@jingyi0605/codingns4dsh 0.2.1-beta.6 → 0.2.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -4
- package/README.md +21 -5
- package/THIRD_PARTY_NOTICES +5 -0
- package/assets/provider-icons/r4.svg +4 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/client/assistant-settings-styles.d.ts.map +1 -1
- package/data/build/dist/client/assistant-settings-styles.js +3 -2
- package/data/build/dist/client/assistant-settings-styles.js.map +1 -1
- package/data/build/dist/client/avatar/catalog-panel.d.ts.map +1 -1
- package/data/build/dist/client/avatar/catalog-panel.js +7 -5
- package/data/build/dist/client/avatar/catalog-panel.js.map +1 -1
- package/data/build/dist/client/avatar/catalog-picker.d.ts.map +1 -1
- package/data/build/dist/client/avatar/catalog-picker.js +2 -1
- package/data/build/dist/client/avatar/catalog-picker.js.map +1 -1
- package/data/build/dist/client/avatar/desktop-bridge.d.ts +7 -3
- package/data/build/dist/client/avatar/desktop-bridge.d.ts.map +1 -1
- package/data/build/dist/client/avatar/desktop-bridge.js +64 -5
- package/data/build/dist/client/avatar/desktop-bridge.js.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.d.ts +6 -0
- package/data/build/dist/client/avatar/desktop-view.d.ts.map +1 -1
- package/data/build/dist/client/avatar/desktop-view.js +98 -5
- package/data/build/dist/client/avatar/desktop-view.js.map +1 -1
- package/data/build/dist/client/avatar/engine.d.ts.map +1 -1
- package/data/build/dist/client/avatar/engine.js +3 -2
- package/data/build/dist/client/avatar/engine.js.map +1 -1
- package/data/build/dist/client/avatar/floating.d.ts +8 -3
- package/data/build/dist/client/avatar/floating.d.ts.map +1 -1
- package/data/build/dist/client/avatar/floating.js +22 -4
- package/data/build/dist/client/avatar/floating.js.map +1 -1
- package/data/build/dist/client/avatar/image.d.ts +1 -1
- package/data/build/dist/client/avatar/image.d.ts.map +1 -1
- package/data/build/dist/client/avatar/image.js +2 -2
- package/data/build/dist/client/avatar/image.js.map +1 -1
- package/data/build/dist/client/avatar/live2d.d.ts +14 -3
- package/data/build/dist/client/avatar/live2d.d.ts.map +1 -1
- package/data/build/dist/client/avatar/live2d.js +62 -9
- package/data/build/dist/client/avatar/live2d.js.map +1 -1
- package/data/build/dist/client/avatar/loading.d.ts.map +1 -1
- package/data/build/dist/client/avatar/loading.js +3 -2
- package/data/build/dist/client/avatar/loading.js.map +1 -1
- package/data/build/dist/client/avatar/notification-bubble.d.ts +39 -0
- package/data/build/dist/client/avatar/notification-bubble.d.ts.map +1 -0
- package/data/build/dist/client/avatar/notification-bubble.js +353 -0
- package/data/build/dist/client/avatar/notification-bubble.js.map +1 -0
- package/data/build/dist/client/avatar/notification-surface.d.ts +16 -0
- package/data/build/dist/client/avatar/notification-surface.d.ts.map +1 -0
- package/data/build/dist/client/avatar/notification-surface.js +54 -0
- package/data/build/dist/client/avatar/notification-surface.js.map +1 -0
- package/data/build/dist/client/avatar/reaction-badge.d.ts +7 -0
- package/data/build/dist/client/avatar/reaction-badge.d.ts.map +1 -0
- package/data/build/dist/client/avatar/reaction-badge.js +20 -0
- package/data/build/dist/client/avatar/reaction-badge.js.map +1 -0
- package/data/build/dist/client/avatar/registry.d.ts +2 -1
- package/data/build/dist/client/avatar/registry.d.ts.map +1 -1
- package/data/build/dist/client/avatar/registry.js.map +1 -1
- package/data/build/dist/client/avatar/settings-panel.d.ts.map +1 -1
- package/data/build/dist/client/avatar/settings-panel.js +7 -5
- package/data/build/dist/client/avatar/settings-panel.js.map +1 -1
- package/data/build/dist/client/avatar/slot.d.ts +2 -1
- package/data/build/dist/client/avatar/slot.d.ts.map +1 -1
- package/data/build/dist/client/avatar/slot.js +5 -4
- package/data/build/dist/client/avatar/slot.js.map +1 -1
- package/data/build/dist/client/avatar/spritesheet.d.ts +4 -2
- package/data/build/dist/client/avatar/spritesheet.d.ts.map +1 -1
- package/data/build/dist/client/avatar/spritesheet.js +18 -9
- package/data/build/dist/client/avatar/spritesheet.js.map +1 -1
- package/data/build/dist/client/bundle.js +6881 -1776
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-catalog.d.ts +1 -1
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
- package/data/build/dist/client/cli-catalog.js +2 -0
- package/data/build/dist/client/cli-catalog.js.map +1 -1
- package/data/build/dist/client/cli-session-config-cache.d.ts +17 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.js +56 -0
- package/data/build/dist/client/cli-session-config-cache.js.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.d.ts +5 -0
- package/data/build/dist/client/cli-settings-rpc.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.js +60 -0
- package/data/build/dist/client/cli-settings-rpc.js.map +1 -0
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +24 -40
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +264 -55
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/client.assistant-debug-workbench.js +4 -4
- package/data/build/dist/client/client.assistant-debug-workbench.js.map +1 -1
- package/data/build/dist/client/{client.assistant-prompts.js → client.assistant-notifications.js} +63 -2
- package/data/build/dist/client/client.assistant-notifications.js.map +1 -0
- package/data/build/dist/client/client.assistant-prompt-editor.js +4 -4
- package/data/build/dist/client/client.assistant-prompt-editor.js.map +1 -1
- package/data/build/dist/client/client.assistant-workbench.js +287 -161
- package/data/build/dist/client/client.assistant-workbench.js.map +1 -1
- package/data/build/dist/client/client.delegate-command.js +12 -25
- package/data/build/dist/client/client.delegate-command.js.map +1 -1
- package/data/build/dist/client/client.manager.js +201 -25
- package/data/build/dist/client/client.manager.js.map +1 -1
- package/data/build/dist/client/client.model-catalog-cache.js +2 -1
- package/data/build/dist/client/client.model-catalog-cache.js.map +1 -1
- package/data/build/dist/client/client.native-workspace-store.js +42 -11
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.react-dom.js +250 -0
- package/data/build/dist/client/client.react-dom.js.map +1 -1
- package/data/build/dist/client/client.theme.js +58 -12
- package/data/build/dist/client/client.theme.js.map +1 -1
- package/data/build/dist/client/client.transport.js +342 -46
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/debug/ui.d.ts.map +1 -1
- package/data/build/dist/client/debug/ui.js +30 -29
- package/data/build/dist/client/debug/ui.js.map +1 -1
- package/data/build/dist/client/delegate-command.d.ts.map +1 -1
- package/data/build/dist/client/delegate-command.js +12 -21
- package/data/build/dist/client/delegate-command.js.map +1 -1
- package/data/build/dist/client/desktop-assistant.js +61859 -158
- package/data/build/dist/client/external-tool-stream.d.ts.map +1 -1
- package/data/build/dist/client/external-tool-stream.js +2 -1
- package/data/build/dist/client/external-tool-stream.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-session.js +3 -3
- package/data/build/dist/client/features/assistant-configuration-session.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.js +2 -1
- package/data/build/dist/client/features/assistant-configuration-tabs.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-view.d.ts +8 -0
- package/data/build/dist/client/features/assistant-configuration-view.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-view.js +99 -3
- package/data/build/dist/client/features/assistant-configuration-view.js.map +1 -1
- package/data/build/dist/client/features/assistant-conversation-message.d.ts +2 -1
- package/data/build/dist/client/features/assistant-conversation-message.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-conversation-message.js +64 -28
- package/data/build/dist/client/features/assistant-conversation-message.js.map +1 -1
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-debug-workbench.js +3 -2
- package/data/build/dist/client/features/assistant-debug-workbench.js.map +1 -1
- package/data/build/dist/client/features/assistant-floating-call.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-floating-call.js +4 -3
- package/data/build/dist/client/features/assistant-floating-call.js.map +1 -1
- package/data/build/dist/client/features/assistant-notification-store.d.ts +72 -0
- package/data/build/dist/client/features/assistant-notification-store.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-notification-store.js +439 -0
- package/data/build/dist/client/features/assistant-notification-store.js.map +1 -0
- package/data/build/dist/client/features/assistant-realtime-call.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-realtime-call.js +13 -12
- package/data/build/dist/client/features/assistant-realtime-call.js.map +1 -1
- package/data/build/dist/client/features/assistant-record-style.js +11 -4
- package/data/build/dist/client/features/assistant-record-style.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-initialization.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-initialization.js +4 -2
- package/data/build/dist/client/features/assistant-voice-initialization.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.js +2 -1
- package/data/build/dist/client/features/assistant-voice-settings-group.js.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-voice-settings.js +4 -3
- package/data/build/dist/client/features/assistant-voice-settings.js.map +1 -1
- package/data/build/dist/client/features/assistant-workbench-controls.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-workbench-controls.js +6 -5
- package/data/build/dist/client/features/assistant-workbench-controls.js.map +1 -1
- package/data/build/dist/client/features/assistant-workbench.d.ts +4 -0
- package/data/build/dist/client/features/assistant-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-workbench.js +37 -9
- package/data/build/dist/client/features/assistant-workbench.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +140 -35
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/file-management-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management-panel.js +3 -10
- package/data/build/dist/client/features/file-management-panel.js.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.d.ts +6 -0
- package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.js +117 -3
- package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
- package/data/build/dist/client/features/index.d.ts +1 -0
- package/data/build/dist/client/features/index.d.ts.map +1 -1
- package/data/build/dist/client/features/index.js +3 -0
- package/data/build/dist/client/features/index.js.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +6 -4
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.js +7 -2
- package/data/build/dist/client/features/login-protection-panel.js.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.js +19 -13
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts +3 -0
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +445 -28
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/reverse-proxy-panel.js +5 -4
- package/data/build/dist/client/features/reverse-proxy-panel.js.map +1 -1
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts +9 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js +28 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/subscription-usage-panel.js +4 -3
- package/data/build/dist/client/features/subscription-usage-panel.js.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement-panel.js +6 -4
- package/data/build/dist/client/features/terminal-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/features/types.d.ts +8 -0
- package/data/build/dist/client/features/types.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-conversation-dialog.js +7 -6
- package/data/build/dist/client/features/voice-conversation-dialog.js.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.d.ts.map +1 -1
- package/data/build/dist/client/features/voice-initialization-dialog.js +7 -6
- package/data/build/dist/client/features/voice-initialization-dialog.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +44 -96
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +42 -28
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/font-scale.d.ts +37 -0
- package/data/build/dist/client/font-scale.d.ts.map +1 -0
- package/data/build/dist/client/font-scale.js +56 -0
- package/data/build/dist/client/font-scale.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +80 -37
- package/data/build/dist/client/git-management.js.map +1 -1
- package/data/build/dist/client/index.d.ts +1 -1
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +43 -1
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +27 -2
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/assistantWorkbench.d.ts +45 -0
- package/data/build/dist/client/locales/assistantWorkbench.d.ts.map +1 -1
- package/data/build/dist/client/locales/assistantWorkbench.js +30 -6
- package/data/build/dist/client/locales/assistantWorkbench.js.map +1 -1
- package/data/build/dist/client/locales/peerHost.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHost.js +10 -0
- package/data/build/dist/client/locales/peerHost.js.map +1 -1
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/peerHostWorkspace.js +16 -0
- package/data/build/dist/client/locales/peerHostWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/subagentCollapsed.d.ts +53 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.js +95 -0
- package/data/build/dist/client/locales/subagentCollapsed.js.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.js +2 -2
- package/data/build/dist/client/locales/terminalAuth.js.map +1 -1
- package/data/build/dist/client/locales/usage.d.ts.map +1 -1
- package/data/build/dist/client/locales/usage.js +48 -0
- package/data/build/dist/client/locales/usage.js.map +1 -1
- package/data/build/dist/client/native-workspace-store.d.ts +10 -0
- package/data/build/dist/client/native-workspace-store.d.ts.map +1 -1
- package/data/build/dist/client/native-workspace-store.js +22 -1
- package/data/build/dist/client/native-workspace-store.js.map +1 -1
- package/data/build/dist/client/peer-host-color.d.ts +3 -0
- package/data/build/dist/client/peer-host-color.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-color.js +16 -0
- package/data/build/dist/client/peer-host-color.js.map +1 -1
- package/data/build/dist/client/peer-host-file-links.d.ts +8 -0
- package/data/build/dist/client/peer-host-file-links.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-file-links.js +43 -0
- package/data/build/dist/client/peer-host-file-links.js.map +1 -0
- package/data/build/dist/client/peer-host-management-api.d.ts +2 -1
- package/data/build/dist/client/peer-host-management-api.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-management-api.js +2 -1
- package/data/build/dist/client/peer-host-management-api.js.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts +20 -8
- package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.js +127 -15
- package/data/build/dist/client/peer-host-native-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.d.ts +2 -0
- package/data/build/dist/client/peer-host-native-store-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.js +52 -13
- package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-reference-source.d.ts +18 -0
- package/data/build/dist/client/peer-host-reference-source.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-reference-source.js +174 -0
- package/data/build/dist/client/peer-host-reference-source.js.map +1 -0
- package/data/build/dist/client/peer-host-remote-events.d.ts +48 -0
- package/data/build/dist/client/peer-host-remote-events.d.ts.map +1 -0
- package/data/build/dist/client/peer-host-remote-events.js +328 -0
- package/data/build/dist/client/peer-host-remote-events.js.map +1 -0
- package/data/build/dist/client/peer-host-scoped-client.d.ts +3 -0
- package/data/build/dist/client/peer-host-scoped-client.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-scoped-client.js +5 -2
- package/data/build/dist/client/peer-host-scoped-client.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.d.ts +2 -0
- package/data/build/dist/client/peer-host-workspace-tab.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.js +62 -29
- package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tag.d.ts +5 -0
- package/data/build/dist/client/peer-host-workspace-tag.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tag.js +57 -14
- package/data/build/dist/client/peer-host-workspace-tag.js.map +1 -1
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +2 -1
- package/data/build/dist/client/provider-icons.js.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.js +12 -11
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -1
- package/data/build/dist/client/serial-polling.d.ts +1 -0
- package/data/build/dist/client/serial-polling.d.ts.map +1 -1
- package/data/build/dist/client/serial-polling.js +4 -2
- package/data/build/dist/client/serial-polling.js.map +1 -1
- package/data/build/dist/client/session-adapter-cache.d.ts +2 -0
- package/data/build/dist/client/session-adapter-cache.d.ts.map +1 -1
- package/data/build/dist/client/session-adapter-cache.js +11 -0
- package/data/build/dist/client/session-adapter-cache.js.map +1 -1
- package/data/build/dist/client/session-changed-files-view.d.ts +15 -0
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -1
- package/data/build/dist/client/session-changed-files-view.js +73 -29
- package/data/build/dist/client/session-changed-files-view.js.map +1 -1
- package/data/build/dist/client/settings-controls.d.ts +29 -0
- package/data/build/dist/client/settings-controls.d.ts.map +1 -0
- package/data/build/dist/client/settings-controls.js +80 -0
- package/data/build/dist/client/settings-controls.js.map +1 -0
- package/data/build/dist/client/settings-section.d.ts.map +1 -1
- package/data/build/dist/client/settings-section.js +7 -11
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/skill-command.d.ts.map +1 -1
- package/data/build/dist/client/skill-command.js +2 -1
- package/data/build/dist/client/skill-command.js.map +1 -1
- package/data/build/dist/client/style.css +2561 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts +103 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js +664 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/subscription-slot.d.ts +8 -2
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +55 -34
- package/data/build/dist/client/subscription-slot.js.map +1 -1
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
- package/data/build/dist/client/terminal/ui.js +26 -8
- package/data/build/dist/client/terminal/ui.js.map +1 -1
- package/data/build/dist/client/theme.d.ts +2 -0
- package/data/build/dist/client/theme.d.ts.map +1 -1
- package/data/build/dist/client/theme.js +20 -12
- package/data/build/dist/client/theme.js.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.js +22 -10
- 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 +15 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js +86 -0
- package/data/build/dist/dsh-capabilities/client/assistant-session-navigation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +199 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js +8 -2
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +13 -3
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +37 -3
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/types.js.map +1 -1
- package/data/build/dist/host/avatar/materials.d.ts.map +1 -1
- package/data/build/dist/host/avatar/materials.js +3 -1
- package/data/build/dist/host/avatar/materials.js.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +136 -11
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js +65 -31
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +36 -9
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js +271 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +136 -16
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts +4 -3
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js +7 -6
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts +32 -11
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-app.js +195 -24
- package/data/build/dist/host/cli-adapters/doubao-app.js.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.js +3 -1
- package/data/build/dist/host/cli-adapters/doubao-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js +153 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +2 -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 +16 -5
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +23 -3
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +72 -28
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +22 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +24 -2
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +113 -4
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +63 -18
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +35 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/new-api-subscription.js +2 -45
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +10 -3
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +334 -62
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +134 -14
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +13 -45
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js +111 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +14 -3
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +7 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.js +28 -7
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts +24 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.js +121 -23
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js +26 -6
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.d.ts +45 -4
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +129 -14
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +20 -5
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.d.ts +27 -2
- package/data/build/dist/host/desktop-assistant/controller.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/controller.js +197 -7
- package/data/build/dist/host/desktop-assistant/controller.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/feature.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/feature.js +41 -4
- package/data/build/dist/host/desktop-assistant/feature.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/launcher.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/launcher.js +3 -1
- package/data/build/dist/host/desktop-assistant/launcher.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/mac-agent.js +41 -10
- package/data/build/dist/host/desktop-assistant/mac-agent.js.map +1 -1
- package/data/build/dist/host/desktop-assistant/notifications.d.ts +16 -0
- package/data/build/dist/host/desktop-assistant/notifications.d.ts.map +1 -0
- package/data/build/dist/host/desktop-assistant/notifications.js +45 -0
- package/data/build/dist/host/desktop-assistant/notifications.js.map +1 -0
- package/data/build/dist/host/desktop-assistant/win-agent.d.ts.map +1 -1
- package/data/build/dist/host/desktop-assistant/win-agent.js +95 -8
- package/data/build/dist/host/desktop-assistant/win-agent.js.map +1 -1
- package/data/build/dist/host/features/assistant-lifecycle-settings.js +1 -1
- package/data/build/dist/host/features/assistant-lifecycle-settings.js.map +1 -1
- package/data/build/dist/host/features/assistant-management-tools.d.ts +2 -1
- package/data/build/dist/host/features/assistant-management-tools.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-management-tools.js +10 -3
- package/data/build/dist/host/features/assistant-management-tools.js.map +1 -1
- package/data/build/dist/host/features/assistant-notification-events.d.ts +77 -0
- package/data/build/dist/host/features/assistant-notification-events.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-events.js +574 -0
- package/data/build/dist/host/features/assistant-notification-events.js.map +1 -0
- package/data/build/dist/host/features/assistant-notification-source.d.ts +32 -0
- package/data/build/dist/host/features/assistant-notification-source.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-source.js +101 -0
- package/data/build/dist/host/features/assistant-notification-source.js.map +1 -0
- package/data/build/dist/host/features/assistant-notification-stream.d.ts +26 -0
- package/data/build/dist/host/features/assistant-notification-stream.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notification-stream.js +179 -0
- package/data/build/dist/host/features/assistant-notification-stream.js.map +1 -0
- package/data/build/dist/host/features/assistant-notifications.d.ts +78 -0
- package/data/build/dist/host/features/assistant-notifications.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-notifications.js +436 -0
- package/data/build/dist/host/features/assistant-notifications.js.map +1 -0
- package/data/build/dist/host/features/assistant-peer-notifications.d.ts +53 -0
- package/data/build/dist/host/features/assistant-peer-notifications.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-peer-notifications.js +197 -0
- package/data/build/dist/host/features/assistant-peer-notifications.js.map +1 -0
- package/data/build/dist/host/features/assistant-tts-service.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-tts-service.js +2 -2
- package/data/build/dist/host/features/assistant-tts-service.js.map +1 -1
- package/data/build/dist/host/features/assistant-voice-initialization.js +1 -1
- package/data/build/dist/host/features/assistant-voice-initialization.js.map +1 -1
- package/data/build/dist/host/features/git-management.js +2 -1
- package/data/build/dist/host/features/git-management.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts +2 -2
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +179 -4
- package/data/build/dist/host/features/global-voice-rpc.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts +1 -0
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +3 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +193 -75
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/session-title-optimization.d.ts +5 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.js +26 -0
- package/data/build/dist/host/features/session-title-optimization.js.map +1 -0
- package/data/build/dist/host/features/types.d.ts +9 -1
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +23 -1
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +9 -1
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.js +8 -2
- package/data/build/dist/host/modules/peer-host/aggregated-host-transport.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.d.ts +5 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js +72 -23
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.js +7 -5
- package/data/build/dist/host/modules/peer-host/host-ws-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts +6 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js +7 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.d.ts +2 -1
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.js +11 -10
- package/data/build/dist/host/modules/peer-host/peer-host-handshake.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts +7 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js +63 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-dispatch.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +6 -3
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +92 -5
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts +15 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js +101 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-streams.js.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js +44 -11
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +75 -20
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.d.ts +31 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.js +60 -0
- package/data/build/dist/host/modules/peer-host/peer-host-request-errors.js.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-session.d.ts +12 -4
- package/data/build/dist/host/modules/peer-host/peer-host-session.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-session.js +28 -18
- package/data/build/dist/host/modules/peer-host/peer-host-session.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js +15 -4
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.d.ts +22 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.js +133 -0
- package/data/build/dist/host/modules/peer-host/peer-host-workspace-cache.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +2 -0
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +89 -9
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +11 -2
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +14 -3
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/terminal/controller-factory.d.ts +1 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts.map +1 -1
- package/data/build/dist/host/terminal/controller-factory.js +3 -0
- package/data/build/dist/host/terminal/controller-factory.js.map +1 -1
- package/data/build/dist/host/terminal/startup.d.ts +3 -0
- package/data/build/dist/host/terminal/startup.d.ts.map +1 -1
- package/data/build/dist/host/terminal/startup.js +1 -0
- package/data/build/dist/host/terminal/startup.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.d.ts +8 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.js +2 -1
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
- package/data/build/dist/shared/assistant-avatar-adapters.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-avatar-adapters.js +3 -0
- package/data/build/dist/shared/assistant-avatar-adapters.js.map +1 -1
- package/data/build/dist/shared/assistant-avatar.d.ts +11 -1
- package/data/build/dist/shared/assistant-avatar.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-avatar.js +31 -1
- package/data/build/dist/shared/assistant-avatar.js.map +1 -1
- package/data/build/dist/shared/assistant-message-timeline.d.ts +11 -0
- package/data/build/dist/shared/assistant-message-timeline.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-message-timeline.js +19 -0
- package/data/build/dist/shared/assistant-message-timeline.js.map +1 -1
- package/data/build/dist/shared/assistant-notification-feed.d.ts +44 -0
- package/data/build/dist/shared/assistant-notification-feed.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-notification-feed.js +88 -0
- package/data/build/dist/shared/assistant-notification-feed.js.map +1 -0
- package/data/build/dist/shared/assistant-notifications.d.ts +141 -0
- package/data/build/dist/shared/assistant-notifications.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-notifications.js +32 -0
- package/data/build/dist/shared/assistant-notifications.js.map +1 -0
- package/data/build/dist/shared/assistant-session-messages.d.ts +13 -0
- package/data/build/dist/shared/assistant-session-messages.d.ts.map +1 -0
- package/data/build/dist/shared/assistant-session-messages.js +155 -0
- package/data/build/dist/shared/assistant-session-messages.js.map +1 -0
- package/data/build/dist/shared/assistant-tts.js +1 -1
- package/data/build/dist/shared/contracts/assistant.d.ts +13 -0
- package/data/build/dist/shared/contracts/assistant.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +5 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.d.ts +5 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +3 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/peer-host.d.ts +15 -0
- package/data/build/dist/shared/contracts/peer-host.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.js.map +1 -1
- package/data/build/dist/shared/contracts/subscription.d.ts +31 -0
- package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/subscription.js.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +12 -8
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +11 -7
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/desktop-assistant.d.ts +74 -1
- package/data/build/dist/shared/desktop-assistant.d.ts.map +1 -1
- package/data/build/dist/shared/desktop-assistant.js +201 -2
- package/data/build/dist/shared/desktop-assistant.js.map +1 -1
- package/data/build/dist/shared/index.d.ts +2 -2
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js.map +1 -1
- package/data/build/dist/shared/peer-host-file-location.d.ts +11 -0
- package/data/build/dist/shared/peer-host-file-location.d.ts.map +1 -0
- package/data/build/dist/shared/peer-host-file-location.js +20 -0
- package/data/build/dist/shared/peer-host-file-location.js.map +1 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts +10 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.js +7 -1
- package/data/build/dist/shared/peer-host-http-routes.js.map +1 -1
- package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -1
- package/data/build/dist/shared/provider-icon-resources.js +1 -0
- package/data/build/dist/shared/provider-icon-resources.js.map +1 -1
- package/data/build/dist/shared/session-reference.d.ts +11 -0
- package/data/build/dist/shared/session-reference.d.ts.map +1 -0
- package/data/build/dist/shared/session-reference.js +29 -0
- package/data/build/dist/shared/session-reference.js.map +1 -0
- package/data/build/dist/shared/session-title.d.ts +12 -0
- package/data/build/dist/shared/session-title.d.ts.map +1 -0
- package/data/build/dist/shared/session-title.js +65 -0
- package/data/build/dist/shared/session-title.js.map +1 -0
- package/data/build/dist/shared/voice-initialization.d.ts +1 -1
- package/data/build/dist/shared/voice-initialization.d.ts.map +1 -1
- package/data/build/dist/shared/voice-initialization.js +1 -1
- package/data/build/dist/shared/voice-initialization.js.map +1 -1
- package/data/build/dist/shared/voice-models.d.ts +2 -2
- package/data/build/dist/shared/voice-models.d.ts.map +1 -1
- package/data/build/dist/shared/voice-models.js +9 -9
- package/data/build/dist/shared/voice-models.js.map +1 -1
- package/data/build/dist/typert.host.d.ts +18 -1
- package/data/build/dist/typert.host.d.ts.map +1 -1
- package/data/build/dist/typert.host.js +28 -3
- package/data/build/dist/typert.host.js.map +1 -1
- package/data/build/dist/typert.notifications-client.d.ts +5 -0
- package/data/build/dist/typert.notifications-client.d.ts.map +1 -0
- package/data/build/dist/typert.notifications-client.js +7 -0
- package/data/build/dist/typert.notifications-client.js.map +1 -0
- package/data/build/dist/typert.remote-client.js +1 -1
- package/data/build/dist/typert.remote-client.js.map +1 -1
- package/package.json +41 -33
- package/profile/README.md +2 -2
- package/profile/package.json +3 -3
- package/profile/version.json +3 -3
- package/version.json +3 -3
- package/data/build/dist/client/client.assistant-prompts.js.map +0 -1
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { createElement, Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { StateDot, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
|
+
import { dshPopupSurfaceStyle, dshThemeColor } from './theme.js';
|
|
5
|
+
import { resolveChevronDownIcon, resolveRefreshIcon, resolveTerminalArrowIcon } from '../dsh-capabilities/client/primitives-adapter.js';
|
|
6
|
+
import { en, zh } from './locales/subagentCollapsed.js';
|
|
7
|
+
import { uiFontSize } from './font-scale.js';
|
|
8
|
+
/** 停止子 Agent 分组的专用词典,避免改写 DSH 原生 subagent 词典。 */
|
|
9
|
+
export const SUBAGENT_COLLAPSED_LOCALE_NS = 'codingnsSubagentCollapsed';
|
|
10
|
+
/**
|
|
11
|
+
* 合并目录运行态和会话摘要。
|
|
12
|
+
*
|
|
13
|
+
* 目录项来自 DSH 的子 Agent 列表,摘要来自 Session Controller。停止边界
|
|
14
|
+
* 可能先到达其中一条数据流;只要摘要已经明确为 idle,就不能继续把目录项
|
|
15
|
+
* 当成运行中,否则顶部计数和绿色状态点会在回合结束后短暂滞留。
|
|
16
|
+
*/
|
|
17
|
+
function childActivity(entry, summaries) {
|
|
18
|
+
return entry.activity === 'running' && summaries[entry.id]?.running !== false
|
|
19
|
+
? 'running'
|
|
20
|
+
: 'inactive';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 统一 DSH 0.2.0 与 0.2.1 的子 Agent 导航动作。
|
|
24
|
+
*
|
|
25
|
+
* 0.2.0 的原生组件直接调用 sessions.openSubagent/refreshSubagents;
|
|
26
|
+
* 0.2.1 将导航提升到 uiWorkspace,并把刷新命名为 refreshProjections。
|
|
27
|
+
* 这里只适配动作,不改变目录数据和会话生命周期。
|
|
28
|
+
*/
|
|
29
|
+
export function createSubagentSessionsActions(rawSessions, rawWorkspace, rawSidebarRight) {
|
|
30
|
+
const sessions = rawSessions;
|
|
31
|
+
const workspace = rawWorkspace;
|
|
32
|
+
const sidebarRight = rawSidebarRight;
|
|
33
|
+
const openChild = typeof workspace?.openSession === 'function'
|
|
34
|
+
? (address) => { workspace.openSession(address); }
|
|
35
|
+
: typeof sessions?.openSubagent === 'function'
|
|
36
|
+
? (address) => { sessions.openSubagent(address); }
|
|
37
|
+
: undefined;
|
|
38
|
+
const refresh = typeof sessions?.refreshProjections === 'function'
|
|
39
|
+
? (parentSessionId) => sessions.refreshProjections(parentSessionId)
|
|
40
|
+
: typeof sessions?.refreshSubagents === 'function'
|
|
41
|
+
? (parentSessionId) => sessions.refreshSubagents(parentSessionId)
|
|
42
|
+
: undefined;
|
|
43
|
+
if (openChild === undefined || refresh === undefined)
|
|
44
|
+
return undefined;
|
|
45
|
+
const setCatalogOpen = typeof sessions?.setSubagentCatalogOpen === 'function'
|
|
46
|
+
? (parentSessionId, open) => { sessions.setSubagentCatalogOpen(parentSessionId, open); }
|
|
47
|
+
: () => undefined;
|
|
48
|
+
const openChildAside = typeof sidebarRight?.openResource === 'function'
|
|
49
|
+
? (address) => {
|
|
50
|
+
if (address === null || typeof address !== 'object')
|
|
51
|
+
return;
|
|
52
|
+
const value = address;
|
|
53
|
+
if (typeof value.parentSessionId !== 'string' || typeof value.childSessionId !== 'string')
|
|
54
|
+
return;
|
|
55
|
+
const mode = typeof value.mode === 'string' ? value.mode : 'unknown';
|
|
56
|
+
const query = new URLSearchParams({ parent: value.parentSessionId, mode });
|
|
57
|
+
sidebarRight.openResource(`dsh-resource://subagentchat/session/${encodeURIComponent(value.childSessionId)}?${query.toString()}`, {
|
|
58
|
+
kind: 'subagentchat', preferNewPane: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
: undefined;
|
|
62
|
+
return { openChild, refresh, setSubagentCatalogOpen: setCatalogOpen, ...(openChildAside === undefined ? {} : { openChildAside }) };
|
|
63
|
+
}
|
|
64
|
+
/** 将目录项分成诊断、运行中和停止三组;目录本身不会被过滤或删除。 */
|
|
65
|
+
export function partitionSubagentEntries(entries, summaries = {}) {
|
|
66
|
+
const diagnostics = [];
|
|
67
|
+
const running = [];
|
|
68
|
+
const inactive = [];
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
if (entry.kind === 'diagnostic')
|
|
71
|
+
diagnostics.push(entry);
|
|
72
|
+
else if (childActivity(entry, summaries) === 'running')
|
|
73
|
+
running.push(entry);
|
|
74
|
+
else
|
|
75
|
+
inactive.push(entry);
|
|
76
|
+
}
|
|
77
|
+
return { diagnostics, running, inactive };
|
|
78
|
+
}
|
|
79
|
+
function catalogStyle() {
|
|
80
|
+
return {
|
|
81
|
+
...dshPopupSurfaceStyle,
|
|
82
|
+
position: 'fixed', zIndex: 1100, boxSizing: 'border-box', display: 'flex', flexDirection: 'column',
|
|
83
|
+
width: 336, maxWidth: 'min(400px, calc(100vw - 32px))', maxHeight: 'min(560px, calc(100vh - 140px))',
|
|
84
|
+
overflow: 'hidden', padding: 3, border: 0, borderRadius: 'var(--dsw-radius-lg)',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const catalogMenuBodyStyle = {
|
|
88
|
+
display: 'flex', flex: 'auto', flexDirection: 'column', minHeight: 0, overflow: 'auto',
|
|
89
|
+
};
|
|
90
|
+
const rowStyle = {
|
|
91
|
+
position: 'relative', display: 'flex', alignItems: 'flex-start', gap: 6, boxSizing: 'border-box',
|
|
92
|
+
width: '100%', minHeight: 44, padding: '6px 7px 6px 9px', border: 0, borderRadius: 'var(--dsw-radius-lg)',
|
|
93
|
+
background: 'transparent', color: dshThemeColor.labelPrimary, fontSize: uiFontSize(12), lineHeight: '17px',
|
|
94
|
+
textAlign: 'left', cursor: 'pointer', outline: 'none',
|
|
95
|
+
};
|
|
96
|
+
const buttonStyle = {
|
|
97
|
+
display: 'inline-flex', alignItems: 'center', gap: 8, width: '100%', minHeight: 40, boxSizing: 'border-box', padding: '0 10px',
|
|
98
|
+
border: 0, borderRadius: 10, background: dshThemeColor.surfaceSubtle,
|
|
99
|
+
color: dshThemeColor.labelSecondary, fontSize: uiFontSize(14), lineHeight: '22px', cursor: 'pointer', textAlign: 'left',
|
|
100
|
+
};
|
|
101
|
+
/** 停止分组是列表内的辅助折叠条,尺寸与 DSH 原生触发器保持一致。 */
|
|
102
|
+
const inactiveGroupButtonStyle = {
|
|
103
|
+
display: 'inline-flex', alignItems: 'center', gap: 6, width: '100%', minHeight: 32, boxSizing: 'border-box',
|
|
104
|
+
padding: '3px 7px', border: 0, borderRadius: 'var(--dsw-radius-sm)', background: dshThemeColor.surfaceSubtle,
|
|
105
|
+
color: dshThemeColor.labelSecondary, fontSize: uiFontSize(12), lineHeight: '18px', cursor: 'pointer', textAlign: 'left',
|
|
106
|
+
};
|
|
107
|
+
const clickareaStyle = {
|
|
108
|
+
display: 'flex', flex: 1, alignSelf: 'stretch', alignItems: 'flex-start', gap: 6, minWidth: 0,
|
|
109
|
+
boxSizing: 'border-box', margin: '-6px -7px', padding: '6px 7px', borderRadius: 'var(--dsw-radius-lg)',
|
|
110
|
+
};
|
|
111
|
+
const rowActivitySlotStyle = {
|
|
112
|
+
display: 'inline-flex', flex: 'none', alignItems: 'center', justifyContent: 'center', width: 14, height: 17,
|
|
113
|
+
};
|
|
114
|
+
const contentStyle = { display: 'flex', flex: 1, flexDirection: 'column', minWidth: 0 };
|
|
115
|
+
const ellipsisStyle = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
|
|
116
|
+
const metricsStyle = {
|
|
117
|
+
display: 'grid', flex: 'none', gridTemplateRows: '17px 15px', color: dshThemeColor.labelTertiary,
|
|
118
|
+
fontSize: uiFontSize(10), lineHeight: '15px', fontVariantNumeric: 'tabular-nums', textAlign: 'right', whiteSpace: 'nowrap',
|
|
119
|
+
};
|
|
120
|
+
const sidebarButtonStyle = {
|
|
121
|
+
display: 'inline-flex', flex: 'none', alignItems: 'center', justifyContent: 'center', width: 28, height: 28,
|
|
122
|
+
margin: '4px 0', padding: 6, border: 0, borderRadius: 'var(--dsw-radius-sm)', background: 'transparent',
|
|
123
|
+
color: dshThemeColor.labelTertiary, cursor: 'pointer',
|
|
124
|
+
};
|
|
125
|
+
function formatTokens(value, t) {
|
|
126
|
+
const scaled = (next) => next >= 100 ? String(Math.round(next)) : String(Math.round(next * 10) / 10);
|
|
127
|
+
if (value < 1e3)
|
|
128
|
+
return String(value);
|
|
129
|
+
if (value < 1e6)
|
|
130
|
+
return t('subagentCollapsed.tokens.thousand', { value: scaled(value / 1e3) });
|
|
131
|
+
return t('subagentCollapsed.tokens.million', { value: scaled(value / 1e6) });
|
|
132
|
+
}
|
|
133
|
+
function tokenTotal(usage) {
|
|
134
|
+
if (usage === undefined)
|
|
135
|
+
return undefined;
|
|
136
|
+
const values = usage;
|
|
137
|
+
const buckets = [values.uncachedInputTokens, values.outputTokens, values.cacheReadTokens, values.cacheWriteTokens];
|
|
138
|
+
if (buckets.some((value) => typeof value !== 'number' || !Number.isFinite(value)))
|
|
139
|
+
return undefined;
|
|
140
|
+
return buckets.reduce((sum, value) => sum + value, 0);
|
|
141
|
+
}
|
|
142
|
+
function activityDuration(summary, activity, now) {
|
|
143
|
+
const timing = summary?.projectionValues?.subagentTiming;
|
|
144
|
+
if (timing === undefined || typeof timing.settledMs !== 'number')
|
|
145
|
+
return undefined;
|
|
146
|
+
if (timing.active === undefined)
|
|
147
|
+
return timing.settledMs;
|
|
148
|
+
const end = activity === 'running' ? now : timing.active.through;
|
|
149
|
+
return timing.settledMs + Math.max(0, end - timing.active.since);
|
|
150
|
+
}
|
|
151
|
+
function splitDuration(ms) {
|
|
152
|
+
const totalSeconds = Math.floor(Math.max(0, ms) / 1e3);
|
|
153
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
154
|
+
const totalHours = Math.floor(totalMinutes / 60);
|
|
155
|
+
return { seconds: totalSeconds % 60, minutes: totalMinutes % 60, hours: totalHours % 24, days: Math.floor(totalHours / 24), totalMinutes, totalHours };
|
|
156
|
+
}
|
|
157
|
+
function formatDuration(ms, t) {
|
|
158
|
+
const { seconds, minutes, hours, days, totalMinutes, totalHours } = splitDuration(ms);
|
|
159
|
+
if (days >= 365) {
|
|
160
|
+
const years = Math.floor(days / 365);
|
|
161
|
+
const months = Math.floor((days % 365) / 30);
|
|
162
|
+
return months === 0 ? t('subagentCollapsed.duration.years', { years }) : t('subagentCollapsed.duration.yearsMonths', { years, months });
|
|
163
|
+
}
|
|
164
|
+
if (days >= 30) {
|
|
165
|
+
const months = Math.floor(days / 30);
|
|
166
|
+
const remainingDays = days % 30;
|
|
167
|
+
return remainingDays === 0 ? t('subagentCollapsed.duration.months', { months }) : t('subagentCollapsed.duration.monthsDays', { months, days: remainingDays });
|
|
168
|
+
}
|
|
169
|
+
if (days > 0)
|
|
170
|
+
return hours === 0 ? t('subagentCollapsed.duration.days', { days }) : t('subagentCollapsed.duration.daysHours', { days, hours });
|
|
171
|
+
if (totalHours > 0)
|
|
172
|
+
return t('subagentCollapsed.duration.hours', { hours: totalHours, minutes: String(minutes).padStart(2, '0'), seconds: String(seconds).padStart(2, '0') });
|
|
173
|
+
if (totalMinutes > 0)
|
|
174
|
+
return t('subagentCollapsed.duration.minutes', { minutes: totalMinutes, seconds: String(seconds).padStart(2, '0') });
|
|
175
|
+
return t('subagentCollapsed.duration.seconds', { seconds });
|
|
176
|
+
}
|
|
177
|
+
function formatExactDuration(ms, t) {
|
|
178
|
+
const { seconds, minutes, hours, days } = splitDuration(ms);
|
|
179
|
+
return days === 0 ? formatDuration(ms, t) : t('subagentCollapsed.duration.exactDays', {
|
|
180
|
+
days, hours: String(hours).padStart(2, '0'), minutes: String(minutes).padStart(2, '0'), seconds: String(seconds).padStart(2, '0'),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function menuPosition(trigger) {
|
|
184
|
+
const rect = trigger.getBoundingClientRect();
|
|
185
|
+
const width = Math.min(336, window.innerWidth - 32);
|
|
186
|
+
return { top: rect.bottom + 5, left: Math.min(Math.max(16, rect.left), window.innerWidth - width - 16) };
|
|
187
|
+
}
|
|
188
|
+
/** DSH 原生 switcher 的上下双箭头图标。 */
|
|
189
|
+
function subagentSwitcherIcon() {
|
|
190
|
+
return createElement('svg', { width: 16, height: 16, viewBox: '0 0 20 20', fill: 'none', 'aria-hidden': true }, createElement('path', { d: 'M5.99951 12.7L8.95546 14.9478C9.40011 15.2859 9.62244 15.455 9.87526 15.488C9.95774 15.4988 10.0413 15.4988 10.1238 15.488C10.3766 15.455 10.599 15.2859 11.0436 14.9478L13.9995 12.7', stroke: 'currentColor', strokeWidth: 1.5 }), createElement('path', { d: 'M13.9995 7.7417L11.0436 5.49387C10.5989 5.15574 10.3766 4.98668 10.1238 4.95362C10.0413 4.94283 9.95775 4.94283 9.87527 4.95362C9.62245 4.98668 9.40012 5.15574 8.95547 5.49387L5.99952 7.7417', stroke: 'currentColor', strokeWidth: 1.5 }));
|
|
191
|
+
}
|
|
192
|
+
function normalizeMode(value) {
|
|
193
|
+
return value === 'one-shot' || value === 'continuable' || value === 'unknown' ? value : 'unknown';
|
|
194
|
+
}
|
|
195
|
+
function statusRunning(statuses, id) {
|
|
196
|
+
if (statuses instanceof Map) {
|
|
197
|
+
const status = statuses.get(id);
|
|
198
|
+
return typeof status?.running === 'boolean' ? status.running : undefined;
|
|
199
|
+
}
|
|
200
|
+
if (statuses !== null && typeof statuses === 'object') {
|
|
201
|
+
const status = statuses[id];
|
|
202
|
+
return typeof status?.running === 'boolean' ? status.running : undefined;
|
|
203
|
+
}
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 将 DSH 0.2.0 的 subagentsByParent 和 0.2.1 的 projectionsBySession
|
|
208
|
+
* 统一为本组件的目录快照。这样覆盖层只依赖公开投影,不读取会话日志。
|
|
209
|
+
*/
|
|
210
|
+
function normalizeCatalogs(state, statuses) {
|
|
211
|
+
if (state.subagentsByParent !== undefined)
|
|
212
|
+
return state.subagentsByParent;
|
|
213
|
+
const projections = state.projectionsBySession ?? {};
|
|
214
|
+
const summaries = state.byId ?? {};
|
|
215
|
+
const result = {};
|
|
216
|
+
for (const [parentId, projection] of Object.entries(projections)) {
|
|
217
|
+
const rawEntries = projection.values?.subagentCatalog ?? [];
|
|
218
|
+
const entries = rawEntries.flatMap((raw) => {
|
|
219
|
+
const id = typeof raw.id === 'string' ? raw.id : undefined;
|
|
220
|
+
if (id === undefined)
|
|
221
|
+
return [];
|
|
222
|
+
const running = statusRunning(statuses, id) ?? summaries[id]?.running === true;
|
|
223
|
+
const childProjection = projections[id];
|
|
224
|
+
const childCatalog = childProjection?.values?.subagentCatalog;
|
|
225
|
+
return [{
|
|
226
|
+
kind: 'child',
|
|
227
|
+
id,
|
|
228
|
+
...(typeof raw.label === 'string' ? { label: raw.label } : {}),
|
|
229
|
+
mode: normalizeMode(raw.mode),
|
|
230
|
+
activity: running ? 'running' : 'inactive',
|
|
231
|
+
// 未加载的子投影保留分支入口;ready + 空数组才确认是叶子。
|
|
232
|
+
hasChildren: childProjection === undefined
|
|
233
|
+
|| childProjection.state === 'loading'
|
|
234
|
+
|| childProjection.state === 'idle' && childCatalog === undefined
|
|
235
|
+
|| (childCatalog?.length ?? 0) > 0,
|
|
236
|
+
}];
|
|
237
|
+
});
|
|
238
|
+
const projectionState = projection.state ?? 'loading';
|
|
239
|
+
result[parentId] = {
|
|
240
|
+
entries,
|
|
241
|
+
state: projectionState === 'idle'
|
|
242
|
+
? projection.values?.subagentCatalog === undefined ? 'loading' : 'ready'
|
|
243
|
+
: projectionState,
|
|
244
|
+
...(projection.error === undefined ? {} : { error: projection.error }),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
function parentSessionIdOf(state, sessionId) {
|
|
250
|
+
const summary = state.byId?.[sessionId];
|
|
251
|
+
if (summary?.origin === 'subagent' && summary.parentId !== undefined)
|
|
252
|
+
return summary.parentId;
|
|
253
|
+
for (const [parentId, catalog] of Object.entries(state.subagentsByParent ?? {})) {
|
|
254
|
+
if (catalog.entries.some((entry) => entry.kind === 'child' && entry.id === sessionId))
|
|
255
|
+
return parentId;
|
|
256
|
+
}
|
|
257
|
+
for (const [parentId, projection] of Object.entries(state.projectionsBySession ?? {})) {
|
|
258
|
+
if (projection.values?.subagentCatalog?.some((entry) => entry.id === sessionId))
|
|
259
|
+
return parentId;
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
function sessionStats(root, summaries, catalogs) {
|
|
264
|
+
// DSH 原生触发器统计当前父会话的直接子项;递归目录只在展开分支后显示,
|
|
265
|
+
// 不能把孙级 Agent 混入顶部的“个数”和停止分组。
|
|
266
|
+
const catalogEntries = catalogs[root]?.entries ?? [];
|
|
267
|
+
const catalogChildren = catalogEntries.flatMap((entry) => entry.kind === 'child' ? [entry.id] : []);
|
|
268
|
+
const summaryChildren = Object.values(summaries).filter((summary) => summary.parentId === root).map((summary) => summary.id);
|
|
269
|
+
const childIds = new Set([...summaryChildren, ...catalogChildren]);
|
|
270
|
+
let runningCount = 0;
|
|
271
|
+
for (const id of childIds) {
|
|
272
|
+
const catalogEntry = catalogEntries.find((entry) => entry.kind === 'child' && entry.id === id);
|
|
273
|
+
if (catalogEntry !== undefined
|
|
274
|
+
? childActivity(catalogEntry, summaries) === 'running'
|
|
275
|
+
: summaries[id]?.running === true)
|
|
276
|
+
runningCount += 1;
|
|
277
|
+
}
|
|
278
|
+
return { count: childIds.size, runningCount };
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* 判断打开目录时是否需要补拉父会话投影。
|
|
282
|
+
*
|
|
283
|
+
* 顶部计数可以先由会话摘要提供,目录投影却可能仍为空;用摘要计数作为
|
|
284
|
+
* 下限可以覆盖这种短暂不一致,也能覆盖关闭目录后投影被清理的情况。
|
|
285
|
+
*/
|
|
286
|
+
export function shouldRefreshSubagentCatalog(catalog, totalCount) {
|
|
287
|
+
const childCount = catalog?.entries.reduce((count, entry) => count + (entry.kind === 'child' ? 1 : 0), 0) ?? 0;
|
|
288
|
+
return catalog === undefined || catalog.state !== 'ready' || childCount < totalCount;
|
|
289
|
+
}
|
|
290
|
+
function diagnosticText(entry, t) {
|
|
291
|
+
return t(`subagentCollapsed.diagnostic.${entry.reason}`);
|
|
292
|
+
}
|
|
293
|
+
function CatalogRows(props) {
|
|
294
|
+
const [now, setNow] = useState(() => Date.now());
|
|
295
|
+
const partitioned = partitionSubagentEntries(props.catalog.entries, props.summaries);
|
|
296
|
+
const hasRunning = partitioned.running.length > 0;
|
|
297
|
+
useEffect(() => {
|
|
298
|
+
if (!hasRunning)
|
|
299
|
+
return;
|
|
300
|
+
const timer = setInterval(() => setNow(Date.now()), 1000);
|
|
301
|
+
return () => clearInterval(timer);
|
|
302
|
+
}, [hasRunning]);
|
|
303
|
+
const showInactive = props.inactiveOpen.has(props.parentSessionId);
|
|
304
|
+
const reserveDisclosure = props.catalog.entries.some((entry) => {
|
|
305
|
+
if (entry.kind !== 'child')
|
|
306
|
+
return false;
|
|
307
|
+
const childCatalog = props.catalogs[entry.id];
|
|
308
|
+
return entry.hasChildren && !(childCatalog?.state === 'ready' && childCatalog.entries.length === 0);
|
|
309
|
+
});
|
|
310
|
+
const renderEntry = (entry) => {
|
|
311
|
+
const childCatalog = props.catalogs[entry.id];
|
|
312
|
+
const knownLeaf = !entry.hasChildren || childCatalog?.state === 'ready' && childCatalog.entries.length === 0;
|
|
313
|
+
const expanded = props.expanded.has(entry.id);
|
|
314
|
+
const summary = props.summaries[entry.id];
|
|
315
|
+
const activity = childActivity(entry, props.summaries);
|
|
316
|
+
const label = entry.label ?? entry.id;
|
|
317
|
+
const modeLabel = entry.mode === 'one-shot'
|
|
318
|
+
? props.t('subagentCollapsed.mode.oneShot')
|
|
319
|
+
: entry.mode === 'continuable' ? props.t('subagentCollapsed.mode.continuable') : props.t('subagentCollapsed.mode.unknown');
|
|
320
|
+
const secondary = [summary?.title, modeLabel, activity === 'running' ? props.t('subagentCollapsed.activity.running') : props.t('subagentCollapsed.activity.inactive')]
|
|
321
|
+
.filter((value) => value !== undefined && value !== '')
|
|
322
|
+
.join(' · ');
|
|
323
|
+
const totalTokens = tokenTotal(summary?.projectionValues?.tokenUsage);
|
|
324
|
+
const durationMs = activityDuration(summary, activity, now);
|
|
325
|
+
const tokenMetric = totalTokens === undefined ? undefined : props.t('subagentCollapsed.tokens.total', { value: formatTokens(totalTokens, props.t) });
|
|
326
|
+
const durationMetric = durationMs === undefined ? undefined : {
|
|
327
|
+
compact: formatDuration(durationMs, props.t),
|
|
328
|
+
exact: formatExactDuration(durationMs, props.t),
|
|
329
|
+
};
|
|
330
|
+
const metrics = [tokenMetric, durationMetric?.exact].filter((value) => value !== undefined && value !== '').join(' · ');
|
|
331
|
+
const openChild = () => {
|
|
332
|
+
props.openChild({ parentSessionId: props.parentSessionId, childSessionId: entry.id, mode: entry.mode });
|
|
333
|
+
props.closeCatalog();
|
|
334
|
+
};
|
|
335
|
+
const handleKey = (event) => {
|
|
336
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
337
|
+
event.preventDefault();
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
openChild();
|
|
340
|
+
}
|
|
341
|
+
else if (event.key === 'ArrowRight' && !knownLeaf && !expanded) {
|
|
342
|
+
event.preventDefault();
|
|
343
|
+
event.stopPropagation();
|
|
344
|
+
props.toggleBranch(entry.id);
|
|
345
|
+
}
|
|
346
|
+
else if (event.key === 'ArrowLeft' && expanded) {
|
|
347
|
+
event.preventDefault();
|
|
348
|
+
event.stopPropagation();
|
|
349
|
+
props.toggleBranch(entry.id);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
const openAside = (event) => {
|
|
353
|
+
event.preventDefault();
|
|
354
|
+
event.stopPropagation();
|
|
355
|
+
props.openChildAside?.({ parentSessionId: props.parentSessionId, childSessionId: entry.id, mode: entry.mode });
|
|
356
|
+
props.closeCatalog();
|
|
357
|
+
};
|
|
358
|
+
const disclosure = knownLeaf
|
|
359
|
+
? reserveDisclosure ? createElement('span', { key: 'disclosure-space', style: { flex: 'none', width: 14, height: 17 } }) : null
|
|
360
|
+
: createElement('button', {
|
|
361
|
+
key: 'disclosure', type: 'button', tabIndex: -1,
|
|
362
|
+
'aria-label': props.t(expanded ? 'subagentCollapsed.branch.collapse' : 'subagentCollapsed.branch.expand', { label }),
|
|
363
|
+
onClick: (event) => { event.preventDefault(); event.stopPropagation(); props.toggleBranch(entry.id); },
|
|
364
|
+
style: { display: 'inline-flex', flex: 'none', alignItems: 'center', justifyContent: 'center', width: 14, height: 17, padding: 0, border: 0, borderRadius: 0, background: 'transparent', color: dshThemeColor.labelTertiary, cursor: 'pointer', transition: 'transform .12s', transform: expanded ? 'rotate(90deg)' : undefined },
|
|
365
|
+
}, createElement(resolveTerminalArrowIcon('right'), { size: 12 }));
|
|
366
|
+
const asideAnchor = props.currentSessionId === entry.id || props.openChildAside === undefined ? null : createElement('button', {
|
|
367
|
+
type: 'button', 'aria-label': props.t('subagentCollapsed.open.sidebar.aria', { label }),
|
|
368
|
+
onClick: openAside, onKeyDown: (event) => { event.stopPropagation(); },
|
|
369
|
+
onMouseEnter: (event) => { event.currentTarget.style.background = dshThemeColor.surfaceSubtle; event.currentTarget.style.color = dshThemeColor.labelPrimary; },
|
|
370
|
+
onMouseLeave: (event) => { event.currentTarget.style.background = 'transparent'; event.currentTarget.style.color = dshThemeColor.labelTertiary; },
|
|
371
|
+
style: sidebarButtonStyle,
|
|
372
|
+
}, createElement(resolveTerminalArrowIcon('right'), { size: 12 }));
|
|
373
|
+
const asideButton = asideAnchor === null ? null : createElement(Tooltip, { label: props.t('subagentCollapsed.open.sidebar'), side: 'bottom', align: 'end', children: asideAnchor });
|
|
374
|
+
const clickarea = createElement('div', { key: 'clickarea', 'data-subagent-clickarea': 'true', style: clickareaStyle }, createElement('span', { style: rowActivitySlotStyle }, createElement(StateDot, { state: activity === 'running' ? 'ongoing' : 'idle' })), createElement('span', { style: contentStyle }, createElement('span', { style: { ...ellipsisStyle, color: 'inherit', fontWeight: entry.id === props.currentSessionId ? 600 : 400 } }, label), createElement('span', { style: { ...ellipsisStyle, color: dshThemeColor.labelTertiary, fontSize: uiFontSize(10), lineHeight: '15px' } }, secondary)), metrics === '' ? null : createElement('span', { style: metricsStyle }, tokenMetric === undefined ? null : createElement('span', { style: { gridRow: 1, lineHeight: '17px' } }, tokenMetric), durationMetric === undefined ? null : createElement('span', { style: { gridRow: 2 }, title: props.t('subagentCollapsed.duration.exactTitle', { duration: durationMetric.exact }) }, durationMetric.compact)), asideButton);
|
|
375
|
+
const row = createElement('div', {
|
|
376
|
+
key: entry.id, role: 'treeitem', tabIndex: 0, 'aria-level': props.level, 'aria-current': entry.id === props.currentSessionId || undefined,
|
|
377
|
+
'aria-label': [label, secondary, metrics].filter((value) => value !== '').join(' '),
|
|
378
|
+
...knownLeaf ? {} : { 'aria-expanded': expanded }, style: rowStyle,
|
|
379
|
+
onMouseEnter: (event) => { const area = event.currentTarget.querySelector('[data-subagent-clickarea]'); if (area !== null)
|
|
380
|
+
area.style.background = dshThemeColor.surfaceSubtle; },
|
|
381
|
+
onMouseLeave: (event) => { const area = event.currentTarget.querySelector('[data-subagent-clickarea]'); if (area !== null)
|
|
382
|
+
area.style.background = 'transparent'; },
|
|
383
|
+
onClick: openChild, onKeyDown: handleKey,
|
|
384
|
+
}, disclosure, clickarea);
|
|
385
|
+
if (knownLeaf || !expanded)
|
|
386
|
+
return createElement('div', { key: `${entry.id}-node`, style: { position: 'relative', minWidth: 0 } }, row);
|
|
387
|
+
const childLoading = childCatalog === undefined || (childCatalog.state === 'loading' && childCatalog.entries.length === 0);
|
|
388
|
+
const children = childCatalog === undefined
|
|
389
|
+
? createElement('div', { style: { color: dshThemeColor.labelTertiary, padding: '8px 10px', fontSize: uiFontSize(11), lineHeight: '16px' } }, props.t('subagentCollapsed.loading.label'))
|
|
390
|
+
: createElement(CatalogRows, { ...props, parentSessionId: entry.id, catalog: childCatalog, level: props.level + 1 });
|
|
391
|
+
return createElement('div', { key: `${entry.id}-node`, style: { position: 'relative', minWidth: 0 } }, row, createElement('div', { role: 'group', 'aria-busy': childLoading || undefined, style: { marginLeft: 16, paddingLeft: 3, borderLeft: '0.5px solid var(--dsw-alias-border-l2)' } }, children));
|
|
392
|
+
};
|
|
393
|
+
const diagnostics = partitioned.diagnostics.map((entry) => createElement('div', { key: `diagnostic-${entry.id}`, role: 'treeitem', 'aria-disabled': true, 'aria-level': props.level, style: { ...rowStyle, color: dshThemeColor.labelTertiary, cursor: 'not-allowed' } }, createElement('span', { style: rowActivitySlotStyle }, createElement(StateDot, { state: 'error' })), createElement('span', { style: contentStyle }, createElement('span', { style: ellipsisStyle }, entry.id), createElement('span', { style: { ...ellipsisStyle, fontSize: uiFontSize(10), lineHeight: '15px' } }, diagnosticText(entry, props.t)))));
|
|
394
|
+
const inactiveLabel = props.t(partitioned.inactive.length === 1 ? 'subagentCollapsed.inactive.one' : 'subagentCollapsed.inactive.other', { count: partitioned.inactive.length });
|
|
395
|
+
return createElement(Fragment, null, props.catalog.state === 'loading' && props.catalog.entries.length === 0 ? createElement('div', { style: { color: dshThemeColor.labelTertiary, padding: '8px 10px', fontSize: uiFontSize(11), lineHeight: '16px' } }, props.t('subagentCollapsed.loading.label')) : null, props.catalog.state === 'error' ? createElement('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, color: 'var(--dsw-alias-state-error-primary)', padding: '8px 10px', fontSize: uiFontSize(11), lineHeight: '16px' } }, createElement('span', null, props.catalog.error?.message ?? props.t('subagentCollapsed.load.error')), createElement('button', { type: 'button', onClick: () => props.refresh(props.parentSessionId), style: { ...buttonStyle, width: 'auto', minHeight: 28, padding: '3px 5px', background: 'transparent', fontSize: uiFontSize(11) } }, createElement(resolveRefreshIcon()), props.t('subagentCollapsed.retry'))) : null, ...diagnostics, ...partitioned.running.map(renderEntry), partitioned.inactive.length > 0 ? createElement('div', { key: `${props.parentSessionId}-inactive`, style: { marginTop: props.catalog.entries.length > partitioned.inactive.length ? 2 : 0 } }, createElement('button', { type: 'button', 'aria-expanded': showInactive, 'aria-label': props.t(showInactive ? 'subagentCollapsed.inactive.collapse' : 'subagentCollapsed.inactive.expand'), onClick: () => props.toggleInactive(props.parentSessionId), style: inactiveGroupButtonStyle }, createElement(showInactive ? resolveChevronDownIcon() : resolveTerminalArrowIcon('right'), { size: 14 }), inactiveLabel), showInactive ? createElement('div', { role: 'group', style: { marginTop: 1 } }, ...partitioned.inactive.map(renderEntry)) : null) : null);
|
|
396
|
+
}
|
|
397
|
+
function CatalogDropdown(props) {
|
|
398
|
+
const sessionState = props.useSessions((value) => value);
|
|
399
|
+
const summaries = sessionState.byId ?? {};
|
|
400
|
+
const statuses = props.useSessionStatus?.((value) => value);
|
|
401
|
+
const catalogs = useMemo(() => normalizeCatalogs(sessionState, statuses), [sessionState, statuses]);
|
|
402
|
+
const catalog = catalogs[props.rootSessionId];
|
|
403
|
+
const stats = useMemo(() => sessionStats(props.rootSessionId, summaries, catalogs), [props.rootSessionId, summaries, catalogs]);
|
|
404
|
+
const directEntries = catalog?.entries.filter((entry) => entry.kind === 'child') ?? [];
|
|
405
|
+
// 目录可能先于会话摘要到达;触发器不能在这段窗口显示为 0 个。
|
|
406
|
+
const totalCount = Math.max(stats.count, directEntries.length);
|
|
407
|
+
const runningCount = stats.runningCount;
|
|
408
|
+
const [open, setOpen] = useState(false);
|
|
409
|
+
const [expanded, setExpanded] = useState(new Set());
|
|
410
|
+
const [inactiveOpen, setInactiveOpen] = useState(new Set());
|
|
411
|
+
const [position, setPosition] = useState();
|
|
412
|
+
const [triggerInteractive, setTriggerInteractive] = useState(false);
|
|
413
|
+
const rootRef = useRef(null);
|
|
414
|
+
const triggerRef = useRef(null);
|
|
415
|
+
const menuRef = useRef(null);
|
|
416
|
+
const hoverOpenTimer = useRef();
|
|
417
|
+
const hoverCloseTimer = useRef();
|
|
418
|
+
const pinnedRef = useRef(false);
|
|
419
|
+
const setCatalogOpenRef = useRef(props.setCatalogOpen);
|
|
420
|
+
setCatalogOpenRef.current = props.setCatalogOpen;
|
|
421
|
+
const visible = props.variant === 'switcher' || catalog?.state === 'error' || (catalog?.entries.length ?? 0) > 0 || totalCount > 0;
|
|
422
|
+
const cancelHoverOpen = () => {
|
|
423
|
+
if (hoverOpenTimer.current === undefined)
|
|
424
|
+
return;
|
|
425
|
+
clearTimeout(hoverOpenTimer.current);
|
|
426
|
+
hoverOpenTimer.current = undefined;
|
|
427
|
+
};
|
|
428
|
+
const cancelHoverClose = () => {
|
|
429
|
+
if (hoverCloseTimer.current === undefined)
|
|
430
|
+
return;
|
|
431
|
+
clearTimeout(hoverCloseTimer.current);
|
|
432
|
+
hoverCloseTimer.current = undefined;
|
|
433
|
+
};
|
|
434
|
+
const changeOpen = (next, restoreFocus = false) => {
|
|
435
|
+
cancelHoverOpen();
|
|
436
|
+
cancelHoverClose();
|
|
437
|
+
if (next) {
|
|
438
|
+
const trigger = triggerRef.current;
|
|
439
|
+
if (trigger === null)
|
|
440
|
+
return;
|
|
441
|
+
setOpen(true);
|
|
442
|
+
setPosition(menuPosition(trigger));
|
|
443
|
+
props.setCatalogOpen(props.rootSessionId, true);
|
|
444
|
+
// 计数可能来自 Session 摘要,而目录投影仍未加载(尤其是关闭后再次打开时)。
|
|
445
|
+
// 0.2.1 的 setSubagentCatalogOpen 没有拉取副作用,必须在打开入口主动刷新父会话,
|
|
446
|
+
// 否则弹层会显示为空目录,已停止的子智能体也无法重新出现。
|
|
447
|
+
if (shouldRefreshSubagentCatalog(catalog, totalCount))
|
|
448
|
+
props.refresh(props.rootSessionId);
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
pinnedRef.current = false;
|
|
452
|
+
const closing = new Set(expanded);
|
|
453
|
+
setOpen(false);
|
|
454
|
+
setPosition(undefined);
|
|
455
|
+
setExpanded(new Set());
|
|
456
|
+
setInactiveOpen(new Set());
|
|
457
|
+
for (const sessionId of closing)
|
|
458
|
+
props.setCatalogOpen(sessionId, false);
|
|
459
|
+
props.setCatalogOpen(props.rootSessionId, false);
|
|
460
|
+
}
|
|
461
|
+
if (restoreFocus)
|
|
462
|
+
queueMicrotask(() => { triggerRef.current?.focus(); });
|
|
463
|
+
};
|
|
464
|
+
const scheduleHoverOpen = () => {
|
|
465
|
+
cancelHoverOpen();
|
|
466
|
+
cancelHoverClose();
|
|
467
|
+
if (open)
|
|
468
|
+
return;
|
|
469
|
+
hoverOpenTimer.current = setTimeout(() => { hoverOpenTimer.current = undefined; changeOpen(true); }, 150);
|
|
470
|
+
};
|
|
471
|
+
const scheduleHoverClose = () => {
|
|
472
|
+
cancelHoverOpen();
|
|
473
|
+
cancelHoverClose();
|
|
474
|
+
if (pinnedRef.current)
|
|
475
|
+
return;
|
|
476
|
+
hoverCloseTimer.current = setTimeout(() => { hoverCloseTimer.current = undefined; changeOpen(false); }, 120);
|
|
477
|
+
};
|
|
478
|
+
const close = () => { changeOpen(false); };
|
|
479
|
+
const handleTriggerClick = () => {
|
|
480
|
+
cancelHoverOpen();
|
|
481
|
+
cancelHoverClose();
|
|
482
|
+
if (props.variant === 'switcher' && props.openTitle !== undefined) {
|
|
483
|
+
if (open)
|
|
484
|
+
changeOpen(false);
|
|
485
|
+
props.openTitle();
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
pinnedRef.current = true;
|
|
489
|
+
if (!open)
|
|
490
|
+
changeOpen(true);
|
|
491
|
+
};
|
|
492
|
+
const handleTriggerKeyDown = (event) => {
|
|
493
|
+
if (event.key !== 'ArrowDown')
|
|
494
|
+
return;
|
|
495
|
+
event.preventDefault();
|
|
496
|
+
if (!open)
|
|
497
|
+
changeOpen(true);
|
|
498
|
+
queueMicrotask(() => { menuRef.current?.querySelector('[role="treeitem"]:not([aria-disabled="true"])')?.focus(); });
|
|
499
|
+
};
|
|
500
|
+
const navigate = (event) => {
|
|
501
|
+
const items = menuRef.current === null
|
|
502
|
+
? []
|
|
503
|
+
: Array.from(menuRef.current.querySelectorAll('[role="treeitem"]:not([aria-disabled="true"])'));
|
|
504
|
+
const index = items.indexOf(document.activeElement);
|
|
505
|
+
if (event.key === 'Escape') {
|
|
506
|
+
event.preventDefault();
|
|
507
|
+
close();
|
|
508
|
+
triggerRef.current?.focus();
|
|
509
|
+
}
|
|
510
|
+
else if (event.key === 'Home') {
|
|
511
|
+
event.preventDefault();
|
|
512
|
+
items[0]?.focus();
|
|
513
|
+
}
|
|
514
|
+
else if (event.key === 'End') {
|
|
515
|
+
event.preventDefault();
|
|
516
|
+
items[items.length - 1]?.focus();
|
|
517
|
+
}
|
|
518
|
+
else if (event.key === 'ArrowDown') {
|
|
519
|
+
event.preventDefault();
|
|
520
|
+
items[(index + 1 + items.length) % items.length]?.focus();
|
|
521
|
+
}
|
|
522
|
+
else if (event.key === 'ArrowUp') {
|
|
523
|
+
event.preventDefault();
|
|
524
|
+
items[(index < 0 ? items.length : index - 1 + items.length) % items.length]?.focus();
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
const toggleBranch = (childSessionId) => {
|
|
528
|
+
if (expanded.has(childSessionId)) {
|
|
529
|
+
setExpanded(current => new Set([...current].filter(id => id !== childSessionId)));
|
|
530
|
+
props.setCatalogOpen(childSessionId, false);
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
setExpanded(current => new Set(current).add(childSessionId));
|
|
534
|
+
props.setCatalogOpen(childSessionId, true);
|
|
535
|
+
// 0.2.1 不再有 setSubagentCatalogOpen 的拉取副作用;显式刷新保证
|
|
536
|
+
// 展开分支时仍能得到完整的子目录,旧版则由 Session Controller 去重。
|
|
537
|
+
props.refresh(childSessionId);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
const toggleInactive = (parentSessionId) => {
|
|
541
|
+
setInactiveOpen(current => {
|
|
542
|
+
const next = new Set(current);
|
|
543
|
+
if (next.has(parentSessionId))
|
|
544
|
+
next.delete(parentSessionId);
|
|
545
|
+
else
|
|
546
|
+
next.add(parentSessionId);
|
|
547
|
+
return next;
|
|
548
|
+
});
|
|
549
|
+
};
|
|
550
|
+
useEffect(() => {
|
|
551
|
+
if (!open)
|
|
552
|
+
return;
|
|
553
|
+
const listener = (event) => {
|
|
554
|
+
if (event.target instanceof Node && !rootRef.current?.contains(event.target) && !menuRef.current?.contains(event.target))
|
|
555
|
+
close();
|
|
556
|
+
};
|
|
557
|
+
document.addEventListener('pointerdown', listener);
|
|
558
|
+
return () => { document.removeEventListener('pointerdown', listener); };
|
|
559
|
+
}, [open]);
|
|
560
|
+
useEffect(() => {
|
|
561
|
+
if (!open)
|
|
562
|
+
return;
|
|
563
|
+
const placeMenu = () => {
|
|
564
|
+
const trigger = triggerRef.current;
|
|
565
|
+
if (trigger !== null)
|
|
566
|
+
setPosition(menuPosition(trigger));
|
|
567
|
+
};
|
|
568
|
+
window.addEventListener('resize', placeMenu);
|
|
569
|
+
document.addEventListener('scroll', placeMenu, true);
|
|
570
|
+
return () => { window.removeEventListener('resize', placeMenu); document.removeEventListener('scroll', placeMenu, true); };
|
|
571
|
+
}, [open]);
|
|
572
|
+
useEffect(() => () => { cancelHoverOpen(); cancelHoverClose(); }, []);
|
|
573
|
+
useEffect(() => () => { setCatalogOpenRef.current(props.rootSessionId, false); }, [props.rootSessionId]);
|
|
574
|
+
useEffect(() => { if (!visible && open)
|
|
575
|
+
close(); }, [visible, open]);
|
|
576
|
+
if (!visible)
|
|
577
|
+
return null;
|
|
578
|
+
const currentEntry = props.currentSessionId === undefined ? undefined : catalog?.entries.find(entry => entry.kind === 'child' && entry.id === props.currentSessionId);
|
|
579
|
+
const title = currentEntry?.kind === 'child' ? currentEntry.label ?? currentEntry.id : props.displayTitle;
|
|
580
|
+
const totalKey = totalCount === 1 ? 'subagentCollapsed.count.total.one' : 'subagentCollapsed.count.total.other';
|
|
581
|
+
const runningKey = runningCount === 1 ? 'subagentCollapsed.count.running.one' : 'subagentCollapsed.count.running.other';
|
|
582
|
+
const triggerText = props.variant === 'switcher'
|
|
583
|
+
? title ?? ''
|
|
584
|
+
: props.t(totalKey, { count: totalCount });
|
|
585
|
+
const triggerAriaLabel = props.variant === 'switcher'
|
|
586
|
+
? props.t('subagentCollapsed.switcher.aria', { title: triggerText })
|
|
587
|
+
: props.t(runningCount > 0 ? runningKey : totalKey, { count: runningCount > 0 ? runningCount : totalCount });
|
|
588
|
+
const ancestorSwitcher = props.variant === 'switcher' && props.openTitle !== undefined;
|
|
589
|
+
const triggerColor = props.variant === 'switcher'
|
|
590
|
+
? ancestorSwitcher ? 'var(--dsw-alias-label-tertiary)' : 'var(--dsw-alias-label-primary)'
|
|
591
|
+
: triggerInteractive ? 'var(--dsw-alias-label-primary)' : 'var(--dsw-alias-label-tertiary)';
|
|
592
|
+
const button = createElement('button', {
|
|
593
|
+
ref: triggerRef, type: 'button', 'aria-haspopup': 'tree', 'aria-expanded': open,
|
|
594
|
+
'aria-label': triggerAriaLabel,
|
|
595
|
+
onMouseEnter: () => { setTriggerInteractive(true); scheduleHoverOpen(); }, onMouseLeave: () => { setTriggerInteractive(false); scheduleHoverClose(); }, onFocus: () => setTriggerInteractive(true), onBlur: () => setTriggerInteractive(false),
|
|
596
|
+
onClick: handleTriggerClick, onKeyDown: handleTriggerKeyDown,
|
|
597
|
+
style: { display: 'inline-flex', alignItems: 'center', gap: 4, minHeight: 28, maxWidth: props.variant === 'switcher' ? 244 : undefined, padding: '3px 2px', border: 0, borderRadius: 'var(--dsw-radius-sm)', background: 'transparent', color: triggerColor, fontSize: uiFontSize(12), lineHeight: '18px', fontWeight: props.variant === 'switcher' && !ancestorSwitcher ? 500 : undefined, cursor: 'pointer', outline: 'none' },
|
|
598
|
+
}, props.variant === 'count' && runningCount > 0 ? createElement(StateDot, { state: 'ongoing' }) : null, createElement('span', { style: { flex: 1, minWidth: 0, maxWidth: 244, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, triggerText), props.variant === 'switcher' ? subagentSwitcherIcon() : createElement('span', { style: { display: 'inline-flex', transition: 'transform .12s', transform: open ? 'rotate(180deg)' : undefined } }, createElement(resolveChevronDownIcon())));
|
|
599
|
+
const menu = open ? createElement('div', { ref: menuRef, role: 'presentation', onMouseEnter: cancelHoverClose, onMouseLeave: scheduleHoverClose, onKeyDown: navigate, style: { ...catalogStyle(), ...position } }, createElement('div', { role: 'tree', 'aria-label': props.t('subagentCollapsed.tree.aria'), style: catalogMenuBodyStyle }, createElement(CatalogRows, { parentSessionId: props.rootSessionId, ...(props.currentSessionId === undefined ? {} : { currentSessionId: props.currentSessionId }), catalog: catalog ?? { entries: [], state: 'loading' }, catalogs, summaries, expanded, inactiveOpen, level: 1, openChild: props.openChild, openChildAside: props.openChildAside, refresh: props.refresh, toggleBranch, toggleInactive, closeCatalog: close, t: props.t }))) : null;
|
|
600
|
+
const renderedMenu = menu === null ? null : typeof document === 'undefined' ? menu : createPortal(menu, document.body);
|
|
601
|
+
return createElement('div', { ref: rootRef, onMouseLeave: scheduleHoverClose, style: { position: 'relative', display: 'inline-flex', alignItems: 'center', gap: 10, minWidth: 0, marginLeft: props.variant === 'switcher' ? 6 : undefined } }, button, renderedMenu);
|
|
602
|
+
}
|
|
603
|
+
/** DSH 原生 lineage 的兼容投影:保持原生树结构,仅增加停止项折叠投影。 */
|
|
604
|
+
export function CollapsedSubagentLineage(props) {
|
|
605
|
+
const state = props.useSessions((value) => value);
|
|
606
|
+
const parentId = parentSessionIdOf(state, props.lineageSessionId);
|
|
607
|
+
const shared = { useSessions: props.useSessions, useSessionStatus: props.useSessionStatus, openChild: props.openChild, openChildAside: props.openChildAside, refresh: props.refresh, setCatalogOpen: props.setCatalogOpen, t: props.t };
|
|
608
|
+
// DSH 0.2.0+ 已把根会话的目录计数迁移到 header.actions。lineage 只负责
|
|
609
|
+
// 子会话的面包屑;根会话在这里返回空,避免同一个目录出现两个入口。
|
|
610
|
+
if (parentId === undefined)
|
|
611
|
+
return createElement(Fragment, null);
|
|
612
|
+
return createElement(Fragment, null, createElement(CatalogDropdown, { ...shared, rootSessionId: parentId, currentSessionId: props.lineageSessionId, variant: 'switcher', displayTitle: props.displayTitle, ...(props.openTitle === undefined ? {} : { openTitle: props.openTitle }) }), props.openTitle === undefined ? createElement(CatalogDropdown, { ...shared, rootSessionId: parentId, variant: 'count' }) : null);
|
|
613
|
+
}
|
|
614
|
+
/** DSH 0.2.1 根会话把计数入口放进 header.actions;这里必须覆盖这个 Slot。 */
|
|
615
|
+
export function CollapsedSubagentCatalogAction(props) {
|
|
616
|
+
const state = props.useSessions((value) => value);
|
|
617
|
+
if (state.byId?.[props.sessionId]?.origin === 'subagent')
|
|
618
|
+
return createElement(Fragment, null);
|
|
619
|
+
return createElement(CatalogDropdown, {
|
|
620
|
+
useSessions: props.useSessions,
|
|
621
|
+
useSessionStatus: props.useSessionStatus,
|
|
622
|
+
openChild: props.openChild,
|
|
623
|
+
openChildAside: props.openChildAside,
|
|
624
|
+
refresh: props.refresh,
|
|
625
|
+
setCatalogOpen: props.setCatalogOpen,
|
|
626
|
+
t: props.t,
|
|
627
|
+
rootSessionId: props.sessionId,
|
|
628
|
+
variant: 'count',
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
/** 在 DSH 两个子 Agent Header Slot 的更低优先级登记兼容投影;原生组件仍保留作回退。 */
|
|
632
|
+
export function registerCollapsedSubagentLineage(slots, locale, sessions) {
|
|
633
|
+
if (slots === undefined || sessions === undefined)
|
|
634
|
+
return () => undefined;
|
|
635
|
+
const disposeLocale = locale.register(SUBAGENT_COLLAPSED_LOCALE_NS, { zh, en });
|
|
636
|
+
const disposeInjection = slots.inject('conversation.session.header.lineage', () => slots.register({
|
|
637
|
+
name: 'conversation.session.header.lineage',
|
|
638
|
+
priority: -1,
|
|
639
|
+
locale: SUBAGENT_COLLAPSED_LOCALE_NS,
|
|
640
|
+
inject: () => ({
|
|
641
|
+
openChild: (address) => { sessions.openChild(address); },
|
|
642
|
+
openChildAside: sessions.openChildAside === undefined ? undefined : (address) => { sessions.openChildAside(address); },
|
|
643
|
+
refresh: (sessionId) => { void sessions.refresh(sessionId); },
|
|
644
|
+
setCatalogOpen: (sessionId, open) => { sessions.setSubagentCatalogOpen(sessionId, open); },
|
|
645
|
+
}),
|
|
646
|
+
}, CollapsedSubagentLineage));
|
|
647
|
+
// 0.2.1 的根会话计数入口位于 keyed list Slot;同样用更低优先级
|
|
648
|
+
// shadow 原生 id,避免只覆盖子会话面包屑而漏掉用户实际点击的入口。
|
|
649
|
+
const disposeActionInjection = slots.inject('conversation.session.header.actions', () => slots.register({
|
|
650
|
+
name: 'conversation.session.header.actions',
|
|
651
|
+
id: 'subagent-catalog',
|
|
652
|
+
order: -30,
|
|
653
|
+
priority: -1,
|
|
654
|
+
locale: SUBAGENT_COLLAPSED_LOCALE_NS,
|
|
655
|
+
inject: () => ({
|
|
656
|
+
openChild: (address) => { sessions.openChild(address); },
|
|
657
|
+
openChildAside: sessions.openChildAside === undefined ? undefined : (address) => { sessions.openChildAside(address); },
|
|
658
|
+
refresh: (sessionId) => { void sessions.refresh(sessionId); },
|
|
659
|
+
setCatalogOpen: (sessionId, open) => { sessions.setSubagentCatalogOpen(sessionId, open); },
|
|
660
|
+
}),
|
|
661
|
+
}, CollapsedSubagentCatalogAction));
|
|
662
|
+
return () => { disposeActionInjection(); disposeInjection(); disposeLocale(); };
|
|
663
|
+
}
|
|
664
|
+
//# sourceMappingURL=subagent-collapsed-lineage.js.map
|