Files
orca/src/shared/electron-remote-runtime-client-capabilities.ts
T
Neil 88de2dbacb fix(web): the browser client advertises the desktop's chat capabilities, so its host opens chats (#32253)
* fix(web): the browser client advertises the desktop's chat capabilities, so its host opens chats

The browser client's handshake never named agent-session.structured.v1, so a paired
host refused every agentSession call with structured_agent_session_unsupported and
withheld chat tabs. The desktop window, the Electron remote handshake and the browser
client now build their lists from one shared array of what the renderer's chat implements.

Fixes #32145

* refactor(web): keep the browser client's capability list beside the desktop's in shared

The host-side test parses both handshakes with the host's own parser, which the node
typecheck project can only import from src/shared.

* test(web): assert close-intent support in the auth frame, not the whole capability list
2026-10-23 02:44:40 -07:00

31 lines
1.7 KiB
TypeScript

import { STRUCTURED_AGENT_SESSION_RENDERER_CLIENT_CAPABILITIES } from './structured-agent-session-renderer-client-capabilities'
import { TERMINAL_IMAGE_VIEWER_CAPABILITY } from './terminal-image-viewer-capability'
import {
AGENT_STATUS_RESTORED_UNCONFIRMED_RUNTIME_CAPABILITY,
BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY,
BROWSER_CLIENT_PAGE_METADATA_RUNTIME_CAPABILITY,
NATIVE_REMOTE_RUNTIME_CLIENT_CAPABILITIES,
SESSION_TABS_RETIREMENT_PROOF_DELTA_RUNTIME_CAPABILITY,
SESSION_TABS_TAB_DELTA_RUNTIME_CAPABILITY,
WORKTREE_BACKGROUND_REMOVAL_RUNTIME_CAPABILITY
} from './protocol-version'
// Electron clients can decode client-hosted page placement; becoming a page
// host still requires the separate authenticated browser-client lease.
export const ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES = [
...NATIVE_REMOTE_RUNTIME_CLIENT_CAPABILITIES,
TERMINAL_IMAGE_VIEWER_CAPABILITY,
// The renderer that reads a paired host's structured chats is the one that reads its own.
...STRUCTURED_AGENT_SESSION_RENDERER_CLIENT_CAPABILITIES,
BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY,
BROWSER_CLIENT_PAGE_METADATA_RUNTIME_CAPABILITY,
// Why: only the renderer runs the retirement-proof ledger; CLI and mobile must keep full lists.
SESSION_TABS_RETIREMENT_PROOF_DELTA_RUNTIME_CAPABILITY,
// Main restores every tab-delta frame before the window or any other reader sees it.
SESSION_TABS_TAB_DELTA_RUNTIME_CAPABILITY,
// Only the renderer shows Deleting for a `removing` row; CLI and mobile get those rows omitted.
WORKTREE_BACKGROUND_REMOVAL_RUNTIME_CAPABILITY,
// The renderer shows a restored, unconfirmed agent row as identity only.
AGENT_STATUS_RESTORED_UNCONFIRMED_RUNTIME_CAPABILITY
] as const