@deepseek-harness-tui/dsh-tui 0.18.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.
Files changed (209) hide show
  1. package/README.md +35 -10
  2. package/bin/dsh-tui.js +46 -3
  3. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  4. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  5. package/guide/dsh-tui-guide/configuration.en.md +7 -2
  6. package/guide/dsh-tui-guide/configuration.md +7 -2
  7. package/guide/dsh-tui-guide/getting-started.en.md +168 -4
  8. package/guide/dsh-tui-guide/getting-started.md +121 -14
  9. package/guide/dsh-tui-guide/interaction.en.md +11 -10
  10. package/guide/dsh-tui-guide/interaction.md +5 -4
  11. package/guide/dsh-tui-guide/user-guide.en.md +6 -5
  12. package/guide/dsh-tui-guide/user-guide.md +6 -5
  13. package/lib/settings.json +1 -1
  14. package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
  15. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  16. package/lib/types/adapter/ports/channel-view.d.ts +28 -5
  17. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  18. package/lib/types/agent/events.d.ts +12 -5
  19. package/lib/types/agent/events.d.ts.map +1 -1
  20. package/lib/types/agent/session.d.ts +5 -0
  21. package/lib/types/agent/session.d.ts.map +1 -1
  22. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  23. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  24. package/lib/types/backends/claude/translate/core.js +10 -6
  25. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  26. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  27. package/lib/types/backends/codex/session/commands.js +8 -4
  28. package/lib/types/backends/codex/session/input.d.ts +11 -7
  29. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  30. package/lib/types/backends/codex/session/input.js +68 -15
  31. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  32. package/lib/types/backends/codex/session/session.js +2 -3
  33. package/lib/types/channel/projection.d.ts.map +1 -1
  34. package/lib/types/channel/projection.js +78 -10
  35. package/lib/types/channel/questions.d.ts +19 -3
  36. package/lib/types/channel/questions.d.ts.map +1 -1
  37. package/lib/types/channel/sanitize.d.ts.map +1 -1
  38. package/lib/types/channel/sanitize.js +8 -4
  39. package/lib/types/channel/subagent-failure.d.ts +49 -0
  40. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  41. package/lib/types/channel/subagent-failure.js +59 -0
  42. package/lib/types/channel/transcript.d.ts +17 -0
  43. package/lib/types/channel/transcript.d.ts.map +1 -1
  44. package/lib/types/channel/transcript.js +35 -0
  45. package/lib/types/commands.js +1 -1
  46. package/lib/types/components/MessageList.d.ts.map +1 -1
  47. package/lib/types/components/MessageList.js +11 -7
  48. package/lib/types/components/PromptInput.d.ts.map +1 -1
  49. package/lib/types/components/PromptInput.js +61 -6
  50. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  51. package/lib/types/components/SubagentDashboard.js +7 -1
  52. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  53. package/lib/types/components/messages/AssistantToolUseMessage.js +5 -2
  54. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  55. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  56. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  57. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  58. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  59. package/lib/types/components/revealScope.d.ts +15 -0
  60. package/lib/types/components/revealScope.d.ts.map +1 -0
  61. package/lib/types/components/revealScope.js +17 -0
  62. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
  63. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  64. package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
  65. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  66. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
  67. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  68. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
  69. package/lib/types/components/smoothReveal.d.ts +36 -6
  70. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  71. package/lib/types/components/smoothReveal.js +92 -21
  72. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  73. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  74. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  75. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  76. package/lib/types/dsh-adapter/backend/session.js +12 -0
  77. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/backend/translate.js +6 -1
  79. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  80. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  81. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  82. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  83. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  84. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  85. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
  86. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
  88. package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
  89. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  90. package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
  91. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  92. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  93. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  94. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/channel/extensions.js +8 -0
  96. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  97. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  98. package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
  99. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  100. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  101. package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
  102. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  103. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  104. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  105. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  106. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  107. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  108. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  109. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  111. package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
  112. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -4
  114. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
  116. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  117. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  119. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  120. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/contract.d.ts +26 -3
  122. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  123. package/lib/types/dsh-adapter/contract.js +44 -5
  124. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  125. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  126. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  127. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  128. package/lib/types/dsh-adapter/host-access.js +60 -11
  129. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  130. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  131. package/lib/types/dsh-adapter/host-contract.js +4 -2
  132. package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
  133. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/host-dsh.js +27 -6
  135. package/lib/types/dsh-adapter/host-entry.js +4 -0
  136. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  137. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  138. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/plugin.js +143 -44
  140. package/lib/types/dsh-adapter/presets.d.ts +38 -11
  141. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  142. package/lib/types/dsh-adapter/presets.js +46 -17
  143. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  144. package/lib/types/dsh-adapter/process-exit.js +1 -1
  145. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  146. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/questions.js +1 -1
  148. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  149. package/lib/types/dsh-adapter/subagents.d.ts +5 -0
  150. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/subagents.js +22 -1
  152. package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
  153. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/team-mode.js +19 -12
  155. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  156. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  157. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  158. package/lib/types/dsh-adapter/types.d.ts +2 -1
  159. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  160. package/lib/types/heldInputs.d.ts +55 -16
  161. package/lib/types/heldInputs.d.ts.map +1 -1
  162. package/lib/types/heldInputs.js +277 -41
  163. package/lib/types/i18n.d.ts +227 -11
  164. package/lib/types/i18n.d.ts.map +1 -1
  165. package/lib/types/i18n.js +60 -5
  166. package/lib/types/ink/components/App.d.ts +2 -0
  167. package/lib/types/ink/components/App.d.ts.map +1 -1
  168. package/lib/types/ink/components/App.js +8 -0
  169. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  170. package/lib/types/ink/events/input-event.js +7 -6
  171. package/lib/types/ink/hit-test.d.ts +2 -0
  172. package/lib/types/ink/hit-test.d.ts.map +1 -1
  173. package/lib/types/ink/hit-test.js +10 -0
  174. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  175. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  176. package/lib/types/ink/hooks/use-program-status.js +3 -2
  177. package/lib/types/ink/ink.d.ts +1 -0
  178. package/lib/types/ink/ink.d.ts.map +1 -1
  179. package/lib/types/ink/ink.js +5 -2
  180. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  181. package/lib/types/ink/parse-keypress.js +25 -0
  182. package/lib/types/ink/terminal.d.ts +13 -2
  183. package/lib/types/ink/terminal.d.ts.map +1 -1
  184. package/lib/types/ink/terminal.js +29 -5
  185. package/lib/types/screens/Chat.d.ts.map +1 -1
  186. package/lib/types/screens/Chat.js +43 -2
  187. package/lib/types/screens/SessionSupervisor.d.ts +3 -6
  188. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  189. package/lib/types/screens/SessionSupervisor.js +5 -8
  190. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
  191. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  192. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
  193. package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
  194. package/lib/types/screens/sessionSupervisor/model.js +1 -1
  195. package/lib/types/sessionMounts.d.ts +12 -5
  196. package/lib/types/sessionMounts.d.ts.map +1 -1
  197. package/lib/types/sessionMounts.js +33 -6
  198. package/lib/types/update.d.ts +412 -20
  199. package/lib/types/update.d.ts.map +1 -1
  200. package/lib/types/update.js +2094 -193
  201. package/lib/types/updateHost.d.ts +198 -0
  202. package/lib/types/updateHost.d.ts.map +1 -0
  203. package/lib/types/updateHost.js +608 -0
  204. package/lib/types/utils/processName.d.ts +16 -0
  205. package/lib/types/utils/processName.d.ts.map +1 -0
  206. package/lib/types/utils/processName.js +27 -0
  207. package/package.json +111 -108
  208. package/tui-profile/feed/README.md +1 -1
  209. package/tui-profile/feed/first-party.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAA;AAGhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAA+D,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAsBtH,OAAO,EAAmE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC3H,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE7E,OAAO,EAAE,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACzH,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAu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;IACP,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,aAAa,CAAA;CACzB,GACL,OAAO,CAAC,IAAI,CAAC,CAuGf;AAiND,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAIrE"}
