zidane 7.2.5 → 8.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -6
- package/dist/{acp-D-tVyUjw.js → acp-DQDhi2dj.js} +230 -77
- package/dist/acp-DQDhi2dj.js.map +1 -0
- package/dist/acp-cli.d.ts +1 -1
- package/dist/acp-cli.js +9 -66
- package/dist/acp-cli.js.map +1 -1
- package/dist/acp.d.ts +10 -590
- package/dist/acp.d.ts.map +1 -1
- package/dist/acp.js +3 -3
- package/dist/{agent-D0zZnGbt.js → agent-DSLNmBp0.js} +14401 -13214
- package/dist/agent-DSLNmBp0.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -2
- package/dist/aliasing-lVFbm81n.js +217 -0
- package/dist/aliasing-lVFbm81n.js.map +1 -0
- package/dist/{anthropic-C2aole0G.js → anthropic-CD00LhUP.js} +1442 -1264
- package/dist/anthropic-CD00LhUP.js.map +1 -0
- package/dist/artifacts-CV2hUKnL.js.map +1 -1
- package/dist/{atomic-write-B7zr1ddF.js → atomic-write-Ijgf2Mhc.js} +13 -3
- package/dist/atomic-write-Ijgf2Mhc.js.map +1 -0
- package/dist/call-tool-dHlbGOIY.js +70 -0
- package/dist/call-tool-dHlbGOIY.js.map +1 -0
- package/dist/chat/pure.d.ts +372 -6
- package/dist/chat/pure.d.ts.map +1 -1
- package/dist/chat/pure.js +35 -244
- package/dist/chat/pure.js.map +1 -1
- package/dist/{approvals-DKaJZYlm.js → chat-JPJJ8uu5.js} +15879 -14631
- package/dist/chat-JPJJ8uu5.js.map +1 -0
- package/dist/chat.d.ts +4 -6
- package/dist/chat.js +23 -12
- package/dist/cli-shared-C-YCaglL.js +159 -0
- package/dist/cli-shared-C-YCaglL.js.map +1 -0
- package/dist/client-core-BQSyDALT.d.ts +2115 -0
- package/dist/client-core-BQSyDALT.d.ts.map +1 -0
- package/dist/codemode-worker.d.ts +1 -0
- package/dist/codemode-worker.js +155 -0
- package/dist/codemode-worker.js.map +1 -0
- package/dist/codemode.d.ts +352 -0
- package/dist/codemode.d.ts.map +1 -0
- package/dist/codemode.js +5 -0
- package/dist/connection-Dr-Js4yZ.d.ts +28 -0
- package/dist/connection-Dr-Js4yZ.d.ts.map +1 -0
- package/dist/connection-loop-gdh22LTI.js +112 -0
- package/dist/connection-loop-gdh22LTI.js.map +1 -0
- package/dist/context-segments-BHKlagL6.js +1016 -0
- package/dist/context-segments-BHKlagL6.js.map +1 -0
- package/dist/{context-transport-T_6AYIvy.js → context-transport-DSMTUsK1.js} +3 -3
- package/dist/{context-transport-T_6AYIvy.js.map → context-transport-DSMTUsK1.js.map} +1 -1
- package/dist/contexts/daytona.d.ts +19 -8
- package/dist/contexts/daytona.d.ts.map +1 -1
- package/dist/contexts/daytona.js +1 -440
- package/dist/contexts/docker.d.ts +36 -7
- package/dist/contexts/docker.d.ts.map +1 -1
- package/dist/contexts/docker.js +1 -456
- package/dist/contexts/e2b.d.ts +68 -13
- package/dist/contexts/e2b.d.ts.map +1 -1
- package/dist/contexts/e2b.js +1 -382
- package/dist/contexts/sandbox.d.ts +1 -1
- package/dist/contexts/sandbox.js +5 -0
- package/dist/contexts/sandbox.js.map +1 -1
- package/dist/{contexts-CRE9pw07.js → contexts-d7UolYot.js} +1059 -524
- package/dist/contexts-d7UolYot.js.map +1 -0
- package/dist/contexts.d.ts +3 -3
- package/dist/contexts.js +1 -1
- package/dist/cred-keys-GpBg71cP.js +105 -0
- package/dist/cred-keys-GpBg71cP.js.map +1 -0
- package/dist/{auth-BG2rVKSt.js → credentials-JttEuRON.js} +55 -206
- package/dist/credentials-JttEuRON.js.map +1 -0
- package/dist/{cursor-iojRXHF9.js → cursor-CdjaQTBW.js} +3 -3
- package/dist/{cursor-iojRXHF9.js.map → cursor-CdjaQTBW.js.map} +1 -1
- package/dist/daemon-cli.d.ts +1 -1
- package/dist/daemon-cli.js +3 -2
- package/dist/daemon-cli.js.map +1 -1
- package/dist/daytona-DG3omipZ.js +513 -0
- package/dist/daytona-DG3omipZ.js.map +1 -0
- package/dist/defaults-Cx3zvDOV.js +23 -0
- package/dist/defaults-Cx3zvDOV.js.map +1 -0
- package/dist/dispatcher-BMlu2BmZ.js +4941 -0
- package/dist/dispatcher-BMlu2BmZ.js.map +1 -0
- package/dist/docker-BZhMMJUp.js +727 -0
- package/dist/docker-BZhMMJUp.js.map +1 -0
- package/dist/e2b-CEVOdRib.js +480 -0
- package/dist/e2b-CEVOdRib.js.map +1 -0
- package/dist/edit-utils-EGosADZq.js +234 -0
- package/dist/edit-utils-EGosADZq.js.map +1 -0
- package/dist/environment-8wsKE2Ln.js +214 -0
- package/dist/environment-8wsKE2Ln.js.map +1 -0
- package/dist/eval-BNcvle_J.js +1595 -0
- package/dist/eval-BNcvle_J.js.map +1 -0
- package/dist/eval.d.ts +2 -2
- package/dist/eval.js +1 -1489
- package/dist/executor-Cx5-8yqi.js +621 -0
- package/dist/executor-Cx5-8yqi.js.map +1 -0
- package/dist/extension-authoring-DyGGmq9V.js +385 -0
- package/dist/extension-authoring-DyGGmq9V.js.map +1 -0
- package/dist/extensions.d.ts +2 -2
- package/dist/extensions.js +3 -3
- package/dist/{fetch-url-DX75gpL0.js → fetch-url-Ct2TjDWt.js} +4 -4
- package/dist/{fetch-url-DX75gpL0.js.map → fetch-url-Ct2TjDWt.js.map} +1 -1
- package/dist/{format-BF745pLL.js → format-C2NQEVUH.js} +39 -2
- package/dist/format-C2NQEVUH.js.map +1 -0
- package/dist/format-bytes-C7tfc3Zm.js +55 -0
- package/dist/format-bytes-C7tfc3Zm.js.map +1 -0
- package/dist/headless-C_rNUuYC.js +960 -0
- package/dist/headless-C_rNUuYC.js.map +1 -0
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -413
- package/dist/{history-search-C4bk1Wz_.js → history-search-CcYzF8-0.js} +7 -3
- package/dist/history-search-CcYzF8-0.js.map +1 -0
- package/dist/history-search-worker.d.ts +1 -1
- package/dist/history-search-worker.js +1 -1
- package/dist/host-D7NrI03V.js +378 -0
- package/dist/host-D7NrI03V.js.map +1 -0
- package/dist/host-signals-BcP5QKUD.js +118 -0
- package/dist/host-signals-BcP5QKUD.js.map +1 -0
- package/dist/identity-CwfO8K-t.js +26 -0
- package/dist/identity-CwfO8K-t.js.map +1 -0
- package/dist/{index-BgN1T3lk.d.ts → index-BGe1fQT7.d.ts} +10987 -9320
- package/dist/index-BGe1fQT7.d.ts.map +1 -0
- package/dist/index-BVQsIKGn.d.ts +448 -0
- package/dist/index-BVQsIKGn.d.ts.map +1 -0
- package/dist/{index-C6NEd5y_.d.ts → index-CHABJd-L.d.ts} +3386 -502
- package/dist/index-CHABJd-L.d.ts.map +1 -0
- package/dist/{index-C37_ppWv.d.ts → index-D6a7qXpg.d.ts} +2 -3
- package/dist/index-D6a7qXpg.d.ts.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +27 -23
- package/dist/{completion-core-BRo86R_L.js → inline-ghost-BVRQeGoL.js} +50 -2
- package/dist/inline-ghost-BVRQeGoL.js.map +1 -0
- package/dist/ipc/remote.d.ts +313 -0
- package/dist/ipc/remote.d.ts.map +1 -0
- package/dist/ipc/remote.js +4 -0
- package/dist/ipc.d.ts +6 -964
- package/dist/ipc.js +403 -4
- package/dist/ipc.js.map +1 -0
- package/dist/{isolation-Kfoof0MM.d.ts → isolation-D9L650W5.d.ts} +100 -15
- package/dist/isolation-D9L650W5.d.ts.map +1 -0
- package/dist/json-rpc--HXQti1E.js +350 -0
- package/dist/json-rpc--HXQti1E.js.map +1 -0
- package/dist/links-j8rED1sR.js +603 -0
- package/dist/links-j8rED1sR.js.map +1 -0
- package/dist/local-terminal-D8QThwo_.js +252 -0
- package/dist/local-terminal-D8QThwo_.js.map +1 -0
- package/dist/{logger--C1VQjwJ.js → logger-Gtqlayx8.js} +199 -173
- package/dist/logger-Gtqlayx8.js.map +1 -0
- package/dist/logs-view-CWG8aUAG.js.map +1 -1
- package/dist/{mcp-CgNd-f3F.js → mcp-_wecH9Qe.js} +608 -562
- package/dist/mcp-_wecH9Qe.js.map +1 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +2 -2
- package/dist/media-sniff-UKijEaiQ.js.map +1 -1
- package/dist/{messages-2jcOA_5R.js → messages-BqiwcD2Q.js} +1017 -1014
- package/dist/messages-BqiwcD2Q.js.map +1 -0
- package/dist/{oauth-DxHO17JE.js → oauth-Px_pBB9W.js} +5 -5
- package/dist/{oauth-DxHO17JE.js.map → oauth-Px_pBB9W.js.map} +1 -1
- package/dist/{openai-compat-Dy56weK8.js → openai-compat-CFrpH7uq.js} +432 -589
- package/dist/openai-compat-CFrpH7uq.js.map +1 -0
- package/dist/orchestration-BCGmB8Ps.js +511 -0
- package/dist/orchestration-BCGmB8Ps.js.map +1 -0
- package/dist/output/stream-json.d.ts +1 -2
- package/dist/output/stream-json.d.ts.map +1 -1
- package/dist/output/stream-json.js +1 -1
- package/dist/output/terminal.d.ts +1 -2
- package/dist/output/terminal.d.ts.map +1 -1
- package/dist/output/terminal.js +13 -7
- package/dist/output/terminal.js.map +1 -1
- package/dist/{plugins-gbI7SBA6.js → plugins-DS7mahzZ.js} +20 -101
- package/dist/plugins-DS7mahzZ.js.map +1 -0
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -2
- package/dist/prelude-Cxo4t74B.js +517 -0
- package/dist/prelude-Cxo4t74B.js.map +1 -0
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -2
- package/dist/project-root-B8zADr4o.js +167 -0
- package/dist/project-root-B8zADr4o.js.map +1 -0
- package/dist/project-user-paths-BSgtrRxl.js +58 -0
- package/dist/project-user-paths-BSgtrRxl.js.map +1 -0
- package/dist/{prompts-Pqc3JdW_.d.ts → prompts-DYcvqShf.d.ts} +14 -11
- package/dist/prompts-DYcvqShf.d.ts.map +1 -0
- package/dist/protocol-DnhqqSmE.js +13 -0
- package/dist/protocol-DnhqqSmE.js.map +1 -0
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +1 -2
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/arcee.js +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/baseten.js +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/cerebras.js +3 -2
- package/dist/providers/cerebras.js.map +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/local.js +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai-compat.js +1 -2
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.js +15 -12
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/openrouter.js +3 -2
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +3 -3
- package/dist/{providers-BVhnFyiY.js → providers-XUR7F4Hi.js} +4 -4
- package/dist/{providers-BVhnFyiY.js.map → providers-XUR7F4Hi.js.map} +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +4 -4
- package/dist/registry-D6ShBWJU.js +5234 -0
- package/dist/registry-D6ShBWJU.js.map +1 -0
- package/dist/remote-hosts-BtA_9ZGp.js +97 -0
- package/dist/remote-hosts-BtA_9ZGp.js.map +1 -0
- package/dist/restate.d.ts +2 -3
- package/dist/restate.d.ts.map +1 -1
- package/dist/restate.js +631 -572
- package/dist/restate.js.map +1 -1
- package/dist/run-summary-CklLiZ4y.js +288 -0
- package/dist/run-summary-CklLiZ4y.js.map +1 -0
- package/dist/{sandbox-BH0WQkXn.d.ts → sandbox-C5dR5DwQ.d.ts} +6 -3
- package/dist/sandbox-C5dR5DwQ.d.ts.map +1 -0
- package/dist/session/sqlite.d.ts +1 -2
- package/dist/session/sqlite.d.ts.map +1 -1
- package/dist/session/sqlite.js +1 -616
- package/dist/session-factory-BUGY5P40.js +1576 -0
- package/dist/session-factory-BUGY5P40.js.map +1 -0
- package/dist/{session-BqRP1hS7.js → session-xh9JXu6i.js} +94 -52
- package/dist/session-xh9JXu6i.js.map +1 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +2 -2
- package/dist/settings-keys-Ckf29NeM.js +677 -0
- package/dist/settings-keys-Ckf29NeM.js.map +1 -0
- package/dist/shell-path-Dqaoow2J.js +412 -0
- package/dist/shell-path-Dqaoow2J.js.map +1 -0
- package/dist/{skills-BC3dodWp.js → skills-DKqZJm4X.js} +430 -470
- package/dist/skills-DKqZJm4X.js.map +1 -0
- package/dist/skills.d.ts +2 -2
- package/dist/skills.js +1 -2
- package/dist/source-mPExaUm8.js +381 -0
- package/dist/source-mPExaUm8.js.map +1 -0
- package/dist/sqlite-DV1DQzN2.js +698 -0
- package/dist/sqlite-DV1DQzN2.js.map +1 -0
- package/dist/{src-CkNQKFKr.js → src-BRMYRJib.js} +903 -1121
- package/dist/src-BRMYRJib.js.map +1 -0
- package/dist/{stdio-DPpBDPx5.js → stdio-C6YyoW3I.js} +4 -4
- package/dist/{stdio-DPpBDPx5.js.map → stdio-C6YyoW3I.js.map} +1 -1
- package/dist/{stdio-loader-Bbx19dMZ.js → stdio-loader-C830Vg-Z.js} +4 -4
- package/dist/{stdio-loader-Bbx19dMZ.js.map → stdio-loader-C830Vg-Z.js.map} +1 -1
- package/dist/system-prompt-MNVHatSD.d.ts.map +1 -1
- package/dist/timeout-DEaqslLO.d.ts.map +1 -1
- package/dist/todo-edits-Dn251YUP.js +1790 -0
- package/dist/todo-edits-Dn251YUP.js.map +1 -0
- package/dist/{turn-operations-DrbJlpq9.js → tool-formatters-IQFDrdrs.js} +1456 -2120
- package/dist/tool-formatters-IQFDrdrs.js.map +1 -0
- package/dist/tool-state-Dku6YqAB.js +989 -0
- package/dist/tool-state-Dku6YqAB.js.map +1 -0
- package/dist/tools/fetch-url.d.ts +1 -2
- package/dist/tools/fetch-url.d.ts.map +1 -1
- package/dist/tools/fetch-url.js +1 -2
- package/dist/tools/prompts.d.ts +1 -1
- package/dist/tools/prompts.js +7 -7
- package/dist/tools/prompts.js.map +1 -1
- package/dist/tools/web-search.d.ts +1 -2
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +2 -2
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools-_DnT3AGM.js +578 -0
- package/dist/tools-_DnT3AGM.js.map +1 -0
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +4 -2
- package/dist/tui.d.ts +534 -517
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +34933 -27243
- package/dist/tui.js.map +1 -1
- package/dist/turn-operations-B8sokwi5.js +333 -0
- package/dist/turn-operations-B8sokwi5.js.map +1 -0
- package/dist/turn-operations-DQX5ZZni.d.ts +3089 -0
- package/dist/turn-operations-DQX5ZZni.d.ts.map +1 -0
- package/dist/types-C7ZFOztE.d.ts +132 -0
- package/dist/types-C7ZFOztE.d.ts.map +1 -0
- package/dist/types-CH5XpIHw.js +114 -0
- package/dist/types-CH5XpIHw.js.map +1 -0
- package/dist/{types-CWgENVLY.js → types-Cu0ZGDu9.js} +10 -6
- package/dist/types-Cu0ZGDu9.js.map +1 -0
- package/dist/types-IqegbJEE.d.ts +624 -0
- package/dist/types-IqegbJEE.d.ts.map +1 -0
- package/dist/types.d.ts +4 -4
- package/dist/types.js +1 -1
- package/dist/url-D8HCl65b.js +1259 -0
- package/dist/url-D8HCl65b.js.map +1 -0
- package/dist/wasm-BVT-j5cl.js +33 -0
- package/dist/wasm-BVT-j5cl.js.map +1 -0
- package/dist/workspace-exec-stream-SV2R9d5S.js +355 -0
- package/dist/workspace-exec-stream-SV2R9d5S.js.map +1 -0
- package/dist/ws-CIHMvlSh.js +952 -0
- package/dist/ws-CIHMvlSh.js.map +1 -0
- package/dist/ws-client-N7NxzvQp.js +230 -0
- package/dist/ws-client-N7NxzvQp.js.map +1 -0
- package/dist/{xai-CazjStOK.js → xai-CvJTeLrI.js} +165 -5
- package/dist/xai-CvJTeLrI.js.map +1 -0
- package/dist/xdg-zweed0-t.js +117 -0
- package/dist/xdg-zweed0-t.js.map +1 -0
- package/docs/ACP.md +52 -0
- package/docs/ARCHITECTURE.md +103 -6
- package/docs/ARTIFACTS.md +8 -4
- package/docs/CHAT.md +165 -14
- package/docs/EXECUTION_CONTEXT.md +8 -0
- package/docs/EXTENSIONS.md +123 -2
- package/docs/HEADLESS.md +2 -0
- package/docs/IPC.md +775 -64
- package/docs/MACHINES.md +456 -0
- package/docs/PANELS.md +3 -0
- package/docs/README.md +4 -0
- package/docs/RESTATE.md +3 -2
- package/docs/RUN_IN_BACKGROUND.md +10 -2
- package/docs/SERVER.md +1085 -0
- package/docs/SKILL.md +6 -1
- package/docs/TERMINAL.md +75 -0
- package/docs/TUI.md +65 -14
- package/package.json +58 -26
- package/scripts/eval.ts +4 -0
- package/dist/acp-D-tVyUjw.js.map +0 -1
- package/dist/agent-D0zZnGbt.js.map +0 -1
- package/dist/anthropic-C2aole0G.js.map +0 -1
- package/dist/approvals-DKaJZYlm.js.map +0 -1
- package/dist/atomic-write-B7zr1ddF.js.map +0 -1
- package/dist/auth-BG2rVKSt.js.map +0 -1
- package/dist/completion-core-BRo86R_L.js.map +0 -1
- package/dist/contexts/daytona.js.map +0 -1
- package/dist/contexts/docker.js.map +0 -1
- package/dist/contexts/e2b.js.map +0 -1
- package/dist/contexts-CRE9pw07.js.map +0 -1
- package/dist/eval.js.map +0 -1
- package/dist/format-BF745pLL.js.map +0 -1
- package/dist/glob-DluQFSw1.js +0 -270
- package/dist/glob-DluQFSw1.js.map +0 -1
- package/dist/headless.js.map +0 -1
- package/dist/history-search-C4bk1Wz_.js.map +0 -1
- package/dist/index-BgN1T3lk.d.ts.map +0 -1
- package/dist/index-C37_ppWv.d.ts.map +0 -1
- package/dist/index-C6NEd5y_.d.ts.map +0 -1
- package/dist/ipc-BKVIIOqH.js +0 -331
- package/dist/ipc-BKVIIOqH.js.map +0 -1
- package/dist/ipc.d.ts.map +0 -1
- package/dist/isolation-Kfoof0MM.d.ts.map +0 -1
- package/dist/json-rpc-rSWMUh9b.js +0 -192
- package/dist/json-rpc-rSWMUh9b.js.map +0 -1
- package/dist/logger--C1VQjwJ.js.map +0 -1
- package/dist/mcp-CgNd-f3F.js.map +0 -1
- package/dist/messages-2jcOA_5R.js.map +0 -1
- package/dist/openai-compat-Dy56weK8.js.map +0 -1
- package/dist/output-cap-C9zukcCj.js +0 -100
- package/dist/output-cap-C9zukcCj.js.map +0 -1
- package/dist/panels-B6gRk4bf.js +0 -789
- package/dist/panels-B6gRk4bf.js.map +0 -1
- package/dist/plugins-gbI7SBA6.js.map +0 -1
- package/dist/prompts-Pqc3JdW_.d.ts.map +0 -1
- package/dist/run-summary-BU_NgwUT.js +0 -269
- package/dist/run-summary-BU_NgwUT.js.map +0 -1
- package/dist/sandbox-BH0WQkXn.d.ts.map +0 -1
- package/dist/session/sqlite.js.map +0 -1
- package/dist/session-BqRP1hS7.js.map +0 -1
- package/dist/shell-path-DfdXrGg9.js +0 -1549
- package/dist/shell-path-DfdXrGg9.js.map +0 -1
- package/dist/skills-BC3dodWp.js.map +0 -1
- package/dist/src-CkNQKFKr.js.map +0 -1
- package/dist/todo-edits-UOwgxGKu.js +0 -528
- package/dist/todo-edits-UOwgxGKu.js.map +0 -1
- package/dist/tool-formatters-DoRLnfuD.d.ts +0 -759
- package/dist/tool-formatters-DoRLnfuD.d.ts.map +0 -1
- package/dist/transcript-anchors-BeudMbXx.d.ts +0 -1762
- package/dist/transcript-anchors-BeudMbXx.d.ts.map +0 -1
- package/dist/turn-operations-C8bMBDl_.d.ts +0 -1258
- package/dist/turn-operations-C8bMBDl_.d.ts.map +0 -1
- package/dist/turn-operations-DrbJlpq9.js.map +0 -1
- package/dist/types-CWgENVLY.js.map +0 -1
- package/dist/xai-CazjStOK.js.map +0 -1
|
@@ -0,0 +1,2115 @@
|
|
|
1
|
+
import { Eg as ContextBreakdown, Gy as SessionTurn, Jx as SessionArtifact, Kh as ProviderKey, Lp as SessionEnvironmentSummary, Mh as EnvironmentVerifyResult, Qb as SessionData, Qd as CommandOutputBlock, Rp as SessionHeader, Vp as StreamEvent, _f as InteractionResponse, by as JsonValue, eb as ThinkingLevel, eh as EnvironmentDescriptor, gh as EnvironmentActionSummary, hh as EnvironmentActionResult, ih as EnvironmentSettingsChange, jh as EnvironmentTeardownResult, kh as EnvironmentRequest, xy as McpServerConfig, zp as SessionMeta } from "./index-BGe1fQT7.js";
|
|
2
|
+
import { m as ExecResult, v as ListFilesEntry } from "./isolation-D9L650W5.js";
|
|
3
|
+
import { Cn as ContextSegmentsReport, Dn as WorkerRow, En as CreateWorkerParams, On as WorkerSummary, Tn as WorkspaceListFilesOptions, ar as PendingInteraction, bn as CompactionReport, cr as QueuedItem, fr as SessionPresence, hr as WireApprovalRequest, ir as HostSignal, kn as SessionLaunchOverrides, lr as RunningWorkItem, mr as TodosSnapshot, nr as CommandSummary, or as PromptAttachment, rr as HostSettings, tr as CommandArgSuggestionSummary, ur as SendOptions, vr as SystemMdFile } from "./index-CHABJd-L.js";
|
|
4
|
+
import "./types-IqegbJEE.js";
|
|
5
|
+
import { Cn as MachineInfo, Kt as TodoItem, On as MachineRegisterParams, Tn as MachineLinksStatus, fn as TerminalAttachResult, hn as TerminalOpenInput, mn as TerminalInfo, mr as SessionHistoryMatch, nr as BrowserResponse, pr as SearchTurnResult, vn as TerminalSessionState, xi as ApprovalDecision } from "./turn-operations-DQX5ZZni.js";
|
|
6
|
+
import { c as SyncClaimResult, d as SyncPushResult, p as SyncStatus, s as SyncCategory, u as SyncPayload } from "./types-C7ZFOztE.js";
|
|
7
|
+
//#region src/ipc/protocol.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* v6 (changes since v5):
|
|
10
|
+
* - `event` signals carry an optional `echo` flag marking host-generated
|
|
11
|
+
* SEND/STEER echoes of the user's own message.
|
|
12
|
+
* - `chat.pushQueued` result gained the `'queued'` delivered variant.
|
|
13
|
+
* - `sessions.setModel` now honors `fallbacks`: it persists the canonical
|
|
14
|
+
* `metadata.modelChain` and CLEARS a previously persisted chain when
|
|
15
|
+
* omitted/empty. It also accepts `effort` / `modelOptions` and resets
|
|
16
|
+
* both when omitted (a pick is atomic — no stale per-model knobs).
|
|
17
|
+
* - additive: `extension.emit` notification + `extension:signal` fan-out
|
|
18
|
+
* (the permission-gated per-extension cross-window bus, `ctx.bus`).
|
|
19
|
+
* Older daemons ignore the unknown notification; older clients drop the
|
|
20
|
+
* unknown signal kind — no version bump needed.
|
|
21
|
+
* - additive: `extension.emit` / `extension:signal` carry an optional
|
|
22
|
+
* `nonce` (the emitter's per-process random id) so receivers dedupe on
|
|
23
|
+
* `(extensionId, nonce, seq)` instead of the collision-prone
|
|
24
|
+
* `(extensionId, seq)`. Older peers omit it and fall back to the
|
|
25
|
+
* seq-only key — no version bump needed.
|
|
26
|
+
* - `SessionRow.modelFallbacks` is now populated from the session's
|
|
27
|
+
* persisted `metadata.modelChain`.
|
|
28
|
+
* - Default socket path moved from `<stateDir>/daemon.sock` to the
|
|
29
|
+
* dedicated `<stateDir>/daemon/daemon.sock` (dir chmod'd 0700) so the
|
|
30
|
+
* daemon can harden its socket dir without touching shared state files.
|
|
31
|
+
* - ADDITIVE (no version bump — older daemons answer "method not
|
|
32
|
+
* found", clients degrade to local compute): `suggest.resolve` RPC
|
|
33
|
+
* resolves inline ghost-text autocomplete daemon-side, and the
|
|
34
|
+
* `suggest:changed` signal fans the result out to every OTHER peer
|
|
35
|
+
* on the session so mirroring windows paint the same ghost without
|
|
36
|
+
* recomputing.
|
|
37
|
+
* - ADDITIVE (no version bump — optional field, older daemons simply
|
|
38
|
+
* omit it and clients fall back to the single `suggestion`):
|
|
39
|
+
* `suggest.resolve` results and `suggest:changed` signals carry the
|
|
40
|
+
* resolver's full ordered `candidates` list so daemon mode keeps
|
|
41
|
+
* ↑/↓ candidate rotation instead of degrading to one suggestion.
|
|
42
|
+
* - ADDITIVE (no version bump — `optional()` swallows "method not
|
|
43
|
+
* found" on an older daemon, which then simply keeps its stale
|
|
44
|
+
* registries as before): `runtime.reload` RPC drops the daemon's
|
|
45
|
+
* cached extension registries and retires live agents after a window
|
|
46
|
+
* reloaded its extensions.
|
|
47
|
+
* - ADDITIVE (no version bump): `terminal.registerViewer` /
|
|
48
|
+
* `terminal.unregisterViewer`. The desktop app registers as a client that
|
|
49
|
+
* can show terminals; agents only get terminal tools while one is
|
|
50
|
+
* attached. An older daemon answers "method not found" (and keeps giving
|
|
51
|
+
* every agent the tools, as before); an older desktop app on a newer
|
|
52
|
+
* daemon never registers, so its agents run without terminal tools.
|
|
53
|
+
* - ADDITIVE (no version bump): `queue.attachments` returns a queued
|
|
54
|
+
* entry's attachments with their bytes, and `queue.update` accepts
|
|
55
|
+
* `attachments` to replace them. An older daemon answers "method not
|
|
56
|
+
* found" / ignores the field: the entry's attachments stay as queued.
|
|
57
|
+
* - ADDITIVE (no version bump): `chat.steer` / `chat.followUp` resolve to
|
|
58
|
+
* whether the message reached a live run. Older daemons resolve `null`,
|
|
59
|
+
* which clients treat as delivered (the pre-existing behavior).
|
|
60
|
+
* - ADDITIVE (no version bump): `sessions.fork`, `sessions.deleteTurn`,
|
|
61
|
+
* `sessions.editTurnText`, `sessions.setFolder`, `sessions.appendTurns`.
|
|
62
|
+
* History and folder edits run in the host instead of being written to
|
|
63
|
+
* the store by the client (then `sessions.touch` + `chat.rebuildAgent`).
|
|
64
|
+
* Older clients keep the old path, which still works on a shared disk.
|
|
65
|
+
* A newer client only meets an older daemon while it retires (the
|
|
66
|
+
* release fence drains it otherwise), and then gets "method not found".
|
|
67
|
+
* - ADDITIVE (no version bump): `sessions.listMeta`, `sessions.getMeta`,
|
|
68
|
+
* `sessions.get`, `sessions.setExtensionState` serve a client the
|
|
69
|
+
* session data it used to read and write in its own store, so a window
|
|
70
|
+
* on another machine sees the host's sessions. `sessions.create` accepts `id`, `effort`, `modelOptions` and
|
|
71
|
+
* `pinnedSkills`; `todos.set` accepts `persistIdle`. An older host answers
|
|
72
|
+
* "method not found" / ignores the fields: a window falls back to the
|
|
73
|
+
* store it shares with a local daemon, and refuses a remote host.
|
|
74
|
+
*/
|
|
75
|
+
declare const IPC_PROTOCOL_VERSION = 13;
|
|
76
|
+
/**
|
|
77
|
+
* JSON-RPC error codes specific to the zidane daemon. Lives here (not in
|
|
78
|
+
* `daemon/server.ts`) so clients can import the codes without pulling the
|
|
79
|
+
* server's module graph.
|
|
80
|
+
*/
|
|
81
|
+
declare const IpcErrorCode: {
|
|
82
|
+
readonly VersionMismatch: -32010;
|
|
83
|
+
readonly NotHandshaken: -32011;
|
|
84
|
+
/** A network transport's per-connection request budget is spent; retry later. */
|
|
85
|
+
readonly RateLimited: -32012;
|
|
86
|
+
/**
|
|
87
|
+
* The reply would exceed the transport's message size: nothing was sent
|
|
88
|
+
* but this error (the connection stays). Ask for less (a transcript: a
|
|
89
|
+
* smaller page, see {@link loadAllEvents}).
|
|
90
|
+
*/
|
|
91
|
+
readonly ResponseTooLarge: -32013;
|
|
92
|
+
/**
|
|
93
|
+
* The handler threw: the host refused or failed the call (`message` says
|
|
94
|
+
* why). Hosts before it answered -32000, which ACP uses for
|
|
95
|
+
* `AuthenticationRequired`; clients treat both as a plain remote error.
|
|
96
|
+
*/
|
|
97
|
+
readonly HandlerFailed: -32014;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Session-scoped signals fanned out to every peer carry their number in
|
|
101
|
+
* their session as this extra field on the `ipc.signal` params (clients
|
|
102
|
+
* predating it ignore it; `IpcClient` strips it and hands it to listeners as
|
|
103
|
+
* {@link SignalMeta}). Per session, from 1, gap-free within one host process.
|
|
104
|
+
*/
|
|
105
|
+
declare const SIGNAL_SEQ_FIELD = "$seq";
|
|
106
|
+
/** What a signal listener gets beside the signal: its number in its session, when it has one. */
|
|
107
|
+
interface SignalMeta {
|
|
108
|
+
seq: number;
|
|
109
|
+
}
|
|
110
|
+
interface SequencedSignal {
|
|
111
|
+
seq: number;
|
|
112
|
+
signal: HostSignal;
|
|
113
|
+
}
|
|
114
|
+
type SessionResumeResult = {
|
|
115
|
+
ok: true;
|
|
116
|
+
signals: SequencedSignal[];
|
|
117
|
+
} |
|
|
118
|
+
/** `epoch`: another host process numbered them. `gap`: the log no longer covers the position. */
|
|
119
|
+
{
|
|
120
|
+
ok: false;
|
|
121
|
+
reason: 'epoch' | 'gap';
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Typed method map for the daemon transport. Keys are JSON-RPC method
|
|
125
|
+
* names; each entry pins params/result so both the daemon dispatch table
|
|
126
|
+
* and the client proxy are checked against the same contract.
|
|
127
|
+
*
|
|
128
|
+
* Scope: the chat core every client needs. Host-UI-specific surfaces
|
|
129
|
+
* (folder pickers, themes, keybindings) intentionally stay client-local.
|
|
130
|
+
*/
|
|
131
|
+
interface IpcMethods {
|
|
132
|
+
/** `wake` is host-internal (see `SendOptions.wake`) — not accepted over the wire. */
|
|
133
|
+
'chat.send': {
|
|
134
|
+
params: Omit<SendOptions, 'wake'>;
|
|
135
|
+
result: {
|
|
136
|
+
runId: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
'chat.interrupt': {
|
|
140
|
+
params: {
|
|
141
|
+
sessionId: string;
|
|
142
|
+
};
|
|
143
|
+
result: void;
|
|
144
|
+
};
|
|
145
|
+
/** `true` when the message reached a live run; `false` when nothing was running (it was not delivered). */
|
|
146
|
+
'chat.steer': {
|
|
147
|
+
params: {
|
|
148
|
+
sessionId: string;
|
|
149
|
+
message: string;
|
|
150
|
+
};
|
|
151
|
+
result: boolean;
|
|
152
|
+
};
|
|
153
|
+
'chat.followUp': {
|
|
154
|
+
params: {
|
|
155
|
+
sessionId: string;
|
|
156
|
+
message: string;
|
|
157
|
+
};
|
|
158
|
+
result: boolean;
|
|
159
|
+
};
|
|
160
|
+
'chat.pushQueued': {
|
|
161
|
+
params: {
|
|
162
|
+
sessionId: string;
|
|
163
|
+
message: string;
|
|
164
|
+
activatedSkills?: string[];
|
|
165
|
+
keepDraft?: boolean;
|
|
166
|
+
};
|
|
167
|
+
result: {
|
|
168
|
+
delivered: 'steer' | 'send' | 'command' | 'queued';
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
'chat.isRunning': {
|
|
172
|
+
params: {
|
|
173
|
+
sessionId: string;
|
|
174
|
+
};
|
|
175
|
+
result: boolean;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Retire the session's live agent so the next run rebuilds against
|
|
179
|
+
* fresh config/credentials (MCP login, extension reload). Run-end
|
|
180
|
+
* deferred when a run is in flight; HITL/queue state survives.
|
|
181
|
+
*/
|
|
182
|
+
'chat.rebuildAgent': {
|
|
183
|
+
params: {
|
|
184
|
+
sessionId: string;
|
|
185
|
+
};
|
|
186
|
+
result: void;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* `zidane run --system / --mcp` for a host-backed window: launch overrides
|
|
190
|
+
* for the session's agent (`ChatHost.setLaunchOverrides`), owned by the
|
|
191
|
+
* calling client and dropped when it disconnects. A call with neither field clears them.
|
|
192
|
+
*/
|
|
193
|
+
'sessions.setLaunchOverrides': {
|
|
194
|
+
params: {
|
|
195
|
+
sessionId: string;
|
|
196
|
+
} & SessionLaunchOverrides;
|
|
197
|
+
result: void;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Drop the daemon's cached runtime configs (extension registries, per
|
|
201
|
+
* cwd) and retire every live agent so the next command or run rebuilds
|
|
202
|
+
* against what is on disk now. Sent by a window after it reloaded its
|
|
203
|
+
* own extensions (install, update, remove, `/reload`): extension `/`
|
|
204
|
+
* commands execute daemon-side, so without this the daemon keeps
|
|
205
|
+
* running the code it loaded at boot. Busy sessions rebuild at run end.
|
|
206
|
+
*/
|
|
207
|
+
'runtime.reload': {
|
|
208
|
+
params: Record<string, never>;
|
|
209
|
+
result: void;
|
|
210
|
+
};
|
|
211
|
+
'chat.listWork': {
|
|
212
|
+
params: {
|
|
213
|
+
sessionId: string;
|
|
214
|
+
};
|
|
215
|
+
result: RunningWorkItem[];
|
|
216
|
+
};
|
|
217
|
+
'chat.cancelWork': {
|
|
218
|
+
params: {
|
|
219
|
+
sessionId: string;
|
|
220
|
+
id: string | 'all';
|
|
221
|
+
reason?: string;
|
|
222
|
+
};
|
|
223
|
+
result: boolean;
|
|
224
|
+
};
|
|
225
|
+
'sessions.list': {
|
|
226
|
+
params: {
|
|
227
|
+
projectRoot?: string | null;
|
|
228
|
+
archive?: 'active' | 'archived' | 'all';
|
|
229
|
+
};
|
|
230
|
+
result: SessionRow[];
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* The session list as a window renders it (`SessionMeta`: title, turn /
|
|
234
|
+
* message / run counts, project, cwd, environment, artifact count, the
|
|
235
|
+
* orchestration main flag), newest first. `projectRoot`: omitted = every
|
|
236
|
+
* project, `null` = untagged sessions.
|
|
237
|
+
*/
|
|
238
|
+
'sessions.listMeta': {
|
|
239
|
+
params: {
|
|
240
|
+
projectRoot?: string | null;
|
|
241
|
+
};
|
|
242
|
+
result: SessionMeta[];
|
|
243
|
+
};
|
|
244
|
+
/** One `SessionMeta` by id (rows a filtered list can't return, e.g. the main); `null` when unknown. */
|
|
245
|
+
'sessions.getMeta': {
|
|
246
|
+
params: {
|
|
247
|
+
sessionId: string;
|
|
248
|
+
};
|
|
249
|
+
result: SessionMeta | null;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* The whole session document as the host holds it: the live copy when an
|
|
253
|
+
* agent is live (turns persisted mid-run, todos kept in memory), else the
|
|
254
|
+
* stored one, a stale `running` marker demoted. `null` when unknown.
|
|
255
|
+
*/
|
|
256
|
+
'sessions.get': {
|
|
257
|
+
params: {
|
|
258
|
+
sessionId: string;
|
|
259
|
+
turns?: boolean;
|
|
260
|
+
};
|
|
261
|
+
result: SessionDocumentHead | null;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* A slice of a session's turns, `[from, from + limit)` (default from 0,
|
|
265
|
+
* {@link SESSION_TURNS_PAGE} turns, at most {@link SESSION_TURNS_MAX_PAGE}),
|
|
266
|
+
* from the same copy `sessions.get` reads, and how many turns it has: a
|
|
267
|
+
* client reads a long session's document a page at a time
|
|
268
|
+
* ({@link loadSessionDocument}) instead of in one reply. With
|
|
269
|
+
* `sessions.get` `turns: false` (the document without its turns), what an
|
|
270
|
+
* export needs. Pages and that head come from one snapshot of the
|
|
271
|
+
* document per content version (read once, not per page), and name it
|
|
272
|
+
* (`version`): a client that sees it change mid-load starts over rather
|
|
273
|
+
* than mix two versions ({@link loadSessionDocument}). `null` when
|
|
274
|
+
* unknown. Additive: an older host answers "method not found", ignores
|
|
275
|
+
* `turns: false`, and names no version.
|
|
276
|
+
*/
|
|
277
|
+
'sessions.getTurns': {
|
|
278
|
+
params: {
|
|
279
|
+
sessionId: string;
|
|
280
|
+
from?: number;
|
|
281
|
+
limit?: number;
|
|
282
|
+
};
|
|
283
|
+
result: {
|
|
284
|
+
turns: SessionTurn[];
|
|
285
|
+
total: number;
|
|
286
|
+
version?: string;
|
|
287
|
+
} | null;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* The full text of one tool result (`callId`; `turnId`, when known, the
|
|
291
|
+
* turn that holds it): what a clipped tool row shows on expand, without
|
|
292
|
+
* the session crossing the wire. `null` when no such result. Additive.
|
|
293
|
+
*/
|
|
294
|
+
'sessions.getToolResult': {
|
|
295
|
+
params: {
|
|
296
|
+
sessionId: string;
|
|
297
|
+
callId: string;
|
|
298
|
+
turnId?: string;
|
|
299
|
+
};
|
|
300
|
+
result: string | null;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* One session's header: its list row plus metadata, profile and status,
|
|
304
|
+
* without turns or runs (the live copy when an agent holds it). What a
|
|
305
|
+
* window re-reads on `sessions:changed`. Additive. `usage: true` adds the
|
|
306
|
+
* footer's numbers, computed host-side from the turns and runs
|
|
307
|
+
* (`contextTokens`, `costUsd`): a client needs no document for its context
|
|
308
|
+
* gauge or cost pill. Older hosts ignore it.
|
|
309
|
+
*/
|
|
310
|
+
'sessions.getHeader': {
|
|
311
|
+
params: {
|
|
312
|
+
sessionId: string;
|
|
313
|
+
usage?: boolean;
|
|
314
|
+
};
|
|
315
|
+
result: SessionHeader | null;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* One key of an extension's per-session state (`metadata.extensions`, the
|
|
319
|
+
* bag `ctx.session` and renderer `useSessionState` share), written by the
|
|
320
|
+
* host into its copy of the session. `value` omitted deletes the key.
|
|
321
|
+
*/
|
|
322
|
+
'sessions.setExtensionState': {
|
|
323
|
+
params: {
|
|
324
|
+
sessionId: string;
|
|
325
|
+
extension: string;
|
|
326
|
+
key: string;
|
|
327
|
+
value?: JsonValue;
|
|
328
|
+
};
|
|
329
|
+
result: void;
|
|
330
|
+
};
|
|
331
|
+
'sessions.create': {
|
|
332
|
+
params: CreateSessionParams;
|
|
333
|
+
result: SessionRow;
|
|
334
|
+
};
|
|
335
|
+
/** Resolves with what happened to the session's environment (a provider may keep it). */
|
|
336
|
+
'sessions.delete': {
|
|
337
|
+
params: {
|
|
338
|
+
sessionId: string;
|
|
339
|
+
};
|
|
340
|
+
result: {
|
|
341
|
+
environment?: EnvironmentTeardownResult;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
/** Provision a failed (or restart-stranded) environment again. */
|
|
345
|
+
'sessions.retryEnvironment': {
|
|
346
|
+
params: {
|
|
347
|
+
sessionId: string;
|
|
348
|
+
};
|
|
349
|
+
result: void;
|
|
350
|
+
};
|
|
351
|
+
/** The per-session commands the session's environment offers right now (push, open PR, …). */
|
|
352
|
+
'sessions.environmentActions': {
|
|
353
|
+
params: {
|
|
354
|
+
sessionId: string;
|
|
355
|
+
};
|
|
356
|
+
result: EnvironmentActionSummary[];
|
|
357
|
+
};
|
|
358
|
+
/** Run one of them in the session's environment (resumed when suspended). */
|
|
359
|
+
'sessions.runEnvironmentAction': {
|
|
360
|
+
params: {
|
|
361
|
+
sessionId: string;
|
|
362
|
+
actionId: string;
|
|
363
|
+
};
|
|
364
|
+
result: EnvironmentActionResult;
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* The session's workspace (`ChatHost.workspace*`): its execution context,
|
|
368
|
+
* rooted inside the environment when the files live there, else at the
|
|
369
|
+
* session's cwd. Paths and exec `cwd` resolve against the root as the
|
|
370
|
+
* execution context resolves them; containment is the context's own.
|
|
371
|
+
* `cwd` / `env` on exec and the list / size methods are additive: an
|
|
372
|
+
* older daemon ignores the former and answers "method not found" to the
|
|
373
|
+
* latter (active clients are build-fenced, so this is a transient case).
|
|
374
|
+
*/
|
|
375
|
+
'sessions.workspaceExec': {
|
|
376
|
+
params: {
|
|
377
|
+
sessionId: string;
|
|
378
|
+
command: string;
|
|
379
|
+
cwd?: string;
|
|
380
|
+
env?: Record<string, string>;
|
|
381
|
+
timeoutSeconds?: number;
|
|
382
|
+
};
|
|
383
|
+
result: ExecResult;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* The same command, streamed (`!` on a remote host): the reply names the
|
|
387
|
+
* exec, its output follows as `workspace:exec:data` signals and ends with
|
|
388
|
+
* one `workspace:exec:exit`, all to this connection only (signals may
|
|
389
|
+
* precede the reply). Bounded per connection (concurrent commands, chunk
|
|
390
|
+
* size, total output: past it the process is stopped and the exit says
|
|
391
|
+
* `truncated`). A dropped connection kills what it started. Additive: an
|
|
392
|
+
* older host answers "method not found" and clients use `workspaceExec`.
|
|
393
|
+
*/
|
|
394
|
+
'sessions.workspaceExecStream': {
|
|
395
|
+
params: {
|
|
396
|
+
sessionId: string;
|
|
397
|
+
command: string;
|
|
398
|
+
cwd?: string;
|
|
399
|
+
};
|
|
400
|
+
result: {
|
|
401
|
+
execId: string;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
/** Kill a streamed command's process group (this connection's only; `cancelled: false` otherwise or when it already ended). */
|
|
405
|
+
'sessions.workspaceExecCancel': {
|
|
406
|
+
params: {
|
|
407
|
+
execId: string;
|
|
408
|
+
};
|
|
409
|
+
result: {
|
|
410
|
+
cancelled: boolean;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
'sessions.workspaceReadFile': {
|
|
414
|
+
params: {
|
|
415
|
+
sessionId: string;
|
|
416
|
+
path: string;
|
|
417
|
+
};
|
|
418
|
+
result: string;
|
|
419
|
+
};
|
|
420
|
+
'sessions.workspaceWriteFile': {
|
|
421
|
+
params: {
|
|
422
|
+
sessionId: string;
|
|
423
|
+
path: string;
|
|
424
|
+
content: string;
|
|
425
|
+
};
|
|
426
|
+
result: void;
|
|
427
|
+
};
|
|
428
|
+
'sessions.workspaceListFiles': {
|
|
429
|
+
params: {
|
|
430
|
+
sessionId: string;
|
|
431
|
+
path: string;
|
|
432
|
+
options?: WorkspaceListFilesOptions;
|
|
433
|
+
};
|
|
434
|
+
result: ListFilesEntry[];
|
|
435
|
+
};
|
|
436
|
+
'sessions.workspaceFileSize': {
|
|
437
|
+
params: {
|
|
438
|
+
sessionId: string;
|
|
439
|
+
path: string;
|
|
440
|
+
};
|
|
441
|
+
result: number | null;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Every environment kind the host can create, described for a new session
|
|
445
|
+
* in `cwd` (availability, default, branch suggestion, options — secrets
|
|
446
|
+
* only as "configured"). What pickers and the Environments settings render.
|
|
447
|
+
* `kind`: a machine kind (`local@laptop`) says `cwd` is that machine's
|
|
448
|
+
* folder, checked against its roots instead of this host's
|
|
449
|
+
* (`docs/MACHINES.md` § Folders); the same on `commands.*`, `catalog.*`
|
|
450
|
+
* and `models.list`. Additive.
|
|
451
|
+
*/
|
|
452
|
+
'environments.list': {
|
|
453
|
+
params: {
|
|
454
|
+
cwd?: string;
|
|
455
|
+
kind?: string;
|
|
456
|
+
};
|
|
457
|
+
result: EnvironmentDescriptor[];
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* Apply one Environments-settings edit (enable, default, options,
|
|
461
|
+
* secrets), validated against the kind's schema. Settings changes fan out
|
|
462
|
+
* as `settings:changed`; secrets are stored host-side and never returned.
|
|
463
|
+
*/
|
|
464
|
+
'environments.update': {
|
|
465
|
+
params: EnvironmentSettingsChange;
|
|
466
|
+
result: void;
|
|
467
|
+
};
|
|
468
|
+
/** "Test connection" for a kind with its current options. */
|
|
469
|
+
'environments.verify': {
|
|
470
|
+
params: {
|
|
471
|
+
kind: string;
|
|
472
|
+
};
|
|
473
|
+
result: EnvironmentVerifyResult;
|
|
474
|
+
};
|
|
475
|
+
'sessions.setTitle': {
|
|
476
|
+
params: {
|
|
477
|
+
sessionId: string;
|
|
478
|
+
title: string;
|
|
479
|
+
};
|
|
480
|
+
result: void;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Title the session ON the host: its providers and credentials (a server
|
|
484
|
+
* session's transcript never goes to the window's provider), the same
|
|
485
|
+
* generator (`generateSessionTitle`), written as `sessions.setTitle` does.
|
|
486
|
+
* `providerKey` / `model`: the window's pick, used when the host has that
|
|
487
|
+
* provider; otherwise the session's own provider and model. The Main
|
|
488
|
+
* session is refused (it keeps its name). Additive: an older host answers
|
|
489
|
+
* "method not found".
|
|
490
|
+
*/
|
|
491
|
+
'sessions.generateTitle': {
|
|
492
|
+
params: {
|
|
493
|
+
sessionId: string;
|
|
494
|
+
providerKey?: string;
|
|
495
|
+
model?: string;
|
|
496
|
+
};
|
|
497
|
+
result: {
|
|
498
|
+
title: string;
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
'sessions.setArchived': {
|
|
502
|
+
params: {
|
|
503
|
+
sessionId: string;
|
|
504
|
+
archived: boolean;
|
|
505
|
+
};
|
|
506
|
+
result: void;
|
|
507
|
+
};
|
|
508
|
+
'sessions.setAgentId': {
|
|
509
|
+
params: {
|
|
510
|
+
sessionId: string;
|
|
511
|
+
agentId: string;
|
|
512
|
+
};
|
|
513
|
+
result: void;
|
|
514
|
+
};
|
|
515
|
+
'sessions.setEffort': {
|
|
516
|
+
params: {
|
|
517
|
+
sessionId: string;
|
|
518
|
+
effort: ThinkingLevel;
|
|
519
|
+
};
|
|
520
|
+
result: void;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* The one model-swap contract (`ChatHost.setSessionModel`). A pick is a
|
|
524
|
+
* whole: `fallbacks` (ordered, primary excluded) REPLACES the persisted
|
|
525
|
+
* `metadata.modelChain` (omitted/empty clears it); `effort` and
|
|
526
|
+
* `modelOptions` are reset to the supplied values (omitted clears them —
|
|
527
|
+
* per-model knobs never leak onto the new model). The live agent is
|
|
528
|
+
* retired so the next run rebuilds on the new pick (run-end deferred
|
|
529
|
+
* while a run is in flight).
|
|
530
|
+
*/
|
|
531
|
+
'sessions.setModel': {
|
|
532
|
+
params: {
|
|
533
|
+
sessionId: string;
|
|
534
|
+
providerKey: ProviderKey;
|
|
535
|
+
modelId: string;
|
|
536
|
+
fallbacks?: ModelFallbackRef[];
|
|
537
|
+
effort?: ThinkingLevel;
|
|
538
|
+
modelOptions?: Record<string, boolean>;
|
|
539
|
+
};
|
|
540
|
+
result: void;
|
|
541
|
+
};
|
|
542
|
+
'sessions.setModelOptions': {
|
|
543
|
+
params: {
|
|
544
|
+
sessionId: string;
|
|
545
|
+
options: Record<string, boolean>;
|
|
546
|
+
};
|
|
547
|
+
result: void;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* The session's transcript as canonical events. Without `before` / `limit`:
|
|
551
|
+
* every turn, as a plain array (the shape every client predating paging
|
|
552
|
+
* reads). With either: one page, `{ events, cursor? }`, the last `limit`
|
|
553
|
+
* turns (default {@link LOAD_EVENTS_PAGE_TURNS}, at most
|
|
554
|
+
* {@link LOAD_EVENTS_MAX_PAGE_TURNS}) before turn position `before`
|
|
555
|
+
* (default: the end), its start moved back to an exchange boundary when one
|
|
556
|
+
* is near so a tool call is never cut from its result. `cursor`: the
|
|
557
|
+
* `before` of the previous page, absent at the first turn. Typed here as
|
|
558
|
+
* the unpaged call every client makes; a paged call goes through
|
|
559
|
+
* {@link loadEventsPage}. Paging is additive: an older host ignores the
|
|
560
|
+
* fields and answers the whole array.
|
|
561
|
+
*/
|
|
562
|
+
'sessions.loadEvents': {
|
|
563
|
+
params: {
|
|
564
|
+
sessionId: string;
|
|
565
|
+
};
|
|
566
|
+
result: StreamEvent[];
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
* Reattach without a reload: the session's signals numbered after
|
|
570
|
+
* `afterSeq` (see {@link SIGNAL_SEQ_FIELD}), in order, as long as this host
|
|
571
|
+
* process (`epoch`, from `HelloResult.signalEpoch`) still holds them all.
|
|
572
|
+
* Otherwise refused, and the client reloads with `sessions.loadEvents`.
|
|
573
|
+
* Additive: an older host answers "method not found", same fallback.
|
|
574
|
+
*/
|
|
575
|
+
'sessions.resume': {
|
|
576
|
+
params: {
|
|
577
|
+
sessionId: string;
|
|
578
|
+
epoch: string;
|
|
579
|
+
afterSeq: number;
|
|
580
|
+
};
|
|
581
|
+
result: SessionResumeResult;
|
|
582
|
+
};
|
|
583
|
+
'sessions.getTurn': {
|
|
584
|
+
params: {
|
|
585
|
+
sessionId: string;
|
|
586
|
+
turnId: string;
|
|
587
|
+
};
|
|
588
|
+
result: SessionTurn | null;
|
|
589
|
+
};
|
|
590
|
+
'sessions.contextBreakdown': {
|
|
591
|
+
params: {
|
|
592
|
+
sessionId: string;
|
|
593
|
+
};
|
|
594
|
+
result: ContextBreakdown | null;
|
|
595
|
+
};
|
|
596
|
+
/**
|
|
597
|
+
* Artifacts one session recorded (PRs, branches, commits, files,
|
|
598
|
+
* extension kinds — see `session/artifacts.ts`), newest first. Empty on
|
|
599
|
+
* stores without artifact support. Additive; pre-artifact daemons
|
|
600
|
+
* reject the method and clients treat that as empty.
|
|
601
|
+
*/
|
|
602
|
+
'sessions.artifacts': {
|
|
603
|
+
params: {
|
|
604
|
+
sessionId: string;
|
|
605
|
+
kind?: string;
|
|
606
|
+
limit?: number;
|
|
607
|
+
};
|
|
608
|
+
result: SessionArtifact[];
|
|
609
|
+
};
|
|
610
|
+
/**
|
|
611
|
+
* Artifacts across sessions, filtered by project root (`null` = untagged
|
|
612
|
+
* sessions, omitted = every project) and/or kind/uri (reverse lookup).
|
|
613
|
+
*/
|
|
614
|
+
'artifacts.list': {
|
|
615
|
+
params: {
|
|
616
|
+
projectRoot?: string | null;
|
|
617
|
+
kind?: string;
|
|
618
|
+
uri?: string;
|
|
619
|
+
since?: number;
|
|
620
|
+
limit?: number;
|
|
621
|
+
};
|
|
622
|
+
result: SessionArtifact[];
|
|
623
|
+
};
|
|
624
|
+
/** Remove one artifact. `false` when the store has no artifact support. Fans out `artifact:changed`. */
|
|
625
|
+
'artifacts.delete': {
|
|
626
|
+
params: {
|
|
627
|
+
sessionId: string;
|
|
628
|
+
artifactId: string;
|
|
629
|
+
};
|
|
630
|
+
result: boolean;
|
|
631
|
+
};
|
|
632
|
+
/**
|
|
633
|
+
* Upsert an artifact — the lazy `resolve()` write-back (refreshed
|
|
634
|
+
* `label` / `meta`). Same merge semantics as `SessionStore.upsertArtifact`;
|
|
635
|
+
* `null` when the session is unknown or the store lacks support.
|
|
636
|
+
*/
|
|
637
|
+
'artifacts.upsert': {
|
|
638
|
+
params: {
|
|
639
|
+
artifact: SessionArtifact;
|
|
640
|
+
};
|
|
641
|
+
result: SessionArtifact | null;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Transcript search over ONE session, daemon-side. The daemon owns the
|
|
645
|
+
* authoritative turns (live wrapper when an agent is active — fresh
|
|
646
|
+
* mid-run, which a window's load-time snapshot is not) and an LRU index
|
|
647
|
+
* cache shared by every window, so repeat queries pay match cost only.
|
|
648
|
+
* Results come back in TURN ORDER (search is a transcript filter).
|
|
649
|
+
*/
|
|
650
|
+
'history.searchSession': {
|
|
651
|
+
params: {
|
|
652
|
+
sessionId: string;
|
|
653
|
+
query: string;
|
|
654
|
+
limit?: number;
|
|
655
|
+
};
|
|
656
|
+
result: SearchTurnResult[];
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* Cross-session content search, daemon-side. One RPC replaces a
|
|
660
|
+
* window's per-session index/build/search round-trips — indexes are
|
|
661
|
+
* built once in the daemon and shared by every window.
|
|
662
|
+
*/
|
|
663
|
+
'history.searchAll': {
|
|
664
|
+
params: {
|
|
665
|
+
query: string;
|
|
666
|
+
sessionIds: string[];
|
|
667
|
+
excerptLimit?: number;
|
|
668
|
+
};
|
|
669
|
+
result: Record<string, SessionHistoryMatch>;
|
|
670
|
+
};
|
|
671
|
+
/**
|
|
672
|
+
* A window appended transcript content OUT-OF-BAND (local `/` command
|
|
673
|
+
* output, `!` shell turns — written straight to the shared store, not
|
|
674
|
+
* through a host run). The daemon fans out `sessions:changed` so every
|
|
675
|
+
* window (issuer included) re-converges on the canonical replay NOW
|
|
676
|
+
* instead of at the next run end. Sent as a notification.
|
|
677
|
+
*/
|
|
678
|
+
'sessions.touch': {
|
|
679
|
+
params: {
|
|
680
|
+
sessionId: string;
|
|
681
|
+
};
|
|
682
|
+
result: void;
|
|
683
|
+
};
|
|
684
|
+
/** Fork at `turnId` into a new session (`ChatHost.forkSession`); announced as a `sessions:changed` create. */
|
|
685
|
+
'sessions.fork': {
|
|
686
|
+
params: {
|
|
687
|
+
sessionId: string;
|
|
688
|
+
turnId: string;
|
|
689
|
+
title?: string;
|
|
690
|
+
};
|
|
691
|
+
result: {
|
|
692
|
+
id: string;
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
/** History edits (`ChatHost.deleteTurn` / `editTurnText`): refused while the session runs. */
|
|
696
|
+
'sessions.deleteTurn': {
|
|
697
|
+
params: {
|
|
698
|
+
sessionId: string;
|
|
699
|
+
turnId: string;
|
|
700
|
+
};
|
|
701
|
+
result: void;
|
|
702
|
+
};
|
|
703
|
+
'sessions.editTurnText': {
|
|
704
|
+
params: {
|
|
705
|
+
sessionId: string;
|
|
706
|
+
turnId: string;
|
|
707
|
+
text: string;
|
|
708
|
+
};
|
|
709
|
+
result: void;
|
|
710
|
+
};
|
|
711
|
+
/** Bind to a folder, or back to a plain chat with `cwd: ''` (`ChatHost.setSessionFolder`). */
|
|
712
|
+
'sessions.setFolder': {
|
|
713
|
+
params: {
|
|
714
|
+
sessionId: string;
|
|
715
|
+
cwd: string;
|
|
716
|
+
};
|
|
717
|
+
result: void;
|
|
718
|
+
};
|
|
719
|
+
/** Turns written outside a run, e.g. `!` shell output (`ChatHost.appendTurns`). */
|
|
720
|
+
'sessions.appendTurns': {
|
|
721
|
+
params: {
|
|
722
|
+
sessionId: string;
|
|
723
|
+
turns: SessionTurn[];
|
|
724
|
+
};
|
|
725
|
+
result: void;
|
|
726
|
+
};
|
|
727
|
+
/**
|
|
728
|
+
* `ctx.appendNote` outside a run: a display-only note, rendered live and
|
|
729
|
+
* persisted (`ChatHost.appendNote`). False for an unknown session or no blocks.
|
|
730
|
+
*/
|
|
731
|
+
'sessions.appendNote': {
|
|
732
|
+
params: {
|
|
733
|
+
sessionId: string;
|
|
734
|
+
blocks: CommandOutputBlock[];
|
|
735
|
+
};
|
|
736
|
+
result: boolean;
|
|
737
|
+
};
|
|
738
|
+
/** Compact now (`ChatHost.compactSessionNow`): what was done, `null` when nothing was. Older daemons resolve `null`. */
|
|
739
|
+
'sessions.compact': {
|
|
740
|
+
params: {
|
|
741
|
+
sessionId: string;
|
|
742
|
+
};
|
|
743
|
+
result: CompactionReport | null;
|
|
744
|
+
};
|
|
745
|
+
'todos.get': {
|
|
746
|
+
params: {
|
|
747
|
+
sessionId: string;
|
|
748
|
+
};
|
|
749
|
+
result: TodosSnapshot | null;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* Apply a user todo edit (add / edit / remove / cycle / clear) to the
|
|
753
|
+
* session the MODEL reads.
|
|
754
|
+
*
|
|
755
|
+
* Required because todos live in `session.metadata` and `todowrite` reads
|
|
756
|
+
* them off the daemon agent's in-memory `Session`. A window writing its own
|
|
757
|
+
* `Session` instance persisted an edit that the daemon never observed, so the
|
|
758
|
+
* model's next `todowrite` silently overwrote it.
|
|
759
|
+
*
|
|
760
|
+
* Sends the whole list rather than a delta: the mutators in
|
|
761
|
+
* `chat/todo-edits.ts` are already whole-list transforms, and a delta would
|
|
762
|
+
* need conflict rules against a list the model rewrites concurrently.
|
|
763
|
+
*
|
|
764
|
+
* `null` = no live agent (or no run owns a todo slot), and the caller should
|
|
765
|
+
* apply its own store-level write — race-free, since nothing is appending.
|
|
766
|
+
*/
|
|
767
|
+
/**
|
|
768
|
+
* `persistIdle`: with no live agent, the host applies the edit to the stored
|
|
769
|
+
* session itself (the run the list belongs to must exist) instead of
|
|
770
|
+
* answering `null`. Older hosts ignore it.
|
|
771
|
+
*/
|
|
772
|
+
'todos.set': {
|
|
773
|
+
params: {
|
|
774
|
+
sessionId: string;
|
|
775
|
+
items: readonly TodoItem[];
|
|
776
|
+
persistIdle?: boolean;
|
|
777
|
+
};
|
|
778
|
+
result: TodosSnapshot | null;
|
|
779
|
+
};
|
|
780
|
+
/** The main session id, creating it (directory-less) when the setting is on and none exists. */
|
|
781
|
+
'orchestration.main': {
|
|
782
|
+
params: Record<string, never>;
|
|
783
|
+
result: string | null;
|
|
784
|
+
};
|
|
785
|
+
'orchestration.createWorker': {
|
|
786
|
+
params: {
|
|
787
|
+
mainId: string;
|
|
788
|
+
} & CreateWorkerParams;
|
|
789
|
+
result: string;
|
|
790
|
+
};
|
|
791
|
+
'orchestration.list': {
|
|
792
|
+
params: {
|
|
793
|
+
mainId: string;
|
|
794
|
+
limit?: number;
|
|
795
|
+
};
|
|
796
|
+
result: WorkerRow[];
|
|
797
|
+
};
|
|
798
|
+
'orchestration.read': {
|
|
799
|
+
params: {
|
|
800
|
+
mainId: string;
|
|
801
|
+
sessionId: string;
|
|
802
|
+
};
|
|
803
|
+
result: WorkerSummary | null;
|
|
804
|
+
};
|
|
805
|
+
/** `wake` (default true): whether that run finishing wakes the main. */
|
|
806
|
+
'orchestration.send': {
|
|
807
|
+
params: {
|
|
808
|
+
mainId: string;
|
|
809
|
+
sessionId: string;
|
|
810
|
+
prompt: string;
|
|
811
|
+
wake?: boolean;
|
|
812
|
+
};
|
|
813
|
+
result: void;
|
|
814
|
+
};
|
|
815
|
+
'orchestration.steer': {
|
|
816
|
+
params: {
|
|
817
|
+
mainId: string;
|
|
818
|
+
sessionId: string;
|
|
819
|
+
message: string;
|
|
820
|
+
};
|
|
821
|
+
result: void;
|
|
822
|
+
};
|
|
823
|
+
'orchestration.cancel': {
|
|
824
|
+
params: {
|
|
825
|
+
mainId: string;
|
|
826
|
+
sessionId: string;
|
|
827
|
+
};
|
|
828
|
+
result: void;
|
|
829
|
+
};
|
|
830
|
+
'orchestration.transcript': {
|
|
831
|
+
params: {
|
|
832
|
+
mainId: string;
|
|
833
|
+
sessionId: string;
|
|
834
|
+
limit?: number;
|
|
835
|
+
};
|
|
836
|
+
result: string;
|
|
837
|
+
};
|
|
838
|
+
/** Extension-contributed `/` commands discovered for `cwd`. */
|
|
839
|
+
'commands.list': {
|
|
840
|
+
params: {
|
|
841
|
+
cwd: string;
|
|
842
|
+
kind?: string;
|
|
843
|
+
};
|
|
844
|
+
result: CommandSummary[];
|
|
845
|
+
};
|
|
846
|
+
/** Argument suggestions for `/name <prefix>` — best-effort, empty on failure. */
|
|
847
|
+
'commands.completeArgs': {
|
|
848
|
+
params: {
|
|
849
|
+
cwd: string;
|
|
850
|
+
name: string;
|
|
851
|
+
argsPrefix: string;
|
|
852
|
+
kind?: string;
|
|
853
|
+
};
|
|
854
|
+
result: CommandArgSuggestionSummary[];
|
|
855
|
+
};
|
|
856
|
+
'interactions.list': {
|
|
857
|
+
params: {
|
|
858
|
+
sessionId?: string;
|
|
859
|
+
};
|
|
860
|
+
result: PendingInteraction[];
|
|
861
|
+
};
|
|
862
|
+
'interactions.respond': {
|
|
863
|
+
params: {
|
|
864
|
+
requestId: string;
|
|
865
|
+
response: InteractionResponse;
|
|
866
|
+
};
|
|
867
|
+
result: {
|
|
868
|
+
ok: boolean;
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
'interactions.cancel': {
|
|
872
|
+
params: {
|
|
873
|
+
requestId: string;
|
|
874
|
+
reason?: string;
|
|
875
|
+
};
|
|
876
|
+
result: {
|
|
877
|
+
ok: boolean;
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
'interactions.rehydrate': {
|
|
881
|
+
params: {
|
|
882
|
+
sessionId: string;
|
|
883
|
+
};
|
|
884
|
+
result: PendingInteraction[];
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Dev browser: a window offers to host the pages the agent's `browser_*`
|
|
888
|
+
* tools drive (the GUI's main process). Released when the connection
|
|
889
|
+
* drops. It then answers each `browser:request` signal addressed to it.
|
|
890
|
+
*/
|
|
891
|
+
'browser.registerHost': {
|
|
892
|
+
params: {
|
|
893
|
+
hostId: string;
|
|
894
|
+
};
|
|
895
|
+
result: {
|
|
896
|
+
ok: boolean;
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
'browser.unregisterHost': {
|
|
900
|
+
params: {
|
|
901
|
+
hostId: string;
|
|
902
|
+
};
|
|
903
|
+
result: {
|
|
904
|
+
ok: boolean;
|
|
905
|
+
};
|
|
906
|
+
};
|
|
907
|
+
'browser.respond': {
|
|
908
|
+
params: {
|
|
909
|
+
requestId: string;
|
|
910
|
+
response: BrowserResponse;
|
|
911
|
+
};
|
|
912
|
+
result: {
|
|
913
|
+
ok: boolean;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
/**
|
|
917
|
+
* Terminals, run by the host in the session's environment. `clientId`
|
|
918
|
+
* names one view (a window's drawer or panel); views attached through a
|
|
919
|
+
* connection are detached when it drops. Output arrives as
|
|
920
|
+
* `terminal:output` signals; `ack` what was written to keep it flowing.
|
|
921
|
+
*/
|
|
922
|
+
'terminal.state': {
|
|
923
|
+
params: {
|
|
924
|
+
sessionId: string;
|
|
925
|
+
};
|
|
926
|
+
result: TerminalSessionState;
|
|
927
|
+
};
|
|
928
|
+
'terminal.open': {
|
|
929
|
+
params: TerminalOpenInput;
|
|
930
|
+
result: TerminalInfo;
|
|
931
|
+
};
|
|
932
|
+
'terminal.attach': {
|
|
933
|
+
params: {
|
|
934
|
+
terminalId: string;
|
|
935
|
+
clientId: string;
|
|
936
|
+
};
|
|
937
|
+
result: TerminalAttachResult;
|
|
938
|
+
};
|
|
939
|
+
'terminal.detach': {
|
|
940
|
+
params: {
|
|
941
|
+
terminalId: string;
|
|
942
|
+
clientId: string;
|
|
943
|
+
};
|
|
944
|
+
result: void;
|
|
945
|
+
};
|
|
946
|
+
/** `clientId` + `response`: bytes the view's emulator generated (DSR/DA replies), dropped unless that view owns the size. */
|
|
947
|
+
'terminal.write': {
|
|
948
|
+
params: {
|
|
949
|
+
terminalId: string;
|
|
950
|
+
data: string;
|
|
951
|
+
clientId?: string;
|
|
952
|
+
response?: boolean;
|
|
953
|
+
};
|
|
954
|
+
result: void;
|
|
955
|
+
};
|
|
956
|
+
'terminal.resize': {
|
|
957
|
+
params: {
|
|
958
|
+
terminalId: string;
|
|
959
|
+
clientId: string;
|
|
960
|
+
cols: number;
|
|
961
|
+
rows: number;
|
|
962
|
+
claim?: boolean;
|
|
963
|
+
};
|
|
964
|
+
result: void;
|
|
965
|
+
};
|
|
966
|
+
'terminal.ack': {
|
|
967
|
+
params: {
|
|
968
|
+
terminalId: string;
|
|
969
|
+
clientId: string;
|
|
970
|
+
offset: number;
|
|
971
|
+
};
|
|
972
|
+
result: void;
|
|
973
|
+
};
|
|
974
|
+
'terminal.restart': {
|
|
975
|
+
params: {
|
|
976
|
+
terminalId: string;
|
|
977
|
+
};
|
|
978
|
+
result: TerminalInfo;
|
|
979
|
+
};
|
|
980
|
+
'terminal.close': {
|
|
981
|
+
params: {
|
|
982
|
+
terminalId: string;
|
|
983
|
+
};
|
|
984
|
+
result: void;
|
|
985
|
+
};
|
|
986
|
+
'terminal.setHidden': {
|
|
987
|
+
params: {
|
|
988
|
+
terminalId: string;
|
|
989
|
+
hidden: boolean;
|
|
990
|
+
};
|
|
991
|
+
result: void;
|
|
992
|
+
};
|
|
993
|
+
/**
|
|
994
|
+
* This connection can show terminals (the desktop app). While at least one
|
|
995
|
+
* viewer is attached, agents get the terminal tools; the registration is
|
|
996
|
+
* dropped with the connection.
|
|
997
|
+
*/
|
|
998
|
+
'terminal.registerViewer': {
|
|
999
|
+
params: {
|
|
1000
|
+
viewerId: string;
|
|
1001
|
+
};
|
|
1002
|
+
result: {
|
|
1003
|
+
ok: boolean;
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
'terminal.unregisterViewer': {
|
|
1007
|
+
params: {
|
|
1008
|
+
viewerId: string;
|
|
1009
|
+
};
|
|
1010
|
+
result: {
|
|
1011
|
+
ok: boolean;
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
'approvals.resolve': {
|
|
1015
|
+
params: {
|
|
1016
|
+
requestId: string;
|
|
1017
|
+
decision: ApprovalDecision;
|
|
1018
|
+
};
|
|
1019
|
+
result: void;
|
|
1020
|
+
};
|
|
1021
|
+
'approvals.denyAll': {
|
|
1022
|
+
params: {
|
|
1023
|
+
sessionId?: string;
|
|
1024
|
+
};
|
|
1025
|
+
result: void;
|
|
1026
|
+
};
|
|
1027
|
+
'approvals.listPending': {
|
|
1028
|
+
params: Record<string, never>;
|
|
1029
|
+
result: WireApprovalRequest[];
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Type-ahead queue, host-owned so every window sees and can manipulate
|
|
1033
|
+
* the same list. `queue.add` queues when a run is in flight and sends
|
|
1034
|
+
* immediately otherwise; the host auto-drains the queue FIFO at run end.
|
|
1035
|
+
*/
|
|
1036
|
+
'queue.list': {
|
|
1037
|
+
params: {
|
|
1038
|
+
sessionId: string;
|
|
1039
|
+
};
|
|
1040
|
+
result: QueuedItem[];
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* Which `SYSTEM.md` override composes this session's prompt, for windows
|
|
1044
|
+
* attaching to an already-warm agent.
|
|
1045
|
+
*
|
|
1046
|
+
* The `system-md` signal fires once per agent BUILD and the daemon caches
|
|
1047
|
+
* agents, so the normal multi-window case (daemon already running, open a
|
|
1048
|
+
* second terminal or the GUI) would otherwise never learn that the built-in
|
|
1049
|
+
* safety and git doctrine has been replaced. `null` = no live agent yet, in
|
|
1050
|
+
* which case the next build broadcasts it.
|
|
1051
|
+
*/
|
|
1052
|
+
'sessions.systemMd': {
|
|
1053
|
+
params: {
|
|
1054
|
+
sessionId: string;
|
|
1055
|
+
};
|
|
1056
|
+
result: {
|
|
1057
|
+
file: SystemMdFile | null;
|
|
1058
|
+
shadowed: readonly SystemMdFile[];
|
|
1059
|
+
} | null;
|
|
1060
|
+
};
|
|
1061
|
+
/**
|
|
1062
|
+
* Every chunk of the session's system prompt with provenance — the
|
|
1063
|
+
* Instructions tab. Built from the live agent's assembly, so it reflects
|
|
1064
|
+
* MCP instructions, extension fragments and the resolved `SYSTEM.md`.
|
|
1065
|
+
*/
|
|
1066
|
+
'sessions.contextSegments': {
|
|
1067
|
+
params: {
|
|
1068
|
+
sessionId: string;
|
|
1069
|
+
};
|
|
1070
|
+
result: ContextSegmentsReport | null;
|
|
1071
|
+
};
|
|
1072
|
+
/** Seed a user-scope `SYSTEM.md` from the session's doctrine; throws when an override could not apply. */
|
|
1073
|
+
'sessions.createSystemOverride': {
|
|
1074
|
+
params: {
|
|
1075
|
+
sessionId: string;
|
|
1076
|
+
};
|
|
1077
|
+
result: {
|
|
1078
|
+
path: string;
|
|
1079
|
+
created: boolean;
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
'queue.add': {
|
|
1083
|
+
/**
|
|
1084
|
+
* `asCommand`: see `SendOptions.asCommand` — the host refuses when it cannot resolve it.
|
|
1085
|
+
* `keepDraft`: see `SendOptions.keepDraft` — a prompt from outside the composer.
|
|
1086
|
+
*/
|
|
1087
|
+
params: {
|
|
1088
|
+
sessionId: string;
|
|
1089
|
+
text: string;
|
|
1090
|
+
activatedSkills?: string[];
|
|
1091
|
+
attachments?: PromptAttachment[];
|
|
1092
|
+
asCommand?: string;
|
|
1093
|
+
keepDraft?: boolean;
|
|
1094
|
+
};
|
|
1095
|
+
result: {
|
|
1096
|
+
delivered: 'queued' | 'sent' | 'steer';
|
|
1097
|
+
};
|
|
1098
|
+
};
|
|
1099
|
+
'queue.remove': {
|
|
1100
|
+
params: {
|
|
1101
|
+
sessionId: string;
|
|
1102
|
+
id: string;
|
|
1103
|
+
};
|
|
1104
|
+
result: boolean;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* Edit a queued entry in place; order is kept. `attachments` replaces the
|
|
1108
|
+
* entry's list when given. `false` when already sent / dropped.
|
|
1109
|
+
*/
|
|
1110
|
+
'queue.update': {
|
|
1111
|
+
params: {
|
|
1112
|
+
sessionId: string;
|
|
1113
|
+
id: string;
|
|
1114
|
+
text: string;
|
|
1115
|
+
attachments?: PromptAttachment[];
|
|
1116
|
+
};
|
|
1117
|
+
result: boolean;
|
|
1118
|
+
};
|
|
1119
|
+
/** A queued entry's attachments with their bytes; `null` when already sent / dropped. */
|
|
1120
|
+
'queue.attachments': {
|
|
1121
|
+
params: {
|
|
1122
|
+
sessionId: string;
|
|
1123
|
+
id: string;
|
|
1124
|
+
};
|
|
1125
|
+
result: PromptAttachment[] | null;
|
|
1126
|
+
};
|
|
1127
|
+
/** Steer a queued entry into the live run now (falls back to send when idle). */
|
|
1128
|
+
'queue.pushNow': {
|
|
1129
|
+
params: {
|
|
1130
|
+
sessionId: string;
|
|
1131
|
+
id: string;
|
|
1132
|
+
};
|
|
1133
|
+
result: {
|
|
1134
|
+
delivered: 'steer' | 'send' | 'queued' | 'missing';
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
/** Current shared draft for a session — backfill on window attach. */
|
|
1138
|
+
'drafts.get': {
|
|
1139
|
+
params: {
|
|
1140
|
+
sessionId: string;
|
|
1141
|
+
};
|
|
1142
|
+
result: {
|
|
1143
|
+
text: string;
|
|
1144
|
+
shell?: boolean;
|
|
1145
|
+
attachments?: PromptAttachment[];
|
|
1146
|
+
search?: {
|
|
1147
|
+
active: boolean;
|
|
1148
|
+
query: string;
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
/**
|
|
1153
|
+
* Replace the session's shared draft. Fans out `draft:changed` to every
|
|
1154
|
+
* OTHER peer. Ephemeral daemon state — drafts don't survive a daemon
|
|
1155
|
+
* restart and are cleared when any window submits the prompt.
|
|
1156
|
+
*/
|
|
1157
|
+
/**
|
|
1158
|
+
* `shell` carries the prompt's shell mode OUT OF BAND — never encoded
|
|
1159
|
+
* into the text, so a literal leading `!` in a normal draft can't flip
|
|
1160
|
+
* other windows into shell-execution semantics.
|
|
1161
|
+
*/
|
|
1162
|
+
'drafts.set': {
|
|
1163
|
+
params: {
|
|
1164
|
+
sessionId: string;
|
|
1165
|
+
text: string;
|
|
1166
|
+
shell?: boolean;
|
|
1167
|
+
};
|
|
1168
|
+
result: void;
|
|
1169
|
+
};
|
|
1170
|
+
/** Replace the shared draft's composing attachments (notification). */
|
|
1171
|
+
'drafts.setAttachments': {
|
|
1172
|
+
params: {
|
|
1173
|
+
sessionId: string;
|
|
1174
|
+
attachments: PromptAttachment[];
|
|
1175
|
+
};
|
|
1176
|
+
result: void;
|
|
1177
|
+
};
|
|
1178
|
+
/** Replace the shared transcript-search state (notification, per keystroke). */
|
|
1179
|
+
'search.set': {
|
|
1180
|
+
params: {
|
|
1181
|
+
sessionId: string;
|
|
1182
|
+
active: boolean;
|
|
1183
|
+
query: string;
|
|
1184
|
+
};
|
|
1185
|
+
result: void;
|
|
1186
|
+
};
|
|
1187
|
+
/**
|
|
1188
|
+
* Extension bus emit from a wire client whose extensions run CLIENT-side
|
|
1189
|
+
* (TUI daemon mode — the extension has no host to broadcast through).
|
|
1190
|
+
* Sent as a notification. The daemon validates the extension id against
|
|
1191
|
+
* the session cwd's registry (boot registry when no `sessionId`) and the
|
|
1192
|
+
* `'ipc'` permission, re-validates the 64 KiB payload cap, delivers to
|
|
1193
|
+
* its own subscribers, and fans out `extension:signal` to every OTHER
|
|
1194
|
+
* peer (origin excluded — the emitter already delivered locally).
|
|
1195
|
+
*/
|
|
1196
|
+
'extension.emit': {
|
|
1197
|
+
params: {
|
|
1198
|
+
extensionId: string;
|
|
1199
|
+
sessionId?: string;
|
|
1200
|
+
payload: JsonValue;
|
|
1201
|
+
seq: number;
|
|
1202
|
+
nonce?: string;
|
|
1203
|
+
};
|
|
1204
|
+
result: void;
|
|
1205
|
+
};
|
|
1206
|
+
/**
|
|
1207
|
+
* Resolve inline ghost-text autocomplete daemon-side (the typing
|
|
1208
|
+
* window's request IS the single computation): canonical resolver
|
|
1209
|
+
* against the session cwd's extension registry. Latest-wins per
|
|
1210
|
+
* session — a `seq` older than the newest seen returns
|
|
1211
|
+
* `{ suggestion: null }` without computing, and a newer request
|
|
1212
|
+
* aborts an in-flight compute. The result additionally fans out as
|
|
1213
|
+
* `suggest:changed` to every OTHER peer.
|
|
1214
|
+
*/
|
|
1215
|
+
'suggest.resolve': {
|
|
1216
|
+
params: {
|
|
1217
|
+
sessionId: string;
|
|
1218
|
+
text: string;
|
|
1219
|
+
caret: number;
|
|
1220
|
+
seq: number;
|
|
1221
|
+
};
|
|
1222
|
+
result: {
|
|
1223
|
+
suggestion: string | null;
|
|
1224
|
+
seq: number;
|
|
1225
|
+
candidates?: string[];
|
|
1226
|
+
};
|
|
1227
|
+
};
|
|
1228
|
+
'settings.get': {
|
|
1229
|
+
params: Record<string, never>;
|
|
1230
|
+
result: HostSettings;
|
|
1231
|
+
};
|
|
1232
|
+
'settings.set': {
|
|
1233
|
+
params: {
|
|
1234
|
+
patch: Partial<HostSettings>;
|
|
1235
|
+
};
|
|
1236
|
+
result: HostSettings;
|
|
1237
|
+
};
|
|
1238
|
+
/** Current presence snapshot — backfill for a freshly opened session list. */
|
|
1239
|
+
'presence.list': {
|
|
1240
|
+
params: Record<string, never>;
|
|
1241
|
+
result: SessionPresence[];
|
|
1242
|
+
};
|
|
1243
|
+
/**
|
|
1244
|
+
* Tag the calling peer as watching a session (one per connection; the
|
|
1245
|
+
* TUI opens one connection per activated session). Sent as a
|
|
1246
|
+
* notification right after the handshake. Detach is implicit — the
|
|
1247
|
+
* daemon recomputes presence when the socket drops.
|
|
1248
|
+
*/
|
|
1249
|
+
'presence.watch': {
|
|
1250
|
+
params: {
|
|
1251
|
+
sessionId: string;
|
|
1252
|
+
};
|
|
1253
|
+
result: void;
|
|
1254
|
+
};
|
|
1255
|
+
/**
|
|
1256
|
+
* Where this host lets a session's folder be: a server's workspace roots
|
|
1257
|
+
* (`confined`: `sessions.create` / `setFolder` refuse anything outside),
|
|
1258
|
+
* or the user's home on a local host (unconfined). Additive.
|
|
1259
|
+
*/
|
|
1260
|
+
'fs.roots': {
|
|
1261
|
+
params: Record<string, never>;
|
|
1262
|
+
result: FsRoots;
|
|
1263
|
+
};
|
|
1264
|
+
/**
|
|
1265
|
+
* The folders in `path` (default: the first root), for a folder picker on
|
|
1266
|
+
* the host's machine. Only inside the roots (real paths: `..` and
|
|
1267
|
+
* symlinks out are refused), no dotfiles. Additive.
|
|
1268
|
+
*/
|
|
1269
|
+
'fs.listDirs': {
|
|
1270
|
+
params: {
|
|
1271
|
+
path?: string;
|
|
1272
|
+
};
|
|
1273
|
+
result: FsDirListing;
|
|
1274
|
+
};
|
|
1275
|
+
/**
|
|
1276
|
+
* The host's provider credentials, as the host's agents use them (its
|
|
1277
|
+
* data dir's `credentials.json` and environment): per provider, whether
|
|
1278
|
+
* something is configured, its stored API key / OAuth accounts (labels,
|
|
1279
|
+
* which is active) and an env var it reads. Never a secret. Additive.
|
|
1280
|
+
*/
|
|
1281
|
+
'auth.status': {
|
|
1282
|
+
params: Record<string, never>;
|
|
1283
|
+
result: {
|
|
1284
|
+
providers: HostProviderAuth[];
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
/**
|
|
1288
|
+
* Store an API key for one of the host's providers as its active
|
|
1289
|
+
* credential, apply it to the host's environment, and rebuild agents
|
|
1290
|
+
* (idle now, busy ones at run end). Returns the provider's new status.
|
|
1291
|
+
* OAuth sign-in goes through `auth.oauth.*`. Additive.
|
|
1292
|
+
*/
|
|
1293
|
+
'auth.setApiKey': {
|
|
1294
|
+
params: {
|
|
1295
|
+
provider: string;
|
|
1296
|
+
key: string;
|
|
1297
|
+
};
|
|
1298
|
+
result: HostProviderAuth;
|
|
1299
|
+
};
|
|
1300
|
+
/**
|
|
1301
|
+
* Remove one stored credential (`account`: its key from `auth.status`) or,
|
|
1302
|
+
* without one, every stored credential of the provider; then as
|
|
1303
|
+
* `auth.setApiKey`. A key the host only has from its own environment is
|
|
1304
|
+
* left alone. Additive.
|
|
1305
|
+
*/
|
|
1306
|
+
'auth.remove': {
|
|
1307
|
+
params: {
|
|
1308
|
+
provider: string;
|
|
1309
|
+
account?: string;
|
|
1310
|
+
};
|
|
1311
|
+
result: {
|
|
1312
|
+
removed: boolean;
|
|
1313
|
+
provider: HostProviderAuth;
|
|
1314
|
+
};
|
|
1315
|
+
};
|
|
1316
|
+
/**
|
|
1317
|
+
* OAuth sign-in with the browser on the CLIENT and the tokens on the host:
|
|
1318
|
+
* the host starts a provider's login (`provider`) or an MCP server's
|
|
1319
|
+
* (`mcpServer`, found in `cwd`'s catalog, as `catalog.mcps`), keeping the
|
|
1320
|
+
* PKCE verifier and `state`, and answers with the authorization URL.
|
|
1321
|
+
* `mode: 'loopback'`: the client listens at `redirectUri` (a provider's
|
|
1322
|
+
* fixed port; for an MCP server the loopback URI the client passed) and
|
|
1323
|
+
* forwards the code; `'browser'`: the client opens `url` (pasting a code if
|
|
1324
|
+
* the page shows one); `'device'`: shows `userCode`. The flow belongs to
|
|
1325
|
+
* this connection, is single-use and expires (`expiresAt`). Additive.
|
|
1326
|
+
*/
|
|
1327
|
+
'auth.oauth.begin': {
|
|
1328
|
+
params: {
|
|
1329
|
+
provider?: string;
|
|
1330
|
+
mcpServer?: string;
|
|
1331
|
+
cwd?: string;
|
|
1332
|
+
kind?: string;
|
|
1333
|
+
redirectUri?: string;
|
|
1334
|
+
};
|
|
1335
|
+
result: HostOAuthBegin;
|
|
1336
|
+
};
|
|
1337
|
+
/**
|
|
1338
|
+
* Deliver the code (`code` + `state` from the loopback, or `input`: what
|
|
1339
|
+
* the user pasted) once, then wait for the host's token exchange; without
|
|
1340
|
+
* either, just wait (device and polling flows). A wrong `state` or another
|
|
1341
|
+
* connection's flow is refused. Tokens stay on the host: the result says
|
|
1342
|
+
* what changed, never a secret.
|
|
1343
|
+
*/
|
|
1344
|
+
'auth.oauth.complete': {
|
|
1345
|
+
params: {
|
|
1346
|
+
flowId: string;
|
|
1347
|
+
code?: string;
|
|
1348
|
+
state?: string;
|
|
1349
|
+
input?: string;
|
|
1350
|
+
};
|
|
1351
|
+
result: HostOAuthComplete;
|
|
1352
|
+
};
|
|
1353
|
+
/**
|
|
1354
|
+
* Answer the step a flow is waiting on (`HostOAuthBegin.step` before its
|
|
1355
|
+
* URL, `HostOAuthComplete.step` after): a select's option id (none:
|
|
1356
|
+
* cancel), a prompt's text. Answers with where the flow is now: its URL, or
|
|
1357
|
+
* the next step. Then `complete` as before. Additive.
|
|
1358
|
+
*/
|
|
1359
|
+
'auth.oauth.respond': {
|
|
1360
|
+
params: {
|
|
1361
|
+
flowId: string;
|
|
1362
|
+
stepId: string;
|
|
1363
|
+
value?: string;
|
|
1364
|
+
};
|
|
1365
|
+
result: HostOAuthBegin;
|
|
1366
|
+
};
|
|
1367
|
+
/** Abandon a flow of this connection. */
|
|
1368
|
+
'auth.oauth.cancel': {
|
|
1369
|
+
params: {
|
|
1370
|
+
flowId: string;
|
|
1371
|
+
};
|
|
1372
|
+
result: {
|
|
1373
|
+
cancelled: boolean;
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
/**
|
|
1377
|
+
* What the host discovered for the settings tabs, each entry with whether
|
|
1378
|
+
* the host's settings enable it (an unset allowlist enables everything).
|
|
1379
|
+
* `cwd` adds the project scope of that folder (inside the workspace roots
|
|
1380
|
+
* on a server); without it, the user scope (the host user's home). The
|
|
1381
|
+
* enabled lists are written with `settings.set`. Installing, removing and
|
|
1382
|
+
* MCP sign-in stay on the host's machine. Additive.
|
|
1383
|
+
*/
|
|
1384
|
+
'catalog.skills': {
|
|
1385
|
+
params: {
|
|
1386
|
+
cwd?: string;
|
|
1387
|
+
kind?: string;
|
|
1388
|
+
};
|
|
1389
|
+
result: {
|
|
1390
|
+
skills: HostCatalogSkill[];
|
|
1391
|
+
};
|
|
1392
|
+
};
|
|
1393
|
+
/** MCP servers: `env` and `headers` values, URL credentials and query values are redacted. */
|
|
1394
|
+
'catalog.mcps': {
|
|
1395
|
+
params: {
|
|
1396
|
+
cwd?: string;
|
|
1397
|
+
kind?: string;
|
|
1398
|
+
};
|
|
1399
|
+
result: {
|
|
1400
|
+
servers: HostCatalogMcp[];
|
|
1401
|
+
errors: HostCatalogError[];
|
|
1402
|
+
};
|
|
1403
|
+
};
|
|
1404
|
+
'catalog.extensions': {
|
|
1405
|
+
params: {
|
|
1406
|
+
cwd?: string;
|
|
1407
|
+
kind?: string;
|
|
1408
|
+
};
|
|
1409
|
+
result: {
|
|
1410
|
+
extensions: HostCatalogExtension[];
|
|
1411
|
+
};
|
|
1412
|
+
};
|
|
1413
|
+
'catalog.plugins': {
|
|
1414
|
+
params: {
|
|
1415
|
+
cwd?: string;
|
|
1416
|
+
kind?: string;
|
|
1417
|
+
};
|
|
1418
|
+
result: {
|
|
1419
|
+
plugins: HostCatalogPlugin[];
|
|
1420
|
+
};
|
|
1421
|
+
};
|
|
1422
|
+
/**
|
|
1423
|
+
* Install a skill or an extension on the host, in its user's scope only
|
|
1424
|
+
* (`scope` may only be `'user'`): a GitHub (`owner/repo[#ref][:dir]`, a
|
|
1425
|
+
* GitHub URL, a skills.sh URL) or npm spec; paths are refused. `skills` /
|
|
1426
|
+
* `all` pick from a multi-skill source (the `multiple-candidates` error
|
|
1427
|
+
* lists them), `extension` from a multi-extension one. Runs the host's
|
|
1428
|
+
* package managers and fetches code there: a zidane-server's
|
|
1429
|
+
* `allowRemoteInstalls` gates it, every attempt is audited. Bounded in
|
|
1430
|
+
* time; the progress lines come back with the result. Every window gets
|
|
1431
|
+
* `catalog:changed`. Additive (`remoteInstalls` on `ipc.hello`).
|
|
1432
|
+
*/
|
|
1433
|
+
'catalog.install': {
|
|
1434
|
+
params: {
|
|
1435
|
+
kind: HostInstallKind;
|
|
1436
|
+
spec: string;
|
|
1437
|
+
scope?: 'user';
|
|
1438
|
+
skills?: string[];
|
|
1439
|
+
all?: boolean;
|
|
1440
|
+
extension?: string;
|
|
1441
|
+
overwrite?: boolean;
|
|
1442
|
+
};
|
|
1443
|
+
result: {
|
|
1444
|
+
installed: string[];
|
|
1445
|
+
message: string;
|
|
1446
|
+
progress: string[];
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
/** Remove a user-scope skill or extension of the host by name (its directory). As `catalog.install`. */
|
|
1450
|
+
'catalog.remove': {
|
|
1451
|
+
params: {
|
|
1452
|
+
kind: HostInstallKind;
|
|
1453
|
+
name: string;
|
|
1454
|
+
};
|
|
1455
|
+
result: {
|
|
1456
|
+
removed: string;
|
|
1457
|
+
message: string;
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
1460
|
+
/** Update a user-scope extension installed from a source. As `catalog.install`. */
|
|
1461
|
+
'catalog.update': {
|
|
1462
|
+
params: {
|
|
1463
|
+
kind: HostInstallKind;
|
|
1464
|
+
name: string;
|
|
1465
|
+
};
|
|
1466
|
+
result: {
|
|
1467
|
+
updated: string;
|
|
1468
|
+
upToDate: boolean;
|
|
1469
|
+
message: string;
|
|
1470
|
+
};
|
|
1471
|
+
};
|
|
1472
|
+
/**
|
|
1473
|
+
* Add or replace an MCP server in the host user's `mcps.json`. Its `env` /
|
|
1474
|
+
* `headers` values are stored there and never come back (`catalog.mcps`
|
|
1475
|
+
* redacts them, the reply names the server only). As `catalog.install`.
|
|
1476
|
+
*/
|
|
1477
|
+
'mcp.upsert': {
|
|
1478
|
+
params: {
|
|
1479
|
+
config: McpServerConfig;
|
|
1480
|
+
};
|
|
1481
|
+
result: {
|
|
1482
|
+
name: string;
|
|
1483
|
+
created: boolean;
|
|
1484
|
+
};
|
|
1485
|
+
};
|
|
1486
|
+
/** Remove an MCP server from the host user's `mcps.json`; `removed: false` when it has none. As `catalog.install`. */
|
|
1487
|
+
'mcp.remove': {
|
|
1488
|
+
params: {
|
|
1489
|
+
name: string;
|
|
1490
|
+
};
|
|
1491
|
+
result: {
|
|
1492
|
+
removed: boolean;
|
|
1493
|
+
};
|
|
1494
|
+
};
|
|
1495
|
+
/**
|
|
1496
|
+
* The host's credentialed providers (what its agents can run) and their
|
|
1497
|
+
* models, for a model picker of a session on that host. `cwd` adds the
|
|
1498
|
+
* providers its extensions contribute there. Additive.
|
|
1499
|
+
*/
|
|
1500
|
+
'models.list': {
|
|
1501
|
+
params: {
|
|
1502
|
+
cwd?: string;
|
|
1503
|
+
kind?: string;
|
|
1504
|
+
};
|
|
1505
|
+
result: {
|
|
1506
|
+
providers: HostModelProvider[];
|
|
1507
|
+
};
|
|
1508
|
+
};
|
|
1509
|
+
/**
|
|
1510
|
+
* The machines this host knows (`docs/MACHINES.md`), online or not, and
|
|
1511
|
+
* forgetting one (it disconnects; its `local@` / `worktree@` kinds stop
|
|
1512
|
+
* resolving). Additive.
|
|
1513
|
+
*/
|
|
1514
|
+
'machines.list': {
|
|
1515
|
+
params: Record<string, never>;
|
|
1516
|
+
result: MachineInfo[];
|
|
1517
|
+
};
|
|
1518
|
+
'machines.forget': {
|
|
1519
|
+
params: {
|
|
1520
|
+
machineId: string;
|
|
1521
|
+
};
|
|
1522
|
+
result: {
|
|
1523
|
+
forgotten: boolean;
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Folders of a machine, for a client's folder picker: the host proxies a
|
|
1528
|
+
* listing to the machine (`fs.list`, confined to its roots there): the
|
|
1529
|
+
* folders in `path` (absent: its first root), and every root. Additive.
|
|
1530
|
+
*/
|
|
1531
|
+
'machines.listDirs': {
|
|
1532
|
+
params: {
|
|
1533
|
+
machineId: string;
|
|
1534
|
+
path?: string;
|
|
1535
|
+
};
|
|
1536
|
+
result: {
|
|
1537
|
+
path: string;
|
|
1538
|
+
dirs: string[];
|
|
1539
|
+
roots: string[];
|
|
1540
|
+
};
|
|
1541
|
+
};
|
|
1542
|
+
/**
|
|
1543
|
+
* A local host's machine links (`docs/MACHINES.md` § Client UI), behind
|
|
1544
|
+
* remote hosts: share this computer with a saved server (the machine agent
|
|
1545
|
+
* runs in this host's process, with the machine token `token` or the one
|
|
1546
|
+
* already stored for that server), stop sharing, use a saved server as a
|
|
1547
|
+
* machine (reverse direction), and read their state. Refused while remote
|
|
1548
|
+
* hosts are off. Additive.
|
|
1549
|
+
*/
|
|
1550
|
+
'machines.share.start': {
|
|
1551
|
+
params: {
|
|
1552
|
+
hostId: string;
|
|
1553
|
+
name: string;
|
|
1554
|
+
roots: string[];
|
|
1555
|
+
token?: string;
|
|
1556
|
+
};
|
|
1557
|
+
result: MachineLinksStatus;
|
|
1558
|
+
};
|
|
1559
|
+
'machines.share.stop': {
|
|
1560
|
+
params: {
|
|
1561
|
+
hostId: string;
|
|
1562
|
+
};
|
|
1563
|
+
result: MachineLinksStatus;
|
|
1564
|
+
};
|
|
1565
|
+
'machines.useServer': {
|
|
1566
|
+
params: {
|
|
1567
|
+
hostId: string;
|
|
1568
|
+
enabled: boolean;
|
|
1569
|
+
};
|
|
1570
|
+
result: MachineLinksStatus;
|
|
1571
|
+
};
|
|
1572
|
+
'machines.links.status': {
|
|
1573
|
+
params: Record<string, never>;
|
|
1574
|
+
result: MachineLinksStatus;
|
|
1575
|
+
};
|
|
1576
|
+
/**
|
|
1577
|
+
* Reverse direction (`docs/MACHINES.md` § Reverse direction): a client asks
|
|
1578
|
+
* this server to lend itself as a machine over this very connection
|
|
1579
|
+
* (`allowAsMachine` on, else refused). `hostId` names the asking host, so
|
|
1580
|
+
* a reconnect finds its tasks and terminals again. Then `machine.call`
|
|
1581
|
+
* carries each host→machine request (`MachineMethods`), answered by the
|
|
1582
|
+
* server's confined executor; machine notifications come back as
|
|
1583
|
+
* `machine:notification` signals on this connection only.
|
|
1584
|
+
*/
|
|
1585
|
+
'machine.attach': {
|
|
1586
|
+
params: {
|
|
1587
|
+
hostId: string;
|
|
1588
|
+
};
|
|
1589
|
+
result: MachineRegisterParams;
|
|
1590
|
+
};
|
|
1591
|
+
'machine.call': {
|
|
1592
|
+
params: {
|
|
1593
|
+
method: string;
|
|
1594
|
+
params?: JsonValue;
|
|
1595
|
+
};
|
|
1596
|
+
result: JsonValue;
|
|
1597
|
+
};
|
|
1598
|
+
'machine.detach': {
|
|
1599
|
+
params: Record<string, never>;
|
|
1600
|
+
result: {
|
|
1601
|
+
detached: boolean;
|
|
1602
|
+
};
|
|
1603
|
+
};
|
|
1604
|
+
/**
|
|
1605
|
+
* Mint a `machine`-scoped token on this server (a zidane-server only), so
|
|
1606
|
+
* a window can share its computer in one step. Any client may: in the
|
|
1607
|
+
* single-user model a client token is already an admin's. Audited.
|
|
1608
|
+
*/
|
|
1609
|
+
'tokens.createMachineToken': {
|
|
1610
|
+
params: {
|
|
1611
|
+
name: string;
|
|
1612
|
+
};
|
|
1613
|
+
result: {
|
|
1614
|
+
id: string;
|
|
1615
|
+
name: string;
|
|
1616
|
+
token: string;
|
|
1617
|
+
};
|
|
1618
|
+
};
|
|
1619
|
+
'sync.status': {
|
|
1620
|
+
params: Record<string, never>;
|
|
1621
|
+
result: SyncStatus;
|
|
1622
|
+
};
|
|
1623
|
+
'sync.claim': {
|
|
1624
|
+
params: {
|
|
1625
|
+
deviceId: string;
|
|
1626
|
+
deviceName: string;
|
|
1627
|
+
takeover?: boolean;
|
|
1628
|
+
categories?: SyncCategory[];
|
|
1629
|
+
keys?: string[];
|
|
1630
|
+
};
|
|
1631
|
+
result: SyncClaimResult;
|
|
1632
|
+
};
|
|
1633
|
+
'sync.push': {
|
|
1634
|
+
params: {
|
|
1635
|
+
deviceId: string;
|
|
1636
|
+
category: SyncCategory;
|
|
1637
|
+
payload: SyncPayload;
|
|
1638
|
+
};
|
|
1639
|
+
result: SyncPushResult;
|
|
1640
|
+
};
|
|
1641
|
+
'sync.reset': {
|
|
1642
|
+
params: {
|
|
1643
|
+
field: string;
|
|
1644
|
+
};
|
|
1645
|
+
result: {
|
|
1646
|
+
reset: boolean;
|
|
1647
|
+
};
|
|
1648
|
+
};
|
|
1649
|
+
'sync.release': {
|
|
1650
|
+
params: {
|
|
1651
|
+
deviceId: string;
|
|
1652
|
+
};
|
|
1653
|
+
result: {
|
|
1654
|
+
released: boolean;
|
|
1655
|
+
};
|
|
1656
|
+
};
|
|
1657
|
+
'daemon.info': {
|
|
1658
|
+
params: Record<string, never>;
|
|
1659
|
+
result: HelloResult;
|
|
1660
|
+
};
|
|
1661
|
+
/**
|
|
1662
|
+
* Graceful drain: deny pending approvals, abort live runs, close the
|
|
1663
|
+
* socket. Used by clients that detect a protocol-version mismatch and
|
|
1664
|
+
* need the stale daemon gone before respawning.
|
|
1665
|
+
*
|
|
1666
|
+
* `whenIdle` (version-skew retirement): a daemon with active work does
|
|
1667
|
+
* NOT abort it. It answers `{ deferred: true }` and exits once idle.
|
|
1668
|
+
* Explicit stops (`zidane daemon stop`) omit it and drain immediately.
|
|
1669
|
+
* Daemons predating the flag ignore it and drain immediately.
|
|
1670
|
+
*/
|
|
1671
|
+
'daemon.shutdown': {
|
|
1672
|
+
params: {
|
|
1673
|
+
whenIdle?: boolean;
|
|
1674
|
+
};
|
|
1675
|
+
result: {
|
|
1676
|
+
deferred?: boolean;
|
|
1677
|
+
} | void;
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
/** The host's identity from a hello (or `daemon.info`) reply; `null` from a host that predates it. */
|
|
1681
|
+
declare function hostRefOf(hello: HelloResult): HostRef | null;
|
|
1682
|
+
type IpcMethodName = keyof IpcMethods;
|
|
1683
|
+
type IpcParams<M extends IpcMethodName> = IpcMethods[M]['params'];
|
|
1684
|
+
type IpcResult<M extends IpcMethodName> = IpcMethods[M]['result'];
|
|
1685
|
+
/** Turns per `sessions.loadEvents` page when only `before` is given. */
|
|
1686
|
+
declare const LOAD_EVENTS_PAGE_TURNS = 200;
|
|
1687
|
+
/** Largest `limit` a host honors. */
|
|
1688
|
+
declare const LOAD_EVENTS_MAX_PAGE_TURNS = 1000;
|
|
1689
|
+
interface LoadEventsPaging {
|
|
1690
|
+
/** Turn position (exclusive) the page ends at: a previous page's `cursor`. */
|
|
1691
|
+
before?: number;
|
|
1692
|
+
/** Turns in the page. */
|
|
1693
|
+
limit?: number;
|
|
1694
|
+
}
|
|
1695
|
+
interface SessionEventsPage {
|
|
1696
|
+
events: StreamEvent[];
|
|
1697
|
+
/** Pass as `before` for the page before this one; absent once the first turn is in. */
|
|
1698
|
+
cursor?: number;
|
|
1699
|
+
/**
|
|
1700
|
+
* The events are this page's slice of the whole replay, so pages
|
|
1701
|
+
* concatenate to exactly one whole `loadEvents`. Absent from an older
|
|
1702
|
+
* host, whose pages replay on their own ({@link loadAllEvents} restores
|
|
1703
|
+
* the exchange separator at their joins).
|
|
1704
|
+
*/
|
|
1705
|
+
exact?: true;
|
|
1706
|
+
/**
|
|
1707
|
+
* With `exact`: how many events of the whole replay come before this
|
|
1708
|
+
* page. Lets a client open on the tail of a long transcript and still
|
|
1709
|
+
* say how much it left out ({@link loadEventsTail}). Absent from an
|
|
1710
|
+
* older host.
|
|
1711
|
+
*/
|
|
1712
|
+
start?: number;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* One page of `sessions.loadEvents` (see its paging). An older host answers
|
|
1716
|
+
* the whole transcript: it comes back as one page with no cursor.
|
|
1717
|
+
*/
|
|
1718
|
+
declare function loadEventsPage(request: (method: 'sessions.loadEvents', params: {
|
|
1719
|
+
sessionId: string;
|
|
1720
|
+
}) => Promise<StreamEvent[]>, params: {
|
|
1721
|
+
sessionId: string;
|
|
1722
|
+
} & LoadEventsPaging): Promise<SessionEventsPage>;
|
|
1723
|
+
/**
|
|
1724
|
+
* A session's whole transcript, loaded a page at a time from the end so no
|
|
1725
|
+
* single reply carries it all (a long session with images can outgrow a
|
|
1726
|
+
* transport's message size). A page refused as too large is asked again at
|
|
1727
|
+
* half the turns, down to one; a single turn that still doesn't fit fails
|
|
1728
|
+
* the load. An older host answers the whole transcript to the first call.
|
|
1729
|
+
*/
|
|
1730
|
+
declare function loadAllEvents(request: (method: 'sessions.loadEvents', params: {
|
|
1731
|
+
sessionId: string;
|
|
1732
|
+
}) => Promise<StreamEvent[]>, sessionId: string, options?: {
|
|
1733
|
+
pageTurns?: number;
|
|
1734
|
+
}): Promise<StreamEvent[]>;
|
|
1735
|
+
/** Turns per `sessions.getTurns` page by default. */
|
|
1736
|
+
declare const SESSION_TURNS_PAGE = 200;
|
|
1737
|
+
/** Largest `limit` a host honors for `sessions.getTurns`. */
|
|
1738
|
+
declare const SESSION_TURNS_MAX_PAGE = 1000;
|
|
1739
|
+
type SessionDocumentRequest = <M extends 'sessions.get' | 'sessions.getTurns'>(method: M, params: IpcParams<M>) => Promise<IpcResult<M>>;
|
|
1740
|
+
/**
|
|
1741
|
+
* What `sessions.get` answers: the document; with `turns: false`, the
|
|
1742
|
+
* version of the snapshot it was cut from, the one `sessions.getTurns`
|
|
1743
|
+
* pages carry.
|
|
1744
|
+
*/
|
|
1745
|
+
type SessionDocumentHead = SessionData & {
|
|
1746
|
+
version?: string;
|
|
1747
|
+
};
|
|
1748
|
+
/**
|
|
1749
|
+
* A session's whole document, read a page of turns at a time so no reply
|
|
1750
|
+
* carries it all (`sessions.getTurns` pages, then the `sessions.get`
|
|
1751
|
+
* `turns: false` head; a page refused as too large is asked again at half
|
|
1752
|
+
* the turns). Every page and the head name the snapshot they come from: a
|
|
1753
|
+
* version change mid-read (a turn appended, a compaction) starts the read
|
|
1754
|
+
* over, so the result is one version, never pages of two. After
|
|
1755
|
+
* {@link SESSION_DOCUMENT_RESTARTS} restarts (a session busier than the
|
|
1756
|
+
* read), the whole document comes in one reply. A host that predates
|
|
1757
|
+
* `sessions.getTurns` sends it that way too; one that names no version is
|
|
1758
|
+
* read as before. `null` when the host doesn't know the session.
|
|
1759
|
+
*/
|
|
1760
|
+
declare function loadSessionDocument(request: SessionDocumentRequest, sessionId: string, options?: {
|
|
1761
|
+
pageTurns?: number;
|
|
1762
|
+
}): Promise<SessionData | null>;
|
|
1763
|
+
/** A catalog entry's on/off state as the host's settings decide it. */
|
|
1764
|
+
interface HostCatalogToggle {
|
|
1765
|
+
name: string;
|
|
1766
|
+
/** The host's settings enable it (always `false` for an entry that cannot load). */
|
|
1767
|
+
enabled: boolean;
|
|
1768
|
+
/**
|
|
1769
|
+
* Its own allowlist governs it (`enabledSkills`, …). `false`: contributed
|
|
1770
|
+
* by a plugin or extension (their toggle governs it), or broken.
|
|
1771
|
+
*/
|
|
1772
|
+
toggleable: boolean;
|
|
1773
|
+
}
|
|
1774
|
+
interface HostCatalogSkill extends HostCatalogToggle {
|
|
1775
|
+
description: string;
|
|
1776
|
+
source?: 'project' | 'user' | 'inline' | 'builtin';
|
|
1777
|
+
/** `SKILL.md` on the host's machine. */
|
|
1778
|
+
location?: string;
|
|
1779
|
+
/** `disk`: a scan path; else the plugin or extension that contributes it (`contributedBy`). */
|
|
1780
|
+
origin: 'disk' | 'plugin' | 'extension';
|
|
1781
|
+
contributedBy?: string;
|
|
1782
|
+
}
|
|
1783
|
+
/** Every secret-bearing value of a catalog entry is replaced by this. */
|
|
1784
|
+
declare const REDACTED = "<redacted>";
|
|
1785
|
+
interface HostCatalogMcp extends HostCatalogToggle {
|
|
1786
|
+
transport: 'stdio' | 'sse' | 'streamable-http';
|
|
1787
|
+
source: 'project' | 'user';
|
|
1788
|
+
/** The config file on the host's machine. */
|
|
1789
|
+
path: string;
|
|
1790
|
+
command?: string;
|
|
1791
|
+
args?: string[];
|
|
1792
|
+
/** Credentials and query values redacted. */
|
|
1793
|
+
url?: string;
|
|
1794
|
+
cwd?: string;
|
|
1795
|
+
scope?: 'host' | 'context';
|
|
1796
|
+
auth?: 'oauth';
|
|
1797
|
+
/** Names only: every value is {@link REDACTED}. */
|
|
1798
|
+
env?: Record<string, string>;
|
|
1799
|
+
headers?: Record<string, string>;
|
|
1800
|
+
}
|
|
1801
|
+
/** A config file that failed to parse (or an informational skip). */
|
|
1802
|
+
interface HostCatalogError {
|
|
1803
|
+
path: string;
|
|
1804
|
+
source: 'project' | 'user';
|
|
1805
|
+
message: string;
|
|
1806
|
+
informational?: boolean;
|
|
1807
|
+
}
|
|
1808
|
+
interface HostCatalogExtension extends HostCatalogToggle {
|
|
1809
|
+
source: 'user' | 'project' | 'inline' | 'builtin';
|
|
1810
|
+
version?: string;
|
|
1811
|
+
description?: string;
|
|
1812
|
+
dir?: string;
|
|
1813
|
+
/** Why it did not load. */
|
|
1814
|
+
error?: string;
|
|
1815
|
+
/** What it contributes: `tools`, `skills`, `mcps`, `commands`, … */
|
|
1816
|
+
capabilities?: string[];
|
|
1817
|
+
}
|
|
1818
|
+
interface HostCatalogPlugin extends HostCatalogToggle {
|
|
1819
|
+
origin: {
|
|
1820
|
+
kind: 'disk';
|
|
1821
|
+
scope: 'project' | 'user';
|
|
1822
|
+
dir: string;
|
|
1823
|
+
} | {
|
|
1824
|
+
kind: 'extension';
|
|
1825
|
+
extensionName: string;
|
|
1826
|
+
dir: string;
|
|
1827
|
+
};
|
|
1828
|
+
/** `false`: the manifest was rejected (`error` says why). */
|
|
1829
|
+
ok: boolean;
|
|
1830
|
+
version?: string;
|
|
1831
|
+
description?: string;
|
|
1832
|
+
skills: string[];
|
|
1833
|
+
mcpServers: string[];
|
|
1834
|
+
error?: string;
|
|
1835
|
+
}
|
|
1836
|
+
/** One provider a host can run, with its models (`models.list`). */
|
|
1837
|
+
interface HostModelProvider {
|
|
1838
|
+
key: string;
|
|
1839
|
+
label: string;
|
|
1840
|
+
models: HostModelInfo[];
|
|
1841
|
+
}
|
|
1842
|
+
/** `ModelInfo` as it crosses the wire. */
|
|
1843
|
+
interface HostModelInfo {
|
|
1844
|
+
id: string;
|
|
1845
|
+
name?: string;
|
|
1846
|
+
contextWindow: number;
|
|
1847
|
+
maxTokens?: number;
|
|
1848
|
+
reasoning?: boolean;
|
|
1849
|
+
input?: ('text' | 'image')[];
|
|
1850
|
+
cost?: {
|
|
1851
|
+
input: number;
|
|
1852
|
+
output: number;
|
|
1853
|
+
cacheRead?: number;
|
|
1854
|
+
cacheWrite?: number;
|
|
1855
|
+
};
|
|
1856
|
+
provider?: string;
|
|
1857
|
+
options?: {
|
|
1858
|
+
id: string;
|
|
1859
|
+
label: string;
|
|
1860
|
+
description?: string;
|
|
1861
|
+
costMultiplier?: {
|
|
1862
|
+
input?: number;
|
|
1863
|
+
output?: number;
|
|
1864
|
+
cacheRead?: number;
|
|
1865
|
+
cacheWrite?: number;
|
|
1866
|
+
};
|
|
1867
|
+
}[];
|
|
1868
|
+
}
|
|
1869
|
+
/** One credential source of a host's provider (`auth.status`); no secret. */
|
|
1870
|
+
interface HostAuthMethod {
|
|
1871
|
+
source: 'apikey' | 'oauth' | 'env';
|
|
1872
|
+
/** A stored credential the provider resolves (`env` never is). */
|
|
1873
|
+
active: boolean;
|
|
1874
|
+
/** Credentials-file key of a stored credential: the `account` of `auth.remove`. */
|
|
1875
|
+
key?: string;
|
|
1876
|
+
/** OAuth account name. */
|
|
1877
|
+
label?: string;
|
|
1878
|
+
/** Display detail: `credentials.json`, an OAuth account and its expiry, an env var name. */
|
|
1879
|
+
detail: string;
|
|
1880
|
+
}
|
|
1881
|
+
/** `auth.oauth.begin`: what the client shows and where the code comes back. */
|
|
1882
|
+
/**
|
|
1883
|
+
* A question the provider's sign-in asks before (or after) its URL: a choice
|
|
1884
|
+
* between flows, or a free text. The client shows it and answers with
|
|
1885
|
+
* `auth.oauth.respond`; the host never picks for the user.
|
|
1886
|
+
*/
|
|
1887
|
+
type HostOAuthStep = {
|
|
1888
|
+
id: string;
|
|
1889
|
+
kind: 'select';
|
|
1890
|
+
message: string;
|
|
1891
|
+
options: Array<{
|
|
1892
|
+
id: string;
|
|
1893
|
+
label: string;
|
|
1894
|
+
}>;
|
|
1895
|
+
} | {
|
|
1896
|
+
id: string;
|
|
1897
|
+
kind: 'prompt';
|
|
1898
|
+
message: string;
|
|
1899
|
+
placeholder?: string;
|
|
1900
|
+
allowEmpty?: boolean;
|
|
1901
|
+
};
|
|
1902
|
+
interface HostOAuthBegin {
|
|
1903
|
+
/** Random, single-use, bound to the connection that began it. */
|
|
1904
|
+
flowId: string;
|
|
1905
|
+
/** The authorization URL (a device flow: its verification URL); `''` while a `step` comes first. */
|
|
1906
|
+
url: string;
|
|
1907
|
+
/** `step`: answer {@link step} (`auth.oauth.respond`) before the URL exists. */
|
|
1908
|
+
mode: 'loopback' | 'browser' | 'device' | 'step';
|
|
1909
|
+
step?: HostOAuthStep;
|
|
1910
|
+
/** `loopback`: where the browser is sent back, on the client's machine. */
|
|
1911
|
+
redirectUri?: string;
|
|
1912
|
+
/** `device`: the code to enter at `url`. */
|
|
1913
|
+
userCode?: string;
|
|
1914
|
+
instructions?: string;
|
|
1915
|
+
/** Epoch ms: the host forgets the flow after it. */
|
|
1916
|
+
expiresAt: number;
|
|
1917
|
+
}
|
|
1918
|
+
/** `auth.oauth.complete`: the outcome, never a token. */
|
|
1919
|
+
interface HostOAuthComplete {
|
|
1920
|
+
/** A provider sign-in: its new status. */
|
|
1921
|
+
provider?: HostProviderAuth;
|
|
1922
|
+
/** An MCP server sign-in: its name. */
|
|
1923
|
+
mcpServer?: string;
|
|
1924
|
+
/** Not finished: the sign-in asks this. Answer it (`auth.oauth.respond`), then `complete` again. */
|
|
1925
|
+
step?: HostOAuthStep;
|
|
1926
|
+
}
|
|
1927
|
+
interface HostProviderAuth {
|
|
1928
|
+
key: string;
|
|
1929
|
+
label: string;
|
|
1930
|
+
/** Some credential source is present. */
|
|
1931
|
+
configured: boolean;
|
|
1932
|
+
/** The provider signs in with OAuth (on the host's machine only). */
|
|
1933
|
+
oauth: boolean;
|
|
1934
|
+
/** The env var it reads, when it declares one. */
|
|
1935
|
+
envKey?: string;
|
|
1936
|
+
methods: HostAuthMethod[];
|
|
1937
|
+
}
|
|
1938
|
+
interface FsRoots {
|
|
1939
|
+
/** Real paths, the default first. */
|
|
1940
|
+
roots: string[];
|
|
1941
|
+
/** Session folders must be inside `roots` (a server). */
|
|
1942
|
+
confined: boolean;
|
|
1943
|
+
}
|
|
1944
|
+
interface FsDirEntry {
|
|
1945
|
+
name: string;
|
|
1946
|
+
/** Real path (a symlink resolved). */
|
|
1947
|
+
path: string;
|
|
1948
|
+
/** Holds a `.git`. */
|
|
1949
|
+
isGitRepo: boolean;
|
|
1950
|
+
}
|
|
1951
|
+
interface FsDirListing {
|
|
1952
|
+
roots: string[];
|
|
1953
|
+
/** The listed folder, as a real path. */
|
|
1954
|
+
path: string;
|
|
1955
|
+
/** The folder above, or `null` at a root. */
|
|
1956
|
+
parent: string | null;
|
|
1957
|
+
/** Sorted by name. */
|
|
1958
|
+
entries: FsDirEntry[];
|
|
1959
|
+
/** More folders than the listing returns. */
|
|
1960
|
+
truncated?: boolean;
|
|
1961
|
+
}
|
|
1962
|
+
/** One row in a cross-window session list. */
|
|
1963
|
+
/** One ordered model-fallback target (primary excluded). */
|
|
1964
|
+
interface ModelFallbackRef {
|
|
1965
|
+
providerKey: ProviderKey;
|
|
1966
|
+
modelId: string;
|
|
1967
|
+
}
|
|
1968
|
+
interface SessionRow {
|
|
1969
|
+
id: string;
|
|
1970
|
+
title: string;
|
|
1971
|
+
projectRoot: string | null;
|
|
1972
|
+
cwd: string;
|
|
1973
|
+
agentId?: string;
|
|
1974
|
+
status: 'idle' | 'running' | 'completed' | 'error';
|
|
1975
|
+
createdAt: number;
|
|
1976
|
+
updatedAt: number;
|
|
1977
|
+
archived: boolean;
|
|
1978
|
+
/** Orchestration main session — see `SessionMeta.isMain`. Additive. */
|
|
1979
|
+
isMain?: boolean;
|
|
1980
|
+
providerKey?: ProviderKey;
|
|
1981
|
+
modelId?: string;
|
|
1982
|
+
effort?: ThinkingLevel;
|
|
1983
|
+
modelOptions?: Record<string, boolean>;
|
|
1984
|
+
/** Validated (head-matched) fallback chain tail, for pickers/badges. */
|
|
1985
|
+
modelFallbacks?: ModelFallbackRef[];
|
|
1986
|
+
/** Non-local environment summary (kind, state, branch, error). */
|
|
1987
|
+
environment?: SessionEnvironmentSummary;
|
|
1988
|
+
/** The host serving this row (`HelloResult.hostId`). Additive: absent from older hosts. */
|
|
1989
|
+
hostId?: string;
|
|
1990
|
+
}
|
|
1991
|
+
interface CreateSessionParams {
|
|
1992
|
+
/** Tool-execution directory — `projectRoot` is derived from it host-side. */
|
|
1993
|
+
cwd: string;
|
|
1994
|
+
title?: string;
|
|
1995
|
+
agentId?: string;
|
|
1996
|
+
providerKey?: ProviderKey;
|
|
1997
|
+
modelId?: string;
|
|
1998
|
+
/** Seed an ordered fallback chain alongside the model pick. */
|
|
1999
|
+
fallbacks?: ModelFallbackRef[];
|
|
2000
|
+
/** The model pick's reasoning effort and options, stamped with it. */
|
|
2001
|
+
effort?: ThinkingLevel;
|
|
2002
|
+
modelOptions?: Record<string, boolean>;
|
|
2003
|
+
/** Skills pinned from the first turn (an authoring session's docs skill). */
|
|
2004
|
+
pinnedSkills?: string[];
|
|
2005
|
+
/** Mark as an extension-authoring session (auto-activates the docs skill). */
|
|
2006
|
+
extensionEdit?: boolean;
|
|
2007
|
+
/** Mark as a skill-authoring session for the named skill (dir = `cwd`). */
|
|
2008
|
+
skillEdit?: {
|
|
2009
|
+
name: string;
|
|
2010
|
+
};
|
|
2011
|
+
/** Where the session's work happens. Omitted → local. */
|
|
2012
|
+
environment?: EnvironmentRequest;
|
|
2013
|
+
}
|
|
2014
|
+
interface HelloParams {
|
|
2015
|
+
protocolVersion: number;
|
|
2016
|
+
/** Client's zidane version — surfaced in daemon diagnostics. */
|
|
2017
|
+
appVersion: string;
|
|
2018
|
+
pid: number;
|
|
2019
|
+
/**
|
|
2020
|
+
* Build fingerprint (module mtime; `'unknown'` in compiled binaries).
|
|
2021
|
+
* When BOTH sides report a real id and they differ, the daemon rejects
|
|
2022
|
+
* the handshake like a protocol-version mismatch — the client drains it
|
|
2023
|
+
* and respawns. Closes same-version code drift during development.
|
|
2024
|
+
*/
|
|
2025
|
+
buildId?: string;
|
|
2026
|
+
/**
|
|
2027
|
+
* Version of the zidane code the client runs (`ZIDANE_VERSION`, inlined at
|
|
2028
|
+
* build). Unlike `buildId` this survives compiled binaries, so it closes
|
|
2029
|
+
* the gap released builds had: same protocol version, older code. A
|
|
2030
|
+
* client STRICTLY NEWER than the daemon is rejected like a build mismatch
|
|
2031
|
+
* and the stale daemon is drained; an older client is accepted and
|
|
2032
|
+
* degrades via `optional()`.
|
|
2033
|
+
*/
|
|
2034
|
+
codeVersion?: string;
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* What a host process is: a window's own (`in-process`), the local shared
|
|
2038
|
+
* daemon (`daemon`), or a remote `zidane-server` (`server`).
|
|
2039
|
+
*/
|
|
2040
|
+
type HostKind = 'in-process' | 'daemon' | 'server';
|
|
2041
|
+
/** Which host a client is talking to, as clients keep it (from `hostRefOf`). */
|
|
2042
|
+
interface HostRef {
|
|
2043
|
+
/** Stable across restarts: persisted in the host's data dir. */
|
|
2044
|
+
id: string;
|
|
2045
|
+
kind: HostKind;
|
|
2046
|
+
/** Display name: the machine's hostname by default. */
|
|
2047
|
+
name: string;
|
|
2048
|
+
}
|
|
2049
|
+
interface HelloResult {
|
|
2050
|
+
protocolVersion: number;
|
|
2051
|
+
appVersion: string;
|
|
2052
|
+
pid: number;
|
|
2053
|
+
startedAt: number;
|
|
2054
|
+
buildId?: string;
|
|
2055
|
+
codeVersion?: string;
|
|
2056
|
+
/**
|
|
2057
|
+
* Host identity (additive). `hostId` is a UUID persisted once in the host's
|
|
2058
|
+
* data dir, so it survives restarts; the in-process host and the local
|
|
2059
|
+
* daemon share the data dir, and so the id: they are the same computer.
|
|
2060
|
+
*/
|
|
2061
|
+
hostId?: string;
|
|
2062
|
+
hostKind?: HostKind;
|
|
2063
|
+
hostName?: string;
|
|
2064
|
+
/**
|
|
2065
|
+
* The daemon is older than a client that attached while it had active
|
|
2066
|
+
* work: it accepted the handshake instead of draining (which would abort
|
|
2067
|
+
* those runs) and exits once idle. Clients attach normally; their
|
|
2068
|
+
* reconnect path lands on a fresh daemon after the exit.
|
|
2069
|
+
*/
|
|
2070
|
+
retiring?: boolean;
|
|
2071
|
+
/**
|
|
2072
|
+
* Names this host process's signal numbering ({@link SIGNAL_SEQ_FIELD}):
|
|
2073
|
+
* a position from another epoch cannot be resumed. Additive.
|
|
2074
|
+
*/
|
|
2075
|
+
signalEpoch?: string;
|
|
2076
|
+
/**
|
|
2077
|
+
* This server lends itself as a machine to the hosts of its clients
|
|
2078
|
+
* (`machine.attach`, `allowAsMachine` on). Absent: it doesn't. Additive.
|
|
2079
|
+
*/
|
|
2080
|
+
machineServe?: boolean;
|
|
2081
|
+
/**
|
|
2082
|
+
* This server takes installs and removals from its clients (`catalog.install`
|
|
2083
|
+
* / `remove` / `update`, `mcp.upsert` / `remove`; `allowRemoteInstalls` on).
|
|
2084
|
+
* Absent: it doesn't (or predates them). Additive.
|
|
2085
|
+
*/
|
|
2086
|
+
remoteInstalls?: boolean;
|
|
2087
|
+
/** This server takes settings sync from a client's computer (`sync.*`). Absent: it doesn't. Additive. */
|
|
2088
|
+
sync?: boolean;
|
|
2089
|
+
}
|
|
2090
|
+
/** `catalog.install` / `remove` / `update`: what is installed from a client, in the host user's scope. */
|
|
2091
|
+
type HostInstallKind = 'skill' | 'extension';
|
|
2092
|
+
//#endregion
|
|
2093
|
+
//#region src/ipc/transports/client-core.d.ts
|
|
2094
|
+
interface IpcClient {
|
|
2095
|
+
hello: HelloResult;
|
|
2096
|
+
request: <M extends IpcMethodName>(method: M, params: IpcParams<M>) => Promise<IpcResult<M>>;
|
|
2097
|
+
/**
|
|
2098
|
+
* Fire-and-forget notification — same method table as `request`, but no
|
|
2099
|
+
* id, no response, no pending-promise bookkeeping. The hot path for
|
|
2100
|
+
* high-frequency writes (per-keystroke draft sync). Daemons that don't
|
|
2101
|
+
* know the method ignore it silently.
|
|
2102
|
+
*/
|
|
2103
|
+
notify: <M extends IpcMethodName>(method: M, params: IpcParams<M>) => void;
|
|
2104
|
+
/** Host signals, with their number in their session when they have one (`SignalMeta`). */
|
|
2105
|
+
onSignal: (cb: SignalListener) => () => void;
|
|
2106
|
+
close: () => void;
|
|
2107
|
+
}
|
|
2108
|
+
type SignalListener = (signal: HostSignal, meta?: SignalMeta) => void;
|
|
2109
|
+
declare class IpcVersionMismatchError extends Error {
|
|
2110
|
+
readonly daemon?: HelloResult | undefined;
|
|
2111
|
+
constructor(message: string, daemon?: HelloResult | undefined);
|
|
2112
|
+
}
|
|
2113
|
+
//#endregion
|
|
2114
|
+
export { LOAD_EVENTS_PAGE_TURNS as A, SessionResumeResult as B, IPC_PROTOCOL_VERSION as C, IpcParams as D, IpcMethods as E, SESSION_TURNS_PAGE as F, loadEventsPage as G, SignalMeta as H, SIGNAL_SEQ_FIELD as I, loadSessionDocument as K, SequencedSignal as L, ModelFallbackRef as M, REDACTED as N, IpcResult as O, SESSION_TURNS_MAX_PAGE as P, SessionDocumentHead as R, HostRef as S, IpcMethodName as T, hostRefOf as U, SessionRow as V, loadAllEvents as W, HostModelProvider as _, FsDirListing as a, HostOAuthStep as b, HelloResult as c, HostCatalogExtension as d, HostCatalogMcp as f, HostModelInfo as g, HostKind as h, FsDirEntry as i, LoadEventsPaging as j, LOAD_EVENTS_MAX_PAGE_TURNS as k, HostAuthMethod as l, HostCatalogSkill as m, IpcVersionMismatchError as n, FsRoots as o, HostCatalogPlugin as p, CreateSessionParams as r, HelloParams as s, IpcClient as t, HostCatalogError as u, HostOAuthBegin as v, IpcErrorCode as w, HostProviderAuth as x, HostOAuthComplete as y, SessionEventsPage as z };
|
|
2115
|
+
//# sourceMappingURL=client-core-BQSyDALT.d.ts.map
|