@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
|
@@ -33,10 +33,13 @@ export declare function createBindingEvents(ctx: Context, deps: {
|
|
|
33
33
|
* request reports usage. */
|
|
34
34
|
seedContextOccupancy?(session: unknown): void;
|
|
35
35
|
seedTeam?(session: unknown): void;
|
|
36
|
+
/** Re-apply per-agent registry state (the preset's tool carve-out). */
|
|
37
|
+
onBind?(agent: Agent): void;
|
|
36
38
|
inputConvergence: InputConvergence;
|
|
37
39
|
modelSelection: ReturnType<typeof createModelSelection>;
|
|
38
40
|
modelActions: {
|
|
39
41
|
applyPreferredEffort(preserveSessionEffort?: boolean): Promise<void>;
|
|
42
|
+
dropModelNodeCache?(): void;
|
|
40
43
|
};
|
|
41
44
|
modeActions: {
|
|
42
45
|
refreshMode(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-events.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/binding-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,i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AAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1C;;+DAE2D;IAC3D,wBAAwB,CAAC,IAAI,IAAI,CAAA;CAClC;;;;wBAsEmB,IAAI;+CAImB,YAAY,GAAG,IAAI;;EA6G7D;AAED,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -98,10 +98,11 @@ export function createBindingEvents(ctx, deps) {
|
|
|
98
98
|
installSubagents();
|
|
99
99
|
},
|
|
100
100
|
onBind({ capture, current, register }) {
|
|
101
|
+
deps.onBind?.(deps.binding.agent);
|
|
101
102
|
deps.seedActivity?.(deps.binding.agent.session);
|
|
102
103
|
deps.seedContextOccupancy?.(deps.binding.agent.session);
|
|
103
104
|
deps.seedTeam?.(deps.binding.agent.session);
|
|
104
|
-
deps.modelSelection.bind(deps.binding.agent, { provider: deps.state.provider, model: deps.state.model });
|
|
105
|
+
const durableSelection = deps.modelSelection.bind(deps.binding.agent, { provider: deps.state.provider, model: deps.state.model });
|
|
105
106
|
const selected = deps.modelSelection.selection.current;
|
|
106
107
|
// A parked turn may not have logged its first selected request yet.
|
|
107
108
|
if (selected !== undefined) {
|
|
@@ -111,7 +112,7 @@ export function createBindingEvents(ctx, deps) {
|
|
|
111
112
|
const recorded = deps.binding.agent.session.requestHeader?.()?.config;
|
|
112
113
|
// Reattachment keeps a live pin; an adopted header also owns the
|
|
113
114
|
// absence of a pin. A child on a different route still seeds normally.
|
|
114
|
-
const preserveSessionEffort = selected?.reasoningEffort !== undefined ||
|
|
115
|
+
const preserveSessionEffort = durableSelection || selected?.reasoningEffort !== undefined ||
|
|
115
116
|
(recorded?.provider === deps.state.provider && recorded?.model === deps.state.model);
|
|
116
117
|
if (preserveSessionEffort)
|
|
117
118
|
deps.state.reasoningEffort = selected === undefined ? recorded?.reasoningEffort : selected.reasoningEffort;
|
|
@@ -140,6 +141,46 @@ export function createBindingEvents(ctx, deps) {
|
|
|
140
141
|
deps.messageObserver?.publish(native.agent.session, event);
|
|
141
142
|
deps.modeActions.onSessionEvent(native.agent.session, event);
|
|
142
143
|
deps.jobs?.onSessionEvent(event);
|
|
144
|
+
if (event.type === 'model/selection') {
|
|
145
|
+
// The API/Web/plugin may select on this same live Agent. The seam is
|
|
146
|
+
// authoritative; an effort-only action must never resurrect UI cache.
|
|
147
|
+
const selected = deps.modelSelection.selection.current;
|
|
148
|
+
if (selected !== undefined) {
|
|
149
|
+
const routeChanged = selected.provider !== deps.state.provider || selected.model !== deps.state.model;
|
|
150
|
+
deps.state.provider = selected.provider;
|
|
151
|
+
deps.state.model = selected.model;
|
|
152
|
+
deps.state.reasoningEffort = selected.reasoningEffort;
|
|
153
|
+
if (routeChanged) {
|
|
154
|
+
deps.state.contextWindow = undefined;
|
|
155
|
+
deps.state.effortLevels = undefined;
|
|
156
|
+
deps.modelActions.dropModelNodeCache?.();
|
|
157
|
+
void deps.modelActions.applyPreferredEffort(true);
|
|
158
|
+
deps.seedUpstreamRetry?.(selected.provider);
|
|
159
|
+
}
|
|
160
|
+
deps.state.emit();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (event.type === 'request/header' && typeof native.agent.model?.current === 'function') {
|
|
164
|
+
// The projector paints the completed request's effort below. That
|
|
165
|
+
// request may have fixed A/high before a pending B/low was selected.
|
|
166
|
+
// Reconcile after projection, keeping adapter-default readouts only
|
|
167
|
+
// when that header still describes the next selected route.
|
|
168
|
+
queueMicrotask(() => {
|
|
169
|
+
if (!current())
|
|
170
|
+
return;
|
|
171
|
+
const selected = deps.modelSelection.selection.current;
|
|
172
|
+
if (selected === undefined)
|
|
173
|
+
return;
|
|
174
|
+
const header = native.agent.session.requestHeader();
|
|
175
|
+
const adapterDefault = header?.adapterDefaults?.reasoningEffort === true;
|
|
176
|
+
const effort = selected.reasoningEffort ?? (adapterDefault && header?.config.provider === selected.provider && header.config.model === selected.model
|
|
177
|
+
? header.config.reasoningEffort : undefined);
|
|
178
|
+
if (deps.state.reasoningEffort !== effort) {
|
|
179
|
+
deps.state.reasoningEffort = effort;
|
|
180
|
+
deps.state.emit();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
143
184
|
if (event.type === 'working-directory/change') {
|
|
144
185
|
// The projector folds this event later in the same dispatch; only a
|
|
145
186
|
// move to a different directory refreshes.
|
|
@@ -73,5 +73,7 @@ export declare function createComposerImages(ctx: ServiceLookup, owner: ChannelO
|
|
|
73
73
|
* backend with the `images` capability); undefined = the DSH
|
|
74
74
|
* attachments service. */
|
|
75
75
|
localImages?(): LocalImageStore | undefined;
|
|
76
|
+
/** Staged images a session change keeps: those of held rows. */
|
|
77
|
+
retainedStageIds?(): ReadonlySet<string>;
|
|
76
78
|
}): ComposerImages;
|
|
77
79
|
//# sourceMappingURL=composer-images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-images.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAOtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,QAAqB,CAAA;AAEtD;6EAC6E;AAC7E,eAAO,MAAM,0BAA0B,QAAsB,CAAA;AAE7D,eAAO,MAAM,sBAAsB,GAAI,WAAW,MAAM,KAAG,MACe,CAAA;AAE1E;;;2EAG2E;AAC3E,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,WAAW,C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,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAA;IAChE;4DACwD;IACxD,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAAA;IACtG,wEAAwE;IACxE,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAAA;CACnG;AA0BD,iFAAiF;AACjF,qBAAa,mBAAoB,SAAQ,KAAK;CAAG;AAEjD,oFAAoF;AACpF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC,CA2G9L;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE;IACJ,UAAU,IAAI,MAAM,CAAA;IACpB,kFAAkF;IAClF,SAAS,CAAC,IAAI,MAAM,CAAA;IACpB;;+BAE2B;IAC3B,WAAW,CAAC,IAAI,eAAe,GAAG,SAAS,CAAA;IAC3C,gEAAgE;IAChE,gBAAgB,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAA;CACzC,GACA,cAAc,CA8KhB"}
|
|
@@ -203,8 +203,16 @@ export function createComposerImages(ctx, owner, deps) {
|
|
|
203
203
|
};
|
|
204
204
|
const clearStagedImages = () => {
|
|
205
205
|
stagedImageEpoch += 1;
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
// Held rows are the user's messages waiting for the next session (#1651):
|
|
207
|
+
// their images go with them. References are content-addressed and
|
|
208
|
+
// durable, so only the drafts' capabilities are revoked.
|
|
209
|
+
const retained = deps.retainedStageIds?.() ?? new Set();
|
|
210
|
+
for (const stageId of [...stagedImages.keys()]) {
|
|
211
|
+
if (retained.has(stageId))
|
|
212
|
+
continue;
|
|
213
|
+
stagedImages.delete(stageId);
|
|
214
|
+
stagedImageViews.delete(stageId);
|
|
215
|
+
}
|
|
208
216
|
legacyStagedImageRefs.clear();
|
|
209
217
|
legacyStagedImageSequence = 0;
|
|
210
218
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-mentions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"composer-mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-mentions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,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,CAuM3B"}
|
|
@@ -3,6 +3,7 @@ import { extractMentions } from '../../utils/mentions.js';
|
|
|
3
3
|
import { COMPOSER_IMAGE_TOKEN, ImageAdmissionError, saveAdmittedImage } from './composer-images.js';
|
|
4
4
|
import { MENTION_MAX_DIR_ENTRIES, MENTION_MAX_FILE_CHARS, MENTION_MAX_TOTAL_CHARS, mentionImageMediaType, tryResolveMention, } from './mentions.js';
|
|
5
5
|
import { basename } from './paths.js';
|
|
6
|
+
import { expandHomePrefix } from '../../utils/paths.js';
|
|
6
7
|
/**
|
|
7
8
|
* Expand a submitted text's `@` mentions (issue #15) into model-facing
|
|
8
9
|
* attachment blocks: supported image files become durable image blocks,
|
|
@@ -82,15 +83,22 @@ export async function expandComposerMentions(fs, cwd, text, attachments, stagedI
|
|
|
82
83
|
if (budget <= 0 && imageMediaType === undefined)
|
|
83
84
|
continue;
|
|
84
85
|
// Mentions resolve against the session cwd, same as the model-facing fs
|
|
85
|
-
// tools; absolute paths pass through untouched
|
|
86
|
-
// (
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
86
|
+
// tools; absolute paths pass through untouched, and a leading literal `~/`
|
|
87
|
+
// (or `~\`) expands to the host home exactly like completion does (issue
|
|
88
|
+
// #1706 — this is the submit path, so without it a path the `@` menu
|
|
89
|
+
// listed was joined onto the workspace and silently went missing). A
|
|
90
|
+
// `#L12-14` line suffix (issue #359) is stripped before resolution; when
|
|
91
|
+
// the stripped path misses, the typed literal (suffix intact) gets ONE
|
|
92
|
+
// fallback try so filenames genuinely containing `#L…` still resolve as
|
|
93
|
+
// whole files.
|
|
94
|
+
const mentionPath = expandHomePrefix(mention.path);
|
|
95
|
+
const absolute = isAbsolute(mentionPath) ? mentionPath : join(cwd, mentionPath);
|
|
90
96
|
let resolved = await tryResolveMention(fs, absolute);
|
|
91
97
|
let literalFallback = false;
|
|
98
|
+
let literalExpanded;
|
|
92
99
|
if (resolved === undefined && mention.literal !== undefined) {
|
|
93
|
-
|
|
100
|
+
literalExpanded = expandHomePrefix(mention.literal);
|
|
101
|
+
const literalPath = isAbsolute(literalExpanded) ? literalExpanded : join(cwd, literalExpanded);
|
|
94
102
|
resolved = await tryResolveMention(fs, literalPath);
|
|
95
103
|
literalFallback = resolved !== undefined;
|
|
96
104
|
}
|
|
@@ -101,7 +109,14 @@ export async function expandComposerMentions(fs, cwd, text, attachments, stagedI
|
|
|
101
109
|
const { target, info } = resolved;
|
|
102
110
|
// On a literal-fallback hit the attached file IS the typed name — the
|
|
103
111
|
// model must see that path, not the suffix-stripped one.
|
|
104
|
-
|
|
112
|
+
//
|
|
113
|
+
// The model-facing path must also be resolvable by the fs tools, which
|
|
114
|
+
// resolve against the session cwd and do NOT expand `~` (issue #1706):
|
|
115
|
+
// when the typed path carried a home prefix, hand the model the expanded
|
|
116
|
+
// path. The user-visible `attached`/`missing` lists keep the typed string.
|
|
117
|
+
const shownPath = literalFallback
|
|
118
|
+
? (literalExpanded !== undefined && isAbsolute(literalExpanded) ? literalExpanded : display)
|
|
119
|
+
: (isAbsolute(mentionPath) ? mentionPath : mention.path);
|
|
105
120
|
// …and judge image-ness by the typed extension in that case too.
|
|
106
121
|
const imageType = literalFallback && mention.literal !== undefined
|
|
107
122
|
? mentionImageMediaType(mention.literal)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextOccupancy } from '../../adapter/ports/channel-view.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PendingMessage, PendingTrackInput } from './types.js';
|
|
3
3
|
/** Small mutable cells for Channel-local warning and pending-message state. */
|
|
4
4
|
export declare function createContextBookkeeping(state: () => {
|
|
5
5
|
/** The channel's single occupancy reading (projection first, sample
|
|
@@ -16,11 +16,7 @@ export declare function createContextBookkeeping(state: () => {
|
|
|
16
16
|
};
|
|
17
17
|
resetContextWarning: () => void;
|
|
18
18
|
checkContextWarning: () => void;
|
|
19
|
-
trackPending: (message:
|
|
20
|
-
|
|
21
|
-
text: string;
|
|
22
|
-
images?: readonly ComposerImageRef[];
|
|
23
|
-
}, placement: PendingMessage["placement"]) => void;
|
|
24
|
-
untrackPending: (messageId: string) => void;
|
|
19
|
+
trackPending: (message: PendingTrackInput, placement: PendingMessage["placement"]) => void;
|
|
20
|
+
untrackPending: (messageId: string, hold?: boolean) => void;
|
|
25
21
|
};
|
|
26
22
|
//# sourceMappingURL=context-bookkeeping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-bookkeeping.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/context-bookkeeping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"context-bookkeeping.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/context-bookkeeping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnE,+EAA+E;AAC/E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM;IACX;wEACoE;IACpE,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC9C,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,IAAI,IAAI,IAAI,CAAA;CACb,EACD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,EACnF,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,EAC3C,mBAAmB,EAAE,MAAM;;;;+BAuCK,IAAI;+BApCJ,IAAI;4BAeL,iBAAiB,aAAa,cAAc,CAAC,WAAW,CAAC,KAAG,IAAI;gCAa5D,MAAM,qBAAiB,IAAI;EAU/D"}
|
|
@@ -21,15 +21,25 @@ export function createContextBookkeeping(state, notify, lowContextText, warningB
|
|
|
21
21
|
};
|
|
22
22
|
const trackPending = (message, placement) => {
|
|
23
23
|
const channel = state();
|
|
24
|
-
channel.pending = [...channel.pending, {
|
|
24
|
+
channel.pending = [...channel.pending, {
|
|
25
|
+
id: message.id,
|
|
26
|
+
text: message.text,
|
|
27
|
+
images: message.images ?? [],
|
|
28
|
+
placement,
|
|
29
|
+
...(message.contexts === undefined || message.contexts.length === 0 ? {} : { contexts: message.contexts }),
|
|
30
|
+
}];
|
|
25
31
|
channel.emit();
|
|
26
32
|
};
|
|
27
|
-
|
|
33
|
+
/** Drop the preview of a message the backend never took; `hold` keeps it
|
|
34
|
+
* instead as a held, undelivered dock row (a refusal must not lose it). */
|
|
35
|
+
const untrackPending = (messageId, hold = false) => {
|
|
28
36
|
const channel = state();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
channel.
|
|
37
|
+
if (!channel.pending.some(item => item.id === messageId))
|
|
38
|
+
return;
|
|
39
|
+
channel.pending = hold
|
|
40
|
+
? channel.pending.map(item => item.id === messageId ? { ...item, docked: true, orphaned: true } : item)
|
|
41
|
+
: channel.pending.filter(item => item.id !== messageId);
|
|
42
|
+
channel.emit();
|
|
33
43
|
};
|
|
34
44
|
const resetContextWarning = () => { warning.value = false; };
|
|
35
45
|
return { warning, resetContextWarning, checkContextWarning, trackPending, untrackPending };
|
|
@@ -70,6 +70,8 @@ export declare function createSessionBatchRouter(deps: {
|
|
|
70
70
|
onReset?(event: AgentEventOf<'session.reset'>): void;
|
|
71
71
|
ownsCompactionProgress?(): boolean;
|
|
72
72
|
warn(message: string): void;
|
|
73
|
+
/** Tell the user about inputs held for them; absent = held silently. */
|
|
74
|
+
notify?: ChannelProjectionDeps['notify'];
|
|
73
75
|
taskCompletion?: ReturnType<typeof createTaskCompletion>;
|
|
74
76
|
}): {
|
|
75
77
|
route: (batch: readonly AgentEvent[], meta: AgentEventMeta, current: () => boolean) => void;
|
|
@@ -91,6 +93,8 @@ export declare function createSessionBinder(deps: {
|
|
|
91
93
|
/** Forget the core's trajectory fold before the seed replay paints (a
|
|
92
94
|
* session swap starts an empty raw-event log, exactly like the rows). */
|
|
93
95
|
resetTrajectory?(): void;
|
|
96
|
+
/** The binding generation just changed (a session swap). */
|
|
97
|
+
rebound?(): void;
|
|
94
98
|
/** The stores a session's prompts park in (`ChannelLaunchOptions.interaction`). */
|
|
95
99
|
interaction?: ChannelLaunchOptions['interaction'];
|
|
96
100
|
/** The session-level facts kept unless the extension owns them. */
|
|
@@ -122,6 +126,8 @@ export declare function createBindingFeed(ctx: {
|
|
|
122
126
|
onReset?(event: AgentEventOf<'session.reset'>): void;
|
|
123
127
|
/** Passed to the binder: resets the core trajectory fold per bind. */
|
|
124
128
|
resetTrajectory?(): void;
|
|
129
|
+
/** Passed to the binder: the binding generation just changed. */
|
|
130
|
+
rebound?(): void;
|
|
125
131
|
}): {
|
|
126
132
|
projector: {
|
|
127
133
|
apply: (events: readonly AgentEvent[], meta: AgentEventMeta) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-feed.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/binding-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"binding-feed.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/binding-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAG5H,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qB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AG,eAAe,CAAC,CAAC,GAAG,IAAI;EAKpG;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { attachInteraction } from '../../../channel/interaction.js';
|
|
2
2
|
import { createChannelProjection } from '../../../channel/projection.js';
|
|
3
|
+
import { t } from '../../../i18n.js';
|
|
3
4
|
import { logForDebugging } from '../../../utils/debug.js';
|
|
4
5
|
import { createTaskCompletion } from '../task-completion.js';
|
|
5
6
|
/**
|
|
@@ -20,11 +21,39 @@ export function createSessionBatchRouter(deps) {
|
|
|
20
21
|
deps.projector.settleStreaming();
|
|
21
22
|
deps.projector.updateSpinnerMode();
|
|
22
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Hold previews no backend will run any more (#1651): the backend dropped
|
|
26
|
+
* them on its own (`ids`), or the session ended (`'all'`), possibly after
|
|
27
|
+
* its drop notices could no longer arrive. They join the dock, which never
|
|
28
|
+
* re-sends by itself, and stay across the switch to the next session.
|
|
29
|
+
*/
|
|
30
|
+
const holdOrphans = (ids) => {
|
|
31
|
+
let held = 0;
|
|
32
|
+
let changed = false;
|
|
33
|
+
deps.state.pending = deps.state.pending.map(item => {
|
|
34
|
+
if (item.orphaned === true || (ids !== 'all' && !ids.has(item.id)))
|
|
35
|
+
return item;
|
|
36
|
+
changed = true;
|
|
37
|
+
if (item.docked !== true)
|
|
38
|
+
held += 1;
|
|
39
|
+
return { ...item, docked: true, orphaned: true };
|
|
40
|
+
});
|
|
41
|
+
if (!changed)
|
|
42
|
+
return;
|
|
43
|
+
if (held > 0)
|
|
44
|
+
deps.notify?.(t('input-orphans-held', { count: held }), { color: 'warning', timeoutMs: 8000 });
|
|
45
|
+
deps.state.emit();
|
|
46
|
+
};
|
|
23
47
|
/** `session.status` as the backend reports it. */
|
|
24
48
|
const applyStatus = (status) => {
|
|
25
49
|
if (status === 'disposed') {
|
|
26
50
|
deps.state.status = 'disposed';
|
|
27
51
|
reconcileRetiredProjection('disposed');
|
|
52
|
+
// An automatic compaction's `compaction.end` will not come any more
|
|
53
|
+
// (#1651). A manual one is the transaction's: it retires its own row.
|
|
54
|
+
if (deps.state.compaction !== undefined && deps.ownsCompactionProgress?.() !== true)
|
|
55
|
+
deps.state.compaction = undefined;
|
|
56
|
+
holdOrphans('all');
|
|
28
57
|
deps.state.emit();
|
|
29
58
|
return;
|
|
30
59
|
}
|
|
@@ -42,8 +71,10 @@ export function createSessionBatchRouter(deps) {
|
|
|
42
71
|
* delete the context before it is ever injected.
|
|
43
72
|
*/
|
|
44
73
|
const applyPending = (event) => {
|
|
45
|
-
for (const messageId of event.discarded ?? [])
|
|
74
|
+
for (const messageId of [...event.discarded ?? [], ...event.dropped ?? []])
|
|
46
75
|
deps.retireAttachment?.(messageId);
|
|
76
|
+
if (event.dropped !== undefined && event.dropped.length > 0)
|
|
77
|
+
holdOrphans(new Set(event.dropped));
|
|
47
78
|
// A discard of a docked preview only drops the backend copy. The dock
|
|
48
79
|
// (where an interrupt parks inputs on the channel side) owns the row, so
|
|
49
80
|
// it stays until sent (`deliverDocked`) or retracted. A claim always
|
|
@@ -156,6 +187,7 @@ export function createSessionBinder(deps) {
|
|
|
156
187
|
try {
|
|
157
188
|
state.agentBindingGeneration = binding.bind();
|
|
158
189
|
deps.resetTrajectory?.();
|
|
190
|
+
deps.rebound?.();
|
|
159
191
|
hooks.onGeneration?.();
|
|
160
192
|
inputConvergence.cancelInFlight = false;
|
|
161
193
|
inputConvergence.interruptSeq += 1;
|
|
@@ -217,6 +249,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
217
249
|
projector,
|
|
218
250
|
inputConvergence,
|
|
219
251
|
retireAttachment: deps.retireAttachment,
|
|
252
|
+
notify: deps.projection.notify,
|
|
220
253
|
ownsCompactionProgress: () => deps.hooks().ownsCompactionProgress?.() ?? false,
|
|
221
254
|
...(deps.onReset === undefined ? {} : { onReset: deps.onReset }),
|
|
222
255
|
warn: message => ctx.logger.warn(message),
|
|
@@ -270,6 +303,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
270
303
|
route: router.route,
|
|
271
304
|
hooks: deps.hooks,
|
|
272
305
|
...(deps.resetTrajectory === undefined ? {} : { resetTrajectory: deps.resetTrajectory }),
|
|
306
|
+
...(deps.rebound === undefined ? {} : { rebound: deps.rebound }),
|
|
273
307
|
interaction: deps.options.interaction,
|
|
274
308
|
facts: {
|
|
275
309
|
observe: controls.observe,
|
|
@@ -110,16 +110,12 @@ export declare function createCoreChannel(ctx: ChannelHost, initialSession: Agen
|
|
|
110
110
|
};
|
|
111
111
|
resetContextWarning: () => void;
|
|
112
112
|
checkContextWarning: () => void;
|
|
113
|
-
trackPending: (message:
|
|
114
|
-
|
|
115
|
-
text: string;
|
|
116
|
-
images?: readonly import("../types.js").ComposerImageRef[];
|
|
117
|
-
}, placement: import("../types.js").PendingMessage["placement"]) => void;
|
|
118
|
-
untrackPending: (messageId: string) => void;
|
|
113
|
+
trackPending: (message: import("../types.js").PendingTrackInput, placement: import("../types.js").PendingMessage["placement"]) => void;
|
|
114
|
+
untrackPending: (messageId: string, hold?: boolean) => void;
|
|
119
115
|
};
|
|
120
116
|
composer: import("../composer-images.js").ComposerImages;
|
|
121
117
|
input: {
|
|
122
|
-
dispatchUserText: (text: string, placement: import("../types.js").PendingMessage["placement"], images?: readonly import("../types.js").ComposerImageRef[], attach?: import("@deepseek-ai/dsh-llm").UserMessage) => void;
|
|
118
|
+
dispatchUserText: (text: string, placement: import("../types.js").PendingMessage["placement"], images?: readonly import("../types.js").ComposerImageRef[], attach?: import("@deepseek-ai/dsh-llm").UserMessage, contexts?: readonly import("../types.js").AttachedContext[]) => void;
|
|
123
119
|
activity: () => {
|
|
124
120
|
readonly dispatched: number;
|
|
125
121
|
readonly unsettled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/compose.ts"],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AE8D;IAC9D,iBAAiB,CAAC,IAAI,iBAAiB,CAAA;IACvC,oDAAoD;IACpD,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,yEAAyE;IACzE,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B;+DAC2D;IAC3D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC3C,4EAA4E;IAC5E,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,IAAI,IAAI,CAAC;QAAC,KAAK,CAAC,IAAI,IAAI,CAAA;KAAE,CAAA;CAC5C;AAED,wCAAwC;AACxC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE9D,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,WAAW,EAChB,cAAc,EAAE,YAAY,EAC5B,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA+lBiE,CAAC;iBAG3D,CAAA;;wBAjkBC,MAAM,KAAG,IAAI;;;;;;;;;;;;;;;;2BAgQyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BApXtD,CAAA;uCAAqC,CAAC;;;;;;;;kBApCpC,CAAC;gBAAmB,CAAC;;;;;;;;;6BAqQL,IAAI;;IAm1BhC,sFAAsF;iBACzE,gBAAgB,GAAG,IAAI;IAQpC,4EAA4E;wBACxD,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAK1D,gEAAgE;aACvD,YAAY;EA4BxB"}
|
|
@@ -234,6 +234,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
234
234
|
generation: () => state.agentBindingGeneration,
|
|
235
235
|
sessionId: () => state.agentId,
|
|
236
236
|
localImages,
|
|
237
|
+
retainedStageIds: () => new Set(state.pending.filter(item => item.orphaned === true).flatMap(item => item.images.map(image => image.stageId))),
|
|
237
238
|
});
|
|
238
239
|
const files = createCoreFiles(ctx, {
|
|
239
240
|
owner,
|
|
@@ -364,7 +365,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
364
365
|
};
|
|
365
366
|
};
|
|
366
367
|
const state = {
|
|
367
|
-
...createInputActions(() => state, () => binding.session, owner, inputConvergence, composer, (text, placement, images) => dispatchUserText(text, placement, images), (command, includeInContext) => getReadyActions().runLocalCommand(command, includeInContext), sessionId => { extension.touchSession?.(sessionId); }),
|
|
368
|
+
...createInputActions(() => state, () => binding.session, owner, inputConvergence, composer, (text, placement, images, attach, contexts) => dispatchUserText(text, placement, images, attach, contexts), (command, includeInContext) => getReadyActions().runLocalCommand(command, includeInContext), sessionId => { extension.touchSession?.(sessionId); }),
|
|
368
369
|
subscribe: emitter.subscribe,
|
|
369
370
|
emit: emitter.emit,
|
|
370
371
|
emitStream: emitter.emitStream,
|
|
@@ -747,6 +748,10 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
747
748
|
},
|
|
748
749
|
resetTrajectory: () => { if (trajectoryOwned())
|
|
749
750
|
agentTrajectory.reset(); },
|
|
751
|
+
// The image store follows the swap now, while the held rows that keep
|
|
752
|
+
// their images are still listed (#1651): delivering or editing one
|
|
753
|
+
// later must not be what notices the swap.
|
|
754
|
+
rebound: () => { composer.stagedImageGeneration(); },
|
|
750
755
|
retireAttachment: inputDelivery.retireAttachment,
|
|
751
756
|
controls,
|
|
752
757
|
hooks: () => extension.bind ?? {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-actions.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/local-actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD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A;IACzB,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAA;IACvC,eAAe,IAAI,IAAI,CAAA;IACvB,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,2EAA2E;IAC3E,QAAQ,IAAI,IAAI,CAAA;IAChB;2DACuD;IACvD,SAAS,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAA;IACvC,kEAAkE;IAClE,UAAU,CAAC,IAAI,MAAM,IAAI,CAAA;CAC1B;iBAIgB,MAAM;aAQV,IAAI;qBAYI,MAAM,SAAS,SAAS,MAAM,EAAE,YAAY;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;8BAchH,MAAM,KAAG,OAAO;IAE1C;;;;OAIG;6BAC4B,MAAM,oBAAoB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;EA8CnF;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { writeActivityFrames } from '../../../activityPrefs.js';
|
|
|
4
4
|
import { isPresetName, normalizeActivityPreset } from '../../../components/activityFrames.js';
|
|
5
5
|
import { t } from '../../../i18n.js';
|
|
6
6
|
import { runForegroundShell } from '../../compat/shell.js';
|
|
7
|
-
import { LOCAL_OUTPUT_LIMIT,
|
|
7
|
+
import { LOCAL_OUTPUT_LIMIT, preview, previewIndented, trimLocalRows } from '../transcript.js';
|
|
8
8
|
import { sessionWorkingDirectory } from '../../../channel/working-directory.js';
|
|
9
9
|
/** `/activity frames <name>`: validate, persist, re-render. */
|
|
10
10
|
export function setActivityFrames(state, notify, name) {
|
|
@@ -29,18 +29,6 @@ export function setActivityFrames(state, notify, name) {
|
|
|
29
29
|
notify(t('activity-indicator-switched', { name: preset }));
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* One report line that keeps its shape: blank rows stay blank and leading
|
|
34
|
-
* indentation survives; a stray newline still cannot become a second row.
|
|
35
|
-
*/
|
|
36
|
-
function previewIndented(text, limit) {
|
|
37
|
-
const line = text.replace(/[\r\n]+/gu, ' ').replace(/\s+$/u, '');
|
|
38
|
-
// A truly empty Text node measures as zero height; one no-break space keeps
|
|
39
|
-
// the blank row the report asked for without painting anything.
|
|
40
|
-
if (line === '')
|
|
41
|
-
return '\u00a0';
|
|
42
|
-
return line.length <= limit ? line : `${line.slice(0, limit)}…`;
|
|
43
|
-
}
|
|
44
32
|
export function createCoreLocalActions(ctx, deps) {
|
|
45
33
|
const { owner, binding, state, rowIds, notify } = deps;
|
|
46
34
|
return {
|
|
@@ -71,19 +59,8 @@ export function createCoreLocalActions(ctx, deps) {
|
|
|
71
59
|
const render = options?.preserveWhitespace ? previewIndented : preview;
|
|
72
60
|
// Local reports cannot be restored from backend history. Retain whole
|
|
73
61
|
// recent blocks within the existing row budget, without folding facts.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (state.rows[i].kind !== 'local' && state.rows[i].kind !== 'local-output') {
|
|
77
|
-
i++;
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
let end = i + 1;
|
|
81
|
-
while (state.rows[end]?.kind === 'local-output')
|
|
82
|
-
end++;
|
|
83
|
-
count -= end - i;
|
|
84
|
-
state.rows.splice(i, end - i);
|
|
85
|
-
markChannelReadDirty(state.rows);
|
|
86
|
-
}
|
|
62
|
+
trimLocalRows(state.rows, lines.length + 1);
|
|
63
|
+
markChannelReadDirty(state.rows);
|
|
87
64
|
state.rows.push({ id: rowIds.value++, kind: 'local', text: title });
|
|
88
65
|
for (const line of lines)
|
|
89
66
|
state.rows.push({ id: rowIds.value++, kind: 'local-output', text: render(line, limit) });
|
|
@@ -7,7 +7,7 @@ beforeStream, options = {}) {
|
|
|
7
7
|
const foldOption = options.fold;
|
|
8
8
|
const fold = typeof foldOption === 'function' ? foldOption : foldOption === false ? () => false : () => true;
|
|
9
9
|
const listeners = new Set();
|
|
10
|
-
const foldCursor = { rows: undefined, index: 0, head: undefined };
|
|
10
|
+
const foldCursor = { rows: undefined, index: 0, head: undefined, boundary: undefined };
|
|
11
11
|
let timer;
|
|
12
12
|
let disposed = false;
|
|
13
13
|
const wake = (source) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAyB5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAyB5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA6BpD,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAsBzE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CA2xBN"}
|
|
@@ -27,6 +27,7 @@ import { createLoadedContextRefresher } from './loaded-context.js';
|
|
|
27
27
|
import { createLocalActions } from './local-actions.js';
|
|
28
28
|
import { mentionAttachments } from './mentions.js';
|
|
29
29
|
import { createModelSelection } from './model-selection.js';
|
|
30
|
+
import { createToolScope } from '../tool-scope.js';
|
|
30
31
|
import { createModelActions } from './model-actions.js';
|
|
31
32
|
import { createModelSwitchAction } from './model-switch.js';
|
|
32
33
|
import { autoPresetConfirmed, createPermissionModeActions } from './mode-permission-actions.js';
|
|
@@ -480,6 +481,11 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
|
|
|
480
481
|
state.cancelPending = false;
|
|
481
482
|
state.status = binding.agent.status;
|
|
482
483
|
state.emit();
|
|
484
|
+
// Track all existing and newly published agent scopes, not only the screen's
|
|
485
|
+
// binding: background dispatch and subagents may run without being attached.
|
|
486
|
+
// Older hosts retain the final-assembly filters in the plugin instead.
|
|
487
|
+
// Created after the agent view so construction rollback still owns its listeners.
|
|
488
|
+
const toolScope = createToolScope(ctx, dispose => owner.own(dispose), () => binding.agent);
|
|
483
489
|
const modelActions = createModelActions(ctx, state, {
|
|
484
490
|
owner,
|
|
485
491
|
binding,
|
|
@@ -488,6 +494,7 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
|
|
|
488
494
|
agent: () => binding.agent,
|
|
489
495
|
notify,
|
|
490
496
|
checkContextWarning: core.bookkeeping.checkContextWarning,
|
|
497
|
+
onPresetChanged: agent => toolScope.apply(agent),
|
|
491
498
|
});
|
|
492
499
|
// The first bind (start) and every adoption tail bind through the core
|
|
493
500
|
// feed, which runs the DSH binding-events hooks below.
|
|
@@ -538,6 +545,7 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
|
|
|
538
545
|
seedActivity: options.seedActivity,
|
|
539
546
|
seedContextOccupancy: options.seedContextOccupancy,
|
|
540
547
|
seedTeam: options.seedTeam,
|
|
548
|
+
onBind: agent => toolScope.apply(agent),
|
|
541
549
|
inputConvergence: core.inputConvergence,
|
|
542
550
|
modelSelection,
|
|
543
551
|
modelActions,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentSession } from '../../agent/session.js';
|
|
2
|
-
import type { ChannelState, ComposerImageRef } from './types.js';
|
|
2
|
+
import type { AttachedContext, ChannelState, ComposerImageRef } from './types.js';
|
|
3
3
|
export interface InputConvergence {
|
|
4
4
|
cancelInFlight: boolean;
|
|
5
5
|
interruptSeq: number;
|
|
@@ -25,12 +25,12 @@ export interface InputConvergence {
|
|
|
25
25
|
* undefined when none is. */
|
|
26
26
|
provisionalDockIds?: string[];
|
|
27
27
|
}
|
|
28
|
-
export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities'>, getSession: () => AgentSession, owner: {
|
|
28
|
+
export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities' | 'status'>, getSession: () => AgentSession, owner: {
|
|
29
29
|
assertActive(): void;
|
|
30
30
|
}, input: InputConvergence, composer: {
|
|
31
31
|
includeLegacyImageRefs(text: string, images: readonly ComposerImageRef[]): readonly ComposerImageRef[];
|
|
32
|
-
}, dispatchUserText: (text: string, placement: 'steer' | 'followup', images?: readonly ComposerImageRef[]) => void, runLocalCommand: (command: string, includeInContext: boolean) => Promise<void>,
|
|
32
|
+
}, dispatchUserText: (text: string, placement: 'steer' | 'followup', images?: readonly ComposerImageRef[], attach?: never, contexts?: readonly AttachedContext[]) => void, runLocalCommand: (command: string, includeInContext: boolean) => Promise<void>,
|
|
33
33
|
/** Move the used session to the front of the `/resume` MRU (DSH session
|
|
34
34
|
* history); a backend whose sessions that list cannot open passes a no-op. */
|
|
35
|
-
touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft'>;
|
|
35
|
+
touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft' | 'holdInputs'>;
|
|
36
36
|
//# sourceMappingURL=input-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"input-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAGzE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAsC,MAAM,YAAY,CAAA;AAErH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB;;6EAEyE;IACzE,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAClC;0EACsE;IACtE,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;yEAGqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B;;;;;;;kCAO8B;IAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B;AACD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,qBAAqB,GAAG,QAAQ,CAAC,EAClI,UAAU,EAAE,MAAM,YAAY,EAC9B,KAAK,EAAE;IAAE,YAAY,IAAI,IAAI,CAAA;CAAE,EAC/B,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE;IAAE,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,gBAAgB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