@jingyi0605/codingns4dsh 0.2.1-beta.5 → 0.2.1-beta.6
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 +112 -161
- package/README.md +106 -263
- package/assets/provider-icons/doubao.png +0 -0
- package/data/build/dist/client/avatar/catalog-panel.d.ts +1 -1
- package/data/build/dist/client/avatar/catalog-panel.d.ts.map +1 -1
- package/data/build/dist/client/avatar/catalog-panel.js +13 -11
- package/data/build/dist/client/avatar/catalog-panel.js.map +1 -1
- package/data/build/dist/client/avatar/engine.d.ts.map +1 -1
- package/data/build/dist/client/avatar/engine.js +26 -7
- package/data/build/dist/client/avatar/engine.js.map +1 -1
- package/data/build/dist/client/avatar/manager.d.ts.map +1 -1
- package/data/build/dist/client/avatar/manager.js +5 -1
- package/data/build/dist/client/avatar/manager.js.map +1 -1
- package/data/build/dist/client/avatar/slot.d.ts.map +1 -1
- package/data/build/dist/client/avatar/slot.js +4 -1
- package/data/build/dist/client/avatar/slot.js.map +1 -1
- package/data/build/dist/client/bundle.js +49155 -99509
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-catalog.d.ts +2 -0
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
- package/data/build/dist/client/cli-catalog.js +8 -0
- package/data/build/dist/client/cli-catalog.js.map +1 -1
- package/data/build/dist/client/cli-slots.js +2 -2
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.assistant-configuration-view.js +4526 -0
- package/data/build/dist/client/client.assistant-configuration-view.js.map +1 -0
- package/data/build/dist/client/client.assistant-debug-workbench.js +764 -0
- package/data/build/dist/client/client.assistant-debug-workbench.js.map +1 -0
- package/data/build/dist/client/client.assistant-prompt-editor.js +76 -0
- package/data/build/dist/client/client.assistant-prompt-editor.js.map +1 -0
- package/data/build/dist/client/client.assistant-prompts.js +44 -0
- package/data/build/dist/client/client.assistant-prompts.js.map +1 -0
- package/data/build/dist/client/client.assistant-voice-sessions.js +144 -0
- package/data/build/dist/client/client.assistant-voice-sessions.js.map +1 -0
- package/data/build/dist/client/client.assistant-workbench.js +2929 -0
- package/data/build/dist/client/client.assistant-workbench.js.map +1 -0
- package/data/build/dist/client/client.delegate-command.js +1315 -0
- package/data/build/dist/client/client.delegate-command.js.map +1 -0
- package/data/build/dist/client/client.editor-engine.js +32486 -0
- package/data/build/dist/client/client.editor-engine.js.map +1 -0
- package/data/build/dist/client/client.manager.js +3454 -0
- package/data/build/dist/client/client.manager.js.map +1 -0
- package/data/build/dist/client/client.model-catalog-cache.js +543 -0
- package/data/build/dist/client/client.model-catalog-cache.js.map +1 -0
- package/data/build/dist/client/client.native-workspace-store.js +689 -0
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -0
- package/data/build/dist/client/client.primitives-adapter.js +333 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -0
- package/data/build/dist/client/client.react-dom.js +7286 -0
- package/data/build/dist/client/client.react-dom.js.map +1 -0
- package/data/build/dist/client/client.rolldown-runtime.js +59 -0
- package/data/build/dist/client/client.theme.js +386 -0
- package/data/build/dist/client/client.theme.js.map +1 -0
- package/data/build/dist/client/client.transport.js +3323 -0
- package/data/build/dist/client/client.transport.js.map +1 -0
- package/data/build/dist/client/client.xterm-engine.js +13064 -0
- package/data/build/dist/client/client.xterm-engine.js.map +1 -0
- package/data/build/dist/client/editor-engine.d.ts +4 -0
- package/data/build/dist/client/editor-engine.d.ts.map +1 -0
- package/data/build/dist/client/editor-engine.js +50 -0
- package/data/build/dist/client/editor-engine.js.map +1 -0
- package/data/build/dist/client/engine-loader.d.ts +5 -0
- package/data/build/dist/client/engine-loader.d.ts.map +1 -0
- package/data/build/dist/client/engine-loader.js +35 -0
- package/data/build/dist/client/engine-loader.js.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-loader.d.ts +14 -0
- package/data/build/dist/client/features/assistant-configuration-loader.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-loader.js +13 -0
- package/data/build/dist/client/features/assistant-configuration-loader.js.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-session.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-session.js +13 -4
- package/data/build/dist/client/features/assistant-configuration-session.js.map +1 -1
- package/data/build/dist/client/features/assistant-configuration-view.d.ts +66 -0
- package/data/build/dist/client/features/assistant-configuration-view.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-configuration-view.js +133 -0
- package/data/build/dist/client/features/assistant-configuration-view.js.map +1 -0
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts +4 -11
- package/data/build/dist/client/features/assistant-debug-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-debug-workbench.js +41 -68
- package/data/build/dist/client/features/assistant-debug-workbench.js.map +1 -1
- package/data/build/dist/client/features/assistant-display-store.d.ts +57 -0
- package/data/build/dist/client/features/assistant-display-store.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-display-store.js +189 -0
- package/data/build/dist/client/features/assistant-display-store.js.map +1 -0
- package/data/build/dist/client/features/assistant-prompt-editor.d.ts +12 -0
- package/data/build/dist/client/features/assistant-prompt-editor.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-prompt-editor.js +14 -0
- package/data/build/dist/client/features/assistant-prompt-editor.js.map +1 -0
- package/data/build/dist/client/features/assistant-view-loader.d.ts +17 -0
- package/data/build/dist/client/features/assistant-view-loader.d.ts.map +1 -0
- package/data/build/dist/client/features/assistant-view-loader.js +49 -0
- package/data/build/dist/client/features/assistant-view-loader.js.map +1 -0
- package/data/build/dist/client/features/assistant-workbench.d.ts +1 -60
- package/data/build/dist/client/features/assistant-workbench.d.ts.map +1 -1
- package/data/build/dist/client/features/assistant-workbench.js +41 -169
- package/data/build/dist/client/features/assistant-workbench.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +3 -7
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.d.ts.map +1 -1
- package/data/build/dist/client/features/global-voice-assistant.js +21 -20
- package/data/build/dist/client/features/global-voice-assistant.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +14 -25
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts +3 -1
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +85 -79
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/locales/assistantAvatar.d.ts +1 -1
- package/data/build/dist/client/locales/assistantAvatar.js +2 -2
- package/data/build/dist/client/locales/assistantAvatar.js.map +1 -1
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/fileWorkspace.js +2 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
- package/data/build/dist/client/peer-host-management-api.d.ts +2 -2
- package/data/build/dist/client/peer-host-management-api.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-management-api.js +8 -5
- package/data/build/dist/client/peer-host-management-api.js.map +1 -1
- package/data/build/dist/client/provider-icon-assets.js +5 -39
- package/data/build/dist/client/provider-icon-assets.js.map +1 -1
- package/data/build/dist/client/provider-icon-bridge.d.ts +6 -0
- package/data/build/dist/client/provider-icon-bridge.d.ts.map +1 -0
- package/data/build/dist/client/provider-icon-bridge.js +65 -0
- package/data/build/dist/client/provider-icon-bridge.js.map +1 -0
- package/data/build/dist/client/provider-icons.d.ts +1 -0
- 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/remote-web-context.d.ts +2 -0
- package/data/build/dist/client/remote-web-context.d.ts.map +1 -1
- package/data/build/dist/client/remote-web-context.js +50 -2
- package/data/build/dist/client/remote-web-context.js.map +1 -1
- package/data/build/dist/client/serial-polling.d.ts +3 -1
- package/data/build/dist/client/serial-polling.d.ts.map +1 -1
- package/data/build/dist/client/serial-polling.js +10 -3
- package/data/build/dist/client/serial-polling.js.map +1 -1
- package/data/build/dist/client/settings-section.js +8 -2
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/terminal/xterm-engine.d.ts +4 -0
- package/data/build/dist/client/terminal/xterm-engine.d.ts.map +1 -0
- package/data/build/dist/client/terminal/xterm-engine.js +5 -0
- package/data/build/dist/client/terminal/xterm-engine.js.map +1 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.js +33 -25
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
- package/data/build/dist/host/avatar/temporary-previews.d.ts +3 -1
- package/data/build/dist/host/avatar/temporary-previews.d.ts.map +1 -1
- package/data/build/dist/host/avatar/temporary-previews.js +7 -2
- package/data/build/dist/host/avatar/temporary-previews.js.map +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js +71 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +4 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.js +2 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/claude-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-process.js +59 -0
- package/data/build/dist/host/cli-adapters/claude-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js +18 -5
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +0 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +6 -29
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts +27 -0
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js +110 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js +142 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js +34 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts +49 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js +177 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js +291 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js +126 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js +176 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js +139 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +3 -2
- package/data/build/dist/host/cli-adapters/driver.d.ts.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 +2 -0
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +3 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +2 -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 +10 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +1 -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 +9 -28
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +4 -2
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.js +64 -11
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/qoder-driver.js +13 -33
- package/data/build/dist/host/cli-adapters/qoder-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +31 -4
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +2 -11
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +1 -28
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +3 -3
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +12 -37
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts +12 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js +53 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js.map +1 -0
- package/data/build/dist/host/features/assistant-avatar-runtime.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-avatar-runtime.js +23 -14
- package/data/build/dist/host/features/assistant-avatar-runtime.js.map +1 -1
- package/data/build/dist/host/features/assistant-background.d.ts +44 -0
- package/data/build/dist/host/features/assistant-background.d.ts.map +1 -0
- package/data/build/dist/host/features/assistant-background.js +116 -0
- package/data/build/dist/host/features/assistant-background.js.map +1 -0
- package/data/build/dist/host/features/assistant-index-updates.d.ts +5 -0
- package/data/build/dist/host/features/assistant-index-updates.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-index-updates.js +29 -6
- package/data/build/dist/host/features/assistant-index-updates.js.map +1 -1
- package/data/build/dist/host/features/assistant-source-cache.d.ts +2 -2
- package/data/build/dist/host/features/assistant-source-cache.d.ts.map +1 -1
- package/data/build/dist/host/features/assistant-source-cache.js +4 -2
- package/data/build/dist/host/features/assistant-source-cache.js.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.d.ts.map +1 -1
- package/data/build/dist/host/features/global-voice-rpc.js +269 -110
- package/data/build/dist/host/features/global-voice-rpc.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 +61 -21
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +6 -4
- 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 +29 -19
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/provider-icon-assets.d.ts +5 -0
- package/data/build/dist/host/provider-icon-assets.d.ts.map +1 -0
- package/data/build/dist/host/provider-icon-assets.js +61 -0
- package/data/build/dist/host/provider-icon-assets.js.map +1 -0
- package/data/build/dist/host/rpc.js +1 -1
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/session-migration-repair.d.ts +4 -0
- package/data/build/dist/host/session-migration-repair.d.ts.map +1 -1
- package/data/build/dist/host/session-migration-repair.js +75 -2
- package/data/build/dist/host/session-migration-repair.js.map +1 -1
- package/data/build/dist/shared/assistant-avatar-engine.d.ts +2 -0
- package/data/build/dist/shared/assistant-avatar-engine.d.ts.map +1 -1
- package/data/build/dist/shared/assistant-avatar-engine.js +11 -1
- package/data/build/dist/shared/assistant-avatar-engine.js.map +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +3 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +1 -1
- package/data/build/dist/shared/contracts/version.js +1 -1
- package/data/build/dist/shared/provider-icon-resources.d.ts +4 -0
- package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -0
- package/data/build/dist/shared/provider-icon-resources.js +24 -0
- package/data/build/dist/shared/provider-icon-resources.js.map +1 -0
- package/package.json +2 -2
- package/profile/README.md +2 -2
- package/profile/package.json +2 -2
- package/profile/version.json +1 -1
- package/version.json +1 -1
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@jingyi0605/codingns4dsh",
|
|
3
|
+
chunk: "client.assistant-debug-workbench.js",
|
|
4
|
+
factory: (require) => {
|
|
5
|
+
var module = { exports: {} };
|
|
6
|
+
var exports = module.exports;
|
|
7
|
+
const require_native_workspace_store = require("@jingyi0605/codingns4dsh/client.native-workspace-store.js");
|
|
8
|
+
const require_transport = require("@jingyi0605/codingns4dsh/client.transport.js");
|
|
9
|
+
const require_assistant_prompts = require("@jingyi0605/codingns4dsh/client.assistant-prompts.js");
|
|
10
|
+
const require_theme = require("@jingyi0605/codingns4dsh/client.theme.js");
|
|
11
|
+
const require_assistant_prompt_editor = require("@jingyi0605/codingns4dsh/client.assistant-prompt-editor.js");
|
|
12
|
+
const require_assistant_workbench = require("@jingyi0605/codingns4dsh/client.assistant-workbench.js");
|
|
13
|
+
let react = require("react");
|
|
14
|
+
//#region src/client/features/assistant-debug-workbench.ts
|
|
15
|
+
const TABS = [
|
|
16
|
+
"scope",
|
|
17
|
+
"sessions",
|
|
18
|
+
"result",
|
|
19
|
+
"records",
|
|
20
|
+
"chat"
|
|
21
|
+
];
|
|
22
|
+
/** 五个步骤各自处理范围、成员、结果、运行记录和 LLM 问答,不依赖语音。 */
|
|
23
|
+
function AssistantDebugDialog({ services, displayRpc = services.rpc, onClose }) {
|
|
24
|
+
const t = require_transport.useCodingNsTranslator(services.locale);
|
|
25
|
+
const [tab, setTab] = (0, react.useState)("scope");
|
|
26
|
+
const [snapshot, setSnapshot] = (0, react.useState)();
|
|
27
|
+
const [settings, setSettings] = (0, react.useState)(() => services.settings.getSnapshot());
|
|
28
|
+
const [nativeWorkspaces, setNativeWorkspaces] = (0, react.useState)([]);
|
|
29
|
+
const [loading, setLoading] = (0, react.useState)(false);
|
|
30
|
+
const [indexing, setIndexing] = (0, react.useState)(false);
|
|
31
|
+
const [saving, setSaving] = (0, react.useState)(false);
|
|
32
|
+
const [error, setError] = (0, react.useState)();
|
|
33
|
+
const [catalog, setCatalog] = (0, react.useState)();
|
|
34
|
+
const [modelsLoading, setModelsLoading] = (0, react.useState)(false);
|
|
35
|
+
const [modelKey, setModelKey] = (0, react.useState)("");
|
|
36
|
+
const [text, setText] = (0, react.useState)("");
|
|
37
|
+
const [submitted, setSubmitted] = (0, react.useState)("");
|
|
38
|
+
const [history, setHistory] = (0, react.useState)([]);
|
|
39
|
+
const [run, setRun] = (0, react.useState)();
|
|
40
|
+
const [starting, setStarting] = (0, react.useState)(false);
|
|
41
|
+
const mounted = (0, react.useRef)(true);
|
|
42
|
+
const request = (0, react.useRef)();
|
|
43
|
+
const activeChatId = (0, react.useRef)();
|
|
44
|
+
const chatting = starting || run?.state === "running";
|
|
45
|
+
const summarizing = snapshot?.index.analysis?.state === "running";
|
|
46
|
+
const busy = loading || saving || indexing || chatting || summarizing;
|
|
47
|
+
const managedIds = settings.value?.assistant.managedWorkspaceIds ?? [];
|
|
48
|
+
const scopeKey = require_assistant_workbench.assistantDisplayScope(managedIds);
|
|
49
|
+
const display = (0, react.useMemo)(() => require_assistant_workbench.getAssistantDisplayStore(displayRpc, scopeKey), [displayRpc, scopeKey]);
|
|
50
|
+
const workspaces = mergeDebugWorkspaces(snapshot, nativeWorkspaces, managedIds);
|
|
51
|
+
const prompts = require_assistant_prompts.readAssistantPrompts(settings.value?.assistant.prompts);
|
|
52
|
+
const call = (0, react.useCallback)(async (action, payload = {}, signal) => {
|
|
53
|
+
const response = await services.rpc.call(require_transport.CODINGNS_RPC_CHANNEL, action, payload, signal);
|
|
54
|
+
if (!response.ok) throw new Error(response.error.message);
|
|
55
|
+
return response.value;
|
|
56
|
+
}, [services]);
|
|
57
|
+
const refresh = (0, react.useCallback)(async (rebuild = false, model) => {
|
|
58
|
+
request.current?.abort();
|
|
59
|
+
const abort = new AbortController();
|
|
60
|
+
request.current = abort;
|
|
61
|
+
setLoading(true);
|
|
62
|
+
setIndexing(rebuild);
|
|
63
|
+
setError(void 0);
|
|
64
|
+
try {
|
|
65
|
+
if (rebuild) await call("assistant/index/rebuild", model ?? {}, abort.signal);
|
|
66
|
+
abort.signal.throwIfAborted();
|
|
67
|
+
const next = await display.debug.refresh({
|
|
68
|
+
force: true,
|
|
69
|
+
afterPending: true
|
|
70
|
+
});
|
|
71
|
+
if (!abort.signal.aborted && mounted.current && next) setSnapshot(next);
|
|
72
|
+
} catch (cause) {
|
|
73
|
+
if (!abort.signal.aborted && mounted.current) setError(errorMessage(cause));
|
|
74
|
+
} finally {
|
|
75
|
+
if (!abort.signal.aborted && mounted.current) {
|
|
76
|
+
setLoading(false);
|
|
77
|
+
setIndexing(false);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [call, display]);
|
|
81
|
+
const loadModels = (0, react.useCallback)(async () => {
|
|
82
|
+
setModelsLoading(true);
|
|
83
|
+
try {
|
|
84
|
+
const next = await call("assistant/chat/models");
|
|
85
|
+
if (!mounted.current) return;
|
|
86
|
+
setCatalog(next);
|
|
87
|
+
setModelKey((current) => next.models.some((model) => selectionKey(model) === current) ? current : next.default === null ? "" : selectionKey(next.default));
|
|
88
|
+
} catch (cause) {
|
|
89
|
+
if (mounted.current) setCatalog({
|
|
90
|
+
models: [],
|
|
91
|
+
default: null,
|
|
92
|
+
errors: [errorMessage(cause)]
|
|
93
|
+
});
|
|
94
|
+
} finally {
|
|
95
|
+
if (mounted.current) setModelsLoading(false);
|
|
96
|
+
}
|
|
97
|
+
}, [call]);
|
|
98
|
+
(0, react.useEffect)(() => {
|
|
99
|
+
mounted.current = true;
|
|
100
|
+
loadModels();
|
|
101
|
+
return () => {
|
|
102
|
+
mounted.current = false;
|
|
103
|
+
request.current?.abort();
|
|
104
|
+
if (activeChatId.current !== void 0) call("assistant/chat/cancel", { requestId: activeChatId.current }).catch(() => void 0);
|
|
105
|
+
};
|
|
106
|
+
}, [loadModels, call]);
|
|
107
|
+
(0, react.useEffect)(() => {
|
|
108
|
+
const model = catalog?.models.find((item) => selectionKey(item) === modelKey);
|
|
109
|
+
if (model === void 0) return;
|
|
110
|
+
call("assistant/index/configure", {
|
|
111
|
+
provider: model.provider,
|
|
112
|
+
model: model.model
|
|
113
|
+
}).catch((cause) => {
|
|
114
|
+
if (mounted.current) setError(errorMessage(cause));
|
|
115
|
+
});
|
|
116
|
+
}, [
|
|
117
|
+
modelKey,
|
|
118
|
+
catalog,
|
|
119
|
+
call
|
|
120
|
+
]);
|
|
121
|
+
(0, react.useEffect)(() => {
|
|
122
|
+
const refreshSettings = () => setSettings(services.settings.getSnapshot());
|
|
123
|
+
const refreshWorkspaces = () => setNativeWorkspaces(require_native_workspace_store.readNativeWorkspaceSnapshot(services.uiContext)?.items ?? []);
|
|
124
|
+
refreshSettings();
|
|
125
|
+
refreshWorkspaces();
|
|
126
|
+
const disposeSettings = services.settings.subscribe(refreshSettings);
|
|
127
|
+
const disposeWorkspaces = require_native_workspace_store.readNativeWorkspaceListStore(services.uiContext)?.subscribe(refreshWorkspaces);
|
|
128
|
+
return () => {
|
|
129
|
+
disposeSettings();
|
|
130
|
+
disposeWorkspaces?.();
|
|
131
|
+
};
|
|
132
|
+
}, [services]);
|
|
133
|
+
(0, react.useEffect)(() => {
|
|
134
|
+
if (activeChatId.current !== void 0) call("assistant/chat/cancel", { requestId: activeChatId.current }).catch(() => void 0);
|
|
135
|
+
activeChatId.current = void 0;
|
|
136
|
+
setHistory([]);
|
|
137
|
+
setRun(void 0);
|
|
138
|
+
setSubmitted("");
|
|
139
|
+
}, [
|
|
140
|
+
scopeKey,
|
|
141
|
+
snapshot?.index.generation,
|
|
142
|
+
modelKey,
|
|
143
|
+
prompts.chat,
|
|
144
|
+
call
|
|
145
|
+
]);
|
|
146
|
+
(0, react.useEffect)(() => {
|
|
147
|
+
const changed = () => {
|
|
148
|
+
const next = display.debug.getSnapshot();
|
|
149
|
+
if (next.value) setSnapshot(next.value);
|
|
150
|
+
if (next.error) setError(errorMessage(next.error));
|
|
151
|
+
};
|
|
152
|
+
changed();
|
|
153
|
+
return display.debug.subscribe(changed);
|
|
154
|
+
}, [display]);
|
|
155
|
+
(0, react.useEffect)(() => {
|
|
156
|
+
const onEscape = (event) => {
|
|
157
|
+
if (event.key === "Escape") {
|
|
158
|
+
event.stopImmediatePropagation();
|
|
159
|
+
onClose();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
document.addEventListener("keydown", onEscape);
|
|
163
|
+
return () => document.removeEventListener("keydown", onEscape);
|
|
164
|
+
}, [onClose]);
|
|
165
|
+
(0, react.useEffect)(() => {
|
|
166
|
+
if (run?.state !== "running") return;
|
|
167
|
+
const id = run.requestId;
|
|
168
|
+
const resource = display.chat(id);
|
|
169
|
+
const changed = () => {
|
|
170
|
+
const snapshot = resource.getSnapshot();
|
|
171
|
+
if (snapshot.error) {
|
|
172
|
+
setError(errorMessage(snapshot.error));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const next = snapshot.value;
|
|
176
|
+
if (!next || activeChatId.current !== id) return;
|
|
177
|
+
setRun(next);
|
|
178
|
+
if (next.state === "completed") {
|
|
179
|
+
setHistory((previous) => [
|
|
180
|
+
...previous,
|
|
181
|
+
{
|
|
182
|
+
role: "user",
|
|
183
|
+
text: submitted
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
role: "assistant",
|
|
187
|
+
text: next.text
|
|
188
|
+
}
|
|
189
|
+
]);
|
|
190
|
+
setSubmitted("");
|
|
191
|
+
}
|
|
192
|
+
if (next.state !== "running") activeChatId.current = void 0;
|
|
193
|
+
};
|
|
194
|
+
changed();
|
|
195
|
+
return resource.subscribe(changed);
|
|
196
|
+
}, [
|
|
197
|
+
run?.requestId,
|
|
198
|
+
run?.state,
|
|
199
|
+
submitted,
|
|
200
|
+
display
|
|
201
|
+
]);
|
|
202
|
+
const updateScope = async (workspaceId, checked) => {
|
|
203
|
+
const next = new Set(services.settings.getSnapshot().value?.assistant.managedWorkspaceIds ?? []);
|
|
204
|
+
if (checked) next.add(workspaceId);
|
|
205
|
+
else next.delete(workspaceId);
|
|
206
|
+
setSaving(true);
|
|
207
|
+
setError(void 0);
|
|
208
|
+
try {
|
|
209
|
+
if (!await services.settings.mutate([{
|
|
210
|
+
op: "set",
|
|
211
|
+
path: ["assistant", "managedWorkspaceIds"],
|
|
212
|
+
value: [...next]
|
|
213
|
+
}])) throw new Error(t("settings.moduleWriteRejected"));
|
|
214
|
+
if (mounted.current) await refresh();
|
|
215
|
+
} catch (cause) {
|
|
216
|
+
if (mounted.current) setError(errorMessage(cause));
|
|
217
|
+
} finally {
|
|
218
|
+
if (mounted.current) setSaving(false);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const send = async () => {
|
|
222
|
+
const model = catalog?.models.find((entry) => selectionKey(entry) === modelKey);
|
|
223
|
+
if (model === void 0 || snapshot === void 0 || chatting || text.trim() === "") return;
|
|
224
|
+
const prompt = text.trim();
|
|
225
|
+
const id = `assistant-chat-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random()}`}`;
|
|
226
|
+
activeChatId.current = id;
|
|
227
|
+
setStarting(true);
|
|
228
|
+
setError(void 0);
|
|
229
|
+
setSubmitted(prompt);
|
|
230
|
+
setRun(void 0);
|
|
231
|
+
try {
|
|
232
|
+
const next = await call("assistant/chat/start", {
|
|
233
|
+
requestId: id,
|
|
234
|
+
...model,
|
|
235
|
+
generation: snapshot.index.generation,
|
|
236
|
+
messages: [...history.slice(-18), {
|
|
237
|
+
role: "user",
|
|
238
|
+
text: prompt
|
|
239
|
+
}]
|
|
240
|
+
});
|
|
241
|
+
if (!mounted.current || activeChatId.current !== id) {
|
|
242
|
+
call("assistant/chat/cancel", { requestId: id }).catch(() => void 0);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
setRun(next);
|
|
246
|
+
setText("");
|
|
247
|
+
if (next.state === "completed") {
|
|
248
|
+
activeChatId.current = void 0;
|
|
249
|
+
setHistory((previous) => [
|
|
250
|
+
...previous,
|
|
251
|
+
{
|
|
252
|
+
role: "user",
|
|
253
|
+
text: prompt
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
role: "assistant",
|
|
257
|
+
text: next.text
|
|
258
|
+
}
|
|
259
|
+
]);
|
|
260
|
+
setSubmitted("");
|
|
261
|
+
}
|
|
262
|
+
} catch (cause) {
|
|
263
|
+
if (mounted.current) {
|
|
264
|
+
setError(errorMessage(cause));
|
|
265
|
+
setSubmitted("");
|
|
266
|
+
activeChatId.current = void 0;
|
|
267
|
+
}
|
|
268
|
+
} finally {
|
|
269
|
+
if (mounted.current) setStarting(false);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
const stop = async () => {
|
|
273
|
+
if (activeChatId.current === void 0) return;
|
|
274
|
+
try {
|
|
275
|
+
const next = await call("assistant/chat/cancel", { requestId: activeChatId.current });
|
|
276
|
+
if (mounted.current) setRun(next);
|
|
277
|
+
} catch (cause) {
|
|
278
|
+
if (mounted.current) setError(errorMessage(cause));
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const savePrompt = async (kind, value) => {
|
|
282
|
+
setSaving(true);
|
|
283
|
+
setError(void 0);
|
|
284
|
+
try {
|
|
285
|
+
if (!await services.settings.mutate([{
|
|
286
|
+
op: "set",
|
|
287
|
+
path: [
|
|
288
|
+
"assistant",
|
|
289
|
+
"prompts",
|
|
290
|
+
kind
|
|
291
|
+
],
|
|
292
|
+
value
|
|
293
|
+
}])) throw new Error(t("settings.moduleWriteRejected"));
|
|
294
|
+
await refresh();
|
|
295
|
+
} catch (cause) {
|
|
296
|
+
if (mounted.current) setError(errorMessage(cause));
|
|
297
|
+
throw cause;
|
|
298
|
+
} finally {
|
|
299
|
+
if (mounted.current) setSaving(false);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const stopIndex = async () => {
|
|
303
|
+
const id = snapshot?.index.analysis?.requestId;
|
|
304
|
+
if (id === void 0) return;
|
|
305
|
+
try {
|
|
306
|
+
await call("assistant/index/cancel", { requestId: id });
|
|
307
|
+
await refresh();
|
|
308
|
+
} catch (cause) {
|
|
309
|
+
if (mounted.current) setError(errorMessage(cause));
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const button = (label, action, disabled = busy, primary = false) => (0, react.createElement)("button", {
|
|
313
|
+
type: "button",
|
|
314
|
+
disabled,
|
|
315
|
+
onClick: action,
|
|
316
|
+
style: primary ? require_theme.dshSettingsPrimaryButtonStyle : require_theme.dshSettingsButtonStyle
|
|
317
|
+
}, t(label));
|
|
318
|
+
return (0, react.createElement)("div", {
|
|
319
|
+
role: "presentation",
|
|
320
|
+
onPointerDown: onClose,
|
|
321
|
+
style: {
|
|
322
|
+
position: "fixed",
|
|
323
|
+
inset: 0,
|
|
324
|
+
zIndex: 10010,
|
|
325
|
+
padding: 12,
|
|
326
|
+
display: "flex",
|
|
327
|
+
justifyContent: "center",
|
|
328
|
+
alignItems: "center",
|
|
329
|
+
background: require_theme.dshThemeColor.overlay,
|
|
330
|
+
boxSizing: "border-box"
|
|
331
|
+
}
|
|
332
|
+
}, (0, react.createElement)("div", {
|
|
333
|
+
role: "dialog",
|
|
334
|
+
"aria-modal": true,
|
|
335
|
+
"aria-label": t("assistant.debug.title"),
|
|
336
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
337
|
+
style: {
|
|
338
|
+
display: "flex",
|
|
339
|
+
flexDirection: "column",
|
|
340
|
+
gap: 16,
|
|
341
|
+
width: "min(960px, 100%)",
|
|
342
|
+
maxHeight: "calc(100dvh - 24px)",
|
|
343
|
+
overflowY: "auto",
|
|
344
|
+
padding: 11,
|
|
345
|
+
borderRadius: 12,
|
|
346
|
+
border: `1px solid ${require_theme.dshThemeColor.border}`,
|
|
347
|
+
color: require_theme.dshThemeColor.labelPrimary,
|
|
348
|
+
background: require_theme.dshThemeColor.menuBackground,
|
|
349
|
+
boxSizing: "border-box"
|
|
350
|
+
}
|
|
351
|
+
}, (0, react.createElement)("strong", { style: { fontSize: 18 } }, t("assistant.debug.title")), (0, react.createElement)("p", { style: {
|
|
352
|
+
...require_theme.dshSettingsHelpStyle,
|
|
353
|
+
margin: 0
|
|
354
|
+
} }, t("assistant.debug.stepsDescription")), (0, react.createElement)("div", { style: actionsStyle }, button("assistant.debug.viewRefresh", () => {
|
|
355
|
+
refresh();
|
|
356
|
+
}), button("assistant.debug.modelsRefresh", () => {
|
|
357
|
+
loadModels();
|
|
358
|
+
}, busy || modelsLoading), button(summarizing ? "assistant.debug.summarizing" : indexing ? "assistant.debug.indexing" : "assistant.debug.build", () => {
|
|
359
|
+
setTab("result");
|
|
360
|
+
refresh(true, catalog?.models.find((model) => selectionKey(model) === modelKey));
|
|
361
|
+
}, busy || managedIds.length === 0 || modelKey === "", true), !summarizing ? null : button("assistant.debug.analysisStop", () => {
|
|
362
|
+
stopIndex();
|
|
363
|
+
}, false), button("assistant.debug.export", () => {
|
|
364
|
+
if (snapshot !== void 0) downloadSnapshot(snapshot);
|
|
365
|
+
}, busy || snapshot === void 0), button("assistant.debug.close", onClose, false)), (0, react.createElement)("label", { style: {
|
|
366
|
+
display: "grid",
|
|
367
|
+
gap: 8
|
|
368
|
+
} }, t("assistant.debug.sharedModel"), (0, react.createElement)("select", {
|
|
369
|
+
"aria-label": t("assistant.debug.sharedModel"),
|
|
370
|
+
value: modelKey,
|
|
371
|
+
disabled: busy || catalog === void 0,
|
|
372
|
+
onChange: (event) => setModelKey(event.currentTarget.value),
|
|
373
|
+
style: {
|
|
374
|
+
...require_theme.dshFieldStyle,
|
|
375
|
+
width: "100%",
|
|
376
|
+
padding: 8
|
|
377
|
+
}
|
|
378
|
+
}, (0, react.createElement)("option", {
|
|
379
|
+
value: "",
|
|
380
|
+
disabled: true
|
|
381
|
+
}, t(catalog === void 0 ? "assistant.debug.modelsLoading" : "assistant.debug.chooseModel")), ...catalog?.models.map((model) => (0, react.createElement)("option", {
|
|
382
|
+
key: selectionKey(model),
|
|
383
|
+
value: selectionKey(model)
|
|
384
|
+
}, model.label)) ?? [])), ...catalog?.errors.map((message, index) => (0, react.createElement)("span", {
|
|
385
|
+
key: index,
|
|
386
|
+
role: "alert"
|
|
387
|
+
}, message)) ?? [], catalog?.models.length === 0 ? (0, react.createElement)("span", { role: "status" }, t("assistant.debug.modelsEmpty")) : null, (0, react.createElement)("div", {
|
|
388
|
+
role: "tablist",
|
|
389
|
+
"aria-label": t("assistant.debug.steps"),
|
|
390
|
+
style: actionsStyle
|
|
391
|
+
}, ...TABS.map((item) => (0, react.createElement)("button", {
|
|
392
|
+
key: item,
|
|
393
|
+
id: `assistant-debug-tab-${item}`,
|
|
394
|
+
type: "button",
|
|
395
|
+
role: "tab",
|
|
396
|
+
"aria-selected": tab === item,
|
|
397
|
+
"aria-controls": `assistant-debug-panel-${item}`,
|
|
398
|
+
onClick: () => setTab(item),
|
|
399
|
+
style: tab === item ? require_theme.dshSettingsPrimaryButtonStyle : require_theme.dshSettingsButtonStyle
|
|
400
|
+
}, t(`assistant.debug.tab.${item}`)))), loading || saving || snapshot === void 0 && error === void 0 ? (0, react.createElement)("div", {
|
|
401
|
+
role: "status",
|
|
402
|
+
style: require_theme.dshSettingsHelpStyle
|
|
403
|
+
}, t(indexing ? "assistant.debug.indexing" : "assistant.debug.loading")) : null, error === void 0 ? null : (0, react.createElement)("div", {
|
|
404
|
+
role: "alert",
|
|
405
|
+
style: {
|
|
406
|
+
color: require_theme.dshThemeColor.error,
|
|
407
|
+
overflowWrap: "anywhere"
|
|
408
|
+
}
|
|
409
|
+
}, error), (0, react.createElement)("div", {
|
|
410
|
+
role: "tabpanel",
|
|
411
|
+
id: `assistant-debug-panel-${tab}`,
|
|
412
|
+
"aria-labelledby": `assistant-debug-tab-${tab}`,
|
|
413
|
+
style: {
|
|
414
|
+
display: "grid",
|
|
415
|
+
gap: 14,
|
|
416
|
+
minWidth: 0
|
|
417
|
+
}
|
|
418
|
+
}, tab !== "scope" ? null : (0, react.createElement)("section", { style: sectionStyle }, (0, react.createElement)("strong", null, t("assistant.debug.tab.scope")), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.rangeHelp")), (0, react.createElement)("span", null, t("assistant.debug.selectedCount", { count: managedIds.length })), ...workspaces.map((workspace) => (0, react.createElement)("label", {
|
|
419
|
+
key: workspace.workspaceId,
|
|
420
|
+
style: {
|
|
421
|
+
display: "flex",
|
|
422
|
+
alignItems: "center",
|
|
423
|
+
gap: 12
|
|
424
|
+
}
|
|
425
|
+
}, (0, react.createElement)("input", {
|
|
426
|
+
type: "checkbox",
|
|
427
|
+
"aria-label": workspace.title,
|
|
428
|
+
checked: managedIds.includes(workspace.workspaceId),
|
|
429
|
+
disabled: busy || !settings.writable || settings.status === "loading",
|
|
430
|
+
onChange: (event) => {
|
|
431
|
+
updateScope(workspace.workspaceId, event.currentTarget.checked);
|
|
432
|
+
}
|
|
433
|
+
}), (0, react.createElement)("span", { style: {
|
|
434
|
+
display: "grid",
|
|
435
|
+
gap: 3,
|
|
436
|
+
minWidth: 0,
|
|
437
|
+
overflowWrap: "anywhere"
|
|
438
|
+
} }, (0, react.createElement)("strong", null, workspace.title), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, workspace.path ?? workspace.workspaceId), workspace.available ? null : (0, react.createElement)("span", null, t("assistant.debug.missingWorkspace"))))), workspaces.length === 0 ? (0, react.createElement)("span", null, t("assistant.noWorkspaces")) : null), tab !== "sessions" || snapshot === void 0 ? null : (0, react.createElement)(AssistantScopeSessionsView, {
|
|
439
|
+
snapshot,
|
|
440
|
+
managedIds,
|
|
441
|
+
t
|
|
442
|
+
}), tab !== "result" ? null : (0, react.createElement)(require_assistant_prompt_editor.AssistantPromptEditor, {
|
|
443
|
+
kind: "index",
|
|
444
|
+
value: prompts.index,
|
|
445
|
+
disabled: busy || !settings.writable || settings.status !== "ready",
|
|
446
|
+
onSave: savePrompt,
|
|
447
|
+
t
|
|
448
|
+
}), tab !== "result" || snapshot === void 0 ? null : (0, react.createElement)(AssistantDebugSnapshotView, {
|
|
449
|
+
snapshot,
|
|
450
|
+
t
|
|
451
|
+
}), tab !== "records" || snapshot === void 0 ? null : (0, react.createElement)(AssistantIndexRecordsView, {
|
|
452
|
+
snapshot,
|
|
453
|
+
t
|
|
454
|
+
}), tab !== "chat" ? null : (0, react.createElement)("section", { style: sectionStyle }, (0, react.createElement)(require_assistant_prompt_editor.AssistantPromptEditor, {
|
|
455
|
+
kind: "chat",
|
|
456
|
+
value: prompts.chat,
|
|
457
|
+
disabled: busy || !settings.writable || settings.status !== "ready",
|
|
458
|
+
onSave: savePrompt,
|
|
459
|
+
t
|
|
460
|
+
}), (0, react.createElement)("strong", null, t("assistant.debug.tab.chat")), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.chatHelp")), snapshot?.indexState !== "ready" ? (0, react.createElement)("span", { role: "status" }, t("assistant.debug.chatNeedsIndex")) : (0, react.createElement)("span", null, t("assistant.debug.chatGeneration", { generation: snapshot.index.generation })), (0, react.createElement)("div", { style: actionsStyle }, button("assistant.debug.chatClear", () => {
|
|
461
|
+
setHistory([]);
|
|
462
|
+
setRun(void 0);
|
|
463
|
+
setSubmitted("");
|
|
464
|
+
}, chatting)), (0, react.createElement)(AssistantChatMessagesView, {
|
|
465
|
+
history,
|
|
466
|
+
submitted,
|
|
467
|
+
run,
|
|
468
|
+
t
|
|
469
|
+
}), (0, react.createElement)("textarea", {
|
|
470
|
+
"aria-label": t("assistant.debug.chatInput"),
|
|
471
|
+
placeholder: t("assistant.debug.chatPlaceholder"),
|
|
472
|
+
maxLength: 8e3,
|
|
473
|
+
value: text,
|
|
474
|
+
disabled: busy,
|
|
475
|
+
onChange: (event) => setText(event.currentTarget.value),
|
|
476
|
+
rows: 3,
|
|
477
|
+
style: {
|
|
478
|
+
...require_theme.dshFieldStyle,
|
|
479
|
+
width: "100%",
|
|
480
|
+
padding: 10,
|
|
481
|
+
boxSizing: "border-box",
|
|
482
|
+
resize: "vertical"
|
|
483
|
+
}
|
|
484
|
+
}), (0, react.createElement)("div", { style: actionsStyle }, button(chatting ? "assistant.debug.chatGenerating" : "assistant.debug.chatSend", () => {
|
|
485
|
+
send();
|
|
486
|
+
}, busy || modelsLoading || text.trim() === "" || modelKey === "" || snapshot?.indexState !== "ready", true), !chatting ? null : button("assistant.debug.chatStop", () => {
|
|
487
|
+
stop();
|
|
488
|
+
}, starting))))));
|
|
489
|
+
}
|
|
490
|
+
/** 范围成员与正文索引分开显示,空项目也必须出现在范围内。 */
|
|
491
|
+
function AssistantScopeSessionsView({ snapshot, managedIds, t }) {
|
|
492
|
+
const sessions = snapshot.scopeSessions;
|
|
493
|
+
return (0, react.createElement)("section", { style: sectionStyle }, (0, react.createElement)("strong", null, t("assistant.debug.tab.sessions")), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.sessionStateHelp")), managedIds.length === 0 ? (0, react.createElement)("span", null, t("assistant.debug.scopeEmpty")) : null, ...managedIds.map((id) => (0, react.createElement)("div", {
|
|
494
|
+
key: id,
|
|
495
|
+
style: {
|
|
496
|
+
display: "grid",
|
|
497
|
+
gap: 8
|
|
498
|
+
}
|
|
499
|
+
}, (0, react.createElement)("strong", null, t("assistant.debug.projectCount", {
|
|
500
|
+
name: snapshot.workspaces.find((workspace) => workspace.workspaceId === id)?.name ?? sessions.find((entry) => entry.workspaceId === id)?.workspaceName ?? id,
|
|
501
|
+
count: sessions.filter((entry) => entry.workspaceId === id).length
|
|
502
|
+
})), ...sessions.filter((entry) => entry.workspaceId === id).map((entry) => sessionCard(entry, t, false)), sessions.some((entry) => entry.workspaceId === id) ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.projectEmpty")))));
|
|
503
|
+
}
|
|
504
|
+
/** 结果只展示当前范围的索引及质量统计,底层接口和 JSON 收进折叠区。 */
|
|
505
|
+
function AssistantDebugSnapshotView({ snapshot, t }) {
|
|
506
|
+
const { index } = snapshot;
|
|
507
|
+
const unknown = index.entries.filter((entry) => entry.status === "unknown" || entry.status === void 0).length;
|
|
508
|
+
const read = index.entries.filter((entry) => entry.summary).length;
|
|
509
|
+
return (0, react.createElement)("section", { style: sectionStyle }, (0, react.createElement)("strong", null, t("assistant.debug.tab.result")), (0, react.createElement)("span", { role: "status" }, t(`assistant.debug.indexState.${snapshot.indexState}`)), snapshot.indexedAt === null ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.indexTime", {
|
|
510
|
+
time: new Date(snapshot.indexedAt).toLocaleString(),
|
|
511
|
+
generation: index.generation
|
|
512
|
+
})), snapshot.indexedAt === null ? null : (0, react.createElement)("span", null, t("assistant.debug.quality", {
|
|
513
|
+
total: index.entries.length,
|
|
514
|
+
read,
|
|
515
|
+
empty: index.entries.length - read - index.unreadableCount,
|
|
516
|
+
unknown,
|
|
517
|
+
failed: index.unreadableCount
|
|
518
|
+
})), ...snapshot.warnings.map((warning, number) => (0, react.createElement)("span", {
|
|
519
|
+
key: number,
|
|
520
|
+
role: "alert"
|
|
521
|
+
}, warning)), index.analysis === void 0 ? null : (0, react.createElement)("div", { style: cardStyle }, (0, react.createElement)("strong", null, t("assistant.debug.analysisTitle")), (0, react.createElement)("span", { role: "status" }, t(index.analysis.state === "completed" && index.analysis.tasks?.some((task) => task.state === "deferred") ? "assistant.debug.analysisDeferred" : `assistant.debug.analysisState.${index.analysis.state}`)), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.analysisModel", {
|
|
522
|
+
provider: index.analysis.provider,
|
|
523
|
+
model: index.analysis.model
|
|
524
|
+
})), index.analysis.tasks === void 0 ? null : indexTasksView(index.analysis.tasks, t), ...(index.analysis.tasks ?? []).filter((task) => task.text !== "").map((task) => (0, react.createElement)("details", { key: task.requestId }, (0, react.createElement)("summary", null, t("assistant.debug.taskRaw", { name: task.title ?? shortSessionTitle(task.sessionId, t) })), (0, react.createElement)("pre", { style: {
|
|
525
|
+
whiteSpace: "pre-wrap",
|
|
526
|
+
overflowWrap: "anywhere"
|
|
527
|
+
} }, task.text))), ...(index.analysis.result?.sessions ?? []).map((session) => structuredSessionCard(session, t)), index.analysis.result !== void 0 || index.analysis.text === "" ? null : (0, react.createElement)("details", null, (0, react.createElement)("summary", null, t("assistant.debug.modelRaw")), (0, react.createElement)("pre", { style: {
|
|
528
|
+
whiteSpace: "pre-wrap",
|
|
529
|
+
overflowWrap: "anywhere"
|
|
530
|
+
} }, index.analysis.text)), index.analysis.error === null ? null : (0, react.createElement)("span", { role: "alert" }, index.analysis.error)), snapshot.indexedAt === null || index.analysis !== void 0 ? null : (0, react.createElement)("div", { style: {
|
|
531
|
+
whiteSpace: "pre-wrap",
|
|
532
|
+
overflowWrap: "anywhere",
|
|
533
|
+
lineHeight: 1.6
|
|
534
|
+
} }, snapshot.summary.speechText), snapshot.indexedAt === null ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.rawEvidence")), snapshot.indexedAt === null ? null : (0, react.createElement)("div", { style: {
|
|
535
|
+
display: "grid",
|
|
536
|
+
gap: 8
|
|
537
|
+
} }, ...index.entries.map((entry) => sessionCard(entry, t, true))), (0, react.createElement)("details", { style: sectionStyle }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, t("assistant.debug.technical")), ...Object.entries(snapshot.services).map(([name, available]) => (0, react.createElement)("span", { key: name }, t("assistant.debug.serviceState", {
|
|
538
|
+
service: t(`assistant.debug.service.${name}`),
|
|
539
|
+
state: t(available ? "assistant.debug.available" : "assistant.debug.unavailable")
|
|
540
|
+
}))), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, t("assistant.debug.excludedCount", { count: index.excludedTargets?.length ?? 0 })), ...(index.excludedTargets ?? []).map((entry) => (0, react.createElement)("div", { key: `${entry.hostId}:${entry.sessionId}` }, t("assistant.debug.excludedRow", {
|
|
541
|
+
name: entry.title ?? shortSessionTitle(entry.sessionId, t),
|
|
542
|
+
workspace: entry.workspaceName,
|
|
543
|
+
reason: t(entry.archived ? "assistant.debug.archived" : "assistant.debug.outsideScope")
|
|
544
|
+
})))), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, t("assistant.debug.raw")), jsonView(snapshot))));
|
|
545
|
+
}
|
|
546
|
+
/** 逐项显示独立任务的进度与思考参数,历史记录复用相同展示。 */
|
|
547
|
+
function indexTasksView(tasks, t) {
|
|
548
|
+
const count = (state) => tasks.filter((task) => task.state === state).length;
|
|
549
|
+
return (0, react.createElement)("div", { style: cardStyle }, (0, react.createElement)("strong", null, t("assistant.debug.taskProgress", {
|
|
550
|
+
total: tasks.length,
|
|
551
|
+
completed: count("completed"),
|
|
552
|
+
queued: count("queued"),
|
|
553
|
+
running: count("running"),
|
|
554
|
+
failed: count("failed") + count("cancelled"),
|
|
555
|
+
deferred: count("deferred"),
|
|
556
|
+
reused: tasks.filter((task) => task.reused && task.state === "completed").length
|
|
557
|
+
})), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.taskHelp")), ...tasks.map((task) => (0, react.createElement)("div", {
|
|
558
|
+
key: task.requestId,
|
|
559
|
+
style: {
|
|
560
|
+
display: "grid",
|
|
561
|
+
gap: 3
|
|
562
|
+
}
|
|
563
|
+
}, (0, react.createElement)("span", null, t("assistant.debug.taskRow", {
|
|
564
|
+
workspace: task.workspaceName,
|
|
565
|
+
name: task.title ?? shortSessionTitle(task.sessionId, t),
|
|
566
|
+
state: t(`assistant.debug.taskState.${task.state}`)
|
|
567
|
+
})), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t(task.reused ? "assistant.debug.taskReused" : `assistant.debug.thinking.${task.thinking ?? "pending"}`)), task.attempt === void 0 ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t(task.reused ? "assistant.debug.taskPreviousAttempt" : "assistant.debug.taskAttempt", {
|
|
568
|
+
attempt: task.attempt,
|
|
569
|
+
max: task.maxAttempts ?? 1
|
|
570
|
+
})), task.nextRetryAt == null ? null : (0, react.createElement)("span", { role: "status" }, t("assistant.debug.taskRetryWait", {
|
|
571
|
+
attempt: (task.attempt ?? 0) + 1,
|
|
572
|
+
seconds: Math.max(0, Math.ceil((task.nextRetryAt - Date.now()) / 1e3))
|
|
573
|
+
})), task.error === null ? null : (0, react.createElement)("span", { role: "alert" }, task.error))));
|
|
574
|
+
}
|
|
575
|
+
/** 调试时逐会话检查事实、任务与证据;正式对话仍由 LLM 输出简短口语。 */
|
|
576
|
+
function structuredSessionCard(session, t) {
|
|
577
|
+
return (0, react.createElement)("article", {
|
|
578
|
+
key: JSON.stringify([session.hostId, session.sessionId]),
|
|
579
|
+
style: cardStyle
|
|
580
|
+
}, (0, react.createElement)("strong", null, `${session.workspaceName} / ${session.title ?? shortSessionTitle(session.sessionId, t)}`), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.sourceStatus", { status: t(`assistant.debug.status.${session.sourceStatus}`) })), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t(`assistant.debug.material.${session.material}`)), factSection("objective", session.objective === null ? [] : [session.objective], t), factSection("progress", session.progress, t), factSection("blockers", session.blockers, t), factSection("pendingTasks", session.pendingTasks, t), (0, react.createElement)("div", { style: {
|
|
581
|
+
display: "grid",
|
|
582
|
+
gap: 6
|
|
583
|
+
} }, (0, react.createElement)("strong", null, t("assistant.debug.field.nextActions")), session.nextActions.length === 0 ? (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.noEvidence")) : null, ...session.nextActions.map((action, index) => (0, react.createElement)("div", {
|
|
584
|
+
key: index,
|
|
585
|
+
style: cardStyle
|
|
586
|
+
}, (0, react.createElement)("span", null, t("assistant.debug.actionTitle", {
|
|
587
|
+
kind: t(`assistant.debug.actionKind.${action.kind}`),
|
|
588
|
+
priority: t(`assistant.debug.priority.${action.priority}`),
|
|
589
|
+
action: action.action
|
|
590
|
+
})), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.actionReason", { reason: action.reason })), evidenceView(action.evidence, t)))), (0, react.createElement)("div", { style: {
|
|
591
|
+
display: "grid",
|
|
592
|
+
gap: 6
|
|
593
|
+
} }, (0, react.createElement)("strong", null, t("assistant.debug.field.openQuestions")), session.openQuestions.length === 0 ? (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.noQuestions")) : null, ...session.openQuestions.map((question, index) => (0, react.createElement)("span", { key: index }, question))));
|
|
594
|
+
}
|
|
595
|
+
function factSection(name, facts, t) {
|
|
596
|
+
return (0, react.createElement)("div", { style: {
|
|
597
|
+
display: "grid",
|
|
598
|
+
gap: 6
|
|
599
|
+
} }, (0, react.createElement)("strong", null, t(`assistant.debug.field.${name}`)), facts.length === 0 ? (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.noEvidence")) : null, ...facts.map((fact, index) => (0, react.createElement)("div", { key: index }, (0, react.createElement)("span", null, fact.text), evidenceView(fact.evidence, t))));
|
|
600
|
+
}
|
|
601
|
+
function evidenceView(evidence, t) {
|
|
602
|
+
return (0, react.createElement)("details", null, (0, react.createElement)("summary", null, t("assistant.debug.evidence")), ...evidence.map((item, index) => (0, react.createElement)("blockquote", {
|
|
603
|
+
key: index,
|
|
604
|
+
style: {
|
|
605
|
+
margin: "4px 0",
|
|
606
|
+
whiteSpace: "pre-wrap"
|
|
607
|
+
}
|
|
608
|
+
}, t("assistant.debug.evidenceQuote", {
|
|
609
|
+
source: t(`assistant.debug.evidenceSource.${item.source}`),
|
|
610
|
+
quote: item.quote
|
|
611
|
+
}))));
|
|
612
|
+
}
|
|
613
|
+
function AssistantIndexRecordsView({ snapshot, t }) {
|
|
614
|
+
return (0, react.createElement)("section", { style: sectionStyle }, (0, react.createElement)("strong", null, t("assistant.debug.tab.records")), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.recordsHelp")), snapshot.records.length === 0 ? (0, react.createElement)("span", null, t("assistant.debug.noRecords")) : null, ...snapshot.records.map((record) => (0, react.createElement)("details", {
|
|
615
|
+
key: record.id,
|
|
616
|
+
style: cardStyle
|
|
617
|
+
}, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, t("assistant.debug.recordTitle", {
|
|
618
|
+
time: new Date(record.startedAt).toLocaleString(),
|
|
619
|
+
trigger: t(`assistant.debug.trigger.${record.trigger}`),
|
|
620
|
+
state: t(`assistant.debug.recordState.${record.state}`)
|
|
621
|
+
})), (0, react.createElement)("span", null, t("assistant.debug.recordStats", {
|
|
622
|
+
duration: record.durationMs ?? 0,
|
|
623
|
+
included: record.included,
|
|
624
|
+
excluded: record.excluded,
|
|
625
|
+
failed: record.unreadable
|
|
626
|
+
})), (0, react.createElement)("span", null, t("assistant.debug.recordScope", { names: record.workspaceIds.map((id) => snapshot.workspaces.find((item) => item.workspaceId === id)?.name ?? id).join(" / ") })), record.error === null ? null : (0, react.createElement)("span", { role: "alert" }, record.error), ...record.warnings.map((warning, index) => (0, react.createElement)("span", { key: index }, warning)), record.analysis === void 0 ? null : (0, react.createElement)("span", null, t("assistant.debug.analysisRecord", {
|
|
627
|
+
provider: record.analysis.provider,
|
|
628
|
+
model: record.analysis.model,
|
|
629
|
+
state: t(`assistant.debug.analysisState.${record.analysis.state}`),
|
|
630
|
+
duration: (record.analysis.finishedAt ?? snapshot.capturedAt) - record.analysis.startedAt
|
|
631
|
+
})), record.analysis?.error ? (0, react.createElement)("span", { role: "alert" }, record.analysis.error) : null, record.analysis?.tasks === void 0 ? null : indexTasksView(record.analysis.tasks, t), ...record.sessions.map((session) => (0, react.createElement)("div", { key: session.sessionId }, t("assistant.debug.recordSession", {
|
|
632
|
+
name: session.title ?? shortSessionTitle(session.sessionId, t),
|
|
633
|
+
workspace: session.workspaceName,
|
|
634
|
+
result: t(`assistant.debug.readResult.${session.result}`)
|
|
635
|
+
}), session.error === null ? null : (0, react.createElement)("span", { role: "alert" }, session.error))))));
|
|
636
|
+
}
|
|
637
|
+
function AssistantChatMessagesView({ history, submitted, run, t }) {
|
|
638
|
+
const pending = submitted === "" ? [] : [{
|
|
639
|
+
role: "user",
|
|
640
|
+
text: submitted
|
|
641
|
+
}, {
|
|
642
|
+
role: "assistant",
|
|
643
|
+
text: run?.text || t(run?.state === "failed" ? "assistant.debug.chatFailed" : run?.state === "cancelled" ? "assistant.debug.chatCancelled" : "assistant.debug.chatGenerating")
|
|
644
|
+
}];
|
|
645
|
+
return (0, react.createElement)("div", {
|
|
646
|
+
role: "log",
|
|
647
|
+
"aria-live": "polite",
|
|
648
|
+
style: {
|
|
649
|
+
display: "grid",
|
|
650
|
+
gap: 10,
|
|
651
|
+
maxHeight: 380,
|
|
652
|
+
overflowY: "auto",
|
|
653
|
+
minHeight: 100
|
|
654
|
+
}
|
|
655
|
+
}, history.length === 0 && submitted === "" ? (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.chatEmpty")) : null, ...[...history, ...pending].map((message, index) => (0, react.createElement)("div", {
|
|
656
|
+
key: index,
|
|
657
|
+
style: {
|
|
658
|
+
...cardStyle,
|
|
659
|
+
whiteSpace: "pre-wrap"
|
|
660
|
+
}
|
|
661
|
+
}, (0, react.createElement)("strong", null, t(`assistant.debug.chatRole.${message.role}`)), (0, react.createElement)("span", null, message.text))), run?.error ? (0, react.createElement)("span", { role: "alert" }, run.error) : null);
|
|
662
|
+
}
|
|
663
|
+
function sessionCard(entry, t, indexed) {
|
|
664
|
+
const indexState = entry.indexState === "waiting" ? entry.waiting !== null ? "waiting-user" : entry.activity === "unknown" ? "waiting-status" : "waiting" : entry.indexState;
|
|
665
|
+
return (0, react.createElement)("details", {
|
|
666
|
+
key: `${entry.hostId}:${entry.sessionId}`,
|
|
667
|
+
style: cardStyle
|
|
668
|
+
}, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, t("assistant.debug.sessionTitle", {
|
|
669
|
+
title: entry.title ?? shortSessionTitle(entry.sessionId, t),
|
|
670
|
+
status: t(`assistant.debug.status.${entry.status ?? "unknown"}`)
|
|
671
|
+
}), indexState === void 0 ? null : (0, react.createElement)("span", { style: {
|
|
672
|
+
marginLeft: 12,
|
|
673
|
+
...require_theme.dshSettingsHelpStyle
|
|
674
|
+
} }, t(`assistant.debug.sessionIndex.${indexState}`))), entry.sourceVersion === void 0 ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t(indexed ? "assistant.debug.sessionMaterialVersion" : "assistant.debug.sessionVersion", {
|
|
675
|
+
source: entry.sourceVersion,
|
|
676
|
+
indexed: entry.indexedVersion ?? 0
|
|
677
|
+
})), entry.waiting === null ? null : (0, react.createElement)("span", null, t(`assistant.debug.waiting.${entry.waiting}`)), (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, `${entry.hostId} / ${entry.sessionId}`), entry.updatedAt === null ? null : (0, react.createElement)("span", { style: require_theme.dshSettingsHelpStyle }, t("assistant.debug.updated", { time: new Date(entry.updatedAt).toLocaleString() })), !indexed ? null : (0, react.createElement)("span", { style: {
|
|
678
|
+
whiteSpace: "pre-wrap",
|
|
679
|
+
lineHeight: 1.6
|
|
680
|
+
} }, entry.summary || t("assistant.debug.noSummary")));
|
|
681
|
+
}
|
|
682
|
+
/** 合并 Host、原生和远端元数据,保留已选但不可用的工作区。 */
|
|
683
|
+
function mergeDebugWorkspaces(snapshot, native, managedIds) {
|
|
684
|
+
const result = /* @__PURE__ */ new Map();
|
|
685
|
+
for (const workspace of snapshot?.workspaces ?? []) result.set(workspace.workspaceId, {
|
|
686
|
+
workspaceId: workspace.workspaceId,
|
|
687
|
+
title: workspace.name,
|
|
688
|
+
...workspace.path === null ? {} : { path: workspace.path },
|
|
689
|
+
available: true
|
|
690
|
+
});
|
|
691
|
+
for (const workspace of native) result.set(workspace.workspaceId, {
|
|
692
|
+
...workspace,
|
|
693
|
+
available: true
|
|
694
|
+
});
|
|
695
|
+
for (const entry of [
|
|
696
|
+
...snapshot?.scopeSessions ?? [],
|
|
697
|
+
...snapshot?.index.entries ?? [],
|
|
698
|
+
...snapshot?.index.excludedTargets ?? []
|
|
699
|
+
]) if (!result.has(entry.workspaceId)) result.set(entry.workspaceId, {
|
|
700
|
+
workspaceId: entry.workspaceId,
|
|
701
|
+
title: entry.workspaceName,
|
|
702
|
+
available: true
|
|
703
|
+
});
|
|
704
|
+
for (const workspaceId of managedIds) if (!result.has(workspaceId)) result.set(workspaceId, {
|
|
705
|
+
workspaceId,
|
|
706
|
+
title: workspaceId,
|
|
707
|
+
available: false
|
|
708
|
+
});
|
|
709
|
+
return [...result.values()];
|
|
710
|
+
}
|
|
711
|
+
function selectionKey(model) {
|
|
712
|
+
return JSON.stringify([model.provider, model.model]);
|
|
713
|
+
}
|
|
714
|
+
function shortSessionTitle(id, t) {
|
|
715
|
+
return t("assistant.debug.shortTitle", { id: id.slice(-8) });
|
|
716
|
+
}
|
|
717
|
+
function jsonView(value) {
|
|
718
|
+
return (0, react.createElement)("pre", { style: {
|
|
719
|
+
margin: "8px 0 0",
|
|
720
|
+
whiteSpace: "pre-wrap",
|
|
721
|
+
overflowWrap: "anywhere",
|
|
722
|
+
fontSize: 12,
|
|
723
|
+
lineHeight: 1.5
|
|
724
|
+
} }, JSON.stringify(value, null, 2));
|
|
725
|
+
}
|
|
726
|
+
function errorMessage(value) {
|
|
727
|
+
return value instanceof Error ? value.message : String(value);
|
|
728
|
+
}
|
|
729
|
+
function downloadSnapshot(snapshot) {
|
|
730
|
+
const url = URL.createObjectURL(new Blob([JSON.stringify(snapshot, null, 2)], { type: "application/json" }));
|
|
731
|
+
const anchor = document.createElement("a");
|
|
732
|
+
anchor.href = url;
|
|
733
|
+
anchor.download = `assistant-debug-${new Date(snapshot.capturedAt).toISOString().replace(/[:.]/gu, "-")}.json`;
|
|
734
|
+
anchor.click();
|
|
735
|
+
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
736
|
+
}
|
|
737
|
+
const actionsStyle = {
|
|
738
|
+
display: "flex",
|
|
739
|
+
flexWrap: "wrap",
|
|
740
|
+
gap: 8
|
|
741
|
+
};
|
|
742
|
+
const sectionStyle = {
|
|
743
|
+
display: "grid",
|
|
744
|
+
gap: 10,
|
|
745
|
+
minWidth: 0,
|
|
746
|
+
padding: 14,
|
|
747
|
+
borderRadius: 8,
|
|
748
|
+
border: `1px solid ${require_theme.dshThemeColor.border}`
|
|
749
|
+
};
|
|
750
|
+
const cardStyle = {
|
|
751
|
+
display: "grid",
|
|
752
|
+
gap: 5,
|
|
753
|
+
padding: 12,
|
|
754
|
+
borderRadius: 8,
|
|
755
|
+
background: require_theme.dshThemeColor.inputBackground,
|
|
756
|
+
overflowWrap: "anywhere"
|
|
757
|
+
};
|
|
758
|
+
//#endregion
|
|
759
|
+
exports.AssistantDebugDialog = AssistantDebugDialog;
|
|
760
|
+
return module.exports;
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
//# sourceMappingURL=client.assistant-debug-workbench.js.map
|