@@ -14,6 +14,7 @@ import { EDITABLE_CONFIG_KEYS } from '../settings/definitions.js';
14
14
  import { kernelEntriesOf } from '../components/kernelCatalog.js';
15
15
  import { openBackendStartup, prepareBackendStartup, probeKernels, installSurfaceFor } from './backends.js';
16
16
  import { backendLabel, isBackendIdSyntax, isRegisteredBackend, listBackends, listOfferedBackends, loadBackend, parseBackendChoice, unloadBackends } from './backend-registry.js';
17
+ import { installedKernelVersion } from './contract.js';
17
18
  import { createPluginInstallEntry } from './plugin-install.js';
18
19
  import { createPluginManageEntry } from './plugin-manage.js';
19
20
  import { formatSessionRef } from '../agent/refs.js';
@@ -52,12 +53,12 @@ import { clearResumeTarget, resumeTargetFromArgv, stripResumeArgs, writeResumeTa
52
53
  import { cmdlineArgsOf, initialPromptFromCmdlineArgs } from './startup-args.js';
53
54
  import { readHomePrefs } from '../homePrefs.js';
54
55
  import { handoffEventTag, formatHandoffNotice } from '../handoffEvents.js';
55
- import { adoptHeldInputs, heldInputsResumeCommand, takeHeldInputs, writeHeldInputs } from '../heldInputs.js';
56
+ import { adoptHeldInputs, collectHeldInputs, heldInputsResumeCommand, takeHeldInputs, writeHeldInputs } from '../heldInputs.js';
56
57
  import { armFirstFrameAck, beginHandoffAck, handoffAttemptId, ownsAltScreenExit } from '../handoffAck.js';
57
58
  import { DSH_BACKEND_ID, HOST_NOTICE_ENV, KERNEL_SWITCH_HANDOFF_ENV, RESUME_BACKEND_ENV, RESUME_RETRY_ENV, parseBackendId, readKernelPrefs, resolveRememberedBackend, resolveResumeTarget, writeKernelPrefs } from '../kernelPrefs.js';
58
59
  import { shouldOfferOnboarding } from '../onboardingPrefs.js';
59
60
  import { resolveSessionCwd } from '../utils/workspaceRoot.js';
60
- import { LAUNCH_PROMPT_SENT_ENV, beginRestartAttempt, checkForTuiUpdate, installedTuiVersion, isBootDeadlockTarget, isStandaloneRuntime, isVersionNewer, logRestartEvent, resolveDshProfileName, resolveTuiUpdateTarget, restartTui, updateTuiAndRestart, writeHandoffNotice, writeLastRunRecord } from '../update.js';
61
+ import { LAUNCH_PROMPT_SENT_ENV, beginRestartAttempt, blockedUpdateMessages, checkForTuiUpdate, describeHostStepReason, describeLauncherStepReason, deliverEngineSkipReport, idleReportMessages, installedTuiVersion, isBootDeadlockTarget, isStandaloneRuntime, isVersionNewer, logRestartEvent, resolveDshProfileName, resolveUpdatePlan, restartTui, updatePlanLayers, updatePlanState, updatePlanSuite, updateTuiAndRestart, writeHandoffNotice, writeLastRunRecord } from '../update.js';
61
62
  import { getLang, isLang, resolveStartupLang, setLang, t, writeLangPref } from '../i18n.js';
62
63
  import { applyBtwContextBudget, applyBtwContextTurns, applyCodeFrameStyle, applyCompanionSkin, applyImageBacking, applyMathImageBacking, applyMathImageScale, applyMathRendering, applyMermaidDiagrams, applyPageMargin, applySidePanelOpen, applySidePanelPanels, applySidePanelRatio, applySidePanelSplitEnabled, ALL_SIDE_PANELS, BTW_CONTEXT_BUDGET_MAX, BTW_CONTEXT_BUDGET_MIN, BTW_CONTEXT_TURNS_MAX, BTW_CONTEXT_TURNS_MIN, DEFAULT_PAGE_MARGIN, DEFAULT_STATUS_BAR, isPageMarginMode, normalizeJobGroupFold, normalizePageMargin, normalizeScrollGutter, normalizeSidePanelPanels, normalizePluginFieldsOrder, normalizeStatusBar, normalizeToolBackground, parsePageMarginSpec, parsePluginFieldsOrder, parseSidePanelPanels, resolveMathRendering } from '../tuiDisplayPrefs.js';
63
64
  import { draftComboConflicts, effectiveComboString, parseComboDraft, setKeymapOverrides, SHORTCUT_ACTIONS, } from '../utils/keymap.js';
@@ -427,10 +428,17 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
427
428
  // pretending the update landed.
428
429
  {
429
430
  const updatedFrom = process.env.DSH_TUI_UPDATED_FROM;
430
- if (updatedFrom !== undefined) {
431
- // Assigning undefined would stringify to "undefined" and leak the
432
- // marker into every child process; remove it for real.
431
+ const updatedDshFrom = process.env.DSH_TUI_UPDATED_DSH_FROM;
432
+ const launcherAbsent = process.env.DSH_TUI_LAUNCHER_ABSENT !== undefined;
433
+ // Assigning undefined would stringify to "undefined" and leak the marker
434
+ // into every child process; remove them for real.
435
+ if (updatedFrom !== undefined)
433
436
  delete process.env.DSH_TUI_UPDATED_FROM;
437
+ if (updatedDshFrom !== undefined)
438
+ delete process.env.DSH_TUI_UPDATED_DSH_FROM;
439
+ if (launcherAbsent)
440
+ delete process.env.DSH_TUI_LAUNCHER_ABSENT;
441
+ if (updatedFrom !== undefined) {
434
442
  const now = installedTuiVersion();
435
443
  if (now === undefined || !isVersionNewer(now, updatedFrom)) {
436
444
  ctx.logger.warn(`dsh-tui: /update restarted but the version did not advance (still ${now ?? 'unknown'}, was ${updatedFrom})`);
@@ -439,21 +447,45 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
439
447
  `可能是镜像 registry 未同步,请稍后重试或检查 registry 配置。\n`);
440
448
  }
441
449
  }
442
- else if (process.stderr.isTTY) {
443
- // Launcher alignment bridge (0.8.3): /update only replaces the
444
- // package inside the DSH profile; a globally installed `dsh-tui`
445
- // launcher is a separate copy that keeps its old version. Launchers
446
- // >=0.8.3 export DSH_TUI_LAUNCHER_VERSION so we can tell whether
447
- // the outer launcher lags the freshly installed profile. Launchers
448
- // <=0.8.2 never set the marker — the generic branch below is
449
- // intentionally one-shot: DSH_TUI_UPDATED_FROM exists only on the
450
- // replacement process immediately after /update.
451
- const launcherVersion = process.env.DSH_TUI_LAUNCHER_VERSION;
452
- if (launcherVersion === undefined) {
453
- process.stderr.write(`\n[dsh-tui] ${t('update-launcher-align-unknown', { version: now })}\n`);
450
+ }
451
+ // Engine counterpart (#1844 §3.6): the engine step reports its own stamp,
452
+ // so a "TUI already latest, engine-only" update is checked against the
453
+ // engine instead of tripping the TUI version-advance warning above.
454
+ if (updatedDshFrom !== undefined) {
455
+ const engine = installedKernelVersion();
456
+ if (engine === undefined || !isVersionNewer(engine, updatedDshFrom)) {
457
+ ctx.logger.warn(`dsh-tui: /update restarted but the dsh engine did not advance (still ${engine ?? 'unknown'}, was ${updatedDshFrom})`);
458
+ if (process.stderr.isTTY) {
459
+ process.stderr.write(`\n${t('update-engine-not-advanced', {
460
+ now: engine ?? 'unknown',
461
+ from: updatedDshFrom,
462
+ command: 'dsh-tui update',
463
+ })}\n`);
454
464
  }
455
- else if (isVersionNewer(now, launcherVersion)) {
456
- process.stderr.write(`\n[dsh-tui] ${t('update-launcher-outdated', { profile: now, launcher: launcherVersion })}\n`);
465
+ }
466
+ }
467
+ if ((updatedFrom !== undefined || updatedDshFrom !== undefined) && process.stderr.isTTY) {
468
+ // Launcher alignment bridge (0.8.3): the profile copy was just
469
+ // replaced; a globally installed `dsh-tui` launcher is a separate copy
470
+ // that keeps its old version. Launchers >=0.8.3 export
471
+ // DSH_TUI_LAUNCHER_VERSION so we can tell whether the outer launcher
472
+ // lags the freshly installed profile. Both stamps exist only on the
473
+ // replacement process immediately after /update.
474
+ const launcherVersion = process.env.DSH_TUI_LAUNCHER_VERSION;
475
+ if (launcherVersion === undefined) {
476
+ // A `dsh --profile` boot has no launcher to align at all, and plan
477
+ // §3.5 asks for no warning there: the update that just ran resolved no
478
+ // launcher and left a one-shot marker. An engine-only update stays
479
+ // silent unless a launcher actually reported itself; a TUI-only update
480
+ // through an older shim (version marker, no path) still warns.
481
+ if (updatedFrom !== undefined && !launcherAbsent) {
482
+ process.stderr.write(`\n[dsh-tui] ${t('update-launcher-align-unknown', { version: installedTuiVersion() ?? 'unknown' })}\n`);
483
+ }
484
+ }
485
+ else {
486
+ const profileVersion = installedTuiVersion();
487
+ if (profileVersion !== undefined && isVersionNewer(profileVersion, launcherVersion)) {
488
+ process.stderr.write(`\n[dsh-tui] ${t('update-launcher-outdated', { profile: profileVersion, launcher: launcherVersion })}\n`);
457
489
  }
458
490
  }
459
491
  }
@@ -491,10 +523,13 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
491
523
  // delegation rows, and a request that carries `spawn_teammate` drops
492
524
  // `subagent` / `subagent_fork` (team-mode.ts), so a team bundle switched
493
525
  // at run time reaches the sessions already running.
526
+ // 0.2.2 presentations have no tool declarations: tool-scope.ts owns those
527
+ // restrictions and these shape-based filters keep only the section half.
528
+ // Old hosts still carry tools here and must retain the same safety filters.
494
529
  dshCtx.on('system-prompt/assemble', async (_assembly, context, next) => {
495
- const assembled = filterTeamReplacedTools(await next());
530
+ const assembled = await next();
496
531
  const presetId = context.agent === undefined ? undefined : runningPresetOf(context.agent.session);
497
- return filterMinimalPresetTools(assembled, presetId);
532
+ return filterMinimalPresetTools(filterTeamReplacedTools(assembled), presetId);
498
533
  });
499
534
  // `/debug-prompt` snapshots the final provider-neutral request at the
500
535
  // llm/stream boundary, after every prompt and tool contributor has run.
@@ -2069,6 +2104,15 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2069
2104
  ctx.effect(() => unsubscribe, 'dsh-tui initial prompt after startup');
2070
2105
  }
2071
2106
  }
2107
+ // The /update that restarted into this process skipped the engine. Its own
2108
+ // screen was torn down in the same tick, so the guidance lands here, on the
2109
+ // mount that survives the boot recompose.
2110
+ if (!shadow) {
2111
+ ctx.effect(() => deliverEngineSkipReport(channel, skip => {
2112
+ channel.pushLocal(skip.title, skip.report.split('\n').map(line => line.trimEnd()), { lineLimit: 2000 });
2113
+ notifyChannel(skip.toast, { color: 'warning' });
2114
+ }), 'dsh-tui engine skip report after startup');
2115
+ }
2072
2116
  // Attach the stderr reporter to the live channel and flush anything a
2073
2117
  // startup-spawned server produced while the channel didn't exist yet.
2074
2118
  notifyStderr = (text, options) => notifyChannel(text, options);
@@ -2093,7 +2137,8 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2093
2137
  let instance;
2094
2138
  let exited = false;
2095
2139
  let updateRequested = false;
2096
- let updateTargetVersion;
2140
+ /** The preflight plan for /update (TUI + engine + launcher, #1844). */
2141
+ let updatePlan;
2097
2142
  // `/restart` flag: same exit funnel as `/update` minus the pnpm step —
2098
2143
  // write the resume target, restore the terminal, respawn the process with
2099
2144
  // the original argv, and let the fresh boot attach the same session.
@@ -2160,6 +2205,14 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2160
2205
  return;
2161
2206
  }
2162
2207
  if (updateRequested) {
2208
+ // The plan is assigned in the same onUpdate block that raises
2209
+ // `updateRequested`; capturing it keeps the narrowed type inside the
2210
+ // exit closure. Unreachable, but exiting non-zero beats hanging.
2211
+ const plan = updatePlan;
2212
+ if (plan === undefined) {
2213
+ void disposeRootAndExit(ctx, 1);
2214
+ return;
2215
+ }
2163
2216
  try {
2164
2217
  // Non-DSH sessions keep their marker in backend prefs, not DSH's `resume.txt`.
2165
2218
  if (backendStart === undefined) {
@@ -2179,7 +2232,7 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2179
2232
  const hintText = isStandaloneRuntime()
2180
2233
  ? t('update-standalone-starting')
2181
2234
  : t('update-starting');
2182
- void finishExit(ctx, instance, bootedFullscreen, hintText, undefined, () => runUpdate(ctx, profile, handoffSessionId(), updateTargetVersion, backendChoice, handoffHint, exitSeam));
2235
+ void finishExit(ctx, instance, bootedFullscreen, hintText, undefined, () => runUpdate(ctx, profile, handoffSessionId(), plan, backendChoice, handoffHint, exitSeam));
2183
2236
  return;
2184
2237
  }
2185
2238
  // The kernel selector's switch: the same respawn machinery, no resume.
@@ -2233,14 +2286,26 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2233
2286
  }
2234
2287
  refreshLastRunRecord();
2235
2288
  // The queue dies with this process (the kernel records it canceled);
2236
- // the replacement parks the same texts as held dock rows (#1651).
2237
- const heldEnv = writeHeldInputs(channel.pending.map(item => item.text));
2289
+ // the replacement parks the same inputs, images included, as held
2290
+ // dock rows (#1651). Their bytes are read now, while the session's
2291
+ // attachment store is still up; the spawn waits for them.
2292
+ const held = collectHeldInputs(channel.pending, stageId => channel.stagedImage(stageId));
2238
2293
  void finishExit(ctx, instance, bootedFullscreen,
2239
2294
  // This line is the one the user actually sees before the terminal is
2240
2295
  // handed over (the composer's toast dies with the unmount): a
2241
2296
  // mid-turn restart must say that the running turn is interrupted,
2242
2297
  // not promise a clean resume.
2243
- t(channel.working ? 'restart-during-turn' : 'restart-starting'), undefined, () => runRestart(ctx, profile, handoffSessionId(), handoffHint, { kernel: backendChoice, env: heldEnv }, exitSeam));
2298
+ t(channel.working ? 'restart-during-turn' : 'restart-starting'), undefined, () => {
2299
+ // A failed collection must still restart, without the carried
2300
+ // input: the alternative is a half-disposed process that never
2301
+ // spawns a replacement. The texts stay in the composer's own
2302
+ // history either way.
2303
+ // `then(onOk, onErr)`, not `.then(...).catch(...)`: the catch form
2304
+ // also swallows a synchronous throw from `runRestart`, which would
2305
+ // dispose the root a second time and race two replacements for the
2306
+ // same session mount.
2307
+ void held.then(inputs => { runRestart(ctx, profile, handoffSessionId(), handoffHint, { kernel: backendChoice, env: writeHeldInputs(inputs) }, exitSeam); }, () => { runRestart(ctx, profile, handoffSessionId(), handoffHint, { kernel: backendChoice }, exitSeam); });
2308
+ });
2244
2309
  return;
2245
2310
  }
