@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,2226 @@
|
|
|
1
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { basename, join, resolve } from 'node:path';
|
|
6
|
+
import { JsonRpcProcess, JsonRpcRequestError } from './json-rpc-process.js';
|
|
7
|
+
import { detectBinary, emptyCatalog, isRecord, textValue, usageChunk } from './rpc-driver-utils.js';
|
|
8
|
+
import { CODEX_CATALOG, isProviderDefaultModel } from './model-catalog.js';
|
|
9
|
+
import { probeStoredSession, readFirstJsonRecord } from './session-probe.js';
|
|
10
|
+
import { firstToolText, normalizeToolStatus, serializeToolValue } from './tool-observation.js';
|
|
11
|
+
import { isQuestionEvent, questionAnswersRecord, readAgentQuestions } from './interaction-events.js';
|
|
12
|
+
import { codexBridgeArgs, codexBridgeDeveloperInstructions, codexComputerUseLaunchSettings, teamBridgeToken } from '../cli-bridge/injections.js';
|
|
13
|
+
import { CodexFileCitationNormalizer } from './codex-file-citations.js';
|
|
14
|
+
import { CodexPerformanceTracker } from './codex-performance.js';
|
|
15
|
+
/** Codex app-server 对已结束回合执行 turn/steer 时返回的固定错误文本。 */
|
|
16
|
+
const CODEX_NO_ACTIVE_TURN_TO_STEER = 'no active turn to steer';
|
|
17
|
+
const DEFAULT_STEER_TERMINAL_GRACE_MS = 2_000;
|
|
18
|
+
// 只有 Provider 已明确报告超过窗口时才主动压缩;接近上限仍交给 Codex
|
|
19
|
+
// 自身的 auto-compact,避免对正常的高占用回合重复发起压缩。
|
|
20
|
+
const CODEX_COMPACTION_THRESHOLD = 1;
|
|
21
|
+
const CODEX_COMPACTION_TIMEOUT_MS = 60_000;
|
|
22
|
+
const CODEX_APP_SERVER_BASE_ARGS = [
|
|
23
|
+
// 原生 request_permissions 默认关闭。必须在插件进程内启用,模型才能主动
|
|
24
|
+
// 发出 item/permissions/requestApproval,而不是靠试写文件碰沙箱边界。
|
|
25
|
+
// 用配置覆盖而非 --enable:旧版会忽略未知 feature 配置,保留原命令审批通道。
|
|
26
|
+
'-c', 'features.request_permissions_tool=true',
|
|
27
|
+
'app-server',
|
|
28
|
+
// Codex 默认关闭 request_user_input;不开启时模型只能把“提问”写成普通文本,
|
|
29
|
+
// app-server 不会发出 item/tool/requestUserInput,DSH 也就没有问题事件可投影。
|
|
30
|
+
'--enable', 'default_mode_request_user_input',
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* DSH 的问题面板只实现了 Codex 的同步 `request_user_input` 回路。
|
|
34
|
+
*
|
|
35
|
+
* Codex 0.153.0 起还会按模型目录暴露 `request_user_input_async`。该工具只
|
|
36
|
+
* 追加带 `delivery: "async"` 的 AgentMessage,然后立即返回 accepted,没有可供
|
|
37
|
+
* DSH 通过 `item/tool/requestUserInput` 回复的 JSON-RPC 请求。若不在模型上下文
|
|
38
|
+
* 中明确约束,模型可能把“已提问”写成普通文本,回合随即结束,用户看不到可提交
|
|
39
|
+
* 的问题面板。这里使用 Codex 官方建议的宿主侧 workaround:强制模型选择同步
|
|
40
|
+
* 工具,并等待结构化答案。
|
|
41
|
+
*/
|
|
42
|
+
const CODEX_QUESTION_DEVELOPER_INSTRUCTIONS = [
|
|
43
|
+
'AgentDoor 提供的是阻塞式原生问题面板。',
|
|
44
|
+
'需要向用户提问时,必须调用同步的 request_user_input 工具,提供 1 到 3 个完整问题和可选项,并等待结构化回答。',
|
|
45
|
+
'不要调用 request_user_input_async,也不要只用普通文本声称问题已经发送;在收到问题回答前不要结束当前回合。',
|
|
46
|
+
].join('\n');
|
|
47
|
+
/**
|
|
48
|
+
* 权限申请属于宿主接入契约,由适配器提供指令,不要求用户指定工具、参数和路径。
|
|
49
|
+
* 指令负责让模型选择原生申请通道;实际执行边界仍由每轮下发的沙箱策略强制执行。
|
|
50
|
+
* 这里不缓存权限档位,避免用户在后续回合切换权限后沿用旧的行为说明。
|
|
51
|
+
*/
|
|
52
|
+
const CODEX_PERMISSION_DEVELOPER_INSTRUCTIONS = [
|
|
53
|
+
'AgentDoor 通过 DSH 原生审批面板处理权限申请,权限边界和审批策略以当前回合的运行时上下文为准。',
|
|
54
|
+
'Computer Use 只在 macOS 官方 cua_repl 运行时可用,需要系统为运行时授予屏幕录制和辅助功能权限;权限不足时如实报告失败,不要反复重试或改用命令工具绕过拒绝。',
|
|
55
|
+
'操作需要额外权限且当前审批策略允许交互时,优先调用原生 request_permissions 工具,申请完成任务所需的最小文件或网络权限,并等待结构化审批结果。',
|
|
56
|
+
'用户要求主动触发或验证权限申请时,应自行选择当前允许范围之外的最小权限并调用 request_permissions;工作区、/tmp、/private/tmp 和 TMPDIR 可能已可写,在这些目录执行普通写入不等于发起审批。',
|
|
57
|
+
'只有当前工具列表没有 request_permissions 时,才使用原生命令工具的 require_escalated 审批通道;工具参数和目标路径由你确定,不要要求用户编写提权命令。',
|
|
58
|
+
'审批策略为 never 时不要申请或反复重试;如果当前已有所需权限,如实说明无需额外授权,不要声称已发生用户审批。',
|
|
59
|
+
'审批返回后检查实际授予的权限范围,只执行被授予范围内的操作;测试批准结果时选择不会覆盖已有文件的最小操作,并验证真实执行结果。',
|
|
60
|
+
'权限未授予、被拒绝或取消时停止对应的受限操作,不要用其他工具或路径绕过同一次拒绝;申请已发送、命令成功和用户已批准是不同事实,报告结论必须依据实际审批及执行结果。',
|
|
61
|
+
].join('\n');
|
|
62
|
+
/** Codex app-server 的 JSON-RPC 驱动,Host 只暴露统一文本流,不暴露线程和 token。 */
|
|
63
|
+
export class CodexAppServerDriver {
|
|
64
|
+
descriptor = { id: 'codex', name: 'Codex', protocol: 'json-rpc', capabilities: ['models', 'skills', 'stream', 'resume', 'interrupt', 'tool-events', 'reasoning', 'usage', 'permission', 'questions', 'steer', 'computer-use'] };
|
|
65
|
+
// Codex 一个 Provider turn 可能同时包含多个工具调用。只有 assistant item
|
|
66
|
+
// 切换后才分段,不能在每个工具完成后注入下一 step。
|
|
67
|
+
supportsSegmentedTurns = true;
|
|
68
|
+
binaries;
|
|
69
|
+
runSpawnSync;
|
|
70
|
+
runSpawn;
|
|
71
|
+
now;
|
|
72
|
+
sessionRoots;
|
|
73
|
+
/** Codex 配置根目录;`config.toml` 与 `auth.json` 都位于这里。 */
|
|
74
|
+
codexHome;
|
|
75
|
+
computerUseMode;
|
|
76
|
+
computerUseConfig;
|
|
77
|
+
steerTerminalGraceMs;
|
|
78
|
+
cachedBinary = null;
|
|
79
|
+
processes = new Set();
|
|
80
|
+
sessions = new Map();
|
|
81
|
+
constructor(options = {}) {
|
|
82
|
+
this.binaries = options.binaries ?? ['codex'];
|
|
83
|
+
this.runSpawnSync = options.spawnSync ?? spawnSync;
|
|
84
|
+
this.runSpawn = options.spawn ?? spawn;
|
|
85
|
+
this.now = options.now ?? Date.now;
|
|
86
|
+
const codexHome = options.codexHome ?? process.env.CODEX_HOME ?? join(homedir(), '.codex');
|
|
87
|
+
this.codexHome = codexHome;
|
|
88
|
+
// 直接构造驱动时保持旧的安全默认值;正式 Feature 显式传入 auto,避免测试
|
|
89
|
+
// 或第三方嵌入在没有桌面宿主时意外启动 CUA 运行时。
|
|
90
|
+
this.computerUseMode = options.computerUse ?? 'disabled';
|
|
91
|
+
this.computerUseConfig = options.computerUseConfig;
|
|
92
|
+
this.steerTerminalGraceMs = options.steerTerminalGraceMs ?? DEFAULT_STEER_TERMINAL_GRACE_MS;
|
|
93
|
+
this.sessionRoots = options.sessionRoots ?? [join(codexHome, 'sessions'), join(codexHome, 'archived_sessions')];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Codex 目录语义指纹。
|
|
97
|
+
*
|
|
98
|
+
* 目录里的 `officialSubscription` 与 `defaultServiceTier` 完全由 `config.toml`
|
|
99
|
+
* 的 `model_provider` / `openai_base_url` / `service_tier` 和 `auth.json` 的登录
|
|
100
|
+
* 模式决定。用户在 cc-switch 之类的工具里切供应商时,只改写这两个文件,
|
|
101
|
+
* `codex` 可执行文件不变,安装探测指纹也就不会变——若不单独比对它们,
|
|
102
|
+
* 10 分钟 TTL 的目录缓存会把「第三方」判定一直沿用下去,官方订阅的 Fast
|
|
103
|
+
* 档位开关就会长期不出现。
|
|
104
|
+
*
|
|
105
|
+
* 只对解析出的**非敏感字段**做哈希:`auth.json` 里的 token 永远不进入指纹,
|
|
106
|
+
* 因此这里返回的内容不能反推凭据。
|
|
107
|
+
*/
|
|
108
|
+
catalogFingerprint() {
|
|
109
|
+
const config = readTextFile(join(this.codexHome, 'config.toml'));
|
|
110
|
+
const auth = readTextFile(join(this.codexHome, 'auth.json'));
|
|
111
|
+
// 两个文件都读不到时返回 undefined,表示无法判断;Registry 不会据此失效缓存,
|
|
112
|
+
// 避免在非标准部署下把目录变成每次都重新探测。
|
|
113
|
+
if (config === undefined && auth === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
const configSummary = config === undefined ? 'missing' : summarizeCodexConfig(config);
|
|
116
|
+
const authSummary = auth === undefined ? 'missing' : summarizeCodexAuth(auth);
|
|
117
|
+
return createHash('sha256').update(`${configSummary}\u0000${authSummary}`).digest('hex').slice(0, 16);
|
|
118
|
+
}
|
|
119
|
+
async detect() {
|
|
120
|
+
const result = await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync });
|
|
121
|
+
if (result.installed)
|
|
122
|
+
this.cachedBinary = result.command;
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
async listModels() {
|
|
126
|
+
const command = this.cachedBinary ?? (await this.detect()).command;
|
|
127
|
+
if (command === null)
|
|
128
|
+
return emptyCatalog();
|
|
129
|
+
// 模型目录查询不需要启动桌面运行时;否则每次刷新模型都会唤起 CUA 服务,
|
|
130
|
+
// 还可能在没有系统权限时把一个与模型无关的失败带进目录查询。
|
|
131
|
+
const rpc = new JsonRpcProcess({ command, args: this.appServerArgs(false), explicitWindowsShell: true, spawn: this.runSpawn });
|
|
132
|
+
const controller = new AbortController();
|
|
133
|
+
const timer = setTimeout(() => controller.abort(), 12_000);
|
|
134
|
+
try {
|
|
135
|
+
await rpc.request('initialize', {
|
|
136
|
+
clientInfo: { name: 'Codex', version: '0.1.1' },
|
|
137
|
+
capabilities: {},
|
|
138
|
+
}, { signal: controller.signal });
|
|
139
|
+
rpc.notify('initialized', {});
|
|
140
|
+
// config/read 让 Codex 完成一次配置加载;model/list 才返回带 effort 元数据的目录。
|
|
141
|
+
const config = await rpc.request('config/read', {}, { signal: controller.signal });
|
|
142
|
+
const response = await rpc.request('model/list', {}, { signal: controller.signal });
|
|
143
|
+
const catalog = parseCodexCatalog(response);
|
|
144
|
+
if (catalog.groups.length === 0)
|
|
145
|
+
return CODEX_CATALOG;
|
|
146
|
+
// 配置里的 service_tier 是线程未显式选择时真正生效的档位:app-server 会继承
|
|
147
|
+
// 它,但**不会**继承 model/list 的 defaultServiceTier。取错来源会让界面显示
|
|
148
|
+
// “Fast 已开启”,而线程实际以标准档运行。
|
|
149
|
+
const configuredTier = readConfiguredServiceTier(config);
|
|
150
|
+
const withDefault = configuredTier === undefined ? catalog : { ...catalog, defaultServiceTier: configuredTier };
|
|
151
|
+
// 服务档位是官方订阅能力。目录本身在第三方配置下也会返回 serviceTiers,
|
|
152
|
+
// 必须再用账号类型确认,否则界面会给出一个切换后不生效的开关。
|
|
153
|
+
// 没有任何模型声明档位时不必多花一次 RPC,保留“未确认”语义。
|
|
154
|
+
if (!catalogHasServiceTiers(withDefault))
|
|
155
|
+
return withDefault;
|
|
156
|
+
const officialSubscription = await readCodexOfficialSubscription(rpc, controller.signal, config, this.codexHome);
|
|
157
|
+
return officialSubscription === undefined ? withDefault : { ...withDefault, officialSubscription };
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return CODEX_CATALOG;
|
|
161
|
+
}
|
|
162
|
+
finally {
|
|
163
|
+
clearTimeout(timer);
|
|
164
|
+
rpc.dispose();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async probeSession(input) {
|
|
168
|
+
return probeStoredSession(input, {
|
|
169
|
+
roots: this.sessionRoots,
|
|
170
|
+
matches: (path, entry, id) => entry.isFile() && basename(path).endsWith(`${id}.jsonl`),
|
|
171
|
+
validate: async (path, id) => {
|
|
172
|
+
const record = await readFirstJsonRecord(path);
|
|
173
|
+
return isRecord(record?.payload) && record.payload.id === id;
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 读取 Codex 当前工作目录的 Skill 目录。
|
|
179
|
+
*
|
|
180
|
+
* Skill 路径和内容只在本驱动缓存,Client 只能拿到可展示的摘要;这样既能
|
|
181
|
+
* 给 DSH `/skills` 提供目录,也不会把任意本地绝对路径变成浏览器输入。
|
|
182
|
+
*/
|
|
183
|
+
async listSkills(input) {
|
|
184
|
+
const command = this.cachedBinary ?? (await this.detect()).command;
|
|
185
|
+
if (command === null)
|
|
186
|
+
return [];
|
|
187
|
+
const sessionInput = {
|
|
188
|
+
sessionId: input.sessionId,
|
|
189
|
+
messages: [],
|
|
190
|
+
prompt: '',
|
|
191
|
+
...(input.cwd === undefined ? {} : { cwd: input.cwd }),
|
|
192
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
193
|
+
};
|
|
194
|
+
const session = await this.getSession(sessionInput, command);
|
|
195
|
+
await this.refreshSkillCatalog(session, input.cwd, input.forceReload === true, input.signal);
|
|
196
|
+
return [...session.skills.values()].map(({ path: _path, ...descriptor }) => descriptor);
|
|
197
|
+
}
|
|
198
|
+
async compact(input) {
|
|
199
|
+
input.signal?.throwIfAborted();
|
|
200
|
+
if (!input.providerSessionId)
|
|
201
|
+
throw new Error('CODEX_COMPACTION_SESSION_REQUIRED');
|
|
202
|
+
const previous = this.sessions.get(input.sessionId);
|
|
203
|
+
if (previous?.turnId || previous?.segmentedTurn || previous?.compacting)
|
|
204
|
+
throw new Error('CODEX_COMPACTION_BUSY');
|
|
205
|
+
const turnInput = { ...input, messages: [], prompt: '' };
|
|
206
|
+
const command = this.cachedBinary ?? (await this.detect()).command;
|
|
207
|
+
if (command === null)
|
|
208
|
+
throw new Error('Codex 未安装');
|
|
209
|
+
if (previous && previous.threadId !== '' && previous.threadId !== input.providerSessionId) {
|
|
210
|
+
previous.rpc.dispose();
|
|
211
|
+
this.sessions.delete(input.sessionId);
|
|
212
|
+
}
|
|
213
|
+
let session;
|
|
214
|
+
try {
|
|
215
|
+
session = previous && !previous.rpc.isClosed && previous.cwd === input.cwd
|
|
216
|
+
&& previous.threadId === input.providerSessionId ? previous : await this.getSession(turnInput, command);
|
|
217
|
+
if (session.threadId === '') {
|
|
218
|
+
const response = await session.rpc.request('thread/resume', {
|
|
219
|
+
threadId: input.providerSessionId, ...codexThreadParams(turnInput),
|
|
220
|
+
}, { signal: input.signal, killOnAbort: false });
|
|
221
|
+
session.threadId = readId(response) ?? input.providerSessionId;
|
|
222
|
+
session.providerSessionId = session.threadId;
|
|
223
|
+
session.threadModelId = readThreadModel(response);
|
|
224
|
+
session.threadServiceTierId = readThreadServiceTier(response);
|
|
225
|
+
}
|
|
226
|
+
if (session.threadId !== input.providerSessionId)
|
|
227
|
+
throw new Error('CODEX_COMPACTION_SESSION_MISMATCH');
|
|
228
|
+
await this.compactThread(session, turnInput);
|
|
229
|
+
return { compacted: true };
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
// Initialization and resume can fail or be cancelled before compaction starts.
|
|
233
|
+
// Discard that process as well; the next operation resumes the persisted thread.
|
|
234
|
+
this.sessions.get(input.sessionId)?.rpc.dispose();
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
// Manual commands have their own command/run + command/done log. Do not replay
|
|
239
|
+
// these standalone maintenance events inside the next user turn.
|
|
240
|
+
if (session !== undefined)
|
|
241
|
+
session.pendingCompactionEvents.length = 0;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
async *executeTurn(input) {
|
|
245
|
+
const citations = new CodexFileCitationNormalizer();
|
|
246
|
+
for await (const chunk of this.executeRawTurn(input))
|
|
247
|
+
yield* citations.push(chunk);
|
|
248
|
+
yield* citations.flush();
|
|
249
|
+
}
|
|
250
|
+
async *executeRawTurn(input) {
|
|
251
|
+
const command = this.cachedBinary ?? (await this.detect()).command;
|
|
252
|
+
if (command === null)
|
|
253
|
+
throw new Error('Codex 未安装');
|
|
254
|
+
if (input.splitToolSteps && this.supportsSegmentedTurns) {
|
|
255
|
+
yield* this.executeSegmentedTurn(input, command);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const session = await this.getSession(input, command);
|
|
259
|
+
prepareCodexSession(session, input);
|
|
260
|
+
const rpc = session.rpc;
|
|
261
|
+
try {
|
|
262
|
+
if (session.threadId === '') {
|
|
263
|
+
const threadParams = codexThreadParams(input);
|
|
264
|
+
const resumeThreadId = input.providerSessionId ?? session.resumeThreadId;
|
|
265
|
+
const thread = resumeThreadId
|
|
266
|
+
? await rpc.request('thread/resume', { threadId: resumeThreadId, ...threadParams }, { signal: input.signal, killOnAbort: false })
|
|
267
|
+
: await rpc.request('thread/start', threadParams, { signal: input.signal, killOnAbort: false });
|
|
268
|
+
session.threadId = readId(thread) ?? input.providerSessionId ?? input.sessionId;
|
|
269
|
+
session.providerSessionId = session.threadId;
|
|
270
|
+
session.threadModelId = readThreadModel(thread);
|
|
271
|
+
session.threadServiceTierId = readThreadServiceTier(thread);
|
|
272
|
+
}
|
|
273
|
+
await this.alignThreadModel(session, input);
|
|
274
|
+
await this.alignThreadServiceTier(session, input);
|
|
275
|
+
await this.ensureContextCapacity(session, input);
|
|
276
|
+
yield* drainCompactionEvents(session);
|
|
277
|
+
yield { type: 'session-binding', providerSessionId: session.providerSessionId };
|
|
278
|
+
const eventQueue = createCodexTurnEventQueue();
|
|
279
|
+
let turnStartResolved = false;
|
|
280
|
+
const notificationsBeforeTurnStart = [];
|
|
281
|
+
let terminalReason = null;
|
|
282
|
+
let failure;
|
|
283
|
+
let sawMeaningfulEvent = false;
|
|
284
|
+
const acceptNotification = (message, allowUnidentifiedTool) => {
|
|
285
|
+
// Codex 自动压缩可能在独立的内部 turn 中运行。它不属于当前用户 turn,
|
|
286
|
+
// 但压缩 item 和 thread/compacted 必须继续进入公共投影层,否则压缩虽已发生,
|
|
287
|
+
// 原生会话不会显示任何 compaction 活动。
|
|
288
|
+
if (isCodexCompactionNotification(message, session.threadId)) {
|
|
289
|
+
const notificationTurnId = readTurnId(message);
|
|
290
|
+
// 显式 thread/compact/start 由 waitForCompaction 独占消费通知并生成
|
|
291
|
+
// start/summary/end,当前 turn 队列不能再次投影同一组事件。
|
|
292
|
+
if (!session.suppressCompactionNotifications
|
|
293
|
+
&& (notificationTurnId === null || !session.suppressedCompactionTurnIds.has(notificationTurnId)))
|
|
294
|
+
eventQueue.push(message);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
// `turn/steer` 可能把 Codex 的活动回合切换成新的 turnId。这里必须读取
|
|
298
|
+
// 会话共享状态;闭包里的旧 turnId 会把新回合正文误判成别的回合,随后
|
|
299
|
+
// 迟到的旧 turn/completed 关闭队列,表现为插话消息发送后立即消失。
|
|
300
|
+
if (!isCodexNotificationForTurn(message, session.threadId, session.turnId, allowUnidentifiedTool))
|
|
301
|
+
return;
|
|
302
|
+
const turnId = readTurnId(message);
|
|
303
|
+
if (turnId !== null) {
|
|
304
|
+
session.turnId = turnId;
|
|
305
|
+
}
|
|
306
|
+
eventQueue.push(withCodexPerformance(session, message));
|
|
307
|
+
const reason = readCodexTerminalReason(message);
|
|
308
|
+
if (reason !== null) {
|
|
309
|
+
terminalReason = reason;
|
|
310
|
+
if (reason === 'error')
|
|
311
|
+
failure = codexFailure(message);
|
|
312
|
+
eventQueue.close();
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const onNotification = (message) => {
|
|
316
|
+
// thread/resume 后,Codex 可能把旧回合的 item 通知迟到到达,并且
|
|
317
|
+
// 与本次 turn/start 的响应交错。响应返回前不能把这些通知当成当前回合,
|
|
318
|
+
// 否则旧工具历史会在流式界面被追加到当前消息末尾。
|
|
319
|
+
if (!turnStartResolved) {
|
|
320
|
+
notificationsBeforeTurnStart.push(message);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
acceptNotification(message, true);
|
|
324
|
+
};
|
|
325
|
+
// 与父仓库 CodexRuntimeAdapter 一致:监听器必须先于 turn/start 注册,
|
|
326
|
+
// 否则响应前到达的 turn/started 或文本通知也会丢失。
|
|
327
|
+
const removeNotificationListener = rpc.addNotificationListener(onNotification);
|
|
328
|
+
const onAbort = () => {
|
|
329
|
+
terminalReason = 'cancel';
|
|
330
|
+
eventQueue.close();
|
|
331
|
+
};
|
|
332
|
+
if (input.signal?.aborted)
|
|
333
|
+
onAbort();
|
|
334
|
+
else
|
|
335
|
+
input.signal?.addEventListener('abort', onAbort, { once: true });
|
|
336
|
+
try {
|
|
337
|
+
const response = await this.startTurn(session, input);
|
|
338
|
+
// turn/start 可能因上下文超限内部触发 compact;压缩事件在重试成功后
|
|
339
|
+
// 仍需先交给公共投影器,不能留在驱动的暂存队列里。
|
|
340
|
+
yield* drainCompactionEvents(session);
|
|
341
|
+
const responseTurnId = readTurnId(response);
|
|
342
|
+
if (responseTurnId !== null) {
|
|
343
|
+
session.turnId = responseTurnId;
|
|
344
|
+
}
|
|
345
|
+
turnStartResolved = true;
|
|
346
|
+
// 响应前缓存的通知可能来自 thread/resume 的旧历史。没有 turnId 的事件
|
|
347
|
+
// 无法证明属于本次回合,因此只能丢弃;有明确 turnId 的事件仍按原有规则处理。
|
|
348
|
+
for (const message of notificationsBeforeTurnStart.splice(0))
|
|
349
|
+
acceptNotification(message, false);
|
|
350
|
+
// 某些 app-server 会直接在 turn/start 响应中返回终态。父仓库把它
|
|
351
|
+
// 归一化成 turn/completed,这里复用同一规则,避免永久等待通知。
|
|
352
|
+
const responseTerminal = buildCodexCompletionNotification(response, session.threadId);
|
|
353
|
+
if (responseTerminal !== null)
|
|
354
|
+
onNotification(responseTerminal);
|
|
355
|
+
for await (const message of eventQueue.iterable) {
|
|
356
|
+
const rawChunk = codexMessageToChunk(message, input.cwd);
|
|
357
|
+
if (rawChunk === null)
|
|
358
|
+
continue;
|
|
359
|
+
for (const chunk of expandCodexCompactionChunk(session, rawChunk)) {
|
|
360
|
+
if (chunk.type !== 'finish')
|
|
361
|
+
sawMeaningfulEvent = true;
|
|
362
|
+
yield stabilizeCodexEvent(session, chunk);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (input.signal?.aborted)
|
|
366
|
+
await this.interrupt(input.sessionId);
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
if (!input.signal?.aborted)
|
|
370
|
+
throw error;
|
|
371
|
+
await this.interrupt(input.sessionId);
|
|
372
|
+
}
|
|
373
|
+
finally {
|
|
374
|
+
input.signal?.removeEventListener('abort', onAbort);
|
|
375
|
+
removeNotificationListener();
|
|
376
|
+
eventQueue.close();
|
|
377
|
+
}
|
|
378
|
+
// 终态 chunk 之后调用方不会再拉动本迭代器,turnId 必须在产出 finish
|
|
379
|
+
// 前复位,否则下一轮 steer/interrupt 会指向已经结束的 turn。
|
|
380
|
+
session.turnId = null;
|
|
381
|
+
const danglingCompaction = closeDanglingAutoCompaction(session);
|
|
382
|
+
if (danglingCompaction !== undefined)
|
|
383
|
+
yield stabilizeCodexEvent(session, danglingCompaction);
|
|
384
|
+
if (!input.signal?.aborted && terminalReason !== 'cancel' && !sawMeaningfulEvent) {
|
|
385
|
+
yield { type: 'text-delta', text: 'AGENT_DOOR_PROVIDER_EMPTY_RESPONSE: Codex Provider 未返回任何有效事件。' };
|
|
386
|
+
yield { type: 'finish', reason: 'error', ...(failure === undefined ? {} : { failure }) };
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
const reason = input.signal?.aborted ? 'cancel' : terminalReason ?? 'stop';
|
|
390
|
+
yield { type: 'finish', reason };
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
finally {
|
|
394
|
+
// app-server 在会话结束前保持连接;但回合中止时仍挂起的问题/审批必须
|
|
395
|
+
// 结算,否则 Codex 认为该 turn 还在等待输入,后续回合会卡住。
|
|
396
|
+
if (input.signal?.aborted)
|
|
397
|
+
this.releasePendingRequests(session);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* 将一个 Codex turn 按 assistant item 切成多个 DSH step。
|
|
402
|
+
*
|
|
403
|
+
* DSH 的 step 边界只能由 Agent Loop 提交;这里仅提前结束本次 llm/stream,
|
|
404
|
+
* 保留同一个 Codex turn 的通知队列,下一次 llm/stream 再继续消费它。
|
|
405
|
+
*/
|
|
406
|
+
async *executeSegmentedTurn(input, command) {
|
|
407
|
+
const session = await this.getSession(input, command);
|
|
408
|
+
prepareCodexSession(session, input);
|
|
409
|
+
const rpc = session.rpc;
|
|
410
|
+
let active;
|
|
411
|
+
try {
|
|
412
|
+
if (session.threadId === '') {
|
|
413
|
+
const threadParams = codexThreadParams(input);
|
|
414
|
+
const resumeThreadId = input.providerSessionId ?? session.resumeThreadId;
|
|
415
|
+
const thread = resumeThreadId
|
|
416
|
+
? await rpc.request('thread/resume', { threadId: resumeThreadId, ...threadParams }, { signal: input.signal, killOnAbort: false })
|
|
417
|
+
: await rpc.request('thread/start', threadParams, { signal: input.signal, killOnAbort: false });
|
|
418
|
+
session.threadId = readId(thread) ?? input.providerSessionId ?? input.sessionId;
|
|
419
|
+
session.providerSessionId = session.threadId;
|
|
420
|
+
session.threadModelId = readThreadModel(thread);
|
|
421
|
+
session.threadServiceTierId = readThreadServiceTier(thread);
|
|
422
|
+
}
|
|
423
|
+
// 只有 Host 显式声明续段时才复用挂起的 Provider 运行。新用户回合、注入
|
|
424
|
+
// 失败或取消后的下一次执行必须丢弃旧段:旧段要么已经跑完,要么其队列
|
|
425
|
+
// 已关闭,复用只会立刻产出 stop,把新消息变成空回合。
|
|
426
|
+
const suspended = input.resumeSegmentedTurn === true
|
|
427
|
+
&& session.segmentedTurn !== undefined
|
|
428
|
+
&& !session.segmentedTurn.done
|
|
429
|
+
? session.segmentedTurn
|
|
430
|
+
: undefined;
|
|
431
|
+
if (suspended === undefined && session.segmentedTurn !== undefined) {
|
|
432
|
+
this.closeSegmentedTurn(session, session.segmentedTurn);
|
|
433
|
+
}
|
|
434
|
+
// 分段 step 仍属于同一个 Provider turn;恢复它时不能插入 compact turn,
|
|
435
|
+
// 也不能改写线程模型或服务档位(同一个 Provider turn 中途换档会被 Codex 拒绝)。
|
|
436
|
+
const hasSuspendedTurn = suspended !== undefined;
|
|
437
|
+
if (!hasSuspendedTurn)
|
|
438
|
+
await this.alignThreadModel(session, input);
|
|
439
|
+
if (!hasSuspendedTurn)
|
|
440
|
+
await this.alignThreadServiceTier(session, input);
|
|
441
|
+
if (!hasSuspendedTurn)
|
|
442
|
+
await this.ensureContextCapacity(session, input);
|
|
443
|
+
if (!hasSuspendedTurn)
|
|
444
|
+
yield* drainCompactionEvents(session);
|
|
445
|
+
active = suspended ?? await this.startSegmentedTurn(session, input);
|
|
446
|
+
yield* drainCompactionEvents(session);
|
|
447
|
+
const isNew = suspended === undefined;
|
|
448
|
+
if (isNew)
|
|
449
|
+
session.segmentedTurn = active;
|
|
450
|
+
if (isNew)
|
|
451
|
+
yield { type: 'session-binding', providerSessionId: session.providerSessionId };
|
|
452
|
+
// DSH 原生 steer 会把消息放进下一个 step。Codex 分段流仍复用同一个
|
|
453
|
+
// Provider turn,单纯续读旧队列会让这条消息只在 DSH 临时快照里出现,
|
|
454
|
+
// 随即被消费掉;只有把真实用户输入转成 `turn/steer`,Codex 才会继续
|
|
455
|
+
// 生成新方向的正文。内部 step 提示和问题回答不属于用户插话,不能重复注入。
|
|
456
|
+
if (!isNew && isCodexSteeringInput(input)) {
|
|
457
|
+
const delivered = yield* this.deliverSegmentedSteer(session, active, input, command);
|
|
458
|
+
if (delivered)
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
for await (const chunk of this.consumeSegment(session, active, input))
|
|
462
|
+
yield chunk;
|
|
463
|
+
if (active.done && session.segmentedTurn === active)
|
|
464
|
+
session.segmentedTurn = undefined;
|
|
465
|
+
}
|
|
466
|
+
catch (error) {
|
|
467
|
+
if (active !== undefined && !active.done)
|
|
468
|
+
this.closeSegmentedTurn(session, active);
|
|
469
|
+
if (!input.signal?.aborted)
|
|
470
|
+
throw error;
|
|
471
|
+
await this.interrupt(input.sessionId);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* 把续段中的真实用户插话交给 Codex;返回 true 表示本次 llm/stream 已经处理完毕。
|
|
476
|
+
*
|
|
477
|
+
* DSH 翻译插话期间,挂起的 Provider turn 可能已经结束。此时 `turn/steer` 无处投递,
|
|
478
|
+
* 只能先产出旧回合的剩余输出,再用新 turn 执行插话。只有 Codex 明确回复“无活动
|
|
479
|
+
* 回合”才允许重新提交;超时或其他协议错误可能已被接收,重发会让同一输入执行两次。
|
|
480
|
+
*/
|
|
481
|
+
async *deliverSegmentedSteer(session, active, input, command) {
|
|
482
|
+
let terminalFallback;
|
|
483
|
+
if (active.terminalReason === null) {
|
|
484
|
+
try {
|
|
485
|
+
await this.steer(input.sessionId, input.prompt);
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
catch (error) {
|
|
489
|
+
if (!isCodexNoActiveTurnError(error))
|
|
490
|
+
throw error;
|
|
491
|
+
// 拒绝响应可能先于终态通知到达。立即关闭队列会丢弃随后到达的 interrupted
|
|
492
|
+
// 或 failed,把被中断的回合误判为正常结束并重新执行插话;因此先等待真实终态。
|
|
493
|
+
if (active.terminalReason === null) {
|
|
494
|
+
terminalFallback = setTimeout(() => {
|
|
495
|
+
active.terminalReason ??= 'stop';
|
|
496
|
+
active.queue.close();
|
|
497
|
+
}, this.steerTerminalGraceMs);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
try {
|
|
502
|
+
// 旧回合的剩余输出与新回合正文同属插话后的这一步。中途的 step 边界和 stop
|
|
503
|
+
// 不能交给 DSH,否则 DSH 会结算这一步并再次消费同一条插话。
|
|
504
|
+
while (!active.done) {
|
|
505
|
+
for await (const chunk of this.consumeSegment(session, active, input)) {
|
|
506
|
+
if (chunk.type === 'step-boundary')
|
|
507
|
+
continue;
|
|
508
|
+
if (chunk.type === 'finish' && chunk.reason === 'stop')
|
|
509
|
+
continue;
|
|
510
|
+
// 旧回合已经结束,它遗留的问题或审批无法再影响结果;直接回绝,
|
|
511
|
+
// 不能让 DSH 等待用户回答一个已失效的请求而阻塞插话。
|
|
512
|
+
if (chunk.type === 'question-request') {
|
|
513
|
+
this.releaseStaleRequest(() => this.respondQuestion(input.sessionId, { requestId: chunk.requestId, answers: [] }));
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
if (chunk.type === 'permission-request') {
|
|
517
|
+
this.releaseStaleRequest(() => this.respondPermission(input.sessionId, { requestId: chunk.requestId, approved: false }));
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
yield chunk;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
finally {
|
|
525
|
+
clearTimeout(terminalFallback);
|
|
526
|
+
}
|
|
527
|
+
// 中断或失败的回合已由上面的 finish 报告终态,不能再自动执行插话。
|
|
528
|
+
if (active.terminalReason !== 'stop' || input.signal?.aborted)
|
|
529
|
+
return true;
|
|
530
|
+
yield* this.executeSegmentedTurn({ ...input, resumeSegmentedTurn: false }, command);
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
/** 回绝已结束回合遗留的反向请求;请求已被其他路径清理时忽略。 */
|
|
534
|
+
releaseStaleRequest(release) {
|
|
535
|
+
try {
|
|
536
|
+
release();
|
|
537
|
+
}
|
|
538
|
+
catch { /* 请求已不存在 */ }
|
|
539
|
+
}
|
|
540
|
+
async startSegmentedTurn(session, input) {
|
|
541
|
+
const eventQueue = createCodexTurnEventQueue();
|
|
542
|
+
let turnStartResolved = false;
|
|
543
|
+
const notificationsBeforeTurnStart = [];
|
|
544
|
+
const active = {
|
|
545
|
+
queue: eventQueue,
|
|
546
|
+
removeNotificationListener: () => undefined,
|
|
547
|
+
terminalReason: null,
|
|
548
|
+
failure: undefined,
|
|
549
|
+
done: false,
|
|
550
|
+
pendingChunk: undefined,
|
|
551
|
+
currentAssistantMessageId: undefined,
|
|
552
|
+
sawCompletedTool: false,
|
|
553
|
+
removeAbortListener: () => undefined,
|
|
554
|
+
};
|
|
555
|
+
const acceptNotification = (message, allowUnidentifiedTool) => {
|
|
556
|
+
if (isCodexCompactionNotification(message, session.threadId)) {
|
|
557
|
+
const notificationTurnId = readTurnId(message);
|
|
558
|
+
// 显式 thread/compact/start 由 waitForCompaction 独占消费通知并生成
|
|
559
|
+
// start/summary/end,当前分段 turn 不能再次投影同一组事件。
|
|
560
|
+
if (!session.suppressCompactionNotifications
|
|
561
|
+
&& (notificationTurnId === null || !session.suppressedCompactionTurnIds.has(notificationTurnId)))
|
|
562
|
+
eventQueue.push(message);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
// 分段流与普通流一样,插话后必须跟随会话当前 turnId,不能继续使用
|
|
566
|
+
// startTurn 时捕获的旧值,否则新回合的通知会全部被丢弃。
|
|
567
|
+
if (!isCodexNotificationForTurn(message, session.threadId, session.turnId, allowUnidentifiedTool))
|
|
568
|
+
return;
|
|
569
|
+
const turnId = readTurnId(message);
|
|
570
|
+
if (turnId !== null) {
|
|
571
|
+
session.turnId = turnId;
|
|
572
|
+
}
|
|
573
|
+
eventQueue.push(withCodexPerformance(session, message));
|
|
574
|
+
const reason = readCodexTerminalReason(message);
|
|
575
|
+
if (reason !== null) {
|
|
576
|
+
active.terminalReason = reason;
|
|
577
|
+
if (reason === 'error')
|
|
578
|
+
active.failure = codexFailure(message);
|
|
579
|
+
eventQueue.close();
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
const onNotification = (message) => {
|
|
583
|
+
if (!turnStartResolved) {
|
|
584
|
+
notificationsBeforeTurnStart.push(message);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
acceptNotification(message, true);
|
|
588
|
+
};
|
|
589
|
+
active.removeNotificationListener = session.rpc.addNotificationListener(onNotification);
|
|
590
|
+
const onAbort = () => {
|
|
591
|
+
active.terminalReason = 'cancel';
|
|
592
|
+
eventQueue.close();
|
|
593
|
+
};
|
|
594
|
+
active.removeAbortListener = () => input.signal?.removeEventListener('abort', onAbort);
|
|
595
|
+
if (input.signal?.aborted)
|
|
596
|
+
onAbort();
|
|
597
|
+
else
|
|
598
|
+
input.signal?.addEventListener('abort', onAbort, { once: true });
|
|
599
|
+
try {
|
|
600
|
+
const response = await this.startTurn(session, input);
|
|
601
|
+
const responseTurnId = readTurnId(response);
|
|
602
|
+
if (responseTurnId !== null) {
|
|
603
|
+
session.turnId = responseTurnId;
|
|
604
|
+
}
|
|
605
|
+
turnStartResolved = true;
|
|
606
|
+
for (const message of notificationsBeforeTurnStart.splice(0))
|
|
607
|
+
acceptNotification(message, false);
|
|
608
|
+
const responseTerminal = buildCodexCompletionNotification(response, session.threadId);
|
|
609
|
+
if (responseTerminal !== null)
|
|
610
|
+
onNotification(responseTerminal);
|
|
611
|
+
return active;
|
|
612
|
+
}
|
|
613
|
+
catch (error) {
|
|
614
|
+
this.closeSegmentedTurn(session, active);
|
|
615
|
+
throw error;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
async *consumeSegment(session, active, input) {
|
|
619
|
+
let hasAssistantContent = false;
|
|
620
|
+
while (true) {
|
|
621
|
+
let chunk;
|
|
622
|
+
if (active.pendingChunk !== undefined) {
|
|
623
|
+
chunk = active.pendingChunk;
|
|
624
|
+
active.pendingChunk = undefined;
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
const next = await active.queue.next();
|
|
628
|
+
if (next.done) {
|
|
629
|
+
if (input.signal?.aborted)
|
|
630
|
+
throw new Error('请求已取消');
|
|
631
|
+
active.done = true;
|
|
632
|
+
session.turnId = null;
|
|
633
|
+
// finish 是调用方看到的最后一个 chunk,之后不会再拉动本迭代器。
|
|
634
|
+
// 悬挂段必须在产出终态前解除,否则它会被当成下一轮的可续段复用。
|
|
635
|
+
if (session.segmentedTurn === active)
|
|
636
|
+
session.segmentedTurn = undefined;
|
|
637
|
+
active.removeAbortListener();
|
|
638
|
+
active.removeNotificationListener();
|
|
639
|
+
const danglingCompaction = closeDanglingAutoCompaction(session);
|
|
640
|
+
if (danglingCompaction !== undefined)
|
|
641
|
+
yield stabilizeCodexEvent(session, danglingCompaction);
|
|
642
|
+
const reason = active.terminalReason ?? 'stop';
|
|
643
|
+
yield { type: 'finish', reason, ...(reason === 'error' && active.failure !== undefined ? { failure: active.failure } : {}) };
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (input.signal?.aborted)
|
|
647
|
+
throw new Error('请求已取消');
|
|
648
|
+
chunk = codexMessageToChunk(next.value, input.cwd);
|
|
649
|
+
}
|
|
650
|
+
if (chunk === null)
|
|
651
|
+
continue;
|
|
652
|
+
for (const part of expandCodexCompactionChunk(session, chunk)) {
|
|
653
|
+
// DSH 按 step 结算一条正文消息,工具历史却在提问时立即写入。
|
|
654
|
+
// 先结算已经输出的前文,再把尚未回答的问题交给下一段,保证历史顺序。
|
|
655
|
+
if (part.type === 'question-request' && hasAssistantContent) {
|
|
656
|
+
active.pendingChunk = part;
|
|
657
|
+
yield { type: 'step-boundary' };
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
// 一个 assistant item 可能在多个工具调用之间切换。把新 item 的首个
|
|
661
|
+
// 正文留给下一次 llm/stream,当前流只返回边界,确保 DSH 先创建新 step。
|
|
662
|
+
if ((part.type === 'text-delta' || part.type === 'reasoning-delta')
|
|
663
|
+
&& part.messageId !== undefined) {
|
|
664
|
+
const previousMessageId = active.currentAssistantMessageId;
|
|
665
|
+
if (previousMessageId !== undefined
|
|
666
|
+
&& previousMessageId !== part.messageId
|
|
667
|
+
&& active.sawCompletedTool) {
|
|
668
|
+
active.pendingChunk = part;
|
|
669
|
+
active.currentAssistantMessageId = part.messageId;
|
|
670
|
+
active.sawCompletedTool = false;
|
|
671
|
+
yield { type: 'step-boundary' };
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
active.currentAssistantMessageId = part.messageId;
|
|
675
|
+
}
|
|
676
|
+
const stabilizedChunk = stabilizeCodexEvent(session, part);
|
|
677
|
+
if (stabilizedChunk.type === 'tool-event' && (stabilizedChunk.status === 'completed' || stabilizedChunk.status === 'failed')) {
|
|
678
|
+
active.sawCompletedTool = true;
|
|
679
|
+
}
|
|
680
|
+
if ((stabilizedChunk.type === 'text-delta' || stabilizedChunk.type === 'reasoning-delta') && stabilizedChunk.text !== '') {
|
|
681
|
+
hasAssistantContent = true;
|
|
682
|
+
}
|
|
683
|
+
yield stabilizedChunk;
|
|
684
|
+
// 提问没有普通工具的 completed 通知。调用方已等待原生问题组件并回传
|
|
685
|
+
// 答案后才会继续读取,因此从这里恢复时可沿用工具完成后的消息分段规则。
|
|
686
|
+
if (stabilizedChunk.type === 'question-request')
|
|
687
|
+
active.sawCompletedTool = true;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
closeSegmentedTurn(session, active) {
|
|
692
|
+
active.done = true;
|
|
693
|
+
active.removeAbortListener();
|
|
694
|
+
active.removeNotificationListener();
|
|
695
|
+
active.queue.close();
|
|
696
|
+
if (session.segmentedTurn === active)
|
|
697
|
+
session.segmentedTurn = undefined;
|
|
698
|
+
this.releasePendingRequests(session);
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* 释放仍挂起的反向请求。
|
|
702
|
+
*
|
|
703
|
+
* Codex app-server 把 `requestUserInput` 和各类审批作为 server request 发给
|
|
704
|
+
* 客户端,驱动只有拿到回包才会让对应 turn 继续。回合被中止、分段被丢弃或
|
|
705
|
+
* 会话被替换时,如果这些 Promise 永远不 resolve,app-server 侧就会认为
|
|
706
|
+
* 该 turn 仍在等待输入;后续同一个 thread 上的新回合会表现成“发消息没有
|
|
707
|
+
* 反应”或直接卡住。这里统一按“取消/拒绝”结算,属于协议层的收尾。
|
|
708
|
+
*/
|
|
709
|
+
releasePendingRequests(session) {
|
|
710
|
+
for (const resolve of session.pendingQuestions.values()) {
|
|
711
|
+
try {
|
|
712
|
+
resolve({ answers: {} });
|
|
713
|
+
}
|
|
714
|
+
catch { /* 请求可能已被其他路径清理 */ }
|
|
715
|
+
}
|
|
716
|
+
session.pendingQuestions.clear();
|
|
717
|
+
for (const pending of session.pendingPermissions.values()) {
|
|
718
|
+
try {
|
|
719
|
+
pending.resolve({ approved: false });
|
|
720
|
+
}
|
|
721
|
+
catch { /* 请求可能已被其他路径清理 */ }
|
|
722
|
+
}
|
|
723
|
+
session.pendingPermissions.clear();
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* 让线程真正生效的模型与 DSH 当前选择的模型保持一致。
|
|
727
|
+
*
|
|
728
|
+
* Codex 只在 `thread/start` 时决定线程模型,同一 app-server 进程内再次
|
|
729
|
+
* `thread/resume` 不会改写已持久化的模型。用户在 DSH 里切换模型后,如果不
|
|
730
|
+
* 显式纠正,后续 turn 仍会沿用旧模型;而线程一旦被写入错误模型(例如历史
|
|
731
|
+
* 路由把 DSH 主模型泄漏给 Codex),会话就会持续以 404 失败且无法自愈。
|
|
732
|
+
* 这里只在两者确实不同时下发一次纠正,避免每个 step 都产生额外 RPC。
|
|
733
|
+
*/
|
|
734
|
+
async alignThreadModel(session, input) {
|
|
735
|
+
if (session.threadId === '' || session.threadSettingsUpdateUnsupported)
|
|
736
|
+
return;
|
|
737
|
+
const desired = isProviderDefaultModel(input.modelId) ? undefined : input.modelId?.trim();
|
|
738
|
+
if (desired === undefined || desired === '')
|
|
739
|
+
return;
|
|
740
|
+
if (session.threadModelId === desired)
|
|
741
|
+
return;
|
|
742
|
+
try {
|
|
743
|
+
const response = await session.rpc.request('thread/settings/update', { threadId: session.threadId, model: desired }, { signal: input.signal, killOnAbort: false });
|
|
744
|
+
session.threadModelId = readThreadModel(response) ?? desired;
|
|
745
|
+
}
|
|
746
|
+
catch (error) {
|
|
747
|
+
// 旧版 Codex 可能没有该方法;纠正失败不能阻断本轮,模型仍由 turn 自身决定。
|
|
748
|
+
// 只有“方法不存在”才永久关闭纠正,避免网络类瞬时失败让会话再也无法换模型。
|
|
749
|
+
if (isMethodNotFound(error))
|
|
750
|
+
session.threadSettingsUpdateUnsupported = true;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* 让线程真正生效的服务档位与 DSH 当前选择保持一致。
|
|
755
|
+
*
|
|
756
|
+
* 服务档位(Codex 官方订阅的 Fast)与模型一样是线程级设置:`thread/start` 与
|
|
757
|
+
* `thread/resume` 之后,线程会保留已持久化的档位。用户在 DSH 里关掉 Fast 时,
|
|
758
|
+
* 如果不显式下发 `default`,后续回合仍会以加速档运行并持续消耗更多额度。
|
|
759
|
+
*
|
|
760
|
+
* `thread/settings/update` 的响应不回显档位,因此这里按“已下发值”记账。只在
|
|
761
|
+
* 期望值与记账值确实不同时下发,避免每个 step 都产生额外 RPC。旧版 Codex 没有
|
|
762
|
+
* 该方法时永久关闭纠正,模型侧能力不受影响。
|
|
763
|
+
*/
|
|
764
|
+
async alignThreadServiceTier(session, input) {
|
|
765
|
+
if (session.threadId === '' || session.threadSettingsUpdateUnsupported)
|
|
766
|
+
return;
|
|
767
|
+
const desired = codexServiceTier(input.serviceTierId);
|
|
768
|
+
// 未声明档位表示 Host 没有该选择(非 Codex 会话或旧版调用方),不能擅自改写线程档位。
|
|
769
|
+
if (desired === undefined)
|
|
770
|
+
return;
|
|
771
|
+
if (session.threadServiceTierId === desired)
|
|
772
|
+
return;
|
|
773
|
+
try {
|
|
774
|
+
await session.rpc.request('thread/settings/update', { threadId: session.threadId, serviceTier: desired }, { signal: input.signal, killOnAbort: false });
|
|
775
|
+
session.threadServiceTierId = desired;
|
|
776
|
+
}
|
|
777
|
+
catch (error) {
|
|
778
|
+
// 与模型纠正共用同一个能力开关:方法不存在说明这是旧版 Codex,
|
|
779
|
+
// 瞬时失败则保留重试机会,否则一次抖动会让会话再也无法切换档位。
|
|
780
|
+
if (isMethodNotFound(error))
|
|
781
|
+
session.threadSettingsUpdateUnsupported = true;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
/** 在下一轮开始前主动压缩,避免把已满的线程直接交给 turn/start。 */
|
|
785
|
+
async ensureContextCapacity(session, input) {
|
|
786
|
+
if (session.contextWindow === undefined || session.contextTokens === undefined)
|
|
787
|
+
return;
|
|
788
|
+
// 达到窗口上限时下一轮还会追加用户输入,必须在 turn/start 前压缩;
|
|
789
|
+
// 只用严格大于会把恰好满窗的会话直接送进超限错误路径。
|
|
790
|
+
if (session.contextTokens < session.contextWindow * CODEX_COMPACTION_THRESHOLD)
|
|
791
|
+
return;
|
|
792
|
+
await this.compactThread(session, input);
|
|
793
|
+
}
|
|
794
|
+
/** turn/start 遇到上下文超限时压缩一次并重试,兼容关闭自动压缩的 Codex 配置。 */
|
|
795
|
+
async startTurn(session, input) {
|
|
796
|
+
await this.prepareSkillInputs(session, input);
|
|
797
|
+
session.performance.beginTurn();
|
|
798
|
+
try {
|
|
799
|
+
return await session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId, session.skills), { signal: input.signal, killOnAbort: false });
|
|
800
|
+
}
|
|
801
|
+
catch (error) {
|
|
802
|
+
if (!isContextWindowError(error))
|
|
803
|
+
throw error;
|
|
804
|
+
await this.compactThread(session, input);
|
|
805
|
+
session.performance.beginTurn();
|
|
806
|
+
return session.rpc.request('turn/start', codexTurnStartParams(input, session.threadId, session.skills), { signal: input.signal, killOnAbort: false });
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/** 只为显式 `/skill-name` 或 `$skill-name` 预取目录;没有显式调用时保留 Codex 自己的隐式匹配。 */
|
|
810
|
+
async prepareSkillInputs(session, input) {
|
|
811
|
+
const names = codexSkillNames(input.prompt);
|
|
812
|
+
if (names.length === 0)
|
|
813
|
+
return;
|
|
814
|
+
const cwd = input.cwd ?? process.cwd();
|
|
815
|
+
if (session.skillsCwd !== cwd)
|
|
816
|
+
session.skills.clear();
|
|
817
|
+
if (session.skillsCwd !== cwd || session.skills.size === 0) {
|
|
818
|
+
try {
|
|
819
|
+
await this.refreshSkillCatalog(session, cwd, false, input.signal);
|
|
820
|
+
}
|
|
821
|
+
catch (error) {
|
|
822
|
+
// 旧版 app-server 可能还没有 skills/list;保留原始 Skill 文本,让 Codex
|
|
823
|
+
// 继续走它自己的解析路径,而不是把一次能力探测失败变成整轮失败。
|
|
824
|
+
if (!isMethodNotFound(error))
|
|
825
|
+
throw error;
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
async refreshSkillCatalog(session, cwd, forceReload, signal) {
|
|
831
|
+
const resolvedCwd = cwd ?? process.cwd();
|
|
832
|
+
const response = await session.rpc.request('skills/list', {
|
|
833
|
+
cwds: [resolvedCwd],
|
|
834
|
+
...(forceReload ? { forceReload: true } : {}),
|
|
835
|
+
}, { signal, killOnAbort: false });
|
|
836
|
+
const entries = parseCodexSkills(response, resolvedCwd);
|
|
837
|
+
session.skills.clear();
|
|
838
|
+
for (const entry of entries)
|
|
839
|
+
session.skills.set(entry.name, entry);
|
|
840
|
+
session.skillsCwd = resolvedCwd;
|
|
841
|
+
}
|
|
842
|
+
/** thread/compact/start 立即返回,真正完成由 contextCompaction turn 的终态通知表示。 */
|
|
843
|
+
async compactThread(session, input) {
|
|
844
|
+
if (session.compacting !== undefined)
|
|
845
|
+
return session.compacting;
|
|
846
|
+
// 在创建异步等待器前同步设置,避免多个 RPC 监听器交错处理同一批通知时
|
|
847
|
+
// 另一个监听器重复投影显式压缩事件。
|
|
848
|
+
session.suppressCompactionNotifications = true;
|
|
849
|
+
const compacting = this.waitForCompaction(session, input);
|
|
850
|
+
session.compacting = compacting;
|
|
851
|
+
try {
|
|
852
|
+
await compacting;
|
|
853
|
+
session.contextTokens = 0;
|
|
854
|
+
}
|
|
855
|
+
finally {
|
|
856
|
+
if (session.compacting === compacting)
|
|
857
|
+
session.compacting = undefined;
|
|
858
|
+
session.suppressCompactionNotifications = false;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
async waitForCompaction(session, input) {
|
|
862
|
+
const compactionId = `codex-compaction-${randomUUID()}`;
|
|
863
|
+
session.pendingCompactionEvents.push({ type: 'context-compaction', phase: 'start', compactionId });
|
|
864
|
+
let compactTurnId = null;
|
|
865
|
+
let sawCompaction = false;
|
|
866
|
+
let summary;
|
|
867
|
+
let shadowedTokenCount;
|
|
868
|
+
let shadowedItemCount;
|
|
869
|
+
let resolveDone;
|
|
870
|
+
let rejectDone;
|
|
871
|
+
const done = new Promise((resolve, reject) => { resolveDone = resolve; rejectDone = reject; });
|
|
872
|
+
// The RPC acknowledges starting compaction before it finishes. Keep cancellation
|
|
873
|
+
// live while awaiting its terminal notification, too.
|
|
874
|
+
const onAbort = () => {
|
|
875
|
+
rejectDone?.(input.signal?.reason instanceof Error ? input.signal.reason : new Error('CODEX_COMPACTION_CANCELLED'));
|
|
876
|
+
session.rpc.dispose();
|
|
877
|
+
};
|
|
878
|
+
input.signal?.addEventListener('abort', onAbort, { once: true });
|
|
879
|
+
// Both an immediate abort and a failed start can reject before we await done.
|
|
880
|
+
void done.catch(() => undefined);
|
|
881
|
+
if (input.signal?.aborted)
|
|
882
|
+
onAbort();
|
|
883
|
+
const onNotification = (message) => {
|
|
884
|
+
const params = isRecord(message.params) ? message.params : null;
|
|
885
|
+
if (readScopedId(params, ['threadId', 'thread_id'], 'thread') !== session.threadId)
|
|
886
|
+
return;
|
|
887
|
+
if (message.method === 'thread/compacted') {
|
|
888
|
+
const details = compactionDetails(params);
|
|
889
|
+
summary = details.summary ?? summary;
|
|
890
|
+
shadowedTokenCount = details.shadowedTokenCount ?? shadowedTokenCount;
|
|
891
|
+
shadowedItemCount = details.shadowedItemCount ?? shadowedItemCount;
|
|
892
|
+
resolveDone?.();
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
if (message.method === 'item/started') {
|
|
896
|
+
const item = isRecord(params?.item) ? params.item : null;
|
|
897
|
+
if (isCodexCompactionItemType(item?.type)) {
|
|
898
|
+
sawCompaction = true;
|
|
899
|
+
compactTurnId = readTurnId(message);
|
|
900
|
+
if (compactTurnId !== null)
|
|
901
|
+
session.suppressedCompactionTurnIds.add(compactTurnId);
|
|
902
|
+
}
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (message.method === 'item/completed') {
|
|
906
|
+
const item = isRecord(params?.item) ? params.item : null;
|
|
907
|
+
if (isCodexCompactionItemType(item?.type)) {
|
|
908
|
+
const itemTurnId = readTurnId(message);
|
|
909
|
+
if (itemTurnId !== null)
|
|
910
|
+
session.suppressedCompactionTurnIds.add(itemTurnId);
|
|
911
|
+
const details = compactionDetails(item);
|
|
912
|
+
summary = details.summary ?? summary;
|
|
913
|
+
shadowedTokenCount = details.shadowedTokenCount ?? shadowedTokenCount;
|
|
914
|
+
shadowedItemCount = details.shadowedItemCount ?? shadowedItemCount;
|
|
915
|
+
}
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
if (message.method !== 'turn/completed')
|
|
919
|
+
return;
|
|
920
|
+
const turnId = readTurnId(message);
|
|
921
|
+
if (sawCompaction && compactTurnId !== null && turnId !== compactTurnId)
|
|
922
|
+
return;
|
|
923
|
+
if (!sawCompaction && compactTurnId === null)
|
|
924
|
+
return;
|
|
925
|
+
const turn = isRecord(params?.turn) ? params.turn : null;
|
|
926
|
+
if (turn?.status === 'failed' || turn?.status === 'interrupted' || turn?.status === 'cancelled') {
|
|
927
|
+
rejectDone?.(new Error('Codex 上下文压缩失败'));
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
resolveDone?.();
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
const removeListener = session.rpc.addNotificationListener(onNotification);
|
|
934
|
+
const removeExitListener = session.rpc.addExitListener(error => rejectDone?.(error));
|
|
935
|
+
const timer = setTimeout(() => {
|
|
936
|
+
rejectDone?.(new Error('Codex 上下文压缩超时'));
|
|
937
|
+
session.rpc.dispose();
|
|
938
|
+
}, CODEX_COMPACTION_TIMEOUT_MS);
|
|
939
|
+
timer.unref?.();
|
|
940
|
+
try {
|
|
941
|
+
await session.rpc.request('thread/compact/start', { threadId: session.threadId }, { signal: input.signal, killOnAbort: false });
|
|
942
|
+
await done;
|
|
943
|
+
if (summary !== undefined || shadowedTokenCount !== undefined || shadowedItemCount !== undefined) {
|
|
944
|
+
// Codex 的 app-server 通知通常不携带被压缩 token 数。DSH 的
|
|
945
|
+
// contextPressure 必须用该数扣除已被替换的 surface;这里使用压缩前
|
|
946
|
+
// 最后一次 Provider prompt 规模作为保守锚点,不能把缺失值写成 0。
|
|
947
|
+
const resolvedShadowedTokenCount = shadowedTokenCount ?? session.contextTokens;
|
|
948
|
+
session.pendingCompactionEvents.push({
|
|
949
|
+
type: 'context-compaction',
|
|
950
|
+
phase: 'summary',
|
|
951
|
+
compactionId,
|
|
952
|
+
...(summary === undefined ? {} : { summary }),
|
|
953
|
+
...(resolvedShadowedTokenCount === undefined ? {} : { shadowedTokenCount: resolvedShadowedTokenCount }),
|
|
954
|
+
...(shadowedItemCount === undefined ? {} : { shadowedItemCount }),
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
session.pendingCompactionEvents.push({ type: 'context-compaction', phase: 'end', compactionId });
|
|
958
|
+
}
|
|
959
|
+
catch (error) {
|
|
960
|
+
session.pendingCompactionEvents.push({
|
|
961
|
+
type: 'context-compaction',
|
|
962
|
+
phase: 'end',
|
|
963
|
+
compactionId,
|
|
964
|
+
error: error instanceof Error ? error.message : String(error),
|
|
965
|
+
});
|
|
966
|
+
throw error;
|
|
967
|
+
}
|
|
968
|
+
finally {
|
|
969
|
+
clearTimeout(timer);
|
|
970
|
+
removeListener();
|
|
971
|
+
removeExitListener();
|
|
972
|
+
input.signal?.removeEventListener('abort', onAbort);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
/** 将新输入 steer 到当前 Codex turn。 */
|
|
976
|
+
async steer(sessionId, prompt) {
|
|
977
|
+
const session = this.sessions.get(sessionId);
|
|
978
|
+
if (session === undefined || session.threadId === '' || session.turnId === null)
|
|
979
|
+
throw new Error('Codex 会话未运行');
|
|
980
|
+
// 插话协议用 expectedTurnId 校验目标回合;turnId 仅用于 turn/interrupt。
|
|
981
|
+
const expectedTurnId = session.turnId;
|
|
982
|
+
const result = await session.rpc.request('turn/steer', {
|
|
983
|
+
threadId: session.threadId,
|
|
984
|
+
expectedTurnId,
|
|
985
|
+
input: [{ type: 'text', text: prompt }],
|
|
986
|
+
}, { killOnAbort: false });
|
|
987
|
+
const turnId = readTurnId(result);
|
|
988
|
+
// 等待响应期间回合可能已经结束或切换,迟到的响应不能恢复旧回合。
|
|
989
|
+
if (turnId && session.turnId === expectedTurnId)
|
|
990
|
+
session.turnId = turnId;
|
|
991
|
+
}
|
|
992
|
+
/** 中断当前 Codex turn,但保留 app-server 线程。 */
|
|
993
|
+
async interrupt(sessionId) {
|
|
994
|
+
const session = this.sessions.get(sessionId);
|
|
995
|
+
if (session === undefined || session.threadId === '' || session.turnId === null)
|
|
996
|
+
return;
|
|
997
|
+
try {
|
|
998
|
+
await session.rpc.request('turn/interrupt', { threadId: session.threadId, turnId: session.turnId }, { killOnAbort: false });
|
|
999
|
+
}
|
|
1000
|
+
catch { /* app-server 可能已经发出 turn/completed */ }
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* 丢弃等待下一个 DSH step 的分段运行(取消、注入失败或切换适配器时)。
|
|
1004
|
+
* 队列关闭后旧回合的通知不会再被投影进下一轮,续段标记同时解除。
|
|
1005
|
+
*/
|
|
1006
|
+
discardSegmentedTurn(sessionId) {
|
|
1007
|
+
const session = this.sessions.get(sessionId);
|
|
1008
|
+
if (session?.segmentedTurn === undefined)
|
|
1009
|
+
return;
|
|
1010
|
+
this.closeSegmentedTurn(session, session.segmentedTurn);
|
|
1011
|
+
}
|
|
1012
|
+
/** 回传原生权限请求;审批值只在 Host 进程中流转。 */
|
|
1013
|
+
respondPermission(sessionId, response) {
|
|
1014
|
+
const session = this.sessions.get(sessionId);
|
|
1015
|
+
const pending = session?.pendingPermissions.get(response.requestId);
|
|
1016
|
+
if (pending === undefined || session === undefined)
|
|
1017
|
+
throw new Error('Codex 权限请求不存在');
|
|
1018
|
+
session.pendingPermissions.delete(response.requestId);
|
|
1019
|
+
if (pending.response === 'file-change') {
|
|
1020
|
+
pending.resolve({ decision: response.approved ? 'accept' : 'decline' });
|
|
1021
|
+
}
|
|
1022
|
+
else if (pending.response === 'command') {
|
|
1023
|
+
pending.resolve({ decision: response.approved ? 'accept' : 'decline' });
|
|
1024
|
+
}
|
|
1025
|
+
else if (pending.response === 'permissions') {
|
|
1026
|
+
// `item/permissions/requestApproval` 的应答形状是 {permissions, scope},
|
|
1027
|
+
// 不是 {approved}。批准回显请求画像;拒绝给空画像,语义等价于“不授予额外权限”。
|
|
1028
|
+
pending.resolve(response.approved
|
|
1029
|
+
? { permissions: grantedPermissionProfile(pending.requested), scope: 'turn' }
|
|
1030
|
+
: { permissions: {}, scope: 'turn' });
|
|
1031
|
+
}
|
|
1032
|
+
else {
|
|
1033
|
+
pending.resolve({
|
|
1034
|
+
approved: response.approved,
|
|
1035
|
+
...(response.reason?.trim() ? { reason: response.reason.trim().slice(0, 512) } : {}),
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
/** 回传 requestUserInput 的结构化回答。 */
|
|
1040
|
+
respondQuestion(sessionId, response) {
|
|
1041
|
+
const session = this.sessions.get(sessionId);
|
|
1042
|
+
const resolve = session?.pendingQuestions.get(response.requestId);
|
|
1043
|
+
if (resolve === undefined || session === undefined)
|
|
1044
|
+
throw new Error('Codex 问题请求不存在');
|
|
1045
|
+
session.pendingQuestions.delete(response.requestId);
|
|
1046
|
+
resolve({ answers: questionAnswersRecord(response) });
|
|
1047
|
+
}
|
|
1048
|
+
dispose() {
|
|
1049
|
+
for (const session of this.sessions.values()) {
|
|
1050
|
+
if (session.segmentedTurn !== undefined)
|
|
1051
|
+
this.closeSegmentedTurn(session, session.segmentedTurn);
|
|
1052
|
+
for (const pending of session.pendingPermissions.values())
|
|
1053
|
+
pending.resolve({ approved: false });
|
|
1054
|
+
session.pendingPermissions.clear();
|
|
1055
|
+
for (const resolve of session.pendingQuestions.values())
|
|
1056
|
+
resolve({ answers: {} });
|
|
1057
|
+
session.pendingQuestions.clear();
|
|
1058
|
+
session.rpc.dispose();
|
|
1059
|
+
}
|
|
1060
|
+
this.sessions.clear();
|
|
1061
|
+
this.processes.clear();
|
|
1062
|
+
this.cachedBinary = null;
|
|
1063
|
+
}
|
|
1064
|
+
appServerArgs(includeComputerUse = true) {
|
|
1065
|
+
const computerUse = codexComputerUseLaunchSettings(includeComputerUse ? this.computerUseMode : 'disabled', includeComputerUse ? this.computerUseConfig : undefined, this.codexHome);
|
|
1066
|
+
return [
|
|
1067
|
+
...CODEX_APP_SERVER_BASE_ARGS.slice(0, 2),
|
|
1068
|
+
...computerUse.args,
|
|
1069
|
+
...CODEX_APP_SERVER_BASE_ARGS.slice(2, 3),
|
|
1070
|
+
...(computerUse.enabled ? ['--enable', 'computer_use'] : ['--disable', 'computer_use']),
|
|
1071
|
+
...CODEX_APP_SERVER_BASE_ARGS.slice(3),
|
|
1072
|
+
];
|
|
1073
|
+
}
|
|
1074
|
+
async getSession(input, command) {
|
|
1075
|
+
const previous = this.sessions.get(input.sessionId);
|
|
1076
|
+
const teamToken = teamBridgeToken(input.sessionId);
|
|
1077
|
+
const runtimeEnvFingerprint = fingerprintRuntimeEnvironment(input.runtimeEnv);
|
|
1078
|
+
if (previous !== undefined
|
|
1079
|
+
&& previous.cwd === input.cwd
|
|
1080
|
+
&& previous.teamToken === teamToken
|
|
1081
|
+
&& previous.runtimeEnvFingerprint === runtimeEnvFingerprint
|
|
1082
|
+
&& !previous.rpc.isClosed)
|
|
1083
|
+
return previous;
|
|
1084
|
+
if (previous?.segmentedTurn !== undefined)
|
|
1085
|
+
this.closeSegmentedTurn(previous, previous.segmentedTurn);
|
|
1086
|
+
previous?.rpc.dispose();
|
|
1087
|
+
// 子代理托管开启时用 `-c` 覆盖注入 MCP 替身工具;工具由桥接转投成 DSH 原生子会话。
|
|
1088
|
+
const bridgeArgs = codexBridgeArgs(input.sessionId, this.descriptor.id);
|
|
1089
|
+
// Codex 的 `-c` 覆盖项必须与 app-server 的其余启动参数放在同一侧;
|
|
1090
|
+
// 统一置于子命令前,避免不同版本对全局/子命令参数的解析差异。
|
|
1091
|
+
const rpc = new JsonRpcProcess({
|
|
1092
|
+
command,
|
|
1093
|
+
args: [...bridgeArgs, ...this.appServerArgs()],
|
|
1094
|
+
cwd: input.cwd,
|
|
1095
|
+
env: { ...(input.runtimeEnv ?? {}) },
|
|
1096
|
+
explicitWindowsShell: true,
|
|
1097
|
+
spawn: this.runSpawn,
|
|
1098
|
+
});
|
|
1099
|
+
const session = {
|
|
1100
|
+
teamToken,
|
|
1101
|
+
runtimeEnvFingerprint,
|
|
1102
|
+
resumeThreadId: input.providerSessionId ?? (previous?.cwd === input.cwd ? previous?.threadId || previous?.resumeThreadId : undefined),
|
|
1103
|
+
performance: new CodexPerformanceTracker(this.now),
|
|
1104
|
+
rpc,
|
|
1105
|
+
cwd: input.cwd,
|
|
1106
|
+
modelId: input.modelId,
|
|
1107
|
+
contextWindow: undefined,
|
|
1108
|
+
contextTokens: undefined,
|
|
1109
|
+
threadId: '',
|
|
1110
|
+
threadModelId: undefined,
|
|
1111
|
+
threadServiceTierId: undefined,
|
|
1112
|
+
threadSettingsUpdateUnsupported: false,
|
|
1113
|
+
turnId: null,
|
|
1114
|
+
providerSessionId: input.providerSessionId ?? input.sessionId,
|
|
1115
|
+
pendingPermissions: new Map(),
|
|
1116
|
+
pendingQuestions: new Map(),
|
|
1117
|
+
segmentedTurn: undefined,
|
|
1118
|
+
compacting: undefined,
|
|
1119
|
+
suppressCompactionNotifications: false,
|
|
1120
|
+
suppressedCompactionTurnIds: new Set(),
|
|
1121
|
+
pendingCompactionEvents: [],
|
|
1122
|
+
autoCompaction: undefined,
|
|
1123
|
+
skillsCwd: undefined,
|
|
1124
|
+
skills: new Map(),
|
|
1125
|
+
};
|
|
1126
|
+
this.processes.add(rpc);
|
|
1127
|
+
this.sessions.set(input.sessionId, session);
|
|
1128
|
+
// Codex 目录发生变化时丢弃 Host 侧路径缓存;下一次显式调用会重新读取目录。
|
|
1129
|
+
rpc.addNotificationListener((message) => {
|
|
1130
|
+
if (message.method !== 'skills/changed')
|
|
1131
|
+
return;
|
|
1132
|
+
session.skills.clear();
|
|
1133
|
+
session.skillsCwd = undefined;
|
|
1134
|
+
});
|
|
1135
|
+
await rpc.request('initialize', { clientInfo: { name: 'Codex', version: '0.1.1' }, capabilities: { experimentalApi: true } }, { signal: input.signal, killOnAbort: false });
|
|
1136
|
+
rpc.notify('initialized', {});
|
|
1137
|
+
rpc.setServerRequestHandler((request) => {
|
|
1138
|
+
const requestId = readRequestId(request);
|
|
1139
|
+
if (requestId === null)
|
|
1140
|
+
return { approved: false };
|
|
1141
|
+
const params = isRecord(request.params) ? request.params : request;
|
|
1142
|
+
const item = isRecord(params.item) ? params.item : params;
|
|
1143
|
+
const method = typeof request.method === 'string' ? request.method : '';
|
|
1144
|
+
const type = typeof item.type === 'string' ? item.type : '';
|
|
1145
|
+
// 动态工具服务端请求要求客户端执行任意工具。
|
|
1146
|
+
// DSH 适配器只负责观察 Codex 已执行的工具,不具备安全执行任意动态工具
|
|
1147
|
+
// 的能力;必须显式回绝请求,不能把它挂进权限等待表,否则 Provider 会永久等待。
|
|
1148
|
+
if (method === ['item', 'tool', 'call'].join('/')) {
|
|
1149
|
+
return {
|
|
1150
|
+
success: false,
|
|
1151
|
+
contentItems: [{ type: 'inputText', text: 'AgentDoor 不支持由 Codex 反向调用动态工具' }],
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
if (isQuestionEvent(`${method} ${type}`)) {
|
|
1155
|
+
return new Promise((resolve) => session.pendingQuestions.set(requestId, resolve));
|
|
1156
|
+
}
|
|
1157
|
+
const kind = permissionResponseKind(method, params);
|
|
1158
|
+
return new Promise((resolve) => session.pendingPermissions.set(requestId, {
|
|
1159
|
+
resolve,
|
|
1160
|
+
response: kind,
|
|
1161
|
+
...(kind === 'permissions' ? { requested: params.permissions } : {}),
|
|
1162
|
+
}));
|
|
1163
|
+
});
|
|
1164
|
+
return session;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
function stabilizeCodexUsage(session, event) {
|
|
1168
|
+
if (event.type !== 'usage')
|
|
1169
|
+
return event;
|
|
1170
|
+
if (event.contextTokens !== undefined)
|
|
1171
|
+
session.contextTokens = event.contextTokens;
|
|
1172
|
+
if (event.contextWindow === undefined)
|
|
1173
|
+
return event;
|
|
1174
|
+
if (session.contextWindow === undefined) {
|
|
1175
|
+
session.contextWindow = event.contextWindow;
|
|
1176
|
+
return event;
|
|
1177
|
+
}
|
|
1178
|
+
if (session.contextWindow === event.contextWindow)
|
|
1179
|
+
return event;
|
|
1180
|
+
// 同一 Codex thread/model 的 usage 通知可能带有全局默认窗口或迟到旧值。
|
|
1181
|
+
// 它不能覆盖首个已确认窗口,否则 DSH 会把 256K 错显示成 1M,并跳过压缩。
|
|
1182
|
+
const contextTokens = event.contextTokens ?? event.inputTokens;
|
|
1183
|
+
return {
|
|
1184
|
+
...event,
|
|
1185
|
+
contextWindow: session.contextWindow,
|
|
1186
|
+
contextTokens,
|
|
1187
|
+
contextUsageRatio: Number(Math.min(1, contextTokens / session.contextWindow).toFixed(6)),
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
function stabilizeCodexEvent(session, event) {
|
|
1191
|
+
if (event.type !== 'context-compaction')
|
|
1192
|
+
return stabilizeCodexUsage(session, event);
|
|
1193
|
+
// 自动压缩的 item 通知没有独立 usage。压缩结束后清零本地状态,避免下一轮
|
|
1194
|
+
// 把压缩前的旧 prompt 规模误认为当前上下文并再次发起压缩。
|
|
1195
|
+
if (event.phase === 'end') {
|
|
1196
|
+
session.contextTokens = 0;
|
|
1197
|
+
return event;
|
|
1198
|
+
}
|
|
1199
|
+
if (event.phase !== 'summary' || event.shadowedTokenCount !== undefined || session.contextTokens === undefined)
|
|
1200
|
+
return event;
|
|
1201
|
+
return { ...event, shadowedTokenCount: session.contextTokens };
|
|
1202
|
+
}
|
|
1203
|
+
function prepareCodexSession(session, input) {
|
|
1204
|
+
if (input.modelId !== undefined && session.modelId !== input.modelId) {
|
|
1205
|
+
// A model change may change context capacity, so discard the old anchor first.
|
|
1206
|
+
session.modelId = input.modelId;
|
|
1207
|
+
session.contextWindow = undefined;
|
|
1208
|
+
}
|
|
1209
|
+
// A Host-supplied context window is authoritative for this model and must be
|
|
1210
|
+
// applied before the first usage event can anchor a stale provider value.
|
|
1211
|
+
if (typeof input.modelContextWindow === 'number'
|
|
1212
|
+
&& Number.isSafeInteger(input.modelContextWindow)
|
|
1213
|
+
&& input.modelContextWindow > 0) {
|
|
1214
|
+
session.contextWindow = input.modelContextWindow;
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
function fingerprintRuntimeEnvironment(environment) {
|
|
1218
|
+
const entries = Object.entries(environment ?? {}).sort(([left], [right]) => left.localeCompare(right));
|
|
1219
|
+
return createHash('sha256').update(JSON.stringify(entries), 'utf8').digest('hex');
|
|
1220
|
+
}
|
|
1221
|
+
function parseCodexCatalog(value) {
|
|
1222
|
+
const root = isRecord(value) && isRecord(value.data) ? value.data : value;
|
|
1223
|
+
const models = Array.isArray(root)
|
|
1224
|
+
? root
|
|
1225
|
+
: isRecord(root) && Array.isArray(root.models) ? root.models
|
|
1226
|
+
: isRecord(root) && Array.isArray(root.data) ? root.data
|
|
1227
|
+
: [];
|
|
1228
|
+
const items = models.flatMap((entry) => {
|
|
1229
|
+
if (!isRecord(entry))
|
|
1230
|
+
return [];
|
|
1231
|
+
if (entry.hidden === true)
|
|
1232
|
+
return [];
|
|
1233
|
+
const id = typeof entry.model === 'string' ? entry.model.trim() : typeof entry.id === 'string' ? entry.id.trim() : '';
|
|
1234
|
+
if (!id)
|
|
1235
|
+
return [];
|
|
1236
|
+
const efforts = Array.isArray(entry.supportedReasoningEfforts)
|
|
1237
|
+
? [...new Set(entry.supportedReasoningEfforts.flatMap((item) => {
|
|
1238
|
+
const effort = typeof item === 'string'
|
|
1239
|
+
? item
|
|
1240
|
+
: isRecord(item) && typeof item.reasoningEffort === 'string'
|
|
1241
|
+
? item.reasoningEffort
|
|
1242
|
+
: null;
|
|
1243
|
+
return effort?.trim() ? [effort.trim()] : [];
|
|
1244
|
+
}))]
|
|
1245
|
+
: [];
|
|
1246
|
+
const serviceTiers = parseCodexServiceTiers(entry.serviceTiers);
|
|
1247
|
+
return [{
|
|
1248
|
+
id,
|
|
1249
|
+
name: typeof entry.displayName === 'string' && entry.displayName.trim() ? entry.displayName : id,
|
|
1250
|
+
efforts,
|
|
1251
|
+
...(serviceTiers.length === 0 ? {} : { serviceTiers }),
|
|
1252
|
+
}];
|
|
1253
|
+
});
|
|
1254
|
+
if (items.length === 0)
|
|
1255
|
+
return emptyCatalog();
|
|
1256
|
+
return {
|
|
1257
|
+
groups: [{ id: 'codex', name: 'Codex', models: [...new Map(items.map((item) => [item.id, item])).values()] }],
|
|
1258
|
+
currentModel: null,
|
|
1259
|
+
currentEffort: null,
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* 读取 `model/list` 的服务档位声明。
|
|
1264
|
+
*
|
|
1265
|
+
* 只接受带非空 id 的条目;`name` 缺失时回退成 id,避免界面出现空标签。
|
|
1266
|
+
* 已废弃的 `additionalSpeedTiers` 不参与解析:它给出的是 `fast` 这类别名,
|
|
1267
|
+
* 而线协议需要的是 `serviceTiers[].id`(`priority`),直接映射会下发无效取值。
|
|
1268
|
+
*/
|
|
1269
|
+
function parseCodexServiceTiers(value) {
|
|
1270
|
+
const entries = Array.isArray(value) ? value : [];
|
|
1271
|
+
const tiers = entries.flatMap((entry) => {
|
|
1272
|
+
if (typeof entry === 'string') {
|
|
1273
|
+
const id = entry.trim();
|
|
1274
|
+
return id === '' ? [] : [{ id, name: id }];
|
|
1275
|
+
}
|
|
1276
|
+
if (!isRecord(entry))
|
|
1277
|
+
return [];
|
|
1278
|
+
const id = typeof entry.id === 'string' ? entry.id.trim() : '';
|
|
1279
|
+
if (id === '')
|
|
1280
|
+
return [];
|
|
1281
|
+
const name = typeof entry.name === 'string' && entry.name.trim() ? entry.name.trim() : id;
|
|
1282
|
+
const description = typeof entry.description === 'string' && entry.description.trim() ? entry.description.trim() : undefined;
|
|
1283
|
+
return [{ id, name, ...(description === undefined ? {} : { description }) }];
|
|
1284
|
+
});
|
|
1285
|
+
return [...new Map(tiers.map((tier) => [tier.id, tier])).values()];
|
|
1286
|
+
}
|
|
1287
|
+
/** 目录里是否有任何模型声明了服务档位;没有时无需再查询账号类型。 */
|
|
1288
|
+
function catalogHasServiceTiers(catalog) {
|
|
1289
|
+
return catalog.groups.some((group) => group.models.some((model) => (model.serviceTiers?.length ?? 0) > 0));
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* 读取 Codex 配置里的 `service_tier`。
|
|
1293
|
+
*
|
|
1294
|
+
* 这是线程未显式选择时真正生效的档位:app-server 在 `thread/start` 时继承它。
|
|
1295
|
+
* `null` 表示配置未设置,此时线程以标准档运行;读不到字段时返回 undefined,
|
|
1296
|
+
* 让目录保持“未配置”而不是伪造一个档位。
|
|
1297
|
+
*/
|
|
1298
|
+
function readConfiguredServiceTier(config) {
|
|
1299
|
+
if (!isRecord(config))
|
|
1300
|
+
return undefined;
|
|
1301
|
+
const root = isRecord(config.config) ? config.config : config;
|
|
1302
|
+
if (!('service_tier' in root))
|
|
1303
|
+
return undefined;
|
|
1304
|
+
const value = root.service_tier;
|
|
1305
|
+
if (value === null || value === undefined)
|
|
1306
|
+
return null;
|
|
1307
|
+
return typeof value === 'string' && value.trim() !== '' ? value.trim() : null;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* 用 `account/read` 确认当前 Codex 是否登录了官方订阅账号。
|
|
1311
|
+
*
|
|
1312
|
+
* `account.type === 'chatgpt'` is authoritative when present. Some compatible gateways
|
|
1313
|
+
* omit the account even when the local Codex profile uses ChatGPT OAuth, so account:null
|
|
1314
|
+
* may fall back to the local auth mode unless an alternate model provider is configured.
|
|
1315
|
+
* API-key accounts remain unavailable; an unsupported account/read method stays unknown.
|
|
1316
|
+
*/
|
|
1317
|
+
async function readCodexOfficialSubscription(rpc, signal, config, codexHome) {
|
|
1318
|
+
try {
|
|
1319
|
+
const response = await rpc.request('account/read', {}, { signal });
|
|
1320
|
+
if (!isRecord(response))
|
|
1321
|
+
return false;
|
|
1322
|
+
const account = isRecord(response.account) ? response.account : null;
|
|
1323
|
+
if (account !== null)
|
|
1324
|
+
return account.type === 'chatgpt';
|
|
1325
|
+
// Some compatible gateways return account:null even when Codex itself is signed in via
|
|
1326
|
+
// ChatGPT OAuth. Trust the local auth mode only when no alternate model provider is active.
|
|
1327
|
+
return !hasAlternateCodexProvider(config) && hasCodexChatGptAuth(codexHome);
|
|
1328
|
+
}
|
|
1329
|
+
catch {
|
|
1330
|
+
return undefined;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
function hasAlternateCodexProvider(config) {
|
|
1334
|
+
if (!isRecord(config))
|
|
1335
|
+
return false;
|
|
1336
|
+
const root = isRecord(config.config) ? config.config : config;
|
|
1337
|
+
const provider = root.model_provider;
|
|
1338
|
+
return typeof provider === 'string' && provider.trim() !== '' && provider.trim() !== 'openai';
|
|
1339
|
+
}
|
|
1340
|
+
function hasCodexChatGptAuth(codexHome) {
|
|
1341
|
+
const auth = readTextFile(join(codexHome, 'auth.json'));
|
|
1342
|
+
if (auth === undefined)
|
|
1343
|
+
return false;
|
|
1344
|
+
try {
|
|
1345
|
+
const parsed = JSON.parse(auth);
|
|
1346
|
+
if (!isRecord(parsed) || parsed.auth_mode !== 'chatgpt' || parsed.OPENAI_API_KEY)
|
|
1347
|
+
return false;
|
|
1348
|
+
return isRecord(parsed.tokens)
|
|
1349
|
+
&& typeof parsed.tokens.refresh_token === 'string'
|
|
1350
|
+
&& parsed.tokens.refresh_token.trim() !== '';
|
|
1351
|
+
}
|
|
1352
|
+
catch {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
/** 同步读取文本文件;不存在或不可读时返回 undefined,调用方按“无法判断”处理。 */
|
|
1357
|
+
function readTextFile(path) {
|
|
1358
|
+
try {
|
|
1359
|
+
return readFileSync(path, 'utf8');
|
|
1360
|
+
}
|
|
1361
|
+
catch {
|
|
1362
|
+
return undefined;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* 从 `config.toml` 摘出影响目录语义的字段。
|
|
1367
|
+
*
|
|
1368
|
+
* 这里刻意不做完整 TOML 解析:只需覆盖两种常见写法——顶层 `key = "value"`,
|
|
1369
|
+
* 以及 `[model_providers.xxx]` 段内的 `base_url`。手写正则比引入解析依赖更稳,
|
|
1370
|
+
* 也不会因为 Codex 新增字段而改变指纹。凭据不在 config.toml 中,无需脱敏。
|
|
1371
|
+
*/
|
|
1372
|
+
function summarizeCodexConfig(config) {
|
|
1373
|
+
const fields = [];
|
|
1374
|
+
let section = '';
|
|
1375
|
+
for (const rawLine of config.split(/\r?\n/u)) {
|
|
1376
|
+
const line = rawLine.trim();
|
|
1377
|
+
if (line === '' || line.startsWith('#'))
|
|
1378
|
+
continue;
|
|
1379
|
+
const sectionMatch = line.match(/^\[(?<name>[^\]]+)\]$/u);
|
|
1380
|
+
if (sectionMatch !== null) {
|
|
1381
|
+
section = sectionMatch.groups?.name?.trim() ?? '';
|
|
1382
|
+
continue;
|
|
1383
|
+
}
|
|
1384
|
+
const assignment = line.match(/^(?<key>[A-Za-z0-9_.-]+)\s*=\s*(?<value>.*)$/u);
|
|
1385
|
+
if (assignment === null)
|
|
1386
|
+
continue;
|
|
1387
|
+
const key = assignment.groups?.key ?? '';
|
|
1388
|
+
const value = (assignment.groups?.value ?? '').trim();
|
|
1389
|
+
// 顶层:决定 Provider 与档位;Provider 段内:只有 base_url 影响上游身份。
|
|
1390
|
+
const topLevelKeys = ['model_provider', 'model', 'service_tier', 'openai_base_url', 'profile'];
|
|
1391
|
+
const isTopLevel = section === '' && topLevelKeys.includes(key);
|
|
1392
|
+
const isProviderBaseUrl = section.startsWith('model_providers.') && key === 'base_url';
|
|
1393
|
+
if (!isTopLevel && !isProviderBaseUrl)
|
|
1394
|
+
continue;
|
|
1395
|
+
fields.push(`${section}.${key}=${value}`);
|
|
1396
|
+
}
|
|
1397
|
+
return fields.join('\n');
|
|
1398
|
+
}
|
|
1399
|
+
/**
|
|
1400
|
+
* 从 `auth.json` 摘出登录模式,**不读取任何凭据**。
|
|
1401
|
+
*
|
|
1402
|
+
* 官方订阅与 API key 两种登录方式的 `auth_mode` 不同;`OPENAI_API_KEY` 只取
|
|
1403
|
+
* 「有没有设置」这一位布尔信息,token 与 key 原文永远不进入指纹。
|
|
1404
|
+
*/
|
|
1405
|
+
function summarizeCodexAuth(auth) {
|
|
1406
|
+
let parsed;
|
|
1407
|
+
try {
|
|
1408
|
+
parsed = JSON.parse(auth);
|
|
1409
|
+
}
|
|
1410
|
+
catch {
|
|
1411
|
+
// auth.json 不是合法 JSON(例如切换过程中被截断):用长度当指纹,
|
|
1412
|
+
// 下一次读取到完整文件时指纹自然变化并触发失效。
|
|
1413
|
+
return `invalid:${auth.length}`;
|
|
1414
|
+
}
|
|
1415
|
+
if (!isRecord(parsed))
|
|
1416
|
+
return 'invalid:not-object';
|
|
1417
|
+
const mode = typeof parsed.auth_mode === 'string' ? parsed.auth_mode : 'unknown';
|
|
1418
|
+
const hasApiKey = typeof parsed.OPENAI_API_KEY === 'string' && parsed.OPENAI_API_KEY.trim() !== '';
|
|
1419
|
+
// 只比较 token 的“有无”与 account_id 是否变化,不比较 token 内容:
|
|
1420
|
+
// 官方订阅每次刷新都会轮换 access_token,把 token 纳入指纹会让目录每次刷新都失效。
|
|
1421
|
+
const tokens = isRecord(parsed.tokens) ? parsed.tokens : undefined;
|
|
1422
|
+
const hasTokens = tokens !== undefined && typeof tokens.refresh_token === 'string';
|
|
1423
|
+
const accountId = tokens !== undefined && typeof tokens.account_id === 'string' ? tokens.account_id : '';
|
|
1424
|
+
return `${mode}|apiKey=${hasApiKey}|tokens=${hasTokens}|account=${accountId}`;
|
|
1425
|
+
}
|
|
1426
|
+
function codexMessageToChunk(message, cwd) {
|
|
1427
|
+
const params = isRecord(message.params) ? message.params : message;
|
|
1428
|
+
const item = isRecord(params.item) ? params.item : params;
|
|
1429
|
+
const method = typeof message.method === 'string' ? message.method : '';
|
|
1430
|
+
const type = typeof item.type === 'string' ? item.type : '';
|
|
1431
|
+
const text = textValue(params.delta ?? params.text ?? params.content ?? params.message);
|
|
1432
|
+
if (isCodexCompactionItemType(type)) {
|
|
1433
|
+
const details = compactionDetails(item);
|
|
1434
|
+
const compactionId = firstToolText(item.id, params.itemId);
|
|
1435
|
+
const phase = method === 'thread/compacted'
|
|
1436
|
+
? 'end'
|
|
1437
|
+
: method.includes('started') || method.includes('start')
|
|
1438
|
+
? 'start'
|
|
1439
|
+
: method.includes('completed') || method.includes('compacted') || method.includes('summary')
|
|
1440
|
+
? 'summary'
|
|
1441
|
+
: 'end';
|
|
1442
|
+
return {
|
|
1443
|
+
type: 'context-compaction',
|
|
1444
|
+
phase,
|
|
1445
|
+
...(compactionId === undefined ? {} : { compactionId }),
|
|
1446
|
+
...(details.summary === undefined ? {} : { summary: details.summary }),
|
|
1447
|
+
...(details.shadowedTokenCount === undefined ? {} : { shadowedTokenCount: details.shadowedTokenCount }),
|
|
1448
|
+
...(details.shadowedItemCount === undefined ? {} : { shadowedItemCount: details.shadowedItemCount }),
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
if (method === 'thread/compacted') {
|
|
1452
|
+
const details = compactionDetails(params);
|
|
1453
|
+
return {
|
|
1454
|
+
type: 'context-compaction',
|
|
1455
|
+
phase: 'end',
|
|
1456
|
+
...(details.summary === undefined ? {} : { summary: details.summary }),
|
|
1457
|
+
...(details.shadowedTokenCount === undefined ? {} : { shadowedTokenCount: details.shadowedTokenCount }),
|
|
1458
|
+
...(details.shadowedItemCount === undefined ? {} : { shadowedItemCount: details.shadowedItemCount }),
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1461
|
+
if (method === 'turn/completed' && isContextCompactionTurn(params.turn)) {
|
|
1462
|
+
const compactionId = readTurnId(message);
|
|
1463
|
+
return { type: 'context-compaction', phase: 'end', ...(compactionId === null ? {} : { compactionId }) };
|
|
1464
|
+
}
|
|
1465
|
+
const imageArtifact = codexImageArtifact(method, type, params, item, cwd);
|
|
1466
|
+
if (imageArtifact !== null)
|
|
1467
|
+
return imageArtifact;
|
|
1468
|
+
if (isQuestionEvent(`${method} ${type}`)) {
|
|
1469
|
+
const requestId = readRequestId(message) ?? readRequestId(params);
|
|
1470
|
+
const questions = readAgentQuestions(params.questions ?? item.questions ?? params);
|
|
1471
|
+
// JSON-RPC id 用于回复请求,官方 itemId 才是模型的工具调用 ID,供原生历史关联问题和答案。
|
|
1472
|
+
const callId = firstToolText(params.itemId);
|
|
1473
|
+
if (requestId !== null && questions.length > 0)
|
|
1474
|
+
return {
|
|
1475
|
+
type: 'question-request',
|
|
1476
|
+
requestId,
|
|
1477
|
+
questions,
|
|
1478
|
+
...(callId === undefined ? {} : { callId }),
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
if (method.includes('permission') || method.includes('Approval') || type.includes('permission') || type.includes('approval')) {
|
|
1482
|
+
const requestId = readRequestId(message) ?? readRequestId(params);
|
|
1483
|
+
const permission = codexPermissionDetails(method, params, item);
|
|
1484
|
+
const detail = permission.detail ?? text ?? undefined;
|
|
1485
|
+
if (requestId !== null)
|
|
1486
|
+
return {
|
|
1487
|
+
type: 'permission-request',
|
|
1488
|
+
requestId,
|
|
1489
|
+
kind: permission.kind,
|
|
1490
|
+
...(permission.toolName === undefined ? {} : { toolName: permission.toolName }),
|
|
1491
|
+
...(permission.callId === undefined ? {} : { callId: permission.callId }),
|
|
1492
|
+
...(detail === undefined ? {} : { detail }),
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
const messageId = firstToolText(params.itemId, item.id);
|
|
1496
|
+
if (method.includes('agentMessage') || method.includes('message') && (type.includes('text') || type === '')) {
|
|
1497
|
+
return text ? { type: 'text-delta', text, ...(messageId === undefined ? {} : { messageId }) } : null;
|
|
1498
|
+
}
|
|
1499
|
+
if (method.includes('reason') || type.includes('reason')) {
|
|
1500
|
+
return text ? { type: 'reasoning-delta', text, ...(messageId === undefined ? {} : { messageId }) } : null;
|
|
1501
|
+
}
|
|
1502
|
+
if (isCodexToolEvent(method, type)) {
|
|
1503
|
+
const mcpToolName = type.replace(/[_-]/gu, '').toLowerCase() === 'mcptoolcall'
|
|
1504
|
+
? firstToolText(item.server, item.tool) === undefined
|
|
1505
|
+
? undefined
|
|
1506
|
+
: `${firstToolText(item.server) ?? 'mcp'}.${firstToolText(item.tool) ?? 'tool'}`
|
|
1507
|
+
: undefined;
|
|
1508
|
+
const name = firstToolText(isFileChangeType(type) ? 'edit_file' : undefined, mcpToolName, item.name, item.toolName, item.tool, item.command !== undefined ? 'command_execution' : undefined, type);
|
|
1509
|
+
const callId = firstToolText(item.callId, item.call_id, item.toolCallId, item.id, params.itemId);
|
|
1510
|
+
const agentId = firstToolText(item.agentId, item.agent_id, type.includes('agent') || type.includes('collab') ? item.id : undefined);
|
|
1511
|
+
const input = serializeToolValue(isFileChangeType(type) ? fileChangeToolInput(item) : item.arguments ?? item.input ?? item.command);
|
|
1512
|
+
// app-server v2 的 commandExecution 使用 camelCase aggregatedOutput;snake_case 保留给旧协议。
|
|
1513
|
+
const rawOutput = item.result ?? item.output ?? item.aggregatedOutput ?? item.aggregated_output;
|
|
1514
|
+
const explicitError = serializeToolValue(item.error);
|
|
1515
|
+
const output = serializeToolValue(rawOutput);
|
|
1516
|
+
const exitCodeFailed = typeof item.exitCode === 'number' && item.exitCode !== 0 || typeof item.exit_code === 'number' && item.exit_code !== 0;
|
|
1517
|
+
const failed = explicitError !== undefined || exitCodeFailed || method.includes('failed') || normalizeToolStatus(item.status ?? item.state, 'running') === 'failed';
|
|
1518
|
+
const fallback = failed ? 'failed' : method.includes('completed') || output !== undefined ? 'completed' : 'running';
|
|
1519
|
+
const detail = serializeToolValue(item.detail ?? item.description);
|
|
1520
|
+
return {
|
|
1521
|
+
type: 'tool-event',
|
|
1522
|
+
toolName: name ?? (agentId ? 'subagent' : 'tool'),
|
|
1523
|
+
status: normalizeToolStatus(item.status ?? item.state, fallback),
|
|
1524
|
+
...(callId ? { callId } : {}),
|
|
1525
|
+
...(input !== undefined ? { input } : {}),
|
|
1526
|
+
...(failed
|
|
1527
|
+
? { error: explicitError ?? output ?? '工具执行失败' }
|
|
1528
|
+
: output === undefined ? {} : { output }),
|
|
1529
|
+
...(!failed && output !== undefined ? { outputMode: 'snapshot' } : {}),
|
|
1530
|
+
...(agentId ? { agentId } : {}),
|
|
1531
|
+
...(detail !== undefined ? { detail } : {}),
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
return codexUsageChunk(params);
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Codex image_gen 在不同版本有两种结果:旧版提供 saved_path,新版扩展可能只
|
|
1538
|
+
* 提供 image_generation_end.result 的 base64 PNG。两者都在 Host 内转成附件,不能
|
|
1539
|
+
* 把 result 放进普通工具文本,也不能让 Client 读取 Provider 的原始路径。
|
|
1540
|
+
*/
|
|
1541
|
+
function codexImageArtifact(method, type, params, item, cwd) {
|
|
1542
|
+
const marker = `${method} ${type} ${firstToolText(item.name, item.toolName, item.tool) ?? ''}`.toLowerCase();
|
|
1543
|
+
if (!/(?:image[_/-]?generation|image[_/-]?gen|imagegeneration)/u.test(marker))
|
|
1544
|
+
return null;
|
|
1545
|
+
const rawPath = firstToolText(item.saved_path, item.savedPath, item.output_path, item.outputPath, item.image_path, item.imagePath, params.saved_path, params.savedPath);
|
|
1546
|
+
const path = rawPath === undefined ? undefined : resolve(cwd ?? process.cwd(), rawPath);
|
|
1547
|
+
const data = codexImageData(item.result ?? params.result ?? item.image ?? params.image);
|
|
1548
|
+
if (path === undefined && data === undefined)
|
|
1549
|
+
return null;
|
|
1550
|
+
return {
|
|
1551
|
+
type: 'image-artifact',
|
|
1552
|
+
...(path === undefined ? {} : { path }),
|
|
1553
|
+
...(data === undefined ? {} : { data }),
|
|
1554
|
+
...(data === undefined ? {} : { mediaType: 'image/png' }),
|
|
1555
|
+
...(path === undefined ? {} : { name: basename(path) }),
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
function codexImageData(value) {
|
|
1559
|
+
if (typeof value === 'string') {
|
|
1560
|
+
const candidate = value.trim();
|
|
1561
|
+
if (/^data:image\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=]+$/u.test(candidate))
|
|
1562
|
+
return candidate;
|
|
1563
|
+
if (candidate.length >= 128 && candidate.length % 4 === 0 && /^[A-Za-z0-9+/]*={0,2}$/u.test(candidate))
|
|
1564
|
+
return candidate;
|
|
1565
|
+
return undefined;
|
|
1566
|
+
}
|
|
1567
|
+
if (!isRecord(value))
|
|
1568
|
+
return undefined;
|
|
1569
|
+
return codexImageData(value.b64_json ?? value.base64 ?? value.data ?? value.image_url ?? value.url);
|
|
1570
|
+
}
|
|
1571
|
+
/** Codex 明确拒绝插话且未接收输入时才返回 true;其他错误都可能已被接收。 */
|
|
1572
|
+
function isCodexNoActiveTurnError(error) {
|
|
1573
|
+
return error instanceof JsonRpcRequestError && error.message === CODEX_NO_ACTIVE_TURN_TO_STEER;
|
|
1574
|
+
}
|
|
1575
|
+
/** 判断分段续流是否带来了新的真实用户插话。 */
|
|
1576
|
+
function isCodexSteeringInput(input) {
|
|
1577
|
+
if (input.resumeSegmentedTurn !== true || input.prompt.trim() === '')
|
|
1578
|
+
return false;
|
|
1579
|
+
if (input.peerInput)
|
|
1580
|
+
return true;
|
|
1581
|
+
for (let index = input.messages.length - 1; index >= 0; index -= 1) {
|
|
1582
|
+
const message = input.messages[index];
|
|
1583
|
+
if (message?.role !== 'user')
|
|
1584
|
+
continue;
|
|
1585
|
+
const source = isRecord(message.source) ? message.source : null;
|
|
1586
|
+
// 旧版调用方没有 source 时按真实用户输入兼容;DSH 内部 notice、问题回答
|
|
1587
|
+
// 等带 source 的控制消息必须排除,避免把同一份上下文再次 steer 给 Codex。
|
|
1588
|
+
return source === null || source.kind === undefined || source.kind === 'user';
|
|
1589
|
+
}
|
|
1590
|
+
return false;
|
|
1591
|
+
}
|
|
1592
|
+
function* drainCompactionEvents(session) {
|
|
1593
|
+
while (session.pendingCompactionEvents.length > 0) {
|
|
1594
|
+
const event = session.pendingCompactionEvents.shift();
|
|
1595
|
+
if (event !== undefined)
|
|
1596
|
+
yield event;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* 把自动压缩的 item 生命周期展开成闭合的 start/summary/end 事务。
|
|
1601
|
+
*
|
|
1602
|
+
* Codex 0.158 起,压缩只通过 contextCompaction item 的 started/completed 通知
|
|
1603
|
+
* 发布,`thread/compacted`(ContextCompactedNotification)已废弃且不再发送。
|
|
1604
|
+
* 而 DSH 会话格式要求每个 compaction/start 必须由 compaction/end 闭合,否则
|
|
1605
|
+
* 历史加载会以 "turn/end crosses an open compaction" 失败。这里在 item/completed
|
|
1606
|
+
* 之后合成 end,同时兼容旧版 Codex 仍会发送的 thread/compacted 完成信号。
|
|
1607
|
+
*/
|
|
1608
|
+
function* expandCodexCompactionChunk(session, chunk) {
|
|
1609
|
+
if (chunk.type !== 'context-compaction') {
|
|
1610
|
+
yield chunk;
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
if (chunk.phase === 'start') {
|
|
1614
|
+
if (session.autoCompaction?.open === true && session.autoCompaction.compactionId === chunk.compactionId) {
|
|
1615
|
+
yield chunk;
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
session.autoCompaction = { compactionId: chunk.compactionId, open: true };
|
|
1619
|
+
yield chunk;
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
if (chunk.phase === 'summary') {
|
|
1623
|
+
yield chunk;
|
|
1624
|
+
const pending = session.autoCompaction;
|
|
1625
|
+
if (pending !== undefined && pending.open) {
|
|
1626
|
+
pending.open = false;
|
|
1627
|
+
yield {
|
|
1628
|
+
type: 'context-compaction',
|
|
1629
|
+
phase: 'end',
|
|
1630
|
+
...(chunk.compactionId === undefined ? {} : { compactionId: chunk.compactionId }),
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
const pending = session.autoCompaction;
|
|
1636
|
+
if (pending !== undefined) {
|
|
1637
|
+
if (pending.open) {
|
|
1638
|
+
// item/started 之后直接收到完成信号(旧版 Codex 的 thread/compacted):
|
|
1639
|
+
// 由该信号闭合事务。
|
|
1640
|
+
pending.open = false;
|
|
1641
|
+
yield chunk;
|
|
1642
|
+
}
|
|
1643
|
+
// 已经由 item/completed 合成过 end 的重复完成信号不再下发;桥接层虽然
|
|
1644
|
+
// 对重复 end 幂等,但重复通知没有新的语义。
|
|
1645
|
+
return;
|
|
1646
|
+
}
|
|
1647
|
+
yield chunk;
|
|
1648
|
+
}
|
|
1649
|
+
/** 流终结时为未收到完成通知的自动压缩补一个 end,避免会话日志残留未闭合事务。 */
|
|
1650
|
+
function closeDanglingAutoCompaction(session) {
|
|
1651
|
+
const pending = session.autoCompaction;
|
|
1652
|
+
if (pending === undefined || !pending.open)
|
|
1653
|
+
return undefined;
|
|
1654
|
+
session.autoCompaction = undefined;
|
|
1655
|
+
return {
|
|
1656
|
+
type: 'context-compaction',
|
|
1657
|
+
phase: 'end',
|
|
1658
|
+
...(pending.compactionId === undefined ? {} : { compactionId: pending.compactionId }),
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
function compactionDetails(value) {
|
|
1662
|
+
if (!isRecord(value))
|
|
1663
|
+
return {};
|
|
1664
|
+
const nested = isRecord(value.compaction) ? value.compaction : isRecord(value.item) ? value.item : value;
|
|
1665
|
+
const summary = textValue(nested.summary ?? nested.summaryText ?? nested.compactionSummary);
|
|
1666
|
+
const shadowedTokenCount = optionalToken(nested.shadowedTokenCount ?? nested.shadowed_tokens ?? nested.compactedTokens);
|
|
1667
|
+
const shadowedItemCount = optionalToken(nested.shadowedItemCount ?? nested.shadowed_items ?? nested.compactedItems);
|
|
1668
|
+
return {
|
|
1669
|
+
...(summary === null || summary.trim() === '' ? {} : { summary: summary.trim() }),
|
|
1670
|
+
...(shadowedTokenCount === undefined ? {} : { shadowedTokenCount }),
|
|
1671
|
+
...(shadowedItemCount === undefined ? {} : { shadowedItemCount }),
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
function isContextCompactionTurn(value) {
|
|
1675
|
+
if (!isRecord(value))
|
|
1676
|
+
return false;
|
|
1677
|
+
const kind = String(value.type ?? value.kind ?? value.name ?? '').toLowerCase();
|
|
1678
|
+
return kind.includes('contextcompaction') || kind.includes('compaction');
|
|
1679
|
+
}
|
|
1680
|
+
function codexPermissionDetails(method, params, item) {
|
|
1681
|
+
const fileChange = method.includes('fileChange') || method.includes('file_change') || String(item.type ?? '').toLowerCase() === 'filechange';
|
|
1682
|
+
// 沙箱提权请求没有 command/grantRoot,只有一个待授予的权限画像;
|
|
1683
|
+
// 必须把画像摘要带进 detail,否则审批弹窗只会显示一个空理由。
|
|
1684
|
+
const permissions = method.includes('permissions') && method.includes('Approval') ? params.permissions : undefined;
|
|
1685
|
+
const command = typeof params.command === 'string' ? params.command : typeof item.command === 'string' ? item.command : undefined;
|
|
1686
|
+
const reason = typeof params.reason === 'string' ? params.reason : typeof params.description === 'string' ? params.description : undefined;
|
|
1687
|
+
const grantRoot = typeof params.grantRoot === 'string' ? params.grantRoot : undefined;
|
|
1688
|
+
const paths = permissionPaths(params.fileChanges ?? params.file_changes ?? item.changes);
|
|
1689
|
+
const callId = firstToolText(params.callId, params.call_id, params.itemId, item.id);
|
|
1690
|
+
const detail = [reason, command, paths.length > 0 ? `文件: ${paths.join(', ')}` : undefined, grantRoot ? `允许写入: ${grantRoot}` : undefined, permissionProfileSummary(permissions)]
|
|
1691
|
+
.filter((value) => value !== undefined && value.trim() !== '')
|
|
1692
|
+
.join(';');
|
|
1693
|
+
return {
|
|
1694
|
+
kind: permissions !== undefined ? 'permissions' : typeof params.kind === 'string' ? params.kind : fileChange ? 'file_change' : 'command',
|
|
1695
|
+
...(fileChange ? { toolName: 'edit' } : {}),
|
|
1696
|
+
...(callId === undefined ? {} : { callId }),
|
|
1697
|
+
...(detail === '' ? {} : { detail }),
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
/** 把权限画像压成一句可读摘要;未知形状返回 undefined,不猜测语义。 */
|
|
1701
|
+
function permissionProfileSummary(value) {
|
|
1702
|
+
const profile = isRecord(value) ? value : null;
|
|
1703
|
+
if (profile === null)
|
|
1704
|
+
return undefined;
|
|
1705
|
+
const fileSystem = isRecord(profile.fileSystem) ? profile.fileSystem : null;
|
|
1706
|
+
const network = isRecord(profile.network) ? profile.network : null;
|
|
1707
|
+
const parts = [];
|
|
1708
|
+
const write = stringList(fileSystem?.write);
|
|
1709
|
+
const read = stringList(fileSystem?.read);
|
|
1710
|
+
if (write.length > 0)
|
|
1711
|
+
parts.push(`请求写入: ${write.join(', ')}`);
|
|
1712
|
+
if (read.length > 0)
|
|
1713
|
+
parts.push(`请求读取: ${read.join(', ')}`);
|
|
1714
|
+
if (network?.enabled === true)
|
|
1715
|
+
parts.push('请求网络访问');
|
|
1716
|
+
return parts.length === 0 ? undefined : parts.join(';');
|
|
1717
|
+
}
|
|
1718
|
+
function stringList(value) {
|
|
1719
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === 'string' && entry.trim() !== '') : [];
|
|
1720
|
+
}
|
|
1721
|
+
function permissionPaths(value) {
|
|
1722
|
+
if (Array.isArray(value))
|
|
1723
|
+
return value.flatMap((entry) => permissionPaths(entry));
|
|
1724
|
+
if (!isRecord(value))
|
|
1725
|
+
return [];
|
|
1726
|
+
const path = firstToolText(value.path, value.filePath, value.file_path);
|
|
1727
|
+
return path === undefined ? [] : [path];
|
|
1728
|
+
}
|
|
1729
|
+
function isFileChangeType(type) {
|
|
1730
|
+
return type.replace(/[_-]/gu, '').toLowerCase() === 'filechange';
|
|
1731
|
+
}
|
|
1732
|
+
function fileChangeToolInput(item) {
|
|
1733
|
+
const changes = Array.isArray(item.changes) ? item.changes : [];
|
|
1734
|
+
return {
|
|
1735
|
+
changes: changes.map((change) => isRecord(change) ? {
|
|
1736
|
+
file_path: firstToolText(change.path, change.filePath, change.file_path) ?? '',
|
|
1737
|
+
...(typeof change.kind === 'string' ? { kind: change.kind } : {}),
|
|
1738
|
+
...(typeof change.diff === 'string' ? { diff: change.diff } : typeof change.patch === 'string' ? { diff: change.patch } : {}),
|
|
1739
|
+
} : change),
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
/** Codex app-server 的 inputTokens 是含缓存读取的完整输入,cachedInputTokens 是其中已命中的子集。 */
|
|
1743
|
+
function codexUsageChunk(params) {
|
|
1744
|
+
const tokenUsage = isRecord(params.tokenUsage) ? params.tokenUsage : isRecord(params.token_usage) ? params.token_usage : null;
|
|
1745
|
+
if (tokenUsage === null)
|
|
1746
|
+
return usageChunk(params);
|
|
1747
|
+
const latest = isRecord(tokenUsage.last)
|
|
1748
|
+
? tokenUsage.last
|
|
1749
|
+
: isRecord(tokenUsage.lastUsage)
|
|
1750
|
+
? tokenUsage.lastUsage
|
|
1751
|
+
: isRecord(tokenUsage.last_token_usage)
|
|
1752
|
+
? tokenUsage.last_token_usage
|
|
1753
|
+
: isRecord(tokenUsage.total)
|
|
1754
|
+
? tokenUsage.total
|
|
1755
|
+
: tokenUsage;
|
|
1756
|
+
const inputTokens = optionalToken(latest.inputTokens ?? latest.input_tokens);
|
|
1757
|
+
const cacheReadTokens = optionalToken(latest.cachedInputTokens ?? latest.cached_input_tokens);
|
|
1758
|
+
const usage = usageChunk({
|
|
1759
|
+
inputTokens: inputTokens ?? 0,
|
|
1760
|
+
...(latest.outputTokens === undefined && latest.output_tokens === undefined ? {} : { outputTokens: latest.outputTokens ?? latest.output_tokens }),
|
|
1761
|
+
...(cacheReadTokens === undefined ? {} : { cacheReadTokens }),
|
|
1762
|
+
...(latest.totalTokens === undefined && latest.total_tokens === undefined ? {} : { totalTokens: latest.totalTokens ?? latest.total_tokens }),
|
|
1763
|
+
});
|
|
1764
|
+
if (usage === null)
|
|
1765
|
+
return null;
|
|
1766
|
+
if (usage.type !== 'usage')
|
|
1767
|
+
return null;
|
|
1768
|
+
const contextWindowValue = optionalToken(tokenUsage.contextWindow
|
|
1769
|
+
?? tokenUsage.context_window
|
|
1770
|
+
?? tokenUsage.modelContextWindow
|
|
1771
|
+
?? tokenUsage.model_context_window
|
|
1772
|
+
?? latest.contextWindow
|
|
1773
|
+
?? latest.context_window
|
|
1774
|
+
?? latest.modelContextWindow
|
|
1775
|
+
?? latest.model_context_window
|
|
1776
|
+
?? params.contextWindow
|
|
1777
|
+
?? params.context_window);
|
|
1778
|
+
const contextWindow = contextWindowValue !== undefined && contextWindowValue > 0 ? contextWindowValue : undefined;
|
|
1779
|
+
const contextTokens = usage.inputTokens;
|
|
1780
|
+
return {
|
|
1781
|
+
...usage,
|
|
1782
|
+
...(params.agentdoorCodexPerformance === undefined ? {} : { codexPerformance: params.agentdoorCodexPerformance }),
|
|
1783
|
+
...(contextWindow === undefined ? {} : {
|
|
1784
|
+
contextWindow,
|
|
1785
|
+
contextTokens,
|
|
1786
|
+
contextUsageRatio: Number(Math.min(1, contextTokens / contextWindow).toFixed(6)),
|
|
1787
|
+
}),
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
function optionalToken(value) {
|
|
1791
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined;
|
|
1792
|
+
}
|
|
1793
|
+
function withCodexPerformance(session, message) {
|
|
1794
|
+
const performance = session.performance.observe(message);
|
|
1795
|
+
return performance === undefined ? message : {
|
|
1796
|
+
...message, params: { ...(isRecord(message.params) ? message.params : {}), agentdoorCodexPerformance: performance },
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
function readRequestId(value) {
|
|
1800
|
+
if (!isRecord(value))
|
|
1801
|
+
return null;
|
|
1802
|
+
for (const key of ['requestId', 'request_id', 'id'])
|
|
1803
|
+
if (typeof value[key] === 'string' || typeof value[key] === 'number')
|
|
1804
|
+
return String(value[key]);
|
|
1805
|
+
return null;
|
|
1806
|
+
}
|
|
1807
|
+
function readTurnId(message) {
|
|
1808
|
+
if (!isRecord(message))
|
|
1809
|
+
return null;
|
|
1810
|
+
const params = isRecord(message.params) ? message.params : message;
|
|
1811
|
+
for (const key of ['turnId', 'turn_id'])
|
|
1812
|
+
if (typeof params[key] === 'string')
|
|
1813
|
+
return params[key];
|
|
1814
|
+
if (isRecord(params.turn) && typeof params.turn.id === 'string')
|
|
1815
|
+
return params.turn.id;
|
|
1816
|
+
return null;
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* 复用父仓库 CodexRuntimeAdapter 的事件队列结构:终止时先排空已入队事件,
|
|
1820
|
+
* 再结束异步迭代,保证 turn/completed 前到达的最后一个文本片段不会丢失。
|
|
1821
|
+
*/
|
|
1822
|
+
function createCodexTurnEventQueue() {
|
|
1823
|
+
const values = [];
|
|
1824
|
+
const waiters = [];
|
|
1825
|
+
let closed = false;
|
|
1826
|
+
const next = () => {
|
|
1827
|
+
const value = values.shift();
|
|
1828
|
+
if (value !== undefined)
|
|
1829
|
+
return Promise.resolve({ done: false, value });
|
|
1830
|
+
if (closed)
|
|
1831
|
+
return Promise.resolve({ done: true, value: undefined });
|
|
1832
|
+
return new Promise((resolve) => waiters.push(resolve));
|
|
1833
|
+
};
|
|
1834
|
+
return {
|
|
1835
|
+
iterable: {
|
|
1836
|
+
[Symbol.asyncIterator]() {
|
|
1837
|
+
return {
|
|
1838
|
+
next,
|
|
1839
|
+
};
|
|
1840
|
+
},
|
|
1841
|
+
},
|
|
1842
|
+
next,
|
|
1843
|
+
push(message) {
|
|
1844
|
+
if (closed)
|
|
1845
|
+
return;
|
|
1846
|
+
const waiter = waiters.shift();
|
|
1847
|
+
if (waiter !== undefined)
|
|
1848
|
+
waiter({ done: false, value: message });
|
|
1849
|
+
else
|
|
1850
|
+
values.push(message);
|
|
1851
|
+
},
|
|
1852
|
+
close() {
|
|
1853
|
+
if (closed)
|
|
1854
|
+
return;
|
|
1855
|
+
closed = true;
|
|
1856
|
+
while (waiters.length > 0)
|
|
1857
|
+
waiters.shift()?.({ done: true, value: undefined });
|
|
1858
|
+
},
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
/** 只接收当前 thread/turn 的事件,避免子 Agent 的完成通知提前结束父轮次。 */
|
|
1862
|
+
function isCodexNotificationForTurn(message, threadId, turnId, allowUnidentifiedTool) {
|
|
1863
|
+
const params = isRecord(message.params) ? message.params : null;
|
|
1864
|
+
const notificationThreadId = readScopedId(params, ['threadId', 'thread_id'], 'thread');
|
|
1865
|
+
const notificationTurnId = readTurnId(message);
|
|
1866
|
+
if (notificationThreadId !== null && notificationThreadId !== threadId)
|
|
1867
|
+
return false;
|
|
1868
|
+
// 权限/问题审批是 Codex 发起的 JSON-RPC 请求,必须先交给交互层,不能因
|
|
1869
|
+
// 它的 turnId 尚未出现在 turn/start 响应中而丢弃。
|
|
1870
|
+
if (message.id !== undefined && message.id !== null)
|
|
1871
|
+
return true;
|
|
1872
|
+
// 响应返回前当前 turnId 为空;带 turnId 的旧通知不能提前关闭新回合队列。
|
|
1873
|
+
if (turnId === null && notificationTurnId !== null)
|
|
1874
|
+
return false;
|
|
1875
|
+
// turn/start 响应前的无 turnId 通知无法证明属于本次回合,尤其不能让迟到的
|
|
1876
|
+
// 无标识 turn/completed 直接关闭新回合;响应后再交给当前开放的 DSH step。
|
|
1877
|
+
if (notificationTurnId === null && !allowUnidentifiedTool)
|
|
1878
|
+
return false;
|
|
1879
|
+
return turnId === null || notificationTurnId === null || notificationTurnId === turnId;
|
|
1880
|
+
}
|
|
1881
|
+
function isCodexCompactionNotification(message, threadId) {
|
|
1882
|
+
const params = isRecord(message.params) ? message.params : null;
|
|
1883
|
+
if (readScopedId(params, ['threadId', 'thread_id'], 'thread') !== null
|
|
1884
|
+
&& readScopedId(params, ['threadId', 'thread_id'], 'thread') !== threadId)
|
|
1885
|
+
return false;
|
|
1886
|
+
if (message.method === 'thread/compacted')
|
|
1887
|
+
return true;
|
|
1888
|
+
if (message.method !== 'item/started' && message.method !== 'item/completed')
|
|
1889
|
+
return false;
|
|
1890
|
+
const item = isRecord(params?.item) ? params.item : null;
|
|
1891
|
+
return isCodexCompactionItemType(item?.type);
|
|
1892
|
+
}
|
|
1893
|
+
function isCodexCompactionItemType(value) {
|
|
1894
|
+
return value === 'contextCompaction' || value === 'context_compaction' || value === 'context-compaction';
|
|
1895
|
+
}
|
|
1896
|
+
function isContextWindowError(error) {
|
|
1897
|
+
if (error instanceof JsonRpcRequestError)
|
|
1898
|
+
return hasContextWindowError(error.data);
|
|
1899
|
+
return hasContextWindowError(error);
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* 判断 RPC 失败是否表示“服务端不认识这个方法”。
|
|
1903
|
+
*
|
|
1904
|
+
* 旧版 Codex app-server 没有 `thread/settings/update`。只有这种情况才应永久
|
|
1905
|
+
* 关闭模型纠正;进程退出、超时等瞬时失败必须保留重试机会,否则一次抖动就会让
|
|
1906
|
+
* 该会话再也无法切换模型。
|
|
1907
|
+
*/
|
|
1908
|
+
function isMethodNotFound(error) {
|
|
1909
|
+
if (error instanceof JsonRpcRequestError) {
|
|
1910
|
+
if (error.code === -32601)
|
|
1911
|
+
return true;
|
|
1912
|
+
const data = isRecord(error.data) ? error.data : null;
|
|
1913
|
+
if (data?.code === -32601)
|
|
1914
|
+
return true;
|
|
1915
|
+
return typeof data?.message === 'string' && /method\s*not\s*found|unknown method/iu.test(data.message);
|
|
1916
|
+
}
|
|
1917
|
+
if (isRecord(error) && error.code === -32601)
|
|
1918
|
+
return true;
|
|
1919
|
+
const message = error instanceof Error ? error.message : typeof error === 'string' ? error : '';
|
|
1920
|
+
return /method\s*not\s*found|unknown method/iu.test(message);
|
|
1921
|
+
}
|
|
1922
|
+
function hasContextWindowError(value) {
|
|
1923
|
+
if (typeof value === 'string')
|
|
1924
|
+
return /context[_-]?window[_-]?exceeded|context window exceeded/iu.test(value);
|
|
1925
|
+
if (!isRecord(value))
|
|
1926
|
+
return false;
|
|
1927
|
+
return Object.entries(value).some(([key, child]) => /context.?window.?exceeded/iu.test(key) || hasContextWindowError(child));
|
|
1928
|
+
}
|
|
1929
|
+
function readCodexTerminalReason(message) {
|
|
1930
|
+
const method = message.method ?? '';
|
|
1931
|
+
if (method === 'error') {
|
|
1932
|
+
const params = isRecord(message.params) ? message.params : null;
|
|
1933
|
+
return params?.willRetry === true ? null : 'error';
|
|
1934
|
+
}
|
|
1935
|
+
if (!isCodexTerminalMethod(method))
|
|
1936
|
+
return null;
|
|
1937
|
+
const params = isRecord(message.params) ? message.params : null;
|
|
1938
|
+
const turn = isRecord(params?.turn) ? params.turn : null;
|
|
1939
|
+
if (turn?.status === 'failed' || hasContextWindowError(turn?.error))
|
|
1940
|
+
return 'error';
|
|
1941
|
+
if (turn?.status === 'interrupted' || turn?.status === 'cancelled')
|
|
1942
|
+
return 'cancel';
|
|
1943
|
+
if (method === 'turn/failed' || method === 'turn/error')
|
|
1944
|
+
return 'error';
|
|
1945
|
+
if (method === 'turn/interrupted' || method === 'turn/cancelled' || method === 'turn/aborted')
|
|
1946
|
+
return 'cancel';
|
|
1947
|
+
return 'stop';
|
|
1948
|
+
}
|
|
1949
|
+
function codexFailure(message) {
|
|
1950
|
+
const params = isRecord(message.params) ? message.params : message;
|
|
1951
|
+
const turn = isRecord(params.turn) ? params.turn : params;
|
|
1952
|
+
const error = isRecord(turn.error) ? turn.error : turn.error ?? params.error;
|
|
1953
|
+
const detail = textValue(isRecord(error) ? error.message ?? error.detail ?? error.description : error)
|
|
1954
|
+
?? (isRecord(error) ? textValue(error.type) : null)
|
|
1955
|
+
?? 'Codex Provider 未返回具体失败信息。';
|
|
1956
|
+
const codeValue = isRecord(error) ? error.code ?? error.errorCode ?? error.error_code ?? error.type ?? error.status ?? error.statusCode : undefined;
|
|
1957
|
+
const code = typeof codeValue === 'number' && Number.isFinite(codeValue)
|
|
1958
|
+
? String(codeValue)
|
|
1959
|
+
: typeof codeValue === 'string' && codeValue.trim() !== ''
|
|
1960
|
+
? codeValue.trim()
|
|
1961
|
+
: undefined;
|
|
1962
|
+
return code === undefined ? { message: detail } : { message: detail, code };
|
|
1963
|
+
}
|
|
1964
|
+
/** Codex 版本间曾使用不同的 turn 终态通知名,统一收敛到同一结束路径。 */
|
|
1965
|
+
function isCodexTerminalMethod(method) {
|
|
1966
|
+
return method === 'turn/completed'
|
|
1967
|
+
|| method === 'turn/failed'
|
|
1968
|
+
|| method === 'turn/error'
|
|
1969
|
+
|| method === 'turn/interrupted'
|
|
1970
|
+
|| method === 'turn/cancelled'
|
|
1971
|
+
|| method === 'turn/aborted';
|
|
1972
|
+
}
|
|
1973
|
+
/** 将 turn/start 响应里的终态归一化成父仓库使用的 turn/completed 通知。 */
|
|
1974
|
+
function buildCodexCompletionNotification(value, threadId) {
|
|
1975
|
+
if (!isRecord(value) || !isRecord(value.turn))
|
|
1976
|
+
return null;
|
|
1977
|
+
const status = value.turn.status;
|
|
1978
|
+
if (status !== 'completed' && status !== 'failed' && status !== 'interrupted' && status !== 'cancelled')
|
|
1979
|
+
return null;
|
|
1980
|
+
return { method: 'turn/completed', params: { threadId, turn: value.turn } };
|
|
1981
|
+
}
|
|
1982
|
+
function readScopedId(value, keys, nestedKey) {
|
|
1983
|
+
if (value === null)
|
|
1984
|
+
return null;
|
|
1985
|
+
for (const key of keys)
|
|
1986
|
+
if (typeof value[key] === 'string' && value[key].trim())
|
|
1987
|
+
return value[key].trim();
|
|
1988
|
+
const nested = value[nestedKey];
|
|
1989
|
+
return isRecord(nested) && typeof nested.id === 'string' && nested.id.trim() ? nested.id.trim() : null;
|
|
1990
|
+
}
|
|
1991
|
+
function isCodexToolEvent(method, type) {
|
|
1992
|
+
if (method.includes('command') || method.includes('tool') || method.includes('agent'))
|
|
1993
|
+
return true;
|
|
1994
|
+
const normalized = type.replace(/[_-]/gu, '').toLowerCase();
|
|
1995
|
+
return ['commandexecution', 'filechange', 'mcptoolcall', 'functioncall', 'customtoolcall', 'dynamictoolcall'].includes(normalized);
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* `thread/start` 与 `thread/resume` 共用的线程参数。
|
|
1999
|
+
*
|
|
2000
|
+
* 权限必须在这里就与 `turn/start` 保持一致:Codex 的线程级沙箱会成为后续回合
|
|
2001
|
+
* 的默认值,只在 turn 上覆盖会让首次工具调用落到与 DSH 不同的模式。
|
|
2002
|
+
*/
|
|
2003
|
+
function codexThreadParams(input) {
|
|
2004
|
+
const bridgeInstructions = codexBridgeDeveloperInstructions(input.sessionId);
|
|
2005
|
+
const developerInstructions = [
|
|
2006
|
+
CODEX_QUESTION_DEVELOPER_INSTRUCTIONS,
|
|
2007
|
+
CODEX_PERMISSION_DEVELOPER_INSTRUCTIONS,
|
|
2008
|
+
bridgeInstructions,
|
|
2009
|
+
].filter((instructions) => instructions !== undefined).join('\n\n');
|
|
2010
|
+
const serviceTier = codexServiceTier(input.serviceTierId);
|
|
2011
|
+
return {
|
|
2012
|
+
cwd: input.cwd ?? process.cwd(),
|
|
2013
|
+
sandbox: codexSandboxMode(input),
|
|
2014
|
+
approvalPolicy: codexApprovalPolicy(input),
|
|
2015
|
+
approvalsReviewer: input.permission?.nativeApprovalMode === 'auto-review' ? 'auto_review' : 'user',
|
|
2016
|
+
...(!isProviderDefaultModel(input.modelId) ? { model: input.modelId } : {}),
|
|
2017
|
+
...(serviceTier === undefined ? {} : { serviceTier }),
|
|
2018
|
+
developerInstructions,
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* 把 DSH 的档位选择归一成 Codex 的线协议取值。
|
|
2023
|
+
*
|
|
2024
|
+
* 未选择档位(undefined 或空串)表示“不下发”,由调用方决定是保留线程现状还是
|
|
2025
|
+
* 显式回落;`default` 是 Codex 自己的标准速度取值,原样透传。
|
|
2026
|
+
*/
|
|
2027
|
+
function codexServiceTier(value) {
|
|
2028
|
+
const tier = value?.trim();
|
|
2029
|
+
return tier === undefined || tier === '' ? undefined : tier;
|
|
2030
|
+
}
|
|
2031
|
+
function codexTurnStartParams(input, threadId, skills) {
|
|
2032
|
+
const cwd = resolve(input.cwd ?? process.cwd());
|
|
2033
|
+
const inputBlocks = [];
|
|
2034
|
+
const attachments = input.attachments ?? [];
|
|
2035
|
+
if (input.prompt.trim() !== '' || attachments.length === 0)
|
|
2036
|
+
inputBlocks.push({ type: 'text', text: input.prompt });
|
|
2037
|
+
for (const attachment of attachments) {
|
|
2038
|
+
if (attachment.kind === 'image')
|
|
2039
|
+
inputBlocks.push({ type: 'localImage', path: attachment.path });
|
|
2040
|
+
}
|
|
2041
|
+
for (const name of codexSkillNames(input.prompt)) {
|
|
2042
|
+
const skill = skills.get(name);
|
|
2043
|
+
if (skill?.enabled !== true || skill.path === undefined)
|
|
2044
|
+
continue;
|
|
2045
|
+
inputBlocks.push({ type: 'skill', name: skill.name, path: skill.path });
|
|
2046
|
+
}
|
|
2047
|
+
return {
|
|
2048
|
+
threadId,
|
|
2049
|
+
input: inputBlocks,
|
|
2050
|
+
cwd,
|
|
2051
|
+
responsesapiClientMetadata: { workspace_kind: 'project' },
|
|
2052
|
+
sandboxPolicy: codexSandboxPolicy(input, cwd),
|
|
2053
|
+
approvalPolicy: codexApprovalPolicy(input),
|
|
2054
|
+
approvalsReviewer: input.permission?.nativeApprovalMode === 'auto-review' ? 'auto_review' : 'user',
|
|
2055
|
+
...(!isProviderDefaultModel(input.modelId) ? { model: input.modelId } : {}),
|
|
2056
|
+
...(input.effortId ? { effort: input.effortId } : {}),
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
/** 从用户文本提取显式 Skill mention,兼容 DSH 原生 `/name` 与旧版 `$name` 写法。 */
|
|
2060
|
+
function codexSkillNames(prompt) {
|
|
2061
|
+
const names = [];
|
|
2062
|
+
const seen = new Set();
|
|
2063
|
+
for (const match of prompt.matchAll(/(?:^|\s)(?:\$|\/)([A-Za-z0-9][A-Za-z0-9._-]*)(?=\s|$)/gu)) {
|
|
2064
|
+
const name = match[1]?.trim();
|
|
2065
|
+
if (name === undefined || name === '' || seen.has(name))
|
|
2066
|
+
continue;
|
|
2067
|
+
seen.add(name);
|
|
2068
|
+
names.push(name);
|
|
2069
|
+
}
|
|
2070
|
+
return names;
|
|
2071
|
+
}
|
|
2072
|
+
/** 兼容不同 Codex app-server 版本的 `skills/list` 响应包装。 */
|
|
2073
|
+
function parseCodexSkills(value, cwd) {
|
|
2074
|
+
const root = isRecord(value) && Array.isArray(value.data) ? value.data : [];
|
|
2075
|
+
const normalizedCwd = resolve(cwd);
|
|
2076
|
+
const scoped = root
|
|
2077
|
+
.filter(isRecord)
|
|
2078
|
+
.find((item) => typeof item.cwd === 'string' && resolve(item.cwd) === normalizedCwd);
|
|
2079
|
+
// 当前请求只传了一个 cwd。部分 Codex 版本会返回规范化前后的路径,
|
|
2080
|
+
// 甚至省略 cwd;此时唯一作用域就是本次请求的结果,不能把它误判成空目录。
|
|
2081
|
+
const singleScope = root.length === 1 && isRecord(root[0]) && Array.isArray(root[0].skills);
|
|
2082
|
+
const rawSkills = Array.isArray(scoped?.skills)
|
|
2083
|
+
? scoped.skills
|
|
2084
|
+
: singleScope
|
|
2085
|
+
? root[0].skills
|
|
2086
|
+
: root.every((item) => isRecord(item) && typeof item.name === 'string')
|
|
2087
|
+
? root
|
|
2088
|
+
: [];
|
|
2089
|
+
const result = [];
|
|
2090
|
+
for (const raw of rawSkills) {
|
|
2091
|
+
if (!isRecord(raw))
|
|
2092
|
+
continue;
|
|
2093
|
+
const name = typeof raw.name === 'string' ? raw.name.trim() : '';
|
|
2094
|
+
if (name === '')
|
|
2095
|
+
continue;
|
|
2096
|
+
const interfaceInfo = isRecord(raw.interface) ? raw.interface : null;
|
|
2097
|
+
const description = firstNonEmptyString(raw.description, interfaceInfo?.shortDescription, interfaceInfo?.displayName, name) ?? name;
|
|
2098
|
+
const displayName = firstNonEmptyString(interfaceInfo?.displayName);
|
|
2099
|
+
const path = firstNonEmptyString(raw.path, raw.skillPath);
|
|
2100
|
+
if (result.some((item) => item.name === name))
|
|
2101
|
+
continue;
|
|
2102
|
+
result.push({
|
|
2103
|
+
id: name,
|
|
2104
|
+
name,
|
|
2105
|
+
description,
|
|
2106
|
+
enabled: raw.enabled !== false,
|
|
2107
|
+
...(displayName === undefined ? {} : { displayName }),
|
|
2108
|
+
...(path === undefined ? {} : { path }),
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
return result;
|
|
2112
|
+
}
|
|
2113
|
+
function firstNonEmptyString(...values) {
|
|
2114
|
+
for (const value of values) {
|
|
2115
|
+
if (typeof value === 'string' && value.trim() !== '')
|
|
2116
|
+
return value.trim();
|
|
2117
|
+
}
|
|
2118
|
+
return undefined;
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* 由 DSH 会话权限状态派生 Codex 原生沙箱模式。
|
|
2122
|
+
*
|
|
2123
|
+
* `permission` 缺省表示 Host **还没读到**权限事实,此时沿用旧的保守默认
|
|
2124
|
+
* (工作区可写),不能推断为完全权限。三个字段必须来自同一份状态。
|
|
2125
|
+
*/
|
|
2126
|
+
function codexSandboxMode(input) {
|
|
2127
|
+
return input.permission?.sandboxMode ?? 'workspace-write';
|
|
2128
|
+
}
|
|
2129
|
+
function codexSandboxPolicy(input, cwd) {
|
|
2130
|
+
const mode = codexSandboxMode(input);
|
|
2131
|
+
// danger-full-access 必须映射成 Codex 自己的 bypass 形状;继续下发
|
|
2132
|
+
// workspaceWrite 会让 DSH 声明完全权限、Codex 实际只读,两侧语义分叉。
|
|
2133
|
+
if (mode === 'danger-full-access')
|
|
2134
|
+
return { type: 'dangerFullAccess' };
|
|
2135
|
+
if (mode === 'read-only')
|
|
2136
|
+
return { type: 'readOnly', networkAccess: false };
|
|
2137
|
+
// DSH 的 workspace-write 只约束自身工具沙箱,不会自动传递给 Codex
|
|
2138
|
+
// app-server。显式声明当前工作区,避免 Codex 将文件编辑误判为只读越权。
|
|
2139
|
+
return {
|
|
2140
|
+
type: 'workspaceWrite',
|
|
2141
|
+
writableRoots: [cwd],
|
|
2142
|
+
networkAccess: false,
|
|
2143
|
+
excludeTmpdirEnvVar: false,
|
|
2144
|
+
excludeSlashTmp: false,
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* 由同一份权限状态派生审批策略。
|
|
2149
|
+
*
|
|
2150
|
+
* DSH 的 `never` 表示“需要审批的动作会被自动拒绝”,因此绝不能同时向 Codex
|
|
2151
|
+
* 声明 `on-request`:那会让 Codex 发起注定被自动拒绝的审批,模型还会误以为
|
|
2152
|
+
* 用户拒绝了它。`ask` 才映射为 Codex 的 `on-request`。
|
|
2153
|
+
*/
|
|
2154
|
+
function codexApprovalPolicy(input) {
|
|
2155
|
+
return input.permission?.approvalPolicy === 'never' ? 'never' : 'on-request';
|
|
2156
|
+
}
|
|
2157
|
+
function permissionResponseKind(method, params) {
|
|
2158
|
+
// 沙箱提权请求的应答是 {permissions, scope},必须在识别 fileChange/command 之前
|
|
2159
|
+
// 判定,否则会落到 legacy 分支返回 {approved},形状不符。
|
|
2160
|
+
if (method.includes('permissions') && method.includes('Approval'))
|
|
2161
|
+
return 'permissions';
|
|
2162
|
+
if (method.includes('fileChange') || method.includes('file_change'))
|
|
2163
|
+
return 'file-change';
|
|
2164
|
+
// 新版 Codex 带 threadId/turnId/itemId,并要求 decision;旧版测试和旧
|
|
2165
|
+
// app-server 使用 approved 字段,按请求形状保持向后兼容。
|
|
2166
|
+
if (method.includes('commandExecution') && (params.threadId !== undefined || params.turnId !== undefined || params.itemId !== undefined))
|
|
2167
|
+
return 'command';
|
|
2168
|
+
return 'legacy';
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* 把 Codex 请求的权限画像转成可回传的授予画像。
|
|
2172
|
+
*
|
|
2173
|
+
* `RequestPermissionProfile` 与 `GrantedPermissionProfile` 同形,但缺省字段在
|
|
2174
|
+
* 授予侧是可选的;这里只保留实际存在的部分,避免回传 null 触发 schema 拒绝。
|
|
2175
|
+
*/
|
|
2176
|
+
function grantedPermissionProfile(requested) {
|
|
2177
|
+
const profile = isRecord(requested) ? requested : null;
|
|
2178
|
+
const fileSystem = isRecord(profile?.fileSystem) ? profile.fileSystem : undefined;
|
|
2179
|
+
const network = isRecord(profile?.network) ? profile.network : undefined;
|
|
2180
|
+
return {
|
|
2181
|
+
...(fileSystem === undefined ? {} : { fileSystem }),
|
|
2182
|
+
...(network === undefined ? {} : { network }),
|
|
2183
|
+
};
|
|
2184
|
+
}
|
|
2185
|
+
function readId(value) {
|
|
2186
|
+
if (!isRecord(value))
|
|
2187
|
+
return null;
|
|
2188
|
+
if (typeof value.threadId === 'string')
|
|
2189
|
+
return value.threadId;
|
|
2190
|
+
if (typeof value.id === 'string')
|
|
2191
|
+
return value.id;
|
|
2192
|
+
if (isRecord(value.thread) && typeof value.thread.id === 'string')
|
|
2193
|
+
return value.thread.id;
|
|
2194
|
+
return null;
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* 读取线程当前生效的模型。
|
|
2198
|
+
*
|
|
2199
|
+
* `thread/start`、`thread/resume` 的响应都在顶层返回 `model`;旧版协议把它嵌在
|
|
2200
|
+
* `thread.model` 中。读不到时返回 undefined,调用方按“未知”处理并自行纠正。
|
|
2201
|
+
*/
|
|
2202
|
+
function readThreadModel(value) {
|
|
2203
|
+
if (!isRecord(value))
|
|
2204
|
+
return undefined;
|
|
2205
|
+
const direct = value.model;
|
|
2206
|
+
if (typeof direct === 'string' && direct.trim() !== '')
|
|
2207
|
+
return direct.trim();
|
|
2208
|
+
const nested = isRecord(value.thread) ? value.thread.model : undefined;
|
|
2209
|
+
return typeof nested === 'string' && nested.trim() !== '' ? nested.trim() : undefined;
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* 读取线程当前生效的服务档位。
|
|
2213
|
+
*
|
|
2214
|
+
* `thread/start` 在响应顶层返回 `serviceTier`;旧版协议可能嵌在 `thread` 中,
|
|
2215
|
+
* 也可能完全不返回。读不到时返回 undefined,调用方按“未知”处理并在下一轮纠正。
|
|
2216
|
+
*/
|
|
2217
|
+
function readThreadServiceTier(value) {
|
|
2218
|
+
if (!isRecord(value))
|
|
2219
|
+
return undefined;
|
|
2220
|
+
const direct = value.serviceTier ?? value.service_tier;
|
|
2221
|
+
if (typeof direct === 'string' && direct.trim() !== '')
|
|
2222
|
+
return direct.trim();
|
|
2223
|
+
const nested = isRecord(value.thread) ? value.thread.serviceTier ?? value.thread.service_tier : undefined;
|
|
2224
|
+
return typeof nested === 'string' && nested.trim() !== '' ? nested.trim() : undefined;
|
|
2225
|
+
}
|
|
2226
|
+
//# sourceMappingURL=codex-driver.js.map
|