mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
A panel that loaded before Orca focused a workspace showed nothing until the next change, and a
subscription made before the panel's push channel opened was never told at all. Now each new
subscriber gets the current context first: the panel bridge replays it once the channel is
open (or right away), and a worker's events.on('workspace.changed') reads it through
workspace.readContext. Unit tests for both, and the agents e2e checks the first event arrives
with no change happening.
2.3 KiB
2.3 KiB
Events
Worker events
List each in contributes.events ({ "on": "<event>" }), with main, the trusted-worker profile and the capability shown; then orca.events.on(event, handler) in activate(orca) returns { dispose() }. Payloads:
workspace.created(capabilityworkspace:read; since 1.4.245): A worktree workspace was created.{ workspaceId: string; kind: "worktree" | "folder"; path: string; branch: string }workspace.removed(capabilityworkspace:read; since 1.4.245): A worktree workspace was removed.{ workspaceId: string; kind: "worktree" | "folder"; path: string }agent.status.changed(capabilityagent:read; since 1.4.160): An agent in a terminal pane changed status;workspaceIdis null when Orca cannot tie the pane to a workspace, andterminalIdnames 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(capabilityworkspace:read; since 1.4.246): The focused workspace changed, or its terminals were opened, closed or renamed;contextis whatworkspace.readContextnow answers. Each new subscriber first gets the current context.{ context: { branch: string; displayName: string; terminals: { id: string; title?: string }[] } | null }
Frame events (orca.on(event, handler) in HTML panels and custom editors)
theme: FrameTheme: The--orca-*variables and thelight/darkclass on<html>already changed.'editor.document': EditorDocument: Custom editors: a new document;orca.document.onDidChangeis 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.eventsentry, it subscribes while it is open. HTML panels get them onorca.ontoo.