@deepseek-harness-tui/dsh-tui 0.10.2 → 0.11.1
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.md +175 -123
- package/bin/dsh-tui.js +748 -22
- package/cordis.patch.yml +42 -13
- package/cordis.yml +5 -2
- package/lib/types/activityPrefs.d.ts +24 -0
- package/lib/types/activityPrefs.d.ts.map +1 -1
- package/lib/types/activityPrefs.js +50 -1
- package/lib/types/adapter/channel/session-projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/session-projection.js +2 -0
- package/lib/types/adapter/channel/state.d.ts.map +1 -1
- package/lib/types/adapter/channel/state.js +3 -1
- package/lib/types/adapter/channel/ui-policy.d.ts +4 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +6 -2
- package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
- package/lib/types/adapter/kernel/host-facade.js +1 -0
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
- package/lib/types/adapter/kernel/replay.js +3 -0
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +2 -0
- package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -1
- package/lib/types/adapter/kernel/slices/workspace.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +29 -5
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +66 -12
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-workspace.d.ts +23 -0
- package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +4 -1
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/adapter/ports/workspace.d.ts +2 -0
- package/lib/types/adapter/ports/workspace.d.ts.map +1 -1
- package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -1
- package/lib/types/adapter/upstream/workspace-driver.js +10 -2
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +1 -0
- package/lib/types/components/ActivityLine.d.ts +7 -2
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityLine.js +0 -8
- package/lib/types/components/ContextBarView.d.ts +15 -7
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +26 -22
- package/lib/types/components/ImagePreviewOverlay.d.ts.map +1 -1
- package/lib/types/components/ImagePreviewOverlay.js +11 -5
- package/lib/types/components/Markdown.d.ts +11 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +20 -2
- package/lib/types/components/MermaidDiagram.d.ts +13 -0
- package/lib/types/components/MermaidDiagram.d.ts.map +1 -0
- package/lib/types/components/MermaidDiagram.js +61 -0
- package/lib/types/components/MessageList.d.ts +26 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +74 -8
- package/lib/types/components/PageMargin.d.ts +1 -1
- package/lib/types/components/PromptInput.d.ts +37 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +291 -30
- package/lib/types/components/ScrollbarGutter.d.ts +20 -5
- package/lib/types/components/ScrollbarGutter.d.ts.map +1 -1
- package/lib/types/components/ScrollbarGutter.js +88 -10
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +2 -1
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +30 -28
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +12 -6
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +8 -3
- package/lib/types/components/Tooltip.d.ts.map +1 -1
- package/lib/types/components/Tooltip.js +45 -7
- package/lib/types/components/design-system/HintLine.d.ts +1 -2
- package/lib/types/components/design-system/HintLine.d.ts.map +1 -1
- package/lib/types/components/design-system/HintLine.js +1 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +30 -26
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +5 -7
- package/lib/types/components/messages/useImageInspection.d.ts.map +1 -1
- package/lib/types/components/messages/useImageInspection.js +19 -9
- package/lib/types/components/promptDraftCache.d.ts +102 -0
- package/lib/types/components/promptDraftCache.d.ts.map +1 -0
- package/lib/types/components/promptDraftCache.js +76 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +17 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +40 -7
- package/lib/types/components/questions/QuestionMinimizedBar.d.ts +12 -0
- package/lib/types/components/questions/QuestionMinimizedBar.d.ts.map +1 -0
- package/lib/types/components/questions/QuestionMinimizedBar.js +43 -0
- package/lib/types/components/sessions/SessionListRow.d.ts +23 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +52 -5
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +49 -0
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -0
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +50 -0
- package/lib/types/dsh-adapter/activity-store.d.ts +221 -0
- package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -0
- package/lib/types/dsh-adapter/activity-store.js +359 -0
- package/lib/types/dsh-adapter/bundled-presets.d.ts +10 -0
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -0
- package/lib/types/dsh-adapter/bundled-presets.js +80 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +3 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +19 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +53 -29
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +8 -6
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +5 -4
- package/lib/types/dsh-adapter/channel/binding.d.ts +19 -2
- package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding.js +78 -18
- package/lib/types/dsh-adapter/channel/compaction.d.ts +0 -1
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +0 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +105 -6
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +8 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +3 -2
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts +58 -0
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/ide-selection.js +226 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +6 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +9 -1
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +3 -19
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +2 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +82 -6
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +49 -31
- package/lib/types/dsh-adapter/channel/projection.d.ts +4 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +29 -19
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +4 -12
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.js +1 -0
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +26 -2
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +2 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +10 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +6 -4
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +0 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +12 -3
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +292 -94
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +34 -16
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +19 -3
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +4 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +6 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +3 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +21 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +173 -6
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +6 -12
- package/lib/types/dsh-adapter/channel/types.d.ts +6 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +41 -1
- package/lib/types/dsh-adapter/channel.d.ts +1 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +82 -20
- package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +1 -1
- package/lib/types/dsh-adapter/compat/messages.d.ts +15 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/messages.js +15 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +18 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +18 -3
- package/lib/types/dsh-adapter/compat/settings.d.ts +35 -0
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/settings.js +57 -0
- package/lib/types/dsh-adapter/compat/shell.d.ts +25 -0
- package/lib/types/dsh-adapter/compat/shell.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/shell.js +11 -0
- package/lib/types/dsh-adapter/contract.d.ts +5 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +17 -6
- package/lib/types/dsh-adapter/ide-channel.d.ts +224 -0
- package/lib/types/dsh-adapter/ide-channel.d.ts.map +1 -0
- package/lib/types/dsh-adapter/ide-channel.js +556 -0
- package/lib/types/dsh-adapter/index.d.ts +18 -3
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +32 -5
- package/lib/types/dsh-adapter/plugin.d.ts +4 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +197 -49
- package/lib/types/dsh-adapter/preset-resolution.d.ts +8 -0
- package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/preset-resolution.js +10 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +53 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-mount-heartbeat.js +100 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +3 -2
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +7 -4
- package/lib/types/dsh-adapter/subagents.d.ts +16 -3
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +92 -29
- package/lib/types/dsh-adapter/workspaces.d.ts +46 -3
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +116 -0
- package/lib/types/effortPrefs.d.ts +15 -3
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +37 -3
- package/lib/types/history.d.ts +13 -1
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +15 -2
- package/lib/types/homePrefs.d.ts +15 -0
- package/lib/types/homePrefs.d.ts.map +1 -0
- package/lib/types/homePrefs.js +53 -0
- package/lib/types/i18n.d.ts +347 -297
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +133 -85
- package/lib/types/ink/colorize.d.ts +10 -0
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +21 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +12 -1
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +5 -1
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-copy-on-select.js +15 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +36 -1
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +19 -1
- package/lib/types/ink/output.d.ts +10 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +109 -17
- package/lib/types/ink/render-border.d.ts +6 -1
- package/lib/types/ink/render-border.d.ts.map +1 -1
- package/lib/types/ink/render-border.js +25 -9
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +48 -6
- package/lib/types/ink/renderer.d.ts +6 -0
- package/lib/types/ink/renderer.d.ts.map +1 -1
- package/lib/types/ink/renderer.js +2 -1
- package/lib/types/ink/selection.d.ts +88 -0
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +164 -0
- package/lib/types/ink/sixel-graphics.d.ts +19 -1
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +124 -12
- package/lib/types/ink/terminal-image.d.ts +18 -1
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal.d.ts +17 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +20 -1
- package/lib/types/screens/Chat.d.ts +20 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +296 -76
- package/lib/types/screens/SessionSupervisor.d.ts +84 -0
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -0
- package/lib/types/screens/SessionSupervisor.js +350 -0
- package/lib/types/screens/SessionTree.js +2 -2
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +32 -9
- package/lib/types/screens/StatusLine.d.ts +18 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +38 -19
- package/lib/types/screens/StatusMetrics.d.ts +79 -22
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +153 -88
- package/lib/types/screens/sessionSupervisor/model.d.ts +83 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/model.js +69 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +120 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +593 -0
- package/lib/types/sessionMounts.d.ts +272 -0
- package/lib/types/sessionMounts.d.ts.map +1 -0
- package/lib/types/sessionMounts.js +706 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +4 -1
- package/lib/types/sessions/resumeFailure.d.ts +38 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -0
- package/lib/types/sessions/resumeFailure.js +58 -0
- package/lib/types/terminal-utils/mermaid.d.ts +44 -0
- package/lib/types/terminal-utils/mermaid.d.ts.map +1 -0
- package/lib/types/terminal-utils/mermaid.js +83 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +175 -19
- package/lib/types/tuiDisplayPrefs.d.ts +7 -9
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +31 -28
- package/lib/types/update.d.ts +61 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +194 -0
- package/lib/types/utils/fold-long-lines.d.ts +1 -1
- package/lib/types/utils/fold-long-lines.js +1 -1
- package/lib/types/utils/imageResize.d.ts +90 -0
- package/lib/types/utils/imageResize.d.ts.map +1 -0
- package/lib/types/utils/imageResize.js +272 -0
- package/lib/types/utils/keymap.d.ts +5 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +23 -0
- package/lib/types/working-activity.d.ts +10 -9
- package/lib/types/working-activity.d.ts.map +1 -1
- package/lib/types/working-activity.js +17 -10
- package/lib/types/workspaces.d.ts +2 -1
- package/lib/types/workspaces.d.ts.map +1 -1
- package/lib/types/workspaces.js +1 -1
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +10 -10
- package/package.json +126 -105
- package/presets/liangshen/.dsh-tui-managed.json +1 -1
- package/presets/liangshen/agent.cordis.yml +15 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +0 -19
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +0 -1
- package/lib/types/components/design-system/KeyboardShortcutHint.js +0 -14
- package/lib/types/dsh-adapter/channel/activity.d.ts +0 -20
- package/lib/types/dsh-adapter/channel/activity.d.ts.map +0 -1
- package/lib/types/dsh-adapter/channel/activity.js +0 -113
- package/lib/types/screens/AgentView.d.ts +0 -23
- package/lib/types/screens/AgentView.d.ts.map +0 -1
- package/lib/types/screens/AgentView.js +0 -546
- package/lib/types/screens/SessionBrowser.d.ts +0 -42
- package/lib/types/screens/SessionBrowser.d.ts.map +0 -1
- package/lib/types/screens/SessionBrowser.js +0 -911
- package/lib/types/terminal-utils/terminal.d.ts +0 -18
- package/lib/types/terminal-utils/terminal.d.ts.map +0 -1
- package/lib/types/terminal-utils/terminal.js +0 -96
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-scoped activity snapshots for the working-status line.
|
|
3
|
+
*
|
|
4
|
+
* The line's *semantics* belong to the `dsh-working-activity` plugin: it folds
|
|
5
|
+
* durable session events and live model frames into a **session projection**
|
|
6
|
+
* (`workingActivity`) that any client can read — the browser reads it, and so
|
|
7
|
+
* does this TUI. Consuming the projection is what removes the second tracker
|
|
8
|
+
* this app used to run: one semantic owner, and a value that arrives already
|
|
9
|
+
* scoped to a session, so a background session can no longer overwrite the line
|
|
10
|
+
* of the session on screen.
|
|
11
|
+
*
|
|
12
|
+
* Two properties of the transport shape this module:
|
|
13
|
+
*
|
|
14
|
+
* 1. **It is event-driven.** A value changes when a committed event folds, never
|
|
15
|
+
* on its own. `updatedAt` is the timestamp of the last folded event (session
|
|
16
|
+
* time, so it survives a restart) and `live` says whether `line` counts
|
|
17
|
+
* elapsed time. A renderer that wants the counter to move must derive it from
|
|
18
|
+
* `turnStartedAt` / `phaseStartedAt` instead of re-rendering `line`.
|
|
19
|
+
* 2. **The value is host data, not plugin API.** The shape below is a local
|
|
20
|
+
* structural copy of the plugin's wire value, the same discipline the channel
|
|
21
|
+
* port already applies to the activity state: this app must not import the
|
|
22
|
+
* plugin's internals to display a line.
|
|
23
|
+
* @module dsh-tui/dsh-adapter/activity-store
|
|
24
|
+
*/
|
|
25
|
+
import React from 'react';
|
|
26
|
+
/** The projection key the activity plugin publishes. */
|
|
27
|
+
export const ACTIVITY_PROJECTION_KEY = 'workingActivity';
|
|
28
|
+
/**
|
|
29
|
+
* Narrow one projection value: anything that is not an activity view is
|
|
30
|
+
* dropped rather than rendered half-formed.
|
|
31
|
+
* @param value - Raw projection value.
|
|
32
|
+
* @returns the value as an activity view, or `undefined`.
|
|
33
|
+
*/
|
|
34
|
+
export function asActivityView(value) {
|
|
35
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
36
|
+
return undefined;
|
|
37
|
+
const record = value;
|
|
38
|
+
if (typeof record.phase !== 'string' || typeof record.line !== 'string')
|
|
39
|
+
return undefined;
|
|
40
|
+
if (!PHASES.has(record.phase))
|
|
41
|
+
return undefined;
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
const PHASES = new Set(['idle', 'waiting', 'thinking', 'tool', 'done']);
|
|
45
|
+
/**
|
|
46
|
+
* The latest activity value for the session on screen, with a subscription
|
|
47
|
+
* for renderers.
|
|
48
|
+
*
|
|
49
|
+
* The store is effectively single-current: binding a session ({@link
|
|
50
|
+
* ActivityStore.seed}) names the session the UI is showing, and every other
|
|
51
|
+
* id is dropped — values, session objects and read-failure counts alike. A
|
|
52
|
+
* registry-less store (the UI's fallback, test rigs) has no current session
|
|
53
|
+
* and keeps today's accept-all behavior.
|
|
54
|
+
*/
|
|
55
|
+
export class ActivityStore {
|
|
56
|
+
values = new Map();
|
|
57
|
+
/** Session objects seen for each id, so a live value can be re-read. */
|
|
58
|
+
sessions = new Map();
|
|
59
|
+
/** Consecutive failed reads per session id; reset by a successful read. */
|
|
60
|
+
readFailures = new Map();
|
|
61
|
+
/** Sessions already warned about (see {@link noteReadFailure}): once each. */
|
|
62
|
+
warned = new Set();
|
|
63
|
+
listeners = new Set();
|
|
64
|
+
/** The session the UI is showing (the last {@link seed}); the only id kept. */
|
|
65
|
+
currentId;
|
|
66
|
+
/** Host registry, remembered so a bind can read a baseline on demand. */
|
|
67
|
+
registry;
|
|
68
|
+
/** Warn sink (see {@link noteReadFailure}); injected by the composition root. */
|
|
69
|
+
warn;
|
|
70
|
+
constructor(warn) {
|
|
71
|
+
this.warn = warn;
|
|
72
|
+
}
|
|
73
|
+
/** Remember the host registry (see {@link seed} and {@link refreshLive}). */
|
|
74
|
+
attachRegistry(registry) {
|
|
75
|
+
this.registry = registry;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Seed one session from the registry's current snapshot and make it the
|
|
79
|
+
* current one.
|
|
80
|
+
*
|
|
81
|
+
* A value only *arrives* when it changes, so a session opened after its last
|
|
82
|
+
* change — a resume, or a window reattached to a running agent — would show
|
|
83
|
+
* nothing until the next event without this read. The bind also defines the
|
|
84
|
+
* session on screen: every other id is pruned, so a later event — or the
|
|
85
|
+
* tick — for a session the user switched away from can no longer fill this
|
|
86
|
+
* store or keep a timer armed.
|
|
87
|
+
* @param session - Session being bound.
|
|
88
|
+
*/
|
|
89
|
+
seed(session) {
|
|
90
|
+
if (session === null || session === undefined)
|
|
91
|
+
return;
|
|
92
|
+
this.currentId = String(session.id);
|
|
93
|
+
this.pruneToCurrent();
|
|
94
|
+
seedActivity(this.registry, this, session);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Note the session object behind an id, so a live value can be re-read.
|
|
98
|
+
* Dropped for any id other than the current one (see {@link seed}). */
|
|
99
|
+
remember(sessionId, session) {
|
|
100
|
+
if (this.currentId !== undefined && sessionId !== this.currentId)
|
|
101
|
+
return;
|
|
102
|
+
this.sessions.set(sessionId, session);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Re-read the current session's value while it is still counting time.
|
|
106
|
+
*
|
|
107
|
+
* The host renders the value when it is *read*, so this is what makes the
|
|
108
|
+
* elapsed seconds advance between committed events — with the host's own copy
|
|
109
|
+
* and language, since nothing is re-rendered here. A value that has settled
|
|
110
|
+
* (`live` false: idle, or a finished turn) is deliberately skipped: its text
|
|
111
|
+
* cannot change on its own. Only the current session can be live (see
|
|
112
|
+
* {@link seed}), so the tick never polls a session the user left.
|
|
113
|
+
*/
|
|
114
|
+
refreshLive() {
|
|
115
|
+
const registry = this.registry;
|
|
116
|
+
if (registry === undefined)
|
|
117
|
+
return;
|
|
118
|
+
for (const [sessionId, value] of [...this.values]) {
|
|
119
|
+
if (!value.live)
|
|
120
|
+
continue;
|
|
121
|
+
const session = this.sessions.get(sessionId);
|
|
122
|
+
if (session === undefined)
|
|
123
|
+
continue;
|
|
124
|
+
seedActivity(registry, this, session);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Whether the current session's value is still counting time (see {@link refreshLive}). */
|
|
128
|
+
hasLive() {
|
|
129
|
+
for (const value of this.values.values())
|
|
130
|
+
if (value.live)
|
|
131
|
+
return true;
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
/** The current value for one session, stable between updates. */
|
|
135
|
+
get(sessionId) {
|
|
136
|
+
if (sessionId === undefined)
|
|
137
|
+
return undefined;
|
|
138
|
+
return this.values.get(sessionId);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Record one projection value. Dropped for any id other than the current
|
|
142
|
+
* one (see {@link seed}).
|
|
143
|
+
* @param sessionId - Session the value belongs to.
|
|
144
|
+
* @param view - The published value.
|
|
145
|
+
*/
|
|
146
|
+
update(sessionId, view) {
|
|
147
|
+
if (this.currentId !== undefined && sessionId !== this.currentId)
|
|
148
|
+
return;
|
|
149
|
+
if (this.values.get(sessionId) === view)
|
|
150
|
+
return;
|
|
151
|
+
this.values.set(sessionId, view);
|
|
152
|
+
this.emit();
|
|
153
|
+
}
|
|
154
|
+
/** Forget one session (disposed, or left behind by a reset). */
|
|
155
|
+
clear(sessionId) {
|
|
156
|
+
this.sessions.delete(sessionId);
|
|
157
|
+
if (!this.values.delete(sessionId))
|
|
158
|
+
return;
|
|
159
|
+
this.emit();
|
|
160
|
+
}
|
|
161
|
+
/** A read succeeded: this session's consecutive-failure count restarts. */
|
|
162
|
+
noteReadSuccess(sessionId) {
|
|
163
|
+
this.readFailures.delete(sessionId);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A read failed. The failure is reported to the warn sink ONCE per session
|
|
167
|
+
* (the sink is the composition root's logger — this module stays free of
|
|
168
|
+
* cordis types), and after {@link MAX_READ_FAILURES} consecutive failures
|
|
169
|
+
* the value is cleared so the tick disarms instead of polling a registry
|
|
170
|
+
* that will never answer.
|
|
171
|
+
* @param sessionId - Session whose read failed.
|
|
172
|
+
* @param detail - What the failed read threw.
|
|
173
|
+
*/
|
|
174
|
+
noteReadFailure(sessionId, detail) {
|
|
175
|
+
const failures = (this.readFailures.get(sessionId) ?? 0) + 1;
|
|
176
|
+
this.readFailures.set(sessionId, failures);
|
|
177
|
+
if (!this.warned.has(sessionId)) {
|
|
178
|
+
this.warned.add(sessionId);
|
|
179
|
+
this.warn?.(`dsh-tui: working-activity projection read failed for session ${sessionId}: ${detail}`);
|
|
180
|
+
}
|
|
181
|
+
if (failures >= MAX_READ_FAILURES)
|
|
182
|
+
this.clear(sessionId);
|
|
183
|
+
}
|
|
184
|
+
/** Drop every id that is not the current one; emit when a value went. */
|
|
185
|
+
pruneToCurrent() {
|
|
186
|
+
if (this.currentId === undefined)
|
|
187
|
+
return;
|
|
188
|
+
let removedValue = false;
|
|
189
|
+
for (const id of [...this.values.keys()]) {
|
|
190
|
+
if (id === this.currentId)
|
|
191
|
+
continue;
|
|
192
|
+
this.values.delete(id);
|
|
193
|
+
removedValue = true;
|
|
194
|
+
this.sessions.delete(id);
|
|
195
|
+
this.readFailures.delete(id);
|
|
196
|
+
this.warned.delete(id);
|
|
197
|
+
}
|
|
198
|
+
for (const id of [...this.sessions.keys()]) {
|
|
199
|
+
if (id === this.currentId)
|
|
200
|
+
continue;
|
|
201
|
+
this.sessions.delete(id);
|
|
202
|
+
this.readFailures.delete(id);
|
|
203
|
+
this.warned.delete(id);
|
|
204
|
+
}
|
|
205
|
+
if (removedValue)
|
|
206
|
+
this.emit();
|
|
207
|
+
}
|
|
208
|
+
/** Subscribe to value changes; returns the unsubscribe function. */
|
|
209
|
+
subscribe(listener) {
|
|
210
|
+
this.listeners.add(listener);
|
|
211
|
+
return () => { this.listeners.delete(listener); };
|
|
212
|
+
}
|
|
213
|
+
emit() {
|
|
214
|
+
for (const listener of [...this.listeners])
|
|
215
|
+
listener();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The change-feed listener for one store.
|
|
220
|
+
*
|
|
221
|
+
* Only this plugin's key is read, and only values that narrow to an activity
|
|
222
|
+
* view are accepted: the feed is host-wide, so every other unit's change and
|
|
223
|
+
* every malformed value must be dropped here rather than inside a renderer.
|
|
224
|
+
* @param store - Store to fill.
|
|
225
|
+
* @returns the listener to hand to `ProjectionRegistry.onChanged`.
|
|
226
|
+
*/
|
|
227
|
+
export function createActivityFeed(store) {
|
|
228
|
+
return (session, key, value) => {
|
|
229
|
+
if (key !== ACTIVITY_PROJECTION_KEY)
|
|
230
|
+
return;
|
|
231
|
+
const view = asActivityView(value);
|
|
232
|
+
if (view === undefined)
|
|
233
|
+
return;
|
|
234
|
+
const sessionId = String(session.id);
|
|
235
|
+
// Values for a session other than the current one are dropped inside
|
|
236
|
+
// remember/update, so the feed needs no filter of its own.
|
|
237
|
+
store.remember(sessionId, session);
|
|
238
|
+
store.update(sessionId, view);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** How often a value that is still counting time is re-read from the host. */
|
|
242
|
+
export const LIVE_TICK_MS = 500;
|
|
243
|
+
/** Consecutive failed reads before a session's value is dropped (see {@link ActivityStore.noteReadFailure}). */
|
|
244
|
+
const MAX_READ_FAILURES = 3;
|
|
245
|
+
/**
|
|
246
|
+
* Wire one store to the host's projection registry.
|
|
247
|
+
*
|
|
248
|
+
* Registration is deferred through `inject` because the plugin that *publishes*
|
|
249
|
+
* the unit is mounted alongside this one: the registry may not exist yet, and
|
|
250
|
+
* the unit may not be registered until later still. Both absences are normal —
|
|
251
|
+
* a composition without the activity plugin simply never fills the store, and
|
|
252
|
+
* the line falls back to whatever else the UI has.
|
|
253
|
+
*
|
|
254
|
+
* The feed is event-driven, so a value only lands when a committed event folds;
|
|
255
|
+
* its elapsed text would therefore freeze for the length of a long tool. The
|
|
256
|
+
* host renders a value when it is READ, so a timer re-reads the live ones: the
|
|
257
|
+
* seconds advance, the copy and language stay the plugin's, and a settled value
|
|
258
|
+
* (idle, or a finished turn) stops the timer instead of being polled forever.
|
|
259
|
+
* @param ctx - Host context of the composition root.
|
|
260
|
+
* @param store - Store to fill.
|
|
261
|
+
*/
|
|
262
|
+
export function attachActivityProjection(ctx, store) {
|
|
263
|
+
ctx.inject(['sessionProjections'], ((projectionCtx) => {
|
|
264
|
+
const registry = projectionCtx.sessionProjections;
|
|
265
|
+
if (registry === undefined)
|
|
266
|
+
return;
|
|
267
|
+
store.attachRegistry(registry);
|
|
268
|
+
const offFeed = registry.onChanged(createActivityFeed(store));
|
|
269
|
+
let timer;
|
|
270
|
+
const stopTimer = () => {
|
|
271
|
+
if (timer === undefined)
|
|
272
|
+
return;
|
|
273
|
+
clearInterval(timer);
|
|
274
|
+
timer = undefined;
|
|
275
|
+
};
|
|
276
|
+
/** Arm while something is counting time, disarm the moment nothing is. */
|
|
277
|
+
const reconcileTimer = () => {
|
|
278
|
+
if (!store.hasLive()) {
|
|
279
|
+
stopTimer();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (timer !== undefined)
|
|
283
|
+
return;
|
|
284
|
+
timer = setInterval(() => {
|
|
285
|
+
store.refreshLive();
|
|
286
|
+
}, LIVE_TICK_MS);
|
|
287
|
+
timer.unref();
|
|
288
|
+
};
|
|
289
|
+
const offStore = store.subscribe(reconcileTimer);
|
|
290
|
+
reconcileTimer();
|
|
291
|
+
// The cleanup belongs to the injected fiber, not the outer ctx: a service
|
|
292
|
+
// re-provide re-runs the callback above, and registering on the outer ctx
|
|
293
|
+
// would stack feed listeners (the old listener's disposer would only run
|
|
294
|
+
// when the whole composition root goes down).
|
|
295
|
+
projectionCtx.effect(() => () => {
|
|
296
|
+
offStore();
|
|
297
|
+
stopTimer();
|
|
298
|
+
offFeed();
|
|
299
|
+
}, 'dsh-tui activity projection feed');
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Create the composition root's activity store and wire it to the host.
|
|
304
|
+
* @param ctx - Host context of the composition root.
|
|
305
|
+
* @param enabled - Whether the working line is shown at all (cordis.yml
|
|
306
|
+
* `activity`; a static, config-time switch — the runtime `/activity` command
|
|
307
|
+
* only changes the preset). With the line off, nothing attaches: no feed,
|
|
308
|
+
* no registry, and therefore no 500ms tick for a line nobody renders.
|
|
309
|
+
* @returns the store the UI reads from.
|
|
310
|
+
*/
|
|
311
|
+
export function createActivityStore(ctx, enabled) {
|
|
312
|
+
const store = new ActivityStore(message => { ctx.logger.warn(message); });
|
|
313
|
+
if (enabled)
|
|
314
|
+
attachActivityProjection(ctx, store);
|
|
315
|
+
return store;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Read one session's activity value in a component.
|
|
319
|
+
* @param store - Store to read.
|
|
320
|
+
* @param sessionId - Session the UI is showing.
|
|
321
|
+
* @returns the current value, or `undefined` when there is none.
|
|
322
|
+
*/
|
|
323
|
+
export function useActivity(store, sessionId) {
|
|
324
|
+
const subscribe = React.useCallback((listener) => store.subscribe(listener), [store]);
|
|
325
|
+
const read = React.useCallback(() => store.get(sessionId), [store, sessionId]);
|
|
326
|
+
return React.useSyncExternalStore(subscribe, read);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Seed one session's value from the registry's current snapshot.
|
|
330
|
+
*
|
|
331
|
+
* A value only *arrives* when it changes, so a session opened after its last
|
|
332
|
+
* change — a resume, or a window reattached to a running agent — would show
|
|
333
|
+
* nothing until the next event without this read.
|
|
334
|
+
* @param registry - Host projection registry.
|
|
335
|
+
* @param store - Store to fill.
|
|
336
|
+
* @param session - Session to read.
|
|
337
|
+
*/
|
|
338
|
+
export function seedActivity(registry, store, session) {
|
|
339
|
+
if (registry === undefined || session === null || session === undefined)
|
|
340
|
+
return;
|
|
341
|
+
const id = String(session.id);
|
|
342
|
+
try {
|
|
343
|
+
const snapshot = registry.snapshot(session, [ACTIVITY_PROJECTION_KEY]);
|
|
344
|
+
const view = asActivityView(snapshot.values[ACTIVITY_PROJECTION_KEY]);
|
|
345
|
+
if (view === undefined)
|
|
346
|
+
store.clear(id);
|
|
347
|
+
else {
|
|
348
|
+
store.remember(id, session);
|
|
349
|
+
store.update(id, view);
|
|
350
|
+
}
|
|
351
|
+
store.noteReadSuccess(id);
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
// An unreadable snapshot is still not worth failing a session bind over,
|
|
355
|
+
// but it is no longer silent either: warn once per session, and a read
|
|
356
|
+
// that keeps failing eventually drops the value so the tick disarms.
|
|
357
|
+
store.noteReadFailure(id, error instanceof Error ? error.message : String(error));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/**
|
|
3
|
+
* 0.1.7 removed directory discovery. Consume the official bundle definitions
|
|
4
|
+
* through its registry, without copying or reimplementing their tool sets.
|
|
5
|
+
* Web/profile declarations own their seats even while still activating.
|
|
6
|
+
* Returns false on the legacy directory-backed roster or while absent. An
|
|
7
|
+
* absent service is watched through Cordis so a late registry is not missed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerBundledPresets(ctx: Context): Promise<boolean>;
|
|
10
|
+
//# sourceMappingURL=bundled-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/bundled-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAwClD;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CA0C3E"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { parse } from 'yaml';
|
|
6
|
+
import { packagedPresetRoot } from './packaged-presets.js';
|
|
7
|
+
function declarativePresets(ctx) {
|
|
8
|
+
const service = ctx.get('agentPresets');
|
|
9
|
+
return service !== null && typeof service === 'object'
|
|
10
|
+
&& 'register' in service && typeof service.register === 'function'
|
|
11
|
+
? service
|
|
12
|
+
: undefined;
|
|
13
|
+
}
|
|
14
|
+
/** Preserve the Loader's expressions; only the owning plugin may evaluate them. */
|
|
15
|
+
function readPresetPatch(path) {
|
|
16
|
+
const patches = parse(readFileSync(path, 'utf8'), {
|
|
17
|
+
customTags: [{ tag: 'tag:yaml.org,2002:js', resolve: (value) => ({ __jsExpr: value }) }],
|
|
18
|
+
});
|
|
19
|
+
if (Array.isArray(patches) && patches.length === 1) {
|
|
20
|
+
const row = patches[0]?.insert?.[0];
|
|
21
|
+
if (row?.name === '@deepseek-ai/dsh-agent-preset'
|
|
22
|
+
&& typeof row.config?.id === 'string' && Array.isArray(row.config.plugins)) {
|
|
23
|
+
return row.config;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`dsh-tui: invalid upstream preset declaration: ${path}`);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 0.1.7 removed directory discovery. Consume the official bundle definitions
|
|
30
|
+
* through its registry, without copying or reimplementing their tool sets.
|
|
31
|
+
* Web/profile declarations own their seats even while still activating.
|
|
32
|
+
* Returns false on the legacy directory-backed roster or while absent. An
|
|
33
|
+
* absent service is watched through Cordis so a late registry is not missed.
|
|
34
|
+
*/
|
|
35
|
+
export async function registerBundledPresets(ctx) {
|
|
36
|
+
if (ctx.get('agentPresets') === undefined) {
|
|
37
|
+
ctx.inject(['agentPresets'], async (ready) => {
|
|
38
|
+
await registerBundledPresets(ready);
|
|
39
|
+
});
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (declarativePresets(ctx) === undefined)
|
|
43
|
+
return false;
|
|
44
|
+
const declared = new Set();
|
|
45
|
+
const loader = ctx.get('loader');
|
|
46
|
+
for (const entry of loader?.entries() ?? []) {
|
|
47
|
+
if (entry.disabled || entry.options.name !== '@deepseek-ai/dsh-agent-preset')
|
|
48
|
+
continue;
|
|
49
|
+
const config = entry.options.config;
|
|
50
|
+
if (config !== null && typeof config === 'object' && 'id' in config && typeof config.id === 'string') {
|
|
51
|
+
declared.add(config.id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const require = createRequire(ctx.baseUrl ?? import.meta.url);
|
|
55
|
+
for (const id of ['standard', 'ptc', 'minimal', 'cordis']) {
|
|
56
|
+
if (declared.has(id))
|
|
57
|
+
continue;
|
|
58
|
+
const path = require.resolve(`@deepseek-ai/dsh-web-app/presets/${id}.patch.yml`);
|
|
59
|
+
const owner = ctx.extend({ baseUrl: pathToFileURL(path).href });
|
|
60
|
+
const dispose = await declarativePresets(owner).register(readPresetPatch(path));
|
|
61
|
+
ctx.effect(() => dispose);
|
|
62
|
+
}
|
|
63
|
+
if (!declared.has('liangshen')) {
|
|
64
|
+
const root = join(packagedPresetRoot(), 'liangshen');
|
|
65
|
+
const metadata = parse(readFileSync(join(root, 'preset.yml'), 'utf8'));
|
|
66
|
+
const dispose = await declarativePresets(ctx).register({
|
|
67
|
+
id: 'liangshen',
|
|
68
|
+
name: metadata.name,
|
|
69
|
+
description: metadata.description,
|
|
70
|
+
order: metadata.order,
|
|
71
|
+
plugins: [{
|
|
72
|
+
id: 'liangshen-plugins',
|
|
73
|
+
name: '@deepseek-ai/cordis-plugin-include',
|
|
74
|
+
config: { path: pathToFileURL(join(root, 'agent.cordis.yml')).href },
|
|
75
|
+
}],
|
|
76
|
+
});
|
|
77
|
+
ctx.effect(() => dispose);
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { ChannelState } from './types.js';
|
|
|
4
4
|
* specialist has been constructed. Construction-time callers fail closed
|
|
5
5
|
* rather than receiving a plausible no-op while the Channel is incomplete.
|
|
6
6
|
*/
|
|
7
|
-
export type ChannelActionDelegates = Pick<ChannelState, 'commandCompletions' | 'loadOlder' | 'rewindTo' | 'rewindToNode' | 'forkSession' | 'resumeTo' | 'newSession' | 'listWorkspaces' | 'resolveWorkspace' | 'switchWorkspace' | 'renameWorkspace' | 'workspaceCommands' | 'runWorkspaceCommand' | 'switchModel' | 'listEfforts' | 'setEffort' | 'setDefaultEffort' | 'cycleMode' | 'runPermissionPreset' | 'clear' | 'setActivityFrames' | 'listPresets' | 'switchPreset' | 'listModels' | 'listProviders' | 'invalidateModelCompletion' | 'listSkills' | 'describeCredential' | 'balanceInfo' | 'sideQuestion' | 'listFileCandidates' | 'listFiles' | 'listSessions' | 'previewSession' | 'bindApprovalStore' | 'agentViewRows' | 'subscribeAgentView' | 'dispatchBackgroundAgent' | 'stopBackgroundAgent' | 'attachToAgent' | 'peekAgentSession' | 'replyToAgent' | 'backgroundCurrent' | 'setResumeTarget' | 'renameSession' | 'setSessionColor' | 'recapRecent' | 'deleteSession' | 'renameSessionTo' | 'compact' | 'runExternalCommand' | 'runExternalCommandOutcome' | 'pushLocal' | 'mcpStatus' | 'exportSession' | 'initWorkspace' | 'doctorInfo' | 'pluginsInfo' | 'listSubagents'> & {
|
|
7
|
+
export type ChannelActionDelegates = Pick<ChannelState, 'commandCompletions' | 'loadOlder' | 'rewindTo' | 'rewindToNode' | 'forkSession' | 'resumeTo' | 'newSession' | 'listWorkspaces' | 'listWorkspaceRegistry' | 'removeWorkspace' | 'renameWorkspaceAt' | 'resolveWorkspace' | 'switchWorkspace' | 'renameWorkspace' | 'workspaceCommands' | 'runWorkspaceCommand' | 'switchModel' | 'listEfforts' | 'setEffort' | 'setDefaultEffort' | 'cycleMode' | 'runPermissionPreset' | 'clear' | 'setActivityFrames' | 'listPresets' | 'switchPreset' | 'listModels' | 'listProviders' | 'invalidateModelCompletion' | 'listSkills' | 'describeCredential' | 'balanceInfo' | 'sideQuestion' | 'listFileCandidates' | 'listFiles' | 'listSessions' | 'previewSession' | 'bindApprovalStore' | 'agentViewRows' | 'subscribeAgentView' | 'dispatchBackgroundAgent' | 'stopBackgroundAgent' | 'attachToAgent' | 'peekAgentSession' | 'replyToAgent' | 'backgroundCurrent' | 'setResumeTarget' | 'renameSession' | 'setSessionColor' | 'recapRecent' | 'deleteSession' | 'renameSessionTo' | 'compact' | 'runExternalCommand' | 'runExternalCommandOutcome' | 'pushLocal' | 'mcpStatus' | 'exportSession' | 'initWorkspace' | 'doctorInfo' | 'pluginsInfo' | 'listSubagents'> & {
|
|
8
8
|
runLocalCommand(command: string, includeInContext: boolean): Promise<void>;
|
|
9
9
|
};
|
|
10
10
|
type ChannelActionMethodName = Exclude<keyof ChannelActionDelegates, 'runLocalCommand'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-readiness.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/action-readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAClD,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,aAAa,GACb,WAAW,GACX,kBAAkB,GAClB,WAAW,GACX,qBAAqB,GACrB,OAAO,GACP,mBAAmB,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,2BAA2B,GAC3B,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,yBAAyB,GACzB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,CAClB,GAAG;IACF,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3E,CAAA;AAED,KAAK,uBAAuB,GAAG,OAAO,CAAC,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,CAAA;AACvF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAE9E;4EAC4E;AAC5E,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,sBAAsB,GAC5C,oBAAoB,
|
|
1
|
+
{"version":3,"file":"action-readiness.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/action-readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,YAAY,EAClD,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,uBAAuB,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,aAAa,GACb,WAAW,GACX,kBAAkB,GAClB,WAAW,GACX,qBAAqB,GACrB,OAAO,GACP,mBAAmB,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,2BAA2B,GAC3B,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,yBAAyB,GACzB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,SAAS,GACT,oBAAoB,GACpB,2BAA2B,GAC3B,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,CAClB,GAAG;IACF,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3E,CAAA;AAED,KAAK,uBAAuB,GAAG,OAAO,CAAC,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,CAAA;AACvF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAE9E;4EAC4E;AAC5E,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,sBAAsB,GAC5C,oBAAoB,CAoEtB;AAED,wBAAgB,4BAA4B;kBAG1B,sBAAsB,GAAG,IAAI;uBAIxB,sBAAsB;EAK5C"}
|
|
@@ -10,6 +10,9 @@ export function createChannelActionMethods(getReadyActions) {
|
|
|
10
10
|
resumeTo: sessionId => getReadyActions().resumeTo(sessionId),
|
|
11
11
|
newSession: () => getReadyActions().newSession(),
|
|
12
12
|
listWorkspaces: () => getReadyActions().listWorkspaces(),
|
|
13
|
+
listWorkspaceRegistry: () => getReadyActions().listWorkspaceRegistry(),
|
|
14
|
+
removeWorkspace: path => getReadyActions().removeWorkspace(path),
|
|
15
|
+
renameWorkspaceAt: (path, title) => getReadyActions().renameWorkspaceAt(path, title),
|
|
13
16
|
resolveWorkspace: uri => getReadyActions().resolveWorkspace(uri),
|
|
14
17
|
// Preserve ChannelUi's promise rejection contract after release: a caller
|
|
15
18
|
// which already received this async method must observe a rejected promise,
|
|
@@ -18,7 +18,7 @@ type ApprovalStore = {
|
|
|
18
18
|
/** Owns detached background handles and the agent-view projection. */
|
|
19
19
|
export declare function createAgentViewProjection(ctx: Context, deps: {
|
|
20
20
|
owner: Pick<ChannelOwner, 'current' | 'assertActive' | 'own'>;
|
|
21
|
-
binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent' | 'prepare' | 'abandon'>;
|
|
21
|
+
binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent' | 'prepare' | 'abandon' | 'waitForDisposal'>;
|
|
22
22
|
cwd(): string;
|
|
23
23
|
configuredPreset?: string;
|
|
24
24
|
configuredProvider?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-view-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/agent-view-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"agent-view-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/agent-view-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAqBlD,OAAO,EAAqD,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG7G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KA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ER, agentViewLivePreview, agentViewStatusOf, foldAgentViewEvents, oneLine, sessionTitleFallback, } from '../agent-view.js';
|
|
10
10
|
import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
|
|
11
11
|
import { composePreset } from '../presets.js';
|
|
12
|
+
import { reserveNewSession } from '../../sessionMounts.js';
|
|
12
13
|
import { locateSession, previewSession } from '../sessions/index.js';
|
|
13
14
|
import { attachSessionToWorkspace } from '../workspace.js';
|
|
14
15
|
import { logForDebugging } from '../../utils/debug.js';
|
|
@@ -75,7 +76,7 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
75
76
|
// These process-wide roster observations still belong to this channel
|
|
76
77
|
// owner. Revoke them so a retained Context cannot wake a dead projection.
|
|
77
78
|
disposeStatus = ctx.on('agent/status', () => schedule());
|
|
78
|
-
disposeCreated = ctx.on('agent/created', () => notify());
|
|
79
|
+
disposeCreated = ctx.on('agent/created', () => { notify(); });
|
|
79
80
|
disposeDisposed = ctx.on('agent/disposed', ({ agent }) => {
|
|
80
81
|
folds.delete(String(agent.id ?? ''));
|
|
81
82
|
backgroundHandles.delete(String(agent.id ?? ''));
|
|
@@ -133,6 +134,10 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
133
134
|
return { ok: false, reason: 'unavailable' };
|
|
134
135
|
}
|
|
135
136
|
const sessionId = SessionId(randomUUID());
|
|
137
|
+
// Announce the id before the factory: the background session's log is
|
|
138
|
+
// created here, and the publisher only learns the id from the registry on
|
|
139
|
+
// its next beat.
|
|
140
|
+
const { reservation } = await reserveNewSession(String(sessionId));
|
|
136
141
|
let detached;
|
|
137
142
|
try {
|
|
138
143
|
deps.owner.assertActive();
|
|
@@ -149,12 +154,14 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
149
154
|
}));
|
|
150
155
|
}
|
|
151
156
|
catch (error) {
|
|
157
|
+
reservation.abandon();
|
|
152
158
|
const message = error instanceof Error ? error.message : String(error);
|
|
153
159
|
deps.notify(t('agentview-dispatch-failed', { err: message }), { color: 'error', timeoutMs: 8000 });
|
|
154
160
|
return { ok: false, reason: 'failed', error: message };
|
|
155
161
|
}
|
|
156
162
|
if (!deps.owner.current()) {
|
|
157
163
|
await detached.release();
|
|
164
|
+
reservation.abandon();
|
|
158
165
|
return { ok: false, reason: 'failed', error: 'Channel lifetime ended' };
|
|
159
166
|
}
|
|
160
167
|
try {
|
|
@@ -163,10 +170,14 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
163
170
|
catch { /* optional ledger */ }
|
|
164
171
|
if (!deps.owner.current()) {
|
|
165
172
|
await detached.release();
|
|
173
|
+
reservation.abandon();
|
|
166
174
|
return { ok: false, reason: 'failed', error: 'Channel lifetime ended' };
|
|
167
175
|
}
|
|
168
176
|
detached.transfer();
|
|
169
177
|
backgroundHandles.set(String(sessionId), detached.handle);
|
|
178
|
+
// The session is this process's background handle from here on, so the
|
|
179
|
+
// reservation has done its job: the registry is the authority now.
|
|
180
|
+
reservation.settle();
|
|
170
181
|
touchAgentViewSession(String(sessionId));
|
|
171
182
|
touchSession(sessionId);
|
|
172
183
|
// transfer intentionally moves disposal to the background ledger; check
|
|
@@ -209,13 +220,19 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
209
220
|
const attach = async (sessionId) => {
|
|
210
221
|
if (sessionId === String(deps.binding.agent.session.id))
|
|
211
222
|
return { ok: true };
|
|
223
|
+
const capture = deps.binding.capture();
|
|
224
|
+
// A retiring Agent can remain in the registry until its JSONL writer has
|
|
225
|
+
// drained. Read the live target only after that close, just like /resume.
|
|
226
|
+
await deps.binding.waitForDisposal(sessionId);
|
|
227
|
+
if (!deps.binding.isCurrent(capture))
|
|
228
|
+
return { ok: false, reason: 'cancelled' };
|
|
212
229
|
// Capture the exact live target before the async host decision. If the
|
|
213
230
|
// registry replaces it while parked, never silently adopt that arbitrary
|
|
214
231
|
// replacement; a later user action can make a fresh, explicit choice.
|
|
215
232
|
const live = agents()?.get(SessionId(sessionId));
|
|
216
233
|
if (await deps.sessionSwitchVetoed('agent-view', sessionId))
|
|
217
234
|
return { ok: false, reason: 'cancelled' };
|
|
218
|
-
if (
|
|
235
|
+
if (!deps.binding.isCurrent(capture) || agents()?.get(SessionId(sessionId)) !== live)
|
|
219
236
|
return { ok: false, reason: 'cancelled' };
|
|
220
237
|
return live === undefined ? deps.resumeInto(sessionId, 'agent-view', true) : deps.adoptLive(live);
|
|
221
238
|
};
|
|
@@ -7,7 +7,7 @@ import type { BackgroundResult, ChannelState } from './types.js';
|
|
|
7
7
|
type Binding = ReturnType<typeof createChannelBinding>;
|
|
8
8
|
/** `/bg` foreground handoff. The binding remains the sole identity writer;
|
|
9
9
|
* this action only parks the exact previous handle passed by its transaction. */
|
|
10
|
-
export declare function createBackgroundCurrentAction(ctx: Context, state: Pick<ChannelState, 'cwd' | 'status' | 'agentId' | 'loadedContext' | 'contextWindow' | 'effortLevels' | 'reasoningEffort' | 'emit' | 'notify'> & Parameters<typeof resetSessionProjection>[0], options: {
|
|
10
|
+
export declare function createBackgroundCurrentAction(ctx: Context, state: Pick<ChannelState, 'cwd' | 'status' | 'agentId' | 'sessionId' | 'loadedContext' | 'contextWindow' | 'effortLevels' | 'reasoningEffort' | 'emit' | 'notify'> & Parameters<typeof resetSessionProjection>[0], options: {
|
|
11
11
|
configuredPreset?: string;
|
|
12
12
|
configuredProvider?: string;
|
|
13
13
|
configuredModel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-action.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/background-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"background-action.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/background-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E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