@jingyi0605/codingns4dsh 0.2.0-beta.2 → 0.2.0-rc.3
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
|
@@ -3,17 +3,21 @@ import { startPeerHostManagementPanel } from '../peer-host-management-panel.js';
|
|
|
3
3
|
import { createPeerHostManagementApi } from '../peer-host-management-api.js';
|
|
4
4
|
import { DSH_PEER_HOST_PREBOOT_SHIM_GLOBAL, readDshPeerHostPrebootShimMode, readDshPeerHostPrebootShimState } from '../../bootstrap/dsh-peer-host-preboot-shim.js';
|
|
5
5
|
import { dshSettingsNoteStyle, dshThemeColor } from '../theme.js';
|
|
6
|
-
import { createVirtualSessionId, createVirtualWorkspaceId, parseVirtualSessionId } from '../../shared/index.js';
|
|
6
|
+
import { createVirtualSessionId, createVirtualWorkspaceId, parseVirtualSessionId, parseVirtualWorkspaceId } from '../../shared/index.js';
|
|
7
7
|
import { decodeNativeResponseBytes, isDshNativeRemoteMethod } from '../../host/modules/peer-host/peer-host-native-protocol.js';
|
|
8
8
|
import { createPeerHostNativeProjection } from '../peer-host-native-projection.js';
|
|
9
9
|
import { installPeerHostNativeStoreProjection, refreshPeerHostNativeSessions } from '../peer-host-native-store-projection.js';
|
|
10
10
|
import { startPeerHostWorkspaceTag } from '../peer-host-workspace-tag.js';
|
|
11
11
|
import { startPeerHostWorkspaceTab } from '../peer-host-workspace-tab.js';
|
|
12
|
-
import { registerPeerHostAggregateRefresh, requestPeerHostAggregateRefresh } from '../peer-host-aggregate-refresh.js';
|
|
12
|
+
import { isPeerHostAggregateRefreshRegistered, registerPeerHostAggregateRefresh, requestPeerHostAggregateRefresh } from '../peer-host-aggregate-refresh.js';
|
|
13
|
+
import { useCodingNsTranslator } from '../locale.js';
|
|
14
|
+
import { publishSessionAdapter } from '../session-adapter-cache.js';
|
|
13
15
|
/** 聚合刷新周期;远端资源只影响自身节点,刷新失败不改变本机界面。 */
|
|
14
16
|
const PEER_HOST_AGGREGATE_REFRESH_MS = 30_000;
|
|
15
17
|
/** 新建会话尚未出现在聚合摘要时,临时保留其远端作用域的最长时间。 */
|
|
16
18
|
const PEER_HOST_PENDING_SESSION_SCOPE_TTL_MS = 30_000;
|
|
19
|
+
/** 远端会话流刷新聚合的合并窗口,避免每个文本增量都触发完整摘要读取。 */
|
|
20
|
+
const PEER_HOST_SESSION_REFRESH_DEBOUNCE_MS = 200;
|
|
17
21
|
/** PeerHost Client 模块的边界声明;远端凭据和目标连接始终由 Host 侧持有。 */
|
|
18
22
|
export const peerHostFeature = {
|
|
19
23
|
descriptor: {
|
|
@@ -30,8 +34,10 @@ export const peerHostFeature = {
|
|
|
30
34
|
{ capability: 'peer-host.remote-web-context-fallback', required: false, fallback: 'degrade' },
|
|
31
35
|
],
|
|
32
36
|
ui: {
|
|
33
|
-
label: '
|
|
34
|
-
|
|
37
|
+
label: 'Manage other DSH Hosts',
|
|
38
|
+
labelKey: 'feature.peerHost.label',
|
|
39
|
+
description: 'Aggregate sessions from multiple Hosts',
|
|
40
|
+
descriptionKey: 'feature.peerHost.description',
|
|
35
41
|
order: 50,
|
|
36
42
|
defaultOpen: false,
|
|
37
43
|
},
|
|
@@ -39,13 +45,26 @@ export const peerHostFeature = {
|
|
|
39
45
|
start: async (context) => {
|
|
40
46
|
const shim = globalThis[DSH_PEER_HOST_PREBOOT_SHIM_GLOBAL];
|
|
41
47
|
const projection = createPeerHostNativeProjection();
|
|
42
|
-
const transport = shim === undefined ? undefined : createPeerHostPageTransport(projection);
|
|
48
|
+
const transport = shim === undefined ? undefined : createPeerHostPageTransport(projection, context.services.uiContext);
|
|
49
|
+
const management = createPeerHostManagementApi(context.services.rpc);
|
|
43
50
|
if (shim !== undefined) {
|
|
44
51
|
shim.activate(transport.hooks);
|
|
45
52
|
context.resources.add(() => { shim.deactivate(); });
|
|
46
53
|
// 原生侧栏在插件 apply 时按引用捕获 `workspaces.list`,只能就地投影这个对象;
|
|
47
54
|
// 没有 shim 就没有原生 Remote 路由,此时不注入,避免出现点不开的远端条目。
|
|
48
|
-
context.resources.add(installPeerHostNativeStoreProjection({
|
|
55
|
+
context.resources.add(installPeerHostNativeStoreProjection({
|
|
56
|
+
uiContext: context.services.uiContext,
|
|
57
|
+
projection,
|
|
58
|
+
moveWorkspace: (workspaceId, beforeWorkspaceId) => management.moveWorkspace(workspaceId, beforeWorkspaceId),
|
|
59
|
+
refreshWorkspaceOrder: async () => {
|
|
60
|
+
// 原生侧栏可能在首次聚合完成前就收到远端 Workspace;拖拽入口此时
|
|
61
|
+
// 先补一次聚合和顺序快照,再继续原操作,避免把虚拟 ID误判成未知项。
|
|
62
|
+
const aggregate = await management.aggregate();
|
|
63
|
+
const order = await management.workspaceOrder();
|
|
64
|
+
transport.setAggregate(aggregate, order.orderedWorkspaceIds);
|
|
65
|
+
return order.orderedWorkspaceIds;
|
|
66
|
+
},
|
|
67
|
+
}));
|
|
49
68
|
// Desktop 的 Transport 只有 `{ ownsHost, streamBaseUrl }`,shim 不提供 `rpc`,
|
|
50
69
|
// 因此 DSH 用原生 `createWebConnectionRpc` 建立了 Connection。这里在 Connection
|
|
51
70
|
// 就绪后就地补聚合分流:`rpc.call` 上放行聚合请求,本机流在 Remote 服务的
|
|
@@ -62,9 +81,8 @@ export const peerHostFeature = {
|
|
|
62
81
|
context.resources.add(route);
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
|
-
const panel = startPeerHostManagementPanel({ rpc: context.services.rpc });
|
|
84
|
+
const panel = startPeerHostManagementPanel({ rpc: context.services.rpc, locale: context.services.locale });
|
|
66
85
|
context.resources.add(() => panel.dispose());
|
|
67
|
-
const management = createPeerHostManagementApi(context.services.rpc);
|
|
68
86
|
// 工作区标签:远端工作区不再把 Host 名写进标题文本,改由彩色标签表达归属。
|
|
69
87
|
const tag = startPeerHostWorkspaceTag();
|
|
70
88
|
context.resources.add(() => tag.dispose());
|
|
@@ -72,15 +90,35 @@ export const peerHostFeature = {
|
|
|
72
90
|
const workspaceTab = startPeerHostWorkspaceTab({
|
|
73
91
|
api: management,
|
|
74
92
|
onWorkspaceAdded: () => refresh(),
|
|
93
|
+
locale: context.services.locale,
|
|
75
94
|
});
|
|
76
95
|
context.resources.add(() => workspaceTab.dispose());
|
|
77
96
|
// 虚拟会话必须进入原生 SessionManager 目录(否则 sessions.retain 解析失败),
|
|
78
97
|
// 因此聚合变化后触发一次原生列表刷新,由页面 Transport 在 session/list 响应里补齐。
|
|
98
|
+
let refreshGeneration = 0;
|
|
79
99
|
const refresh = async () => {
|
|
100
|
+
const generation = ++refreshGeneration;
|
|
101
|
+
const orderReference = projection.workspaceOrder();
|
|
80
102
|
try {
|
|
81
103
|
const aggregate = await management.aggregate();
|
|
104
|
+
// Host 端先完成 aggregate 再 hydrate 顺序;按同一顺序读取可避免拿到空的初始 order,
|
|
105
|
+
// 同时保持 aggregate 的旧返回形状,旧 Host 不支持该 RPC 时仍回退为追加远端项。
|
|
106
|
+
let orderedWorkspaceIds;
|
|
107
|
+
try {
|
|
108
|
+
orderedWorkspaceIds = (await management.workspaceOrder()).orderedWorkspaceIds;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
orderedWorkspaceIds = undefined;
|
|
112
|
+
}
|
|
113
|
+
// 定时器、可见性事件和原生归档事件可能并发触发刷新;旧请求不能覆盖
|
|
114
|
+
// 更新的聚合或拖拽顺序,否则列表会短暂跳回旧位置。
|
|
115
|
+
if (generation !== refreshGeneration)
|
|
116
|
+
return;
|
|
117
|
+
// 聚合读取期间如果用户完成了一次拖拽,保留本地刚确认的顺序;本轮只更新
|
|
118
|
+
// 工作区内容,下一轮再从 Host 读取顺序,避免旧的 order 响应覆盖拖拽结果。
|
|
119
|
+
const refreshedOrder = projection.workspaceOrder() === orderReference ? orderedWorkspaceIds : undefined;
|
|
82
120
|
tag.setAggregate(aggregate);
|
|
83
|
-
if (transport?.setAggregate(aggregate) === true) {
|
|
121
|
+
if (transport?.setAggregate(aggregate, refreshedOrder) === true) {
|
|
84
122
|
await refreshPeerHostNativeSessions(context.services.uiContext);
|
|
85
123
|
}
|
|
86
124
|
}
|
|
@@ -107,9 +145,67 @@ export const peerHostFeature = {
|
|
|
107
145
|
settingsPanel: PeerHostPanel,
|
|
108
146
|
};
|
|
109
147
|
/** 将 DSH preboot shim 绑定到当前页面的 Host RPC;不调用 Connection.rpc,避免递归。 */
|
|
110
|
-
export function createPeerHostPageTransport(projection = createPeerHostNativeProjection()) {
|
|
148
|
+
export function createPeerHostPageTransport(projection = createPeerHostNativeProjection(), uiContext) {
|
|
111
149
|
const fetchImpl = typeof globalThis.fetch === 'function' ? globalThis.fetch.bind(globalThis) : undefined;
|
|
112
150
|
const scopes = new Map();
|
|
151
|
+
const remoteHostScopes = new Map();
|
|
152
|
+
// `session/modelCatalog`、`cli/catalog` 和 `cli/models` 在新建会话阶段可能没有
|
|
153
|
+
// Session 参数;记录最近一次远程工作区作用域,供这些无参数请求复用。
|
|
154
|
+
let activeRemoteScope;
|
|
155
|
+
// DSH 的模型目录是 Host generation 级缓存;PeerHost 工作区切换不会触发 DSH
|
|
156
|
+
// 自己的 connection/reset,因此这里单独记录当前作用域并在变化时失效目录。
|
|
157
|
+
let activeModelCatalogScopeKey;
|
|
158
|
+
const modelCatalogScopeKey = (scope) => {
|
|
159
|
+
if (scope?.targetHostId === null || scope?.targetHostId === undefined)
|
|
160
|
+
return undefined;
|
|
161
|
+
return `${scope.targetHostId}:${scope.workspaceId}:${scope.scopeGeneration}`;
|
|
162
|
+
};
|
|
163
|
+
const refreshModelCatalogForScope = (scope) => {
|
|
164
|
+
const nextKey = modelCatalogScopeKey(scope);
|
|
165
|
+
if (nextKey === activeModelCatalogScopeKey)
|
|
166
|
+
return;
|
|
167
|
+
activeModelCatalogScopeKey = nextKey;
|
|
168
|
+
refreshDshModelCatalog(uiContext);
|
|
169
|
+
};
|
|
170
|
+
let aggregateRefreshTimer;
|
|
171
|
+
let aggregateRefreshInFlight;
|
|
172
|
+
let aggregateRefreshQueued = false;
|
|
173
|
+
let aggregateRefreshLastStartedAt;
|
|
174
|
+
const scheduleAggregateRefresh = () => {
|
|
175
|
+
if (!isPeerHostAggregateRefreshRegistered())
|
|
176
|
+
return;
|
|
177
|
+
aggregateRefreshQueued = true;
|
|
178
|
+
if (aggregateRefreshTimer !== undefined || aggregateRefreshInFlight !== undefined)
|
|
179
|
+
return;
|
|
180
|
+
const elapsed = aggregateRefreshLastStartedAt === undefined ? 0 : Date.now() - aggregateRefreshLastStartedAt;
|
|
181
|
+
const delay = Math.max(0, PEER_HOST_SESSION_REFRESH_DEBOUNCE_MS - elapsed);
|
|
182
|
+
aggregateRefreshTimer = setTimeout(() => {
|
|
183
|
+
aggregateRefreshTimer = undefined;
|
|
184
|
+
if (!aggregateRefreshQueued)
|
|
185
|
+
return;
|
|
186
|
+
aggregateRefreshQueued = false;
|
|
187
|
+
if (!isPeerHostAggregateRefreshRegistered())
|
|
188
|
+
return;
|
|
189
|
+
aggregateRefreshLastStartedAt = Date.now();
|
|
190
|
+
let result;
|
|
191
|
+
try {
|
|
192
|
+
result = requestPeerHostAggregateRefresh();
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
result = undefined;
|
|
196
|
+
}
|
|
197
|
+
if (result === undefined) {
|
|
198
|
+
if (aggregateRefreshQueued)
|
|
199
|
+
scheduleAggregateRefresh();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
aggregateRefreshInFlight = Promise.resolve(result).catch(() => undefined).finally(() => {
|
|
203
|
+
aggregateRefreshInFlight = undefined;
|
|
204
|
+
if (aggregateRefreshQueued)
|
|
205
|
+
scheduleAggregateRefresh();
|
|
206
|
+
});
|
|
207
|
+
}, delay);
|
|
208
|
+
};
|
|
113
209
|
const request = async (channel, endpoint, payload, signal) => {
|
|
114
210
|
if (fetchImpl === undefined)
|
|
115
211
|
throw new Error('当前页面没有 fetch');
|
|
@@ -123,7 +219,7 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
123
219
|
}
|
|
124
220
|
if (response === undefined || !response.ok)
|
|
125
221
|
throw new Error(`transport failure: HTTP ${response?.status ?? 500}`);
|
|
126
|
-
const envelope = await response
|
|
222
|
+
const envelope = await readPageRpcResponse(response);
|
|
127
223
|
return envelope.result;
|
|
128
224
|
};
|
|
129
225
|
const codingNsCall = async (endpoint, payload, signal) => {
|
|
@@ -165,6 +261,169 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
165
261
|
}
|
|
166
262
|
return undefined;
|
|
167
263
|
};
|
|
264
|
+
const scopeForNativeRequest = (method, value) => {
|
|
265
|
+
const direct = findScope(value);
|
|
266
|
+
if (direct !== undefined)
|
|
267
|
+
return direct;
|
|
268
|
+
if (method === 'session/modelCatalog') {
|
|
269
|
+
// 新建空白会话时模型目录先于 session/create 请求加载;当前路由中的虚拟
|
|
270
|
+
// workspace 是这时唯一可用的目标线索,优先于上一次请求留下的作用域。
|
|
271
|
+
const locationScope = currentLocationWorkspaceScope();
|
|
272
|
+
if (locationScope !== undefined)
|
|
273
|
+
return locationScope;
|
|
274
|
+
if (currentLocationIsLocalWorkspace()) {
|
|
275
|
+
activeRemoteScope = undefined;
|
|
276
|
+
refreshModelCatalogForScope(undefined);
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
if (activeRemoteScope !== undefined)
|
|
280
|
+
return activeRemoteScope;
|
|
281
|
+
}
|
|
282
|
+
return undefined;
|
|
283
|
+
};
|
|
284
|
+
const scopeForCliRequest = (endpoint, value) => {
|
|
285
|
+
const direct = findScope(value);
|
|
286
|
+
if (direct !== undefined)
|
|
287
|
+
return direct;
|
|
288
|
+
// 新建远程会话的工具栏先于 session/create 拿到 sessionId;此时 catalog/models
|
|
289
|
+
// 只有 adapterId 或空对象,沿用当前远程工作区作用域,不能回落到本机 Host。
|
|
290
|
+
if (endpoint !== 'cli/catalog' && endpoint !== 'cli/models')
|
|
291
|
+
return undefined;
|
|
292
|
+
if (currentLocationIsLocalWorkspace()) {
|
|
293
|
+
activeRemoteScope = undefined;
|
|
294
|
+
refreshModelCatalogForScope(undefined);
|
|
295
|
+
return undefined;
|
|
296
|
+
}
|
|
297
|
+
return activeRemoteScope;
|
|
298
|
+
};
|
|
299
|
+
const rememberNativeScope = (method, scope, value) => {
|
|
300
|
+
if (scope !== undefined && scope.targetHostId !== null) {
|
|
301
|
+
activeRemoteScope = scope;
|
|
302
|
+
refreshModelCatalogForScope(scope);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
// workspace/follow 和 session/follow 是 DSH 的长期基线/后台流,不代表当前导航。
|
|
306
|
+
// 只有显式携带本机 workspaceId 的导航才清理远程作用域,不能因本机旧会话的
|
|
307
|
+
// 后台流抵达,就清掉正在创建的远程会话作用域。
|
|
308
|
+
if (method === 'workspace/follow' && scope === undefined && containsLocalWorkspaceId(value)) {
|
|
309
|
+
activeRemoteScope = undefined;
|
|
310
|
+
refreshModelCatalogForScope(undefined);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
const currentLocationWorkspaceScope = () => {
|
|
314
|
+
if (typeof window === 'undefined')
|
|
315
|
+
return undefined;
|
|
316
|
+
const match = window.location.pathname.match(/\/workspaces\/([^/]+)/u);
|
|
317
|
+
if (match?.[1] === undefined)
|
|
318
|
+
return undefined;
|
|
319
|
+
let workspaceId;
|
|
320
|
+
try {
|
|
321
|
+
workspaceId = decodeURIComponent(match[1]);
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
const parsed = parseVirtualWorkspaceId(workspaceId);
|
|
327
|
+
if (parsed === null || parsed.targetHostId === null)
|
|
328
|
+
return undefined;
|
|
329
|
+
return findScope(parsed.virtualWorkspaceId);
|
|
330
|
+
};
|
|
331
|
+
const currentLocationIsLocalWorkspace = () => {
|
|
332
|
+
if (typeof window === 'undefined')
|
|
333
|
+
return false;
|
|
334
|
+
const match = window.location.pathname.match(/\/workspaces\/([^/]+)/u);
|
|
335
|
+
if (match?.[1] === undefined)
|
|
336
|
+
return false;
|
|
337
|
+
let workspaceId;
|
|
338
|
+
try {
|
|
339
|
+
workspaceId = decodeURIComponent(match[1]);
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
const parsed = parseVirtualWorkspaceId(workspaceId);
|
|
345
|
+
return parsed === null || parsed.targetHostId === null;
|
|
346
|
+
};
|
|
347
|
+
const containsLocalWorkspaceId = (value) => {
|
|
348
|
+
if (Array.isArray(value))
|
|
349
|
+
return value.some(containsLocalWorkspaceId);
|
|
350
|
+
const record = asRecord(value);
|
|
351
|
+
if (record === null)
|
|
352
|
+
return false;
|
|
353
|
+
for (const [key, child] of Object.entries(record)) {
|
|
354
|
+
if (key === 'workspaceId' && typeof child === 'string' && parseVirtualWorkspaceId(child) === null)
|
|
355
|
+
return true;
|
|
356
|
+
if (containsLocalWorkspaceId(child))
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
return false;
|
|
360
|
+
};
|
|
361
|
+
const cliEndpoint = (channel, endpoint) => {
|
|
362
|
+
if (channel === '/codingns' && endpoint.startsWith('cli/'))
|
|
363
|
+
return endpoint;
|
|
364
|
+
if (channel === '/api' && endpoint.startsWith('codingns/cli/'))
|
|
365
|
+
return endpoint.slice('codingns/'.length);
|
|
366
|
+
return undefined;
|
|
367
|
+
};
|
|
368
|
+
const rewriteCliPayload = (value, scope, key = '') => {
|
|
369
|
+
if (typeof value === 'string') {
|
|
370
|
+
const parsed = parseVirtualSessionId(value);
|
|
371
|
+
const isSessionField = key === 'sessionId' || key === 'parentSessionId' || key === 'childSessionId';
|
|
372
|
+
return isSessionField && parsed !== null && parsed.hostId === (scope.targetHostId ?? scope.hostId) ? parsed.sessionId : value;
|
|
373
|
+
}
|
|
374
|
+
if (Array.isArray(value))
|
|
375
|
+
return value.map((item) => rewriteCliPayload(item, scope, key));
|
|
376
|
+
const record = asRecord(value);
|
|
377
|
+
if (record === null)
|
|
378
|
+
return value;
|
|
379
|
+
return Object.fromEntries(Object.entries(record).map(([childKey, child]) => [childKey, rewriteCliPayload(child, scope, childKey)]));
|
|
380
|
+
};
|
|
381
|
+
const remoteCliRpc = async (scope, endpoint, payload, signal) => {
|
|
382
|
+
if (scope.targetHostId === null)
|
|
383
|
+
throw new Error('PeerHost CLI 请求缺少目标 Host');
|
|
384
|
+
const response = asRecord(await codingNsCall('peerHost/request', {
|
|
385
|
+
peerHostId: scope.targetHostId,
|
|
386
|
+
scope,
|
|
387
|
+
path: `/api/codingns/${endpoint}`,
|
|
388
|
+
method: 'POST',
|
|
389
|
+
body: JSON.stringify({ rpcId: createRequestId(), method: endpoint, payload: rewriteCliPayload(payload, scope) }),
|
|
390
|
+
}, signal));
|
|
391
|
+
const status = typeof response?.status === 'number' ? response.status : 500;
|
|
392
|
+
const body = typeof response?.body === 'string' ? response.body : '';
|
|
393
|
+
if (status < 200 || status >= 300)
|
|
394
|
+
throw new Error(`远端 Host CLI RPC 失败: HTTP ${status}`);
|
|
395
|
+
try {
|
|
396
|
+
const envelope = asRecord(JSON.parse(body));
|
|
397
|
+
return envelope?.result;
|
|
398
|
+
}
|
|
399
|
+
catch {
|
|
400
|
+
throw new Error('远端 Host CLI RPC 响应不是 JSON');
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
const mergeRemoteAdapterMap = async (localResult, signal) => {
|
|
404
|
+
const localEnvelope = asRecord(localResult);
|
|
405
|
+
if (localEnvelope?.ok !== true || !Array.isArray(localEnvelope.value))
|
|
406
|
+
return localResult;
|
|
407
|
+
const rows = [...localEnvelope.value];
|
|
408
|
+
for (const [targetHostId, scope] of remoteHostScopes) {
|
|
409
|
+
try {
|
|
410
|
+
const remoteEnvelope = asRecord(await remoteCliRpc(scope, 'cli/session/adapter-map', {}, signal));
|
|
411
|
+
if (remoteEnvelope?.ok !== true || !Array.isArray(remoteEnvelope.value))
|
|
412
|
+
continue;
|
|
413
|
+
for (const raw of remoteEnvelope.value) {
|
|
414
|
+
const row = asRecord(raw);
|
|
415
|
+
const sessionId = typeof row?.sessionId === 'string' ? row.sessionId : '';
|
|
416
|
+
const adapterId = typeof row?.adapterId === 'string' ? row.adapterId : '';
|
|
417
|
+
if (sessionId !== '' && adapterId !== '')
|
|
418
|
+
rows.push({ sessionId: createVirtualSessionId(targetHostId, sessionId), adapterId });
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
catch {
|
|
422
|
+
// 旧版目标 Host 没有 CLI 映射时保留本机结果,远端会话仍可打开。
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return { ...localEnvelope, value: rows };
|
|
426
|
+
};
|
|
168
427
|
const openRemoteStream = (method, payload, scope, signal) => (async function* () {
|
|
169
428
|
const opened = asRecord(await codingNsCall('peerHost/nativeStream', { method, payload, scope }, signal));
|
|
170
429
|
const streamId = typeof opened?.streamId === 'string' ? opened.streamId : '';
|
|
@@ -225,8 +484,24 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
225
484
|
const value = asRecord(payload);
|
|
226
485
|
const channel = typeof value?.channel === 'string' ? value.channel : '/codingns';
|
|
227
486
|
const body = value?.payload;
|
|
487
|
+
const cli = cliEndpoint(channel, method);
|
|
488
|
+
if (cli === 'cli/session/adapter-map') {
|
|
489
|
+
return await mergeRemoteAdapterMap(await request(channel, method, body, signal), signal);
|
|
490
|
+
}
|
|
491
|
+
if (cli !== undefined) {
|
|
492
|
+
const scope = scopeForCliRequest(cli, body);
|
|
493
|
+
if (scope !== undefined && scope.targetHostId !== null) {
|
|
494
|
+
try {
|
|
495
|
+
return await remoteCliRpc(scope, cli, body, signal);
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
return { ok: false, error: { code: 'gateway/internal', message: error instanceof Error ? error.message : String(error) } };
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
228
502
|
if (channel === '/api' && isDshNativeRemoteMethod(method)) {
|
|
229
|
-
const scope =
|
|
503
|
+
const scope = scopeForNativeRequest(method, body);
|
|
504
|
+
rememberNativeScope(method, scope, body);
|
|
230
505
|
if (scope !== undefined && scope.targetHostId !== null) {
|
|
231
506
|
// DSH 的 client 契约要求 unary 结果是 `{ok, value}` / `{ok:false, error}` 信封:
|
|
232
507
|
// 返回裸值会让网关在 `rebuiltFailure(result.error)` 读 undefined.code 而崩成 carrierFailure。
|
|
@@ -261,9 +536,29 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
261
536
|
const channel = typeof value?.channel === 'string' ? value.channel : '/api';
|
|
262
537
|
const body = value?.payload;
|
|
263
538
|
if (channel === '/api' && isDshNativeRemoteMethod(method)) {
|
|
264
|
-
const scope =
|
|
539
|
+
const scope = scopeForNativeRequest(method, body);
|
|
540
|
+
rememberNativeScope(method, scope, body);
|
|
265
541
|
if (scope !== undefined && scope.targetHostId !== null) {
|
|
266
|
-
|
|
542
|
+
const stream = openRemoteStream(method, body, scope, signal);
|
|
543
|
+
if (method !== 'session/follow')
|
|
544
|
+
return stream;
|
|
545
|
+
// session/follow 承载远端新建、续接过程中的实时事件。聚合摘要本身仍按轮询
|
|
546
|
+
// 读取,但由这里把事件转成合并刷新,侧栏无需切换到别的会话才能更新状态。
|
|
547
|
+
return (async function* () {
|
|
548
|
+
let emitted = false;
|
|
549
|
+
try {
|
|
550
|
+
for await (const chunk of stream) {
|
|
551
|
+
emitted = true;
|
|
552
|
+
scheduleAggregateRefresh();
|
|
553
|
+
yield chunk;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
finally {
|
|
557
|
+
// 某些实现只在回合结束时写入 updatedAt/status,流结束也必须补一次刷新。
|
|
558
|
+
if (!emitted)
|
|
559
|
+
scheduleAggregateRefresh();
|
|
560
|
+
}
|
|
561
|
+
})();
|
|
267
562
|
}
|
|
268
563
|
}
|
|
269
564
|
// 本机流(含 $events 等非白名单流)必须回到 DSH Gateway:本地 baseline 不能
|
|
@@ -281,13 +576,24 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
281
576
|
return {
|
|
282
577
|
hooks,
|
|
283
578
|
/** 该请求是否落在某个远端 Host 的作用域内;Desktop 连接路由用它决定是否分流。 */
|
|
284
|
-
matchesScope(value) {
|
|
285
|
-
const
|
|
579
|
+
matchesScope(value, method) {
|
|
580
|
+
const cli = method === undefined
|
|
581
|
+
? undefined
|
|
582
|
+
: method === 'cli/catalog' || method === 'cli/models'
|
|
583
|
+
? method
|
|
584
|
+
: method.startsWith('codingns/cli/') ? method.slice('codingns/'.length) : undefined;
|
|
585
|
+
const scope = cli === undefined
|
|
586
|
+
? scopeForNativeRequest(method ?? '', value)
|
|
587
|
+
: scopeForCliRequest(cli, value);
|
|
286
588
|
return scope !== undefined && scope.targetHostId !== null;
|
|
287
589
|
},
|
|
288
|
-
setAggregate(aggregate) {
|
|
590
|
+
setAggregate(aggregate, orderedWorkspaceIds) {
|
|
289
591
|
scopes.clear();
|
|
592
|
+
remoteHostScopes.clear();
|
|
290
593
|
for (const host of aggregate) {
|
|
594
|
+
if (host.targetHostId !== null) {
|
|
595
|
+
remoteHostScopes.set(host.targetHostId, { hostId: host.hostId, targetHostId: host.targetHostId, workspaceId: '__aggregate__', sessionId: null, scopeGeneration: 0 });
|
|
596
|
+
}
|
|
291
597
|
for (const workspace of host.workspaces) {
|
|
292
598
|
const virtualHostId = host.targetHostId ?? host.hostId;
|
|
293
599
|
const virtualWorkspaceId = createVirtualWorkspaceId(virtualHostId, workspace.workspaceId);
|
|
@@ -301,6 +607,14 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
301
607
|
}
|
|
302
608
|
}
|
|
303
609
|
}
|
|
610
|
+
const locationScope = currentLocationWorkspaceScope();
|
|
611
|
+
if (locationScope !== undefined && locationScope.targetHostId !== null)
|
|
612
|
+
activeRemoteScope = locationScope;
|
|
613
|
+
if (activeRemoteScope !== undefined && activeRemoteScope.targetHostId !== null) {
|
|
614
|
+
const activeWorkspaceId = createVirtualWorkspaceId(activeRemoteScope.targetHostId, activeRemoteScope.workspaceId);
|
|
615
|
+
if (!scopes.has(activeWorkspaceId))
|
|
616
|
+
activeRemoteScope = undefined;
|
|
617
|
+
}
|
|
304
618
|
// 刚创建、尚未进入聚合的会话要保住作用域;聚合里已存在的以聚合为准。
|
|
305
619
|
// 一旦聚合确认,pending 记录立即清掉;之后远端删除会随下一次聚合重建自然移除。
|
|
306
620
|
const now = Date.now();
|
|
@@ -315,7 +629,8 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
315
629
|
}
|
|
316
630
|
scopes.set(sessionId, pending.scope);
|
|
317
631
|
}
|
|
318
|
-
|
|
632
|
+
refreshModelCatalogForScope(activeRemoteScope);
|
|
633
|
+
return projection.setAggregate(aggregate, orderedWorkspaceIds);
|
|
319
634
|
},
|
|
320
635
|
};
|
|
321
636
|
}
|
|
@@ -345,9 +660,17 @@ export function installPeerHostConnectionRouting(options) {
|
|
|
345
660
|
const originalCallRemote = remote.openRemoteStream;
|
|
346
661
|
const isPeerScoped = (channel, endpoint, payload) => channel === '/api'
|
|
347
662
|
&& isDshNativeRemoteMethod(endpoint)
|
|
348
|
-
&& options.matchesScope(payload);
|
|
663
|
+
&& options.matchesScope(payload, endpoint);
|
|
664
|
+
const isPeerCli = (channel, endpoint, payload) => {
|
|
665
|
+
const cliEndpoint = channel === '/codingns' && endpoint.startsWith('cli/')
|
|
666
|
+
? endpoint
|
|
667
|
+
: channel === '/api' && endpoint.startsWith('codingns/cli/')
|
|
668
|
+
? endpoint.slice('codingns/'.length)
|
|
669
|
+
: undefined;
|
|
670
|
+
return cliEndpoint !== undefined && (cliEndpoint === 'cli/session/adapter-map' || options.matchesScope(payload, endpoint));
|
|
671
|
+
};
|
|
349
672
|
rpc.call = async (channel, endpoint, payload, signal) => {
|
|
350
|
-
if (isPeerScoped(channel, endpoint, payload)) {
|
|
673
|
+
if (isPeerScoped(channel, endpoint, payload) || isPeerCli(channel, endpoint, payload)) {
|
|
351
674
|
return await options.hooks.rpc({ method: endpoint, payload: { channel, payload }, ...(signal === undefined ? {} : { signal }) });
|
|
352
675
|
}
|
|
353
676
|
const result = await originalCall.call(rpc, channel, endpoint, payload, signal);
|
|
@@ -409,6 +732,10 @@ function mergeSessionListResult(result, projection) {
|
|
|
409
732
|
const id = asRecord(item)?.sessionId;
|
|
410
733
|
return typeof id === 'string' ? [id] : [];
|
|
411
734
|
}));
|
|
735
|
+
for (const session of virtual) {
|
|
736
|
+
if (session.adapterId !== undefined)
|
|
737
|
+
publishSessionAdapter(session.sessionId, session.adapterId);
|
|
738
|
+
}
|
|
412
739
|
const items = [...value.items, ...virtual.filter((session) => !known.has(session.sessionId))];
|
|
413
740
|
return { ...envelope, value: { ...value, items } };
|
|
414
741
|
}
|
|
@@ -418,6 +745,110 @@ function createRequestId() {
|
|
|
418
745
|
function asRecord(value) {
|
|
419
746
|
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null;
|
|
420
747
|
}
|
|
748
|
+
/**
|
|
749
|
+
* 解析页面 DSH Gateway 的 JSON 或 multipart 响应。
|
|
750
|
+
*
|
|
751
|
+
* `workspaceFiles/readBytes` 等 Remote 会把 Uint8Array 放到 multipart 附件里;
|
|
752
|
+
* 页面 Transport 不能直接调用 `response.json()`,否则 multipart 的 `--` 边界会被
|
|
753
|
+
* JSON 解析器当成负数开头,产生误导性的“No number after minus sign”错误。
|
|
754
|
+
*/
|
|
755
|
+
async function readPageRpcResponse(response) {
|
|
756
|
+
const contentType = response.headers.get('content-type')?.split(';', 1)[0]?.trim().toLowerCase();
|
|
757
|
+
if (contentType !== 'multipart/form-data')
|
|
758
|
+
return await response.json();
|
|
759
|
+
const fields = new Map();
|
|
760
|
+
for (const [name, value] of (await response.formData()).entries()) {
|
|
761
|
+
if (fields.has(name))
|
|
762
|
+
throw new TypeError('connection: invalid binary response fields');
|
|
763
|
+
fields.set(name, value);
|
|
764
|
+
}
|
|
765
|
+
const metadata = fields.get('metadata');
|
|
766
|
+
if (typeof metadata !== 'string')
|
|
767
|
+
throw new TypeError('connection: invalid binary response fields');
|
|
768
|
+
const envelope = asRecord(JSON.parse(metadata));
|
|
769
|
+
const result = asRecord(envelope?.result);
|
|
770
|
+
if (envelope === null || result === null)
|
|
771
|
+
throw new TypeError('connection: invalid server-response envelope');
|
|
772
|
+
fields.delete('metadata');
|
|
773
|
+
if (result.ok !== true) {
|
|
774
|
+
if (fields.size !== 0)
|
|
775
|
+
throw new TypeError('connection: invalid binary response fields');
|
|
776
|
+
return envelope;
|
|
777
|
+
}
|
|
778
|
+
const attachments = envelope.attachments;
|
|
779
|
+
if (!Array.isArray(attachments) || attachments.length === 0)
|
|
780
|
+
throw new TypeError('connection: invalid binary response result');
|
|
781
|
+
const root = { value: result.value };
|
|
782
|
+
for (const rawAttachment of attachments) {
|
|
783
|
+
const attachment = asRecord(rawAttachment);
|
|
784
|
+
const path = attachment?.path;
|
|
785
|
+
const part = attachment?.part;
|
|
786
|
+
if (attachment?.codec !== 'bytes' || typeof part !== 'string' || !Array.isArray(path)) {
|
|
787
|
+
throw new TypeError('connection: invalid binary response attachment');
|
|
788
|
+
}
|
|
789
|
+
const data = fields.get(part);
|
|
790
|
+
if (!(data instanceof Blob))
|
|
791
|
+
throw new TypeError('connection: invalid binary response fields');
|
|
792
|
+
let parent = root;
|
|
793
|
+
let key = 'value';
|
|
794
|
+
for (const segment of path) {
|
|
795
|
+
const value = Reflect.get(parent, key);
|
|
796
|
+
if (typeof value !== 'object' || value === null)
|
|
797
|
+
throw new TypeError('connection: invalid binary response path');
|
|
798
|
+
if (Array.isArray(value)) {
|
|
799
|
+
if (typeof segment !== 'number' || !Number.isSafeInteger(segment) || segment < 0 || segment >= value.length) {
|
|
800
|
+
throw new TypeError('connection: invalid binary response path');
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
else if (typeof segment !== 'string') {
|
|
804
|
+
throw new TypeError('connection: invalid binary response path');
|
|
805
|
+
}
|
|
806
|
+
if (!Object.hasOwn(value, segment))
|
|
807
|
+
throw new TypeError('connection: invalid binary response path');
|
|
808
|
+
parent = value;
|
|
809
|
+
key = segment;
|
|
810
|
+
}
|
|
811
|
+
if (Reflect.get(parent, key) !== null)
|
|
812
|
+
throw new TypeError('connection: invalid binary response placeholder');
|
|
813
|
+
Object.defineProperty(parent, key, {
|
|
814
|
+
value: new Uint8Array(await data.arrayBuffer()),
|
|
815
|
+
enumerable: true,
|
|
816
|
+
writable: true,
|
|
817
|
+
configurable: true,
|
|
818
|
+
});
|
|
819
|
+
fields.delete(part);
|
|
820
|
+
}
|
|
821
|
+
if (fields.size !== 0)
|
|
822
|
+
throw new TypeError('connection: invalid binary response fields');
|
|
823
|
+
return { ...envelope, result: { ...result, value: root.value } };
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* 让 DSH 原生模型目录丢弃上一工作区的缓存并立即读取新作用域。
|
|
827
|
+
*
|
|
828
|
+
* `modelDirectories.catalog` 在 DSH 类型中是内部字段,这里只做运行时结构探测,
|
|
829
|
+
* 这样旧版 DSH 或 Desktop 没有该服务时仍保持原有路由行为。
|
|
830
|
+
*/
|
|
831
|
+
function refreshDshModelCatalog(uiContext) {
|
|
832
|
+
if (uiContext === undefined)
|
|
833
|
+
return;
|
|
834
|
+
try {
|
|
835
|
+
const service = asRecord(uiContext.get('modelDirectories'));
|
|
836
|
+
const catalog = service === null ? null : asRecord(service.catalog);
|
|
837
|
+
if (catalog === null)
|
|
838
|
+
return;
|
|
839
|
+
const resetGeneration = catalog.resetGeneration;
|
|
840
|
+
const refresh = catalog.refresh;
|
|
841
|
+
if (typeof resetGeneration === 'function') {
|
|
842
|
+
resetGeneration.call(catalog);
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (typeof refresh === 'function')
|
|
846
|
+
refresh.call(catalog);
|
|
847
|
+
}
|
|
848
|
+
catch {
|
|
849
|
+
// 模型选择插件未挂载或 DSH 版本没有该内部服务时,不影响远程请求本身。
|
|
850
|
+
}
|
|
851
|
+
}
|
|
421
852
|
/** 打开当前页面 DSH Gateway 的单个 Remote 流;协议与 dsh-api-gateway 保持一致。 */
|
|
422
853
|
function openDshGatewayStream(endpoint, payload, signal) {
|
|
423
854
|
const streamId = `codingns_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
@@ -502,23 +933,24 @@ function isDesktopTopologyPage() {
|
|
|
502
933
|
}
|
|
503
934
|
}
|
|
504
935
|
/** PeerHost 启用状态说明;安装动作发生在启动页 preboot 阶段。 */
|
|
505
|
-
function PeerHostPanel({ enabled }) {
|
|
936
|
+
function PeerHostPanel({ services, enabled }) {
|
|
937
|
+
const t = useCodingNsTranslator(services.locale);
|
|
506
938
|
// shim 状态在启用变化后可能改变(刚激活为 active),每次渲染都重读全局。
|
|
507
939
|
const state = readDshPeerHostPrebootShimState();
|
|
508
940
|
const mode = readDshPeerHostPrebootShimMode();
|
|
509
941
|
const desktop = mode === 'desktop' || isDesktopTopologyPage();
|
|
510
942
|
const structural = state === 'external' || state === 'not-installed';
|
|
511
943
|
const message = state === 'external'
|
|
512
|
-
? '
|
|
944
|
+
? t('peerHost.stateExternal')
|
|
513
945
|
: state === 'not-installed'
|
|
514
946
|
? desktop
|
|
515
|
-
? '
|
|
516
|
-
: '
|
|
947
|
+
? t('peerHost.stateNotInstalledDesktop')
|
|
948
|
+
: t('peerHost.stateNotInstalledWeb')
|
|
517
949
|
: state === 'requires-reload'
|
|
518
|
-
? '
|
|
950
|
+
? t('peerHost.stateRequiresReload')
|
|
519
951
|
: state === 'active'
|
|
520
|
-
? '
|
|
521
|
-
: '
|
|
952
|
+
? t('peerHost.stateActive')
|
|
953
|
+
: t('peerHost.statePending');
|
|
522
954
|
return createElement('div', {
|
|
523
955
|
role: structural ? 'alert' : 'status',
|
|
524
956
|
'aria-disabled': !enabled,
|