Interface: MenuContext
Defined in: packages/sdk/src/types.ts:447
The typed context object each MenuSurface passes to an invoked command (as its first argument) and to the contribution's when / checked predicates. The contract is per-surface and closed: a flat, serializable object — never a DOM event or host component internals.
The "workspace" surface is unique in passing the full Workspace rather than a lightweight derived object — workspace actions typically need the workspace's metadata (id, folder, name) wholesale.
Properties
explorer/item
explorer/item: object;Defined in: packages/sdk/src/types.ts:448
path
path: string;isDir
isDir: boolean;workspaceId
workspaceId: string;editor/tab
editor/tab: object;Defined in: packages/sdk/src/types.ts:449
editorId
editorId: string;filePath
filePath: string | null;viewId
viewId: string;terminal/tab
terminal/tab: object;Defined in: packages/sdk/src/types.ts:450
terminalId
terminalId: string;workspaceId
workspaceId: string;terminal/link
terminal/link: object;Defined in: packages/sdk/src/types.ts:458
The right-clicked link's kind ("url" for OSC-8/WebLinksAddon-detected links, "path" for Silo's own file-path provider) and its literal text (the URL or path string), alongside which terminal it was found in. See ADR 0027 for the shared link contract this surface hooks into.
terminalId
terminalId: string;kind
kind: "url" | "path";text
text: string;panel/tab
panel/tab: object;Defined in: packages/sdk/src/types.ts:472
A dock panel's tab, of any DockPanelKind — the bundled Chat transcript, a web viewer, your own panel. Field-for-field the same shape as a panel toolbar item's target (ToolbarItemContext["panel"]), because both describe the same thing.
There is no per-kind surface: an item registered here appears on every panel tab unless it scopes itself, exactly as a surface: "panel" toolbar item does — when: (_keys, t) => t.kindId === "silo.agents-chat-panel". Instance state arrives as the panel's params.
params is a copy taken when the menu opened; mutating it changes nothing.
panelId
panelId: string;kindId
kindId: string;workspaceId
workspaceId: string;params
params: Readonly<Record<string, unknown>>;workspace
workspace: Workspace;Defined in: packages/sdk/src/types.ts:478