@jingyi0605/codingns4dsh 0.2.1-beta.6 → 0.2.1-beta.7
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 +19 -5
- package/THIRD_PARTY_NOTICES +5 -0
- package/assets/provider-icons/r4.svg +4 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/client/assistant-settings-styles.d.ts.map +1 -1
- package/data/build/dist/client/assistant-settings-styles.js +3 -2
- package/data/build/dist/client/assistant-settings-styles.js.map +1 -1
- package/data/build/dist/client/avatar/catalog-panel.d.ts.map +1 -1
- package/data/build/dist/client/avatar/catalog-panel.js +7 -5
- package/data/build/dist/client/avatar/catalog-panel.js.map +1 -1
- package/data/build/dist/client/avatar/catalog-picker.d.ts.map +1 -1
- package/data/build/dist/client/avatar/catalog-picker.js +2 -1
- package/data/build/dist/client/avatar/catalog-picker.js.map +1 -1
- package/data/build/dist/client/avatar/desktop-bridge.d.ts +7 -3
- package/data/build/dist/client/avatar/desktop-bridge.d.ts.map +1 -1
- package/data/build/dist/client/avatar/desktop-bridge.js +64 -5
- package/data/build/dist/client/avatar/desktop-bridge.js.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.d.ts +4 -0
- package/data/build/dist/client/avatar/desktop-view.d.ts.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.js +82 -5
- package/data/build/dist/client/avatar/desktop-view.js.map +1 -1
- package/data/build/dist/client/avatar/engine.d.ts.map +1 -1
- package/data/build/dist/client/avatar/engine.js +3 -2
- package/data/build/dist/client/avatar/engine.js.map +1 -1
- package/data/build/dist/client/avatar/floating.d.ts +5 -3
- package/data/build/dist/client/avatar/floating.d.ts.map +1 -1
- package/data/build/dist/client/avatar/floating.js +11 -4
- package/data/build/dist/client/avatar/floating.js.map +1 -1
- package/data/build/dist/client/avatar/image.d.ts +1 -1
- package/data/build/dist/client/avatar/image.d.ts.map +1 -1
- package/data/build/dist/client/avatar/image.js +2 -2
- package/data/build/dist/client/avatar/image.js.map +1 -1
- package/data/build/dist/client/avatar/live2d.d.ts +14 -3
- package/data/build/dist/client/avatar/live2d.d.ts.map +1 -1
- package/data/build/dist/client/avatar/live2d.js +62 -9
- package/data/build/dist/client/avatar/live2d.js.map +1 -1
- package/data/build/dist/client/avatar/loading.d.ts.map +1 -1
- package/data/build/dist/client/avatar/loading.js +3 -2
- package/data/build/dist/client/avatar/loading.js.map +1 -1
- package/data/build/dist/client/avatar/notification-bubble.d.ts +26 -0
- package/data/build/dist/client/avatar/notification-bubble.d.ts.map +1 -0
- package/data/build/dist/client/avatar/notification-bubble.js +201 -0
- package/data/build/dist/client/avatar/notification-bubble.js.map +1 -0
- package/data/build/dist/client/avatar/reaction-badge.d.ts +7 -0
- package/data/build/dist/client/avatar/reaction-badge.d.ts.map +1 -0
- package/data/build/dist/client/avatar/reaction-badge.js +11 -0
- package/data/build/dist/client/avatar/reaction-badge.js.map +1 -0
- package/data/build/dist/client/avatar/registry.d.ts +2 -1
- package/data/build/dist/client/avatar/registry.d.ts.map +1 -1
- package/data/build/dist/client/avatar/registry.js.map +1 -1
- package/data/build/dist/client/avatar/settings-panel.d.ts.map +1 -1
- package/data/build/dist/client/avatar/settings-panel.js +7 -5
- package/data/build/dist/client/avatar/settings-panel.js.map +1 -1
- package/data/build/dist/client/avatar/slot.d.ts +2 -1
- package/data/build/dist/client/avatar/slot.d.ts.map +1 -1
- package/data/build/dist/client/avatar/slot.js +5 -4
- package/data/build/dist/client/avatar/slot.js.map +1 -1
- package/data/build/dist/client/avatar/spritesheet.d.ts +4 -2
- package/data/build/dist/client/avatar/spritesheet.d.ts.map +1 -1
- package/data/build/dist/client/avatar/spritesheet.js +18 -9
- package/data/build/dist/client/avatar/spritesheet.js.map +1 -1
- package/data/build/dist/client/bundle.js +5815 -1449
- 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 +2 -0
- package/data/build/dist/client/cli-catalog.js.map +1 -1
- package/data/build/dist/client/cli-session-config-cache.d.ts +17 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.js +56 -0
- package/data/build/dist/client/cli-session-config-cache.js.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.d.ts +5 -0
- package/data/build/dist/client/cli-settings-rpc.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.js +60 -0
- package/data/build/dist/client/cli-settings-rpc.js.map +1 -0
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +24 -40
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +264 -55
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/client.assistant-debug-workbench.js +4 -4
- package/data/build/dist/client/client.assistant-debug-workbench.js.map +1 -1
- package/data/build/dist/client/{client.assistant-prompts.js → client.assistant-notifications.js} +63 -2
- package/data/build/dist/client/client.assistant-notifications.js.map +1 -0
- package/data/build/dist/client/client.assistant-prompt-editor.js +4 -4
- package/data/build/dist/client/client.assistant-prompt-editor.js.map +1 -1
- package/data/build/dist/client/client.assistant-workbench.js +57 -57
- package/data/build/dist/client/client.assistant-workbench.js.map +1 -1
- package/data/build/dist/client/client.delegate-command.js +12 -25
- package/data/build/dist/client/client.delegate-command.js.map +1 -1
- package/data/build/dist/client/client.manager.js +164 -25
- package/data/build/dist/client/client.manager.js.map +1 -1
- package/data/build/dist/client/client.model-catalog-cache.js +2 -1
- package/data/build/dist/client/client.model-catalog-cache.js.map +1 -1
- package/data/build/dist/client/client.native-workspace-store.js +42 -11
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.react-dom.js +250 -0
- package/data/build/dist/client/client.react-dom.js.map +1 -1
- package/data/build/dist/client/client.theme.js +56 -12
- package/data/build/dist/client/client.theme.js.map +1 -1
- package/data/build/dist/client/client.transport.js +312 -44
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/debug/ui.d.ts.map +1 -1
- package/data/build/dist/client/debug/ui.js +30 -29
- package/data/build/dist/client/debug/ui.js.map +1 -1
- package/data/build/dist/client/delegate-command.d.ts.map +1 -1
- package/data/build/dist/client/delegate-command.js +12 -21
- package/data/build/dist/client/delegate-command.js.map +1 -1
- package/data/build/dist/client/desktop-assistant.js +4348 -31
- package/data/build/dist/client/external-tool-stream.d.ts.map +1 -1
- package/data/build/dist/client/external-tool-stream.js +2 -1
- package/data/build/dist/client/external-tool-stream.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-session.js +3 -3
- package/data/build/dist/client/features/assistant-configuration-session.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.js +2 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-view.d.ts +8 -0
- package/data/build/dist/client/features/assistant-configuration-view.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-view.js +99 -3
- package/data/build/dist/client/features/assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/features/assistant-conversation-message.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-conversation-message.js +9 -8
- package/data/build/dist/client/features/assistant-conversation-message.js.map +1 -1
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-debug-workbench.js +3 -2
- package/data/build/dist/client/features/assistant-debug-workbench.js.map +1 -1
- package/data/build/dist/client/features/assistant-floating-call.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-floating-call.js +4 -3
- package/data/build/dist/client/features/assistant-floating-call.js.map +1 -1
- package/data/build/dist/client/features/assistant-notification-store.d.ts +66 -0
- package/data/build/dist/client/features/assistant-notification-store.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-notification-store.js +395 -0
- package/data/build/dist/client/features/assistant-notification-store.js.map +1 -0
- package/data/build/dist/client/features/assistant-realtime-call.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-realtime-call.js +13 -12
- package/data/build/dist/client/features/assistant-realtime-call.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-initialization.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-initialization.js +4 -2
- package/data/build/dist/client/features/assistant-voice-initialization.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.js +2 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings.js +4 -3
- package/data/build/dist/client/features/assistant-voice-settings.js.map +1 -1
- package/data/build/dist/client/features/assistant-workbench-controls.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-workbench-controls.js +6 -5
- package/data/build/dist/client/features/assistant-workbench-controls.js.map +1 -1
- package/data/build/dist/client/features/assistant-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-workbench.js +11 -9
- package/data/build/dist/client/features/assistant-workbench.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +140 -35
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/file-management-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management-panel.js +3 -10
- package/data/build/dist/client/features/file-management-panel.js.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.d.ts +6 -0
- package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.js +85 -3
- package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
- package/data/build/dist/client/features/index.d.ts +1 -0
- package/data/build/dist/client/features/index.d.ts.map +1 -1
- package/data/build/dist/client/features/index.js +3 -0
- package/data/build/dist/client/features/index.js.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +6 -4
- package/data/build/dist/client/features/lan-access-panel.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 +7 -2
- package/data/build/dist/client/features/login-protection-panel.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 +19 -13
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts +3 -0
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +412 -26
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/reverse-proxy-panel.js +5 -4
- package/data/build/dist/client/features/reverse-proxy-panel.js.map +1 -1
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts +9 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js +28 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/subscription-usage-panel.js +4 -3
- package/data/build/dist/client/features/subscription-usage-panel.js.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement-panel.js +6 -4
- package/data/build/dist/client/features/terminal-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/features/types.d.ts +8 -0
- package/data/build/dist/client/features/types.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.js +7 -6
- package/data/build/dist/client/features/voice-conversation-dialog.js.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.js +7 -6
- package/data/build/dist/client/features/voice-initialization-dialog.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +44 -96
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +42 -28
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/font-scale.d.ts +37 -0
- package/data/build/dist/client/font-scale.d.ts.map +1 -0
- package/data/build/dist/client/font-scale.js +56 -0
- package/data/build/dist/client/font-scale.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +80 -37
- package/data/build/dist/client/git-management.js.map +1 -1
- package/data/build/dist/client/index.d.ts +1 -1
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +43 -1
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +27 -2
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/assistantWorkbench.d.ts +31 -0
- package/data/build/dist/client/locales/assistantWorkbench.d.ts.map +1 -1
- package/data/build/dist/client/locales/assistantWorkbench.js +22 -2
- package/data/build/dist/client/locales/assistantWorkbench.js.map +1 -1
- package/data/build/dist/client/locales/peerHost.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHost.js +10 -0
- package/data/build/dist/client/locales/peerHost.js.map +1 -1
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHostWorkspace.js +16 -0
- package/data/build/dist/client/locales/peerHostWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/subagentCollapsed.d.ts +53 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.js +95 -0
- package/data/build/dist/client/locales/subagentCollapsed.js.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.js +2 -2
- package/data/build/dist/client/locales/terminalAuth.js.map +1 -1
- package/data/build/dist/client/locales/usage.d.ts.map +1 -1
- package/data/build/dist/client/locales/usage.js +48 -0
- package/data/build/dist/client/locales/usage.js.map +1 -1
- package/data/build/dist/client/native-workspace-store.d.ts +10 -0
- package/data/build/dist/client/native-workspace-store.d.ts.map +1 -1
- package/data/build/dist/client/native-workspace-store.js +22 -1
- package/data/build/dist/client/native-workspace-store.js.map +1 -1
- package/data/build/dist/client/peer-host-color.d.ts +3 -0
- package/data/build/dist/client/peer-host-color.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-color.js +16 -0
- package/data/build/dist/client/peer-host-color.js.map +1 -1
- package/data/build/dist/client/peer-host-file-links.d.ts +8 -0
- package/data/build/dist/client/peer-host-file-links.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-file-links.js +43 -0
- package/data/build/dist/client/peer-host-file-links.js.map +1 -0
- package/data/build/dist/client/peer-host-management-api.d.ts +2 -1
- package/data/build/dist/client/peer-host-management-api.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-management-api.js +2 -1
- package/data/build/dist/client/peer-host-management-api.js.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts +16 -8
- package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.js +88 -15
- 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 +2 -0
- 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 +52 -13
- package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-reference-source.d.ts +18 -0
- package/data/build/dist/client/peer-host-reference-source.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-reference-source.js +174 -0
- package/data/build/dist/client/peer-host-reference-source.js.map +1 -0
- package/data/build/dist/client/peer-host-remote-events.d.ts +34 -0
- package/data/build/dist/client/peer-host-remote-events.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-remote-events.js +239 -0
- package/data/build/dist/client/peer-host-remote-events.js.map +1 -0
- package/data/build/dist/client/peer-host-scoped-client.d.ts +3 -0
- package/data/build/dist/client/peer-host-scoped-client.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-scoped-client.js +5 -2
- package/data/build/dist/client/peer-host-scoped-client.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.d.ts +2 -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 +62 -29
- package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tag.d.ts +5 -0
- package/data/build/dist/client/peer-host-workspace-tag.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tag.js +57 -14
- package/data/build/dist/client/peer-host-workspace-tag.js.map +1 -1
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +2 -1
- package/data/build/dist/client/provider-icons.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 +12 -11
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -1
- package/data/build/dist/client/serial-polling.d.ts +1 -0
- package/data/build/dist/client/serial-polling.d.ts.map +1 -1
- package/data/build/dist/client/serial-polling.js +4 -2
- package/data/build/dist/client/serial-polling.js.map +1 -1
- package/data/build/dist/client/session-adapter-cache.d.ts +2 -0
- package/data/build/dist/client/session-adapter-cache.d.ts.map +1 -1
- package/data/build/dist/client/session-adapter-cache.js +11 -0
- package/data/build/dist/client/session-adapter-cache.js.map +1 -1
- package/data/build/dist/client/session-changed-files-view.d.ts +15 -0
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -1
- package/data/build/dist/client/session-changed-files-view.js +73 -29
- package/data/build/dist/client/session-changed-files-view.js.map +1 -1
- package/data/build/dist/client/settings-controls.d.ts +29 -0
- package/data/build/dist/client/settings-controls.d.ts.map +1 -0
- package/data/build/dist/client/settings-controls.js +80 -0
- package/data/build/dist/client/settings-controls.js.map +1 -0
- package/data/build/dist/client/settings-section.d.ts.map +1 -1
- package/data/build/dist/client/settings-section.js +7 -11
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/skill-command.d.ts.map +1 -1
- package/data/build/dist/client/skill-command.js +2 -1
- package/data/build/dist/client/skill-command.js.map +1 -1
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts +103 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js +664 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/subscription-slot.d.ts +8 -2
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +50 -33
- package/data/build/dist/client/subscription-slot.js.map +1 -1
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
- package/data/build/dist/client/terminal/ui.js +26 -8
- package/data/build/dist/client/terminal/ui.js.map +1 -1
- package/data/build/dist/client/theme.d.ts.map +1 -1
- package/data/build/dist/client/theme.js +17 -12
- package/data/build/dist/client/theme.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js +47 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +199 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js +8 -2
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +13 -3
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +37 -3
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/types.js.map +1 -1
- package/data/build/dist/host/avatar/materials.d.ts.map +1 -1
- package/data/build/dist/host/avatar/materials.js +3 -1
- package/data/build/dist/host/avatar/materials.js.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +136 -11
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js +65 -31
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +29 -9
- 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.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +136 -16
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js +7 -6
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts +32 -11
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-app.js +195 -24
- package/data/build/dist/host/cli-adapters/doubao-app.js.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.js +3 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js +153 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +23 -3
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +71 -28
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +22 -0
- 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 +24 -2
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +113 -4
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +63 -18
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +35 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.js +2 -45
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +6 -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 +10 -3
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +317 -62
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +134 -14
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +13 -45
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js +111 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +14 -3
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -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 +7 -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.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.js +28 -7
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts +24 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.js +121 -23
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js +26 -6
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.d.ts +45 -4
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +129 -14
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +20 -5
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.d.ts +25 -2
- package/data/build/dist/host/desktop-assistant/controller.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.js +170 -7
- package/data/build/dist/host/desktop-assistant/controller.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/feature.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/feature.js +41 -4
- package/data/build/dist/host/desktop-assistant/feature.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/launcher.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/launcher.js +3 -1
- package/data/build/dist/host/desktop-assistant/launcher.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.js +41 -10
- package/data/build/dist/host/desktop-assistant/mac-agent.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/notifications.d.ts +16 -0
- package/data/build/dist/host/desktop-assistant/notifications.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/notifications.js +45 -0
- package/data/build/dist/host/desktop-assistant/notifications.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/win-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/win-agent.js +95 -8
- package/data/build/dist/host/desktop-assistant/win-agent.js.map +1 -1
- package/data/build/dist/host/features/assistant-lifecycle-settings.js +1 -1
- package/data/build/dist/host/features/assistant-lifecycle-settings.js.map +1 -1
- package/data/build/dist/host/features/assistant-notification-events.d.ts +77 -0
- package/data/build/dist/host/features/assistant-notification-events.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-events.js +574 -0
- package/data/build/dist/host/features/assistant-notification-events.js.map +1 -0
- package/data/build/dist/host/features/assistant-notification-source.d.ts +32 -0
- package/data/build/dist/host/features/assistant-notification-source.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-source.js +101 -0
- package/data/build/dist/host/features/assistant-notification-source.js.map +1 -0
- package/data/build/dist/host/features/assistant-notification-stream.d.ts +26 -0
- package/data/build/dist/host/features/assistant-notification-stream.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-stream.js +179 -0
- package/data/build/dist/host/features/assistant-notification-stream.js.map +1 -0
- package/data/build/dist/host/features/assistant-notifications.d.ts +71 -0
- package/data/build/dist/host/features/assistant-notifications.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notifications.js +342 -0
- package/data/build/dist/host/features/assistant-notifications.js.map +1 -0
- package/data/build/dist/host/features/assistant-peer-notifications.d.ts +53 -0
- package/data/build/dist/host/features/assistant-peer-notifications.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-peer-notifications.js +197 -0
- package/data/build/dist/host/features/assistant-peer-notifications.js.map +1 -0
- package/data/build/dist/host/features/assistant-tts-service.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-tts-service.js +2 -2
- package/data/build/dist/host/features/assistant-tts-service.js.map +1 -1
- package/data/build/dist/host/features/assistant-voice-initialization.js +1 -1
- package/data/build/dist/host/features/assistant-voice-initialization.js.map +1 -1
- package/data/build/dist/host/features/git-management.js +2 -1
- package/data/build/dist/host/features/git-management.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +90 -2
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts +1 -0
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +3 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +159 -70
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/session-title-optimization.d.ts +5 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.js +26 -0
- package/data/build/dist/host/features/session-title-optimization.js.map +1 -0
- package/data/build/dist/host/features/types.d.ts +6 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +23 -1
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +9 -1
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.js +8 -2
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.d.ts +5 -1
- 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 +72 -23
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.js +7 -5
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts +6 -1
- 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 +7 -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-handshake.d.ts +2 -1
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.js +11 -10
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +43 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +6 -3
- 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 +92 -5
- 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-streams.d.ts +15 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +101 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -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 +44 -11
- 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.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +75 -20
- 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-request-errors.d.ts +31 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.js +60 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.js.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-session.d.ts +12 -4
- package/data/build/dist/host/modules/peer-host/peer-host-session.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-session.js +28 -18
- package/data/build/dist/host/modules/peer-host/peer-host-session.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts +1 -1
- 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 +15 -4
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.d.ts +22 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.js +133 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +2 -0
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +67 -0
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +11 -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 -3
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/terminal/controller-factory.d.ts +1 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts.map +1 -1
- package/data/build/dist/host/terminal/controller-factory.js +3 -0
- package/data/build/dist/host/terminal/controller-factory.js.map +1 -1
- package/data/build/dist/host/terminal/startup.d.ts +3 -0
- package/data/build/dist/host/terminal/startup.d.ts.map +1 -1
- package/data/build/dist/host/terminal/startup.js +1 -0
- package/data/build/dist/host/terminal/startup.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.d.ts +8 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.js +2 -1
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
- package/data/build/dist/shared/assistant-avatar-adapters.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-avatar-adapters.js +3 -0
- package/data/build/dist/shared/assistant-avatar-adapters.js.map +1 -1
- package/data/build/dist/shared/assistant-avatar.d.ts +11 -1
- package/data/build/dist/shared/assistant-avatar.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-avatar.js +31 -1
- package/data/build/dist/shared/assistant-avatar.js.map +1 -1
- package/data/build/dist/shared/assistant-notification-feed.d.ts +44 -0
- package/data/build/dist/shared/assistant-notification-feed.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-notification-feed.js +88 -0
- package/data/build/dist/shared/assistant-notification-feed.js.map +1 -0
- package/data/build/dist/shared/assistant-notifications.d.ts +107 -0
- package/data/build/dist/shared/assistant-notifications.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-notifications.js +24 -0
- package/data/build/dist/shared/assistant-notifications.js.map +1 -0
- package/data/build/dist/shared/assistant-tts.js +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +5 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.d.ts +5 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +3 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/peer-host.d.ts +15 -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 +31 -0
- 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/version.d.ts +12 -8
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +11 -7
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/desktop-assistant.d.ts +73 -1
- package/data/build/dist/shared/desktop-assistant.d.ts.map +1 -1
- package/data/build/dist/shared/desktop-assistant.js +189 -2
- package/data/build/dist/shared/desktop-assistant.js.map +1 -1
- package/data/build/dist/shared/index.d.ts +2 -2
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js.map +1 -1
- package/data/build/dist/shared/peer-host-file-location.d.ts +11 -0
- package/data/build/dist/shared/peer-host-file-location.d.ts.map +1 -0
- package/data/build/dist/shared/peer-host-file-location.js +20 -0
- package/data/build/dist/shared/peer-host-file-location.js.map +1 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts +10 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.js +7 -1
- package/data/build/dist/shared/peer-host-http-routes.js.map +1 -1
- package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -1
- package/data/build/dist/shared/provider-icon-resources.js +1 -0
- package/data/build/dist/shared/provider-icon-resources.js.map +1 -1
- package/data/build/dist/shared/session-reference.d.ts +11 -0
- package/data/build/dist/shared/session-reference.d.ts.map +1 -0
- package/data/build/dist/shared/session-reference.js +29 -0
- package/data/build/dist/shared/session-reference.js.map +1 -0
- package/data/build/dist/shared/session-title.d.ts +12 -0
- package/data/build/dist/shared/session-title.d.ts.map +1 -0
- package/data/build/dist/shared/session-title.js +65 -0
- package/data/build/dist/shared/session-title.js.map +1 -0
- package/data/build/dist/shared/voice-initialization.d.ts +1 -1
- package/data/build/dist/shared/voice-initialization.d.ts.map +1 -1
- package/data/build/dist/shared/voice-initialization.js +1 -1
- package/data/build/dist/shared/voice-initialization.js.map +1 -1
- package/data/build/dist/shared/voice-models.d.ts +2 -2
- package/data/build/dist/shared/voice-models.d.ts.map +1 -1
- package/data/build/dist/shared/voice-models.js +9 -9
- package/data/build/dist/shared/voice-models.js.map +1 -1
- package/data/build/dist/typert.host.d.ts +18 -1
- package/data/build/dist/typert.host.d.ts.map +1 -1
- package/data/build/dist/typert.host.js +28 -3
- package/data/build/dist/typert.host.js.map +1 -1
- package/data/build/dist/typert.notifications-client.d.ts +5 -0
- package/data/build/dist/typert.notifications-client.d.ts.map +1 -0
- package/data/build/dist/typert.notifications-client.js +7 -0
- package/data/build/dist/typert.notifications-client.js.map +1 -0
- package/data/build/dist/typert.remote-client.js +1 -1
- package/data/build/dist/typert.remote-client.js.map +1 -1
- package/package.json +32 -26
- package/profile/README.md +2 -2
- package/profile/package.json +3 -3
- package/profile/version.json +3 -3
- package/version.json +3 -3
- package/data/build/dist/client/client.assistant-prompts.js.map +0 -1
|
@@ -13,8 +13,13 @@ import { isPeerHostAggregateRefreshRegistered, registerPeerHostAggregateRefresh,
|
|
|
13
13
|
import { resolveCodingNsTranslator, useCodingNsTranslator } from '../locale.js';
|
|
14
14
|
import { publishSessionAdapter } from '../session-adapter-cache.js';
|
|
15
15
|
import { startSerialPolling } from '../serial-polling.js';
|
|
16
|
+
import { PeerHostRemoteEvents } from '../peer-host-remote-events.js';
|
|
17
|
+
import { installPeerHostFileLinkRouting } from '../peer-host-file-links.js';
|
|
18
|
+
import { registerPeerHostReferenceSource } from '../peer-host-reference-source.js';
|
|
16
19
|
/** 聚合刷新周期;远端资源只影响自身节点,刷新失败不改变本机界面。 */
|
|
17
20
|
const PEER_HOST_AGGREGATE_REFRESH_MS = 30_000;
|
|
21
|
+
/** 有断线节点时缩短复检周期,成功重连后恢复正常频率。 */
|
|
22
|
+
const PEER_HOST_RECOVERY_REFRESH_MS = 5_000;
|
|
18
23
|
/** 新建会话尚未出现在聚合摘要时,临时保留其远端作用域的最长时间。 */
|
|
19
24
|
const PEER_HOST_PENDING_SESSION_SCOPE_TTL_MS = 30_000;
|
|
20
25
|
/** 远端会话流刷新聚合的合并窗口,避免每个文本增量都触发完整摘要读取。 */
|
|
@@ -47,14 +52,39 @@ export const peerHostFeature = {
|
|
|
47
52
|
const shim = globalThis[DSH_PEER_HOST_PREBOOT_SHIM_GLOBAL];
|
|
48
53
|
const projection = createPeerHostNativeProjection();
|
|
49
54
|
const transport = shim === undefined ? undefined : createPeerHostPageTransport(projection, context.services.uiContext, context.services.locale);
|
|
55
|
+
// 官方 ui-reference 在远程 Session 尚未完成本地保留、或目标 Host 版本没有
|
|
56
|
+
// sessionReferenceResolver 时会静默丢弃整组对话候选。PeerHost 已经持有摘要,
|
|
57
|
+
// 让兜底源只在可确认的远程会话/工作区上生效,保证 @ 菜单仍能列出可引用会话。
|
|
58
|
+
const referenceSource = context.services.uiContext?.inject(['inputTriggers', 'sessions'], (scope) => {
|
|
59
|
+
scope.effect(() => {
|
|
60
|
+
// 先挂载不依赖新 Remote 的摘要兜底;若嵌套 Remote 随后就绪,切换到
|
|
61
|
+
// Resolver 感知版本,官方候选成功时不会在菜单中产生重复项。
|
|
62
|
+
let dispose = registerPeerHostReferenceSource(scope, projection, context.services.locale);
|
|
63
|
+
const resolverFiber = scope.inject(['remote.sessionReferenceResolver'], (resolverScope) => {
|
|
64
|
+
dispose();
|
|
65
|
+
dispose = registerPeerHostReferenceSource(resolverScope, projection, context.services.locale);
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
dispose();
|
|
69
|
+
void resolverFiber.dispose();
|
|
70
|
+
};
|
|
71
|
+
}, 'codingns4dsh: PeerHost session reference source');
|
|
72
|
+
});
|
|
73
|
+
if (referenceSource !== undefined)
|
|
74
|
+
context.resources.add(() => referenceSource.dispose());
|
|
50
75
|
const management = createPeerHostManagementApi(context.services.rpc);
|
|
51
76
|
if (shim !== undefined) {
|
|
52
77
|
shim.activate(transport.hooks);
|
|
53
78
|
context.resources.add(() => {
|
|
79
|
+
transport.dispose();
|
|
54
80
|
shim.deactivate();
|
|
55
81
|
// 资源按逆序释放:此时 Desktop 路由和导航订阅已还原,重新加载本机目录,
|
|
56
82
|
// 避免停用 PeerHost 后仍展示最后一个远端 Host 的全局缓存。
|
|
57
83
|
refreshDshModelCatalog(context.services.uiContext);
|
|
84
|
+
// Web 路径没有额外的原生 Remote 路由,不需要为了停用插件强制结束当前
|
|
85
|
+
// Connection 代次;否则 DSH 会在每次手动重连后自动再发一次 session/list。
|
|
86
|
+
if (shim.getMode?.() === 'desktop')
|
|
87
|
+
reconnectNativeEvents(context.services.uiContext);
|
|
58
88
|
});
|
|
59
89
|
// 原生侧栏在插件 apply 时按引用捕获 `workspaces.list`,只能就地投影这个对象;
|
|
60
90
|
// 没有 shim 就没有原生 Remote 路由,此时不注入,避免出现点不开的远端条目。
|
|
@@ -81,6 +111,7 @@ export const peerHostFeature = {
|
|
|
81
111
|
...(context.services.remote === undefined ? {} : { remote: context.services.remote }),
|
|
82
112
|
hooks: transport.hooks,
|
|
83
113
|
matchesScope: transport.matchesScope,
|
|
114
|
+
mergeEvents: transport.mergeEvents,
|
|
84
115
|
decorateLocalResult: (method, result) => method === 'session/list' ? mergeSessionListResult(result, projection) : result,
|
|
85
116
|
});
|
|
86
117
|
if (route !== undefined)
|
|
@@ -93,16 +124,44 @@ export const peerHostFeature = {
|
|
|
93
124
|
});
|
|
94
125
|
if (navigation !== undefined)
|
|
95
126
|
context.resources.add(() => navigation.dispose());
|
|
127
|
+
// 文件路径的平台取自资源所属会话,不能由本机平台或前台选择决定。
|
|
128
|
+
const fileLinks = context.services.uiContext?.inject(['sidebarRight'], (scope) => {
|
|
129
|
+
scope.effect(() => installPeerHostFileLinkRouting(scope, (sessionId) => (projection.sessions().find((session) => session.sessionId === sessionId)?.cwd)) ?? (() => undefined), 'codingns4dsh: PeerHost file links');
|
|
130
|
+
});
|
|
131
|
+
if (fileLinks !== undefined)
|
|
132
|
+
context.resources.add(() => fileLinks.dispose());
|
|
133
|
+
// Desktop 的原生 `$events` 可能早于插件启动;切换一次客户端连接代次,让
|
|
134
|
+
// 已打开的流使用聚合入口。Web 路径从 preboot shim 开始就使用当前入口,
|
|
135
|
+
// 这里重连只会白白触发 DSH 的 session/list 基线刷新。
|
|
136
|
+
if (shim.getMode?.() === 'desktop')
|
|
137
|
+
reconnectNativeEvents(context.services.uiContext);
|
|
96
138
|
}
|
|
97
139
|
const panel = startPeerHostManagementPanel({ rpc: context.services.rpc, locale: context.services.locale });
|
|
98
140
|
context.resources.add(() => panel.dispose());
|
|
99
141
|
// 工作区标签:远端工作区不再把 Host 名写进标题文本,改由彩色标签表达归属。
|
|
100
|
-
|
|
142
|
+
let latestAggregate = [];
|
|
143
|
+
const tag = startPeerHostWorkspaceTag({
|
|
144
|
+
locale: context.services.locale,
|
|
145
|
+
onDismissDisconnectedWorkspace: async (virtualWorkspaceId) => {
|
|
146
|
+
const workspace = parseVirtualWorkspaceId(virtualWorkspaceId);
|
|
147
|
+
if (workspace === null || workspace.targetHostId === null)
|
|
148
|
+
return;
|
|
149
|
+
await management.dismissDisconnectedWorkspace(workspace.targetHostId, workspace.workspaceId);
|
|
150
|
+
// 本地立即隐藏已确认移除的缓存,不等待下一次网络复检完成。
|
|
151
|
+
latestAggregate = latestAggregate.map((host) => host.targetHostId === workspace.targetHostId && host.availability !== 'ready'
|
|
152
|
+
? { ...host, workspaces: host.workspaces.filter((item) => item.workspaceId !== workspace.workspaceId) } : host);
|
|
153
|
+
tag.setAggregate(latestAggregate);
|
|
154
|
+
if (transport?.setAggregate(latestAggregate) === true)
|
|
155
|
+
await refreshPeerHostNativeSessions(context.services.uiContext);
|
|
156
|
+
await polling.refresh({ afterPending: true });
|
|
157
|
+
},
|
|
158
|
+
});
|
|
101
159
|
context.resources.add(() => tag.dispose());
|
|
102
160
|
// 原生"添加工作区"对话框保持主体不变,只额外挂一个"远程 HOST"标签页。
|
|
103
161
|
const workspaceTab = startPeerHostWorkspaceTab({
|
|
104
162
|
api: management,
|
|
105
163
|
onWorkspaceAdded: () => polling.refresh({ afterPending: true }),
|
|
164
|
+
onWorkspaceRemoved: () => polling.refresh({ afterPending: true }),
|
|
106
165
|
locale: context.services.locale,
|
|
107
166
|
});
|
|
108
167
|
context.resources.add(() => workspaceTab.dispose());
|
|
@@ -110,6 +169,7 @@ export const peerHostFeature = {
|
|
|
110
169
|
// 因此聚合变化后触发一次原生列表刷新,由页面 Transport 在 session/list 响应里补齐。
|
|
111
170
|
const refresh = async (signal) => {
|
|
112
171
|
const orderReference = projection.workspaceOrder();
|
|
172
|
+
const sessionMembershipBefore = sessionMembershipKey(projection.sessions());
|
|
113
173
|
try {
|
|
114
174
|
const aggregate = await management.aggregate(signal);
|
|
115
175
|
// Host 端先完成 aggregate 再 hydrate 顺序;按同一顺序读取可避免拿到空的初始 order,
|
|
@@ -126,8 +186,14 @@ export const peerHostFeature = {
|
|
|
126
186
|
// 聚合读取期间如果用户完成了一次拖拽,保留本地刚确认的顺序;本轮只更新
|
|
127
187
|
// 工作区内容,下一轮再从 Host 读取顺序,避免旧的 order 响应覆盖拖拽结果。
|
|
128
188
|
const refreshedOrder = projection.workspaceOrder() === orderReference ? orderedWorkspaceIds : undefined;
|
|
189
|
+
latestAggregate = aggregate;
|
|
129
190
|
tag.setAggregate(aggregate);
|
|
130
|
-
|
|
191
|
+
const projectionChanged = transport === undefined
|
|
192
|
+
? projection.setAggregate(aggregate, refreshedOrder)
|
|
193
|
+
: transport.setAggregate(aggregate, refreshedOrder);
|
|
194
|
+
// 运行态、标题和更新时间都由事件流增量承载;只有会话成员集合增删时
|
|
195
|
+
// 才需要让原生 SessionManager 重新取一次完整 session/list。
|
|
196
|
+
if (projectionChanged && sessionMembershipBefore !== sessionMembershipKey(projection.sessions())) {
|
|
131
197
|
await refreshPeerHostNativeSessions(context.services.uiContext);
|
|
132
198
|
}
|
|
133
199
|
return true;
|
|
@@ -138,8 +204,17 @@ export const peerHostFeature = {
|
|
|
138
204
|
}
|
|
139
205
|
};
|
|
140
206
|
// 首次聚合后台执行,慢远端不能挡住后续模块启动;隐藏页面暂停自动刷新。
|
|
141
|
-
const polling = startSerialPolling(refresh, PEER_HOST_AGGREGATE_REFRESH_MS
|
|
207
|
+
const polling = startSerialPolling(refresh, PEER_HOST_AGGREGATE_REFRESH_MS, {
|
|
208
|
+
// 即使断线缓存被手动隐藏,也继续检查 Host;隐藏页仍暂停轮询。
|
|
209
|
+
getIntervalMs: () => latestAggregate.some((host) => host.targetHostId !== null && host.availability !== 'ready')
|
|
210
|
+
? PEER_HOST_RECOVERY_REFRESH_MS : PEER_HOST_AGGREGATE_REFRESH_MS,
|
|
211
|
+
});
|
|
142
212
|
context.resources.add(() => polling.dispose());
|
|
213
|
+
const online = () => { void polling.refresh({ afterPending: true }); };
|
|
214
|
+
if (typeof window !== 'undefined') {
|
|
215
|
+
window.addEventListener('online', online);
|
|
216
|
+
context.resources.add(() => window.removeEventListener('online', online));
|
|
217
|
+
}
|
|
143
218
|
// 归档入口等原生操作完成后可以立刻请求刷新,而不必等待下一个周期。
|
|
144
219
|
context.resources.add(registerPeerHostAggregateRefresh(() => polling.refresh({ afterPending: true })));
|
|
145
220
|
},
|
|
@@ -148,7 +223,8 @@ export const peerHostFeature = {
|
|
|
148
223
|
/** 将 DSH preboot shim 绑定到当前页面的 Host RPC;不调用 Connection.rpc,避免递归。 */
|
|
149
224
|
export function createPeerHostPageTransport(projection = createPeerHostNativeProjection(), uiContext, locale) {
|
|
150
225
|
const t = resolveCodingNsTranslator(locale);
|
|
151
|
-
const
|
|
226
|
+
const originalGlobalFetch = globalThis.fetch;
|
|
227
|
+
const fetchImpl = typeof originalGlobalFetch === 'function' ? originalGlobalFetch.bind(globalThis) : undefined;
|
|
152
228
|
const scopes = new Map();
|
|
153
229
|
const remoteHostScopes = new Map();
|
|
154
230
|
// DSH 的模型目录是 Host generation 级缓存;PeerHost 工作区切换不会触发 DSH
|
|
@@ -232,6 +308,61 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
232
308
|
failure.code = error.code;
|
|
233
309
|
throw failure;
|
|
234
310
|
};
|
|
311
|
+
const scopeForSessionExport = (url) => {
|
|
312
|
+
const virtualSessionId = url.searchParams.get('sessionId');
|
|
313
|
+
if (virtualSessionId === null)
|
|
314
|
+
return undefined;
|
|
315
|
+
const parsed = parseVirtualSessionId(virtualSessionId);
|
|
316
|
+
if (parsed === null)
|
|
317
|
+
return undefined;
|
|
318
|
+
const scope = scopes.get(virtualSessionId);
|
|
319
|
+
return scope?.targetHostId === parsed.hostId ? scope : undefined;
|
|
320
|
+
};
|
|
321
|
+
const sessionExportPath = (url, scope) => {
|
|
322
|
+
const parsed = parseVirtualSessionId(url.searchParams.get('sessionId') ?? '');
|
|
323
|
+
if (parsed === null || scope.targetHostId !== parsed.hostId)
|
|
324
|
+
throw new Error('远程 Session 导出作用域不匹配');
|
|
325
|
+
const rewritten = new URL(url.href);
|
|
326
|
+
rewritten.searchParams.set('sessionId', parsed.sessionId);
|
|
327
|
+
return rewritten.pathname + rewritten.search;
|
|
328
|
+
};
|
|
329
|
+
const readFetchUrl = (input) => {
|
|
330
|
+
const raw = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
|
|
331
|
+
return new URL(raw, typeof document === 'undefined' ? 'http://codingns.invalid' : document.baseURI);
|
|
332
|
+
};
|
|
333
|
+
const remoteSessionExportFetch = async (input, init) => {
|
|
334
|
+
if (fetchImpl === undefined)
|
|
335
|
+
throw new Error('当前页面没有 fetch');
|
|
336
|
+
const request = typeof Request !== 'undefined' && input instanceof Request ? input : undefined;
|
|
337
|
+
const method = (init?.method ?? request?.method ?? 'GET').toUpperCase();
|
|
338
|
+
const url = readFetchUrl(input);
|
|
339
|
+
if (url.pathname !== '/api/session.export' || (method !== 'GET' && method !== 'HEAD'))
|
|
340
|
+
return fetchImpl(input, init);
|
|
341
|
+
const scope = scopeForSessionExport(url);
|
|
342
|
+
if (scope === undefined || scope.targetHostId === null)
|
|
343
|
+
return fetchImpl(input, init);
|
|
344
|
+
const headers = init?.headers === undefined && request === undefined
|
|
345
|
+
? undefined
|
|
346
|
+
: Object.fromEntries(new Headers(init?.headers ?? request?.headers).entries());
|
|
347
|
+
const response = asRecord(await codingNsCall('peerHost/request', {
|
|
348
|
+
peerHostId: scope.targetHostId,
|
|
349
|
+
scope,
|
|
350
|
+
path: sessionExportPath(url, scope),
|
|
351
|
+
method,
|
|
352
|
+
...(headers === undefined ? {} : { headers }),
|
|
353
|
+
}, init?.signal ?? request?.signal));
|
|
354
|
+
const status = typeof response?.status === 'number' ? response.status : 502;
|
|
355
|
+
const responseHeaders = new Headers(Array.isArray(response?.headers) ? response.headers : undefined);
|
|
356
|
+
// DSH 导出控制器会读取 HEAD 的正文来补充失败原因。浏览器原生 HEAD
|
|
357
|
+
// 响应不会暴露正文,但这里是页面内合成的 Response,保留代理返回的
|
|
358
|
+
// 文本错误可以把目标 Host 的真实鉴权原因传回 UI;成功 HEAD 仍为空正文。
|
|
359
|
+
const body = typeof response?.bodyBase64 === 'string'
|
|
360
|
+
? decodeBase64(response.bodyBase64)
|
|
361
|
+
: typeof response?.body === 'string' ? response.body : '';
|
|
362
|
+
return new Response(body, { status, headers: responseHeaders });
|
|
363
|
+
};
|
|
364
|
+
const restoreGlobalFetch = installSessionExportFetchPatch(originalGlobalFetch, remoteSessionExportFetch);
|
|
365
|
+
const restoreAnchorClick = installSessionExportAnchorPatch(remoteSessionExportFetch, scopeForSessionExport);
|
|
235
366
|
const findScope = (value) => {
|
|
236
367
|
if (typeof value === 'string') {
|
|
237
368
|
const session = scopes.get(value);
|
|
@@ -261,12 +392,41 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
261
392
|
return undefined;
|
|
262
393
|
};
|
|
263
394
|
const scopeForNativeRequest = (method, value) => {
|
|
395
|
+
// 问题答案是任意用户内容,只能由正式 agentId 决定目标,不能扫描答案里的字符串。
|
|
396
|
+
if (method === 'userQuestions/answer' || method === 'userQuestions/attachWait')
|
|
397
|
+
return findScope(questionAgentId(value));
|
|
398
|
+
// 反馈只能由 request.sessionId 决定归属,消息 ID、反馈文字和版本号都不是路由身份。
|
|
399
|
+
if (method.startsWith('messageFeedback/') || method === 'sessionFeedback/record') {
|
|
400
|
+
const input = asRecord(value);
|
|
401
|
+
const request = asRecord(asRecord(input?.args)?.request ?? input?.request);
|
|
402
|
+
return findScope(request?.sessionId);
|
|
403
|
+
}
|
|
264
404
|
const direct = findScope(value);
|
|
265
405
|
if (direct !== undefined)
|
|
266
406
|
return direct;
|
|
267
407
|
return method === 'session/modelCatalog' && !containsResourceId(value) ? navigationScope() : undefined;
|
|
268
408
|
};
|
|
269
409
|
const scopeForPluginRequest = (endpoint, value) => {
|
|
410
|
+
// 设置页明确选择本机时,不能让无会话的目录查询跟随前台远端工作区。
|
|
411
|
+
if ((endpoint === 'cli/catalog' || endpoint === 'cli/models' || endpoint === 'cli/catalog/refresh')
|
|
412
|
+
&& asRecord(value)?.catalogHostId === 'local')
|
|
413
|
+
return undefined;
|
|
414
|
+
if (endpoint.startsWith('fileManagement/')) {
|
|
415
|
+
// 文件内容与路径均不参与路由;显式资源必须属于同一台 Host 的同一工作区。
|
|
416
|
+
const input = asRecord(value);
|
|
417
|
+
const workspace = findScope(input?.workspaceId);
|
|
418
|
+
const session = findScope(input?.sessionId);
|
|
419
|
+
if (hasVirtualResourceScope(value)) {
|
|
420
|
+
if (typeof input?.workspaceId === 'string' && workspace === undefined)
|
|
421
|
+
return undefined;
|
|
422
|
+
if (typeof input?.sessionId === 'string' && session === undefined)
|
|
423
|
+
return undefined;
|
|
424
|
+
if (workspace !== undefined && session !== undefined
|
|
425
|
+
&& (workspace.targetHostId !== session.targetHostId || workspace.workspaceId !== session.workspaceId))
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
return workspace ?? session;
|
|
429
|
+
}
|
|
270
430
|
// 调试只按顶层资源选择 Host,配置正文里的字符串不能影响路由。
|
|
271
431
|
if (isDebugPluginEndpoint(endpoint)) {
|
|
272
432
|
const input = asRecord(value);
|
|
@@ -333,6 +493,27 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
333
493
|
}
|
|
334
494
|
return false;
|
|
335
495
|
};
|
|
496
|
+
/** 判断请求中是否仍携带虚拟资源 ID;作用域丢失时不能把它交给本机 Gateway。 */
|
|
497
|
+
const containsVirtualResourceId = (value) => {
|
|
498
|
+
if (typeof value === 'string')
|
|
499
|
+
return parseVirtualSessionId(value) !== null || parseVirtualWorkspaceId(value) !== null;
|
|
500
|
+
if (Array.isArray(value))
|
|
501
|
+
return value.some(containsVirtualResourceId);
|
|
502
|
+
const record = asRecord(value);
|
|
503
|
+
return record !== null && Object.values(record).some(containsVirtualResourceId);
|
|
504
|
+
};
|
|
505
|
+
const hasUnresolvedVirtualNativeScope = (method, value) => {
|
|
506
|
+
// 问题答案正文允许引用任意会话 ID;唯一的路由身份是 agentId,不能扫描正文。
|
|
507
|
+
if (method === 'userQuestions/answer' || method === 'userQuestions/attachWait')
|
|
508
|
+
return false;
|
|
509
|
+
// 反馈只能由 request.sessionId 决定归属,消息 ID、反馈文字和版本号都不是路由身份。
|
|
510
|
+
if (method.startsWith('messageFeedback/') || method === 'sessionFeedback/record') {
|
|
511
|
+
const input = asRecord(value);
|
|
512
|
+
const request = asRecord(asRecord(input?.args)?.request ?? input?.request);
|
|
513
|
+
return typeof request?.sessionId === 'string' && parseVirtualSessionId(request.sessionId) !== null;
|
|
514
|
+
}
|
|
515
|
+
return containsVirtualResourceId(value);
|
|
516
|
+
};
|
|
336
517
|
const rewriteCliPayload = (value, scope, key = '') => {
|
|
337
518
|
if (typeof value === 'string') {
|
|
338
519
|
const parsed = parseVirtualSessionId(value);
|
|
@@ -356,7 +537,7 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
356
537
|
method: 'POST',
|
|
357
538
|
body: JSON.stringify({ rpcId: createRequestId(), method: endpoint, payload: endpoint.startsWith('git/')
|
|
358
539
|
? { ...asRecord(payload), workspaceId: scope.workspaceId }
|
|
359
|
-
: endpoint.startsWith('cli/') ? rewriteCliPayload(payload, scope) :
|
|
540
|
+
: endpoint.startsWith('cli/') ? rewriteCliPayload(payload, scope) : rewritePluginResourcePayload(payload, scope) }),
|
|
360
541
|
}, signal));
|
|
361
542
|
const status = typeof response?.status === 'number' ? response.status : 500;
|
|
362
543
|
const body = typeof response?.body === 'string' ? response.body : '';
|
|
@@ -422,9 +603,23 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
422
603
|
signal?.throwIfAborted();
|
|
423
604
|
}
|
|
424
605
|
finally {
|
|
425
|
-
await codingNsCall('peerHost/nativeStreamClose', { streamId, scope }).catch(() => undefined);
|
|
606
|
+
await codingNsCall('peerHost/nativeStreamClose', { streamId, scope }, AbortSignal.timeout(5_000)).catch(() => undefined);
|
|
426
607
|
}
|
|
427
608
|
})();
|
|
609
|
+
// DSH 自己会在每个 Connection 代次完成时刷新一次真实 session/list;PeerHost
|
|
610
|
+
// 只需在首次事件流握手成功后补一次虚拟会话基线,后续增量由事件流和聚合变化驱动。
|
|
611
|
+
let nativeSessionPrepared = false;
|
|
612
|
+
const events = new PeerHostRemoteEvents({
|
|
613
|
+
open: (scope, signal) => openRemoteStream('$events', { args: {} }, scope, signal),
|
|
614
|
+
reply: (scope, payload, signal) => codingNsCall('peerHost/native', { method: '$events/result', payload, scope }, signal),
|
|
615
|
+
accepts: (agentId, scope) => scopes.get(agentId)?.targetHostId === scope.targetHostId,
|
|
616
|
+
prepare: async () => {
|
|
617
|
+
if (nativeSessionPrepared)
|
|
618
|
+
return;
|
|
619
|
+
nativeSessionPrepared = true;
|
|
620
|
+
await refreshPeerHostNativeSessions(uiContext);
|
|
621
|
+
},
|
|
622
|
+
});
|
|
428
623
|
const pendingSessionScopes = new Map();
|
|
429
624
|
const forgetPendingSession = (sessionId) => {
|
|
430
625
|
const pending = pendingSessionScopes.get(sessionId);
|
|
@@ -464,17 +659,40 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
464
659
|
scopes.set(sessionId, created);
|
|
465
660
|
refreshModelCatalogForScope(navigationScope());
|
|
466
661
|
};
|
|
662
|
+
/** 父会话目录早于聚合到达时,复用新建会话的临时作用域与清理机制。 */
|
|
663
|
+
const rememberSubagentCatalog = (scope, value) => {
|
|
664
|
+
const catalog = asRecord(asRecord(asRecord(value)?.projections)?.values)?.subagentCatalog;
|
|
665
|
+
if (!Array.isArray(catalog))
|
|
666
|
+
return;
|
|
667
|
+
for (const child of catalog) {
|
|
668
|
+
const id = asRecord(child)?.id;
|
|
669
|
+
if (typeof id === 'string' && !scopes.has(id))
|
|
670
|
+
rememberCreatedSession(scope, { sessionId: id });
|
|
671
|
+
}
|
|
672
|
+
};
|
|
467
673
|
const hooks = {
|
|
468
674
|
rpc: async ({ method, payload, signal }) => {
|
|
469
675
|
const value = asRecord(payload);
|
|
470
676
|
const channel = typeof value?.channel === 'string' ? value.channel : '/codingns';
|
|
471
677
|
const body = value?.payload;
|
|
678
|
+
if (channel === '/api' && method === '$events/result' && events.ownsResult(body)) {
|
|
679
|
+
try {
|
|
680
|
+
return { ok: true, value: await events.reply(body, signal) };
|
|
681
|
+
}
|
|
682
|
+
catch (error) {
|
|
683
|
+
const code = error.code;
|
|
684
|
+
return { ok: false, error: { code: typeof code === 'string' ? code : 'gateway/internal', message: error instanceof Error ? error.message : String(error) } };
|
|
685
|
+
}
|
|
686
|
+
}
|
|
472
687
|
const endpoint = peerHostPluginEndpoint(channel, method);
|
|
473
688
|
if (endpoint === 'cli/session/adapter-map') {
|
|
474
689
|
return await mergeRemoteAdapterMap(await request(channel, method, body, signal), signal);
|
|
475
690
|
}
|
|
476
691
|
if (endpoint !== undefined) {
|
|
477
|
-
if (
|
|
692
|
+
if (endpoint.startsWith('fileManagement/') && hasVirtualResourceScope(body) && scopeForPluginRequest(endpoint, body) === undefined) {
|
|
693
|
+
return { ok: false, error: { code: 'PEER_HOST_SCOPE_MISMATCH', message: t('peerHost.fileWorkspaceUnavailable') } };
|
|
694
|
+
}
|
|
695
|
+
if (isDebugPluginEndpoint(endpoint) && hasVirtualResourceScope(body) && scopeForPluginRequest(endpoint, body) === undefined) {
|
|
478
696
|
return { ok: false, error: { code: 'PEER_HOST_SCOPE_MISMATCH', message: t('peerHost.debugWorkspaceUnavailable') } };
|
|
479
697
|
}
|
|
480
698
|
// Git 只由顶层 workspaceId 决定归属,文件名和提交正文不能参与 Host 选择。
|
|
@@ -494,6 +712,12 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
494
712
|
}
|
|
495
713
|
if (channel === '/api' && isDshNativeRemoteMethod(method)) {
|
|
496
714
|
const scope = scopeForNativeRequest(method, body);
|
|
715
|
+
if (scope === undefined && hasVirtualQuestionAgent(method, body)) {
|
|
716
|
+
return { ok: false, error: { code: 'PEER_HOST_SCOPE_MISMATCH', message: t('peerHost.questionSessionUnavailable') } };
|
|
717
|
+
}
|
|
718
|
+
if (scope === undefined && hasUnresolvedVirtualNativeScope(method, body)) {
|
|
719
|
+
return { ok: false, error: { code: 'PEER_HOST_SCOPE_MISMATCH', message: t('peerHost.sessionUnavailable') } };
|
|
720
|
+
}
|
|
497
721
|
if (scope !== undefined && scope.targetHostId !== null) {
|
|
498
722
|
// DSH 的 client 契约要求 unary 结果是 `{ok, value}` / `{ok:false, error}` 信封:
|
|
499
723
|
// 返回裸值会让网关在 `rebuiltFailure(result.error)` 读 undefined.code 而崩成 carrierFailure。
|
|
@@ -527,8 +751,18 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
527
751
|
const value = asRecord(payload);
|
|
528
752
|
const channel = typeof value?.channel === 'string' ? value.channel : '/api';
|
|
529
753
|
const body = value?.payload;
|
|
754
|
+
if (channel === '/api' && method === '$events') {
|
|
755
|
+
return events.open(localSignal => openDshGatewayStream(method, body, localSignal), signal);
|
|
756
|
+
}
|
|
530
757
|
if (channel === '/api' && isDshNativeRemoteMethod(method)) {
|
|
531
758
|
const scope = scopeForNativeRequest(method, body);
|
|
759
|
+
if (scope === undefined && hasVirtualQuestionAgent(method, body))
|
|
760
|
+
throw new Error('远端问题所属会话不可用,请重新连接');
|
|
761
|
+
if (scope === undefined && hasUnresolvedVirtualNativeScope(method, body)) {
|
|
762
|
+
const error = new Error(t('peerHost.sessionUnavailable'));
|
|
763
|
+
error.code = 'PEER_HOST_SCOPE_MISMATCH';
|
|
764
|
+
throw error;
|
|
765
|
+
}
|
|
532
766
|
if (scope !== undefined && scope.targetHostId !== null) {
|
|
533
767
|
const stream = openRemoteStream(method, body, scope, signal);
|
|
534
768
|
if (method !== 'session/follow')
|
|
@@ -540,6 +774,9 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
540
774
|
try {
|
|
541
775
|
for await (const chunk of stream) {
|
|
542
776
|
emitted = true;
|
|
777
|
+
// 父会话先公布子会话目录,聚合稍后才补基线。立即登记已验证的虚拟 ID,
|
|
778
|
+
// 避免用户在这段窗口打开子会话时把 CLI 配置读到本机并缓存成 dsh。
|
|
779
|
+
rememberSubagentCatalog(scope, chunk);
|
|
543
780
|
scheduleAggregateRefresh();
|
|
544
781
|
yield chunk;
|
|
545
782
|
}
|
|
@@ -552,27 +789,43 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
552
789
|
})();
|
|
553
790
|
}
|
|
554
791
|
}
|
|
555
|
-
//
|
|
792
|
+
// 其余本机流必须回到 DSH Gateway:本地 baseline 不能
|
|
556
793
|
// 走 PeerHost,否则原生 workspace/session Store 会整体停在 loading。
|
|
557
794
|
if (channel !== '/api')
|
|
558
795
|
throw new Error('CODINGNS_BASELINE_STREAM');
|
|
559
796
|
return openDshGatewayStream(method, body, signal);
|
|
560
797
|
},
|
|
561
798
|
fetch: (input, init) => {
|
|
562
|
-
|
|
563
|
-
return Promise.reject(new Error('当前页面没有 fetch'));
|
|
564
|
-
return fetchImpl(input, init);
|
|
799
|
+
return remoteSessionExportFetch(input, init);
|
|
565
800
|
},
|
|
566
801
|
};
|
|
567
802
|
return {
|
|
568
803
|
hooks,
|
|
804
|
+
mergeEvents: (local, signal) => events.open(local, signal),
|
|
805
|
+
dispose() {
|
|
806
|
+
events.dispose();
|
|
807
|
+
restoreAnchorClick();
|
|
808
|
+
restoreGlobalFetch();
|
|
809
|
+
if (aggregateRefreshTimer !== undefined)
|
|
810
|
+
clearTimeout(aggregateRefreshTimer);
|
|
811
|
+
for (const sessionId of pendingSessionScopes.keys())
|
|
812
|
+
forgetPendingSession(sessionId);
|
|
813
|
+
},
|
|
569
814
|
/** 该请求是否落在某个远端 Host 的作用域内;Desktop 连接路由用它决定是否分流。 */
|
|
570
815
|
matchesScope(value, method) {
|
|
816
|
+
if (method === '$events/result')
|
|
817
|
+
return events.ownsResult(value);
|
|
818
|
+
if (hasVirtualQuestionAgent(method ?? '', value))
|
|
819
|
+
return true;
|
|
571
820
|
const endpoint = method?.replace(/^codingns\//u, '') ?? '';
|
|
821
|
+
if (endpoint.startsWith('fileManagement/')) {
|
|
822
|
+
const scope = scopeForPluginRequest(endpoint, value);
|
|
823
|
+
return scope === undefined ? hasVirtualResourceScope(value) : scope.targetHostId !== null;
|
|
824
|
+
}
|
|
572
825
|
if (isDebugPluginEndpoint(endpoint)) {
|
|
573
826
|
const scope = scopeForPluginRequest(endpoint, value);
|
|
574
827
|
// 聚合暂时缺失时仍接管虚拟资源,返回明确错误,禁止回落本机调试服务。
|
|
575
|
-
return scope === undefined ?
|
|
828
|
+
return scope === undefined ? hasVirtualResourceScope(value) : scope.targetHostId !== null;
|
|
576
829
|
}
|
|
577
830
|
if (method?.startsWith('git/') || method?.startsWith('codingns/git/')) {
|
|
578
831
|
const workspaceId = asRecord(value)?.workspaceId;
|
|
@@ -587,7 +840,11 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
587
840
|
const scope = cli === undefined
|
|
588
841
|
? scopeForNativeRequest(method ?? '', value)
|
|
589
842
|
: scopeForPluginRequest(cli, value);
|
|
590
|
-
|
|
843
|
+
if (scope !== undefined)
|
|
844
|
+
return scope.targetHostId !== null;
|
|
845
|
+
// 只有原生 Remote 方法会在 hooks 里明确报错、拒绝回落本机;CLI 等插件端点
|
|
846
|
+
// 没有这层守卫,作用域丢失时必须交还本机,不能假装接管后静默落到本机。
|
|
847
|
+
return isDshNativeRemoteMethod(method ?? '') && hasUnresolvedVirtualNativeScope(method ?? '', value);
|
|
591
848
|
},
|
|
592
849
|
watchNavigation() {
|
|
593
850
|
const store = readNativeNavigationStore(uiContext);
|
|
@@ -597,8 +854,11 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
597
854
|
return stop ?? (() => undefined);
|
|
598
855
|
},
|
|
599
856
|
setAggregate(aggregate, orderedWorkspaceIds) {
|
|
857
|
+
const previousScopes = new Map(scopes);
|
|
858
|
+
const now = Date.now();
|
|
600
859
|
scopes.clear();
|
|
601
860
|
remoteHostScopes.clear();
|
|
861
|
+
const visibleWorkspaceIds = new Set();
|
|
602
862
|
for (const host of aggregate) {
|
|
603
863
|
if (host.targetHostId !== null) {
|
|
604
864
|
remoteHostScopes.set(host.targetHostId, { hostId: host.hostId, targetHostId: host.targetHostId, workspaceId: '__aggregate__', sessionId: null, scopeGeneration: 0 });
|
|
@@ -606,19 +866,31 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
606
866
|
for (const workspace of host.workspaces) {
|
|
607
867
|
const virtualHostId = host.targetHostId ?? host.hostId;
|
|
608
868
|
const virtualWorkspaceId = createVirtualWorkspaceId(virtualHostId, workspace.workspaceId);
|
|
869
|
+
visibleWorkspaceIds.add(virtualWorkspaceId);
|
|
609
870
|
const workspaceScope = { hostId: host.hostId, targetHostId: host.targetHostId, workspaceId: workspace.workspaceId, sessionId: null, scopeGeneration: 0 };
|
|
610
871
|
scopes.set(virtualWorkspaceId, workspaceScope);
|
|
611
872
|
// 归档会话也要能解析作用域:取消归档请求按虚拟会话 ID 路由到目标 Host。
|
|
612
|
-
for (const session of [...workspace.sessions, ...(workspace.archivedSessions ?? [])]) {
|
|
873
|
+
for (const session of [...workspace.sessions, ...(workspace.archivedSessions ?? []), ...(workspace.subagentSessions ?? [])]) {
|
|
613
874
|
if (session.scope.sessionId === null)
|
|
614
875
|
continue;
|
|
615
876
|
scopes.set(createVirtualSessionId(virtualHostId, session.scope.sessionId), { ...workspaceScope, sessionId: session.scope.sessionId });
|
|
616
877
|
}
|
|
617
878
|
}
|
|
618
879
|
}
|
|
880
|
+
// 聚合刷新可能暂时漏掉会话元数据,但只要工作区仍存在,当前页面的远端会话
|
|
881
|
+
// 就不能立即改走本机 Gateway。真实删除会在目标 Host 返回明确的 not-found。
|
|
882
|
+
for (const [sessionId, scope] of previousScopes) {
|
|
883
|
+
if (scope.targetHostId === null || scope.sessionId === null || scopes.has(sessionId))
|
|
884
|
+
continue;
|
|
885
|
+
const pending = pendingSessionScopes.get(sessionId);
|
|
886
|
+
if (pending !== undefined && pending.expiresAt <= now)
|
|
887
|
+
continue;
|
|
888
|
+
if (visibleWorkspaceIds.has(createVirtualWorkspaceId(scope.targetHostId, scope.workspaceId)))
|
|
889
|
+
scopes.set(sessionId, scope);
|
|
890
|
+
}
|
|
619
891
|
// 刚创建、尚未进入聚合的会话要保住作用域;聚合里已存在的以聚合为准。
|
|
620
|
-
//
|
|
621
|
-
|
|
892
|
+
// 聚合确认后清掉 pending 记录;会话摘要暂缺时由上面的最后确认作用域接管,
|
|
893
|
+
// 直到工作区消失。目标 Host 的会话错误仍保持在 PeerHost 边界内,不回落本机。
|
|
622
894
|
for (const [sessionId, pending] of [...pendingSessionScopes]) {
|
|
623
895
|
if (scopes.has(sessionId)) {
|
|
624
896
|
forgetPendingSession(sessionId);
|
|
@@ -631,7 +903,10 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
631
903
|
scopes.set(sessionId, pending.scope);
|
|
632
904
|
}
|
|
633
905
|
refreshModelCatalogForScope(navigationScope());
|
|
634
|
-
|
|
906
|
+
const changed = projection.setAggregate(aggregate, orderedWorkspaceIds);
|
|
907
|
+
const readyHosts = new Set(aggregate.filter(host => host.availability === 'ready' && host.workspaces.length > 0).map(host => host.targetHostId));
|
|
908
|
+
events.setPeers([...remoteHostScopes.values()].filter(scope => readyHosts.has(scope.targetHostId)));
|
|
909
|
+
return changed;
|
|
635
910
|
},
|
|
636
911
|
};
|
|
637
912
|
}
|
|
@@ -639,12 +914,22 @@ export function createPeerHostPageTransport(projection = createPeerHostNativePro
|
|
|
639
914
|
function peerHostPluginEndpoint(channel, method) {
|
|
640
915
|
const endpoint = channel === '/codingns' ? method
|
|
641
916
|
: channel === '/api' && method.startsWith('codingns/') ? method.slice('codingns/'.length) : '';
|
|
642
|
-
return endpoint.startsWith('cli/') || endpoint.startsWith('git/') || endpoint.startsWith('debug/') || endpoint === 'terminal/status' ? endpoint : undefined;
|
|
917
|
+
return endpoint.startsWith('cli/') || endpoint.startsWith('git/') || endpoint.startsWith('debug/') || endpoint.startsWith('fileManagement/') || endpoint === 'terminal/status' ? endpoint : undefined;
|
|
918
|
+
}
|
|
919
|
+
function questionAgentId(value) {
|
|
920
|
+
const input = asRecord(value);
|
|
921
|
+
return asRecord(input?.args)?.agentId ?? input?.agentId;
|
|
922
|
+
}
|
|
923
|
+
function hasVirtualQuestionAgent(method, value) {
|
|
924
|
+
if (method !== 'userQuestions/answer' && method !== 'userQuestions/attachWait')
|
|
925
|
+
return false;
|
|
926
|
+
const id = questionAgentId(value);
|
|
927
|
+
return typeof id === 'string' && parseVirtualSessionId(id) !== null;
|
|
643
928
|
}
|
|
644
929
|
function isDebugPluginEndpoint(endpoint) {
|
|
645
930
|
return endpoint.startsWith('debug/') || endpoint === 'terminal/status';
|
|
646
931
|
}
|
|
647
|
-
function
|
|
932
|
+
function hasVirtualResourceScope(value) {
|
|
648
933
|
const input = asRecord(value);
|
|
649
934
|
return (typeof input?.workspaceId === 'string' && parseVirtualWorkspaceId(input.workspaceId) !== null)
|
|
650
935
|
|| (typeof input?.sessionId === 'string' && parseVirtualSessionId(input.sessionId) !== null);
|
|
@@ -661,8 +946,8 @@ function projectGitWorkspaceIds(value, workspaceId, virtualWorkspaceId) {
|
|
|
661
946
|
key === 'workspaceId' && child === workspaceId ? virtualWorkspaceId : projectGitWorkspaceIds(child, workspaceId, virtualWorkspaceId),
|
|
662
947
|
]));
|
|
663
948
|
}
|
|
664
|
-
/**
|
|
665
|
-
function
|
|
949
|
+
/** 只还原调试与文件请求的顶层资源标识,配置、文件正文和路径必须原样保存。 */
|
|
950
|
+
function rewritePluginResourcePayload(value, scope) {
|
|
666
951
|
const input = asRecord(value);
|
|
667
952
|
if (input === null)
|
|
668
953
|
return value;
|
|
@@ -670,7 +955,7 @@ function rewriteDebugPayload(value, scope) {
|
|
|
670
955
|
const workspace = typeof input.workspaceId === 'string' ? parseVirtualWorkspaceId(input.workspaceId) : null;
|
|
671
956
|
if (workspace !== null) {
|
|
672
957
|
if (workspace.hostId !== scope.targetHostId || workspace.workspaceId !== scope.workspaceId)
|
|
673
|
-
throw new Error('
|
|
958
|
+
throw new Error('请求的 Workspace 与目标 Host 作用域不一致');
|
|
674
959
|
result.workspaceId = workspace.workspaceId;
|
|
675
960
|
}
|
|
676
961
|
for (const key of ['sessionId', 'dshSessionId']) {
|
|
@@ -678,7 +963,7 @@ function rewriteDebugPayload(value, scope) {
|
|
|
678
963
|
if (session === null)
|
|
679
964
|
continue;
|
|
680
965
|
if (session.hostId !== scope.targetHostId)
|
|
681
|
-
throw new Error('
|
|
966
|
+
throw new Error('请求的 Session 与目标 Host 作用域不一致');
|
|
682
967
|
result[key] = session.sessionId;
|
|
683
968
|
}
|
|
684
969
|
return result;
|
|
@@ -725,6 +1010,9 @@ export function installPeerHostConnectionRouting(options) {
|
|
|
725
1010
|
// RemoteStreamMuxClient),因此 uplink 与重连行为都不受影响;也不要动
|
|
726
1011
|
// `connection.rpc.open`,否则网关会认为本页自带流通道而不再启动/重连 mux。
|
|
727
1012
|
const patchedOpenRemoteStream = (endpoint, payload, signal, uplink, noConnection) => {
|
|
1013
|
+
if (endpoint === '$events' && options.mergeEvents !== undefined) {
|
|
1014
|
+
return options.mergeEvents(localSignal => originalCallRemote.call(remote, endpoint, payload, localSignal, uplink, noConnection), signal);
|
|
1015
|
+
}
|
|
728
1016
|
if (typeof options.hooks.openStream === 'function' && isPeerScoped('/api', endpoint, payload)) {
|
|
729
1017
|
return options.hooks.openStream({ method: endpoint, payload: { channel: '/api', payload, uplink }, ...(signal === undefined ? {} : { signal }) });
|
|
730
1018
|
}
|
|
@@ -762,6 +1050,14 @@ function readConnectionHandle(uiContext) {
|
|
|
762
1050
|
return undefined;
|
|
763
1051
|
}
|
|
764
1052
|
}
|
|
1053
|
+
/** 只更新浏览器内的事件订阅代次,不重启 Host 或任何运行实例。 */
|
|
1054
|
+
function reconnectNativeEvents(uiContext) {
|
|
1055
|
+
try {
|
|
1056
|
+
const connection = uiContext?.get('connection');
|
|
1057
|
+
connection?.reconnect?.();
|
|
1058
|
+
}
|
|
1059
|
+
catch { /* 原生连接尚未挂载时,首次连接会直接使用新的入口。 */ }
|
|
1060
|
+
}
|
|
765
1061
|
/** 只借用原生导航数据,不修改选择策略,也不从后台保留会话推断前台。 */
|
|
766
1062
|
function readNativeNavigationStore(uiContext) {
|
|
767
1063
|
try {
|
|
@@ -908,10 +1204,15 @@ function refreshDshModelCatalog(uiContext) {
|
|
|
908
1204
|
// 模型选择插件未挂载或 DSH 版本没有该内部服务时,不影响远程请求本身。
|
|
909
1205
|
}
|
|
910
1206
|
}
|
|
1207
|
+
/** 只比较会话成员集合,避免把每个状态增量放大成完整列表请求。 */
|
|
1208
|
+
function sessionMembershipKey(sessions) {
|
|
1209
|
+
return sessions.map((session) => session.sessionId).join('\u0000');
|
|
1210
|
+
}
|
|
911
1211
|
/** 打开当前页面 DSH Gateway 的单个 Remote 流;协议与 dsh-api-gateway 保持一致。 */
|
|
912
1212
|
function openDshGatewayStream(endpoint, payload, signal) {
|
|
913
1213
|
const streamId = `codingns_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
914
1214
|
return (async function* () {
|
|
1215
|
+
signal?.throwIfAborted();
|
|
915
1216
|
const WebSocketCtor = globalThis.WebSocket;
|
|
916
1217
|
if (typeof WebSocketCtor !== 'function')
|
|
917
1218
|
throw new Error('当前页面没有可用 WebSocket');
|
|
@@ -947,16 +1248,29 @@ function openDshGatewayStream(endpoint, payload, signal) {
|
|
|
947
1248
|
}
|
|
948
1249
|
};
|
|
949
1250
|
const onError = () => { failure = new Error('DSH Remote stream WebSocket 失败'); notify(); };
|
|
950
|
-
const onAbort = () => { failure = signal?.reason instanceof Error ? signal.reason : new Error('DSH Remote stream 已取消'); notify(); };
|
|
1251
|
+
const onAbort = () => { failure = signal?.reason instanceof Error ? signal.reason : new Error('DSH Remote stream 已取消'); notify(); socket.close(1000, 'stream aborted'); };
|
|
1252
|
+
const onClose = () => { if (!ended)
|
|
1253
|
+
failure ??= new Error('DSH Remote stream WebSocket 已关闭'); notify(); };
|
|
951
1254
|
socket.addEventListener('message', onMessage);
|
|
952
1255
|
socket.addEventListener('error', onError);
|
|
1256
|
+
socket.addEventListener('close', onClose);
|
|
953
1257
|
signal?.addEventListener('abort', onAbort, { once: true });
|
|
954
1258
|
try {
|
|
955
1259
|
await new Promise((resolve, reject) => {
|
|
956
|
-
const
|
|
957
|
-
|
|
1260
|
+
const cleanup = () => {
|
|
1261
|
+
socket.removeEventListener('open', opened);
|
|
1262
|
+
socket.removeEventListener('error', failed);
|
|
1263
|
+
socket.removeEventListener('close', failed);
|
|
1264
|
+
signal?.removeEventListener('abort', failed);
|
|
1265
|
+
};
|
|
1266
|
+
const opened = () => { cleanup(); resolve(); };
|
|
1267
|
+
const failed = () => { cleanup(); reject(failure ?? new Error('DSH Remote stream WebSocket 打开失败')); };
|
|
958
1268
|
socket.addEventListener('open', opened, { once: true });
|
|
959
1269
|
socket.addEventListener('error', failed, { once: true });
|
|
1270
|
+
socket.addEventListener('close', failed, { once: true });
|
|
1271
|
+
signal?.addEventListener('abort', failed, { once: true });
|
|
1272
|
+
if (signal?.aborted)
|
|
1273
|
+
failed();
|
|
960
1274
|
});
|
|
961
1275
|
signal?.throwIfAborted();
|
|
962
1276
|
socket.send(JSON.stringify({ type: 'open', streamId, endpoint, payload }));
|
|
@@ -976,6 +1290,9 @@ function openDshGatewayStream(endpoint, payload, signal) {
|
|
|
976
1290
|
}
|
|
977
1291
|
finally {
|
|
978
1292
|
signal?.removeEventListener('abort', onAbort);
|
|
1293
|
+
socket.removeEventListener('message', onMessage);
|
|
1294
|
+
socket.removeEventListener('error', onError);
|
|
1295
|
+
socket.removeEventListener('close', onClose);
|
|
979
1296
|
socket.close(1000, 'stream closed');
|
|
980
1297
|
}
|
|
981
1298
|
})();
|
|
@@ -991,6 +1308,75 @@ function isDesktopTopologyPage() {
|
|
|
991
1308
|
return false;
|
|
992
1309
|
}
|
|
993
1310
|
}
|
|
1311
|
+
/** 导出插件直接使用全局 fetch;把远程虚拟 Session 的预检请求接入页面 Transport。 */
|
|
1312
|
+
function installSessionExportFetchPatch(original, routed) {
|
|
1313
|
+
if (original === undefined || typeof window === 'undefined')
|
|
1314
|
+
return () => undefined;
|
|
1315
|
+
const wrapped = ((input, init) => routed(input, init));
|
|
1316
|
+
try {
|
|
1317
|
+
globalThis.fetch = wrapped;
|
|
1318
|
+
}
|
|
1319
|
+
catch {
|
|
1320
|
+
return () => undefined;
|
|
1321
|
+
}
|
|
1322
|
+
return () => {
|
|
1323
|
+
if (globalThis.fetch === wrapped)
|
|
1324
|
+
globalThis.fetch = original;
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
/** 导出插件的 GET 使用原生锚点导航;远程 ZIP 必须先经代理取回 Blob 再触发下载。 */
|
|
1328
|
+
function installSessionExportAnchorPatch(fetcher, findScope) {
|
|
1329
|
+
if (typeof window === 'undefined' || typeof document === 'undefined')
|
|
1330
|
+
return () => undefined;
|
|
1331
|
+
const prototype = globalThis.HTMLAnchorElement?.prototype;
|
|
1332
|
+
const originalClick = prototype?.click;
|
|
1333
|
+
if (prototype === undefined || originalClick === undefined)
|
|
1334
|
+
return () => undefined;
|
|
1335
|
+
const patchedClick = function () {
|
|
1336
|
+
let url;
|
|
1337
|
+
try {
|
|
1338
|
+
url = new URL(this.href, document.baseURI);
|
|
1339
|
+
}
|
|
1340
|
+
catch {
|
|
1341
|
+
originalClick.call(this);
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
if (url.pathname !== '/api/session.export' || findScope(url) === undefined) {
|
|
1345
|
+
originalClick.call(this);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
const filename = this.download;
|
|
1349
|
+
void fetcher(url, { method: 'GET' }).then(async (response) => {
|
|
1350
|
+
if (!response.ok)
|
|
1351
|
+
return;
|
|
1352
|
+
const blobUrl = URL.createObjectURL(await response.blob());
|
|
1353
|
+
const download = document.createElement('a');
|
|
1354
|
+
download.href = blobUrl;
|
|
1355
|
+
download.download = filename;
|
|
1356
|
+
originalClick.call(download);
|
|
1357
|
+
setTimeout(() => URL.revokeObjectURL(blobUrl), 0);
|
|
1358
|
+
}).catch(() => undefined);
|
|
1359
|
+
};
|
|
1360
|
+
try {
|
|
1361
|
+
prototype.click = patchedClick;
|
|
1362
|
+
}
|
|
1363
|
+
catch {
|
|
1364
|
+
return () => undefined;
|
|
1365
|
+
}
|
|
1366
|
+
return () => {
|
|
1367
|
+
if (prototype.click === patchedClick)
|
|
1368
|
+
prototype.click = originalClick;
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
function decodeBase64(value) {
|
|
1372
|
+
if (typeof atob !== 'function')
|
|
1373
|
+
throw new Error('当前页面不支持 Base64 解码');
|
|
1374
|
+
const binary = atob(value);
|
|
1375
|
+
const bytes = new Uint8Array(binary.length);
|
|
1376
|
+
for (let index = 0; index < binary.length; index += 1)
|
|
1377
|
+
bytes[index] = binary.charCodeAt(index);
|
|
1378
|
+
return bytes.buffer;
|
|
1379
|
+
}
|
|
994
1380
|
/** PeerHost 启用状态说明;安装动作发生在启动页 preboot 阶段。 */
|
|
995
1381
|
function PeerHostPanel({ services, enabled }) {
|
|
996
1382
|
const t = useCodingNsTranslator(services.locale);
|