# Events ## Worker events List each in `contributes.events` (`{ "on": "" }`), with `main`, the `trusted-worker` profile and the capability shown; then `orca.events.on(event, handler)` in `activate(orca)` returns `{ dispose() }`. Payloads: - `workspace.created` (capability `workspace:read`; since 1.4.245): A worktree workspace was created. `{ workspaceId: string; kind: "worktree" | "folder"; path: string; branch: string }` - `workspace.removed` (capability `workspace:read`; since 1.4.245): A worktree workspace was removed. `{ workspaceId: string; kind: "worktree" | "folder"; path: string }` - `agent.status.changed` (capability `agent:read`; since 1.4.160): An agent in a terminal pane changed status; `workspaceId` is null when Orca cannot tie the pane to a workspace, and `terminalId` names its terminal when Orca lists it. `{ workspaceId: string | null; paneKey: string; terminalId?: string; title?: string; state: "working" | "blocked" | "waiting" | "done"; receivedAt: number; mainAgent?: { state: "working" | "blocked" | "waiting" | "done"; outcome?: "success" | "failure" | "cancellation" | "superseded" | "interruption" | "unconfirmed"; stateStartedAt: number } }` - `workspace.changed` (capability `workspace:read`; since 1.4.246): The focused workspace changed, or its terminals were opened, closed or renamed; `context` is what `workspace.readContext` now answers. Each new subscriber first gets the current context. `{ context: { branch: string; displayName: string; terminals: { id: string; title?: string }[] } | null }` - `editor.typography.changed` (no capability; since 1.4.256): What Orca's file editor uses changed (a setting or the editor zoom); the payload is what `editor.readTypography` now answers. Needs no capability. `{ fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" | "off"; minimap: boolean }` ## Frame events (`orca.on(event, handler)` in HTML panels and custom editors) - `theme: FrameTheme`: The `--orca-*` variables and the `light`/`dark` class on `` already changed. - `'editor.document': EditorDocument`: Custom editors: a new document; `orca.document.onDidChange` is the usual way to listen. - `'editor.flush': undefined`: Custom editors: post pending edits before a save; Orca waits for a returned promise. ## Components panel events (`on(event, handler)` from `orca`) - `theme: { colorScheme: 'light' | 'dark' }` - Every worker event above, with the same payload and capability; a panel needs no `contributes.events` entry, it subscribes while it is open. HTML panels get them on `orca.on` too.