@deepseek-harness-tui/dsh-tui 0.17.0 → 0.19.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 +43 -16
- package/bin/dsh-tui.js +46 -3
- package/cli/adapters/dsh/index.mjs +2 -2
- package/guide/dsh-tui-guide/cli.en.md +1 -1
- package/guide/dsh-tui-guide/cli.md +1 -1
- 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 +8 -2
- package/guide/dsh-tui-guide/configuration.md +8 -2
- package/guide/dsh-tui-guide/getting-started.en.md +174 -6
- package/guide/dsh-tui-guide/getting-started.md +125 -15
- package/guide/dsh-tui-guide/interaction.en.md +30 -8
- package/guide/dsh-tui-guide/interaction.md +18 -5
- package/guide/dsh-tui-guide/plugins.en.md +28 -7
- package/guide/dsh-tui-guide/plugins.md +18 -5
- package/guide/dsh-tui-guide/user-guide.en.md +32 -17
- package/guide/dsh-tui-guide/user-guide.md +23 -12
- package/lib/settings.json +3 -3
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +10 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +31 -5
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.d.ts +60 -0
- package/lib/types/adapter/standard/grants.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.js +74 -0
- package/lib/types/agent/events.d.ts +16 -3
- 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/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/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +78 -10
- package/lib/types/channel/questions.d.ts +19 -3
- package/lib/types/channel/questions.d.ts.map +1 -1
- 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/GoalTodoPanel.d.ts +71 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +14 -9
- package/lib/types/components/PluginGrantList.d.ts +45 -0
- package/lib/types/components/PluginGrantList.d.ts.map +1 -0
- package/lib/types/components/PluginGrantList.js +126 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
- package/lib/types/components/PluginInstallPane.js +35 -6
- package/lib/types/components/PluginManagePane.d.ts.map +1 -1
- package/lib/types/components/PluginManagePane.js +65 -8
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +63 -8
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +17 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +12 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +16 -7
- package/lib/types/components/onboardingModel.d.ts +2 -2
- package/lib/types/components/onboardingModel.js +3 -3
- package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
- package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
- package/lib/types/components/onboardingProviderPlan.js +78 -0
- 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 +41 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +123 -6
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +9 -2
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +9 -2
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +14 -2
- package/lib/types/components/sidePanel/types.d.ts +2 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +15 -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/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/backend/session.d.ts +7 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +74 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +15 -6
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
- 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/composer-images.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +10 -2
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +22 -7
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +16 -6
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +35 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +3 -7
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +6 -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 +8 -0
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +59 -5
- 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 +21 -8
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mentions.js +21 -7
- 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/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +11 -9
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +3 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +10 -3
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +9 -3
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +11 -5
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
- 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/contract.d.ts +27 -3
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +47 -5
- package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +3 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.js +4 -0
- 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/grant-file.d.ts +70 -0
- package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grant-file.js +178 -0
- package/lib/types/dsh-adapter/host-access.d.ts +4 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +114 -15
- 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 +0 -8
- package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-dsh.js +27 -6
- package/lib/types/dsh-adapter/host-entry.js +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +8 -5
- 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/panels.d.ts +7 -1
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-install.js +160 -13
- package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +240 -51
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +203 -58
- package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +34 -21
- package/lib/types/dsh-adapter/presets.d.ts +41 -10
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +59 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +11 -5
- 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/row-attachment.d.ts +30 -0
- package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
- package/lib/types/dsh-adapter/row-attachment.js +29 -0
- package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
- package/lib/types/dsh-adapter/subagents.d.ts +5 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +22 -1
- package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +19 -12
- 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/dsh-adapter/worktree-tool.d.ts +27 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
- package/lib/types/dsh-adapter/worktree-tool.js +87 -0
- package/lib/types/heldInputs.d.ts +75 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +409 -0
- package/lib/types/i18n.d.ts +577 -34
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +230 -22
- 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/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +7 -6
- 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/ink.d.ts +1 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +5 -2
- 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.d.ts +13 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +29 -5
- package/lib/types/onboardingDraft.d.ts +143 -0
- package/lib/types/onboardingDraft.d.ts.map +1 -0
- package/lib/types/onboardingDraft.js +71 -0
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +133 -32
- package/lib/types/screens/Onboarding.d.ts +22 -3
- package/lib/types/screens/Onboarding.d.ts.map +1 -1
- package/lib/types/screens/Onboarding.js +606 -36
- 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.js +2 -2
- 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/paths.d.ts +15 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +25 -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 -108
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -183,6 +183,11 @@ touch = touchSession) {
|
|
|
183
183
|
// not the ones this receipt speaks about.
|
|
184
184
|
if (getSession() !== session)
|
|
185
185
|
return;
|
|
186
|
+
// The session ended meanwhile: its end held every row and their
|
|
187
|
+
// backend copies went with it, so this answer neither un-docks them
|
|
188
|
+
// nor reports a queue that will still run.
|
|
189
|
+
if (session.status === 'disposed')
|
|
190
|
+
return;
|
|
186
191
|
// Every docked row this receipt cannot confirm dropped: the ids the
|
|
187
192
|
// backend says it kept, plus every row docked after the request
|
|
188
193
|
// fired (outside its snapshot). Those copies are still live: their
|
|
@@ -244,6 +249,12 @@ touch = touchSession) {
|
|
|
244
249
|
const docked = state.pending.filter(item => item.docked === true);
|
|
245
250
|
if (docked.length === 0)
|
|
246
251
|
return 0;
|
|
252
|
+
// The session ended: nothing would run them, and a refused send would
|
|
253
|
+
// lose them. They stay docked for the next session.
|
|
254
|
+
if (state.status === 'disposed') {
|
|
255
|
+
state.notify(t('input-dock-session-disposed'), { color: 'warning', timeoutMs: 6000 });
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
247
258
|
// Provisional rows are always the newest dock batches, so the confirmed
|
|
248
259
|
// remainder is a FIFO prefix; holding the tail never reorders anyone.
|
|
249
260
|
const ready = docked.filter(item => !held(item.id));
|
|
@@ -256,7 +267,7 @@ touch = touchSession) {
|
|
|
256
267
|
state.emit();
|
|
257
268
|
for (const entry of ready) {
|
|
258
269
|
touch(state.agentId);
|
|
259
|
-
dispatchUserText(entry.text, 'followup', entry.images);
|
|
270
|
+
dispatchUserText(entry.text, 'followup', entry.images, undefined, entry.contexts);
|
|
260
271
|
}
|
|
261
272
|
return ready.length;
|
|
262
273
|
},
|
|
@@ -282,7 +293,14 @@ touch = touchSession) {
|
|
|
282
293
|
// the user a second copy the late revocation cannot reach.
|
|
283
294
|
if (input.provisionalDockIds?.includes(id) === true)
|
|
284
295
|
return false;
|
|
296
|
+
// The draft takes the swapped row's place: held for the next session
|
|
297
|
+
// when that row was (its own session ended), so `/new` keeps it too.
|
|
298
|
+
const orphaned = state.pending[index].orphaned === true;
|
|
285
299
|
// A docked retract is purely local on every backend (see removePending).
|
|
300
|
+
// The swap row carries the DRAFT's text, so it must not inherit the
|
|
301
|
+
// retracted row's contexts: the caller re-stages those into the composer
|
|
302
|
+
// (PromptInput's restageContexts), and keeping a copy here would send the
|
|
303
|
+
// same panel body with this draft's later dock delivery.
|
|
286
304
|
state.pending = [
|
|
287
305
|
...state.pending.filter(item => item.id !== id),
|
|
288
306
|
{
|
|
@@ -291,19 +309,52 @@ touch = touchSession) {
|
|
|
291
309
|
images: [...(draft.images ?? [])],
|
|
292
310
|
placement: 'followup',
|
|
293
311
|
docked: true,
|
|
312
|
+
...(orphaned ? { orphaned: true } : {}),
|
|
294
313
|
},
|
|
295
314
|
];
|
|
296
315
|
state.emit();
|
|
297
316
|
return true;
|
|
298
317
|
},
|
|
318
|
+
holdInputs(inputs) {
|
|
319
|
+
owner.assertActive();
|
|
320
|
+
const state = getState();
|
|
321
|
+
// Local ids like the swap's: no backend copy exists, so no inbox event
|
|
322
|
+
// can match these rows and no interrupt receipt covers them.
|
|
323
|
+
const held = inputs
|
|
324
|
+
.map(input => typeof input === 'string' ? { text: input } : input)
|
|
325
|
+
.filter(input => input.text.trim() !== '')
|
|
326
|
+
.map((input) => ({
|
|
327
|
+
id: `dock-held-${randomUUID()}`,
|
|
328
|
+
text: input.text,
|
|
329
|
+
images: [...(input.images ?? [])],
|
|
330
|
+
...(input.contexts === undefined || input.contexts.length === 0 ? {} : { contexts: [...input.contexts] }),
|
|
331
|
+
placement: 'followup',
|
|
332
|
+
docked: true,
|
|
333
|
+
orphaned: true,
|
|
334
|
+
}));
|
|
335
|
+
if (held.length === 0)
|
|
336
|
+
return 0;
|
|
337
|
+
state.pending = [...state.pending, ...held];
|
|
338
|
+
// The rows are on the pending list now: a listener throwing out of the
|
|
339
|
+
// emit (or a disposed owner in notify) must not read as "nothing was
|
|
340
|
+
// held", or the caller releases the claim and another pass holds the
|
|
341
|
+
// same inputs a second time.
|
|
342
|
+
try {
|
|
343
|
+
state.emit();
|
|
344
|
+
state.notify(t('input-orphans-held', { count: held.length }), { color: 'warning', timeoutMs: 8000 });
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
}
|
|
348
|
+
return held.length;
|
|
349
|
+
},
|
|
299
350
|
interruptAndDeliver(inputs) {
|
|
300
351
|
owner.assertActive();
|
|
301
352
|
const state = getState();
|
|
302
353
|
const session = getSession();
|
|
303
354
|
const queued = inputs
|
|
304
355
|
.map(input => typeof input === 'string'
|
|
305
|
-
? { text: input.trim(), images: [] }
|
|
306
|
-
: { text: input.text.trim(), images: [...(input.images ?? [])] })
|
|
356
|
+
? { text: input.trim(), images: [], contexts: undefined }
|
|
357
|
+
: { text: input.text.trim(), images: [...(input.images ?? [])], contexts: undefined })
|
|
307
358
|
.filter(input => input.text !== '');
|
|
308
359
|
if (queued.length === 0)
|
|
309
360
|
return 0;
|
|
@@ -344,8 +395,11 @@ touch = touchSession) {
|
|
|
344
395
|
touch(state.agentId);
|
|
345
396
|
// Same tui/input decision pass as a typed submit: Ctrl+Enter must
|
|
346
397
|
// not bypass a plugin's cancel/transform policy, and re-queued
|
|
347
|
-
// texts keep submission order through the one FIFO chain.
|
|
348
|
-
|
|
398
|
+
// texts keep submission order through the one FIFO chain. A docked
|
|
399
|
+
// row carries the "send to Chat" contexts its original submission
|
|
400
|
+
// did, and their chips are gone: forward them or the model loses
|
|
401
|
+
// that context.
|
|
402
|
+
dispatchUserText(entry.text, 'followup', entry.images, undefined, entry.contexts);
|
|
349
403
|
}
|
|
350
404
|
};
|
|
351
405
|
// Let cancel finish its synchronous inbox bookkeeping before waking.
|
|
@@ -5,7 +5,7 @@ import type { ChannelHost } from './channel-host.js';
|
|
|
5
5
|
import type { LocalImageStore } from './core/local-images.js';
|
|
6
6
|
import type { ChannelOwner } from './owner.js';
|
|
7
7
|
import type { AttachedContext, ChannelSelection, SelectionAttachment } from '../../adapter/ports/channel-view.js';
|
|
8
|
-
import type { ChannelImageBlock, ChannelState, ComposerImageRef, MentionAttachments, MentionFs, PendingMessage, StagedImageInput } from './types.js';
|
|
8
|
+
import type { ChannelImageBlock, ChannelState, ComposerImageRef, MentionAttachments, MentionFs, PendingMessage, PendingTrackInput, StagedImageInput } from './types.js';
|
|
9
9
|
/** One submission's enqueue-time world: the session it was typed in, the
|
|
10
10
|
* services that resolve its references, and the capabilities live then. */
|
|
11
11
|
export interface UserTextOrigin {
|
|
@@ -34,11 +34,7 @@ export interface UserTextOrigin {
|
|
|
34
34
|
/** Input FIFO, staged attachments and decision notice timers share one lifetime. */
|
|
35
35
|
export declare function createInputDelivery(ctx: ChannelHost, owner: ChannelOwner, binding: {
|
|
36
36
|
readonly session: AgentSession;
|
|
37
|
-
}, state: () => Pick<ChannelState, 'cwd' | 'workingDirectory' | 'agentId' | 'agentBindingGeneration'>, notify: ChannelState['notify'], trackPending: (message:
|
|
38
|
-
id: string;
|
|
39
|
-
text: string;
|
|
40
|
-
images?: readonly ComposerImageRef[];
|
|
41
|
-
}, placement: PendingMessage['placement']) => void, untrackPending: (id: string) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
|
|
37
|
+
}, state: () => Pick<ChannelState, 'cwd' | 'workingDirectory' | 'agentId' | 'agentBindingGeneration'>, notify: ChannelState['notify'], trackPending: (message: PendingTrackInput, placement: PendingMessage['placement']) => void, untrackPending: (id: string, hold?: boolean) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
|
|
42
38
|
/** The fs surface to use when the host mounts no `fs` service (a non-DSH
|
|
43
39
|
* composition reads the local disk); absent = no fallback. */
|
|
44
40
|
fallbackFs?: () => MentionFs | undefined,
|
|
@@ -52,7 +48,7 @@ localImages?: () => LocalImageStore | undefined,
|
|
|
52
48
|
* simply carries no contexts.
|
|
53
49
|
*/
|
|
54
50
|
consumeAttachedContexts?: () => readonly AttachedContext[]): {
|
|
55
|
-
dispatchUserText: (text: string, placement: PendingMessage["placement"], images?: readonly ComposerImageRef[], attach?: UserMessage) => void;
|
|
51
|
+
dispatchUserText: (text: string, placement: PendingMessage["placement"], images?: readonly ComposerImageRef[], attach?: UserMessage, contexts?: readonly AttachedContext[]) => void;
|
|
56
52
|
/** Inputs dispatched so far, and whether any is still in the FIFO (a
|
|
57
53
|
* parked decision, an `@` read, an IDE-selection read). */
|
|
58
54
|
activity: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-delivery.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG1D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAw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EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;4BAlB9F,MAAM,aACD,cAAc,CAAC,WAAW,CAAC,WAC9B,SAAS,gBAAgB,EAAE,WAC1B,WAAW,KACnB,IAAI;iCAxV6B,SAAS,WAAW,EAAE,KAAG,WAAW,EAAE;kCAarC,MAAM,KAAG,IAAI;0BAgMrB,CAAC,QAAQ,MAAM,WAAW,OAAO,CAAC,CAAC,CAAC,WAAW,cAAc,KAAG,OAAO,CAAC,CAAC,CAAC;6BA+IzE,IAAI;wBAoBZ,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAAC;wBACpC,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;;EAGzE"}
|
|
@@ -3,7 +3,7 @@ import { t } from '../../i18n.js';
|
|
|
3
3
|
import { logForDebugging } from '../../utils/debug.js';
|
|
4
4
|
import { firstStaleComposerToken, formatMissingReference, orderedComposerImages, } from './composer-images.js';
|
|
5
5
|
import { expandComposerMentions } from './composer-mentions.js';
|
|
6
|
-
import { appendAttachedContextBlocks } from './attached-context.js';
|
|
6
|
+
import { appendAttachedContextBlocks, mergeAttachedContexts } from './attached-context.js';
|
|
7
7
|
import { normalizeInputDecision } from './decisions.js';
|
|
8
8
|
import { attachIdeSelection } from './ide-selection.js';
|
|
9
9
|
import { mentionAttachments, mentionFs } from './mentions.js';
|
|
@@ -163,7 +163,7 @@ consumeAttachedContexts) {
|
|
|
163
163
|
// Track BEFORE the submit: a synchronous throw inside it rolls the
|
|
164
164
|
// preview back; otherwise the backend's pending changes retire it once
|
|
165
165
|
// the message is claimed or discarded.
|
|
166
|
-
trackPending({ id: message.id, text, images }, placement);
|
|
166
|
+
trackPending({ id: message.id, text, images, contexts: origin.attachedContexts }, placement);
|
|
167
167
|
try {
|
|
168
168
|
// The message id IS the clientMessageId every ledger above keys on; the
|
|
169
169
|
// DSH session delivers this exact message (steer/followup).
|
|
@@ -179,16 +179,22 @@ consumeAttachedContexts) {
|
|
|
179
179
|
const result = await origin.session.submit({ text, blocks: message.content, clientMessageId: message.id, native: message, ...(images === undefined || images.length === 0 ? {} : { images }) }, placement);
|
|
180
180
|
// A backend refusal need not emit pending.changed. Retire its preview
|
|
181
181
|
// and attached context here, and show the refusal instead of queuing it.
|
|
182
|
+
// An ended session refuses every retry: its text stays as a held dock
|
|
183
|
+
// row instead (#1651), sent only when the user sends the dock.
|
|
182
184
|
if (!result.accepted) {
|
|
183
185
|
if (attach !== undefined)
|
|
184
186
|
attachedByMessageId.delete(message.id);
|
|
185
|
-
|
|
187
|
+
// A backend that is certain it never ran the input asks for it back
|
|
188
|
+
// (`dropped`), like an ended session: keep the text as a dock row.
|
|
189
|
+
const hold = result.dropped === true || origin.session.status === 'disposed';
|
|
190
|
+
untrackPending(message.id, hold);
|
|
186
191
|
// A refusal with no reason is still a refusal: say so, or the send
|
|
187
192
|
// looks successful while nothing was queued.
|
|
188
|
-
|
|
189
|
-
|
|
193
|
+
const reason = result.reason !== undefined && result.reason !== '' ? result.reason : t('input-not-accepted');
|
|
194
|
+
if (hold)
|
|
195
|
+
notify(t('input-refused-held', { reason }), { color: 'warning', timeoutMs: 6000 });
|
|
190
196
|
else
|
|
191
|
-
notify(
|
|
197
|
+
notify(reason, { color: 'warning', timeoutMs: 4000 });
|
|
192
198
|
return;
|
|
193
199
|
}
|
|
194
200
|
}
|
|
@@ -351,8 +357,15 @@ consumeAttachedContexts) {
|
|
|
351
357
|
notify(t('send-failed', { err: message }), { color: 'error' });
|
|
352
358
|
}
|
|
353
359
|
};
|
|
354
|
-
const dispatchUserText = (text, placement, images = [], attach) => {
|
|
355
|
-
const
|
|
360
|
+
const dispatchUserText = (text, placement, images = [], attach, contexts) => {
|
|
361
|
+
const captured = captureOrigin();
|
|
362
|
+
// A dock re-send carries the contexts the row saved: the live chips were
|
|
363
|
+
// consumed by the submission that was refused (#1651). `captureOrigin`
|
|
364
|
+
// already took whatever the user staged since, so merge — never replace —
|
|
365
|
+
// or those chips would be neither sent nor kept.
|
|
366
|
+
const origin = contexts === undefined || contexts.length === 0
|
|
367
|
+
? captured
|
|
368
|
+
: { ...captured, attachedContexts: mergeAttachedContexts(contexts, captured.attachedContexts) };
|
|
356
369
|
const capturedImages = composer.captureDraftImages(text, images);
|
|
357
370
|
dispatched += 1;
|
|
358
371
|
inFlight.push(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5I;gDACgD;AAChD,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,SAAU,CAAA;AAE9C;eACe;AACf,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;wEACwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,kBAAkB,GAAG,SAAS,CAErF;AAED,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAMrF,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAErF;AAED;+EAC+E;AAC/E,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAS7G;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,kBAAkB,EAChC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAkM3B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { extname, isAbsolute, join } from 'node:path';
|
|
2
2
|
import { extractMentions } from '../../utils/mentions.js';
|
|
3
3
|
import { basename } from './paths.js';
|
|
4
|
+
import { expandHomePrefix } from '../../utils/paths.js';
|
|
4
5
|
import { COMPOSER_IMAGE_TOKEN } from './composer-images.js';
|
|
5
6
|
/** One attached file's contribution is capped so an absent-minded `@` of a
|
|
6
7
|
* huge file cannot blow the context window. */
|
|
@@ -115,15 +116,21 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
|
|
|
115
116
|
if (budget <= 0 && imageMediaType === undefined)
|
|
116
117
|
continue;
|
|
117
118
|
// Mentions resolve against the session cwd, same as the model-facing fs
|
|
118
|
-
// tools; absolute paths pass through untouched
|
|
119
|
-
// (
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
|
|
119
|
+
// tools; absolute paths pass through untouched, and a leading literal `~/`
|
|
120
|
+
// (or `~\`) expands to the host home exactly like completion does (issue
|
|
121
|
+
// #1706 — without this the typed path was joined onto the workspace and
|
|
122
|
+
// silently went missing). A `#L12-14` line suffix (issue #359) is stripped
|
|
123
|
+
// before resolution; when the stripped path misses, the typed literal
|
|
124
|
+
// (suffix intact) gets ONE fallback try so filenames genuinely containing
|
|
125
|
+
// `#L…` still resolve as whole files.
|
|
126
|
+
const mentionPath = expandHomePrefix(mention.path);
|
|
127
|
+
const absolute = isAbsolute(mentionPath) ? mentionPath : join(cwd, mentionPath);
|
|
123
128
|
let resolved = await tryResolveMention(fs, absolute);
|
|
124
129
|
let literalFallback = false;
|
|
130
|
+
let literalExpanded;
|
|
125
131
|
if (resolved === undefined && mention.literal !== undefined) {
|
|
126
|
-
|
|
132
|
+
literalExpanded = expandHomePrefix(mention.literal);
|
|
133
|
+
const literalPath = isAbsolute(literalExpanded) ? literalExpanded : join(cwd, literalExpanded);
|
|
127
134
|
resolved = await tryResolveMention(fs, literalPath);
|
|
128
135
|
literalFallback = resolved !== undefined;
|
|
129
136
|
}
|
|
@@ -134,7 +141,14 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
|
|
|
134
141
|
const { target, info } = resolved;
|
|
135
142
|
// On a literal-fallback hit the attached file IS the typed name — the
|
|
136
143
|
// model must see that path, not the suffix-stripped one.
|
|
137
|
-
|
|
144
|
+
//
|
|
145
|
+
// The model-facing path must also be resolvable by the fs tools, which
|
|
146
|
+
// resolve against the session cwd and do NOT expand `~` (issue #1706):
|
|
147
|
+
// when the typed path carried a home prefix, hand the model the expanded
|
|
148
|
+
// path. The user-visible `attached`/`missing` lists keep the typed string.
|
|
149
|
+
const shownPath = literalFallback
|
|
150
|
+
? (literalExpanded !== undefined && isAbsolute(literalExpanded) ? literalExpanded : display)
|
|
151
|
+
: (isAbsolute(mentionPath) ? mentionPath : mention.path);
|
|
138
152
|
// …and judge image-ness by the typed extension in that case too.
|
|
139
153
|
const imageType = literalFallback && mention.literal !== undefined
|
|
140
154
|
? mentionImageMediaType(mention.literal)
|
|
@@ -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,Y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BACR,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"}
|