@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,1958 @@
|
|
|
1
|
+
import { runAsyncCommand } from './process-utils.js';
|
|
2
|
+
import { failedDetection, probeFailure } from './binary-detection.js';
|
|
3
|
+
import { readFileSync, readdirSync, realpathSync, statSync } from 'node:fs';
|
|
4
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
5
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
6
|
+
import { homedir, tmpdir } from 'node:os';
|
|
7
|
+
import { createConnection } from 'node:net';
|
|
8
|
+
import { basename, dirname, isAbsolute, join, win32 } from 'node:path';
|
|
9
|
+
import { JsonRpcProcess, JsonRpcRequestError } from './json-rpc-process.js';
|
|
10
|
+
import { emptyCatalog, isRecord, streamRpcRequest, textValue, usageChunk } from './rpc-driver-utils.js';
|
|
11
|
+
import { probeStoredSession, readFirstJsonRecord } from './session-probe.js';
|
|
12
|
+
import { acpToolStatusFields, firstToolText, isToolRecord, serializeToolValue } from './tool-observation.js';
|
|
13
|
+
import { buildAcpPromptBlocks } from './attachment-utils.js';
|
|
14
|
+
import { acpBridgeMcpServers } from '../cli-bridge/injections.js';
|
|
15
|
+
import { reasoningText } from './reasoning-content.js';
|
|
16
|
+
import { advanceAgentDoorSegment, createAgentDoorSegmentState, decorateAgentDoorSegmentEvent } from './stream-normalizer.js';
|
|
17
|
+
import { commandEnvironment, resolveCommandPath, WINDOWS } from './process-utils.js';
|
|
18
|
+
import { isProviderDefaultModel } from './model-catalog.js';
|
|
19
|
+
import { ACP_FORM_CLIENT_CAPABILITIES, acpElicitationResponse, readAcpElicitationRequest } from './acp-elicitation.js';
|
|
20
|
+
import { WORKBUDDY_CREDENTIAL_PRELOAD } from './workbuddy-credential-bootstrap.js';
|
|
21
|
+
/** WorkBuddy 将 Auto 拆成三个模型 ID,但它们实际是 Auto 的思考档位。 */
|
|
22
|
+
const WORKBUDDY_AUTO_TIER_MODELS = [
|
|
23
|
+
{ id: 'fast-model', name: '快速' },
|
|
24
|
+
{ id: 'balanced-model', name: '均衡' },
|
|
25
|
+
{ id: 'deep-model', name: '极致' },
|
|
26
|
+
];
|
|
27
|
+
const WORKBUDDY_AUTO_TIER_IDS = new Set(WORKBUDDY_AUTO_TIER_MODELS.map((model) => model.id));
|
|
28
|
+
/** `auto` 是 WorkBuddy 的默认路由占位符,不应作为独立模型渲染。 */
|
|
29
|
+
const WORKBUDDY_AUTO_MODEL_ID = 'auto';
|
|
30
|
+
const CODEBUDDY_HOME = join(homedir(), '.codebuddy');
|
|
31
|
+
const CODEBUDDY_INTERNATIONAL_AUTH_HOME = join(homedir(), '.codebuddy-international-home');
|
|
32
|
+
// 官方 FileAuthenticationStorage 不读取 CODEBUDDY_CONFIG_DIR,而是按 HOME
|
|
33
|
+
// 计算 ~/Library/Application Support/CodeBuddyExtension(或平台等价目录)。
|
|
34
|
+
// CN 在全局认证不是 CN 账号时使用独立 HOME,避免登录时覆盖国际版的认证文件。
|
|
35
|
+
const CODEBUDDY_CN_AUTH_HOME = join(homedir(), '.codebuddy-cn-home');
|
|
36
|
+
const INTERNAL_AUTH_DOMAINS = new Set([
|
|
37
|
+
'copilot.tencent.com', 'staging-copilot.tencent.com', 'www.codebuddy.cn', 'staging.codebuddy.cn',
|
|
38
|
+
'www.workbuddy.cn', 'staging.workbuddy.cn',
|
|
39
|
+
]);
|
|
40
|
+
const EXTERNAL_AUTH_DOMAINS = new Set(['www.codebuddy.ai', 'staging-codebuddy.tencent.com']);
|
|
41
|
+
// WorkBuddy 产品配置中的 dataFolderName 为 `.workbuddy`;必须复用桌面应用
|
|
42
|
+
// 的认证存储,不能另造 `.workbuddy-ai` 隔离目录,否则 ACP 会报 Authentication required。
|
|
43
|
+
const WORKBUDDY_HOME = join(homedir(), '.workbuddy');
|
|
44
|
+
/** CodeBuddy 独立 CLI 的产品身份。 */
|
|
45
|
+
export const CODEBUDDY_PROFILE = {
|
|
46
|
+
adapterId: 'codebuddy',
|
|
47
|
+
displayName: 'CodeBuddy',
|
|
48
|
+
// CN 与国际版是同一个 CLI;兼容旧版 CN profile 的专用配置变量,统一归入
|
|
49
|
+
// 当前适配器的配置根,不再注册第二个 Agent。
|
|
50
|
+
configRootEnvVars: ['CODEBUDDY_CONFIG_DIR', 'CODEBUDDY_CN_CONFIG_DIR'],
|
|
51
|
+
defaultConfigRoot: CODEBUDDY_HOME,
|
|
52
|
+
historyDirRule: 'lowercase-slug',
|
|
53
|
+
platforms: ['darwin', 'win32', 'linux'],
|
|
54
|
+
commandEnvOverride: 'CODEBUDDY_CLI_PATH',
|
|
55
|
+
// 官方 npm 包同时提供 codebuddy、codebuddy-code 和 cbc 三个入口。
|
|
56
|
+
binaries: ['codebuddy', 'codebuddy-code', 'cbc', 'codebuddy.cmd', 'codebuddy-code.cmd', 'cbc.cmd'],
|
|
57
|
+
bundledInApp: false,
|
|
58
|
+
// 没有匹配的全局国际账号时,使用独立认证根,避免读到 CN 会话。
|
|
59
|
+
isolatedHome: CODEBUDDY_INTERNATIONAL_AUTH_HOME,
|
|
60
|
+
// 区域变量在 runtimeEnvironment 中根据认证域名动态设置。
|
|
61
|
+
};
|
|
62
|
+
/** 旧版 CN profile 的兼容导出;运行时不再把它注册为独立 Agent。 */
|
|
63
|
+
export const CODEBUDDY_CN_PROFILE = CODEBUDDY_PROFILE;
|
|
64
|
+
/** WorkBuddy 桌面应用内置 CLI 的产品身份。 */
|
|
65
|
+
export const WORKBUDDY_PROFILE = {
|
|
66
|
+
adapterId: 'workbuddy',
|
|
67
|
+
displayName: 'WorkBuddy',
|
|
68
|
+
configRootEnvVars: ['WORKBUDDY_CONFIG_DIR', 'CODEBUDDY_CONFIG_DIR'],
|
|
69
|
+
configRootLookupEnvVars: ['WORKBUDDY_CONFIG_DIR'],
|
|
70
|
+
defaultConfigRoot: WORKBUDDY_HOME,
|
|
71
|
+
historyDirRule: 'preserve-case',
|
|
72
|
+
platforms: ['darwin', 'win32'],
|
|
73
|
+
commandEnvOverride: 'WORKBUDDY_CLI_PATH',
|
|
74
|
+
// WorkBuddy 的入口文件仍叫 codebuddy,但只能使用桌面应用内置副本。
|
|
75
|
+
binaries: ['codebuddy'],
|
|
76
|
+
bundledInApp: true,
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* ACP 驱动的已验收公共能力。
|
|
80
|
+
*
|
|
81
|
+
* CodeBuddy 的 ACP 上下文事件与本地 JSONL 用量补偿已经完成验收;账户套餐
|
|
82
|
+
* 仍由独立订阅读取器负责,不混入 ACP 能力声明。
|
|
83
|
+
*/
|
|
84
|
+
const CONSERVATIVE_CAPABILITIES = [
|
|
85
|
+
'models', 'stream', 'resume', 'interrupt', 'tool-events', 'reasoning', 'usage', 'permission', 'questions',
|
|
86
|
+
];
|
|
87
|
+
/** 无副作用模型探测的最低回退项;登记层可以传入更完整的真实目录覆盖它。 */
|
|
88
|
+
export const CODEBUDDY_DEFAULT_CATALOG = {
|
|
89
|
+
groups: [{ id: 'codebuddy', name: 'CodeBuddy', models: [{ id: 'provider-default', name: '跟随 CodeBuddy 默认模型', efforts: [] }] }],
|
|
90
|
+
currentModel: null,
|
|
91
|
+
currentEffort: null,
|
|
92
|
+
// 只有默认入口时表示产品目录尚未读取成功,Registry 必须按短周期重试。
|
|
93
|
+
fallback: true,
|
|
94
|
+
};
|
|
95
|
+
export const CODEBUDDY_CN_DEFAULT_CATALOG = CODEBUDDY_DEFAULT_CATALOG;
|
|
96
|
+
export const WORKBUDDY_DEFAULT_CATALOG = {
|
|
97
|
+
groups: [{ id: 'workbuddy', name: 'WorkBuddy', models: [{ id: 'provider-default', name: '跟随 WorkBuddy 默认模型', efforts: [] }] }],
|
|
98
|
+
currentModel: null,
|
|
99
|
+
currentEffort: null,
|
|
100
|
+
// 只有默认入口时表示产品目录尚未读取成功,Registry 必须按短周期重试。
|
|
101
|
+
fallback: true,
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* CodeBuddy 与 WorkBuddy 共用的 ACP stdio 驱动。
|
|
105
|
+
*
|
|
106
|
+
* 每轮启动一个短生命周期 ACP 进程,继续会话时通过 `session/load` 恢复。
|
|
107
|
+
* 这样取消不会把残留取消态带到下一轮,且不需要复制厂商 SDK 或桌面应用登录态。
|
|
108
|
+
*/
|
|
109
|
+
export class CodeBuddyCliDriver {
|
|
110
|
+
descriptor;
|
|
111
|
+
/** CodeBuddy/WorkBuddy 的 ACP 流可由 Registry 在工具完成后暂停并续读。 */
|
|
112
|
+
supportsToolStepSplitting = true;
|
|
113
|
+
profile;
|
|
114
|
+
runSpawnSync;
|
|
115
|
+
runSpawn;
|
|
116
|
+
environment;
|
|
117
|
+
configRoot;
|
|
118
|
+
sessionRoots;
|
|
119
|
+
fallbackCatalog;
|
|
120
|
+
platform;
|
|
121
|
+
binaries;
|
|
122
|
+
binariesOverride;
|
|
123
|
+
modelCatalogPaths;
|
|
124
|
+
readModelCatalogFile;
|
|
125
|
+
commandPath;
|
|
126
|
+
useSidecar;
|
|
127
|
+
sidecarSocketPath;
|
|
128
|
+
workbuddyElectronPath;
|
|
129
|
+
cachedCommand = null;
|
|
130
|
+
lastVersion = null;
|
|
131
|
+
detectionDiagnostic;
|
|
132
|
+
detectionFailure;
|
|
133
|
+
processes = new Map();
|
|
134
|
+
sidecarProcesses = new Map();
|
|
135
|
+
permissions = new Map();
|
|
136
|
+
questions = new Map();
|
|
137
|
+
constructor(options = {}) {
|
|
138
|
+
this.profile = options.profile ?? CODEBUDDY_PROFILE;
|
|
139
|
+
this.runSpawnSync = options.spawnSync ?? spawnSync;
|
|
140
|
+
this.runSpawn = options.spawn ?? spawn;
|
|
141
|
+
this.platform = options.platform ?? process.platform;
|
|
142
|
+
this.binariesOverride = options.binaries !== undefined;
|
|
143
|
+
this.binaries = options.binaries ?? this.profile.binaries;
|
|
144
|
+
this.commandPath = options.commandPath?.trim() || undefined;
|
|
145
|
+
this.environment = { ...process.env, ...(options.environment ?? options.env ?? {}) };
|
|
146
|
+
this.configRoot = resolveConfigRoot(this.profile, options.configRoot, this.environment);
|
|
147
|
+
this.modelCatalogPaths = options.modelCatalogPaths;
|
|
148
|
+
this.readModelCatalogFile = options.readFileSync ?? readFileSync;
|
|
149
|
+
this.sessionRoots = options.sessionRoots ?? [join(this.configRoot, 'projects'), join(this.configRoot, 'sessions')];
|
|
150
|
+
this.fallbackCatalog = options.fallbackCatalog ?? defaultCatalogForProfile(this.profile);
|
|
151
|
+
this.useSidecar = options.useSidecar ?? false;
|
|
152
|
+
this.sidecarSocketPath = options.sidecarSocketPath?.trim() || undefined;
|
|
153
|
+
this.workbuddyElectronPath = options.workbuddyElectronPath?.trim() || undefined;
|
|
154
|
+
this.descriptor = {
|
|
155
|
+
id: this.profile.adapterId,
|
|
156
|
+
name: this.profile.displayName,
|
|
157
|
+
protocol: 'acp',
|
|
158
|
+
capabilities: CONSERVATIVE_CAPABILITIES,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** 当前使用的产品身份配置根,供测试和诊断使用;不包含凭据。 */
|
|
162
|
+
get configDirectory() { return this.configRoot; }
|
|
163
|
+
/** 最近一次探测失败的脱敏诊断。 */
|
|
164
|
+
get discoveryError() { return this.detectionDiagnostic; }
|
|
165
|
+
getDiscoveryDiagnostic() { return this.detectionDiagnostic; }
|
|
166
|
+
getDiscoveryFailure() { return this.detectionFailure; }
|
|
167
|
+
/** 回复 ACP 标准权限请求。 */
|
|
168
|
+
async respondPermission(sessionId, response) {
|
|
169
|
+
const pending = this.permissions.get(sessionId)?.get(response.requestId);
|
|
170
|
+
if (pending === undefined)
|
|
171
|
+
throw new Error(`${this.profile.displayName} 权限请求不存在`);
|
|
172
|
+
this.permissions.get(sessionId).delete(response.requestId);
|
|
173
|
+
const result = { outcome: { outcome: 'selected', optionId: response.approved ? pending.allowOptionId : pending.rejectOptionId } };
|
|
174
|
+
if (pending.client !== undefined) {
|
|
175
|
+
await pending.client.respond(pending.rpcId, result);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const process = this.processes.get(sessionId)?.rpc;
|
|
179
|
+
if (process === undefined)
|
|
180
|
+
throw new Error(`${this.profile.displayName} ACP 进程已结束`);
|
|
181
|
+
process.respond(pending.rpcId, result);
|
|
182
|
+
}
|
|
183
|
+
/** 回复 ACP 标准 form elicitation。 */
|
|
184
|
+
async respondQuestion(sessionId, response) {
|
|
185
|
+
const pending = this.questions.get(sessionId)?.get(response.requestId);
|
|
186
|
+
if (pending === undefined)
|
|
187
|
+
throw new Error(`${this.profile.displayName} 问题请求不存在`);
|
|
188
|
+
this.questions.get(sessionId).delete(response.requestId);
|
|
189
|
+
const result = acpElicitationResponse(pending.request, response);
|
|
190
|
+
if (pending.client !== undefined) {
|
|
191
|
+
await pending.client.respond(pending.request.rpcId, result);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const process = this.processes.get(sessionId)?.rpc;
|
|
195
|
+
if (process === undefined)
|
|
196
|
+
throw new Error(`${this.profile.displayName} ACP 进程已结束`);
|
|
197
|
+
process.respond(pending.request.rpcId, result);
|
|
198
|
+
}
|
|
199
|
+
async detect() {
|
|
200
|
+
this.detectionDiagnostic = undefined;
|
|
201
|
+
this.detectionFailure = undefined;
|
|
202
|
+
if (!this.profile.platforms.includes(this.platform)) {
|
|
203
|
+
this.detectionDiagnostic = `${this.profile.displayName} 官方未提供 ${this.platform} 平台版本`;
|
|
204
|
+
return { installed: false, version: null, command: null };
|
|
205
|
+
}
|
|
206
|
+
const explicit = this.explicitCommand();
|
|
207
|
+
if (explicit !== undefined) {
|
|
208
|
+
const result = await this.detectCommand(explicit);
|
|
209
|
+
if (result !== null)
|
|
210
|
+
return result;
|
|
211
|
+
if (this.detectionDiagnostic === undefined)
|
|
212
|
+
this.detectionDiagnostic = this.detectionFailure === undefined
|
|
213
|
+
? `${this.profile.displayName} 显式指定的 CLI 路径无效` : failedDetection(this.detectionFailure).diagnostic;
|
|
214
|
+
return { installed: false, version: null, command: null };
|
|
215
|
+
}
|
|
216
|
+
let firstDiagnostic;
|
|
217
|
+
let firstFailure;
|
|
218
|
+
for (const command of this.candidateCommands()) {
|
|
219
|
+
const result = await this.detectCommand(command);
|
|
220
|
+
if (result !== null)
|
|
221
|
+
return result;
|
|
222
|
+
if (firstDiagnostic === undefined && this.detectionDiagnostic !== undefined)
|
|
223
|
+
firstDiagnostic = this.detectionDiagnostic;
|
|
224
|
+
firstFailure ??= this.detectionFailure;
|
|
225
|
+
}
|
|
226
|
+
this.detectionDiagnostic = firstDiagnostic ?? (firstFailure === undefined ? `${this.profile.displayName} CLI 未安装` : failedDetection(firstFailure).diagnostic);
|
|
227
|
+
this.detectionFailure = firstFailure;
|
|
228
|
+
return { installed: false, version: null, command: null };
|
|
229
|
+
}
|
|
230
|
+
/** 从产品快照读取模型目录;ACP 没有标准只读目录接口,不能创建会话探测模型。 */
|
|
231
|
+
async listModels() {
|
|
232
|
+
const detection = await this.detect();
|
|
233
|
+
if (!detection.installed)
|
|
234
|
+
return emptyCatalog();
|
|
235
|
+
// PATH 中的 npm shim 可能只是相对命令名;模型目录位于真实 CLI 包根目录,
|
|
236
|
+
// 因此这里补一次只读路径解析,避免把工作目录误当成产品目录。
|
|
237
|
+
const command = detection.command !== null && !isAbsolute(detection.command)
|
|
238
|
+
? (await resolveCommandPath(detection.command, this.runSpawnSync)) ?? detection.command
|
|
239
|
+
: detection.command;
|
|
240
|
+
const modelCatalogPaths = this.modelCatalogPaths ?? defaultModelCatalogPaths(this.profile, this.configRoot, this.environment);
|
|
241
|
+
return readProductCatalog(modelCatalogPaths, this.readModelCatalogFile, command, this.profile, detectCodeBuddyRegion(this.environment)) ?? this.fallbackCatalog;
|
|
242
|
+
}
|
|
243
|
+
/** 只读扫描产品自己的历史根;不会调用 ACP load/prompt。 */
|
|
244
|
+
async probeSession(input) {
|
|
245
|
+
return probeStoredSession(input, {
|
|
246
|
+
roots: this.sessionRoots,
|
|
247
|
+
matches: (path, entry, id) => entry.isFile() && (path.endsWith(`${id}.jsonl`) || basename(path).includes(id)),
|
|
248
|
+
validate: async (path, id) => {
|
|
249
|
+
const record = await readFirstJsonRecord(path);
|
|
250
|
+
const value = record?.sessionId ?? record?.session_id ?? record?.id;
|
|
251
|
+
return value === id;
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
async *executeTurn(input) {
|
|
256
|
+
const command = this.cachedCommand ?? (await this.detect()).command;
|
|
257
|
+
if (command === null)
|
|
258
|
+
throw new Error(`${this.profile.displayName} CLI 未安装`);
|
|
259
|
+
if (this.useSidecar && this.profile.adapterId === WORKBUDDY_PROFILE.adapterId) {
|
|
260
|
+
yield* this.executeWorkBuddySidecarTurn(input, command);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const environment = { ...this.runtimeEnvironment(command), ...(input.runtimeEnv ?? {}) };
|
|
264
|
+
const invocation = this.profile.adapterId === WORKBUDDY_PROFILE.adapterId
|
|
265
|
+
? workBuddyDirectLaunchSpec(command, this.workbuddyElectronPath, this.configRoot, this.platform, environment)
|
|
266
|
+
: { command, args: ['--acp'], env: environment };
|
|
267
|
+
const rpc = new JsonRpcProcess({
|
|
268
|
+
...invocation,
|
|
269
|
+
cwd: input.cwd,
|
|
270
|
+
spawn: this.runSpawn,
|
|
271
|
+
});
|
|
272
|
+
const processState = { rpc, providerSessionId: '' };
|
|
273
|
+
this.processes.set(input.sessionId, processState);
|
|
274
|
+
const permissions = new Map();
|
|
275
|
+
this.permissions.set(input.sessionId, permissions);
|
|
276
|
+
const questions = new Map();
|
|
277
|
+
this.questions.set(input.sessionId, questions);
|
|
278
|
+
// ACP 标准权限和 form elicitation 交给 DSH 原生组件;未知扩展请求快速取消。
|
|
279
|
+
rpc.setServerRequestHandler((message) => {
|
|
280
|
+
const elicitation = readAcpElicitationRequest(message);
|
|
281
|
+
if (elicitation !== null) {
|
|
282
|
+
questions.set(elicitation.requestId, { request: elicitation });
|
|
283
|
+
return new Promise(() => undefined);
|
|
284
|
+
}
|
|
285
|
+
if (message.method === 'elicitation/create')
|
|
286
|
+
return { action: 'cancel' };
|
|
287
|
+
const permission = codeBuddyPermissionRequest(message);
|
|
288
|
+
if (permission === null || message.id === undefined || message.id === null)
|
|
289
|
+
return { outcome: { outcome: 'cancelled' } };
|
|
290
|
+
permissions.set(permission.requestId, { rpcId: message.id, allowOptionId: permission.allowOptionId, rejectOptionId: permission.rejectOptionId });
|
|
291
|
+
return new Promise(() => undefined);
|
|
292
|
+
});
|
|
293
|
+
try {
|
|
294
|
+
await rpc.request('initialize', {
|
|
295
|
+
protocolVersion: 1,
|
|
296
|
+
clientInfo: { name: 'dsh-agentdoor', version: '0.1.1' },
|
|
297
|
+
clientCapabilities: ACP_FORM_CLIENT_CAPABILITIES,
|
|
298
|
+
}, sidecarSignalOptions(input.signal));
|
|
299
|
+
rpc.notify('initialized', {});
|
|
300
|
+
const session = input.providerSessionId
|
|
301
|
+
? await rpc.request('session/load', {
|
|
302
|
+
sessionId: input.providerSessionId,
|
|
303
|
+
cwd: input.cwd ?? process.cwd(),
|
|
304
|
+
mcpServers: acpBridgeMcpServers(input.sessionId, this.profile.adapterId),
|
|
305
|
+
}, sidecarSignalOptions(input.signal))
|
|
306
|
+
: await rpc.request('session/new', {
|
|
307
|
+
cwd: input.cwd ?? process.cwd(),
|
|
308
|
+
mcpServers: acpBridgeMcpServers(input.sessionId, this.profile.adapterId),
|
|
309
|
+
}, sidecarSignalOptions(input.signal));
|
|
310
|
+
const providerSessionId = readSessionId(session) ?? input.providerSessionId ?? input.sessionId;
|
|
311
|
+
processState.providerSessionId = providerSessionId;
|
|
312
|
+
yield { type: 'session-binding', providerSessionId };
|
|
313
|
+
// ACP 版本间的模型设置方法并不完全一致;失败时沿用 Provider 默认模型,不能阻断本轮。
|
|
314
|
+
const modelId = resolveCodeBuddyModelId(this.profile, input.modelId, input.effortId);
|
|
315
|
+
if (!isProviderDefaultModel(modelId)) {
|
|
316
|
+
await rpc.request('session/set_model', { sessionId: providerSessionId, modelId }, { signal: input.signal, killOnAbort: false }).catch(() => undefined);
|
|
317
|
+
}
|
|
318
|
+
const stream = streamRpcRequest(rpc, 'session/prompt', {
|
|
319
|
+
sessionId: providerSessionId,
|
|
320
|
+
prompt: await buildAcpPromptBlocks(input.prompt, input.attachments ?? []),
|
|
321
|
+
}, input.signal, { dispose: false, killOnAbort: false });
|
|
322
|
+
let meaningful = false;
|
|
323
|
+
let richUsageSeen = false;
|
|
324
|
+
let reportedContextWindow;
|
|
325
|
+
let terminal;
|
|
326
|
+
const segmentState = createAgentDoorSegmentState();
|
|
327
|
+
let promptResponse;
|
|
328
|
+
while (true) {
|
|
329
|
+
const item = await stream.next();
|
|
330
|
+
if (item.done) {
|
|
331
|
+
promptResponse = item.value;
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
const rawChunk = codeBuddyMessageToChunk(item.value);
|
|
335
|
+
const chunk = rawChunk === null ? null : decorateAgentDoorSegmentEvent(rawChunk, input, segmentState, this.descriptor.id);
|
|
336
|
+
if (chunk?.type === 'finish') {
|
|
337
|
+
// ACP 可能先发一个 session/update 终态,再在 prompt 响应里携带真正的
|
|
338
|
+
// stopReason。先暂存终态,等正文和 prompt 响应都到齐后再决定成功或失败。
|
|
339
|
+
terminal = chunk;
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (chunk !== null) {
|
|
343
|
+
meaningful = true;
|
|
344
|
+
if (chunk.type === 'usage') {
|
|
345
|
+
if (chunk.contextWindow !== undefined)
|
|
346
|
+
reportedContextWindow = chunk.contextWindow;
|
|
347
|
+
if (hasTokenUsage(chunk))
|
|
348
|
+
richUsageSeen = true;
|
|
349
|
+
}
|
|
350
|
+
yield chunk;
|
|
351
|
+
advanceAgentDoorSegment(chunk, segmentState);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// CodeBuddy ACP 当前只发送正文与 stopReason;完整 Token/缓存数据会在
|
|
355
|
+
// prompt 完成后写入本地 JSONL。只在 ACP 没有提供完整 usage 时补读,避免
|
|
356
|
+
// 同一轮产生两套互相冲突的 token 口径。
|
|
357
|
+
if (!richUsageSeen) {
|
|
358
|
+
const historyUsage = await this.readHistoryUsage(input, providerSessionId);
|
|
359
|
+
if (historyUsage !== null)
|
|
360
|
+
yield enrichCodeBuddyUsageContext(historyUsage, reportedContextWindow);
|
|
361
|
+
}
|
|
362
|
+
const responseHasStopReason = isRecord(promptResponse) && typeof promptResponse.stopReason === 'string';
|
|
363
|
+
if (responseHasStopReason) {
|
|
364
|
+
// prompt 响应是 ACP 对本轮的最终判定,必须覆盖通知中可能提前发送的
|
|
365
|
+
// `finish(stop)`;否则 refusal 会被投影成正常结束,留下空 assistant。
|
|
366
|
+
yield promptFinish(promptResponse, input.signal);
|
|
367
|
+
}
|
|
368
|
+
else if (terminal !== undefined) {
|
|
369
|
+
if (meaningful) {
|
|
370
|
+
yield terminal;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
yield emptyResponseFinish(terminal.failure ?? promptFailure(promptResponse));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
yield emptyResponseFinish(promptFailure(promptResponse));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
finally {
|
|
381
|
+
if (this.processes.get(input.sessionId) === processState)
|
|
382
|
+
this.processes.delete(input.sessionId);
|
|
383
|
+
this.permissions.delete(input.sessionId);
|
|
384
|
+
this.questions.delete(input.sessionId);
|
|
385
|
+
await rpc.disposeAndWait();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/** 显式选择旧 sidecar 时,仍复用桌面创建的认证运行时。 */
|
|
389
|
+
async *executeWorkBuddySidecarTurn(input, command) {
|
|
390
|
+
const socketPath = this.sidecarSocketPath ?? discoverWorkBuddySidecarSocket(this.configRoot, this.platform, this.environment);
|
|
391
|
+
if (socketPath === null) {
|
|
392
|
+
throw new Error('WorkBuddy 桌面运行通道尚未就绪。请打开并登录 WorkBuddy,在桌面应用中发送一条消息后重试;插件需要复用桌面应用创建的已认证运行时。若仍失败,请检查 WorkBuddy 版本及运行日志。');
|
|
393
|
+
}
|
|
394
|
+
const sidecar = new WorkBuddySidecarClient(socketPath);
|
|
395
|
+
let sidecarSessionId = '';
|
|
396
|
+
let ownsSidecarSession = false;
|
|
397
|
+
const launch = workBuddyLaunchSpec(command, this.workbuddyElectronPath, this.platform, this.environment);
|
|
398
|
+
let client;
|
|
399
|
+
let providerSessionId = '';
|
|
400
|
+
let disposed = false;
|
|
401
|
+
const cleanup = async () => {
|
|
402
|
+
if (disposed)
|
|
403
|
+
return;
|
|
404
|
+
disposed = true;
|
|
405
|
+
this.sidecarProcesses.delete(input.sessionId);
|
|
406
|
+
await client?.dispose().catch(() => undefined);
|
|
407
|
+
if (ownsSidecarSession && sidecarSessionId !== '') {
|
|
408
|
+
await sidecar.request('session.kill', { sessionId: sidecarSessionId }, { timeoutMs: 5_000 }).catch(() => undefined);
|
|
409
|
+
}
|
|
410
|
+
sidecar.dispose();
|
|
411
|
+
};
|
|
412
|
+
try {
|
|
413
|
+
const endpoint = await resolveWorkBuddyAcpEndpoint(sidecar, input, launch, command, this.configRoot, { ...this.runtimeEnvironment(command), ...(input.runtimeEnv ?? {}) }, this.platform, this.environment, (value) => {
|
|
414
|
+
sidecarSessionId = value;
|
|
415
|
+
ownsSidecarSession = true;
|
|
416
|
+
});
|
|
417
|
+
if (endpoint === '')
|
|
418
|
+
throw new Error('WorkBuddy sidecar 未返回 ACP 地址');
|
|
419
|
+
client = new WorkBuddyHttpAcpClient(endpoint);
|
|
420
|
+
await client.connect(input.signal);
|
|
421
|
+
const acpClient = client;
|
|
422
|
+
const permissions = new Map();
|
|
423
|
+
this.permissions.set(input.sessionId, permissions);
|
|
424
|
+
const questions = new Map();
|
|
425
|
+
this.questions.set(input.sessionId, questions);
|
|
426
|
+
acpClient.setServerRequestHandler((message) => {
|
|
427
|
+
const elicitation = readAcpElicitationRequest(message);
|
|
428
|
+
if (elicitation !== null) {
|
|
429
|
+
questions.set(elicitation.requestId, { request: elicitation, client: acpClient });
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
if (message.method === 'elicitation/create')
|
|
433
|
+
return false;
|
|
434
|
+
const permission = codeBuddyPermissionRequest(message);
|
|
435
|
+
if (permission === null || message.id === undefined || message.id === null)
|
|
436
|
+
return false;
|
|
437
|
+
permissions.set(permission.requestId, {
|
|
438
|
+
rpcId: message.id,
|
|
439
|
+
allowOptionId: permission.allowOptionId,
|
|
440
|
+
rejectOptionId: permission.rejectOptionId,
|
|
441
|
+
client: acpClient,
|
|
442
|
+
});
|
|
443
|
+
return true;
|
|
444
|
+
});
|
|
445
|
+
const state = {
|
|
446
|
+
client,
|
|
447
|
+
sidecar,
|
|
448
|
+
sidecarSessionId,
|
|
449
|
+
get providerSessionId() { return providerSessionId; },
|
|
450
|
+
dispose: cleanup,
|
|
451
|
+
};
|
|
452
|
+
this.sidecarProcesses.set(input.sessionId, state);
|
|
453
|
+
await client.request('initialize', {
|
|
454
|
+
protocolVersion: 1,
|
|
455
|
+
clientInfo: { name: 'dsh-agentdoor', version: '0.1.1' },
|
|
456
|
+
clientCapabilities: ACP_FORM_CLIENT_CAPABILITIES,
|
|
457
|
+
}, sidecarSignalOptions(input.signal));
|
|
458
|
+
await client.notify('initialized', {}, input.signal);
|
|
459
|
+
const session = input.providerSessionId
|
|
460
|
+
? await client.request('session/load', {
|
|
461
|
+
sessionId: input.providerSessionId,
|
|
462
|
+
cwd: input.cwd ?? process.cwd(),
|
|
463
|
+
mcpServers: acpBridgeMcpServers(input.sessionId, this.profile.adapterId),
|
|
464
|
+
}, sidecarSignalOptions(input.signal))
|
|
465
|
+
: await client.request('session/new', {
|
|
466
|
+
cwd: input.cwd ?? process.cwd(),
|
|
467
|
+
mcpServers: acpBridgeMcpServers(input.sessionId, this.profile.adapterId),
|
|
468
|
+
}, sidecarSignalOptions(input.signal));
|
|
469
|
+
providerSessionId = readSessionId(session) ?? input.providerSessionId ?? input.sessionId;
|
|
470
|
+
yield { type: 'session-binding', providerSessionId };
|
|
471
|
+
const modelId = resolveCodeBuddyModelId(this.profile, input.modelId, input.effortId);
|
|
472
|
+
if (!isProviderDefaultModel(modelId)) {
|
|
473
|
+
await client.request('session/set_model', { sessionId: providerSessionId, modelId }, sidecarSignalOptions(input.signal, false)).catch(() => undefined);
|
|
474
|
+
}
|
|
475
|
+
const stream = client.streamRequest('session/prompt', {
|
|
476
|
+
sessionId: providerSessionId,
|
|
477
|
+
prompt: await buildAcpPromptBlocks(input.prompt, input.attachments ?? []),
|
|
478
|
+
}, input.signal);
|
|
479
|
+
let meaningful = false;
|
|
480
|
+
let richUsageSeen = false;
|
|
481
|
+
let reportedContextWindow;
|
|
482
|
+
let terminal;
|
|
483
|
+
const segmentState = createAgentDoorSegmentState();
|
|
484
|
+
let promptResponse;
|
|
485
|
+
while (true) {
|
|
486
|
+
const item = await stream.next();
|
|
487
|
+
if (item.done) {
|
|
488
|
+
promptResponse = item.value;
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
const rawChunk = codeBuddyMessageToChunk(item.value);
|
|
492
|
+
const chunk = rawChunk === null ? null : decorateAgentDoorSegmentEvent(rawChunk, input, segmentState, this.descriptor.id);
|
|
493
|
+
if (chunk?.type === 'finish') {
|
|
494
|
+
terminal = chunk;
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
if (chunk !== null) {
|
|
498
|
+
meaningful = true;
|
|
499
|
+
if (chunk.type === 'usage') {
|
|
500
|
+
if (chunk.contextWindow !== undefined)
|
|
501
|
+
reportedContextWindow = chunk.contextWindow;
|
|
502
|
+
if (hasTokenUsage(chunk))
|
|
503
|
+
richUsageSeen = true;
|
|
504
|
+
}
|
|
505
|
+
yield chunk;
|
|
506
|
+
advanceAgentDoorSegment(chunk, segmentState);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (!richUsageSeen) {
|
|
510
|
+
const historyUsage = await this.readHistoryUsage(input, providerSessionId);
|
|
511
|
+
if (historyUsage !== null)
|
|
512
|
+
yield enrichCodeBuddyUsageContext(historyUsage, reportedContextWindow);
|
|
513
|
+
}
|
|
514
|
+
const responseHasStopReason = isRecord(promptResponse) && typeof promptResponse.stopReason === 'string';
|
|
515
|
+
if (responseHasStopReason) {
|
|
516
|
+
yield promptFinish(promptResponse, input.signal);
|
|
517
|
+
}
|
|
518
|
+
else if (terminal !== undefined) {
|
|
519
|
+
if (meaningful)
|
|
520
|
+
yield terminal;
|
|
521
|
+
else
|
|
522
|
+
yield emptyResponseFinish(terminal.failure ?? promptFailure(promptResponse));
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
yield emptyResponseFinish(promptFailure(promptResponse));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
finally {
|
|
529
|
+
this.permissions.delete(input.sessionId);
|
|
530
|
+
this.questions.delete(input.sessionId);
|
|
531
|
+
await cleanup();
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/** ACP 未提供 usage 时,从 CodeBuddy 已落盘的最新 assistant 记录补齐用量。 */
|
|
535
|
+
async readHistoryUsage(input, providerSessionId) {
|
|
536
|
+
let rawStoreRef = input.rawStoreRef?.trim() || undefined;
|
|
537
|
+
// CLI 写 JSONL 与结束响应存在极短竞态,最多等待 100ms;失败时保持原有
|
|
538
|
+
// ACP 行为,不把“读不到历史”误报成 Provider 错误。
|
|
539
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
540
|
+
if (rawStoreRef === undefined) {
|
|
541
|
+
const probe = await this.probeSession({
|
|
542
|
+
providerSessionId,
|
|
543
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
544
|
+
}).catch(() => undefined);
|
|
545
|
+
rawStoreRef = probe?.rawStoreRef;
|
|
546
|
+
}
|
|
547
|
+
if (rawStoreRef !== undefined) {
|
|
548
|
+
const usage = readCodeBuddyHistoryUsage(rawStoreRef);
|
|
549
|
+
if (usage !== null) {
|
|
550
|
+
const modelId = readCodeBuddyHistoryModel(rawStoreRef);
|
|
551
|
+
const configuredWindow = modelId === null
|
|
552
|
+
? undefined
|
|
553
|
+
: readCodeBuddyModelContextWindow(modelId, this.configRoot, this.environment, this.readModelCatalogFile);
|
|
554
|
+
return enrichCodeBuddyUsageContext(usage, configuredWindow);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (attempt < 2)
|
|
558
|
+
await delay(50);
|
|
559
|
+
}
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
/** 中断当前 ACP 进程;服务端取消失败时仍关闭本轮进程。 */
|
|
563
|
+
async interrupt(sessionId) {
|
|
564
|
+
const sidecarState = this.sidecarProcesses.get(sessionId);
|
|
565
|
+
if (sidecarState !== undefined) {
|
|
566
|
+
await sidecarState.client.request('session/cancel', { sessionId: sidecarState.providerSessionId || sessionId }, { killOnAbort: false }).catch(() => undefined);
|
|
567
|
+
await sidecarState.dispose().catch(() => undefined);
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const state = this.processes.get(sessionId);
|
|
571
|
+
if (state === undefined)
|
|
572
|
+
return;
|
|
573
|
+
try {
|
|
574
|
+
await state.rpc.request('session/cancel', { sessionId: state.providerSessionId || sessionId }, { killOnAbort: false });
|
|
575
|
+
}
|
|
576
|
+
catch { /* 进程关闭兜底 */ }
|
|
577
|
+
state.rpc.dispose();
|
|
578
|
+
}
|
|
579
|
+
dispose() {
|
|
580
|
+
for (const state of this.processes.values())
|
|
581
|
+
state.rpc.dispose();
|
|
582
|
+
this.processes.clear();
|
|
583
|
+
for (const state of this.sidecarProcesses.values())
|
|
584
|
+
void state.dispose().catch(() => undefined);
|
|
585
|
+
this.sidecarProcesses.clear();
|
|
586
|
+
this.cachedCommand = null;
|
|
587
|
+
this.lastVersion = null;
|
|
588
|
+
}
|
|
589
|
+
explicitCommand() {
|
|
590
|
+
if (this.commandPath !== undefined)
|
|
591
|
+
return this.commandPath;
|
|
592
|
+
const value = this.profile.commandEnvOverride === ''
|
|
593
|
+
? undefined
|
|
594
|
+
: this.environment[this.profile.commandEnvOverride]
|
|
595
|
+
?? (this.profile.adapterId === CODEBUDDY_PROFILE.adapterId ? this.environment.CODEBUDDY_CN_CLI_PATH : undefined);
|
|
596
|
+
return value?.trim() || undefined;
|
|
597
|
+
}
|
|
598
|
+
candidateCommands() {
|
|
599
|
+
if (this.profile.bundledInApp && !this.binariesOverride)
|
|
600
|
+
return bundledWorkBuddyCommands(this.platform, this.environment);
|
|
601
|
+
return this.binaries;
|
|
602
|
+
}
|
|
603
|
+
async detectCommand(command) {
|
|
604
|
+
try {
|
|
605
|
+
const windowsWorkBuddy = this.platform === 'win32' && this.profile.bundledInApp;
|
|
606
|
+
// Windows 安装包中的无后缀入口是 Node 脚本;缺失入口不能交给
|
|
607
|
+
// cmd(或 Electron)后误报为启动失败。
|
|
608
|
+
if (windowsWorkBuddy && !statSync(command).isFile())
|
|
609
|
+
return null;
|
|
610
|
+
const runtime = windowsWorkBuddy
|
|
611
|
+
? workBuddyWindowsRuntime(command, this.workbuddyElectronPath, this.environment)
|
|
612
|
+
: undefined;
|
|
613
|
+
const args = runtime === undefined ? [] : [command];
|
|
614
|
+
const options = {
|
|
615
|
+
encoding: 'utf8', timeout: 5_000, windowsHide: true, shell: runtime === undefined && WINDOWS,
|
|
616
|
+
env: { ...this.runtimeEnvironment(command), ...(runtime === undefined ? {} : { ELECTRON_RUN_AS_NODE: '1' }) },
|
|
617
|
+
};
|
|
618
|
+
const result = await runAsyncCommand(this.runSpawnSync, runtime ?? command, [...args, '--version'], options);
|
|
619
|
+
const output = `${result.stdout ?? ''}\n${result.stderr ?? ''}`;
|
|
620
|
+
const version = output.match(/\b\d+\.\d+(?:\.\d+)?(?:[-+][0-9A-Za-z.-]+)?\b/u)?.[0];
|
|
621
|
+
if (result.status === 0 && version !== undefined) {
|
|
622
|
+
const help = await runAsyncCommand(this.runSpawnSync, runtime ?? command, [...args, '--help'], options);
|
|
623
|
+
const helpOutput = `${help.stdout ?? ''}\n${help.stderr ?? ''}`;
|
|
624
|
+
if (!/--acp(?:[\s=]|$)/u.test(helpOutput)) {
|
|
625
|
+
this.detectionFailure = help.status === 0 ? 'protocol' : probeFailure(help, true) ?? 'launch';
|
|
626
|
+
this.detectionDiagnostic = help.status === 0
|
|
627
|
+
? `${this.profile.displayName} CLI 不支持 ACP 协议`
|
|
628
|
+
: summarizeCliFailure(this.profile.displayName, helpOutput);
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
this.cachedCommand = command;
|
|
632
|
+
this.lastVersion = version;
|
|
633
|
+
this.detectionDiagnostic = undefined;
|
|
634
|
+
this.detectionFailure = undefined;
|
|
635
|
+
return { installed: true, version, command };
|
|
636
|
+
}
|
|
637
|
+
const failure = summarizeCliFailure(this.profile.displayName, output);
|
|
638
|
+
if (failure !== undefined)
|
|
639
|
+
this.detectionDiagnostic = failure;
|
|
640
|
+
this.detectionFailure = probeFailure(result, isAbsolute(command)) ?? (runtime === undefined ? undefined : 'launch');
|
|
641
|
+
// CodeBuddy 的 PATH shim 可能在 GUI 环境中不在当前 PATH,失败后只对非内置产品做一次登录 Shell 查找。
|
|
642
|
+
if (!this.profile.bundledInApp && !isAbsolute(command)) {
|
|
643
|
+
const resolved = await resolveCommandPath(command, this.runSpawnSync);
|
|
644
|
+
if (resolved !== null && resolved !== command)
|
|
645
|
+
return this.detectCommand(resolved);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
catch (error) {
|
|
649
|
+
// 继续尝试下一个官方候选;错误只保留脱敏诊断。
|
|
650
|
+
if (error.code !== 'ENOENT')
|
|
651
|
+
this.detectionFailure = 'launch';
|
|
652
|
+
}
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
runtimeEnvironment(command) {
|
|
656
|
+
const env = { ...commandEnvironment(command), ...this.environment, ...(this.profile.environmentOverrides ?? {}) };
|
|
657
|
+
if (this.profile.adapterId === CODEBUDDY_PROFILE.adapterId) {
|
|
658
|
+
const region = detectCodeBuddyRegion(env);
|
|
659
|
+
if (region === 'cn') {
|
|
660
|
+
env.CODEBUDDY_INTERNET_ENVIRONMENT = 'internal';
|
|
661
|
+
env.CODEBUDDY_COPILOT_INTERNET_ENVIRONMENT = 'internal';
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
delete env.CODEBUDDY_INTERNET_ENVIRONMENT;
|
|
665
|
+
delete env.CODEBUDDY_COPILOT_INTERNET_ENVIRONMENT;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
const authenticationHome = resolveAuthenticationHome(this.profile, this.platform, env);
|
|
669
|
+
if (authenticationHome !== undefined) {
|
|
670
|
+
env.HOME = authenticationHome;
|
|
671
|
+
if (this.platform === 'win32')
|
|
672
|
+
env.USERPROFILE = authenticationHome;
|
|
673
|
+
}
|
|
674
|
+
for (const variable of this.profile.configRootEnvVars)
|
|
675
|
+
env[variable] = this.configRoot;
|
|
676
|
+
return WINDOWS ? commandEnvironment(command, env) : env;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
/** WorkBuddy 只允许应用内置 codebuddy,不会误启动 PATH 上的 CodeBuddy。 */
|
|
680
|
+
export class WorkBuddyCliDriver extends CodeBuddyCliDriver {
|
|
681
|
+
constructor(options = {}) {
|
|
682
|
+
super({ ...options, profile: WORKBUDDY_PROFILE });
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/** 旧版 CN 类名兼容导出;CN/国际版现在统一使用 codebuddy 适配器。 */
|
|
686
|
+
export class CodeBuddyCnCliDriver extends CodeBuddyCliDriver {
|
|
687
|
+
constructor(options = {}) {
|
|
688
|
+
super(options);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
export { CodeBuddyCliDriver as CodeBuddyDriver, CodeBuddyCnCliDriver as CodeBuddyCnDriver };
|
|
692
|
+
function sidecarSignalOptions(signal, killOnAbort) {
|
|
693
|
+
return {
|
|
694
|
+
...(signal === undefined ? {} : { signal }),
|
|
695
|
+
...(killOnAbort === undefined ? {} : { killOnAbort }),
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
/** WorkBuddy sidecar 的逐行 JSON-RPC 控制客户端;socket 本身已由桌面应用设为 0700。 */
|
|
699
|
+
class WorkBuddySidecarClient {
|
|
700
|
+
socketPath;
|
|
701
|
+
closed = false;
|
|
702
|
+
nextId = 1;
|
|
703
|
+
constructor(socketPath) {
|
|
704
|
+
this.socketPath = socketPath;
|
|
705
|
+
}
|
|
706
|
+
async request(method, params = {}, options = {}) {
|
|
707
|
+
if (this.closed)
|
|
708
|
+
throw new Error('WorkBuddy sidecar 已关闭');
|
|
709
|
+
const id = this.nextId++;
|
|
710
|
+
return await new Promise((resolve, reject) => {
|
|
711
|
+
const socket = createConnection(this.socketPath);
|
|
712
|
+
let buffer = '';
|
|
713
|
+
let settled = false;
|
|
714
|
+
const timeout = setTimeout(() => finish(new Error(`WorkBuddy sidecar 请求超时:${method}`)), options.timeoutMs ?? 30_000);
|
|
715
|
+
timeout.unref?.();
|
|
716
|
+
const abort = () => finish(new Error('WorkBuddy sidecar 请求已取消'));
|
|
717
|
+
const finish = (error, value) => {
|
|
718
|
+
if (settled)
|
|
719
|
+
return;
|
|
720
|
+
settled = true;
|
|
721
|
+
clearTimeout(timeout);
|
|
722
|
+
options.signal?.removeEventListener('abort', abort);
|
|
723
|
+
socket.destroy();
|
|
724
|
+
if (error === undefined)
|
|
725
|
+
resolve(value);
|
|
726
|
+
else
|
|
727
|
+
reject(error);
|
|
728
|
+
};
|
|
729
|
+
const onLine = (line) => {
|
|
730
|
+
if (line.trim() === '')
|
|
731
|
+
return;
|
|
732
|
+
let message;
|
|
733
|
+
try {
|
|
734
|
+
message = JSON.parse(line);
|
|
735
|
+
}
|
|
736
|
+
catch {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
if (message.id !== id)
|
|
740
|
+
return;
|
|
741
|
+
if (message.error !== undefined) {
|
|
742
|
+
finish(new JsonRpcRequestError(message.error.code, message.error.data, message.error.message ?? 'WorkBuddy sidecar 请求失败'));
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
finish(undefined, message.result);
|
|
746
|
+
};
|
|
747
|
+
socket.on('connect', () => {
|
|
748
|
+
socket.write(`${JSON.stringify({ jsonrpc: '2.0', id, method, params })}\n`);
|
|
749
|
+
});
|
|
750
|
+
socket.on('data', (chunk) => {
|
|
751
|
+
buffer += chunk.toString();
|
|
752
|
+
let index = buffer.indexOf('\n');
|
|
753
|
+
while (index >= 0) {
|
|
754
|
+
const line = buffer.slice(0, index);
|
|
755
|
+
buffer = buffer.slice(index + 1);
|
|
756
|
+
onLine(line);
|
|
757
|
+
index = buffer.indexOf('\n');
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
socket.once('error', (error) => finish(new Error(`WorkBuddy sidecar 连接失败:${error.message}`)));
|
|
761
|
+
socket.once('close', () => finish(new Error('WorkBuddy sidecar 连接已关闭')));
|
|
762
|
+
options.signal?.addEventListener('abort', abort, { once: true });
|
|
763
|
+
if (options.signal?.aborted)
|
|
764
|
+
abort();
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
dispose() {
|
|
768
|
+
this.closed = true;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
/** WorkBuddy ACP 的 streamable HTTP 客户端。每个 POST 响应都是一段 SSE 消息流。 */
|
|
772
|
+
class WorkBuddyHttpAcpClient {
|
|
773
|
+
endpoint;
|
|
774
|
+
connectionId = '';
|
|
775
|
+
sessionToken = '';
|
|
776
|
+
nextId = 1;
|
|
777
|
+
closed = false;
|
|
778
|
+
activeControllers = new Set();
|
|
779
|
+
responseReleases = new WeakMap();
|
|
780
|
+
serverRequestHandler;
|
|
781
|
+
constructor(endpoint) {
|
|
782
|
+
this.endpoint = endpoint;
|
|
783
|
+
}
|
|
784
|
+
async connect(signal) {
|
|
785
|
+
const response = await fetch(`${this.endpoint}/connect`, {
|
|
786
|
+
method: 'POST',
|
|
787
|
+
headers: { accept: 'application/json', 'x-codebuddy-request': '1' },
|
|
788
|
+
...(signal === undefined ? {} : { signal }),
|
|
789
|
+
});
|
|
790
|
+
if (!response.ok)
|
|
791
|
+
throw new Error(`WorkBuddy ACP 连接失败(HTTP ${response.status})`);
|
|
792
|
+
const value = await response.json();
|
|
793
|
+
const connectionId = typeof value.connectionId === 'string' ? value.connectionId : '';
|
|
794
|
+
if (connectionId === '')
|
|
795
|
+
throw new Error('WorkBuddy ACP 未返回连接标识');
|
|
796
|
+
this.connectionId = connectionId;
|
|
797
|
+
this.sessionToken = typeof value.sessionToken === 'string' ? value.sessionToken : '';
|
|
798
|
+
}
|
|
799
|
+
async request(method, params = {}, options = {}) {
|
|
800
|
+
const stream = this.streamRequest(method, params, options.signal, options.killOnAbort);
|
|
801
|
+
let item = await stream.next();
|
|
802
|
+
while (!item.done)
|
|
803
|
+
item = await stream.next();
|
|
804
|
+
return item.value;
|
|
805
|
+
}
|
|
806
|
+
async notify(method, params = {}, signal) {
|
|
807
|
+
const response = await this.post({ jsonrpc: '2.0', method, params }, signal);
|
|
808
|
+
try {
|
|
809
|
+
// JSON-RPC 通知仍可能返回 `:ok` 或一段 SSE;必须消费响应体,
|
|
810
|
+
// 否则 undici 会保留连接,下一轮结束时留下悬挂 socket。
|
|
811
|
+
for await (const _message of readAcpSseMessages(response)) { /* 只排空通知响应。 */ }
|
|
812
|
+
}
|
|
813
|
+
finally {
|
|
814
|
+
this.releaseResponse(response);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
setServerRequestHandler(handler) {
|
|
818
|
+
this.serverRequestHandler = handler;
|
|
819
|
+
}
|
|
820
|
+
async *streamRequest(method, params = {}, signal, _killOnAbort = true) {
|
|
821
|
+
const id = this.nextId++;
|
|
822
|
+
const response = await this.post({ jsonrpc: '2.0', id, method, params }, signal);
|
|
823
|
+
try {
|
|
824
|
+
let final;
|
|
825
|
+
for await (const message of readAcpSseMessages(response)) {
|
|
826
|
+
if (message.id === id) {
|
|
827
|
+
final = message;
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
if (typeof message.method === 'string' && message.id !== undefined && message.id !== null) {
|
|
831
|
+
const handled = this.serverRequestHandler?.(message) === true;
|
|
832
|
+
if (!handled) {
|
|
833
|
+
const result = message.method === 'elicitation/create'
|
|
834
|
+
? { action: 'cancel' }
|
|
835
|
+
: { outcome: { outcome: 'cancelled' } };
|
|
836
|
+
void this.respond(message.id, result, signal);
|
|
837
|
+
}
|
|
838
|
+
if (handled)
|
|
839
|
+
yield message;
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
yield message;
|
|
843
|
+
}
|
|
844
|
+
if (final === undefined)
|
|
845
|
+
throw new Error(`WorkBuddy ACP 未返回 ${method} 的响应`);
|
|
846
|
+
if (final.error !== undefined) {
|
|
847
|
+
throw new JsonRpcRequestError(final.error.code, final.error.data, final.error.message ?? 'WorkBuddy ACP 请求失败');
|
|
848
|
+
}
|
|
849
|
+
return final.result;
|
|
850
|
+
}
|
|
851
|
+
finally {
|
|
852
|
+
this.releaseResponse(response);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
async dispose() {
|
|
856
|
+
if (this.closed)
|
|
857
|
+
return;
|
|
858
|
+
this.closed = true;
|
|
859
|
+
for (const controller of this.activeControllers)
|
|
860
|
+
controller.abort();
|
|
861
|
+
this.activeControllers.clear();
|
|
862
|
+
if (this.connectionId === '')
|
|
863
|
+
return;
|
|
864
|
+
try {
|
|
865
|
+
await fetch(this.endpoint, {
|
|
866
|
+
method: 'DELETE',
|
|
867
|
+
headers: this.headers(),
|
|
868
|
+
signal: AbortSignal.timeout(2_000),
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
catch {
|
|
872
|
+
// sidecar.session.kill 负责最终清理;HTTP DELETE 失败不应掩盖本轮结果。
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
async respond(id, result, signal) {
|
|
876
|
+
try {
|
|
877
|
+
const response = await this.post({ jsonrpc: '2.0', id, result }, signal);
|
|
878
|
+
try {
|
|
879
|
+
for await (const _message of readAcpSseMessages(response)) { /* 排空响应后再释放请求控制器。 */ }
|
|
880
|
+
}
|
|
881
|
+
finally {
|
|
882
|
+
this.releaseResponse(response);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
catch { /* 取消态无需再上抛 */ }
|
|
886
|
+
}
|
|
887
|
+
async post(body, signal) {
|
|
888
|
+
if (this.closed)
|
|
889
|
+
throw new Error('WorkBuddy ACP 已关闭');
|
|
890
|
+
const controller = new AbortController();
|
|
891
|
+
this.activeControllers.add(controller);
|
|
892
|
+
const onAbort = () => controller.abort();
|
|
893
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
894
|
+
try {
|
|
895
|
+
const response = await fetch(this.endpoint, {
|
|
896
|
+
method: 'POST',
|
|
897
|
+
headers: { ...this.headers(), accept: 'application/json, text/event-stream', 'content-type': 'application/json', 'x-codebuddy-request': '1' },
|
|
898
|
+
body: JSON.stringify(body),
|
|
899
|
+
signal: controller.signal,
|
|
900
|
+
});
|
|
901
|
+
if (!response.ok) {
|
|
902
|
+
this.activeControllers.delete(controller);
|
|
903
|
+
throw new Error(`WorkBuddy ACP 请求失败(HTTP ${response.status})`);
|
|
904
|
+
}
|
|
905
|
+
this.responseReleases.set(response, () => {
|
|
906
|
+
signal?.removeEventListener('abort', onAbort);
|
|
907
|
+
this.activeControllers.delete(controller);
|
|
908
|
+
});
|
|
909
|
+
return response;
|
|
910
|
+
}
|
|
911
|
+
catch (error) {
|
|
912
|
+
signal?.removeEventListener('abort', onAbort);
|
|
913
|
+
this.activeControllers.delete(controller);
|
|
914
|
+
throw error;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
releaseResponse(response) {
|
|
918
|
+
this.responseReleases.get(response)?.();
|
|
919
|
+
this.responseReleases.delete(response);
|
|
920
|
+
}
|
|
921
|
+
headers() {
|
|
922
|
+
return {
|
|
923
|
+
'acp-connection-id': this.connectionId,
|
|
924
|
+
...(this.sessionToken === '' ? {} : { 'acp-session-token': this.sessionToken }),
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
async function* readAcpSseMessages(response) {
|
|
929
|
+
const contentType = response.headers.get('content-type')?.toLowerCase() ?? '';
|
|
930
|
+
if (!contentType.includes('text/event-stream')) {
|
|
931
|
+
const text = await response.text();
|
|
932
|
+
if (text.trim() !== '') {
|
|
933
|
+
try {
|
|
934
|
+
const value = JSON.parse(text);
|
|
935
|
+
yield value;
|
|
936
|
+
}
|
|
937
|
+
catch { /* 非 JSON 的 :ok 响应没有协议消息。 */ }
|
|
938
|
+
}
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
const body = response.body;
|
|
942
|
+
if (body === null)
|
|
943
|
+
return;
|
|
944
|
+
const reader = body.getReader();
|
|
945
|
+
const decoder = new TextDecoder();
|
|
946
|
+
let buffer = '';
|
|
947
|
+
let dataLines = [];
|
|
948
|
+
const emit = async function* () {
|
|
949
|
+
if (dataLines.length === 0)
|
|
950
|
+
return;
|
|
951
|
+
const data = dataLines.join('\n');
|
|
952
|
+
dataLines = [];
|
|
953
|
+
if (data.trim() === '')
|
|
954
|
+
return;
|
|
955
|
+
try {
|
|
956
|
+
const value = JSON.parse(data);
|
|
957
|
+
yield value;
|
|
958
|
+
}
|
|
959
|
+
catch { /* 忽略 SSE 心跳或厂商非 JSON 扩展。 */ }
|
|
960
|
+
};
|
|
961
|
+
while (true) {
|
|
962
|
+
const chunk = await reader.read();
|
|
963
|
+
buffer += decoder.decode(chunk.value ?? new Uint8Array(), { stream: !chunk.done });
|
|
964
|
+
let newline = buffer.indexOf('\n');
|
|
965
|
+
while (newline >= 0) {
|
|
966
|
+
const line = buffer.slice(0, newline).replace(/\r$/u, '');
|
|
967
|
+
buffer = buffer.slice(newline + 1);
|
|
968
|
+
if (line === '') {
|
|
969
|
+
for await (const message of emit())
|
|
970
|
+
yield message;
|
|
971
|
+
}
|
|
972
|
+
else if (line.startsWith('data:')) {
|
|
973
|
+
dataLines.push(line.slice(5).trimStart());
|
|
974
|
+
}
|
|
975
|
+
newline = buffer.indexOf('\n');
|
|
976
|
+
}
|
|
977
|
+
if (chunk.done)
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
if (dataLines.length > 0)
|
|
981
|
+
for await (const message of emit())
|
|
982
|
+
yield message;
|
|
983
|
+
}
|
|
984
|
+
function discoverWorkBuddySidecarSocket(configRoot, platform, environment) {
|
|
985
|
+
const explicit = environment.WORKBUDDY_SIDECAR_SOCKET?.trim();
|
|
986
|
+
if (explicit)
|
|
987
|
+
return explicit;
|
|
988
|
+
const uid = typeof process.getuid === 'function' ? String(process.getuid()) : 'unknown';
|
|
989
|
+
const runtimeRoot = platform === 'win32'
|
|
990
|
+
? join(tmpdir(), 'wb', sha1Token(configRoot, 12))
|
|
991
|
+
: join(environment.TMPDIR?.trim() || tmpdir(), `wb-${sha1Token(uid, 6)}`, sha1Token(configRoot, 12));
|
|
992
|
+
const pidPath = join(runtimeRoot, 'sidecar.pid');
|
|
993
|
+
try {
|
|
994
|
+
const record = JSON.parse(readFileSync(pidPath, 'utf8'));
|
|
995
|
+
if (typeof record.controlPipeUuid !== 'string' || !/^[a-f0-9]+$/u.test(record.controlPipeUuid))
|
|
996
|
+
throw new Error('invalid sidecar pid record');
|
|
997
|
+
if (platform === 'win32')
|
|
998
|
+
return `\\\\.\\pipe\\workbuddy-${sha1Token(configRoot, 12)}-sidecar-control-${record.controlPipeUuid}`;
|
|
999
|
+
const socket = join(runtimeRoot, `sidecar-${record.controlPipeUuid}.sock`);
|
|
1000
|
+
try {
|
|
1001
|
+
statSync(socket);
|
|
1002
|
+
return socket;
|
|
1003
|
+
}
|
|
1004
|
+
catch {
|
|
1005
|
+
throw new Error('sidecar socket missing');
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
catch {
|
|
1009
|
+
// 5.7.3 的 sidecar 先监听带随机 UUID 的 socket,再写 sidecar.pid。
|
|
1010
|
+
// PID 文件可能因异常退出或文件清理丢失,但存活 sidecar 仍可被复用;
|
|
1011
|
+
// 只扫描严格匹配的 control socket,避免把会话 data socket 当成控制端点。
|
|
1012
|
+
if (platform === 'win32') {
|
|
1013
|
+
// Windows 没有 Unix socket 文件;PID 文件迟到或缺失时,按配置根
|
|
1014
|
+
// 严格匹配桌面应用的控制管道,不能选中 session 的 data 管道。
|
|
1015
|
+
const prefix = `workbuddy-${sha1Token(configRoot, 12)}-sidecar-control-`;
|
|
1016
|
+
try {
|
|
1017
|
+
const pipe = readdirSync('\\\\.\\pipe\\').find((name) => name.startsWith(prefix) && /^[a-f0-9]+$/u.test(name.slice(prefix.length)));
|
|
1018
|
+
return pipe === undefined ? null : `\\\\.\\pipe\\${pipe}`;
|
|
1019
|
+
}
|
|
1020
|
+
catch {
|
|
1021
|
+
return null;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
try {
|
|
1025
|
+
const candidates = readdirSync(runtimeRoot, { withFileTypes: true })
|
|
1026
|
+
.filter((entry) => (entry.isFile() || entry.isSocket()) && /^sidecar-[a-f0-9]+\.sock$/u.test(entry.name))
|
|
1027
|
+
.flatMap((entry) => {
|
|
1028
|
+
const socket = join(runtimeRoot, entry.name);
|
|
1029
|
+
try {
|
|
1030
|
+
return [{ socket, modifiedAt: statSync(socket).mtimeMs }];
|
|
1031
|
+
}
|
|
1032
|
+
catch {
|
|
1033
|
+
return [];
|
|
1034
|
+
}
|
|
1035
|
+
})
|
|
1036
|
+
.sort((left, right) => right.modifiedAt - left.modifiedAt);
|
|
1037
|
+
return candidates[0]?.socket ?? null;
|
|
1038
|
+
}
|
|
1039
|
+
catch {
|
|
1040
|
+
return null;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
async function resolveWorkBuddyAcpEndpoint(sidecar, input, launch, cliCommand, configRoot, baseEnvironment, platform, environment, onCreated) {
|
|
1045
|
+
// 桌面 host 可能禁用历史保存;复用它会使下一轮 probe/load 失败。
|
|
1046
|
+
// 通过已认证 sidecar 创建独立且可持久化的运行时,每轮结束后回收。
|
|
1047
|
+
const sessionId = `agent-door-${input.sessionId}-${randomUUID()}`;
|
|
1048
|
+
const created = await sidecar.request('session.create', {
|
|
1049
|
+
sessionId,
|
|
1050
|
+
command: launch.command,
|
|
1051
|
+
args: launch.args,
|
|
1052
|
+
cwd: input.cwd ?? process.cwd(),
|
|
1053
|
+
port: 0,
|
|
1054
|
+
env: workBuddySidecarEnvironment(baseEnvironment, configRoot, launch.command, cliCommand, platform, environment),
|
|
1055
|
+
}, { timeoutMs: 195_000 });
|
|
1056
|
+
// session.create 已经启动了独立 runtime;即使响应缺少 ACP 地址也必须登记,
|
|
1057
|
+
// 这样调用方的 finally 才能发送 session.kill,避免失败路径遗留进程。
|
|
1058
|
+
onCreated(sessionId);
|
|
1059
|
+
const endpoint = isRecord(created) && typeof created.acpEndpoint === 'string' ? created.acpEndpoint.trim() : '';
|
|
1060
|
+
if (endpoint === '')
|
|
1061
|
+
throw new Error('WorkBuddy sidecar 未返回 ACP 地址');
|
|
1062
|
+
return endpoint;
|
|
1063
|
+
}
|
|
1064
|
+
function sha1Token(value, length) {
|
|
1065
|
+
return createHash('sha1').update(value).digest('hex').slice(0, length);
|
|
1066
|
+
}
|
|
1067
|
+
/** 直接启动同安装 Electron;认证初始化与 CLI 均在该子进程内执行。 */
|
|
1068
|
+
function workBuddyDirectLaunchSpec(cliCommand, electronOverride, configRoot, platform, environment) {
|
|
1069
|
+
const appRoot = platform === 'darwin' ? cliCommand.match(/^(.*\.app)\/Contents\/Resources\//u)?.[1] : undefined;
|
|
1070
|
+
const electron = platform === 'win32'
|
|
1071
|
+
? workBuddyWindowsRuntime(cliCommand, electronOverride, environment)
|
|
1072
|
+
: electronOverride || environment.WORKBUDDY_ELECTRON_PATH?.trim() || (appRoot === undefined ? undefined : join(appRoot, 'Contents/MacOS/Electron'));
|
|
1073
|
+
if (electron === undefined)
|
|
1074
|
+
return { command: cliCommand, args: ['--acp'], env: environment };
|
|
1075
|
+
const dist = join(dirname(dirname(cliCommand)), 'dist');
|
|
1076
|
+
const isFile = (path) => { try {
|
|
1077
|
+
return statSync(path).isFile();
|
|
1078
|
+
}
|
|
1079
|
+
catch {
|
|
1080
|
+
return false;
|
|
1081
|
+
} };
|
|
1082
|
+
// 5.9.3 的 full/headless 与桌面使用的 lite 可能携带不同认证协议。
|
|
1083
|
+
// 优先选择桌面随包提供的 WorkBuddy 专用入口,缺少时才沿用完整 ACP。
|
|
1084
|
+
const useLite = isFile(join(dist, 'codebuddy-lite-wb.mjs'));
|
|
1085
|
+
const snapshot = join(configRoot, 'cache/acc-product-config-v3.json');
|
|
1086
|
+
const productConfig = ['ACC_PRODUCT_CONFIG_PATH', 'ACC_PRODUCT_CONFIG_V3', 'ACC_PRODUCT_CONFIG_V2', 'ACC_PRODUCT_CONFIG']
|
|
1087
|
+
.some((name) => environment[name] !== undefined);
|
|
1088
|
+
return {
|
|
1089
|
+
command: electron,
|
|
1090
|
+
args: [
|
|
1091
|
+
'--eval', `${WORKBUDDY_CREDENTIAL_PRELOAD}\nrequire(process.argv[1]);`, cliCommand,
|
|
1092
|
+
'--acp', '--setting-sources', 'user', '--strict-mcp-config',
|
|
1093
|
+
...(useLite ? ['--serve', '--host', '127.0.0.1', '--port', '0', '--auth', 'password'] : []),
|
|
1094
|
+
],
|
|
1095
|
+
shell: false,
|
|
1096
|
+
env: {
|
|
1097
|
+
...environment,
|
|
1098
|
+
ELECTRON_RUN_AS_NODE: '1',
|
|
1099
|
+
WORKBUDDY_CONFIG_DIR: configRoot,
|
|
1100
|
+
CODEBUDDY_CONFIG_DIR: configRoot,
|
|
1101
|
+
...(!productConfig && isFile(snapshot) ? { ACC_PRODUCT_CONFIG_PATH: snapshot } : {}),
|
|
1102
|
+
...(useLite ? {
|
|
1103
|
+
CODEBUDDY_FORCE_LITE_WB_BUNDLE: '1',
|
|
1104
|
+
CODEBUDDY_GATEWAY_AUTH: 'password',
|
|
1105
|
+
CODEBUDDY_GATEWAY_PASSWORD: randomUUID(),
|
|
1106
|
+
CODEBUDDY_GATEWAY_BASE_PATH: '',
|
|
1107
|
+
} : {}),
|
|
1108
|
+
},
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
function workBuddyLaunchSpec(cliCommand, electronOverride, platform, environment) {
|
|
1112
|
+
// 不传 --no-session-persistence:下一轮由新的进程 session/load 原始历史。
|
|
1113
|
+
const cliPath = cliCommand;
|
|
1114
|
+
if (platform === 'darwin') {
|
|
1115
|
+
const appRoot = cliPath.match(/^(.*\.app)\/Contents\/Resources\//u)?.[1];
|
|
1116
|
+
const electron = electronOverride
|
|
1117
|
+
|| (appRoot === undefined ? undefined : join(appRoot, 'Contents/MacOS/Electron'))
|
|
1118
|
+
|| '/Applications/WorkBuddy.app/Contents/MacOS/Electron';
|
|
1119
|
+
return {
|
|
1120
|
+
command: electron,
|
|
1121
|
+
args: [cliPath, '--serve', '--setting-sources', 'user', '--strict-mcp-config'],
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
const electron = workBuddyWindowsRuntime(cliPath, electronOverride, environment);
|
|
1125
|
+
return {
|
|
1126
|
+
command: electron ?? cliPath,
|
|
1127
|
+
args: [...(electron === undefined ? [] : [cliPath]), '--serve', '--setting-sources', 'user', '--strict-mcp-config'],
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
/** 只将应用内置脚本交给同一安装的 Electron;exe/cmd 入口仍直接执行。 */
|
|
1131
|
+
function workBuddyWindowsRuntime(cliPath, electronOverride, environment) {
|
|
1132
|
+
if (/\.(?:exe|com|cmd|bat)$/iu.test(cliPath))
|
|
1133
|
+
return undefined;
|
|
1134
|
+
const explicit = electronOverride || environment.WORKBUDDY_ELECTRON_PATH?.trim();
|
|
1135
|
+
if (explicit)
|
|
1136
|
+
return explicit;
|
|
1137
|
+
const root = cliPath.match(/^(.*)[\\/]resources[\\/]app\.asar\.unpacked[\\/]cli[\\/]bin[\\/]codebuddy$/iu)?.[1];
|
|
1138
|
+
return root === undefined ? undefined : win32.join(root, 'WorkBuddy.exe');
|
|
1139
|
+
}
|
|
1140
|
+
function workBuddySidecarEnvironment(base, configRoot, launchCommand, cliCommand, platform, environment) {
|
|
1141
|
+
const appRoot = platform === 'darwin'
|
|
1142
|
+
? launchCommand.match(/^(.*\.app)\/Contents\/MacOS\/Electron$/u)?.[1]
|
|
1143
|
+
: undefined;
|
|
1144
|
+
const appPath = base.WORKBUDDY_APP_PATH || (platform === 'win32'
|
|
1145
|
+
? win32.join(cliCommand.match(/^(.*)[\\/]resources[\\/]app\.asar\.unpacked[\\/]cli[\\/]bin[\\/]/iu)?.[1] ?? win32.dirname(launchCommand), 'resources/app.asar')
|
|
1146
|
+
: appRoot === undefined ? '/Applications/WorkBuddy.app/Contents/Resources/app.asar' : join(appRoot, 'Contents/Resources/app.asar'));
|
|
1147
|
+
const resourcesPath = base.WORKBUDDY_RESOURCES_PATH || (platform === 'win32' ? win32.dirname(appPath) : dirname(appPath));
|
|
1148
|
+
const env = {
|
|
1149
|
+
...base,
|
|
1150
|
+
ELECTRON_RUN_AS_NODE: '1',
|
|
1151
|
+
WORKBUDDY_IS_PACKAGED: '1',
|
|
1152
|
+
WORKBUDDY_APP_PATH: base.WORKBUDDY_APP_PATH || appPath,
|
|
1153
|
+
WORKBUDDY_CONFIG_DIR: configRoot,
|
|
1154
|
+
CODEBUDDY_CONFIG_DIR: configRoot,
|
|
1155
|
+
WORKBUDDY_DATA_FOLDER_NAME: '.workbuddy',
|
|
1156
|
+
WORKBUDDY_APP_NAME: 'WorkBuddy',
|
|
1157
|
+
WORKBUDDY_APPLICATION_NAME: 'WorkBuddy',
|
|
1158
|
+
WORKBUDDY_PRODUCT_NAME: 'WorkBuddy',
|
|
1159
|
+
WORKBUDDY_RESOURCES_PATH: resourcesPath,
|
|
1160
|
+
WORKBUDDY_USER_DATA_DIR: base.WORKBUDDY_USER_DATA_DIR || join(configRoot, 'app'),
|
|
1161
|
+
WORKBUDDY_NODE_ENV: 'production',
|
|
1162
|
+
ACC_PRODUCT_CONFIG_PATH: base.ACC_PRODUCT_CONFIG_PATH || join(configRoot, 'cache/acc-product-config-v3.json'),
|
|
1163
|
+
CODEBUDDY_DISABLE_IDE: '1',
|
|
1164
|
+
CODEBUDDY_FORCE_HEADLESS_BUNDLE: '1',
|
|
1165
|
+
CODEBUDDY_GATEWAY_AUTH: base.CODEBUDDY_GATEWAY_AUTH || 'password',
|
|
1166
|
+
CODEBUDDY_GATEWAY_PASSWORD: base.CODEBUDDY_GATEWAY_PASSWORD || randomUUID(),
|
|
1167
|
+
CODEBUDDY_HOST: base.CODEBUDDY_HOST || 'workbuddy-desktop',
|
|
1168
|
+
CODEBUDDY_INTERNET_ENVIRONMENT: base.CODEBUDDY_INTERNET_ENVIRONMENT || 'internal',
|
|
1169
|
+
CODEBUDDY_COPILOT_INTERNET_ENVIRONMENT: base.CODEBUDDY_COPILOT_INTERNET_ENVIRONMENT || 'internal',
|
|
1170
|
+
SERVER__PORT: '0',
|
|
1171
|
+
SERVER__HOST: '127.0.0.1',
|
|
1172
|
+
...(environment.WORKBUDDY_EXTRA_PATHS === undefined ? {} : { WORKBUDDY_EXTRA_PATHS: environment.WORKBUDDY_EXTRA_PATHS }),
|
|
1173
|
+
};
|
|
1174
|
+
return env;
|
|
1175
|
+
}
|
|
1176
|
+
function resolveConfigRoot(profile, explicit, environment) {
|
|
1177
|
+
const lookupEnvVars = profile.configRootLookupEnvVars ?? profile.configRootEnvVars;
|
|
1178
|
+
const candidate = explicit?.trim()
|
|
1179
|
+
|| lookupEnvVars.map((name) => environment[name]?.trim()).find((value) => Boolean(value))
|
|
1180
|
+
|| profile.defaultConfigRoot;
|
|
1181
|
+
return candidate;
|
|
1182
|
+
}
|
|
1183
|
+
function bundledWorkBuddyCommands(platform, environment) {
|
|
1184
|
+
if (platform === 'darwin') {
|
|
1185
|
+
const roots = [
|
|
1186
|
+
'/Applications/WorkBuddy AI.app',
|
|
1187
|
+
'/Applications/WorkBuddy.app',
|
|
1188
|
+
join(homedir(), 'Applications/WorkBuddy AI.app'),
|
|
1189
|
+
join(homedir(), 'Applications/WorkBuddy.app'),
|
|
1190
|
+
];
|
|
1191
|
+
return roots.map((root) => join(root, 'Contents/Resources/app.asar.unpacked/cli/bin/codebuddy'));
|
|
1192
|
+
}
|
|
1193
|
+
if (platform === 'win32') {
|
|
1194
|
+
const local = environment.LOCALAPPDATA ?? join(homedir(), 'AppData/Local');
|
|
1195
|
+
const programFiles = environment.PROGRAMFILES ?? 'C:\\Program Files';
|
|
1196
|
+
const roots = [
|
|
1197
|
+
join(local, 'Programs/WorkBuddy AI'),
|
|
1198
|
+
join(local, 'Programs/WorkBuddy'),
|
|
1199
|
+
join(programFiles, 'WorkBuddy AI'),
|
|
1200
|
+
join(programFiles, 'WorkBuddy'),
|
|
1201
|
+
];
|
|
1202
|
+
return roots.flatMap((root) => [
|
|
1203
|
+
join(root, 'resources/app.asar.unpacked/cli/bin/codebuddy.exe'),
|
|
1204
|
+
join(root, 'resources/app.asar.unpacked/cli/bin/codebuddy.cmd'),
|
|
1205
|
+
join(root, 'resources/app.asar.unpacked/cli/bin/codebuddy'),
|
|
1206
|
+
]);
|
|
1207
|
+
}
|
|
1208
|
+
return [];
|
|
1209
|
+
}
|
|
1210
|
+
function uniqueCommands(commands) {
|
|
1211
|
+
return [...new Set(commands.filter((command) => command.trim().length > 0))];
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* 官方认证文件不按 CODEBUDDY_CONFIG_DIR 分片,而是按 HOME 下的
|
|
1215
|
+
* CodeBuddyExtension/Data/Public 分片。若全局文件正好属于当前区域,复用它
|
|
1216
|
+
* 保持现有登录态;若属于另一区域或不存在,切换到适配器专用 HOME。
|
|
1217
|
+
*/
|
|
1218
|
+
function resolveAuthenticationHome(profile, platform, environment) {
|
|
1219
|
+
if (profile.isolatedHome === undefined)
|
|
1220
|
+
return undefined;
|
|
1221
|
+
const adapterRegion = profile.adapterId === CODEBUDDY_PROFILE.adapterId ? detectCodeBuddyRegion(environment) : undefined;
|
|
1222
|
+
if (adapterRegion === undefined)
|
|
1223
|
+
return profile.isolatedHome;
|
|
1224
|
+
const baseHome = platform === 'win32'
|
|
1225
|
+
? environment.USERPROFILE?.trim() || environment.HOME?.trim() || homedir()
|
|
1226
|
+
: environment.HOME?.trim() || homedir();
|
|
1227
|
+
const authPath = platform === 'darwin'
|
|
1228
|
+
? join(baseHome, 'Library/Application Support/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info')
|
|
1229
|
+
: platform === 'win32'
|
|
1230
|
+
? join(baseHome, 'AppData/Local/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info')
|
|
1231
|
+
: join(baseHome, '.local/share/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info');
|
|
1232
|
+
let domain;
|
|
1233
|
+
try {
|
|
1234
|
+
const parsed = JSON.parse(readFileSync(authPath, 'utf8'));
|
|
1235
|
+
if (typeof parsed.auth?.domain === 'string')
|
|
1236
|
+
domain = parsed.auth.domain.trim().toLowerCase();
|
|
1237
|
+
}
|
|
1238
|
+
catch {
|
|
1239
|
+
// 没有全局认证文件或文件损坏时,直接使用适配器隔离目录。
|
|
1240
|
+
}
|
|
1241
|
+
const matches = adapterRegion === 'cn' ? INTERNAL_AUTH_DOMAINS.has(domain ?? '') : EXTERNAL_AUTH_DOMAINS.has(domain ?? '');
|
|
1242
|
+
if (matches)
|
|
1243
|
+
return undefined;
|
|
1244
|
+
return adapterRegion === 'cn' ? CODEBUDDY_CN_AUTH_HOME : CODEBUDDY_INTERNATIONAL_AUTH_HOME;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* 从显式环境、认证域名和产品快照推断 CodeBuddy 区域。
|
|
1248
|
+
* 官方 CLI 只有一个二进制,区域必须在启动前确定,否则模型和请求端点会串线。
|
|
1249
|
+
*/
|
|
1250
|
+
function detectCodeBuddyRegion(environment) {
|
|
1251
|
+
const configured = `${environment.CODEBUDDY_INTERNET_ENVIRONMENT ?? environment.CODEBUDDY_COPILOT_INTERNET_ENVIRONMENT ?? ''}`.trim().toLowerCase();
|
|
1252
|
+
if (configured === 'internal' || configured === 'cn' || configured === 'china' || configured === 'ioa')
|
|
1253
|
+
return 'cn';
|
|
1254
|
+
if (configured === 'external' || configured === 'international' || configured === 'overseas')
|
|
1255
|
+
return 'international';
|
|
1256
|
+
const homes = uniquePaths([
|
|
1257
|
+
environment.HOME?.trim() || homedir(),
|
|
1258
|
+
CODEBUDDY_CN_AUTH_HOME,
|
|
1259
|
+
CODEBUDDY_INTERNATIONAL_AUTH_HOME,
|
|
1260
|
+
]);
|
|
1261
|
+
for (const home of homes) {
|
|
1262
|
+
const domain = readCodeBuddyAuthDomain(home, environment);
|
|
1263
|
+
if (domain === undefined)
|
|
1264
|
+
continue;
|
|
1265
|
+
if (INTERNAL_AUTH_DOMAINS.has(domain))
|
|
1266
|
+
return 'cn';
|
|
1267
|
+
if (EXTERNAL_AUTH_DOMAINS.has(domain))
|
|
1268
|
+
return 'international';
|
|
1269
|
+
}
|
|
1270
|
+
const productConfig = environment.ACC_PRODUCT_CONFIG_PATH?.trim();
|
|
1271
|
+
if (productConfig !== undefined && productConfig !== '') {
|
|
1272
|
+
try {
|
|
1273
|
+
const value = JSON.parse(readFileSync(productConfig, 'utf8'));
|
|
1274
|
+
const endpoint = typeof value.endpoint === 'string' ? value.endpoint.toLowerCase() : '';
|
|
1275
|
+
if (endpoint.includes('codebuddy.ai'))
|
|
1276
|
+
return 'international';
|
|
1277
|
+
if (endpoint.includes('copilot.tencent.com') || endpoint.includes('codebuddy.cn'))
|
|
1278
|
+
return 'cn';
|
|
1279
|
+
}
|
|
1280
|
+
catch {
|
|
1281
|
+
// 产品快照损坏时回退到官方默认国际环境。
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
return 'international';
|
|
1285
|
+
}
|
|
1286
|
+
function readCodeBuddyAuthDomain(home, environment) {
|
|
1287
|
+
const authPath = environment.CODEBUDDY_AUTH_FILE?.trim()
|
|
1288
|
+
|| (process.platform === 'darwin'
|
|
1289
|
+
? join(home, 'Library/Application Support/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info')
|
|
1290
|
+
: process.platform === 'win32'
|
|
1291
|
+
? join(home, 'AppData/Local/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info')
|
|
1292
|
+
: join(home, '.local/share/CodeBuddyExtension/Data/Public/auth/Tencent-Cloud.coding-copilot.info'));
|
|
1293
|
+
try {
|
|
1294
|
+
const value = JSON.parse(readFileSync(authPath, 'utf8'));
|
|
1295
|
+
return typeof value.auth?.domain === 'string' ? value.auth.domain.trim().toLowerCase() : undefined;
|
|
1296
|
+
}
|
|
1297
|
+
catch {
|
|
1298
|
+
return undefined;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
function summarizeCliFailure(displayName, output) {
|
|
1302
|
+
if (/Cannot find module ['"]esbuild['"]/u.test(output)) {
|
|
1303
|
+
return `${displayName} CLI 启动失败:缺少依赖 esbuild,请重新安装 CLI`;
|
|
1304
|
+
}
|
|
1305
|
+
if (/Cannot find module/u.test(output)) {
|
|
1306
|
+
return `${displayName} CLI 启动失败:缺少 Node.js 依赖,请重新安装 CLI`;
|
|
1307
|
+
}
|
|
1308
|
+
if (output.trim().length === 0)
|
|
1309
|
+
return undefined;
|
|
1310
|
+
return `${displayName} CLI 启动失败,请检查命令输出`;
|
|
1311
|
+
}
|
|
1312
|
+
function defaultModelCatalogPaths(profile, configRoot, environment) {
|
|
1313
|
+
const region = profile.adapterId === CODEBUDDY_PROFILE.adapterId ? detectCodeBuddyRegion(environment) : undefined;
|
|
1314
|
+
const configuredNames = profile.adapterId === CODEBUDDY_PROFILE.adapterId
|
|
1315
|
+
? region === 'cn' ? ['CODEBUDDY_CN_MODEL_CATALOG', 'CODEBUDDY_MODEL_CATALOG'] : ['CODEBUDDY_MODEL_CATALOG', 'CODEBUDDY_CN_MODEL_CATALOG']
|
|
1316
|
+
: [profile.modelCatalogEnvVar ?? `${profile.adapterId.toUpperCase().replace(/[^A-Z0-9]+/gu, '_')}_MODEL_CATALOG`];
|
|
1317
|
+
const configured = configuredNames.flatMap((name) => {
|
|
1318
|
+
const value = environment[name]?.trim();
|
|
1319
|
+
return value === undefined || value === '' ? [] : [value];
|
|
1320
|
+
});
|
|
1321
|
+
const paths = [...configured];
|
|
1322
|
+
if (profile.adapterId === WORKBUDDY_PROFILE.adapterId) {
|
|
1323
|
+
const userDataRoot = join(homedir(), '.workbuddy');
|
|
1324
|
+
const configSiblingRoot = join(dirname(configRoot), '.workbuddy');
|
|
1325
|
+
// WorkBuddy 桌面端把最新云端产品快照写在 local_storage envelope 中;
|
|
1326
|
+
// cache/acc-product-config-v3.json 可能仍是旧端点的目录,必须优先读取前者。
|
|
1327
|
+
const localStorageRoots = uniquePaths([
|
|
1328
|
+
join(userDataRoot, 'local_storage'),
|
|
1329
|
+
join(configSiblingRoot, 'local_storage'),
|
|
1330
|
+
]);
|
|
1331
|
+
for (const root of localStorageRoots)
|
|
1332
|
+
paths.push(...workBuddyLocalStorageCatalogPaths(root));
|
|
1333
|
+
paths.push(join(userDataRoot, 'cache/acc-product-config-v3.json'));
|
|
1334
|
+
if (configSiblingRoot !== userDataRoot)
|
|
1335
|
+
paths.push(join(configSiblingRoot, 'cache/acc-product-config-v3.json'));
|
|
1336
|
+
}
|
|
1337
|
+
if (profile.adapterId === CODEBUDDY_PROFILE.adapterId) {
|
|
1338
|
+
if (region === 'cn')
|
|
1339
|
+
paths.push(join(configRoot, 'product.internal.json'));
|
|
1340
|
+
paths.push(join(configRoot, 'product.json'));
|
|
1341
|
+
if (region !== 'cn')
|
|
1342
|
+
paths.push(join(configRoot, 'product.internal.json'));
|
|
1343
|
+
}
|
|
1344
|
+
return [
|
|
1345
|
+
...paths,
|
|
1346
|
+
];
|
|
1347
|
+
}
|
|
1348
|
+
function defaultCatalogForProfile(profile) {
|
|
1349
|
+
if (profile.adapterId === WORKBUDDY_PROFILE.adapterId)
|
|
1350
|
+
return WORKBUDDY_DEFAULT_CATALOG;
|
|
1351
|
+
return CODEBUDDY_DEFAULT_CATALOG;
|
|
1352
|
+
}
|
|
1353
|
+
/** 从 CodeBuddy/WorkBuddy 产品快照投影主 Agent 真正可选的模型。 */
|
|
1354
|
+
function readProductCatalog(paths, readFile, command, profile, region = detectCodeBuddyRegion(process.env)) {
|
|
1355
|
+
const commandRoots = command === null ? [] : commandProductRoots(command);
|
|
1356
|
+
const commandCatalogs = commandRoots.flatMap((commandRoot) => [
|
|
1357
|
+
...(profile.adapterId === WORKBUDDY_PROFILE.adapterId
|
|
1358
|
+
? [join(commandRoot, 'product.internal.json')]
|
|
1359
|
+
: []),
|
|
1360
|
+
...(profile.adapterId === CODEBUDDY_PROFILE.adapterId && region === 'cn'
|
|
1361
|
+
? [join(commandRoot, 'product.internal.json'), join(commandRoot, 'product-ide-cn.json')]
|
|
1362
|
+
: []),
|
|
1363
|
+
join(commandRoot, 'product.json'),
|
|
1364
|
+
join(commandRoot, 'product-ide.json'),
|
|
1365
|
+
join(commandRoot, 'product.cloudhosted.json'),
|
|
1366
|
+
]);
|
|
1367
|
+
const candidates = [
|
|
1368
|
+
...paths,
|
|
1369
|
+
...commandCatalogs,
|
|
1370
|
+
];
|
|
1371
|
+
const seen = new Set();
|
|
1372
|
+
for (const path of candidates) {
|
|
1373
|
+
if (seen.has(path))
|
|
1374
|
+
continue;
|
|
1375
|
+
seen.add(path);
|
|
1376
|
+
let parsed;
|
|
1377
|
+
try {
|
|
1378
|
+
parsed = JSON.parse(String(readFile(path, 'utf8')));
|
|
1379
|
+
}
|
|
1380
|
+
catch {
|
|
1381
|
+
continue;
|
|
1382
|
+
}
|
|
1383
|
+
const catalog = parseProductCatalog(parsed, profile);
|
|
1384
|
+
if (catalog !== null)
|
|
1385
|
+
return catalog;
|
|
1386
|
+
}
|
|
1387
|
+
return null;
|
|
1388
|
+
}
|
|
1389
|
+
/** 返回 WorkBuddy 桌面端按更新时间排列的产品配置 envelope 文件。 */
|
|
1390
|
+
function workBuddyLocalStorageCatalogPaths(root) {
|
|
1391
|
+
try {
|
|
1392
|
+
return readdirSync(root, { withFileTypes: true })
|
|
1393
|
+
.filter((entry) => entry.isFile() && /^(?:wb_)?entry_[0-9a-f]+\.info$/u.test(entry.name))
|
|
1394
|
+
.map((entry) => {
|
|
1395
|
+
const path = join(root, entry.name);
|
|
1396
|
+
try {
|
|
1397
|
+
return { path, modifiedAt: statSync(path).mtimeMs };
|
|
1398
|
+
}
|
|
1399
|
+
catch {
|
|
1400
|
+
return { path, modifiedAt: 0 };
|
|
1401
|
+
}
|
|
1402
|
+
})
|
|
1403
|
+
.sort((left, right) => right.modifiedAt - left.modifiedAt)
|
|
1404
|
+
.map((entry) => entry.path);
|
|
1405
|
+
}
|
|
1406
|
+
catch {
|
|
1407
|
+
return [];
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
function uniquePaths(paths) {
|
|
1411
|
+
return [...new Set(paths)];
|
|
1412
|
+
}
|
|
1413
|
+
/** 从 CLI 入口推导官方产品包根目录,兼容 npm shim 和直接入口。 */
|
|
1414
|
+
function commandProductRoots(command) {
|
|
1415
|
+
const roots = new Set();
|
|
1416
|
+
const add = (path) => {
|
|
1417
|
+
const root = dirname(dirname(path));
|
|
1418
|
+
if (root !== '.')
|
|
1419
|
+
roots.add(root);
|
|
1420
|
+
};
|
|
1421
|
+
add(command);
|
|
1422
|
+
try {
|
|
1423
|
+
add(realpathSync(command));
|
|
1424
|
+
}
|
|
1425
|
+
catch { /* 命令可能只是 PATH 中的名称 */ }
|
|
1426
|
+
return [...roots];
|
|
1427
|
+
}
|
|
1428
|
+
function parseProductCatalog(value, profile) {
|
|
1429
|
+
const records = [];
|
|
1430
|
+
if (isRecord(value))
|
|
1431
|
+
records.push(value);
|
|
1432
|
+
else if (Array.isArray(value)) {
|
|
1433
|
+
for (const entry of value) {
|
|
1434
|
+
if (!isRecord(entry))
|
|
1435
|
+
continue;
|
|
1436
|
+
records.push(isRecord(entry.data) ? entry.data : entry);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
for (const record of records) {
|
|
1440
|
+
const catalog = parseProductCatalogRecord(record, profile);
|
|
1441
|
+
if (catalog !== null)
|
|
1442
|
+
return catalog;
|
|
1443
|
+
}
|
|
1444
|
+
return null;
|
|
1445
|
+
}
|
|
1446
|
+
function parseProductCatalogRecord(value, profile) {
|
|
1447
|
+
if (!isRecord(value) || !Array.isArray(value.models))
|
|
1448
|
+
return null;
|
|
1449
|
+
const metadata = new Map();
|
|
1450
|
+
for (const entry of value.models) {
|
|
1451
|
+
if (!isRecord(entry))
|
|
1452
|
+
continue;
|
|
1453
|
+
const id = typeof entry.id === 'string' ? entry.id.trim() : '';
|
|
1454
|
+
if (id !== '')
|
|
1455
|
+
metadata.set(id, entry);
|
|
1456
|
+
}
|
|
1457
|
+
if (metadata.size === 0)
|
|
1458
|
+
return null;
|
|
1459
|
+
const primaryAgentNames = profile.adapterId === WORKBUDDY_PROFILE.adapterId ? ['cli'] : ['craft', 'cli', 'agent', 'chat'];
|
|
1460
|
+
const configuredIds = Array.isArray(value.agents)
|
|
1461
|
+
? value.agents
|
|
1462
|
+
.filter((entry) => isRecord(entry) && typeof entry.name === 'string' && primaryAgentNames.includes(entry.name))
|
|
1463
|
+
.flatMap((entry) => isRecord(entry) && Array.isArray(entry.models) ? entry.models : [])
|
|
1464
|
+
.filter((entry) => typeof entry === 'string' && entry.trim() !== '')
|
|
1465
|
+
.map((entry) => entry.trim())
|
|
1466
|
+
: [...metadata.keys()];
|
|
1467
|
+
const configuredModelIds = [...new Set(configuredIds)].filter((id) => metadata.has(id));
|
|
1468
|
+
// WorkBuddy 的最新快照已不再把 Auto 三档写入 `agents[].models`,但全局
|
|
1469
|
+
// `models` 仍然保留它们。目录投影必须以两处数据的并集为准,否则三档会
|
|
1470
|
+
// 消失,且 `auto.reasoning.effort` 会被错误地当成普通模型思考强度。
|
|
1471
|
+
const autoTierIds = profile.adapterId === WORKBUDDY_PROFILE.adapterId
|
|
1472
|
+
? WORKBUDDY_AUTO_TIER_MODELS.filter((model) => metadata.has(model.id)).map((model) => model.id)
|
|
1473
|
+
: [];
|
|
1474
|
+
const modelIds = [...new Set([...configuredModelIds, ...autoTierIds])];
|
|
1475
|
+
if (modelIds.length === 0)
|
|
1476
|
+
return null;
|
|
1477
|
+
// 产品配置把 Auto 三档展开进 agent.models;在 AgentDoor 的目录契约中,
|
|
1478
|
+
// 它们属于默认模型的思考强度,不能继续作为三个普通模型渲染。
|
|
1479
|
+
const regularModelIds = modelIds.filter((id) => !autoTierIds.includes(id)
|
|
1480
|
+
&& !(profile.adapterId === WORKBUDDY_PROFILE.adapterId && id === WORKBUDDY_AUTO_MODEL_ID));
|
|
1481
|
+
const models = regularModelIds.map((id) => {
|
|
1482
|
+
const entry = metadata.get(id);
|
|
1483
|
+
const reasoning = isRecord(entry.reasoning) ? entry.reasoning : undefined;
|
|
1484
|
+
const supportedEfforts = reasoning !== undefined && Array.isArray(reasoning.supportedEfforts)
|
|
1485
|
+
? reasoning.supportedEfforts.filter((effort) => typeof effort === 'string' && effort.trim() !== '')
|
|
1486
|
+
: reasoning !== undefined && typeof reasoning.effort === 'string' && reasoning.effort.trim() !== ''
|
|
1487
|
+
? [reasoning.effort.trim()]
|
|
1488
|
+
: [];
|
|
1489
|
+
const name = typeof entry.name === 'string' && entry.name.trim() !== '' ? entry.name.trim() : id;
|
|
1490
|
+
const description = typeof entry.descriptionZh === 'string' && entry.descriptionZh.trim() !== ''
|
|
1491
|
+
? entry.descriptionZh.trim()
|
|
1492
|
+
: typeof entry.descriptionEn === 'string' && entry.descriptionEn.trim() !== ''
|
|
1493
|
+
? entry.descriptionEn.trim()
|
|
1494
|
+
: undefined;
|
|
1495
|
+
return {
|
|
1496
|
+
id,
|
|
1497
|
+
name: profile.adapterId === WORKBUDDY_PROFILE.adapterId ? workBuddyModelLabel(name, entry.credits) : name,
|
|
1498
|
+
...(description === undefined ? {} : { description }),
|
|
1499
|
+
efforts: [...new Set(supportedEfforts)],
|
|
1500
|
+
};
|
|
1501
|
+
});
|
|
1502
|
+
const autoTierLabels = Object.fromEntries(autoTierIds.map((id) => {
|
|
1503
|
+
const configuredName = metadata.get(id)?.name;
|
|
1504
|
+
const fallbackName = WORKBUDDY_AUTO_TIER_MODELS.find((model) => model.id === id)?.name ?? id;
|
|
1505
|
+
const name = typeof configuredName === 'string' && configuredName.trim() !== '' ? configuredName.trim() : fallbackName;
|
|
1506
|
+
return [id, workBuddyModelLabel(name, metadata.get(id)?.credits)];
|
|
1507
|
+
}));
|
|
1508
|
+
const providerDefault = {
|
|
1509
|
+
id: 'provider-default',
|
|
1510
|
+
name: `跟随 ${profile.displayName} 默认模型`,
|
|
1511
|
+
efforts: autoTierIds,
|
|
1512
|
+
...(autoTierIds.length === 0 ? {} : { effortLabels: autoTierLabels }),
|
|
1513
|
+
};
|
|
1514
|
+
return {
|
|
1515
|
+
groups: [{ id: profile.adapterId, name: profile.displayName, models: [providerDefault, ...models] }],
|
|
1516
|
+
currentModel: null,
|
|
1517
|
+
currentEffort: null,
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
/** credits 是产品快照中的展示倍率,不是 token 单价或活动折后价格。 */
|
|
1521
|
+
function workBuddyModelLabel(name, credits) {
|
|
1522
|
+
const multiplier = typeof credits === 'string' ? /^x(\d+(?:\.\d+)?)$/u.exec(credits.trim())?.[1] : undefined;
|
|
1523
|
+
return multiplier === undefined ? name : `${name} · ${multiplier}×`;
|
|
1524
|
+
}
|
|
1525
|
+
function resolveCodeBuddyModelId(profile, modelId, effortId) {
|
|
1526
|
+
if (profile.adapterId === WORKBUDDY_PROFILE.adapterId && isProviderDefaultModel(modelId) && effortId !== undefined && WORKBUDDY_AUTO_TIER_IDS.has(effortId)) {
|
|
1527
|
+
return effortId;
|
|
1528
|
+
}
|
|
1529
|
+
return modelId;
|
|
1530
|
+
}
|
|
1531
|
+
function codeBuddyMessageToChunk(message) {
|
|
1532
|
+
const params = isRecord(message.params) ? message.params : message;
|
|
1533
|
+
const update = isRecord(params.update) ? params.update : params;
|
|
1534
|
+
const method = typeof message.method === 'string' ? message.method.toLowerCase() : '';
|
|
1535
|
+
const rawType = update.sessionUpdate ?? update.type ?? method;
|
|
1536
|
+
const type = typeof rawType === 'string' ? rawType.toLowerCase() : '';
|
|
1537
|
+
const reasoning = reasoningText(update);
|
|
1538
|
+
if (reasoning !== null)
|
|
1539
|
+
return { type: 'reasoning-delta', text: reasoning };
|
|
1540
|
+
const text = acpText(update.delta ?? update.text ?? update.content ?? update.message);
|
|
1541
|
+
const content = isRecord(update.content) ? update.content : undefined;
|
|
1542
|
+
const messageId = firstToolText(update.messageId, update.message_id, update.itemId, update.item_id, content?.messageId, content?.message_id, content?.id);
|
|
1543
|
+
const withMessageId = messageId === undefined ? {} : { messageId };
|
|
1544
|
+
const permission = codeBuddyPermissionRequest(message);
|
|
1545
|
+
if (permission !== null) {
|
|
1546
|
+
return {
|
|
1547
|
+
type: 'permission-request',
|
|
1548
|
+
requestId: permission.requestId,
|
|
1549
|
+
kind: permission.kind,
|
|
1550
|
+
...(permission.toolName === undefined ? {} : { toolName: permission.toolName }),
|
|
1551
|
+
...(permission.callId === undefined ? {} : { callId: permission.callId }),
|
|
1552
|
+
...(permission.detail === undefined ? {} : { detail: permission.detail }),
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
const elicitation = readAcpElicitationRequest(message);
|
|
1556
|
+
if (elicitation !== null)
|
|
1557
|
+
return { type: 'question-request', requestId: elicitation.requestId, questions: elicitation.questions };
|
|
1558
|
+
if (type.includes('permission') || type.includes('interruption'))
|
|
1559
|
+
return null;
|
|
1560
|
+
if (type.includes('thought') || type.includes('reason'))
|
|
1561
|
+
return text ? { type: 'reasoning-delta', text, ...withMessageId } : null;
|
|
1562
|
+
if (type.includes('user') && type.includes('message'))
|
|
1563
|
+
return null;
|
|
1564
|
+
if (type.includes('agent_message') || type.includes('text') || type === 'message')
|
|
1565
|
+
return text ? { type: 'text-delta', text, ...withMessageId } : null;
|
|
1566
|
+
if (type.includes('tool') || type.includes('command')) {
|
|
1567
|
+
const tool = isToolRecord(update.toolCall) ? update.toolCall : isToolRecord(update.tool_call) ? update.tool_call : update;
|
|
1568
|
+
const toolName = firstToolText(tool.name, tool.toolName, tool.tool_name, tool.title, update.name, update.toolName, update.tool_name, update.title);
|
|
1569
|
+
const callId = firstToolText(tool.callId, tool.call_id, tool.toolCallId, tool.tool_call_id, tool.toolUseId, tool.tool_use_id, tool.id, update.toolCallId, update.tool_call_id, update.id);
|
|
1570
|
+
if (toolName === undefined && callId === undefined)
|
|
1571
|
+
return null;
|
|
1572
|
+
const input = serializeToolValue(tool.rawInput ?? tool.input ?? tool.arguments ?? tool.args ?? tool.parameters ?? update.rawInput);
|
|
1573
|
+
const output = serializeToolValue(tool.rawOutput ?? tool.output ?? tool.result ?? update.rawOutput);
|
|
1574
|
+
const error = serializeToolValue(tool.error ?? update.error);
|
|
1575
|
+
const fallback = error !== undefined || type.includes('error') || type.includes('fail')
|
|
1576
|
+
? 'failed'
|
|
1577
|
+
: output !== undefined || type.includes('result') || type.includes('complete')
|
|
1578
|
+
? 'completed'
|
|
1579
|
+
: 'running';
|
|
1580
|
+
return {
|
|
1581
|
+
type: 'tool-event',
|
|
1582
|
+
toolName: toolName ?? 'tool',
|
|
1583
|
+
...acpToolStatusFields(tool.status ?? tool.state ?? update.status, type, fallback),
|
|
1584
|
+
...(callId === undefined ? {} : { callId }),
|
|
1585
|
+
...(input === undefined ? {} : { input }),
|
|
1586
|
+
...(output === undefined ? {} : { output, outputMode: type.includes('delta') ? 'delta' : 'snapshot' }),
|
|
1587
|
+
...(error === undefined ? {} : { error }),
|
|
1588
|
+
...(firstToolText(tool.agentId, tool.agent_id, update.agentId, update.agent_id) ? { agentId: firstToolText(tool.agentId, tool.agent_id, update.agentId, update.agent_id) } : {}),
|
|
1589
|
+
...(serializeToolValue(tool.detail ?? update.detail) === undefined ? {} : { detail: serializeToolValue(tool.detail ?? update.detail) }),
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
// CodeBuddy ACP 的 usage_update 使用 used/size 表示当前上下文占用和窗口,
|
|
1593
|
+
// 这不是账户套餐余量;先按会话上下文事件解析,避免把 used 误当成输入 token。
|
|
1594
|
+
if (type.includes('usage_update')) {
|
|
1595
|
+
const usage = codeBuddyUsageChunk(update);
|
|
1596
|
+
if (usage !== null)
|
|
1597
|
+
return usage;
|
|
1598
|
+
}
|
|
1599
|
+
const usage = usageChunk(update);
|
|
1600
|
+
if (usage !== null)
|
|
1601
|
+
return usage;
|
|
1602
|
+
if (type.includes('turn_completed') || type.includes('turn_complete') || type.includes('prompt_end') || type === 'done' || type === 'result' || type === 'completed')
|
|
1603
|
+
return { type: 'finish', reason: 'stop' };
|
|
1604
|
+
if (type.includes('error') || type.includes('failed')) {
|
|
1605
|
+
const failure = readFailure(update);
|
|
1606
|
+
return { type: 'finish', reason: 'error', ...(failure === undefined ? {} : { failure }) };
|
|
1607
|
+
}
|
|
1608
|
+
return null;
|
|
1609
|
+
}
|
|
1610
|
+
/** 读取 CodeBuddy/WorkBuddy 使用的 ACP 标准权限请求。 */
|
|
1611
|
+
function codeBuddyPermissionRequest(message) {
|
|
1612
|
+
const method = typeof message.method === 'string' ? message.method.toLowerCase() : '';
|
|
1613
|
+
const params = isRecord(message.params) ? message.params : {};
|
|
1614
|
+
// 只有标准 server request 有明确的 response id;notification 扩展没有可验证
|
|
1615
|
+
// 的回传方法,不能把它伪装成可审批的 DSH 权限事件。
|
|
1616
|
+
if (method !== 'session/request_permission')
|
|
1617
|
+
return null;
|
|
1618
|
+
const requestId = message.id ?? params.requestId ?? params.request_id ?? params.id;
|
|
1619
|
+
if (typeof requestId !== 'string' && typeof requestId !== 'number')
|
|
1620
|
+
return null;
|
|
1621
|
+
const tool = isRecord(params.toolCall) ? params.toolCall : isRecord(params.tool_call) ? params.tool_call : {};
|
|
1622
|
+
const toolName = firstToolText(tool.title, tool.name, tool.toolName, tool.tool_name, params.toolName, params.tool_name);
|
|
1623
|
+
const callId = firstToolText(tool.toolCallId, tool.tool_call_id, tool.callId, tool.call_id, params.callId, params.call_id);
|
|
1624
|
+
const detail = firstToolText(params.detail, params.reason, params.message, tool.detail);
|
|
1625
|
+
const options = Array.isArray(params.options) ? params.options : [];
|
|
1626
|
+
const ids = options.flatMap((option) => {
|
|
1627
|
+
if (!isRecord(option))
|
|
1628
|
+
return [];
|
|
1629
|
+
const id = firstToolText(option.optionId, option.option_id, option.id);
|
|
1630
|
+
if (id === undefined)
|
|
1631
|
+
return [];
|
|
1632
|
+
return [{ id, kind: firstToolText(option.kind, option.type)?.toLowerCase() ?? '' }];
|
|
1633
|
+
});
|
|
1634
|
+
return {
|
|
1635
|
+
requestId: String(requestId), kind: firstToolText(params.kind, params.permissionKind, tool.kind) ?? toolName ?? 'unknown',
|
|
1636
|
+
...(toolName === undefined ? {} : { toolName }), ...(callId === undefined ? {} : { callId }), ...(detail === undefined ? {} : { detail }),
|
|
1637
|
+
allowOptionId: ids.find((option) => /allow|approve|accept/u.test(option.kind))?.id ?? ids[0]?.id ?? 'allow-once',
|
|
1638
|
+
rejectOptionId: ids.find((option) => /reject|deny|decline|cancel/u.test(option.kind))?.id ?? ids[1]?.id ?? 'reject-once',
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
/** 解析 CodeBuddy ACP usage_update;仅投影会话上下文,不推断账户套餐额度。 */
|
|
1642
|
+
export function codeBuddyUsageChunk(value) {
|
|
1643
|
+
if (!isRecord(value))
|
|
1644
|
+
return null;
|
|
1645
|
+
const used = finiteNonNegativeNumber(value.used);
|
|
1646
|
+
const size = finiteNonNegativeNumber(value.size);
|
|
1647
|
+
if (used === undefined && size === undefined)
|
|
1648
|
+
return null;
|
|
1649
|
+
const contextTokens = used ?? 0;
|
|
1650
|
+
const contextWindow = size !== undefined && size > 0 ? size : undefined;
|
|
1651
|
+
return {
|
|
1652
|
+
type: 'usage',
|
|
1653
|
+
inputTokens: 0,
|
|
1654
|
+
outputTokens: 0,
|
|
1655
|
+
...(contextWindow === undefined ? {} : { contextWindow }),
|
|
1656
|
+
contextTokens,
|
|
1657
|
+
...(contextWindow === undefined ? {} : { contextUsageRatio: Number(Math.min(1, contextTokens / contextWindow).toFixed(6)) }),
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
/** 判断 ACP usage 是否已经包含可用于 token-meter 的真实数值。 */
|
|
1661
|
+
function hasTokenUsage(event) {
|
|
1662
|
+
return event.inputTokens > 0 || event.outputTokens > 0
|
|
1663
|
+
|| (event.cacheReadTokens ?? 0) > 0 || (event.cacheWriteTokens ?? 0) > 0;
|
|
1664
|
+
}
|
|
1665
|
+
/** 把 ACP 已确认的窗口补到 JSONL token 采样,保证最后一个 usage 也含上下文比例。 */
|
|
1666
|
+
function enrichCodeBuddyUsageContext(event, contextWindow) {
|
|
1667
|
+
if (event.type !== 'usage' || event.contextWindow !== undefined || contextWindow === undefined || contextWindow <= 0)
|
|
1668
|
+
return event;
|
|
1669
|
+
const contextTokens = event.contextTokens ?? event.inputTokens;
|
|
1670
|
+
return {
|
|
1671
|
+
...event,
|
|
1672
|
+
contextWindow,
|
|
1673
|
+
contextTokens,
|
|
1674
|
+
contextUsageRatio: Number(Math.min(1, contextTokens / contextWindow).toFixed(6)),
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* 读取 CodeBuddy JSONL 中最新 assistant 记录的 provider 用量。
|
|
1679
|
+
*
|
|
1680
|
+
* CodeBuddy 的 ACP 通道不会把这组字段放进 `session/prompt`,但同一轮完成后
|
|
1681
|
+
* 会把 `rawUsage` 和 `message.usage` 原样写入会话文件。这里按完整输入、缓存读、
|
|
1682
|
+
* 缓存写三桶折算,避免把 `prompt_tokens` 和缓存桶重复计入 DSH。
|
|
1683
|
+
*/
|
|
1684
|
+
export function readCodeBuddyHistoryUsage(path) {
|
|
1685
|
+
let text;
|
|
1686
|
+
try {
|
|
1687
|
+
text = readFileSync(path, 'utf8');
|
|
1688
|
+
}
|
|
1689
|
+
catch {
|
|
1690
|
+
return null;
|
|
1691
|
+
}
|
|
1692
|
+
const lines = text.split(/\r?\n/u);
|
|
1693
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
1694
|
+
const line = lines[index]?.trim();
|
|
1695
|
+
if (!line)
|
|
1696
|
+
continue;
|
|
1697
|
+
try {
|
|
1698
|
+
const record = JSON.parse(line);
|
|
1699
|
+
const usage = parseCodeBuddyHistoryUsage(record);
|
|
1700
|
+
if (usage !== null)
|
|
1701
|
+
return historyUsageEvent(usage);
|
|
1702
|
+
}
|
|
1703
|
+
catch {
|
|
1704
|
+
// JSONL 可能正被 CLI 追加,跳过损坏的尾行并继续寻找上一条完整记录。
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return null;
|
|
1708
|
+
}
|
|
1709
|
+
/** 从最新 assistant 记录取得实际路由模型,用于查找动态产品快照的窗口。 */
|
|
1710
|
+
function readCodeBuddyHistoryModel(path) {
|
|
1711
|
+
let text;
|
|
1712
|
+
try {
|
|
1713
|
+
text = readFileSync(path, 'utf8');
|
|
1714
|
+
}
|
|
1715
|
+
catch {
|
|
1716
|
+
return null;
|
|
1717
|
+
}
|
|
1718
|
+
const lines = text.split(/\r?\n/u);
|
|
1719
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
1720
|
+
const line = lines[index]?.trim();
|
|
1721
|
+
if (!line)
|
|
1722
|
+
continue;
|
|
1723
|
+
try {
|
|
1724
|
+
const value = JSON.parse(line);
|
|
1725
|
+
if (!isRecord(value))
|
|
1726
|
+
continue;
|
|
1727
|
+
const providerData = isRecord(value.providerData) ? value.providerData : undefined;
|
|
1728
|
+
const model = firstText(providerData?.model, providerData?.requestModelId, value.model);
|
|
1729
|
+
if (model !== undefined)
|
|
1730
|
+
return model;
|
|
1731
|
+
}
|
|
1732
|
+
catch {
|
|
1733
|
+
// 跳过尚未写完整的尾行。
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
return null;
|
|
1737
|
+
}
|
|
1738
|
+
/** 读取 CodeBuddy 动态产品快照中的模型上下文窗口。 */
|
|
1739
|
+
function readCodeBuddyModelContextWindow(modelId, configRoot, environment, readFile) {
|
|
1740
|
+
const home = environment.HOME?.trim() || homedir();
|
|
1741
|
+
const files = [
|
|
1742
|
+
join(configRoot, 'product.internal.json'),
|
|
1743
|
+
join(configRoot, 'product.json'),
|
|
1744
|
+
];
|
|
1745
|
+
const storageRoots = uniquePaths([
|
|
1746
|
+
join(configRoot, 'local_storage'),
|
|
1747
|
+
join(home, '.codebuddy/local_storage'),
|
|
1748
|
+
]);
|
|
1749
|
+
for (const root of storageRoots) {
|
|
1750
|
+
try {
|
|
1751
|
+
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
1752
|
+
if (entry.isFile() && entry.name.endsWith('.info'))
|
|
1753
|
+
files.push(join(root, entry.name));
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
catch {
|
|
1757
|
+
// 当前安装可能没有 local_storage,继续检查产品文件。
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
for (const path of files) {
|
|
1761
|
+
let parsed;
|
|
1762
|
+
try {
|
|
1763
|
+
parsed = JSON.parse(String(readFile(path, 'utf8')));
|
|
1764
|
+
}
|
|
1765
|
+
catch {
|
|
1766
|
+
continue;
|
|
1767
|
+
}
|
|
1768
|
+
const records = Array.isArray(parsed) ? parsed : [parsed];
|
|
1769
|
+
for (const record of records) {
|
|
1770
|
+
const data = isRecord(record) && isRecord(record.data) ? record.data : record;
|
|
1771
|
+
if (!isRecord(data) || !Array.isArray(data.models))
|
|
1772
|
+
continue;
|
|
1773
|
+
const model = data.models.find((entry) => isRecord(entry) && entry.id === modelId);
|
|
1774
|
+
if (model === undefined)
|
|
1775
|
+
continue;
|
|
1776
|
+
const maxInputTokens = finiteNonNegativeNumber(model.maxInputTokens);
|
|
1777
|
+
if (maxInputTokens !== undefined && maxInputTokens > 0)
|
|
1778
|
+
return maxInputTokens;
|
|
1779
|
+
const contextWindow = isRecord(model.contextWindow) ? model.contextWindow : undefined;
|
|
1780
|
+
const defaultLength = finiteNonNegativeNumber(contextWindow?.defaultLength);
|
|
1781
|
+
if (defaultLength !== undefined && defaultLength > 0)
|
|
1782
|
+
return defaultLength;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
return undefined;
|
|
1786
|
+
}
|
|
1787
|
+
function firstText(...values) {
|
|
1788
|
+
return values.find((value) => typeof value === 'string' && value.trim() !== '')?.trim();
|
|
1789
|
+
}
|
|
1790
|
+
function parseCodeBuddyHistoryUsage(value) {
|
|
1791
|
+
if (!isRecord(value))
|
|
1792
|
+
return null;
|
|
1793
|
+
const providerData = isRecord(value.providerData) ? value.providerData : undefined;
|
|
1794
|
+
const raw = providerData !== undefined && isRecord(providerData.rawUsage) ? providerData.rawUsage : undefined;
|
|
1795
|
+
const message = isRecord(value.message) ? value.message : undefined;
|
|
1796
|
+
const messageUsage = message !== undefined && isRecord(message.usage) ? message.usage : undefined;
|
|
1797
|
+
const providerUsage = providerData !== undefined && isRecord(providerData.usage) ? providerData.usage : undefined;
|
|
1798
|
+
if (raw === undefined && messageUsage === undefined && providerUsage === undefined)
|
|
1799
|
+
return null;
|
|
1800
|
+
const inputTokens = firstNumber(raw?.prompt_tokens, messageUsage?.input_tokens, providerUsage?.inputTokens, value.input_tokens);
|
|
1801
|
+
const outputTokens = firstNumber(raw?.completion_tokens, messageUsage?.output_tokens, providerUsage?.outputTokens, value.output_tokens);
|
|
1802
|
+
if (inputTokens === undefined && outputTokens === undefined)
|
|
1803
|
+
return null;
|
|
1804
|
+
const cacheReadTokens = largestNumber(raw?.prompt_cache_hit_tokens, raw?.cache_read_input_tokens, messageUsage?.cache_read_input_tokens, cachedTokenDetail(providerUsage));
|
|
1805
|
+
const cacheWriteTokens = largestNumber(raw?.cache_creation_input_tokens, raw?.prompt_cache_miss_tokens, raw?.prompt_cache_write_tokens, messageUsage?.cache_creation_input_tokens);
|
|
1806
|
+
const fullInput = inputTokens ?? Math.max(0, (cacheReadTokens ?? 0) + (cacheWriteTokens ?? 0));
|
|
1807
|
+
const output = outputTokens ?? 0;
|
|
1808
|
+
const totalTokens = firstNumber(raw?.total_tokens, messageUsage?.total_tokens, providerUsage?.totalTokens)
|
|
1809
|
+
?? fullInput + output;
|
|
1810
|
+
const modelUsage = isRecord(value.modelUsage)
|
|
1811
|
+
? value.modelUsage
|
|
1812
|
+
: providerData !== undefined && isRecord(providerData.modelUsage) ? providerData.modelUsage : undefined;
|
|
1813
|
+
const modelContextWindows = modelUsage === undefined
|
|
1814
|
+
? []
|
|
1815
|
+
: Object.values(modelUsage).map((entry) => isRecord(entry) ? entry.contextWindow ?? entry.context_window : undefined);
|
|
1816
|
+
const contextWindow = largestNumber(value.contextWindow, value.context_window, ...modelContextWindows);
|
|
1817
|
+
return {
|
|
1818
|
+
inputTokens: fullInput,
|
|
1819
|
+
outputTokens: output,
|
|
1820
|
+
...(cacheReadTokens === undefined ? {} : { cacheReadTokens }),
|
|
1821
|
+
...(cacheWriteTokens === undefined ? {} : { cacheWriteTokens }),
|
|
1822
|
+
totalTokens,
|
|
1823
|
+
...(contextWindow === undefined ? {} : { contextWindow }),
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
function historyUsageEvent(usage) {
|
|
1827
|
+
const cached = (usage.cacheReadTokens ?? 0) + (usage.cacheWriteTokens ?? 0);
|
|
1828
|
+
const uncachedInputTokens = Math.max(0, usage.inputTokens - cached);
|
|
1829
|
+
return {
|
|
1830
|
+
type: 'usage',
|
|
1831
|
+
inputTokens: usage.inputTokens,
|
|
1832
|
+
outputTokens: usage.outputTokens,
|
|
1833
|
+
...(usage.cacheReadTokens === undefined ? {} : { cacheReadTokens: usage.cacheReadTokens }),
|
|
1834
|
+
...(usage.cacheWriteTokens === undefined ? {} : { cacheWriteTokens: usage.cacheWriteTokens }),
|
|
1835
|
+
uncachedInputTokens,
|
|
1836
|
+
...(usage.totalTokens === undefined ? {} : { totalTokens: usage.totalTokens }),
|
|
1837
|
+
...(usage.cacheReadTokens === undefined || usage.inputTokens <= 0
|
|
1838
|
+
? {}
|
|
1839
|
+
: { cacheHitRate: Number((usage.cacheReadTokens / usage.inputTokens * 100).toFixed(4)) }),
|
|
1840
|
+
contextTokens: usage.inputTokens,
|
|
1841
|
+
...(usage.contextWindow === undefined ? {} : {
|
|
1842
|
+
contextWindow: usage.contextWindow,
|
|
1843
|
+
contextUsageRatio: Number(Math.min(1, usage.inputTokens / usage.contextWindow).toFixed(6)),
|
|
1844
|
+
}),
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
function cachedTokenDetail(value) {
|
|
1848
|
+
if (value === undefined || !Array.isArray(value.inputTokensDetails))
|
|
1849
|
+
return undefined;
|
|
1850
|
+
return largestNumber(...value.inputTokensDetails.map((entry) => isRecord(entry) ? entry.cached_tokens : undefined));
|
|
1851
|
+
}
|
|
1852
|
+
function firstNumber(...values) {
|
|
1853
|
+
for (const value of values) {
|
|
1854
|
+
const parsed = finiteNonNegativeNumber(value);
|
|
1855
|
+
if (parsed !== undefined)
|
|
1856
|
+
return parsed;
|
|
1857
|
+
}
|
|
1858
|
+
return undefined;
|
|
1859
|
+
}
|
|
1860
|
+
function largestNumber(...values) {
|
|
1861
|
+
const numbers = values.map(finiteNonNegativeNumber).filter((value) => value !== undefined);
|
|
1862
|
+
return numbers.length === 0 ? undefined : Math.max(...numbers);
|
|
1863
|
+
}
|
|
1864
|
+
function delay(milliseconds) {
|
|
1865
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
1866
|
+
}
|
|
1867
|
+
function finiteNonNegativeNumber(value) {
|
|
1868
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
1869
|
+
return Math.max(0, value);
|
|
1870
|
+
if (typeof value === 'string' && value.trim() !== '') {
|
|
1871
|
+
const parsed = Number(value);
|
|
1872
|
+
return Number.isFinite(parsed) ? Math.max(0, parsed) : undefined;
|
|
1873
|
+
}
|
|
1874
|
+
return undefined;
|
|
1875
|
+
}
|
|
1876
|
+
function readSessionId(value) {
|
|
1877
|
+
if (!isRecord(value))
|
|
1878
|
+
return null;
|
|
1879
|
+
if (typeof value.sessionId === 'string' && value.sessionId.trim())
|
|
1880
|
+
return value.sessionId.trim();
|
|
1881
|
+
if (typeof value.session_id === 'string' && value.session_id.trim())
|
|
1882
|
+
return value.session_id.trim();
|
|
1883
|
+
if (isRecord(value.session) && typeof value.session.id === 'string' && value.session.id.trim())
|
|
1884
|
+
return value.session.id.trim();
|
|
1885
|
+
return typeof value.id === 'string' && value.id.trim() ? value.id.trim() : null;
|
|
1886
|
+
}
|
|
1887
|
+
function promptFinish(value, signal) {
|
|
1888
|
+
if (signal?.aborted)
|
|
1889
|
+
return { type: 'finish', reason: 'cancel' };
|
|
1890
|
+
if (!isRecord(value) || typeof value.stopReason !== 'string')
|
|
1891
|
+
return emptyResponseFinish();
|
|
1892
|
+
const reason = value.stopReason.toLowerCase();
|
|
1893
|
+
if (reason === 'cancelled' || reason === 'canceled')
|
|
1894
|
+
return { type: 'finish', reason: 'cancel' };
|
|
1895
|
+
if (reason === 'error' || reason === 'failed' || reason === 'refusal') {
|
|
1896
|
+
return {
|
|
1897
|
+
type: 'finish',
|
|
1898
|
+
reason: 'error',
|
|
1899
|
+
failure: promptFailure(value) ?? { message: 'WorkBuddy ACP 拒绝或结束了请求,但未返回具体错误信息。', code: 'PROVIDER_ERROR' },
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
if (reason === 'end_turn' || reason === 'endturn' || reason === 'max_tokens' || reason === 'max_turn_requests' || reason === 'stop') {
|
|
1903
|
+
return { type: 'finish', reason: 'stop' };
|
|
1904
|
+
}
|
|
1905
|
+
return emptyResponseFinish();
|
|
1906
|
+
}
|
|
1907
|
+
function emptyResponseFinish(failure = { message: 'AGENT_DOOR_PROVIDER_EMPTY_RESPONSE: WorkBuddy ACP 未返回任何有效响应。', code: 'PROVIDER_ERROR' }) {
|
|
1908
|
+
return { type: 'finish', reason: 'error', failure };
|
|
1909
|
+
}
|
|
1910
|
+
function promptFailure(value) {
|
|
1911
|
+
const failure = isRecord(value) ? readPromptFailure(value) : undefined;
|
|
1912
|
+
return failure;
|
|
1913
|
+
}
|
|
1914
|
+
function readPromptFailure(value) {
|
|
1915
|
+
const direct = readFailure(value);
|
|
1916
|
+
if (direct !== undefined)
|
|
1917
|
+
return direct;
|
|
1918
|
+
const metadata = isRecord(value._meta) ? value._meta : undefined;
|
|
1919
|
+
const encoded = metadata === undefined ? undefined : firstToolText(metadata['codebuddy.ai/errorMessage'], metadata.errorMessage, metadata.error_message);
|
|
1920
|
+
if (encoded === undefined)
|
|
1921
|
+
return undefined;
|
|
1922
|
+
try {
|
|
1923
|
+
const parsed = JSON.parse(encoded);
|
|
1924
|
+
if (isRecord(parsed))
|
|
1925
|
+
return readPromptFailure(parsed) ?? { message: encoded };
|
|
1926
|
+
}
|
|
1927
|
+
catch {
|
|
1928
|
+
// WorkBuddy 某些版本直接写入纯文本错误,保留该文本。
|
|
1929
|
+
}
|
|
1930
|
+
return { message: encoded };
|
|
1931
|
+
}
|
|
1932
|
+
function acpText(value) {
|
|
1933
|
+
const direct = textValue(value);
|
|
1934
|
+
if (direct)
|
|
1935
|
+
return direct;
|
|
1936
|
+
if (Array.isArray(value)) {
|
|
1937
|
+
const joined = value.map((item) => acpText(item) ?? '').join('');
|
|
1938
|
+
return joined.trim() ? joined : null;
|
|
1939
|
+
}
|
|
1940
|
+
if (isRecord(value)) {
|
|
1941
|
+
for (const key of ['text', 'delta', 'content', 'message']) {
|
|
1942
|
+
const nested = acpText(value[key]);
|
|
1943
|
+
if (nested)
|
|
1944
|
+
return nested;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
return null;
|
|
1948
|
+
}
|
|
1949
|
+
function readFailure(value) {
|
|
1950
|
+
const error = isRecord(value.error) ? value.error : value;
|
|
1951
|
+
const message = firstToolText(error.message, error.errorMessage, error.error_message, error.detail, error.reason);
|
|
1952
|
+
if (message === undefined)
|
|
1953
|
+
return undefined;
|
|
1954
|
+
const data = isRecord(value.data) ? value.data : undefined;
|
|
1955
|
+
const code = firstToolText(error.code, error.errorCode, error.error_code, data?.category);
|
|
1956
|
+
return code === undefined ? { message } : { message, code };
|
|
1957
|
+
}
|
|
1958
|
+
//# sourceMappingURL=codebuddy-driver.js.map
|