feat(plugins): add workspace.rename and project names in workspace.list

Plugins that name workspaces had to read Orca's private runtime token and call
worktree.set over the runtime socket, bypassing capability consent. workspace.rename
(workspace:write, worker only, host API 1.5) does the same update as a sidebar
rename. workspace.list rows gain the project name so plugins can prefix names
without reading the runtime's repo list.
This commit is contained in:
Neil
2026-11-08 23:13:04 -08:00
parent 46451538e4
commit 436cbc6199
9 changed files with 223 additions and 29 deletions
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -1,5 +1,5 @@
// Generated by `pnpm generate:plugin-author-typings` from src/shared/plugins. Do not edit.
// Host API 1.4 types shared by frames (`window.orca`) and workers (`activate(orca)`).
// Host API 1.5 types shared by frames (`window.orca`) and workers (`activate(orca)`).
declare module 'orca/host' {
// Why from 'orca': authors declare `PluginRequests` and `PluginPanelEvents` there once, and
@@ -163,7 +163,7 @@ declare module 'orca/host' {
/** Lists every workspace, Git worktrees and folders, on every host Orca reaches. Since host API 1.3. */
"workspace.list": {
params: Record<string, never> | undefined
result: { workspaces: { id: string; kind: "worktree" | "folder"; name: string; path: string; branch: string | null; hostId: string | null }[]; truncated: boolean }
result: { workspaces: { id: string; kind: "worktree" | "folder"; name: string; project: string | null; path: string; branch: string | null; hostId: string | null }[]; truncated: boolean }
surfaces: "worker"
}
/** Shows a workspace in Orca, as clicking it in the sidebar does; a folder workspace needs the desktop app. Since host API 1.3. */
@@ -172,6 +172,12 @@ declare module 'orca/host' {
result: { opened: true }
surfaces: "worker"
}
/** Renames a workspace in Orca's sidebar, as renaming it by hand does; the name stays until it is renamed again. Since host API 1.5. */
"workspace.rename": {
params: { workspaceId: string; name: string }
result: { name: string }
surfaces: "worker"
}
/** Opens a terminal in a workspace, optionally running a command, in the background. Since host API 1.3. */
"terminal.create": {
params: { workspaceId: string; title?: string; command?: string }