@deepseek-harness-tui/dsh-tui 0.18.0 → 0.20.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 +90 -59
- package/bin/dsh-tui.js +46 -3
- package/cordis.patch.yml +5 -3
- package/cordis.yml +3 -2
- package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
- package/guide/dsh-tui-guide/codex-backend.md +2 -2
- package/guide/dsh-tui-guide/configuration.en.md +7 -2
- package/guide/dsh-tui-guide/configuration.md +7 -2
- package/guide/dsh-tui-guide/getting-started.en.md +168 -4
- package/guide/dsh-tui-guide/getting-started.md +121 -14
- package/guide/dsh-tui-guide/interaction.en.md +11 -10
- package/guide/dsh-tui-guide/interaction.md +5 -4
- package/guide/dsh-tui-guide/user-guide.en.md +12 -6
- package/guide/dsh-tui-guide/user-guide.md +12 -6
- package/lib/settings.json +24 -8
- package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +67 -8
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +14 -5
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/agent/session.d.ts +5 -0
- package/lib/types/agent/session.d.ts.map +1 -1
- package/lib/types/backends/claude/tools.d.ts.map +1 -1
- package/lib/types/backends/claude/tools.js +8 -3
- package/lib/types/backends/claude/translate/core.d.ts +2 -2
- package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/core.js +10 -6
- package/lib/types/backends/codex/session/commands.d.ts +2 -0
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
- package/lib/types/backends/codex/session/commands.js +8 -4
- package/lib/types/backends/codex/session/input.d.ts +11 -7
- package/lib/types/backends/codex/session/input.d.ts.map +1 -1
- package/lib/types/backends/codex/session/input.js +68 -15
- package/lib/types/backends/codex/session/session.d.ts.map +1 -1
- package/lib/types/backends/codex/session/session.js +2 -3
- package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/presentation.js +5 -2
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/permissions.d.ts +15 -0
- package/lib/types/channel/permissions.d.ts.map +1 -1
- package/lib/types/channel/permissions.js +28 -0
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +89 -11
- package/lib/types/channel/questions.d.ts +45 -3
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/questions.js +43 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +8 -4
- package/lib/types/channel/subagent-failure.d.ts +49 -0
- package/lib/types/channel/subagent-failure.d.ts.map +1 -0
- package/lib/types/channel/subagent-failure.js +59 -0
- package/lib/types/channel/transcript.d.ts +17 -0
- package/lib/types/channel/transcript.d.ts.map +1 -1
- package/lib/types/channel/transcript.js +35 -0
- package/lib/types/commands.js +2 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +14 -10
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +61 -6
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +3 -2
- package/lib/types/components/StarPrompt.d.ts +5 -3
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +56 -6
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +1 -1
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +9 -2
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +126 -25
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
- package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/revealScope.d.ts +15 -0
- package/lib/types/components/revealScope.d.ts.map +1 -0
- package/lib/types/components/revealScope.js +17 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
- package/lib/types/components/smoothReveal.d.ts +36 -6
- package/lib/types/components/smoothReveal.d.ts.map +1 -1
- package/lib/types/components/smoothReveal.js +92 -21
- package/lib/types/components/teamRoster.d.ts +6 -3
- package/lib/types/components/teamRoster.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
- package/lib/types/dsh-adapter/approvals.d.ts +19 -0
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +17 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +12 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +21 -4
- package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
- package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
- package/lib/types/dsh-adapter/channel/emitter.js +1 -1
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +15 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
- 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 +26 -9
- package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -4
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +185 -36
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
- package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
- package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +13 -4
- package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
- package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
- package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +2 -2
- package/lib/types/dsh-adapter/contract.d.ts +29 -3
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +48 -5
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
- package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
- package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
- package/lib/types/dsh-adapter/fresh-agent.js +60 -11
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +60 -11
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-contract.js +5 -3
- package/lib/types/dsh-adapter/host-dsh.d.ts +2 -8
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +30 -6
- package/lib/types/dsh-adapter/host-entry.js +4 -0
- package/lib/types/dsh-adapter/index.d.ts +9 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +5 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
- package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
- package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
- package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/index.js +44 -0
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
- package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
- package/lib/types/dsh-adapter/oauth/service.js +5 -6
- package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +3 -2
- package/lib/types/dsh-adapter/plugin.d.ts +237 -6
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +751 -67
- package/lib/types/dsh-adapter/presets.d.ts +38 -11
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +46 -17
- 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/questions.d.ts +3 -4
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +1 -1
- package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
- package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
- package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/session-projection-store.js +30 -23
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +4 -1
- package/lib/types/dsh-adapter/subagents.d.ts +6 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +32 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +46 -27
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +157 -29
- package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
- package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-roster.js +206 -39
- package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
- package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-tools.js +81 -26
- package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
- package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
- package/lib/types/dsh-adapter/tool-scope.js +127 -0
- package/lib/types/dsh-adapter/types.d.ts +2 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/heldInputs.d.ts +55 -16
- package/lib/types/heldInputs.d.ts.map +1 -1
- package/lib/types/heldInputs.js +277 -41
- package/lib/types/i18n.d.ts +292 -20
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +89 -13
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +8 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +13 -3
- package/lib/types/ink/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +7 -6
- package/lib/types/ink/flush-tick.d.ts +6 -0
- package/lib/types/ink/flush-tick.d.ts.map +1 -1
- package/lib/types/ink/flush-tick.js +31 -0
- package/lib/types/ink/hit-test.d.ts +2 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +10 -0
- package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.js +3 -2
- package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-title.js +23 -3
- package/lib/types/ink/ink.d.ts +1 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +7 -4
- package/lib/types/ink/jumpback-state.d.ts +33 -0
- package/lib/types/ink/jumpback-state.d.ts.map +1 -0
- package/lib/types/ink/jumpback-state.js +51 -0
- package/lib/types/ink/jumpback.d.ts +78 -0
- package/lib/types/ink/jumpback.d.ts.map +1 -0
- package/lib/types/ink/jumpback.js +515 -0
- package/lib/types/ink/log-update.js +37 -14
- package/lib/types/ink/notify-helper/activate.cs +836 -0
- package/lib/types/ink/notify-helper/compile.d.ts +30 -0
- package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
- package/lib/types/ink/notify-helper/compile.js +235 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +25 -0
- package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.js +14 -21
- package/lib/types/ink/terminal-notification.d.ts +31 -2
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +51 -0
- package/lib/types/ink/terminal.d.ts +15 -3
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +38 -9
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +1 -1
- package/lib/types/screens/Chat.d.ts +4 -3
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +81 -11
- package/lib/types/screens/SessionSupervisor.d.ts +3 -6
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +5 -8
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
- package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +1 -1
- package/lib/types/sessionMounts.d.ts +12 -5
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +33 -6
- package/lib/types/settings/definitions.d.ts +12 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +15 -7
- package/lib/types/update.d.ts +412 -20
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +2094 -193
- package/lib/types/updateHost.d.ts +198 -0
- package/lib/types/updateHost.d.ts.map +1 -0
- package/lib/types/updateHost.js +608 -0
- package/lib/types/utils/processName.d.ts +16 -0
- package/lib/types/utils/processName.d.ts.map +1 -0
- package/lib/types/utils/processName.js +27 -0
- package/package.json +114 -111
- package/presets/liangshen/agent.cordis.yml +4 -0
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
import type { Context } from '@deepseek-ai/cordis';
|
|
19
19
|
import type { AgentSetup } from '@deepseek-ai/dsh-agent';
|
|
20
20
|
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
21
|
-
import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
|
|
22
21
|
import { type ModelRoute } from '../modelRoute.js';
|
|
23
22
|
/** The composition inputs for `agents.create`/`agents.resume`. */
|
|
24
23
|
export interface PresetComposition {
|
|
@@ -106,28 +105,56 @@ export declare function presetHidesHostAskTool(presetId: string | undefined): bo
|
|
|
106
105
|
* exactly one persistent shell tool, and host-layer contributors the person
|
|
107
106
|
* switched on elsewhere must not become extra ones.
|
|
108
107
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
108
|
+
* The carve-outs live in two places since 0.2.2 split the prompt assembly
|
|
109
|
+
* from the tool declarations: this section filter, and `presetToolDeny`
|
|
110
|
+
* below, which {@link ./tool-scope.ts} hands to the registry's
|
|
111
|
+
* `tools.restrict()` on each agent's own scope. Both cover:
|
|
111
112
|
* - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
|
|
112
113
|
* - `@deepseek-ai/dsh-experimental-session-search`, which registers five
|
|
113
114
|
* read-only tools AND a usage-guidance section. The upstream bundle promises
|
|
114
115
|
* "every preset including minimal"; this app intentionally deviates, because
|
|
115
116
|
* Minimal's published promise is one persistent shell and a TUI process runs
|
|
116
|
-
* sessions under several presets at once — hence
|
|
117
|
-
* rather than a registry
|
|
117
|
+
* sessions under several presets at once — hence a per-agent scope
|
|
118
|
+
* restriction rather than a global registry decision that would leak;
|
|
118
119
|
* - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
|
|
119
120
|
* host-layer tool, no section), which would move the session away from the
|
|
120
121
|
* persistent shell.
|
|
121
122
|
*
|
|
122
|
-
* This is per-
|
|
123
|
-
*
|
|
124
|
-
*
|
|
123
|
+
* This is per-agent because one TUI process can resume, create, or recompose
|
|
124
|
+
* sessions under different presets. The session log remains the source of
|
|
125
|
+
* truth for the active preset.
|
|
125
126
|
*
|
|
126
|
-
* @param assembly -
|
|
127
|
+
* @param assembly - Prompt presentation for one model request.
|
|
127
128
|
* @param presetId - Preset recorded for the requesting session.
|
|
128
|
-
* @returns The original
|
|
129
|
+
* @returns The original presentation when nothing is carved out, else the filtered copy.
|
|
129
130
|
*/
|
|
130
|
-
export declare function
|
|
131
|
+
export declare function filterMinimalPresetSections<T extends {
|
|
132
|
+
readonly sections: readonly {
|
|
133
|
+
readonly name: string;
|
|
134
|
+
}[];
|
|
135
|
+
}>(assembly: T, presetId: string | undefined): T;
|
|
136
|
+
/**
|
|
137
|
+
* Legacy hosts let the assembly waterfall own tool declarations. Keep the same
|
|
138
|
+
* safety carve-outs there; 0.2.2 presentations have no `tools` and use the
|
|
139
|
+
* registry restrictions instead. The structural type accepts both API lines.
|
|
140
|
+
*/
|
|
141
|
+
export declare function filterMinimalPresetTools<T extends {
|
|
142
|
+
readonly sections: readonly {
|
|
143
|
+
readonly name: string;
|
|
144
|
+
}[];
|
|
145
|
+
readonly tools?: readonly {
|
|
146
|
+
readonly name: string;
|
|
147
|
+
}[];
|
|
148
|
+
}>(assembly: T, presetId: string | undefined): T;
|
|
149
|
+
/**
|
|
150
|
+
* Host-layer tools the preset must not expose, for the per-agent registry
|
|
151
|
+
* restriction (`tools.restrict()`); see {@link filterMinimalPresetSections}
|
|
152
|
+
* for why these carve-outs exist.
|
|
153
|
+
*
|
|
154
|
+
* @param presetId - Preset recorded for the requesting session.
|
|
155
|
+
* @returns Tool names to deny on that agent, empty when the preset is untouched.
|
|
156
|
+
*/
|
|
157
|
+
export declare function presetToolDeny(presetId: string | undefined): readonly string[];
|
|
131
158
|
/**
|
|
132
159
|
* Read a service the way a joined agent sees it: through the preset scope
|
|
133
160
|
* chain when a roster is mounted (preset realms hide e.g. `compaction` from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAuDtE,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAA;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBA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E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAKpG"}
|
|
@@ -189,38 +189,67 @@ export function presetHidesHostAskTool(presetId) {
|
|
|
189
189
|
* exactly one persistent shell tool, and host-layer contributors the person
|
|
190
190
|
* switched on elsewhere must not become extra ones.
|
|
191
191
|
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
192
|
+
* The carve-outs live in two places since 0.2.2 split the prompt assembly
|
|
193
|
+
* from the tool declarations: this section filter, and `presetToolDeny`
|
|
194
|
+
* below, which {@link ./tool-scope.ts} hands to the registry's
|
|
195
|
+
* `tools.restrict()` on each agent's own scope. Both cover:
|
|
194
196
|
* - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
|
|
195
197
|
* - `@deepseek-ai/dsh-experimental-session-search`, which registers five
|
|
196
198
|
* read-only tools AND a usage-guidance section. The upstream bundle promises
|
|
197
199
|
* "every preset including minimal"; this app intentionally deviates, because
|
|
198
200
|
* Minimal's published promise is one persistent shell and a TUI process runs
|
|
199
|
-
* sessions under several presets at once — hence
|
|
200
|
-
* rather than a registry
|
|
201
|
+
* sessions under several presets at once — hence a per-agent scope
|
|
202
|
+
* restriction rather than a global registry decision that would leak;
|
|
201
203
|
* - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
|
|
202
204
|
* host-layer tool, no section), which would move the session away from the
|
|
203
205
|
* persistent shell.
|
|
204
206
|
*
|
|
205
|
-
* This is per-
|
|
206
|
-
*
|
|
207
|
-
*
|
|
207
|
+
* This is per-agent because one TUI process can resume, create, or recompose
|
|
208
|
+
* sessions under different presets. The session log remains the source of
|
|
209
|
+
* truth for the active preset.
|
|
208
210
|
*
|
|
209
|
-
* @param assembly -
|
|
211
|
+
* @param assembly - Prompt presentation for one model request.
|
|
210
212
|
* @param presetId - Preset recorded for the requesting session.
|
|
211
|
-
* @returns The original
|
|
213
|
+
* @returns The original presentation when nothing is carved out, else the filtered copy.
|
|
214
|
+
*/
|
|
215
|
+
export function filterMinimalPresetSections(assembly, presetId) {
|
|
216
|
+
if (!isMinimalPreset(presetId))
|
|
217
|
+
return assembly;
|
|
218
|
+
const sections = assembly.sections.filter(section => section.name !== SESSION_SEARCH_SECTION);
|
|
219
|
+
if (sections.length === assembly.sections.length)
|
|
220
|
+
return assembly;
|
|
221
|
+
return { ...assembly, sections };
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Legacy hosts let the assembly waterfall own tool declarations. Keep the same
|
|
225
|
+
* safety carve-outs there; 0.2.2 presentations have no `tools` and use the
|
|
226
|
+
* registry restrictions instead. The structural type accepts both API lines.
|
|
212
227
|
*/
|
|
213
228
|
export function filterMinimalPresetTools(assembly, presetId) {
|
|
229
|
+
const presentation = filterMinimalPresetSections(assembly, presetId);
|
|
230
|
+
if (presentation.tools === undefined)
|
|
231
|
+
return presentation;
|
|
232
|
+
const deny = new Set(presetToolDeny(presetId));
|
|
233
|
+
const tools = presentation.tools.filter(tool => !deny.has(tool.name));
|
|
234
|
+
return tools.length === presentation.tools.length ? presentation : { ...presentation, tools };
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Host-layer tools the preset must not expose, for the per-agent registry
|
|
238
|
+
* restriction (`tools.restrict()`); see {@link filterMinimalPresetSections}
|
|
239
|
+
* for why these carve-outs exist.
|
|
240
|
+
*
|
|
241
|
+
* @param presetId - Preset recorded for the requesting session.
|
|
242
|
+
* @returns Tool names to deny on that agent, empty when the preset is untouched.
|
|
243
|
+
*/
|
|
244
|
+
export function presetToolDeny(presetId) {
|
|
214
245
|
const minimal = isMinimalPreset(presetId);
|
|
215
246
|
const persistentShell = presetId !== undefined && PERSISTENT_SHELL_PRESETS.has(presetId);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return assembly;
|
|
223
|
-
return { ...assembly, tools, sections };
|
|
247
|
+
const deny = [];
|
|
248
|
+
if (persistentShell)
|
|
249
|
+
deny.push(WORKTREE_TOOL);
|
|
250
|
+
if (minimal)
|
|
251
|
+
deny.push(ASK_USER_TOOL, ...SESSION_SEARCH_TOOLS);
|
|
252
|
+
return deny;
|
|
224
253
|
}
|
|
225
254
|
/**
|
|
226
255
|
* Read a service the way a joined agent sees it: through the preset scope
|
|
@@ -23,7 +23,7 @@ export type ExitRequestAnswer = 'exiting' | 'pending' | 'supervising' | 'refused
|
|
|
23
23
|
export interface ProcessExitSeam {
|
|
24
24
|
request?: (request: ExitRequest) => ExitRequestAnswer;
|
|
25
25
|
}
|
|
26
|
-
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.
|
|
26
|
+
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.2-rc.1): the dispose bound. */
|
|
27
27
|
export declare const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
28
28
|
/**
|
|
29
29
|
* End the process by `signal`. Only the entry's own listeners come off, so the
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* tmux and service managers); a second signal forces the exit at once.
|
|
7
7
|
*/
|
|
8
8
|
export const TERMINATION_SIGNALS = ['SIGTERM', 'SIGHUP', 'SIGINT'];
|
|
9
|
-
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.
|
|
9
|
+
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.2-rc.1): the dispose bound. */
|
|
10
10
|
export const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
11
11
|
/** Last-resort bound for a funnel exit: outlasts its terminal cleanup plus the dispose bound. */
|
|
12
12
|
const BACKSTOP_MS = PROCESS_SHUTDOWN_TIMEOUT_MS + 2000;
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { compositionRoot } from './host-access.js';
|
|
20
20
|
import { type AdapterRuntimeOptions } from '../adapter/kernel/runtime.js';
|
|
21
|
-
import { type
|
|
22
|
-
import { QuestionStore as SharedQuestionStore } from '../channel/questions.js';
|
|
21
|
+
import { QuestionStore as SharedQuestionStore, type QuestionAnswer, type QuestionRequest } from '../channel/questions.js';
|
|
23
22
|
export type { QuestionDraft, QuestionSelection, QuestionSnapshot } from '../channel/questions.js';
|
|
24
23
|
/** The shared store, rejecting interruptions with the DSH protocol error. */
|
|
25
24
|
export declare class QuestionStore extends SharedQuestionStore {
|
|
@@ -31,9 +30,9 @@ export declare class QuestionStore extends SharedQuestionStore {
|
|
|
31
30
|
* capability's audited entry (`verify:adapter-shadow`), and again,
|
|
32
31
|
* idempotently, by the shared store every asker goes through.
|
|
33
32
|
*/
|
|
34
|
-
ask(request:
|
|
33
|
+
ask(request: QuestionRequest, options?: {
|
|
35
34
|
redact?: boolean;
|
|
36
|
-
}): Promise<
|
|
35
|
+
}): Promise<QuestionAnswer>;
|
|
37
36
|
}
|
|
38
37
|
/** Host-only registration used by the TUI plugin bootstrap. */
|
|
39
38
|
export declare function bindQuestionStore(ctx: Parameters<typeof compositionRoot>[0], store: QuestionStore): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzH,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEjG,6EAA6E;AAC7E,qBAAa,aAAc,SAAQ,mBAAmB;gBACxC,OAAO,GAAE,qBAA+C;IAIpE;;;;;;OAMG;IACM,GAAG,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;CAIhG;AAID,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAGxG;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,SAAS,CAGtG"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { compositionRoot } from './host-access.js';
|
|
20
20
|
import { assertCapabilityShadowPolicy, defaultAdapterRuntime, } from '../adapter/kernel/runtime.js';
|
|
21
|
-
import { UserQuestionError
|
|
21
|
+
import { UserQuestionError } from '@deepseek-ai/dsh-user-questions';
|
|
22
22
|
import { QuestionStore as SharedQuestionStore } from '../channel/questions.js';
|
|
23
23
|
/** The shared store, rejecting interruptions with the DSH protocol error. */
|
|
24
24
|
export class QuestionStore extends SharedQuestionStore {
|
|
@@ -36,13 +36,13 @@ function sessionListMetadataDefinition() {
|
|
|
36
36
|
}
|
|
37
37
|
/** Register before creating the boot agent, so its first checkpoint has the key. */
|
|
38
38
|
export function attachSessionListMetadata(ctx) {
|
|
39
|
-
ctx.inject(['sessionProjections'], ((projectionCtx) => {
|
|
39
|
+
ctx.inject(['sessionProjections'], (async (projectionCtx) => {
|
|
40
40
|
const registry = projectionCtx.sessionProjections;
|
|
41
41
|
if (typeof registry?.register !== 'function')
|
|
42
42
|
return;
|
|
43
43
|
try {
|
|
44
44
|
// The host binds this registration to the calling context's fiber.
|
|
45
|
-
registry.register(sessionListMetadataDefinition());
|
|
45
|
+
await registry.register(sessionListMetadataDefinition());
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
48
|
try {
|
|
@@ -25,7 +25,7 @@ export interface SessionProjectionStoreOptions<T> {
|
|
|
25
25
|
/** Narrow one wire value of a session; anything else is dropped, never half-rendered. */
|
|
26
26
|
narrow(value: unknown, sessionId: string): T | undefined;
|
|
27
27
|
/** Map the bound session to the session it reads (default: itself). */
|
|
28
|
-
watch?(session: unknown): WatchedSession;
|
|
28
|
+
watch?(session: unknown): WatchedSession | undefined;
|
|
29
29
|
/** Read-failure sink, reported once per attached registry (the composition root's logger). */
|
|
30
30
|
warn?(message: string): void;
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-projection-store.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/session-projection-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,yFAAyF;IACzF,MAAM,CAAC,K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,OAAO,GAAG,IAAI,CAAA;IAC/C;;;;OAIG;IACH,MAAM,IAAI,IAAI,CAAA;IACd,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,mEAAmE;IACnE,IAAI,IAAI,CAAC,GAAG,SAAS,CAAA;IACrB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IAC3C,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CACtC;AASD,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,OAAO,EAAE,6BAA6B,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CA6FpH;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,GAAG,IAAI,CAmB/G"}
|
|
@@ -45,28 +45,7 @@ export function createSessionProjectionStore(options) {
|
|
|
45
45
|
value = undefined;
|
|
46
46
|
emit();
|
|
47
47
|
},
|
|
48
|
-
seed(session)
|
|
49
|
-
if (session === null || session === undefined)
|
|
50
|
-
return;
|
|
51
|
-
bound = session;
|
|
52
|
-
const next = options.watch?.(session) ?? { id: sessionIdOf(session), session };
|
|
53
|
-
if (next.id !== watched?.id) {
|
|
54
|
-
raw = undefined;
|
|
55
|
-
if (value !== undefined) {
|
|
56
|
-
value = undefined;
|
|
57
|
-
emit();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
watched = next;
|
|
61
|
-
if (registry === undefined || next.session === undefined)
|
|
62
|
-
return;
|
|
63
|
-
try {
|
|
64
|
-
store.update(next.id, registry.snapshot(next.session, [options.key]).values[options.key]);
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
store.noteReadFailure(error);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
48
|
+
seed: session => { seedValue(session); },
|
|
70
49
|
update(sessionId, next) {
|
|
71
50
|
if (sessionId !== watched?.id)
|
|
72
51
|
return;
|
|
@@ -89,7 +68,7 @@ export function createSessionProjectionStore(options) {
|
|
|
89
68
|
// included, is re-narrowed.
|
|
90
69
|
const held = raw;
|
|
91
70
|
raw = UNREAD;
|
|
92
|
-
|
|
71
|
+
seedValue(bound);
|
|
93
72
|
// No snapshot was read (no registry, the watched session not live, or a
|
|
94
73
|
// failed read): narrow the value already held instead.
|
|
95
74
|
if (raw === UNREAD && held !== UNREAD && watched !== undefined)
|
|
@@ -114,6 +93,34 @@ export function createSessionProjectionStore(options) {
|
|
|
114
93
|
options.warn?.(`dsh-tui: ${options.key} projection read failed: ${detail}`);
|
|
115
94
|
},
|
|
116
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Bind/read one session. Kept private so `reseed` never re-enters an
|
|
98
|
+
* overridden `seed` (a composite store would otherwise rebind its companion
|
|
99
|
+
* projection and narrow the old session's value against the new one).
|
|
100
|
+
* @param session - the session to bind and read a baseline for.
|
|
101
|
+
*/
|
|
102
|
+
function seedValue(session) {
|
|
103
|
+
if (session === null || session === undefined)
|
|
104
|
+
return;
|
|
105
|
+
bound = session;
|
|
106
|
+
const next = options.watch === undefined ? { id: sessionIdOf(session), session } : options.watch(session);
|
|
107
|
+
if (next?.id !== watched?.id) {
|
|
108
|
+
raw = undefined;
|
|
109
|
+
if (value !== undefined) {
|
|
110
|
+
value = undefined;
|
|
111
|
+
emit();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
watched = next;
|
|
115
|
+
if (registry === undefined || next?.session === undefined)
|
|
116
|
+
return;
|
|
117
|
+
try {
|
|
118
|
+
store.update(next.id, registry.snapshot(next.session, [options.key]).values[options.key]);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
store.noteReadFailure(error);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
117
124
|
return store;
|
|
118
125
|
}
|
|
119
126
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionTree.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/sessionTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAiE,MAAM,qCAAqC,CAAA;AAC9J,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC9J;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"sessionTree.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/sessionTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAiE,MAAM,qCAAqC,CAAA;AAC9J,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC9J;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAI5D,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,CAAA;AACrE,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAgD,CAAA;AAE9F,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,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,IAAI,GAAG,QAAQ,EAAE,CA0F/F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,MAAM,GACZ,QAAQ,EAAE,CA+FZ;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,MAAM,CAaR"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CompactionPreviews } from './compat/compaction-previews.js';
|
|
1
2
|
import { isCompactionCheckpointSource, toolResultPayload } from './compat/messages.js';
|
|
2
3
|
export const TREE_FILTERS = ['default', 'no-tools', 'user-only', 'all'];
|
|
3
4
|
/**
|
|
@@ -312,7 +313,9 @@ export function extractEntries(sessionId, events) {
|
|
|
312
313
|
const openTools = new Map();
|
|
313
314
|
/** Turns whose turn/end said aborted/interrupted. */
|
|
314
315
|
const abortedTurns = new Set();
|
|
316
|
+
const compactionPreviews = new CompactionPreviews();
|
|
315
317
|
for (const event of coalesceReplayEvents(events)) {
|
|
318
|
+
compactionPreviews.observe(event);
|
|
316
319
|
if (event.type === 'turn/start') {
|
|
317
320
|
turnsSeen += 1;
|
|
318
321
|
inFirstTurn = markFirstTurn && turnsSeen === 1;
|
|
@@ -351,7 +354,7 @@ export function extractEntries(sessionId, events) {
|
|
|
351
354
|
push({
|
|
352
355
|
seq: event.seq,
|
|
353
356
|
kind: 'compact',
|
|
354
|
-
text: preview(summary || '(compaction)'),
|
|
357
|
+
text: preview(compactionPreviews.take(source) ?? (summary || '(compaction)')),
|
|
355
358
|
searchText: `compact ${summary}`,
|
|
356
359
|
time: event.time,
|
|
357
360
|
});
|
|
@@ -55,6 +55,7 @@ export declare class SubagentActivityStore {
|
|
|
55
55
|
* alone cannot prove how its last epoch ended). */
|
|
56
56
|
onDiscovered(agentId: string, info?: {
|
|
57
57
|
label?: string;
|
|
58
|
+
name?: string;
|
|
58
59
|
childCreatedAt?: number;
|
|
59
60
|
live?: boolean;
|
|
60
61
|
provider?: string;
|
|
@@ -109,6 +110,11 @@ export declare class SubagentActivityStore {
|
|
|
109
110
|
onFailed(agentId: string, error: string, endedAt?: number): void;
|
|
110
111
|
onCancelled(agentId: string, reason?: string, summary?: string, endedAt?: number): void;
|
|
111
112
|
private finish;
|
|
113
|
+
/** Keep this run's outcome before a continuable child opens its next run
|
|
114
|
+
* under the same `agentId`. `finish` accepts only the first terminal edge,
|
|
115
|
+
* so one run records once; the `known` branch only absorbs a durable replay
|
|
116
|
+
* of the same settlement. */
|
|
117
|
+
private recordSettledRun;
|
|
112
118
|
/** Drop all tracked subagents and session links (session swap: the old
|
|
113
119
|
* session's children were disposed with their parent — nothing may keep
|
|
114
120
|
* routing events of a session the channel no longer projects). The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAIlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAsC,kBAAkB,EAAE,gBAAgB,EAAsB,MAAM,kCAAkC,CAAA;AACxM,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAIlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,E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AAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAU3J,mDAAmD;IACnD,OAAO,CAAC,WAAW;IAqBnB;;;;;;sCAMkC;IAClC,OAAO,CAAC,cAAc;IAyBtB,qDAAqD;IACrD,YAAY,IAAI,oBAAoB;IAWpC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAE5F,OAAO,CAAC,MAAM;IAwBd;;;kCAG8B;IAC9B,OAAO,CAAC,gBAAgB;IAUxB;;;sDAGkD;IAClD,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,aAAa,EAAE;IAC3B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAC3C,OAAO,CAAC,MAAM;CACf"}
|
|
@@ -3,6 +3,10 @@ import { toolResultPayload } from './compat/messages.js';
|
|
|
3
3
|
import { toolFailureText } from './channel/transcript.js';
|
|
4
4
|
const MAX_OUTPUT_EVENTS = 160;
|
|
5
5
|
const MAX_OUTPUT_LINES = 160;
|
|
6
|
+
/** Settled runs kept per child. A continuable child can open runs forever, so
|
|
7
|
+
* the history is bounded; the banner only needs recent runs to reach its
|
|
8
|
+
* two-failure floor. */
|
|
9
|
+
const MAX_SETTLED_RUNS = 32;
|
|
6
10
|
/** Keyed labels parked before their row exists (see `earlyLabels`). */
|
|
7
11
|
const MAX_EARLY_LABELS = 64;
|
|
8
12
|
export class SubagentActivityStore {
|
|
@@ -73,6 +77,7 @@ export class SubagentActivityStore {
|
|
|
73
77
|
sessionId: info.sessionId,
|
|
74
78
|
output: [],
|
|
75
79
|
outputEvents: [],
|
|
80
|
+
settledRuns: [],
|
|
76
81
|
toolCalls: [],
|
|
77
82
|
...(info.parentAgentId === undefined ? {} : { parentAgentId: info.parentAgentId }),
|
|
78
83
|
});
|
|
@@ -174,13 +179,19 @@ export class SubagentActivityStore {
|
|
|
174
179
|
const existing = this.states.get(agentId);
|
|
175
180
|
if (existing !== undefined) {
|
|
176
181
|
// A bus edge usually created the row first; the durable catalog fact
|
|
177
|
-
// still carries the
|
|
178
|
-
// childId-keyed label that a queue-derived description only guessed at
|
|
182
|
+
// still carries the things the edge never knows — the mode, the
|
|
183
|
+
// childId-keyed label that a queue-derived description only guessed at,
|
|
184
|
+
// and (catalog v3) the sibling-unique name.
|
|
179
185
|
let changed = false;
|
|
180
186
|
if (info.mode !== undefined && existing.mode === undefined) {
|
|
181
187
|
existing.mode = info.mode;
|
|
182
188
|
changed = true;
|
|
183
189
|
}
|
|
190
|
+
// A name is immutable and sibling-unique, so the first fact is final.
|
|
191
|
+
if (info.name !== undefined && existing.name === undefined) {
|
|
192
|
+
existing.name = info.name;
|
|
193
|
+
changed = true;
|
|
194
|
+
}
|
|
184
195
|
if (this.describeFromLabel(agentId, info.label))
|
|
185
196
|
changed = true;
|
|
186
197
|
if (changed)
|
|
@@ -190,9 +201,11 @@ export class SubagentActivityStore {
|
|
|
190
201
|
// An empty label is not a fact: the row keeps a visible placeholder that a
|
|
191
202
|
// later real label can still replace.
|
|
192
203
|
const label = typeof info.label === 'string' && info.label !== '' ? info.label : undefined;
|
|
204
|
+
const name = typeof info.name === 'string' && info.name !== '' ? info.name : undefined;
|
|
193
205
|
this.states.set(agentId, {
|
|
194
206
|
agentId,
|
|
195
207
|
description: label ?? `${info.provider ?? 'subagent'} task`,
|
|
208
|
+
...(name === undefined ? {} : { name }),
|
|
196
209
|
provider: info.provider ?? 'subagent',
|
|
197
210
|
model: info.model ?? info.provider,
|
|
198
211
|
status: info.live ? 'running' : 'unknown',
|
|
@@ -535,8 +548,24 @@ export class SubagentActivityStore {
|
|
|
535
548
|
state.summary = summary;
|
|
536
549
|
if (status === 'failed')
|
|
537
550
|
state.error = reason;
|
|
551
|
+
this.recordSettledRun(state, status);
|
|
538
552
|
this.notify();
|
|
539
553
|
}
|
|
554
|
+
/** Keep this run's outcome before a continuable child opens its next run
|
|
555
|
+
* under the same `agentId`. `finish` accepts only the first terminal edge,
|
|
556
|
+
* so one run records once; the `known` branch only absorbs a durable replay
|
|
557
|
+
* of the same settlement. */
|
|
558
|
+
recordSettledRun(state, status) {
|
|
559
|
+
const runId = state.runId ?? state.agentId;
|
|
560
|
+
const runs = [...(state.settledRuns ?? [])];
|
|
561
|
+
const entry = { runId, provider: state.provider, status };
|
|
562
|
+
const known = runs.findIndex(run => run.runId === runId);
|
|
563
|
+
if (known >= 0)
|
|
564
|
+
runs[known] = entry;
|
|
565
|
+
else
|
|
566
|
+
runs.push(entry);
|
|
567
|
+
state.settledRuns = runs.length > MAX_SETTLED_RUNS ? runs.slice(-MAX_SETTLED_RUNS) : runs;
|
|
568
|
+
}
|
|
540
569
|
/** Drop all tracked subagents and session links (session swap: the old
|
|
541
570
|
* session's children were disposed with their parent — nothing may keep
|
|
542
571
|
* routing events of a session the channel no longer projects). The
|
|
@@ -552,7 +581,7 @@ export class SubagentActivityStore {
|
|
|
552
581
|
this.earlyLabels.clear();
|
|
553
582
|
this.notify();
|
|
554
583
|
}
|
|
555
|
-
snapshot() { return Array.from(this.states.values()).map(state => ({ ...state, output: [...state.output], outputEvents: [...state.outputEvents], toolCalls: state.toolCalls.map(tool => ({ ...tool })), tokens: state.tokens ? { ...state.tokens } : undefined })); }
|
|
584
|
+
snapshot() { return Array.from(this.states.values()).map(state => ({ ...state, output: [...state.output], outputEvents: [...state.outputEvents], toolCalls: state.toolCalls.map(tool => ({ ...tool })), tokens: state.tokens ? { ...state.tokens } : undefined, settledRuns: state.settledRuns?.map(run => ({ ...run })) })); }
|
|
556
585
|
get(agentId) { return this.snapshot().find(state => state.agentId === agentId); }
|
|
557
586
|
subscribe(listener) { this.listeners.add(listener); return () => this.listeners.delete(listener); }
|
|
558
587
|
notify() { for (const listener of this.listeners)
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent Teams status at run time (issue #1241
|
|
3
|
-
*
|
|
2
|
+
* Agent Teams status and switch at run time (issue #1241; `0.2.2-rc.2`
|
|
3
|
+
* moved the team from an experimental bundle to a per-session selection).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* Two upstream mechanisms are told apart by shape, never by version:
|
|
6
|
+
*
|
|
7
|
+
* - **Selection hosts** (`0.2.2-rc.2` and later): the service ships in
|
|
8
|
+
* `dsh-base` and exposes `setEnabled(rootAgent, enabled)` / `isEnabled`.
|
|
9
|
+
* `/team on|off` writes that saved per-root selection; `/team` reports it.
|
|
10
|
+
* The task tools and Team guidance follow the root's selection throughout
|
|
11
|
+
* its subagent tree, and switching off keeps subagents and tasks.
|
|
12
|
+
* - **Bundle hosts** (`0.2.2-rc.1` and earlier): the service is mounted by the
|
|
13
|
+
* retired `dsh-experimental-agent-team-profile` bundle, so the switch stays
|
|
14
|
+
* `/plugin enable|disable`, and `/team` only reports plus points at it.
|
|
13
15
|
*
|
|
14
16
|
* What stays here besides the command is the one decision that cannot live in
|
|
15
|
-
* a preset — which legacy delegation tools a request carries.
|
|
17
|
+
* a preset — which legacy delegation tools a request carries. It is a
|
|
18
|
+
* bundle-host seam: a selection host has no `spawn_teammate` tool, so the
|
|
19
|
+
* predicate is inert there.
|
|
16
20
|
*
|
|
17
21
|
* @module
|
|
18
22
|
*/
|
|
19
23
|
import type { Context } from '@deepseek-ai/cordis';
|
|
20
|
-
import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
|
|
21
24
|
import type { LocalCommand } from '../commands.js';
|
|
22
25
|
import type { TeamActiveMembers } from './plugin-manage.js';
|
|
23
26
|
/**
|
|
24
27
|
* Whether the team service is mounted. This is the one signal `/team` appears
|
|
25
|
-
* on:
|
|
28
|
+
* on: a bundle host mounts it only while the feature is on, while a selection
|
|
29
|
+
* host always mounts it (the saved mode decides whether the tools are there).
|
|
26
30
|
* @param ctx - Host context of the composition root.
|
|
27
31
|
*/
|
|
28
32
|
export declare function teamServiceActive(ctx: Context): boolean;
|
|
@@ -38,21 +42,34 @@ export declare function teamServiceActive(ctx: Context): boolean;
|
|
|
38
42
|
export declare function withTeamCommandVisibility(commands: readonly LocalCommand[], visible: boolean): readonly LocalCommand[];
|
|
39
43
|
/**
|
|
40
44
|
* Keep one delegation tool set per request. Presets keep their legacy rows,
|
|
41
|
-
* so whether the team replaces them is decided where the tools are known:
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
45
|
+
* so whether the team replaces them is decided where the tools are known: a
|
|
46
|
+
* registry carrying `spawn_teammate` drops `subagent` / `subagent_fork` on the
|
|
47
|
+
* agent's own scope (the assembly no longer carries tool declarations since
|
|
48
|
+
* 0.2.2). This follows a bundle toggled at run time into the sessions already
|
|
49
|
+
* joined (a preset revision cannot), and a team service that never activated
|
|
50
|
+
* leaves the legacy tools in place.
|
|
51
|
+
*
|
|
52
|
+
* Bundle hosts only: a selection host (`0.2.2-rc.2` and later) has no
|
|
53
|
+
* `spawn_teammate`, and the standard `subagent` / `subagent_fork` tools are
|
|
54
|
+
* its own delegation surface, so the predicate is inert there. Kept for the
|
|
55
|
+
* old hosts this application still supports.
|
|
56
|
+
*
|
|
57
|
+
* @param registered - Effective agent tool names, including inherited preset tools.
|
|
58
|
+
* @returns The replaced tool names to deny, empty when the team is inactive.
|
|
49
59
|
*/
|
|
50
|
-
export declare function
|
|
60
|
+
export declare function teamReplacedToolDeny(registered: ReadonlySet<string>): readonly string[];
|
|
61
|
+
/** Keep the legacy final-assembly seam; new presentations carry no tools. */
|
|
62
|
+
export declare function filterTeamReplacedTools<T extends {
|
|
63
|
+
readonly sections: readonly unknown[];
|
|
64
|
+
readonly tools?: readonly {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
}[];
|
|
67
|
+
}>(assembly: T): T;
|
|
51
68
|
/** What `/team` was asked. */
|
|
52
69
|
export type TeamCommand = {
|
|
53
70
|
readonly kind: 'status';
|
|
54
71
|
}
|
|
55
|
-
/** `on` / `off`: the switch
|
|
72
|
+
/** `on` / `off`: the per-session switch on a selection host, the bundle route on a bundle host. */
|
|
56
73
|
| {
|
|
57
74
|
readonly kind: 'switch';
|
|
58
75
|
} | {
|
|
@@ -70,14 +87,16 @@ export interface TeamCommandSink {
|
|
|
70
87
|
/** The entry the screen calls: argument text in, report lines out. */
|
|
71
88
|
export type TeamCommandEntry = (args: string, sink: TeamCommandSink) => Promise<readonly string[]>;
|
|
72
89
|
/**
|
|
73
|
-
* Wire `/team` to the running composition.
|
|
74
|
-
*
|
|
75
|
-
* and its confirmations.
|
|
90
|
+
* Wire `/team` to the running composition. On a selection host it also moves
|
|
91
|
+
* the switch; on a bundle host it only reports and points at
|
|
92
|
+
* `/plugin enable|disable` (the lifecycle flow and its confirmations).
|
|
76
93
|
* @param ctx - Host context of the composition root.
|
|
77
|
-
* @param options - The profile a CLI route names.
|
|
94
|
+
* @param options - The profile a CLI route names, and how to reach the bound session's live Agent.
|
|
78
95
|
* @returns the command entry the screen calls.
|
|
79
96
|
*/
|
|
80
97
|
export declare function createTeamCommandEntry(ctx: Context, options?: {
|
|
81
98
|
readonly profileName?: string | undefined;
|
|
99
|
+
/** The bound session's live Agent, when this launch has one (DSH kernels). */
|
|
100
|
+
readonly rootAgent?: (() => unknown) | undefined;
|
|
82
101
|
}): TeamCommandEntry;
|
|
83
102
|
//# sourceMappingURL=team-mode.d.ts.map
|