@jingyi0605/codingns4dsh 0.2.1-beta.9 → 0.2.1-rc.2
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 +8 -6
- package/README.md +11 -8
- 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 +54516 -35293
- 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} +241 -12
- 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 +65 -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 +738 -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 +1202 -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/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.map +1 -1
- package/data/build/dist/client/features/index.js +2 -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/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/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 +55 -34
- 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 +14 -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/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +22 -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/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 +98 -0
- package/data/build/dist/client/locales/usage.js.map +1 -1
- package/data/build/dist/client/magpie-model-tag.d.ts +8 -0
- package/data/build/dist/client/magpie-model-tag.d.ts.map +1 -0
- package/data/build/dist/client/magpie-model-tag.js +50 -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.map +1 -1
- package/data/build/dist/client/provider-icons.js +3 -1
- 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/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 +276 -276
- package/data/build/dist/client/subscription-slot.d.ts +6 -2
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +373 -21
- 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/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/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 +22 -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 +47 -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.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +6 -3
- 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 +18 -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 +126 -21
- 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 +4 -1
- 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 +137 -25
- 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.js +7 -4
- 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 +51 -16
- 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 +4 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +587 -101
- 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 +458 -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-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-usage.d.ts +90 -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 +986 -0
- package/data/build/dist/host/cli-adapters/magpie-usage.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 +2 -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 +16 -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/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/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 +3 -3
- 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 +204 -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 +81 -13
- 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/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.map +1 -1
- package/data/build/dist/host/rpc.js +23 -12
- 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 +31 -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 +7 -1
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +3 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/errors.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/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 +87 -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 +3 -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/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,46 @@ 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 { MagpieUsageService, magpieAgentForAdapter } from './magpie-usage.js';
|
|
25
|
+
import { createMagpieSessionRouting } from './magpie-session-routing.js';
|
|
22
26
|
import { normalizeSubagentBridgeSettings, normalizeSubscriptionUsageSettings } from '../../shared/contracts/config.js';
|
|
23
27
|
import { setAdapterRegistry } from './registry-holder.js';
|
|
24
28
|
import { createDshVirtualProviderRegistration } from './dsh-virtual-providers.js';
|
|
25
29
|
import { dispatchBridgeSubagent } from '../cli-bridge/dispatch.js';
|
|
30
|
+
import { dispatchBridgeSearch } from '../cli-bridge/search-dispatch.js';
|
|
31
|
+
import { dispatchBridgeFetch } from '../cli-bridge/fetch-dispatch.js';
|
|
26
32
|
import { startSubagentBridgeServer } from '../cli-bridge/bridge-server.js';
|
|
27
|
-
import { setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
33
|
+
import { getSubagentBridge, setSubagentBridge } from '../cli-bridge/bridge-holder.js';
|
|
28
34
|
import { delegateCapability, dispatchDelegateSubagent } from './delegate-dispatch.js';
|
|
29
35
|
import { guardNativeSubagentParentTurn, markNativeSubagentParentTurnStarted, setMaxNativeSubagentsPerParent } from './native-subagent-dispatch.js';
|
|
30
36
|
import { containsDelegationCarrier, delegationAdapterIds, rewriteDelegationMessages } from './delegation-mention-rewrite.js';
|
|
31
37
|
import { clearDelegationAuthorization, setDelegationAuthorization } from './delegation-authorization.js';
|
|
32
38
|
import { debugInfo } from '../../shared/debug.js';
|
|
33
39
|
import { hasLegacySessionAdapterHint } from './legacy-session-adapter.js';
|
|
34
|
-
import {} from '../../shared/contracts/session-translation.js';
|
|
40
|
+
import { DSH_NATIVE_SESSION_ADAPTER_ID, formatSessionTranslationOutput, readSessionTranslationMetrics, } from '../../shared/contracts/session-translation.js';
|
|
41
|
+
import { questionTranslationFields } from '../../shared/contracts/interaction-translation.js';
|
|
42
|
+
import { createInteractionTranslation } from '../features/interaction-translation.js';
|
|
43
|
+
import { createSessionTranslationRecovery, SessionTranslationCancelled } from '../features/session-translation-recovery.js';
|
|
44
|
+
import { isSessionTranslationInputEnabled } from '../features/session-translation-service.js';
|
|
45
|
+
import { ASSISTANT_AGENT_PREFIX } from '../../dsh-capabilities/host/assistant-agent-adapter.js';
|
|
46
|
+
import { createDshCapabilityRegistry } from '../../dsh-capabilities/routes.js';
|
|
47
|
+
import { attachmentFileNotice } from '../../shared/attachment-prompts.js';
|
|
48
|
+
import { sessionPromptScope } from '../../dsh-capabilities/host/session-prompt-adapter.js';
|
|
49
|
+
import { createSessionPromptTranslation } from '../features/session-prompt-translation.js';
|
|
50
|
+
import { codexPerformanceProjection } from './codex-performance-projection.js';
|
|
51
|
+
import { grokContextProjection, grokPerformanceProjection } from './grok-performance-projection.js';
|
|
52
|
+
import { fromCliProviderId, toCliProviderId } from '../../shared/cli-provider-route.js';
|
|
53
|
+
import { DshAgentTeamAdapter } from '../../dsh-capabilities/host/agent-team-adapter.js';
|
|
54
|
+
import { CodingNsTeamDispatcher } from '../cli-bridge/team-dispatch.js';
|
|
55
|
+
import { createAgentTeamTool } from '../cli-bridge/team-tool.js';
|
|
56
|
+
import { TeamInputTracker, isTeamInputMessage, pendingPeerInput } from './team-input.js';
|
|
57
|
+
import { withTeamSupport } from '../cli-bridge/team-adapters.js';
|
|
35
58
|
export function createCliAdaptersFeature(options = {}) {
|
|
36
59
|
return {
|
|
37
60
|
descriptor: {
|
|
@@ -40,8 +63,17 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
40
63
|
enabledByDefault: true,
|
|
41
64
|
dependencies: [],
|
|
42
65
|
runtime: 'host',
|
|
66
|
+
requires: [
|
|
67
|
+
{ capability: 'agent-team.external-member', required: false, fallback: 'degrade' },
|
|
68
|
+
{ capability: 'agent-team.external-lead', required: false, fallback: 'degrade' },
|
|
69
|
+
{ capability: 'session.external-model-selection', required: false, fallback: 'degrade' },
|
|
70
|
+
{ capability: 'session.external-performance', required: false, fallback: 'degrade' },
|
|
71
|
+
],
|
|
43
72
|
},
|
|
44
73
|
async start(context) {
|
|
74
|
+
const lifetime = new AbortController();
|
|
75
|
+
const magpieSessionRouting = createMagpieSessionRouting();
|
|
76
|
+
context.resources.add(() => magpieSessionRouting.dispose());
|
|
45
77
|
// 用量查询超时对所有适配器统一生效:同一个 timeoutMs 下发给全部网络读取器,
|
|
46
78
|
// 设置变更时整体重建,避免旧超时继续生效。
|
|
47
79
|
const buildSubscriptions = (settings) => {
|
|
@@ -49,11 +81,21 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
49
81
|
return new ProviderSubscriptionService({ commandCode: new CommandCodeSubscriptionService({ timeoutMs }), timeoutMs });
|
|
50
82
|
};
|
|
51
83
|
let subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
84
|
+
const magpieUsage = options.magpieUsage ?? new MagpieUsageService({ lifetimeSignal: lifetime.signal });
|
|
52
85
|
let subscriptionSettings = JSON.stringify(context.services.settings?.get().subscriptionUsage ?? null);
|
|
53
86
|
// 注入的 registry 自带 SessionStore;只有自建时才有本地 store 变量。
|
|
54
87
|
const sessionStore = options.registry?.sessionRecords
|
|
55
88
|
?? new CodingNsCliSessionStore(context.services.settings === undefined ? {} : { settings: context.services.settings });
|
|
56
89
|
const nativeSessions = context.services.nativeSessions;
|
|
90
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
91
|
+
const performance = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
92
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-performance')?.value;
|
|
93
|
+
if (performance !== undefined) {
|
|
94
|
+
for (const projection of [codexPerformanceProjection, grokPerformanceProjection, grokContextProjection]) {
|
|
95
|
+
context.resources.add(performance.install(projection));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
57
99
|
const translation = context.services.sessionTranslation;
|
|
58
100
|
// 启动只恢复持久化索引;旧会话在打开时迁移,禁止在首屏扫描全部历史。
|
|
59
101
|
const registry = options.registry ?? new CodingNsCliAdapterRegistry([
|
|
@@ -81,6 +123,45 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
81
123
|
...(context.services.nativeSessions === undefined ? {} : { nativeSessions: context.services.nativeSessions }),
|
|
82
124
|
});
|
|
83
125
|
setAdapterRegistry(registry);
|
|
126
|
+
const teamInputs = new TeamInputTracker();
|
|
127
|
+
context.resources.add(() => teamInputs.clear());
|
|
128
|
+
let teamAdapter;
|
|
129
|
+
const teamDispatcher = new CodingNsTeamDispatcher({
|
|
130
|
+
adapter: () => teamAdapter,
|
|
131
|
+
registry,
|
|
132
|
+
enabled: () => !lifetime.signal.aborted && normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled,
|
|
133
|
+
});
|
|
134
|
+
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');
|
|
135
|
+
const teamCatalog = (catalog) => withTeamSupport(catalog, !versionSupported ? 'version' : !normalizeSubagentBridgeSettings(context.services.settings?.get().subagentBridge).enabled ? 'disabled' : !teamAdapter ? 'profile' : undefined, teamAdapter?.supportsLead);
|
|
136
|
+
const dshContext = context.services.dshContext;
|
|
137
|
+
if (dshContext?.inject && context.services.dshVersion) {
|
|
138
|
+
const teamScope = dshContext.inject(['agentTeams', 'agents', 'subagents', 'tools'], scoped => {
|
|
139
|
+
const capability = createDshCapabilityRegistry(context.services.dshVersion, 'host', scoped).getProfile(scoped).capabilities.get('agent-team.external-member');
|
|
140
|
+
if (capability?.status !== 'ready')
|
|
141
|
+
return;
|
|
142
|
+
const adapter = capability.value;
|
|
143
|
+
teamAdapter = adapter;
|
|
144
|
+
const tools = scoped.get('tools');
|
|
145
|
+
const unregister = tools.register(createAgentTeamTool(teamDispatcher));
|
|
146
|
+
scoped.effect(() => () => {
|
|
147
|
+
adapter.dispose();
|
|
148
|
+
if (teamAdapter === adapter)
|
|
149
|
+
teamAdapter = undefined;
|
|
150
|
+
if (typeof unregister === 'function')
|
|
151
|
+
unregister();
|
|
152
|
+
}, 'CodingNS native Team bridge');
|
|
153
|
+
});
|
|
154
|
+
context.resources.add(() => teamScope.dispose());
|
|
155
|
+
}
|
|
156
|
+
if (dshContext?.on) {
|
|
157
|
+
const stopCreated = dshContext.on('agent/created', ((payload) => {
|
|
158
|
+
const agent = asRecord(payload)?.agent;
|
|
159
|
+
if (agent && typeof agent.id === 'string')
|
|
160
|
+
teamDispatcher.initializeNativeChild(agent);
|
|
161
|
+
}), { global: true });
|
|
162
|
+
if (typeof stopCreated === 'function')
|
|
163
|
+
context.resources.add(stopCreated);
|
|
164
|
+
}
|
|
84
165
|
context.resources.add(() => {
|
|
85
166
|
if (registry === undefined)
|
|
86
167
|
return;
|
|
@@ -88,10 +169,30 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
88
169
|
});
|
|
89
170
|
registry.applyEnabledSettings(context.services.settings?.get().agentAdapters);
|
|
90
171
|
const virtualProviders = createDshVirtualProviderRegistration(context.services.dshContext);
|
|
91
|
-
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
92
172
|
if (virtualProviders !== undefined)
|
|
93
173
|
context.resources.add(() => virtualProviders.dispose());
|
|
174
|
+
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
175
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
176
|
+
const selection = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
177
|
+
.getProfile(context.services.dshContext).capabilities.get('session.external-model-selection')
|
|
178
|
+
?.value;
|
|
179
|
+
if (selection !== undefined)
|
|
180
|
+
context.resources.add(selection.install((sessionId) => {
|
|
181
|
+
const config = registry.getSession(sessionId);
|
|
182
|
+
if (config.adapterId === 'dsh' && config.teamId && config.providerId && config.modelId)
|
|
183
|
+
return {
|
|
184
|
+
provider: config.providerId, model: config.modelId, ...(config.effortId ? { reasoningEffort: config.effortId } : {}),
|
|
185
|
+
};
|
|
186
|
+
if (config.adapterId === 'dsh' || !registry.isEnabled(config.adapterId))
|
|
187
|
+
return undefined;
|
|
188
|
+
return { provider: toCliProviderId(config.adapterId), model: config.modelId?.trim() || 'provider-default' };
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
94
191
|
registry.warmCatalog();
|
|
192
|
+
const management = new CliManagementService(registry);
|
|
193
|
+
context.resources.add(() => management.dispose());
|
|
194
|
+
const updates = new CliUpdateCheckService(options.updateCheck);
|
|
195
|
+
context.resources.add(() => updates.dispose());
|
|
95
196
|
// 外部适配器没有经过 DSH 原生 Agent Loop,必须把同一套运行状态投影给
|
|
96
197
|
// subagentCatalog。这里集中去重,避免 llm/stream、原生 session/event 和
|
|
97
198
|
// agent/status 同时到达时反复刷新同一个子 Agent。
|
|
@@ -130,19 +231,57 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
130
231
|
});
|
|
131
232
|
context.resources.add(disposeNativeEvents);
|
|
132
233
|
}
|
|
133
|
-
|
|
134
|
-
context.resources.add(
|
|
234
|
+
const translationRecovery = createSessionTranslationRecovery(translation, sessionId => registry.getSession(sessionId));
|
|
235
|
+
context.resources.add(() => translationRecovery.dispose());
|
|
236
|
+
const promptTranslation = createSessionPromptTranslation(translation, sessionId => {
|
|
237
|
+
if (!sessionId || isAssistantSession(sessionId) || readNativeSessionHeader(nativeSessions, sessionId)?.origin === 'subagent')
|
|
238
|
+
return undefined;
|
|
239
|
+
const config = registry.getSession(sessionId);
|
|
240
|
+
return (config.translationEnabled ?? (config.adapterId === 'dsh' && translation?.nativeEnabled === true)) ? config.adapterId : undefined;
|
|
241
|
+
});
|
|
242
|
+
context.resources.add(() => promptTranslation.dispose());
|
|
243
|
+
if (context.services.dshContext !== undefined && context.services.dshVersion !== undefined) {
|
|
244
|
+
const adapter = createDshCapabilityRegistry(context.services.dshVersion, 'host', context.services.dshContext)
|
|
245
|
+
.getProfile(context.services.dshContext).capabilities.get('session.prompt-assembly')?.value;
|
|
246
|
+
if (adapter !== undefined)
|
|
247
|
+
context.resources.add(adapter.install((assembly, scope) => promptTranslation.translateAssembly(assembly, scope)));
|
|
248
|
+
}
|
|
249
|
+
registerDelegationAgentHooks(context.services.dshContext, registry, context.resources, publishExternalStatus, translation, translationRecovery, promptTranslation, nativeSessions, teamInputs);
|
|
250
|
+
const interactionTranslation = createInteractionTranslation(translation, sessionId => registry.getSession(sessionId));
|
|
251
|
+
context.resources.add(() => interactionTranslation.dispose());
|
|
252
|
+
context.resources.add(context.services.rpc.register('cli', async (action, payload, rpcContext) => {
|
|
253
|
+
const rpcSignal = asRecord(rpcContext)?.signal;
|
|
254
|
+
const signal = isAbortSignal(rpcSignal) ? rpcSignal : undefined;
|
|
135
255
|
switch (action) {
|
|
136
|
-
case '
|
|
256
|
+
case 'management/plan':
|
|
257
|
+
case 'management/start':
|
|
258
|
+
case 'management/status':
|
|
259
|
+
case 'management/cancel': return management.rpc(action, payload);
|
|
260
|
+
case 'catalog': return registry.catalog().then(catalog => updates.catalog(teamCatalog(catalog)));
|
|
137
261
|
case 'catalog/refresh': return registry.refreshCatalog(asRecord(payload)?.adapterId === undefined ? undefined : readAdapterId(payload)).then((catalog) => {
|
|
138
262
|
subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
139
|
-
return
|
|
263
|
+
return asRecord(payload)?.checkUpdates === true
|
|
264
|
+
? updates.refresh(teamCatalog(catalog), asRecord(payload)?.adapterId)
|
|
265
|
+
: updates.catalog(teamCatalog(catalog));
|
|
140
266
|
});
|
|
141
267
|
case 'models': {
|
|
142
268
|
const adapterId = readAdapterId(payload);
|
|
143
|
-
|
|
269
|
+
const catalog = adapterId === 'dsh'
|
|
270
|
+
? readDshModelCatalog(context.services.dshContext)
|
|
271
|
+
: registry.models(adapterId);
|
|
272
|
+
if (asRecord(payload)?.stage === 'base') {
|
|
273
|
+
const base = await catalog;
|
|
274
|
+
return magpieAgentForAdapter(adapterId) === null ? base : { ...base, magpiePending: true };
|
|
275
|
+
}
|
|
276
|
+
return typeof magpieUsage.enrichModelCatalog === 'function'
|
|
277
|
+
? magpieUsage.enrichModelCatalog(adapterId, catalog, signal ?? lifetime.signal)
|
|
278
|
+
: catalog;
|
|
144
279
|
}
|
|
145
280
|
case 'translation/models': return context.services.sessionTranslation?.catalog() ?? { models: [], default: null, errors: ['翻译模型目录不可用'] };
|
|
281
|
+
case 'translation/pending': return translationRecovery.pending(payload);
|
|
282
|
+
case 'translation/resolve': return translationRecovery.resolve(payload);
|
|
283
|
+
case 'translation/retry-output': return translationRecovery.retryOutput(payload, signal);
|
|
284
|
+
case 'translation/fields': return interactionTranslation.translate(payload, signal);
|
|
146
285
|
case 'skills': {
|
|
147
286
|
const request = readSkillsRequest(payload);
|
|
148
287
|
const cwd = resolveSessionCwd(context.services.nativeSessions, request.sessionId, null);
|
|
@@ -160,15 +299,27 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
160
299
|
}
|
|
161
300
|
return registry.getSession(sessionId);
|
|
162
301
|
}
|
|
163
|
-
case 'session/set':
|
|
302
|
+
case 'session/set': {
|
|
303
|
+
const sessionId = readSessionId(payload);
|
|
304
|
+
const previous = registry.getSession(sessionId);
|
|
305
|
+
const config = readSessionConfig(payload);
|
|
306
|
+
const saved = registry.setSession(sessionId, config);
|
|
307
|
+
if (config.translationEnabled === false || previous.adapterId !== config.adapterId)
|
|
308
|
+
translationRecovery.cancelSession(sessionId);
|
|
309
|
+
return saved;
|
|
310
|
+
}
|
|
164
311
|
case 'session/list': return registry.listSessions(readSessionListOptions(payload));
|
|
165
312
|
case 'session/adapter-map':
|
|
166
313
|
// 列表查询只返回持久化索引,不能触发会话加载或历史解析。
|
|
167
314
|
return sessionStore.adapterBindings();
|
|
168
315
|
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':
|
|
316
|
+
case 'session/steer': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), false, signal);
|
|
317
|
+
case 'session/follow-up': return translateSteerPrompt(translationRecovery, registry, readSessionId(payload), readPrompt(payload), true, signal);
|
|
318
|
+
case 'session/interrupt': {
|
|
319
|
+
const sessionId = readSessionId(payload);
|
|
320
|
+
translationRecovery.cancelSession(sessionId);
|
|
321
|
+
return registry.interrupt(sessionId);
|
|
322
|
+
}
|
|
172
323
|
case 'team/status': return context.services.nativeTeam?.diagnostic() ?? registry.teamDiagnostic();
|
|
173
324
|
case 'team/members': return requireTeam(context).invoke('members', payload);
|
|
174
325
|
case 'team/tasks': return requireTeam(context).invoke('tasks', payload);
|
|
@@ -181,7 +332,17 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
181
332
|
case 'team/interrupt': return requireTeam(context).invoke('interrupt', payload);
|
|
182
333
|
case 'subscription': {
|
|
183
334
|
const subscription = readSubscriptionRequest(payload);
|
|
184
|
-
|
|
335
|
+
const requestSignal = signal ?? lifetime.signal;
|
|
336
|
+
const session = subscription.sessionId === undefined ? undefined : registry.getSession(subscription.sessionId);
|
|
337
|
+
if (session !== undefined && session.adapterId === subscription.adapterId) {
|
|
338
|
+
const magpie = await magpieUsage.read(session, requestSignal, subscription.includeRoute, subscription.sessionId);
|
|
339
|
+
requestSignal.throwIfAborted();
|
|
340
|
+
if (magpie !== null)
|
|
341
|
+
return { providerUsage: null, magpie };
|
|
342
|
+
}
|
|
343
|
+
requestSignal.throwIfAborted();
|
|
344
|
+
const providerUsage = await subscriptions.read(subscription.adapterId, subscription.providerId, subscription.modelId);
|
|
345
|
+
return { providerUsage, magpie: null };
|
|
185
346
|
}
|
|
186
347
|
case 'subscription/reset': {
|
|
187
348
|
const subscription = readSubscriptionResetRequest(payload);
|
|
@@ -221,10 +382,18 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
221
382
|
try {
|
|
222
383
|
const agents = readOptionalContextService(context.services.dshContext, 'agents');
|
|
223
384
|
const server = await startSubagentBridgeServer({
|
|
385
|
+
teamAccess: (sessionId) => teamDispatcher.access(sessionId),
|
|
386
|
+
teamDispatch: (sessionId, input, signal) => teamDispatcher.dispatch(sessionId, input, signal),
|
|
224
387
|
dispatch: (request) => dispatchBridgeSubagent(request, {
|
|
225
388
|
agents: agents,
|
|
226
389
|
nativeSessions: context.services.nativeSessions,
|
|
227
390
|
}),
|
|
391
|
+
search: (input, signal) => dispatchBridgeSearch(input, {
|
|
392
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
393
|
+
}, signal),
|
|
394
|
+
fetch: (input, signal) => dispatchBridgeFetch(input, {
|
|
395
|
+
web: readOptionalContextService(context.services.dshContext, 'web'),
|
|
396
|
+
}, signal),
|
|
228
397
|
});
|
|
229
398
|
bridgeServer = server;
|
|
230
399
|
setSubagentBridge(server.runtime);
|
|
@@ -259,6 +428,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
259
428
|
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
260
429
|
registry.syncPreferences(next.agentAdapterPreferences);
|
|
261
430
|
sessionStore.sync(next.cliSessions);
|
|
431
|
+
translationRecovery.cancelDisabled(next.sessionTranslation);
|
|
262
432
|
const nextSubscriptionSettings = JSON.stringify(next.subscriptionUsage ?? null);
|
|
263
433
|
if (nextSubscriptionSettings !== subscriptionSettings) {
|
|
264
434
|
subscriptionSettings = nextSubscriptionSettings;
|
|
@@ -317,7 +487,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
317
487
|
}
|
|
318
488
|
else if (sessionId !== '')
|
|
319
489
|
clearDelegationAuthorization(sessionId);
|
|
320
|
-
const selectedExternalAdapter = selectExternalAdapter(dshSelection.providerId, inferMessageAdapter(messages), registry);
|
|
490
|
+
const selectedExternalAdapter = storedConfig.adapterId === 'dsh' && storedConfig.teamId ? undefined : selectExternalAdapter(fromCliProviderId(dshSelection.providerId), inferMessageAdapter(messages), registry);
|
|
321
491
|
// DSH 的 modelSelection 只描述 DSH 自己那条模型路由(例如 glor/deepseek)。
|
|
322
492
|
// 只有它明确指向即将接管的外部适配器时,model/effort 才属于该适配器;
|
|
323
493
|
// 当适配器是从会话历史推断出来的(fork 子会话继承父会话的外部消息,而
|
|
@@ -325,7 +495,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
325
495
|
// 写进外部 Agent——Codex 会用它 thread/start 并直接 404,整个会话从此
|
|
326
496
|
// 无法继续。此时必须留空,由适配器自己的偏好决定模型。
|
|
327
497
|
const selectionOwnedByAdapter = selectedExternalAdapter !== undefined
|
|
328
|
-
&& dshSelection.providerId === selectedExternalAdapter;
|
|
498
|
+
&& (fromCliProviderId(dshSelection.providerId) ?? dshSelection.providerId) === selectedExternalAdapter;
|
|
329
499
|
let config = storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined
|
|
330
500
|
? {
|
|
331
501
|
adapterId: selectedExternalAdapter,
|
|
@@ -339,35 +509,65 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
339
509
|
if (sessionId !== '' && storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined) {
|
|
340
510
|
config = registry.setSession(sessionId, config);
|
|
341
511
|
}
|
|
512
|
+
if (config.teamId && !teamDispatcher.identity(sessionId)) {
|
|
513
|
+
throw Object.assign(new Error('The native Team identity is unavailable. Restore its Team profile and adapter before continuing.'), { code: 'TEAM_SERVICE_UNAVAILABLE' });
|
|
514
|
+
}
|
|
342
515
|
if (config.adapterId === 'dsh') {
|
|
343
516
|
const selection = dshSelection;
|
|
344
517
|
if (sessionId !== '' && (selection.modelId !== undefined || selection.effortId !== undefined)) {
|
|
345
518
|
registry.setSession(sessionId, { adapterId: 'dsh', ...selection });
|
|
346
519
|
}
|
|
347
|
-
|
|
520
|
+
// Native-session output translation wraps only DSH's own Provider stream:
|
|
521
|
+
// preserve text/reasoning and attach the translation record; the client renders it.
|
|
522
|
+
if (!isSessionTranslationLlmRequest(value)
|
|
523
|
+
&& translation !== undefined
|
|
524
|
+
&& translation.enabled
|
|
525
|
+
&& (config.translationEnabled ?? translation.nativeEnabled === true)
|
|
526
|
+
&& sessionId !== ''
|
|
527
|
+
&& !isAssistantSession(sessionId)
|
|
528
|
+
&& readNativeSessionHeader(nativeSessions, sessionId)?.origin !== 'subagent') {
|
|
529
|
+
yield* guardDshNativeStream(() => translateNativeStream(magpieSessionRouting.wrap(sessionId, next()), translation, translation.bilingual === true, isAbortSignal(value?.signal) ? value.signal : undefined));
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
yield* guardDshNativeStream(() => magpieSessionRouting.wrap(sessionId, next()));
|
|
348
533
|
return;
|
|
349
534
|
}
|
|
350
535
|
const cwd = resolveSessionCwd(context.services.nativeSessions, sessionId, value);
|
|
351
|
-
const turnInput = extractTurnInput(messages, context.services.dshContext);
|
|
536
|
+
const turnInput = extractTurnInput(messages, context.services.dshContext, teamInputs.take(sessionId, messages));
|
|
352
537
|
const turnOptions = readCliTurnOptions(value);
|
|
353
538
|
const runtimeEnv = readCliRuntimeEnv(value);
|
|
354
|
-
const requestSignal = isAbortSignal(value?.signal)
|
|
539
|
+
const requestSignal = isAbortSignal(value?.signal)
|
|
540
|
+
? AbortSignal.any([value.signal, lifetime.signal])
|
|
541
|
+
: lifetime.signal;
|
|
542
|
+
const translationLanguage = translation?.enabled && isSessionTranslationInputEnabled(translation, config.adapterId) && config.translationEnabled === true ? readInputTargetLanguage(translation) : undefined;
|
|
355
543
|
let translatedPrompt = turnInput.translationPrompt;
|
|
356
|
-
if (turnInput.translatePrompt &&
|
|
544
|
+
if (turnInput.translatePrompt && turnInput.translationPrompt.trim() !== '' && translationLanguage !== undefined) {
|
|
357
545
|
try {
|
|
358
|
-
translatedPrompt = await
|
|
546
|
+
translatedPrompt = (await translationRecovery.translateInput(sessionId, config.adapterId, turnInput.translationPrompt, requestSignal)).translated;
|
|
359
547
|
}
|
|
360
|
-
catch {
|
|
361
|
-
|
|
362
|
-
|
|
548
|
+
catch (error) {
|
|
549
|
+
if (!(error instanceof SessionTranslationCancelled) && !requestSignal?.aborted)
|
|
550
|
+
throw error;
|
|
551
|
+
yield { type: 'finish', reason: { kind: 'stop' } };
|
|
552
|
+
return;
|
|
363
553
|
}
|
|
364
554
|
}
|
|
365
555
|
const prompt = turnInput.translatePrompt
|
|
366
|
-
? [translatedPrompt, turnInput.untranslatedPrompt].filter((part) => part.trim() !== '').join('\n\n')
|
|
556
|
+
? [translatedPrompt, translationLanguage === undefined ? turnInput.untranslatedPrompt : attachmentNotices(turnInput.attachments, translationLanguage)].filter((part) => part.trim() !== '').join('\n\n')
|
|
367
557
|
: turnInput.prompt;
|
|
368
558
|
// 权限状态必须与 DSH 会话当前生效值同源。驱动不能自行假设“完全权限”,
|
|
369
559
|
// 也不能把缺省当成“已确认无限制”:解析失败时留空,由驱动沿用保守默认。
|
|
370
560
|
const permission = resolveSessionPermission(context.services.dshContext, sessionId);
|
|
561
|
+
let magpieCodexContextWindow;
|
|
562
|
+
if (config.adapterId === 'codex' && config.modelId !== undefined && typeof magpieUsage.readModelMetadata === 'function') {
|
|
563
|
+
try {
|
|
564
|
+
magpieCodexContextWindow = (await magpieUsage.readModelMetadata('codex', config.modelId, requestSignal))?.contextWindow;
|
|
565
|
+
}
|
|
566
|
+
catch (error) {
|
|
567
|
+
if (!requestSignal.aborted)
|
|
568
|
+
throw error;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
371
571
|
// 只有 Provider 驱动明确声明可以维护连续事件流,才把工具边界映射为 DSH step。
|
|
372
572
|
// Command Code、Codex 自己维护 assistant 消息边界;OpenCode 由 Registry
|
|
373
573
|
// 挂起并续读同一条 SSE。其他驱动仍把整轮保持在一个 step,避免 token-meter
|
|
@@ -376,6 +576,8 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
376
576
|
sessionId,
|
|
377
577
|
messages: turnInput.messages,
|
|
378
578
|
prompt,
|
|
579
|
+
...(turnInput.peerInput ? { peerInput: true } : {}),
|
|
580
|
+
...(translationLanguage === undefined ? {} : { translationLanguage }),
|
|
379
581
|
...(turnInput.attachments.length === 0 ? {} : { attachments: turnInput.attachments }),
|
|
380
582
|
...(permission === undefined ? {} : { permission }),
|
|
381
583
|
...(turnOptions.plan === true ? { plan: true } : {}),
|
|
@@ -383,6 +585,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
383
585
|
...(turnOptions.enableAskUserQuestion === true ? { enableAskUserQuestion: true } : {}),
|
|
384
586
|
...(runtimeEnv === undefined ? {} : { runtimeEnv }),
|
|
385
587
|
...(config.modelId ? { modelId: config.modelId } : {}),
|
|
588
|
+
...(magpieCodexContextWindow === undefined ? {} : { modelContextWindow: magpieCodexContextWindow }),
|
|
386
589
|
...(config.effortId ? { effortId: config.effortId } : {}),
|
|
387
590
|
...(config.serviceTierId ? { serviceTierId: config.serviceTierId } : {}),
|
|
388
591
|
...(config.translationEnabled === undefined ? {} : { translationEnabled: config.translationEnabled }),
|
|
@@ -411,6 +614,12 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
411
614
|
respondQuestion: (response) => registry.respondQuestion(sessionId, response),
|
|
412
615
|
...(translation === undefined ? {} : { translation }),
|
|
413
616
|
...(translation === undefined ? {} : { translationEnabled: config.translationEnabled === true }),
|
|
617
|
+
prefetchQuestionTranslation: questions => {
|
|
618
|
+
const fields = questionTranslationFields(questions);
|
|
619
|
+
if (fields.length === 0)
|
|
620
|
+
return;
|
|
621
|
+
interactionTranslation.prefetch({ sessionId, direction: 'output', fields });
|
|
622
|
+
},
|
|
414
623
|
});
|
|
415
624
|
const discardSuspendedTurn = () => registry.discardSegmentedTurn(sessionId);
|
|
416
625
|
input.signal?.addEventListener('abort', discardSuspendedTurn, { once: true });
|
|
@@ -472,6 +681,10 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
472
681
|
// DSH 先停用设置上下文再执行异步资源清理时,旧的写队列不能继续调用
|
|
473
682
|
// configEditor,否则会出现 inactive context 并污染退出日志。
|
|
474
683
|
sessionStore.dispose();
|
|
684
|
+
// Close native interaction cards before unloading their provider transports.
|
|
685
|
+
lifetime.abort();
|
|
686
|
+
updates.dispose();
|
|
687
|
+
await management.dispose();
|
|
475
688
|
await registry.dispose();
|
|
476
689
|
await sessionStore.flush();
|
|
477
690
|
setAdapterRegistry(undefined);
|
|
@@ -526,12 +739,13 @@ function createExternalSessionStatusPublisher(events, registry, sessionStore) {
|
|
|
526
739
|
* `messages`,会直接抛出只读属性异常。`agent/pre-step` 返回的新消息保留用户原文,并把
|
|
527
740
|
* 译文写入 source 元数据;外部适配器再据此构造发给 Agent 的译文。
|
|
528
741
|
*/
|
|
529
|
-
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation) {
|
|
742
|
+
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation, translationRecovery, promptTranslation, nativeSessions, teamInputs) {
|
|
530
743
|
if (dshContext === undefined || typeof dshContext.on !== 'function')
|
|
531
744
|
return;
|
|
532
745
|
const disposers = [];
|
|
533
746
|
const register = (name, listener) => {
|
|
534
|
-
|
|
747
|
+
// Wrap existing pre-step producers so their after-next catalogs are visible.
|
|
748
|
+
const disposer = dshContext.on(name, listener, { global: true, prepend: name === 'agent/pre-step' });
|
|
535
749
|
if (typeof disposer === 'function')
|
|
536
750
|
disposers.push(disposer);
|
|
537
751
|
};
|
|
@@ -553,10 +767,15 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
553
767
|
catch {
|
|
554
768
|
return config;
|
|
555
769
|
}
|
|
770
|
+
if (session.adapterId === 'dsh' && session.teamId && session.providerId && session.modelId) {
|
|
771
|
+
const { reasoningEffort: _effort, ...nativeConfig } = config;
|
|
772
|
+
return { ...nativeConfig, provider: session.providerId, model: session.modelId, ...(session.effortId ? { reasoningEffort: session.effortId } : {}) };
|
|
773
|
+
}
|
|
774
|
+
const providerAdapter = fromCliProviderId(config.provider);
|
|
556
775
|
const configuredAdapter = session.adapterId !== 'dsh' && registry.isEnabled(session.adapterId)
|
|
557
776
|
? session.adapterId
|
|
558
|
-
:
|
|
559
|
-
?
|
|
777
|
+
: providerAdapter !== undefined && registry.isEnabled(providerAdapter)
|
|
778
|
+
? providerAdapter
|
|
560
779
|
: undefined;
|
|
561
780
|
if (configuredAdapter === undefined)
|
|
562
781
|
return config;
|
|
@@ -567,7 +786,12 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
567
786
|
});
|
|
568
787
|
}
|
|
569
788
|
const model = session.modelId?.trim() || (typeof config.model === 'string' && config.model.trim() !== '' ? config.model.trim() : configuredAdapter);
|
|
570
|
-
|
|
789
|
+
// reasoningEffort 属于被改写掉的那条 DSH 原生路由(例如全局默认模型 glor/deepseek-v4.1-flash
|
|
790
|
+
// 的 max)。外部 CLI 的虚拟 Provider 不声明任何思考强度,DSH 会在准入阶段以
|
|
791
|
+
// UNSUPPORTED_REASONING_EFFORT 拒绝整轮;外部 Agent 的思考强度由适配器自己的
|
|
792
|
+
// effortId 偏好驱动,因此这里必须丢弃继承值,只改写 provider/model。
|
|
793
|
+
const { reasoningEffort: _inheritedReasoningEffort, ...routeConfig } = config;
|
|
794
|
+
return { ...routeConfig, provider: toCliProviderId(configuredAdapter), model };
|
|
571
795
|
});
|
|
572
796
|
register('agent/pre-step', async (payload, next) => {
|
|
573
797
|
const record = asRecord(payload);
|
|
@@ -583,20 +807,49 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
583
807
|
messages = [...delegation.value.messages];
|
|
584
808
|
}
|
|
585
809
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
810
|
+
let translatedInput;
|
|
811
|
+
try {
|
|
812
|
+
translatedInput = await translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, isAbortSignal(record?.signal) ? record.signal : undefined, nativePreStepContext(translation, registry, sessionId, nativeSessions));
|
|
813
|
+
}
|
|
814
|
+
catch (error) {
|
|
815
|
+
if (error instanceof SessionTranslationCancelled || record?.signal?.aborted === true)
|
|
816
|
+
return { kind: 'reject' };
|
|
817
|
+
throw error;
|
|
818
|
+
}
|
|
589
819
|
const decision = await next();
|
|
590
820
|
if (!isEnterPreStepDecision(decision))
|
|
591
821
|
return decision;
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
822
|
+
// Match producer-owned messages by identity. Downstream middleware may insert
|
|
823
|
+
// instructions before the human message, so a positional prefix loses data.
|
|
824
|
+
const incoming = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
825
|
+
const replaced = new Set();
|
|
826
|
+
const replacements = translatedInput ?? messages;
|
|
827
|
+
const accepted = delegation?.kind === 'rewritten' || translatedInput !== undefined
|
|
828
|
+
? decision.messages.flatMap(message => {
|
|
829
|
+
const index = incoming.findIndex((original, position) => !replaced.has(position) && (original === message || typeof original.id === 'string' && original.id === message.id
|
|
830
|
+
// Legacy callers can return detached messages without durable IDs.
|
|
831
|
+
|| original.id === undefined && message.id === undefined && original.role === message.role
|
|
832
|
+
&& original.source?.kind === message.source?.kind && original.source?.form === message.source?.form
|
|
833
|
+
&& JSON.stringify(original.content) === JSON.stringify(message.content)));
|
|
834
|
+
if (index >= 0)
|
|
835
|
+
replaced.add(index);
|
|
836
|
+
if (index < 0)
|
|
837
|
+
return [message];
|
|
838
|
+
const replacement = replacements[index];
|
|
839
|
+
return replacement === undefined ? [] : [replacement];
|
|
840
|
+
}) : decision.messages;
|
|
841
|
+
try {
|
|
842
|
+
const scope = sessionPromptScope(record?.agent, isAbortSignal(record?.signal) ? record.signal : undefined);
|
|
843
|
+
const translated = await promptTranslation.translateMessages(accepted, scope);
|
|
844
|
+
if (registry.getSession(sessionId).adapterId !== 'dsh')
|
|
845
|
+
teamInputs?.accept(sessionId, translated);
|
|
846
|
+
return { ...decision, messages: translated };
|
|
847
|
+
}
|
|
848
|
+
catch (error) {
|
|
849
|
+
if (error instanceof SessionTranslationCancelled || record?.signal?.aborted === true)
|
|
850
|
+
return { kind: 'reject' };
|
|
851
|
+
throw error;
|
|
852
|
+
}
|
|
600
853
|
});
|
|
601
854
|
// 正常结束、异常结束和中断最终都会进入 idle;在此清理本轮授权,避免下一轮
|
|
602
855
|
// 没有 carrier 时继承上一轮的目标白名单。
|
|
@@ -606,12 +859,16 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
606
859
|
if (record?.status === 'running')
|
|
607
860
|
publishExternalStatus(sessionId, true);
|
|
608
861
|
else if (record?.status === 'idle') {
|
|
862
|
+
translationRecovery.cancelSession(sessionId);
|
|
609
863
|
publishExternalStatus(sessionId, false);
|
|
610
864
|
clearDelegationAuthorization(sessionId);
|
|
611
865
|
}
|
|
612
866
|
});
|
|
613
867
|
register('agent/disposed', (payload) => {
|
|
614
868
|
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
869
|
+
teamInputs?.release(sessionId);
|
|
870
|
+
getSubagentBridge()?.revokeTeamSession?.(sessionId);
|
|
871
|
+
translationRecovery.cancelSession(sessionId);
|
|
615
872
|
// disposed 只代表运行时释放;subagentCatalog 没有删除语义,保留目录项并
|
|
616
873
|
// 把它标成 idle,后续若 DSH 重新激活会再次收到 running。
|
|
617
874
|
publishExternalStatus(sessionId, false);
|
|
@@ -749,11 +1006,11 @@ function isMeaningfulDshChunk(value) {
|
|
|
749
1006
|
const record = asRecord(value);
|
|
750
1007
|
if (record === null)
|
|
751
1008
|
return false;
|
|
752
|
-
if (record.type === 'text-delta' || record.type === 'reasoning-delta' || record.type === 'usage' || record.type === 'tool-call' || record.type === 'tool-result')
|
|
1009
|
+
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
1010
|
return true;
|
|
754
1011
|
if (record.type === 'block-end') {
|
|
755
1012
|
const block = asRecord(record.block);
|
|
756
|
-
return typeof block?.text === 'string' && block.text !== '';
|
|
1013
|
+
return block?.type === 'tool-call' || block?.type === 'tool-result' || typeof block?.text === 'string' && block.text !== '';
|
|
757
1014
|
}
|
|
758
1015
|
return false;
|
|
759
1016
|
}
|
|
@@ -766,10 +1023,12 @@ function readAdapterId(value) {
|
|
|
766
1023
|
function readSubscriptionRequest(value) {
|
|
767
1024
|
const record = asRecord(value);
|
|
768
1025
|
if (record === null || record.adapterId === undefined)
|
|
769
|
-
return { adapterId: 'command-code' };
|
|
1026
|
+
return { adapterId: 'command-code', includeRoute: false };
|
|
770
1027
|
const adapterId = readAdapterId(value);
|
|
771
1028
|
return {
|
|
772
1029
|
adapterId,
|
|
1030
|
+
...(typeof record.sessionId === 'string' && record.sessionId.trim() !== '' ? { sessionId: record.sessionId.trim() } : {}),
|
|
1031
|
+
includeRoute: record.includeRoute === true,
|
|
773
1032
|
...(typeof record.providerId === 'string' && record.providerId.trim() !== '' ? { providerId: record.providerId.trim() } : {}),
|
|
774
1033
|
// Antigravity 用会话模型区分 Gemini 与 Claude/GPT 两个独立配额组。
|
|
775
1034
|
...(typeof record.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
@@ -899,7 +1158,7 @@ function readCliRuntimeEnv(value) {
|
|
|
899
1158
|
const entries = Object.entries(candidate).filter(([, item]) => typeof item === 'string');
|
|
900
1159
|
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
901
1160
|
}
|
|
902
|
-
/** DSH
|
|
1161
|
+
/** Prefer the pending/next DSH route because lastUsed may still be stale. */
|
|
903
1162
|
function readModelSelectionCandidates(value) {
|
|
904
1163
|
const result = [];
|
|
905
1164
|
for (const candidate of [value, asRecord(value?.request), asRecord(value?.config), asRecord(value?.header), asRecord(asRecord(value?.record)?.rows)]) {
|
|
@@ -909,12 +1168,12 @@ function readModelSelectionCandidates(value) {
|
|
|
909
1168
|
const lastUsed = asRecord(selection?.lastUsed);
|
|
910
1169
|
const next = asRecord(selection?.next);
|
|
911
1170
|
const pending = asRecord(selection?.pending);
|
|
912
|
-
if (lastUsed !== null)
|
|
913
|
-
result.push(lastUsed);
|
|
914
|
-
if (next !== null)
|
|
915
|
-
result.push(next);
|
|
916
1171
|
if (pending !== null)
|
|
917
1172
|
result.push(pending);
|
|
1173
|
+
if (next !== null)
|
|
1174
|
+
result.push(next);
|
|
1175
|
+
if (lastUsed !== null)
|
|
1176
|
+
result.push(lastUsed);
|
|
918
1177
|
}
|
|
919
1178
|
return result;
|
|
920
1179
|
}
|
|
@@ -953,13 +1212,14 @@ function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
|
953
1212
|
function inferMessageAdapter(messages) {
|
|
954
1213
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
955
1214
|
const source = asRecord(messages[index].source);
|
|
956
|
-
// 旧会话和 DSH 原生投影的 source 形状不完全一致;只要是模型消息就读取
|
|
957
|
-
// provider,最终仍由 selectExternalAdapter 校验是否为已启用外部适配器。
|
|
958
1215
|
if (source?.kind !== 'model')
|
|
959
1216
|
continue;
|
|
960
|
-
const provider = source.provider;
|
|
961
|
-
|
|
962
|
-
|
|
1217
|
+
const provider = typeof source.provider === 'string' ? source.provider.trim() : undefined;
|
|
1218
|
+
// Legacy raw providers need explicit plugin metadata; native API brands can
|
|
1219
|
+
// have the same names as CLI adapters. The latest model source is decisive.
|
|
1220
|
+
return fromCliProviderId(provider)
|
|
1221
|
+
?? (typeof source.adapterId === 'string' ? source.adapterId : undefined)
|
|
1222
|
+
?? (source.plugin === 'codingns4dsh' ? provider : undefined);
|
|
963
1223
|
}
|
|
964
1224
|
return undefined;
|
|
965
1225
|
}
|
|
@@ -974,18 +1234,20 @@ async function setAdapterEnabled(settings, registry, value) {
|
|
|
974
1234
|
return { adapterId, enabled };
|
|
975
1235
|
}
|
|
976
1236
|
/** 运行中的外部 Agent 插话也必须经过同一条输入翻译路径。 */
|
|
977
|
-
async function translateSteerPrompt(
|
|
1237
|
+
async function translateSteerPrompt(translationRecovery, registry, sessionId, prompt, followUp, signal) {
|
|
978
1238
|
const session = registry.getSession(sessionId);
|
|
979
1239
|
let translated = prompt;
|
|
980
|
-
if (
|
|
1240
|
+
if (session.translationEnabled === true) {
|
|
981
1241
|
try {
|
|
982
|
-
translated = await
|
|
1242
|
+
translated = (await translationRecovery.translateInput(sessionId, session.adapterId, prompt, signal)).translated;
|
|
983
1243
|
}
|
|
984
|
-
catch {
|
|
985
|
-
|
|
986
|
-
|
|
1244
|
+
catch (error) {
|
|
1245
|
+
if (error instanceof SessionTranslationCancelled)
|
|
1246
|
+
return;
|
|
1247
|
+
throw error;
|
|
987
1248
|
}
|
|
988
1249
|
}
|
|
1250
|
+
signal?.throwIfAborted();
|
|
989
1251
|
await registry.steer(sessionId, translated, followUp);
|
|
990
1252
|
}
|
|
991
1253
|
/**
|
|
@@ -994,9 +1256,63 @@ async function translateSteerPrompt(translation, registry, sessionId, prompt, fo
|
|
|
994
1256
|
* DSH 随后会把返回的消息写入 `user/message`。正文只放实际发送的译文;原文和模型
|
|
995
1257
|
* 记录在 source 元数据中供 Client 详情按钮读取。外部 CLI 边界也会移除该元数据。
|
|
996
1258
|
*/
|
|
997
|
-
async function translatePreStepInput(translation, registry, sessionId, messages, dshContext, signal) {
|
|
1259
|
+
async function translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, signal, nativeSession) {
|
|
998
1260
|
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
999
1261
|
return undefined;
|
|
1262
|
+
if (messages.some(isTeamInputMessage)) {
|
|
1263
|
+
const next = [];
|
|
1264
|
+
for (const message of messages) {
|
|
1265
|
+
// Team protocol text keeps its sender and machine-owned body. Human
|
|
1266
|
+
// messages accepted at the same boundary still use submission recovery.
|
|
1267
|
+
try {
|
|
1268
|
+
const translated = isHumanUserMessage(message)
|
|
1269
|
+
? await translatePreStepInput(translation, translationRecovery, registry, sessionId, [message], dshContext, signal, nativeSession)
|
|
1270
|
+
: undefined;
|
|
1271
|
+
next.push(translated?.[0] ?? message);
|
|
1272
|
+
}
|
|
1273
|
+
catch (error) {
|
|
1274
|
+
if (!(error instanceof SessionTranslationCancelled) || signal?.aborted)
|
|
1275
|
+
throw error;
|
|
1276
|
+
// Cancelling one submission does not cancel independently accepted
|
|
1277
|
+
// Team work. Keep the original positions until pre-step producers merge.
|
|
1278
|
+
next.push(undefined);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return next.some((message, index) => message !== messages[index]) ? next : undefined;
|
|
1282
|
+
}
|
|
1283
|
+
const messageIndex = findLatestHumanMessage(messages);
|
|
1284
|
+
const current = messageIndex < 0 ? undefined : messages[messageIndex];
|
|
1285
|
+
if (current === undefined || readInputTranslation(current.source) !== undefined)
|
|
1286
|
+
return undefined;
|
|
1287
|
+
if (nativeSession !== undefined) {
|
|
1288
|
+
// DSH 原生会话:消息本身就是发给 Provider 的正文,直接替换为译文并把原文留在元数据。
|
|
1289
|
+
if (nativeSession.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, nativeSession.adapterId))
|
|
1290
|
+
return undefined;
|
|
1291
|
+
const input = extractTurnInput(messages, dshContext);
|
|
1292
|
+
if (input.prompt.trim() === '')
|
|
1293
|
+
return undefined;
|
|
1294
|
+
const result = await translationRecovery.translateInput(sessionId, nativeSession.adapterId, input.translationPrompt, signal);
|
|
1295
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))].filter((part) => part.trim() !== '').join('\n\n').trim();
|
|
1296
|
+
if (translated === '')
|
|
1297
|
+
return undefined;
|
|
1298
|
+
const record = {
|
|
1299
|
+
original: input.prompt,
|
|
1300
|
+
translated,
|
|
1301
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1302
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1303
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1304
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1305
|
+
...readSessionTranslationMetrics(result),
|
|
1306
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1307
|
+
};
|
|
1308
|
+
const next = [...messages];
|
|
1309
|
+
next[messageIndex] = {
|
|
1310
|
+
...current,
|
|
1311
|
+
content: result.failed ? current.content : replaceInputTranslationContent(nativeTranslationContent(current.content, dshContext), translated),
|
|
1312
|
+
source: { ...(current.source ?? {}), kind: 'user', codingnsTranslationInput: record },
|
|
1313
|
+
};
|
|
1314
|
+
return next;
|
|
1315
|
+
}
|
|
1000
1316
|
let session;
|
|
1001
1317
|
try {
|
|
1002
1318
|
session = registry.getSession(sessionId);
|
|
@@ -1004,39 +1320,13 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1004
1320
|
catch {
|
|
1005
1321
|
return undefined;
|
|
1006
1322
|
}
|
|
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)
|
|
1323
|
+
if (session.adapterId === 'dsh' || session.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, session.adapterId))
|
|
1012
1324
|
return undefined;
|
|
1013
1325
|
const input = extractTurnInput(messages, dshContext);
|
|
1014
|
-
if (input.
|
|
1326
|
+
if (input.prompt.trim() === '')
|
|
1015
1327
|
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]
|
|
1328
|
+
const result = await translationRecovery.translateInput(sessionId, session.adapterId, input.translationPrompt, signal);
|
|
1329
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))]
|
|
1040
1330
|
.filter((part) => part.trim() !== '')
|
|
1041
1331
|
.join('\n\n')
|
|
1042
1332
|
.trim();
|
|
@@ -1045,11 +1335,12 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1045
1335
|
const record = {
|
|
1046
1336
|
original: input.prompt,
|
|
1047
1337
|
translated,
|
|
1048
|
-
...(
|
|
1049
|
-
targetLanguage: translation
|
|
1050
|
-
...(alreadyTargetLanguage ? { alreadyTargetLanguage: true } : {}),
|
|
1051
|
-
...(
|
|
1052
|
-
...(
|
|
1338
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1339
|
+
targetLanguage: readInputTargetLanguage(translation),
|
|
1340
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1341
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1342
|
+
...readSessionTranslationMetrics(result),
|
|
1343
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1053
1344
|
};
|
|
1054
1345
|
const next = [...messages];
|
|
1055
1346
|
next[messageIndex] = {
|
|
@@ -1062,7 +1353,186 @@ async function translatePreStepInput(translation, registry, sessionId, messages,
|
|
|
1062
1353
|
};
|
|
1063
1354
|
return next;
|
|
1064
1355
|
}
|
|
1065
|
-
|
|
1356
|
+
/** 旧测试替身没有 inputLanguage 时沿用历史默认值英语。 */
|
|
1357
|
+
function readInputTargetLanguage(translation) {
|
|
1358
|
+
const language = translation.inputLanguage;
|
|
1359
|
+
return language === undefined ? 'en' : language;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* 判断本次 pre-step 是否按 DSH 原生会话翻译。
|
|
1363
|
+
*
|
|
1364
|
+
* 原生会话的翻译记录来自全局 `nativeEnabled` 与适配器偏好(会话索引对 `dsh` 不落盘),
|
|
1365
|
+
* 子代理与插件自己的助理会话必须排除,避免把内部执行流水线翻译掉。
|
|
1366
|
+
*/
|
|
1367
|
+
function nativePreStepContext(translation, registry, sessionId, nativeSessions) {
|
|
1368
|
+
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
1369
|
+
return undefined;
|
|
1370
|
+
if (isAssistantSession(sessionId))
|
|
1371
|
+
return undefined;
|
|
1372
|
+
if (readNativeSessionHeader(nativeSessions, sessionId)?.origin === 'subagent')
|
|
1373
|
+
return undefined;
|
|
1374
|
+
let session;
|
|
1375
|
+
try {
|
|
1376
|
+
session = registry.getSession(sessionId);
|
|
1377
|
+
}
|
|
1378
|
+
catch {
|
|
1379
|
+
return undefined;
|
|
1380
|
+
}
|
|
1381
|
+
if (session.adapterId !== DSH_NATIVE_SESSION_ADAPTER_ID)
|
|
1382
|
+
return undefined;
|
|
1383
|
+
return {
|
|
1384
|
+
adapterId: DSH_NATIVE_SESSION_ADAPTER_ID,
|
|
1385
|
+
// 会话级开关优先;用户没有单独设置过该会话时跟随「DSH 原生会话」总开关。
|
|
1386
|
+
translationEnabled: session.translationEnabled ?? translation.nativeEnabled === true,
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
/** 读取原生会话 header;测试替身或会话尚未装载时返回 undefined。 */
|
|
1390
|
+
function readNativeSessionHeader(nativeSessions, sessionId) {
|
|
1391
|
+
if (nativeSessions === undefined)
|
|
1392
|
+
return undefined;
|
|
1393
|
+
try {
|
|
1394
|
+
return asRecord(asRecord(nativeSessions.get(sessionId))?.header) ?? undefined;
|
|
1395
|
+
}
|
|
1396
|
+
catch {
|
|
1397
|
+
return undefined;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
/** 插件自己的全局助理会话不属于用户对话,不能被翻译改写。 */
|
|
1401
|
+
function isAssistantSession(sessionId) {
|
|
1402
|
+
// 复用助理适配器导出的会话前缀常量:会话身份的唯一定义在那里,重复字面量会漂移。
|
|
1403
|
+
return sessionId.startsWith(ASSISTANT_AGENT_PREFIX);
|
|
1404
|
+
}
|
|
1405
|
+
/** Translate completed native output blocks without buffering their visible deltas. */
|
|
1406
|
+
async function* translateNativeStream(stream, translation, bilingual, signal) {
|
|
1407
|
+
const blocks = new Map();
|
|
1408
|
+
const bufferOf = (index, kind) => {
|
|
1409
|
+
const existing = blocks.get(index);
|
|
1410
|
+
if (existing !== undefined)
|
|
1411
|
+
return existing.kind === kind && !existing.closed ? existing : undefined;
|
|
1412
|
+
const created = {
|
|
1413
|
+
index, kind, text: '', closed: false,
|
|
1414
|
+
translate: translation.shouldTranslate(DSH_NATIVE_SESSION_ADAPTER_ID, kind === 'reasoning' ? 'reasoning' : 'assistant', true),
|
|
1415
|
+
};
|
|
1416
|
+
blocks.set(index, created);
|
|
1417
|
+
return created;
|
|
1418
|
+
};
|
|
1419
|
+
const translateBlock = async (block) => {
|
|
1420
|
+
const original = block.text;
|
|
1421
|
+
if (original.trim() === '')
|
|
1422
|
+
return undefined;
|
|
1423
|
+
const kind = block.kind === 'reasoning' ? 'reasoning' : 'assistant';
|
|
1424
|
+
let record;
|
|
1425
|
+
try {
|
|
1426
|
+
const result = await translation.translateOutput(DSH_NATIVE_SESSION_ADAPTER_ID, kind, original, signal, true);
|
|
1427
|
+
if (result !== null && result !== undefined) {
|
|
1428
|
+
record = {
|
|
1429
|
+
original: result.original,
|
|
1430
|
+
translated: result.translated,
|
|
1431
|
+
...(result.sourceLanguage === undefined ? {} : { sourceLanguage: result.sourceLanguage }),
|
|
1432
|
+
targetLanguage: result.targetLanguage,
|
|
1433
|
+
outputKind: kind,
|
|
1434
|
+
bilingual: result.bilingual,
|
|
1435
|
+
...(result.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1436
|
+
...(result.model === undefined ? {} : { model: result.model }),
|
|
1437
|
+
...readSessionTranslationMetrics(result),
|
|
1438
|
+
...(result.failed === true ? { failed: true } : {}),
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
catch {
|
|
1443
|
+
record = { original, translated: original, targetLanguage: translation.outputLanguage ?? 'zh', outputKind: kind, bilingual, failed: true };
|
|
1444
|
+
}
|
|
1445
|
+
if (record === undefined)
|
|
1446
|
+
return undefined;
|
|
1447
|
+
const visible = formatSessionTranslationOutput(record);
|
|
1448
|
+
if (visible.trim() === '' || visible === original && record.failed !== true)
|
|
1449
|
+
return undefined;
|
|
1450
|
+
return record;
|
|
1451
|
+
};
|
|
1452
|
+
try {
|
|
1453
|
+
for await (const chunk of stream) {
|
|
1454
|
+
const record = asRecord(chunk);
|
|
1455
|
+
const type = typeof record?.type === 'string' ? record.type : '';
|
|
1456
|
+
const index = typeof record?.index === 'number' ? record.index : undefined;
|
|
1457
|
+
if (type === 'text-delta' || type === 'reasoning-delta') {
|
|
1458
|
+
if (index === undefined || typeof record?.text !== 'string') {
|
|
1459
|
+
yield chunk;
|
|
1460
|
+
continue;
|
|
1461
|
+
}
|
|
1462
|
+
const kind = type === 'text-delta' ? 'text' : 'reasoning';
|
|
1463
|
+
const block = bufferOf(index, kind);
|
|
1464
|
+
// Decide once per block: changing settings must not translate only a suffix
|
|
1465
|
+
// or drop a prefix that was already buffered.
|
|
1466
|
+
if (block === undefined || !block.translate) {
|
|
1467
|
+
yield chunk;
|
|
1468
|
+
continue;
|
|
1469
|
+
}
|
|
1470
|
+
block.text += record.text;
|
|
1471
|
+
// Keep provider deltas visible while the completed block is being translated.
|
|
1472
|
+
yield chunk;
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1475
|
+
if (type === 'block-end' && index !== undefined) {
|
|
1476
|
+
const block = blocks.get(index);
|
|
1477
|
+
if (block !== undefined && !block.closed) {
|
|
1478
|
+
block.closed = true;
|
|
1479
|
+
if (block.text.trim() !== '') {
|
|
1480
|
+
const translationRecord = await translateBlock(block);
|
|
1481
|
+
if (translationRecord !== undefined) {
|
|
1482
|
+
const finalBlock = asRecord(record?.block);
|
|
1483
|
+
yield {
|
|
1484
|
+
...(record ?? {}),
|
|
1485
|
+
block: {
|
|
1486
|
+
...(finalBlock ?? {}),
|
|
1487
|
+
type: block.kind,
|
|
1488
|
+
text: block.text,
|
|
1489
|
+
codingnsTranslation: translationRecord,
|
|
1490
|
+
},
|
|
1491
|
+
codingnsTranslation: translationRecord,
|
|
1492
|
+
};
|
|
1493
|
+
continue;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
yield chunk;
|
|
1498
|
+
continue;
|
|
1499
|
+
}
|
|
1500
|
+
yield chunk;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
catch (error) {
|
|
1504
|
+
// 流异常时先把缓存正文按原文补发,再把原始错误交给 DSH,保证回复不丢失。
|
|
1505
|
+
for (const item of flushBuffered())
|
|
1506
|
+
yield item;
|
|
1507
|
+
throw error;
|
|
1508
|
+
}
|
|
1509
|
+
for (const item of flushBuffered())
|
|
1510
|
+
yield item;
|
|
1511
|
+
/**
|
|
1512
|
+
* Provider 未发送 block-end(中断或异常)时,结束已透传的原文块。
|
|
1513
|
+
*
|
|
1514
|
+
* 不能用 `finally` 里的 `yield`:异常正在传播时生成器已经结束,后续 yield 会被
|
|
1515
|
+
* 直接丢弃,用户会看不到已经生成的半截回复。
|
|
1516
|
+
*/
|
|
1517
|
+
function* flushBuffered() {
|
|
1518
|
+
for (const block of [...blocks.values()]) {
|
|
1519
|
+
if (block.closed || block.text.trim() === '')
|
|
1520
|
+
continue;
|
|
1521
|
+
block.closed = true;
|
|
1522
|
+
yield { type: 'block-end', index: block.index, block: { type: block.kind, text: block.text } };
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
function extractTurnInput(messages, dshContext, acceptedPeerInput = pendingPeerInput(messages)) {
|
|
1527
|
+
if (acceptedPeerInput.some(isTeamInputMessage)) {
|
|
1528
|
+
const parts = acceptedPeerInput.map(message => {
|
|
1529
|
+
const part = extractMessageInput(message.content, dshContext);
|
|
1530
|
+
const translated = isHumanUserMessage(message) ? readInputTranslation(message.source) : undefined;
|
|
1531
|
+
return translated ? { ...part, prompt: translated.translated } : part;
|
|
1532
|
+
});
|
|
1533
|
+
const prompt = parts.map(part => part.prompt).filter(text => text.trim() !== '').join('\n\n');
|
|
1534
|
+
return { prompt, peerInput: true, translationPrompt: prompt, untranslatedPrompt: '', attachments: parts.flatMap(part => part.attachments), translatePrompt: false, messages: stripInputTranslationDisplay(messages) };
|
|
1535
|
+
}
|
|
1066
1536
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1067
1537
|
const message = messages[index];
|
|
1068
1538
|
if (message !== undefined && isInjectedStepNotice(message)) {
|
|
@@ -1085,9 +1555,10 @@ function extractTurnInput(messages, dshContext) {
|
|
|
1085
1555
|
: messages.filter((_candidate, candidateIndex) => !referenceIndexes.includes(candidateIndex));
|
|
1086
1556
|
const translatedInput = readInputTranslation(message.source);
|
|
1087
1557
|
if (translatedInput !== undefined) {
|
|
1558
|
+
const prompt = [translatedInput.translated, ...referenceText].join('\n\n');
|
|
1088
1559
|
return {
|
|
1089
|
-
prompt
|
|
1090
|
-
translationPrompt:
|
|
1560
|
+
prompt,
|
|
1561
|
+
translationPrompt: prompt,
|
|
1091
1562
|
untranslatedPrompt: '',
|
|
1092
1563
|
attachments: direct.attachments,
|
|
1093
1564
|
translatePrompt: false,
|
|
@@ -1120,7 +1591,7 @@ function readInputTranslation(value) {
|
|
|
1120
1591
|
return undefined;
|
|
1121
1592
|
if (candidate.original.trim() === '' || candidate.translated.trim() === '')
|
|
1122
1593
|
return undefined;
|
|
1123
|
-
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja'
|
|
1594
|
+
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja' || candidate.targetLanguage === 'zh'
|
|
1124
1595
|
? candidate.targetLanguage
|
|
1125
1596
|
: 'en';
|
|
1126
1597
|
const sourceLanguage = candidate.sourceLanguage === 'zh' || candidate.sourceLanguage === 'en' || candidate.sourceLanguage === 'fr' || candidate.sourceLanguage === 'de' || candidate.sourceLanguage === 'ja'
|
|
@@ -1170,6 +1641,19 @@ function replaceInputTranslationContent(content, text) {
|
|
|
1170
1641
|
});
|
|
1171
1642
|
return replaced ? blocks : [{ type: 'text', text }, ...content];
|
|
1172
1643
|
}
|
|
1644
|
+
/** Resolved files already have localized path notices. Leaving their file blocks
|
|
1645
|
+
* would make DSH append another, English-only file notice at adapter dispatch.
|
|
1646
|
+
* Preserve images and unresolved files so DSH retains modality/error handling.
|
|
1647
|
+
*/
|
|
1648
|
+
function nativeTranslationContent(content, dshContext) {
|
|
1649
|
+
if (!Array.isArray(content))
|
|
1650
|
+
return content;
|
|
1651
|
+
return content.filter(part => {
|
|
1652
|
+
if (!isRecord(part) || part.type !== 'file')
|
|
1653
|
+
return true;
|
|
1654
|
+
return resolveDshAttachmentPath(dshContext, 'file', isRecord(part.attachment) ? part.attachment : part) === undefined;
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1173
1657
|
/** DSH 为工具分段注入的继续提示必须成为下一次 Provider 请求的 prompt。 */
|
|
1174
1658
|
function isInjectedStepNotice(message) {
|
|
1175
1659
|
if (message.role !== 'user' || !isRecord(message.source))
|
|
@@ -1225,11 +1709,13 @@ function extractMessageInput(content, dshContext) {
|
|
|
1225
1709
|
const mimeType = typeof reference.mediaType === 'string' && reference.mediaType.trim() !== '' ? reference.mediaType.trim() : undefined;
|
|
1226
1710
|
attachments.push({ kind, path, ...(name === undefined ? {} : { name }), ...(mimeType === undefined ? {} : { mimeType }) });
|
|
1227
1711
|
}
|
|
1228
|
-
const fileNotes = attachments.filter((attachment) => attachment.kind === 'file').map((attachment) => `附件文件${attachment.name === undefined ? '' : `「${attachment.name}」`}位于:${attachment.path}\n请使用工具读取该文件的内容。`);
|
|
1229
1712
|
const translationPrompt = text.join('\n\n').trim();
|
|
1230
|
-
const untranslatedPrompt =
|
|
1713
|
+
const untranslatedPrompt = attachmentNotices(attachments);
|
|
1231
1714
|
return { prompt: [translationPrompt, untranslatedPrompt].filter(value => value !== '').join('\n\n'), translationPrompt, untranslatedPrompt, attachments };
|
|
1232
1715
|
}
|
|
1716
|
+
function attachmentNotices(attachments, language) {
|
|
1717
|
+
return attachments.filter(attachment => attachment.kind === 'file').map(attachment => attachmentFileNotice(attachment, language)).join('\n\n');
|
|
1718
|
+
}
|
|
1233
1719
|
function resolveDshAttachmentPath(dshContext, kind, reference) {
|
|
1234
1720
|
if (dshContext === undefined || typeof reference.attachmentId !== 'string')
|
|
1235
1721
|
return undefined;
|