@jingyi0605/codingns4dsh 0.2.0-beta.2 → 0.2.0-rc3
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/README.en.md +4 -4
- package/README.md +18 -7
- package/assets/provider-icons/antigravity.svg +39 -0
- package/assets/provider-icons/codebuddy.svg +37 -0
- package/assets/provider-icons/cursor-cli.svg +1 -0
- package/assets/provider-icons/kiro-cli.svg +11 -0
- package/assets/provider-icons/minimax-code.svg +4 -0
- package/assets/provider-icons/qoder-cn.svg +5 -0
- package/assets/provider-icons/qoder.svg +5 -0
- package/assets/provider-icons/workbuddy.svg +29 -0
- package/assets/provider-icons/zcode.svg +14 -0
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.d.ts.map +1 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +78 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.map +1 -1
- package/data/build/dist/client/account-bar.d.ts +2 -1
- package/data/build/dist/client/account-bar.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.js +21 -16
- package/data/build/dist/client/account-bar.js.map +1 -1
- package/data/build/dist/client/bundle.js +8147 -2158
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-catalog.d.ts +1 -1
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
- package/data/build/dist/client/cli-catalog.js +11 -5
- package/data/build/dist/client/cli-catalog.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +127 -21
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/debug/ui.d.ts +2 -1
- package/data/build/dist/client/debug/ui.d.ts.map +1 -1
- package/data/build/dist/client/debug/ui.js +41 -34
- package/data/build/dist/client/debug/ui.js.map +1 -1
- 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 +597 -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/external-tool-stream.d.ts.map +1 -1
- package/data/build/dist/client/external-tool-stream.js +44 -36
- package/data/build/dist/client/external-tool-stream.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts +7 -2
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +153 -95
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/debug.d.ts.map +1 -1
- package/data/build/dist/client/features/debug.js +5 -3
- package/data/build/dist/client/features/debug.js.map +1 -1
- package/data/build/dist/client/features/file-management.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management.js +7 -4
- package/data/build/dist/client/features/file-management.js.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +10 -10
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
- package/data/build/dist/client/features/lan-access.d.ts.map +1 -1
- package/data/build/dist/client/features/lan-access.js +8 -3
- package/data/build/dist/client/features/lan-access.js.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.js +9 -7
- package/data/build/dist/client/features/login-protection-panel.js.map +1 -1
- package/data/build/dist/client/features/login-protection.js +2 -2
- package/data/build/dist/client/features/login-protection.js.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.js +8 -7
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -1
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access.js +6 -2
- package/data/build/dist/client/features/mobile-access.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts +6 -4
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +459 -27
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/reverse-proxy.js +2 -2
- package/data/build/dist/client/features/reverse-proxy.js.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement.js +2 -2
- package/data/build/dist/client/features/terminal-enhancement.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.js +8 -3
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts +3 -0
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +41 -30
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/git-history-graph.d.ts +2 -2
- package/data/build/dist/client/git-history-graph.d.ts.map +1 -1
- package/data/build/dist/client/git-history-graph.js +2 -2
- package/data/build/dist/client/git-history-graph.js.map +1 -1
- package/data/build/dist/client/git-management.d.ts +2 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +103 -75
- package/data/build/dist/client/git-management.js.map +1 -1
- 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/index.d.ts +2 -0
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +6 -5
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts +7 -0
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +140 -42
- package/data/build/dist/client/locale.js.map +1 -1
- 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 +139 -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 +223 -0
- package/data/build/dist/client/locales/git.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 +33 -0
- package/data/build/dist/client/locales/panels.js.map +1 -0
- package/data/build/dist/client/locales/peerHost.d.ts +9 -0
- package/data/build/dist/client/locales/peerHost.d.ts.map +1 -0
- package/data/build/dist/client/locales/peerHost.js +153 -0
- package/data/build/dist/client/locales/peerHost.js.map +1 -0
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts +9 -0
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts.map +1 -0
- package/data/build/dist/client/locales/peerHostWorkspace.js +69 -0
- package/data/build/dist/client/locales/peerHostWorkspace.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 +71 -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 +215 -0
- package/data/build/dist/client/locales/usage.js.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts +44 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.js +308 -0
- package/data/build/dist/client/mobile-session-interaction.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts +55 -7
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -1
- package/data/build/dist/client/mobile-sidebar-gestures.js +339 -40
- package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -1
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts +10 -2
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts.map +1 -1
- package/data/build/dist/client/mobile-sidebar-rail-dom.js +14 -6
- package/data/build/dist/client/mobile-sidebar-rail-dom.js.map +1 -1
- package/data/build/dist/client/model-catalog-cache.d.ts +5 -0
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -0
- package/data/build/dist/client/model-catalog-cache.js +58 -0
- package/data/build/dist/client/model-catalog-cache.js.map +1 -0
- package/data/build/dist/client/peer-host-aggregate-refresh.d.ts +7 -0
- package/data/build/dist/client/peer-host-aggregate-refresh.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-aggregate-refresh.js +13 -1
- package/data/build/dist/client/peer-host-aggregate-refresh.js.map +1 -1
- package/data/build/dist/client/peer-host-connection-button.d.ts +14 -1
- package/data/build/dist/client/peer-host-connection-button.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-connection-button.js +12 -4
- package/data/build/dist/client/peer-host-connection-button.js.map +1 -1
- package/data/build/dist/client/peer-host-management-panel.d.ts +3 -0
- package/data/build/dist/client/peer-host-management-panel.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-management-panel.js +83 -79
- package/data/build/dist/client/peer-host-management-panel.js.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts +17 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.js +54 -8
- package/data/build/dist/client/peer-host-native-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.d.ts +6 -2
- package/data/build/dist/client/peer-host-native-store-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.js +308 -10
- package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-scoped-client.js +5 -5
- package/data/build/dist/client/peer-host-scoped-client.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.d.ts +8 -0
- package/data/build/dist/client/peer-host-workspace-tab.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.js +48 -28
- package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
- package/data/build/dist/client/provider-icon-assets.js +18 -0
- package/data/build/dist/client/provider-icon-assets.js.map +1 -1
- package/data/build/dist/client/provider-icons.d.ts +8 -2
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +28 -7
- package/data/build/dist/client/provider-icons.js.map +1 -1
- package/data/build/dist/client/pwa-install-prompt.d.ts +4 -1
- package/data/build/dist/client/pwa-install-prompt.d.ts.map +1 -1
- package/data/build/dist/client/pwa-install-prompt.js +8 -7
- package/data/build/dist/client/pwa-install-prompt.js.map +1 -1
- package/data/build/dist/client/quick-phrase-layout.d.ts +11 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts.map +1 -1
- package/data/build/dist/client/quick-phrase-layout.js +20 -0
- package/data/build/dist/client/quick-phrase-layout.js.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.js +20 -8
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -1
- package/data/build/dist/client/remote-web-context.js +10 -6
- package/data/build/dist/client/remote-web-context.js.map +1 -1
- package/data/build/dist/client/service-tier.d.ts +54 -0
- package/data/build/dist/client/service-tier.d.ts.map +1 -0
- package/data/build/dist/client/service-tier.js +78 -0
- package/data/build/dist/client/service-tier.js.map +1 -0
- package/data/build/dist/client/session-changed-files-view.d.ts +8 -1
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -1
- package/data/build/dist/client/session-changed-files-view.js +71 -28
- package/data/build/dist/client/session-changed-files-view.js.map +1 -1
- package/data/build/dist/client/settings-anchor.d.ts +9 -3
- package/data/build/dist/client/settings-anchor.d.ts.map +1 -1
- package/data/build/dist/client/settings-anchor.js +8 -2
- package/data/build/dist/client/settings-anchor.js.map +1 -1
- package/data/build/dist/client/settings-promo-styles.d.ts +28 -0
- package/data/build/dist/client/settings-promo-styles.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo-styles.js +58 -0
- package/data/build/dist/client/settings-promo-styles.js.map +1 -0
- package/data/build/dist/client/settings-promo.d.ts +14 -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 +2 -1
- package/data/build/dist/client/settings-section.d.ts.map +1 -1
- package/data/build/dist/client/settings-section.js +10 -7
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/subscription-slot.d.ts +4 -1
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +497 -56
- package/data/build/dist/client/subscription-slot.js.map +1 -1
- package/data/build/dist/client/terminal/model.d.ts +94 -4
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +392 -33
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/client/terminal/recovery.d.ts +16 -1
- package/data/build/dist/client/terminal/recovery.d.ts.map +1 -1
- package/data/build/dist/client/terminal/recovery.js +101 -39
- package/data/build/dist/client/terminal/recovery.js.map +1 -1
- package/data/build/dist/client/terminal/styles.d.ts +10 -0
- package/data/build/dist/client/terminal/styles.d.ts.map +1 -1
- package/data/build/dist/client/terminal/styles.js +27 -3
- package/data/build/dist/client/terminal/styles.js.map +1 -1
- package/data/build/dist/client/terminal/ui.d.ts +3 -2
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
- package/data/build/dist/client/terminal/ui.js +216 -103
- package/data/build/dist/client/terminal/ui.js.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.d.ts +8 -1
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.js +394 -34
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-archive-dom.js +131 -45
- package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-logo-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-logo-dom.js +3 -1
- package/data/build/dist/client/workspace-session-logo-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.js +46 -17
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +20 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- 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 +105 -0
- package/data/build/dist/host/browser-text.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +58 -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 +271 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +30 -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 +210 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +28 -2
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +74 -4
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.js +22 -9
- package/data/build/dist/host/cli-adapters/claude-model-options.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +139 -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 +1721 -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 +22 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +254 -7
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +43 -3
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +681 -74
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts +147 -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 +659 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +12 -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 +20 -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 +48 -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 +111 -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 +34 -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 +121 -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 +32 -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 +121 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +5 -4
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts +16 -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 +73 -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.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +459 -26
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js +21 -5
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +24 -7
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +22 -6
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +118 -21
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.js +25 -4
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- 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 +11 -2
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +26 -6
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
- 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 +56 -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 +544 -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 +35 -5
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +213 -8
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +81 -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 +299 -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.js +18 -15
- package/data/build/dist/host/cli-adapters/native-team-proxy.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +57 -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 +126 -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 +959 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +22 -10
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +24 -7
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +41 -4
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +254 -40
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +71 -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 +553 -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 +31 -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 +178 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.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 +54 -2
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +224 -18
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/session-store.d.ts +10 -1
- package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/session-store.js +60 -6
- package/data/build/dist/host/cli-adapters/session-store.js.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +16 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +150 -26
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +10 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +23 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- 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 +112 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts +57 -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 +843 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts +28 -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 +212 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +27 -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 +51 -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 +39 -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 +140 -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 +29 -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 +91 -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 +128 -0
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.js +131 -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 +170 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js +6 -2
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts +21 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +176 -31
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +2 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/index.d.ts +15 -1
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +48 -2
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts +7 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +95 -19
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- 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/peer-host/host-api-proxy-service.d.ts +3 -0
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js +2 -0
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +9 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.d.ts +8 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js +9 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts +7 -0
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +31 -3
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts +2 -0
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js +26 -7
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts +6 -4
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-assets.js +11 -9
- package/data/build/dist/host/modules/pwa/pwa-assets.js.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts +3 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +6 -4
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -1
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +106 -59
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.js +8 -2
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +14 -4
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts.map +1 -1
- package/data/build/dist/host/terminal/backends/local-pty-backend.js +14 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js.map +1 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +40 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts.map +1 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.js +291 -18
- package/data/build/dist/host/terminal/backends/tmux-backend.js.map +1 -1
- package/data/build/dist/host/terminal/runtime-adapter.d.ts +32 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts.map +1 -1
- package/data/build/dist/host/terminal/runtime-adapter.js +8 -0
- package/data/build/dist/host/terminal/runtime-adapter.js.map +1 -1
- package/data/build/dist/host/terminal/runtime-manager.d.ts +3 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts.map +1 -1
- package/data/build/dist/host/terminal/runtime-manager.js +92 -4
- package/data/build/dist/host/terminal/runtime-manager.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.js +58 -6
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-process-service.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-process-service.js +12 -2
- package/data/build/dist/host/terminal/terminal-process-service.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-service.d.ts +41 -4
- package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-service.js +551 -61
- package/data/build/dist/host/terminal/terminal-service.js.map +1 -1
- package/data/build/dist/index.d.ts +2 -2
- package/data/build/dist/index.d.ts.map +1 -1
- package/data/build/dist/index.js +2 -2
- package/data/build/dist/index.js.map +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +69 -2
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.d.ts +63 -10
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +57 -5
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.d.ts +2 -0
- package/data/build/dist/shared/contracts/peer-host.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.js.map +1 -1
- package/data/build/dist/shared/contracts/subscription.d.ts +20 -1
- package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/subscription.js.map +1 -1
- package/data/build/dist/shared/contracts/terminal.d.ts +8 -1
- package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +1 -1
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +1 -1
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/debug.d.ts +8 -0
- package/data/build/dist/shared/debug.d.ts.map +1 -1
- package/data/build/dist/shared/debug.js +43 -7
- package/data/build/dist/shared/debug.js.map +1 -1
- 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 +3 -3
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +2 -2
- package/data/build/dist/shared/index.js.map +1 -1
- 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/transport/debug.d.ts +7 -0
- package/data/build/dist/transport/debug.d.ts.map +1 -1
- package/data/build/dist/transport/debug.js +33 -5
- package/data/build/dist/transport/debug.js.map +1 -1
- package/data/build/dist/transport/index.d.ts +1 -1
- package/data/build/dist/transport/index.d.ts.map +1 -1
- package/data/build/dist/transport/index.js +1 -1
- package/data/build/dist/transport/index.js.map +1 -1
- package/data/build/dist/typert.host.js +1 -1
- package/data/build/dist/typert.host.js.map +1 -1
- package/package.json +3 -1
- package/profile/README.md +2 -2
- package/profile/package.json +2 -2
- package/profile/version.json +1 -1
- package/version.json +1 -1
|
@@ -6,12 +6,29 @@ import { PiAgentDriver } from './pi-driver.js';
|
|
|
6
6
|
import { CodexAppServerDriver } from './codex-driver.js';
|
|
7
7
|
import { GrokBuildDriver } from './grok-driver.js';
|
|
8
8
|
import { OpenCodeDriver } from './opencode-driver.js';
|
|
9
|
+
import { MiniMaxCodeDriver } from './mcode-driver.js';
|
|
10
|
+
import { ZcodeAppServerDriver } from './zcode-driver.js';
|
|
11
|
+
import { CodeBuddyCliDriver, WorkBuddyCliDriver } from './codebuddy-driver.js';
|
|
12
|
+
import { CursorCliDriver } from './cursor-driver.js';
|
|
13
|
+
import { KiroCliDriver } from './kiro-driver.js';
|
|
14
|
+
import { QoderCliDriver } from './qoder-driver.js';
|
|
15
|
+
import { AntigravityDriver } from './antigravity-driver.js';
|
|
9
16
|
import { CodingNsCliAdapterRegistry } from './registry.js';
|
|
10
17
|
import { CodingNsCliSessionStore } from './session-store.js';
|
|
11
18
|
import { CodingNsDshMessageProjector } from './dsh-message-projector.js';
|
|
12
19
|
import { CommandCodeSubscriptionService } from './command-code-subscription.js';
|
|
13
20
|
import { ProviderSubscriptionService } from './provider-subscription.js';
|
|
14
|
-
import { normalizeSubscriptionUsageSettings } from '../../shared/contracts/config.js';
|
|
21
|
+
import { normalizeSubagentBridgeSettings, normalizeSubscriptionUsageSettings } from '../../shared/contracts/config.js';
|
|
22
|
+
import { setAdapterRegistry } from './registry-holder.js';
|
|
23
|
+
import { createDshVirtualProviderRegistration } from './dsh-virtual-providers.js';
|
|
24
|
+
import { dispatchBridgeSubagent } from '../cli-bridge/dispatch.js';
|
|
25
|
+
import { startSubagentBridgeServer } from '../cli-bridge/bridge-server.js';
|
|
26
|
+
import { setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
27
|
+
import { delegateCapability, dispatchDelegateSubagent } from './delegate-dispatch.js';
|
|
28
|
+
import { setMaxNativeSubagentsPerParent } from './native-subagent-dispatch.js';
|
|
29
|
+
import { containsDelegationCarrier, rewriteDelegationMessages } from './delegation-mention-rewrite.js';
|
|
30
|
+
import { clearDelegationAuthorization, setDelegationAuthorization } from './delegation-authorization.js';
|
|
31
|
+
import { debugInfo } from '../../shared/debug.js';
|
|
15
32
|
export function createCliAdaptersFeature(options = {}) {
|
|
16
33
|
return {
|
|
17
34
|
descriptor: {
|
|
@@ -21,7 +38,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
21
38
|
dependencies: [],
|
|
22
39
|
runtime: 'host',
|
|
23
40
|
},
|
|
24
|
-
start(context) {
|
|
41
|
+
async start(context) {
|
|
25
42
|
// 用量查询超时对所有适配器统一生效:同一个 timeoutMs 下发给全部网络读取器,
|
|
26
43
|
// 设置变更时整体重建,避免旧超时继续生效。
|
|
27
44
|
const buildSubscriptions = (settings) => {
|
|
@@ -29,12 +46,15 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
29
46
|
return new ProviderSubscriptionService({ commandCode: new CommandCodeSubscriptionService({ timeoutMs }), timeoutMs });
|
|
30
47
|
};
|
|
31
48
|
let subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
32
|
-
|
|
49
|
+
// 注入的 registry 自带 SessionStore;只有自建时才有本地 store 变量。
|
|
50
|
+
const sessionStore = options.registry?.sessionRecords
|
|
51
|
+
?? new CodingNsCliSessionStore(context.services.settings === undefined ? {} : { settings: context.services.settings });
|
|
33
52
|
const nativeSessions = context.services.nativeSessions;
|
|
53
|
+
// fork 子会话的绑定来自父会话,启动迁移也必须补齐祖先链。
|
|
34
54
|
if (nativeSessions !== undefined) {
|
|
35
|
-
const migration = sessionStore.migrateLegacySessions(nativeSessions.list());
|
|
55
|
+
const migration = sessionStore.migrateLegacySessions(expandMigrationChain(nativeSessions, nativeSessions.list()));
|
|
36
56
|
if (migration.migrated > 0 || migration.unresolved > 0) {
|
|
37
|
-
|
|
57
|
+
debugInfo('codingns4dsh: 旧外部会话适配器迁移完成', migration);
|
|
38
58
|
}
|
|
39
59
|
}
|
|
40
60
|
const registry = options.registry ?? new CodingNsCliAdapterRegistry([
|
|
@@ -46,12 +66,31 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
46
66
|
new CodexAppServerDriver(),
|
|
47
67
|
new OpenCodeDriver(),
|
|
48
68
|
new GrokBuildDriver(),
|
|
69
|
+
new MiniMaxCodeDriver(),
|
|
70
|
+
new ZcodeAppServerDriver(),
|
|
71
|
+
new CodeBuddyCliDriver(),
|
|
72
|
+
new WorkBuddyCliDriver(),
|
|
73
|
+
new CursorCliDriver(),
|
|
74
|
+
new KiroCliDriver(),
|
|
75
|
+
new QoderCliDriver(),
|
|
76
|
+
new QoderCliDriver({ variant: 'qoder-cn' }),
|
|
77
|
+
new AntigravityDriver(),
|
|
49
78
|
], context.services.settings?.get().agentAdapters, {
|
|
50
79
|
sessionStore,
|
|
51
80
|
...(context.services.settings === undefined ? {} : { settings: context.services.settings }),
|
|
52
81
|
...(context.services.nativeSessions === undefined ? {} : { nativeSessions: context.services.nativeSessions }),
|
|
53
82
|
});
|
|
83
|
+
setAdapterRegistry(registry);
|
|
84
|
+
context.resources.add(() => {
|
|
85
|
+
if (registry === undefined)
|
|
86
|
+
return;
|
|
87
|
+
setAdapterRegistry(undefined);
|
|
88
|
+
});
|
|
54
89
|
registry.applyEnabledSettings(context.services.settings?.get().agentAdapters);
|
|
90
|
+
const virtualProviders = createDshVirtualProviderRegistration(context.services.dshContext);
|
|
91
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
92
|
+
if (virtualProviders !== undefined)
|
|
93
|
+
context.resources.add(() => virtualProviders.dispose());
|
|
55
94
|
registry.warmCatalog();
|
|
56
95
|
if (nativeSessions !== undefined) {
|
|
57
96
|
const disposeNativeEvents = nativeSessions.subscribe({
|
|
@@ -61,9 +100,11 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
61
100
|
if (sessionId === undefined || eventType === undefined)
|
|
62
101
|
return;
|
|
63
102
|
// 旧会话可能不在启动时的 SessionStore.list() 中,直到用户点击
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
103
|
+
// 侧栏才加载。加载事件本身携带完整快照,此时补做一次迁移;
|
|
104
|
+
// fork 子会话的绑定来自父会话,必须把祖先链一起交给迁移。
|
|
105
|
+
if (sessionStore.get(sessionId) === undefined) {
|
|
106
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, session));
|
|
107
|
+
}
|
|
67
108
|
const current = sessionStore.get(sessionId);
|
|
68
109
|
if (current === undefined || current.status === 'archived')
|
|
69
110
|
return;
|
|
@@ -77,10 +118,14 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
77
118
|
});
|
|
78
119
|
context.resources.add(disposeNativeEvents);
|
|
79
120
|
}
|
|
121
|
+
registerDelegationAgentHooks(context.services.dshContext, registry, context.resources);
|
|
80
122
|
context.resources.add(context.services.rpc.register('cli', (action, payload) => {
|
|
81
123
|
switch (action) {
|
|
82
124
|
case 'catalog': return registry.catalog();
|
|
83
|
-
case 'models':
|
|
125
|
+
case 'models': {
|
|
126
|
+
const adapterId = readAdapterId(payload);
|
|
127
|
+
return adapterId === 'dsh' ? readDshModelCatalog(context.services.dshContext) : registry.models(adapterId);
|
|
128
|
+
}
|
|
84
129
|
case 'adapter/set': return setAdapterEnabled(context.services.settings, registry, payload);
|
|
85
130
|
case 'session/get': return registry.getSession(readSessionId(payload));
|
|
86
131
|
case 'session/set': return registry.setSession(readSessionId(payload), readSessionConfig(payload));
|
|
@@ -88,8 +133,10 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
88
133
|
case 'session/adapter-map':
|
|
89
134
|
// DSH 历史会话的 seed 事件不会发布 session/event;每次读取映射时
|
|
90
135
|
// 重新检查当前已加载对象,覆盖“用户刚点击打开旧会话”的路径。
|
|
91
|
-
|
|
92
|
-
|
|
136
|
+
// 子会话的父会话可能尚未出现在 list() 里,按需补齐祖先链。
|
|
137
|
+
if (nativeSessions !== undefined) {
|
|
138
|
+
sessionStore.migrateLegacySessions(expandMigrationChain(nativeSessions, nativeSessions.list()));
|
|
139
|
+
}
|
|
93
140
|
return sessionStore.adapterBindings();
|
|
94
141
|
case 'session/archive': return registry.archiveSession(readSessionId(payload));
|
|
95
142
|
case 'session/steer': return registry.steer(readSessionId(payload), readPrompt(payload), false);
|
|
@@ -109,16 +156,84 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
109
156
|
const subscription = readSubscriptionRequest(payload);
|
|
110
157
|
return subscriptions.read(subscription.adapterId, subscription.providerId);
|
|
111
158
|
}
|
|
159
|
+
case 'subscription/reset': {
|
|
160
|
+
const subscription = readSubscriptionResetRequest(payload);
|
|
161
|
+
return subscriptions.reset(subscription.adapterId, subscription.providerId);
|
|
162
|
+
}
|
|
163
|
+
// `/委派` 的 Host 边界:先给 Client 一个可读的能力诊断,再落地异步派发。
|
|
164
|
+
case 'delegate/capability': {
|
|
165
|
+
return delegateCapability({
|
|
166
|
+
agents: readOptionalContextService(context.services.dshContext, 'agents'),
|
|
167
|
+
nativeSessions: context.services.nativeSessions,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
case 'delegate': {
|
|
171
|
+
const request = readDelegateRequest(payload);
|
|
172
|
+
return dispatchDelegateSubagent(request, {
|
|
173
|
+
agents: readOptionalContextService(context.services.dshContext, 'agents'),
|
|
174
|
+
nativeSessions: context.services.nativeSessions,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
112
177
|
default: throw new Error(`未知 CLI RPC: cli/${action}`);
|
|
113
178
|
}
|
|
114
179
|
}));
|
|
180
|
+
// 外部 CLI 子代理托管:开启时启动本机回环桥接,把外部 CLI 的子代理调用
|
|
181
|
+
// 转投成 DSH 原生可续子会话;关闭或模块停用时收回端口并清空驱动句柄。
|
|
182
|
+
let bridgeServer;
|
|
183
|
+
let bridgeSync = Promise.resolve();
|
|
184
|
+
const syncSubagentBridge = async (enabled) => {
|
|
185
|
+
if (enabled === (bridgeServer !== undefined))
|
|
186
|
+
return;
|
|
187
|
+
if (!enabled) {
|
|
188
|
+
const server = bridgeServer;
|
|
189
|
+
bridgeServer = undefined;
|
|
190
|
+
setSubagentBridge(undefined);
|
|
191
|
+
await server?.close();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const agents = readOptionalContextService(context.services.dshContext, 'agents');
|
|
196
|
+
const server = await startSubagentBridgeServer({
|
|
197
|
+
dispatch: (request) => dispatchBridgeSubagent(request, {
|
|
198
|
+
agents: agents,
|
|
199
|
+
nativeSessions: context.services.nativeSessions,
|
|
200
|
+
}),
|
|
201
|
+
});
|
|
202
|
+
bridgeServer = server;
|
|
203
|
+
setSubagentBridge(server.runtime);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
console.warn('codingns4dsh: 外部 Agent 子代理桥接启动失败', error);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const scheduleSubagentBridgeSync = (enabled) => {
|
|
210
|
+
bridgeSync = bridgeSync.then(() => syncSubagentBridge(enabled), () => syncSubagentBridge(enabled));
|
|
211
|
+
};
|
|
212
|
+
const syncSubagentBridgeSettings = (raw) => {
|
|
213
|
+
const bridgeSettings = normalizeSubagentBridgeSettings(raw);
|
|
214
|
+
// 并发上限先于桥接启停生效:桥接开启后立刻到达的并行调用必须看到用户配置,
|
|
215
|
+
// 否则第一批派发仍会撞上缺省上限。
|
|
216
|
+
setMaxNativeSubagentsPerParent(bridgeSettings.maxConcurrentSubagents);
|
|
217
|
+
scheduleSubagentBridgeSync(bridgeSettings.enabled);
|
|
218
|
+
};
|
|
219
|
+
// 初始值必须在任何派发之前落地:桥接开启后第一批并行调用就会读取上限。
|
|
220
|
+
syncSubagentBridgeSettings(context.services.settings?.get().subagentBridge);
|
|
221
|
+
await bridgeSync;
|
|
222
|
+
context.resources.add(async () => {
|
|
223
|
+
const server = bridgeServer;
|
|
224
|
+
bridgeServer = undefined;
|
|
225
|
+
setSubagentBridge(undefined);
|
|
226
|
+
await server?.close();
|
|
227
|
+
});
|
|
115
228
|
const settings = context.services.settings;
|
|
116
229
|
if (settings !== undefined) {
|
|
117
230
|
context.resources.add(settings.watch((next) => {
|
|
118
231
|
registry.applyEnabledSettings(next.agentAdapters);
|
|
232
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
119
233
|
registry.syncPreferences(next.agentAdapterPreferences);
|
|
120
234
|
sessionStore.sync(next.cliSessions);
|
|
121
235
|
subscriptions = buildSubscriptions(next);
|
|
236
|
+
syncSubagentBridgeSettings(next.subagentBridge);
|
|
122
237
|
}));
|
|
123
238
|
}
|
|
124
239
|
const events = context.services.events;
|
|
@@ -130,24 +245,62 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
130
245
|
yield* next();
|
|
131
246
|
return;
|
|
132
247
|
}
|
|
248
|
+
// fork 子会话继承父会话历史,但可能还没被任何 RPC 触碰过;用户直接在
|
|
249
|
+
// 子会话里发消息时,这里必须补一次迁移,否则子会话会被当成默认 DSH
|
|
250
|
+
// 会话,用户看到的仍是 DSH 主模型而不是原来的外部 Agent。子会话的
|
|
251
|
+
// 绑定来自父会话,所以父会话必须一起进入同一批迁移。
|
|
252
|
+
if (sessionId !== '' && nativeSessions !== undefined) {
|
|
253
|
+
const nativeSession = nativeSessions.get(sessionId);
|
|
254
|
+
if (nativeSession !== undefined) {
|
|
255
|
+
sessionStore.migrateLegacySessions(collectMigrationChain(nativeSessions, nativeSession));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
133
258
|
const storedConfig = sessionId ? registry.getSession(sessionId) : { adapterId: 'dsh' };
|
|
134
259
|
// DSH 原生请求仍会携带当前模型提供方。旧会话在重载后可能暂时
|
|
135
260
|
// 被恢复成 dsh,但 provider 已明确指向外部 Agent;继续旁路会让
|
|
136
261
|
// 第二轮直接落入 DSH 空流,并丢失外部驱动的 usage/context 修正。
|
|
137
262
|
const dshSelection = readDshSelection(value);
|
|
138
|
-
|
|
263
|
+
let messages = Array.isArray(value?.messages) ? value.messages.filter(isMessage) : [];
|
|
264
|
+
// 委派 carrier 只在普通对话提交时消费。选择 Agent 本身不会经过这里,也不会创建
|
|
265
|
+
// 子会话;Agent Loop 请求会在 agent/pre-step 边界完成改写。这里仅保留
|
|
266
|
+
// 非 Agent Loop 手工 llm/stream 调用的错误消费和外部 Agent 局部解析。
|
|
267
|
+
if (containsDelegationCarrier(messages)) {
|
|
268
|
+
const delegation = rewriteDelegationMessages(messages, await registry.catalog());
|
|
269
|
+
if (delegation.kind === 'error') {
|
|
270
|
+
yield* delegationErrorStream(`${delegation.error.code}: ${delegation.error.message}`);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (delegation.kind === 'rewritten') {
|
|
274
|
+
// DSH Agent Loop 传入的 options 是深冻结对象,不能把改写结果写回
|
|
275
|
+
// `value.messages`。外部适配器只消费本地快照,原生 Agent 的 carrier
|
|
276
|
+
// 已在 agent/pre-step 中被替换并持久化。
|
|
277
|
+
setDelegationAuthorization(sessionId, delegation.value.targets);
|
|
278
|
+
messages = [...delegation.value.messages];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else if (sessionId !== '')
|
|
282
|
+
clearDelegationAuthorization(sessionId);
|
|
139
283
|
const selectedExternalAdapter = selectExternalAdapter(dshSelection.providerId, inferMessageAdapter(messages), registry);
|
|
140
|
-
|
|
284
|
+
// DSH 的 modelSelection 只描述 DSH 自己那条模型路由(例如 glor/deepseek)。
|
|
285
|
+
// 只有它明确指向即将接管的外部适配器时,model/effort 才属于该适配器;
|
|
286
|
+
// 当适配器是从会话历史推断出来的(fork 子会话继承父会话的外部消息,而
|
|
287
|
+
// provider 仍是 DSH 主模型)时,沿用该 model 会把别的 Provider 的模型名
|
|
288
|
+
// 写进外部 Agent——Codex 会用它 thread/start 并直接 404,整个会话从此
|
|
289
|
+
// 无法继续。此时必须留空,由适配器自己的偏好决定模型。
|
|
290
|
+
const selectionOwnedByAdapter = selectedExternalAdapter !== undefined
|
|
291
|
+
&& dshSelection.providerId === selectedExternalAdapter;
|
|
292
|
+
let config = storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined
|
|
141
293
|
? {
|
|
142
294
|
adapterId: selectedExternalAdapter,
|
|
143
|
-
...(dshSelection.modelId
|
|
144
|
-
...(dshSelection.effortId
|
|
295
|
+
...(selectionOwnedByAdapter && dshSelection.modelId !== undefined ? { modelId: dshSelection.modelId } : {}),
|
|
296
|
+
...(selectionOwnedByAdapter && dshSelection.effortId !== undefined ? { effortId: dshSelection.effortId } : {}),
|
|
145
297
|
}
|
|
146
298
|
: storedConfig;
|
|
147
299
|
// DSH 首轮请求可能只通过 provider 临时选择外部 Agent,第二轮请求通常不再携带
|
|
148
300
|
// provider。必须在路由决定后立即持久化绑定,否则下一轮会在进入 Registry 前退回 dsh。
|
|
301
|
+
// 采用规范化结果,让本轮也使用适配器自己的模型偏好,而不是 DSH 主模型。
|
|
149
302
|
if (sessionId !== '' && storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined) {
|
|
150
|
-
registry.setSession(sessionId, config);
|
|
303
|
+
config = registry.setSession(sessionId, config);
|
|
151
304
|
}
|
|
152
305
|
if (config.adapterId === 'dsh') {
|
|
153
306
|
const selection = dshSelection;
|
|
@@ -159,6 +312,8 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
159
312
|
}
|
|
160
313
|
const cwd = resolveSessionCwd(context.services.nativeSessions, sessionId, value);
|
|
161
314
|
const turnInput = extractTurnInput(messages, context.services.dshContext);
|
|
315
|
+
const turnOptions = readCliTurnOptions(value);
|
|
316
|
+
const runtimeEnv = readCliRuntimeEnv(value);
|
|
162
317
|
// 权限状态必须与 DSH 会话当前生效值同源。驱动不能自行假设“完全权限”,
|
|
163
318
|
// 也不能把缺省当成“已确认无限制”:解析失败时留空,由驱动沿用保守默认。
|
|
164
319
|
const permission = resolveSessionPermission(context.services.dshContext, sessionId);
|
|
@@ -168,17 +323,22 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
168
323
|
// 条 usage 到达前失去投影。
|
|
169
324
|
const input = {
|
|
170
325
|
sessionId,
|
|
171
|
-
messages,
|
|
326
|
+
messages: turnInput.messages,
|
|
172
327
|
prompt: turnInput.prompt,
|
|
173
328
|
...(turnInput.attachments.length === 0 ? {} : { attachments: turnInput.attachments }),
|
|
174
329
|
...(permission === undefined ? {} : { permission }),
|
|
330
|
+
...(turnOptions.plan === true ? { plan: true } : {}),
|
|
331
|
+
...(turnOptions.forkSession === true ? { forkSession: true } : {}),
|
|
332
|
+
...(turnOptions.enableAskUserQuestion === true ? { enableAskUserQuestion: true } : {}),
|
|
333
|
+
...(runtimeEnv === undefined ? {} : { runtimeEnv }),
|
|
175
334
|
...(config.modelId ? { modelId: config.modelId } : {}),
|
|
176
335
|
...(config.effortId ? { effortId: config.effortId } : {}),
|
|
336
|
+
...(config.serviceTierId ? { serviceTierId: config.serviceTierId } : {}),
|
|
177
337
|
...(config.providerSessionId ? { providerSessionId: config.providerSessionId } : {}),
|
|
178
338
|
...(config.rawStoreRef ? { rawStoreRef: config.rawStoreRef } : {}),
|
|
179
339
|
...(cwd === undefined ? {} : { cwd }),
|
|
180
340
|
...(isAbortSignal(value?.signal) ? { signal: value.signal } : {}),
|
|
181
|
-
...(registry.supportsSegmentedTurns(config.adapterId)
|
|
341
|
+
...((registry.supportsSegmentedTurns(config.adapterId) || registry.supportsToolStepSplitting(config.adapterId))
|
|
182
342
|
&& nativeSessions?.available === true
|
|
183
343
|
&& nativeSessions.injectNextStep !== undefined
|
|
184
344
|
&& (nativeSessions.canInjectNextStep === undefined
|
|
@@ -199,6 +359,10 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
199
359
|
input.signal?.addEventListener('abort', discardSuspendedTurn, { once: true });
|
|
200
360
|
if (input.signal?.aborted)
|
|
201
361
|
discardSuspendedTurn();
|
|
362
|
+
// DSH UI 的会话未读绿点由 api-session/status 的 true -> false 转换驱动。
|
|
363
|
+
// 外部适配器绕过 DSH 原生 Agent Loop,必须在真正执行外部流前补发同一状态,
|
|
364
|
+
// 否则外部子会话完成后虽已写入历史,侧栏却永远不会生成 completionUnread。
|
|
365
|
+
publishExternalSessionStatus(context.services.events, sessionId, true);
|
|
202
366
|
try {
|
|
203
367
|
for await (const chunk of registry.execute({ ...input, adapterId: config.adapterId })) {
|
|
204
368
|
if (chunk.type === 'step-boundary') {
|
|
@@ -231,12 +395,20 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
231
395
|
}
|
|
232
396
|
finally {
|
|
233
397
|
input.signal?.removeEventListener('abort', discardSuspendedTurn);
|
|
398
|
+
publishExternalSessionStatus(context.services.events, sessionId, false);
|
|
234
399
|
}
|
|
235
400
|
});
|
|
236
401
|
if (typeof dispose === 'function')
|
|
237
402
|
context.resources.add(() => { dispose(); });
|
|
238
403
|
}
|
|
239
|
-
context.resources.add(async () => {
|
|
404
|
+
context.resources.add(async () => {
|
|
405
|
+
// DSH 先停用设置上下文再执行异步资源清理时,旧的写队列不能继续调用
|
|
406
|
+
// configEditor,否则会出现 inactive context 并污染退出日志。
|
|
407
|
+
sessionStore.dispose();
|
|
408
|
+
await registry.dispose();
|
|
409
|
+
await sessionStore.flush();
|
|
410
|
+
setAdapterRegistry(undefined);
|
|
411
|
+
});
|
|
240
412
|
},
|
|
241
413
|
};
|
|
242
414
|
}
|
|
@@ -245,6 +417,137 @@ function requireTeam(context) {
|
|
|
245
417
|
throw new Error('DSH_TEAM_NATIVE_UNAVAILABLE');
|
|
246
418
|
return context.services.nativeTeam;
|
|
247
419
|
}
|
|
420
|
+
/** 发布外部回合运行状态,让 DSH 原生 UI 能正确维护完成未读标记。 */
|
|
421
|
+
function publishExternalSessionStatus(events, sessionId, running) {
|
|
422
|
+
if (sessionId.trim() === '' || events?.emit === undefined)
|
|
423
|
+
return;
|
|
424
|
+
try {
|
|
425
|
+
events.emit('api-session/status', sessionId, running);
|
|
426
|
+
}
|
|
427
|
+
catch {
|
|
428
|
+
// 状态提示是 UI 增强能力,不能因为精简 Host 没有完整事件转发器而阻断回合。
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* 在 Agent Loop 的可变输入边界消费委派 carrier。
|
|
433
|
+
*
|
|
434
|
+
* `llm/stream` 收到的 LOOP 请求由 DSH 深冻结,监听器只能读取;如果在那里改写
|
|
435
|
+
* `messages`,会直接抛出只读属性异常。`agent/pre-step` 返回新的决策消息,随后由
|
|
436
|
+
* Agent Loop 负责把改写后的内容写入当前会话并构造下一次只读 LLM 请求。
|
|
437
|
+
*/
|
|
438
|
+
function registerDelegationAgentHooks(dshContext, registry, resources) {
|
|
439
|
+
if (dshContext === undefined || typeof dshContext.on !== 'function')
|
|
440
|
+
return;
|
|
441
|
+
const disposers = [];
|
|
442
|
+
const register = (name, listener) => {
|
|
443
|
+
const disposer = dshContext.on(name, listener, { global: true });
|
|
444
|
+
if (typeof disposer === 'function')
|
|
445
|
+
disposers.push(disposer);
|
|
446
|
+
};
|
|
447
|
+
register('agent/pre-step', async (payload, next) => {
|
|
448
|
+
const record = asRecord(payload);
|
|
449
|
+
const sessionId = readAgentSessionId(record?.agent);
|
|
450
|
+
const messages = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
451
|
+
let delegation;
|
|
452
|
+
if (containsDelegationCarrier(messages)) {
|
|
453
|
+
delegation = rewriteDelegationMessages(messages, await registry.catalog());
|
|
454
|
+
if (delegation.kind === 'error')
|
|
455
|
+
clearDelegationAuthorization(sessionId);
|
|
456
|
+
else if (delegation.kind === 'rewritten') {
|
|
457
|
+
setDelegationAuthorization(sessionId, delegation.value.targets);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const decision = await next();
|
|
461
|
+
if (delegation?.kind !== 'rewritten' || !isEnterPreStepDecision(decision))
|
|
462
|
+
return decision;
|
|
463
|
+
// `next()` 可能已经追加系统上下文或模型切换通知,只替换它前面的本轮用户消息。
|
|
464
|
+
const suffix = decision.messages.slice(messages.length);
|
|
465
|
+
return {
|
|
466
|
+
...decision,
|
|
467
|
+
messages: [...delegation.value.messages, ...suffix],
|
|
468
|
+
};
|
|
469
|
+
});
|
|
470
|
+
// 正常结束、异常结束和中断最终都会进入 idle;在此清理本轮授权,避免下一轮
|
|
471
|
+
// 没有 carrier 时继承上一轮的目标白名单。
|
|
472
|
+
register('agent/status', (payload) => {
|
|
473
|
+
const record = asRecord(payload);
|
|
474
|
+
if (record?.status === 'idle')
|
|
475
|
+
clearDelegationAuthorization(readAgentSessionId(record?.agent));
|
|
476
|
+
});
|
|
477
|
+
register('agent/disposed', (payload) => {
|
|
478
|
+
clearDelegationAuthorization(readAgentSessionId(asRecord(payload)?.agent));
|
|
479
|
+
});
|
|
480
|
+
resources.add(() => {
|
|
481
|
+
for (const dispose of disposers.reverse())
|
|
482
|
+
dispose();
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function isEnterPreStepDecision(value) {
|
|
486
|
+
const record = asRecord(value);
|
|
487
|
+
return record?.kind === 'enter' && Array.isArray(record.messages);
|
|
488
|
+
}
|
|
489
|
+
function readAgentSessionId(value) {
|
|
490
|
+
const record = asRecord(value);
|
|
491
|
+
if (typeof record?.id === 'string' && record.id.trim() !== '')
|
|
492
|
+
return record.id.trim();
|
|
493
|
+
const session = asRecord(record?.session);
|
|
494
|
+
const header = asRecord(session?.header);
|
|
495
|
+
return typeof header?.id === 'string' ? header.id.trim() : '';
|
|
496
|
+
}
|
|
497
|
+
/** DSH Context 可能在测试或嵌入式宿主里缺少目标服务;缺失时按不可用处理。 */
|
|
498
|
+
function readOptionalContextService(ctx, name) {
|
|
499
|
+
if (ctx === undefined)
|
|
500
|
+
return undefined;
|
|
501
|
+
try {
|
|
502
|
+
return ctx.get(name);
|
|
503
|
+
}
|
|
504
|
+
catch {
|
|
505
|
+
return undefined;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
/** 将 DSH 原生 session/modelCatalog 归一化为委派选择器复用的模型目录契约。 */
|
|
509
|
+
async function readDshModelCatalog(ctx) {
|
|
510
|
+
const controller = readOptionalContextService(ctx, 'sessionController');
|
|
511
|
+
if (isRecord(controller) && typeof controller.modelCatalog === 'function') {
|
|
512
|
+
try {
|
|
513
|
+
const raw = await controller.modelCatalog();
|
|
514
|
+
const record = asRecord(raw);
|
|
515
|
+
const groups = Array.isArray(record?.groups)
|
|
516
|
+
? record.groups.flatMap((group) => normalizeDshModelGroup(group))
|
|
517
|
+
: [];
|
|
518
|
+
const defaultSelection = asRecord(record?.default);
|
|
519
|
+
const defaultModel = typeof defaultSelection?.model === 'string' && defaultSelection.model.trim() !== '' ? defaultSelection.model.trim() : null;
|
|
520
|
+
const defaultEffort = typeof defaultSelection?.reasoningEffort === 'string' && defaultSelection.reasoningEffort.trim() !== '' ? defaultSelection.reasoningEffort.trim() : null;
|
|
521
|
+
if (groups.length > 0)
|
|
522
|
+
return { groups, currentModel: defaultModel, currentEffort: defaultEffort };
|
|
523
|
+
if (defaultModel !== null)
|
|
524
|
+
return { groups: [{ id: 'dsh', name: 'DeepSeek Harness', models: [{ id: defaultModel, name: defaultModel, efforts: defaultEffort === null ? [] : [defaultEffort] }] }], currentModel: defaultModel, currentEffort: defaultEffort };
|
|
525
|
+
}
|
|
526
|
+
catch (error) {
|
|
527
|
+
debugInfo('codingns4dsh: DSH 模型目录读取失败', { error: error instanceof Error ? error.message : String(error) });
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// 精简 Host 没有 sessionController 时仍给出稳定的“跟随 DSH 当前模型”选项,
|
|
531
|
+
// 这样 dsh 目标不会退化成无模型可选,实际请求继续沿用 DSH 当前路由。
|
|
532
|
+
return { groups: [{ id: 'dsh', name: 'DeepSeek Harness', models: [{ id: 'provider-default', name: '跟随 DSH 当前模型', efforts: [] }] }], currentModel: 'provider-default', currentEffort: null, fallback: true };
|
|
533
|
+
}
|
|
534
|
+
function normalizeDshModelGroup(value) {
|
|
535
|
+
const record = asRecord(value);
|
|
536
|
+
const id = typeof record?.id === 'string' && record.id.trim() !== '' ? record.id.trim() : 'dsh';
|
|
537
|
+
const name = typeof record?.name === 'string' && record.name.trim() !== '' ? record.name.trim() : id;
|
|
538
|
+
const models = Array.isArray(record?.models) ? record.models.flatMap((item) => {
|
|
539
|
+
const model = asRecord(item);
|
|
540
|
+
const modelId = typeof model?.id === 'string' ? model.id.trim() : '';
|
|
541
|
+
if (modelId === '')
|
|
542
|
+
return [];
|
|
543
|
+
const reasoning = asRecord(model?.reasoning);
|
|
544
|
+
const efforts = Array.isArray(reasoning?.efforts)
|
|
545
|
+
? reasoning.efforts.flatMap((effort) => typeof asRecord(effort)?.id === 'string' ? [String(asRecord(effort)?.id)] : [])
|
|
546
|
+
: [];
|
|
547
|
+
return [{ id: modelId, name: typeof model?.name === 'string' && model.name.trim() !== '' ? model.name.trim() : modelId, ...(typeof model?.description === 'string' && model.description.trim() !== '' ? { description: model.description.trim() } : {}), efforts }];
|
|
548
|
+
}) : [];
|
|
549
|
+
return { id, name, models };
|
|
550
|
+
}
|
|
248
551
|
/**
|
|
249
552
|
* DSH 原生 Provider 可能只返回一个 finish(stop)。不能把这个空回合当作成功,
|
|
250
553
|
* 否则 Session 会落下一条空 assistant/message,用户只能看到“一秒结束”。
|
|
@@ -271,6 +574,13 @@ async function* guardDshNativeStream(next) {
|
|
|
271
574
|
yield { type: 'block-end', index: 1, block: { type: 'text', text: message } };
|
|
272
575
|
yield { type: 'finish', reason: { kind: 'error', failure: { message, code: 'PROVIDER_ERROR' } } };
|
|
273
576
|
}
|
|
577
|
+
/** carrier 解析失败也必须以可读的 DSH 错误事件结束当前轮次。 */
|
|
578
|
+
async function* delegationErrorStream(message) {
|
|
579
|
+
yield { type: 'block-start', index: 1, blockType: 'text' };
|
|
580
|
+
yield { type: 'text-delta', index: 1, text: message };
|
|
581
|
+
yield { type: 'block-end', index: 1, block: { type: 'text', text: message } };
|
|
582
|
+
yield { type: 'finish', reason: { kind: 'error', failure: { message, code: 'DELEGATE_ERROR' } } };
|
|
583
|
+
}
|
|
274
584
|
function isDshFinishChunk(value) {
|
|
275
585
|
const record = asRecord(value);
|
|
276
586
|
return record?.type === 'finish';
|
|
@@ -303,12 +613,37 @@ function readSubscriptionRequest(value) {
|
|
|
303
613
|
...(typeof record.providerId === 'string' && record.providerId.trim() !== '' ? { providerId: record.providerId.trim() } : {}),
|
|
304
614
|
};
|
|
305
615
|
}
|
|
616
|
+
/** 重置请求必须显式给出适配器;缺省回退 command-code 会让重置落到错误的 Agent。 */
|
|
617
|
+
function readSubscriptionResetRequest(value) {
|
|
618
|
+
const record = asRecord(value);
|
|
619
|
+
if (record === null || record.adapterId === undefined)
|
|
620
|
+
throw new Error('adapterId 不能为空');
|
|
621
|
+
return readSubscriptionRequest(value);
|
|
622
|
+
}
|
|
306
623
|
function readSessionId(value) {
|
|
307
624
|
const record = asRecord(value);
|
|
308
625
|
if (typeof record?.sessionId !== 'string' || record.sessionId.trim() === '')
|
|
309
626
|
throw new Error('sessionId 不能为空');
|
|
310
627
|
return record.sessionId.trim();
|
|
311
628
|
}
|
|
629
|
+
/** `/委派` 请求:父会话、目标适配器与自包含任务描述。 */
|
|
630
|
+
function readDelegateRequest(value) {
|
|
631
|
+
const record = asRecord(value);
|
|
632
|
+
const sessionId = readSessionId(value);
|
|
633
|
+
const adapterId = readAdapterId(value);
|
|
634
|
+
// 这里不能复用 readPrompt:旧 Client 可能仍传入空 prompt,空串要交给派发内核返回
|
|
635
|
+
// 结构化空任务错误;不得读取历史消息补齐任务。
|
|
636
|
+
const rawPrompt = record?.prompt;
|
|
637
|
+
if (rawPrompt !== undefined && typeof rawPrompt !== 'string')
|
|
638
|
+
throw new Error('prompt 必须是字符串');
|
|
639
|
+
const prompt = typeof rawPrompt === 'string' ? rawPrompt.trim() : '';
|
|
640
|
+
return {
|
|
641
|
+
sessionId,
|
|
642
|
+
adapterId,
|
|
643
|
+
prompt,
|
|
644
|
+
...(typeof record?.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
645
|
+
};
|
|
646
|
+
}
|
|
312
647
|
function readSessionConfig(value) {
|
|
313
648
|
const record = asRecord(value);
|
|
314
649
|
const adapterId = readAdapterId(record);
|
|
@@ -316,8 +651,12 @@ function readSessionConfig(value) {
|
|
|
316
651
|
adapterId,
|
|
317
652
|
...(typeof record?.modelId === 'string' && record.modelId.trim() ? { modelId: record.modelId.trim() } : {}),
|
|
318
653
|
...(typeof record?.effortId === 'string' && record.effortId.trim() ? { effortId: record.effortId.trim() } : {}),
|
|
654
|
+
// `default` 是显式的“标准速度”选择,不能当作空值丢弃,否则关掉 Fast 会被
|
|
655
|
+
// Registry 回退成上一次记住的加速档。
|
|
656
|
+
...(typeof record?.serviceTierId === 'string' && record.serviceTierId.trim() ? { serviceTierId: record.serviceTierId.trim() } : {}),
|
|
319
657
|
...(typeof record?.providerId === 'string' && record.providerId.trim() ? { providerId: record.providerId.trim() } : {}),
|
|
320
658
|
...(typeof record?.providerSessionId === 'string' && record.providerSessionId.trim() ? { providerSessionId: record.providerSessionId.trim() } : {}),
|
|
659
|
+
...(typeof record?.rawStoreRef === 'string' && record.rawStoreRef.trim() ? { rawStoreRef: record.rawStoreRef.trim() } : {}),
|
|
321
660
|
};
|
|
322
661
|
}
|
|
323
662
|
function readSessionListOptions(value) {
|
|
@@ -363,6 +702,33 @@ function readDshSelection(value) {
|
|
|
363
702
|
...(providerId === undefined ? {} : { providerId }),
|
|
364
703
|
};
|
|
365
704
|
}
|
|
705
|
+
/** 读取 DSH/Host 明确下发给外部 CLI 的运行选项;缺省值不改变 Provider 行为。 */
|
|
706
|
+
function readCliTurnOptions(value) {
|
|
707
|
+
const candidates = [
|
|
708
|
+
value,
|
|
709
|
+
asRecord(value?.options),
|
|
710
|
+
asRecord(value?.request),
|
|
711
|
+
asRecord(asRecord(value?.request)?.options),
|
|
712
|
+
asRecord(value?.config),
|
|
713
|
+
];
|
|
714
|
+
const read = (keys) => candidates.some((candidate) => keys.some((key) => candidate?.[key] === true));
|
|
715
|
+
const plan = read(['plan']);
|
|
716
|
+
const forkSession = read(['forkSession', 'fork']);
|
|
717
|
+
const enableAskUserQuestion = read(['enableAskUserQuestion', 'askUserQuestion']);
|
|
718
|
+
return {
|
|
719
|
+
...(plan ? { plan: true } : {}),
|
|
720
|
+
...(forkSession ? { forkSession: true } : {}),
|
|
721
|
+
...(enableAskUserQuestion ? { enableAskUserQuestion: true } : {}),
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
/** 父仓库通过运行时环境开启 ask_user_question;保留同一兼容入口。 */
|
|
725
|
+
function readCliRuntimeEnv(value) {
|
|
726
|
+
const candidate = asRecord(value?.runtimeEnv) ?? asRecord(asRecord(value?.options)?.runtimeEnv);
|
|
727
|
+
if (candidate === null)
|
|
728
|
+
return undefined;
|
|
729
|
+
const entries = Object.entries(candidate).filter(([, item]) => typeof item === 'string');
|
|
730
|
+
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
731
|
+
}
|
|
366
732
|
/** DSH Session 快照把最近选择放在 modelSelection.lastUsed/next。 */
|
|
367
733
|
function readModelSelectionCandidates(value) {
|
|
368
734
|
const result = [];
|
|
@@ -382,6 +748,46 @@ function readModelSelectionCandidates(value) {
|
|
|
382
748
|
}
|
|
383
749
|
return result;
|
|
384
750
|
}
|
|
751
|
+
/**
|
|
752
|
+
* 分叉子会话的绑定来自父会话,迁移时必须把祖先链一起交给 SessionStore。
|
|
753
|
+
* 只传子会话会让继承逻辑找不到父记录,子会话继续停留在 dsh。
|
|
754
|
+
*/
|
|
755
|
+
function collectMigrationChain(nativeSessions, session) {
|
|
756
|
+
const chain = [session];
|
|
757
|
+
const seen = new Set();
|
|
758
|
+
let current = session;
|
|
759
|
+
for (let depth = 0; depth < 16; depth += 1) {
|
|
760
|
+
const record = asRecord(current);
|
|
761
|
+
const header = asRecord(record?.header);
|
|
762
|
+
const parentSessionId = typeof header?.parentSession === 'string' ? header.parentSession.trim() : '';
|
|
763
|
+
if (parentSessionId === '' || seen.has(parentSessionId))
|
|
764
|
+
break;
|
|
765
|
+
seen.add(parentSessionId);
|
|
766
|
+
const parent = nativeSessions?.get(parentSessionId);
|
|
767
|
+
if (parent === undefined)
|
|
768
|
+
break;
|
|
769
|
+
chain.push(parent);
|
|
770
|
+
current = parent;
|
|
771
|
+
}
|
|
772
|
+
return chain;
|
|
773
|
+
}
|
|
774
|
+
/** 对一批会话逐个补齐祖先链,保持原有顺序并去重。 */
|
|
775
|
+
function expandMigrationChain(nativeSessions, sessions) {
|
|
776
|
+
const result = [];
|
|
777
|
+
const seen = new Set();
|
|
778
|
+
for (const session of sessions) {
|
|
779
|
+
for (const entry of collectMigrationChain(nativeSessions, session)) {
|
|
780
|
+
const record = asRecord(entry);
|
|
781
|
+
const id = typeof record?.id === 'string' ? record.id : '';
|
|
782
|
+
if (id !== '' && seen.has(id))
|
|
783
|
+
continue;
|
|
784
|
+
if (id !== '')
|
|
785
|
+
seen.add(id);
|
|
786
|
+
result.push(entry);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return result;
|
|
790
|
+
}
|
|
385
791
|
function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
386
792
|
for (const candidate of [selectedProvider, messageAdapter]) {
|
|
387
793
|
if (candidate !== undefined && candidate !== 'dsh' && registry.isEnabled(candidate))
|
|
@@ -393,7 +799,9 @@ function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
|
393
799
|
function inferMessageAdapter(messages) {
|
|
394
800
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
395
801
|
const source = asRecord(messages[index].source);
|
|
396
|
-
|
|
802
|
+
// 旧会话和 DSH 原生投影的 source 形状不完全一致;只要是模型消息就读取
|
|
803
|
+
// provider,最终仍由 selectExternalAdapter 校验是否为已启用外部适配器。
|
|
804
|
+
if (source?.kind !== 'model')
|
|
397
805
|
continue;
|
|
398
806
|
const provider = source.provider;
|
|
399
807
|
if (typeof provider === 'string' && provider.trim() !== '')
|
|
@@ -414,12 +822,31 @@ async function setAdapterEnabled(settings, registry, value) {
|
|
|
414
822
|
function extractTurnInput(messages, dshContext) {
|
|
415
823
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
416
824
|
const message = messages[index];
|
|
417
|
-
if (message !== undefined && isInjectedStepNotice(message))
|
|
418
|
-
return { prompt: extractText(message.content), attachments: [] };
|
|
419
|
-
|
|
420
|
-
|
|
825
|
+
if (message !== undefined && isInjectedStepNotice(message)) {
|
|
826
|
+
return { prompt: extractText(message.content), attachments: [], messages };
|
|
827
|
+
}
|
|
828
|
+
if (message !== undefined && isHumanUserMessage(message)) {
|
|
829
|
+
const direct = extractMessageInput(message.content, dshContext);
|
|
830
|
+
const referenceIndexes = messages
|
|
831
|
+
.slice(index + 1)
|
|
832
|
+
.map((candidate, offset) => isSessionReferenceContext(candidate) ? index + 1 + offset : -1)
|
|
833
|
+
.filter((candidateIndex) => candidateIndex >= 0);
|
|
834
|
+
const referenceText = referenceIndexes
|
|
835
|
+
.map(referenceIndex => messages[referenceIndex])
|
|
836
|
+
.filter((candidate) => candidate !== undefined)
|
|
837
|
+
.map(candidate => extractText(candidate.content))
|
|
838
|
+
.filter(text => text.trim() !== '');
|
|
839
|
+
const forwarded = referenceIndexes.length === 0
|
|
840
|
+
? messages
|
|
841
|
+
: messages.filter((_candidate, candidateIndex) => !referenceIndexes.includes(candidateIndex));
|
|
842
|
+
return {
|
|
843
|
+
prompt: [direct.prompt, ...referenceText].filter(text => text.trim() !== '').join('\n\n').trim(),
|
|
844
|
+
attachments: direct.attachments,
|
|
845
|
+
messages: forwarded,
|
|
846
|
+
};
|
|
847
|
+
}
|
|
421
848
|
}
|
|
422
|
-
return { prompt: '', attachments: [] };
|
|
849
|
+
return { prompt: '', attachments: [], messages };
|
|
423
850
|
}
|
|
424
851
|
/** DSH 为工具分段注入的继续提示必须成为下一次 Provider 请求的 prompt。 */
|
|
425
852
|
function isInjectedStepNotice(message) {
|
|
@@ -440,6 +867,12 @@ function isHumanUserMessage(message) {
|
|
|
440
867
|
return false;
|
|
441
868
|
return message.source.kind === undefined || message.source.kind === 'user';
|
|
442
869
|
}
|
|
870
|
+
/** DSH 为当前用户消息生成的只读跨会话快照,允许进入外部 Agent 的当前 prompt。 */
|
|
871
|
+
function isSessionReferenceContext(message) {
|
|
872
|
+
if (message.role !== 'user' || !isRecord(message.source))
|
|
873
|
+
return false;
|
|
874
|
+
return message.source.kind === 'session-reference' && message.source.form === 'recall';
|
|
875
|
+
}
|
|
443
876
|
function extractText(content) {
|
|
444
877
|
if (typeof content === 'string')
|
|
445
878
|
return content;
|
|
@@ -648,7 +1081,7 @@ function nativeEventType(value) {
|
|
|
648
1081
|
const record = asRecord(value);
|
|
649
1082
|
return typeof record?.type === 'string' ? record.type : undefined;
|
|
650
1083
|
}
|
|
651
|
-
function isMessage(value) { const record = asRecord(value); return (record?.role === 'user' || record?.role === 'assistant' || record?.role === 'system') && 'content' in record; }
|
|
1084
|
+
function isMessage(value) { const record = asRecord(value); return (record?.role === 'user' || record?.role === 'assistant' || record?.role === 'system' || record?.role === 'tool') && 'content' in record; }
|
|
652
1085
|
function isAbortSignal(value) { return asRecord(value)?.aborted === true || (asRecord(value)?.addEventListener instanceof Function); }
|
|
653
1086
|
function safeError(error) { return error instanceof Error ? error.message.slice(0, 512) : String(error).slice(0, 512); }
|
|
654
1087
|
//# sourceMappingURL=feature.js.map
|