@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t } from '../../i18n.js';
|
|
2
2
|
import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
|
|
3
|
+
import { listDirectChildren } from './subagent-projection.js';
|
|
3
4
|
export { setActivityFrames } from './core/local-actions.js';
|
|
4
5
|
/**
|
|
5
6
|
* The DSH halves of the local actions (the backend-neutral ones live in
|
|
@@ -21,19 +22,22 @@ export function createLocalActions(deps) {
|
|
|
21
22
|
return [t('subagent-not-mounted')];
|
|
22
23
|
const capture = binding.capture();
|
|
23
24
|
try {
|
|
24
|
-
const children = await service
|
|
25
|
+
const children = await listDirectChildren(service, String(binding.agent.session.id));
|
|
25
26
|
if (!current(capture))
|
|
26
27
|
throw new Error('dsh-tui: Channel lifetime has ended');
|
|
27
28
|
if (children.length === 0)
|
|
28
29
|
return [t('subagent-none')];
|
|
29
30
|
return children.map(child => {
|
|
30
|
-
const id =
|
|
31
|
+
const id = child.id;
|
|
31
32
|
// The host's non-running activity is not proof that a child was
|
|
32
33
|
// archived: continuable children can be idle or temporarily unknown.
|
|
33
34
|
// Prefer the live projection when this process still owns the run.
|
|
34
35
|
const running = state.subagents.some(sub => sub.agentId === id && sub.status === 'running');
|
|
35
36
|
const activity = running || child.activity === 'running' ? t('subagent-running') : t('subagent-unknown');
|
|
36
|
-
|
|
37
|
+
// rc.2 names the child (`reviewer/checker`), the addressable locator;
|
|
38
|
+
// a historical row has no name and keeps the short id.
|
|
39
|
+
const locator = child.name !== undefined && child.name !== '' ? child.name : id.slice(0, 8);
|
|
40
|
+
return t('subagent-row', { mode: child.mode === 'continuable' ? t('subagent-resumable') : t('subagent-oneshot'), label: child.label ? `「${child.label}」` : '', activity, id: locator });
|
|
37
41
|
});
|
|
38
42
|
}
|
|
39
43
|
catch (error) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import { type LlmModelInfo } from '@deepseek-ai/dsh-llm';
|
|
3
|
-
import type { Agent
|
|
3
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
4
4
|
import { type CommandCompletionNode } from '../../commands.js';
|
|
5
|
+
import type { ModelSelectionRef } from './model-selection.js';
|
|
5
6
|
import type { DshChannelBinding } from './binding.js';
|
|
6
7
|
import type { ChannelOwner } from './owner.js';
|
|
7
8
|
import type { ChannelState, EffortOption, PresetOption } from './types.js';
|
|
@@ -21,6 +22,8 @@ export declare function createModelActions(ctx: Context, state: Pick<ChannelStat
|
|
|
21
22
|
/** Re-check the context-low warning after a refreshed route metadata
|
|
22
23
|
* answer carries a newer contextWindow than the session started with. */
|
|
23
24
|
checkContextWarning(): void;
|
|
25
|
+
/** Re-apply the preset's tool carve-out after an in-place recomposition. */
|
|
26
|
+
onPresetChanged?(agent: Agent): void;
|
|
24
27
|
}): {
|
|
25
28
|
selection: ModelSelectionRef;
|
|
26
29
|
applyPreferredEffort: (preserveSessionEffort?: boolean) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"model-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAO7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE1E,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAEhC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,CAAC,EAC3I,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,WAAW,CAAC,CAAA;IAC/C,SAAS,EAAE,iBAAiB,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,IAAI,KAAK,CAAA;IACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B;6EACyE;IACzE,mBAAmB,IAAI,IAAI,CAAA;IAC3B,4EAA4E;IAC5E,eAAe,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACrC;;+DA6GmE,OAAO,CAAC,IAAI,CAAC;+BA6DjD,IAAI;0BAuBD;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC;QAAE,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,cAAc,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;oBA0BnJ,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;2BAoBxB,MAAM,GAAG,SAAS,KAAG,IAAI;4BAM1B,IAAI;sBAeV,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;;YA3PnB,MAAM;cAAQ,MAAM;;8BAsQzB,IAAI;0BACR,IAAI;;6BASD,IAAI;;uBAOJ,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;6BAQxB,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;EAmChE"}
|
|
@@ -27,11 +27,20 @@ export function createModelActions(ctx, state, deps) {
|
|
|
27
27
|
const effortWarm = { tried: false };
|
|
28
28
|
const modelNodeCache = { nodes: undefined, load: undefined, generation: 0 };
|
|
29
29
|
const presetOptionCache = { lang: undefined, list: undefined, load: undefined };
|
|
30
|
-
|
|
30
|
+
// Metadata-only refreshes also run during adoption, before selection binds.
|
|
31
|
+
const captureRoute = () => ({
|
|
31
32
|
binding: deps.binding.capture(), provider: state.provider, model: state.model, operation: ++effortOperation,
|
|
32
33
|
});
|
|
33
|
-
const
|
|
34
|
+
const captureEffort = () => ({ ...captureRoute(), selected: selection.current });
|
|
35
|
+
const effortRouteCurrent = (capture) => owner.current() && deps.binding.isCurrent(capture.binding) && capture.binding.session?.status !== 'disposed' &&
|
|
34
36
|
state.provider === capture.provider && state.model === capture.model && effortOperation === capture.operation;
|
|
37
|
+
const effortCurrent = (capture) => {
|
|
38
|
+
if (!effortRouteCurrent(capture))
|
|
39
|
+
return false;
|
|
40
|
+
const selected = selection.current;
|
|
41
|
+
return selected?.provider === capture.selected?.provider && selected?.model === capture.selected?.model &&
|
|
42
|
+
selected?.reasoningEffort === capture.selected?.reasoningEffort;
|
|
43
|
+
};
|
|
35
44
|
/** Route-level metadata shared by every resolveModelInfo consumer. The
|
|
36
45
|
* context window follows the route, not the binding: a resume rebuilds
|
|
37
46
|
* the binding (effortCurrent goes false) while the capacity answer for
|
|
@@ -88,10 +97,16 @@ export function createModelActions(ctx, state, deps) {
|
|
|
88
97
|
try {
|
|
89
98
|
const info = await llmRuntime.resolveModelInfo(capture.provider, capture.model);
|
|
90
99
|
applyRouteMetadata(capture, info);
|
|
91
|
-
if (!
|
|
100
|
+
if (!effortRouteCurrent(capture))
|
|
92
101
|
return 'stale';
|
|
93
102
|
const efforts = tiersOf(info.reasoning);
|
|
94
103
|
state.effortLevels = efforts.map(level => level.id);
|
|
104
|
+
// An effort-only external choice invalidates a pin commit, not this
|
|
105
|
+
// route's still-valid tier metadata (including the initial bind read).
|
|
106
|
+
if (!effortCurrent(capture)) {
|
|
107
|
+
state.emit();
|
|
108
|
+
return 'stale';
|
|
109
|
+
}
|
|
95
110
|
return { efforts, defaultEffort: typeof info.reasoning === 'object' && info.reasoning !== null ? info.reasoning.defaultEffort : undefined };
|
|
96
111
|
}
|
|
97
112
|
catch (error) {
|
|
@@ -169,13 +184,13 @@ export function createModelActions(ctx, state, deps) {
|
|
|
169
184
|
const refreshEffortLevels = () => {
|
|
170
185
|
if (llmRuntime === undefined || typeof llmRuntime.resolveModelInfo !== 'function')
|
|
171
186
|
return;
|
|
172
|
-
const capture =
|
|
187
|
+
const capture = captureRoute();
|
|
173
188
|
const generation = ++effortLevelsGeneration;
|
|
174
189
|
void llmRuntime.resolveModelInfo(capture.provider, capture.model).then(info => {
|
|
175
190
|
if (generation !== effortLevelsGeneration)
|
|
176
191
|
return;
|
|
177
192
|
applyRouteMetadata(capture, info);
|
|
178
|
-
if (!
|
|
193
|
+
if (!effortRouteCurrent(capture))
|
|
179
194
|
return;
|
|
180
195
|
state.effortLevels = tiersOf(info.reasoning).map(level => level.id);
|
|
181
196
|
state.emit();
|
|
@@ -183,13 +198,15 @@ export function createModelActions(ctx, state, deps) {
|
|
|
183
198
|
};
|
|
184
199
|
const applyEffort = (effort, capture) => {
|
|
185
200
|
if (!effortCurrent(capture))
|
|
186
|
-
return;
|
|
187
|
-
|
|
201
|
+
return false;
|
|
202
|
+
const selected = { provider: capture.provider, model: capture.model, reasoningEffort: ReasoningEffortId(effort.id) };
|
|
203
|
+
selection.current = selected;
|
|
188
204
|
preferredEffort = effort.id;
|
|
189
205
|
state.reasoningEffort = effort.id;
|
|
190
206
|
writeEffortPref(effort.id);
|
|
191
207
|
notify(t('effort-switched', { name: effort.name }));
|
|
192
208
|
state.emit();
|
|
209
|
+
return effortCurrent({ ...capture, selected });
|
|
193
210
|
};
|
|
194
211
|
const listEfforts = async (route) => {
|
|
195
212
|
if (route !== undefined) {
|
|
@@ -249,8 +266,7 @@ export function createModelActions(ctx, state, deps) {
|
|
|
249
266
|
notify(t('effort-invalid', { id, ids: resolved.efforts.map(effort => effort.id).join(', ') }), { color: 'warning' });
|
|
250
267
|
return false;
|
|
251
268
|
}
|
|
252
|
-
applyEffort(found, capture);
|
|
253
|
-
return effortCurrent(capture);
|
|
269
|
+
return applyEffort(found, capture);
|
|
254
270
|
};
|
|
255
271
|
/**
|
|
256
272
|
* Re-seat the future-sessions default reasoning effort. `id` is the settings
|
|
@@ -396,6 +412,7 @@ export function createModelActions(ctx, state, deps) {
|
|
|
396
412
|
return false;
|
|
397
413
|
state.agentPreset = preset.id;
|
|
398
414
|
state.emit();
|
|
415
|
+
deps.onPresetChanged?.(targetAgent);
|
|
399
416
|
if (!current())
|
|
400
417
|
return false;
|
|
401
418
|
if (!writePresetPref(target.id)) {
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { Agent,
|
|
2
|
+
import type { Agent, ModelSelection } from '@deepseek-ai/dsh-agent';
|
|
3
3
|
import { type ChannelOwner } from './owner.js';
|
|
4
|
+
/**
|
|
5
|
+
* The foreground selection facade. Modern hosts read the Agent-owned durable
|
|
6
|
+
* choice live; only legacy hosts keep a mutable route locally. `assembled`
|
|
7
|
+
* captures the selection the current step entered prompt assembly with.
|
|
8
|
+
*/
|
|
9
|
+
export interface ModelSelectionRef {
|
|
10
|
+
/** Model selected for the next step that enters prompt assembly. */
|
|
11
|
+
current: ModelSelection | undefined;
|
|
12
|
+
/** Selection captured when the current step entered prompt assembly. */
|
|
13
|
+
assembled: ModelSelection | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The upstream seam that replaced the mutable ref: `current()` folds the
|
|
17
|
+
* session's recorded selection over the last request and the creation
|
|
18
|
+
* options, `select()` records a new one durably. Absent on hosts before
|
|
19
|
+
* 0.2.2, where the channel drives the same pipeline through its own
|
|
20
|
+
* waterfalls; probed by shape so older installs keep working.
|
|
21
|
+
*/
|
|
22
|
+
interface ModelSeam {
|
|
23
|
+
current(): Readonly<ModelSelection> | undefined;
|
|
24
|
+
select(selection: Readonly<ModelSelection>): void;
|
|
25
|
+
}
|
|
26
|
+
/** The public durable seam, absent on legacy hosts. */
|
|
27
|
+
export declare function modelSeamOf(agent: Agent): ModelSeam | undefined;
|
|
4
28
|
/** Routing belongs to the live agent, including turns running while parked.
|
|
5
29
|
* The foreground facade follows the binding; each waterfall captures its own
|
|
6
30
|
* agent's ref so a later binding can never supply its route. */
|
|
@@ -12,6 +36,7 @@ export declare function createModelSelection(ctx: Context, deps: {
|
|
|
12
36
|
bind: (agent: Agent, route: {
|
|
13
37
|
provider: string;
|
|
14
38
|
model: string;
|
|
15
|
-
}) =>
|
|
39
|
+
}) => boolean;
|
|
16
40
|
};
|
|
41
|
+
export {};
|
|
17
42
|
//# sourceMappingURL=model-selection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-selection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"model-selection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAGnE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAElE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;IACnC,wEAAwE;IACxE,SAAS,EAAE,cAAc,GAAG,SAAS,CAAA;CACtC;AAED;;;;;;GAMG;AACH,UAAU,SAAS;IACjB,OAAO,IAAI,QAAQ,CAAC,cAAc,CAAC,GAAG,SAAS,CAAA;IAC/C,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAAA;CAClD;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAK/D;AAOD;;gEAEgE;AAChE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IACvD,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,IAAI,KAAK,CAAA;CACf;;kBAgCsB,KAAK,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO;EA8FjF"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { boundContextSummary, createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
|
|
2
3
|
import { createChannelOwner } from './owner.js';
|
|
4
|
+
/** The public durable seam, absent on legacy hosts. */
|
|
5
|
+
export function modelSeamOf(agent) {
|
|
6
|
+
const model = agent.model;
|
|
7
|
+
return typeof model?.current === 'function' && typeof model.select === 'function'
|
|
8
|
+
? model
|
|
9
|
+
: undefined;
|
|
10
|
+
}
|
|
11
|
+
function sameRoute(a, b) {
|
|
12
|
+
if (a === undefined || b === undefined)
|
|
13
|
+
return a === b;
|
|
14
|
+
return a.provider === b.provider && a.model === b.model && a.reasoningEffort === b.reasoningEffort;
|
|
15
|
+
}
|
|
3
16
|
/** Routing belongs to the live agent, including turns running while parked.
|
|
4
17
|
* The foreground facade follows the binding; each waterfall captures its own
|
|
5
18
|
* agent's ref so a later binding can never supply its route. */
|
|
@@ -9,33 +22,50 @@ export function createModelSelection(ctx, deps) {
|
|
|
9
22
|
const entry = entries.get(deps.agent());
|
|
10
23
|
if (entry === undefined)
|
|
11
24
|
throw new Error('dsh-tui: model selection has not been bound');
|
|
12
|
-
return entry
|
|
25
|
+
return entry;
|
|
26
|
+
};
|
|
27
|
+
/** Write the next step's route, through the durable seam when the host has one. */
|
|
28
|
+
const write = (entry, value) => {
|
|
29
|
+
if (entry.seam === undefined) {
|
|
30
|
+
entry.ref.current = value;
|
|
31
|
+
}
|
|
32
|
+
else if (value !== undefined && !sameRoute(value, entry.seam.current())) {
|
|
33
|
+
entry.seam.select(value);
|
|
34
|
+
}
|
|
13
35
|
};
|
|
14
36
|
const selection = {
|
|
15
|
-
get current() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
get current() {
|
|
38
|
+
const entry = foreground();
|
|
39
|
+
return entry.seam === undefined ? entry.ref.current : entry.seam.current();
|
|
40
|
+
},
|
|
41
|
+
set current(value) { write(foreground(), value); },
|
|
42
|
+
get assembled() { return foreground().ref.assembled; },
|
|
43
|
+
set assembled(value) { foreground().ref.assembled = value; },
|
|
19
44
|
};
|
|
20
45
|
deps.owner.own(ctx.on('agent/disposed', ({ agent }) => entries.get(agent)?.release()));
|
|
46
|
+
/** Bind without selecting; return whether the session owns its effort too. */
|
|
21
47
|
const bind = (agent, route) => {
|
|
22
48
|
deps.owner.assertActive();
|
|
23
|
-
|
|
24
|
-
return;
|
|
49
|
+
const seam = modelSeamOf(agent);
|
|
25
50
|
const recorded = agent.session.requestHeader?.()?.config;
|
|
51
|
+
const durable = seam !== undefined && (recorded !== undefined ||
|
|
52
|
+
snapshotLiveSessionEvents(agent.session).some(event => event.type === 'model/selection'));
|
|
53
|
+
if (entries.has(agent))
|
|
54
|
+
return durable;
|
|
26
55
|
const hasCreatedRoute = agent.options?.provider !== undefined && agent.options.model !== undefined;
|
|
27
56
|
// Seeded children can deliberately replace the inherited header's route.
|
|
28
57
|
// Restore a recorded pin only when the caller actually adopted that route.
|
|
29
58
|
const usesRecordedRoute = recorded?.provider === route.provider && recorded?.model === route.model;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
59
|
+
// The pre-0.2.2 seed: creation options plus the persisted request header.
|
|
60
|
+
const legacySeed = usesRecordedRoute && recorded?.reasoningEffort !== undefined
|
|
61
|
+
? { ...route, reasoningEffort: recorded.reasoningEffort }
|
|
62
|
+
: route.provider !== '' && route.model !== '' &&
|
|
63
|
+
(!hasCreatedRoute || (usesRecordedRoute &&
|
|
64
|
+
(route.provider !== agent.options.provider || route.model !== agent.options.model)))
|
|
65
|
+
? { ...route } : undefined;
|
|
66
|
+
const adopted = seam?.current();
|
|
67
|
+
const seed = adopted !== undefined ? { ...adopted } : legacySeed;
|
|
68
|
+
const ref = { current: seed, assembled: undefined };
|
|
39
69
|
const lifetime = createChannelOwner();
|
|
40
70
|
lifetime.bind(deps.owner.current);
|
|
41
71
|
let assemblyOperation = 0;
|
|
@@ -44,15 +74,21 @@ export function createModelSelection(ctx, deps) {
|
|
|
44
74
|
entries.delete(agent);
|
|
45
75
|
lifetime.dispose();
|
|
46
76
|
});
|
|
47
|
-
entries.set(agent, { ref, release });
|
|
77
|
+
entries.set(agent, { ref, seam, release });
|
|
78
|
+
// Only a host with no recorded route or creation options needs a seed.
|
|
79
|
+
if (seam !== undefined && adopted === undefined && seed !== undefined)
|
|
80
|
+
seam.select(seed);
|
|
48
81
|
const own = (dispose) => {
|
|
49
82
|
lifetime.own(dispose);
|
|
50
83
|
lifetime.assertActive();
|
|
51
84
|
};
|
|
52
85
|
try {
|
|
53
|
-
own(agent.ctx.on('system-prompt/assemble', async (_assembly,
|
|
86
|
+
own(agent.ctx.on('system-prompt/assemble', async (_assembly, context, next) => {
|
|
54
87
|
const operation = ++assemblyOperation;
|
|
55
|
-
|
|
88
|
+
// A step fixes its choice before asynchronous tool/prompt resolution.
|
|
89
|
+
// Diagnostics have no fixed step and inspect the current durable choice.
|
|
90
|
+
const selected = seam === undefined ? ref.current
|
|
91
|
+
: context.modelSelection ?? seam.current();
|
|
56
92
|
const assembled = await next();
|
|
57
93
|
if (!current())
|
|
58
94
|
return assembled;
|
|
@@ -63,32 +99,39 @@ export function createModelSelection(ctx, deps) {
|
|
|
63
99
|
return assembled;
|
|
64
100
|
return { ...assembled, variables: { ...assembled.variables, provider: selected.provider, model: selected.model } };
|
|
65
101
|
}));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
...withoutInheritedEffort
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
// Modern hosts fix request routing upstream and reject rewrites here.
|
|
103
|
+
if (seam === undefined) {
|
|
104
|
+
own(agent.ctx.on('agent/request', async (_payload, next) => {
|
|
105
|
+
const resolved = await next();
|
|
106
|
+
if (!current())
|
|
107
|
+
return resolved;
|
|
108
|
+
const selected = ref.assembled;
|
|
109
|
+
if (selected === undefined)
|
|
110
|
+
return resolved;
|
|
111
|
+
const { reasoningEffort: _inheritedEffort, ...withoutInheritedEffort } = resolved;
|
|
112
|
+
return {
|
|
113
|
+
...withoutInheritedEffort,
|
|
114
|
+
provider: selected.provider,
|
|
115
|
+
model: selected.model,
|
|
116
|
+
...(selected.reasoningEffort === undefined ? {} : { reasoningEffort: selected.reasoningEffort }),
|
|
117
|
+
};
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
81
120
|
// Match upstream installModelSelection's admission-time provenance.
|
|
82
|
-
|
|
121
|
+
// Not every composition installs it, but one step must have at most one notice.
|
|
122
|
+
own(agent.ctx.on('agent/pre-step', async (payload, next) => {
|
|
123
|
+
const { agent: subject, messages, signal, step } = payload;
|
|
83
124
|
const decision = await next();
|
|
84
125
|
if (!current() || decision.kind === 'reject' || signal.aborted)
|
|
85
126
|
return decision;
|
|
86
127
|
if (decision.messages.length === 0 && (step === 1 || messages.length > 0))
|
|
87
128
|
return decision;
|
|
88
|
-
const selected = ref.assembled
|
|
129
|
+
const selected = seam === undefined ? ref.assembled
|
|
130
|
+
: payload.modelSelection;
|
|
89
131
|
const previous = subject.session.requestHeader()?.config;
|
|
90
132
|
if (selected === undefined || previous === undefined ||
|
|
91
|
-
(selected.provider === previous.provider && selected.model === previous.model)
|
|
133
|
+
(selected.provider === previous.provider && selected.model === previous.model) ||
|
|
134
|
+
decision.messages.some(message => message.source?.kind === 'model-selection'))
|
|
92
135
|
return decision;
|
|
93
136
|
const from = selected.provider === previous.provider ? previous.model : `${previous.provider}/${previous.model}`;
|
|
94
137
|
const to = selected.provider === previous.provider ? selected.model : `${selected.provider}/${selected.model}`;
|
|
@@ -106,6 +149,7 @@ export function createModelSelection(ctx, deps) {
|
|
|
106
149
|
catch { /* preserve the registration failure */ }
|
|
107
150
|
throw error;
|
|
108
151
|
}
|
|
152
|
+
return durable;
|
|
109
153
|
};
|
|
110
154
|
return { selection, bind };
|
|
111
155
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { ModelSelectionRef } from '
|
|
2
|
+
import type { ModelSelectionRef } from './model-selection.js';
|
|
3
3
|
import type { createChannelBinding } from './binding.js';
|
|
4
4
|
import type { ChannelOwner } from './owner.js';
|
|
5
5
|
import type { ChannelState } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-switch.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"model-switch.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAI7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACtD,KAAK,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,GAAG,MAAM,CAAC,CAAA;AAEvI,uFAAuF;AACvF,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,WAAW,CAAC,CAAA;IAC/C,SAAS,EAAE,iBAAiB,CAAA;IAC5B,uFAAuF;IACvF,mBAAmB,EAAE,OAAO,CAAA;IAC5B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,mBAAmB,IAAI,IAAI,CAAA;IAC3B,wEAAwE;IACxE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACzC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC/B,IAGa,UAAU,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,CAwCjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-helpers.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/projection-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"projection-helpers.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/projection-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAgB/C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQjF;AAED;;+EAE+E;AAC/E,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAa9E;AAED,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,QAAkC,CAAA;AAEnE,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,EAAE,GAAG,SAAS,CAWzE"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Names the subagent delegation tools ship under (preset `toolName` values
|
|
2
2
|
* plus the CLI default); each renders as a live subagent card, never a plain
|
|
3
|
-
* tool card.
|
|
3
|
+
* tool card. `spawn_teammate` is the retired rc.1 Agent Teams tool: rc.2 has
|
|
4
|
+
* no such tool, but a historical log still holds its calls and they fold
|
|
5
|
+
* into the subagent row instead of a raw arguments card. */
|
|
4
6
|
const SUBAGENT_TOOL_NAMES = new Set([
|
|
5
7
|
'task',
|
|
6
8
|
'subagent',
|
|
@@ -8,7 +10,7 @@ const SUBAGENT_TOOL_NAMES = new Set([
|
|
|
8
10
|
'subagent_claude_code',
|
|
9
11
|
'subagent_codex',
|
|
10
12
|
'spawn_task',
|
|
11
|
-
//
|
|
13
|
+
// compat(dsh <= 0.2.2-rc.1, log + old host): the retired team tool.
|
|
12
14
|
'spawn_teammate',
|
|
13
15
|
]);
|
|
14
16
|
export function isSubagentToolName(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-rewind.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-rewind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"session-rewind.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-rewind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAavE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEvD,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC,CAAA;AAgB/E,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC,CAAA;IAC7F,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAA;IAC9K,qBAAqB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1F,IAEa,KAAK,OAAO,EAAE,OAAM,MAAM,GAAG,IAAW,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsHhF"}
|
|
@@ -10,6 +10,7 @@ import { composePreset, runningPresetOf } from '../presets.js';
|
|
|
10
10
|
import { holdsNoConversation, latestPolicyFacts, replayPolicyFacts } from '../session-seed.js';
|
|
11
11
|
import { attachSessionToWorkspace } from '../workspace.js';
|
|
12
12
|
import { reserveNewSession } from '../../sessionMounts.js';
|
|
13
|
+
import { modelSeamOf } from './model-selection.js';
|
|
13
14
|
async function waitForTurnEnd(session, fromSeq, timeoutMs) {
|
|
14
15
|
const deadline = Date.now() + timeoutMs;
|
|
15
16
|
while (Date.now() < deadline) {
|
|
@@ -79,12 +80,14 @@ export function createRewindToAction(ctx, state, deps) {
|
|
|
79
80
|
// beat.
|
|
80
81
|
const { reservation } = await reserveNewSession(String(childId));
|
|
81
82
|
let candidate;
|
|
83
|
+
// A branch keeps the live explicit pin, not an adapter-default UI readout.
|
|
84
|
+
const route = { ...(modelSeamOf(deps.binding.agent)?.current() ?? { provider: state.provider, model: state.model }) };
|
|
82
85
|
try {
|
|
83
86
|
const create = () => cutHoldsNoConversation
|
|
84
87
|
? createFreshAgent(ctx, agents, {
|
|
85
88
|
sessionId: childId,
|
|
86
89
|
meta: { cwd: state.cwd, ...(composed.agentPreset === undefined ? {} : { agentPreset: composed.agentPreset }) },
|
|
87
|
-
agentOptions:
|
|
90
|
+
agentOptions: route,
|
|
88
91
|
setup: composed.setup,
|
|
89
92
|
})
|
|
90
93
|
: agents.create(liveSessionCreateOptions({
|
|
@@ -95,8 +98,9 @@ export function createRewindToAction(ctx, state, deps) {
|
|
|
95
98
|
cwd: state.cwd,
|
|
96
99
|
parentSession: source.id,
|
|
97
100
|
agentPreset: composed.agentPreset,
|
|
98
|
-
agentOptions:
|
|
101
|
+
agentOptions: route,
|
|
99
102
|
setup: async (agentCtx, agent) => {
|
|
103
|
+
modelSeamOf(agent)?.select(route);
|
|
100
104
|
agent.inbox.clear();
|
|
101
105
|
return composed.setup?.(agentCtx, agent);
|
|
102
106
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-tree-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-tree-actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"session-tree-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-tree-actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAa1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC,CAAA;AAYnF,+GAA+G;AAC/G,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC,CAAA;IAC7F,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAA;IAC9K,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACnG,IAEa,WAAW,MAAM,EAAE,KAAK,MAAM,EAAE,OAAM,QAAQ,GAAG,MAAiB,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyI1G"}
|
|
@@ -10,6 +10,7 @@ import { composePreset, resolvePersistedPreset, runningPresetOf } from '../prese
|
|
|
10
10
|
import { holdsNoConversation, latestPolicyFacts, replayPolicyFacts } from '../session-seed.js';
|
|
11
11
|
import { attachSessionToWorkspace } from '../workspace.js';
|
|
12
12
|
import { reserveNewSession } from '../../sessionMounts.js';
|
|
13
|
+
import { modelSeamOf } from './model-selection.js';
|
|
13
14
|
import { forkTarget, rewindTarget, turnUserText } from '../sessionTree.js';
|
|
14
15
|
async function waitForTurnEnd(session, fromSeq, timeoutMs) {
|
|
15
16
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -100,12 +101,14 @@ export function createTreeRewindAction(ctx, state, deps) {
|
|
|
100
101
|
// the publisher only learns the id from the registry on its next beat.
|
|
101
102
|
const { reservation } = await reserveNewSession(String(childId));
|
|
102
103
|
let candidate;
|
|
104
|
+
// A branch keeps the live explicit pin, not an adapter-default UI readout.
|
|
105
|
+
const route = { ...(modelSeamOf(deps.binding.agent)?.current() ?? { provider: state.provider, model: state.model }) };
|
|
103
106
|
try {
|
|
104
107
|
const create = () => cutHoldsNoConversation
|
|
105
108
|
? createFreshAgent(ctx, agents, {
|
|
106
109
|
sessionId: childId,
|
|
107
110
|
meta: { cwd: sourceCwd, ...(composed.agentPreset === undefined ? {} : { agentPreset: composed.agentPreset }) },
|
|
108
|
-
agentOptions:
|
|
111
|
+
agentOptions: route,
|
|
109
112
|
setup: composed.setup,
|
|
110
113
|
})
|
|
111
114
|
: agents.create(liveSessionCreateOptions({
|
|
@@ -116,14 +119,15 @@ export function createTreeRewindAction(ctx, state, deps) {
|
|
|
116
119
|
cwd: sourceCwd,
|
|
117
120
|
parentSession: SessionId(sessionId),
|
|
118
121
|
agentPreset: composed.agentPreset,
|
|
119
|
-
agentOptions:
|
|
120
|
-
setup:
|
|
122
|
+
agentOptions: route,
|
|
123
|
+
setup: async (agentCtx, agent) => {
|
|
124
|
+
modelSeamOf(agent)?.select(route);
|
|
121
125
|
if (closeAfterCreate)
|
|
122
126
|
closeLiveForkTurn(agent.session, target.closeTurn);
|
|
123
127
|
if (mode === 'rewind')
|
|
124
128
|
agent.inbox.clear();
|
|
125
129
|
return composed.setup?.(agentCtx, agent);
|
|
126
|
-
}
|
|
130
|
+
},
|
|
127
131
|
}));
|
|
128
132
|
candidate = await deps.binding.prepare(adoption, async () => {
|
|
129
133
|
const handle = await create();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIvD,OAAO,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIvD,OAAO,KAAK,EAAE,qBAAqB,EAAqE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAkC3K,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CA8O1H;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,GAAG,aAAa,CAAC,CA4VlM"}
|