@jingyi0605/codingns4dsh 0.2.1-beta.9 → 0.2.1-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 +10 -6
- package/README.md +12 -9
- package/assets/provider-icons/magpie.png +0 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.js +24 -70
- package/data/build/dist/client/account-bar.js.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.d.ts +10 -2
- package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.js +16 -4
- package/data/build/dist/client/adapter-catalog-watch.js.map +1 -1
- package/data/build/dist/client/bundle.js +55627 -31591
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
- package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-dialog.js +215 -0
- package/data/build/dist/client/cli-management-dialog.js.map +1 -0
- package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
- package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-terminal.js +30 -0
- package/data/build/dist/client/cli-management-terminal.js.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.js +45 -0
- package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.js +1 -1
- package/data/build/dist/client/cli-settings-rpc.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts +17 -3
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +300 -41
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +4 -3
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/client.delegate-command.js +44 -26
- package/data/build/dist/client/client.delegate-command.js.map +1 -1
- package/data/build/dist/client/client.editor-engine.js +4 -1
- package/data/build/dist/client/client.editor-engine.js.map +1 -1
- package/data/build/dist/client/{client.model-catalog-cache.js → client.magpie-model-tag.js} +393 -14
- package/data/build/dist/client/client.magpie-model-tag.js.map +1 -0
- package/data/build/dist/client/client.moss-voice-output.js +415 -0
- package/data/build/dist/client/client.moss-voice-output.js.map +1 -0
- package/data/build/dist/client/client.native-workspace-store.js +91 -15
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js +128 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.react-dom.js +0 -404
- package/data/build/dist/client/client.react-dom.js.map +1 -1
- package/data/build/dist/client/client.session-translation.js +121 -2
- package/data/build/dist/client/client.session-translation.js.map +1 -1
- package/data/build/dist/client/client.transport.js +1415 -57
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.js +54 -0
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
- package/data/build/dist/client/delegate-command.d.ts.map +1 -1
- package/data/build/dist/client/delegate-command.js +36 -7
- package/data/build/dist/client/delegate-command.js.map +1 -1
- package/data/build/dist/client/desktop-assistant.js +1948 -494
- package/data/build/dist/client/editor-engine.d.ts +1 -1
- package/data/build/dist/client/editor-engine.d.ts.map +1 -1
- package/data/build/dist/client/editor-engine.js +4 -1
- package/data/build/dist/client/editor-engine.js.map +1 -1
- package/data/build/dist/client/feature-requirement.d.ts +43 -0
- package/data/build/dist/client/feature-requirement.d.ts.map +1 -0
- package/data/build/dist/client/feature-requirement.js +105 -0
- package/data/build/dist/client/feature-requirement.js.map +1 -0
- package/data/build/dist/client/features/cli-adapters.d.ts +3 -1
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +207 -112
- package/data/build/dist/client/features/cli-adapters.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 +18 -0
- package/data/build/dist/client/features/file-management.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 +5 -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 +1 -0
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
- package/data/build/dist/client/features/magpie-management-controls.d.ts +46 -0
- package/data/build/dist/client/features/magpie-management-controls.d.ts.map +1 -0
- package/data/build/dist/client/features/magpie-management-controls.js +759 -0
- package/data/build/dist/client/features/magpie-management-controls.js.map +1 -0
- package/data/build/dist/client/features/magpie-management-page.d.ts +124 -0
- package/data/build/dist/client/features/magpie-management-page.d.ts.map +1 -0
- package/data/build/dist/client/features/magpie-management-page.js +1256 -0
- package/data/build/dist/client/features/magpie-management-page.js.map +1 -0
- package/data/build/dist/client/features/magpie-management.d.ts +7 -0
- package/data/build/dist/client/features/magpie-management.d.ts.map +1 -0
- package/data/build/dist/client/features/magpie-management.js +154 -0
- package/data/build/dist/client/features/magpie-management.js.map +1 -0
- package/data/build/dist/client/features/magpie-mark.d.ts +10 -0
- package/data/build/dist/client/features/magpie-mark.d.ts.map +1 -0
- package/data/build/dist/client/features/magpie-mark.js +21 -0
- package/data/build/dist/client/features/magpie-mark.js.map +1 -0
- package/data/build/dist/client/features/magpie-provider-logo.d.ts +11 -0
- package/data/build/dist/client/features/magpie-provider-logo.d.ts.map +1 -0
- package/data/build/dist/client/features/magpie-provider-logo.js +35 -0
- package/data/build/dist/client/features/magpie-provider-logo.js.map +1 -0
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access.js +7 -0
- package/data/build/dist/client/features/mobile-access.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +6 -0
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/quick-apps.d.ts +3 -0
- package/data/build/dist/client/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/client/features/quick-apps.js +14 -0
- package/data/build/dist/client/features/quick-apps.js.map +1 -0
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/client/features/session-translation.js +50 -49
- package/data/build/dist/client/features/session-translation.js.map +1 -1
- package/data/build/dist/client/features/subscription-quota-groups.d.ts +193 -0
- package/data/build/dist/client/features/subscription-quota-groups.d.ts.map +1 -0
- package/data/build/dist/client/features/subscription-quota-groups.js +548 -0
- package/data/build/dist/client/features/subscription-quota-groups.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.js +6 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts +20 -1
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +94 -18
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
- package/data/build/dist/client/git-management-settings.d.ts +4 -0
- package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
- package/data/build/dist/client/git-management-settings.js +73 -0
- package/data/build/dist/client/git-management-settings.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts +2 -1
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +64 -41
- package/data/build/dist/client/git-management.js.map +1 -1
- package/data/build/dist/client/git-panel-styles.d.ts +4 -0
- package/data/build/dist/client/git-panel-styles.d.ts.map +1 -1
- package/data/build/dist/client/git-panel-styles.js +15 -0
- package/data/build/dist/client/git-panel-styles.js.map +1 -1
- package/data/build/dist/client/html-workspace-files.d.ts +4 -0
- package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/client/html-workspace-files.js +114 -0
- package/data/build/dist/client/html-workspace-files.js.map +1 -0
- package/data/build/dist/client/index.d.ts +1 -1
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +1 -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 +29 -2
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
- package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
- package/data/build/dist/client/locales/cliManagement.js +155 -0
- package/data/build/dist/client/locales/cliManagement.js.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/fileWorkspace.js +8 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/git.d.ts.map +1 -1
- package/data/build/dist/client/locales/git.js +30 -2
- package/data/build/dist/client/locales/git.js.map +1 -1
- package/data/build/dist/client/locales/magpie.d.ts +4 -0
- package/data/build/dist/client/locales/magpie.d.ts.map +1 -0
- package/data/build/dist/client/locales/magpie.js +622 -0
- package/data/build/dist/client/locales/magpie.js.map +1 -0
- package/data/build/dist/client/locales/panels.d.ts.map +1 -1
- package/data/build/dist/client/locales/panels.js +103 -11
- package/data/build/dist/client/locales/panels.js.map +1 -1
- package/data/build/dist/client/locales/peerHost.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHost.js +2 -0
- package/data/build/dist/client/locales/peerHost.js.map +1 -1
- package/data/build/dist/client/locales/quickApps.d.ts +136 -0
- package/data/build/dist/client/locales/quickApps.d.ts.map +1 -0
- package/data/build/dist/client/locales/quickApps.js +162 -0
- package/data/build/dist/client/locales/quickApps.js.map +1 -0
- package/data/build/dist/client/locales/usage.d.ts.map +1 -1
- package/data/build/dist/client/locales/usage.js +150 -0
- package/data/build/dist/client/locales/usage.js.map +1 -1
- package/data/build/dist/client/magpie-model-tag.d.ts +16 -0
- package/data/build/dist/client/magpie-model-tag.d.ts.map +1 -0
- package/data/build/dist/client/magpie-model-tag.js +62 -0
- package/data/build/dist/client/magpie-model-tag.js.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
- package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -1
- package/data/build/dist/client/model-catalog-cache.js +66 -12
- package/data/build/dist/client/model-catalog-cache.js.map +1 -1
- package/data/build/dist/client/model-priority-pool.d.ts +23 -0
- package/data/build/dist/client/model-priority-pool.d.ts.map +1 -0
- package/data/build/dist/client/model-priority-pool.js +245 -0
- package/data/build/dist/client/model-priority-pool.js.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts +13 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.js +159 -0
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
- package/data/build/dist/client/native-translation-default.d.ts +6 -0
- package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
- package/data/build/dist/client/native-translation-default.js +30 -0
- package/data/build/dist/client/native-translation-default.js.map +1 -0
- package/data/build/dist/client/provider-icons.d.ts +8 -0
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +125 -3
- package/data/build/dist/client/provider-icons.js.map +1 -1
- package/data/build/dist/client/quick-apps/browser-storage.d.ts +24 -0
- package/data/build/dist/client/quick-apps/browser-storage.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/browser-storage.js +114 -0
- package/data/build/dist/client/quick-apps/browser-storage.js.map +1 -0
- package/data/build/dist/client/quick-apps/client.d.ts +31 -0
- package/data/build/dist/client/quick-apps/client.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/client.js +68 -0
- package/data/build/dist/client/quick-apps/client.js.map +1 -0
- package/data/build/dist/client/quick-apps/document.d.ts +26 -0
- package/data/build/dist/client/quick-apps/document.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/document.js +110 -0
- package/data/build/dist/client/quick-apps/document.js.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts +14 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.js +51 -0
- package/data/build/dist/client/quick-apps/file-picker.js.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts +7 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.js +267 -0
- package/data/build/dist/client/quick-apps/launcher.js.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts +16 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.js +47 -0
- package/data/build/dist/client/quick-apps/presentation.js.map +1 -0
- package/data/build/dist/client/quick-apps/rail-preference.d.ts +5 -0
- package/data/build/dist/client/quick-apps/rail-preference.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/rail-preference.js +19 -0
- package/data/build/dist/client/quick-apps/rail-preference.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts +6 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js +50 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts +26 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.js +128 -0
- package/data/build/dist/client/quick-apps/reorder.js.map +1 -0
- package/data/build/dist/client/quick-apps/styles.d.ts +3 -0
- package/data/build/dist/client/quick-apps/styles.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/styles.js +153 -0
- package/data/build/dist/client/quick-apps/styles.js.map +1 -0
- package/data/build/dist/client/quick-apps/ui.d.ts +20 -0
- package/data/build/dist/client/quick-apps/ui.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/ui.js +21 -0
- package/data/build/dist/client/quick-apps/ui.js.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts +16 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.js +165 -0
- package/data/build/dist/client/quick-apps/viewer.js.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts +19 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js +30 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +68 -2
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
- package/data/build/dist/client/session-translation-chat.js +297 -109
- package/data/build/dist/client/session-translation-chat.js.map +1 -1
- package/data/build/dist/client/session-translation-interactions.d.ts +31 -0
- package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-interactions.js +158 -0
- package/data/build/dist/client/session-translation-interactions.js.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.js +58 -0
- package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
- package/data/build/dist/client/session-translation-retry.d.ts +16 -0
- package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-retry.js +66 -0
- package/data/build/dist/client/session-translation-retry.js.map +1 -0
- package/data/build/dist/client/session-translation-rules.d.ts +13 -0
- package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-rules.js +58 -0
- package/data/build/dist/client/session-translation-rules.js.map +1 -0
- package/data/build/dist/client/settings-bridge.d.ts +1 -0
- package/data/build/dist/client/settings-bridge.d.ts.map +1 -1
- package/data/build/dist/client/settings-bridge.js +29 -10
- package/data/build/dist/client/settings-bridge.js.map +1 -1
- package/data/build/dist/client/settings-section.d.ts.map +1 -1
- package/data/build/dist/client/settings-section.js +21 -3
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/sidebar-footer-style.d.ts +13 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.js +54 -0
- package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
- package/data/build/dist/client/style.css +279 -276
- package/data/build/dist/client/subscription-slot.d.ts +26 -2
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +679 -24
- package/data/build/dist/client/subscription-slot.js.map +1 -1
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +2 -1
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +1 -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 +68 -8
- package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-rightbar-dom.js +12 -21
- package/data/build/dist/client/workspace-session-rightbar-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 +43 -10
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js +71 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts +27 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js +109 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +30 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +93 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +39 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js +27 -0
- package/data/build/dist/dsh-capabilities/client/peer-host-attachment-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +36 -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 +88 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts +18 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +75 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +52 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +109 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +34 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/host/native-dispatch-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts +11 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js +97 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts +36 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js +164 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts +44 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js +240 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts +37 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js +35 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js +30 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js +132 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js +33 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +45 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +18 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +31 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +2 -1
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +32 -2
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js +24 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +23 -5
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.d.ts +1 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +50 -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/cli-adapters/acp-cli-driver.d.ts +27 -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 +94 -16
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +184 -21
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +28 -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 +158 -22
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +6 -2
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +198 -26
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.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 +33 -5
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +3 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +41 -4
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -1
- package/data/build/dist/host/cli-adapters/driver.d.ts +2 -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 +5 -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 +65 -17
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +3 -2
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +3 -2
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +972 -102
- 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 +5 -3
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +463 -59
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- 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 +20 -3
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
- package/data/build/dist/host/cli-adapters/magpie-detection.d.ts +72 -0
- package/data/build/dist/host/cli-adapters/magpie-detection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-detection.js +298 -0
- package/data/build/dist/host/cli-adapters/magpie-detection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-management.d.ts +50 -0
- package/data/build/dist/host/cli-adapters/magpie-management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-management.js +1268 -0
- package/data/build/dist/host/cli-adapters/magpie-management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts +9 -0
- package/data/build/dist/host/cli-adapters/magpie-session-routing.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-session-routing.js +90 -0
- package/data/build/dist/host/cli-adapters/magpie-session-routing.js.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-update.d.ts +59 -0
- package/data/build/dist/host/cli-adapters/magpie-update.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-update.js +249 -0
- package/data/build/dist/host/cli-adapters/magpie-update.js.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-usage.d.ts +148 -0
- package/data/build/dist/host/cli-adapters/magpie-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-usage.js +1710 -0
- package/data/build/dist/host/cli-adapters/magpie-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-web.d.ts +54 -0
- package/data/build/dist/host/cli-adapters/magpie-web.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/magpie-web.js +407 -0
- package/data/build/dist/host/cli-adapters/magpie-web.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
- package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
- package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.js +62 -0
- package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management.js +177 -0
- package/data/build/dist/host/cli-adapters/management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js +12 -5
- package/data/build/dist/host/cli-adapters/mcode-driver.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 +70 -7
- 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 +1 -1
- 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 +13 -5
- 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 +7 -1
- 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 +6 -3
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +22 -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 +105 -17
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +4 -1
- 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 +45 -11
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.js +20 -11
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts +7 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +141 -51
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +74 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js +83 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
- 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 +4 -0
- 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 +3 -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 +2 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts +26 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js +30 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.js +7 -6
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
- package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.js +67 -0
- package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.js +263 -0
- package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js +7 -2
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +14 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-holder.js +53 -6
- package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +8 -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 +63 -6
- 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.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.js +128 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts +23 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js +73 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +14 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +69 -7
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts +1 -1
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +102 -7
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js +9 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts +52 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js +311 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts +20 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js +61 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js +23 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js +208 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
- package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts.map +1 -1
- package/data/build/dist/host/dsh-gateway-feature.js +26 -3
- package/data/build/dist/host/dsh-gateway-feature.js.map +1 -1
- package/data/build/dist/host/features/file-management.d.ts.map +1 -1
- package/data/build/dist/host/features/file-management.js +10 -1
- package/data/build/dist/host/features/file-management.js.map +1 -1
- package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
- package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
- package/data/build/dist/host/features/git-commit-message.js +66 -0
- package/data/build/dist/host/features/git-commit-message.js.map +1 -0
- package/data/build/dist/host/features/git-management.d.ts +11 -2
- package/data/build/dist/host/features/git-management.d.ts.map +1 -1
- package/data/build/dist/host/features/git-management.js +61 -7
- 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 +2 -3
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/host-status.d.ts +25 -0
- package/data/build/dist/host/features/host-status.d.ts.map +1 -1
- package/data/build/dist/host/features/host-status.js +60 -6
- package/data/build/dist/host/features/host-status.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +2 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/interaction-translation.d.ts +10 -0
- package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/interaction-translation.js +219 -0
- package/data/build/dist/host/features/interaction-translation.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 +64 -13
- package/data/build/dist/host/features/lan-access-dsh.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 +13 -6
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/quick-apps.d.ts +4 -0
- package/data/build/dist/host/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/host/features/quick-apps.js +158 -0
- package/data/build/dist/host/features/quick-apps.js.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.js +227 -0
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts +22 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.js +205 -0
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.js +125 -0
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts +16 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.js +85 -0
- package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
- package/data/build/dist/host/features/session-translation-service.d.ts +19 -4
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-service.js +249 -210
- package/data/build/dist/host/features/session-translation-service.js.map +1 -1
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation.js +6 -3
- package/data/build/dist/host/features/session-translation.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +10 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/html-workspace-files.d.ts +3 -0
- package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/host/html-workspace-files.js +135 -0
- package/data/build/dist/host/html-workspace-files.js.map +1 -0
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +32 -39
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts +14 -2
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +87 -15
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +2 -2
- 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 +10 -9
- 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-streams.d.ts +3 -3
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +26 -14
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts +5 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js +27 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +2 -1
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -1
- package/data/build/dist/host/modules/quick-apps/browse.d.ts +5 -0
- package/data/build/dist/host/modules/quick-apps/browse.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/browse.js +37 -0
- package/data/build/dist/host/modules/quick-apps/browse.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts +4 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js +39 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.js +87 -0
- package/data/build/dist/host/modules/quick-apps/documents.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/egress.d.ts +35 -0
- package/data/build/dist/host/modules/quick-apps/egress.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/egress.js +244 -0
- package/data/build/dist/host/modules/quick-apps/egress.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.js +15 -0
- package/data/build/dist/host/modules/quick-apps/errors.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js +149 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts +35 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.js +80 -0
- package/data/build/dist/host/modules/quick-apps/launches.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.js +72 -0
- package/data/build/dist/host/modules/quick-apps/paths.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.js +195 -0
- package/data/build/dist/host/modules/quick-apps/registry.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts +38 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.js +238 -0
- package/data/build/dist/host/modules/quick-apps/remote.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts +27 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.js +174 -0
- package/data/build/dist/host/modules/quick-apps/service.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js +213 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +7 -1
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +10 -15
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts +15 -2
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +67 -15
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/session-changes.d.ts.map +1 -1
- package/data/build/dist/host/session-changes.js +6 -2
- package/data/build/dist/host/session-changes.js.map +1 -1
- package/data/build/dist/host/session-migration-repair.js +48 -35
- package/data/build/dist/host/session-migration-repair.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +36 -2
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.js +15 -0
- package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
- package/data/build/dist/host/workspace-root.d.ts +14 -0
- package/data/build/dist/host/workspace-root.d.ts.map +1 -0
- package/data/build/dist/host/workspace-root.js +99 -0
- package/data/build/dist/host/workspace-root.js.map +1 -0
- package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
- package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/attachment-prompts.js +17 -0
- package/data/build/dist/shared/attachment-prompts.js.map +1 -0
- package/data/build/dist/shared/cli-provider-route.d.ts +7 -0
- package/data/build/dist/shared/cli-provider-route.d.ts.map +1 -0
- package/data/build/dist/shared/cli-provider-route.js +13 -0
- package/data/build/dist/shared/cli-provider-route.js.map +1 -0
- package/data/build/dist/shared/codex-performance.d.ts +3 -0
- package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
- package/data/build/dist/shared/codex-performance.js +2 -0
- package/data/build/dist/shared/codex-performance.js.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts +14 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.js +48 -0
- package/data/build/dist/shared/contracts/agent-team.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +62 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.js +2 -0
- package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
- package/data/build/dist/shared/contracts/config.d.ts +25 -1
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +11 -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/errors.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/feature.d.ts +7 -0
- package/data/build/dist/shared/contracts/feature.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/git.d.ts +17 -0
- package/data/build/dist/shared/contracts/git.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/git.js +27 -1
- package/data/build/dist/shared/contracts/git.js.map +1 -1
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts +53 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.js +44 -0
- package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/magpie-management.d.ts +395 -0
- package/data/build/dist/shared/contracts/magpie-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/magpie-management.js +2 -0
- package/data/build/dist/shared/contracts/magpie-management.js.map +1 -0
- package/data/build/dist/shared/contracts/quick-apps.d.ts +70 -0
- package/data/build/dist/shared/contracts/quick-apps.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/quick-apps.js +4 -0
- package/data/build/dist/shared/contracts/quick-apps.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +82 -9
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/session-translation.js +146 -2
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -1
- package/data/build/dist/shared/contracts/subscription.d.ts +161 -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 +9 -15
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +8 -14
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/index.d.ts +4 -2
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +3 -2
- package/data/build/dist/shared/index.js.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.d.ts +4 -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 +4 -0
- 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/quick-app-browser-storage.d.ts +33 -0
- package/data/build/dist/shared/quick-app-browser-storage.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-browser-storage.js +33 -0
- package/data/build/dist/shared/quick-app-browser-storage.js.map +1 -0
- package/data/build/dist/shared/quick-app-network-allow.d.ts +8 -0
- package/data/build/dist/shared/quick-app-network-allow.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-network-allow.js +192 -0
- package/data/build/dist/shared/quick-app-network-allow.js.map +1 -0
- package/data/build/dist/shared/quick-app-network-bootstrap.d.ts +9 -0
- package/data/build/dist/shared/quick-app-network-bootstrap.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-network-bootstrap.js +134 -0
- package/data/build/dist/shared/quick-app-network-bootstrap.js.map +1 -0
- package/data/build/dist/shared/quick-app-proxy-path.d.ts +6 -0
- package/data/build/dist/shared/quick-app-proxy-path.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-proxy-path.js +18 -0
- package/data/build/dist/shared/quick-app-proxy-path.js.map +1 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts +9 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.js +189 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.js.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts +7 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js +10 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js.map +1 -0
- package/data/build/dist/shared/request-performance.d.ts +15 -0
- package/data/build/dist/shared/request-performance.d.ts.map +1 -0
- package/data/build/dist/shared/request-performance.js +3 -0
- package/data/build/dist/shared/request-performance.js.map +1 -0
- package/data/build/dist/shared/session-title.d.ts.map +1 -1
- package/data/build/dist/shared/session-title.js +10 -4
- package/data/build/dist/shared/session-title.js.map +1 -1
- package/data/build/dist/shared/translation-indicator.d.ts +26 -0
- package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
- package/data/build/dist/shared/translation-indicator.js +29 -0
- package/data/build/dist/shared/translation-indicator.js.map +1 -0
- package/package.json +35 -34
- 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.model-catalog-cache.js.map +0 -1
|
@@ -15,23 +15,52 @@ import { QoderCliDriver } from './qoder-driver.js';
|
|
|
15
15
|
import { AntigravityDriver } from './antigravity-driver.js';
|
|
16
16
|
import { DoubaoAppDriver } from './doubao-driver.js';
|
|
17
17
|
import { CodingNsCliAdapterRegistry } from './registry.js';
|
|
18
|
+
import { CliManagementService } from './management.js';
|
|
19
|
+
import { CliUpdateCheckService } from './update-check.js';
|
|
18
20
|
import { CodingNsCliSessionStore } from './session-store.js';
|
|
19
21
|
import { CodingNsDshMessageProjector } from './dsh-message-projector.js';
|
|
20
22
|
import { CommandCodeSubscriptionService } from './command-code-subscription.js';
|
|
21
23
|
import { ProviderSubscriptionService } from './provider-subscription.js';
|
|
24
|
+
import { attachMagpieSessionNames, MagpieUsageService, magpieAgentForAdapter } from './magpie-usage.js';
|
|
25
|
+
import { readDshProviderSource } from './dsh-config.js';
|
|
26
|
+
import { MagpieManagementService } from './magpie-management.js';
|
|
27
|
+
import { MagpieWebService } from './magpie-web.js';
|
|
28
|
+
import { MagpieUpdateService } from './magpie-update.js';
|
|
29
|
+
import { MagpieInstallDetectionService, normalizeCustomCommand } from './magpie-detection.js';
|
|
30
|
+
import { createMagpieSessionRouting } from './magpie-session-routing.js';
|
|
22
31
|
import { normalizeSubagentBridgeSettings, normalizeSubscriptionUsageSettings } from '../../shared/contracts/config.js';
|
|
32
|
+
import { CodingNsRpcError } from '../rpc-table.js';
|
|
23
33
|
import { setAdapterRegistry } from './registry-holder.js';
|
|
24
34
|
import { createDshVirtualProviderRegistration } from './dsh-virtual-providers.js';
|
|
25
35
|
import { dispatchBridgeSubagent } from '../cli-bridge/dispatch.js';
|
|
36
|
+
import { dispatchBridgeSearch } from '../cli-bridge/search-dispatch.js';
|
|
37
|
+
import { dispatchBridgeFetch } from '../cli-bridge/fetch-dispatch.js';
|
|
26
38
|
import { startSubagentBridgeServer } from '../cli-bridge/bridge-server.js';
|
|
27
|
-
import { setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
39
|
+
import { getSubagentBridge, setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
28
40
|
import { delegateCapability, dispatchDelegateSubagent } from './delegate-dispatch.js';
|
|
29
41
|
import { guardNativeSubagentParentTurn, markNativeSubagentParentTurnStarted, setMaxNativeSubagentsPerParent } from './native-subagent-dispatch.js';
|
|
30
42
|
import { containsDelegationCarrier, delegationAdapterIds, rewriteDelegationMessages } from './delegation-mention-rewrite.js';
|
|
31
43
|
import { clearDelegationAuthorization, setDelegationAuthorization } from './delegation-authorization.js';
|
|
32
44
|
import { debugInfo } from '../../shared/debug.js';
|
|
33
45
|
import { hasLegacySessionAdapterHint } from './legacy-session-adapter.js';
|
|
34
|
-
import {} from '../../shared/contracts/session-translation.js';
|
|
46
|
+
import { DSH_NATIVE_SESSION_ADAPTER_ID, formatSessionTranslationOutput, readSessionTranslationMetrics, } from '../../shared/contracts/session-translation.js';
|
|
47
|
+
import { questionTranslationFields } from '../../shared/contracts/interaction-translation.js';
|
|
48
|
+
import { createInteractionTranslation } from '../features/interaction-translation.js';
|
|
49
|
+
import { createSessionTranslationRecovery, SessionTranslationCancelled } from '../features/session-translation-recovery.js';
|
|
50
|
+
import { isSessionTranslationInputEnabled } from '../features/session-translation-service.js';
|
|
51
|
+
import { ASSISTANT_AGENT_PREFIX } from '../../dsh-capabilities/host/assistant-agent-adapter.js';
|
|
52
|
+
import { createDshCapabilityRegistry } from '../../dsh-capabilities/routes.js';
|
|
53
|
+
import { attachmentFileNotice } from '../../shared/attachment-prompts.js';
|
|
54
|
+
import { sessionPromptScope } from '../../dsh-capabilities/host/session-prompt-adapter.js';
|
|
55
|
+
import { createSessionPromptTranslation } from '../features/session-prompt-translation.js';
|
|
56
|
+
import { codexPerformanceProjection } from './codex-performance-projection.js';
|
|
57
|
+
import { grokContextProjection, grokPerformanceProjection } from './grok-performance-projection.js';
|
|
58
|
+
import { fromCliProviderId, toCliProviderId } from '../../shared/cli-provider-route.js';
|
|
59
|
+
import { DshAgentTeamAdapter } from '../../dsh-capabilities/host/agent-team-adapter.js';
|
|
60
|
+
import { CodingNsTeamDispatcher } from '../cli-bridge/team-dispatch.js';
|
|
61
|
+
import { createAgentTeamTool } from '../cli-bridge/team-tool.js';
|
|
62
|
+
import { TeamInputTracker, isTeamInputMessage, pendingPeerInput } from './team-input.js';
|
|
63
|
+
import { withTeamSupport } from '../cli-bridge/team-adapters.js';
|
|
35
64
|
export function createCliAdaptersFeature(options = {}) {
|
|
36
65
|
return {
|
|
37
66
|
descriptor: {
|
|
@@ -40,20 +69,86 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
40
69
|
enabledByDefault: true,
|
|
41
70
|
dependencies: [],
|
|
42
71
|
runtime: 'host',
|
|
72
|
+
requires: [
|
|
73
|
+
{ capability: 'agent-team.external-member', required: false, fallback: 'degrade' },
|
|
74
|
+
{ capability: 'agent-team.external-lead', required: false, fallback: 'degrade' },
|
|
75
|
+
{ capability: 'session.external-model-selection', required: false, fallback: 'degrade' },
|
|
76
|
+
{ capability: 'session.external-performance', required: false, fallback: 'degrade' },
|
|
77
|
+
],
|
|
43
78
|
},
|
|
44
79
|
async start(context) {
|
|
80
|
+
const lifetime = new AbortController();
|
|
81
|
+
const magpieSessionRouting = createMagpieSessionRouting();
|
|
82
|
+
context.resources.add(() => magpieSessionRouting.dispose());
|
|
45
83
|
// 用量查询超时对所有适配器统一生效:同一个 timeoutMs 下发给全部网络读取器,
|
|
46
84
|
// 设置变更时整体重建,避免旧超时继续生效。
|
|
47
85
|
const buildSubscriptions = (settings) => {
|
|
48
86
|
const timeoutMs = normalizeSubscriptionUsageSettings(settings?.subscriptionUsage).timeoutSecs * 1000;
|
|
49
87
|
return new ProviderSubscriptionService({ commandCode: new CommandCodeSubscriptionService({ timeoutMs }), timeoutMs });
|
|
50
88
|
};
|
|
51
|
-
let subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
89
|
+
let subscriptions = options.subscriptions ?? buildSubscriptions(context.services.settings?.get());
|
|
90
|
+
let magpieDetection = options.magpieDetection ?? new MagpieInstallDetectionService(options.magpieDetectionOptions);
|
|
91
|
+
// 最近一次可用的 Magpie 入口;探测会随用户指定的路径变化而重建,Web 服务总是读最新值。
|
|
92
|
+
let magpieCommand = null;
|
|
93
|
+
let magpieVersion = null;
|
|
94
|
+
const magpieWeb = options.magpieWeb ?? new MagpieWebService({ startupCommand: () => magpieCommand });
|
|
95
|
+
const magpieUsage = options.magpieUsage ?? new MagpieUsageService({ lifetimeSignal: lifetime.signal, webApi: magpieWeb });
|
|
96
|
+
const magpieManagement = options.magpieManagement ?? new MagpieManagementService({ webApi: magpieWeb });
|
|
97
|
+
const magpieUpdates = options.magpieUpdates ?? new MagpieUpdateService({ webApi: magpieWeb, version: () => magpieVersion });
|
|
98
|
+
let magpieWebDesired = false;
|
|
99
|
+
let magpieWebSync = Promise.resolve();
|
|
100
|
+
const scheduleMagpieWebSync = (enabled) => {
|
|
101
|
+
magpieWebDesired = enabled;
|
|
102
|
+
if (!enabled) {
|
|
103
|
+
magpieUpdates.stopBackgroundChecks();
|
|
104
|
+
void magpieWeb.stop().catch(() => undefined);
|
|
105
|
+
}
|
|
106
|
+
const next = magpieWebSync.then(async () => {
|
|
107
|
+
if (magpieWebDesired !== enabled)
|
|
108
|
+
return;
|
|
109
|
+
if (!enabled) {
|
|
110
|
+
await magpieWeb.stop();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
await magpieWeb.start();
|
|
115
|
+
magpieUpdates.startBackgroundChecks();
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
console.warn('codingns4dsh: Magpie Web startup failed; the next Web API request will retry', error);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
magpieWebSync = next.catch(() => undefined);
|
|
122
|
+
};
|
|
123
|
+
// 设置里可能保留了“已启用”,但本机没有可用 Magpie(换机、卸载或安装损坏)。
|
|
124
|
+
// 这种情况下不拉起 Magpie Web,等用户安装后重新检测再启用。
|
|
125
|
+
let magpieInstalled = await magpieDetection.detect().then((detection) => {
|
|
126
|
+
const usable = MagpieInstallDetectionService.isUsable(detection);
|
|
127
|
+
magpieCommand = usable ? detection.command : null;
|
|
128
|
+
magpieVersion = usable ? detection.version : null;
|
|
129
|
+
return usable;
|
|
130
|
+
}, () => false);
|
|
131
|
+
scheduleMagpieWebSync(context.services.settings?.get().modules.magpieManagement === true && magpieInstalled);
|
|
132
|
+
context.resources.add(async () => {
|
|
133
|
+
magpieWebDesired = false;
|
|
134
|
+
await magpieWeb.stop();
|
|
135
|
+
await magpieWebSync;
|
|
136
|
+
await magpieWeb.dispose();
|
|
137
|
+
});
|
|
52
138
|
let subscriptionSettings = JSON.stringify(context.services.settings?.get().subscriptionUsage ?? null);
|
|
53
139
|
// 注入的 registry 自带 SessionStore;只有自建时才有本地 store 变量。
|
|
54
140
|
const sessionStore = options.registry?.sessionRecords
|
|
55
141
|
?? new CodingNsCliSessionStore(context.services.settings === undefined ? {} : { settings: context.services.settings });
|
|
56
142
|
const nativeSessions = context.services.nativeSessions;
|
|
143
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
144
|
+
const performance = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
145
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-performance')?.value;
|
|
146
|
+
if (performance !== undefined) {
|
|
147
|
+
for (const projection of [codexPerformanceProjection, grokPerformanceProjection, grokContextProjection]) {
|
|
148
|
+
context.resources.add(performance.install(projection));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
57
152
|
const translation = context.services.sessionTranslation;
|
|
58
153
|
// 启动只恢复持久化索引;旧会话在打开时迁移,禁止在首屏扫描全部历史。
|
|
59
154
|
const registry = options.registry ?? new CodingNsCliAdapterRegistry([
|
|
@@ -81,6 +176,45 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
81
176
|
...(context.services.nativeSessions === undefined ? {} : { nativeSessions: context.services.nativeSessions }),
|
|
82
177
|
});
|
|
83
178
|
setAdapterRegistry(registry);
|
|
179
|
+
const teamInputs = new TeamInputTracker();
|
|
180
|
+
context.resources.add(() => teamInputs.clear());
|
|
181
|
+
let teamAdapter;
|
|
182
|
+
const teamDispatcher = new CodingNsTeamDispatcher({
|
|
183
|
+
adapter: () => teamAdapter,
|
|
184
|
+
registry,
|
|
185
|
+
enabled: () => !lifetime.signal.aborted && normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled,
|
|
186
|
+
});
|
|
187
|
+
const versionSupported = context.services.dshVersion !== undefined && !createDshCapabilityRegistry(context.services.dshVersion, 'host', {}).getProfile({}).diagnostics.some(item => item.capability === 'agent-team.external-member' && item.code === 'CAPABILITY_VERSION_UNSUPPORTED');
|
|
188
|
+
const teamCatalog = (catalog) => withTeamSupport(catalog, !versionSupported ? 'version' : !normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled ? 'disabled' : !teamAdapter ? 'profile' : undefined, teamAdapter?.supportsLead);
|
|
189
|
+
const dshContext = context.services.dshContext;
|
|
190
|
+
if (dshContext?.inject && context.services.dshVersion) {
|
|
191
|
+
const teamScope = dshContext.inject(['agentTeams', 'agents', 'subagents', 'tools'], scoped => {
|
|
192
|
+
const capability = createDshCapabilityRegistry(context.services.dshVersion, 'host', scoped).getProfile(scoped).capabilities.get('agent-team.external-member');
|
|
193
|
+
if (capability?.status !== 'ready')
|
|
194
|
+
return;
|
|
195
|
+
const adapter = capability.value;
|
|
196
|
+
teamAdapter = adapter;
|
|
197
|
+
const tools = scoped.get('tools');
|
|
198
|
+
const unregister = tools.register(createAgentTeamTool(teamDispatcher));
|
|
199
|
+
scoped.effect(() => () => {
|
|
200
|
+
adapter.dispose();
|
|
201
|
+
if (teamAdapter === adapter)
|
|
202
|
+
teamAdapter = undefined;
|
|
203
|
+
if (typeof unregister === 'function')
|
|
204
|
+
unregister();
|
|
205
|
+
}, 'CodingNS native Team bridge');
|
|
206
|
+
});
|
|
207
|
+
context.resources.add(() => teamScope.dispose());
|
|
208
|
+
}
|
|
209
|
+
if (dshContext?.on) {
|
|
210
|
+
const stopCreated = dshContext.on('agent/created', ((payload) => {
|
|
211
|
+
const agent = asRecord(payload)?.agent;
|
|
212
|
+
if (agent && typeof agent.id === 'string')
|
|
213
|
+
teamDispatcher.initializeNativeChild(agent);
|
|
214
|
+
}), { global: true });
|
|
215
|
+
if (typeof stopCreated === 'function')
|
|
216
|
+
context.resources.add(stopCreated);
|
|
217
|
+
}
|
|
84
218
|
context.resources.add(() => {
|
|
85
219
|
if (registry === undefined)
|
|
86
220
|
return;
|
|
@@ -88,10 +222,30 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
88
222
|
});
|
|
89
223
|
registry.applyEnabledSettings(context.services.settings?.get().agentAdapters);
|
|
90
224
|
const virtualProviders = createDshVirtualProviderRegistration(context.services.dshContext);
|
|
91
|
-
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
92
225
|
if (virtualProviders !== undefined)
|
|
93
226
|
context.resources.add(() => virtualProviders.dispose());
|
|
227
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
228
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
229
|
+
const selection = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
230
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-model-selection')
|
|
231
|
+
?.value;
|
|
232
|
+
if (selection !== undefined)
|
|
233
|
+
context.resources.add(selection.install((sessionId) => {
|
|
234
|
+
const config = registry.getSession(sessionId);
|
|
235
|
+
if (config.adapterId === 'dsh' && config.teamId && config.providerId && config.modelId)
|
|
236
|
+
return {
|
|
237
|
+
provider: config.providerId, model: config.modelId, ...(config.effortId ? { reasoningEffort: config.effortId } : {}),
|
|
238
|
+
};
|
|
239
|
+
if (config.adapterId === 'dsh' || !registry.isEnabled(config.adapterId))
|
|
240
|
+
return undefined;
|
|
241
|
+
return { provider: toCliProviderId(config.adapterId), model: config.modelId?.trim() || 'provider-default' };
|
|
242
|
+
}));
|
|
243
|
+
}
|
|
94
244
|
registry.warmCatalog();
|
|
245
|
+
const management = new CliManagementService(registry);
|
|
246
|
+
context.resources.add(() => management.dispose());
|
|
247
|
+
const updates = new CliUpdateCheckService(options.updateCheck);
|
|
248
|
+
context.resources.add(() => updates.dispose());
|
|
95
249
|
// 外部适配器没有经过 DSH 原生 Agent Loop,必须把同一套运行状态投影给
|
|
96
250
|
// subagentCatalog。这里集中去重,避免 llm/stream、原生 session/event 和
|
|
97
251
|
// agent/status 同时到达时反复刷新同一个子 Agent。
|
|
@@ -130,19 +284,57 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
130
284
|
});
|
|
131
285
|
context.resources.add(disposeNativeEvents);
|
|
132
286
|
}
|
|
133
|
-
|
|
134
|
-
context.resources.add(
|
|
287
|
+
const translationRecovery = createSessionTranslationRecovery(translation, sessionId => registry.getSession(sessionId));
|
|
288
|
+
context.resources.add(() => translationRecovery.dispose());
|
|
289
|
+
const promptTranslation = createSessionPromptTranslation(translation, sessionId => {
|
|
290
|
+
if (!sessionId || isAssistantSession(sessionId) || readNativeSessionHeader(nativeSessions, sessionId)?.origin === 'subagent')
|
|
291
|
+
return undefined;
|
|
292
|
+
const config = registry.getSession(sessionId);
|
|
293
|
+
return (config.translationEnabled ?? (config.adapterId === 'dsh' && translation?.nativeEnabled === true)) ? config.adapterId : undefined;
|
|
294
|
+
});
|
|
295
|
+
context.resources.add(() => promptTranslation.dispose());
|
|
296
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
297
|
+
const adapter = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
298
|
+
.getProfile(context.services.dshContext).capabilities.get('session.prompt-assembly')?.value;
|
|
299
|
+
if (adapter !== undefined)
|
|
300
|
+
context.resources.add(adapter.install((assembly, scope) => promptTranslation.translateAssembly(assembly, scope)));
|
|
301
|
+
}
|
|
302
|
+
registerDelegationAgentHooks(context.services.dshContext, registry, context.resources, publishExternalStatus, translation, translationRecovery, promptTranslation, nativeSessions, teamInputs);
|
|
303
|
+
const interactionTranslation = createInteractionTranslation(translation, sessionId => registry.getSession(sessionId));
|
|
304
|
+
context.resources.add(() => interactionTranslation.dispose());
|
|
305
|
+
context.resources.add(context.services.rpc.register('cli', async (action, payload, rpcContext) => {
|
|
306
|
+
const rpcSignal = asRecord(rpcContext)?.signal;
|
|
307
|
+
const signal = isAbortSignal(rpcSignal) ? rpcSignal : undefined;
|
|
135
308
|
switch (action) {
|
|
136
|
-
case '
|
|
309
|
+
case 'management/plan':
|
|
310
|
+
case 'management/start':
|
|
311
|
+
case 'management/status':
|
|
312
|
+
case 'management/cancel': return management.rpc(action, payload);
|
|
313
|
+
case 'catalog': return registry.catalog().then(catalog => updates.catalog(teamCatalog(catalog)));
|
|
137
314
|
case 'catalog/refresh': return registry.refreshCatalog(asRecord(payload)?.adapterId === undefined ? undefined : readAdapterId(payload)).then((catalog) => {
|
|
138
315
|
subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
139
|
-
return
|
|
316
|
+
return asRecord(payload)?.checkUpdates === true
|
|
317
|
+
? updates.refresh(teamCatalog(catalog), asRecord(payload)?.adapterId)
|
|
318
|
+
: updates.catalog(teamCatalog(catalog));
|
|
140
319
|
});
|
|
141
320
|
case 'models': {
|
|
142
321
|
const adapterId = readAdapterId(payload);
|
|
143
|
-
|
|
322
|
+
const catalog = adapterId === 'dsh'
|
|
323
|
+
? readDshModelCatalog(context.services.dshContext)
|
|
324
|
+
: registry.models(adapterId);
|
|
325
|
+
if (asRecord(payload)?.stage === 'base') {
|
|
326
|
+
const base = await catalog;
|
|
327
|
+
return magpieAgentForAdapter(adapterId) === null ? base : { ...base, magpiePending: true };
|
|
328
|
+
}
|
|
329
|
+
return typeof magpieUsage.enrichModelCatalog === 'function'
|
|
330
|
+
? magpieUsage.enrichModelCatalog(adapterId, catalog, signal ?? lifetime.signal)
|
|
331
|
+
: catalog;
|
|
144
332
|
}
|
|
145
333
|
case 'translation/models': return context.services.sessionTranslation?.catalog() ?? { models: [], default: null, errors: ['翻译模型目录不可用'] };
|
|
334
|
+
case 'translation/pending': return translationRecovery.pending(payload);
|
|
335
|
+
case 'translation/resolve': return translationRecovery.resolve(payload);
|
|
336
|
+
case 'translation/retry-output': return translationRecovery.retryOutput(payload, signal);
|
|
337
|
+
case 'translation/fields': return interactionTranslation.translate(payload, signal);
|
|
146
338
|
case 'skills': {
|
|
147
339
|
const request = readSkillsRequest(payload);
|
|
148
340
|
const cwd = resolveSessionCwd(context.services.nativeSessions, request.sessionId, null);
|
|
@@ -160,15 +352,27 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
160
352
|
}
|
|
161
353
|
return registry.getSession(sessionId);
|
|
162
354
|
}
|
|
163
|
-
case 'session/set':
|
|
355
|
+
case 'session/set': {
|
|
356
|
+
const sessionId = readSessionId(payload);
|
|
357
|
+
const previous = registry.getSession(sessionId);
|
|
358
|
+
const config = readSessionConfig(payload);
|
|
359
|
+
const saved = registry.setSession(sessionId, config);
|
|
360
|
+
if (config.translationEnabled === false || previous.adapterId !== config.adapterId)
|
|
361
|
+
translationRecovery.cancelSession(sessionId);
|
|
362
|
+
return saved;
|
|
363
|
+
}
|
|
164
364
|
case 'session/list': return registry.listSessions(readSessionListOptions(payload));
|
|
165
365
|
case 'session/adapter-map':
|
|
166
366
|
// 列表查询只返回持久化索引,不能触发会话加载或历史解析。
|
|
167
367
|
return sessionStore.adapterBindings();
|
|
168
368
|
case 'session/archive': return registry.archiveSession(readSessionId(payload));
|
|
169
|
-
case 'session/steer': return translateSteerPrompt(
|
|
170
|
-
case 'session/follow-up': return translateSteerPrompt(
|
|
171
|
-
case 'session/interrupt':
|
|
369
|
+
case 'session/steer': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), false, signal);
|
|
370
|
+
case 'session/follow-up': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), true, signal);
|
|
371
|
+
case 'session/interrupt': {
|
|
372
|
+
const sessionId = readSessionId(payload);
|
|
373
|
+
translationRecovery.cancelSession(sessionId);
|
|
374
|
+
return registry.interrupt(sessionId);
|
|
375
|
+
}
|
|
172
376
|
case 'team/status': return context.services.nativeTeam?.diagnostic() ?? registry.teamDiagnostic();
|
|
173
377
|
case 'team/members': return requireTeam(context).invoke('members', payload);
|
|
174
378
|
case 'team/tasks': return requireTeam(context).invoke('tasks', payload);
|
|
@@ -181,7 +385,23 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
181
385
|
case 'team/interrupt': return requireTeam(context).invoke('interrupt', payload);
|
|
182
386
|
case 'subscription': {
|
|
183
387
|
const subscription = readSubscriptionRequest(payload);
|
|
184
|
-
|
|
388
|
+
const requestSignal = signal ?? lifetime.signal;
|
|
389
|
+
const session = subscription.sessionId === undefined ? undefined : registry.getSession(subscription.sessionId);
|
|
390
|
+
if (context.services.settings?.get().modules.magpieManagement === true
|
|
391
|
+
&& session !== undefined && session.adapterId === subscription.adapterId) {
|
|
392
|
+
const magpie = await magpieUsage.read(session, requestSignal, subscription.includeRoute, subscription.sessionId);
|
|
393
|
+
requestSignal.throwIfAborted();
|
|
394
|
+
const snapshot = magpie ?? (subscription.sessionId === undefined
|
|
395
|
+
? null
|
|
396
|
+
: await pendingMagpieUsage(magpieUsage, nativeSessions, subscription.sessionId, session, requestSignal));
|
|
397
|
+
if (snapshot !== null) {
|
|
398
|
+
const sessionName = subscription.sessionId === undefined ? undefined : readDshSessionDisplayName(subscription.sessionId, sessionStore, nativeSessions);
|
|
399
|
+
return { providerUsage: null, magpie: sessionName === undefined ? snapshot : { ...snapshot, sessionName } };
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
requestSignal.throwIfAborted();
|
|
403
|
+
const providerUsage = await subscriptions.read(subscription.adapterId, subscription.providerId, subscription.modelId);
|
|
404
|
+
return { providerUsage, magpie: null };
|
|
185
405
|
}
|
|
186
406
|
case 'subscription/reset': {
|
|
187
407
|
const subscription = readSubscriptionResetRequest(payload);
|
|
@@ -204,6 +424,59 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
204
424
|
default: throw new Error(`未知 CLI RPC: cli/${action}`);
|
|
205
425
|
}
|
|
206
426
|
}));
|
|
427
|
+
context.resources.add(context.services.rpc.register('magpie', async (action, payload, rpcContext) => {
|
|
428
|
+
const rpcSignal = asRecord(rpcContext)?.signal;
|
|
429
|
+
const signal = isAbortSignal(rpcSignal) ? rpcSignal : lifetime.signal;
|
|
430
|
+
// 安装探测本身就是启用前的判断依据,因此不要求模块已启用。
|
|
431
|
+
if (action === 'management/detection') {
|
|
432
|
+
const request = readMagpieDetectionRequest(payload);
|
|
433
|
+
const force = readMagpieDetectionForce(payload);
|
|
434
|
+
// A custom path is request-scoped; it must not poison later automatic detection.
|
|
435
|
+
const customCommand = normalizeCustomCommand(request.commandPath);
|
|
436
|
+
const detectionService = customCommand === null
|
|
437
|
+
? magpieDetection
|
|
438
|
+
: new MagpieInstallDetectionService({ ...options.magpieDetectionOptions, customCommand });
|
|
439
|
+
const detection = await detectionService.detect(customCommand === null ? {} : { commandPath: customCommand }, { force: force || customCommand !== null });
|
|
440
|
+
magpieCommand = MagpieInstallDetectionService.isUsable(detection) ? detection.command : null;
|
|
441
|
+
magpieVersion = MagpieInstallDetectionService.isUsable(detection) ? detection.version : null;
|
|
442
|
+
return detection;
|
|
443
|
+
}
|
|
444
|
+
if (context.services.settings?.get().modules.magpieManagement !== true) {
|
|
445
|
+
throw new CodingNsRpcError('CODINGNS_MAGPIE_DISABLED', 'Magpie management is disabled');
|
|
446
|
+
}
|
|
447
|
+
switch (action) {
|
|
448
|
+
case 'usage/dashboard': {
|
|
449
|
+
const dashboard = await magpieUsage.readDashboard(readMagpieDashboardPeriod(payload), signal);
|
|
450
|
+
return attachMagpieSessionNames(dashboard, await magpieSessionNameBindings(sessionStore, nativeSessions, signal));
|
|
451
|
+
}
|
|
452
|
+
case 'usage/dashboard/stream': {
|
|
453
|
+
const input = asRecord(payload);
|
|
454
|
+
const period = readMagpieDashboardPeriod(payload);
|
|
455
|
+
const force = input?.force === true;
|
|
456
|
+
return streamMagpieDashboard(magpieUsage, period, signal, force, sessionStore, nativeSessions);
|
|
457
|
+
}
|
|
458
|
+
case 'usage/requests':
|
|
459
|
+
return magpieUsage.readRequestPage(readMagpieRequestOptions(payload), signal);
|
|
460
|
+
case 'management/snapshot':
|
|
461
|
+
return magpieManagement.readSnapshot(signal);
|
|
462
|
+
case 'management/provider/update':
|
|
463
|
+
return magpieManagement.updateProvider(payload, signal);
|
|
464
|
+
case 'management/group/update':
|
|
465
|
+
return magpieManagement.updateGroup(payload, signal);
|
|
466
|
+
case 'management/account/update':
|
|
467
|
+
return magpieManagement.updateAccount(payload, signal);
|
|
468
|
+
case 'update/status':
|
|
469
|
+
return magpieUpdates.readStatus(signal);
|
|
470
|
+
case 'update/notes':
|
|
471
|
+
return magpieUpdates.readNotes(signal);
|
|
472
|
+
case 'update/check':
|
|
473
|
+
return magpieUpdates.checkForUpdate(signal);
|
|
474
|
+
case 'update/install':
|
|
475
|
+
return magpieUpdates.installUpdate(payload, signal);
|
|
476
|
+
default:
|
|
477
|
+
throw new CodingNsRpcError('CODINGNS_RPC_NOT_FOUND', `Unknown Magpie RPC: ${action}`);
|
|
478
|
+
}
|
|
479
|
+
}));
|
|
207
480
|
// 外部 CLI 子代理托管:开启时启动本机回环桥接,把外部 CLI 的子代理调用
|
|
208
481
|
// 转投成 DSH 原生可续子会话;关闭或模块停用时收回端口并清空驱动句柄。
|
|
209
482
|
let bridgeServer;
|
|
@@ -221,10 +494,18 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
221
494
|
try {
|
|
222
495
|
const agents = readOptionalContextService(context.services.dshContext, 'agents');
|
|
223
496
|
const server = await startSubagentBridgeServer({
|
|
497
|
+
teamAccess: (sessionId) => teamDispatcher.access(sessionId),
|
|
498
|
+
teamDispatch: (sessionId, input, signal) => teamDispatcher.dispatch(sessionId, input, signal),
|
|
224
499
|
dispatch: (request) => dispatchBridgeSubagent(request, {
|
|
225
500
|
agents: agents,
|
|
226
501
|
nativeSessions: context.services.nativeSessions,
|
|
227
502
|
}),
|
|
503
|
+
search: (input, signal) => dispatchBridgeSearch(input, {
|
|
504
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
505
|
+
}, signal),
|
|
506
|
+
fetch: (input, signal) => dispatchBridgeFetch(input, {
|
|
507
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
508
|
+
}, signal),
|
|
228
509
|
});
|
|
229
510
|
bridgeServer = server;
|
|
230
511
|
setSubagentBridge(server.runtime);
|
|
@@ -259,12 +540,24 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
259
540
|
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
260
541
|
registry.syncPreferences(next.agentAdapterPreferences);
|
|
261
542
|
sessionStore.sync(next.cliSessions);
|
|
543
|
+
translationRecovery.cancelDisabled(next.sessionTranslation);
|
|
262
544
|
const nextSubscriptionSettings = JSON.stringify(next.subscriptionUsage ?? null);
|
|
263
545
|
if (nextSubscriptionSettings !== subscriptionSettings) {
|
|
264
546
|
subscriptionSettings = nextSubscriptionSettings;
|
|
265
547
|
subscriptions = buildSubscriptions(next);
|
|
266
548
|
}
|
|
267
549
|
syncSubagentBridgeSettings(next.subagentBridge);
|
|
550
|
+
const magpieWanted = next.modules.magpieManagement === true;
|
|
551
|
+
// 只在“需要启动”时重新探测;停用时立即回收,退出探测的旧结果不覆盖新状态。
|
|
552
|
+
void (magpieWanted && !magpieInstalled
|
|
553
|
+
? magpieDetection.detect({}, { force: true }).then(detection => MagpieInstallDetectionService.isUsable(detection), () => false)
|
|
554
|
+
: Promise.resolve(magpieInstalled)).then((installed) => {
|
|
555
|
+
magpieInstalled = installed;
|
|
556
|
+
if (next.modules.magpieManagement !== true)
|
|
557
|
+
scheduleMagpieWebSync(false);
|
|
558
|
+
else if (installed)
|
|
559
|
+
scheduleMagpieWebSync(true);
|
|
560
|
+
});
|
|
268
561
|
}));
|
|
269
562
|
}
|
|
270
563
|
const events = context.services.events;
|
|
@@ -317,7 +610,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
317
610
|
}
|
|
318
611
|
else if (sessionId !== '')
|
|
319
612
|
clearDelegationAuthorization(sessionId);
|
|
320
|
-
const selectedExternalAdapter = selectExternalAdapter(dshSelection.providerId, inferMessageAdapter(messages), registry);
|
|
613
|
+
const selectedExternalAdapter = storedConfig.adapterId === 'dsh' && storedConfig.teamId ? undefined : selectExternalAdapter(fromCliProviderId(dshSelection.providerId), inferMessageAdapter(messages), registry);
|
|
321
614
|
// DSH 的 modelSelection 只描述 DSH 自己那条模型路由(例如 glor/deepseek)。
|
|
322
615
|
// 只有它明确指向即将接管的外部适配器时,model/effort 才属于该适配器;
|
|
323
616
|
// 当适配器是从会话历史推断出来的(fork 子会话继承父会话的外部消息,而
|
|
@@ -325,7 +618,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
325
618
|
// 写进外部 Agent——Codex 会用它 thread/start 并直接 404,整个会话从此
|
|
326
619
|
// 无法继续。此时必须留空,由适配器自己的偏好决定模型。
|
|
327
620
|
const selectionOwnedByAdapter = selectedExternalAdapter !== undefined
|
|
328
|
-
&& dshSelection.providerId === selectedExternalAdapter;
|
|
621
|
+
&& (fromCliProviderId(dshSelection.providerId) ?? dshSelection.providerId) === selectedExternalAdapter;
|
|
329
622
|
let config = storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined
|
|
330
623
|
? {
|
|
331
624
|
adapterId: selectedExternalAdapter,
|
|
@@ -339,35 +632,65 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
339
632
|
if (sessionId !== '' && storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined) {
|
|
340
633
|
config = registry.setSession(sessionId, config);
|
|
341
634
|
}
|
|
635
|
+
if (config.teamId && !teamDispatcher.identity(sessionId)) {
|
|
636
|
+
throw Object.assign(new Error('The native Team identity is unavailable. Restore its Team profile and adapter before continuing.'), { code: 'TEAM_SERVICE_UNAVAILABLE' });
|
|
637
|
+
}
|
|
342
638
|
if (config.adapterId === 'dsh') {
|
|
343
639
|
const selection = dshSelection;
|
|
344
640
|
if (sessionId !== '' && (selection.modelId !== undefined || selection.effortId !== undefined)) {
|
|
345
641
|
registry.setSession(sessionId, { adapterId: 'dsh', ...selection });
|
|
346
642
|
}
|
|
347
|
-
|
|
643
|
+
// Native-session output translation wraps only DSH's own Provider stream:
|
|
644
|
+
// preserve text/reasoning and attach the translation record; the client renders it.
|
|
645
|
+
if (!isSessionTranslationLlmRequest(value)
|
|
646
|
+
&& translation !== undefined
|
|
647
|
+
&& translation.enabled
|
|
648
|
+
&& (config.translationEnabled ?? translation.nativeEnabled === true)
|
|
649
|
+
&& sessionId !== ''
|
|
650
|
+
&& !isAssistantSession(sessionId)
|
|
651
|
+
&& readNativeSessionHeader(nativeSessions, sessionId)?.origin !== 'subagent') {
|
|
652
|
+
yield* guardDshNativeStream(() => translateNativeStream(magpieSessionRouting.wrap(sessionId, next()), translation, translation.bilingual === true, isAbortSignal(value?.signal) ? value.signal : undefined));
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
yield* guardDshNativeStream(() => magpieSessionRouting.wrap(sessionId, next()));
|
|
348
656
|
return;
|
|
349
657
|
}
|
|
350
658
|
const cwd = resolveSessionCwd(context.services.nativeSessions, sessionId, value);
|
|
351
|
-
const turnInput = extractTurnInput(messages, context.services.dshContext);
|
|
659
|
+
const turnInput = extractTurnInput(messages, context.services.dshContext, teamInputs.take(sessionId, messages));
|
|
352
660
|
const turnOptions = readCliTurnOptions(value);
|
|
353
661
|
const runtimeEnv = readCliRuntimeEnv(value);
|
|
354
|
-
const requestSignal = isAbortSignal(value?.signal)
|
|
662
|
+
const requestSignal = isAbortSignal(value?.signal)
|
|
663
|
+
? AbortSignal.any([value.signal, lifetime.signal])
|
|
664
|
+
: lifetime.signal;
|
|
665
|
+
const translationLanguage = translation?.enabled && isSessionTranslationInputEnabled(translation, config.adapterId) && config.translationEnabled === true ? readInputTargetLanguage(translation) : undefined;
|
|
355
666
|
let translatedPrompt = turnInput.translationPrompt;
|
|
356
|
-
if (turnInput.translatePrompt &&
|
|
667
|
+
if (turnInput.translatePrompt && turnInput.translationPrompt.trim() !== '' && translationLanguage !== undefined) {
|
|
357
668
|
try {
|
|
358
|
-
translatedPrompt = await
|
|
669
|
+
translatedPrompt = (await translationRecovery.translateInput(sessionId, config.adapterId, turnInput.translationPrompt, requestSignal)).translated;
|
|
359
670
|
}
|
|
360
|
-
catch {
|
|
361
|
-
|
|
362
|
-
|
|
671
|
+
catch (error) {
|
|
672
|
+
if (!(error instanceof SessionTranslationCancelled) && !requestSignal?.aborted)
|
|
673
|
+
throw error;
|
|
674
|
+
yield { type: 'finish', reason: { kind: 'stop' } };
|
|
675
|
+
return;
|
|
363
676
|
}
|
|
364
677
|
}
|
|
365
678
|
const prompt = turnInput.translatePrompt
|
|
366
|
-
? [translatedPrompt, turnInput.untranslatedPrompt].filter((part) => part.trim() !== '').join('\n\n')
|
|
679
|
+
? [translatedPrompt, translationLanguage === undefined ? turnInput.untranslatedPrompt : attachmentNotices(turnInput.attachments, translationLanguage)].filter((part) => part.trim() !== '').join('\n\n')
|
|
367
680
|
: turnInput.prompt;
|
|
368
681
|
// 权限状态必须与 DSH 会话当前生效值同源。驱动不能自行假设“完全权限”,
|
|
369
682
|
// 也不能把缺省当成“已确认无限制”:解析失败时留空,由驱动沿用保守默认。
|
|
370
683
|
const permission = resolveSessionPermission(context.services.dshContext, sessionId);
|
|
684
|
+
let magpieCodexContextWindow;
|
|
685
|
+
if (config.adapterId === 'codex' && config.modelId !== undefined && typeof magpieUsage.readModelMetadata === 'function') {
|
|
686
|
+
try {
|
|
687
|
+
magpieCodexContextWindow = (await magpieUsage.readModelMetadata('codex', config.modelId, requestSignal))?.contextWindow;
|
|
688
|
+
}
|
|
689
|
+
catch (error) {
|
|
690
|
+
if (!requestSignal.aborted)
|
|
691
|
+
throw error;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
371
694
|
// 只有 Provider 驱动明确声明可以维护连续事件流,才把工具边界映射为 DSH step。
|
|
372
695
|
// Command Code、Codex 自己维护 assistant 消息边界;OpenCode 由 Registry
|
|
373
696
|
// 挂起并续读同一条 SSE。其他驱动仍把整轮保持在一个 step,避免 token-meter
|
|
@@ -376,6 +699,8 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
376
699
|
sessionId,
|
|
377
700
|
messages: turnInput.messages,
|
|
378
701
|
prompt,
|
|
702
|
+
...(turnInput.peerInput ? { peerInput: true } : {}),
|
|
703
|
+
...(translationLanguage === undefined ? {} : { translationLanguage }),
|
|
379
704
|
...(turnInput.attachments.length === 0 ? {} : { attachments: turnInput.attachments }),
|
|
380
705
|
...(permission === undefined ? {} : { permission }),
|
|
381
706
|
...(turnOptions.plan === true ? { plan: true } : {}),
|
|
@@ -383,6 +708,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
383
708
|
...(turnOptions.enableAskUserQuestion === true ? { enableAskUserQuestion: true } : {}),
|
|
384
709
|
...(runtimeEnv === undefined ? {} : { runtimeEnv }),
|
|
385
710
|
...(config.modelId ? { modelId: config.modelId } : {}),
|
|
711
|
+
...(magpieCodexContextWindow === undefined ? {} : { modelContextWindow: magpieCodexContextWindow }),
|
|
386
712
|
...(config.effortId ? { effortId: config.effortId } : {}),
|
|
387
713
|
...(config.serviceTierId ? { serviceTierId: config.serviceTierId } : {}),
|
|
388
714
|
...(config.translationEnabled === undefined ? {} : { translationEnabled: config.translationEnabled }),
|
|
@@ -411,6 +737,12 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
411
737
|
respondQuestion: (response) => registry.respondQuestion(sessionId, response),
|
|
412
738
|
...(translation === undefined ? {} : { translation }),
|
|
413
739
|
...(translation === undefined ? {} : { translationEnabled: config.translationEnabled === true }),
|
|
740
|
+
prefetchQuestionTranslation: questions => {
|
|
741
|
+
const fields = questionTranslationFields(questions);
|
|
742
|
+
if (fields.length === 0)
|
|
743
|
+
return;
|
|
744
|
+
interactionTranslation.prefetch({ sessionId, direction: 'output', fields });
|
|
745
|
+
},
|
|
414
746
|
});
|
|
415
747
|
const discardSuspendedTurn = () => registry.discardSegmentedTurn(sessionId);
|
|
416
748
|
input.signal?.addEventListener('abort', discardSuspendedTurn, { once: true });
|
|
@@ -472,6 +804,11 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
472
804
|
// DSH 先停用设置上下文再执行异步资源清理时,旧的写队列不能继续调用
|
|
473
805
|
// configEditor,否则会出现 inactive context 并污染退出日志。
|
|
474
806
|
sessionStore.dispose();
|
|
807
|
+
// Close native interaction cards before unloading their provider transports.
|
|
808
|
+
lifetime.abort();
|
|
809
|
+
updates.dispose();
|
|
810
|
+
magpieUpdates.dispose();
|
|
811
|
+
await management.dispose();
|
|
475
812
|
await registry.dispose();
|
|
476
813
|
await sessionStore.flush();
|
|
477
814
|
setAdapterRegistry(undefined);
|
|
@@ -526,12 +863,13 @@ function createExternalSessionStatusPublisher(events, registry, sessionStore) {
|
|
|
526
863
|
* `messages`,会直接抛出只读属性异常。`agent/pre-step` 返回的新消息保留用户原文,并把
|
|
527
864
|
* 译文写入 source 元数据;外部适配器再据此构造发给 Agent 的译文。
|
|
528
865
|
*/
|
|
529
|
-
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation) {
|
|
866
|
+
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation, translationRecovery, promptTranslation, nativeSessions, teamInputs) {
|
|
530
867
|
if (dshContext === undefined || typeof dshContext.on !== 'function')
|
|
531
868
|
return;
|
|
532
869
|
const disposers = [];
|
|
533
870
|
const register = (name, listener) => {
|
|
534
|
-
|
|
871
|
+
// Wrap existing pre-step producers so their after-next catalogs are visible.
|
|
872
|
+
const disposer = dshContext.on(name, listener, { global: true, prepend: name === 'agent/pre-step' });
|
|
535
873
|
if (typeof disposer === 'function')
|
|
536
874
|
disposers.push(disposer);
|
|
537
875
|
};
|
|
@@ -553,10 +891,15 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
553
891
|
catch {
|
|
554
892
|
return config;
|
|
555
893
|
}
|
|
894
|
+
if (session.adapterId === 'dsh' && session.teamId && session.providerId && session.modelId) {
|
|
895
|
+
const { reasoningEffort: _effort, ...nativeConfig } = config;
|
|
896
|
+
return { ...nativeConfig, provider: session.providerId, model: session.modelId, ...(session.effortId ? { reasoningEffort: session.effortId } : {}) };
|
|
897
|
+
}
|
|
898
|
+
const providerAdapter = fromCliProviderId(config.provider);
|
|
556
899
|
const configuredAdapter = session.adapterId !== 'dsh' && registry.isEnabled(session.adapterId)
|
|
557
900
|
? session.adapterId
|
|
558
|
-
:
|
|
559
|
-
?
|
|
901
|
+
: providerAdapter !== undefined && registry.isEnabled(providerAdapter)
|
|
902
|
+
? providerAdapter
|
|
560
903
|
: undefined;
|
|
561
904
|
if (configuredAdapter === undefined)
|
|
562
905
|
return config;
|
|
@@ -567,7 +910,12 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
567
910
|
});
|
|
568
911
|
}
|
|
569
912
|
const model = session.modelId?.trim() || (typeof config.model === 'string' && config.model.trim() !== '' ? config.model.trim() : configuredAdapter);
|
|
570
|
-
|
|
913
|
+
// reasoningEffort 属于被改写掉的那条 DSH 原生路由(例如全局默认模型 glor/deepseek-v4.1-flash
|
|
914
|
+
// 的 max)。外部 CLI 的虚拟 Provider 不声明任何思考强度,DSH 会在准入阶段以
|
|
915
|
+
// UNSUPPORTED_REASONING_EFFORT 拒绝整轮;外部 Agent 的思考强度由适配器自己的
|
|
916
|
+
// effortId 偏好驱动,因此这里必须丢弃继承值,只改写 provider/model。
|
|
917
|
+
const { reasoningEffort: _inheritedReasoningEffort, ...routeConfig } = config;
|
|
918
|
+
return { ...routeConfig, provider: toCliProviderId(configuredAdapter), model };
|
|
571
919
|
});
|
|
572
920
|
register('agent/pre-step', async (payload, next) => {
|
|
573
921
|
const record = asRecord(payload);
|
|
@@ -583,20 +931,49 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
583
931
|
messages = [...delegation.value.messages];
|
|
584
932
|
}
|
|
585
933
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
934
|
+
let translatedInput;
|
|
935
|
+
try {
|
|
936
|
+
translatedInput = await translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, isAbortSignal(record?.signal) ? record.signal : undefined, nativePreStepContext(translation, registry, sessionId, nativeSessions));
|
|
937
|
+
}
|
|
938
|
+
catch (error) {
|
|
939
|
+
if (error instanceof SessionTranslationCancelled || record?.signal?.aborted === true)
|
|
940
|
+
return { kind: 'reject' };
|
|
941
|
+
throw error;
|
|
942
|
+
}
|
|
589
943
|
const decision = await next();
|
|
590
944
|
if (!isEnterPreStepDecision(decision))
|
|
591
945
|
return decision;
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
946
|
+
// Match producer-owned messages by identity. Downstream middleware may insert
|
|
947
|
+
// instructions before the human message, so a positional prefix loses data.
|
|
948
|
+
const incoming = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
949
|
+
const replaced = new Set();
|
|
950
|
+
const replacements = translatedInput ?? messages;
|
|
951
|
+
const accepted = delegation?.kind === 'rewritten' || translatedInput !== undefined
|
|
952
|
+
? decision.messages.flatMap(message => {
|
|
953
|
+
const index = incoming.findIndex((original, position) => !replaced.has(position) && (original === message || typeof original.id === 'string' && original.id === message.id
|
|
954
|
+
// Legacy callers can return detached messages without durable IDs.
|
|
955
|
+
|| original.id === undefined && message.id === undefined && original.role === message.role
|
|
956
|
+
&& original.source?.kind === message.source?.kind && original.source?.form === message.source?.form
|
|
957
|
+
&& JSON.stringify(original.content) === JSON.stringify(message.content)));
|
|
958
|
+
if (index >= 0)
|
|
959
|
+
replaced.add(index);
|
|
960
|
+
if (index < 0)
|
|
961
|
+
return [message];
|
|
962
|
+
const replacement = replacements[index];
|
|
963
|
+
return replacement === undefined ? [] : [replacement];
|
|
964
|
+
}) : decision.messages;
|
|
965
|
+
try {
|
|
966
|
+
const scope = sessionPromptScope(record?.agent, isAbortSignal(record?.signal) ? record.signal : undefined);
|
|
967
|
+
const translated = await promptTranslation.translateMessages(accepted, scope);
|
|
968
|
+
if (registry.getSession(sessionId).adapterId !== 'dsh')
|
|
969
|
+
teamInputs?.accept(sessionId, translated);
|
|
970
|
+
return { ...decision, messages: translated };
|
|
971
|
+
}
|
|
972
|
+
catch (error) {
|
|
973
|
+
if (error instanceof SessionTranslationCancelled || record?.signal?.aborted === true)
|
|
974
|
+
return { kind: 'reject' };
|
|
975
|
+
throw error;
|
|
976
|
+
}
|
|
600
977
|
});
|
|
601
978
|
// 正常结束、异常结束和中断最终都会进入 idle;在此清理本轮授权,避免下一轮
|
|
602
979
|
// 没有 carrier 时继承上一轮的目标白名单。
|
|
@@ -606,12 +983,16 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
606
983
|
if (record?.status === 'running')
|
|
607
984
|
publishExternalStatus(sessionId, true);
|
|
608
985
|
else if (record?.status === 'idle') {
|
|
986
|
+
translationRecovery.cancelSession(sessionId);
|
|
609
987
|
publishExternalStatus(sessionId, false);
|
|
610
988
|
clearDelegationAuthorization(sessionId);
|
|
611
989
|
}
|
|
612
990
|
});
|
|
613
991
|
register('agent/disposed', (payload) => {
|
|
614
992
|
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
993
|
+
teamInputs?.release(sessionId);
|
|
994
|
+
getSubagentBridge()?.revokeTeamSession?.(sessionId);
|
|
995
|
+
translationRecovery.cancelSession(sessionId);
|
|
615
996
|
// disposed 只代表运行时释放;subagentCatalog 没有删除语义,保留目录项并
|
|
616
997
|
// 把它标成 idle,后续若 DSH 重新激活会再次收到 running。
|
|
617
998
|
publishExternalStatus(sessionId, false);
|
|
@@ -711,12 +1092,25 @@ function normalizeDshModelGroup(value) {
|
|
|
711
1092
|
/**
|
|
712
1093
|
* DSH 原生 Provider 可能只返回一个 finish(stop)。不能把这个空回合当作成功,
|
|
713
1094
|
* 否则 Session 会落下一条空 assistant/message,用户只能看到“一秒结束”。
|
|
1095
|
+
*
|
|
1096
|
+
* error finish 携带 Provider 的真实失败原因(状态码、上游错误消息、错误码),
|
|
1097
|
+
* 必须原样透传:替换成统一文案会把 400/429/凭证失效等不同故障折叠成同一句
|
|
1098
|
+
* “未返回任何有效事件”,既无法排查也不可分类告警。统一兜底文案只用于一种
|
|
1099
|
+
* 情形——流以 stop(或无 finish)干净结束且没有任何有效事件,此时没有任何
|
|
1100
|
+
* 原始错误可透传。
|
|
714
1101
|
*/
|
|
715
1102
|
async function* guardDshNativeStream(next) {
|
|
716
1103
|
let meaningful = false;
|
|
717
1104
|
const terminal = [];
|
|
718
1105
|
for await (const chunk of next()) {
|
|
719
1106
|
if (isDshFinishChunk(chunk)) {
|
|
1107
|
+
// error finish 本身就是“有效事件”:立即透传,并标记 meaningful,
|
|
1108
|
+
// 让此前缓冲的非 error finish(正常情况下不会出现)也在收尾时放出。
|
|
1109
|
+
if (isDshErrorFinishChunk(chunk)) {
|
|
1110
|
+
meaningful = true;
|
|
1111
|
+
yield chunk;
|
|
1112
|
+
continue;
|
|
1113
|
+
}
|
|
720
1114
|
terminal.push(chunk);
|
|
721
1115
|
continue;
|
|
722
1116
|
}
|
|
@@ -745,15 +1139,20 @@ function isDshFinishChunk(value) {
|
|
|
745
1139
|
const record = asRecord(value);
|
|
746
1140
|
return record?.type === 'finish';
|
|
747
1141
|
}
|
|
1142
|
+
/** error finish(reason.kind === 'error')携带 Provider 的原始失败,是必须透传的有效事件。 */
|
|
1143
|
+
function isDshErrorFinishChunk(value) {
|
|
1144
|
+
const record = asRecord(value);
|
|
1145
|
+
return record?.type === 'finish' && asRecord(record.reason)?.kind === 'error';
|
|
1146
|
+
}
|
|
748
1147
|
function isMeaningfulDshChunk(value) {
|
|
749
1148
|
const record = asRecord(value);
|
|
750
1149
|
if (record === null)
|
|
751
1150
|
return false;
|
|
752
|
-
if (record.type === 'text-delta' || record.type === 'reasoning-delta' || record.type === 'usage' || record.type === 'tool-call' || record.type === 'tool-result')
|
|
1151
|
+
if (record.type === 'text-delta' || record.type === 'reasoning-delta' || record.type === 'usage' || record.type === 'tool-call-delta' || record.type === 'tool-call' || record.type === 'tool-result')
|
|
753
1152
|
return true;
|
|
754
1153
|
if (record.type === 'block-end') {
|
|
755
1154
|
const block = asRecord(record.block);
|
|
756
|
-
return typeof block?.text === 'string' && block.text !== '';
|
|
1155
|
+
return block?.type === 'tool-call' || block?.type === 'tool-result' || typeof block?.text === 'string' && block.text !== '';
|
|
757
1156
|
}
|
|
758
1157
|
return false;
|
|
759
1158
|
}
|
|
@@ -766,10 +1165,12 @@ function readAdapterId(value) {
|
|
|
766
1165
|
function readSubscriptionRequest(value) {
|
|
767
1166
|
const record = asRecord(value);
|
|
768
1167
|
if (record === null || record.adapterId === undefined)
|
|
769
|
-
return { adapterId: 'command-code' };
|
|
1168
|
+
return { adapterId: 'command-code', includeRoute: false };
|
|
770
1169
|
const adapterId = readAdapterId(value);
|
|
771
1170
|
return {
|
|
772
1171
|
adapterId,
|
|
1172
|
+
...(typeof record.sessionId === 'string' && record.sessionId.trim() !== '' ? { sessionId: record.sessionId.trim() } : {}),
|
|
1173
|
+
includeRoute: record.includeRoute === true,
|
|
773
1174
|
...(typeof record.providerId === 'string' && record.providerId.trim() !== '' ? { providerId: record.providerId.trim() } : {}),
|
|
774
1175
|
// Antigravity 用会话模型区分 Gemini 与 Claude/GPT 两个独立配额组。
|
|
775
1176
|
...(typeof record.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
@@ -899,7 +1300,7 @@ function readCliRuntimeEnv(value) {
|
|
|
899
1300
|
const entries = Object.entries(candidate).filter(([, item]) => typeof item === 'string');
|
|
900
1301
|
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
901
1302
|
}
|
|
902
|
-
/** DSH
|
|
1303
|
+
/** Prefer the pending/next DSH route because lastUsed may still be stale. */
|
|
903
1304
|
function readModelSelectionCandidates(value) {
|
|
904
1305
|
const result = [];
|
|
905
1306
|
for (const candidate of [value, asRecord(value?.request), asRecord(value?.config), asRecord(value?.header), asRecord(asRecord(value?.record)?.rows)]) {
|
|
@@ -909,12 +1310,12 @@ function readModelSelectionCandidates(value) {
|
|
|
909
1310
|
const lastUsed = asRecord(selection?.lastUsed);
|
|
910
1311
|
const next = asRecord(selection?.next);
|
|
911
1312
|
const pending = asRecord(selection?.pending);
|
|
912
|
-
if (lastUsed !== null)
|
|
913
|
-
result.push(lastUsed);
|
|
914
|
-
if (next !== null)
|
|
915
|
-
result.push(next);
|
|
916
1313
|
if (pending !== null)
|
|
917
1314
|
result.push(pending);
|
|
1315
|
+
if (next !== null)
|
|
1316
|
+
result.push(next);
|
|
1317
|
+
if (lastUsed !== null)
|
|
1318
|
+
result.push(lastUsed);
|
|
918
1319
|
}
|
|
919
1320
|
return result;
|
|
920
1321
|
}
|
|
@@ -953,13 +1354,14 @@ function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
|
953
1354
|
function inferMessageAdapter(messages) {
|
|
954
1355
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
955
1356
|
const source = asRecord(messages[index].source);
|
|
956
|
-
// 旧会话和 DSH 原生投影的 source 形状不完全一致;只要是模型消息就读取
|
|
957
|
-
// provider,最终仍由 selectExternalAdapter 校验是否为已启用外部适配器。
|
|
958
1357
|
if (source?.kind !== 'model')
|
|
959
1358
|
continue;
|
|
960
|
-
const provider = source.provider;
|
|
961
|
-
|
|
962
|
-
|
|
1359
|
+
const provider = typeof source.provider === 'string' ? source.provider.trim() : undefined;
|
|
1360
|
+
// Legacy raw providers need explicit plugin metadata; native API brands can
|
|
1361
|
+
// have the same names as CLI adapters. The latest model source is decisive.
|
|
1362
|
+
return fromCliProviderId(provider)
|
|
1363
|
+
?? (typeof source.adapterId === 'string' ? source.adapterId : undefined)
|
|
1364
|
+
?? (source.plugin === 'codingns4dsh' ? provider : undefined);
|
|
963
1365
|
}
|
|
964
1366
|
return undefined;
|
|
965
1367
|
}
|
|
@@ -974,18 +1376,20 @@ async function setAdapterEnabled(settings, registry, value) {
|
|
|
974
1376
|
return { adapterId, enabled };
|
|
975
1377
|
}
|
|
976
1378
|
/** 运行中的外部 Agent 插话也必须经过同一条输入翻译路径。 */
|
|
977
|
-
async function translateSteerPrompt(
|
|
1379
|
+
async function translateSteerPrompt(translationRecovery, registry, sessionId, prompt, followUp, signal) {
|
|
978
1380
|
const session = registry.getSession(sessionId);
|
|
979
1381
|
let translated = prompt;
|
|
980
|
-
if (
|
|
1382
|
+
if (session.translationEnabled === true) {
|
|
981
1383
|
try {
|
|
982
|
-
translated = await
|
|
1384
|
+
translated = (await translationRecovery.translateInput(sessionId, session.adapterId, prompt, signal)).translated;
|
|
983
1385
|
}
|
|
984
|
-
catch {
|
|
985
|
-
|
|
986
|
-
|
|
1386
|
+
catch (error) {
|
|
1387
|
+
if (error instanceof SessionTranslationCancelled)
|
|
1388
|
+
return;
|
|
1389
|
+
throw error;
|
|
987
1390
|
}
|
|
988
1391
|
}
|
|
1392
|
+
signal?.throwIfAborted();
|
|
989
1393
|
await registry.steer(sessionId, translated, followUp);
|
|
990
1394
|
}
|
|
991
1395
|
/**
|
|
@@ -994,9 +1398,63 @@ async function translateSteerPrompt(translation, registry, sessionId, prompt, fo
|
|
|
994
1398
|
* DSH 随后会把返回的消息写入 `user/message`。正文只放实际发送的译文;原文和模型
|
|
995
1399
|
* 记录在 source 元数据中供 Client 详情按钮读取。外部 CLI 边界也会移除该元数据。
|
|
996
1400
|
*/
|
|
997
|
-
async function translatePreStepInput(translation, registry, sessionId, messages, dshContext, signal) {
|
|
1401
|
+
async function translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, signal, nativeSession) {
|
|
998
1402
|
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
999
1403
|
return undefined;
|
|
1404
|
+
if (messages.some(isTeamInputMessage)) {
|
|
1405
|
+
const next = [];
|
|
1406
|
+
for (const message of messages) {
|
|
1407
|
+
// Team protocol text keeps its sender and machine-owned body. Human
|
|
1408
|
+
// messages accepted at the same boundary still use submission recovery.
|
|
1409
|
+
try {
|
|
1410
|
+
const translated = isHumanUserMessage(message)
|
|
1411
|
+
? await translatePreStepInput(translation, translationRecovery, registry, sessionId, [message], dshContext, signal, nativeSession)
|
|
1412
|
+
: undefined;
|
|
1413
|
+
next.push(translated?.[0] ?? message);
|
|
1414
|
+
}
|
|
1415
|
+
catch (error) {
|
|
1416
|
+
if (!(error instanceof SessionTranslationCancelled) || signal?.aborted)
|
|
1417
|
+
throw error;
|
|
1418
|
+
// Cancelling one submission does not cancel independently accepted
|
|
1419
|
+
// Team work. Keep the original positions until pre-step producers merge.
|
|
1420
|
+
next.push(undefined);
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
return next.some((message, index) => message !== messages[index]) ? next : undefined;
|
|
1424
|
+
}
|
|
1425
|
+
const messageIndex = findLatestHumanMessage(messages);
|
|
1426
|
+
const current = messageIndex < 0 ? undefined : messages[messageIndex];
|
|
1427
|
+
if (current === undefined || readInputTranslation(current.source) !== undefined)
|
|
1428
|
+
return undefined;
|
|
1429
|
+
if (nativeSession !== undefined) {
|
|
1430
|
+
// DSH 原生会话:消息本身就是发给 Provider 的正文,直接替换为译文并把原文留在元数据。
|
|
1431
|
+
if (nativeSession.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, nativeSession.adapterId))
|
|
1432
|
+
return undefined;
|
|
1433
|
+
const input = extractTurnInput(messages, dshContext);
|
|
1434
|
+
if (input.prompt.trim() === '')
|
|
1435
|
+
return undefined;
|
|
1436
|
+
const result = await translationRecovery.translateInput(sessionId, nativeSession.adapterId, input.translationPrompt, signal);
|
|
1437
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))].filter((part) => part.trim() !== '').join('\n\n').trim();
|
|
1438
|
+
if (translated === '')
|
|
1439
|
+
return undefined;
|
|
1440
|
+
const record = {
|
|
1441
|
+
original: input.prompt,
|
|
1442
|
+
translated,
|
|
1443
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1444
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1445
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1446
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1447
|
+
...readSessionTranslationMetrics(result),
|
|
1448
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1449
|
+
};
|
|
1450
|
+
const next = [...messages];
|
|
1451
|
+
next[messageIndex] = {
|
|
1452
|
+
...current,
|
|
1453
|
+
content: result.failed ? current.content : replaceInputTranslationContent(nativeTranslationContent(current.content, dshContext), translated),
|
|
1454
|
+
source: { ...(current.source ?? {}), kind: 'user', codingnsTranslationInput: record },
|
|
1455
|
+
};
|
|
1456
|
+
return next;
|
|
1457
|
+
}
|
|
1000
1458
|
let session;
|
|
1001
1459
|
try {
|
|
1002
1460
|
session = registry.getSession(sessionId);
|
|
@@ -1004,39 +1462,13 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1004
1462
|
catch {
|
|
1005
1463
|
return undefined;
|
|
1006
1464
|
}
|
|
1007
|
-
if (session.adapterId === 'dsh' || session.translationEnabled !== true)
|
|
1008
|
-
return undefined;
|
|
1009
|
-
const messageIndex = findLatestHumanMessage(messages);
|
|
1010
|
-
const current = messageIndex < 0 ? undefined : messages[messageIndex];
|
|
1011
|
-
if (current === undefined || readInputTranslation(current.source) !== undefined)
|
|
1465
|
+
if (session.adapterId === 'dsh' || session.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, session.adapterId))
|
|
1012
1466
|
return undefined;
|
|
1013
1467
|
const input = extractTurnInput(messages, dshContext);
|
|
1014
|
-
if (input.
|
|
1468
|
+
if (input.prompt.trim() === '')
|
|
1015
1469
|
return undefined;
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
let alreadyTargetLanguage = false;
|
|
1019
|
-
let translationModel;
|
|
1020
|
-
let translationFailed = false;
|
|
1021
|
-
try {
|
|
1022
|
-
if (translation.translateInputDetailed !== undefined) {
|
|
1023
|
-
const detailed = await translation.translateInputDetailed(session.adapterId, input.translationPrompt, signal, true);
|
|
1024
|
-
translatedNatural = detailed.translated;
|
|
1025
|
-
translationSourceLanguage = detailed.sourceLanguage;
|
|
1026
|
-
alreadyTargetLanguage = detailed.alreadyTargetLanguage === true;
|
|
1027
|
-
translationModel = detailed.model;
|
|
1028
|
-
translationFailed = detailed.failed === true;
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
translatedNatural = await translation.translateInput(session.adapterId, input.translationPrompt, signal, true);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
catch {
|
|
1035
|
-
// 翻译只是增强能力;异常时保持现有外部 Agent 回合继续使用原文。
|
|
1036
|
-
translatedNatural = input.translationPrompt;
|
|
1037
|
-
translationFailed = true;
|
|
1038
|
-
}
|
|
1039
|
-
const translated = [translatedNatural, input.untranslatedPrompt]
|
|
1470
|
+
const result = await translationRecovery.translateInput(sessionId, session.adapterId, input.translationPrompt, signal);
|
|
1471
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))]
|
|
1040
1472
|
.filter((part) => part.trim() !== '')
|
|
1041
1473
|
.join('\n\n')
|
|
1042
1474
|
.trim();
|
|
@@ -1045,11 +1477,12 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1045
1477
|
const record = {
|
|
1046
1478
|
original: input.prompt,
|
|
1047
1479
|
translated,
|
|
1048
|
-
...(
|
|
1049
|
-
targetLanguage: translation
|
|
1050
|
-
...(alreadyTargetLanguage ? { alreadyTargetLanguage: true } : {}),
|
|
1051
|
-
...(
|
|
1052
|
-
...(
|
|
1480
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1481
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1482
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1483
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1484
|
+
...readSessionTranslationMetrics(result),
|
|
1485
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1053
1486
|
};
|
|
1054
1487
|
const next = [...messages];
|
|
1055
1488
|
next[messageIndex] = {
|
|
@@ -1062,7 +1495,285 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1062
1495
|
};
|
|
1063
1496
|
return next;
|
|
1064
1497
|
}
|
|
1065
|
-
|
|
1498
|
+
/** 旧测试替身没有 inputLanguage 时沿用历史默认值英语。 */
|
|
1499
|
+
function readInputTargetLanguage(translation) {
|
|
1500
|
+
const language = translation.inputLanguage;
|
|
1501
|
+
return language === undefined ? 'en' : language;
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* 判断本次 pre-step 是否按 DSH 原生会话翻译。
|
|
1505
|
+
*
|
|
1506
|
+
* 原生会话的翻译记录来自全局 `nativeEnabled` 与适配器偏好(会话索引对 `dsh` 不落盘),
|
|
1507
|
+
* 子代理与插件自己的助理会话必须排除,避免把内部执行流水线翻译掉。
|
|
1508
|
+
*/
|
|
1509
|
+
function nativePreStepContext(translation, registry, sessionId, nativeSessions) {
|
|
1510
|
+
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
1511
|
+
return undefined;
|
|
1512
|
+
if (isAssistantSession(sessionId))
|
|
1513
|
+
return undefined;
|
|
1514
|
+
if (readNativeSessionHeader(nativeSessions, sessionId)?.origin === 'subagent')
|
|
1515
|
+
return undefined;
|
|
1516
|
+
let session;
|
|
1517
|
+
try {
|
|
1518
|
+
session = registry.getSession(sessionId);
|
|
1519
|
+
}
|
|
1520
|
+
catch {
|
|
1521
|
+
return undefined;
|
|
1522
|
+
}
|
|
1523
|
+
if (session.adapterId !== DSH_NATIVE_SESSION_ADAPTER_ID)
|
|
1524
|
+
return undefined;
|
|
1525
|
+
return {
|
|
1526
|
+
adapterId: DSH_NATIVE_SESSION_ADAPTER_ID,
|
|
1527
|
+
// 会话级开关优先;用户没有单独设置过该会话时跟随「DSH 原生会话」总开关。
|
|
1528
|
+
translationEnabled: session.translationEnabled ?? translation.nativeEnabled === true,
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
function readOptionalText(value) {
|
|
1532
|
+
return typeof value === 'string' ? value.trim() || undefined : undefined;
|
|
1533
|
+
}
|
|
1534
|
+
/** 原生 Provider 选中的模型,用于在 Magpie 会话身份可读之前判断该模型是否由 Magpie 提供。 */
|
|
1535
|
+
function readNativeModelSelection(nativeSessions, sessionId) {
|
|
1536
|
+
if (nativeSessions === undefined)
|
|
1537
|
+
return undefined;
|
|
1538
|
+
let session;
|
|
1539
|
+
try {
|
|
1540
|
+
session = nativeSessions.get(sessionId);
|
|
1541
|
+
}
|
|
1542
|
+
catch {
|
|
1543
|
+
return undefined;
|
|
1544
|
+
}
|
|
1545
|
+
const root = asRecord(session);
|
|
1546
|
+
const selection = asRecord(root?.modelSelection) ?? asRecord(asRecord(asRecord(root?.record)?.rows)?.modelSelection);
|
|
1547
|
+
const value = asRecord(selection?.val) ?? selection;
|
|
1548
|
+
// 待用的 pending/next 优先;lastUsed 可能仍描述上一个模型。
|
|
1549
|
+
for (const candidate of [asRecord(value?.pending), asRecord(value?.next), asRecord(value?.lastUsed)]) {
|
|
1550
|
+
const modelId = readOptionalText(candidate?.model);
|
|
1551
|
+
if (modelId === undefined)
|
|
1552
|
+
continue;
|
|
1553
|
+
const providerId = readOptionalText(candidate?.provider);
|
|
1554
|
+
return providerId === undefined ? { modelId } : { providerId, modelId };
|
|
1555
|
+
}
|
|
1556
|
+
return undefined;
|
|
1557
|
+
}
|
|
1558
|
+
/** Magpie 网关只监听本机回环;Provider 指向这里时才算 Magpie 自己的路由。 */
|
|
1559
|
+
const MAGPIE_GATEWAY_HOSTS = new Set(['127.0.0.1', 'localhost', '[::1]', '::1']);
|
|
1560
|
+
function isMagpieGateway(baseUrl) {
|
|
1561
|
+
try {
|
|
1562
|
+
const target = new URL(baseUrl);
|
|
1563
|
+
// 端口由 `magpie web` 绑定(默认 3425),配置里改端口也应视为同一网关,
|
|
1564
|
+
// 因此这里只要求回环地址,不再硬编码端口。
|
|
1565
|
+
return MAGPIE_GATEWAY_HOSTS.has(target.hostname);
|
|
1566
|
+
}
|
|
1567
|
+
catch {
|
|
1568
|
+
return false;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Provider ID 本身可能是任意用户命名,因此先看 DSH 配置里的 baseURL;
|
|
1573
|
+
* 配置读不到时只接受与 `readDshDefaultProvider()` 相同的 Magpie 名称约定。
|
|
1574
|
+
*/
|
|
1575
|
+
function isMagpieGatewayProvider(providerId) {
|
|
1576
|
+
const source = readDshProviderSource(providerId);
|
|
1577
|
+
if (source !== null)
|
|
1578
|
+
return isMagpieGateway(source.baseUrl);
|
|
1579
|
+
return /^magpie(?:[-_.].*)?$/iu.test(providerId);
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* 读到用量之后仍然要判断「这个模型是不是 Magpie 的」。
|
|
1583
|
+
*
|
|
1584
|
+
* `magpieUsage.read()` 只有在会话身份(Provider 会话 ID 或 DSH 会话 ID)已经出现在
|
|
1585
|
+
* Magpie 账本里时才返回快照。新会话的首个请求可能还没被 Magpie Web 记账,或者两边的
|
|
1586
|
+
* 会话 ID 在滚动升级期间并不相等,这时返回 null 会让 Host 直接回退到官方余量。
|
|
1587
|
+
* 只有确认模型由 Magpie 提供时才下发占位快照,避免官方数字抢占首屏。
|
|
1588
|
+
*/
|
|
1589
|
+
async function pendingMagpieUsage(magpie, nativeSessions, sessionId, session, signal) {
|
|
1590
|
+
const agent = magpieAgentForAdapter(session.adapterId);
|
|
1591
|
+
const modelId = session.modelId?.trim();
|
|
1592
|
+
if (agent === null || modelId === undefined || modelId === '')
|
|
1593
|
+
return null;
|
|
1594
|
+
try {
|
|
1595
|
+
const selectedProviderId = session.providerId?.trim();
|
|
1596
|
+
const providerId = selectedProviderId === undefined || selectedProviderId === ''
|
|
1597
|
+
? readNativeModelSelection(nativeSessions, sessionId)?.providerId
|
|
1598
|
+
: selectedProviderId;
|
|
1599
|
+
if (providerId === undefined || !isMagpieGatewayProvider(providerId))
|
|
1600
|
+
return null;
|
|
1601
|
+
const confirmed = await magpie.readModelMetadata(session.adapterId, modelId, signal);
|
|
1602
|
+
signal.throwIfAborted();
|
|
1603
|
+
return confirmed === null ? null : pendingMagpieSnapshot(agent, modelId);
|
|
1604
|
+
}
|
|
1605
|
+
catch {
|
|
1606
|
+
// 目录不可读、超时或请求被取消:保持原有回退语义,不伪造 Magpie 用量。
|
|
1607
|
+
return null;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
/** Magpie 已经确认提供该模型、但会话身份还读不到时下发的占位快照。 */
|
|
1611
|
+
function pendingMagpieSnapshot(agent, modelId) {
|
|
1612
|
+
const capturedAt = new Date().toISOString();
|
|
1613
|
+
return {
|
|
1614
|
+
agent,
|
|
1615
|
+
modelId,
|
|
1616
|
+
capturedAt,
|
|
1617
|
+
usageStatus: 'unavailable',
|
|
1618
|
+
aggregate: null,
|
|
1619
|
+
sessionId: null,
|
|
1620
|
+
session: null,
|
|
1621
|
+
routeStatus: 'not-requested',
|
|
1622
|
+
route: null,
|
|
1623
|
+
upstreamProvider: null,
|
|
1624
|
+
upstreamProviders: [],
|
|
1625
|
+
// 客户端据此在 3 秒内带路由补读,而不是停留在官方余额上。
|
|
1626
|
+
quotaStatus: 'provider-unavailable',
|
|
1627
|
+
quotas: [],
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
/** 读取原生会话 header;测试替身或会话尚未装载时返回 undefined。 */
|
|
1631
|
+
function readNativeSessionHeader(nativeSessions, sessionId) {
|
|
1632
|
+
if (nativeSessions === undefined)
|
|
1633
|
+
return undefined;
|
|
1634
|
+
try {
|
|
1635
|
+
return asRecord(asRecord(nativeSessions.get(sessionId))?.header) ?? undefined;
|
|
1636
|
+
}
|
|
1637
|
+
catch {
|
|
1638
|
+
return undefined;
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
/** 插件自己的全局助理会话不属于用户对话,不能被翻译改写。 */
|
|
1642
|
+
function isAssistantSession(sessionId) {
|
|
1643
|
+
// 复用助理适配器导出的会话前缀常量:会话身份的唯一定义在那里,重复字面量会漂移。
|
|
1644
|
+
return sessionId.startsWith(ASSISTANT_AGENT_PREFIX);
|
|
1645
|
+
}
|
|
1646
|
+
/** Translate completed native output blocks without buffering their visible deltas. */
|
|
1647
|
+
async function* translateNativeStream(stream, translation, bilingual, signal) {
|
|
1648
|
+
const blocks = new Map();
|
|
1649
|
+
const bufferOf = (index, kind) => {
|
|
1650
|
+
const existing = blocks.get(index);
|
|
1651
|
+
if (existing !== undefined)
|
|
1652
|
+
return existing.kind === kind && !existing.closed ? existing : undefined;
|
|
1653
|
+
const created = {
|
|
1654
|
+
index, kind, text: '', closed: false,
|
|
1655
|
+
translate: translation.shouldTranslate(DSH_NATIVE_SESSION_ADAPTER_ID, kind === 'reasoning' ? 'reasoning' : 'assistant', true),
|
|
1656
|
+
};
|
|
1657
|
+
blocks.set(index, created);
|
|
1658
|
+
return created;
|
|
1659
|
+
};
|
|
1660
|
+
const translateBlock = async (block) => {
|
|
1661
|
+
const original = block.text;
|
|
1662
|
+
if (original.trim() === '')
|
|
1663
|
+
return undefined;
|
|
1664
|
+
const kind = block.kind === 'reasoning' ? 'reasoning' : 'assistant';
|
|
1665
|
+
let record;
|
|
1666
|
+
try {
|
|
1667
|
+
const result = await translation.translateOutput(DSH_NATIVE_SESSION_ADAPTER_ID, kind, original, signal, true);
|
|
1668
|
+
if (result !== null && result !== undefined) {
|
|
1669
|
+
record = {
|
|
1670
|
+
original: result.original,
|
|
1671
|
+
translated: result.translated,
|
|
1672
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1673
|
+
targetLanguage: result.targetLanguage,
|
|
1674
|
+
outputKind: kind,
|
|
1675
|
+
bilingual: result.bilingual,
|
|
1676
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1677
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1678
|
+
...readSessionTranslationMetrics(result),
|
|
1679
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
catch {
|
|
1684
|
+
record = { original, translated: original, targetLanguage: translation.outputLanguage ?? 'zh', outputKind: kind, bilingual, failed: true };
|
|
1685
|
+
}
|
|
1686
|
+
if (record === undefined)
|
|
1687
|
+
return undefined;
|
|
1688
|
+
const visible = formatSessionTranslationOutput(record);
|
|
1689
|
+
if (visible.trim() === '' || visible === original && record.failed !== true)
|
|
1690
|
+
return undefined;
|
|
1691
|
+
return record;
|
|
1692
|
+
};
|
|
1693
|
+
try {
|
|
1694
|
+
for await (const chunk of stream) {
|
|
1695
|
+
const record = asRecord(chunk);
|
|
1696
|
+
const type = typeof record?.type === 'string' ? record.type : '';
|
|
1697
|
+
const index = typeof record?.index === 'number' ? record.index : undefined;
|
|
1698
|
+
if (type === 'text-delta' || type === 'reasoning-delta') {
|
|
1699
|
+
if (index === undefined || typeof record?.text !== 'string') {
|
|
1700
|
+
yield chunk;
|
|
1701
|
+
continue;
|
|
1702
|
+
}
|
|
1703
|
+
const kind = type === 'text-delta' ? 'text' : 'reasoning';
|
|
1704
|
+
const block = bufferOf(index, kind);
|
|
1705
|
+
// Decide once per block: changing settings must not translate only a suffix
|
|
1706
|
+
// or drop a prefix that was already buffered.
|
|
1707
|
+
if (block === undefined || !block.translate) {
|
|
1708
|
+
yield chunk;
|
|
1709
|
+
continue;
|
|
1710
|
+
}
|
|
1711
|
+
block.text += record.text;
|
|
1712
|
+
// Keep provider deltas visible while the completed block is being translated.
|
|
1713
|
+
yield chunk;
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
if (type === 'block-end' && index !== undefined) {
|
|
1717
|
+
const block = blocks.get(index);
|
|
1718
|
+
if (block !== undefined && !block.closed) {
|
|
1719
|
+
block.closed = true;
|
|
1720
|
+
if (block.text.trim() !== '') {
|
|
1721
|
+
const translationRecord = await translateBlock(block);
|
|
1722
|
+
if (translationRecord !== undefined) {
|
|
1723
|
+
const finalBlock = asRecord(record?.block);
|
|
1724
|
+
yield {
|
|
1725
|
+
...(record ?? {}),
|
|
1726
|
+
block: {
|
|
1727
|
+
...(finalBlock ?? {}),
|
|
1728
|
+
type: block.kind,
|
|
1729
|
+
text: block.text,
|
|
1730
|
+
codingnsTranslation: translationRecord,
|
|
1731
|
+
},
|
|
1732
|
+
codingnsTranslation: translationRecord,
|
|
1733
|
+
};
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
yield chunk;
|
|
1739
|
+
continue;
|
|
1740
|
+
}
|
|
1741
|
+
yield chunk;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
catch (error) {
|
|
1745
|
+
// 流异常时先把缓存正文按原文补发,再把原始错误交给 DSH,保证回复不丢失。
|
|
1746
|
+
for (const item of flushBuffered())
|
|
1747
|
+
yield item;
|
|
1748
|
+
throw error;
|
|
1749
|
+
}
|
|
1750
|
+
for (const item of flushBuffered())
|
|
1751
|
+
yield item;
|
|
1752
|
+
/**
|
|
1753
|
+
* Provider 未发送 block-end(中断或异常)时,结束已透传的原文块。
|
|
1754
|
+
*
|
|
1755
|
+
* 不能用 `finally` 里的 `yield`:异常正在传播时生成器已经结束,后续 yield 会被
|
|
1756
|
+
* 直接丢弃,用户会看不到已经生成的半截回复。
|
|
1757
|
+
*/
|
|
1758
|
+
function* flushBuffered() {
|
|
1759
|
+
for (const block of [...blocks.values()]) {
|
|
1760
|
+
if (block.closed || block.text.trim() === '')
|
|
1761
|
+
continue;
|
|
1762
|
+
block.closed = true;
|
|
1763
|
+
yield { type: 'block-end', index: block.index, block: { type: block.kind, text: block.text } };
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
function extractTurnInput(messages, dshContext, acceptedPeerInput = pendingPeerInput(messages)) {
|
|
1768
|
+
if (acceptedPeerInput.some(isTeamInputMessage)) {
|
|
1769
|
+
const parts = acceptedPeerInput.map(message => {
|
|
1770
|
+
const part = extractMessageInput(message.content, dshContext);
|
|
1771
|
+
const translated = isHumanUserMessage(message) ? readInputTranslation(message.source) : undefined;
|
|
1772
|
+
return translated ? { ...part, prompt: translated.translated } : part;
|
|
1773
|
+
});
|
|
1774
|
+
const prompt = parts.map(part => part.prompt).filter(text => text.trim() !== '').join('\n\n');
|
|
1775
|
+
return { prompt, peerInput: true, translationPrompt: prompt, untranslatedPrompt: '', attachments: parts.flatMap(part => part.attachments), translatePrompt: false, messages: stripInputTranslationDisplay(messages) };
|
|
1776
|
+
}
|
|
1066
1777
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1067
1778
|
const message = messages[index];
|
|
1068
1779
|
if (message !== undefined && isInjectedStepNotice(message)) {
|
|
@@ -1085,9 +1796,10 @@ function extractTurnInput(messages, dshContext) {
|
|
|
1085
1796
|
: messages.filter((_candidate, candidateIndex) => !referenceIndexes.includes(candidateIndex));
|
|
1086
1797
|
const translatedInput = readInputTranslation(message.source);
|
|
1087
1798
|
if (translatedInput !== undefined) {
|
|
1799
|
+
const prompt = [translatedInput.translated, ...referenceText].join('\n\n');
|
|
1088
1800
|
return {
|
|
1089
|
-
prompt
|
|
1090
|
-
translationPrompt:
|
|
1801
|
+
prompt,
|
|
1802
|
+
translationPrompt: prompt,
|
|
1091
1803
|
untranslatedPrompt: '',
|
|
1092
1804
|
attachments: direct.attachments,
|
|
1093
1805
|
translatePrompt: false,
|
|
@@ -1120,7 +1832,7 @@ function readInputTranslation(value) {
|
|
|
1120
1832
|
return undefined;
|
|
1121
1833
|
if (candidate.original.trim() === '' || candidate.translated.trim() === '')
|
|
1122
1834
|
return undefined;
|
|
1123
|
-
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja'
|
|
1835
|
+
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja' || candidate.targetLanguage === 'zh'
|
|
1124
1836
|
? candidate.targetLanguage
|
|
1125
1837
|
: 'en';
|
|
1126
1838
|
const sourceLanguage = candidate.sourceLanguage === 'zh' || candidate.sourceLanguage === 'en' || candidate.sourceLanguage === 'fr' || candidate.sourceLanguage === 'de' || candidate.sourceLanguage === 'ja'
|
|
@@ -1170,6 +1882,19 @@ function replaceInputTranslationContent(content, text) {
|
|
|
1170
1882
|
});
|
|
1171
1883
|
return replaced ? blocks : [{ type: 'text', text }, ...content];
|
|
1172
1884
|
}
|
|
1885
|
+
/** Resolved files already have localized path notices. Leaving their file blocks
|
|
1886
|
+
* would make DSH append another, English-only file notice at adapter dispatch.
|
|
1887
|
+
* Preserve images and unresolved files so DSH retains modality/error handling.
|
|
1888
|
+
*/
|
|
1889
|
+
function nativeTranslationContent(content, dshContext) {
|
|
1890
|
+
if (!Array.isArray(content))
|
|
1891
|
+
return content;
|
|
1892
|
+
return content.filter(part => {
|
|
1893
|
+
if (!isRecord(part) || part.type !== 'file')
|
|
1894
|
+
return true;
|
|
1895
|
+
return resolveDshAttachmentPath(dshContext, 'file', isRecord(part.attachment) ? part.attachment : part) === undefined;
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1173
1898
|
/** DSH 为工具分段注入的继续提示必须成为下一次 Provider 请求的 prompt。 */
|
|
1174
1899
|
function isInjectedStepNotice(message) {
|
|
1175
1900
|
if (message.role !== 'user' || !isRecord(message.source))
|
|
@@ -1225,11 +1950,13 @@ function extractMessageInput(content, dshContext) {
|
|
|
1225
1950
|
const mimeType = typeof reference.mediaType === 'string' && reference.mediaType.trim() !== '' ? reference.mediaType.trim() : undefined;
|
|
1226
1951
|
attachments.push({ kind, path, ...(name === undefined ? {} : { name }), ...(mimeType === undefined ? {} : { mimeType }) });
|
|
1227
1952
|
}
|
|
1228
|
-
const fileNotes = attachments.filter((attachment) => attachment.kind === 'file').map((attachment) => `附件文件${attachment.name === undefined ? '' : `「${attachment.name}」`}位于:${attachment.path}\n请使用工具读取该文件的内容。`);
|
|
1229
1953
|
const translationPrompt = text.join('\n\n').trim();
|
|
1230
|
-
const untranslatedPrompt =
|
|
1954
|
+
const untranslatedPrompt = attachmentNotices(attachments);
|
|
1231
1955
|
return { prompt: [translationPrompt, untranslatedPrompt].filter(value => value !== '').join('\n\n'), translationPrompt, untranslatedPrompt, attachments };
|
|
1232
1956
|
}
|
|
1957
|
+
function attachmentNotices(attachments, language) {
|
|
1958
|
+
return attachments.filter(attachment => attachment.kind === 'file').map(attachment => attachmentFileNotice(attachment, language)).join('\n\n');
|
|
1959
|
+
}
|
|
1233
1960
|
function resolveDshAttachmentPath(dshContext, kind, reference) {
|
|
1234
1961
|
if (dshContext === undefined || typeof reference.attachmentId !== 'string')
|
|
1235
1962
|
return undefined;
|
|
@@ -1395,6 +2122,149 @@ function findCwdInValue(value, depth) {
|
|
|
1395
2122
|
}
|
|
1396
2123
|
return undefined;
|
|
1397
2124
|
}
|
|
2125
|
+
function readMagpieDashboardPeriod(payload) {
|
|
2126
|
+
const value = asRecord(payload)?.period;
|
|
2127
|
+
if (value === 'today' || value === 'week' || value === 'month' || value === 'all')
|
|
2128
|
+
return value;
|
|
2129
|
+
throw new TypeError('Magpie usage period must be today, week, month, or all');
|
|
2130
|
+
}
|
|
2131
|
+
async function* streamMagpieDashboard(service, period, signal, force, sessionStore, nativeSessions) {
|
|
2132
|
+
const names = magpieSessionNameBindings(sessionStore, nativeSessions, signal).catch(() => []);
|
|
2133
|
+
let latest;
|
|
2134
|
+
for await (const chunk of service.readDashboardStream(period, signal, force)) {
|
|
2135
|
+
latest = chunk.dashboard;
|
|
2136
|
+
yield chunk;
|
|
2137
|
+
}
|
|
2138
|
+
if (latest !== undefined) {
|
|
2139
|
+
const named = attachMagpieSessionNames(latest, await names);
|
|
2140
|
+
if (named !== latest)
|
|
2141
|
+
yield { part: 'sessions', dashboard: named, stale: false };
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
/** 探测载荷只接受可选入口路径;其余字段一律忽略,避免把参数带进命令行。 */
|
|
2145
|
+
function readMagpieDetectionRequest(payload) {
|
|
2146
|
+
const record = asRecord(payload);
|
|
2147
|
+
if (record === null || typeof record.commandPath !== 'string')
|
|
2148
|
+
return {};
|
|
2149
|
+
const commandPath = record.commandPath.trim();
|
|
2150
|
+
return commandPath === '' ? {} : { commandPath };
|
|
2151
|
+
}
|
|
2152
|
+
/** `force` 只在用户主动重新检测时出现;缺省复用短期探测结果。 */
|
|
2153
|
+
function readMagpieDetectionForce(payload) {
|
|
2154
|
+
return asRecord(payload)?.force === true;
|
|
2155
|
+
}
|
|
2156
|
+
function readMagpieRequestOptions(payload) {
|
|
2157
|
+
const record = asRecord(payload);
|
|
2158
|
+
if (record === null)
|
|
2159
|
+
throw new TypeError('Magpie request page must be an object');
|
|
2160
|
+
const period = readMagpieDashboardPeriod(record);
|
|
2161
|
+
const offset = record.offset === undefined ? 0 : record.offset;
|
|
2162
|
+
const limit = record.limit === undefined ? 50 : record.limit;
|
|
2163
|
+
if (typeof offset !== 'number' || !Number.isSafeInteger(offset) || offset < 0 || offset > 1_000_000) {
|
|
2164
|
+
throw new TypeError('Magpie request offset is out of bounds');
|
|
2165
|
+
}
|
|
2166
|
+
if (typeof limit !== 'number' || !Number.isSafeInteger(limit) || limit < 1 || limit > 100) {
|
|
2167
|
+
throw new TypeError('Magpie request limit must be between 1 and 100');
|
|
2168
|
+
}
|
|
2169
|
+
const sessionId = readOptionalMagpieIdentity(record.sessionId, 512);
|
|
2170
|
+
const sessionAgent = readOptionalMagpieIdentity(record.sessionAgent, 64);
|
|
2171
|
+
if ((sessionId === undefined) !== (sessionAgent === undefined)) {
|
|
2172
|
+
throw new TypeError('Magpie session details require both sessionId and sessionAgent');
|
|
2173
|
+
}
|
|
2174
|
+
if (sessionAgent !== undefined && !/^[a-z0-9][a-z0-9-]*$/u.test(sessionAgent)) {
|
|
2175
|
+
throw new TypeError('Magpie session Agent is invalid');
|
|
2176
|
+
}
|
|
2177
|
+
return {
|
|
2178
|
+
period,
|
|
2179
|
+
offset,
|
|
2180
|
+
limit,
|
|
2181
|
+
...(sessionId === undefined ? {} : { sessionId }),
|
|
2182
|
+
...(sessionAgent === undefined ? {} : { sessionAgent }),
|
|
2183
|
+
};
|
|
2184
|
+
}
|
|
2185
|
+
function readOptionalMagpieIdentity(value, maxLength) {
|
|
2186
|
+
if (value === undefined)
|
|
2187
|
+
return undefined;
|
|
2188
|
+
if (typeof value !== 'string')
|
|
2189
|
+
throw new TypeError('Magpie session identity must be text');
|
|
2190
|
+
const text = value.trim();
|
|
2191
|
+
if (text === '' || text.length > maxLength || /[\u0000-\u001f\u007f]/u.test(text)) {
|
|
2192
|
+
throw new TypeError('Magpie session identity is invalid');
|
|
2193
|
+
}
|
|
2194
|
+
return text;
|
|
2195
|
+
}
|
|
2196
|
+
async function magpieSessionNameBindings(sessionStore, nativeSessions, signal) {
|
|
2197
|
+
const records = sessionStore.list({ includeArchived: true });
|
|
2198
|
+
const bindings = [];
|
|
2199
|
+
const knownSessionIds = new Set();
|
|
2200
|
+
let nativeValues = nativeSessions?.list() ?? [];
|
|
2201
|
+
if (nativeSessions?.listRemote !== undefined) {
|
|
2202
|
+
try {
|
|
2203
|
+
nativeValues = await nativeSessions.listRemote(signal);
|
|
2204
|
+
}
|
|
2205
|
+
catch {
|
|
2206
|
+
signal?.throwIfAborted();
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
const nativeNames = new Map();
|
|
2210
|
+
for (const value of nativeValues) {
|
|
2211
|
+
const sessionId = nativeSessionId(value);
|
|
2212
|
+
const name = readNativeSessionDisplayName(value);
|
|
2213
|
+
if (sessionId !== undefined && name !== undefined)
|
|
2214
|
+
nativeNames.set(sessionId, name);
|
|
2215
|
+
}
|
|
2216
|
+
for (const record of records) {
|
|
2217
|
+
knownSessionIds.add(record.dshSessionId);
|
|
2218
|
+
const name = nativeNames.get(record.dshSessionId) ?? readDshSessionDisplayName(record.dshSessionId, sessionStore, nativeSessions);
|
|
2219
|
+
if (name === undefined)
|
|
2220
|
+
continue;
|
|
2221
|
+
bindings.push({
|
|
2222
|
+
dshSessionId: record.dshSessionId,
|
|
2223
|
+
adapterId: record.adapterId,
|
|
2224
|
+
...(record.providerSessionId === undefined ? {} : { providerSessionId: record.providerSessionId }),
|
|
2225
|
+
name,
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
// Native DSH sessions do not always have a CodingNS session-index record. They
|
|
2229
|
+
// still use the DSH session ID as Magpie's identity, so include their title
|
|
2230
|
+
// only when no external adapter binding claims the same DSH session.
|
|
2231
|
+
for (const value of nativeValues) {
|
|
2232
|
+
const sessionId = nativeSessionId(value);
|
|
2233
|
+
if (sessionId === undefined || knownSessionIds.has(sessionId))
|
|
2234
|
+
continue;
|
|
2235
|
+
const name = readNativeSessionDisplayName(value);
|
|
2236
|
+
if (name === undefined)
|
|
2237
|
+
continue;
|
|
2238
|
+
bindings.push({ dshSessionId: sessionId, adapterId: 'dsh', name });
|
|
2239
|
+
}
|
|
2240
|
+
return bindings;
|
|
2241
|
+
}
|
|
2242
|
+
function readDshSessionDisplayName(sessionId, sessionStore, nativeSessions) {
|
|
2243
|
+
return readNativeSessionDisplayName(nativeSessions?.get(sessionId)) ?? cleanDisplayName(sessionStore.get(sessionId)?.title);
|
|
2244
|
+
}
|
|
2245
|
+
function readNativeSessionDisplayName(value) {
|
|
2246
|
+
const root = asRecord(value);
|
|
2247
|
+
if (root === null)
|
|
2248
|
+
return undefined;
|
|
2249
|
+
const projection = asRecord(root.projections) ?? asRecord(asRecord(root.record)?.projections);
|
|
2250
|
+
const values = asRecord(projection?.values);
|
|
2251
|
+
const record = asRecord(root.record);
|
|
2252
|
+
const rows = asRecord(record?.rows);
|
|
2253
|
+
const rowProjection = asRecord(rows?.projections);
|
|
2254
|
+
const rowValues = asRecord(rowProjection?.values);
|
|
2255
|
+
for (const candidate of [values?.title, rowValues?.title, root.title, root.name, root.displayName, record?.title, record?.name]) {
|
|
2256
|
+
const title = cleanDisplayName(candidate);
|
|
2257
|
+
if (title !== undefined)
|
|
2258
|
+
return title;
|
|
2259
|
+
}
|
|
2260
|
+
return undefined;
|
|
2261
|
+
}
|
|
2262
|
+
function cleanDisplayName(value) {
|
|
2263
|
+
if (typeof value !== 'string')
|
|
2264
|
+
return undefined;
|
|
2265
|
+
const name = value.trim().replace(/[\u0000-\u001f\u007f]/gu, '').slice(0, 240);
|
|
2266
|
+
return name === '' ? undefined : name;
|
|
2267
|
+
}
|
|
1398
2268
|
function asRecord(value) { return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null; }
|
|
1399
2269
|
function isRecord(value) { return asRecord(value) !== null; }
|
|
1400
2270
|
function nativeSessionId(value) {
|