Skip to content

Type Alias: PageEvent

PageEvent = { kind: "selectionPresent"; present: boolean; tab: number; } | { kind: "interaction"; tab: number; } | { key: string; kind: "keyForward"; phase: "down" | "up"; repeat: boolean; tab: number; } | { from: string; kind: "navigation"; navKind?: "push" | "replace" | "traverse" | "reload" | "hash"; tab: number; tabRecord?: PageTabRecord; to: string; } | { kind: "aiuiSupport"; supported: boolean; tab: number; } | { components?: unknown[]; kind: "regionDrag"; rect: { h: number; w: number; x: number; y: number; }; tab: number; takenAt: number; viewport: { h: number; w: number; }; } | { kind: "jumpDone"; tab: number; } | { kind: "pageTools"; registrations: object[]; tab: number; } | { kind: "tabClosed"; tab: number; } | { callId: string; error?: string; kind: "toolsResult"; ok: boolean; tab: number; value?: unknown; }

Defined in: aiui-intent-client/src/transport.ts:195

Events pages push at the panel (the inbound half of the relay).

Union Members

Type Literal

{ kind: "selectionPresent"; present: boolean; tab: number; }


Type Literal

{ kind: "interaction"; tab: number; }


Type Literal

{ key: string; kind: "keyForward"; phase: "down" | "up"; repeat: boolean; tab: number; }


Type Literal

{ from: string; kind: "navigation"; navKind?: "push" | "replace" | "traverse" | "reload" | "hash"; tab: number; tabRecord?: PageTabRecord; to: string; }

A same-tab navigation (SPA route, reload, hash) — context riding the turn, rendered into the prompt by the wire engine. tabRecord is the DESTINATION's canonical record (pageTabRecord), when the reporter could build one.


Type Literal

{ kind: "aiuiSupport"; supported: boolean; tab: number; }

The page announced whether it is aiui-INSTRUMENTED (window.AIUI): instrumented pages can host jump-to-editor.


Type Literal

{ components?: unknown[]; kind: "regionDrag"; rect: { h: number; w: number; x: number; y: number; }; tab: number; takenAt: number; viewport: { h: number; w: number; }; }

The user completed a region drag (the armed a gesture): the rect in CSS px (viewport coords), the viewport for crop scaling, the gesture's wall-clock, and — on aiui-instrumented pages — the located components (data-source-loc stamps) the drag framed.


Type Literal

{ kind: "jumpDone"; tab: number; }

The user finished a jump pick — committed a row (VS Code opens) or cancelled (Esc / click-away). The page's completion signal that auto-exits jump mode (owner, 2026-07-16); carries no payload beyond the tab.


Type Literal

{ kind: "pageTools"; registrations: object[]; tab: number; }

The page's __AIUI__.tools registry changed: its FULL current tool set, descriptors only (names/descriptions/schemas — never functions). An empty registrations means the page has no tools (the link closes its socket).


Type Literal

{ kind: "tabClosed"; tab: number; }

The tab is GONE (window closed, target detached). Distinct from an empty pageTools set — nothing will ever report from this tab again, so holders of per-tab state (the tools link's socket, the panel's descriptor registry) must drop it. Without this, a closed tab's tools socket stayed open and the channel's directory advertised its namespaces forever (the duplicate-tools leak, found live 2026-08-03).


Type Literal

{ callId: string; error?: string; kind: "toolsResult"; ok: boolean; tab: number; value?: unknown; }

A toolsCall's answer, correlated by callId.