@evanbobo/dsh-agentdoor 0.0.0-stage → 0.2.2-rc.1
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.en.md +268 -0
- package/README.md +243 -2
- package/THIRD_PARTY_NOTICES +96 -0
- package/assets/provider-icons/antigravity.svg +39 -0
- package/assets/provider-icons/claude-code.png +0 -0
- package/assets/provider-icons/codebuddy.svg +37 -0
- package/assets/provider-icons/codex.png +0 -0
- package/assets/provider-icons/command-code.svg +5 -0
- package/assets/provider-icons/cursor-cli.svg +1 -0
- package/assets/provider-icons/deepseek-harness.svg +9 -0
- package/assets/provider-icons/doubao.png +0 -0
- package/assets/provider-icons/gemini.png +0 -0
- package/assets/provider-icons/grok.png +0 -0
- package/assets/provider-icons/kimi.png +0 -0
- package/assets/provider-icons/kiro-cli.svg +11 -0
- package/assets/provider-icons/minimax-code.svg +4 -0
- package/assets/provider-icons/opencode.png +0 -0
- package/assets/provider-icons/pi.svg +7 -0
- package/assets/provider-icons/qoder-cn.svg +5 -0
- package/assets/provider-icons/qoder.svg +5 -0
- package/assets/provider-icons/r4.svg +4 -0
- package/assets/provider-icons/workbuddy.svg +29 -0
- package/assets/provider-icons/zcode.svg +14 -0
- package/bin/agent-door-credential.mjs +92 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +97 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.js +169 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.js.map +1 -0
- package/data/build/dist/bootstrap/index.d.ts +38 -0
- package/data/build/dist/bootstrap/index.d.ts.map +1 -0
- package/data/build/dist/bootstrap/index.js +44 -0
- package/data/build/dist/bootstrap/index.js.map +1 -0
- package/data/build/dist/client/account-bar.d.ts +14 -0
- package/data/build/dist/client/account-bar.d.ts.map +1 -0
- package/data/build/dist/client/account-bar.js +541 -0
- package/data/build/dist/client/account-bar.js.map +1 -0
- package/data/build/dist/client/adapter-catalog-watch.d.ts +16 -0
- package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -0
- package/data/build/dist/client/adapter-catalog-watch.js +91 -0
- package/data/build/dist/client/adapter-catalog-watch.js.map +1 -0
- package/data/build/dist/client/bundle.js +67698 -0
- package/data/build/dist/client/bundle.js.map +1 -0
- package/data/build/dist/client/cli-catalog.d.ts +29 -0
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -0
- package/data/build/dist/client/cli-catalog.js +148 -0
- package/data/build/dist/client/cli-catalog.js.map +1 -0
- package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
- package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-dialog.js +215 -0
- package/data/build/dist/client/cli-management-dialog.js.map +1 -0
- package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
- package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-terminal.js +30 -0
- package/data/build/dist/client/cli-management-terminal.js.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts +17 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.js +62 -0
- package/data/build/dist/client/cli-session-config-cache.js.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.js +45 -0
- package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
- package/data/build/dist/client/cli-slots.d.ts +64 -0
- package/data/build/dist/client/cli-slots.d.ts.map +1 -0
- package/data/build/dist/client/cli-slots.js +985 -0
- package/data/build/dist/client/cli-slots.js.map +1 -0
- package/data/build/dist/client/client.command-token.js +32 -0
- package/data/build/dist/client/client.command-token.js.map +1 -0
- package/data/build/dist/client/client.delegate-command.js +1314 -0
- package/data/build/dist/client/client.delegate-command.js.map +1 -0
- package/data/build/dist/client/client.editor-engine.js +32557 -0
- package/data/build/dist/client/client.editor-engine.js.map +1 -0
- package/data/build/dist/client/client.primitives-adapter.js +3740 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -0
- package/data/build/dist/client/client.rolldown-runtime.js +58 -0
- package/data/build/dist/client/client.xterm-engine.js +13061 -0
- package/data/build/dist/client/client.xterm-engine.js.map +1 -0
- package/data/build/dist/client/command-token.d.ts +13 -0
- package/data/build/dist/client/command-token.d.ts.map +1 -0
- package/data/build/dist/client/command-token.js +14 -0
- package/data/build/dist/client/command-token.js.map +1 -0
- package/data/build/dist/client/context-breakdown-dom.d.ts +53 -0
- package/data/build/dist/client/context-breakdown-dom.d.ts.map +1 -0
- package/data/build/dist/client/context-breakdown-dom.js +171 -0
- package/data/build/dist/client/context-breakdown-dom.js.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.js +60 -0
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
- package/data/build/dist/client/credential-reference.d.ts +14 -0
- package/data/build/dist/client/credential-reference.d.ts.map +1 -0
- package/data/build/dist/client/credential-reference.js +268 -0
- package/data/build/dist/client/credential-reference.js.map +1 -0
- package/data/build/dist/client/credential-ui-dom.d.ts +18 -0
- package/data/build/dist/client/credential-ui-dom.d.ts.map +1 -0
- package/data/build/dist/client/credential-ui-dom.js +191 -0
- package/data/build/dist/client/credential-ui-dom.js.map +1 -0
- package/data/build/dist/client/credentials-settings-section.d.ts +10 -0
- package/data/build/dist/client/credentials-settings-section.d.ts.map +1 -0
- package/data/build/dist/client/credentials-settings-section.js +204 -0
- package/data/build/dist/client/credentials-settings-section.js.map +1 -0
- package/data/build/dist/client/debug/ui.d.ts +13 -0
- package/data/build/dist/client/debug/ui.d.ts.map +1 -0
- package/data/build/dist/client/debug/ui.js +499 -0
- package/data/build/dist/client/debug/ui.js.map +1 -0
- package/data/build/dist/client/delegate-command.d.ts +17 -0
- package/data/build/dist/client/delegate-command.d.ts.map +1 -0
- package/data/build/dist/client/delegate-command.js +616 -0
- package/data/build/dist/client/delegate-command.js.map +1 -0
- package/data/build/dist/client/delegate-plan.d.ts +40 -0
- package/data/build/dist/client/delegate-plan.d.ts.map +1 -0
- package/data/build/dist/client/delegate-plan.js +63 -0
- package/data/build/dist/client/delegate-plan.js.map +1 -0
- package/data/build/dist/client/delegate-ui-dom.d.ts +86 -0
- package/data/build/dist/client/delegate-ui-dom.d.ts.map +1 -0
- package/data/build/dist/client/delegate-ui-dom.js +647 -0
- package/data/build/dist/client/delegate-ui-dom.js.map +1 -0
- package/data/build/dist/client/dsh-h5-bootstrap.d.ts +66 -0
- package/data/build/dist/client/dsh-h5-bootstrap.d.ts.map +1 -0
- package/data/build/dist/client/dsh-h5-bootstrap.js +372 -0
- package/data/build/dist/client/dsh-h5-bootstrap.js.map +1 -0
- package/data/build/dist/client/dsh-runtime-version.d.ts +4 -0
- package/data/build/dist/client/dsh-runtime-version.d.ts.map +1 -0
- package/data/build/dist/client/dsh-runtime-version.js +11 -0
- package/data/build/dist/client/dsh-runtime-version.js.map +1 -0
- package/data/build/dist/client/editor-engine.d.ts +4 -0
- package/data/build/dist/client/editor-engine.d.ts.map +1 -0
- package/data/build/dist/client/editor-engine.js +53 -0
- package/data/build/dist/client/editor-engine.js.map +1 -0
- package/data/build/dist/client/engine-loader.d.ts +5 -0
- package/data/build/dist/client/engine-loader.d.ts.map +1 -0
- package/data/build/dist/client/engine-loader.js +35 -0
- package/data/build/dist/client/engine-loader.js.map +1 -0
- package/data/build/dist/client/external-tool-stream.d.ts +24 -0
- package/data/build/dist/client/external-tool-stream.d.ts.map +1 -0
- package/data/build/dist/client/external-tool-stream.js +123 -0
- package/data/build/dist/client/external-tool-stream.js.map +1 -0
- package/data/build/dist/client/features/cli-adapters.d.ts +14 -0
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -0
- package/data/build/dist/client/features/cli-adapters.js +456 -0
- package/data/build/dist/client/features/cli-adapters.js.map +1 -0
- package/data/build/dist/client/features/credentials.d.ts +3 -0
- package/data/build/dist/client/features/credentials.d.ts.map +1 -0
- package/data/build/dist/client/features/credentials.js +96 -0
- package/data/build/dist/client/features/credentials.js.map +1 -0
- package/data/build/dist/client/features/debug.d.ts +4 -0
- package/data/build/dist/client/features/debug.d.ts.map +1 -0
- package/data/build/dist/client/features/debug.js +26 -0
- package/data/build/dist/client/features/debug.js.map +1 -0
- package/data/build/dist/client/features/file-management-panel.d.ts +5 -0
- package/data/build/dist/client/features/file-management-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/file-management-panel.js +41 -0
- package/data/build/dist/client/features/file-management-panel.js.map +1 -0
- package/data/build/dist/client/features/file-management.d.ts +4 -0
- package/data/build/dist/client/features/file-management.d.ts.map +1 -0
- package/data/build/dist/client/features/file-management.js +92 -0
- package/data/build/dist/client/features/file-management.js.map +1 -0
- package/data/build/dist/client/features/index.d.ts +41 -0
- package/data/build/dist/client/features/index.d.ts.map +1 -0
- package/data/build/dist/client/features/index.js +63 -0
- package/data/build/dist/client/features/index.js.map +1 -0
- package/data/build/dist/client/features/lan-access-panel.d.ts +5 -0
- package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access-panel.js +225 -0
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -0
- package/data/build/dist/client/features/lan-access-status.d.ts +40 -0
- package/data/build/dist/client/features/lan-access-status.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access-status.js +118 -0
- package/data/build/dist/client/features/lan-access-status.js.map +1 -0
- package/data/build/dist/client/features/lan-access.d.ts +12 -0
- package/data/build/dist/client/features/lan-access.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access.js +62 -0
- package/data/build/dist/client/features/lan-access.js.map +1 -0
- package/data/build/dist/client/features/login-protection-panel.d.ts +5 -0
- package/data/build/dist/client/features/login-protection-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection-panel.js +96 -0
- package/data/build/dist/client/features/login-protection-panel.js.map +1 -0
- package/data/build/dist/client/features/login-protection-session.d.ts +8 -0
- package/data/build/dist/client/features/login-protection-session.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection-session.js +43 -0
- package/data/build/dist/client/features/login-protection-session.js.map +1 -0
- package/data/build/dist/client/features/login-protection.d.ts +4 -0
- package/data/build/dist/client/features/login-protection.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection.js +23 -0
- package/data/build/dist/client/features/login-protection.js.map +1 -0
- package/data/build/dist/client/features/mobile-access-panel.d.ts +12 -0
- package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/mobile-access-panel.js +256 -0
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -0
- package/data/build/dist/client/features/mobile-access.d.ts +10 -0
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -0
- package/data/build/dist/client/features/mobile-access.js +66 -0
- package/data/build/dist/client/features/mobile-access.js.map +1 -0
- package/data/build/dist/client/features/plugin-update.d.ts +3 -0
- package/data/build/dist/client/features/plugin-update.d.ts.map +1 -0
- package/data/build/dist/client/features/plugin-update.js +14 -0
- package/data/build/dist/client/features/plugin-update.js.map +1 -0
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts +9 -0
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/reverse-proxy-panel.js +269 -0
- package/data/build/dist/client/features/reverse-proxy-panel.js.map +1 -0
- package/data/build/dist/client/features/reverse-proxy.d.ts +11 -0
- package/data/build/dist/client/features/reverse-proxy.d.ts.map +1 -0
- package/data/build/dist/client/features/reverse-proxy.js +183 -0
- package/data/build/dist/client/features/reverse-proxy.js.map +1 -0
- package/data/build/dist/client/features/session-translation.d.ts +3 -0
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/client/features/session-translation.js +124 -0
- package/data/build/dist/client/features/session-translation.js.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts +9 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js +28 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts +15 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.js +118 -0
- package/data/build/dist/client/features/subscription-usage-panel.js.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.js +169 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.js.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/terminal-enhancement.d.ts.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement.js +30 -0
- package/data/build/dist/client/features/terminal-enhancement.js.map +1 -0
- package/data/build/dist/client/features/types.d.ts +99 -0
- package/data/build/dist/client/features/types.d.ts.map +1 -0
- package/data/build/dist/client/features/types.js +2 -0
- package/data/build/dist/client/features/types.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +121 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js +278 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -0
- package/data/build/dist/client/file-management-context-menu.d.ts +10 -0
- package/data/build/dist/client/file-management-context-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-management-context-menu.js +178 -0
- package/data/build/dist/client/file-management-context-menu.js.map +1 -0
- package/data/build/dist/client/file-management-dom.d.ts +40 -0
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -0
- package/data/build/dist/client/file-management-dom.js +660 -0
- package/data/build/dist/client/file-management-dom.js.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
- package/data/build/dist/client/font-scale.d.ts +37 -0
- package/data/build/dist/client/font-scale.d.ts.map +1 -0
- package/data/build/dist/client/font-scale.js +56 -0
- package/data/build/dist/client/font-scale.js.map +1 -0
- package/data/build/dist/client/git-history-graph.d.ts +81 -0
- package/data/build/dist/client/git-history-graph.d.ts.map +1 -0
- package/data/build/dist/client/git-history-graph.js +195 -0
- package/data/build/dist/client/git-history-graph.js.map +1 -0
- package/data/build/dist/client/git-management-settings.d.ts +4 -0
- package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
- package/data/build/dist/client/git-management-settings.js +73 -0
- package/data/build/dist/client/git-management-settings.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts +24 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -0
- package/data/build/dist/client/git-management.js +1209 -0
- package/data/build/dist/client/git-management.js.map +1 -0
- package/data/build/dist/client/git-panel-styles.d.ts +32 -0
- package/data/build/dist/client/git-panel-styles.d.ts.map +1 -0
- package/data/build/dist/client/git-panel-styles.js +110 -0
- package/data/build/dist/client/git-panel-styles.js.map +1 -0
- package/data/build/dist/client/git-workspace-events.d.ts +7 -0
- package/data/build/dist/client/git-workspace-events.d.ts.map +1 -0
- package/data/build/dist/client/git-workspace-events.js +32 -0
- package/data/build/dist/client/git-workspace-events.js.map +1 -0
- package/data/build/dist/client/git-worktree-selection.d.ts +89 -0
- package/data/build/dist/client/git-worktree-selection.d.ts.map +1 -0
- package/data/build/dist/client/git-worktree-selection.js +121 -0
- package/data/build/dist/client/git-worktree-selection.js.map +1 -0
- package/data/build/dist/client/h5-bootstrap-entry.d.ts +2 -0
- package/data/build/dist/client/h5-bootstrap-entry.d.ts.map +1 -0
- package/data/build/dist/client/h5-bootstrap-entry.js +17 -0
- package/data/build/dist/client/h5-bootstrap-entry.js.map +1 -0
- package/data/build/dist/client/html-workspace-files.d.ts +4 -0
- package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/client/html-workspace-files.js +114 -0
- package/data/build/dist/client/html-workspace-files.js.map +1 -0
- package/data/build/dist/client/index.d.ts +39 -0
- package/data/build/dist/client/index.d.ts.map +1 -0
- package/data/build/dist/client/index.js +249 -0
- package/data/build/dist/client/index.js.map +1 -0
- package/data/build/dist/client/lan-access.d.ts +28 -0
- package/data/build/dist/client/lan-access.d.ts.map +1 -0
- package/data/build/dist/client/lan-access.js +68 -0
- package/data/build/dist/client/lan-access.js.map +1 -0
- package/data/build/dist/client/locale.d.ts +27 -0
- package/data/build/dist/client/locale.d.ts.map +1 -0
- package/data/build/dist/client/locale.js +845 -0
- package/data/build/dist/client/locale.js.map +1 -0
- package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
- package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
- package/data/build/dist/client/locales/cliManagement.js +155 -0
- package/data/build/dist/client/locales/cliManagement.js.map +1 -0
- package/data/build/dist/client/locales/credentials.d.ts +3 -0
- package/data/build/dist/client/locales/credentials.d.ts.map +1 -0
- package/data/build/dist/client/locales/credentials.js +93 -0
- package/data/build/dist/client/locales/credentials.js.map +1 -0
- package/data/build/dist/client/locales/debug.d.ts +9 -0
- package/data/build/dist/client/locales/debug.d.ts.map +1 -0
- package/data/build/dist/client/locales/debug.js +163 -0
- package/data/build/dist/client/locales/debug.js.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts +9 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.js +153 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -0
- package/data/build/dist/client/locales/git.d.ts +9 -0
- package/data/build/dist/client/locales/git.d.ts.map +1 -0
- package/data/build/dist/client/locales/git.js +263 -0
- package/data/build/dist/client/locales/git.js.map +1 -0
- package/data/build/dist/client/locales/nativeApproval.d.ts +3 -0
- package/data/build/dist/client/locales/nativeApproval.d.ts.map +1 -0
- package/data/build/dist/client/locales/nativeApproval.js +51 -0
- package/data/build/dist/client/locales/nativeApproval.js.map +1 -0
- package/data/build/dist/client/locales/panels.d.ts +9 -0
- package/data/build/dist/client/locales/panels.d.ts.map +1 -0
- package/data/build/dist/client/locales/panels.js +251 -0
- package/data/build/dist/client/locales/panels.js.map +1 -0
- package/data/build/dist/client/locales/pluginUpdate.d.ts +3 -0
- package/data/build/dist/client/locales/pluginUpdate.d.ts.map +1 -0
- package/data/build/dist/client/locales/pluginUpdate.js +131 -0
- package/data/build/dist/client/locales/pluginUpdate.js.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts +53 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.js +95 -0
- package/data/build/dist/client/locales/subagentCollapsed.js.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.d.ts +9 -0
- package/data/build/dist/client/locales/terminalAuth.d.ts.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.js +153 -0
- package/data/build/dist/client/locales/terminalAuth.js.map +1 -0
- package/data/build/dist/client/locales/usage.d.ts +9 -0
- package/data/build/dist/client/locales/usage.d.ts.map +1 -0
- package/data/build/dist/client/locales/usage.js +311 -0
- package/data/build/dist/client/locales/usage.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts +29 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js +93 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts +32 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js +188 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts +43 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.js +227 -0
- package/data/build/dist/client/mobile-session-interaction.js.map +1 -0
- package/data/build/dist/client/mobile-settings-modal-dom.d.ts +49 -0
- package/data/build/dist/client/mobile-settings-modal-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-settings-modal-dom.js +152 -0
- package/data/build/dist/client/mobile-settings-modal-dom.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts +149 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.js +623 -0
- package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-logo.d.ts +18 -0
- package/data/build/dist/client/mobile-sidebar-logo.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-logo.js +15 -0
- package/data/build/dist/client/mobile-sidebar-logo.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts +114 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.js +452 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.js.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
- package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
- package/data/build/dist/client/mobile-vibration.d.ts +16 -0
- package/data/build/dist/client/mobile-vibration.d.ts.map +1 -0
- package/data/build/dist/client/mobile-vibration.js +20 -0
- package/data/build/dist/client/mobile-vibration.js.map +1 -0
- package/data/build/dist/client/model-catalog-cache.d.ts +28 -0
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -0
- package/data/build/dist/client/model-catalog-cache.js +158 -0
- package/data/build/dist/client/model-catalog-cache.js.map +1 -0
- package/data/build/dist/client/model-priority-pool.d.ts +23 -0
- package/data/build/dist/client/model-priority-pool.d.ts.map +1 -0
- package/data/build/dist/client/model-priority-pool.js +245 -0
- package/data/build/dist/client/model-priority-pool.js.map +1 -0
- package/data/build/dist/client/native-approval-selector.d.ts +22 -0
- package/data/build/dist/client/native-approval-selector.d.ts.map +1 -0
- package/data/build/dist/client/native-approval-selector.js +39 -0
- package/data/build/dist/client/native-approval-selector.js.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts +6 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.js +62 -0
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
- package/data/build/dist/client/native-translation-default.d.ts +6 -0
- package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
- package/data/build/dist/client/native-translation-default.js +30 -0
- package/data/build/dist/client/native-translation-default.js.map +1 -0
- package/data/build/dist/client/native-workspace-store.d.ts +29 -0
- package/data/build/dist/client/native-workspace-store.d.ts.map +1 -0
- package/data/build/dist/client/native-workspace-store.js +75 -0
- package/data/build/dist/client/native-workspace-store.js.map +1 -0
- package/data/build/dist/client/popup-dismiss.d.ts +48 -0
- package/data/build/dist/client/popup-dismiss.d.ts.map +1 -0
- package/data/build/dist/client/popup-dismiss.js +93 -0
- package/data/build/dist/client/popup-dismiss.js.map +1 -0
- package/data/build/dist/client/provider-icon-assets.d.ts +2 -0
- package/data/build/dist/client/provider-icon-assets.d.ts.map +1 -0
- package/data/build/dist/client/provider-icon-assets.js +7 -0
- package/data/build/dist/client/provider-icon-assets.js.map +1 -0
- package/data/build/dist/client/provider-icon-bridge.d.ts +6 -0
- package/data/build/dist/client/provider-icon-bridge.d.ts.map +1 -0
- package/data/build/dist/client/provider-icon-bridge.js +65 -0
- package/data/build/dist/client/provider-icon-bridge.js.map +1 -0
- package/data/build/dist/client/provider-icons.d.ts +43 -0
- package/data/build/dist/client/provider-icons.d.ts.map +1 -0
- package/data/build/dist/client/provider-icons.js +185 -0
- package/data/build/dist/client/provider-icons.js.map +1 -0
- package/data/build/dist/client/pwa-install-prompt.d.ts +76 -0
- package/data/build/dist/client/pwa-install-prompt.d.ts.map +1 -0
- package/data/build/dist/client/pwa-install-prompt.js +179 -0
- package/data/build/dist/client/pwa-install-prompt.js.map +1 -0
- package/data/build/dist/client/pwa-notifications.d.ts +105 -0
- package/data/build/dist/client/pwa-notifications.d.ts.map +1 -0
- package/data/build/dist/client/pwa-notifications.js +192 -0
- package/data/build/dist/client/pwa-notifications.js.map +1 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts +60 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts.map +1 -0
- package/data/build/dist/client/quick-phrase-layout.js +115 -0
- package/data/build/dist/client/quick-phrase-layout.js.map +1 -0
- package/data/build/dist/client/quick-phrase-slot.d.ts +7 -0
- package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -0
- package/data/build/dist/client/quick-phrase-slot.js +405 -0
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -0
- package/data/build/dist/client/remote-web-context.d.ts +59 -0
- package/data/build/dist/client/remote-web-context.d.ts.map +1 -0
- package/data/build/dist/client/remote-web-context.js +1037 -0
- package/data/build/dist/client/remote-web-context.js.map +1 -0
- package/data/build/dist/client/rpc-call.d.ts +4 -0
- package/data/build/dist/client/rpc-call.d.ts.map +1 -0
- package/data/build/dist/client/rpc-call.js +23 -0
- package/data/build/dist/client/rpc-call.js.map +1 -0
- package/data/build/dist/client/serial-polling.d.ts +16 -0
- package/data/build/dist/client/serial-polling.d.ts.map +1 -0
- package/data/build/dist/client/serial-polling.js +50 -0
- package/data/build/dist/client/serial-polling.js.map +1 -0
- package/data/build/dist/client/service-tier.d.ts +65 -0
- package/data/build/dist/client/service-tier.d.ts.map +1 -0
- package/data/build/dist/client/service-tier.js +93 -0
- package/data/build/dist/client/service-tier.js.map +1 -0
- package/data/build/dist/client/session-adapter-cache.d.ts +20 -0
- package/data/build/dist/client/session-adapter-cache.d.ts.map +1 -0
- package/data/build/dist/client/session-adapter-cache.js +105 -0
- package/data/build/dist/client/session-adapter-cache.js.map +1 -0
- package/data/build/dist/client/session-changed-files-view.d.ts +37 -0
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -0
- package/data/build/dist/client/session-changed-files-view.js +528 -0
- package/data/build/dist/client/session-changed-files-view.js.map +1 -0
- package/data/build/dist/client/session-file-links.d.ts +11 -0
- package/data/build/dist/client/session-file-links.d.ts.map +1 -0
- package/data/build/dist/client/session-file-links.js +52 -0
- package/data/build/dist/client/session-file-links.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +73 -0
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-chat.js +889 -0
- package/data/build/dist/client/session-translation-chat.js.map +1 -0
- package/data/build/dist/client/session-translation-interactions.d.ts +40 -0
- package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-interactions.js +222 -0
- package/data/build/dist/client/session-translation-interactions.js.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.js +58 -0
- package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
- package/data/build/dist/client/session-translation-retry.d.ts +16 -0
- package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-retry.js +67 -0
- package/data/build/dist/client/session-translation-retry.js.map +1 -0
- package/data/build/dist/client/session-translation-rules.d.ts +13 -0
- package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-rules.js +58 -0
- package/data/build/dist/client/session-translation-rules.js.map +1 -0
- package/data/build/dist/client/settings-anchor.d.ts +73 -0
- package/data/build/dist/client/settings-anchor.d.ts.map +1 -0
- package/data/build/dist/client/settings-anchor.js +70 -0
- package/data/build/dist/client/settings-anchor.js.map +1 -0
- package/data/build/dist/client/settings-bridge.d.ts +62 -0
- package/data/build/dist/client/settings-bridge.d.ts.map +1 -0
- package/data/build/dist/client/settings-bridge.js +247 -0
- package/data/build/dist/client/settings-bridge.js.map +1 -0
- package/data/build/dist/client/settings-controls.d.ts +29 -0
- package/data/build/dist/client/settings-controls.d.ts.map +1 -0
- package/data/build/dist/client/settings-controls.js +80 -0
- package/data/build/dist/client/settings-controls.js.map +1 -0
- package/data/build/dist/client/settings-promo-styles.d.ts +33 -0
- package/data/build/dist/client/settings-promo-styles.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo-styles.js +71 -0
- package/data/build/dist/client/settings-promo-styles.js.map +1 -0
- package/data/build/dist/client/settings-promo.d.ts +16 -0
- package/data/build/dist/client/settings-promo.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo.js +68 -0
- package/data/build/dist/client/settings-promo.js.map +1 -0
- package/data/build/dist/client/settings-section.d.ts +31 -0
- package/data/build/dist/client/settings-section.d.ts.map +1 -0
- package/data/build/dist/client/settings-section.js +140 -0
- package/data/build/dist/client/settings-section.js.map +1 -0
- package/data/build/dist/client/settings-update.d.ts +8 -0
- package/data/build/dist/client/settings-update.d.ts.map +1 -0
- package/data/build/dist/client/settings-update.js +57 -0
- package/data/build/dist/client/settings-update.js.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts +11 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.js +6 -0
- package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
- package/data/build/dist/client/skill-command.d.ts +10 -0
- package/data/build/dist/client/skill-command.d.ts.map +1 -0
- package/data/build/dist/client/skill-command.js +282 -0
- package/data/build/dist/client/skill-command.js.map +1 -0
- package/data/build/dist/client/skill-reference-dom.d.ts +38 -0
- package/data/build/dist/client/skill-reference-dom.d.ts.map +1 -0
- package/data/build/dist/client/skill-reference-dom.js +187 -0
- package/data/build/dist/client/skill-reference-dom.js.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts +103 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js +664 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/subscription-slot.d.ts +49 -0
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -0
- package/data/build/dist/client/subscription-slot.js +936 -0
- package/data/build/dist/client/subscription-slot.js.map +1 -0
- package/data/build/dist/client/terminal/index.d.ts +4 -0
- package/data/build/dist/client/terminal/index.d.ts.map +1 -0
- package/data/build/dist/client/terminal/index.js +3 -0
- package/data/build/dist/client/terminal/index.js.map +1 -0
- package/data/build/dist/client/terminal/log-preview.d.ts +14 -0
- package/data/build/dist/client/terminal/log-preview.d.ts.map +1 -0
- package/data/build/dist/client/terminal/log-preview.js +23 -0
- package/data/build/dist/client/terminal/log-preview.js.map +1 -0
- package/data/build/dist/client/terminal/model.d.ts +287 -0
- package/data/build/dist/client/terminal/model.d.ts.map +1 -0
- package/data/build/dist/client/terminal/model.js +1166 -0
- package/data/build/dist/client/terminal/model.js.map +1 -0
- package/data/build/dist/client/terminal/recovery.d.ts +69 -0
- package/data/build/dist/client/terminal/recovery.d.ts.map +1 -0
- package/data/build/dist/client/terminal/recovery.js +167 -0
- package/data/build/dist/client/terminal/recovery.js.map +1 -0
- package/data/build/dist/client/terminal/selection-actions.d.ts +63 -0
- package/data/build/dist/client/terminal/selection-actions.d.ts.map +1 -0
- package/data/build/dist/client/terminal/selection-actions.js +132 -0
- package/data/build/dist/client/terminal/selection-actions.js.map +1 -0
- package/data/build/dist/client/terminal/share-menu.d.ts +17 -0
- package/data/build/dist/client/terminal/share-menu.d.ts.map +1 -0
- package/data/build/dist/client/terminal/share-menu.js +131 -0
- package/data/build/dist/client/terminal/share-menu.js.map +1 -0
- package/data/build/dist/client/terminal/sharing.d.ts +42 -0
- package/data/build/dist/client/terminal/sharing.d.ts.map +1 -0
- package/data/build/dist/client/terminal/sharing.js +144 -0
- package/data/build/dist/client/terminal/sharing.js.map +1 -0
- package/data/build/dist/client/terminal/snapshot.d.ts +32 -0
- package/data/build/dist/client/terminal/snapshot.d.ts.map +1 -0
- package/data/build/dist/client/terminal/snapshot.js +108 -0
- package/data/build/dist/client/terminal/snapshot.js.map +1 -0
- package/data/build/dist/client/terminal/styles.d.ts +53 -0
- package/data/build/dist/client/terminal/styles.d.ts.map +1 -0
- package/data/build/dist/client/terminal/styles.js +134 -0
- package/data/build/dist/client/terminal/styles.js.map +1 -0
- package/data/build/dist/client/terminal/surface-cache.d.ts +10 -0
- package/data/build/dist/client/terminal/surface-cache.d.ts.map +1 -0
- package/data/build/dist/client/terminal/surface-cache.js +19 -0
- package/data/build/dist/client/terminal/surface-cache.js.map +1 -0
- package/data/build/dist/client/terminal/ui.d.ts +20 -0
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -0
- package/data/build/dist/client/terminal/ui.js +618 -0
- package/data/build/dist/client/terminal/ui.js.map +1 -0
- package/data/build/dist/client/terminal/xterm-engine.d.ts +4 -0
- package/data/build/dist/client/terminal/xterm-engine.d.ts.map +1 -0
- package/data/build/dist/client/terminal/xterm-engine.js +5 -0
- package/data/build/dist/client/terminal/xterm-engine.js.map +1 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts +23 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -0
- package/data/build/dist/client/terminal/xterm-view.js +790 -0
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -0
- package/data/build/dist/client/theme.d.ts +75 -0
- package/data/build/dist/client/theme.d.ts.map +1 -0
- package/data/build/dist/client/theme.js +247 -0
- package/data/build/dist/client/theme.js.map +1 -0
- package/data/build/dist/client/touch-input-focus.d.ts +30 -0
- package/data/build/dist/client/touch-input-focus.d.ts.map +1 -0
- package/data/build/dist/client/touch-input-focus.js +209 -0
- package/data/build/dist/client/touch-input-focus.js.map +1 -0
- package/data/build/dist/client/update-panel-styles.d.ts +29 -0
- package/data/build/dist/client/update-panel-styles.d.ts.map +1 -0
- package/data/build/dist/client/update-panel-styles.js +69 -0
- package/data/build/dist/client/update-panel-styles.js.map +1 -0
- package/data/build/dist/client/update-panel.d.ts +7 -0
- package/data/build/dist/client/update-panel.d.ts.map +1 -0
- package/data/build/dist/client/update-panel.js +52 -0
- package/data/build/dist/client/update-panel.js.map +1 -0
- package/data/build/dist/client/update-store.d.ts +43 -0
- package/data/build/dist/client/update-store.d.ts.map +1 -0
- package/data/build/dist/client/update-store.js +207 -0
- package/data/build/dist/client/update-store.js.map +1 -0
- package/data/build/dist/client/workspace-activity-dom.d.ts +8 -0
- package/data/build/dist/client/workspace-activity-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-activity-dom.js +140 -0
- package/data/build/dist/client/workspace-activity-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +58 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-archive-dom.js +749 -0
- package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-fiber.d.ts +3 -0
- package/data/build/dist/client/workspace-session-fiber.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-fiber.js +33 -0
- package/data/build/dist/client/workspace-session-fiber.js.map +1 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts +29 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-logo-dom.js +130 -0
- package/data/build/dist/client/workspace-session-logo-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts +28 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.js +282 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +39 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-visibility-dom.js +712 -0
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.js +18 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js +71 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts +64 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js +162 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.d.ts +22 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.js +33 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.js +6 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts +27 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js +109 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +33 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +99 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +49 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.js +6 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +76 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +180 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +79 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts +14 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js +39 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js +5 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts +33 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js +186 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts +5 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +81 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +237 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.js +10 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts +40 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js +71 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +24 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js +13 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.d.ts +27 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.js +101 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.d.ts +23 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.js +79 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.d.ts +16 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.js +94 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +24 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +106 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +27 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +29 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +11 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +229 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js +47 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js +123 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/index.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/index.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/index.js +6 -0
- package/data/build/dist/dsh-capabilities/index.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.js +91 -0
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -0
- package/data/build/dist/dsh-capabilities/registry.d.ts +22 -0
- package/data/build/dist/dsh-capabilities/registry.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/registry.js +200 -0
- package/data/build/dist/dsh-capabilities/registry.js.map +1 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/routes.js +307 -0
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts +43 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/settings-store.js +39 -0
- package/data/build/dist/dsh-capabilities/settings-store.js.map +1 -0
- package/data/build/dist/dsh-capabilities/types.d.ts +50 -0
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/types.js +23 -0
- package/data/build/dist/dsh-capabilities/types.js.map +1 -0
- package/data/build/dist/features/index.d.ts +3 -0
- package/data/build/dist/features/index.d.ts.map +1 -0
- package/data/build/dist/features/index.js +2 -0
- package/data/build/dist/features/index.js.map +1 -0
- package/data/build/dist/features/registry.d.ts +87 -0
- package/data/build/dist/features/registry.d.ts.map +1 -0
- package/data/build/dist/features/registry.js +525 -0
- package/data/build/dist/features/registry.js.map +1 -0
- package/data/build/dist/host/auth-session.d.ts +49 -0
- package/data/build/dist/host/auth-session.d.ts.map +1 -0
- package/data/build/dist/host/auth-session.js +208 -0
- package/data/build/dist/host/auth-session.js.map +1 -0
- package/data/build/dist/host/browser-text.d.ts +30 -0
- package/data/build/dist/host/browser-text.d.ts.map +1 -0
- package/data/build/dist/host/browser-text.js +119 -0
- package/data/build/dist/host/browser-text.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +156 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +705 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.d.ts +31 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.js +144 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +96 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +608 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts +122 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.js +545 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.js +75 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.js.map +1 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +26 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.js +189 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js +75 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +88 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js +815 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.js +109 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/claude-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance.js +66 -0
- package/data/build/dist/host/cli-adapters/claude-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/claude-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-process.js +59 -0
- package/data/build/dist/host/cli-adapters/claude-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +148 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js +1958 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts +53 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.js +778 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +155 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js +2226 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js +271 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +179 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +135 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js +2098 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts +174 -0
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js +789 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.js +132 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.js +91 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts +67 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js +169 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts +49 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js +112 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.js +49 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts +36 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js +126 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js.map +1 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +157 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts +48 -0
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js +281 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js +142 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js +34 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts +49 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js +177 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js +294 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js +126 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js +176 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js +139 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +82 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.js +2 -0
- package/data/build/dist/host/cli-adapters/driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js +153 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +73 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +514 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.js +34 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +52 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +528 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts +27 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +100 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts +28 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/feature.js +2418 -0
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.js +507 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +48 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-driver.js +1118 -0
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.js +99 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.js.map +1 -0
- package/data/build/dist/host/cli-adapters/interaction-events.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/interaction-events.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/interaction-events.js +80 -0
- package/data/build/dist/host/cli-adapters/interaction-events.js.map +1 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +93 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +375 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js +416 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.d.ts +12 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.js +18 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts +28 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +142 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts +24 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js +167 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js.map +1 -0
- package/data/build/dist/host/cli-adapters/log-files.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/log-files.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/log-files.js +32 -0
- package/data/build/dist/host/cli-adapters/log-files.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
- package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
- package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.js +62 -0
- package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management.js +177 -0
- package/data/build/dist/host/cli-adapters/management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.d.ts +23 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.js +120 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts +60 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.js +621 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +113 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js +526 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +159 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +566 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.js +4 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.d.ts +41 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.js +140 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +175 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts +75 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js +869 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts +29 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.js +361 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +112 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js +1270 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts +30 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +828 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-driver.js +616 -0
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance.d.ts +15 -0
- package/data/build/dist/host/cli-adapters/pi-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance.js +94 -0
- package/data/build/dist/host/cli-adapters/pi-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +53 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/process-utils.js +242 -0
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-registry.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/provider-registry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-registry.js +83 -0
- package/data/build/dist/host/cli-adapters/provider-registry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +189 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.js +1616 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +86 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.js +707 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts +36 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.js +207 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js +111 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.js +79 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry-holder.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/registry-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/registry-holder.js +9 -0
- package/data/build/dist/host/cli-adapters/registry-holder.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts +194 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.js +1412 -0
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +120 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +80 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js +108 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-probe.d.ts +20 -0
- package/data/build/dist/host/cli-adapters/session-probe.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-probe.js +139 -0
- package/data/build/dist/host/cli-adapters/session-probe.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts +98 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-store.js +364 -0
- package/data/build/dist/host/cli-adapters/session-store.js.map +1 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js +161 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +73 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +365 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +39 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +135 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js +38 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js +185 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.js +67 -0
- package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
- package/data/build/dist/host/cli-adapters/tool-observation.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/tool-observation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/tool-observation.js +45 -0
- package/data/build/dist/host/cli-adapters/tool-observation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.js +263 -0
- package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts +12 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js +53 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js.map +1 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.js +212 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.d.ts +10 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.js +84 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts +74 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js +1033 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js +97 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts +29 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js +147 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts +23 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js +187 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js +124 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +46 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.js +98 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +56 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.js +201 -0
- package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts +52 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js +335 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -0
- package/data/build/dist/host/cli-bridge/dispatch.d.ts +19 -0
- package/data/build/dist/host/cli-bridge/dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/dispatch.js +199 -0
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts +34 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js +147 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +119 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.js +491 -0
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts +8 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +344 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js +9 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts +52 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js +315 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js +177 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js +23 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +36 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js +243 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
- package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.d.ts +33 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.js +174 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.js.map +1 -0
- package/data/build/dist/host/control-api-client.d.ts +84 -0
- package/data/build/dist/host/control-api-client.d.ts.map +1 -0
- package/data/build/dist/host/control-api-client.js +131 -0
- package/data/build/dist/host/control-api-client.js.map +1 -0
- package/data/build/dist/host/credential-store.d.ts +54 -0
- package/data/build/dist/host/credential-store.d.ts.map +1 -0
- package/data/build/dist/host/credential-store.js +124 -0
- package/data/build/dist/host/credential-store.js.map +1 -0
- package/data/build/dist/host/credentials/broker.d.ts +73 -0
- package/data/build/dist/host/credentials/broker.d.ts.map +1 -0
- package/data/build/dist/host/credentials/broker.js +495 -0
- package/data/build/dist/host/credentials/broker.js.map +1 -0
- package/data/build/dist/host/credentials/index.d.ts +4 -0
- package/data/build/dist/host/credentials/index.d.ts.map +1 -0
- package/data/build/dist/host/credentials/index.js +4 -0
- package/data/build/dist/host/credentials/index.js.map +1 -0
- package/data/build/dist/host/credentials/service.d.ts +43 -0
- package/data/build/dist/host/credentials/service.d.ts.map +1 -0
- package/data/build/dist/host/credentials/service.js +432 -0
- package/data/build/dist/host/credentials/service.js.map +1 -0
- package/data/build/dist/host/credentials/store.d.ts +33 -0
- package/data/build/dist/host/credentials/store.d.ts.map +1 -0
- package/data/build/dist/host/credentials/store.js +238 -0
- package/data/build/dist/host/credentials/store.js.map +1 -0
- package/data/build/dist/host/credentials/tool.d.ts +3 -0
- package/data/build/dist/host/credentials/tool.d.ts.map +1 -0
- package/data/build/dist/host/credentials/tool.js +54 -0
- package/data/build/dist/host/credentials/tool.js.map +1 -0
- package/data/build/dist/host/debug.d.ts +79 -0
- package/data/build/dist/host/debug.d.ts.map +1 -0
- package/data/build/dist/host/debug.js +296 -0
- package/data/build/dist/host/debug.js.map +1 -0
- package/data/build/dist/host/dsh-device-runtime.d.ts +45 -0
- package/data/build/dist/host/dsh-device-runtime.d.ts.map +1 -0
- package/data/build/dist/host/dsh-device-runtime.js +155 -0
- package/data/build/dist/host/dsh-device-runtime.js.map +1 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts +5 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts.map +1 -0
- package/data/build/dist/host/dsh-gateway-feature.js +78 -0
- package/data/build/dist/host/dsh-gateway-feature.js.map +1 -0
- package/data/build/dist/host/dsh-runtime-version.d.ts +13 -0
- package/data/build/dist/host/dsh-runtime-version.d.ts.map +1 -0
- package/data/build/dist/host/dsh-runtime-version.js +143 -0
- package/data/build/dist/host/dsh-runtime-version.js.map +1 -0
- package/data/build/dist/host/features/auth.d.ts +11 -0
- package/data/build/dist/host/features/auth.d.ts.map +1 -0
- package/data/build/dist/host/features/auth.js +284 -0
- package/data/build/dist/host/features/auth.js.map +1 -0
- package/data/build/dist/host/features/credentials.d.ts +4 -0
- package/data/build/dist/host/features/credentials.d.ts.map +1 -0
- package/data/build/dist/host/features/credentials.js +90 -0
- package/data/build/dist/host/features/credentials.js.map +1 -0
- package/data/build/dist/host/features/debug.d.ts +5 -0
- package/data/build/dist/host/features/debug.d.ts.map +1 -0
- package/data/build/dist/host/features/debug.js +90 -0
- package/data/build/dist/host/features/debug.js.map +1 -0
- package/data/build/dist/host/features/file-management.d.ts +5 -0
- package/data/build/dist/host/features/file-management.d.ts.map +1 -0
- package/data/build/dist/host/features/file-management.js +282 -0
- package/data/build/dist/host/features/file-management.js.map +1 -0
- package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
- package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
- package/data/build/dist/host/features/git-commit-message.js +66 -0
- package/data/build/dist/host/features/git-commit-message.js.map +1 -0
- package/data/build/dist/host/features/git-management.d.ts +13 -0
- package/data/build/dist/host/features/git-management.d.ts.map +1 -0
- package/data/build/dist/host/features/git-management.js +576 -0
- package/data/build/dist/host/features/git-management.js.map +1 -0
- package/data/build/dist/host/features/host-status.d.ts +45 -0
- package/data/build/dist/host/features/host-status.d.ts.map +1 -0
- package/data/build/dist/host/features/host-status.js +122 -0
- package/data/build/dist/host/features/host-status.js.map +1 -0
- package/data/build/dist/host/features/index.d.ts +24 -0
- package/data/build/dist/host/features/index.d.ts.map +1 -0
- package/data/build/dist/host/features/index.js +46 -0
- package/data/build/dist/host/features/index.js.map +1 -0
- package/data/build/dist/host/features/interaction-translation.d.ts +10 -0
- package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/interaction-translation.js +222 -0
- package/data/build/dist/host/features/interaction-translation.js.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts +8 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.js +129 -0
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -0
- package/data/build/dist/host/features/plugin-update.d.ts +6 -0
- package/data/build/dist/host/features/plugin-update.d.ts.map +1 -0
- package/data/build/dist/host/features/plugin-update.js +51 -0
- package/data/build/dist/host/features/plugin-update.js.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.js +236 -0
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts +5 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.js +32 -0
- package/data/build/dist/host/features/session-title-optimization.js.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts +26 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.js +213 -0
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.js +123 -0
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts +23 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.js +62 -0
- package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
- package/data/build/dist/host/features/session-translation-service.d.ts +66 -0
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-service.js +664 -0
- package/data/build/dist/host/features/session-translation-service.js.map +1 -0
- package/data/build/dist/host/features/session-translation.d.ts +5 -0
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation.js +45 -0
- package/data/build/dist/host/features/session-translation.js.map +1 -0
- package/data/build/dist/host/features/terminal-process.d.ts +5 -0
- package/data/build/dist/host/features/terminal-process.d.ts.map +1 -0
- package/data/build/dist/host/features/terminal-process.js +110 -0
- package/data/build/dist/host/features/terminal-process.js.map +1 -0
- package/data/build/dist/host/features/terminal-status.d.ts +20 -0
- package/data/build/dist/host/features/terminal-status.d.ts.map +1 -0
- package/data/build/dist/host/features/terminal-status.js +58 -0
- package/data/build/dist/host/features/terminal-status.js.map +1 -0
- package/data/build/dist/host/features/types.d.ts +65 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -0
- package/data/build/dist/host/features/types.js +2 -0
- package/data/build/dist/host/features/types.js.map +1 -0
- package/data/build/dist/host/host-config.d.ts +17 -0
- package/data/build/dist/host/host-config.d.ts.map +1 -0
- package/data/build/dist/host/host-config.js +13 -0
- package/data/build/dist/host/host-config.js.map +1 -0
- package/data/build/dist/host/host-event-bridge.d.ts +11 -0
- package/data/build/dist/host/host-event-bridge.d.ts.map +1 -0
- package/data/build/dist/host/host-event-bridge.js +16 -0
- package/data/build/dist/host/host-event-bridge.js.map +1 -0
- package/data/build/dist/host/html-workspace-files.d.ts +3 -0
- package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/host/html-workspace-files.js +135 -0
- package/data/build/dist/host/html-workspace-files.js.map +1 -0
- package/data/build/dist/host/image-artifact-store.d.ts +21 -0
- package/data/build/dist/host/image-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/image-artifact-store.js +136 -0
- package/data/build/dist/host/image-artifact-store.js.map +1 -0
- package/data/build/dist/host/index-injection.d.ts +35 -0
- package/data/build/dist/host/index-injection.d.ts.map +1 -0
- package/data/build/dist/host/index-injection.js +78 -0
- package/data/build/dist/host/index-injection.js.map +1 -0
- package/data/build/dist/host/index.d.ts +64 -0
- package/data/build/dist/host/index.d.ts.map +1 -0
- package/data/build/dist/host/index.js +446 -0
- package/data/build/dist/host/index.js.map +1 -0
- package/data/build/dist/host/lan-access-dsh.d.ts +192 -0
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/host/lan-access-dsh.js +1322 -0
- package/data/build/dist/host/lan-access-dsh.js.map +1 -0
- package/data/build/dist/host/login-attempt-guard.d.ts +55 -0
- package/data/build/dist/host/login-attempt-guard.d.ts.map +1 -0
- package/data/build/dist/host/login-attempt-guard.js +201 -0
- package/data/build/dist/host/login-attempt-guard.js.map +1 -0
- package/data/build/dist/host/modules/pwa/index.d.ts +7 -0
- package/data/build/dist/host/modules/pwa/index.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/index.js +7 -0
- package/data/build/dist/host/modules/pwa/index.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts +50 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.js +182 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.d.ts +10 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.js +40 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.d.ts +10 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.js +185 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-push.d.ts +74 -0
- package/data/build/dist/host/modules/pwa/pwa-push.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-push.js +288 -0
- package/data/build/dist/host/modules/pwa/pwa-push.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts +17 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +83 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.d.ts +12 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.js +47 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +215 -0
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -0
- package/data/build/dist/host/native-session-bridge.js +993 -0
- package/data/build/dist/host/native-session-bridge.js.map +1 -0
- package/data/build/dist/host/provider-icon-assets.d.ts +5 -0
- package/data/build/dist/host/provider-icon-assets.d.ts.map +1 -0
- package/data/build/dist/host/provider-icon-assets.js +61 -0
- package/data/build/dist/host/provider-icon-assets.js.map +1 -0
- package/data/build/dist/host/relay-tunnel-runtime.d.ts +130 -0
- package/data/build/dist/host/relay-tunnel-runtime.d.ts.map +1 -0
- package/data/build/dist/host/relay-tunnel-runtime.js +422 -0
- package/data/build/dist/host/relay-tunnel-runtime.js.map +1 -0
- package/data/build/dist/host/remote-web-runtime.d.ts +78 -0
- package/data/build/dist/host/remote-web-runtime.d.ts.map +1 -0
- package/data/build/dist/host/remote-web-runtime.js +607 -0
- package/data/build/dist/host/remote-web-runtime.js.map +1 -0
- package/data/build/dist/host/rpc-table.d.ts +32 -0
- package/data/build/dist/host/rpc-table.d.ts.map +1 -0
- package/data/build/dist/host/rpc-table.js +47 -0
- package/data/build/dist/host/rpc-table.js.map +1 -0
- package/data/build/dist/host/rpc.d.ts +43 -0
- package/data/build/dist/host/rpc.d.ts.map +1 -0
- package/data/build/dist/host/rpc.js +422 -0
- package/data/build/dist/host/rpc.js.map +1 -0
- package/data/build/dist/host/session-changes.d.ts +13 -0
- package/data/build/dist/host/session-changes.d.ts.map +1 -0
- package/data/build/dist/host/session-changes.js +374 -0
- package/data/build/dist/host/session-changes.js.map +1 -0
- package/data/build/dist/host/session-handle-eviction.d.ts +33 -0
- package/data/build/dist/host/session-handle-eviction.d.ts.map +1 -0
- package/data/build/dist/host/session-handle-eviction.js +429 -0
- package/data/build/dist/host/session-handle-eviction.js.map +1 -0
- package/data/build/dist/host/session-migration-repair.d.ts +23 -0
- package/data/build/dist/host/session-migration-repair.d.ts.map +1 -0
- package/data/build/dist/host/session-migration-repair.js +576 -0
- package/data/build/dist/host/session-migration-repair.js.map +1 -0
- package/data/build/dist/host/settings.d.ts +39 -0
- package/data/build/dist/host/settings.d.ts.map +1 -0
- package/data/build/dist/host/settings.js +352 -0
- package/data/build/dist/host/settings.js.map +1 -0
- package/data/build/dist/host/stage0-dev-hmr.d.ts +6 -0
- package/data/build/dist/host/stage0-dev-hmr.d.ts.map +1 -0
- package/data/build/dist/host/stage0-dev-hmr.js +20 -0
- package/data/build/dist/host/stage0-dev-hmr.js.map +1 -0
- package/data/build/dist/host/tar-archive.d.ts +8 -0
- package/data/build/dist/host/tar-archive.d.ts.map +1 -0
- package/data/build/dist/host/tar-archive.js +17 -0
- package/data/build/dist/host/tar-archive.js.map +1 -0
- package/data/build/dist/host/terminal/attachment-registry.d.ts +17 -0
- package/data/build/dist/host/terminal/attachment-registry.d.ts.map +1 -0
- package/data/build/dist/host/terminal/attachment-registry.js +49 -0
- package/data/build/dist/host/terminal/attachment-registry.js.map +1 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.d.ts +39 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.js +160 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.js.map +1 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts +36 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js +192 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js.map +1 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +80 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js +467 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts +27 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.js +154 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts +10 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.js +147 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts +92 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js +134 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js.map +1 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts +42 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts.map +1 -0
- package/data/build/dist/host/terminal/controller-factory.js +104 -0
- package/data/build/dist/host/terminal/controller-factory.js.map +1 -0
- package/data/build/dist/host/terminal/index.d.ts +17 -0
- package/data/build/dist/host/terminal/index.d.ts.map +1 -0
- package/data/build/dist/host/terminal/index.js +17 -0
- package/data/build/dist/host/terminal/index.js.map +1 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts +109 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts.map +1 -0
- package/data/build/dist/host/terminal/runtime-adapter.js +26 -0
- package/data/build/dist/host/terminal/runtime-adapter.js.map +1 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts +45 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts.map +1 -0
- package/data/build/dist/host/terminal/runtime-manager.js +270 -0
- package/data/build/dist/host/terminal/runtime-manager.js.map +1 -0
- package/data/build/dist/host/terminal/shell-detection.d.ts +23 -0
- package/data/build/dist/host/terminal/shell-detection.d.ts.map +1 -0
- package/data/build/dist/host/terminal/shell-detection.js +105 -0
- package/data/build/dist/host/terminal/shell-detection.js.map +1 -0
- package/data/build/dist/host/terminal/startup.d.ts +38 -0
- package/data/build/dist/host/terminal/startup.d.ts.map +1 -0
- package/data/build/dist/host/terminal/startup.js +102 -0
- package/data/build/dist/host/terminal/startup.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts +93 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-controller.js +467 -0
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-service.d.ts +52 -0
- package/data/build/dist/host/terminal/terminal-process-service.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-service.js +308 -0
- package/data/build/dist/host/terminal/terminal-process-service.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-store.d.ts +45 -0
- package/data/build/dist/host/terminal/terminal-process-store.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-store.js +183 -0
- package/data/build/dist/host/terminal/terminal-process-store.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-service.d.ts +150 -0
- package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-service.js +1171 -0
- package/data/build/dist/host/terminal/terminal-service.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-store.d.ts +49 -0
- package/data/build/dist/host/terminal/terminal-store.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-store.js +242 -0
- package/data/build/dist/host/terminal/terminal-store.js.map +1 -0
- package/data/build/dist/host/update/application-result.d.ts +3 -0
- package/data/build/dist/host/update/application-result.d.ts.map +1 -0
- package/data/build/dist/host/update/application-result.js +13 -0
- package/data/build/dist/host/update/application-result.js.map +1 -0
- package/data/build/dist/host/update/http.d.ts +7 -0
- package/data/build/dist/host/update/http.d.ts.map +1 -0
- package/data/build/dist/host/update/http.js +55 -0
- package/data/build/dist/host/update/http.js.map +1 -0
- package/data/build/dist/host/update/metadata.d.ts +14 -0
- package/data/build/dist/host/update/metadata.d.ts.map +1 -0
- package/data/build/dist/host/update/metadata.js +75 -0
- package/data/build/dist/host/update/metadata.js.map +1 -0
- package/data/build/dist/host/update/release-notes.d.ts +6 -0
- package/data/build/dist/host/update/release-notes.d.ts.map +1 -0
- package/data/build/dist/host/update/release-notes.js +52 -0
- package/data/build/dist/host/update/release-notes.js.map +1 -0
- package/data/build/dist/host/update/service.d.ts +25 -0
- package/data/build/dist/host/update/service.d.ts.map +1 -0
- package/data/build/dist/host/update/service.js +209 -0
- package/data/build/dist/host/update/service.js.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.js +15 -0
- package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
- package/data/build/dist/host/workspace-root.d.ts +13 -0
- package/data/build/dist/host/workspace-root.d.ts.map +1 -0
- package/data/build/dist/host/workspace-root.js +98 -0
- package/data/build/dist/host/workspace-root.js.map +1 -0
- package/data/build/dist/index.d.ts +40 -0
- package/data/build/dist/index.d.ts.map +1 -0
- package/data/build/dist/index.js +31 -0
- package/data/build/dist/index.js.map +1 -0
- package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
- package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/attachment-prompts.js +17 -0
- package/data/build/dist/shared/attachment-prompts.js.map +1 -0
- package/data/build/dist/shared/attachments.d.ts +18 -0
- package/data/build/dist/shared/attachments.d.ts.map +1 -0
- package/data/build/dist/shared/attachments.js +22 -0
- package/data/build/dist/shared/attachments.js.map +1 -0
- package/data/build/dist/shared/cli-provider-route.d.ts +7 -0
- package/data/build/dist/shared/cli-provider-route.d.ts.map +1 -0
- package/data/build/dist/shared/cli-provider-route.js +13 -0
- package/data/build/dist/shared/cli-provider-route.js.map +1 -0
- package/data/build/dist/shared/codex-performance.d.ts +3 -0
- package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
- package/data/build/dist/shared/codex-performance.js +2 -0
- package/data/build/dist/shared/codex-performance.js.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts +14 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.js +51 -0
- package/data/build/dist/shared/contracts/agent-team.js.map +1 -0
- package/data/build/dist/shared/contracts/auth.d.ts +122 -0
- package/data/build/dist/shared/contracts/auth.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/auth.js +8 -0
- package/data/build/dist/shared/contracts/auth.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +484 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.js +2 -0
- package/data/build/dist/shared/contracts/cli-adapter.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.js +2 -0
- package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
- package/data/build/dist/shared/contracts/command-code.d.ts +5 -0
- package/data/build/dist/shared/contracts/command-code.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/command-code.js +2 -0
- package/data/build/dist/shared/contracts/command-code.js.map +1 -0
- package/data/build/dist/shared/contracts/config.d.ts +363 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/config.js +302 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -0
- package/data/build/dist/shared/contracts/credentials.d.ts +73 -0
- package/data/build/dist/shared/contracts/credentials.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/credentials.js +38 -0
- package/data/build/dist/shared/contracts/credentials.js.map +1 -0
- package/data/build/dist/shared/contracts/debug-config.d.ts +28 -0
- package/data/build/dist/shared/contracts/debug-config.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/debug-config.js +78 -0
- package/data/build/dist/shared/contracts/debug-config.js.map +1 -0
- package/data/build/dist/shared/contracts/debug.d.ts +75 -0
- package/data/build/dist/shared/contracts/debug.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/debug.js +121 -0
- package/data/build/dist/shared/contracts/debug.js.map +1 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts +86 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/dsh-device.js +2 -0
- package/data/build/dist/shared/contracts/dsh-device.js.map +1 -0
- package/data/build/dist/shared/contracts/errors.d.ts +30 -0
- package/data/build/dist/shared/contracts/errors.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/errors.js +38 -0
- package/data/build/dist/shared/contracts/errors.js.map +1 -0
- package/data/build/dist/shared/contracts/feature.d.ts +93 -0
- package/data/build/dist/shared/contracts/feature.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/feature.js +2 -0
- package/data/build/dist/shared/contracts/feature.js.map +1 -0
- package/data/build/dist/shared/contracts/file-management.d.ts +6 -0
- package/data/build/dist/shared/contracts/file-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/file-management.js +3 -0
- package/data/build/dist/shared/contracts/file-management.js.map +1 -0
- package/data/build/dist/shared/contracts/git.d.ts +129 -0
- package/data/build/dist/shared/contracts/git.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/git.js +29 -0
- package/data/build/dist/shared/contracts/git.js.map +1 -0
- package/data/build/dist/shared/contracts/host-status.d.ts +32 -0
- package/data/build/dist/shared/contracts/host-status.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/host-status.js +2 -0
- package/data/build/dist/shared/contracts/host-status.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts +55 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.js +48 -0
- package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.d.ts +53 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.js +2 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.js.map +1 -0
- package/data/build/dist/shared/contracts/llm-chat.d.ts +18 -0
- package/data/build/dist/shared/contracts/llm-chat.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/llm-chat.js +2 -0
- package/data/build/dist/shared/contracts/llm-chat.js.map +1 -0
- package/data/build/dist/shared/contracts/plugin-update.d.ts +93 -0
- package/data/build/dist/shared/contracts/plugin-update.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/plugin-update.js +128 -0
- package/data/build/dist/shared/contracts/plugin-update.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +135 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.js +195 -0
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/signaling.d.ts +67 -0
- package/data/build/dist/shared/contracts/signaling.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/signaling.js +2 -0
- package/data/build/dist/shared/contracts/signaling.js.map +1 -0
- package/data/build/dist/shared/contracts/subscription.d.ts +206 -0
- package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/subscription.js +15 -0
- package/data/build/dist/shared/contracts/subscription.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal-process.d.ts +65 -0
- package/data/build/dist/shared/contracts/terminal-process.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal-process.js +2 -0
- package/data/build/dist/shared/contracts/terminal-process.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal-share.d.ts +27 -0
- package/data/build/dist/shared/contracts/terminal-share.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal-share.js +2 -0
- package/data/build/dist/shared/contracts/terminal-share.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal.d.ts +141 -0
- package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal.js +2 -0
- package/data/build/dist/shared/contracts/terminal.js.map +1 -0
- package/data/build/dist/shared/contracts/transport.d.ts +45 -0
- package/data/build/dist/shared/contracts/transport.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/transport.js +3 -0
- package/data/build/dist/shared/contracts/transport.js.map +1 -0
- package/data/build/dist/shared/contracts/version.d.ts +25 -0
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/version.js +89 -0
- package/data/build/dist/shared/contracts/version.js.map +1 -0
- package/data/build/dist/shared/credential-carrier.d.ts +19 -0
- package/data/build/dist/shared/credential-carrier.d.ts.map +1 -0
- package/data/build/dist/shared/credential-carrier.js +90 -0
- package/data/build/dist/shared/credential-carrier.js.map +1 -0
- package/data/build/dist/shared/debug.d.ts +22 -0
- package/data/build/dist/shared/debug.d.ts.map +1 -0
- package/data/build/dist/shared/debug.js +89 -0
- package/data/build/dist/shared/debug.js.map +1 -0
- package/data/build/dist/shared/delegation-carrier.d.ts +24 -0
- package/data/build/dist/shared/delegation-carrier.d.ts.map +1 -0
- package/data/build/dist/shared/delegation-carrier.js +111 -0
- package/data/build/dist/shared/delegation-carrier.js.map +1 -0
- package/data/build/dist/shared/index.d.ts +29 -0
- package/data/build/dist/shared/index.d.ts.map +1 -0
- package/data/build/dist/shared/index.js +13 -0
- package/data/build/dist/shared/index.js.map +1 -0
- package/data/build/dist/shared/native-approval-modes.d.ts +7 -0
- package/data/build/dist/shared/native-approval-modes.d.ts.map +1 -0
- package/data/build/dist/shared/native-approval-modes.js +38 -0
- package/data/build/dist/shared/native-approval-modes.js.map +1 -0
- package/data/build/dist/shared/provider-icon-resources.d.ts +4 -0
- package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -0
- package/data/build/dist/shared/provider-icon-resources.js +25 -0
- package/data/build/dist/shared/provider-icon-resources.js.map +1 -0
- package/data/build/dist/shared/request-performance.d.ts +20 -0
- package/data/build/dist/shared/request-performance.d.ts.map +1 -0
- package/data/build/dist/shared/request-performance.js +6 -0
- package/data/build/dist/shared/request-performance.js.map +1 -0
- package/data/build/dist/shared/runtime-environment.d.ts +5 -0
- package/data/build/dist/shared/runtime-environment.d.ts.map +1 -0
- package/data/build/dist/shared/runtime-environment.js +7 -0
- package/data/build/dist/shared/runtime-environment.js.map +1 -0
- package/data/build/dist/shared/session-file-location.d.ts +11 -0
- package/data/build/dist/shared/session-file-location.d.ts.map +1 -0
- package/data/build/dist/shared/session-file-location.js +20 -0
- package/data/build/dist/shared/session-file-location.js.map +1 -0
- package/data/build/dist/shared/session-reference.d.ts +9 -0
- package/data/build/dist/shared/session-reference.d.ts.map +1 -0
- package/data/build/dist/shared/session-reference.js +27 -0
- package/data/build/dist/shared/session-reference.js.map +1 -0
- package/data/build/dist/shared/session-title.d.ts +12 -0
- package/data/build/dist/shared/session-title.d.ts.map +1 -0
- package/data/build/dist/shared/session-title.js +71 -0
- package/data/build/dist/shared/session-title.js.map +1 -0
- package/data/build/dist/shared/terminal-input.d.ts +8 -0
- package/data/build/dist/shared/terminal-input.d.ts.map +1 -0
- package/data/build/dist/shared/terminal-input.js +10 -0
- package/data/build/dist/shared/terminal-input.js.map +1 -0
- package/data/build/dist/shared/translation-effect.d.ts +8 -0
- package/data/build/dist/shared/translation-effect.d.ts.map +1 -0
- package/data/build/dist/shared/translation-effect.js +24 -0
- package/data/build/dist/shared/translation-effect.js.map +1 -0
- package/data/build/dist/shared/translation-indicator.d.ts +26 -0
- package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
- package/data/build/dist/shared/translation-indicator.js +29 -0
- package/data/build/dist/shared/translation-indicator.js.map +1 -0
- package/data/build/dist/transport/carrier.d.ts +48 -0
- package/data/build/dist/transport/carrier.d.ts.map +1 -0
- package/data/build/dist/transport/carrier.js +319 -0
- package/data/build/dist/transport/carrier.js.map +1 -0
- package/data/build/dist/transport/debug.d.ts +39 -0
- package/data/build/dist/transport/debug.d.ts.map +1 -0
- package/data/build/dist/transport/debug.js +97 -0
- package/data/build/dist/transport/debug.js.map +1 -0
- package/data/build/dist/transport/dsh-envelope.d.ts +41 -0
- package/data/build/dist/transport/dsh-envelope.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-envelope.js +107 -0
- package/data/build/dist/transport/dsh-envelope.js.map +1 -0
- package/data/build/dist/transport/dsh-gateway.d.ts +64 -0
- package/data/build/dist/transport/dsh-gateway.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-gateway.js +254 -0
- package/data/build/dist/transport/dsh-gateway.js.map +1 -0
- package/data/build/dist/transport/dsh-session.d.ts +72 -0
- package/data/build/dist/transport/dsh-session.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-session.js +291 -0
- package/data/build/dist/transport/dsh-session.js.map +1 -0
- package/data/build/dist/transport/dsh-transport.d.ts +59 -0
- package/data/build/dist/transport/dsh-transport.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-transport.js +136 -0
- package/data/build/dist/transport/dsh-transport.js.map +1 -0
- package/data/build/dist/transport/frame.d.ts +132 -0
- package/data/build/dist/transport/frame.d.ts.map +1 -0
- package/data/build/dist/transport/frame.js +168 -0
- package/data/build/dist/transport/frame.js.map +1 -0
- package/data/build/dist/transport/index.d.ts +11 -0
- package/data/build/dist/transport/index.d.ts.map +1 -0
- package/data/build/dist/transport/index.js +11 -0
- package/data/build/dist/transport/index.js.map +1 -0
- package/data/build/dist/transport/multiplexer.d.ts +63 -0
- package/data/build/dist/transport/multiplexer.d.ts.map +1 -0
- package/data/build/dist/transport/multiplexer.js +323 -0
- package/data/build/dist/transport/multiplexer.js.map +1 -0
- package/data/build/dist/transport/webrtc-client.d.ts +75 -0
- package/data/build/dist/transport/webrtc-client.d.ts.map +1 -0
- package/data/build/dist/transport/webrtc-client.js +382 -0
- package/data/build/dist/transport/webrtc-client.js.map +1 -0
- package/data/build/dist/transport/webrtc-host.d.ts +60 -0
- package/data/build/dist/transport/webrtc-host.d.ts.map +1 -0
- package/data/build/dist/transport/webrtc-host.js +259 -0
- package/data/build/dist/transport/webrtc-host.js.map +1 -0
- package/data/build/dist/typert.host.d.ts +25 -0
- package/data/build/dist/typert.host.d.ts.map +1 -0
- package/data/build/dist/typert.host.js +155 -0
- package/data/build/dist/typert.host.js.map +1 -0
- package/data/build/dist/typert.remote-client.d.ts +11 -0
- package/data/build/dist/typert.remote-client.d.ts.map +1 -0
- package/data/build/dist/typert.remote-client.js +7 -0
- package/data/build/dist/typert.remote-client.js.map +1 -0
- package/dsh.bundle.patch +23 -0
- package/package.json +227 -4
- package/profile/README.md +43 -0
- package/profile/cordis.patch.yml +2 -0
- package/profile/package.json +25 -0
- package/profile/scripts/check-dsh-install.mjs +126 -0
- package/profile/version.json +5 -0
- package/scripts/check-dsh-install.mjs +128 -0
- package/version.json +6 -0
|
@@ -0,0 +1,2098 @@
|
|
|
1
|
+
import { runAsyncCommand } from './process-utils.js';
|
|
2
|
+
import { detectBinary } from './binary-detection.js';
|
|
3
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
4
|
+
import { closeSync, copyFileSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, readSync, realpathSync, statSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { homedir } from 'node:os';
|
|
6
|
+
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
7
|
+
import readline from 'node:readline';
|
|
8
|
+
import { firstToolText, serializeToolValue } from './tool-observation.js';
|
|
9
|
+
import { usageChunk } from './rpc-driver-utils.js';
|
|
10
|
+
import { commandEnvironment, terminateChildProcess } from './process-utils.js';
|
|
11
|
+
import { prepareAttachmentPaths, promptWithAttachmentPaths } from './attachment-utils.js';
|
|
12
|
+
import { parseSkillFrontmatter } from './skill-filesystem.js';
|
|
13
|
+
import { commandCodeNativeAgentArgs, commandCodeNativeAgentEnvironment, subagentBridgeActive, teamBridgeToken } from '../cli-bridge/injections.js';
|
|
14
|
+
import { getSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
15
|
+
import { AcpCliDriver } from './acp-cli-driver.js';
|
|
16
|
+
import { knownCommandCodeContextWindow } from './model-catalog.js';
|
|
17
|
+
import { CommandCodeHistory, CommandCodeUsageTail, } from './command-code-history.js';
|
|
18
|
+
const WINDOWS = process.platform === 'win32';
|
|
19
|
+
const COMMAND_CODE_BINARIES = WINDOWS
|
|
20
|
+
? ['command-code', 'commandcode', 'cmdc']
|
|
21
|
+
: ['command-code', 'commandcode', 'cmdc', 'cmd'];
|
|
22
|
+
const VALID_EFFORTS = new Set(['low', 'medium', 'high', 'xhigh', 'max']);
|
|
23
|
+
const CATALOG_EFFORTS = new Map([
|
|
24
|
+
['deepseek/deepseek-v4-flash-vision-exp', ['high', 'max']],
|
|
25
|
+
['deepseek/deepseek-v4-pro', ['high', 'max']],
|
|
26
|
+
['deepseek/deepseek-v4-flash', ['high', 'max']],
|
|
27
|
+
['deepseek/deepseek-v4.1-flash', ['low', 'high', 'max']],
|
|
28
|
+
['deepseek/deepseek-v4.1', ['low', 'high', 'max']],
|
|
29
|
+
['deepseek/deepseek-v4-flash-fast', ['low', 'high', 'max']],
|
|
30
|
+
['moonshotai/kimi-k3', ['low', 'high', 'max']],
|
|
31
|
+
['moonshotai/kimi-k2.7-code', []],
|
|
32
|
+
['moonshotai/kimi-k2.7-code-highspeed', []],
|
|
33
|
+
['moonshotai/kimi-k2.6', []],
|
|
34
|
+
['moonshotai/kimi-k2.5', []],
|
|
35
|
+
['z-ai/glm-5.3-flash', ['low', 'high', 'max']],
|
|
36
|
+
['z-ai/glm-5.3-flashx', ['low', 'high', 'max']],
|
|
37
|
+
['zai-org/glm-5.3', ['low', 'high', 'max']],
|
|
38
|
+
['zai-org/glm-5.2', ['high', 'max']],
|
|
39
|
+
['zai-org/glm-5.2-fast', []],
|
|
40
|
+
['zai-org/glm-5.1', []],
|
|
41
|
+
['zai-org/glm-5', []],
|
|
42
|
+
['minimaxai/minimax-m3', ['low', 'medium', 'high']],
|
|
43
|
+
['minimaxai/minimax-m2.7', []],
|
|
44
|
+
['minimaxai/minimax-m2.5', []],
|
|
45
|
+
['xiaomi/mimo-v2.6-pro', []],
|
|
46
|
+
['xiaomi/mimo-v2.6-pro-ultraspeed', []],
|
|
47
|
+
['xiaomi/mimo-v2.6-flash', []],
|
|
48
|
+
['xiaomi/mimo-v2.5-pro', []],
|
|
49
|
+
['xiaomi/mimo-v2.5', []],
|
|
50
|
+
['qwen/qwen3.8-omni-flash', ['low', 'medium', 'xhigh']],
|
|
51
|
+
['qwen/qwen3.8-max-0902', ['low', 'medium', 'xhigh']],
|
|
52
|
+
['qwen/qwen3.8-max', ['low', 'medium', 'xhigh']],
|
|
53
|
+
['qwen/qwen3.8-27b', ['low', 'medium', 'xhigh']],
|
|
54
|
+
['qwen/qwen3.8-flash', ['low', 'medium', 'xhigh']],
|
|
55
|
+
['qwen/qwen3.7-max', []],
|
|
56
|
+
['qwen/qwen3.7-plus', []],
|
|
57
|
+
['qwen/qwen3.7-flash', []],
|
|
58
|
+
['qwen/qwen3.6-max-preview', []],
|
|
59
|
+
['qwen/qwen3.6-plus', []],
|
|
60
|
+
['meituan/longcat-2.0', []],
|
|
61
|
+
['stepfun/step-5-preview', []],
|
|
62
|
+
['stepfun/step-3.7-flash', []],
|
|
63
|
+
['stepfun/step-3.5-flash', []],
|
|
64
|
+
['tencent/hy3-paid', []],
|
|
65
|
+
['tencent/hy4-preview', ['low', 'medium', 'high']],
|
|
66
|
+
['nvidia/nemotron-3-ultra-550b-a55b', []],
|
|
67
|
+
['thinkingmachines/inkling', []],
|
|
68
|
+
['thinkingmachines/inkling-small', []],
|
|
69
|
+
['poolside/laguna-s-2.1-free', []],
|
|
70
|
+
['inclusionai/ling-3.0-flash-sante:free', []],
|
|
71
|
+
['sakana/fugu-ultra', ['high', 'xhigh']],
|
|
72
|
+
['claude-sonnet-5', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
73
|
+
['claude-sonnet-4-6', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
74
|
+
['claude-fable-5-1', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
75
|
+
['claude-fable-5', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
76
|
+
['claude-opus-5', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
77
|
+
['claude-opus-4-8', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
78
|
+
['claude-opus-4-7', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
79
|
+
['claude-haiku-4-5', []],
|
|
80
|
+
['gpt-6-astra', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
81
|
+
['gpt-5.6-sol', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
82
|
+
['gpt-5.6-terra', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
83
|
+
['gpt-5.6-luna', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
84
|
+
['gpt-5.5', ['low', 'medium', 'high', 'xhigh']],
|
|
85
|
+
['gpt-5.4', ['low', 'medium', 'high', 'xhigh']],
|
|
86
|
+
['gpt-5.3-codex', ['low', 'medium', 'high', 'xhigh']],
|
|
87
|
+
['gpt-5.4-mini', ['low', 'medium', 'high']],
|
|
88
|
+
['google/gemini-3.8-flash', ['low', 'medium', 'high']],
|
|
89
|
+
['google/gemini-3.7-flash', ['low', 'medium', 'high']],
|
|
90
|
+
['google/gemini-3.6-flash', ['low', 'medium', 'high']],
|
|
91
|
+
['google/gemini-3.5-flash', ['low', 'medium', 'high']],
|
|
92
|
+
['google/gemini-3.5-flash-lite', ['low', 'medium', 'high']],
|
|
93
|
+
['google/gemini-3.1-flash-lite', ['low', 'medium', 'high']],
|
|
94
|
+
['meta/muse-spark-1.1', ['low', 'medium', 'high', 'xhigh']],
|
|
95
|
+
['meta/muse-spark-1.2', ['low', 'medium', 'high', 'xhigh']],
|
|
96
|
+
['meta/muse-spark-1.2-contributor', ['low', 'medium', 'high', 'xhigh']],
|
|
97
|
+
['meta/muse-spark-1.3', ['low', 'medium', 'high', 'xhigh', 'max']],
|
|
98
|
+
['meta/muse-spark-1.3-contributor', ['low', 'medium', 'high', 'xhigh']],
|
|
99
|
+
['xai/grok-4.6', ['low', 'medium', 'high', 'xhigh']],
|
|
100
|
+
['xai/grok-4.5', ['low', 'medium', 'high']],
|
|
101
|
+
['xai/grok-4.7', ['low', 'medium', 'high', 'xhigh']],
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* 按模型名的最后一段回退查找思考强度。
|
|
105
|
+
*
|
|
106
|
+
* BYOK 提供者的模型 id 带自定义前缀(如 `mcgrox/deepseek-v4.1-flash`),
|
|
107
|
+
* 而 CATALOG_EFFORTS 的键是 Command Code 内置目录 id(`deepseek/deepseek-v4.1-flash`),
|
|
108
|
+
* 直接查表会落空,导致菜单只剩 Default。表内 77 个键的最后一段互不重复,
|
|
109
|
+
* 因此可以安全地按末段匹配;命中多个时按歧义处理并返回空,避免误判。
|
|
110
|
+
*/
|
|
111
|
+
function catalogEffortsFor(id) {
|
|
112
|
+
const key = id.toLowerCase();
|
|
113
|
+
const direct = CATALOG_EFFORTS.get(key);
|
|
114
|
+
if (direct !== undefined)
|
|
115
|
+
return direct;
|
|
116
|
+
const bare = key.includes('/') ? key.slice(key.lastIndexOf('/') + 1) : key;
|
|
117
|
+
if (bare === key)
|
|
118
|
+
return [];
|
|
119
|
+
let matched;
|
|
120
|
+
for (const [candidate, efforts] of CATALOG_EFFORTS) {
|
|
121
|
+
if (!candidate.endsWith(`/${bare}`))
|
|
122
|
+
continue;
|
|
123
|
+
if (matched !== undefined)
|
|
124
|
+
return []; // 末段歧义,宁可不给强度也不猜
|
|
125
|
+
matched = efforts;
|
|
126
|
+
}
|
|
127
|
+
return matched ?? [];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 读取 BYOK 提供者在 `~/.commandcode/providers.json` 里声明的思考强度。
|
|
131
|
+
*
|
|
132
|
+
* 这是 BYOK 模型强度的权威来源:用户在 providers.json 的模型条目上写
|
|
133
|
+
* `reasoningEfforts: [...]`,Command Code 据此校验 `--effort`。内置目录查不到
|
|
134
|
+
* 的自定义模型只能从这里拿到强度。键为 `提供者/模型` 小写形式,空 Map 表示无声明。
|
|
135
|
+
*/
|
|
136
|
+
function readDeclaredEfforts(homeDirectory) {
|
|
137
|
+
const declared = new Map();
|
|
138
|
+
const config = readJson(join(homeDirectory, 'providers.json'));
|
|
139
|
+
if (config === null)
|
|
140
|
+
return declared;
|
|
141
|
+
const providers = isRecord(config.provider) ? config.provider : isRecord(config.providers) ? config.providers : null;
|
|
142
|
+
if (providers === null)
|
|
143
|
+
return declared;
|
|
144
|
+
for (const [providerId, provider] of Object.entries(providers)) {
|
|
145
|
+
if (!isRecord(provider) || !isRecord(provider.models))
|
|
146
|
+
continue;
|
|
147
|
+
for (const [modelName, entry] of Object.entries(provider.models)) {
|
|
148
|
+
if (!isRecord(entry) || !Array.isArray(entry.reasoningEfforts))
|
|
149
|
+
continue;
|
|
150
|
+
const efforts = entry.reasoningEfforts.filter((value) => typeof value === 'string' && VALID_EFFORTS.has(value));
|
|
151
|
+
if (efforts.length > 0)
|
|
152
|
+
declared.set(`${providerId}/${modelName}`.toLowerCase(), efforts);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return declared;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* CLI 的 `--max-turns` 默认只有 100,复杂任务经常在半途被截断。
|
|
159
|
+
*
|
|
160
|
+
* 这里显式抬高预算,避免“还没做完就输出结束”;真撞到了再由自动续跑兜底。
|
|
161
|
+
*/
|
|
162
|
+
const DEFAULT_MAX_TURNS = 500;
|
|
163
|
+
const DEFAULT_AUTO_CONTINUE_ATTEMPTS = 3;
|
|
164
|
+
const AUTO_CONTINUE_PROMPT = '继续';
|
|
165
|
+
/** Command Code ACP 自由文本兼容 loader 的 URL;只注入子进程,不改写安装包。 */
|
|
166
|
+
const COMMAND_CODE_ACP_LOADER_URL = new URL('./command-code-acp-loader.js', import.meta.url).href;
|
|
167
|
+
function commandCodeAcpEnvironment() {
|
|
168
|
+
// file URL 会把空格编码成 %20,避免 Windows 的 NODE_OPTIONS 按空格拆路径。
|
|
169
|
+
const loaderOption = `--loader=${COMMAND_CODE_ACP_LOADER_URL}`;
|
|
170
|
+
const existing = process.env.NODE_OPTIONS?.trim();
|
|
171
|
+
return { NODE_OPTIONS: existing === undefined || existing === '' ? loaderOption : `${existing} ${loaderOption}` };
|
|
172
|
+
}
|
|
173
|
+
/** CLI 在 -p 模式撞到 --max-turns 时的退出码(MAX_TURNS_REACHED)。 */
|
|
174
|
+
const COMMAND_CODE_MAX_TURNS_EXIT_CODE = 8;
|
|
175
|
+
/** 发送 SIGINT 后等待 CLI 自己收尾的时间;超时再强制清理进程树。 */
|
|
176
|
+
const COMMAND_CODE_INTERRUPT_GRACE_MS = 1_500;
|
|
177
|
+
/** 将 DSH 权限状态映射为 Command Code 参数;未知状态保持 CLI 默认审批。 */
|
|
178
|
+
function commandCodePermissionArgs(permission) {
|
|
179
|
+
if (permission?.sandboxMode === 'danger-full-access' && permission.approvalPolicy === 'never')
|
|
180
|
+
return ['--yolo'];
|
|
181
|
+
if (permission?.sandboxMode === 'workspace-write')
|
|
182
|
+
return ['--permission-mode', 'accept-edits'];
|
|
183
|
+
if (permission?.sandboxMode === 'read-only')
|
|
184
|
+
return ['--plan'];
|
|
185
|
+
return [];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Command Code 驱动:使用 `--session` 建立首轮输入,随后绑定 Provider 原生会话并用
|
|
189
|
+
* `--resume + -p + --output-format json` 续接。首轮历史只作为 CLI 的输入快照,不能替代
|
|
190
|
+
* Provider 自己维护的 canonical transcript。
|
|
191
|
+
*
|
|
192
|
+
* 与 Codex 驱动保持同一套消息优化:正文/推理增量携带 assistant 消息身份,工具完成后
|
|
193
|
+
* 的下一条 assistant 消息之前结束当前 DSH step,因此一个 Provider 运行会被切成多个
|
|
194
|
+
* step,而不是把整轮正文堆积到最后一条结算消息里。驱动只输出公共事件契约,工具历史、
|
|
195
|
+
* usage 和原生组件映射全部交给公共消息投影层。
|
|
196
|
+
*/
|
|
197
|
+
export class CommandCodeDriver {
|
|
198
|
+
descriptor;
|
|
199
|
+
/**
|
|
200
|
+
* print 回合由驱动自己维护 Provider turn 边界;ACP 回合的整个 agent 循环跑在
|
|
201
|
+
* 一个 `session/prompt` 里,驱动无法在中间结束 llm/stream,只能交给 Registry
|
|
202
|
+
* 在工具完成后挂起同一个迭代器分步。
|
|
203
|
+
*/
|
|
204
|
+
get supportsSegmentedTurns() { return this.acpDriver === undefined; }
|
|
205
|
+
/** ACP 回合由 Registry 按工具边界挂起并续读同一个迭代器。 */
|
|
206
|
+
get supportsToolStepSplitting() { return this.acpDriver !== undefined; }
|
|
207
|
+
homeDirectory;
|
|
208
|
+
binaries;
|
|
209
|
+
runSpawnSync;
|
|
210
|
+
runSpawn;
|
|
211
|
+
maxTurns;
|
|
212
|
+
autoContinueMaxAttempts;
|
|
213
|
+
autoContinuePrompt;
|
|
214
|
+
history;
|
|
215
|
+
acpDriver;
|
|
216
|
+
respondPermission;
|
|
217
|
+
respondQuestion;
|
|
218
|
+
/** 按规范化 cwd 缓存 Skill 摘要;forceReload 用于响应目录变更。 */
|
|
219
|
+
skillCatalogs = new Map();
|
|
220
|
+
cachedBinary = null;
|
|
221
|
+
cachedEnvironment;
|
|
222
|
+
processes = new Set();
|
|
223
|
+
turns = new Map();
|
|
224
|
+
constructor(options = {}) {
|
|
225
|
+
this.homeDirectory = options.homeDirectory ?? join(homedir(), '.commandcode');
|
|
226
|
+
this.binaries = options.binaries ?? COMMAND_CODE_BINARIES;
|
|
227
|
+
this.runSpawnSync = options.spawnSync ?? spawnSync;
|
|
228
|
+
this.runSpawn = options.spawn ?? spawn;
|
|
229
|
+
this.maxTurns = normalizePositiveInteger(options.maxTurns ?? readOptionalIntegerEnv('AGENT_DOOR_COMMAND_CODE_MAX_TURNS'), DEFAULT_MAX_TURNS);
|
|
230
|
+
this.autoContinueMaxAttempts = normalizeNonNegativeInteger(options.autoContinueMaxAttempts ?? readOptionalIntegerEnv('AGENT_DOOR_COMMAND_CODE_AUTO_CONTINUE_ATTEMPTS'), DEFAULT_AUTO_CONTINUE_ATTEMPTS);
|
|
231
|
+
this.autoContinuePrompt = options.autoContinuePrompt?.trim() || AUTO_CONTINUE_PROMPT;
|
|
232
|
+
const readStatus = options.readStatus ?? ((workspacePath) => this.readCommandCodeStatus(workspacePath));
|
|
233
|
+
this.history = new CommandCodeHistory(this.homeDirectory, { readStatus });
|
|
234
|
+
const legacyCapabilities = ['models', 'skills', 'stream', 'resume', 'interrupt', 'tool-events', 'reasoning', 'usage', 'history'];
|
|
235
|
+
const acpCapabilities = [...legacyCapabilities, 'permission', 'questions'];
|
|
236
|
+
this.descriptor = { id: 'command-code', name: 'Command Code', protocol: options.enableAcp === true ? 'acp' : 'command', capabilities: options.enableAcp === true ? acpCapabilities : legacyCapabilities };
|
|
237
|
+
if (options.enableAcp === true) {
|
|
238
|
+
// ACP 只在 prompt 结束时给出整轮累计用量。这里按 canonical transcript 的增量
|
|
239
|
+
// 把每次模型请求的用量单独交给驱动,ContextMeter 才不会把整轮累计(实测
|
|
240
|
+
// 17.6M)当成当前上下文占用。
|
|
241
|
+
const usageTail = new CommandCodeUsageTail(this.homeDirectory);
|
|
242
|
+
this.acpDriver = new AcpCliDriver({
|
|
243
|
+
binaries: this.binaries,
|
|
244
|
+
spawnSync: this.runSpawnSync,
|
|
245
|
+
spawn: this.runSpawn,
|
|
246
|
+
args: ['acp'],
|
|
247
|
+
buildArgs: (input) => commandCodeAcpArgs(input),
|
|
248
|
+
runtimeModelSelection: false,
|
|
249
|
+
configureSession: configureCommandCodeAcpSession,
|
|
250
|
+
recoverConfigureSession: recoverCommandCodeAcpSession,
|
|
251
|
+
sessionEnvironment: commandCodeAcpEnvironment(),
|
|
252
|
+
sessionEnvironmentForInput: (input) => ({
|
|
253
|
+
...commandCodeNativeAgentEnvironment(input.sessionId, 'command-code'),
|
|
254
|
+
}),
|
|
255
|
+
id: 'command-code',
|
|
256
|
+
name: 'Command Code',
|
|
257
|
+
capabilities: acpCapabilities,
|
|
258
|
+
readQuestionRequest: readCommandCodeQuestionRequest,
|
|
259
|
+
decidePermission: commandCodeAcpPermissionDecision,
|
|
260
|
+
enrichUsage: enrichCommandCodeUsage,
|
|
261
|
+
stepUsage: {
|
|
262
|
+
begin: (input, providerSessionId) => {
|
|
263
|
+
usageTail.begin(providerSessionId, input.cwd ?? process.cwd());
|
|
264
|
+
},
|
|
265
|
+
take: (input, providerSessionId) => {
|
|
266
|
+
const delta = usageTail.take(providerSessionId, input.cwd ?? process.cwd());
|
|
267
|
+
if (delta === null)
|
|
268
|
+
return null;
|
|
269
|
+
// 只给原始四桶:上下文窗口与占用由 ACP 驱动合并 Provider 的 usage_update
|
|
270
|
+
// 之后再补齐,避免这里先把 contextTokens 写成请求规模、盖掉真实占用。
|
|
271
|
+
const usage = usageChunk({
|
|
272
|
+
inputTokens: delta.inputTokens,
|
|
273
|
+
outputTokens: delta.outputTokens,
|
|
274
|
+
cacheReadTokens: delta.cacheReadTokens,
|
|
275
|
+
cacheWriteTokens: delta.cacheWriteTokens,
|
|
276
|
+
});
|
|
277
|
+
return usage?.type === 'usage' ? usage : null;
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
probeReason: 'Command Code ACP 不公开可安全读取的会话索引',
|
|
281
|
+
});
|
|
282
|
+
this.respondPermission = (sessionId, response) => this.acpDriver.respondPermission(sessionId, response);
|
|
283
|
+
this.respondQuestion = (sessionId, response) => this.acpDriver.respondQuestion(sessionId, response);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
this.acpDriver = undefined;
|
|
287
|
+
// 保持旧实例的运行时能力声明:未启用 ACP 时不暴露这两个可回写接口。
|
|
288
|
+
this.respondPermission = () => { throw new Error('Command Code ACP 未启用'); };
|
|
289
|
+
this.respondQuestion = () => { throw new Error('Command Code ACP 未启用'); };
|
|
290
|
+
delete this.respondPermission;
|
|
291
|
+
delete this.respondQuestion;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/** 读取 Command Code 原生会话目录,供 Provider History 层使用。 */
|
|
295
|
+
detectSessions(workspacePath) {
|
|
296
|
+
return this.history.detectSessions(workspacePath);
|
|
297
|
+
}
|
|
298
|
+
detectSessionsDetailed(workspacePath) {
|
|
299
|
+
return this.history.detectSessionsDetailed(workspacePath);
|
|
300
|
+
}
|
|
301
|
+
/** 读取 Command Code 与 `.agents` 兼容目录中的 Skill 摘要,不返回本地路径。 */
|
|
302
|
+
async listSkills(input) {
|
|
303
|
+
if (input.signal?.aborted)
|
|
304
|
+
throw new Error('Skill 目录读取已取消');
|
|
305
|
+
const command = this.cachedBinary ?? (await this.detect()).command;
|
|
306
|
+
if (command === null)
|
|
307
|
+
return [];
|
|
308
|
+
const cwd = resolve(input.cwd ?? process.cwd());
|
|
309
|
+
const entries = this.readSkillCatalog(cwd, input.forceReload === true);
|
|
310
|
+
return entries.map(({ path: _path, ...descriptor }) => descriptor);
|
|
311
|
+
}
|
|
312
|
+
/** 只为显式 `/skill-name` 或 `$skill-name` 下发匹配的 Skill 目录。 */
|
|
313
|
+
async resolveSkillPaths(input) {
|
|
314
|
+
const names = commandCodeSkillNames(input.prompt);
|
|
315
|
+
if (names.length === 0)
|
|
316
|
+
return [];
|
|
317
|
+
if (input.signal?.aborted)
|
|
318
|
+
throw new Error('Skill 目录读取已取消');
|
|
319
|
+
const entries = this.readSkillCatalog(resolve(input.cwd ?? process.cwd()), false);
|
|
320
|
+
const byName = new Map(entries.map((entry) => [entry.name, entry]));
|
|
321
|
+
const paths = [];
|
|
322
|
+
for (const name of names) {
|
|
323
|
+
const entry = byName.get(name);
|
|
324
|
+
if (entry?.enabled !== true || paths.includes(entry.path))
|
|
325
|
+
continue;
|
|
326
|
+
paths.push(entry.path);
|
|
327
|
+
}
|
|
328
|
+
return paths;
|
|
329
|
+
}
|
|
330
|
+
readSkillCatalog(cwd, forceReload) {
|
|
331
|
+
const cached = this.skillCatalogs.get(cwd);
|
|
332
|
+
if (!forceReload && cached !== undefined)
|
|
333
|
+
return cached;
|
|
334
|
+
const entries = scanCommandCodeSkills(cwd, this.homeDirectory);
|
|
335
|
+
this.skillCatalogs.set(cwd, entries);
|
|
336
|
+
return entries;
|
|
337
|
+
}
|
|
338
|
+
startSession(workspacePath, options = {}) {
|
|
339
|
+
return this.history.startSession(workspacePath, options);
|
|
340
|
+
}
|
|
341
|
+
resumeSession(providerSessionId, rawStoreRef) {
|
|
342
|
+
return this.history.resumeSession(providerSessionId, rawStoreRef);
|
|
343
|
+
}
|
|
344
|
+
sendMessage(providerSessionId, rawStoreRef, content) {
|
|
345
|
+
return this.history.sendMessage(providerSessionId, rawStoreRef, content);
|
|
346
|
+
}
|
|
347
|
+
readSessionHistory(providerSessionId, rawStoreRef, cursor, limit, direction = 'forward') {
|
|
348
|
+
return this.history.readSessionHistory(providerSessionId, rawStoreRef, cursor, limit, direction);
|
|
349
|
+
}
|
|
350
|
+
readSessionHistoryDelta(providerSessionId, rawStoreRef, cursor, limit, direction = 'forward') {
|
|
351
|
+
return this.history.readSessionHistoryDelta(providerSessionId, rawStoreRef, cursor, limit, direction);
|
|
352
|
+
}
|
|
353
|
+
subscribeSession(providerSessionId, rawStoreRef, cursor, limit, onEvent) {
|
|
354
|
+
return this.history.subscribeSession(providerSessionId, rawStoreRef, cursor, limit, onEvent);
|
|
355
|
+
}
|
|
356
|
+
readSessionTitle(providerSessionId, rawStoreRef) {
|
|
357
|
+
return this.history.readSessionTitle(providerSessionId, rawStoreRef);
|
|
358
|
+
}
|
|
359
|
+
renameSessionTitle(providerSessionId, rawStoreRef, title) {
|
|
360
|
+
return this.history.renameSessionTitle(providerSessionId, rawStoreRef, title);
|
|
361
|
+
}
|
|
362
|
+
updateSessionArchiveState(providerSessionId, rawStoreRef, isArchived) {
|
|
363
|
+
return this.history.updateSessionArchiveState(providerSessionId, rawStoreRef, isArchived);
|
|
364
|
+
}
|
|
365
|
+
deleteSession(providerSessionId, rawStoreRef) {
|
|
366
|
+
return this.history.deleteSession(providerSessionId, rawStoreRef);
|
|
367
|
+
}
|
|
368
|
+
readContextUsage(providerSessionId, rawStoreRef) {
|
|
369
|
+
return this.history.readContextUsage(providerSessionId, rawStoreRef);
|
|
370
|
+
}
|
|
371
|
+
readSessionStats(providerSessionId, rawStoreRef) {
|
|
372
|
+
return this.history.readSessionStats(providerSessionId, rawStoreRef);
|
|
373
|
+
}
|
|
374
|
+
forkSession(providerSessionId, workspacePath, options) {
|
|
375
|
+
return this.history.forkSession(providerSessionId, workspacePath, options);
|
|
376
|
+
}
|
|
377
|
+
async detect() {
|
|
378
|
+
const result = await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync, parseVersion: (output) => output.match(/\d+\.\d+\.\d+/u)?.[0] ?? null });
|
|
379
|
+
this.cachedBinary = result.command;
|
|
380
|
+
this.cachedEnvironment = result.command === null ? undefined : commandEnvironment(result.command);
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
async listModels() {
|
|
384
|
+
const detection = await this.detect();
|
|
385
|
+
if (!detection.installed || detection.command === null)
|
|
386
|
+
return emptyCatalog();
|
|
387
|
+
let stdout = '';
|
|
388
|
+
try {
|
|
389
|
+
const result = await runAsyncCommand(this.runSpawnSync, detection.command, ['--list-models'], { encoding: 'utf8', timeout: 12_000, windowsHide: true, shell: WINDOWS, ...(this.cachedEnvironment === undefined ? {} : { env: this.cachedEnvironment }) });
|
|
390
|
+
stdout = result.stdout ?? '';
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
return emptyCatalog();
|
|
394
|
+
}
|
|
395
|
+
const groups = [];
|
|
396
|
+
const declared = readDeclaredEfforts(this.homeDirectory);
|
|
397
|
+
let currentGroup;
|
|
398
|
+
for (const rawLine of stdout.split(/\r?\n/u)) {
|
|
399
|
+
const line = rawLine.trim();
|
|
400
|
+
if (!line || line.startsWith('Available models') || line.startsWith('Pass the full id') || line.startsWith('cmd --') || line.startsWith('Docs:'))
|
|
401
|
+
continue;
|
|
402
|
+
if (!/\s{2,}/u.test(line) && !line.includes(' · ')) {
|
|
403
|
+
currentGroup = { id: line.toLowerCase().replace(/[^a-z0-9]+/gu, '-'), name: line, models: [] };
|
|
404
|
+
groups.push(currentGroup);
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
const match = line.match(/^(\S+)\s{2,}(.*)$/u);
|
|
408
|
+
if (!match || currentGroup === undefined)
|
|
409
|
+
continue;
|
|
410
|
+
const id = match[1];
|
|
411
|
+
const description = match[2].trim();
|
|
412
|
+
// BYOK 模型以 providers.json 的声明为准,内置目录作为回退;
|
|
413
|
+
// 目录回退按末段匹配,使 `mcgrox/deepseek-v4.1-flash` 也能拿到内置强度。
|
|
414
|
+
const efforts = declared.get(id.toLowerCase()) ?? catalogEffortsFor(id);
|
|
415
|
+
currentGroup.models.push({ id, name: id, ...(description ? { description } : {}), efforts });
|
|
416
|
+
}
|
|
417
|
+
const config = readJson(join(this.homeDirectory, 'config.json'));
|
|
418
|
+
// status --json 反映 CLI 当前真实模型;配置文件可能仍是旧值,优先使用运行时状态。
|
|
419
|
+
let statusModel = null;
|
|
420
|
+
try {
|
|
421
|
+
const status = await runAsyncCommand(this.runSpawnSync, detection.command, ['status', '--json'], { encoding: 'utf8', timeout: 5_000, windowsHide: true, shell: WINDOWS, ...(this.cachedEnvironment === undefined ? {} : { env: this.cachedEnvironment }) });
|
|
422
|
+
const parsed = parseJson(status.stdout ?? '');
|
|
423
|
+
statusModel = typeof parsed?.model === 'string' && parsed.model.trim() !== '' ? parsed.model.trim() : null;
|
|
424
|
+
}
|
|
425
|
+
catch { /* 状态读取失败时回退配置文件 */ }
|
|
426
|
+
const currentModel = statusModel ?? (typeof config?.model === 'string' ? config.model : null);
|
|
427
|
+
const configuredEffort = currentModel !== null && isRecord(config?.reasoningEffort) ? config.reasoningEffort[currentModel] : undefined;
|
|
428
|
+
const currentEffort = typeof configuredEffort === 'string' && VALID_EFFORTS.has(configuredEffort) ? configuredEffort : null;
|
|
429
|
+
const result = { groups, currentModel, currentEffort };
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
/** 读取 Provider 当前 status;历史层只在模型一致时使用其中的上下文窗口。 */
|
|
433
|
+
async readCommandCodeStatus(workspacePath) {
|
|
434
|
+
const command = this.cachedBinary ?? this.binaries[0];
|
|
435
|
+
if (command === undefined)
|
|
436
|
+
return null;
|
|
437
|
+
try {
|
|
438
|
+
const result = await runAsyncCommand(this.runSpawnSync, command, ['status', '--json'], {
|
|
439
|
+
cwd: workspacePath,
|
|
440
|
+
encoding: 'utf8',
|
|
441
|
+
timeout: 5_000,
|
|
442
|
+
windowsHide: true,
|
|
443
|
+
shell: WINDOWS,
|
|
444
|
+
env: this.cachedEnvironment ?? commandEnvironment(command),
|
|
445
|
+
});
|
|
446
|
+
return parseJson(result.stdout ?? '');
|
|
447
|
+
}
|
|
448
|
+
catch {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
async probeSession(input) {
|
|
453
|
+
if (this.acpDriver !== undefined)
|
|
454
|
+
return this.acpDriver.probeSession(input);
|
|
455
|
+
throwIfCommandCodeProbeAborted(input.signal);
|
|
456
|
+
const providerSessionId = input.providerSessionId?.trim();
|
|
457
|
+
if (!providerSessionId)
|
|
458
|
+
return { state: 'unknown', reason: '缺少 Provider 会话标识' };
|
|
459
|
+
const candidates = new Set();
|
|
460
|
+
const rawStoreRef = input.rawStoreRef?.trim();
|
|
461
|
+
const safeRawStoreRef = rawStoreRef !== undefined && isSafeCommandCodeTranscriptPath(rawStoreRef, this.homeDirectory)
|
|
462
|
+
? rawStoreRef
|
|
463
|
+
: undefined;
|
|
464
|
+
if (safeRawStoreRef !== undefined)
|
|
465
|
+
candidates.add(safeRawStoreRef);
|
|
466
|
+
const discovered = resolveCanonicalTranscriptPath(join(this.homeDirectory, 'projects', `${providerSessionId}.jsonl`), this.homeDirectory, input.cwd);
|
|
467
|
+
if (discovered !== null)
|
|
468
|
+
candidates.add(discovered);
|
|
469
|
+
const checkpoint = resolveCommandCodeCheckpointPath(this.homeDirectory, input.cwd ?? process.cwd(), providerSessionId);
|
|
470
|
+
if (checkpoint !== null)
|
|
471
|
+
candidates.add(checkpoint);
|
|
472
|
+
if (candidates.size === 0)
|
|
473
|
+
return { state: 'missing', reason: 'Command Code 原生会话文件不存在' };
|
|
474
|
+
let lastFailure;
|
|
475
|
+
for (const candidate of candidates) {
|
|
476
|
+
throwIfCommandCodeProbeAborted(input.signal);
|
|
477
|
+
if (!existsSync(candidate))
|
|
478
|
+
continue;
|
|
479
|
+
try {
|
|
480
|
+
if (!statSync(candidate).isFile()) {
|
|
481
|
+
lastFailure = { state: 'missing', reason: 'Command Code 原生会话路径不是文件', rawStoreRef: candidate };
|
|
482
|
+
continue;
|
|
483
|
+
}
|
|
484
|
+
// 探测只需验证首条记录;CLI 正在追加时末尾可能存在半行,不能因此拒绝
|
|
485
|
+
// 一个仍可由 --resume 找到的会话。完整历史解析由独立的读取入口负责。
|
|
486
|
+
const firstRecord = readFirstJsonRecord(candidate);
|
|
487
|
+
if (firstRecord === null) {
|
|
488
|
+
lastFailure = { state: 'corrupt', reason: 'Command Code 原生会话首条记录不是有效 JSONL', rawStoreRef: candidate };
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
if (candidate.endsWith('.checkpoints.jsonl')) {
|
|
492
|
+
// checkpoint 只保存回退点,Command Code 的 --resume 索引仍要求同名
|
|
493
|
+
// `.jsonl` transcript。仅有 checkpoint 的旧会话不能宣称可恢复。
|
|
494
|
+
lastFailure = { state: 'missing', reason: 'Command Code 只有 checkpoint,没有可恢复 transcript', rawStoreRef: candidate };
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
const recordedId = textValue(firstRecord.id ?? firstRecord.sessionId).trim();
|
|
498
|
+
if (recordedId !== '' && recordedId !== providerSessionId) {
|
|
499
|
+
lastFailure = { state: 'corrupt', reason: 'Command Code 原生会话标识与绑定不一致', rawStoreRef: candidate };
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
return { state: 'available', reason: 'Command Code 原生会话可用', rawStoreRef: candidate };
|
|
503
|
+
}
|
|
504
|
+
catch (error) {
|
|
505
|
+
lastFailure = { state: 'unreachable', reason: `无法读取 Command Code 原生会话:${error instanceof Error ? error.message : String(error)}`, rawStoreRef: candidate };
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return lastFailure ?? { state: 'missing', reason: 'Command Code 原生会话文件不存在', ...(safeRawStoreRef ? { rawStoreRef: safeRawStoreRef } : {}) };
|
|
509
|
+
}
|
|
510
|
+
async *executeTurn(input) {
|
|
511
|
+
const skillPaths = await this.resolveSkillPaths(input);
|
|
512
|
+
const turnInput = skillPaths.length === 0 ? input : { ...input, skillPaths };
|
|
513
|
+
if (this.acpDriver !== undefined) {
|
|
514
|
+
yield* this.acpDriver.executeTurn(turnInput);
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
const binary = this.cachedBinary ?? (await this.detect()).command;
|
|
518
|
+
if (binary === null)
|
|
519
|
+
throw new Error('Command Code 未安装');
|
|
520
|
+
const segmented = input.splitToolSteps === true;
|
|
521
|
+
const existing = this.turns.get(input.sessionId);
|
|
522
|
+
const resuming = segmented && input.resumeSegmentedTurn === true && existing !== undefined && !existing.disposed && !existing.finished;
|
|
523
|
+
const prepared = resuming ? undefined : await prepareAttachmentPaths(input);
|
|
524
|
+
let turn;
|
|
525
|
+
try {
|
|
526
|
+
const preparedInput = prepared?.input ?? input;
|
|
527
|
+
turn = segmented ? this.acquireTurn(preparedInput, binary, skillPaths) : this.startTurn(preparedInput, binary, skillPaths);
|
|
528
|
+
if (prepared !== undefined)
|
|
529
|
+
turn.attachmentCleanup = prepared.cleanup;
|
|
530
|
+
}
|
|
531
|
+
catch (error) {
|
|
532
|
+
prepared?.cleanup();
|
|
533
|
+
throw error;
|
|
534
|
+
}
|
|
535
|
+
let suspended = false;
|
|
536
|
+
const onAbort = () => { this.requestGracefulStop(turn); };
|
|
537
|
+
input.signal?.addEventListener('abort', onAbort, { once: true });
|
|
538
|
+
if (input.signal?.aborted)
|
|
539
|
+
onAbort();
|
|
540
|
+
try {
|
|
541
|
+
yield* this.consumeTurn(turn, input, segmented, () => { suspended = true; });
|
|
542
|
+
}
|
|
543
|
+
finally {
|
|
544
|
+
input.signal?.removeEventListener('abort', onAbort);
|
|
545
|
+
// 只有驱动自己为下一个 DSH step 挂起时才保留进程;正常结束、取消和调用方
|
|
546
|
+
// 提前关闭流都必须回收 CLI 进程与临时 transcript。
|
|
547
|
+
if (!suspended)
|
|
548
|
+
this.disposeTurn(turn);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
dispose() {
|
|
552
|
+
this.acpDriver?.dispose();
|
|
553
|
+
for (const turn of [...this.turns.values()])
|
|
554
|
+
this.disposeTurn(turn);
|
|
555
|
+
this.turns.clear();
|
|
556
|
+
for (const child of this.processes)
|
|
557
|
+
terminateChildProcess(child);
|
|
558
|
+
this.processes.clear();
|
|
559
|
+
this.skillCatalogs.clear();
|
|
560
|
+
this.cachedBinary = null;
|
|
561
|
+
}
|
|
562
|
+
/** 丢弃等待下一个 DSH step 的 `-p` 运行,避免旧进程继续占用新一轮输出。 */
|
|
563
|
+
discardSegmentedTurn(sessionId) {
|
|
564
|
+
const turn = this.turns.get(sessionId);
|
|
565
|
+
if (turn !== undefined)
|
|
566
|
+
this.disposeTurn(turn);
|
|
567
|
+
}
|
|
568
|
+
/** 只有 Host 显式声明续段时才复用常驻进程;新的用户回合必须重新启动。 */
|
|
569
|
+
acquireTurn(input, binary, skillPaths) {
|
|
570
|
+
const existing = this.turns.get(input.sessionId);
|
|
571
|
+
if (existing !== undefined) {
|
|
572
|
+
if (input.resumeSegmentedTurn === true && !existing.disposed && !existing.finished)
|
|
573
|
+
return existing;
|
|
574
|
+
this.disposeTurn(existing);
|
|
575
|
+
}
|
|
576
|
+
const turn = this.startTurn(input, binary, skillPaths);
|
|
577
|
+
this.turns.set(input.sessionId, turn);
|
|
578
|
+
return turn;
|
|
579
|
+
}
|
|
580
|
+
startTurn(input, binary, skillPaths) {
|
|
581
|
+
const cwd = input.cwd ?? process.cwd();
|
|
582
|
+
const requestedProviderSessionId = input.providerSessionId?.trim() || undefined;
|
|
583
|
+
// 旧 synthetic ID 可能只对应 checkpoint;回退时必须以当前 DSH 会话 ID
|
|
584
|
+
// 作为文件名,保证后续 session-binding、索引和 --resume 使用同一个标识。
|
|
585
|
+
const canonicalKey = requestedProviderSessionId !== undefined
|
|
586
|
+
&& !isLegacySyntheticSessionId(requestedProviderSessionId)
|
|
587
|
+
? requestedProviderSessionId
|
|
588
|
+
: input.sessionId;
|
|
589
|
+
const canonicalPath = resolveCommandCodeTranscriptPath(this.homeDirectory, cwd, canonicalKey);
|
|
590
|
+
const hasCanonicalTranscript = existsSync(canonicalPath) && isSafeCommandCodeTranscriptPath(canonicalPath, this.homeDirectory);
|
|
591
|
+
const hasRequestedRawTranscript = input.rawStoreRef?.trim() !== undefined
|
|
592
|
+
&& existsSync(input.rawStoreRef.trim())
|
|
593
|
+
&& isSafeCommandCodeTranscriptPath(input.rawStoreRef.trim(), this.homeDirectory);
|
|
594
|
+
// 旧版本会把只有 checkpoint 的外部路径登记成 synthetic session ID;该 ID
|
|
595
|
+
// 无法被 Command Code 的 --resume 索引解析。没有可读 JSONL 时重新从 DSH
|
|
596
|
+
// 历史建立 canonical transcript,避免把坏绑定继续传给 Provider。
|
|
597
|
+
const canResume = requestedProviderSessionId !== undefined
|
|
598
|
+
&& (hasCanonicalTranscript || hasRequestedRawTranscript || !isLegacySyntheticSessionId(requestedProviderSessionId));
|
|
599
|
+
const providerSessionId = canResume ? requestedProviderSessionId : input.sessionId;
|
|
600
|
+
const transcriptPath = canResume ? undefined : canonicalPath;
|
|
601
|
+
if (transcriptPath !== undefined)
|
|
602
|
+
writeTranscript(transcriptPath, input);
|
|
603
|
+
const turn = {
|
|
604
|
+
sessionId: input.sessionId,
|
|
605
|
+
child: undefined,
|
|
606
|
+
transcriptPath,
|
|
607
|
+
providerSessionId,
|
|
608
|
+
rawStoreRef: canResume ? input.rawStoreRef?.trim() || undefined : transcriptPath,
|
|
609
|
+
skillPaths,
|
|
610
|
+
cwd,
|
|
611
|
+
queue: createEventQueue(),
|
|
612
|
+
currentMessageId: undefined,
|
|
613
|
+
sawCompletedTool: false,
|
|
614
|
+
pendingChunk: undefined,
|
|
615
|
+
terminal: false,
|
|
616
|
+
finished: false,
|
|
617
|
+
aborted: false,
|
|
618
|
+
failure: null,
|
|
619
|
+
disposed: false,
|
|
620
|
+
attempt: 0,
|
|
621
|
+
maxTurnsReached: false,
|
|
622
|
+
messageSequence: 0,
|
|
623
|
+
stderrTail: '',
|
|
624
|
+
};
|
|
625
|
+
// 首轮固定使用 canonical transcript;CLI 事件里的 checkpoint ID 不可用于
|
|
626
|
+
// --resume,因此先登记稳定的 DSH 会话 ID,后续回合沿用同一路径恢复。
|
|
627
|
+
if (!canResume && transcriptPath !== undefined) {
|
|
628
|
+
turn.queue.push({ type: 'session-binding', providerSessionId: providerSessionId, rawStoreRef: transcriptPath });
|
|
629
|
+
}
|
|
630
|
+
// 普通回合也登记活动 turn;Registry 的 interrupt 不应只对分段回合生效。
|
|
631
|
+
this.turns.set(input.sessionId, turn);
|
|
632
|
+
void this.runTurnAttempts(turn, input, binary);
|
|
633
|
+
return turn;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* 运行一个 `-p` 会话,并在撞到 `--max-turns` 上限时自动续跑。
|
|
637
|
+
*
|
|
638
|
+
* CLI 的 `--max-turns` 只是“单个进程的模型往返预算”,撞到上限会退出 8 并把
|
|
639
|
+
* `subtype=max_turns` 的结果行当成正常结束。对 DSH 来说那既不是完成也不是失败:
|
|
640
|
+
* 直接结束会把只做了一半的任务显示成“已完成”。这里的策略与父仓库
|
|
641
|
+
* `CommandCodeRuntimeAdapter` 对齐——显式抬高预算,撞上限后在同一会话上自动
|
|
642
|
+
* 续跑若干次;次数用尽才按失败上报。
|
|
643
|
+
*/
|
|
644
|
+
async runTurnAttempts(turn, input, binary) {
|
|
645
|
+
try {
|
|
646
|
+
while (true) {
|
|
647
|
+
turn.attempt += 1;
|
|
648
|
+
turn.stderrTail = '';
|
|
649
|
+
// 自动续跑是同一个 DSH 运行里的下一段;消息序号必须跨尝试连续,
|
|
650
|
+
// 否则新进程会从 command-code-message-1 重新编号,公共投影层会把它
|
|
651
|
+
// 当成同一条消息继续追加,而不是开启新段。
|
|
652
|
+
const state = createStreamState(() => turn.aborted, turn.messageSequence, turn.providerSessionId ?? null, turn.sessionId, input.splitToolSteps === true);
|
|
653
|
+
const child = this.spawnAttempt(turn, input, binary);
|
|
654
|
+
const code = await this.readAttempt(turn, child, state);
|
|
655
|
+
turn.messageSequence = state.messageSequence;
|
|
656
|
+
// 首轮使用临时 `--session` 文件。Provider 会话 ID 在流中确认后,必须在
|
|
657
|
+
// 本次尝试结束时把临时 transcript 提升到 canonical 路径;否则下一轮拿着
|
|
658
|
+
// 已登记的 ID 执行 `--resume` 时,Command Code 找不到对应原生会话。
|
|
659
|
+
if (turn.transcriptPath !== undefined && turn.providerSessionId !== undefined) {
|
|
660
|
+
syncCommandCodeTranscript(turn.transcriptPath, this.homeDirectory, input.cwd, turn.providerSessionId);
|
|
661
|
+
}
|
|
662
|
+
if (turn.disposed || turn.finished)
|
|
663
|
+
return;
|
|
664
|
+
const capped = state.maxTurnsReached || code === COMMAND_CODE_MAX_TURNS_EXIT_CODE;
|
|
665
|
+
const autoContinueUsed = turn.attempt - 1;
|
|
666
|
+
if (capped && !turn.aborted && !turn.terminal && turn.providerSessionId !== undefined && autoContinueUsed < this.autoContinueMaxAttempts) {
|
|
667
|
+
// 续跑必须落在同一个会话上。CLI 可能把 transcript 写回会话文件、也可能
|
|
668
|
+
// 写进按 cwd 归档的 canonical 目录;两种落点都要先归位到同一个文件,
|
|
669
|
+
// 否则“继续”会开出一个没有上文的新会话,等于白跑一轮预算。
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (capped && !turn.aborted && !turn.terminal) {
|
|
673
|
+
turn.failure ??= new Error(buildMaxTurnsReachedMessage(autoContinueUsed, this.maxTurns));
|
|
674
|
+
}
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
catch (error) {
|
|
679
|
+
turn.failure ??= error instanceof Error ? error : new Error(String(error));
|
|
680
|
+
}
|
|
681
|
+
finally {
|
|
682
|
+
turn.queue.close();
|
|
683
|
+
if (turn.child !== undefined)
|
|
684
|
+
this.processes.delete(turn.child);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
/** 启动一次 CLI 尝试;首次写入 transcript,续跑沿用同一会话文件。 */
|
|
688
|
+
spawnAttempt(turn, input, binary) {
|
|
689
|
+
const args = this.buildTurnArgs(input, turn);
|
|
690
|
+
const bridgeEnvironment = commandCodeNativeAgentEnvironment(input.sessionId, this.descriptor.id);
|
|
691
|
+
const child = this.runSpawn(binary, args, {
|
|
692
|
+
cwd: input.cwd ?? process.cwd(),
|
|
693
|
+
env: { ...(this.cachedEnvironment ?? commandEnvironment(binary)), ...(input.runtimeEnv ?? {}), ...bridgeEnvironment },
|
|
694
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
695
|
+
windowsHide: true,
|
|
696
|
+
shell: WINDOWS,
|
|
697
|
+
});
|
|
698
|
+
// 自动续跑会替换活动进程;已退出的旧尝试不能继续留在进程表里等待 terminate。
|
|
699
|
+
if (turn.child !== undefined)
|
|
700
|
+
this.processes.delete(turn.child);
|
|
701
|
+
this.processes.add(child);
|
|
702
|
+
// 必须消费 stderr,错误内容只保留尾部用于诊断,避免泄露整段命令输出。
|
|
703
|
+
child.stderr?.on('data', (chunk) => {
|
|
704
|
+
turn.stderrTail = `${turn.stderrTail}${chunk.toString()}`.slice(-512);
|
|
705
|
+
});
|
|
706
|
+
turn.child = child;
|
|
707
|
+
return child;
|
|
708
|
+
}
|
|
709
|
+
buildTurnArgs(input, turn) {
|
|
710
|
+
// 续跑沿用同一个 Provider 会话,只把输入换成续跑提示;不能再次写入历史,
|
|
711
|
+
// 否则会把 CLI 已经落盘的进度覆盖成空会话。
|
|
712
|
+
const prompt = turn.attempt > 1 ? this.autoContinuePrompt : promptWithAttachmentPaths(input.prompt, input.attachments ?? [], input.translationLanguage);
|
|
713
|
+
const args = turn.transcriptPath !== undefined && turn.attempt === 1
|
|
714
|
+
? ['--session', turn.transcriptPath, '-p', prompt, '--output-format', 'json', '--skip-onboarding', '--max-turns', String(this.maxTurns)]
|
|
715
|
+
: turn.providerSessionId !== undefined
|
|
716
|
+
? ['-p', prompt, '--output-format', 'json', '--skip-onboarding', '--max-turns', String(this.maxTurns), '--resume', turn.providerSessionId]
|
|
717
|
+
: ['--session', turn.transcriptPath, '-p', prompt, '--output-format', 'json', '--skip-onboarding', '--max-turns', String(this.maxTurns)];
|
|
718
|
+
// 只有 Host 明确确认“完全访问且永不询问”时才允许 --yolo。
|
|
719
|
+
// 权限状态缺省表示尚未读取,必须保持 CLI 的保守默认,不能把未知状态升级为完全访问。
|
|
720
|
+
args.push(...commandCodePermissionArgs(input.permission));
|
|
721
|
+
if (input.plan === true && !args.includes('--plan'))
|
|
722
|
+
args.push('--plan');
|
|
723
|
+
// Command Code 只允许从已有 --resume 会话分叉;首轮临时 transcript 不能带该参数。
|
|
724
|
+
if (input.forkSession === true && turn.providerSessionId !== undefined)
|
|
725
|
+
args.push('--fork-session');
|
|
726
|
+
if (input.enableAskUserQuestion === true || input.runtimeEnv?.CMD_TOOLS_ASK_USER_QUESTION_ENABLE === 'true') {
|
|
727
|
+
args.push('--tools-enable', 'ask_user_question');
|
|
728
|
+
}
|
|
729
|
+
for (const path of turn.skillPaths)
|
|
730
|
+
args.push('--skill', path);
|
|
731
|
+
// 每次启动都加载屏蔽 Mod:父会话转投 DSH,子会话仅禁用嵌套 agent;桥接
|
|
732
|
+
// 不可用时由 Mod 明确阻断,不能回退到 Command Code 原生子代理。
|
|
733
|
+
args.push(...commandCodeNativeAgentArgs(input.sessionId));
|
|
734
|
+
for (const directory of new Set((input.attachments ?? []).map((attachment) => dirname(attachment.path))))
|
|
735
|
+
args.push('--add-dir', directory);
|
|
736
|
+
if (input.modelId && input.modelId !== 'provider-default')
|
|
737
|
+
args.push('--model', input.modelId);
|
|
738
|
+
const effort = input.effortId?.trim().toLowerCase();
|
|
739
|
+
if (effort !== undefined && VALID_EFFORTS.has(effort))
|
|
740
|
+
args.push('--effort', effort);
|
|
741
|
+
return args;
|
|
742
|
+
}
|
|
743
|
+
/** 中断当前会话并清理 CLI 进程;不存在活动运行时视为幂等成功。 */
|
|
744
|
+
async interrupt(sessionId) {
|
|
745
|
+
if (this.acpDriver !== undefined) {
|
|
746
|
+
await this.acpDriver.interrupt(sessionId);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
const turn = this.turns.get(sessionId);
|
|
750
|
+
if (turn === undefined)
|
|
751
|
+
return;
|
|
752
|
+
this.requestGracefulStop(turn);
|
|
753
|
+
}
|
|
754
|
+
/** 先让 CLI 保存检查点并自行退出,超时后才清理进程树。 */
|
|
755
|
+
requestGracefulStop(turn) {
|
|
756
|
+
turn.aborted = true;
|
|
757
|
+
const child = turn.child;
|
|
758
|
+
if (child === undefined) {
|
|
759
|
+
this.disposeTurn(turn);
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
try {
|
|
763
|
+
child.kill('SIGINT');
|
|
764
|
+
}
|
|
765
|
+
catch { /* 进程可能已经退出 */ }
|
|
766
|
+
const timer = setTimeout(() => {
|
|
767
|
+
if (!turn.disposed)
|
|
768
|
+
this.disposeTurn(turn);
|
|
769
|
+
}, COMMAND_CODE_INTERRUPT_GRACE_MS);
|
|
770
|
+
timer.unref?.();
|
|
771
|
+
}
|
|
772
|
+
/** 读取一次尝试的 stdout,直到进程结束;队列在整个运行结束前保持打开。 */
|
|
773
|
+
async readAttempt(turn, child, state) {
|
|
774
|
+
// 测试替身可能只提供 stdout/kill,没有 ChildProcess 的事件接口。
|
|
775
|
+
const emitter = typeof child.on === 'function'
|
|
776
|
+
? child
|
|
777
|
+
: null;
|
|
778
|
+
let exitCode = null;
|
|
779
|
+
let exitSignal = null;
|
|
780
|
+
let resolveClose = null;
|
|
781
|
+
const closed = new Promise((resolve) => { resolveClose = resolve; });
|
|
782
|
+
if (emitter !== null) {
|
|
783
|
+
// 未监听 error 的 ChildProcess 会把 spawn 失败升级成宿主进程异常。
|
|
784
|
+
// 这里只记账并结束本次尝试;队列统一由 runTurnAttempts 关闭,
|
|
785
|
+
// 避免某次尝试失败时把仍在排队的正文事件丢掉。
|
|
786
|
+
emitter.on('error', (error) => {
|
|
787
|
+
turn.failure ??= error;
|
|
788
|
+
resolveClose?.();
|
|
789
|
+
});
|
|
790
|
+
emitter.on('close', (code, signal) => {
|
|
791
|
+
exitCode = code;
|
|
792
|
+
exitSignal = signal ?? null;
|
|
793
|
+
if (state.maxTurnsReached)
|
|
794
|
+
turn.maxTurnsReached = true;
|
|
795
|
+
resolveClose?.();
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
try {
|
|
799
|
+
const lines = readline.createInterface({ input: child.stdout });
|
|
800
|
+
let lineNumber = 0;
|
|
801
|
+
try {
|
|
802
|
+
for await (const line of lines) {
|
|
803
|
+
if (!line.trim())
|
|
804
|
+
continue;
|
|
805
|
+
lineNumber += 1;
|
|
806
|
+
const item = parseJson(line);
|
|
807
|
+
if (item === null) {
|
|
808
|
+
// CLI 升级后可能输出非对象或损坏的 NDJSON;保留行号诊断,不能静默吞掉。
|
|
809
|
+
console.warn(`[dsh-agentdoor] Command Code 忽略非法 NDJSON(第 ${lineNumber} 行)`);
|
|
810
|
+
continue;
|
|
811
|
+
}
|
|
812
|
+
const event = item.type === 'event' && isRecord(item.event) ? item.event : item;
|
|
813
|
+
for (const rawChunk of commandCodeEventChunks(event, state)) {
|
|
814
|
+
let chunk = rawChunk;
|
|
815
|
+
if (rawChunk.type === 'session-binding') {
|
|
816
|
+
// `--session <path>` 模式下 CLI 发出的 sessionId 是 checkpoint
|
|
817
|
+
// 内部 ID,不是可供 --resume 查找的 transcript ID;保持 Host 绑定。
|
|
818
|
+
if (turn.transcriptPath !== undefined)
|
|
819
|
+
continue;
|
|
820
|
+
turn.providerSessionId = rawChunk.providerSessionId;
|
|
821
|
+
turn.rawStoreRef = resolveCommandCodeTranscriptPath(this.homeDirectory, turn.cwd, rawChunk.providerSessionId);
|
|
822
|
+
// Provider ID 一旦确认就立即暴露 canonical 路径;文件可能稍后才落盘,
|
|
823
|
+
// 但 Registry 必须先保存稳定绑定,冷恢复时才能直接定位原生会话。
|
|
824
|
+
chunk = { ...rawChunk, rawStoreRef: turn.rawStoreRef };
|
|
825
|
+
}
|
|
826
|
+
if (chunk.type === 'finish')
|
|
827
|
+
turn.terminal = true;
|
|
828
|
+
turn.queue.push(chunk);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
finally {
|
|
833
|
+
lines.close();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
catch (error) {
|
|
837
|
+
turn.failure ??= error instanceof Error ? error : new Error(String(error));
|
|
838
|
+
}
|
|
839
|
+
// 没有 close 事件时,stdout 结束即视为本次尝试结束。
|
|
840
|
+
if (emitter === null) {
|
|
841
|
+
if (state.maxTurnsReached)
|
|
842
|
+
turn.maxTurnsReached = true;
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
await closed;
|
|
846
|
+
}
|
|
847
|
+
if (!turn.terminal && !state.maxTurnsReached) {
|
|
848
|
+
if (turn.aborted || exitSignal === 'SIGINT' || exitSignal === 'SIGTERM') {
|
|
849
|
+
turn.terminal = true;
|
|
850
|
+
turn.queue.push({ type: 'finish', reason: 'cancel' });
|
|
851
|
+
}
|
|
852
|
+
else if (turn.failure !== null || (exitCode !== null && exitCode !== 0) || exitSignal !== null) {
|
|
853
|
+
const message = turn.failure?.message
|
|
854
|
+
|| (turn.stderrTail.trim() !== '' ? `Command Code 执行失败:${turn.stderrTail.trim()}` : `Command Code 进程退出(代码 ${exitCode ?? exitSignal ?? 'unknown'})`);
|
|
855
|
+
turn.failure = null;
|
|
856
|
+
turn.terminal = true;
|
|
857
|
+
turn.queue.push({
|
|
858
|
+
type: 'finish',
|
|
859
|
+
reason: 'error',
|
|
860
|
+
failure: { message, code: exitCode === null ? 'COMMAND_CODE_SPAWN_ERROR' : `COMMAND_CODE_EXIT_${exitCode}` },
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return exitCode;
|
|
865
|
+
}
|
|
866
|
+
async *consumeTurn(turn, input, segmented, suspend) {
|
|
867
|
+
while (true) {
|
|
868
|
+
let chunk;
|
|
869
|
+
if (turn.pendingChunk !== undefined) {
|
|
870
|
+
chunk = turn.pendingChunk;
|
|
871
|
+
turn.pendingChunk = undefined;
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
const next = await turn.queue.next();
|
|
875
|
+
if (next.done) {
|
|
876
|
+
if (turn.failure !== null)
|
|
877
|
+
throw turn.failure;
|
|
878
|
+
if (turn.terminal)
|
|
879
|
+
return;
|
|
880
|
+
if (turn.aborted || input.signal?.aborted === true) {
|
|
881
|
+
yield { type: 'finish', reason: 'cancel' };
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
throw new Error('Command Code 执行失败');
|
|
885
|
+
}
|
|
886
|
+
chunk = next.value;
|
|
887
|
+
}
|
|
888
|
+
// 一个 `-p` 运行会在同一进程里连续跑多个 agent turn。把新 assistant 消息的
|
|
889
|
+
// 首个正文留给下一次 llm/stream,当前流只返回边界,确保 DSH 先创建新 step。
|
|
890
|
+
if (segmented && chunk.type === 'step-boundary') {
|
|
891
|
+
// 解析层已经把下一条 Provider 消息留在队列中;清掉旧消息身份,避免
|
|
892
|
+
// 续段后的首个正文再次被误判成一个额外边界。
|
|
893
|
+
turn.currentMessageId = undefined;
|
|
894
|
+
turn.sawCompletedTool = false;
|
|
895
|
+
suspend();
|
|
896
|
+
yield chunk;
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
if (segmented
|
|
900
|
+
&& (chunk.type === 'text-delta' || chunk.type === 'reasoning-delta')
|
|
901
|
+
&& chunk.messageId !== undefined) {
|
|
902
|
+
const previousMessageId = turn.currentMessageId;
|
|
903
|
+
if (previousMessageId !== undefined
|
|
904
|
+
&& previousMessageId !== chunk.messageId
|
|
905
|
+
&& turn.sawCompletedTool) {
|
|
906
|
+
turn.pendingChunk = chunk;
|
|
907
|
+
turn.currentMessageId = chunk.messageId;
|
|
908
|
+
turn.sawCompletedTool = false;
|
|
909
|
+
suspend();
|
|
910
|
+
yield { type: 'step-boundary' };
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
turn.currentMessageId = chunk.messageId;
|
|
914
|
+
}
|
|
915
|
+
if (chunk.type === 'tool-event' && (chunk.status === 'completed' || chunk.status === 'failed')) {
|
|
916
|
+
turn.sawCompletedTool = true;
|
|
917
|
+
}
|
|
918
|
+
if (chunk.type === 'finish')
|
|
919
|
+
turn.finished = true;
|
|
920
|
+
yield chunk;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
disposeTurn(turn) {
|
|
924
|
+
if (turn.disposed)
|
|
925
|
+
return;
|
|
926
|
+
turn.disposed = true;
|
|
927
|
+
turn.queue.close();
|
|
928
|
+
if (this.turns.get(turn.sessionId) === turn)
|
|
929
|
+
this.turns.delete(turn.sessionId);
|
|
930
|
+
const child = turn.child;
|
|
931
|
+
if (child !== undefined) {
|
|
932
|
+
this.processes.delete(child);
|
|
933
|
+
terminateChildProcess(child);
|
|
934
|
+
}
|
|
935
|
+
turn.attachmentCleanup?.();
|
|
936
|
+
// 首轮 transcript 已经是 canonical 文件,必须保留给下一轮 --resume 及冷恢复。
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
function enrichCommandCodeUsage(event, input) {
|
|
940
|
+
const contextWindow = event.contextWindow ?? knownCommandCodeContextWindow(input.modelId);
|
|
941
|
+
if (contextWindow === undefined || contextWindow <= 0)
|
|
942
|
+
return event;
|
|
943
|
+
const contextTokens = event.contextTokens ?? (event.inputTokens > 0 ? event.inputTokens : undefined);
|
|
944
|
+
return {
|
|
945
|
+
...event,
|
|
946
|
+
contextWindow,
|
|
947
|
+
...(contextTokens === undefined ? {} : { contextTokens }),
|
|
948
|
+
...(event.contextUsageRatio !== undefined || contextTokens === undefined
|
|
949
|
+
? {}
|
|
950
|
+
: { contextUsageRatio: Number(Math.min(1, contextTokens / contextWindow).toFixed(6)) }),
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
function createStreamState(aborted, messageSequence = 0, sessionId = null, bridgeSessionId = '', splitToolSteps = false) {
|
|
954
|
+
return {
|
|
955
|
+
messageSequence,
|
|
956
|
+
messageId: null,
|
|
957
|
+
emittedText: '',
|
|
958
|
+
emittedReasoning: '',
|
|
959
|
+
sawText: false,
|
|
960
|
+
sawCompletedTool: false,
|
|
961
|
+
splitToolSteps,
|
|
962
|
+
perRequestUsageSeen: false,
|
|
963
|
+
turnUsageSeen: false,
|
|
964
|
+
pendingMessageUsage: null,
|
|
965
|
+
sessionId,
|
|
966
|
+
bridgeSessionId,
|
|
967
|
+
aborted,
|
|
968
|
+
maxTurnsReached: false,
|
|
969
|
+
terminalEmitted: false,
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
function createEventQueue() {
|
|
973
|
+
const values = [];
|
|
974
|
+
const waiters = [];
|
|
975
|
+
let closed = false;
|
|
976
|
+
const next = () => {
|
|
977
|
+
const value = values.shift();
|
|
978
|
+
if (value !== undefined)
|
|
979
|
+
return Promise.resolve({ done: false, value });
|
|
980
|
+
if (closed)
|
|
981
|
+
return Promise.resolve({ done: true, value: undefined });
|
|
982
|
+
return new Promise((resolve) => waiters.push(resolve));
|
|
983
|
+
};
|
|
984
|
+
return {
|
|
985
|
+
next,
|
|
986
|
+
push(event) {
|
|
987
|
+
if (closed)
|
|
988
|
+
return;
|
|
989
|
+
const waiter = waiters.shift();
|
|
990
|
+
if (waiter !== undefined)
|
|
991
|
+
waiter({ done: false, value: event });
|
|
992
|
+
else
|
|
993
|
+
values.push(event);
|
|
994
|
+
},
|
|
995
|
+
close() {
|
|
996
|
+
if (closed)
|
|
997
|
+
return;
|
|
998
|
+
closed = true;
|
|
999
|
+
while (waiters.length > 0)
|
|
1000
|
+
waiters.shift()?.({ done: true, value: undefined });
|
|
1001
|
+
},
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Command Code NDJSON → 公共 Agent 事件。
|
|
1006
|
+
*
|
|
1007
|
+
* 关键约定(对照本机 1.66.0 真实事件流):
|
|
1008
|
+
* - `turn_start` / `message_start` 标识新的 assistant 消息,正文和推理增量都带上它;
|
|
1009
|
+
* - `tool_*` 使用 `toolCallId` 作为稳定调用 ID,同一调用的 queued/running/completed
|
|
1010
|
+
* 只能投影成一个 DSH 工具节点;
|
|
1011
|
+
* - `model_request_end` 的 usage 是当前请求的上下文占用;`run_end`/最终 `result`
|
|
1012
|
+
* 的 usage 是整个运行的累计值,只在完全没有单请求 usage 时兜底。
|
|
1013
|
+
*/
|
|
1014
|
+
function commandCodeEventChunks(event, state) {
|
|
1015
|
+
const chunks = [];
|
|
1016
|
+
const type = textValue(event.type).trim().toLowerCase();
|
|
1017
|
+
const sessionId = readSessionId(event);
|
|
1018
|
+
if (sessionId !== null && sessionId !== state.sessionId) {
|
|
1019
|
+
state.sessionId = sessionId;
|
|
1020
|
+
chunks.push({ type: 'session-binding', providerSessionId: sessionId });
|
|
1021
|
+
}
|
|
1022
|
+
switch (type) {
|
|
1023
|
+
case 'run_start':
|
|
1024
|
+
case 'run-start':
|
|
1025
|
+
case 'session_created':
|
|
1026
|
+
case 'session-created':
|
|
1027
|
+
case 'model_request_start':
|
|
1028
|
+
case 'model-request-start':
|
|
1029
|
+
case 'model_trace':
|
|
1030
|
+
case 'model-trace':
|
|
1031
|
+
// 这些事件只标记 Provider 生命周期,不应制造正文或终态。
|
|
1032
|
+
break;
|
|
1033
|
+
case 'turn_start':
|
|
1034
|
+
case 'turn-start':
|
|
1035
|
+
if (state.splitToolSteps)
|
|
1036
|
+
emitPendingMessageUsage(chunks, state);
|
|
1037
|
+
if (state.splitToolSteps && state.sawCompletedTool)
|
|
1038
|
+
chunks.push({ type: 'step-boundary' });
|
|
1039
|
+
beginMessage(state);
|
|
1040
|
+
state.sawCompletedTool = false;
|
|
1041
|
+
break;
|
|
1042
|
+
case 'message_start':
|
|
1043
|
+
case 'message-start':
|
|
1044
|
+
// 正常一轮只有一个模型请求;没有 turn_start 的旧版本由这里补消息身份。
|
|
1045
|
+
if (state.messageId === null) {
|
|
1046
|
+
if (state.splitToolSteps)
|
|
1047
|
+
emitPendingMessageUsage(chunks, state);
|
|
1048
|
+
if (state.splitToolSteps && state.sawCompletedTool)
|
|
1049
|
+
chunks.push({ type: 'step-boundary' });
|
|
1050
|
+
beginMessage(state);
|
|
1051
|
+
state.sawCompletedTool = false;
|
|
1052
|
+
}
|
|
1053
|
+
break;
|
|
1054
|
+
case 'text_delta':
|
|
1055
|
+
case 'text-delta': {
|
|
1056
|
+
const text = textValue(event.delta ?? event.text ?? event.content);
|
|
1057
|
+
if (text) {
|
|
1058
|
+
ensureMessage(state);
|
|
1059
|
+
state.emittedText += text;
|
|
1060
|
+
state.sawText = true;
|
|
1061
|
+
chunks.push(textDelta(text, state));
|
|
1062
|
+
}
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
case 'thinking_delta':
|
|
1066
|
+
case 'thinking-delta': {
|
|
1067
|
+
const text = textValue(event.delta ?? event.thinking ?? event.content);
|
|
1068
|
+
if (text) {
|
|
1069
|
+
ensureMessage(state);
|
|
1070
|
+
state.emittedReasoning += text;
|
|
1071
|
+
chunks.push(reasoningDelta(text, state));
|
|
1072
|
+
}
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
case 'message':
|
|
1076
|
+
case 'message_update':
|
|
1077
|
+
case 'message-update':
|
|
1078
|
+
case 'message_end':
|
|
1079
|
+
case 'message-end':
|
|
1080
|
+
// 只补齐增量流没有覆盖到的正文,避免累计快照被重复追加。
|
|
1081
|
+
appendContentFallback(chunks, event.content ?? recordValue(event.message)?.content, state);
|
|
1082
|
+
captureMessageUsage(event, state);
|
|
1083
|
+
break;
|
|
1084
|
+
case 'model_request_end':
|
|
1085
|
+
case 'model-request-end': {
|
|
1086
|
+
const usage = usageChunkFromEvent(event);
|
|
1087
|
+
if (usage !== null) {
|
|
1088
|
+
state.pendingMessageUsage = null;
|
|
1089
|
+
state.perRequestUsageSeen = true;
|
|
1090
|
+
state.turnUsageSeen = true;
|
|
1091
|
+
chunks.push(usage);
|
|
1092
|
+
}
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
case 'turn_end':
|
|
1096
|
+
case 'turn-end': {
|
|
1097
|
+
// 旧版本可能只在 turn_end 带 usage;与 model_request_end 去重,不重复结算。
|
|
1098
|
+
if (!state.turnUsageSeen) {
|
|
1099
|
+
const usage = usageChunkFromEvent(event) ?? (state.splitToolSteps ? state.pendingMessageUsage : null);
|
|
1100
|
+
if (usage !== null) {
|
|
1101
|
+
state.pendingMessageUsage = null;
|
|
1102
|
+
state.perRequestUsageSeen = true;
|
|
1103
|
+
state.turnUsageSeen = true;
|
|
1104
|
+
chunks.push(usage);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
case 'run_end':
|
|
1110
|
+
case 'run-end':
|
|
1111
|
+
if (state.splitToolSteps && !state.turnUsageSeen)
|
|
1112
|
+
emitPendingMessageUsage(chunks, state, event);
|
|
1113
|
+
if (!state.sawText) {
|
|
1114
|
+
const finalText = readFinalText(event);
|
|
1115
|
+
if (finalText) {
|
|
1116
|
+
ensureMessage(state);
|
|
1117
|
+
state.sawText = true;
|
|
1118
|
+
state.emittedText = finalText;
|
|
1119
|
+
chunks.push(textDelta(finalText, state));
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
if (isMaxTurnsOutcome(event)) {
|
|
1123
|
+
// 撞到 CLI 的轮次上限不是终态,但 run_end 可能同时携带本次已生成的
|
|
1124
|
+
// 最后一段正文。正文必须先投影出去,续跑只负责继续执行,不能吞掉这段结果。
|
|
1125
|
+
state.maxTurnsReached = true;
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
if (!state.terminalEmitted) {
|
|
1129
|
+
state.terminalEmitted = true;
|
|
1130
|
+
chunks.push({ type: 'finish', reason: state.aborted() ? 'cancel' : resultReason(event) });
|
|
1131
|
+
}
|
|
1132
|
+
break;
|
|
1133
|
+
case 'result': {
|
|
1134
|
+
if (state.terminalEmitted)
|
|
1135
|
+
break;
|
|
1136
|
+
const resultUsage = usageChunkFromEvent(event);
|
|
1137
|
+
if (state.splitToolSteps && state.pendingMessageUsage !== null)
|
|
1138
|
+
emitPendingMessageUsage(chunks, state);
|
|
1139
|
+
else if (!state.turnUsageSeen) {
|
|
1140
|
+
const usage = resultUsage ?? state.pendingMessageUsage;
|
|
1141
|
+
if (usage !== null) {
|
|
1142
|
+
state.perRequestUsageSeen = true;
|
|
1143
|
+
state.turnUsageSeen = true;
|
|
1144
|
+
chunks.push(usage);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
if (!state.sawText) {
|
|
1148
|
+
const finalText = readFinalText(event);
|
|
1149
|
+
if (finalText) {
|
|
1150
|
+
ensureMessage(state);
|
|
1151
|
+
state.sawText = true;
|
|
1152
|
+
state.emittedText += finalText;
|
|
1153
|
+
chunks.push(textDelta(finalText, state));
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
// 撞到 CLI 的轮次上限不是终态:这里只记账,等进程退出后决定自动续跑还是
|
|
1157
|
+
// 按失败上报。直接发 finish 就是“任务没做完却显示已完成”的老毛病。
|
|
1158
|
+
if (isMaxTurnsOutcome(event)) {
|
|
1159
|
+
state.maxTurnsReached = true;
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
const reason = state.aborted() ? 'cancel' : resultReason(event);
|
|
1163
|
+
state.terminalEmitted = true;
|
|
1164
|
+
chunks.push({
|
|
1165
|
+
type: 'finish',
|
|
1166
|
+
reason,
|
|
1167
|
+
...(reason === 'error' ? { failure: commandCodeFailure(event) } : {}),
|
|
1168
|
+
});
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1171
|
+
case 'error':
|
|
1172
|
+
case 'fatal_error':
|
|
1173
|
+
case 'run_error':
|
|
1174
|
+
if (!state.terminalEmitted) {
|
|
1175
|
+
state.terminalEmitted = true;
|
|
1176
|
+
chunks.push({ type: 'finish', reason: state.aborted() ? 'cancel' : 'error', ...(state.aborted() ? {} : { failure: commandCodeFailure(event) }) });
|
|
1177
|
+
}
|
|
1178
|
+
break;
|
|
1179
|
+
default:
|
|
1180
|
+
if (type !== '' && !isToolStart(type) && !isToolResult(type)) {
|
|
1181
|
+
// 未知事件不应改变正常流,但必须留下可定位的升级诊断。
|
|
1182
|
+
console.warn(`[dsh-agentdoor] Command Code 忽略未知事件:${type}`);
|
|
1183
|
+
}
|
|
1184
|
+
break;
|
|
1185
|
+
}
|
|
1186
|
+
if (isToolStart(type)) {
|
|
1187
|
+
// 某些版本只在 message/message_update 上携带 usage,工具开始即表示该
|
|
1188
|
+
// assistant 消息已经结束;先结算最后一份快照,避免工具 step 没有 usage。
|
|
1189
|
+
if (state.splitToolSteps)
|
|
1190
|
+
emitPendingMessageUsage(chunks, state, event);
|
|
1191
|
+
// 某些 Command Code 版本对“只有工具调用的 assistant 消息”不发送
|
|
1192
|
+
// turn_start/message_start。上一个工具已经完成时,下一次工具开始就是
|
|
1193
|
+
// 明确的消息边界;同一消息里的并行工具不会命中此分支,因为它们之间
|
|
1194
|
+
// 还没有 completed 结果。
|
|
1195
|
+
if (state.splitToolSteps && state.sawCompletedTool) {
|
|
1196
|
+
chunks.push({ type: 'step-boundary' });
|
|
1197
|
+
state.sawCompletedTool = false;
|
|
1198
|
+
}
|
|
1199
|
+
const tool = readToolChunk(event, type === 'tool_queued' || type === 'tool_started' ? 'started' : 'running');
|
|
1200
|
+
if (tool !== null)
|
|
1201
|
+
chunks.push(tool);
|
|
1202
|
+
}
|
|
1203
|
+
else if (isToolResult(type)) {
|
|
1204
|
+
// 子代理托管命中时,mod 用 block 结束内建 agent 调用,真正的执行已经发生在
|
|
1205
|
+
// DSH 原生子会话里;这里必须投影为桥接返回的 running/completed/failed 状态,
|
|
1206
|
+
// 而不是把后台创建误报为完成或把普通 hook 拦截误报为托管成功。
|
|
1207
|
+
const redirected = type.includes('blocked') ? consumeBridgeRedirect(state, event) : undefined;
|
|
1208
|
+
const failed = redirected === undefined && (type.includes('error') || type.includes('fail') || type.includes('denied') || type.includes('blocked'));
|
|
1209
|
+
// 后台托管的 hook_blocked 只代表“已创建子会话”。如果这里投影成 completed,
|
|
1210
|
+
// 父 Agent 会跳过 wait/read,子会话随后失败也就没有机会回到父会话。
|
|
1211
|
+
const redirectedStatus = redirected === undefined
|
|
1212
|
+
? undefined
|
|
1213
|
+
: redirected.completed === false || redirected.status === 'running'
|
|
1214
|
+
? 'running'
|
|
1215
|
+
: redirected.ok && redirected.status !== 'failed' && redirected.status !== 'interrupted'
|
|
1216
|
+
? 'completed'
|
|
1217
|
+
: 'failed';
|
|
1218
|
+
const tool = readToolChunk(event, redirectedStatus ?? (failed ? 'failed' : 'completed'));
|
|
1219
|
+
if (tool !== null) {
|
|
1220
|
+
chunks.push(tool);
|
|
1221
|
+
// 工具完成后的正文属于下一条 assistant 消息。即使 CLI 没有发送
|
|
1222
|
+
// turn_start/message_start,也要让公共投影层看到消息身份切换。
|
|
1223
|
+
if (tool.status === 'completed' || tool.status === 'failed')
|
|
1224
|
+
resetMessageIdentity(state);
|
|
1225
|
+
if (tool.status === 'completed' || tool.status === 'failed')
|
|
1226
|
+
state.sawCompletedTool = true;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
if (type === 'message' || type === 'message_update' || type === 'message-update')
|
|
1230
|
+
captureMessageUsage(event, state);
|
|
1231
|
+
return chunks;
|
|
1232
|
+
}
|
|
1233
|
+
/** 从所有 Command Code 事件形状读取 usage;message 快照可能嵌套在 message 内。 */
|
|
1234
|
+
function usageChunkFromEvent(event) {
|
|
1235
|
+
const result = recordValue(event.result);
|
|
1236
|
+
const message = recordValue(event.message);
|
|
1237
|
+
const usage = usageChunk(recordValue(event.usage) ?? recordValue(message?.usage) ?? recordValue(result?.usage));
|
|
1238
|
+
return usage?.type === 'usage' ? usage : null;
|
|
1239
|
+
}
|
|
1240
|
+
/** 暂存消息累计快照,只保留同一请求最后一次值,避免重复结算。 */
|
|
1241
|
+
function captureMessageUsage(event, state) {
|
|
1242
|
+
if (state.turnUsageSeen)
|
|
1243
|
+
return;
|
|
1244
|
+
const usage = usageChunkFromEvent(event);
|
|
1245
|
+
if (usage !== null)
|
|
1246
|
+
state.pendingMessageUsage = usage;
|
|
1247
|
+
}
|
|
1248
|
+
/** 在消息、工具或回合边界结算消息快照。 */
|
|
1249
|
+
function emitPendingMessageUsage(chunks, state, event) {
|
|
1250
|
+
if (state.turnUsageSeen)
|
|
1251
|
+
return;
|
|
1252
|
+
const usage = state.pendingMessageUsage ?? (event === undefined ? null : usageChunkFromEvent(event));
|
|
1253
|
+
if (usage === null)
|
|
1254
|
+
return;
|
|
1255
|
+
state.pendingMessageUsage = null;
|
|
1256
|
+
state.perRequestUsageSeen = true;
|
|
1257
|
+
state.turnUsageSeen = true;
|
|
1258
|
+
chunks.push(usage);
|
|
1259
|
+
}
|
|
1260
|
+
function readFinalText(event) {
|
|
1261
|
+
const result = recordValue(event.result);
|
|
1262
|
+
return textValue(event.finalText
|
|
1263
|
+
?? result?.finalText
|
|
1264
|
+
?? result?.output
|
|
1265
|
+
?? result?.text
|
|
1266
|
+
?? (typeof event.result === 'string' ? event.result : undefined)
|
|
1267
|
+
?? event.output
|
|
1268
|
+
?? event.text);
|
|
1269
|
+
}
|
|
1270
|
+
/** 该 blocked 事件是否来自桥接转投;命中后消费一次记录,避免重复投影。 */
|
|
1271
|
+
function consumeBridgeRedirect(state, event) {
|
|
1272
|
+
if (state.bridgeSessionId === '')
|
|
1273
|
+
return undefined;
|
|
1274
|
+
const callId = firstToolText(event.callId, event.call_id, event.toolCallId, event.tool_call_id, event.toolUseId, event.tool_use_id, event.id);
|
|
1275
|
+
if (callId === undefined || callId === '')
|
|
1276
|
+
return undefined;
|
|
1277
|
+
try {
|
|
1278
|
+
return getSubagentBridge()?.consumeRedirect(state.bridgeSessionId, callId);
|
|
1279
|
+
}
|
|
1280
|
+
catch {
|
|
1281
|
+
return undefined;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
function beginMessage(state) {
|
|
1285
|
+
state.messageSequence += 1;
|
|
1286
|
+
state.messageId = `command-code-message-${state.messageSequence}`;
|
|
1287
|
+
state.emittedText = '';
|
|
1288
|
+
state.emittedReasoning = '';
|
|
1289
|
+
state.turnUsageSeen = false;
|
|
1290
|
+
}
|
|
1291
|
+
/** 丢弃当前消息身份;下一条正文增量会懒加载新的身份。 */
|
|
1292
|
+
function resetMessageIdentity(state) {
|
|
1293
|
+
state.messageId = null;
|
|
1294
|
+
state.emittedText = '';
|
|
1295
|
+
state.emittedReasoning = '';
|
|
1296
|
+
}
|
|
1297
|
+
function ensureMessage(state) {
|
|
1298
|
+
if (state.messageId === null)
|
|
1299
|
+
beginMessage(state);
|
|
1300
|
+
}
|
|
1301
|
+
function textDelta(text, state) {
|
|
1302
|
+
return { type: 'text-delta', text, ...(state.messageId === null ? {} : { messageId: state.messageId }) };
|
|
1303
|
+
}
|
|
1304
|
+
function reasoningDelta(text, state) {
|
|
1305
|
+
return { type: 'reasoning-delta', text, ...(state.messageId === null ? {} : { messageId: state.messageId }) };
|
|
1306
|
+
}
|
|
1307
|
+
/** 用完整的 assistant content 补齐缺失的正文/推理增量(只发送尚未发送的尾部)。 */
|
|
1308
|
+
function appendContentFallback(chunks, content, state) {
|
|
1309
|
+
if (!Array.isArray(content))
|
|
1310
|
+
return;
|
|
1311
|
+
let snapshotText = '';
|
|
1312
|
+
let snapshotReasoning = '';
|
|
1313
|
+
let pendingKind = null;
|
|
1314
|
+
let pendingDelta = '';
|
|
1315
|
+
const flushPending = () => {
|
|
1316
|
+
if (pendingKind === null || pendingDelta === '')
|
|
1317
|
+
return;
|
|
1318
|
+
chunks.push(pendingKind === 'text' ? textDelta(pendingDelta, state) : reasoningDelta(pendingDelta, state));
|
|
1319
|
+
pendingKind = null;
|
|
1320
|
+
pendingDelta = '';
|
|
1321
|
+
};
|
|
1322
|
+
for (const block of content) {
|
|
1323
|
+
const value = recordValue(block);
|
|
1324
|
+
if (value === null)
|
|
1325
|
+
continue;
|
|
1326
|
+
const blockType = textValue(value.type).toLowerCase();
|
|
1327
|
+
const isReasoning = blockType.includes('thinking') || blockType.includes('reasoning')
|
|
1328
|
+
|| typeof value.thinking === 'string' || typeof value.reasoning === 'string';
|
|
1329
|
+
const blockText = textValue(isReasoning
|
|
1330
|
+
? value.thinking ?? value.reasoning ?? value.text ?? value.content
|
|
1331
|
+
: value.text ?? value.content);
|
|
1332
|
+
if (isReasoning) {
|
|
1333
|
+
snapshotReasoning += blockText;
|
|
1334
|
+
if (snapshotReasoning.length > state.emittedReasoning.length) {
|
|
1335
|
+
const delta = snapshotReasoning.slice(state.emittedReasoning.length);
|
|
1336
|
+
ensureMessage(state);
|
|
1337
|
+
state.emittedReasoning = snapshotReasoning;
|
|
1338
|
+
if (pendingKind !== 'reasoning')
|
|
1339
|
+
flushPending();
|
|
1340
|
+
pendingKind = 'reasoning';
|
|
1341
|
+
pendingDelta += delta;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
else {
|
|
1345
|
+
snapshotText += blockText;
|
|
1346
|
+
if (snapshotText.length > state.emittedText.length) {
|
|
1347
|
+
const delta = snapshotText.slice(state.emittedText.length);
|
|
1348
|
+
ensureMessage(state);
|
|
1349
|
+
state.emittedText = snapshotText;
|
|
1350
|
+
state.sawText = true;
|
|
1351
|
+
if (pendingKind !== 'text')
|
|
1352
|
+
flushPending();
|
|
1353
|
+
pendingKind = 'text';
|
|
1354
|
+
pendingDelta += delta;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
flushPending();
|
|
1359
|
+
}
|
|
1360
|
+
function readToolChunk(event, status) {
|
|
1361
|
+
const callId = firstToolText(event.callId, event.call_id, event.toolCallId, event.tool_call_id, event.toolUseId, event.tool_use_id, event.id);
|
|
1362
|
+
const fn = recordValue(event.function);
|
|
1363
|
+
const toolName = textValue(event.name ?? event.toolName ?? event.tool_name ?? event.tool ?? fn?.name) || 'tool';
|
|
1364
|
+
const error = textValue(event.error ?? event.reason ?? event.message);
|
|
1365
|
+
const output = textValue(event.output ?? event.result ?? event.content ?? event.hookOutput);
|
|
1366
|
+
const input = event.input ?? fn?.arguments ?? event.arguments;
|
|
1367
|
+
const agentId = firstToolText(event.agentId, event.agent_id);
|
|
1368
|
+
const detail = serializeToolValue(event.detail ?? event.metadata ?? event.description);
|
|
1369
|
+
if (!callId && !toolName)
|
|
1370
|
+
return null;
|
|
1371
|
+
return {
|
|
1372
|
+
type: 'tool-event',
|
|
1373
|
+
toolName,
|
|
1374
|
+
...(callId ? { callId } : {}),
|
|
1375
|
+
...(input !== undefined ? { input: structuredText(input) } : {}),
|
|
1376
|
+
...(output ? { output } : {}),
|
|
1377
|
+
...(output ? { outputMode: 'snapshot' } : {}),
|
|
1378
|
+
...(error ? { error } : {}),
|
|
1379
|
+
...(agentId ? { agentId } : {}),
|
|
1380
|
+
...(detail !== undefined ? { detail } : {}),
|
|
1381
|
+
status,
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function isToolStart(type) {
|
|
1385
|
+
return ['tool_queued', 'tool_started', 'tool_running', 'tool_use', 'tool_call', 'function_call'].includes(type);
|
|
1386
|
+
}
|
|
1387
|
+
function isToolResult(type) {
|
|
1388
|
+
return ['tool_completed', 'tool_result', 'tool_return', 'tool_failed', 'tool_error', 'tool_denied', 'tool_hook_blocked', 'function_result'].includes(type);
|
|
1389
|
+
}
|
|
1390
|
+
function resultReason(event) {
|
|
1391
|
+
const resultRecord = recordValue(event.result);
|
|
1392
|
+
const stopReason = textValue(event.stopReason ?? resultRecord?.stopReason).toLowerCase();
|
|
1393
|
+
const subtype = textValue(event.subtype).toLowerCase();
|
|
1394
|
+
if (event.error !== undefined || subtype === 'error' || stopReason.includes('error') || stopReason.includes('fail'))
|
|
1395
|
+
return 'error';
|
|
1396
|
+
if (stopReason.includes('interrupt') || stopReason.includes('cancel') || stopReason === 'aborted')
|
|
1397
|
+
return 'cancel';
|
|
1398
|
+
return 'stop';
|
|
1399
|
+
}
|
|
1400
|
+
function commandCodeFailure(event) {
|
|
1401
|
+
const result = recordValue(event.result);
|
|
1402
|
+
const candidate = event.error ?? event.errorMessage ?? event.error_message ?? result?.error ?? result?.errorMessage ?? result?.message ?? event.message;
|
|
1403
|
+
const message = textValue(candidate) ?? (typeof candidate === 'string' ? candidate.trim() : '');
|
|
1404
|
+
const codeValue = result?.code ?? result?.errorCode ?? event.code ?? event.errorCode;
|
|
1405
|
+
const code = typeof codeValue === 'string' && codeValue.trim() !== '' ? codeValue.trim() : undefined;
|
|
1406
|
+
const actual = message.trim() || 'Command Code Provider 未返回具体失败信息。';
|
|
1407
|
+
return code === undefined ? { message: actual } : { message: actual, code };
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* 读取 CLI 的结束原因。
|
|
1411
|
+
*
|
|
1412
|
+
* `result` 行的 subtype/stopReason 在顶层,`run_end` 的 stopReason 藏在 result 里,
|
|
1413
|
+
* 两种都要认,否则 max_turns 会被当成正常完成。
|
|
1414
|
+
*/
|
|
1415
|
+
function readOutcomeSignal(event) {
|
|
1416
|
+
const resultRecord = recordValue(event.result);
|
|
1417
|
+
return textValue(event.subtype
|
|
1418
|
+
?? event.stopReason
|
|
1419
|
+
?? event.stop_reason
|
|
1420
|
+
?? resultRecord?.stopReason
|
|
1421
|
+
?? resultRecord?.stop_reason
|
|
1422
|
+
?? resultRecord?.subtype).trim().toLowerCase();
|
|
1423
|
+
}
|
|
1424
|
+
function isMaxTurnsOutcome(event) {
|
|
1425
|
+
const signal = readOutcomeSignal(event);
|
|
1426
|
+
return signal.includes('max_turns') || signal.includes('max-turns') || signal.includes('maxturns');
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* 把 CLI 可能写到 canonical 目录的 transcript 归位到 `--session` 指定的文件。
|
|
1430
|
+
*
|
|
1431
|
+
* 实测 CLI 的落盘位置取决于会话文件里是否已有历史:空会话(只有 session 头)时
|
|
1432
|
+
* 会把消息写进 `~/.commandcode/projects/<slug>/<id>.jsonl`,带上历史时则写回
|
|
1433
|
+
* `--session` 指定的文件。两种落点都要统一,否则下一轮恢复会落在一个没有上文的
|
|
1434
|
+
* 会话上。两边都存在时按修改时间同步最新内容,首轮则创建 canonical 文件。
|
|
1435
|
+
*/
|
|
1436
|
+
function syncCommandCodeTranscript(transcriptPath, homeDirectory, cwd, providerSessionId) {
|
|
1437
|
+
const canonicalPath = providerSessionId === undefined
|
|
1438
|
+
? resolveCanonicalTranscriptPath(transcriptPath, homeDirectory, cwd)
|
|
1439
|
+
: resolveCommandCodeTranscriptPath(homeDirectory, cwd ?? process.cwd(), providerSessionId);
|
|
1440
|
+
if (canonicalPath === null)
|
|
1441
|
+
return;
|
|
1442
|
+
if (providerSessionId !== undefined && !isSafeCommandCodeTranscriptTarget(canonicalPath, homeDirectory))
|
|
1443
|
+
return;
|
|
1444
|
+
try {
|
|
1445
|
+
if (!existsSync(transcriptPath) || !statSync(transcriptPath).isFile())
|
|
1446
|
+
return;
|
|
1447
|
+
const sourceMtime = statSync(transcriptPath).mtimeMs;
|
|
1448
|
+
if (!existsSync(canonicalPath)) {
|
|
1449
|
+
mkdirSync(dirname(canonicalPath), { recursive: true });
|
|
1450
|
+
copyFileSync(transcriptPath, canonicalPath);
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
if (!statSync(canonicalPath).isFile())
|
|
1454
|
+
return;
|
|
1455
|
+
const canonicalMtime = statSync(canonicalPath).mtimeMs;
|
|
1456
|
+
if (sourceMtime > canonicalMtime)
|
|
1457
|
+
copyFileSync(transcriptPath, canonicalPath);
|
|
1458
|
+
else if (canonicalMtime > sourceMtime)
|
|
1459
|
+
copyFileSync(canonicalPath, transcriptPath);
|
|
1460
|
+
}
|
|
1461
|
+
catch {
|
|
1462
|
+
// transcript 归位是恢复前的必要同步;文件竞态或不可读时保持当前运行结果。
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
/** 按 CLI 的 `<cwd slug>/<session id>` 规则定位 canonical transcript。 */
|
|
1466
|
+
function resolveCanonicalTranscriptPath(transcriptPath, homeDirectory, cwd) {
|
|
1467
|
+
const projectsRoot = join(homeDirectory, 'projects');
|
|
1468
|
+
const id = basename(transcriptPath, '.jsonl');
|
|
1469
|
+
const candidates = new Set();
|
|
1470
|
+
if (cwd)
|
|
1471
|
+
candidates.add(join(projectsRoot, workspaceSlug(cwd), `${id}.jsonl`));
|
|
1472
|
+
// cwd 缺失或 slug 规则变化时,退化为按会话文件名在 projects 下检索。
|
|
1473
|
+
try {
|
|
1474
|
+
for (const entry of readdirSync(projectsRoot)) {
|
|
1475
|
+
if (candidates.has(join(projectsRoot, entry, `${id}.jsonl`)))
|
|
1476
|
+
continue;
|
|
1477
|
+
if (existsSync(join(projectsRoot, entry, `${id}.jsonl`))) {
|
|
1478
|
+
candidates.add(join(projectsRoot, entry, `${id}.jsonl`));
|
|
1479
|
+
break;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
catch {
|
|
1484
|
+
// projects 目录不存在说明 CLI 还没写过 canonical transcript。
|
|
1485
|
+
}
|
|
1486
|
+
for (const candidate of candidates) {
|
|
1487
|
+
if (existsSync(candidate))
|
|
1488
|
+
return candidate;
|
|
1489
|
+
}
|
|
1490
|
+
return null;
|
|
1491
|
+
}
|
|
1492
|
+
/** 按 Provider 会话 ID 计算 Command Code 的 canonical transcript 路径。 */
|
|
1493
|
+
function resolveCommandCodeTranscriptPath(homeDirectory, cwd, providerSessionId) {
|
|
1494
|
+
return join(homeDirectory, 'projects', workspaceSlug(cwd), `${safeId(providerSessionId)}.jsonl`);
|
|
1495
|
+
}
|
|
1496
|
+
/** Provider 索引只能指向 Command Code 项目目录中的 JSONL,避免旧配置污染探测边界。 */
|
|
1497
|
+
function isSafeCommandCodeTranscriptPath(candidate, homeDirectory) {
|
|
1498
|
+
const projectsRootPath = resolve(join(homeDirectory, 'projects'));
|
|
1499
|
+
let projectsRoot = projectsRootPath;
|
|
1500
|
+
try {
|
|
1501
|
+
if (existsSync(projectsRootPath))
|
|
1502
|
+
projectsRoot = realpathSync(projectsRootPath);
|
|
1503
|
+
}
|
|
1504
|
+
catch {
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
const resolvedCandidate = resolve(candidate);
|
|
1508
|
+
let actualCandidate = resolvedCandidate;
|
|
1509
|
+
try {
|
|
1510
|
+
if (existsSync(resolvedCandidate))
|
|
1511
|
+
actualCandidate = realpathSync(resolvedCandidate);
|
|
1512
|
+
}
|
|
1513
|
+
catch {
|
|
1514
|
+
return false;
|
|
1515
|
+
}
|
|
1516
|
+
const relativePath = relative(projectsRoot, actualCandidate);
|
|
1517
|
+
const segments = relativePath.split(/[\\/]+/u).filter(Boolean);
|
|
1518
|
+
return relativePath !== ''
|
|
1519
|
+
&& !relativePath.startsWith('..')
|
|
1520
|
+
&& segments.length === 2
|
|
1521
|
+
&& actualCandidate.endsWith('.jsonl')
|
|
1522
|
+
// checkpoint 不是 --resume 使用的 transcript,即使扩展名同为 .jsonl
|
|
1523
|
+
// 也不能把它当作可恢复会话绑定。
|
|
1524
|
+
&& !actualCandidate.endsWith('.checkpoints.jsonl');
|
|
1525
|
+
}
|
|
1526
|
+
/** 允许同步创建的 canonical transcript 目标,路径必须严格位于 projects/<slug>/*.jsonl。 */
|
|
1527
|
+
function isSafeCommandCodeTranscriptTarget(candidate, homeDirectory) {
|
|
1528
|
+
const projectsRoot = resolve(join(homeDirectory, 'projects'));
|
|
1529
|
+
const resolvedCandidate = resolve(candidate);
|
|
1530
|
+
const relativePath = relative(projectsRoot, resolvedCandidate);
|
|
1531
|
+
const segments = relativePath.split(/[\\/]+/u).filter(Boolean);
|
|
1532
|
+
return relativePath !== ''
|
|
1533
|
+
&& !relativePath.startsWith('..')
|
|
1534
|
+
&& segments.length === 2
|
|
1535
|
+
&& resolvedCandidate.endsWith('.jsonl')
|
|
1536
|
+
&& !resolvedCandidate.endsWith('.checkpoints.jsonl');
|
|
1537
|
+
}
|
|
1538
|
+
/** 只读 JSONL 首条记录,避免探测大 transcript 时把整份文件载入内存。 */
|
|
1539
|
+
function readFirstJsonRecord(path) {
|
|
1540
|
+
const descriptor = openSync(path, 'r');
|
|
1541
|
+
try {
|
|
1542
|
+
const buffer = Buffer.allocUnsafe(64 * 1024);
|
|
1543
|
+
const bytes = readSync(descriptor, buffer, 0, buffer.length, 0);
|
|
1544
|
+
const firstLine = buffer.subarray(0, bytes).toString('utf8').split(/\r?\n/u).find((line) => line.trim() !== '');
|
|
1545
|
+
return firstLine === undefined ? null : parseJson(firstLine);
|
|
1546
|
+
}
|
|
1547
|
+
finally {
|
|
1548
|
+
closeSync(descriptor);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Command Code 的 `--session <临时路径>` 在部分版本只落检查点文件,不创建主 transcript。
|
|
1553
|
+
* 检查点足以证明会话仍可被 `--resume` 找到,但不包含完整消息历史,因此只用于探测回退。
|
|
1554
|
+
*/
|
|
1555
|
+
function resolveCommandCodeCheckpointPath(homeDirectory, cwd, providerSessionId) {
|
|
1556
|
+
const expected = join(homeDirectory, 'projects', workspaceSlug(cwd), `${providerSessionId}.checkpoints.jsonl`);
|
|
1557
|
+
if (existsSync(expected))
|
|
1558
|
+
return expected;
|
|
1559
|
+
const projectsRoot = join(homeDirectory, 'projects');
|
|
1560
|
+
try {
|
|
1561
|
+
for (const entry of readdirSync(projectsRoot)) {
|
|
1562
|
+
const candidate = join(projectsRoot, entry, `${providerSessionId}.checkpoints.jsonl`);
|
|
1563
|
+
if (existsSync(candidate))
|
|
1564
|
+
return candidate;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
catch {
|
|
1568
|
+
// projects 目录不存在说明 CLI 还没写过检查点。
|
|
1569
|
+
}
|
|
1570
|
+
return null;
|
|
1571
|
+
}
|
|
1572
|
+
/** CLI 的 canonical 目录名:绝对路径去掉前导分隔符,非字母数字统一换成连字符并转小写。 */
|
|
1573
|
+
function workspaceSlug(workspacePath) {
|
|
1574
|
+
return workspacePath.replace(/[\\/]+$/, '')
|
|
1575
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
1576
|
+
.replaceAll(':', '-')
|
|
1577
|
+
.replaceAll('\\', '-')
|
|
1578
|
+
.replaceAll('/', '-')
|
|
1579
|
+
.replace(/[^a-zA-Z0-9_-]+/g, '-')
|
|
1580
|
+
.replace(/-+/g, '-')
|
|
1581
|
+
.replace(/^-+|-+$/g, '')
|
|
1582
|
+
.toLowerCase();
|
|
1583
|
+
}
|
|
1584
|
+
/** 从用户文本提取显式 Skill mention,和 Codex 的 `/name`、`$name` 语义保持一致。 */
|
|
1585
|
+
function commandCodeSkillNames(prompt) {
|
|
1586
|
+
const names = [];
|
|
1587
|
+
const seen = new Set();
|
|
1588
|
+
for (const match of prompt.matchAll(/(?:^|\s)(?:\$|\/)([A-Za-z0-9][A-Za-z0-9._-]*)(?=\s|$)/gu)) {
|
|
1589
|
+
const name = match[1]?.trim();
|
|
1590
|
+
if (name === undefined || name === '' || seen.has(name))
|
|
1591
|
+
continue;
|
|
1592
|
+
seen.add(name);
|
|
1593
|
+
names.push(name);
|
|
1594
|
+
}
|
|
1595
|
+
return names;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* 按 Command Code 的优先级扫描项目级、用户级和额外 Skill 根目录。
|
|
1599
|
+
*
|
|
1600
|
+
* 只把合法的 `SKILL.md` 摘要交给 Client;绝对路径保留在 Host,供显式 mention
|
|
1601
|
+
* 通过 `--skill` 下发。重名时高优先级目录胜出,避免同一 Skill 被重复注入。
|
|
1602
|
+
*/
|
|
1603
|
+
function scanCommandCodeSkills(cwd, homeDirectory) {
|
|
1604
|
+
const projectRoot = commandCodeProjectRoot(cwd);
|
|
1605
|
+
const userHome = basename(homeDirectory) === '.commandcode' ? dirname(homeDirectory) : homeDirectory;
|
|
1606
|
+
const disabledSkills = readCommandCodeDisabledSkills(projectRoot, homeDirectory);
|
|
1607
|
+
const roots = [
|
|
1608
|
+
join(projectRoot, '.commandcode', 'skills'),
|
|
1609
|
+
...commandCodeProjectAgentsSkillRoots(cwd, userHome),
|
|
1610
|
+
join(homeDirectory, 'skills'),
|
|
1611
|
+
join(userHome, '.agents', 'skills'),
|
|
1612
|
+
...readCommandCodeConfiguredSkillRoots(projectRoot, homeDirectory),
|
|
1613
|
+
];
|
|
1614
|
+
const entries = [];
|
|
1615
|
+
const seenNames = new Set();
|
|
1616
|
+
const visitedDirectories = new Set();
|
|
1617
|
+
for (const root of roots)
|
|
1618
|
+
scanCommandCodeSkillRoot(root, entries, seenNames, visitedDirectories, disabledSkills);
|
|
1619
|
+
return entries;
|
|
1620
|
+
}
|
|
1621
|
+
/** Command Code 会从当前目录向上查找项目 `.agents/skills`,最多跨十级。 */
|
|
1622
|
+
function commandCodeProjectAgentsSkillRoots(cwd, userHome) {
|
|
1623
|
+
const roots = [];
|
|
1624
|
+
let current = resolve(cwd);
|
|
1625
|
+
for (let depth = 0; depth <= 10; depth += 1) {
|
|
1626
|
+
if (current === resolve(userHome))
|
|
1627
|
+
break;
|
|
1628
|
+
roots.push(join(current, '.agents', 'skills'));
|
|
1629
|
+
const parent = dirname(current);
|
|
1630
|
+
if (parent === current)
|
|
1631
|
+
break;
|
|
1632
|
+
current = parent;
|
|
1633
|
+
}
|
|
1634
|
+
return roots;
|
|
1635
|
+
}
|
|
1636
|
+
function commandCodeProjectRoot(cwd) {
|
|
1637
|
+
let current = resolve(cwd);
|
|
1638
|
+
const fallback = current;
|
|
1639
|
+
while (true) {
|
|
1640
|
+
if (existsSync(join(current, '.git')))
|
|
1641
|
+
return current;
|
|
1642
|
+
const parent = dirname(current);
|
|
1643
|
+
if (parent === current)
|
|
1644
|
+
return fallback;
|
|
1645
|
+
current = parent;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
function readCommandCodeConfiguredSkillRoots(projectRoot, homeDirectory) {
|
|
1649
|
+
const settingsLayers = [
|
|
1650
|
+
{ path: join(projectRoot, '.commandcode', 'settings.local.json'), base: projectRoot },
|
|
1651
|
+
{ path: join(projectRoot, '.commandcode', 'settings.json'), base: projectRoot },
|
|
1652
|
+
{ path: join(homeDirectory, 'settings.json'), base: basename(homeDirectory) === '.commandcode' ? dirname(homeDirectory) : homeDirectory },
|
|
1653
|
+
];
|
|
1654
|
+
const layer = settingsLayers.find(({ path }) => Array.isArray(readJson(path)?.skills));
|
|
1655
|
+
if (layer === undefined)
|
|
1656
|
+
return [];
|
|
1657
|
+
const settings = readJson(layer.path);
|
|
1658
|
+
if (!Array.isArray(settings?.skills))
|
|
1659
|
+
return [];
|
|
1660
|
+
const roots = [];
|
|
1661
|
+
for (const value of settings.skills) {
|
|
1662
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
1663
|
+
continue;
|
|
1664
|
+
const configured = value.trim();
|
|
1665
|
+
const userHome = basename(homeDirectory) === '.commandcode' ? dirname(homeDirectory) : homeDirectory;
|
|
1666
|
+
roots.push(configured.startsWith('~/')
|
|
1667
|
+
? resolve(userHome, configured.slice(2))
|
|
1668
|
+
: resolve(layer.base, configured));
|
|
1669
|
+
}
|
|
1670
|
+
return roots;
|
|
1671
|
+
}
|
|
1672
|
+
function scanCommandCodeSkillRoot(root, entries, seenNames, visitedDirectories, disabledSkills) {
|
|
1673
|
+
if (!existsSync(root))
|
|
1674
|
+
return;
|
|
1675
|
+
let canonicalRoot;
|
|
1676
|
+
try {
|
|
1677
|
+
if (!statSync(root).isDirectory())
|
|
1678
|
+
return;
|
|
1679
|
+
canonicalRoot = realpathSync(root);
|
|
1680
|
+
}
|
|
1681
|
+
catch {
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
const walk = (directory, depth) => {
|
|
1685
|
+
if (depth > 32)
|
|
1686
|
+
return;
|
|
1687
|
+
let canonicalDirectory;
|
|
1688
|
+
try {
|
|
1689
|
+
canonicalDirectory = realpathSync(directory);
|
|
1690
|
+
}
|
|
1691
|
+
catch {
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
if (visitedDirectories.has(canonicalDirectory))
|
|
1695
|
+
return;
|
|
1696
|
+
visitedDirectories.add(canonicalDirectory);
|
|
1697
|
+
const ownSkillFile = join(canonicalDirectory, 'SKILL.md');
|
|
1698
|
+
try {
|
|
1699
|
+
if (statSync(ownSkillFile).isFile()) {
|
|
1700
|
+
const entry = parseCommandCodeSkillFile(ownSkillFile);
|
|
1701
|
+
if (entry !== null && !seenNames.has(entry.name)) {
|
|
1702
|
+
seenNames.add(entry.name);
|
|
1703
|
+
entries.push(disabledSkills.has(entry.name) ? { ...entry, enabled: false } : entry);
|
|
1704
|
+
}
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
catch {
|
|
1709
|
+
// 当前目录不是 Skill 目录,继续检查可能的分组子目录。
|
|
1710
|
+
}
|
|
1711
|
+
let children;
|
|
1712
|
+
try {
|
|
1713
|
+
children = readdirSync(canonicalDirectory, { withFileTypes: true });
|
|
1714
|
+
}
|
|
1715
|
+
catch {
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
for (const child of children) {
|
|
1719
|
+
if (child.name === '.git' || child.name === 'node_modules')
|
|
1720
|
+
continue;
|
|
1721
|
+
const childPath = join(canonicalDirectory, child.name);
|
|
1722
|
+
if (child.isDirectory()) {
|
|
1723
|
+
walk(childPath, depth + 1);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
// 首次遍历也使用规范路径,确保额外目录的符号链接遵守去重规则。
|
|
1728
|
+
walk(canonicalRoot, 0);
|
|
1729
|
+
}
|
|
1730
|
+
/** disabledSkills 是用户设置与项目设置的并集,保持 Command Code 的禁用语义。 */
|
|
1731
|
+
function readCommandCodeDisabledSkills(projectRoot, homeDirectory) {
|
|
1732
|
+
const disabled = new Set();
|
|
1733
|
+
const paths = [
|
|
1734
|
+
join(homeDirectory, 'settings.json'),
|
|
1735
|
+
join(projectRoot, '.commandcode', 'settings.json'),
|
|
1736
|
+
join(projectRoot, '.commandcode', 'settings.local.json'),
|
|
1737
|
+
];
|
|
1738
|
+
for (const path of paths) {
|
|
1739
|
+
const settings = readJson(path);
|
|
1740
|
+
if (!Array.isArray(settings?.disabledSkills))
|
|
1741
|
+
continue;
|
|
1742
|
+
for (const value of settings.disabledSkills) {
|
|
1743
|
+
if (typeof value === 'string' && /^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(value.trim()))
|
|
1744
|
+
disabled.add(value.trim());
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
return disabled;
|
|
1748
|
+
}
|
|
1749
|
+
function parseCommandCodeSkillFile(path) {
|
|
1750
|
+
let source;
|
|
1751
|
+
try {
|
|
1752
|
+
source = readFileSync(path, 'utf8');
|
|
1753
|
+
}
|
|
1754
|
+
catch {
|
|
1755
|
+
return null;
|
|
1756
|
+
}
|
|
1757
|
+
const match = source.match(/^(?:\uFEFF)?---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u);
|
|
1758
|
+
if (match === null)
|
|
1759
|
+
return null;
|
|
1760
|
+
const fields = parseSkillFrontmatter(match[1] ?? '');
|
|
1761
|
+
if (fields === null)
|
|
1762
|
+
return null;
|
|
1763
|
+
const name = typeof fields.name === 'string' ? fields.name.trim() : '';
|
|
1764
|
+
const description = typeof fields.description === 'string' ? fields.description.trim() : '';
|
|
1765
|
+
const directoryName = basename(dirname(path));
|
|
1766
|
+
if (name.length > 64 || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(name)
|
|
1767
|
+
|| name !== directoryName
|
|
1768
|
+
|| description === '')
|
|
1769
|
+
return null;
|
|
1770
|
+
return {
|
|
1771
|
+
id: name,
|
|
1772
|
+
name,
|
|
1773
|
+
description,
|
|
1774
|
+
enabled: fields['user-invocable'] !== false,
|
|
1775
|
+
path: dirname(path),
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
function buildMaxTurnsReachedMessage(autoContinueCount, maxTurns) {
|
|
1779
|
+
const autoContinueSuffix = autoContinueCount > 0
|
|
1780
|
+
? `,自动续跑 ${autoContinueCount} 次后仍未完成`
|
|
1781
|
+
: '';
|
|
1782
|
+
return `COMMAND_CODE_MAX_TURNS:单次运行达到 --max-turns ${maxTurns} 上限${autoContinueSuffix},会话已停止,任务可能尚未完成。`;
|
|
1783
|
+
}
|
|
1784
|
+
function normalizePositiveInteger(value, fallback) {
|
|
1785
|
+
const parsed = typeof value === 'number' ? value : Number(value);
|
|
1786
|
+
return Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : fallback;
|
|
1787
|
+
}
|
|
1788
|
+
function normalizeNonNegativeInteger(value, fallback) {
|
|
1789
|
+
const parsed = typeof value === 'number' ? value : Number(value);
|
|
1790
|
+
return Number.isFinite(parsed) && parsed >= 0 ? Math.floor(parsed) : fallback;
|
|
1791
|
+
}
|
|
1792
|
+
/** 读取可选的整数环境变量;与父仓库同名,便于两套 Host 用同一份运维配置。 */
|
|
1793
|
+
function readOptionalIntegerEnv(name) {
|
|
1794
|
+
const raw = process.env[name]?.trim();
|
|
1795
|
+
if (!raw)
|
|
1796
|
+
return null;
|
|
1797
|
+
const parsed = Number(raw);
|
|
1798
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
1799
|
+
}
|
|
1800
|
+
function readSessionId(event) {
|
|
1801
|
+
const value = textValue(event.sessionId ?? event.session_id ?? recordValue(event.session)?.id ?? recordValue(event.result)?.sessionId).trim();
|
|
1802
|
+
return value === '' ? null : value;
|
|
1803
|
+
}
|
|
1804
|
+
/** 会话探测由 Registry 控制超时;文件扫描期间也必须尊重取消信号。 */
|
|
1805
|
+
function throwIfCommandCodeProbeAborted(signal) {
|
|
1806
|
+
if (signal?.aborted !== true)
|
|
1807
|
+
return;
|
|
1808
|
+
const error = new Error('Command Code 会话探测已取消');
|
|
1809
|
+
error.name = 'AbortError';
|
|
1810
|
+
throw error;
|
|
1811
|
+
}
|
|
1812
|
+
function textValue(value) {
|
|
1813
|
+
return typeof value === 'string' ? value : value === undefined || value === null ? '' : structuredText(value);
|
|
1814
|
+
}
|
|
1815
|
+
function structuredText(value) {
|
|
1816
|
+
if (typeof value === 'string')
|
|
1817
|
+
return value;
|
|
1818
|
+
try {
|
|
1819
|
+
return JSON.stringify(value) ?? '';
|
|
1820
|
+
}
|
|
1821
|
+
catch {
|
|
1822
|
+
return String(value);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
function recordValue(value) {
|
|
1826
|
+
return isRecord(value) ? value : null;
|
|
1827
|
+
}
|
|
1828
|
+
function writeTranscript(path, input) {
|
|
1829
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
1830
|
+
const history = input.messages.length > 0 ? input.messages.slice(0, -1) : [];
|
|
1831
|
+
let parentId = null;
|
|
1832
|
+
const lines = [JSON.stringify({ type: 'session', version: 3, id: input.sessionId, timestamp: new Date().toISOString(), cwd: input.cwd ?? process.cwd() })];
|
|
1833
|
+
history.forEach((message, index) => {
|
|
1834
|
+
if (message.role !== 'user' && message.role !== 'assistant' && message.role !== 'tool')
|
|
1835
|
+
return;
|
|
1836
|
+
const content = extractText(message.content, message);
|
|
1837
|
+
if (content.length === 0)
|
|
1838
|
+
return;
|
|
1839
|
+
const id = message.id ?? `message-${index}`;
|
|
1840
|
+
const role = message.role === 'tool' ? 'user' : message.role;
|
|
1841
|
+
lines.push(JSON.stringify({ type: 'message', id, parentId, timestamp: new Date().toISOString(), message: { role, content } }));
|
|
1842
|
+
parentId = id;
|
|
1843
|
+
});
|
|
1844
|
+
writeFileSync(path, `${lines.join('\n')}\n`, 'utf8');
|
|
1845
|
+
}
|
|
1846
|
+
/** 把 DSH 消息块转换为 Command Code 原生 transcript 块,保留工具和推理语义。 */
|
|
1847
|
+
function extractText(content, message) {
|
|
1848
|
+
if (message.role === 'tool') {
|
|
1849
|
+
const toolCallId = message.toolCallId ?? message.source?.callId;
|
|
1850
|
+
if (toolCallId === undefined || toolCallId.trim() === '')
|
|
1851
|
+
return [];
|
|
1852
|
+
return [{ type: 'tool_result', tool_use_id: toolCallId, content: extractToolResultContent(content) }];
|
|
1853
|
+
}
|
|
1854
|
+
if (typeof content === 'string')
|
|
1855
|
+
return content === '' ? [] : [{ type: 'text', text: content }];
|
|
1856
|
+
if (!Array.isArray(content))
|
|
1857
|
+
return [];
|
|
1858
|
+
const blocks = [];
|
|
1859
|
+
for (const part of content) {
|
|
1860
|
+
if (!isRecord(part))
|
|
1861
|
+
continue;
|
|
1862
|
+
if (part.type === 'tool-call') {
|
|
1863
|
+
const id = typeof part.id === 'string' ? part.id.trim() : '';
|
|
1864
|
+
const name = typeof part.name === 'string' ? part.name.trim() : '';
|
|
1865
|
+
if (id === '' || name === '')
|
|
1866
|
+
continue;
|
|
1867
|
+
blocks.push({ type: 'tool_use', id, name, input: parseToolInput(part.arguments ?? part.input) });
|
|
1868
|
+
continue;
|
|
1869
|
+
}
|
|
1870
|
+
if (part.type === 'tool-result') {
|
|
1871
|
+
const toolUseId = firstText(part.toolCallId, part.tool_use_id, part.toolUseId);
|
|
1872
|
+
if (toolUseId !== '')
|
|
1873
|
+
blocks.push({ type: 'tool_result', tool_use_id: toolUseId, content: extractToolResultContent(part.content ?? part.output ?? part.result) });
|
|
1874
|
+
continue;
|
|
1875
|
+
}
|
|
1876
|
+
if (part.type === 'thinking' || part.type === 'reasoning') {
|
|
1877
|
+
const thinking = firstText(part.thinking, part.reasoning, part.text, part.content);
|
|
1878
|
+
if (thinking !== '')
|
|
1879
|
+
blocks.push({ type: 'thinking', thinking });
|
|
1880
|
+
continue;
|
|
1881
|
+
}
|
|
1882
|
+
const text = typeof part.text === 'string' ? part.text : '';
|
|
1883
|
+
if (text !== '')
|
|
1884
|
+
blocks.push({ type: 'text', text });
|
|
1885
|
+
}
|
|
1886
|
+
return blocks;
|
|
1887
|
+
}
|
|
1888
|
+
function extractToolResultContent(content) {
|
|
1889
|
+
if (typeof content === 'string')
|
|
1890
|
+
return [{ type: 'text', text: content }];
|
|
1891
|
+
if (Array.isArray(content)) {
|
|
1892
|
+
const parts = content.filter(isRecord).map((part) => {
|
|
1893
|
+
if (typeof part.text === 'string')
|
|
1894
|
+
return { type: 'text', text: part.text };
|
|
1895
|
+
return null;
|
|
1896
|
+
}).filter((part) => part !== null);
|
|
1897
|
+
if (parts.length > 0)
|
|
1898
|
+
return parts;
|
|
1899
|
+
}
|
|
1900
|
+
return [{ type: 'text', text: structuredText(content) }];
|
|
1901
|
+
}
|
|
1902
|
+
function parseToolInput(value) {
|
|
1903
|
+
if (typeof value !== 'string')
|
|
1904
|
+
return value ?? {};
|
|
1905
|
+
try {
|
|
1906
|
+
return JSON.parse(value);
|
|
1907
|
+
}
|
|
1908
|
+
catch {
|
|
1909
|
+
return value;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
function firstText(...values) {
|
|
1913
|
+
return values.find((value) => typeof value === 'string' && value !== '') ?? '';
|
|
1914
|
+
}
|
|
1915
|
+
function safeId(value) { return value.replace(/[^a-zA-Z0-9._-]+/gu, '_').slice(0, 96) || 'default'; }
|
|
1916
|
+
/** 旧驱动生成的 Host synthetic ID;没有 canonical transcript 时必须放弃 --resume。 */
|
|
1917
|
+
function isLegacySyntheticSessionId(value) {
|
|
1918
|
+
return value.startsWith('dsh-agentdoor-cc-session-') || value.startsWith('dsh-agent-door-cc-session-');
|
|
1919
|
+
}
|
|
1920
|
+
function parseJson(value) { try {
|
|
1921
|
+
const parsed = JSON.parse(value);
|
|
1922
|
+
return isRecord(parsed) ? parsed : null;
|
|
1923
|
+
}
|
|
1924
|
+
catch {
|
|
1925
|
+
return null;
|
|
1926
|
+
} }
|
|
1927
|
+
function readJson(path) { if (!existsSync(path))
|
|
1928
|
+
return null; try {
|
|
1929
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
1930
|
+
return isRecord(parsed) ? parsed : null;
|
|
1931
|
+
}
|
|
1932
|
+
catch {
|
|
1933
|
+
return null;
|
|
1934
|
+
} }
|
|
1935
|
+
/** 保留启动选择作为进程复用条件;ACP 的实际会话状态由原生协议显式设置。 */
|
|
1936
|
+
function commandCodeAcpArgs(input) {
|
|
1937
|
+
// Command Code 的全局 --mod 必须放在 acp 子命令之前;放到 acp 之后会被
|
|
1938
|
+
// Commander 当成 ACP 子命令参数而拒绝。该参数无论桥接状态都必须存在,确保
|
|
1939
|
+
// 启动阶段就屏蔽原生 agent。
|
|
1940
|
+
const args = [...commandCodeNativeAgentArgs(input.sessionId), 'acp', ...commandCodePermissionArgs(input.permission)];
|
|
1941
|
+
if (input.plan === true && !args.includes('--plan'))
|
|
1942
|
+
args.push('--plan');
|
|
1943
|
+
if (input.enableAskUserQuestion === true || input.runtimeEnv?.CMD_TOOLS_ASK_USER_QUESTION_ENABLE === 'true') {
|
|
1944
|
+
args.push('--tools-enable', 'ask_user_question');
|
|
1945
|
+
}
|
|
1946
|
+
for (const path of input.skillPaths ?? [])
|
|
1947
|
+
args.push('--skill', path);
|
|
1948
|
+
if (input.modelId !== undefined && input.modelId !== 'provider-default')
|
|
1949
|
+
args.push('--model', input.modelId);
|
|
1950
|
+
const effort = input.effortId?.trim().toLowerCase();
|
|
1951
|
+
if (effort !== undefined && VALID_EFFORTS.has(effort))
|
|
1952
|
+
args.push('--effort', effort);
|
|
1953
|
+
return args;
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Command Code 1.74.3 的 acp 子命令不执行普通 CLI action 的参数初始化。
|
|
1957
|
+
* 仅传 --model/--effort/--permission-mode 会被静默忽略,恢复的会话还会沿用旧模型。
|
|
1958
|
+
* 必须在 prompt 前设置线程状态,且不能吞掉模型或权限设置失败。
|
|
1959
|
+
*/
|
|
1960
|
+
async function configureCommandCodeAcpSession(rpc, sessionId, input) {
|
|
1961
|
+
const requestOptions = { signal: input.signal, killOnAbort: false };
|
|
1962
|
+
if (input.modelId !== undefined && input.modelId !== 'provider-default') {
|
|
1963
|
+
await rpc.request('session/set_model', { sessionId, modelId: input.modelId }, requestOptions);
|
|
1964
|
+
}
|
|
1965
|
+
await rpc.request('session/set_mode', { sessionId, modeId: commandCodeAcpMode(input) }, requestOptions);
|
|
1966
|
+
const effort = input.effortId?.trim().toLowerCase();
|
|
1967
|
+
if (effort !== undefined && VALID_EFFORTS.has(effort)) {
|
|
1968
|
+
await rpc.request('session/set_config_option', { sessionId, configId: 'effort', value: effort }, requestOptions);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* Command Code 的 `prompting` 是进程内会话状态,只有 prompt 真正返回才会复位。
|
|
1973
|
+
* 如果上一轮的 prompt 仍卡在 ask_user_question / 权限请求上(例如用户取消了
|
|
1974
|
+
* 提问或直接中止回合),新一轮的 set_model/set_mode 会被 Provider 以
|
|
1975
|
+
* `Cannot switch models while a prompt is running` 拒绝。此时同一进程里的会话
|
|
1976
|
+
* 已经无法自愈:必须先丢弃会话(进程随之退出),下一次执行会重新 spawn 并在
|
|
1977
|
+
* 新会话上重新配置,否则用户看到的就是“每次发消息都在第一步失败”。
|
|
1978
|
+
*/
|
|
1979
|
+
async function recoverCommandCodeAcpSession(params) {
|
|
1980
|
+
if (!commandCodePromptRunningError(params.error))
|
|
1981
|
+
return false;
|
|
1982
|
+
params.abandonSession();
|
|
1983
|
+
return true;
|
|
1984
|
+
}
|
|
1985
|
+
/** 识别 Provider 的“本轮 prompt 尚未结束”拒绝;不同版本文案可能不同。 */
|
|
1986
|
+
function commandCodePromptRunningError(error) {
|
|
1987
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1988
|
+
return /prompt is (?:still )?running|prompt is already running|Cannot switch models while a prompt is running/iu.test(message);
|
|
1989
|
+
}
|
|
1990
|
+
/** ACP 使用权限引擎的模式 ID,与普通 CLI 的 accept-edits/yolo 别名不同。 */
|
|
1991
|
+
function commandCodeAcpMode(input) {
|
|
1992
|
+
const permission = input.permission;
|
|
1993
|
+
if (input.plan === true || permission?.sandboxMode === 'read-only')
|
|
1994
|
+
return 'plan';
|
|
1995
|
+
// 工作区内写入已经由沙箱模式授权;ask 只表示需要审批时可以询问,不能把
|
|
1996
|
+
// 每次普通编辑都降级到 default。auto-accept 仍由 CLI 检查越界与风险操作。
|
|
1997
|
+
if (permission?.sandboxMode === 'workspace-write')
|
|
1998
|
+
return 'auto-accept';
|
|
1999
|
+
if (permission?.approvalPolicy !== 'never')
|
|
2000
|
+
return 'default';
|
|
2001
|
+
if (permission.sandboxMode === 'danger-full-access')
|
|
2002
|
+
return 'bypass';
|
|
2003
|
+
return 'default';
|
|
2004
|
+
}
|
|
2005
|
+
/** 托管委派由 DSH 桥接校验目标授权,不能再交给 CLI 对每次调用重复审批。 */
|
|
2006
|
+
function commandCodeAcpPermissionDecision(message, input) {
|
|
2007
|
+
if (message.method !== 'session/request_permission')
|
|
2008
|
+
return undefined;
|
|
2009
|
+
const params = isRecord(message.params) ? message.params : {};
|
|
2010
|
+
const tool = isRecord(params.toolCall) ? params.toolCall : {};
|
|
2011
|
+
const toolName = firstToolText(tool.name, tool.toolName, tool.tool_name, tool.title);
|
|
2012
|
+
const metadata = isRecord(params._meta) ? params._meta : {};
|
|
2013
|
+
const permission = input.permission;
|
|
2014
|
+
const canWrite = input.plan !== true
|
|
2015
|
+
&& (permission?.sandboxMode === 'workspace-write' || permission?.sandboxMode === 'danger-full-access');
|
|
2016
|
+
// 只识别插件自己的桥接入口,不能把全部 MCP/自定义工具或显式风险请求放行。
|
|
2017
|
+
if (canWrite && metadata.risk === undefined && subagentBridgeActive(input.sessionId)
|
|
2018
|
+
&& (toolName === 'agent_subagent' || toolName === 'mcp__agentdoor__agent_subagent'
|
|
2019
|
+
|| toolName === 'web_search' || toolName === 'mcp__agentdoor__web_search'
|
|
2020
|
+
|| toolName === 'web_fetch' || toolName === 'mcp__agentdoor__web_fetch'
|
|
2021
|
+
|| toolName === 'agent_team' && teamBridgeToken(input.sessionId) !== undefined))
|
|
2022
|
+
return 'allow';
|
|
2023
|
+
// never 允许已有授权范围内的工作,但不允许把剩余审批升级成交互弹窗。
|
|
2024
|
+
return permission?.approvalPolicy === 'never' ? 'reject' : undefined;
|
|
2025
|
+
}
|
|
2026
|
+
/** Command Code 将 ask_user_question 编译成 `session/request_permission`。 */
|
|
2027
|
+
function readCommandCodeQuestionRequest(message) {
|
|
2028
|
+
const method = message.method?.toLowerCase();
|
|
2029
|
+
if (method !== 'session/request_permission' || (typeof message.id !== 'string' && typeof message.id !== 'number'))
|
|
2030
|
+
return null;
|
|
2031
|
+
const params = isRecord(message.params) ? message.params : {};
|
|
2032
|
+
const tool = isRecord(params.toolCall) ? params.toolCall : isRecord(params.tool_call) ? params.tool_call : {};
|
|
2033
|
+
const kind = firstToolText(tool.kind, params.kind)?.toLowerCase();
|
|
2034
|
+
const toolName = firstToolText(tool.name, tool.toolName, tool.tool_name);
|
|
2035
|
+
if (kind !== 'other' && toolName !== 'ask_user_question')
|
|
2036
|
+
return null;
|
|
2037
|
+
const rawInput = isRecord(tool.rawInput) ? tool.rawInput : isRecord(tool.raw_input) ? tool.raw_input : {};
|
|
2038
|
+
const questionText = firstToolText(rawInput.question, rawInput.prompt, params.question, params.prompt);
|
|
2039
|
+
const rawOptions = Array.isArray(rawInput.options)
|
|
2040
|
+
? rawInput.options
|
|
2041
|
+
: Array.isArray(params.questionOptions)
|
|
2042
|
+
? params.questionOptions
|
|
2043
|
+
: [];
|
|
2044
|
+
if (questionText === undefined || rawOptions.length === 0)
|
|
2045
|
+
return null;
|
|
2046
|
+
const options = rawOptions.flatMap((rawOption) => {
|
|
2047
|
+
if (typeof rawOption === 'string' && rawOption.trim() !== '')
|
|
2048
|
+
return [{ label: rawOption.trim() }];
|
|
2049
|
+
if (!isRecord(rawOption))
|
|
2050
|
+
return [];
|
|
2051
|
+
const label = firstToolText(rawOption.label, rawOption.name, rawOption.title, rawOption.value);
|
|
2052
|
+
if (label === undefined)
|
|
2053
|
+
return [];
|
|
2054
|
+
const description = firstToolText(rawOption.description, rawOption.detail);
|
|
2055
|
+
return [{ label, ...(description === undefined ? {} : { description }) }];
|
|
2056
|
+
});
|
|
2057
|
+
if (options.length === 0)
|
|
2058
|
+
return null;
|
|
2059
|
+
const protocolOptions = Array.isArray(params.options) ? params.options : [];
|
|
2060
|
+
const optionIds = options.map((_, index) => {
|
|
2061
|
+
const protocolOption = isRecord(protocolOptions[index]) ? protocolOptions[index] : {};
|
|
2062
|
+
return firstToolText(protocolOption.optionId, protocolOption.option_id, protocolOption.id) ?? `option_${index}`;
|
|
2063
|
+
});
|
|
2064
|
+
const requestId = String(message.id);
|
|
2065
|
+
const questionId = `command-code-question-${requestId}`;
|
|
2066
|
+
const header = firstToolText(rawInput.header, params.header);
|
|
2067
|
+
return {
|
|
2068
|
+
requestId,
|
|
2069
|
+
rpcId: message.id,
|
|
2070
|
+
questions: [{
|
|
2071
|
+
id: questionId,
|
|
2072
|
+
question: questionText,
|
|
2073
|
+
...(header === undefined ? {} : { header }),
|
|
2074
|
+
options,
|
|
2075
|
+
}],
|
|
2076
|
+
respond: (response) => {
|
|
2077
|
+
const answer = response.answers.find((item) => item.id === questionId) ?? response.answers[0];
|
|
2078
|
+
const custom = answer?.custom?.trim() ?? '';
|
|
2079
|
+
const selected = answer?.selected[0]?.trim() ?? '';
|
|
2080
|
+
const selectedIndex = options.findIndex((option) => option.label === selected);
|
|
2081
|
+
if (custom !== '') {
|
|
2082
|
+
// `optionId` 使用保留值,未加载兼容桥时会安全地取消,不会误选第一项。
|
|
2083
|
+
// loader 会从 _meta 读取原文,并把它作为 ask_user_question 的工具答案。
|
|
2084
|
+
return {
|
|
2085
|
+
outcome: { outcome: 'selected', optionId: '__agentdoor_custom__' },
|
|
2086
|
+
answers: [{ questionIndex: 0, selectedOptions: [custom] }],
|
|
2087
|
+
_meta: { 'agentdoor/questionAnswer': custom },
|
|
2088
|
+
};
|
|
2089
|
+
}
|
|
2090
|
+
if (selected === '' || selectedIndex < 0)
|
|
2091
|
+
return { outcome: { outcome: 'cancelled' } };
|
|
2092
|
+
return { outcome: { outcome: 'selected', optionId: optionIds[selectedIndex] } };
|
|
2093
|
+
},
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
function isRecord(value) { return typeof value === 'object' && value !== null && !Array.isArray(value); }
|
|
2097
|
+
function emptyCatalog() { return { groups: [], currentModel: null, currentEffort: null }; }
|
|
2098
|
+
//# sourceMappingURL=command-code-driver.js.map
|