@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,2418 @@
|
|
|
1
|
+
import { createSessionPromptTranslation } from '../features/session-prompt-translation.js';
|
|
2
|
+
import { createSessionPromptAdapter, sessionPromptScope, supportsSessionPromptAssembly } from '../../dsh-capabilities/host/session-prompt-adapter.js';
|
|
3
|
+
import { isNativeApprovalMode, resolveNativeApprovalPermission } from '../../shared/native-approval-modes.js';
|
|
4
|
+
import { CommandCodeDriver } from './command-code-driver.js';
|
|
5
|
+
import { ClaudeCodeDriver } from './claude-driver.js';
|
|
6
|
+
import { GeminiCliDriver } from './gemini-driver.js';
|
|
7
|
+
import { KimiCliDriver } from './kimi-driver.js';
|
|
8
|
+
import { PiAgentDriver } from './pi-driver.js';
|
|
9
|
+
import { CodexAppServerDriver } from './codex-driver.js';
|
|
10
|
+
import { GrokBuildDriver } from './grok-driver.js';
|
|
11
|
+
import { OpenCodeDriver } from './opencode-driver.js';
|
|
12
|
+
import { MiniMaxCodeDriver } from './mcode-driver.js';
|
|
13
|
+
import { ZcodeAppServerDriver } from './zcode-driver.js';
|
|
14
|
+
import { CodeBuddyCliDriver, WorkBuddyCliDriver } from './codebuddy-driver.js';
|
|
15
|
+
import { CursorCliDriver } from './cursor-driver.js';
|
|
16
|
+
import { KiroCliDriver } from './kiro-driver.js';
|
|
17
|
+
import { QoderCliDriver } from './qoder-driver.js';
|
|
18
|
+
import { AntigravityDriver } from './antigravity-driver.js';
|
|
19
|
+
import { DoubaoAppDriver } from './doubao-driver.js';
|
|
20
|
+
import { AgentDoorCliAdapterRegistry } from './registry.js';
|
|
21
|
+
import { CliManagementService } from './management.js';
|
|
22
|
+
import { CliUpdateCheckService } from './update-check.js';
|
|
23
|
+
import { AgentDoorCliSessionStore } from './session-store.js';
|
|
24
|
+
import { AgentDoorDshMessageProjector } from './dsh-message-projector.js';
|
|
25
|
+
import { CommandCodeSubscriptionService } from './command-code-subscription.js';
|
|
26
|
+
import { ProviderSubscriptionService } from './provider-subscription.js';
|
|
27
|
+
import { readDshProviderSource } from './dsh-config.js';
|
|
28
|
+
import { normalizeSubagentBridgeSettings, normalizeSubscriptionUsageSettings } from '../../shared/contracts/config.js';
|
|
29
|
+
import { AgentDoorRpcError } from '../rpc-table.js';
|
|
30
|
+
import { setAdapterRegistry } from './registry-holder.js';
|
|
31
|
+
import { createDshVirtualProviderRegistration } from './dsh-virtual-providers.js';
|
|
32
|
+
import { knownAntigravityContextWindow, knownClaudeContextWindow, knownCodexContextWindow, knownCommandCodeContextWindow, knownOpenCodeContextWindow } from './model-catalog.js';
|
|
33
|
+
import { dispatchBridgeSubagent } from '../cli-bridge/dispatch.js';
|
|
34
|
+
import { dispatchBridgeSearch } from '../cli-bridge/search-dispatch.js';
|
|
35
|
+
import { dispatchBridgeFetch } from '../cli-bridge/fetch-dispatch.js';
|
|
36
|
+
import { startSubagentBridgeServer } from '../cli-bridge/bridge-server.js';
|
|
37
|
+
import { getSubagentBridge, setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
38
|
+
import { delegateCapability, dispatchDelegateSubagent } from './delegate-dispatch.js';
|
|
39
|
+
import { guardNativeSubagentParentTurn, markNativeSubagentParentTurnStarted, setMaxNativeSubagentsPerParent } from './native-subagent-dispatch.js';
|
|
40
|
+
import { containsDelegationCarrier, delegationAdapterIds, rewriteDelegationMessages } from './delegation-mention-rewrite.js';
|
|
41
|
+
import { clearDelegationAuthorization, setDelegationAuthorization } from './delegation-authorization.js';
|
|
42
|
+
import { debugInfo } from '../../shared/debug.js';
|
|
43
|
+
import { hasLegacySessionAdapterHint } from './legacy-session-adapter.js';
|
|
44
|
+
import { DSH_NATIVE_SESSION_ADAPTER_ID, formatSessionTranslationOutput, readSessionTranslationDiagnostics, readSessionTranslationMetrics, supportsSessionTranslation, } from '../../shared/contracts/session-translation.js';
|
|
45
|
+
import { interactionQuestionCategory, questionTranslationFields } from '../../shared/contracts/interaction-translation.js';
|
|
46
|
+
import { createInteractionTranslation } from '../features/interaction-translation.js';
|
|
47
|
+
import { createSessionTranslationRecovery, SessionTranslationCancelled } from '../features/session-translation-recovery.js';
|
|
48
|
+
import { isSessionTranslationInputEnabled } from '../features/session-translation-service.js';
|
|
49
|
+
import { translationFailure } from '../features/session-translation-runtime.js';
|
|
50
|
+
import { runTranslationEffect, translationEffect, translationTimeout } from '../../shared/translation-effect.js';
|
|
51
|
+
import { createDshCapabilityRegistry } from '../../dsh-capabilities/routes.js';
|
|
52
|
+
import { hostBrowserText, resolveHostPushLocale } from '../browser-text.js';
|
|
53
|
+
import { attachmentFileNotice } from '../../shared/attachment-prompts.js';
|
|
54
|
+
import { codexPerformanceProjection } from './codex-performance-projection.js';
|
|
55
|
+
import { claudePerformanceProjection } from './claude-performance-projection.js';
|
|
56
|
+
import { grokContextProjection, grokPerformanceProjection } from './grok-performance-projection.js';
|
|
57
|
+
import { piPerformanceProjection } from './pi-performance-projection.js';
|
|
58
|
+
import { antigravityPerformanceProjection } from './antigravity-performance-projection.js';
|
|
59
|
+
import { countSessionTurnSteps } from './session-performance-projection.js';
|
|
60
|
+
import { fromCliProviderId, toCliProviderId } from '../../shared/cli-provider-route.js';
|
|
61
|
+
import { DshAgentTeamAdapter } from '../../dsh-capabilities/host/agent-team-adapter.js';
|
|
62
|
+
import { AgentDoorTeamDispatcher } from '../cli-bridge/team-dispatch.js';
|
|
63
|
+
import { createAgentTeamTool } from '../cli-bridge/team-tool.js';
|
|
64
|
+
import { TeamInputTracker, isTeamInputMessage, pendingPeerInput } from './team-input.js';
|
|
65
|
+
import { withTeamSupport } from '../cli-bridge/team-adapters.js';
|
|
66
|
+
import { isCredentialReference } from '../../shared/contracts/credentials.js';
|
|
67
|
+
import { parseCredentialCarriers } from '../../shared/credential-carrier.js';
|
|
68
|
+
import { createDshModelCatalogReader } from './dsh-model-catalog.js';
|
|
69
|
+
export function createCliAdaptersFeature(options = {}) {
|
|
70
|
+
return {
|
|
71
|
+
descriptor: {
|
|
72
|
+
name: 'cliAdapters',
|
|
73
|
+
version: '0.1.1',
|
|
74
|
+
enabledByDefault: true,
|
|
75
|
+
dependencies: [],
|
|
76
|
+
runtime: 'host',
|
|
77
|
+
requires: [
|
|
78
|
+
{ capability: 'agent-team.external-member', required: false, fallback: 'degrade' },
|
|
79
|
+
{ capability: 'agent-team.external-lead', required: false, fallback: 'degrade' },
|
|
80
|
+
{ capability: 'session.external-model-selection', required: false, fallback: 'degrade' },
|
|
81
|
+
{ capability: 'session.external-compaction', required: false, fallback: 'degrade' },
|
|
82
|
+
{ capability: 'session.external-performance', required: false, fallback: 'degrade' },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
async start(context) {
|
|
86
|
+
const lifetime = new AbortController();
|
|
87
|
+
// 用量查询超时对所有适配器统一生效:同一个 timeoutMs 下发给全部网络读取器,
|
|
88
|
+
// 设置变更时整体重建,避免旧超时继续生效。
|
|
89
|
+
const buildSubscriptions = (settings) => {
|
|
90
|
+
const timeoutMs = normalizeSubscriptionUsageSettings(settings?.subscriptionUsage).timeoutSecs * 1000;
|
|
91
|
+
return new ProviderSubscriptionService({ commandCode: new CommandCodeSubscriptionService({ timeoutMs }), timeoutMs });
|
|
92
|
+
};
|
|
93
|
+
let subscriptions = options.subscriptions ?? buildSubscriptions(context.services.settings?.get());
|
|
94
|
+
let subscriptionSettings = JSON.stringify(context.services.settings?.get().subscriptionUsage ?? null);
|
|
95
|
+
// 注入的 registry 自带 SessionStore;只有自建时才有本地 store 变量。
|
|
96
|
+
const sessionStore = options.registry?.sessionRecords
|
|
97
|
+
?? new AgentDoorCliSessionStore(context.services.settings === undefined ? {} : { settings: context.services.settings });
|
|
98
|
+
const nativeSessions = context.services.nativeSessions;
|
|
99
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
100
|
+
const performance = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
101
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-performance')?.value;
|
|
102
|
+
if (performance !== undefined) {
|
|
103
|
+
for (const projection of [codexPerformanceProjection, claudePerformanceProjection, grokPerformanceProjection, grokContextProjection, piPerformanceProjection, antigravityPerformanceProjection]) {
|
|
104
|
+
context.resources.add(await performance.install(projection));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const translation = context.services.sessionTranslation;
|
|
109
|
+
// 启动只恢复持久化索引;旧会话在打开时迁移,禁止在首屏扫描全部历史。
|
|
110
|
+
const registry = options.registry ?? new AgentDoorCliAdapterRegistry([
|
|
111
|
+
new CommandCodeDriver({ enableAcp: true }),
|
|
112
|
+
new ClaudeCodeDriver(),
|
|
113
|
+
new KimiCliDriver(),
|
|
114
|
+
new GeminiCliDriver(),
|
|
115
|
+
new PiAgentDriver(),
|
|
116
|
+
new CodexAppServerDriver({ computerUse: 'auto' }),
|
|
117
|
+
new OpenCodeDriver(),
|
|
118
|
+
new GrokBuildDriver(),
|
|
119
|
+
new MiniMaxCodeDriver(),
|
|
120
|
+
new ZcodeAppServerDriver(),
|
|
121
|
+
new CodeBuddyCliDriver(),
|
|
122
|
+
new WorkBuddyCliDriver(),
|
|
123
|
+
new CursorCliDriver(),
|
|
124
|
+
new KiroCliDriver(),
|
|
125
|
+
new QoderCliDriver(),
|
|
126
|
+
new QoderCliDriver({ variant: 'qoder-cn' }),
|
|
127
|
+
new AntigravityDriver(),
|
|
128
|
+
new DoubaoAppDriver(),
|
|
129
|
+
], context.services.settings?.get().agentAdapters, {
|
|
130
|
+
sessionStore,
|
|
131
|
+
...(context.services.settings === undefined ? {} : { settings: context.services.settings }),
|
|
132
|
+
...(context.services.nativeSessions === undefined ? {} : { nativeSessions: context.services.nativeSessions }),
|
|
133
|
+
});
|
|
134
|
+
// 冷启动时 Host 创建 bridge 早于 DSH 的 sessionController 就绪,bridge.controller
|
|
135
|
+
// 因此可能是 undefined;只在启动瞬间取一次会让 fork 钩子永远装不上,fork 出来的
|
|
136
|
+
// 子会话就成了默认 DSH 会话。所以已有 controller 时立即安装,同时订阅
|
|
137
|
+
// sessionController 就绪事件,晚到的 controller 也会被包装。
|
|
138
|
+
let forkBoundController;
|
|
139
|
+
const bindForkAdapter = (controller) => {
|
|
140
|
+
if (controller === undefined || controller === forkBoundController)
|
|
141
|
+
return undefined;
|
|
142
|
+
const dispose = installForkAdapterBinding(controller, nativeSessions, sessionStore, registry);
|
|
143
|
+
if (dispose === undefined)
|
|
144
|
+
return undefined;
|
|
145
|
+
forkBoundController = controller;
|
|
146
|
+
return () => {
|
|
147
|
+
if (forkBoundController === controller)
|
|
148
|
+
forkBoundController = undefined;
|
|
149
|
+
dispose();
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const disposeForkAdapterBinding = bindForkAdapter(nativeSessions?.controller);
|
|
153
|
+
if (disposeForkAdapterBinding !== undefined)
|
|
154
|
+
context.resources.add(disposeForkAdapterBinding);
|
|
155
|
+
const forkControllerScope = context.services.dshContext?.inject?.(['sessionController'], (scoped) => {
|
|
156
|
+
const controller = asRecord(scoped.get('sessionController'));
|
|
157
|
+
if (typeof controller?.fork !== 'function')
|
|
158
|
+
return undefined;
|
|
159
|
+
const dispose = bindForkAdapter(controller);
|
|
160
|
+
if (dispose === undefined)
|
|
161
|
+
return undefined;
|
|
162
|
+
// 钩子随本 Feature 释放,不依赖 inject 作用域是否回收回调返回值。
|
|
163
|
+
context.resources.add(dispose);
|
|
164
|
+
return dispose;
|
|
165
|
+
});
|
|
166
|
+
if (forkControllerScope !== undefined)
|
|
167
|
+
context.resources.add(() => forkControllerScope.dispose());
|
|
168
|
+
setAdapterRegistry(registry);
|
|
169
|
+
const teamInputs = new TeamInputTracker();
|
|
170
|
+
context.resources.add(() => teamInputs.clear());
|
|
171
|
+
let teamAdapter;
|
|
172
|
+
const teamDispatcher = new AgentDoorTeamDispatcher({
|
|
173
|
+
adapter: () => teamAdapter,
|
|
174
|
+
registry,
|
|
175
|
+
enabled: () => !lifetime.signal.aborted && normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled,
|
|
176
|
+
});
|
|
177
|
+
const versionSupported = context.services.dshVersion !== undefined && !createDshCapabilityRegistry(context.services.dshVersion, 'host', {}).getProfile({}).diagnostics.some(item => item.capability === 'agent-team.external-member' && item.code === 'CAPABILITY_VERSION_UNSUPPORTED');
|
|
178
|
+
const teamCatalog = (catalog) => withTeamSupport(catalog, !versionSupported ? 'version' : !normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled ? 'disabled' : !teamAdapter ? 'profile' : undefined, teamAdapter?.supportsLead);
|
|
179
|
+
const dshContext = context.services.dshContext;
|
|
180
|
+
const readCachedDshModelCatalog = createDshModelCatalogReader(() => readDshModelCatalog(dshContext));
|
|
181
|
+
if (dshContext?.inject && context.services.dshVersion) {
|
|
182
|
+
const teamScope = dshContext.inject(['agentTeams', 'agents', 'subagents', 'tools'], scoped => {
|
|
183
|
+
const capability = createDshCapabilityRegistry(context.services.dshVersion, 'host', scoped).getProfile(scoped).capabilities.get('agent-team.external-member');
|
|
184
|
+
if (capability?.status !== 'ready')
|
|
185
|
+
return;
|
|
186
|
+
const adapter = capability.value;
|
|
187
|
+
teamAdapter = adapter;
|
|
188
|
+
const tools = scoped.get('tools');
|
|
189
|
+
const unregister = tools.register(createAgentTeamTool(teamDispatcher));
|
|
190
|
+
scoped.effect(() => () => {
|
|
191
|
+
adapter.dispose();
|
|
192
|
+
if (teamAdapter === adapter)
|
|
193
|
+
teamAdapter = undefined;
|
|
194
|
+
if (typeof unregister === 'function')
|
|
195
|
+
unregister();
|
|
196
|
+
}, 'AgentDoor native Team bridge');
|
|
197
|
+
});
|
|
198
|
+
context.resources.add(() => teamScope.dispose());
|
|
199
|
+
}
|
|
200
|
+
if (dshContext?.on) {
|
|
201
|
+
const stopCreated = dshContext.on('agent/created', ((payload) => {
|
|
202
|
+
const agent = asRecord(payload)?.agent;
|
|
203
|
+
if (agent && typeof agent.id === 'string') {
|
|
204
|
+
teamDispatcher.initializeNativeChild(agent);
|
|
205
|
+
selectExternalModelForAgent(agent, undefined, registry);
|
|
206
|
+
}
|
|
207
|
+
}), { global: true });
|
|
208
|
+
if (typeof stopCreated === 'function')
|
|
209
|
+
context.resources.add(stopCreated);
|
|
210
|
+
}
|
|
211
|
+
context.resources.add(() => {
|
|
212
|
+
if (registry === undefined)
|
|
213
|
+
return;
|
|
214
|
+
setAdapterRegistry(undefined);
|
|
215
|
+
});
|
|
216
|
+
registry.applyEnabledSettings(context.services.settings?.get().agentAdapters);
|
|
217
|
+
const virtualProviders = createDshVirtualProviderRegistration(context.services.dshContext, async (adapterId, modelId, signal) => {
|
|
218
|
+
return adapterId === 'codex' ? knownCodexContextWindow(modelId)
|
|
219
|
+
: adapterId === 'command-code' ? knownCommandCodeContextWindow(modelId)
|
|
220
|
+
: adapterId === 'antigravity' ? knownAntigravityContextWindow(modelId)
|
|
221
|
+
: adapterId === 'opencode' ? knownOpenCodeContextWindow(modelId)
|
|
222
|
+
: adapterId === 'claude-code' ? knownClaudeContextWindow(modelId)
|
|
223
|
+
: undefined;
|
|
224
|
+
});
|
|
225
|
+
if (virtualProviders !== undefined)
|
|
226
|
+
context.resources.add(() => virtualProviders.dispose());
|
|
227
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
228
|
+
let fixedStepRoutes = false;
|
|
229
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
230
|
+
const selection = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
231
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-model-selection')
|
|
232
|
+
?.value;
|
|
233
|
+
fixedStepRoutes = selection?.fixedSteps === true;
|
|
234
|
+
if (selection !== undefined)
|
|
235
|
+
context.resources.add(selection.install((sessionId) => {
|
|
236
|
+
// Cold and forked chats may only carry their CLI identity in history.
|
|
237
|
+
// Recover it before model selection, rather than after admission.
|
|
238
|
+
if (sessionStore.get(sessionId) === undefined && nativeSessions !== undefined) {
|
|
239
|
+
const session = nativeSessions.get(sessionId);
|
|
240
|
+
if (session !== undefined)
|
|
241
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, session));
|
|
242
|
+
}
|
|
243
|
+
const config = registry.getSession(sessionId);
|
|
244
|
+
if (config.adapterId === 'dsh' && config.teamId && config.providerId && config.modelId)
|
|
245
|
+
return {
|
|
246
|
+
provider: config.providerId, model: config.modelId, ...(config.effortId ? { reasoningEffort: config.effortId } : {}),
|
|
247
|
+
};
|
|
248
|
+
if (config.adapterId === 'dsh' || !registry.isEnabled(config.adapterId))
|
|
249
|
+
return undefined;
|
|
250
|
+
return { provider: toCliProviderId(config.adapterId), model: config.modelId?.trim() || 'provider-default' };
|
|
251
|
+
}, listener => registry.onModelSelectionChanged(listener)));
|
|
252
|
+
}
|
|
253
|
+
registry.warmCatalog();
|
|
254
|
+
const management = new CliManagementService(registry);
|
|
255
|
+
context.resources.add(() => management.dispose());
|
|
256
|
+
const updates = new CliUpdateCheckService(options.updateCheck);
|
|
257
|
+
context.resources.add(() => updates.dispose());
|
|
258
|
+
// 外部适配器没有经过 DSH 原生 Agent Loop,必须把同一套运行状态投影给
|
|
259
|
+
// subagentCatalog。这里集中去重,避免 llm/stream、原生 session/event 和
|
|
260
|
+
// agent/status 同时到达时反复刷新同一个子 Agent。
|
|
261
|
+
const publishExternalStatus = createExternalSessionStatusPublisher(context.services.events, registry, sessionStore);
|
|
262
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
263
|
+
const compaction = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
264
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-compaction')?.value;
|
|
265
|
+
if (compaction !== undefined)
|
|
266
|
+
context.resources.add(compaction.install({
|
|
267
|
+
supports(sessionId) {
|
|
268
|
+
const session = nativeSessions?.get(sessionId);
|
|
269
|
+
if (session !== undefined && nativeSessions !== undefined) {
|
|
270
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, session));
|
|
271
|
+
}
|
|
272
|
+
return registry.supportsCompaction(sessionId);
|
|
273
|
+
},
|
|
274
|
+
error: kind => ({ kind: 'error', text: hostBrowserText(resolveHostPushLocale(context.services.settingsProvider), `compact.${kind}`) }),
|
|
275
|
+
async compact(sessionId, cwd, signal) {
|
|
276
|
+
publishExternalStatus(sessionId, true);
|
|
277
|
+
try {
|
|
278
|
+
const config = registry.getSession(sessionId);
|
|
279
|
+
const locale = resolveHostPushLocale(context.services.settingsProvider);
|
|
280
|
+
if (!config.providerSessionId)
|
|
281
|
+
return { kind: 'success', text: hostBrowserText(locale, 'compact.empty', { agent: config.adapterId }) };
|
|
282
|
+
const result = await registry.compact(sessionId, cwd, signal);
|
|
283
|
+
return { kind: 'success', text: result.message?.trim() || hostBrowserText(locale, result.compacted ? 'compact.completed' : 'compact.unchanged', { agent: config.adapterId }) };
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
publishExternalStatus(sessionId, false);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
}));
|
|
290
|
+
}
|
|
291
|
+
if (nativeSessions !== undefined) {
|
|
292
|
+
const disposeNativeEvents = nativeSessions.subscribe({
|
|
293
|
+
onEvent: (session, event) => {
|
|
294
|
+
const sessionId = nativeSessionId(session);
|
|
295
|
+
const eventType = nativeEventType(event);
|
|
296
|
+
if (sessionId === undefined || eventType === undefined)
|
|
297
|
+
return;
|
|
298
|
+
// 旧会话可能不在启动时的 SessionStore.list() 中,直到用户点击
|
|
299
|
+
// 侧栏才加载。加载事件本身携带完整快照,此时补做一次迁移;
|
|
300
|
+
// fork 子会话的绑定来自父会话,必须把祖先链一起交给迁移。
|
|
301
|
+
if (sessionStore.get(sessionId) === undefined) {
|
|
302
|
+
if (hasLegacySessionAdapterHint(event))
|
|
303
|
+
sessionStore.invalidateLegacySession(session);
|
|
304
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, session));
|
|
305
|
+
}
|
|
306
|
+
if (eventType === 'turn/start')
|
|
307
|
+
publishExternalStatus(sessionId, true);
|
|
308
|
+
else if (eventType === 'turn/end')
|
|
309
|
+
publishExternalStatus(sessionId, false);
|
|
310
|
+
const current = sessionStore.get(sessionId);
|
|
311
|
+
if (current === undefined || current.status === 'archived')
|
|
312
|
+
return;
|
|
313
|
+
if (eventType === 'turn/start') {
|
|
314
|
+
markNativeSubagentParentTurnStarted(sessionId);
|
|
315
|
+
sessionStore.upsert(sessionId, { ...current, status: 'active' });
|
|
316
|
+
}
|
|
317
|
+
else if (eventType === 'turn/end') {
|
|
318
|
+
const barrier = guardNativeSubagentParentTurn(nativeSessions, sessionId);
|
|
319
|
+
sessionStore.upsert(sessionId, { ...current, status: barrier.blocked ? 'active' : 'idle' });
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
context.resources.add(disposeNativeEvents);
|
|
324
|
+
}
|
|
325
|
+
const translationRecovery = createSessionTranslationRecovery(translation, sessionId => registry.getSession(sessionId));
|
|
326
|
+
context.resources.add(() => translationRecovery.dispose());
|
|
327
|
+
registerDelegationAgentHooks(context.services.dshContext, registry, context.resources, publishExternalStatus, translation, translationRecovery, context.services.credentialBroker, nativeSessions, teamInputs, fixedStepRoutes);
|
|
328
|
+
const interactionTranslation = createInteractionTranslation(translation, sessionId => registry.getSession(sessionId));
|
|
329
|
+
context.resources.add(() => interactionTranslation.dispose());
|
|
330
|
+
context.resources.add(context.services.rpc.register('cli', async (action, payload, rpcContext) => {
|
|
331
|
+
const rpcSignal = asRecord(rpcContext)?.signal;
|
|
332
|
+
const signal = isAbortSignal(rpcSignal) ? rpcSignal : undefined;
|
|
333
|
+
switch (action) {
|
|
334
|
+
case 'management/plan':
|
|
335
|
+
case 'management/start':
|
|
336
|
+
case 'management/status':
|
|
337
|
+
case 'management/cancel': return management.rpc(action, payload);
|
|
338
|
+
case 'catalog': return registry.catalog().then(catalog => updates.catalog(teamCatalog(catalog)));
|
|
339
|
+
case 'catalog/refresh': return registry.refreshCatalog(asRecord(payload)?.adapterId === undefined ? undefined : readAdapterId(payload)).then((catalog) => {
|
|
340
|
+
subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
341
|
+
return asRecord(payload)?.checkUpdates === true
|
|
342
|
+
? updates.refresh(teamCatalog(catalog), asRecord(payload)?.adapterId)
|
|
343
|
+
: updates.catalog(teamCatalog(catalog));
|
|
344
|
+
});
|
|
345
|
+
case 'models': {
|
|
346
|
+
const adapterId = readAdapterId(payload);
|
|
347
|
+
const catalog = adapterId === 'dsh'
|
|
348
|
+
? readCachedDshModelCatalog()
|
|
349
|
+
: registry.models(adapterId);
|
|
350
|
+
// 各 Agent 自管模型目录,插件不再并入第三方网关的模型。
|
|
351
|
+
return catalog;
|
|
352
|
+
}
|
|
353
|
+
case 'translation/models': return context.services.sessionTranslation?.catalog() ?? { models: [], default: null, errors: ['翻译模型目录不可用'] };
|
|
354
|
+
case 'translation/pending': return translationRecovery.pending(payload);
|
|
355
|
+
case 'translation/resolve': return translationRecovery.resolve(payload);
|
|
356
|
+
case 'translation/retry-output': return translationRecovery.retryOutput(payload, signal);
|
|
357
|
+
case 'translation/fields': return interactionTranslation.translate(payload, signal);
|
|
358
|
+
case 'skills': {
|
|
359
|
+
const request = readSkillsRequest(payload);
|
|
360
|
+
const cwd = resolveSessionCwd(context.services.nativeSessions, request.sessionId, null);
|
|
361
|
+
return registry.listSkills(request.sessionId, {
|
|
362
|
+
...(cwd === undefined ? {} : { cwd }),
|
|
363
|
+
...(request.forceReload ? { forceReload: true } : {}),
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
case 'adapter/set': return setAdapterEnabled(context.services.settings, registry, payload);
|
|
367
|
+
case 'session/get': {
|
|
368
|
+
const sessionId = readSessionId(payload);
|
|
369
|
+
const session = nativeSessions?.get(sessionId);
|
|
370
|
+
if (session !== undefined && nativeSessions !== undefined && sessionStore.get(sessionId) === undefined) {
|
|
371
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, session));
|
|
372
|
+
}
|
|
373
|
+
return registry.getSession(sessionId);
|
|
374
|
+
}
|
|
375
|
+
case 'session/set': {
|
|
376
|
+
const sessionId = readSessionId(payload);
|
|
377
|
+
const previous = registry.getSession(sessionId);
|
|
378
|
+
const config = readSessionConfig(payload);
|
|
379
|
+
const saved = registry.setSession(sessionId, config);
|
|
380
|
+
selectExternalModelForSession(dshContext, sessionId, saved);
|
|
381
|
+
if (config.translationEnabled === false || previous.adapterId !== config.adapterId)
|
|
382
|
+
translationRecovery.cancelSession(sessionId);
|
|
383
|
+
return saved;
|
|
384
|
+
}
|
|
385
|
+
case 'session/list': return registry.listSessions(readSessionListOptions(payload));
|
|
386
|
+
case 'session/adapter-map':
|
|
387
|
+
// 列表查询只返回持久化索引,不能触发会话加载或历史解析。
|
|
388
|
+
return sessionStore.adapterBindings();
|
|
389
|
+
case 'session/archive': return registry.archiveSession(readSessionId(payload));
|
|
390
|
+
case 'session/steer': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), false, signal);
|
|
391
|
+
case 'session/follow-up': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), true, signal);
|
|
392
|
+
case 'session/interrupt': {
|
|
393
|
+
const sessionId = readSessionId(payload);
|
|
394
|
+
translationRecovery.cancelSession(sessionId);
|
|
395
|
+
return registry.interrupt(sessionId);
|
|
396
|
+
}
|
|
397
|
+
case 'team/status': return context.services.nativeTeam?.diagnostic() ?? registry.teamDiagnostic();
|
|
398
|
+
case 'team/mode': return Promise.resolve(requireTeam(context).invoke('mode', payload, signal)).then(() => ({ enabled: asRecord(payload)?.enabled === true }));
|
|
399
|
+
case 'team/members': return requireTeam(context).invoke('members', payload);
|
|
400
|
+
case 'team/tasks': return requireTeam(context).invoke('tasks', payload);
|
|
401
|
+
case 'team/task': return requireTeam(context).invoke('task', payload);
|
|
402
|
+
case 'team/spawn': return requireTeam(context).invoke('spawn', payload);
|
|
403
|
+
case 'team/message': return requireTeam(context).invoke('message', payload);
|
|
404
|
+
case 'team/task/create': return requireTeam(context).invoke('task/create', payload);
|
|
405
|
+
case 'team/task/update': return requireTeam(context).invoke('task/update', payload);
|
|
406
|
+
case 'team/wait': return requireTeam(context).invoke('wait', payload);
|
|
407
|
+
case 'team/interrupt': return requireTeam(context).invoke('interrupt', payload);
|
|
408
|
+
case 'subscription': {
|
|
409
|
+
const subscription = readSubscriptionRequest(payload);
|
|
410
|
+
const requestSignal = signal ?? lifetime.signal;
|
|
411
|
+
// A newly opened native DSH session may not be in the Host bridge's
|
|
412
|
+
// local store yet. Adopt it before reading the Registry, otherwise
|
|
413
|
+
// the native model/provider selection is invisible and the request
|
|
414
|
+
// incorrectly falls back to the official DSH balance.
|
|
415
|
+
if (subscription.adapterId === 'dsh' && subscription.sessionId !== undefined && nativeSessions !== undefined) {
|
|
416
|
+
await nativeSessions.ensure(subscription.sessionId);
|
|
417
|
+
requestSignal.throwIfAborted();
|
|
418
|
+
}
|
|
419
|
+
const session = subscription.sessionId === undefined ? undefined : registry.getSession(subscription.sessionId);
|
|
420
|
+
requestSignal.throwIfAborted();
|
|
421
|
+
const providerUsage = await subscriptions.read(subscription.adapterId, subscription.providerId, subscription.modelId);
|
|
422
|
+
return { providerUsage };
|
|
423
|
+
}
|
|
424
|
+
case 'subscription/reset': {
|
|
425
|
+
const subscription = readSubscriptionResetRequest(payload);
|
|
426
|
+
return subscriptions.reset(subscription.adapterId, subscription.providerId);
|
|
427
|
+
}
|
|
428
|
+
// `/委派` 的 Host 边界:先给 Client 一个可读的能力诊断,再落地异步派发。
|
|
429
|
+
case 'delegate/capability': {
|
|
430
|
+
return delegateCapability({
|
|
431
|
+
agents: readOptionalContextService(context.services.dshContext, 'agents'),
|
|
432
|
+
nativeSessions: context.services.nativeSessions,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
case 'delegate': {
|
|
436
|
+
const request = readDelegateRequest(payload);
|
|
437
|
+
return dispatchDelegateSubagent(request, {
|
|
438
|
+
agents: readOptionalContextService(context.services.dshContext, 'agents'),
|
|
439
|
+
nativeSessions: context.services.nativeSessions,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
default: throw new Error(`未知 CLI RPC: cli/${action}`);
|
|
443
|
+
}
|
|
444
|
+
}));
|
|
445
|
+
// 外部 CLI 子代理托管:开启时启动本机回环桥接,把外部 CLI 的子代理调用
|
|
446
|
+
// 转投成 DSH 原生可续子会话;关闭或模块停用时收回端口并清空驱动句柄。
|
|
447
|
+
let bridgeServer;
|
|
448
|
+
let bridgeSync = Promise.resolve();
|
|
449
|
+
const syncSubagentBridge = async (enabled) => {
|
|
450
|
+
if (enabled === (bridgeServer !== undefined))
|
|
451
|
+
return;
|
|
452
|
+
if (!enabled) {
|
|
453
|
+
const server = bridgeServer;
|
|
454
|
+
bridgeServer = undefined;
|
|
455
|
+
setSubagentBridge(undefined);
|
|
456
|
+
await server?.close();
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
try {
|
|
460
|
+
const agents = readOptionalContextService(context.services.dshContext, 'agents');
|
|
461
|
+
const server = await startSubagentBridgeServer({
|
|
462
|
+
teamAccess: (sessionId) => teamDispatcher.access(sessionId),
|
|
463
|
+
teamDispatch: (sessionId, input, signal) => teamDispatcher.dispatch(sessionId, input, signal),
|
|
464
|
+
dispatch: (request) => dispatchBridgeSubagent(request, {
|
|
465
|
+
agents: agents,
|
|
466
|
+
nativeSessions: context.services.nativeSessions,
|
|
467
|
+
}),
|
|
468
|
+
search: (input, signal) => dispatchBridgeSearch(input, {
|
|
469
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
470
|
+
}, signal),
|
|
471
|
+
fetch: (input, signal) => dispatchBridgeFetch(input, {
|
|
472
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
473
|
+
}, signal),
|
|
474
|
+
});
|
|
475
|
+
bridgeServer = server;
|
|
476
|
+
setSubagentBridge(server.runtime);
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
console.warn('dsh-agentdoor: 外部 Agent 子代理桥接启动失败', error);
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
const scheduleSubagentBridgeSync = (enabled) => {
|
|
483
|
+
bridgeSync = bridgeSync.then(() => syncSubagentBridge(enabled), () => syncSubagentBridge(enabled));
|
|
484
|
+
};
|
|
485
|
+
const syncSubagentBridgeSettings = (raw) => {
|
|
486
|
+
const bridgeSettings = normalizeSubagentBridgeSettings(raw);
|
|
487
|
+
// 并发上限先于桥接启停生效:桥接开启后立刻到达的并行调用必须看到用户配置,
|
|
488
|
+
// 否则第一批派发仍会撞上缺省上限。
|
|
489
|
+
setMaxNativeSubagentsPerParent(bridgeSettings.maxConcurrentSubagents);
|
|
490
|
+
scheduleSubagentBridgeSync(bridgeSettings.enabled);
|
|
491
|
+
};
|
|
492
|
+
// 初始值必须在任何派发之前落地:桥接开启后第一批并行调用就会读取上限。
|
|
493
|
+
syncSubagentBridgeSettings(context.services.settings?.get().subagentBridge);
|
|
494
|
+
await bridgeSync;
|
|
495
|
+
context.resources.add(async () => {
|
|
496
|
+
const server = bridgeServer;
|
|
497
|
+
bridgeServer = undefined;
|
|
498
|
+
setSubagentBridge(undefined);
|
|
499
|
+
await server?.close();
|
|
500
|
+
});
|
|
501
|
+
const settings = context.services.settings;
|
|
502
|
+
if (settings !== undefined) {
|
|
503
|
+
context.resources.add(settings.watch((next) => {
|
|
504
|
+
registry.applyEnabledSettings(next.agentAdapters);
|
|
505
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
506
|
+
registry.syncPreferences(next.agentAdapterPreferences);
|
|
507
|
+
sessionStore.sync(next.cliSessions);
|
|
508
|
+
translationRecovery.cancelDisabled(next.sessionTranslation);
|
|
509
|
+
const nextSubscriptionSettings = JSON.stringify(next.subscriptionUsage ?? null);
|
|
510
|
+
if (nextSubscriptionSettings !== subscriptionSettings) {
|
|
511
|
+
subscriptionSettings = nextSubscriptionSettings;
|
|
512
|
+
subscriptions = buildSubscriptions(next);
|
|
513
|
+
}
|
|
514
|
+
syncSubagentBridgeSettings(next.subagentBridge);
|
|
515
|
+
}));
|
|
516
|
+
}
|
|
517
|
+
const events = context.services.events;
|
|
518
|
+
if (events !== undefined) {
|
|
519
|
+
const dispose = events.on('llm/stream', async function* (options, next) {
|
|
520
|
+
const value = asRecord(options);
|
|
521
|
+
// 翻译服务也复用 DSH 原生 LLM,但它不是外部 Agent 回合;必须在这里
|
|
522
|
+
// 旁路 CLI Provider 接管,否则翻译请求会被再次当成 Grok/Codex 请求。
|
|
523
|
+
if (isSessionTranslationLlmRequest(value)) {
|
|
524
|
+
yield* next();
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
const sessionId = readAgentSessionId(value);
|
|
528
|
+
if (value?.purpose === 'session-title' || value?.purpose === 'compaction') {
|
|
529
|
+
yield* next();
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
// fork 子会话继承父会话历史,但可能还没被任何 RPC 触碰过;用户直接在
|
|
533
|
+
// 子会话里发消息时,这里必须补一次迁移,否则子会话会被当成默认 DSH
|
|
534
|
+
// 会话,用户看到的仍是 DSH 主模型而不是原来的外部 Agent。子会话的
|
|
535
|
+
// 绑定来自父会话,所以父会话必须一起进入同一批迁移。
|
|
536
|
+
if (sessionId !== '' && nativeSessions !== undefined) {
|
|
537
|
+
const nativeSession = nativeSessions.get(sessionId);
|
|
538
|
+
if (nativeSession !== undefined) {
|
|
539
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, nativeSession));
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const storedConfig = sessionId ? registry.getSession(sessionId) : { adapterId: 'dsh' };
|
|
543
|
+
// DSH 原生请求仍会携带当前模型提供方。旧会话在重载后可能暂时
|
|
544
|
+
// 被恢复成 dsh,但 provider 已明确指向外部 Agent;继续旁路会让
|
|
545
|
+
// 第二轮直接落入 DSH 空流,并丢失外部驱动的 usage/context 修正。
|
|
546
|
+
const dshSelection = readDshSelection(value);
|
|
547
|
+
const capturedRoute = fixedStepRoutes && dshSelection.providerId !== undefined && dshSelection.modelId !== undefined;
|
|
548
|
+
const capturedAdapter = capturedRoute ? fromCliProviderId(dshSelection.providerId) : undefined;
|
|
549
|
+
let messages = Array.isArray(value?.messages) ? value.messages.filter(isMessage) : [];
|
|
550
|
+
// 委派 carrier 只在普通对话提交时消费。选择 Agent 本身不会经过这里,也不会创建
|
|
551
|
+
// 子会话;Agent Loop 请求会在 agent/pre-step 边界完成改写。这里仅保留
|
|
552
|
+
// 非 Agent Loop 手工 llm/stream 调用的错误消费和外部 Agent 局部解析。
|
|
553
|
+
if (containsDelegationCarrier(messages)) {
|
|
554
|
+
const delegation = rewriteDelegationMessages(messages, await registry.catalogForUse(delegationAdapterIds(messages)));
|
|
555
|
+
if (delegation.kind === 'error') {
|
|
556
|
+
yield* delegationErrorStream(`${delegation.error.code}: ${delegation.error.message}`);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if (delegation.kind === 'rewritten') {
|
|
560
|
+
// DSH Agent Loop 传入的 options 是深冻结对象,不能把改写结果写回
|
|
561
|
+
// `value.messages`。外部适配器只消费本地快照,原生 Agent 的 carrier
|
|
562
|
+
// 已在 agent/pre-step 中被替换并持久化。
|
|
563
|
+
setDelegationAuthorization(sessionId, delegation.value.targets);
|
|
564
|
+
messages = [...delegation.value.messages];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
else if (sessionId !== '')
|
|
568
|
+
clearDelegationAuthorization(sessionId);
|
|
569
|
+
const selectedExternalAdapter = capturedRoute ? capturedAdapter : storedConfig.adapterId === 'dsh' && storedConfig.teamId ? undefined : selectExternalAdapter(fromCliProviderId(dshSelection.providerId), inferMessageAdapter(messages), registry);
|
|
570
|
+
// DSH 的 modelSelection 只描述 DSH 自己那条模型路由(例如 glor/deepseek)。
|
|
571
|
+
// 只有它明确指向即将接管的外部适配器时,model/effort 才属于该适配器;
|
|
572
|
+
// 当适配器是从会话历史推断出来的(fork 子会话继承父会话的外部消息,而
|
|
573
|
+
// provider 仍是 DSH 主模型)时,沿用该 model 会把别的 Provider 的模型名
|
|
574
|
+
// 写进外部 Agent——Codex 会用它 thread/start 并直接 404,整个会话从此
|
|
575
|
+
// 无法继续。此时必须留空,由适配器自己的偏好决定模型。
|
|
576
|
+
const selectionOwnedByAdapter = selectedExternalAdapter !== undefined
|
|
577
|
+
&& (fromCliProviderId(dshSelection.providerId) ?? dshSelection.providerId) === selectedExternalAdapter;
|
|
578
|
+
let config = storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined
|
|
579
|
+
? {
|
|
580
|
+
adapterId: selectedExternalAdapter,
|
|
581
|
+
...(selectionOwnedByAdapter && dshSelection.modelId !== undefined ? { modelId: dshSelection.modelId } : {}),
|
|
582
|
+
...(selectionOwnedByAdapter && dshSelection.effortId !== undefined ? { effortId: dshSelection.effortId } : {}),
|
|
583
|
+
}
|
|
584
|
+
: storedConfig;
|
|
585
|
+
if (capturedRoute) {
|
|
586
|
+
const { modelId: _nextModel, ...preparedConfig } = storedConfig.adapterId === (capturedAdapter ?? 'dsh')
|
|
587
|
+
? storedConfig : { adapterId: capturedAdapter ?? 'dsh' };
|
|
588
|
+
config = {
|
|
589
|
+
...preparedConfig,
|
|
590
|
+
...(dshSelection.modelId !== 'provider-default' ? { modelId: dshSelection.modelId } : {}),
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
// DSH 首轮请求可能只通过 provider 临时选择外部 Agent,第二轮请求通常不再携带
|
|
594
|
+
// provider。必须在路由决定后立即持久化绑定,否则下一轮会在进入 Registry 前退回 dsh。
|
|
595
|
+
// 采用规范化结果,让本轮也使用适配器自己的模型偏好,而不是 DSH 主模型。
|
|
596
|
+
if (!capturedRoute && sessionId !== '' && storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined) {
|
|
597
|
+
config = registry.setSession(sessionId, config);
|
|
598
|
+
}
|
|
599
|
+
// Team 模式被手动关闭时没有 Team 令牌,外部成员这一回合按普通会话继续;
|
|
600
|
+
// 其余情况(服务被移除、适配器缺失)仍然阻断,避免成员带着失效身份运行。
|
|
601
|
+
if (config.teamId && !teamDispatcher.identity(sessionId) && !teamDispatcher.isTeamModeDisabled(sessionId)) {
|
|
602
|
+
throw Object.assign(new Error('The native Team identity is unavailable. Restore its Team profile and adapter before continuing.'), { code: 'TEAM_SERVICE_UNAVAILABLE' });
|
|
603
|
+
}
|
|
604
|
+
const turnInput = extractTurnInput(messages, context.services.dshContext, teamInputs.take(sessionId, messages));
|
|
605
|
+
const credentialResolution = await resolveCredentialEnvironment(context.services.credentials, context.services.credentialBroker, sessionId, config.credentialRefs, turnInput.credentialCarriers, config.adapterId === 'dsh');
|
|
606
|
+
if (config.adapterId === 'dsh') {
|
|
607
|
+
if (credentialResolution !== undefined && context.services.credentialBroker?.nativeToolAvailable() !== true) {
|
|
608
|
+
throw new AgentDoorRpcError('CREDENTIAL_INJECTION_UNSUPPORTED', 'Native DSH credential tool is unavailable');
|
|
609
|
+
}
|
|
610
|
+
const selection = dshSelection;
|
|
611
|
+
if (sessionId !== '' && (selection.modelId !== undefined || selection.effortId !== undefined)) {
|
|
612
|
+
registry.setSession(sessionId, { adapterId: 'dsh', ...selection });
|
|
613
|
+
}
|
|
614
|
+
// Native-session output translation wraps only DSH's own Provider stream:
|
|
615
|
+
// preserve text/reasoning and attach the translation record; the client renders it.
|
|
616
|
+
if (!isSessionTranslationLlmRequest(value)
|
|
617
|
+
&& translation !== undefined
|
|
618
|
+
&& translation.enabled
|
|
619
|
+
&& (config.translationEnabled ?? translation.nativeEnabled === true)
|
|
620
|
+
&& sessionId !== ''
|
|
621
|
+
&& !isAssistantSession(sessionId)
|
|
622
|
+
&& readNativeSessionHeader(nativeSessions, sessionId)?.origin !== 'subagent') {
|
|
623
|
+
yield* guardDshNativeStream(() => translateNativeStream(next(), translation, translation.bilingual === true, isAbortSignal(value?.signal) ? value.signal : undefined));
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
yield* guardDshNativeStream(() => next());
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
const cwd = resolveSessionCwd(context.services.nativeSessions, sessionId, value);
|
|
630
|
+
const turnOptions = readCliTurnOptions(value);
|
|
631
|
+
const runtimeEnv = readCliRuntimeEnv(value);
|
|
632
|
+
const requestSignal = isAbortSignal(value?.signal)
|
|
633
|
+
? AbortSignal.any([value.signal, lifetime.signal])
|
|
634
|
+
: lifetime.signal;
|
|
635
|
+
const translationLanguage = translation?.enabled && isSessionTranslationInputEnabled(translation, config.adapterId) && config.translationEnabled === true ? readInputTargetLanguage(translation) : undefined;
|
|
636
|
+
let translatedPrompt = turnInput.translationPrompt;
|
|
637
|
+
if (turnInput.translatePrompt && turnInput.translationPrompt.trim() !== '' && translationLanguage !== undefined) {
|
|
638
|
+
try {
|
|
639
|
+
translatedPrompt = (await translationRecovery.translateInput(sessionId, config.adapterId, turnInput.translationPrompt, requestSignal)).translated;
|
|
640
|
+
}
|
|
641
|
+
catch (error) {
|
|
642
|
+
if (!(error instanceof SessionTranslationCancelled) && !requestSignal?.aborted)
|
|
643
|
+
throw error;
|
|
644
|
+
yield { type: 'finish', reason: { kind: 'stop' } };
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
const userPrompt = turnInput.translatePrompt
|
|
649
|
+
? [translatedPrompt, translationLanguage === undefined ? turnInput.untranslatedPrompt : attachmentNotices(turnInput.attachments, translationLanguage)].filter((part) => part.trim() !== '').join('\n\n')
|
|
650
|
+
: turnInput.prompt;
|
|
651
|
+
const prompt = [formatCredentialUsageNotice(credentialResolution), userPrompt]
|
|
652
|
+
.filter((part) => part.trim() !== '')
|
|
653
|
+
.join('\n\n');
|
|
654
|
+
// 权限状态必须与 DSH 会话当前生效值同源。驱动不能自行假设“完全权限”,
|
|
655
|
+
// 也不能把缺省当成“已确认无限制”:解析失败时留空,由驱动沿用保守默认。
|
|
656
|
+
const permission = resolveNativeApprovalPermission(config, resolveSessionPermission(context.services.dshContext, sessionId));
|
|
657
|
+
// 只有 Provider 驱动明确声明可以维护连续事件流,才把工具边界映射为 DSH step。
|
|
658
|
+
// Command Code、Codex 自己维护 assistant 消息边界;OpenCode 由 Registry
|
|
659
|
+
// 挂起并续读同一条 SSE。其他驱动仍把整轮保持在一个 step,避免 token-meter
|
|
660
|
+
// 在下一条 usage 到达前失去投影。
|
|
661
|
+
const input = {
|
|
662
|
+
sessionId,
|
|
663
|
+
messages: turnInput.messages,
|
|
664
|
+
prompt,
|
|
665
|
+
...(turnInput.peerInput ? { peerInput: true } : {}),
|
|
666
|
+
...(translationLanguage === undefined ? {} : { translationLanguage }),
|
|
667
|
+
...(turnInput.attachments.length === 0 ? {} : { attachments: turnInput.attachments }),
|
|
668
|
+
...(permission === undefined ? {} : { permission }),
|
|
669
|
+
...(turnOptions.plan === true ? { plan: true } : {}),
|
|
670
|
+
...(turnOptions.forkSession === true ? { forkSession: true } : {}),
|
|
671
|
+
...(turnOptions.enableAskUserQuestion === true ? { enableAskUserQuestion: true } : {}),
|
|
672
|
+
...(runtimeEnv === undefined && credentialResolution === undefined
|
|
673
|
+
? {}
|
|
674
|
+
: { runtimeEnv: { ...(runtimeEnv ?? {}), ...(credentialResolution?.runtimeEnv ?? {}) } }),
|
|
675
|
+
...(config.modelId ? { modelId: config.modelId } : {}),
|
|
676
|
+
...(config.effortId ? { effortId: config.effortId } : {}),
|
|
677
|
+
...(config.serviceTierId ? { serviceTierId: config.serviceTierId } : {}),
|
|
678
|
+
...(config.translationEnabled === undefined ? {} : { translationEnabled: config.translationEnabled }),
|
|
679
|
+
...(config.providerSessionId ? { providerSessionId: config.providerSessionId } : {}),
|
|
680
|
+
...(config.rawStoreRef ? { rawStoreRef: config.rawStoreRef } : {}),
|
|
681
|
+
...(cwd === undefined ? {} : { cwd }),
|
|
682
|
+
...(requestSignal === undefined ? {} : { signal: requestSignal }),
|
|
683
|
+
...((registry.supportsSegmentedTurns(config.adapterId) || registry.supportsToolStepSplitting(config.adapterId))
|
|
684
|
+
// SessionStore/controller 可能是远端代理而未标记 available,但原生
|
|
685
|
+
// Agent 仍然提供 inject;用真实的 next-step 能力决定分段,不能让
|
|
686
|
+
// available 这个聚合状态把 OpenCode/Command Code 退回单 step。
|
|
687
|
+
&& nativeSessions?.injectNextStep !== undefined
|
|
688
|
+
&& (nativeSessions.canInjectNextStep === undefined
|
|
689
|
+
|| nativeSessions.canInjectNextStep(sessionId))
|
|
690
|
+
? { splitToolSteps: true }
|
|
691
|
+
: {}),
|
|
692
|
+
};
|
|
693
|
+
const projector = new AgentDoorDshMessageProjector({
|
|
694
|
+
adapterId: config.adapterId,
|
|
695
|
+
sessionId,
|
|
696
|
+
...(config.modelId === undefined ? {} : { modelId: config.modelId }),
|
|
697
|
+
...(permission === undefined ? {} : { permission }),
|
|
698
|
+
...(nativeSessions === undefined ? {} : { nativeSessions }),
|
|
699
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
700
|
+
respondPermission: (response) => registry.respondPermission(sessionId, response),
|
|
701
|
+
respondQuestion: (response) => registry.respondQuestion(sessionId, response),
|
|
702
|
+
...(translation === undefined ? {} : { translation }),
|
|
703
|
+
...(translation === undefined ? {} : { translationEnabled: config.translationEnabled === true }),
|
|
704
|
+
prefetchQuestionTranslation: questions => {
|
|
705
|
+
const fields = questionTranslationFields(questions);
|
|
706
|
+
if (fields.length === 0)
|
|
707
|
+
return;
|
|
708
|
+
interactionTranslation.prefetch({ sessionId, category: interactionQuestionCategory(questions), direction: 'output', fields });
|
|
709
|
+
},
|
|
710
|
+
});
|
|
711
|
+
const discardSuspendedTurn = () => registry.discardSegmentedTurn(sessionId);
|
|
712
|
+
input.signal?.addEventListener('abort', discardSuspendedTurn, { once: true });
|
|
713
|
+
if (input.signal?.aborted)
|
|
714
|
+
discardSuspendedTurn();
|
|
715
|
+
// DSH UI 的会话和子智能体运行点由 api-session/status 驱动。
|
|
716
|
+
// 外部适配器绕过 DSH 原生 Agent Loop,必须在真正执行外部流前补发同一状态,
|
|
717
|
+
// 否则外部子会话完成后虽已写入历史,客户端目录仍不会得到 running -> idle。
|
|
718
|
+
publishExternalStatus(sessionId, true);
|
|
719
|
+
// 分步驱动(OpenCode、Claude、CodeBuddy 等)在工具完成处只结束一个 DSH
|
|
720
|
+
// step:Agent Loop 注入 next-step 后仍停留在同一个 turn 里继续下一步。
|
|
721
|
+
// 这种挂起不是回合结束,本段 llm/stream 返回时不能播报 idle,否则每个
|
|
722
|
+
// 工具完成都会先「已完成」再「进行中」,会话状态随工具调用反复闪烁。
|
|
723
|
+
// 真正的收尾由最后一段的 finish、原生 turn/end 与 agent/status idle 补齐。
|
|
724
|
+
let suspendedForNextStep = false;
|
|
725
|
+
try {
|
|
726
|
+
for await (const chunk of registry.execute({ ...input, adapterId: config.adapterId })) {
|
|
727
|
+
if (chunk.type === 'step-boundary') {
|
|
728
|
+
if (input.signal?.aborted) {
|
|
729
|
+
discardSuspendedTurn();
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
// Agent Loop 会在本次 llm/stream 返回后关闭当前 step,并在返回前
|
|
733
|
+
// 检查 next-step inbox。必须先注入,再发送 finish,不能等 complete()
|
|
734
|
+
// 之后再写入,否则 DSH 已经把整个 turn 结算完了。
|
|
735
|
+
const injected = nativeSessions?.injectNextStep?.(sessionId) ?? false;
|
|
736
|
+
if (!injected)
|
|
737
|
+
discardSuspendedTurn();
|
|
738
|
+
else
|
|
739
|
+
suspendedForNextStep = true;
|
|
740
|
+
for (const dshChunk of await projector.push(chunk))
|
|
741
|
+
yield dshChunk;
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
for (const dshChunk of await projector.push(chunk))
|
|
745
|
+
yield dshChunk;
|
|
746
|
+
// DSH 要求 finish 是唯一且最后一个 chunk。这里 return 也会关闭上游迭代器。
|
|
747
|
+
if (projector.isFinished)
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
const reason = input.signal?.aborted ? 'cancel' : 'stop';
|
|
751
|
+
for (const dshChunk of await projector.complete(reason))
|
|
752
|
+
yield dshChunk;
|
|
753
|
+
}
|
|
754
|
+
catch (error) {
|
|
755
|
+
const message = safeError(error);
|
|
756
|
+
for (const dshChunk of await projector.fail(message, input.signal?.aborted ?? false))
|
|
757
|
+
yield dshChunk;
|
|
758
|
+
}
|
|
759
|
+
finally {
|
|
760
|
+
input.signal?.removeEventListener('abort', discardSuspendedTurn);
|
|
761
|
+
// 挂起续段不是回合结束:这里不能播报 idle,否则每个工具完成都会让会话
|
|
762
|
+
// 状态在「已完成 / 进行中」之间来回闪烁。收尾由最后一段的 finish、
|
|
763
|
+
// 原生 turn/end 与 agent/status idle 补齐。
|
|
764
|
+
if (!suspendedForNextStep)
|
|
765
|
+
publishExternalStatus(sessionId, false);
|
|
766
|
+
}
|
|
767
|
+
}, { global: true });
|
|
768
|
+
if (typeof dispose === 'function')
|
|
769
|
+
context.resources.add(() => { dispose(); });
|
|
770
|
+
}
|
|
771
|
+
context.resources.add(async () => {
|
|
772
|
+
// DSH 先停用设置上下文再执行异步资源清理时,旧的写队列不能继续调用
|
|
773
|
+
// configEditor,否则会出现 inactive context 并污染退出日志。
|
|
774
|
+
sessionStore.dispose();
|
|
775
|
+
// Close native interaction cards before unloading their provider transports.
|
|
776
|
+
lifetime.abort();
|
|
777
|
+
updates.dispose();
|
|
778
|
+
await management.dispose();
|
|
779
|
+
await registry.dispose();
|
|
780
|
+
await sessionStore.flush();
|
|
781
|
+
setAdapterRegistry(undefined);
|
|
782
|
+
});
|
|
783
|
+
},
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function requireTeam(context) {
|
|
787
|
+
if (context.services.nativeTeam === undefined)
|
|
788
|
+
throw new Error('DSH_TEAM_NATIVE_UNAVAILABLE');
|
|
789
|
+
return context.services.nativeTeam;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* 为外部 Agent 建立单一状态投影出口。
|
|
793
|
+
*
|
|
794
|
+
* DSH 自己的 Agent 状态由原生 SessionController 负责,插件只给已绑定外部
|
|
795
|
+
* 适配器的会话补发状态;未知会话按 DSH 处理,避免误把原生 Agent 标成外部。
|
|
796
|
+
*/
|
|
797
|
+
function createExternalSessionStatusPublisher(events, registry, sessionStore) {
|
|
798
|
+
const lastPublished = new Map();
|
|
799
|
+
return (sessionId, running) => {
|
|
800
|
+
const id = sessionId.trim();
|
|
801
|
+
if (id === '' || events?.emit === undefined)
|
|
802
|
+
return;
|
|
803
|
+
const stored = sessionStore.get(id);
|
|
804
|
+
let adapterId = stored?.adapterId;
|
|
805
|
+
if (adapterId === undefined) {
|
|
806
|
+
try {
|
|
807
|
+
adapterId = registry.getSession(id).adapterId;
|
|
808
|
+
}
|
|
809
|
+
catch {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
if (adapterId === 'dsh' || adapterId === undefined)
|
|
814
|
+
return;
|
|
815
|
+
if (lastPublished.get(id) === running)
|
|
816
|
+
return;
|
|
817
|
+
try {
|
|
818
|
+
events.emit('api-session/status', id, running);
|
|
819
|
+
lastPublished.set(id, running);
|
|
820
|
+
}
|
|
821
|
+
catch {
|
|
822
|
+
// 状态提示是 UI 增强能力,不能因为精简 Host 没有完整事件转发器而阻断回合。
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* 在 Agent Loop 的可变输入边界消费委派 carrier。
|
|
828
|
+
*
|
|
829
|
+
* `llm/stream` 收到的 LOOP 请求由 DSH 深冻结,监听器只能读取;如果在那里改写
|
|
830
|
+
* `messages`,会直接抛出只读属性异常。`agent/pre-step` 返回的新消息保留用户原文,并把
|
|
831
|
+
* 译文写入 source 元数据;外部适配器再据此构造发给 Agent 的译文。
|
|
832
|
+
*/
|
|
833
|
+
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation, translationRecovery, credentialBroker, nativeSessions, teamInputs, fixedStepRoutes = false) {
|
|
834
|
+
if (dshContext === undefined || typeof dshContext.on !== 'function')
|
|
835
|
+
return;
|
|
836
|
+
const disposers = [];
|
|
837
|
+
// RC.1 assembleContextFor supplies the live agent alongside its opaque scope.
|
|
838
|
+
// Resolve the same native and per-session policy used for human input.
|
|
839
|
+
const promptTranslation = createSessionPromptTranslation(translation, sessionId => {
|
|
840
|
+
if (sessionId.trim() === '' || isAssistantSession(sessionId))
|
|
841
|
+
return undefined;
|
|
842
|
+
try {
|
|
843
|
+
const session = registry.getSession(sessionId);
|
|
844
|
+
if (session.adapterId === DSH_NATIVE_SESSION_ADAPTER_ID) {
|
|
845
|
+
const native = nativePreStepContext(translation, registry, sessionId, nativeSessions);
|
|
846
|
+
return native?.translationEnabled === true ? native.adapterId : undefined;
|
|
847
|
+
}
|
|
848
|
+
return session.translationEnabled === true && supportsSessionTranslation(session.adapterId) ? session.adapterId : undefined;
|
|
849
|
+
}
|
|
850
|
+
catch {
|
|
851
|
+
return undefined;
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
resources.add(() => promptTranslation.dispose());
|
|
855
|
+
if (supportsSessionPromptAssembly(dshContext))
|
|
856
|
+
resources.add(createSessionPromptAdapter(dshContext).install(promptTranslation.translateAssembly));
|
|
857
|
+
const register = (name, listener) => {
|
|
858
|
+
// Wrap existing pre-step producers so their after-next catalogs are visible.
|
|
859
|
+
const disposer = dshContext.on(name, listener, { global: true, prepend: name === 'agent/pre-step' });
|
|
860
|
+
if (typeof disposer === 'function')
|
|
861
|
+
disposers.push(disposer);
|
|
862
|
+
};
|
|
863
|
+
// DSH Agent Loop 会用 agent/request 的 provider/model 生成 assistant/message.source。
|
|
864
|
+
// 外部流虽然在 llm/stream 旁路执行,但如果这里仍保留 DeepSeek 路由,回复历史
|
|
865
|
+
// 就会被错误归属为 DeepSeek。只改写已绑定的外部会话,不影响 DSH 原生会话。
|
|
866
|
+
register('agent/request', async (payload, next) => {
|
|
867
|
+
const resolved = await next();
|
|
868
|
+
const config = asRecord(resolved);
|
|
869
|
+
if (config === null)
|
|
870
|
+
return resolved;
|
|
871
|
+
// RC.1 freezes provider/model selection before this deprecated waterfall.
|
|
872
|
+
// The pre-step hook already selected the route through agent.model.select().
|
|
873
|
+
if (supportsAgentModelSelection(asRecord(payload)?.agent))
|
|
874
|
+
return config;
|
|
875
|
+
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
876
|
+
if (sessionId === '')
|
|
877
|
+
return config;
|
|
878
|
+
let session;
|
|
879
|
+
try {
|
|
880
|
+
session = registry.getSession(sessionId);
|
|
881
|
+
}
|
|
882
|
+
catch {
|
|
883
|
+
return config;
|
|
884
|
+
}
|
|
885
|
+
if (session.adapterId === 'dsh' && session.teamId && session.providerId && session.modelId) {
|
|
886
|
+
const { reasoningEffort: _effort, ...nativeConfig } = config;
|
|
887
|
+
return { ...nativeConfig, provider: session.providerId, model: session.modelId, ...(session.effortId ? { reasoningEffort: session.effortId } : {}) };
|
|
888
|
+
}
|
|
889
|
+
const providerAdapter = fromCliProviderId(config.provider);
|
|
890
|
+
const configuredAdapter = session.adapterId !== 'dsh' && registry.isEnabled(session.adapterId)
|
|
891
|
+
? session.adapterId
|
|
892
|
+
: providerAdapter !== undefined && registry.isEnabled(providerAdapter)
|
|
893
|
+
? providerAdapter
|
|
894
|
+
: undefined;
|
|
895
|
+
if (configuredAdapter === undefined)
|
|
896
|
+
return config;
|
|
897
|
+
if (session.adapterId === 'dsh') {
|
|
898
|
+
session = registry.setSession(sessionId, {
|
|
899
|
+
adapterId: configuredAdapter,
|
|
900
|
+
...(typeof config.model === 'string' && config.model.trim() !== '' ? { modelId: config.model.trim() } : {}),
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
const model = session.modelId?.trim() || (typeof config.model === 'string' && config.model.trim() !== '' ? config.model.trim() : configuredAdapter);
|
|
904
|
+
// reasoningEffort 属于被改写掉的那条 DSH 原生路由(例如全局默认模型 glor/deepseek-v4.1-flash
|
|
905
|
+
// 的 max)。外部 CLI 的虚拟 Provider 不声明任何思考强度,DSH 会在准入阶段以
|
|
906
|
+
// UNSUPPORTED_REASONING_EFFORT 拒绝整轮;外部 Agent 的思考强度由适配器自己的
|
|
907
|
+
// effortId 偏好驱动,因此这里必须丢弃继承值,只改写 provider/model。
|
|
908
|
+
const { reasoningEffort: _inheritedReasoningEffort, ...routeConfig } = config;
|
|
909
|
+
return { ...routeConfig, provider: toCliProviderId(configuredAdapter), model };
|
|
910
|
+
});
|
|
911
|
+
register('agent/pre-step', async (payload, next) => {
|
|
912
|
+
const record = asRecord(payload);
|
|
913
|
+
const sessionId = readAgentSessionId(record?.agent);
|
|
914
|
+
selectExternalModelBeforeStep(record?.agent, sessionId, registry);
|
|
915
|
+
let messages = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
916
|
+
let delegation;
|
|
917
|
+
if (containsDelegationCarrier(messages)) {
|
|
918
|
+
delegation = rewriteDelegationMessages(messages, await registry.catalogForUse(delegationAdapterIds(messages)));
|
|
919
|
+
if (delegation.kind === 'error')
|
|
920
|
+
clearDelegationAuthorization(sessionId);
|
|
921
|
+
else if (delegation.kind === 'rewritten') {
|
|
922
|
+
setDelegationAuthorization(sessionId, delegation.value.targets);
|
|
923
|
+
messages = [...delegation.value.messages];
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
let translatedInput;
|
|
927
|
+
try {
|
|
928
|
+
translatedInput = await translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, isAbortSignal(record?.signal) ? record.signal : undefined, nativePreStepContext(translation, registry, sessionId, nativeSessions));
|
|
929
|
+
}
|
|
930
|
+
catch (error) {
|
|
931
|
+
if (error instanceof SessionTranslationCancelled || record?.signal?.aborted === true)
|
|
932
|
+
return { kind: 'reject' };
|
|
933
|
+
throw error;
|
|
934
|
+
}
|
|
935
|
+
const decision = await next();
|
|
936
|
+
if (!isEnterPreStepDecision(decision))
|
|
937
|
+
return decision;
|
|
938
|
+
// Match producer-owned messages by identity. Downstream middleware may insert
|
|
939
|
+
// instructions before the human message, so a positional prefix loses data.
|
|
940
|
+
const incoming = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
941
|
+
const replaced = new Set();
|
|
942
|
+
const replacements = translatedInput ?? messages;
|
|
943
|
+
const accepted = delegation?.kind === 'rewritten' || translatedInput !== undefined
|
|
944
|
+
? decision.messages.flatMap(message => {
|
|
945
|
+
const index = incoming.findIndex((original, position) => !replaced.has(position) && (original === message || typeof original.id === 'string' && original.id === message.id
|
|
946
|
+
// Legacy callers can return detached messages without durable IDs.
|
|
947
|
+
|| original.id === undefined && message.id === undefined && original.role === message.role
|
|
948
|
+
&& original.source?.kind === message.source?.kind && original.source?.form === message.source?.form
|
|
949
|
+
&& JSON.stringify(original.content) === JSON.stringify(message.content)));
|
|
950
|
+
if (index >= 0)
|
|
951
|
+
replaced.add(index);
|
|
952
|
+
if (index < 0)
|
|
953
|
+
return [message];
|
|
954
|
+
const replacement = replacements[index];
|
|
955
|
+
return replacement === undefined ? [] : [replacement];
|
|
956
|
+
}) : decision.messages;
|
|
957
|
+
// Translate only producer-owned catalog/instruction prose after admission;
|
|
958
|
+
// source identity and human-input recovery remain owned by their producers.
|
|
959
|
+
const promptMessages = await promptTranslation.translateMessages(accepted, sessionPromptScope(record?.agent, record?.signal));
|
|
960
|
+
if (registry.getSession(sessionId).adapterId !== 'dsh')
|
|
961
|
+
teamInputs?.accept(sessionId, promptMessages);
|
|
962
|
+
return { ...decision, messages: promptMessages };
|
|
963
|
+
});
|
|
964
|
+
// 正常结束、异常结束和中断最终都会进入 idle;在此清理本轮授权,避免下一轮
|
|
965
|
+
// 没有 carrier 时继承上一轮的目标白名单。
|
|
966
|
+
register('agent/status', (payload) => {
|
|
967
|
+
const record = asRecord(payload);
|
|
968
|
+
const sessionId = readAgentSessionId(record?.agent);
|
|
969
|
+
if (record?.status === 'running')
|
|
970
|
+
publishExternalStatus(sessionId, true);
|
|
971
|
+
else if (record?.status === 'idle') {
|
|
972
|
+
translationRecovery.cancelSession(sessionId);
|
|
973
|
+
publishExternalStatus(sessionId, false);
|
|
974
|
+
clearDelegationAuthorization(sessionId);
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
register('agent/disposed', (payload) => {
|
|
978
|
+
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
979
|
+
teamInputs?.release(sessionId);
|
|
980
|
+
credentialBroker?.revokeSession(sessionId);
|
|
981
|
+
getSubagentBridge()?.revokeTeamSession?.(sessionId);
|
|
982
|
+
translationRecovery.cancelSession(sessionId);
|
|
983
|
+
// disposed 只代表运行时释放;subagentCatalog 没有删除语义,保留目录项并
|
|
984
|
+
// 把它标成 idle,后续若 DSH 重新激活会再次收到 running。
|
|
985
|
+
publishExternalStatus(sessionId, false);
|
|
986
|
+
clearDelegationAuthorization(sessionId);
|
|
987
|
+
});
|
|
988
|
+
resources.add(() => {
|
|
989
|
+
for (const dispose of disposers.reverse())
|
|
990
|
+
dispose();
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
function isEnterPreStepDecision(value) {
|
|
994
|
+
const record = asRecord(value);
|
|
995
|
+
return record?.kind === 'enter' && Array.isArray(record.messages);
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* 翻译调用优先使用显式字段;若 DSH 在进入 waterfall 前规范化请求并丢掉未知字段,
|
|
999
|
+
* 再用 system 提示里的稳定标记识别。否则翻译请求会被误当成当前外部 Agent 回合。
|
|
1000
|
+
*/
|
|
1001
|
+
function isSessionTranslationLlmRequest(value) {
|
|
1002
|
+
if (value?.agentdoorTranslation === true)
|
|
1003
|
+
return true;
|
|
1004
|
+
if (typeof value?.system === 'string' && value.system.includes('AGENT_DOOR_SESSION_TRANSLATION_V1'))
|
|
1005
|
+
return true;
|
|
1006
|
+
if (!Array.isArray(value?.messages))
|
|
1007
|
+
return false;
|
|
1008
|
+
return value.messages.some((message) => {
|
|
1009
|
+
const record = asRecord(message);
|
|
1010
|
+
if (record?.role !== 'system' || !Array.isArray(record.content))
|
|
1011
|
+
return false;
|
|
1012
|
+
return record.content.some((part) => asRecord(part)?.text?.includes?.('AGENT_DOOR_SESSION_TRANSLATION_V1') === true);
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
function readAgentSessionId(value) {
|
|
1016
|
+
const record = asRecord(value);
|
|
1017
|
+
if (typeof record?.sessionId === 'string' && record.sessionId.trim() !== '')
|
|
1018
|
+
return record.sessionId.trim();
|
|
1019
|
+
const session = asRecord(record?.session);
|
|
1020
|
+
if (typeof session?.id === 'string' && session.id.trim() !== '')
|
|
1021
|
+
return session.id.trim();
|
|
1022
|
+
const header = asRecord(session?.header);
|
|
1023
|
+
if (typeof header?.id === 'string' && header.id.trim() !== '')
|
|
1024
|
+
return header.id.trim();
|
|
1025
|
+
if (typeof record?.id === 'string' && record.id.trim() !== '')
|
|
1026
|
+
return record.id.trim();
|
|
1027
|
+
const agent = asRecord(record?.agent);
|
|
1028
|
+
return agent === null ? '' : readAgentSessionId(agent);
|
|
1029
|
+
}
|
|
1030
|
+
/** Select an external route before DSH freezes the current step's native model choice. */
|
|
1031
|
+
function selectExternalModelBeforeStep(agent, sessionId, registry) {
|
|
1032
|
+
if (sessionId === '')
|
|
1033
|
+
return;
|
|
1034
|
+
let session;
|
|
1035
|
+
try {
|
|
1036
|
+
session = registry.getSession(sessionId);
|
|
1037
|
+
}
|
|
1038
|
+
catch {
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
selectExternalModelForAgent(agent, session, registry);
|
|
1042
|
+
}
|
|
1043
|
+
/** Apply the external route to the live DSH Agent before its next step is prepared. */
|
|
1044
|
+
function selectExternalModelForAgent(agent, session, registry) {
|
|
1045
|
+
const agentRecord = asRecord(agent);
|
|
1046
|
+
const sessionId = typeof agentRecord?.id === 'string' ? agentRecord.id.trim() : '';
|
|
1047
|
+
if (sessionId === '')
|
|
1048
|
+
return;
|
|
1049
|
+
let resolved = session;
|
|
1050
|
+
if (resolved === undefined && registry !== undefined) {
|
|
1051
|
+
try {
|
|
1052
|
+
resolved = registry.getSession(sessionId);
|
|
1053
|
+
}
|
|
1054
|
+
catch {
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
if (resolved === undefined || resolved.adapterId === 'dsh' || registry !== undefined && !registry.isEnabled(resolved.adapterId))
|
|
1059
|
+
return;
|
|
1060
|
+
const modelOwner = asRecord(agentRecord?.model);
|
|
1061
|
+
const select = modelOwner?.select;
|
|
1062
|
+
if (typeof select !== 'function')
|
|
1063
|
+
return;
|
|
1064
|
+
// 外部 CLI 的虚拟 Provider 不声明任何思考强度,DSH 收到 reasoningEffort 会以
|
|
1065
|
+
// UNSUPPORTED_REASONING_EFFORT 拒绝整轮。实际强度由适配器的 effortId 另行传给 CLI,
|
|
1066
|
+
// 所以这里只选择 provider/model,不携带 reasoningEffort。
|
|
1067
|
+
select.call(modelOwner, {
|
|
1068
|
+
provider: toCliProviderId(resolved.adapterId),
|
|
1069
|
+
model: resolved.modelId?.trim() || 'provider-default',
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
function supportsAgentModelSelection(agent) {
|
|
1073
|
+
const model = asRecord(agent?.model);
|
|
1074
|
+
return typeof model?.current === 'function' && typeof model?.select === 'function';
|
|
1075
|
+
}
|
|
1076
|
+
/** Select a route immediately after the Client binds an external adapter to a live Session. */
|
|
1077
|
+
function selectExternalModelForSession(dshContext, sessionId, session) {
|
|
1078
|
+
if (dshContext === undefined || sessionId.trim() === '')
|
|
1079
|
+
return;
|
|
1080
|
+
try {
|
|
1081
|
+
const agents = asRecord(dshContext.get('agents'));
|
|
1082
|
+
const get = agents?.get;
|
|
1083
|
+
if (typeof get !== 'function')
|
|
1084
|
+
return;
|
|
1085
|
+
const agent = get.call(agents, sessionId);
|
|
1086
|
+
if (session.adapterId === 'dsh')
|
|
1087
|
+
restoreNativeModelForAgent(agent, session, dshContext);
|
|
1088
|
+
else
|
|
1089
|
+
selectExternalModelForAgent(agent, session);
|
|
1090
|
+
}
|
|
1091
|
+
catch {
|
|
1092
|
+
// A cold Session may not have a live Agent yet; agent/created retries the selection.
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* 切回 DeepSeek Harness 时,把会话里残留的外部虚拟 Provider 换回原生默认模型。
|
|
1097
|
+
*
|
|
1098
|
+
* 选择外部 Agent 会往 DSH 会话写入 `agent-door-cli-*` 的模型选择,而原生模型目录不含
|
|
1099
|
+
* 这些虚拟 Provider。不还原的话,原生选择器解析不出当前模型,会显示“请选择模型”
|
|
1100
|
+
* 并直接展开列表。这里只在当前选择确实是虚拟 Provider 时才写,且通过 `agent.model.select`
|
|
1101
|
+
* 只记录会话事件;不能走 `selectModel`,它会同时改写全局默认模型。
|
|
1102
|
+
*/
|
|
1103
|
+
function restoreNativeModelForAgent(agent, session, dshContext) {
|
|
1104
|
+
// Team 成员的原生路由由 Team 自己维护。
|
|
1105
|
+
if (session.teamId)
|
|
1106
|
+
return;
|
|
1107
|
+
const modelOwner = asRecord(asRecord(agent)?.model);
|
|
1108
|
+
if (typeof modelOwner?.current !== 'function' || typeof modelOwner.select !== 'function')
|
|
1109
|
+
return;
|
|
1110
|
+
if (fromCliProviderId(asRecord(modelOwner.current.call(modelOwner))?.provider) === undefined)
|
|
1111
|
+
return;
|
|
1112
|
+
const defaults = asRecord(readOptionalContextService(dshContext, 'agentDefaultModel'));
|
|
1113
|
+
if (typeof defaults?.currentSelection !== 'function')
|
|
1114
|
+
return;
|
|
1115
|
+
const native = asRecord(defaults.currentSelection.call(defaults));
|
|
1116
|
+
if (typeof native?.provider !== 'string' || typeof native.model !== 'string' || fromCliProviderId(native.provider) !== undefined)
|
|
1117
|
+
return;
|
|
1118
|
+
modelOwner.select.call(modelOwner, {
|
|
1119
|
+
provider: native.provider,
|
|
1120
|
+
model: native.model,
|
|
1121
|
+
...(typeof native.reasoningEffort === 'string' ? { reasoningEffort: native.reasoningEffort } : {}),
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
/** DSH Context 可能在测试或嵌入式宿主里缺少目标服务;缺失时按不可用处理。 */
|
|
1125
|
+
function readOptionalContextService(ctx, name) {
|
|
1126
|
+
if (ctx === undefined)
|
|
1127
|
+
return undefined;
|
|
1128
|
+
try {
|
|
1129
|
+
return ctx.get(name);
|
|
1130
|
+
}
|
|
1131
|
+
catch {
|
|
1132
|
+
return undefined;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
/** 将 DSH 原生 session/modelCatalog 归一化为委派选择器复用的模型目录契约。 */
|
|
1136
|
+
async function readDshModelCatalog(ctx) {
|
|
1137
|
+
const controller = readOptionalContextService(ctx, 'sessionController');
|
|
1138
|
+
if (isRecord(controller) && typeof controller.modelCatalog === 'function') {
|
|
1139
|
+
try {
|
|
1140
|
+
const raw = await controller.modelCatalog();
|
|
1141
|
+
const record = asRecord(raw);
|
|
1142
|
+
const groups = Array.isArray(record?.groups)
|
|
1143
|
+
? record.groups.flatMap((group) => normalizeDshModelGroup(group))
|
|
1144
|
+
: [];
|
|
1145
|
+
const defaultSelection = asRecord(record?.default);
|
|
1146
|
+
const defaultModel = typeof defaultSelection?.model === 'string' && defaultSelection.model.trim() !== '' ? defaultSelection.model.trim() : null;
|
|
1147
|
+
const defaultEffort = typeof defaultSelection?.reasoningEffort === 'string' && defaultSelection.reasoningEffort.trim() !== '' ? defaultSelection.reasoningEffort.trim() : null;
|
|
1148
|
+
if (groups.length > 0)
|
|
1149
|
+
return { groups, currentModel: defaultModel, currentEffort: defaultEffort };
|
|
1150
|
+
if (defaultModel !== null)
|
|
1151
|
+
return { groups: [{ id: 'dsh', name: 'DeepSeek Harness', models: [{ id: defaultModel, name: defaultModel, efforts: defaultEffort === null ? [] : [defaultEffort] }] }], currentModel: defaultModel, currentEffort: defaultEffort };
|
|
1152
|
+
}
|
|
1153
|
+
catch (error) {
|
|
1154
|
+
debugInfo('dsh-agentdoor: DSH 模型目录读取失败', { error: error instanceof Error ? error.message : String(error) });
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
// 精简 Host 没有 sessionController 时仍给出稳定的“跟随 DSH 当前模型”选项,
|
|
1158
|
+
// 这样 dsh 目标不会退化成无模型可选,实际请求继续沿用 DSH 当前路由。
|
|
1159
|
+
return { groups: [{ id: 'dsh', name: 'DeepSeek Harness', models: [{ id: 'provider-default', name: '跟随 DSH 当前模型', efforts: [] }] }], currentModel: 'provider-default', currentEffort: null, fallback: true };
|
|
1160
|
+
}
|
|
1161
|
+
function normalizeDshModelGroup(value) {
|
|
1162
|
+
const record = asRecord(value);
|
|
1163
|
+
const id = typeof record?.id === 'string' && record.id.trim() !== '' ? record.id.trim() : 'dsh';
|
|
1164
|
+
const name = typeof record?.name === 'string' && record.name.trim() !== '' ? record.name.trim() : id;
|
|
1165
|
+
const models = Array.isArray(record?.models) ? record.models.flatMap((item) => {
|
|
1166
|
+
const model = asRecord(item);
|
|
1167
|
+
const modelId = typeof model?.id === 'string' ? model.id.trim() : '';
|
|
1168
|
+
if (modelId === '')
|
|
1169
|
+
return [];
|
|
1170
|
+
const reasoning = asRecord(model?.reasoning);
|
|
1171
|
+
const efforts = Array.isArray(reasoning?.efforts)
|
|
1172
|
+
? reasoning.efforts.flatMap((effort) => typeof asRecord(effort)?.id === 'string' ? [String(asRecord(effort)?.id)] : [])
|
|
1173
|
+
: [];
|
|
1174
|
+
return [{ id: modelId, name: typeof model?.name === 'string' && model.name.trim() !== '' ? model.name.trim() : modelId, ...(typeof model?.description === 'string' && model.description.trim() !== '' ? { description: model.description.trim() } : {}), efforts }];
|
|
1175
|
+
}) : [];
|
|
1176
|
+
return { id, name, models };
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* DSH 原生 Provider 可能只返回一个 finish(stop)。不能把这个空回合当作成功,
|
|
1180
|
+
* 否则 Session 会落下一条空 assistant/message,用户只能看到“一秒结束”。
|
|
1181
|
+
*
|
|
1182
|
+
* error finish 携带 Provider 的真实失败原因(状态码、上游错误消息、错误码),
|
|
1183
|
+
* 必须原样透传:替换成统一文案会把 400/429/凭证失效等不同故障折叠成同一句
|
|
1184
|
+
* “未返回任何有效事件”,既无法排查也不可分类告警。统一兜底文案只用于一种
|
|
1185
|
+
* 情形——流以 stop(或无 finish)干净结束且没有任何有效事件,此时没有任何
|
|
1186
|
+
* 原始错误可透传。
|
|
1187
|
+
*/
|
|
1188
|
+
async function* guardDshNativeStream(next) {
|
|
1189
|
+
let meaningful = false;
|
|
1190
|
+
const terminal = [];
|
|
1191
|
+
for await (const chunk of next()) {
|
|
1192
|
+
if (isDshFinishChunk(chunk)) {
|
|
1193
|
+
// error finish 本身就是“有效事件”:立即透传,并标记 meaningful,
|
|
1194
|
+
// 让此前缓冲的非 error finish(正常情况下不会出现)也在收尾时放出。
|
|
1195
|
+
if (isDshErrorFinishChunk(chunk)) {
|
|
1196
|
+
meaningful = true;
|
|
1197
|
+
yield chunk;
|
|
1198
|
+
continue;
|
|
1199
|
+
}
|
|
1200
|
+
terminal.push(chunk);
|
|
1201
|
+
continue;
|
|
1202
|
+
}
|
|
1203
|
+
meaningful ||= isMeaningfulDshChunk(chunk);
|
|
1204
|
+
yield chunk;
|
|
1205
|
+
}
|
|
1206
|
+
if (meaningful) {
|
|
1207
|
+
for (const chunk of terminal)
|
|
1208
|
+
yield chunk;
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
const message = 'AGENT_DOOR_PROVIDER_EMPTY_RESPONSE: DSH Provider 未返回任何有效事件。';
|
|
1212
|
+
yield { type: 'block-start', index: 1, blockType: 'text' };
|
|
1213
|
+
yield { type: 'text-delta', index: 1, text: message };
|
|
1214
|
+
yield { type: 'block-end', index: 1, block: { type: 'text', text: message } };
|
|
1215
|
+
yield { type: 'finish', reason: { kind: 'error', failure: { message, code: 'PROVIDER_ERROR' } } };
|
|
1216
|
+
}
|
|
1217
|
+
/** carrier 解析失败也必须以可读的 DSH 错误事件结束当前轮次。 */
|
|
1218
|
+
async function* delegationErrorStream(message) {
|
|
1219
|
+
yield { type: 'block-start', index: 1, blockType: 'text' };
|
|
1220
|
+
yield { type: 'text-delta', index: 1, text: message };
|
|
1221
|
+
yield { type: 'block-end', index: 1, block: { type: 'text', text: message } };
|
|
1222
|
+
yield { type: 'finish', reason: { kind: 'error', failure: { message, code: 'DELEGATE_ERROR' } } };
|
|
1223
|
+
}
|
|
1224
|
+
function isDshFinishChunk(value) {
|
|
1225
|
+
const record = asRecord(value);
|
|
1226
|
+
return record?.type === 'finish';
|
|
1227
|
+
}
|
|
1228
|
+
/** error finish(reason.kind === 'error')携带 Provider 的原始失败,是必须透传的有效事件。 */
|
|
1229
|
+
function isDshErrorFinishChunk(value) {
|
|
1230
|
+
const record = asRecord(value);
|
|
1231
|
+
return record?.type === 'finish' && asRecord(record.reason)?.kind === 'error';
|
|
1232
|
+
}
|
|
1233
|
+
function isMeaningfulDshChunk(value) {
|
|
1234
|
+
const record = asRecord(value);
|
|
1235
|
+
if (record === null)
|
|
1236
|
+
return false;
|
|
1237
|
+
if (record.type === 'text-delta' || record.type === 'reasoning-delta' || record.type === 'usage' || record.type === 'tool-call-delta' || record.type === 'tool-call' || record.type === 'tool-result')
|
|
1238
|
+
return true;
|
|
1239
|
+
if (record.type === 'block-end') {
|
|
1240
|
+
const block = asRecord(record.block);
|
|
1241
|
+
return block?.type === 'tool-call' || block?.type === 'tool-result' || typeof block?.text === 'string' && block.text !== '';
|
|
1242
|
+
}
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
function readAdapterId(value) {
|
|
1246
|
+
const record = asRecord(value);
|
|
1247
|
+
if (typeof record?.adapterId !== 'string' || record.adapterId.trim() === '')
|
|
1248
|
+
throw new Error('adapterId 不能为空');
|
|
1249
|
+
return record.adapterId.trim();
|
|
1250
|
+
}
|
|
1251
|
+
function readSubscriptionRequest(value) {
|
|
1252
|
+
const record = asRecord(value);
|
|
1253
|
+
if (record === null || record.adapterId === undefined)
|
|
1254
|
+
return { adapterId: 'command-code', includeRoute: false };
|
|
1255
|
+
const adapterId = readAdapterId(value);
|
|
1256
|
+
return {
|
|
1257
|
+
adapterId,
|
|
1258
|
+
...(typeof record.sessionId === 'string' && record.sessionId.trim() !== '' ? { sessionId: record.sessionId.trim() } : {}),
|
|
1259
|
+
includeRoute: record.includeRoute === true,
|
|
1260
|
+
...(typeof record.providerId === 'string' && record.providerId.trim() !== '' ? { providerId: record.providerId.trim() } : {}),
|
|
1261
|
+
// Antigravity 用会话模型区分 Gemini 与 Claude/GPT 两个独立配额组。
|
|
1262
|
+
...(typeof record.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
/** 重置请求必须显式给出适配器;缺省回退 command-code 会让重置落到错误的 Agent。 */
|
|
1266
|
+
function readSubscriptionResetRequest(value) {
|
|
1267
|
+
const record = asRecord(value);
|
|
1268
|
+
if (record === null || record.adapterId === undefined)
|
|
1269
|
+
throw new Error('adapterId 不能为空');
|
|
1270
|
+
return readSubscriptionRequest(value);
|
|
1271
|
+
}
|
|
1272
|
+
function readSessionId(value) {
|
|
1273
|
+
const record = asRecord(value);
|
|
1274
|
+
if (typeof record?.sessionId !== 'string' || record.sessionId.trim() === '')
|
|
1275
|
+
throw new Error('sessionId 不能为空');
|
|
1276
|
+
return record.sessionId.trim();
|
|
1277
|
+
}
|
|
1278
|
+
/** `/委派` 请求:父会话、目标适配器与自包含任务描述。 */
|
|
1279
|
+
function readDelegateRequest(value) {
|
|
1280
|
+
const record = asRecord(value);
|
|
1281
|
+
const sessionId = readSessionId(value);
|
|
1282
|
+
const adapterId = readAdapterId(value);
|
|
1283
|
+
// 这里不能复用 readPrompt:旧 Client 可能仍传入空 prompt,空串要交给派发内核返回
|
|
1284
|
+
// 结构化空任务错误;不得读取历史消息补齐任务。
|
|
1285
|
+
const rawPrompt = record?.prompt;
|
|
1286
|
+
if (rawPrompt !== undefined && typeof rawPrompt !== 'string')
|
|
1287
|
+
throw new Error('prompt 必须是字符串');
|
|
1288
|
+
const prompt = typeof rawPrompt === 'string' ? rawPrompt.trim() : '';
|
|
1289
|
+
return {
|
|
1290
|
+
sessionId,
|
|
1291
|
+
adapterId,
|
|
1292
|
+
prompt,
|
|
1293
|
+
...(typeof record?.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
function readSessionConfig(value) {
|
|
1297
|
+
const record = asRecord(value);
|
|
1298
|
+
const adapterId = readAdapterId(record);
|
|
1299
|
+
if (record?.nativeApprovalMode !== undefined && !isNativeApprovalMode(adapterId, record.nativeApprovalMode)) {
|
|
1300
|
+
throw new AgentDoorRpcError('AGENT_DOOR_CLI_INVALID_SESSION', 'Unsupported native approval mode');
|
|
1301
|
+
}
|
|
1302
|
+
return {
|
|
1303
|
+
adapterId,
|
|
1304
|
+
...(isNativeApprovalMode(adapterId, record?.nativeApprovalMode) ? { nativeApprovalMode: record.nativeApprovalMode } : {}),
|
|
1305
|
+
...(typeof record?.modelId === 'string' && record.modelId.trim() ? { modelId: record.modelId.trim() } : {}),
|
|
1306
|
+
...(typeof record?.effortId === 'string' && record.effortId.trim() ? { effortId: record.effortId.trim() } : {}),
|
|
1307
|
+
// `default` 是显式的“标准速度”选择,不能当作空值丢弃,否则关掉 Fast 会被
|
|
1308
|
+
// Registry 回退成上一次记住的加速档。
|
|
1309
|
+
...(typeof record?.serviceTierId === 'string' && record.serviceTierId.trim() ? { serviceTierId: record.serviceTierId.trim() } : {}),
|
|
1310
|
+
...(typeof record?.translationEnabled === 'boolean' ? { translationEnabled: record.translationEnabled } : {}),
|
|
1311
|
+
...(typeof record?.providerId === 'string' && record.providerId.trim() ? { providerId: record.providerId.trim() } : {}),
|
|
1312
|
+
...(typeof record?.providerSessionId === 'string' && record.providerSessionId.trim() ? { providerSessionId: record.providerSessionId.trim() } : {}),
|
|
1313
|
+
...(typeof record?.rawStoreRef === 'string' && record.rawStoreRef.trim() ? { rawStoreRef: record.rawStoreRef.trim() } : {}),
|
|
1314
|
+
...(Array.isArray(record?.credentialRefs) ? { credentialRefs: record.credentialRefs.filter(isCredentialReference) } : {}),
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function readSessionListOptions(value) {
|
|
1318
|
+
const record = asRecord(value);
|
|
1319
|
+
const adapterId = typeof record?.adapterId === 'string' && record.adapterId.trim() ? record.adapterId.trim() : undefined;
|
|
1320
|
+
const includeArchived = record?.includeArchived === true ? true : undefined;
|
|
1321
|
+
return {
|
|
1322
|
+
...(adapterId ? { adapterId } : {}),
|
|
1323
|
+
...(includeArchived === true ? { includeArchived: true } : {}),
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
function readSkillsRequest(value) {
|
|
1327
|
+
const record = asRecord(value);
|
|
1328
|
+
return {
|
|
1329
|
+
sessionId: readSessionId(value),
|
|
1330
|
+
forceReload: record?.forceReload === true,
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
function readPrompt(value) {
|
|
1334
|
+
const record = asRecord(value);
|
|
1335
|
+
if (typeof record?.prompt !== 'string' || record.prompt.trim() === '')
|
|
1336
|
+
throw new Error('prompt 不能为空');
|
|
1337
|
+
return record.prompt.trim();
|
|
1338
|
+
}
|
|
1339
|
+
/** 从 DSH 原生 llm/stream 请求头捕获当前模型和思考强度。 */
|
|
1340
|
+
function readDshSelection(value) {
|
|
1341
|
+
const candidates = [
|
|
1342
|
+
value,
|
|
1343
|
+
asRecord(value?.request),
|
|
1344
|
+
asRecord(value?.config),
|
|
1345
|
+
asRecord(value?.header),
|
|
1346
|
+
...readModelSelectionCandidates(value),
|
|
1347
|
+
];
|
|
1348
|
+
const read = (keys) => {
|
|
1349
|
+
for (const candidate of candidates) {
|
|
1350
|
+
for (const key of keys) {
|
|
1351
|
+
const result = candidate?.[key];
|
|
1352
|
+
if (typeof result === 'string' && result.trim() !== '')
|
|
1353
|
+
return result.trim();
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
return undefined;
|
|
1357
|
+
};
|
|
1358
|
+
const modelId = read(['model', 'modelId']);
|
|
1359
|
+
const effortId = read(['reasoningEffort', 'effortId', 'thinking']);
|
|
1360
|
+
const providerId = read(['provider', 'providerId', 'providerName']);
|
|
1361
|
+
return {
|
|
1362
|
+
...(modelId === undefined ? {} : { modelId }),
|
|
1363
|
+
...(effortId === undefined ? {} : { effortId }),
|
|
1364
|
+
...(providerId === undefined ? {} : { providerId }),
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
/** 读取 DSH/Host 明确下发给外部 CLI 的运行选项;缺省值不改变 Provider 行为。 */
|
|
1368
|
+
function readCliTurnOptions(value) {
|
|
1369
|
+
const candidates = [
|
|
1370
|
+
value,
|
|
1371
|
+
asRecord(value?.options),
|
|
1372
|
+
asRecord(value?.request),
|
|
1373
|
+
asRecord(asRecord(value?.request)?.options),
|
|
1374
|
+
asRecord(value?.config),
|
|
1375
|
+
];
|
|
1376
|
+
const read = (keys) => candidates.some((candidate) => keys.some((key) => candidate?.[key] === true));
|
|
1377
|
+
const plan = read(['plan']);
|
|
1378
|
+
const forkSession = read(['forkSession', 'fork']);
|
|
1379
|
+
const enableAskUserQuestion = read(['enableAskUserQuestion', 'askUserQuestion']);
|
|
1380
|
+
return {
|
|
1381
|
+
...(plan ? { plan: true } : {}),
|
|
1382
|
+
...(forkSession ? { forkSession: true } : {}),
|
|
1383
|
+
...(enableAskUserQuestion ? { enableAskUserQuestion: true } : {}),
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
/** 父仓库通过运行时环境开启 ask_user_question;保留同一兼容入口。 */
|
|
1387
|
+
function readCliRuntimeEnv(value) {
|
|
1388
|
+
const candidate = asRecord(value?.runtimeEnv) ?? asRecord(asRecord(value?.options)?.runtimeEnv);
|
|
1389
|
+
if (candidate === null)
|
|
1390
|
+
return undefined;
|
|
1391
|
+
// The only browser/DSH compatibility variable is a boolean feature switch.
|
|
1392
|
+
// Credential values must come from Host-owned references, never from this payload.
|
|
1393
|
+
const entries = Object.entries(candidate)
|
|
1394
|
+
.filter(([name, item]) => name === 'CMD_TOOLS_ASK_USER_QUESTION_ENABLE' && item === 'true');
|
|
1395
|
+
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
1396
|
+
}
|
|
1397
|
+
async function resolveCredentialEnvironment(service, broker, sessionId, references, carriers = [], reuseExisting = false) {
|
|
1398
|
+
if ((references === undefined || references.length === 0) && carriers.length === 0)
|
|
1399
|
+
return undefined;
|
|
1400
|
+
if (service === undefined || broker === undefined)
|
|
1401
|
+
throw new AgentDoorRpcError('CREDENTIAL_BROKER_UNAVAILABLE', 'Credential broker is unavailable');
|
|
1402
|
+
const processEnvironment = broker.processEnvironment(sessionId);
|
|
1403
|
+
const requestCodes = [];
|
|
1404
|
+
for (const reference of references ?? []) {
|
|
1405
|
+
const issued = await broker.issue({ sessionId, credentialId: reference.credentialId, bindings: reference.bindings, reuseExisting });
|
|
1406
|
+
requestCodes.push(issued);
|
|
1407
|
+
}
|
|
1408
|
+
for (const carrier of carriers) {
|
|
1409
|
+
requestCodes.push(await broker.resolveCarrier(sessionId, carrier.requestCode, carrier.label));
|
|
1410
|
+
}
|
|
1411
|
+
const environmentNames = requestCodes.flatMap((item) => item.bindings.map((binding) => binding.env));
|
|
1412
|
+
if (new Set(environmentNames).size !== environmentNames.length) {
|
|
1413
|
+
throw new AgentDoorRpcError('CREDENTIAL_ENV_CONFLICT', 'Credential environment names must be unique');
|
|
1414
|
+
}
|
|
1415
|
+
return {
|
|
1416
|
+
runtimeEnv: {
|
|
1417
|
+
AGENT_DOOR_CREDENTIAL_BROKER_ENDPOINT: processEnvironment.endpoint,
|
|
1418
|
+
AGENT_DOOR_CREDENTIAL_BROKER_TOKEN: processEnvironment.token,
|
|
1419
|
+
AGENT_DOOR_CREDENTIAL_SESSION: processEnvironment.sessionId,
|
|
1420
|
+
PATH: processEnvironment.path,
|
|
1421
|
+
},
|
|
1422
|
+
environmentNames: [...new Set(environmentNames)].sort(),
|
|
1423
|
+
requestCodes,
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
export function formatCredentialUsageNotice(resolution, nativeToolAvailable = false) {
|
|
1427
|
+
if (resolution === undefined || resolution.requestCodes.length === 0)
|
|
1428
|
+
return '';
|
|
1429
|
+
const codes = resolution.requestCodes.map((item) => [
|
|
1430
|
+
`- ${item.label}: ${item.requestCode}`,
|
|
1431
|
+
...item.bindings.map((binding) => ` ${binding.field} -> ${binding.env} (${binding.kind}; ${binding.usages.join(', ')})`),
|
|
1432
|
+
].join('\n')).join('\n');
|
|
1433
|
+
const usage = nativeToolAvailable
|
|
1434
|
+
? [
|
|
1435
|
+
'Use the native `agentdoor_credential` tool, not a shell command, to consume this credential.',
|
|
1436
|
+
'Call it with action="exec", the request code, and a command array. For SSH, use `sh -lc` so the broker-provided username expands inside the broker environment; the broker configures SSH askpass for SSH secret bindings.',
|
|
1437
|
+
'Example command array: ["sh", "-lc", "exec ssh -o IdentityAgent=none -o IdentitiesOnly=yes -o PubkeyAuthentication=no -o PreferredAuthentications=' + 'pass' + 'word,keyboard-interactive -o NumberOfPasswordPrompts=1 -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new \\\"$CREDENTIAL_USERNAME@HOST\\\" \\\"printf ssh-login-ok\\\""]',
|
|
1438
|
+
]
|
|
1439
|
+
: [
|
|
1440
|
+
'If the native `agentdoor_credential` tool is available, prefer it: call action="exec" with the request code and a command argv array. Otherwise use the credential CLI shown below.',
|
|
1441
|
+
'Use `agent-door-credential exec --code <request-code> -- <command>` or `agent-door-credential exec --handle <handle> -- <command>` after describe.',
|
|
1442
|
+
'For SSH, the broker configures SSH askpass for SSH secret bindings. Run SSH inside a child shell so the username environment variable expands there, and disable unrelated SSH-agent keys with `-o IdentityAgent=none -o IdentitiesOnly=yes -o PubkeyAuthentication=no -o PreferredAuthentications=' + 'pass' + 'word,keyboard-interactive -o NumberOfPasswordPrompts=1`.',
|
|
1443
|
+
'CLI example: `agent-door-credential exec --code <request-code> -- sh -lc \'exec ssh -o IdentityAgent=none -o IdentitiesOnly=yes -o PubkeyAuthentication=no -o PreferredAuthentications=' + 'pass' + 'word,keyboard-interactive -o NumberOfPasswordPrompts=1 "$CREDENTIAL_USERNAME@HOST" "printf ssh-login-ok"\'`.',
|
|
1444
|
+
];
|
|
1445
|
+
return [
|
|
1446
|
+
'AgentDoor credential broker is available for this Agent.',
|
|
1447
|
+
...(nativeToolAvailable ? [] : ['Use `agent-door-credential describe --code <request-code>` to inspect bindings without reading secret values; it returns a handle for later execution.']),
|
|
1448
|
+
...usage,
|
|
1449
|
+
'The request codes and environment names below are session-scoped. Never print credential values or open the credential store.',
|
|
1450
|
+
codes,
|
|
1451
|
+
].join('\n');
|
|
1452
|
+
}
|
|
1453
|
+
/** Compatibility formatter for callers that only have environment names. */
|
|
1454
|
+
export function formatCredentialEnvironmentNotice(environmentNames) {
|
|
1455
|
+
const names = [...new Set(environmentNames.map((name) => name.trim()).filter((name) => name !== ''))].sort();
|
|
1456
|
+
if (names.length === 0)
|
|
1457
|
+
return '';
|
|
1458
|
+
return [
|
|
1459
|
+
'The selected AgentDoor credential is available to this Agent through these process environment variables:',
|
|
1460
|
+
names.map((name) => `- ${name}`).join('\n'),
|
|
1461
|
+
'Read these variables from the process environment when a tool or command needs the credential. Never print their values in chat, logs, or tool output.',
|
|
1462
|
+
].join('\n');
|
|
1463
|
+
}
|
|
1464
|
+
/** Prefer the pending/next DSH route because lastUsed may still be stale. */
|
|
1465
|
+
function readModelSelectionCandidates(value) {
|
|
1466
|
+
const result = [];
|
|
1467
|
+
for (const candidate of [value, asRecord(value?.request), asRecord(value?.config), asRecord(value?.header), asRecord(asRecord(value?.record)?.rows)]) {
|
|
1468
|
+
const selection = asRecord(candidate?.modelSelection);
|
|
1469
|
+
if (selection !== null)
|
|
1470
|
+
result.push(selection);
|
|
1471
|
+
const lastUsed = asRecord(selection?.lastUsed);
|
|
1472
|
+
const next = asRecord(selection?.next);
|
|
1473
|
+
const pending = asRecord(selection?.pending);
|
|
1474
|
+
if (pending !== null)
|
|
1475
|
+
result.push(pending);
|
|
1476
|
+
if (next !== null)
|
|
1477
|
+
result.push(next);
|
|
1478
|
+
if (lastUsed !== null)
|
|
1479
|
+
result.push(lastUsed);
|
|
1480
|
+
}
|
|
1481
|
+
return result;
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* 分叉子会话的绑定来自父会话,迁移时必须把祖先链一起交给 SessionStore。
|
|
1485
|
+
* 只传子会话会让继承逻辑找不到父记录,子会话继续停留在 dsh。
|
|
1486
|
+
*/
|
|
1487
|
+
function collectMigrationChain(nativeSessions, session) {
|
|
1488
|
+
const chain = [session];
|
|
1489
|
+
const seen = new Set();
|
|
1490
|
+
let current = session;
|
|
1491
|
+
for (let depth = 0; depth < 16; depth += 1) {
|
|
1492
|
+
const record = asRecord(current);
|
|
1493
|
+
const header = asRecord(record?.header);
|
|
1494
|
+
const parentSessionId = typeof header?.parentSession === 'string' ? header.parentSession.trim() : '';
|
|
1495
|
+
if (parentSessionId === '' || seen.has(parentSessionId))
|
|
1496
|
+
break;
|
|
1497
|
+
seen.add(parentSessionId);
|
|
1498
|
+
const parent = nativeSessions?.get(parentSessionId);
|
|
1499
|
+
if (parent === undefined)
|
|
1500
|
+
break;
|
|
1501
|
+
chain.push(parent);
|
|
1502
|
+
current = parent;
|
|
1503
|
+
}
|
|
1504
|
+
// 先迁移祖先再迁移子会话,深层 fork 不依赖下一轮轮询补齐中间父节点。
|
|
1505
|
+
return chain.reverse();
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* DSH's native fork command creates the child with the global native default.
|
|
1509
|
+
* Capture the source binding around that command so the child is immediately
|
|
1510
|
+
* visible to the Client as the same external Agent.
|
|
1511
|
+
*/
|
|
1512
|
+
function installForkAdapterBinding(controller, nativeSessions, sessionStore, registry) {
|
|
1513
|
+
const original = controller?.fork;
|
|
1514
|
+
if (controller === undefined || original === undefined)
|
|
1515
|
+
return undefined;
|
|
1516
|
+
const originalDescriptor = Object.getOwnPropertyDescriptor(controller, 'fork');
|
|
1517
|
+
const fork = async function (request) {
|
|
1518
|
+
const sourceSessionId = request.sessionId.trim();
|
|
1519
|
+
let sourceConfig = sourceSessionId === '' ? undefined : registry.getSession(sourceSessionId);
|
|
1520
|
+
if (sourceSessionId !== '' && sourceConfig?.adapterId === 'dsh' && nativeSessions !== undefined) {
|
|
1521
|
+
const source = nativeSessions.get(sourceSessionId);
|
|
1522
|
+
if (source !== undefined) {
|
|
1523
|
+
sessionStore.invalidateLegacySession(source);
|
|
1524
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, source));
|
|
1525
|
+
sourceConfig = registry.getSession(sourceSessionId);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
const result = await original.call(this, request);
|
|
1529
|
+
const childSessionId = forkedSessionId(result);
|
|
1530
|
+
if (childSessionId !== undefined
|
|
1531
|
+
&& sourceSessionId !== ''
|
|
1532
|
+
&& sourceConfig !== undefined
|
|
1533
|
+
&& sourceConfig.adapterId !== 'dsh'
|
|
1534
|
+
&& registry.isEnabled(sourceConfig.adapterId)) {
|
|
1535
|
+
sessionStore.upsert(childSessionId, {
|
|
1536
|
+
adapterId: sourceConfig.adapterId,
|
|
1537
|
+
...(sourceConfig.modelId === undefined ? {} : { modelId: sourceConfig.modelId }),
|
|
1538
|
+
...(sourceConfig.effortId === undefined ? {} : { effortId: sourceConfig.effortId }),
|
|
1539
|
+
...(sourceConfig.serviceTierId === undefined ? {} : { serviceTierId: sourceConfig.serviceTierId }),
|
|
1540
|
+
...(sourceConfig.translationEnabled === undefined ? {} : { translationEnabled: sourceConfig.translationEnabled }),
|
|
1541
|
+
parentSessionId: sourceSessionId,
|
|
1542
|
+
status: 'idle',
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
return result;
|
|
1546
|
+
};
|
|
1547
|
+
try {
|
|
1548
|
+
controller.fork = fork;
|
|
1549
|
+
}
|
|
1550
|
+
catch {
|
|
1551
|
+
return undefined;
|
|
1552
|
+
}
|
|
1553
|
+
return () => {
|
|
1554
|
+
try {
|
|
1555
|
+
// Cordis 代理上的赋值会落到真实服务实例,`fork` 原本在原型上;没有自有描述符时
|
|
1556
|
+
// 删除自有属性才能还原,而不是在实例上再留一个指向原函数的自有属性。
|
|
1557
|
+
if (originalDescriptor !== undefined)
|
|
1558
|
+
Object.defineProperty(controller, 'fork', originalDescriptor);
|
|
1559
|
+
else
|
|
1560
|
+
delete controller.fork;
|
|
1561
|
+
}
|
|
1562
|
+
catch { /* A replaced Host controller owns the current method. */ }
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
function forkedSessionId(value) {
|
|
1566
|
+
const record = asRecord(value);
|
|
1567
|
+
return typeof record?.sessionId === 'string' && record.sessionId.trim() !== ''
|
|
1568
|
+
? record.sessionId.trim()
|
|
1569
|
+
: undefined;
|
|
1570
|
+
}
|
|
1571
|
+
function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
1572
|
+
for (const candidate of [selectedProvider, messageAdapter]) {
|
|
1573
|
+
if (candidate !== undefined && candidate !== 'dsh' && registry.isEnabled(candidate))
|
|
1574
|
+
return candidate;
|
|
1575
|
+
}
|
|
1576
|
+
return undefined;
|
|
1577
|
+
}
|
|
1578
|
+
/** 从当前会话历史恢复外部路由,覆盖 DSH 第二轮省略 provider 的请求形态。 */
|
|
1579
|
+
function inferMessageAdapter(messages) {
|
|
1580
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1581
|
+
const source = asRecord(messages[index].source);
|
|
1582
|
+
if (source?.kind !== 'model')
|
|
1583
|
+
continue;
|
|
1584
|
+
const provider = typeof source.provider === 'string' ? source.provider.trim() : undefined;
|
|
1585
|
+
// Legacy raw providers need explicit plugin metadata; native API brands can
|
|
1586
|
+
// have the same names as CLI adapters. The latest model source is decisive.
|
|
1587
|
+
return fromCliProviderId(provider)
|
|
1588
|
+
?? (typeof source.adapterId === 'string' ? source.adapterId : undefined)
|
|
1589
|
+
?? (source.plugin === 'dsh-agentdoor' ? provider : undefined);
|
|
1590
|
+
}
|
|
1591
|
+
return undefined;
|
|
1592
|
+
}
|
|
1593
|
+
async function setAdapterEnabled(settings, registry, value) {
|
|
1594
|
+
const record = asRecord(value);
|
|
1595
|
+
const adapterId = readAdapterId(record);
|
|
1596
|
+
if (typeof record?.enabled !== 'boolean')
|
|
1597
|
+
throw new Error('enabled 必须是布尔值');
|
|
1598
|
+
const enabled = registry.setEnabled(adapterId, record.enabled);
|
|
1599
|
+
if (settings !== undefined)
|
|
1600
|
+
await settings.update({ agentAdapters: registry.enabledSnapshot() });
|
|
1601
|
+
return { adapterId, enabled };
|
|
1602
|
+
}
|
|
1603
|
+
/** 运行中的外部 Agent 插话也必须经过同一条输入翻译路径。 */
|
|
1604
|
+
async function translateSteerPrompt(translationRecovery, registry, sessionId, prompt, followUp, signal) {
|
|
1605
|
+
const session = registry.getSession(sessionId);
|
|
1606
|
+
let translated = prompt;
|
|
1607
|
+
if (session.translationEnabled === true) {
|
|
1608
|
+
try {
|
|
1609
|
+
translated = (await translationRecovery.translateInput(sessionId, session.adapterId, prompt, signal)).translated;
|
|
1610
|
+
}
|
|
1611
|
+
catch (error) {
|
|
1612
|
+
if (error instanceof SessionTranslationCancelled)
|
|
1613
|
+
return;
|
|
1614
|
+
throw error;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
signal?.throwIfAborted();
|
|
1618
|
+
await registry.steer(sessionId, translated, followUp);
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* 在 Agent Loop 接受本轮输入时生成一次输入译文。
|
|
1622
|
+
*
|
|
1623
|
+
* DSH 随后会把返回的消息写入 `user/message`。正文只放实际发送的译文;原文和模型
|
|
1624
|
+
* 记录在 source 元数据中供 Client 详情按钮读取。外部 CLI 边界也会移除该元数据。
|
|
1625
|
+
*/
|
|
1626
|
+
async function translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, signal, nativeSession) {
|
|
1627
|
+
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
1628
|
+
return undefined;
|
|
1629
|
+
if (messages.some(isTeamInputMessage)) {
|
|
1630
|
+
const next = [];
|
|
1631
|
+
for (const message of messages) {
|
|
1632
|
+
// Team protocol text keeps its sender and machine-owned body. Human
|
|
1633
|
+
// messages accepted at the same boundary still use submission recovery.
|
|
1634
|
+
try {
|
|
1635
|
+
const translated = isHumanUserMessage(message)
|
|
1636
|
+
? await translatePreStepInput(translation, translationRecovery, registry, sessionId, [message], dshContext, signal, nativeSession)
|
|
1637
|
+
: undefined;
|
|
1638
|
+
next.push(translated?.[0] ?? message);
|
|
1639
|
+
}
|
|
1640
|
+
catch (error) {
|
|
1641
|
+
if (!(error instanceof SessionTranslationCancelled) || signal?.aborted)
|
|
1642
|
+
throw error;
|
|
1643
|
+
// Cancelling one submission does not cancel independently accepted
|
|
1644
|
+
// Team work. Keep the original positions until pre-step producers merge.
|
|
1645
|
+
next.push(undefined);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
return next.some((message, index) => message !== messages[index]) ? next : undefined;
|
|
1649
|
+
}
|
|
1650
|
+
const messageIndex = findLatestHumanMessage(messages);
|
|
1651
|
+
const current = messageIndex < 0 ? undefined : messages[messageIndex];
|
|
1652
|
+
if (current === undefined || readInputTranslation(current.source) !== undefined)
|
|
1653
|
+
return undefined;
|
|
1654
|
+
if (nativeSession !== undefined) {
|
|
1655
|
+
// DSH 原生会话:消息本身就是发给 Provider 的正文,直接替换为译文并把原文留在元数据。
|
|
1656
|
+
if (nativeSession.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, nativeSession.adapterId))
|
|
1657
|
+
return undefined;
|
|
1658
|
+
const input = extractTurnInput(messages, dshContext);
|
|
1659
|
+
if (input.prompt.trim() === '')
|
|
1660
|
+
return undefined;
|
|
1661
|
+
const result = await translationRecovery.translateInput(sessionId, nativeSession.adapterId, input.translationPrompt, signal);
|
|
1662
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))].filter((part) => part.trim() !== '').join('\n\n').trim();
|
|
1663
|
+
if (translated === '')
|
|
1664
|
+
return undefined;
|
|
1665
|
+
const record = {
|
|
1666
|
+
original: input.prompt,
|
|
1667
|
+
translated,
|
|
1668
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1669
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1670
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1671
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1672
|
+
...readSessionTranslationDiagnostics(result),
|
|
1673
|
+
...readSessionTranslationMetrics(result),
|
|
1674
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1675
|
+
};
|
|
1676
|
+
const next = [...messages];
|
|
1677
|
+
next[messageIndex] = {
|
|
1678
|
+
...current,
|
|
1679
|
+
content: result.failed ? current.content : replaceInputTranslationContent(nativeTranslationContent(current.content, dshContext), translated),
|
|
1680
|
+
source: { ...(current.source ?? {}), kind: 'user', agentdoorTranslationInput: record },
|
|
1681
|
+
};
|
|
1682
|
+
return next;
|
|
1683
|
+
}
|
|
1684
|
+
let session;
|
|
1685
|
+
try {
|
|
1686
|
+
session = registry.getSession(sessionId);
|
|
1687
|
+
}
|
|
1688
|
+
catch {
|
|
1689
|
+
return undefined;
|
|
1690
|
+
}
|
|
1691
|
+
if (session.adapterId === 'dsh' || session.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, session.adapterId))
|
|
1692
|
+
return undefined;
|
|
1693
|
+
const input = extractTurnInput(messages, dshContext);
|
|
1694
|
+
if (input.prompt.trim() === '')
|
|
1695
|
+
return undefined;
|
|
1696
|
+
const result = await translationRecovery.translateInput(sessionId, session.adapterId, input.translationPrompt, signal);
|
|
1697
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))]
|
|
1698
|
+
.filter((part) => part.trim() !== '')
|
|
1699
|
+
.join('\n\n')
|
|
1700
|
+
.trim();
|
|
1701
|
+
if (translated === '')
|
|
1702
|
+
return undefined;
|
|
1703
|
+
const record = {
|
|
1704
|
+
original: input.prompt,
|
|
1705
|
+
translated,
|
|
1706
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1707
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1708
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1709
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1710
|
+
...readSessionTranslationDiagnostics(result),
|
|
1711
|
+
...readSessionTranslationMetrics(result),
|
|
1712
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1713
|
+
};
|
|
1714
|
+
const next = [...messages];
|
|
1715
|
+
next[messageIndex] = {
|
|
1716
|
+
...current,
|
|
1717
|
+
source: {
|
|
1718
|
+
...(current.source ?? {}),
|
|
1719
|
+
kind: 'user',
|
|
1720
|
+
agentdoorTranslationInput: record,
|
|
1721
|
+
},
|
|
1722
|
+
};
|
|
1723
|
+
return next;
|
|
1724
|
+
}
|
|
1725
|
+
/** 旧测试替身没有 inputLanguage 时沿用历史默认值英语。 */
|
|
1726
|
+
function readInputTargetLanguage(translation) {
|
|
1727
|
+
const language = translation.inputLanguage;
|
|
1728
|
+
return language === undefined ? 'en' : language;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* 判断本次 pre-step 是否按 DSH 原生会话翻译。
|
|
1732
|
+
*
|
|
1733
|
+
* 原生会话的翻译记录来自全局 `nativeEnabled` 与适配器偏好(会话索引对 `dsh` 不落盘),
|
|
1734
|
+
* 子代理与插件自己的助理会话必须排除,避免把内部执行流水线翻译掉。
|
|
1735
|
+
*/
|
|
1736
|
+
function nativePreStepContext(translation, registry, sessionId, nativeSessions) {
|
|
1737
|
+
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
1738
|
+
return undefined;
|
|
1739
|
+
if (isAssistantSession(sessionId))
|
|
1740
|
+
return undefined;
|
|
1741
|
+
if (readNativeSessionHeader(nativeSessions, sessionId)?.origin === 'subagent')
|
|
1742
|
+
return undefined;
|
|
1743
|
+
let session;
|
|
1744
|
+
try {
|
|
1745
|
+
session = registry.getSession(sessionId);
|
|
1746
|
+
}
|
|
1747
|
+
catch {
|
|
1748
|
+
return undefined;
|
|
1749
|
+
}
|
|
1750
|
+
if (session.adapterId !== DSH_NATIVE_SESSION_ADAPTER_ID)
|
|
1751
|
+
return undefined;
|
|
1752
|
+
return {
|
|
1753
|
+
adapterId: DSH_NATIVE_SESSION_ADAPTER_ID,
|
|
1754
|
+
// 会话级开关优先;用户没有单独设置过该会话时跟随「DSH 原生会话」总开关。
|
|
1755
|
+
translationEnabled: session.translationEnabled ?? translation.nativeEnabled === true,
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
function readOptionalText(value) {
|
|
1759
|
+
return typeof value === 'string' ? value.trim() || undefined : undefined;
|
|
1760
|
+
}
|
|
1761
|
+
/** 读取原生会话 header;测试替身或会话尚未装载时返回 undefined。 */
|
|
1762
|
+
function readNativeSessionHeader(nativeSessions, sessionId) {
|
|
1763
|
+
if (nativeSessions === undefined)
|
|
1764
|
+
return undefined;
|
|
1765
|
+
try {
|
|
1766
|
+
return asRecord(asRecord(nativeSessions.get(sessionId))?.header) ?? undefined;
|
|
1767
|
+
}
|
|
1768
|
+
catch {
|
|
1769
|
+
return undefined;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
/** 插件自己的全局助理会话不属于用户对话,不能被翻译改写。 */
|
|
1773
|
+
function isAssistantSession(sessionId) {
|
|
1774
|
+
return sessionId.startsWith('agent-door-assistant-');
|
|
1775
|
+
}
|
|
1776
|
+
/** Translate completed native output blocks without buffering their visible deltas. */
|
|
1777
|
+
async function* translateNativeStream(stream, translation, bilingual, signal) {
|
|
1778
|
+
const blocks = new Map();
|
|
1779
|
+
const bufferOf = (index, kind) => {
|
|
1780
|
+
const existing = blocks.get(index);
|
|
1781
|
+
if (existing !== undefined)
|
|
1782
|
+
return existing.kind === kind && !existing.closed ? existing : undefined;
|
|
1783
|
+
const created = {
|
|
1784
|
+
index, kind, text: '', closed: false,
|
|
1785
|
+
translate: translation.shouldTranslate(DSH_NATIVE_SESSION_ADAPTER_ID, kind === 'reasoning' ? 'reasoning' : 'assistant', true),
|
|
1786
|
+
};
|
|
1787
|
+
blocks.set(index, created);
|
|
1788
|
+
return created;
|
|
1789
|
+
};
|
|
1790
|
+
const translateBlock = async (block) => {
|
|
1791
|
+
const original = block.text;
|
|
1792
|
+
if (original.trim() === '')
|
|
1793
|
+
return undefined;
|
|
1794
|
+
const kind = block.kind === 'reasoning' ? 'reasoning' : 'assistant';
|
|
1795
|
+
let record;
|
|
1796
|
+
try {
|
|
1797
|
+
// RC1 persists the completed block as part of the stream. Bound the wait before the next event.
|
|
1798
|
+
const result = await runTranslationEffect(translationTimeout(translationEffect(attempt => translation.translateOutput(DSH_NATIVE_SESSION_ADAPTER_ID, kind, original, attempt, true)), 1500), signal);
|
|
1799
|
+
if (result !== null && result !== undefined) {
|
|
1800
|
+
record = {
|
|
1801
|
+
original: result.original,
|
|
1802
|
+
translated: result.translated,
|
|
1803
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1804
|
+
targetLanguage: result.targetLanguage,
|
|
1805
|
+
outputKind: kind,
|
|
1806
|
+
bilingual: result.bilingual,
|
|
1807
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1808
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1809
|
+
...readSessionTranslationDiagnostics(result),
|
|
1810
|
+
...readSessionTranslationMetrics(result),
|
|
1811
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
catch (error) {
|
|
1816
|
+
record = { original, translated: original, targetLanguage: translation.outputLanguage ?? 'zh', outputKind: kind, bilingual, failed: true, failure: translationFailure(error, signal) };
|
|
1817
|
+
}
|
|
1818
|
+
if (record === undefined)
|
|
1819
|
+
return undefined;
|
|
1820
|
+
const visible = formatSessionTranslationOutput(record);
|
|
1821
|
+
if (visible.trim() === '' || visible === original && record.failed !== true)
|
|
1822
|
+
return undefined;
|
|
1823
|
+
return record;
|
|
1824
|
+
};
|
|
1825
|
+
try {
|
|
1826
|
+
for await (const chunk of stream) {
|
|
1827
|
+
const record = asRecord(chunk);
|
|
1828
|
+
const type = typeof record?.type === 'string' ? record.type : '';
|
|
1829
|
+
const index = typeof record?.index === 'number' ? record.index : undefined;
|
|
1830
|
+
if (type === 'text-delta' || type === 'reasoning-delta') {
|
|
1831
|
+
if (index === undefined || typeof record?.text !== 'string') {
|
|
1832
|
+
yield chunk;
|
|
1833
|
+
continue;
|
|
1834
|
+
}
|
|
1835
|
+
const kind = type === 'text-delta' ? 'text' : 'reasoning';
|
|
1836
|
+
const block = bufferOf(index, kind);
|
|
1837
|
+
// Decide once per block: changing settings must not translate only a suffix
|
|
1838
|
+
// or drop a prefix that was already buffered.
|
|
1839
|
+
if (block === undefined || !block.translate) {
|
|
1840
|
+
yield chunk;
|
|
1841
|
+
continue;
|
|
1842
|
+
}
|
|
1843
|
+
block.text += record.text;
|
|
1844
|
+
// Keep provider deltas visible while the completed block is being translated.
|
|
1845
|
+
yield chunk;
|
|
1846
|
+
continue;
|
|
1847
|
+
}
|
|
1848
|
+
if (type === 'block-end' && index !== undefined) {
|
|
1849
|
+
const block = blocks.get(index);
|
|
1850
|
+
if (block !== undefined && !block.closed) {
|
|
1851
|
+
block.closed = true;
|
|
1852
|
+
if (block.text.trim() !== '') {
|
|
1853
|
+
const translationRecord = await translateBlock(block);
|
|
1854
|
+
if (translationRecord !== undefined) {
|
|
1855
|
+
const finalBlock = asRecord(record?.block);
|
|
1856
|
+
yield {
|
|
1857
|
+
...(record ?? {}),
|
|
1858
|
+
block: {
|
|
1859
|
+
...(finalBlock ?? {}),
|
|
1860
|
+
type: block.kind,
|
|
1861
|
+
text: block.text,
|
|
1862
|
+
agentdoorTranslation: translationRecord,
|
|
1863
|
+
},
|
|
1864
|
+
agentdoorTranslation: translationRecord,
|
|
1865
|
+
};
|
|
1866
|
+
continue;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
yield chunk;
|
|
1871
|
+
continue;
|
|
1872
|
+
}
|
|
1873
|
+
yield chunk;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
catch (error) {
|
|
1877
|
+
// 流异常时先把缓存正文按原文补发,再把原始错误交给 DSH,保证回复不丢失。
|
|
1878
|
+
for (const item of flushBuffered())
|
|
1879
|
+
yield item;
|
|
1880
|
+
throw error;
|
|
1881
|
+
}
|
|
1882
|
+
for (const item of flushBuffered())
|
|
1883
|
+
yield item;
|
|
1884
|
+
/**
|
|
1885
|
+
* Provider 未发送 block-end(中断或异常)时,结束已透传的原文块。
|
|
1886
|
+
*
|
|
1887
|
+
* 不能用 `finally` 里的 `yield`:异常正在传播时生成器已经结束,后续 yield 会被
|
|
1888
|
+
* 直接丢弃,用户会看不到已经生成的半截回复。
|
|
1889
|
+
*/
|
|
1890
|
+
function* flushBuffered() {
|
|
1891
|
+
for (const block of [...blocks.values()]) {
|
|
1892
|
+
if (block.closed || block.text.trim() === '')
|
|
1893
|
+
continue;
|
|
1894
|
+
block.closed = true;
|
|
1895
|
+
yield { type: 'block-end', index: block.index, block: { type: block.kind, text: block.text } };
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
function extractTurnInput(messages, dshContext, acceptedPeerInput = pendingPeerInput(messages)) {
|
|
1900
|
+
if (acceptedPeerInput.some(isTeamInputMessage)) {
|
|
1901
|
+
const parts = acceptedPeerInput.map(message => {
|
|
1902
|
+
const part = extractMessageInput(message.content, dshContext);
|
|
1903
|
+
const translated = isHumanUserMessage(message) ? readInputTranslation(message.source) : undefined;
|
|
1904
|
+
return translated ? { ...part, prompt: translated.translated } : part;
|
|
1905
|
+
});
|
|
1906
|
+
const prompt = parts.map(part => part.prompt).filter(text => text.trim() !== '').join('\n\n');
|
|
1907
|
+
return {
|
|
1908
|
+
prompt,
|
|
1909
|
+
peerInput: true,
|
|
1910
|
+
translationPrompt: prompt,
|
|
1911
|
+
untranslatedPrompt: '',
|
|
1912
|
+
attachments: parts.flatMap(part => part.attachments),
|
|
1913
|
+
credentialCarriers: parts.flatMap(part => part.credentialCarriers),
|
|
1914
|
+
translatePrompt: false,
|
|
1915
|
+
messages: stripCredentialCarriers(stripInputTranslationDisplay(messages)),
|
|
1916
|
+
};
|
|
1917
|
+
}
|
|
1918
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1919
|
+
const message = messages[index];
|
|
1920
|
+
if (message !== undefined && isInjectedStepNotice(message)) {
|
|
1921
|
+
const prompt = extractText(message.content);
|
|
1922
|
+
return { prompt, translationPrompt: prompt, untranslatedPrompt: '', attachments: [], credentialCarriers: [], translatePrompt: false, messages: stripCredentialCarriers(messages) };
|
|
1923
|
+
}
|
|
1924
|
+
if (message !== undefined && isHumanUserMessage(message)) {
|
|
1925
|
+
const direct = extractMessageInput(message.content, dshContext);
|
|
1926
|
+
const referenceIndexes = messages
|
|
1927
|
+
.slice(index + 1)
|
|
1928
|
+
.map((candidate, offset) => isSessionReferenceContext(candidate) ? index + 1 + offset : -1)
|
|
1929
|
+
.filter((candidateIndex) => candidateIndex >= 0);
|
|
1930
|
+
const referenceText = referenceIndexes
|
|
1931
|
+
.map(referenceIndex => messages[referenceIndex])
|
|
1932
|
+
.filter((candidate) => candidate !== undefined)
|
|
1933
|
+
.map(candidate => extractText(candidate.content))
|
|
1934
|
+
.filter(text => text.trim() !== '');
|
|
1935
|
+
const forwarded = referenceIndexes.length === 0
|
|
1936
|
+
? messages
|
|
1937
|
+
: messages.filter((_candidate, candidateIndex) => !referenceIndexes.includes(candidateIndex));
|
|
1938
|
+
const translatedInput = readInputTranslation(message.source);
|
|
1939
|
+
if (translatedInput !== undefined) {
|
|
1940
|
+
const prompt = [translatedInput.translated, ...referenceText].join('\n\n');
|
|
1941
|
+
return {
|
|
1942
|
+
prompt,
|
|
1943
|
+
translationPrompt: prompt,
|
|
1944
|
+
untranslatedPrompt: '',
|
|
1945
|
+
attachments: direct.attachments,
|
|
1946
|
+
translatePrompt: false,
|
|
1947
|
+
credentialCarriers: direct.credentialCarriers,
|
|
1948
|
+
messages: stripCredentialCarriers(stripInputTranslationDisplay(forwarded)),
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
return {
|
|
1952
|
+
prompt: [direct.prompt, ...referenceText].filter(text => text.trim() !== '').join('\n\n').trim(),
|
|
1953
|
+
translationPrompt: [direct.translationPrompt, ...referenceText].filter(text => text.trim() !== '').join('\n\n').trim(),
|
|
1954
|
+
untranslatedPrompt: direct.untranslatedPrompt,
|
|
1955
|
+
attachments: direct.attachments,
|
|
1956
|
+
translatePrompt: true,
|
|
1957
|
+
credentialCarriers: direct.credentialCarriers,
|
|
1958
|
+
messages: stripCredentialCarriers(stripInputTranslationDisplay(forwarded)),
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
return {
|
|
1963
|
+
prompt: '',
|
|
1964
|
+
translationPrompt: '',
|
|
1965
|
+
untranslatedPrompt: '',
|
|
1966
|
+
attachments: [],
|
|
1967
|
+
credentialCarriers: [],
|
|
1968
|
+
translatePrompt: false,
|
|
1969
|
+
messages: stripCredentialCarriers(stripInputTranslationDisplay(messages)),
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
function findLatestHumanMessage(messages) {
|
|
1973
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1974
|
+
const message = messages[index];
|
|
1975
|
+
if (message !== undefined && isHumanUserMessage(message))
|
|
1976
|
+
return index;
|
|
1977
|
+
}
|
|
1978
|
+
return -1;
|
|
1979
|
+
}
|
|
1980
|
+
function readInputTranslation(value) {
|
|
1981
|
+
const candidate = value?.agentdoorTranslationInput;
|
|
1982
|
+
if (!isRecord(candidate) || typeof candidate.original !== 'string' || typeof candidate.translated !== 'string')
|
|
1983
|
+
return undefined;
|
|
1984
|
+
if (candidate.original.trim() === '' || candidate.translated.trim() === '')
|
|
1985
|
+
return undefined;
|
|
1986
|
+
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja' || candidate.targetLanguage === 'zh'
|
|
1987
|
+
? candidate.targetLanguage
|
|
1988
|
+
: 'en';
|
|
1989
|
+
const sourceLanguage = candidate.sourceLanguage === 'zh' || candidate.sourceLanguage === 'en' || candidate.sourceLanguage === 'fr' || candidate.sourceLanguage === 'de' || candidate.sourceLanguage === 'ja'
|
|
1990
|
+
? candidate.sourceLanguage
|
|
1991
|
+
: undefined;
|
|
1992
|
+
return {
|
|
1993
|
+
original: candidate.original,
|
|
1994
|
+
translated: candidate.translated,
|
|
1995
|
+
...(sourceLanguage === undefined ? {} : { sourceLanguage }),
|
|
1996
|
+
targetLanguage,
|
|
1997
|
+
...(candidate.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
/** 把历史消息还原为 Provider 可见的纯译文,并移除内部翻译元数据。 */
|
|
2001
|
+
function stripInputTranslationDisplay(messages) {
|
|
2002
|
+
return messages.map((message) => {
|
|
2003
|
+
const record = readInputTranslation(message.source);
|
|
2004
|
+
if (record === undefined)
|
|
2005
|
+
return message;
|
|
2006
|
+
const source = message.source;
|
|
2007
|
+
const cleanSource = source === undefined
|
|
2008
|
+
? undefined
|
|
2009
|
+
: (() => {
|
|
2010
|
+
const { agentdoorTranslationInput: _translation, ...rest } = source;
|
|
2011
|
+
return rest;
|
|
2012
|
+
})();
|
|
2013
|
+
return {
|
|
2014
|
+
...message,
|
|
2015
|
+
content: replaceInputTranslationContent(message.content, record.translated),
|
|
2016
|
+
...(cleanSource === undefined ? {} : { source: cleanSource }),
|
|
2017
|
+
};
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
2020
|
+
function stripCredentialCarriers(messages) {
|
|
2021
|
+
return messages.map((message) => {
|
|
2022
|
+
const content = replaceCredentialCarriersInContent(message.content);
|
|
2023
|
+
return content === message.content ? message : { ...message, content };
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
function replaceCredentialCarriersInContent(content) {
|
|
2027
|
+
if (typeof content === 'string')
|
|
2028
|
+
return parseCredentialCarriers(content).text;
|
|
2029
|
+
if (!Array.isArray(content))
|
|
2030
|
+
return content;
|
|
2031
|
+
let changed = false;
|
|
2032
|
+
const next = content.map((part) => {
|
|
2033
|
+
if (!isRecord(part) || typeof part.text !== 'string')
|
|
2034
|
+
return part;
|
|
2035
|
+
const text = parseCredentialCarriers(part.text).text;
|
|
2036
|
+
if (text === part.text)
|
|
2037
|
+
return part;
|
|
2038
|
+
changed = true;
|
|
2039
|
+
return { ...part, text };
|
|
2040
|
+
});
|
|
2041
|
+
return changed ? next : content;
|
|
2042
|
+
}
|
|
2043
|
+
function replaceInputTranslationContent(content, text) {
|
|
2044
|
+
if (typeof content === 'string')
|
|
2045
|
+
return text;
|
|
2046
|
+
if (!Array.isArray(content))
|
|
2047
|
+
return [{ type: 'text', text }];
|
|
2048
|
+
let replaced = false;
|
|
2049
|
+
const blocks = content.flatMap((part) => {
|
|
2050
|
+
if (!isRecord(part) || part.type !== 'text')
|
|
2051
|
+
return [part];
|
|
2052
|
+
if (replaced)
|
|
2053
|
+
return [];
|
|
2054
|
+
replaced = true;
|
|
2055
|
+
return [{ ...part, text }];
|
|
2056
|
+
});
|
|
2057
|
+
return replaced ? blocks : [{ type: 'text', text }, ...content];
|
|
2058
|
+
}
|
|
2059
|
+
/** Resolved files already have localized path notices. Leaving their file blocks
|
|
2060
|
+
* would make DSH append another, English-only file notice at adapter dispatch.
|
|
2061
|
+
* Preserve images and unresolved files so DSH retains modality/error handling.
|
|
2062
|
+
*/
|
|
2063
|
+
function nativeTranslationContent(content, dshContext) {
|
|
2064
|
+
if (!Array.isArray(content))
|
|
2065
|
+
return content;
|
|
2066
|
+
return content.filter(part => {
|
|
2067
|
+
if (!isRecord(part) || part.type !== 'file')
|
|
2068
|
+
return true;
|
|
2069
|
+
return resolveDshAttachmentPath(dshContext, 'file', isRecord(part.attachment) ? part.attachment : part) === undefined;
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
/** DSH 为工具分段注入的继续提示必须成为下一次 Provider 请求的 prompt。 */
|
|
2073
|
+
function isInjectedStepNotice(message) {
|
|
2074
|
+
if (message.role !== 'user' || !isRecord(message.source))
|
|
2075
|
+
return false;
|
|
2076
|
+
if (message.source.form !== 'notice')
|
|
2077
|
+
return false;
|
|
2078
|
+
// v4 continuations share DSH's model-selection source; only our own IDs
|
|
2079
|
+
// identify a continuation, not an ordinary model-switch notification.
|
|
2080
|
+
return message.source.kind === 'model-selection' && message.id?.startsWith('agent-door-external-step-') === true
|
|
2081
|
+
|| message.source.kind === 'plugin' && message.source.plugin === 'dsh-agentdoor';
|
|
2082
|
+
}
|
|
2083
|
+
function isHumanUserMessage(message) {
|
|
2084
|
+
if (message.role !== 'user')
|
|
2085
|
+
return false;
|
|
2086
|
+
// 旧测试和旧调用方没有 source,保留其兼容语义;有 source 时只接受真实用户消息。
|
|
2087
|
+
if (message.source === undefined)
|
|
2088
|
+
return true;
|
|
2089
|
+
if (!isRecord(message.source))
|
|
2090
|
+
return false;
|
|
2091
|
+
return message.source.kind === undefined || message.source.kind === 'user';
|
|
2092
|
+
}
|
|
2093
|
+
/** DSH 为当前用户消息生成的只读跨会话快照,允许进入外部 Agent 的当前 prompt。 */
|
|
2094
|
+
function isSessionReferenceContext(message) {
|
|
2095
|
+
if (message.role !== 'user' || !isRecord(message.source))
|
|
2096
|
+
return false;
|
|
2097
|
+
return message.source.kind === 'session-reference' && message.source.form === 'recall';
|
|
2098
|
+
}
|
|
2099
|
+
function extractText(content) {
|
|
2100
|
+
if (typeof content === 'string')
|
|
2101
|
+
return content;
|
|
2102
|
+
if (!Array.isArray(content))
|
|
2103
|
+
return '';
|
|
2104
|
+
return content.filter(isRecord).map((part) => typeof part.text === 'string' ? part.text : '').join('\n').trim();
|
|
2105
|
+
}
|
|
2106
|
+
function extractMessageInput(content, dshContext) {
|
|
2107
|
+
if (typeof content === 'string') {
|
|
2108
|
+
const parsed = parseCredentialCarriers(content);
|
|
2109
|
+
return { prompt: parsed.text, translationPrompt: parsed.text, untranslatedPrompt: '', attachments: [], credentialCarriers: parsed.carriers };
|
|
2110
|
+
}
|
|
2111
|
+
if (!Array.isArray(content))
|
|
2112
|
+
return { prompt: '', translationPrompt: '', untranslatedPrompt: '', attachments: [], credentialCarriers: [] };
|
|
2113
|
+
const text = [];
|
|
2114
|
+
const attachments = [];
|
|
2115
|
+
const credentialCarriers = [];
|
|
2116
|
+
for (const part of content) {
|
|
2117
|
+
if (!isRecord(part))
|
|
2118
|
+
continue;
|
|
2119
|
+
if (typeof part.text === 'string' && part.text.trim() !== '') {
|
|
2120
|
+
const parsed = parseCredentialCarriers(part.text);
|
|
2121
|
+
text.push(parsed.text);
|
|
2122
|
+
for (const carrier of parsed.carriers) {
|
|
2123
|
+
if (!credentialCarriers.some((item) => item.requestCode === carrier.requestCode))
|
|
2124
|
+
credentialCarriers.push(carrier);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
const kind = part.type === 'image' ? 'image' : part.type === 'file' ? 'file' : null;
|
|
2128
|
+
if (kind === null)
|
|
2129
|
+
continue;
|
|
2130
|
+
const reference = isRecord(part.attachment) ? part.attachment : part;
|
|
2131
|
+
const path = resolveDshAttachmentPath(dshContext, kind, reference);
|
|
2132
|
+
if (path === undefined)
|
|
2133
|
+
continue;
|
|
2134
|
+
const name = typeof reference.name === 'string' && reference.name.trim() !== '' ? reference.name.trim() : undefined;
|
|
2135
|
+
const mimeType = typeof reference.mediaType === 'string' && reference.mediaType.trim() !== '' ? reference.mediaType.trim() : undefined;
|
|
2136
|
+
attachments.push({ kind, path, ...(name === undefined ? {} : { name }), ...(mimeType === undefined ? {} : { mimeType }) });
|
|
2137
|
+
}
|
|
2138
|
+
const translationPrompt = text.join('\n\n').trim();
|
|
2139
|
+
const untranslatedPrompt = attachmentNotices(attachments);
|
|
2140
|
+
return {
|
|
2141
|
+
prompt: [translationPrompt, untranslatedPrompt].filter(value => value !== '').join('\n\n'),
|
|
2142
|
+
translationPrompt,
|
|
2143
|
+
untranslatedPrompt,
|
|
2144
|
+
attachments,
|
|
2145
|
+
credentialCarriers,
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
function attachmentNotices(attachments, language) {
|
|
2149
|
+
return attachments.filter(attachment => attachment.kind === 'file').map(attachment => attachmentFileNotice(attachment, language)).join('\n\n');
|
|
2150
|
+
}
|
|
2151
|
+
function resolveDshAttachmentPath(dshContext, kind, reference) {
|
|
2152
|
+
if (dshContext === undefined || typeof reference.attachmentId !== 'string')
|
|
2153
|
+
return undefined;
|
|
2154
|
+
try {
|
|
2155
|
+
const attachments = dshContext.get('attachments');
|
|
2156
|
+
const resolver = attachments?.[kind === 'image' ? 'imageHostPath' : 'fileHostPath'];
|
|
2157
|
+
if (typeof resolver !== 'function')
|
|
2158
|
+
return undefined;
|
|
2159
|
+
const hostPath = resolver.call(attachments, reference);
|
|
2160
|
+
if (typeof hostPath !== 'string' || hostPath.trim() === '')
|
|
2161
|
+
return undefined;
|
|
2162
|
+
const fs = dshContext.get('fs');
|
|
2163
|
+
const mapper = fs?.processPathFromHostPath;
|
|
2164
|
+
const processPath = typeof mapper === 'function' ? mapper.call(fs, hostPath) : undefined;
|
|
2165
|
+
return typeof processPath === 'string' && processPath.trim() !== '' ? processPath : hostPath;
|
|
2166
|
+
}
|
|
2167
|
+
catch {
|
|
2168
|
+
return undefined;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* 读取 DSH 会话当前生效的权限状态。
|
|
2173
|
+
*
|
|
2174
|
+
* 三个服务各自负责一部分事实,必须与 DSH 执行侧同源:
|
|
2175
|
+
* - `sandboxPolicy.resolve()` 给出含部署默认的生效模式;
|
|
2176
|
+
* - `approval.overrideOf()` 只返回会话覆盖值,缺省时用服务自身配置的默认策略补齐;
|
|
2177
|
+
* - `permissionPresets.current()` 只用于诊断。
|
|
2178
|
+
*
|
|
2179
|
+
* 任一服务缺失或结构不符时留空对应字段:驱动必须区分“还没读到”和“已确认无限制”,
|
|
2180
|
+
* 绝不能把探测失败当成 danger-full-access。
|
|
2181
|
+
*/
|
|
2182
|
+
function resolveSessionPermission(dshContext, sessionId) {
|
|
2183
|
+
if (dshContext === undefined || sessionId.trim() === '')
|
|
2184
|
+
return undefined;
|
|
2185
|
+
const session = nativeSessionFor(dshContext, sessionId);
|
|
2186
|
+
if (session === undefined)
|
|
2187
|
+
return undefined;
|
|
2188
|
+
const sandboxMode = readSandboxMode(dshContext, session);
|
|
2189
|
+
const approvalPolicy = readApprovalPolicy(dshContext, session);
|
|
2190
|
+
const preset = readPermissionPreset(dshContext, session);
|
|
2191
|
+
if (sandboxMode === undefined && approvalPolicy === undefined && preset === undefined)
|
|
2192
|
+
return undefined;
|
|
2193
|
+
return {
|
|
2194
|
+
...(sandboxMode === undefined ? {} : { sandboxMode }),
|
|
2195
|
+
...(approvalPolicy === undefined ? {} : { approvalPolicy }),
|
|
2196
|
+
...(preset === undefined ? {} : { preset }),
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* DSH 的 `agents` 注册表持有 Agent,而权限服务以 Agent 的 Session 为读取键。
|
|
2201
|
+
* 两者形状变化时都必须留空,不能把 Agent 直接当 Session 传进服务。
|
|
2202
|
+
*/
|
|
2203
|
+
function nativeSessionFor(dshContext, sessionId) {
|
|
2204
|
+
try {
|
|
2205
|
+
const agents = dshContext.get('agents');
|
|
2206
|
+
const get = agents?.get;
|
|
2207
|
+
if (typeof get !== 'function')
|
|
2208
|
+
return undefined;
|
|
2209
|
+
const agent = asRecord(get.call(agents, sessionId));
|
|
2210
|
+
return agent?.session ?? undefined;
|
|
2211
|
+
}
|
|
2212
|
+
catch {
|
|
2213
|
+
return undefined;
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
function readSandboxMode(dshContext, session) {
|
|
2217
|
+
try {
|
|
2218
|
+
const service = dshContext.get('sandboxPolicy');
|
|
2219
|
+
const resolvePolicy = service?.resolve;
|
|
2220
|
+
if (typeof resolvePolicy !== 'function')
|
|
2221
|
+
return undefined;
|
|
2222
|
+
const policy = resolvePolicy.call(service, { session });
|
|
2223
|
+
// 先落到 unknown 再收窄:asRecord 返回的 any 属性不会触发类型谓词收窄,
|
|
2224
|
+
// 直接返回会退化成 boolean,无法赋给 AgentDoorCliSandboxMode。
|
|
2225
|
+
const mode = asRecord(policy)?.mode;
|
|
2226
|
+
return isSandboxMode(mode) ? mode : undefined;
|
|
2227
|
+
}
|
|
2228
|
+
catch {
|
|
2229
|
+
return undefined;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
function readApprovalPolicy(dshContext, session) {
|
|
2233
|
+
try {
|
|
2234
|
+
const service = dshContext.get('approval');
|
|
2235
|
+
const overrideOf = service?.overrideOf;
|
|
2236
|
+
const override = typeof overrideOf === 'function' ? overrideOf.call(service, session) : undefined;
|
|
2237
|
+
if (isApprovalPolicy(override))
|
|
2238
|
+
return override;
|
|
2239
|
+
// 没有会话覆盖时,服务自身配置的策略就是生效值;缺省与 DSH 一致按 ask 处理。
|
|
2240
|
+
const configured = asRecord(service?.config)?.policy;
|
|
2241
|
+
return isApprovalPolicy(configured) ? configured : 'ask';
|
|
2242
|
+
}
|
|
2243
|
+
catch {
|
|
2244
|
+
return undefined;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
function readPermissionPreset(dshContext, session) {
|
|
2248
|
+
try {
|
|
2249
|
+
const service = dshContext.get('permissionPresets');
|
|
2250
|
+
const current = service?.current;
|
|
2251
|
+
if (typeof current !== 'function')
|
|
2252
|
+
return undefined;
|
|
2253
|
+
const preset = current.call(service, session);
|
|
2254
|
+
return typeof preset === 'string' && preset.trim() !== '' ? preset.trim() : undefined;
|
|
2255
|
+
}
|
|
2256
|
+
catch {
|
|
2257
|
+
return undefined;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
function isSandboxMode(value) {
|
|
2261
|
+
return value === 'read-only' || value === 'workspace-write' || value === 'danger-full-access';
|
|
2262
|
+
}
|
|
2263
|
+
function isApprovalPolicy(value) {
|
|
2264
|
+
return value === 'ask' || value === 'never';
|
|
2265
|
+
}
|
|
2266
|
+
function resolveSessionCwd(nativeSessions, sessionId, value) {
|
|
2267
|
+
const direct = typeof value?.cwd === 'string' && value.cwd.trim() ? value.cwd.trim() : undefined;
|
|
2268
|
+
if (direct !== undefined)
|
|
2269
|
+
return direct;
|
|
2270
|
+
if (nativeSessions === undefined || sessionId.trim() === '')
|
|
2271
|
+
return undefined;
|
|
2272
|
+
const session = nativeSessions.get(sessionId);
|
|
2273
|
+
const record = asRecord(session);
|
|
2274
|
+
const header = asRecord(record?.header);
|
|
2275
|
+
const meta = asRecord(record?.meta);
|
|
2276
|
+
const directCwd = [header?.cwd, meta?.cwd, record?.cwd].find((item) => typeof item === 'string' && item.trim() !== '');
|
|
2277
|
+
if (directCwd !== undefined)
|
|
2278
|
+
return directCwd.trim();
|
|
2279
|
+
const snapshot = record?.snapshotEvents;
|
|
2280
|
+
if (typeof snapshot === 'function') {
|
|
2281
|
+
try {
|
|
2282
|
+
const events = snapshot.call(session);
|
|
2283
|
+
const eventCwd = findCwdInValue(events, 0);
|
|
2284
|
+
if (eventCwd !== undefined)
|
|
2285
|
+
return eventCwd;
|
|
2286
|
+
}
|
|
2287
|
+
catch { /* 原生会话快照不可读时继续使用未解析状态。 */ }
|
|
2288
|
+
}
|
|
2289
|
+
return findCwdInValue(record, 0);
|
|
2290
|
+
}
|
|
2291
|
+
/** DSH 的 cwd 可能只存在 request/header.data.header 或事件 data.cwd 中。 */
|
|
2292
|
+
function findCwdInValue(value, depth) {
|
|
2293
|
+
if (depth > 6 || value === null || typeof value !== 'object')
|
|
2294
|
+
return undefined;
|
|
2295
|
+
if (Array.isArray(value)) {
|
|
2296
|
+
for (const item of value) {
|
|
2297
|
+
const found = findCwdInValue(item, depth + 1);
|
|
2298
|
+
if (found !== undefined)
|
|
2299
|
+
return found;
|
|
2300
|
+
}
|
|
2301
|
+
return undefined;
|
|
2302
|
+
}
|
|
2303
|
+
const record = value;
|
|
2304
|
+
for (const key of ['cwd', 'workingDirectory']) {
|
|
2305
|
+
const candidate = record[key];
|
|
2306
|
+
if (typeof candidate === 'string' && candidate.trim() !== '')
|
|
2307
|
+
return candidate.trim();
|
|
2308
|
+
}
|
|
2309
|
+
for (const key of ['header', 'request', 'context', 'data', 'meta', 'session']) {
|
|
2310
|
+
const found = findCwdInValue(record[key], depth + 1);
|
|
2311
|
+
if (found !== undefined)
|
|
2312
|
+
return found;
|
|
2313
|
+
}
|
|
2314
|
+
return undefined;
|
|
2315
|
+
}
|
|
2316
|
+
function readDshSessionDisplayName(sessionId, sessionStore, nativeSessions, dshContext) {
|
|
2317
|
+
const direct = readNativeSession(nativeSessions, sessionId);
|
|
2318
|
+
const directName = readNativeSessionDisplayName(direct, dshContext);
|
|
2319
|
+
if (directName !== undefined)
|
|
2320
|
+
return directName;
|
|
2321
|
+
const directRecord = sessionStore.get(sessionId);
|
|
2322
|
+
const directRecordName = cleanDisplayName(directRecord?.title);
|
|
2323
|
+
if (directRecordName !== undefined)
|
|
2324
|
+
return directRecordName;
|
|
2325
|
+
const binding = sessionStore.list({ includeArchived: true }).find((record) => record.dshSessionId === sessionId || record.providerSessionId === sessionId);
|
|
2326
|
+
if (binding === undefined)
|
|
2327
|
+
return undefined;
|
|
2328
|
+
return readNativeSessionDisplayName(readNativeSession(nativeSessions, binding.dshSessionId), dshContext)
|
|
2329
|
+
?? cleanDisplayName(binding.title);
|
|
2330
|
+
}
|
|
2331
|
+
function readNativeSessionDisplayName(value, dshContext) {
|
|
2332
|
+
const root = asRecord(value);
|
|
2333
|
+
if (root === null)
|
|
2334
|
+
return undefined;
|
|
2335
|
+
const projection = asRecord(root.projections) ?? asRecord(asRecord(root.record)?.projections);
|
|
2336
|
+
const values = asRecord(projection?.values);
|
|
2337
|
+
const record = asRecord(root.record);
|
|
2338
|
+
const header = asRecord(root.header);
|
|
2339
|
+
const recordHeader = asRecord(record?.header);
|
|
2340
|
+
const rows = asRecord(record?.rows);
|
|
2341
|
+
const rowProjection = asRecord(rows?.projections);
|
|
2342
|
+
const rowValues = asRecord(rowProjection?.values);
|
|
2343
|
+
const titleService = asRecord(readOptionalDshService(dshContext, 'sessionTitle'));
|
|
2344
|
+
if (typeof titleService?.get === 'function') {
|
|
2345
|
+
try {
|
|
2346
|
+
const snapshot = titleService.get(value);
|
|
2347
|
+
const title = cleanDisplayName(asRecord(snapshot)?.title ?? snapshot);
|
|
2348
|
+
if (title !== undefined)
|
|
2349
|
+
return title;
|
|
2350
|
+
}
|
|
2351
|
+
catch { /* The optional native title service may not accept this session shape. */ }
|
|
2352
|
+
}
|
|
2353
|
+
for (const candidate of [
|
|
2354
|
+
values?.title, rowValues?.title, root.title, root.name, root.displayName,
|
|
2355
|
+
header?.title, header?.name, header?.displayName,
|
|
2356
|
+
record?.title, record?.name, recordHeader?.title, recordHeader?.name,
|
|
2357
|
+
]) {
|
|
2358
|
+
const title = cleanDisplayName(candidate);
|
|
2359
|
+
if (title !== undefined)
|
|
2360
|
+
return title;
|
|
2361
|
+
}
|
|
2362
|
+
if (typeof root.snapshotEvents === 'function') {
|
|
2363
|
+
try {
|
|
2364
|
+
const events = root.snapshotEvents.call(value);
|
|
2365
|
+
if (Array.isArray(events)) {
|
|
2366
|
+
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
2367
|
+
const event = asRecord(events[index]);
|
|
2368
|
+
if (event?.type !== 'session/title')
|
|
2369
|
+
continue;
|
|
2370
|
+
const title = cleanDisplayName(asRecord(event.data)?.title ?? event.title);
|
|
2371
|
+
if (title !== undefined)
|
|
2372
|
+
return title;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
catch { /* A missing or closed native history cannot block usage rendering. */ }
|
|
2377
|
+
}
|
|
2378
|
+
return undefined;
|
|
2379
|
+
}
|
|
2380
|
+
function readNativeSession(nativeSessions, sessionId) {
|
|
2381
|
+
try {
|
|
2382
|
+
return nativeSessions?.get(sessionId);
|
|
2383
|
+
}
|
|
2384
|
+
catch {
|
|
2385
|
+
return undefined;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
function readOptionalDshService(context, name) {
|
|
2389
|
+
const get = context?.get;
|
|
2390
|
+
if (typeof get !== 'function')
|
|
2391
|
+
return undefined;
|
|
2392
|
+
try {
|
|
2393
|
+
return get.call(context, name);
|
|
2394
|
+
}
|
|
2395
|
+
catch {
|
|
2396
|
+
return undefined;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
function cleanDisplayName(value) {
|
|
2400
|
+
if (typeof value !== 'string')
|
|
2401
|
+
return undefined;
|
|
2402
|
+
const name = value.trim().replace(/[\u0000-\u001f\u007f]/gu, '').slice(0, 240);
|
|
2403
|
+
return name === '' ? undefined : name;
|
|
2404
|
+
}
|
|
2405
|
+
function asRecord(value) { return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null; }
|
|
2406
|
+
function isRecord(value) { return asRecord(value) !== null; }
|
|
2407
|
+
function nativeSessionId(value) {
|
|
2408
|
+
const record = asRecord(value);
|
|
2409
|
+
return typeof record?.id === 'string' && record.id.trim() ? record.id.trim() : typeof record?.sessionId === 'string' && record.sessionId.trim() ? record.sessionId.trim() : undefined;
|
|
2410
|
+
}
|
|
2411
|
+
function nativeEventType(value) {
|
|
2412
|
+
const record = asRecord(value);
|
|
2413
|
+
return typeof record?.type === 'string' ? record.type : undefined;
|
|
2414
|
+
}
|
|
2415
|
+
function isMessage(value) { const record = asRecord(value); return (record?.role === 'user' || record?.role === 'assistant' || record?.role === 'system' || record?.role === 'tool') && 'content' in record; }
|
|
2416
|
+
function isAbortSignal(value) { return asRecord(value)?.aborted === true || (asRecord(value)?.addEventListener instanceof Function); }
|
|
2417
|
+
function safeError(error) { return error instanceof Error ? error.message.slice(0, 512) : String(error).slice(0, 512); }
|
|
2418
|
+
//# sourceMappingURL=feature.js.map
|