@jingyi0605/codingns4dsh 0.2.1-beta.8 → 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 +14 -7
- 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/dsh-peer-host-preboot-shim.d.ts.map +1 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +26 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.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 +57 -91
- 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/avatar/desktop-bridge.js +1 -1
- package/data/build/dist/client/avatar/desktop-bridge.js.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.d.ts +3 -1
- package/data/build/dist/client/avatar/desktop-view.d.ts.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.js +31 -12
- package/data/build/dist/client/avatar/desktop-view.js.map +1 -1
- package/data/build/dist/client/avatar/notification-bubble.d.ts +7 -1
- package/data/build/dist/client/avatar/notification-bubble.d.ts.map +1 -1
- package/data/build/dist/client/avatar/notification-bubble.js +68 -33
- package/data/build/dist/client/avatar/notification-bubble.js.map +1 -1
- package/data/build/dist/client/bundle.js +54814 -34268
- 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 +321 -38
- 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.assistant-notifications.js.map +1 -1
- package/data/build/dist/client/client.delegate-command.js +50 -32
- 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 +103 -17
- 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 +173 -0
- package/data/build/dist/client/client.session-translation.js.map +1 -0
- package/data/build/dist/client/client.transport.js +813 -48
- 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 +1408 -544
- 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/assistant-notification-store.d.ts +1 -1
- package/data/build/dist/client/features/assistant-notification-store.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-notification-store.js +1 -1
- package/data/build/dist/client/features/assistant-notification-store.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/global-voice-assistant.d.ts.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.js +12 -6
- package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
- package/data/build/dist/client/features/index.d.ts +1 -0
- package/data/build/dist/client/features/index.d.ts.map +1 -1
- package/data/build/dist/client/features/index.js +5 -0
- package/data/build/dist/client/features/index.js.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +1 -0
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
- package/data/build/dist/client/features/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 +105 -17
- 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 +3 -0
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/client/features/session-translation.js +117 -0
- package/data/build/dist/client/features/session-translation.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.js +6 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts +20 -1
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +94 -18
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
- package/data/build/dist/client/git-management-settings.d.ts +4 -0
- package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
- package/data/build/dist/client/git-management-settings.js +73 -0
- package/data/build/dist/client/git-management-settings.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts +2 -1
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +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/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +6 -1
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +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 +154 -0
- 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-file-links.d.ts +11 -0
- package/data/build/dist/client/session-file-links.d.ts.map +1 -0
- package/data/build/dist/client/{peer-host-file-links.js → session-file-links.js} +13 -3
- package/data/build/dist/client/session-file-links.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +72 -0
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-chat.js +874 -0
- package/data/build/dist/client/session-translation-chat.js.map +1 -0
- 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 +66 -17
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js +28 -2
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.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 +21 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +106 -6
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/attachment-utils.js +9 -8
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +184 -21
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +28 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +198 -34
- 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 +12 -2
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +158 -3
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +8 -2
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +39 -7
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts +27 -0
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-history.js +131 -1
- package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -1
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js +9 -9
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.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 +16 -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 +120 -13
- 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 +806 -53
- 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 +558 -98
- 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/legacy-session-settings.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js +7 -2
- package/data/build/dist/host/cli-adapters/legacy-session-settings.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 +26 -2
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +183 -48
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +67 -7
- 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/provider-subscription.d.ts +5 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +90 -25
- package/data/build/dist/host/cli-adapters/provider-subscription.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 +163 -56
- 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/session-store.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/session-store.js +3 -0
- package/data/build/dist/host/cli-adapters/session-store.js.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.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 +65 -8
- 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 +149 -21
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js +20 -20
- 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 +46 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +205 -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 +122 -27
- 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/desktop-assistant/controller.d.ts +1 -0
- package/data/build/dist/host/desktop-assistant/controller.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.js +21 -3
- package/data/build/dist/host/desktop-assistant/controller.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.js +15 -3
- package/data/build/dist/host/desktop-assistant/mac-agent.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/win-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/win-agent.js +21 -3
- package/data/build/dist/host/desktop-assistant/win-agent.js.map +1 -1
- package/data/build/dist/host/features/assistant-notifications.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-notifications.js +12 -4
- package/data/build/dist/host/features/assistant-notifications.js.map +1 -1
- package/data/build/dist/host/features/file-management.d.ts.map +1 -1
- package/data/build/dist/host/features/file-management.js +10 -1
- package/data/build/dist/host/features/file-management.js.map +1 -1
- package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
- package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
- package/data/build/dist/host/features/git-commit-message.js +66 -0
- package/data/build/dist/host/features/git-commit-message.js.map +1 -0
- package/data/build/dist/host/features/git-management.d.ts +11 -2
- package/data/build/dist/host/features/git-management.d.ts.map +1 -1
- package/data/build/dist/host/features/git-management.js +61 -7
- package/data/build/dist/host/features/git-management.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +2 -3
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts +1 -0
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +5 -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 +24 -10
- 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 +46 -0
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-service.js +490 -0
- package/data/build/dist/host/features/session-translation-service.js.map +1 -0
- package/data/build/dist/host/features/session-translation.d.ts +5 -0
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation.js +40 -0
- package/data/build/dist/host/features/session-translation.js.map +1 -0
- package/data/build/dist/host/features/types.d.ts +13 -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/image-artifact-store.d.ts +21 -0
- package/data/build/dist/host/image-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/image-artifact-store.js +136 -0
- package/data/build/dist/host/image-artifact-store.js.map +1 -0
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +35 -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-protocol.d.ts +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +2 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +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 +23 -2
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +57 -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 +24 -13
- 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 +201 -14
- 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 +37 -0
- 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/assistant-notifications.d.ts +2 -2
- package/data/build/dist/shared/assistant-notifications.d.ts.map +1 -1
- 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 +86 -2
- 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 +13 -1
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +6 -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 +131 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.js +167 -0
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -0
- 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/delegation-carrier.js +6 -6
- package/data/build/dist/shared/delegation-carrier.js.map +1 -1
- package/data/build/dist/shared/desktop-assistant.d.ts +10 -4
- package/data/build/dist/shared/desktop-assistant.d.ts.map +1 -1
- package/data/build/dist/shared/desktop-assistant.js +28 -8
- package/data/build/dist/shared/desktop-assistant.js.map +1 -1
- package/data/build/dist/shared/index.d.ts +3 -1
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +3 -1
- 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 +36 -35
- 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
- package/data/build/dist/client/peer-host-file-links.d.ts +0 -8
- package/data/build/dist/client/peer-host-file-links.d.ts.map +0 -1
- package/data/build/dist/client/peer-host-file-links.js.map +0 -1
|
@@ -15,22 +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';
|
|
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';
|
|
34
58
|
export function createCliAdaptersFeature(options = {}) {
|
|
35
59
|
return {
|
|
36
60
|
descriptor: {
|
|
@@ -39,8 +63,17 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
39
63
|
enabledByDefault: true,
|
|
40
64
|
dependencies: [],
|
|
41
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
|
+
],
|
|
42
72
|
},
|
|
43
73
|
async start(context) {
|
|
74
|
+
const lifetime = new AbortController();
|
|
75
|
+
const magpieSessionRouting = createMagpieSessionRouting();
|
|
76
|
+
context.resources.add(() => magpieSessionRouting.dispose());
|
|
44
77
|
// 用量查询超时对所有适配器统一生效:同一个 timeoutMs 下发给全部网络读取器,
|
|
45
78
|
// 设置变更时整体重建,避免旧超时继续生效。
|
|
46
79
|
const buildSubscriptions = (settings) => {
|
|
@@ -48,11 +81,22 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
48
81
|
return new ProviderSubscriptionService({ commandCode: new CommandCodeSubscriptionService({ timeoutMs }), timeoutMs });
|
|
49
82
|
};
|
|
50
83
|
let subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
84
|
+
const magpieUsage = options.magpieUsage ?? new MagpieUsageService({ lifetimeSignal: lifetime.signal });
|
|
51
85
|
let subscriptionSettings = JSON.stringify(context.services.settings?.get().subscriptionUsage ?? null);
|
|
52
86
|
// 注入的 registry 自带 SessionStore;只有自建时才有本地 store 变量。
|
|
53
87
|
const sessionStore = options.registry?.sessionRecords
|
|
54
88
|
?? new CodingNsCliSessionStore(context.services.settings === undefined ? {} : { settings: context.services.settings });
|
|
55
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
|
+
}
|
|
99
|
+
const translation = context.services.sessionTranslation;
|
|
56
100
|
// 启动只恢复持久化索引;旧会话在打开时迁移,禁止在首屏扫描全部历史。
|
|
57
101
|
const registry = options.registry ?? new CodingNsCliAdapterRegistry([
|
|
58
102
|
new CommandCodeDriver({ enableAcp: true }),
|
|
@@ -60,7 +104,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
60
104
|
new KimiCliDriver(),
|
|
61
105
|
new GeminiCliDriver(),
|
|
62
106
|
new PiAgentDriver(),
|
|
63
|
-
new CodexAppServerDriver(),
|
|
107
|
+
new CodexAppServerDriver({ computerUse: 'auto' }),
|
|
64
108
|
new OpenCodeDriver(),
|
|
65
109
|
new GrokBuildDriver(),
|
|
66
110
|
new MiniMaxCodeDriver(),
|
|
@@ -79,6 +123,45 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
79
123
|
...(context.services.nativeSessions === undefined ? {} : { nativeSessions: context.services.nativeSessions }),
|
|
80
124
|
});
|
|
81
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
|
+
}
|
|
82
165
|
context.resources.add(() => {
|
|
83
166
|
if (registry === undefined)
|
|
84
167
|
return;
|
|
@@ -86,10 +169,30 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
86
169
|
});
|
|
87
170
|
registry.applyEnabledSettings(context.services.settings?.get().agentAdapters);
|
|
88
171
|
const virtualProviders = createDshVirtualProviderRegistration(context.services.dshContext);
|
|
89
|
-
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
90
172
|
if (virtualProviders !== undefined)
|
|
91
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
|
+
}
|
|
92
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());
|
|
93
196
|
// 外部适配器没有经过 DSH 原生 Agent Loop,必须把同一套运行状态投影给
|
|
94
197
|
// subagentCatalog。这里集中去重,避免 llm/stream、原生 session/event 和
|
|
95
198
|
// agent/status 同时到达时反复刷新同一个子 Agent。
|
|
@@ -128,18 +231,57 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
128
231
|
});
|
|
129
232
|
context.resources.add(disposeNativeEvents);
|
|
130
233
|
}
|
|
131
|
-
|
|
132
|
-
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;
|
|
133
255
|
switch (action) {
|
|
134
|
-
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)));
|
|
135
261
|
case 'catalog/refresh': return registry.refreshCatalog(asRecord(payload)?.adapterId === undefined ? undefined : readAdapterId(payload)).then((catalog) => {
|
|
136
262
|
subscriptions = buildSubscriptions(context.services.settings?.get());
|
|
137
|
-
return
|
|
263
|
+
return asRecord(payload)?.checkUpdates === true
|
|
264
|
+
? updates.refresh(teamCatalog(catalog), asRecord(payload)?.adapterId)
|
|
265
|
+
: updates.catalog(teamCatalog(catalog));
|
|
138
266
|
});
|
|
139
267
|
case 'models': {
|
|
140
268
|
const adapterId = readAdapterId(payload);
|
|
141
|
-
|
|
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;
|
|
142
279
|
}
|
|
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);
|
|
143
285
|
case 'skills': {
|
|
144
286
|
const request = readSkillsRequest(payload);
|
|
145
287
|
const cwd = resolveSessionCwd(context.services.nativeSessions, request.sessionId, null);
|
|
@@ -157,15 +299,27 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
157
299
|
}
|
|
158
300
|
return registry.getSession(sessionId);
|
|
159
301
|
}
|
|
160
|
-
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
|
+
}
|
|
161
311
|
case 'session/list': return registry.listSessions(readSessionListOptions(payload));
|
|
162
312
|
case 'session/adapter-map':
|
|
163
313
|
// 列表查询只返回持久化索引,不能触发会话加载或历史解析。
|
|
164
314
|
return sessionStore.adapterBindings();
|
|
165
315
|
case 'session/archive': return registry.archiveSession(readSessionId(payload));
|
|
166
|
-
case 'session/steer': return registry
|
|
167
|
-
case 'session/follow-up': return registry
|
|
168
|
-
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
|
+
}
|
|
169
323
|
case 'team/status': return context.services.nativeTeam?.diagnostic() ?? registry.teamDiagnostic();
|
|
170
324
|
case 'team/members': return requireTeam(context).invoke('members', payload);
|
|
171
325
|
case 'team/tasks': return requireTeam(context).invoke('tasks', payload);
|
|
@@ -178,7 +332,17 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
178
332
|
case 'team/interrupt': return requireTeam(context).invoke('interrupt', payload);
|
|
179
333
|
case 'subscription': {
|
|
180
334
|
const subscription = readSubscriptionRequest(payload);
|
|
181
|
-
|
|
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 };
|
|
182
346
|
}
|
|
183
347
|
case 'subscription/reset': {
|
|
184
348
|
const subscription = readSubscriptionResetRequest(payload);
|
|
@@ -218,10 +382,18 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
218
382
|
try {
|
|
219
383
|
const agents = readOptionalContextService(context.services.dshContext, 'agents');
|
|
220
384
|
const server = await startSubagentBridgeServer({
|
|
385
|
+
teamAccess: (sessionId) => teamDispatcher.access(sessionId),
|
|
386
|
+
teamDispatch: (sessionId, input, signal) => teamDispatcher.dispatch(sessionId, input, signal),
|
|
221
387
|
dispatch: (request) => dispatchBridgeSubagent(request, {
|
|
222
388
|
agents: agents,
|
|
223
389
|
nativeSessions: context.services.nativeSessions,
|
|
224
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),
|
|
225
397
|
});
|
|
226
398
|
bridgeServer = server;
|
|
227
399
|
setSubagentBridge(server.runtime);
|
|
@@ -256,6 +428,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
256
428
|
virtualProviders?.setProviders(registry.enabledAdapterIds());
|
|
257
429
|
registry.syncPreferences(next.agentAdapterPreferences);
|
|
258
430
|
sessionStore.sync(next.cliSessions);
|
|
431
|
+
translationRecovery.cancelDisabled(next.sessionTranslation);
|
|
259
432
|
const nextSubscriptionSettings = JSON.stringify(next.subscriptionUsage ?? null);
|
|
260
433
|
if (nextSubscriptionSettings !== subscriptionSettings) {
|
|
261
434
|
subscriptionSettings = nextSubscriptionSettings;
|
|
@@ -268,6 +441,12 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
268
441
|
if (events !== undefined) {
|
|
269
442
|
const dispose = events.on('llm/stream', async function* (options, next) {
|
|
270
443
|
const value = asRecord(options);
|
|
444
|
+
// 翻译服务也复用 DSH 原生 LLM,但它不是外部 Agent 回合;必须在这里
|
|
445
|
+
// 旁路 CLI Provider 接管,否则翻译请求会被再次当成 Grok/Codex 请求。
|
|
446
|
+
if (isSessionTranslationLlmRequest(value)) {
|
|
447
|
+
yield* next();
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
271
450
|
const sessionId = typeof value?.sessionId === 'string' ? value.sessionId : '';
|
|
272
451
|
if (value?.purpose === 'session-title' || value?.purpose === 'compaction') {
|
|
273
452
|
yield* next();
|
|
@@ -308,7 +487,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
308
487
|
}
|
|
309
488
|
else if (sessionId !== '')
|
|
310
489
|
clearDelegationAuthorization(sessionId);
|
|
311
|
-
const selectedExternalAdapter = selectExternalAdapter(dshSelection.providerId, inferMessageAdapter(messages), registry);
|
|
490
|
+
const selectedExternalAdapter = storedConfig.adapterId === 'dsh' && storedConfig.teamId ? undefined : selectExternalAdapter(fromCliProviderId(dshSelection.providerId), inferMessageAdapter(messages), registry);
|
|
312
491
|
// DSH 的 modelSelection 只描述 DSH 自己那条模型路由(例如 glor/deepseek)。
|
|
313
492
|
// 只有它明确指向即将接管的外部适配器时,model/effort 才属于该适配器;
|
|
314
493
|
// 当适配器是从会话历史推断出来的(fork 子会话继承父会话的外部消息,而
|
|
@@ -316,7 +495,7 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
316
495
|
// 写进外部 Agent——Codex 会用它 thread/start 并直接 404,整个会话从此
|
|
317
496
|
// 无法继续。此时必须留空,由适配器自己的偏好决定模型。
|
|
318
497
|
const selectionOwnedByAdapter = selectedExternalAdapter !== undefined
|
|
319
|
-
&& dshSelection.providerId === selectedExternalAdapter;
|
|
498
|
+
&& (fromCliProviderId(dshSelection.providerId) ?? dshSelection.providerId) === selectedExternalAdapter;
|
|
320
499
|
let config = storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined
|
|
321
500
|
? {
|
|
322
501
|
adapterId: selectedExternalAdapter,
|
|
@@ -330,21 +509,65 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
330
509
|
if (sessionId !== '' && storedConfig.adapterId === 'dsh' && selectedExternalAdapter !== undefined) {
|
|
331
510
|
config = registry.setSession(sessionId, config);
|
|
332
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
|
+
}
|
|
333
515
|
if (config.adapterId === 'dsh') {
|
|
334
516
|
const selection = dshSelection;
|
|
335
517
|
if (sessionId !== '' && (selection.modelId !== undefined || selection.effortId !== undefined)) {
|
|
336
518
|
registry.setSession(sessionId, { adapterId: 'dsh', ...selection });
|
|
337
519
|
}
|
|
338
|
-
|
|
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()));
|
|
339
533
|
return;
|
|
340
534
|
}
|
|
341
535
|
const cwd = resolveSessionCwd(context.services.nativeSessions, sessionId, value);
|
|
342
|
-
const turnInput = extractTurnInput(messages, context.services.dshContext);
|
|
536
|
+
const turnInput = extractTurnInput(messages, context.services.dshContext, teamInputs.take(sessionId, messages));
|
|
343
537
|
const turnOptions = readCliTurnOptions(value);
|
|
344
538
|
const runtimeEnv = readCliRuntimeEnv(value);
|
|
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;
|
|
543
|
+
let translatedPrompt = turnInput.translationPrompt;
|
|
544
|
+
if (turnInput.translatePrompt && turnInput.translationPrompt.trim() !== '' && translationLanguage !== undefined) {
|
|
545
|
+
try {
|
|
546
|
+
translatedPrompt = (await translationRecovery.translateInput(sessionId, config.adapterId, turnInput.translationPrompt, requestSignal)).translated;
|
|
547
|
+
}
|
|
548
|
+
catch (error) {
|
|
549
|
+
if (!(error instanceof SessionTranslationCancelled) && !requestSignal?.aborted)
|
|
550
|
+
throw error;
|
|
551
|
+
yield { type: 'finish', reason: { kind: 'stop' } };
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
const prompt = turnInput.translatePrompt
|
|
556
|
+
? [translatedPrompt, translationLanguage === undefined ? turnInput.untranslatedPrompt : attachmentNotices(turnInput.attachments, translationLanguage)].filter((part) => part.trim() !== '').join('\n\n')
|
|
557
|
+
: turnInput.prompt;
|
|
345
558
|
// 权限状态必须与 DSH 会话当前生效值同源。驱动不能自行假设“完全权限”,
|
|
346
559
|
// 也不能把缺省当成“已确认无限制”:解析失败时留空,由驱动沿用保守默认。
|
|
347
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
|
+
}
|
|
348
571
|
// 只有 Provider 驱动明确声明可以维护连续事件流,才把工具边界映射为 DSH step。
|
|
349
572
|
// Command Code、Codex 自己维护 assistant 消息边界;OpenCode 由 Registry
|
|
350
573
|
// 挂起并续读同一条 SSE。其他驱动仍把整轮保持在一个 step,避免 token-meter
|
|
@@ -352,7 +575,9 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
352
575
|
const input = {
|
|
353
576
|
sessionId,
|
|
354
577
|
messages: turnInput.messages,
|
|
355
|
-
prompt
|
|
578
|
+
prompt,
|
|
579
|
+
...(turnInput.peerInput ? { peerInput: true } : {}),
|
|
580
|
+
...(translationLanguage === undefined ? {} : { translationLanguage }),
|
|
356
581
|
...(turnInput.attachments.length === 0 ? {} : { attachments: turnInput.attachments }),
|
|
357
582
|
...(permission === undefined ? {} : { permission }),
|
|
358
583
|
...(turnOptions.plan === true ? { plan: true } : {}),
|
|
@@ -360,12 +585,14 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
360
585
|
...(turnOptions.enableAskUserQuestion === true ? { enableAskUserQuestion: true } : {}),
|
|
361
586
|
...(runtimeEnv === undefined ? {} : { runtimeEnv }),
|
|
362
587
|
...(config.modelId ? { modelId: config.modelId } : {}),
|
|
588
|
+
...(magpieCodexContextWindow === undefined ? {} : { modelContextWindow: magpieCodexContextWindow }),
|
|
363
589
|
...(config.effortId ? { effortId: config.effortId } : {}),
|
|
364
590
|
...(config.serviceTierId ? { serviceTierId: config.serviceTierId } : {}),
|
|
591
|
+
...(config.translationEnabled === undefined ? {} : { translationEnabled: config.translationEnabled }),
|
|
365
592
|
...(config.providerSessionId ? { providerSessionId: config.providerSessionId } : {}),
|
|
366
593
|
...(config.rawStoreRef ? { rawStoreRef: config.rawStoreRef } : {}),
|
|
367
594
|
...(cwd === undefined ? {} : { cwd }),
|
|
368
|
-
...(
|
|
595
|
+
...(requestSignal === undefined ? {} : { signal: requestSignal }),
|
|
369
596
|
...((registry.supportsSegmentedTurns(config.adapterId) || registry.supportsToolStepSplitting(config.adapterId))
|
|
370
597
|
// SessionStore/controller 可能是远端代理而未标记 available,但原生
|
|
371
598
|
// Agent 仍然提供 inject;用真实的 next-step 能力决定分段,不能让
|
|
@@ -385,6 +612,14 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
385
612
|
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
386
613
|
respondPermission: (response) => registry.respondPermission(sessionId, response),
|
|
387
614
|
respondQuestion: (response) => registry.respondQuestion(sessionId, response),
|
|
615
|
+
...(translation === undefined ? {} : { translation }),
|
|
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
|
+
},
|
|
388
623
|
});
|
|
389
624
|
const discardSuspendedTurn = () => registry.discardSegmentedTurn(sessionId);
|
|
390
625
|
input.signal?.addEventListener('abort', discardSuspendedTurn, { once: true });
|
|
@@ -394,6 +629,12 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
394
629
|
// 外部适配器绕过 DSH 原生 Agent Loop,必须在真正执行外部流前补发同一状态,
|
|
395
630
|
// 否则外部子会话完成后虽已写入历史,客户端目录仍不会得到 running -> idle。
|
|
396
631
|
publishExternalStatus(sessionId, true);
|
|
632
|
+
// 分步驱动(OpenCode、Claude、CodeBuddy 等)在工具完成处只结束一个 DSH
|
|
633
|
+
// step:Agent Loop 注入 next-step 后仍停留在同一个 turn 里继续下一步。
|
|
634
|
+
// 这种挂起不是回合结束,本段 llm/stream 返回时不能播报 idle,否则每个
|
|
635
|
+
// 工具完成都会先「已完成」再「进行中」,会话状态随工具调用反复闪烁。
|
|
636
|
+
// 真正的收尾由最后一段的 finish、原生 turn/end 与 agent/status idle 补齐。
|
|
637
|
+
let suspendedForNextStep = false;
|
|
397
638
|
try {
|
|
398
639
|
for await (const chunk of registry.execute({ ...input, adapterId: config.adapterId })) {
|
|
399
640
|
if (chunk.type === 'step-boundary') {
|
|
@@ -403,6 +644,8 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
403
644
|
const injected = nativeSessions?.injectNextStep?.(sessionId) ?? false;
|
|
404
645
|
if (!injected)
|
|
405
646
|
discardSuspendedTurn();
|
|
647
|
+
else
|
|
648
|
+
suspendedForNextStep = true;
|
|
406
649
|
for (const dshChunk of await projector.push(chunk))
|
|
407
650
|
yield dshChunk;
|
|
408
651
|
continue;
|
|
@@ -424,7 +667,11 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
424
667
|
}
|
|
425
668
|
finally {
|
|
426
669
|
input.signal?.removeEventListener('abort', discardSuspendedTurn);
|
|
427
|
-
|
|
670
|
+
// 挂起续段不是回合结束:这里不能播报 idle,否则每个工具完成都会让会话
|
|
671
|
+
// 状态在「已完成 / 进行中」之间来回闪烁。收尾由最后一段的 finish、
|
|
672
|
+
// 原生 turn/end 与 agent/status idle 补齐。
|
|
673
|
+
if (!suspendedForNextStep)
|
|
674
|
+
publishExternalStatus(sessionId, false);
|
|
428
675
|
}
|
|
429
676
|
});
|
|
430
677
|
if (typeof dispose === 'function')
|
|
@@ -434,6 +681,10 @@ export function createCliAdaptersFeature(options = {}) {
|
|
|
434
681
|
// DSH 先停用设置上下文再执行异步资源清理时,旧的写队列不能继续调用
|
|
435
682
|
// configEditor,否则会出现 inactive context 并污染退出日志。
|
|
436
683
|
sessionStore.dispose();
|
|
684
|
+
// Close native interaction cards before unloading their provider transports.
|
|
685
|
+
lifetime.abort();
|
|
686
|
+
updates.dispose();
|
|
687
|
+
await management.dispose();
|
|
437
688
|
await registry.dispose();
|
|
438
689
|
await sessionStore.flush();
|
|
439
690
|
setAdapterRegistry(undefined);
|
|
@@ -485,22 +736,67 @@ function createExternalSessionStatusPublisher(events, registry, sessionStore) {
|
|
|
485
736
|
* 在 Agent Loop 的可变输入边界消费委派 carrier。
|
|
486
737
|
*
|
|
487
738
|
* `llm/stream` 收到的 LOOP 请求由 DSH 深冻结,监听器只能读取;如果在那里改写
|
|
488
|
-
* `messages`,会直接抛出只读属性异常。`agent/pre-step`
|
|
489
|
-
*
|
|
739
|
+
* `messages`,会直接抛出只读属性异常。`agent/pre-step` 返回的新消息保留用户原文,并把
|
|
740
|
+
* 译文写入 source 元数据;外部适配器再据此构造发给 Agent 的译文。
|
|
490
741
|
*/
|
|
491
|
-
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus) {
|
|
742
|
+
function registerDelegationAgentHooks(dshContext, registry, resources, publishExternalStatus, translation, translationRecovery, promptTranslation, nativeSessions, teamInputs) {
|
|
492
743
|
if (dshContext === undefined || typeof dshContext.on !== 'function')
|
|
493
744
|
return;
|
|
494
745
|
const disposers = [];
|
|
495
746
|
const register = (name, listener) => {
|
|
496
|
-
|
|
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' });
|
|
497
749
|
if (typeof disposer === 'function')
|
|
498
750
|
disposers.push(disposer);
|
|
499
751
|
};
|
|
752
|
+
// DSH Agent Loop 会用 agent/request 的 provider/model 生成 assistant/message.source。
|
|
753
|
+
// 外部流虽然在 llm/stream 旁路执行,但如果这里仍保留 DeepSeek 路由,回复历史
|
|
754
|
+
// 就会被错误归属为 DeepSeek。只改写已绑定的外部会话,不影响 DSH 原生会话。
|
|
755
|
+
register('agent/request', async (payload, next) => {
|
|
756
|
+
const resolved = await next();
|
|
757
|
+
const config = asRecord(resolved);
|
|
758
|
+
if (config === null)
|
|
759
|
+
return resolved;
|
|
760
|
+
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
761
|
+
if (sessionId === '')
|
|
762
|
+
return config;
|
|
763
|
+
let session;
|
|
764
|
+
try {
|
|
765
|
+
session = registry.getSession(sessionId);
|
|
766
|
+
}
|
|
767
|
+
catch {
|
|
768
|
+
return config;
|
|
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);
|
|
775
|
+
const configuredAdapter = session.adapterId !== 'dsh' && registry.isEnabled(session.adapterId)
|
|
776
|
+
? session.adapterId
|
|
777
|
+
: providerAdapter !== undefined && registry.isEnabled(providerAdapter)
|
|
778
|
+
? providerAdapter
|
|
779
|
+
: undefined;
|
|
780
|
+
if (configuredAdapter === undefined)
|
|
781
|
+
return config;
|
|
782
|
+
if (session.adapterId === 'dsh') {
|
|
783
|
+
session = registry.setSession(sessionId, {
|
|
784
|
+
adapterId: configuredAdapter,
|
|
785
|
+
...(typeof config.model === 'string' && config.model.trim() !== '' ? { modelId: config.model.trim() } : {}),
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
const model = session.modelId?.trim() || (typeof config.model === 'string' && config.model.trim() !== '' ? config.model.trim() : configuredAdapter);
|
|
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 };
|
|
795
|
+
});
|
|
500
796
|
register('agent/pre-step', async (payload, next) => {
|
|
501
797
|
const record = asRecord(payload);
|
|
502
798
|
const sessionId = readAgentSessionId(record?.agent);
|
|
503
|
-
|
|
799
|
+
let messages = Array.isArray(record?.messages) ? record.messages.filter(isMessage) : [];
|
|
504
800
|
let delegation;
|
|
505
801
|
if (containsDelegationCarrier(messages)) {
|
|
506
802
|
delegation = rewriteDelegationMessages(messages, await registry.catalogForUse(delegationAdapterIds(messages)));
|
|
@@ -508,17 +804,52 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
508
804
|
clearDelegationAuthorization(sessionId);
|
|
509
805
|
else if (delegation.kind === 'rewritten') {
|
|
510
806
|
setDelegationAuthorization(sessionId, delegation.value.targets);
|
|
807
|
+
messages = [...delegation.value.messages];
|
|
511
808
|
}
|
|
512
809
|
}
|
|
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
|
+
}
|
|
513
819
|
const decision = await next();
|
|
514
|
-
if (
|
|
820
|
+
if (!isEnterPreStepDecision(decision))
|
|
515
821
|
return decision;
|
|
516
|
-
//
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
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
|
+
}
|
|
522
853
|
});
|
|
523
854
|
// 正常结束、异常结束和中断最终都会进入 idle;在此清理本轮授权,避免下一轮
|
|
524
855
|
// 没有 carrier 时继承上一轮的目标白名单。
|
|
@@ -528,12 +859,16 @@ function registerDelegationAgentHooks(dshContext, registry, resources, publishEx
|
|
|
528
859
|
if (record?.status === 'running')
|
|
529
860
|
publishExternalStatus(sessionId, true);
|
|
530
861
|
else if (record?.status === 'idle') {
|
|
862
|
+
translationRecovery.cancelSession(sessionId);
|
|
531
863
|
publishExternalStatus(sessionId, false);
|
|
532
864
|
clearDelegationAuthorization(sessionId);
|
|
533
865
|
}
|
|
534
866
|
});
|
|
535
867
|
register('agent/disposed', (payload) => {
|
|
536
868
|
const sessionId = readAgentSessionId(asRecord(payload)?.agent);
|
|
869
|
+
teamInputs?.release(sessionId);
|
|
870
|
+
getSubagentBridge()?.revokeTeamSession?.(sessionId);
|
|
871
|
+
translationRecovery.cancelSession(sessionId);
|
|
537
872
|
// disposed 只代表运行时释放;subagentCatalog 没有删除语义,保留目录项并
|
|
538
873
|
// 把它标成 idle,后续若 DSH 重新激活会再次收到 running。
|
|
539
874
|
publishExternalStatus(sessionId, false);
|
|
@@ -548,6 +883,24 @@ function isEnterPreStepDecision(value) {
|
|
|
548
883
|
const record = asRecord(value);
|
|
549
884
|
return record?.kind === 'enter' && Array.isArray(record.messages);
|
|
550
885
|
}
|
|
886
|
+
/**
|
|
887
|
+
* 翻译调用优先使用显式字段;若 DSH 在进入 waterfall 前规范化请求并丢掉未知字段,
|
|
888
|
+
* 再用 system 提示里的稳定标记识别。否则翻译请求会被误当成当前外部 Agent 回合。
|
|
889
|
+
*/
|
|
890
|
+
function isSessionTranslationLlmRequest(value) {
|
|
891
|
+
if (value?.codingnsTranslation === true)
|
|
892
|
+
return true;
|
|
893
|
+
if (typeof value?.system === 'string' && value.system.includes('CODINGNS_SESSION_TRANSLATION_V1'))
|
|
894
|
+
return true;
|
|
895
|
+
if (!Array.isArray(value?.messages))
|
|
896
|
+
return false;
|
|
897
|
+
return value.messages.some((message) => {
|
|
898
|
+
const record = asRecord(message);
|
|
899
|
+
if (record?.role !== 'system' || !Array.isArray(record.content))
|
|
900
|
+
return false;
|
|
901
|
+
return record.content.some((part) => asRecord(part)?.text?.includes?.('CODINGNS_SESSION_TRANSLATION_V1') === true);
|
|
902
|
+
});
|
|
903
|
+
}
|
|
551
904
|
function readAgentSessionId(value) {
|
|
552
905
|
const record = asRecord(value);
|
|
553
906
|
if (typeof record?.id === 'string' && record.id.trim() !== '')
|
|
@@ -653,11 +1006,11 @@ function isMeaningfulDshChunk(value) {
|
|
|
653
1006
|
const record = asRecord(value);
|
|
654
1007
|
if (record === null)
|
|
655
1008
|
return false;
|
|
656
|
-
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')
|
|
657
1010
|
return true;
|
|
658
1011
|
if (record.type === 'block-end') {
|
|
659
1012
|
const block = asRecord(record.block);
|
|
660
|
-
return typeof block?.text === 'string' && block.text !== '';
|
|
1013
|
+
return block?.type === 'tool-call' || block?.type === 'tool-result' || typeof block?.text === 'string' && block.text !== '';
|
|
661
1014
|
}
|
|
662
1015
|
return false;
|
|
663
1016
|
}
|
|
@@ -670,10 +1023,12 @@ function readAdapterId(value) {
|
|
|
670
1023
|
function readSubscriptionRequest(value) {
|
|
671
1024
|
const record = asRecord(value);
|
|
672
1025
|
if (record === null || record.adapterId === undefined)
|
|
673
|
-
return { adapterId: 'command-code' };
|
|
1026
|
+
return { adapterId: 'command-code', includeRoute: false };
|
|
674
1027
|
const adapterId = readAdapterId(value);
|
|
675
1028
|
return {
|
|
676
1029
|
adapterId,
|
|
1030
|
+
...(typeof record.sessionId === 'string' && record.sessionId.trim() !== '' ? { sessionId: record.sessionId.trim() } : {}),
|
|
1031
|
+
includeRoute: record.includeRoute === true,
|
|
677
1032
|
...(typeof record.providerId === 'string' && record.providerId.trim() !== '' ? { providerId: record.providerId.trim() } : {}),
|
|
678
1033
|
// Antigravity 用会话模型区分 Gemini 与 Claude/GPT 两个独立配额组。
|
|
679
1034
|
...(typeof record.modelId === 'string' && record.modelId.trim() !== '' ? { modelId: record.modelId.trim() } : {}),
|
|
@@ -720,6 +1075,7 @@ function readSessionConfig(value) {
|
|
|
720
1075
|
// `default` 是显式的“标准速度”选择,不能当作空值丢弃,否则关掉 Fast 会被
|
|
721
1076
|
// Registry 回退成上一次记住的加速档。
|
|
722
1077
|
...(typeof record?.serviceTierId === 'string' && record.serviceTierId.trim() ? { serviceTierId: record.serviceTierId.trim() } : {}),
|
|
1078
|
+
...(typeof record?.translationEnabled === 'boolean' ? { translationEnabled: record.translationEnabled } : {}),
|
|
723
1079
|
...(typeof record?.providerId === 'string' && record.providerId.trim() ? { providerId: record.providerId.trim() } : {}),
|
|
724
1080
|
...(typeof record?.providerSessionId === 'string' && record.providerSessionId.trim() ? { providerSessionId: record.providerSessionId.trim() } : {}),
|
|
725
1081
|
...(typeof record?.rawStoreRef === 'string' && record.rawStoreRef.trim() ? { rawStoreRef: record.rawStoreRef.trim() } : {}),
|
|
@@ -802,7 +1158,7 @@ function readCliRuntimeEnv(value) {
|
|
|
802
1158
|
const entries = Object.entries(candidate).filter(([, item]) => typeof item === 'string');
|
|
803
1159
|
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
804
1160
|
}
|
|
805
|
-
/** DSH
|
|
1161
|
+
/** Prefer the pending/next DSH route because lastUsed may still be stale. */
|
|
806
1162
|
function readModelSelectionCandidates(value) {
|
|
807
1163
|
const result = [];
|
|
808
1164
|
for (const candidate of [value, asRecord(value?.request), asRecord(value?.config), asRecord(value?.header), asRecord(asRecord(value?.record)?.rows)]) {
|
|
@@ -812,12 +1168,12 @@ function readModelSelectionCandidates(value) {
|
|
|
812
1168
|
const lastUsed = asRecord(selection?.lastUsed);
|
|
813
1169
|
const next = asRecord(selection?.next);
|
|
814
1170
|
const pending = asRecord(selection?.pending);
|
|
815
|
-
if (lastUsed !== null)
|
|
816
|
-
result.push(lastUsed);
|
|
817
|
-
if (next !== null)
|
|
818
|
-
result.push(next);
|
|
819
1171
|
if (pending !== null)
|
|
820
1172
|
result.push(pending);
|
|
1173
|
+
if (next !== null)
|
|
1174
|
+
result.push(next);
|
|
1175
|
+
if (lastUsed !== null)
|
|
1176
|
+
result.push(lastUsed);
|
|
821
1177
|
}
|
|
822
1178
|
return result;
|
|
823
1179
|
}
|
|
@@ -856,13 +1212,14 @@ function selectExternalAdapter(selectedProvider, messageAdapter, registry) {
|
|
|
856
1212
|
function inferMessageAdapter(messages) {
|
|
857
1213
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
858
1214
|
const source = asRecord(messages[index].source);
|
|
859
|
-
// 旧会话和 DSH 原生投影的 source 形状不完全一致;只要是模型消息就读取
|
|
860
|
-
// provider,最终仍由 selectExternalAdapter 校验是否为已启用外部适配器。
|
|
861
1215
|
if (source?.kind !== 'model')
|
|
862
1216
|
continue;
|
|
863
|
-
const provider = source.provider;
|
|
864
|
-
|
|
865
|
-
|
|
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);
|
|
866
1223
|
}
|
|
867
1224
|
return undefined;
|
|
868
1225
|
}
|
|
@@ -876,11 +1233,311 @@ async function setAdapterEnabled(settings, registry, value) {
|
|
|
876
1233
|
await settings.update({ agentAdapters: registry.enabledSnapshot() });
|
|
877
1234
|
return { adapterId, enabled };
|
|
878
1235
|
}
|
|
879
|
-
|
|
1236
|
+
/** 运行中的外部 Agent 插话也必须经过同一条输入翻译路径。 */
|
|
1237
|
+
async function translateSteerPrompt(translationRecovery, registry, sessionId, prompt, followUp, signal) {
|
|
1238
|
+
const session = registry.getSession(sessionId);
|
|
1239
|
+
let translated = prompt;
|
|
1240
|
+
if (session.translationEnabled === true) {
|
|
1241
|
+
try {
|
|
1242
|
+
translated = (await translationRecovery.translateInput(sessionId, session.adapterId, prompt, signal)).translated;
|
|
1243
|
+
}
|
|
1244
|
+
catch (error) {
|
|
1245
|
+
if (error instanceof SessionTranslationCancelled)
|
|
1246
|
+
return;
|
|
1247
|
+
throw error;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
signal?.throwIfAborted();
|
|
1251
|
+
await registry.steer(sessionId, translated, followUp);
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* 在 Agent Loop 接受本轮输入时生成一次输入译文。
|
|
1255
|
+
*
|
|
1256
|
+
* DSH 随后会把返回的消息写入 `user/message`。正文只放实际发送的译文;原文和模型
|
|
1257
|
+
* 记录在 source 元数据中供 Client 详情按钮读取。外部 CLI 边界也会移除该元数据。
|
|
1258
|
+
*/
|
|
1259
|
+
async function translatePreStepInput(translation, translationRecovery, registry, sessionId, messages, dshContext, signal, nativeSession) {
|
|
1260
|
+
if (translation === undefined || !translation.enabled || sessionId.trim() === '')
|
|
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
|
+
}
|
|
1316
|
+
let session;
|
|
1317
|
+
try {
|
|
1318
|
+
session = registry.getSession(sessionId);
|
|
1319
|
+
}
|
|
1320
|
+
catch {
|
|
1321
|
+
return undefined;
|
|
1322
|
+
}
|
|
1323
|
+
if (session.adapterId === 'dsh' || session.translationEnabled !== true || !isSessionTranslationInputEnabled(translation, session.adapterId))
|
|
1324
|
+
return undefined;
|
|
1325
|
+
const input = extractTurnInput(messages, dshContext);
|
|
1326
|
+
if (input.prompt.trim() === '')
|
|
1327
|
+
return undefined;
|
|
1328
|
+
const result = await translationRecovery.translateInput(sessionId, session.adapterId, input.translationPrompt, signal);
|
|
1329
|
+
const translated = [result.translated, attachmentNotices(input.attachments, readInputTargetLanguage(translation))]
|
|
1330
|
+
.filter((part) => part.trim() !== '')
|
|
1331
|
+
.join('\n\n')
|
|
1332
|
+
.trim();
|
|
1333
|
+
if (translated === '')
|
|
1334
|
+
return undefined;
|
|
1335
|
+
const record = {
|
|
1336
|
+
original: input.prompt,
|
|
1337
|
+
translated,
|
|
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 } : {}),
|
|
1344
|
+
};
|
|
1345
|
+
const next = [...messages];
|
|
1346
|
+
next[messageIndex] = {
|
|
1347
|
+
...current,
|
|
1348
|
+
source: {
|
|
1349
|
+
...(current.source ?? {}),
|
|
1350
|
+
kind: 'user',
|
|
1351
|
+
codingnsTranslationInput: record,
|
|
1352
|
+
},
|
|
1353
|
+
};
|
|
1354
|
+
return next;
|
|
1355
|
+
}
|
|
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
|
+
}
|
|
880
1536
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
881
1537
|
const message = messages[index];
|
|
882
1538
|
if (message !== undefined && isInjectedStepNotice(message)) {
|
|
883
|
-
|
|
1539
|
+
const prompt = extractText(message.content);
|
|
1540
|
+
return { prompt, translationPrompt: prompt, untranslatedPrompt: '', attachments: [], translatePrompt: false, messages };
|
|
884
1541
|
}
|
|
885
1542
|
if (message !== undefined && isHumanUserMessage(message)) {
|
|
886
1543
|
const direct = extractMessageInput(message.content, dshContext);
|
|
@@ -896,14 +1553,106 @@ function extractTurnInput(messages, dshContext) {
|
|
|
896
1553
|
const forwarded = referenceIndexes.length === 0
|
|
897
1554
|
? messages
|
|
898
1555
|
: messages.filter((_candidate, candidateIndex) => !referenceIndexes.includes(candidateIndex));
|
|
1556
|
+
const translatedInput = readInputTranslation(message.source);
|
|
1557
|
+
if (translatedInput !== undefined) {
|
|
1558
|
+
const prompt = [translatedInput.translated, ...referenceText].join('\n\n');
|
|
1559
|
+
return {
|
|
1560
|
+
prompt,
|
|
1561
|
+
translationPrompt: prompt,
|
|
1562
|
+
untranslatedPrompt: '',
|
|
1563
|
+
attachments: direct.attachments,
|
|
1564
|
+
translatePrompt: false,
|
|
1565
|
+
messages: stripInputTranslationDisplay(forwarded),
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
899
1568
|
return {
|
|
900
1569
|
prompt: [direct.prompt, ...referenceText].filter(text => text.trim() !== '').join('\n\n').trim(),
|
|
1570
|
+
translationPrompt: [direct.translationPrompt, ...referenceText].filter(text => text.trim() !== '').join('\n\n').trim(),
|
|
1571
|
+
untranslatedPrompt: direct.untranslatedPrompt,
|
|
901
1572
|
attachments: direct.attachments,
|
|
902
|
-
|
|
1573
|
+
translatePrompt: true,
|
|
1574
|
+
messages: stripInputTranslationDisplay(forwarded),
|
|
903
1575
|
};
|
|
904
1576
|
}
|
|
905
1577
|
}
|
|
906
|
-
return { prompt: '', attachments: [], messages };
|
|
1578
|
+
return { prompt: '', translationPrompt: '', untranslatedPrompt: '', attachments: [], translatePrompt: false, messages: stripInputTranslationDisplay(messages) };
|
|
1579
|
+
}
|
|
1580
|
+
function findLatestHumanMessage(messages) {
|
|
1581
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
1582
|
+
const message = messages[index];
|
|
1583
|
+
if (message !== undefined && isHumanUserMessage(message))
|
|
1584
|
+
return index;
|
|
1585
|
+
}
|
|
1586
|
+
return -1;
|
|
1587
|
+
}
|
|
1588
|
+
function readInputTranslation(value) {
|
|
1589
|
+
const candidate = value?.codingnsTranslationInput;
|
|
1590
|
+
if (!isRecord(candidate) || typeof candidate.original !== 'string' || typeof candidate.translated !== 'string')
|
|
1591
|
+
return undefined;
|
|
1592
|
+
if (candidate.original.trim() === '' || candidate.translated.trim() === '')
|
|
1593
|
+
return undefined;
|
|
1594
|
+
const targetLanguage = candidate.targetLanguage === 'fr' || candidate.targetLanguage === 'de' || candidate.targetLanguage === 'ja' || candidate.targetLanguage === 'zh'
|
|
1595
|
+
? candidate.targetLanguage
|
|
1596
|
+
: 'en';
|
|
1597
|
+
const sourceLanguage = candidate.sourceLanguage === 'zh' || candidate.sourceLanguage === 'en' || candidate.sourceLanguage === 'fr' || candidate.sourceLanguage === 'de' || candidate.sourceLanguage === 'ja'
|
|
1598
|
+
? candidate.sourceLanguage
|
|
1599
|
+
: undefined;
|
|
1600
|
+
return {
|
|
1601
|
+
original: candidate.original,
|
|
1602
|
+
translated: candidate.translated,
|
|
1603
|
+
...(sourceLanguage === undefined ? {} : { sourceLanguage }),
|
|
1604
|
+
targetLanguage,
|
|
1605
|
+
...(candidate.alreadyTargetLanguage === true ? { alreadyTargetLanguage: true } : {}),
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
/** 把历史消息还原为 Provider 可见的纯译文,并移除内部翻译元数据。 */
|
|
1609
|
+
function stripInputTranslationDisplay(messages) {
|
|
1610
|
+
return messages.map((message) => {
|
|
1611
|
+
const record = readInputTranslation(message.source);
|
|
1612
|
+
if (record === undefined)
|
|
1613
|
+
return message;
|
|
1614
|
+
const source = message.source;
|
|
1615
|
+
const cleanSource = source === undefined
|
|
1616
|
+
? undefined
|
|
1617
|
+
: (() => {
|
|
1618
|
+
const { codingnsTranslationInput: _translation, ...rest } = source;
|
|
1619
|
+
return rest;
|
|
1620
|
+
})();
|
|
1621
|
+
return {
|
|
1622
|
+
...message,
|
|
1623
|
+
content: replaceInputTranslationContent(message.content, record.translated),
|
|
1624
|
+
...(cleanSource === undefined ? {} : { source: cleanSource }),
|
|
1625
|
+
};
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
function replaceInputTranslationContent(content, text) {
|
|
1629
|
+
if (typeof content === 'string')
|
|
1630
|
+
return text;
|
|
1631
|
+
if (!Array.isArray(content))
|
|
1632
|
+
return [{ type: 'text', text }];
|
|
1633
|
+
let replaced = false;
|
|
1634
|
+
const blocks = content.flatMap((part) => {
|
|
1635
|
+
if (!isRecord(part) || part.type !== 'text')
|
|
1636
|
+
return [part];
|
|
1637
|
+
if (replaced)
|
|
1638
|
+
return [];
|
|
1639
|
+
replaced = true;
|
|
1640
|
+
return [{ ...part, text }];
|
|
1641
|
+
});
|
|
1642
|
+
return replaced ? blocks : [{ type: 'text', text }, ...content];
|
|
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
|
+
});
|
|
907
1656
|
}
|
|
908
1657
|
/** DSH 为工具分段注入的继续提示必须成为下一次 Provider 请求的 prompt。 */
|
|
909
1658
|
function isInjectedStepNotice(message) {
|
|
@@ -939,9 +1688,9 @@ function extractText(content) {
|
|
|
939
1688
|
}
|
|
940
1689
|
function extractMessageInput(content, dshContext) {
|
|
941
1690
|
if (typeof content === 'string')
|
|
942
|
-
return { prompt: content, attachments: [] };
|
|
1691
|
+
return { prompt: content, translationPrompt: content, untranslatedPrompt: '', attachments: [] };
|
|
943
1692
|
if (!Array.isArray(content))
|
|
944
|
-
return { prompt: '', attachments: [] };
|
|
1693
|
+
return { prompt: '', translationPrompt: '', untranslatedPrompt: '', attachments: [] };
|
|
945
1694
|
const text = [];
|
|
946
1695
|
const attachments = [];
|
|
947
1696
|
for (const part of content) {
|
|
@@ -960,8 +1709,12 @@ function extractMessageInput(content, dshContext) {
|
|
|
960
1709
|
const mimeType = typeof reference.mediaType === 'string' && reference.mediaType.trim() !== '' ? reference.mediaType.trim() : undefined;
|
|
961
1710
|
attachments.push({ kind, path, ...(name === undefined ? {} : { name }), ...(mimeType === undefined ? {} : { mimeType }) });
|
|
962
1711
|
}
|
|
963
|
-
const
|
|
964
|
-
|
|
1712
|
+
const translationPrompt = text.join('\n\n').trim();
|
|
1713
|
+
const untranslatedPrompt = attachmentNotices(attachments);
|
|
1714
|
+
return { prompt: [translationPrompt, untranslatedPrompt].filter(value => value !== '').join('\n\n'), translationPrompt, untranslatedPrompt, attachments };
|
|
1715
|
+
}
|
|
1716
|
+
function attachmentNotices(attachments, language) {
|
|
1717
|
+
return attachments.filter(attachment => attachment.kind === 'file').map(attachment => attachmentFileNotice(attachment, language)).join('\n\n');
|
|
965
1718
|
}
|
|
966
1719
|
function resolveDshAttachmentPath(dshContext, kind, reference) {
|
|
967
1720
|
if (dshContext === undefined || typeof reference.attachmentId !== 'string')
|