2246
2311
  // Judge against the live session behind the channel (channel.agentId),
@@ -2526,42 +2591,71 @@ export async function apply(ctx, runtimeConfig, configOwner = ctx, runtimeOption
2526
2591
  onUpdate: profile === undefined ? undefined : () => {
2527
2592
  if (exited || updateRequested)
2528
2593
  return;
2529
- // Confirm the target version before tearing the TUI down: on an
2530
- // already-latest install, an unconditional update+restart would churn
2531
- // the process and then trip the "version did not advance" warning.
2532
- void resolveTuiUpdateTarget().then((target) => {
2594
+ // Resolve the WHOLE set before tearing the TUI down (#1844): the TUI
2595
+ // target, the engine version its peer range validates, and whether the
2596
+ // global launcher lags. An already-current TUI does NOT end the check —
2597
+ // the engine and launcher layers may still have work to do.
2598
+ void resolveUpdatePlan().then((plan) => {
2533
2599
  if (exited || updateRequested)
2534
2600
  return;
2535
- if (target.kind === 'latest') {
2536
- notifyChannel(t('update-already-latest', { current: target.current }), { color: 'warning' });
2601
+ const state = updatePlanState(plan);
2602
+ if (state === 'blocked') {
2603
+ // The composer toast is a single truncated row; the refusal promises
2604
+ // a manual repair command, so the complete text goes into a durable
2605
+ // transcript report and the toast stays a short pointer.
2606
+ const blocked = blockedUpdateMessages(plan);
2607
+ channel.pushLocal(blocked.title, blocked.report.split('\n').map(line => line.trimEnd()), { lineLimit: 2000 });
2608
+ notifyChannel(blocked.toast, { color: 'warning' });
2609
+ return;
2610
+ }
2611
+ if (state === 'empty') {
2612
+ notifyChannel(t('update-plan-empty', { layers: updatePlanSuite(plan) }));
2613
+ return;
2614
+ }
2615
+ if (state === 'idle') {
2616
+ const report = idleReportMessages(plan);
2617
+ if (report !== undefined) {
2618
+ // The composer toast is one truncated row; either the engine cannot
2619
+ // be aligned automatically (with a computed repair command) or a
2620
+ // newer release is waiting for a TUI that declares it, so the whole
2621
+ // explanation goes into the durable transcript.
2622
+ channel.pushLocal(report.title, report.report.split('\n').map(line => line.trimEnd()), { lineLimit: 2000 });
2623
+ notifyChannel(report.toast, { color: 'warning' });
2624
+ return;
2625
+ }
2626
+ notifyChannel(t('update-plan-idle', {
2627
+ current: plan.tui.kind === 'latest' ? plan.tui.current : installedTuiVersion() ?? 'unknown',
2628
+ reason: describeLauncherStepReason(plan.launcher) ?? describeHostStepReason(plan.host),
2629
+ }), { color: 'warning' });
2537
2630
  return;
2538
2631
  }
2539
- if (target.kind === 'unknown') {
2632
+ if (plan.tui.kind === 'unknown') {
2540
2633
  notifyChannel(t('update-check-failed'));
2541
2634
  }
2542
- else {
2635
+ else if (plan.tui.kind === 'update') {
2543
2636
  // 0.7.0/0.7.1 hard-inject tuiWorkspaces at the code level; under
2544
2637
  // an older global launcher patch (no service row) that is a
2545
2638
  // permanent boot deadlock (issues #183/#307, the exact report
2546
2639
  // "pending (waiting for service: tuiWorkspaces)"). A stale mirror
2547
2640
  // pinning /update onto that range must be refused, not installed.
2548
- if (isBootDeadlockTarget(target.latest)) {
2641
+ if (isBootDeadlockTarget(plan.tui.latest)) {
2549
2642
  notifyChannel(t('update-refused-deadlock', {
2550
- latest: target.latest,
2551
- authoritative: target.authoritative ?? target.latest,
2643
+ latest: plan.tui.latest,
2644
+ authoritative: plan.tui.authoritative ?? plan.tui.latest,
2552
2645
  }), { color: 'warning' });
2553
2646
  return;
2554
2647
  }
2555
- if (target.authoritative !== undefined) {
2556
- notifyChannel(t('update-mirror-lag', { latest: target.latest, authoritative: target.authoritative }));
2648
+ if (plan.tui.authoritative !== undefined) {
2649
+ notifyChannel(t('update-mirror-lag', { latest: plan.tui.latest, authoritative: plan.tui.authoritative }));
2557
2650
  }
2558
- updateTargetVersion = target.latest;
2559
2651
  }
2652
+ updatePlan = plan;
2560
2653
  if (isStandaloneRuntime()) {
2561
2654
  notifyChannel(t('update-standalone-starting'));
2562
2655
  }
2563
2656
  else {
2564
- notifyChannel(t('update-starting'));
2657
+ const layers = updatePlanLayers(plan);
2658
+ notifyChannel(layers.length === 0 ? t('update-starting') : t('update-plan-starting', { layers: layers.join(' · ') }));
2565
2659
  }
2566
2660
  updateRequested = true;
2567
2661
  handleExit();
@@ -3432,10 +3526,15 @@ function runRestart(ctx, profile, sessionId, hint = id => resumeCommand(profile,
3432
3526
  });
3433
3527
  }, stalled);
3434
3528
  }
3435
- function runUpdate(ctx, profile, sessionId, targetVersion, kernel, hint = id => resumeCommand(profile, id), exitSeam) {
3529
+ function runUpdate(ctx, profile, sessionId, plan, kernel, hint = id => resumeCommand(profile, id), exitSeam) {
3436
3530
  const recovery = preservedSessionTail(sessionId, hint);
3437
3531
  disposeRootAndThen(ctx, () => {
3438
- logRestartEvent('update: starting', { profile, targetVersion });
3532
+ logRestartEvent('update: starting', {
3533
+ profile,
3534
+ tui: plan.tui.kind === 'update' ? `${plan.tui.current}->${plan.tui.latest}` : plan.tui.kind,
3535
+ host: plan.host.kind === 'install' ? `${plan.host.from ?? '?'}->${plan.host.to}` : plan.host.kind,
3536
+ launcher: plan.launcher.kind,
3537
+ });
3439
3538
  writeHandoffNotice(`\ndsh-tui: installation starts. Check/repair an interrupted installation before resuming.${recovery}`);
3440
3539
  if (profile === undefined) {
3441
3540
  writeHandoffNotice(`\n${t('update-aborted-no-profile')}${recovery}`);
@@ -3457,7 +3556,7 @@ function runUpdate(ctx, profile, sessionId, targetVersion, kernel, hint = id =>
3457
3556
  exitSeam.request = replacementRequest;
3458
3557
  onSpawn?.(child);
3459
3558
  };
3460
- void updateTuiAndRestart(sessionId, profile, targetVersion, kernel, supervision, cancellation.signal).then(({ updateCode, restartCode }) => {
3559
+ void updateTuiAndRestart(sessionId, profile, plan, kernel, supervision, cancellation.signal).then(({ updateCode, restartCode }) => {
3461
3560
  logRestartEvent('update: finished', { updateCode, restartCode });
3462
3561
  if (updateCode !== 0) {
3463
3562
  writeHandoffNotice(`\ndsh-tui update failed (exit ${updateCode}). Check/repair the installation before resuming.${preservedSessionTail(sessionId, hint)}`);
@@ -18,7 +18,6 @@
18
18
  import type { Context } from '@deepseek-ai/cordis';
19
19
  import type { AgentSetup } from '@deepseek-ai/dsh-agent';
20
20
  import type { SessionId } from '@deepseek-ai/dsh-session';
21
- import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
22
21
  import { type ModelRoute } from '../modelRoute.js';
23
22
  /** The composition inputs for `agents.create`/`agents.resume`. */
24
23
  export interface PresetComposition {
@@ -106,28 +105,56 @@ export declare function presetHidesHostAskTool(presetId: string | undefined): bo
106
105
  * exactly one persistent shell tool, and host-layer contributors the person
107
106
  * switched on elsewhere must not become extra ones.
108
107
  *
109
- * Three such contributors are carved out here (the last one for liangshen
110
- * too, see `PERSISTENT_SHELL_PRESETS`):
108
+ * The carve-outs live in two places since 0.2.2 split the prompt assembly
109
+ * from the tool declarations: this section filter, and `presetToolDeny`
110
+ * below, which {@link ./tool-scope.ts} hands to the registry's
111
+ * `tools.restrict()` on each agent's own scope. Both cover:
111
112
  * - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
112
113
  * - `@deepseek-ai/dsh-experimental-session-search`, which registers five
113
114
  * read-only tools AND a usage-guidance section. The upstream bundle promises
114
115
  * "every preset including minimal"; this app intentionally deviates, because
115
116
  * Minimal's published promise is one persistent shell and a TUI process runs
116
- * sessions under several presets at once — hence an assembly-boundary filter
117
- * rather than a registry (or shell-whitelist) decision that would leak;
117
+ * sessions under several presets at once — hence a per-agent scope
118
+ * restriction rather than a global registry decision that would leak;
118
119
  * - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
119
120
  * host-layer tool, no section), which would move the session away from the
120
121
  * persistent shell.
121
122
  *
122
- * This is per-assembly because one TUI process can resume, create, or
123
- * recompose sessions under different presets. The session log remains the
124
- * source of truth for the active preset.
123
+ * This is per-agent because one TUI process can resume, create, or recompose
124
+ * sessions under different presets. The session log remains the source of
125
+ * truth for the active preset.
125
126
  *
126
- * @param assembly - Fully assembled prompt inputs for one model request.
127
+ * @param assembly - Prompt presentation for one model request.
127
128
  * @param presetId - Preset recorded for the requesting session.
128
- * @returns The original assembly when nothing is carved out, else the filtered copy.
129
+ * @returns The original presentation when nothing is carved out, else the filtered copy.
129
130
  */
130
- export declare function filterMinimalPresetTools(assembly: PromptAssembly, presetId: string | undefined): PromptAssembly;
131
+ export declare function filterMinimalPresetSections<T extends {
132
+ readonly sections: readonly {
133
+ readonly name: string;
134
+ }[];
135
+ }>(assembly: T, presetId: string | undefined): T;
136
+ /**
137
+ * Legacy hosts let the assembly waterfall own tool declarations. Keep the same
138
+ * safety carve-outs there; 0.2.2 presentations have no `tools` and use the
139
+ * registry restrictions instead. The structural type accepts both API lines.
140
+ */
141
+ export declare function filterMinimalPresetTools<T extends {
142
+ readonly sections: readonly {
143
+ readonly name: string;
144
+ }[];
145
+ readonly tools?: readonly {
146
+ readonly name: string;
147
+ }[];
148
+ }>(assembly: T, presetId: string | undefined): T;
149
+ /**
150
+ * Host-layer tools the preset must not expose, for the per-agent registry
151
+ * restriction (`tools.restrict()`); see {@link filterMinimalPresetSections}
152
+ * for why these carve-outs exist.
153
+ *
154
+ * @param presetId - Preset recorded for the requesting session.
155
+ * @returns Tool names to deny on that agent, empty when the preset is untouched.
156
+ */
157
+ export declare function presetToolDeny(presetId: string | undefined): readonly string[];
131
158
  /**
132
159
  * Read a service the way a joined agent sees it: through the preset scope
133
160
  * chain when a roster is mounted (preset realms hide e.g. `compaction` from
@@ -1 +1 @@
1
- {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAuDtE,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAA;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAmBhG;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,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AAE,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,CAM/C;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,CAO9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAKpG"}
@@ -189,38 +189,67 @@ export function presetHidesHostAskTool(presetId) {
189
189
  * exactly one persistent shell tool, and host-layer contributors the person
190
190
  * switched on elsewhere must not become extra ones.
191
191
  *
192
- * Three such contributors are carved out here (the last one for liangshen
193
- * too, see `PERSISTENT_SHELL_PRESETS`):
192
+ * The carve-outs live in two places since 0.2.2 split the prompt assembly
193
+ * from the tool declarations: this section filter, and `presetToolDeny`
194
+ * below, which {@link ./tool-scope.ts} hands to the registry's
195
+ * `tools.restrict()` on each agent's own scope. Both cover:
194
196
  * - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
195
197
  * - `@deepseek-ai/dsh-experimental-session-search`, which registers five
196
198
  * read-only tools AND a usage-guidance section. The upstream bundle promises
197
199
  * "every preset including minimal"; this app intentionally deviates, because
198
200
  * Minimal's published promise is one persistent shell and a TUI process runs
199
- * sessions under several presets at once — hence an assembly-boundary filter
200
- * rather than a registry (or shell-whitelist) decision that would leak;
201
+ * sessions under several presets at once — hence a per-agent scope
202
+ * restriction rather than a global registry decision that would leak;
201
203
  * - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
202
204
  * host-layer tool, no section), which would move the session away from the
203
205
  * persistent shell.
204
206
  *
205
- * This is per-assembly because one TUI process can resume, create, or
206
- * recompose sessions under different presets. The session log remains the
207
- * source of truth for the active preset.
207
+ * This is per-agent because one TUI process can resume, create, or recompose
208
+ * sessions under different presets. The session log remains the source of
209
+ * truth for the active preset.
208
210
  *
209
- * @param assembly - Fully assembled prompt inputs for one model request.
211
+ * @param assembly - Prompt presentation for one model request.
210
212
  * @param presetId - Preset recorded for the requesting session.
211
- * @returns The original assembly when nothing is carved out, else the filtered copy.
213
+ * @returns The original presentation when nothing is carved out, else the filtered copy.
214
+ */
215
+ export function filterMinimalPresetSections(assembly, presetId) {
216
+ if (!isMinimalPreset(presetId))
217
+ return assembly;
218
+ const sections = assembly.sections.filter(section => section.name !== SESSION_SEARCH_SECTION);
219
+ if (sections.length === assembly.sections.length)
220
+ return assembly;
221
+ return { ...assembly, sections };
222
+ }
223
+ /**
224
+ * Legacy hosts let the assembly waterfall own tool declarations. Keep the same
225
+ * safety carve-outs there; 0.2.2 presentations have no `tools` and use the
226
+ * registry restrictions instead. The structural type accepts both API lines.
212
227
  */
213
228
  export function filterMinimalPresetTools(assembly, presetId) {
229
+ const presentation = filterMinimalPresetSections(assembly, presetId);
230
+ if (presentation.tools === undefined)
231
+ return presentation;
232
+ const deny = new Set(presetToolDeny(presetId));
233
+ const tools = presentation.tools.filter(tool => !deny.has(tool.name));
234
+ return tools.length === presentation.tools.length ? presentation : { ...presentation, tools };
235
+ }
236
+ /**
237
+ * Host-layer tools the preset must not expose, for the per-agent registry
238
+ * restriction (`tools.restrict()`); see {@link filterMinimalPresetSections}
239
+ * for why these carve-outs exist.
240
+ *
241
+ * @param presetId - Preset recorded for the requesting session.
242
+ * @returns Tool names to deny on that agent, empty when the preset is untouched.
243
+ */
244
+ export function presetToolDeny(presetId) {
214
245
  const minimal = isMinimalPreset(presetId);
215
246
  const persistentShell = presetId !== undefined && PERSISTENT_SHELL_PRESETS.has(presetId);
216
- if (!minimal && !persistentShell)
217
- return assembly;
218
- const tools = assembly.tools.filter(tool => !(persistentShell && tool.name === WORKTREE_TOOL) &&
219
- !(minimal && (tool.name === ASK_USER_TOOL || SESSION_SEARCH_TOOLS.has(tool.name))));
220
- const sections = minimal ? assembly.sections.filter(section => section.name !== SESSION_SEARCH_SECTION) : assembly.sections;
221
- if (tools.length === assembly.tools.length && sections.length === assembly.sections.length)
222
- return assembly;
223
- return { ...assembly, tools, sections };
247
+ const deny = [];
248
+ if (persistentShell)
249
+ deny.push(WORKTREE_TOOL);
250
+ if (minimal)
251
+ deny.push(ASK_USER_TOOL, ...SESSION_SEARCH_TOOLS);
252
+ return deny;
224
253
  }
225
254
  /**
226
255
  * Read a service the way a joined agent sees it: through the preset scope
@@ -23,7 +23,7 @@ export type ExitRequestAnswer = 'exiting' | 'pending' | 'supervising' | 'refused
23
23
  export interface ProcessExitSeam {
24
24
  request?: (request: ExitRequest) => ExitRequestAnswer;
25
25
  }
26
- /** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.5): the dispose bound. */
26
+ /** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.2-rc.1): the dispose bound. */
27
27
  export declare const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
28
28
  /**
29
29
  * End the process by `signal`. Only the entry's own listeners come off, so the
@@ -6,7 +6,7 @@
6
6
  * tmux and service managers); a second signal forces the exit at once.
7
7
  */
8
8
  export const TERMINATION_SIGNALS = ['SIGTERM', 'SIGHUP', 'SIGINT'];
9
- /** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.5): the dispose bound. */
9
+ /** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.2-rc.1): the dispose bound. */
10
10
  export const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
11
11
  /** Last-resort bound for a funnel exit: outlasts its terminal cleanup plus the dispose bound. */
12
12
  const BACKSTOP_MS = PROCESS_SHUTDOWN_TIMEOUT_MS + 2000;
@@ -18,8 +18,7 @@
18
18
  */
19
19
  import { compositionRoot } from './host-access.js';
20
20
  import { type AdapterRuntimeOptions } from '../adapter/kernel/runtime.js';
21
- import { type AskUserQuestionAnswer, type AskUserQuestionRequest } from '@deepseek-ai/dsh-user-questions';
22
- import { QuestionStore as SharedQuestionStore } from '../channel/questions.js';
21
+ import { QuestionStore as SharedQuestionStore, type QuestionAnswer, type QuestionRequest } from '../channel/questions.js';
23
22
  export type { QuestionDraft, QuestionSelection, QuestionSnapshot } from '../channel/questions.js';
24
23
  /** The shared store, rejecting interruptions with the DSH protocol error. */
25
24
  export declare class QuestionStore extends SharedQuestionStore {
@@ -31,9 +30,9 @@ export declare class QuestionStore extends SharedQuestionStore {
31
30
  * capability's audited entry (`verify:adapter-shadow`), and again,
32
31
  * idempotently, by the shared store every asker goes through.
33
32
  */
34
- ask(request: AskUserQuestionRequest, options?: {
33
+ ask(request: QuestionRequest, options?: {
35
34
  redact?: boolean;
36
- }): Promise<AskUserQuestionAnswer>;
35
+ }): Promise<QuestionAnswer>;
37
36
  }
38
37
  /** Host-only registration used by the TUI plugin bootstrap. */
39
38
  export declare function bindQuestionStore(ctx: Parameters<typeof compositionRoot>[0], store: QuestionStore): void;
@@ -1 +1 @@
1
- {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAE9E,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEjG,6EAA6E;AAC7E,qBAAa,aAAc,SAAQ,mBAAmB;gBACxC,OAAO,GAAE,qBAA+C;IAIpE;;;;;;OAMG;IACM,GAAG,CAAC,OAAO,EAAE,sBAAsB,EAAE,O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CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,SAAS,CAGtG"}
@@ -18,7 +18,7 @@
18
18
  */
19
19
  import { compositionRoot } from './host-access.js';
20
20
  import { assertCapabilityShadowPolicy, defaultAdapterRuntime, } from '../adapter/kernel/runtime.js';
21
- import { UserQuestionError, } from '@deepseek-ai/dsh-user-questions';
21
+ import { UserQuestionError } from '@deepseek-ai/dsh-user-questions';
22
22
  import { QuestionStore as SharedQuestionStore } from '../channel/questions.js';
23
23
  /** The shared store, rejecting interruptions with the DSH protocol error. */
24
24
  export class QuestionStore extends SharedQuestionStore {
@@ -36,13 +36,13 @@ function sessionListMetadataDefinition() {
36
36
  }
37
37
  /** Register before creating the boot agent, so its first checkpoint has the key. */
38
38
  export function attachSessionListMetadata(ctx) {
39
- ctx.inject(['sessionProjections'], ((projectionCtx) => {
39
+ ctx.inject(['sessionProjections'], (async (projectionCtx) => {
40
40
  const registry = projectionCtx.sessionProjections;
41
41
  if (typeof registry?.register !== 'function')
42
42
  return;
43
43
  try {
44
44
  // The host binds this registration to the calling context's fiber.
45
- registry.register(sessionListMetadataDefinition());
45
+ await registry.register(sessionListMetadataDefinition());
46
46
  }
47
47
  catch (error) {
48
48
  try {
@@ -109,6 +109,11 @@ export declare class SubagentActivityStore {
109
109
  onFailed(agentId: string, error: string, endedAt?: number): void;
110
110
  onCancelled(agentId: string, reason?: string, summary?: string, endedAt?: number): void;
111
111
  private finish;
112
+ /** Keep this run's outcome before a continuable child opens its next run
113
+ * under the same `agentId`. `finish` accepts only the first terminal edge,
114
+ * so one run records once; the `known` branch only absorbs a durable replay
115
+ * of the same settlement. */
116
+ private recordSettledRun;
112
117
  /** Drop all tracked subagents and session links (session swap: the old
113
118
  * session's children were disposed with their parent — nothing may keep
114
119
  * routing events of a session the channel no longer projects). The