@deepseek-harness-tui/dsh-tui 0.16.0 → 0.17.0
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 +214 -34
- package/assets/plugin-icon.svg +13 -0
- package/assets/windows-installer.cs +308 -0
- package/assets/windows-installer.ps1 +17 -0
- package/bin/dsh-tui.js +64 -5
- package/cli/adapters/dsh/index.mjs +111 -0
- package/cli/adapters/dsh/locate.mjs +73 -0
- package/cli/adapters/dsh/management-plugin.mjs +111 -0
- package/cli/args.mjs +154 -0
- package/cli/contracts.d.ts +48 -0
- package/cli/engine.mjs +92 -0
- package/cli/entry.mjs +48 -0
- package/cli/process.mjs +118 -0
- package/cli/protocol.mjs +23 -0
- package/cli/schema-v1.json +33 -0
- package/cordis.patch.yml +3 -1
- package/cordis.yml +3 -1
- package/guide/dsh-tui-guide/SKILL.md +1 -0
- package/guide/dsh-tui-guide/claude-backend.en.md +8 -0
- package/guide/dsh-tui-guide/claude-backend.md +5 -0
- package/guide/dsh-tui-guide/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +6 -5
- package/guide/dsh-tui-guide/configuration.md +6 -5
- package/guide/dsh-tui-guide/getting-started.en.md +44 -10
- package/guide/dsh-tui-guide/getting-started.md +31 -9
- package/guide/dsh-tui-guide/interaction.en.md +22 -10
- package/guide/dsh-tui-guide/interaction.md +18 -8
- package/guide/dsh-tui-guide/plugins.en.md +35 -4
- package/guide/dsh-tui-guide/plugins.md +23 -2
- package/guide/dsh-tui-guide/user-guide.en.md +30 -23
- package/guide/dsh-tui-guide/user-guide.md +29 -22
- package/lib/settings.json +83 -40
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
- package/lib/types/adapter/channel/plugins.js +8 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +3 -0
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +17 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +8 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +7 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +2 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +8 -0
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/api.d.ts +2 -2
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.js +2 -1
- package/lib/types/backends/codex/auth/status.js +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +6 -5
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.js +3 -1
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +9 -8
- package/lib/types/channel/history-restore.d.ts.map +1 -1
- package/lib/types/channel/history-restore.js +2 -0
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/projection.d.ts +1 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +19 -4
- package/lib/types/channel/questions.d.ts +2 -0
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts +14 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +55 -0
- package/lib/types/channel/working-directory.d.ts +9 -0
- package/lib/types/channel/working-directory.d.ts.map +1 -0
- package/lib/types/channel/working-directory.js +7 -0
- package/lib/types/commands.d.ts +8 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +13 -4
- package/lib/types/components/ChatTitle.d.ts +7 -0
- package/lib/types/components/ChatTitle.d.ts.map +1 -0
- package/lib/types/components/ChatTitle.js +15 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
- package/lib/types/components/CodeBlockFrame.js +10 -5
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
- package/lib/types/components/CompactionStatusRow.js +24 -3
- package/lib/types/components/GoalTodoPanel.d.ts +3 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/Markdown.d.ts +9 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +5 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +17 -12
- package/lib/types/components/PromptInput.d.ts +13 -5
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +189 -107
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDetailScene.d.ts +3 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +5 -1
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +8 -5
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +93 -11
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +13 -6
- package/lib/types/components/previewRows.d.ts +19 -0
- package/lib/types/components/previewRows.d.ts.map +1 -0
- package/lib/types/components/previewRows.js +46 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +18 -10
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +4 -3
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +22 -16
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
- package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
- package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
- package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +24 -6
- package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +7 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +11 -1
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +9 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +111 -111
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +16 -10
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +13 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +2 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +2 -1
- package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +192 -13
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +31 -5
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +4 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +24 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
- 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 +4 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +46 -33
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -2
- package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
- package/lib/types/dsh-adapter/contract.d.ts +6 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +7 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +26 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +11 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +4 -0
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/host-entry.js +5 -3
- package/lib/types/dsh-adapter/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -7
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -1
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
- package/lib/types/dsh-adapter/panels.d.ts +21 -7
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +11 -56
- package/lib/types/dsh-adapter/plugin.d.ts +81 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +318 -70
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +65 -10
- package/lib/types/dsh-adapter/presets.d.ts +15 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +51 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
- package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-tools.js +39 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +73 -0
- package/lib/types/dsh-adapter/status.d.ts +88 -1
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +318 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +76 -112
- package/lib/types/extensions.d.ts +1 -1
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/force-production-react.js +3 -3
- package/lib/types/i18n.d.ts +195 -52
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +96 -30
- package/lib/types/ink/colorize.d.ts +7 -1
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +29 -8
- package/lib/types/ink/components/App.d.ts +2 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +1 -0
- 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-program-status.d.ts +78 -0
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-program-status.js +96 -0
- package/lib/types/ink/ink.d.ts +13 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +119 -25
- package/lib/types/ink/output.d.ts +17 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +85 -2
- package/lib/types/ink/parse-keypress.d.ts +1 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +5 -4
- package/lib/types/ink/render-node-to-output.d.ts +2 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +79 -10
- package/lib/types/ink/root.d.ts +8 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +12 -3
- package/lib/types/ink/screen.d.ts +11 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +44 -0
- package/lib/types/ink/selection.d.ts +7 -2
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +187 -44
- package/lib/types/ink/shutdown-input.d.ts +15 -0
- package/lib/types/ink/shutdown-input.d.ts.map +1 -0
- package/lib/types/ink/shutdown-input.js +28 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
- package/lib/types/ink/sixel-cursor-heal.js +62 -0
- package/lib/types/ink/sixel-graphics.d.ts +6 -0
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +18 -0
- package/lib/types/ink/styles.d.ts +8 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification-windows.js +433 -0
- package/lib/types/ink/terminal-notification.d.ts +3 -1
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +4 -1
- package/lib/types/ink/terminal-querier.d.ts +9 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +32 -1
- package/lib/types/ink/terminal.d.ts +23 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +37 -8
- package/lib/types/ink/termio/osc7501.d.ts +102 -0
- package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
- package/lib/types/ink/termio/osc7501.js +229 -0
- package/lib/types/ink/termio/tokenize.js +5 -7
- package/lib/types/panels.d.ts +1 -1
- package/lib/types/panels.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +5 -1
- package/lib/types/screens/Chat.d.ts +6 -6
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +304 -111
- package/lib/types/screens/Launchpad.d.ts +8 -2
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +32 -12
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +31 -21
- package/lib/types/screens/Settings.d.ts +5 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +528 -51
- package/lib/types/screens/StatusLine.d.ts +9 -3
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +91 -15
- package/lib/types/screens/StatusMetrics.d.ts +2 -11
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -14
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
- package/lib/types/sessionMounts.d.ts +14 -0
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +20 -9
- package/lib/types/sessions/format.d.ts +39 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +83 -0
- package/lib/types/sessions/resumeFailure.d.ts +4 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +12 -4
- package/lib/types/sessions/workspaceCounts.d.ts +6 -0
- package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
- package/lib/types/sessions/workspaceCounts.js +24 -0
- package/lib/types/settings/definitions.d.ts +24 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +38 -13
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +113 -5
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +276 -14
- package/lib/types/update.d.ts +46 -36
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +248 -157
- package/lib/types/updateProcess.d.ts +28 -0
- package/lib/types/updateProcess.d.ts.map +1 -0
- package/lib/types/updateProcess.js +135 -0
- package/lib/types/utils/inputWordBoundary.d.ts +5 -0
- package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/inputWordBoundary.js +18 -0
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +6 -1
- package/lib/types/windowsInstaller.d.ts +4 -0
- package/lib/types/windowsInstaller.d.ts.map +1 -0
- package/lib/types/windowsInstaller.js +237 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +127 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
* sanitizes and joins every text contribution into one line. `registerView`
|
|
6
6
|
* is the bounded rich companion for compact, pointer-only surfaces that need
|
|
7
7
|
* host React and themed cells (for example a progress card). It deliberately
|
|
8
|
-
* receives no input, channel, or raw-terminal capability.
|
|
8
|
+
* receives no input, channel, or raw-terminal capability. `setField` is the
|
|
9
|
+
* footer sibling: one keyed text cell admitted into the prompt footer's
|
|
10
|
+
* existing left/right groups, with the same lifecycle, ownership, token, and
|
|
11
|
+
* ledger rules as `set()`.
|
|
9
12
|
*
|
|
10
13
|
* Same split as the dialogs seam: a cordis-free store the chat screen
|
|
11
14
|
* subscribes to, and a thin cordis service validating untrusted input.
|
|
12
15
|
*/
|
|
13
16
|
import { Service } from '@deepseek-ai/cordis';
|
|
14
|
-
import { cleanScalarText } from './sanitize.js';
|
|
17
|
+
import { cleanScalarText, cleanStatusFieldText } from './sanitize.js';
|
|
15
18
|
import { activationFiber, assertCallerContext, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
16
19
|
import { componentIdentityOf } from './component-identity.js';
|
|
17
20
|
import { assertCapabilityShadowPolicy, } from '../adapter/kernel/runtime.js';
|
|
@@ -23,6 +26,16 @@ const TEXT_CELLS = 200;
|
|
|
23
26
|
const MAX_ENTRIES = 20;
|
|
24
27
|
const MAX_VIEW_ROWS = 3;
|
|
25
28
|
const MAX_VIEW_ROW_BUDGET = 6;
|
|
29
|
+
// Footer budget: six plugin cells total (the row is one terminal line), two
|
|
30
|
+
// per activation so one plugin cannot own the whole footer.
|
|
31
|
+
const MAX_FIELDS = 6;
|
|
32
|
+
const MAX_FIELDS_PER_OWNER = 2;
|
|
33
|
+
const FIELD_CELLS_DEFAULT = 16;
|
|
34
|
+
const FIELD_CELLS_MAX = 32;
|
|
35
|
+
const FIELD_DETAIL_CELLS = 160;
|
|
36
|
+
const FIELD_MIN_COLUMNS_MAX = 400;
|
|
37
|
+
const FIELD_SLOTS = new Set(['left-tail', 'right-head', 'right-tail']);
|
|
38
|
+
const FIELD_TONES = new Set(['dim', 'accent', 'success', 'warning', 'error']);
|
|
26
39
|
const HOST_STATUS_OWNER = Object.freeze({ kind: 'host-status-owner' });
|
|
27
40
|
/** Cordis-free text + view store. Render order is first-set/register order
|
|
28
41
|
* (Map insertion order), so plugin contributions do not jump on updates. */
|
|
@@ -35,10 +48,13 @@ export class TuiStatusStore {
|
|
|
35
48
|
// same status text).
|
|
36
49
|
entries = new Map();
|
|
37
50
|
views = new Map();
|
|
51
|
+
fields = new Map();
|
|
38
52
|
// useSyncExternalStore requires a referentially stable snapshot between
|
|
39
53
|
// emits — a fresh array per call would re-render in an infinite loop.
|
|
40
54
|
snapshot = [];
|
|
41
55
|
viewSnapshot = [];
|
|
56
|
+
fieldSnapshot = [];
|
|
57
|
+
onFieldError;
|
|
42
58
|
constructor(onViewError) {
|
|
43
59
|
this.onViewError = onViewError;
|
|
44
60
|
}
|
|
@@ -100,6 +116,54 @@ export class TuiStatusStore {
|
|
|
100
116
|
reportViewError(key, error) {
|
|
101
117
|
this.onViewError?.(key, error);
|
|
102
118
|
}
|
|
119
|
+
/** Current footer fields, first-set first and referentially stable between
|
|
120
|
+
* mutations for `useSyncExternalStore`. */
|
|
121
|
+
getFieldSnapshot() {
|
|
122
|
+
return this.fieldSnapshot;
|
|
123
|
+
}
|
|
124
|
+
/** Store (or overwrite) one admitted field. Slot/option merging already
|
|
125
|
+
* happened in the service; the store only records normalized entries. */
|
|
126
|
+
setField(entry, token, owner, rawOnClick) {
|
|
127
|
+
this.fields.set(entry.key, { entry, token, owner, ...(rawOnClick === undefined ? {} : { rawOnClick }) });
|
|
128
|
+
this.fieldSnapshot = [...this.fields.values()].map(record => record.entry);
|
|
129
|
+
this.emit();
|
|
130
|
+
}
|
|
131
|
+
/** The full admission record for `key` (read by the service to merge an
|
|
132
|
+
* update onto the previous options and to check ownership). */
|
|
133
|
+
fieldEntry(key) {
|
|
134
|
+
return this.fields.get(key);
|
|
135
|
+
}
|
|
136
|
+
fieldCount() {
|
|
137
|
+
return this.fields.size;
|
|
138
|
+
}
|
|
139
|
+
/** How many footer fields one activation currently owns (cap enforcement). */
|
|
140
|
+
fieldsOwnedBy(owner) {
|
|
141
|
+
let count = 0;
|
|
142
|
+
for (const record of this.fields.values()) {
|
|
143
|
+
if (record.owner === owner)
|
|
144
|
+
count += 1;
|
|
145
|
+
}
|
|
146
|
+
return count;
|
|
147
|
+
}
|
|
148
|
+
/** Clear `key` only while it still holds this token AND owner. */
|
|
149
|
+
clearFieldIf(key, token, owner) {
|
|
150
|
+
const current = this.fields.get(key);
|
|
151
|
+
if (owner !== undefined && current?.owner !== owner)
|
|
152
|
+
return false;
|
|
153
|
+
if (current?.token !== token)
|
|
154
|
+
return false;
|
|
155
|
+
this.fields.delete(key);
|
|
156
|
+
this.fieldSnapshot = [...this.fields.values()].map(record => record.entry);
|
|
157
|
+
this.emit();
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
/** UI-side handler for a plugin click that threw; the service logs first. */
|
|
161
|
+
setFieldErrorHandler(handler) {
|
|
162
|
+
this.onFieldError = handler;
|
|
163
|
+
}
|
|
164
|
+
reportFieldError(key, error) {
|
|
165
|
+
this.onFieldError?.(key, error);
|
|
166
|
+
}
|
|
103
167
|
/** Clear `key` only while it still holds the write tagged `token` — a
|
|
104
168
|
* stale disposer must not wipe a newer contribution (even one with
|
|
105
169
|
* identical text). Returns true when this call actually cleared. */
|
|
@@ -115,12 +179,14 @@ export class TuiStatusStore {
|
|
|
115
179
|
}
|
|
116
180
|
/** Drop everything (teardown). */
|
|
117
181
|
clear() {
|
|
118
|
-
if (this.entries.size === 0 && this.views.size === 0)
|
|
182
|
+
if (this.entries.size === 0 && this.views.size === 0 && this.fields.size === 0)
|
|
119
183
|
return;
|
|
120
184
|
this.entries.clear();
|
|
121
185
|
this.views.clear();
|
|
186
|
+
this.fields.clear();
|
|
122
187
|
this.snapshot = [];
|
|
123
188
|
this.viewSnapshot = [];
|
|
189
|
+
this.fieldSnapshot = [];
|
|
124
190
|
this.emit();
|
|
125
191
|
}
|
|
126
192
|
subscribe(listener) {
|
|
@@ -280,6 +346,255 @@ export class TuiStatusRuntime extends Service {
|
|
|
280
346
|
ledgerApplied = true;
|
|
281
347
|
return dispose;
|
|
282
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Insert (or update/clear) one keyed TEXT field in the prompt footer's
|
|
351
|
+
* existing left/right groups — no new row, no plugin component. The field
|
|
352
|
+
* keeps the same admission contract as `set()`: plugin caller, activation
|
|
353
|
+
* ownership, token-based disposers, effect-ledger records, never throws.
|
|
354
|
+
*
|
|
355
|
+
* Unlike `set()`, footer fields are capped (six total, two per activation)
|
|
356
|
+
* and each cell is truncated by the host to `maxCells` (default 16, at most
|
|
357
|
+
* 32) so the row's flex shrinking always has a definite bound. `detail` and
|
|
358
|
+
* `onClick` are optional; a click without a detail line is refused (the
|
|
359
|
+
* footer must never promise an action it cannot explain on hover).
|
|
360
|
+
*
|
|
361
|
+
* Passing `undefined` (or text that sanitizes to nothing) CLEARS the field;
|
|
362
|
+
* a stale disposer cannot clear a newer write for the same key.
|
|
363
|
+
*/
|
|
364
|
+
setField(key, text, options, identity) {
|
|
365
|
+
const state = statusStateFor(this);
|
|
366
|
+
assertCapabilityShadowPolicy('host.status.set', state.runtime.mode, state.runtime.slices);
|
|
367
|
+
const noop = () => { };
|
|
368
|
+
let caller;
|
|
369
|
+
try {
|
|
370
|
+
caller = requirePluginCaller(this.ctx, 'tuiStatus.setField', this);
|
|
371
|
+
}
|
|
372
|
+
catch {
|
|
373
|
+
this.ctx.logger.warn('dsh-tui: tuiStatus.setField requires a live non-root plugin activation');
|
|
374
|
+
return noop;
|
|
375
|
+
}
|
|
376
|
+
const store = state.store;
|
|
377
|
+
// Capture the logger now: a click handler can outlive the activation, and
|
|
378
|
+
// reaching back through a disposed caller proxy would only mask the error.
|
|
379
|
+
const logger = caller.logger;
|
|
380
|
+
if (identity !== undefined) {
|
|
381
|
+
try {
|
|
382
|
+
assertCallerContext(caller, identity, 'tuiStatus.setField');
|
|
383
|
+
}
|
|
384
|
+
catch {
|
|
385
|
+
logger.warn('dsh-tui: tuiStatus.setField rejected an identity belonging to another activation');
|
|
386
|
+
return noop;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const owner = activationFiber(caller);
|
|
390
|
+
if (owner === undefined) {
|
|
391
|
+
logger.warn('dsh-tui: tuiStatus.setField requires a live activation owner');
|
|
392
|
+
return noop;
|
|
393
|
+
}
|
|
394
|
+
let normalized;
|
|
395
|
+
try {
|
|
396
|
+
normalized = String(key ?? '').trim().toLowerCase();
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
logger.warn('dsh-tui: tuiStatus.setField rejected an uncoercible key');
|
|
400
|
+
return noop;
|
|
401
|
+
}
|
|
402
|
+
if (!KEY_PATTERN.test(normalized)) {
|
|
403
|
+
logger.warn('dsh-tui: tuiStatus.setField rejected an invalid key');
|
|
404
|
+
return noop;
|
|
405
|
+
}
|
|
406
|
+
const existing = store.fieldEntry(normalized);
|
|
407
|
+
const ledger = caller.get('tuiEffectLedger');
|
|
408
|
+
// Clear path. Ownership is checked BEFORE anything is removed: another
|
|
409
|
+
// activation's field is not this caller's to clear.
|
|
410
|
+
const clear = () => {
|
|
411
|
+
if (existing === undefined)
|
|
412
|
+
return noop;
|
|
413
|
+
if (existing.owner !== owner) {
|
|
414
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — the field belongs to another activation`);
|
|
415
|
+
return noop;
|
|
416
|
+
}
|
|
417
|
+
if (store.clearFieldIf(normalized, existing.token, owner)) {
|
|
418
|
+
ledger?.record({ operation: 'release', resource: { kind: 'status-field', id: normalized }, result: 'applied' }, identity);
|
|
419
|
+
}
|
|
420
|
+
return noop;
|
|
421
|
+
};
|
|
422
|
+
if (text === undefined || text === '')
|
|
423
|
+
return clear();
|
|
424
|
+
// Scalar-only coercion, same rule as set(): an object must not become
|
|
425
|
+
// "[object Object]" nor be silently downgraded to a clear.
|
|
426
|
+
if (typeof text !== 'string' && typeof text !== 'number' && typeof text !== 'boolean') {
|
|
427
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected non-scalar text for "${normalized}"`);
|
|
428
|
+
return noop;
|
|
429
|
+
}
|
|
430
|
+
let rawOptions;
|
|
431
|
+
if (options === undefined) {
|
|
432
|
+
rawOptions = {};
|
|
433
|
+
}
|
|
434
|
+
else if (typeof options !== 'object' || options === null || Array.isArray(options)) {
|
|
435
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected invalid options for "${normalized}"`);
|
|
436
|
+
return noop;
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
rawOptions = options;
|
|
440
|
+
}
|
|
441
|
+
// The options object is plugin-supplied, so a throwing getter (or a Proxy)
|
|
442
|
+
// must take the documented reject-and-warn path instead of escaping into
|
|
443
|
+
// the caller. Read every option once, inside one guard: the checks below
|
|
444
|
+
// then cannot re-trigger a getter.
|
|
445
|
+
let optionMaxCells;
|
|
446
|
+
let optionSlot;
|
|
447
|
+
let optionTone;
|
|
448
|
+
let optionMinColumns;
|
|
449
|
+
let optionDetail;
|
|
450
|
+
let optionOnClick;
|
|
451
|
+
try {
|
|
452
|
+
optionMaxCells = rawOptions.maxCells;
|
|
453
|
+
optionSlot = rawOptions.slot;
|
|
454
|
+
optionTone = rawOptions.tone;
|
|
455
|
+
optionMinColumns = rawOptions.minColumns;
|
|
456
|
+
optionDetail = rawOptions.detail;
|
|
457
|
+
optionOnClick = rawOptions.onClick;
|
|
458
|
+
}
|
|
459
|
+
catch {
|
|
460
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — unreadable options`);
|
|
461
|
+
return noop;
|
|
462
|
+
}
|
|
463
|
+
const prev = existing?.entry;
|
|
464
|
+
let maxCells = prev?.maxCells ?? FIELD_CELLS_DEFAULT;
|
|
465
|
+
if (optionMaxCells !== undefined) {
|
|
466
|
+
if (typeof optionMaxCells !== 'number' || !Number.isInteger(optionMaxCells)) {
|
|
467
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — maxCells must be an integer`);
|
|
468
|
+
return noop;
|
|
469
|
+
}
|
|
470
|
+
maxCells = Math.min(FIELD_CELLS_MAX, Math.max(1, optionMaxCells));
|
|
471
|
+
}
|
|
472
|
+
const cleaned = cleanStatusFieldText(text, maxCells);
|
|
473
|
+
// Whitespace/control/bidi-only text is a clear (set() folds it the same
|
|
474
|
+
// way). Checked before the remaining option gates: a clear carries no
|
|
475
|
+
// rendered options to validate.
|
|
476
|
+
if (cleaned === '')
|
|
477
|
+
return clear();
|
|
478
|
+
let slot = prev?.slot ?? 'left-tail';
|
|
479
|
+
if (optionSlot !== undefined) {
|
|
480
|
+
if (!FIELD_SLOTS.has(optionSlot)) {
|
|
481
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — invalid slot`);
|
|
482
|
+
return noop;
|
|
483
|
+
}
|
|
484
|
+
slot = optionSlot;
|
|
485
|
+
}
|
|
486
|
+
let tone = prev?.tone ?? 'dim';
|
|
487
|
+
if (optionTone !== undefined) {
|
|
488
|
+
if (!FIELD_TONES.has(optionTone)) {
|
|
489
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — invalid tone`);
|
|
490
|
+
return noop;
|
|
491
|
+
}
|
|
492
|
+
tone = optionTone;
|
|
493
|
+
}
|
|
494
|
+
let minColumns = prev?.minColumns ?? 0;
|
|
495
|
+
if (optionMinColumns !== undefined) {
|
|
496
|
+
if (typeof optionMinColumns !== 'number' || !Number.isInteger(optionMinColumns)) {
|
|
497
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — minColumns must be an integer`);
|
|
498
|
+
return noop;
|
|
499
|
+
}
|
|
500
|
+
minColumns = Math.min(FIELD_MIN_COLUMNS_MAX, Math.max(0, optionMinColumns));
|
|
501
|
+
}
|
|
502
|
+
let detail = prev?.detail;
|
|
503
|
+
if (optionDetail !== undefined) {
|
|
504
|
+
if (typeof optionDetail !== 'string') {
|
|
505
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — detail must be a string`);
|
|
506
|
+
return noop;
|
|
507
|
+
}
|
|
508
|
+
// An explicitly empty/unsafe detail means "no detail", not "keep the old
|
|
509
|
+
// one" — omitted is the only spelling that carries the previous value.
|
|
510
|
+
detail = cleanStatusFieldText(optionDetail, FIELD_DETAIL_CELLS) || undefined;
|
|
511
|
+
}
|
|
512
|
+
let rawOnClick = existing?.rawOnClick;
|
|
513
|
+
if (optionOnClick !== undefined) {
|
|
514
|
+
if (typeof optionOnClick !== 'function') {
|
|
515
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — onClick must be a function`);
|
|
516
|
+
return noop;
|
|
517
|
+
}
|
|
518
|
+
rawOnClick = optionOnClick;
|
|
519
|
+
}
|
|
520
|
+
if (rawOnClick !== undefined && detail === undefined) {
|
|
521
|
+
// D3: a clickable cell owes the user an explanation on hover.
|
|
522
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — onClick requires detail`);
|
|
523
|
+
return noop;
|
|
524
|
+
}
|
|
525
|
+
if (existing === undefined) {
|
|
526
|
+
if (store.fieldCount() >= MAX_FIELDS) {
|
|
527
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}": ${MAX_FIELDS} footer fields already shown`);
|
|
528
|
+
return noop;
|
|
529
|
+
}
|
|
530
|
+
if (store.fieldsOwnedBy(owner) >= MAX_FIELDS_PER_OWNER) {
|
|
531
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}": ${MAX_FIELDS_PER_OWNER} footer fields per plugin already shown`);
|
|
532
|
+
return noop;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
else if (existing.owner !== owner) {
|
|
536
|
+
logger.warn(`dsh-tui: tuiStatus.setField rejected "${normalized}" — the field belongs to another activation`);
|
|
537
|
+
return noop;
|
|
538
|
+
}
|
|
539
|
+
// The wrapper lives HERE, not in the UI: a throwing click and a REJECTED
|
|
540
|
+
// async click share one funnel — both are logged and reported as a toast.
|
|
541
|
+
// A bare `rawOnClick()` leaves a returned promise unobserved, and an
|
|
542
|
+
// unhandled rejection is fatal to the process guard; `shortcuts.ts` uses
|
|
543
|
+
// the same deferred funnel for its handlers.
|
|
544
|
+
const onClick = rawOnClick === undefined
|
|
545
|
+
? undefined
|
|
546
|
+
: () => {
|
|
547
|
+
Promise.resolve()
|
|
548
|
+
.then(() => rawOnClick())
|
|
549
|
+
.catch((error) => {
|
|
550
|
+
const failure = error instanceof Error ? error : new Error(String(error));
|
|
551
|
+
logger.warn(`dsh-tui: tuiStatus.setField "${normalized}" click failed: ${failure.message}`);
|
|
552
|
+
store.reportFieldError(normalized, failure);
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
const token = state.nextToken++;
|
|
556
|
+
const entry = Object.freeze({
|
|
557
|
+
key: normalized,
|
|
558
|
+
text: cleaned,
|
|
559
|
+
slot,
|
|
560
|
+
tone,
|
|
561
|
+
maxCells,
|
|
562
|
+
minColumns,
|
|
563
|
+
...(detail === undefined ? {} : { detail }),
|
|
564
|
+
...(onClick === undefined ? {} : { onClick }),
|
|
565
|
+
});
|
|
566
|
+
store.setField(entry, token, owner, rawOnClick);
|
|
567
|
+
const had = existing !== undefined;
|
|
568
|
+
let disposed = false;
|
|
569
|
+
let ledgerApplied = false;
|
|
570
|
+
let ownerCleanup;
|
|
571
|
+
const dispose = () => {
|
|
572
|
+
if (disposed)
|
|
573
|
+
return;
|
|
574
|
+
disposed = true;
|
|
575
|
+
if (store.clearFieldIf(normalized, token, owner) && ledgerApplied) {
|
|
576
|
+
caller.get('tuiEffectLedger')?.record({ operation: 'release', resource: { kind: 'status-field', id: normalized }, result: 'applied' }, identity);
|
|
577
|
+
}
|
|
578
|
+
const cleanup = ownerCleanup;
|
|
579
|
+
ownerCleanup = undefined;
|
|
580
|
+
cleanup?.();
|
|
581
|
+
};
|
|
582
|
+
const bound = bindCallerEffect(caller, dispose, cleanup => {
|
|
583
|
+
ownerCleanup = cleanup;
|
|
584
|
+
});
|
|
585
|
+
// bindCallerEffect runs the disposer itself when registration fails, so the
|
|
586
|
+
// store entry is already rolled back here.
|
|
587
|
+
if (!bound)
|
|
588
|
+
return noop;
|
|
589
|
+
ledger?.record({
|
|
590
|
+
operation: had ? 'replace' : 'bind',
|
|
591
|
+
resource: { kind: 'status-field', id: normalized },
|
|
592
|
+
result: 'applied',
|
|
593
|
+
...(had ? { replaces: { resourceId: normalized } } : {}),
|
|
594
|
+
}, identity);
|
|
595
|
+
ledgerApplied = true;
|
|
596
|
+
return dispose;
|
|
597
|
+
}
|
|
283
598
|
/**
|
|
284
599
|
* Register a compact React view above the prompt. The component receives
|
|
285
600
|
* the host's React plus a pointer-only UI kit; it owns its live data via an
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent Teams
|
|
2
|
+
* Agent Teams status at run time (issue #1241, see
|
|
3
3
|
* docs/agent-teams-design.md「开关机制」).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* drops its layer through the host plugin manager
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* Switching is the upstream team bundle itself: `/plugin enable|disable`
|
|
6
|
+
* selects or drops its layer through the host plugin manager, which persists
|
|
7
|
+
* to the profile and, with `hmr` mounted, applies at once. `/team` is the
|
|
8
|
+
* read-only side: it reports the bundle, the service and this session's
|
|
9
|
+
* teammates, and is exposed only while the `agentTeams` service is mounted —
|
|
10
|
+
* the same availability the desktop UI gives the feature. A typed `/team`
|
|
11
|
+
* before that still answers with the enable route instead of reaching the
|
|
12
|
+
* model.
|
|
13
|
+
*
|
|
14
|
+
* What stays here besides the command is the one decision that cannot live in
|
|
15
|
+
* a preset — which legacy delegation tools a request carries.
|
|
12
16
|
*
|
|
13
17
|
* @module
|
|
14
18
|
*/
|
|
15
19
|
import type { Context } from '@deepseek-ai/cordis';
|
|
16
20
|
import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
|
|
17
|
-
import
|
|
21
|
+
import type { LocalCommand } from '../commands.js';
|
|
22
|
+
import type { TeamActiveMembers } from './plugin-manage.js';
|
|
23
|
+
/**
|
|
24
|
+
* Whether the team service is mounted. This is the one signal `/team` appears
|
|
25
|
+
* on: the desktop UI shows the same feature only while its service is there.
|
|
26
|
+
* @param ctx - Host context of the composition root.
|
|
27
|
+
*/
|
|
28
|
+
export declare function teamServiceActive(ctx: Context): boolean;
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
30
|
+
* Hide `/team` from Help and `/` completion while the service is not mounted.
|
|
31
|
+
* The typed form stays a local command (`isLocalCommandName` still knows the
|
|
32
|
+
* name), so it can answer with the enable route instead of becoming text sent
|
|
33
|
+
* to the model.
|
|
34
|
+
* @param commands - The current command catalog.
|
|
35
|
+
* @param visible - Whether the team service is mounted.
|
|
36
|
+
* @returns The catalog with `/team` removed when it is not.
|
|
26
37
|
*/
|
|
27
|
-
export declare function
|
|
38
|
+
export declare function withTeamCommandVisibility(commands: readonly LocalCommand[], visible: boolean): readonly LocalCommand[];
|
|
28
39
|
/**
|
|
29
40
|
* Keep one delegation tool set per request. Presets keep their legacy rows,
|
|
30
41
|
* so whether the team replaces them is decided where the tools are known: an
|
|
@@ -39,36 +50,34 @@ export declare function teamBundleSpec(kernel: string | undefined): string | und
|
|
|
39
50
|
export declare function filterTeamReplacedTools(assembly: PromptAssembly): PromptAssembly;
|
|
40
51
|
/** What `/team` was asked. */
|
|
41
52
|
export type TeamCommand = {
|
|
42
|
-
readonly kind: '
|
|
53
|
+
readonly kind: 'status';
|
|
54
|
+
}
|
|
55
|
+
/** `on` / `off`: the switch moved to `/plugin enable|disable`. */
|
|
56
|
+
| {
|
|
57
|
+
readonly kind: 'switch';
|
|
43
58
|
} | {
|
|
44
59
|
readonly kind: 'unknown';
|
|
45
60
|
readonly sub: string;
|
|
46
61
|
};
|
|
47
62
|
export declare function parseTeamArgs(args: string): TeamCommand;
|
|
48
|
-
/** What the screen supplies: the
|
|
49
|
-
export interface TeamCommandSink
|
|
63
|
+
/** What the screen supplies: the bound session's live team counts. */
|
|
64
|
+
export interface TeamCommandSink {
|
|
50
65
|
/** Teammates of the bound session, how many are running or provisioning, and how many may be running. */
|
|
51
66
|
readonly members: () => {
|
|
52
67
|
readonly total: number;
|
|
53
68
|
} & TeamActiveMembers;
|
|
54
69
|
}
|
|
55
|
-
/**
|
|
56
|
-
export type
|
|
57
|
-
readonly kind: 'flow';
|
|
58
|
-
readonly flow: PluginManageFlow;
|
|
59
|
-
} | {
|
|
60
|
-
readonly kind: 'lines';
|
|
61
|
-
readonly lines: Promise<readonly string[]>;
|
|
62
|
-
};
|
|
70
|
+
/** The entry the screen calls: argument text in, report lines out. */
|
|
71
|
+
export type TeamCommandEntry = (args: string, sink: TeamCommandSink) => Promise<readonly string[]>;
|
|
63
72
|
/**
|
|
64
|
-
* Wire `/team` to the running composition.
|
|
73
|
+
* Wire `/team` to the running composition. The command only reports; the
|
|
74
|
+
* bundle switch is `/plugin enable|disable`, which shares the lifecycle flow
|
|
75
|
+
* and its confirmations.
|
|
65
76
|
* @param ctx - Host context of the composition root.
|
|
66
|
-
* @param options - The profile a
|
|
67
|
-
* DSH version (this package's entry; otherwise the installed one is read).
|
|
77
|
+
* @param options - The profile a CLI route names.
|
|
68
78
|
* @returns the command entry the screen calls.
|
|
69
79
|
*/
|
|
70
80
|
export declare function createTeamCommandEntry(ctx: Context, options?: {
|
|
71
81
|
readonly profileName?: string | undefined;
|
|
72
|
-
|
|
73
|
-
}): (args: string, sink: TeamCommandSink) => TeamCommandOutcome;
|
|
82
|
+
}): TeamCommandEntry;
|
|
74
83
|
//# sourceMappingURL=team-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAS3D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,YAAY,EAAE,CAEtH;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAIhF;AAED,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE;AAC7B,kEAAkE;GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKvD;AAED,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,yGAAyG;IACzG,QAAQ,CAAC,OAAO,EAAE,MAAM;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,iBAAiB,CAAA;CACvE;AAED,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;AAElG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAC1D,gBAAgB,CAiBlB"}
|