@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.
Files changed (318) hide show
  1. package/README.md +43 -16
  2. package/bin/dsh-tui.js +46 -3
  3. package/cli/adapters/dsh/index.mjs +2 -2
  4. package/guide/dsh-tui-guide/cli.en.md +1 -1
  5. package/guide/dsh-tui-guide/cli.md +1 -1
  6. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  7. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  8. package/guide/dsh-tui-guide/configuration.en.md +8 -2
  9. package/guide/dsh-tui-guide/configuration.md +8 -2
  10. package/guide/dsh-tui-guide/getting-started.en.md +174 -6
  11. package/guide/dsh-tui-guide/getting-started.md +125 -15
  12. package/guide/dsh-tui-guide/interaction.en.md +30 -8
  13. package/guide/dsh-tui-guide/interaction.md +18 -5
  14. package/guide/dsh-tui-guide/plugins.en.md +28 -7
  15. package/guide/dsh-tui-guide/plugins.md +18 -5
  16. package/guide/dsh-tui-guide/user-guide.en.md +32 -17
  17. package/guide/dsh-tui-guide/user-guide.md +23 -12
  18. package/lib/settings.json +3 -3
  19. package/lib/types/adapter/channel/ui-policy.d.ts +1 -0
  20. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  21. package/lib/types/adapter/channel/ui-policy.js +1 -0
  22. package/lib/types/adapter/ports/channel-ui.d.ts +10 -2
  23. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  24. package/lib/types/adapter/ports/channel-view.d.ts +31 -5
  25. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  26. package/lib/types/adapter/standard/grants.d.ts +60 -0
  27. package/lib/types/adapter/standard/grants.d.ts.map +1 -1
  28. package/lib/types/adapter/standard/grants.js +74 -0
  29. package/lib/types/agent/events.d.ts +16 -3
  30. package/lib/types/agent/events.d.ts.map +1 -1
  31. package/lib/types/agent/session.d.ts +5 -0
  32. package/lib/types/agent/session.d.ts.map +1 -1
  33. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  34. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  35. package/lib/types/backends/claude/translate/core.js +10 -6
  36. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  37. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  38. package/lib/types/backends/codex/session/commands.js +8 -4
  39. package/lib/types/backends/codex/session/input.d.ts +11 -7
  40. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  41. package/lib/types/backends/codex/session/input.js +68 -15
  42. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  43. package/lib/types/backends/codex/session/session.js +2 -3
  44. package/lib/types/channel/projection.d.ts.map +1 -1
  45. package/lib/types/channel/projection.js +78 -10
  46. package/lib/types/channel/questions.d.ts +19 -3
  47. package/lib/types/channel/questions.d.ts.map +1 -1
  48. package/lib/types/channel/sanitize.d.ts.map +1 -1
  49. package/lib/types/channel/sanitize.js +8 -4
  50. package/lib/types/channel/subagent-failure.d.ts +49 -0
  51. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  52. package/lib/types/channel/subagent-failure.js +59 -0
  53. package/lib/types/channel/transcript.d.ts +17 -0
  54. package/lib/types/channel/transcript.d.ts.map +1 -1
  55. package/lib/types/channel/transcript.js +35 -0
  56. package/lib/types/commands.js +2 -2
  57. package/lib/types/components/GoalTodoPanel.d.ts +71 -6
  58. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  59. package/lib/types/components/GoalTodoPanel.js +165 -17
  60. package/lib/types/components/MessageList.d.ts.map +1 -1
  61. package/lib/types/components/MessageList.js +14 -9
  62. package/lib/types/components/PluginGrantList.d.ts +45 -0
  63. package/lib/types/components/PluginGrantList.d.ts.map +1 -0
  64. package/lib/types/components/PluginGrantList.js +126 -0
  65. package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
  66. package/lib/types/components/PluginInstallPane.js +35 -6
  67. package/lib/types/components/PluginManagePane.d.ts.map +1 -1
  68. package/lib/types/components/PluginManagePane.js +65 -8
  69. package/lib/types/components/PromptInput.d.ts.map +1 -1
  70. package/lib/types/components/PromptInput.js +63 -8
  71. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  72. package/lib/types/components/SubagentDashboard.js +17 -1
  73. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  74. package/lib/types/components/SubagentDetailScene.js +12 -0
  75. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
  76. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  77. package/lib/types/components/messages/AssistantToolUseMessage.js +16 -7
  78. package/lib/types/components/onboardingModel.d.ts +2 -2
  79. package/lib/types/components/onboardingModel.js +3 -3
  80. package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
  81. package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
  82. package/lib/types/components/onboardingProviderPlan.js +78 -0
  83. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  84. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  85. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  86. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  87. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  88. package/lib/types/components/revealScope.d.ts +15 -0
  89. package/lib/types/components/revealScope.d.ts.map +1 -0
  90. package/lib/types/components/revealScope.js +17 -0
  91. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +41 -1
  92. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  93. package/lib/types/components/sidePanel/btw/BtwComposer.js +123 -6
  94. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  95. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +9 -2
  96. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
  97. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  98. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +9 -2
  99. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
  100. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
  101. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
  102. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  103. package/lib/types/components/sidePanel/builtinPanels.js +14 -2
  104. package/lib/types/components/sidePanel/types.d.ts +2 -0
  105. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  106. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  107. package/lib/types/components/sidePanel/useSidePanel.js +15 -1
  108. package/lib/types/components/smoothReveal.d.ts +36 -6
  109. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  110. package/lib/types/components/smoothReveal.js +92 -21
  111. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  112. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  113. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  114. package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
  115. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  116. package/lib/types/dsh-adapter/backend/session.js +74 -6
  117. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/backend/translate.js +15 -6
  119. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  120. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
  122. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  123. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  125. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  126. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  128. package/lib/types/dsh-adapter/channel/composer-images.d.ts +2 -0
  129. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  130. package/lib/types/dsh-adapter/channel/composer-images.js +10 -2
  131. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/channel/composer-mentions.js +22 -7
  133. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +3 -7
  134. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  135. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +16 -6
  136. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +6 -0
  137. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  138. package/lib/types/dsh-adapter/channel/core/binding-feed.js +35 -1
  139. package/lib/types/dsh-adapter/channel/core/compose.d.ts +3 -7
  140. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  141. package/lib/types/dsh-adapter/channel/core/compose.js +6 -1
  142. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  143. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  144. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  145. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  146. package/lib/types/dsh-adapter/channel/extensions.js +8 -0
  147. package/lib/types/dsh-adapter/channel/input-actions.d.ts +4 -4
  148. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/channel/input-actions.js +59 -5
  150. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  151. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  152. package/lib/types/dsh-adapter/channel/input-delivery.js +21 -8
  153. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/channel/mentions.js +21 -7
  155. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  156. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  158. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  159. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  161. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  162. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  163. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  164. package/lib/types/dsh-adapter/channel/paths.js +11 -9
  165. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
  166. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  167. package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
  168. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/channel/session-reset.js +3 -1
  170. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
  171. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/channel/session-resume.js +10 -3
  173. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
  174. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  175. package/lib/types/dsh-adapter/channel/session-rewind.js +9 -3
  176. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
  177. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  178. package/lib/types/dsh-adapter/channel/session-tree-actions.js +11 -5
  179. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
  181. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  182. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  183. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  184. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  185. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  186. package/lib/types/dsh-adapter/contract.d.ts +27 -3
  187. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  188. package/lib/types/dsh-adapter/contract.js +47 -5
  189. package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
  190. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  191. package/lib/types/dsh-adapter/experimental-bundles.d.ts +3 -0
  192. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  193. package/lib/types/dsh-adapter/experimental-bundles.js +4 -0
  194. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  195. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  197. package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
  198. package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
  199. package/lib/types/dsh-adapter/grant-file.js +178 -0
  200. package/lib/types/dsh-adapter/host-access.d.ts +4 -0
  201. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/host-access.js +114 -15
  203. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  204. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  205. package/lib/types/dsh-adapter/host-contract.js +5 -3
  206. package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
  207. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  208. package/lib/types/dsh-adapter/host-dsh.js +27 -6
  209. package/lib/types/dsh-adapter/host-entry.js +4 -0
  210. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  211. package/lib/types/dsh-adapter/index.js +8 -5
  212. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  214. package/lib/types/dsh-adapter/panels.d.ts +7 -1
  215. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  216. package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
  217. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
  219. package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
  220. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
  221. package/lib/types/dsh-adapter/plugin-install.js +160 -13
  222. package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
  223. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  224. package/lib/types/dsh-adapter/plugin-manage.js +240 -51
  225. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  226. package/lib/types/dsh-adapter/plugin.js +203 -58
  227. package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
  228. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  229. package/lib/types/dsh-adapter/plugins-info.js +34 -21
  230. package/lib/types/dsh-adapter/presets.d.ts +41 -10
  231. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  232. package/lib/types/dsh-adapter/presets.js +59 -12
  233. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  234. package/lib/types/dsh-adapter/process-exit.js +1 -1
  235. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
  236. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  237. package/lib/types/dsh-adapter/providerWizard.js +11 -5
  238. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  239. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  240. package/lib/types/dsh-adapter/questions.js +1 -1
  241. package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
  242. package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
  243. package/lib/types/dsh-adapter/row-attachment.js +29 -0
  244. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  245. package/lib/types/dsh-adapter/subagents.d.ts +5 -0
  246. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  247. package/lib/types/dsh-adapter/subagents.js +22 -1
  248. package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
  249. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  250. package/lib/types/dsh-adapter/team-mode.js +19 -12
  251. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  252. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  253. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  254. package/lib/types/dsh-adapter/types.d.ts +2 -1
  255. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  256. package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
  257. package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
  258. package/lib/types/dsh-adapter/worktree-tool.js +87 -0
  259. package/lib/types/heldInputs.d.ts +75 -0
  260. package/lib/types/heldInputs.d.ts.map +1 -0
  261. package/lib/types/heldInputs.js +409 -0
  262. package/lib/types/i18n.d.ts +577 -34
  263. package/lib/types/i18n.d.ts.map +1 -1
  264. package/lib/types/i18n.js +230 -22
  265. package/lib/types/ink/components/App.d.ts +2 -0
  266. package/lib/types/ink/components/App.d.ts.map +1 -1
  267. package/lib/types/ink/components/App.js +8 -0
  268. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  269. package/lib/types/ink/events/input-event.js +7 -6
  270. package/lib/types/ink/hit-test.d.ts +2 -0
  271. package/lib/types/ink/hit-test.d.ts.map +1 -1
  272. package/lib/types/ink/hit-test.js +10 -0
  273. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  274. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  275. package/lib/types/ink/hooks/use-program-status.js +3 -2
  276. package/lib/types/ink/ink.d.ts +1 -0
  277. package/lib/types/ink/ink.d.ts.map +1 -1
  278. package/lib/types/ink/ink.js +5 -2
  279. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  280. package/lib/types/ink/parse-keypress.js +25 -0
  281. package/lib/types/ink/terminal.d.ts +13 -2
  282. package/lib/types/ink/terminal.d.ts.map +1 -1
  283. package/lib/types/ink/terminal.js +29 -5
  284. package/lib/types/onboardingDraft.d.ts +143 -0
  285. package/lib/types/onboardingDraft.d.ts.map +1 -0
  286. package/lib/types/onboardingDraft.js +71 -0
  287. package/lib/types/screens/Chat.d.ts.map +1 -1
  288. package/lib/types/screens/Chat.js +133 -32
  289. package/lib/types/screens/Onboarding.d.ts +22 -3
  290. package/lib/types/screens/Onboarding.d.ts.map +1 -1
  291. package/lib/types/screens/Onboarding.js +606 -36
  292. package/lib/types/screens/SessionSupervisor.d.ts +3 -6
  293. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  294. package/lib/types/screens/SessionSupervisor.js +5 -8
  295. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
  296. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  297. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
  298. package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
  299. package/lib/types/screens/sessionSupervisor/model.js +1 -1
  300. package/lib/types/sessionMounts.d.ts +12 -5
  301. package/lib/types/sessionMounts.d.ts.map +1 -1
  302. package/lib/types/sessionMounts.js +33 -6
  303. package/lib/types/settings/definitions.js +2 -2
  304. package/lib/types/update.d.ts +412 -20
  305. package/lib/types/update.d.ts.map +1 -1
  306. package/lib/types/update.js +2094 -193
  307. package/lib/types/updateHost.d.ts +198 -0
  308. package/lib/types/updateHost.d.ts.map +1 -0
  309. package/lib/types/updateHost.js +608 -0
  310. package/lib/types/utils/paths.d.ts +15 -0
  311. package/lib/types/utils/paths.d.ts.map +1 -1
  312. package/lib/types/utils/paths.js +25 -0
  313. package/lib/types/utils/processName.d.ts +16 -0
  314. package/lib/types/utils/processName.d.ts.map +1 -0
  315. package/lib/types/utils/processName.js +27 -0
  316. package/package.json +114 -108
  317. package/tui-profile/feed/README.md +1 -1
  318. package/tui-profile/feed/first-party.json +1 -1
@@ -1,5 +1,18 @@
1
1
  import { boundContextSummary, createUserMessage } from '@deepseek-ai/dsh-llm';
2
+ import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
2
3
  import { createChannelOwner } from './owner.js';
4
+ /** The public durable seam, absent on legacy hosts. */
5
+ export function modelSeamOf(agent) {
6
+ const model = agent.model;
7
+ return typeof model?.current === 'function' && typeof model.select === 'function'
8
+ ? model
9
+ : undefined;
10
+ }
11
+ function sameRoute(a, b) {
12
+ if (a === undefined || b === undefined)
13
+ return a === b;
14
+ return a.provider === b.provider && a.model === b.model && a.reasoningEffort === b.reasoningEffort;
15
+ }
3
16
  /** Routing belongs to the live agent, including turns running while parked.
4
17
  * The foreground facade follows the binding; each waterfall captures its own
5
18
  * agent's ref so a later binding can never supply its route. */
@@ -9,33 +22,50 @@ export function createModelSelection(ctx, deps) {
9
22
  const entry = entries.get(deps.agent());
10
23
  if (entry === undefined)
11
24
  throw new Error('dsh-tui: model selection has not been bound');
12
- return entry.ref;
25
+ return entry;
26
+ };
27
+ /** Write the next step's route, through the durable seam when the host has one. */
28
+ const write = (entry, value) => {
29
+ if (entry.seam === undefined) {
30
+ entry.ref.current = value;
31
+ }
32
+ else if (value !== undefined && !sameRoute(value, entry.seam.current())) {
33
+ entry.seam.select(value);
34
+ }
13
35
  };
14
36
  const selection = {
15
- get current() { return foreground().current; },
16
- set current(value) { foreground().current = value; },
17
- get assembled() { return foreground().assembled; },
18
- set assembled(value) { foreground().assembled = value; },
37
+ get current() {
38
+ const entry = foreground();
39
+ return entry.seam === undefined ? entry.ref.current : entry.seam.current();
40
+ },
41
+ set current(value) { write(foreground(), value); },
42
+ get assembled() { return foreground().ref.assembled; },
43
+ set assembled(value) { foreground().ref.assembled = value; },
19
44
  };
20
45
  deps.owner.own(ctx.on('agent/disposed', ({ agent }) => entries.get(agent)?.release()));
46
+ /** Bind without selecting; return whether the session owns its effort too. */
21
47
  const bind = (agent, route) => {
22
48
  deps.owner.assertActive();
23
- if (entries.has(agent))
24
- return;
49
+ const seam = modelSeamOf(agent);
25
50
  const recorded = agent.session.requestHeader?.()?.config;
51
+ const durable = seam !== undefined && (recorded !== undefined ||
52
+ snapshotLiveSessionEvents(agent.session).some(event => event.type === 'model/selection'));
53
+ if (entries.has(agent))
54
+ return durable;
26
55
  const hasCreatedRoute = agent.options?.provider !== undefined && agent.options.model !== undefined;
27
56
  // Seeded children can deliberately replace the inherited header's route.
28
57
  // Restore a recorded pin only when the caller actually adopted that route.
29
58
  const usesRecordedRoute = recorded?.provider === route.provider && recorded?.model === route.model;
30
- const ref = {
31
- current: usesRecordedRoute && recorded?.reasoningEffort !== undefined
32
- ? { ...route, reasoningEffort: recorded.reasoningEffort }
33
- : route.provider !== '' && route.model !== '' &&
34
- (!hasCreatedRoute || (usesRecordedRoute &&
35
- (route.provider !== agent.options.provider || route.model !== agent.options.model)))
36
- ? { ...route } : undefined,
37
- assembled: undefined,
38
- };
59
+ // The pre-0.2.2 seed: creation options plus the persisted request header.
60
+ const legacySeed = usesRecordedRoute && recorded?.reasoningEffort !== undefined
61
+ ? { ...route, reasoningEffort: recorded.reasoningEffort }
62
+ : route.provider !== '' && route.model !== '' &&
63
+ (!hasCreatedRoute || (usesRecordedRoute &&
64
+ (route.provider !== agent.options.provider || route.model !== agent.options.model)))
65
+ ? { ...route } : undefined;
66
+ const adopted = seam?.current();
67
+ const seed = adopted !== undefined ? { ...adopted } : legacySeed;
68
+ const ref = { current: seed, assembled: undefined };
39
69
  const lifetime = createChannelOwner();
40
70
  lifetime.bind(deps.owner.current);
41
71
  let assemblyOperation = 0;
@@ -44,15 +74,21 @@ export function createModelSelection(ctx, deps) {
44
74
  entries.delete(agent);
45
75
  lifetime.dispose();
46
76
  });
47
- entries.set(agent, { ref, release });
77
+ entries.set(agent, { ref, seam, release });
78
+ // Only a host with no recorded route or creation options needs a seed.
79
+ if (seam !== undefined && adopted === undefined && seed !== undefined)
80
+ seam.select(seed);
48
81
  const own = (dispose) => {
49
82
  lifetime.own(dispose);
50
83
  lifetime.assertActive();
51
84
  };
52
85
  try {
53
- own(agent.ctx.on('system-prompt/assemble', async (_assembly, _context, next) => {
86
+ own(agent.ctx.on('system-prompt/assemble', async (_assembly, context, next) => {
54
87
  const operation = ++assemblyOperation;
55
- const selected = ref.current;
88
+ // A step fixes its choice before asynchronous tool/prompt resolution.
89
+ // Diagnostics have no fixed step and inspect the current durable choice.
90
+ const selected = seam === undefined ? ref.current
91
+ : context.modelSelection ?? seam.current();
56
92
  const assembled = await next();
57
93
  if (!current())
58
94
  return assembled;
@@ -63,32 +99,39 @@ export function createModelSelection(ctx, deps) {
63
99
  return assembled;
64
100
  return { ...assembled, variables: { ...assembled.variables, provider: selected.provider, model: selected.model } };
65
101
  }));
66
- own(agent.ctx.on('agent/request', async (_payload, next) => {
67
- const resolved = await next();
68
- if (!current())
69
- return resolved;
70
- const selected = ref.assembled;
71
- if (selected === undefined)
72
- return resolved;
73
- const { reasoningEffort: _inheritedEffort, ...withoutInheritedEffort } = resolved;
74
- return {
75
- ...withoutInheritedEffort,
76
- provider: selected.provider,
77
- model: selected.model,
78
- ...(selected.reasoningEffort === undefined ? {} : { reasoningEffort: selected.reasoningEffort }),
79
- };
80
- }));
102
+ // Modern hosts fix request routing upstream and reject rewrites here.
103
+ if (seam === undefined) {
104
+ own(agent.ctx.on('agent/request', async (_payload, next) => {
105
+ const resolved = await next();
106
+ if (!current())
107
+ return resolved;
108
+ const selected = ref.assembled;
109
+ if (selected === undefined)
110
+ return resolved;
111
+ const { reasoningEffort: _inheritedEffort, ...withoutInheritedEffort } = resolved;
112
+ return {
113
+ ...withoutInheritedEffort,
114
+ provider: selected.provider,
115
+ model: selected.model,
116
+ ...(selected.reasoningEffort === undefined ? {} : { reasoningEffort: selected.reasoningEffort }),
117
+ };
118
+ }));
119
+ }
81
120
  // Match upstream installModelSelection's admission-time provenance.
82
- own(agent.ctx.on('agent/pre-step', async ({ agent: subject, messages, signal, step }, next) => {
121
+ // Not every composition installs it, but one step must have at most one notice.
122
+ own(agent.ctx.on('agent/pre-step', async (payload, next) => {
123
+ const { agent: subject, messages, signal, step } = payload;
83
124
  const decision = await next();
84
125
  if (!current() || decision.kind === 'reject' || signal.aborted)
85
126
  return decision;
86
127
  if (decision.messages.length === 0 && (step === 1 || messages.length > 0))
87
128
  return decision;
88
- const selected = ref.assembled;
129
+ const selected = seam === undefined ? ref.assembled
130
+ : payload.modelSelection;
89
131
  const previous = subject.session.requestHeader()?.config;
90
132
  if (selected === undefined || previous === undefined ||
91
- (selected.provider === previous.provider && selected.model === previous.model))
133
+ (selected.provider === previous.provider && selected.model === previous.model) ||
134
+ decision.messages.some(message => message.source?.kind === 'model-selection'))
92
135
  return decision;
93
136
  const from = selected.provider === previous.provider ? previous.model : `${previous.provider}/${previous.model}`;
94
137
  const to = selected.provider === previous.provider ? selected.model : `${selected.provider}/${selected.model}`;
@@ -106,6 +149,7 @@ export function createModelSelection(ctx, deps) {
106
149
  catch { /* preserve the registration failure */ }
107
150
  throw error;
108
151
  }
152
+ return durable;
109
153
  };
110
154
  return { selection, bind };
111
155
  }
@@ -1,5 +1,5 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
- import type { ModelSelectionRef } from '@deepseek-ai/dsh-agent';
2
+ import type { ModelSelectionRef } from './model-selection.js';
3
3
  import type { createChannelBinding } from './binding.js';
4
4
  import type { ChannelOwner } from './owner.js';
5
5
  import type { ChannelState } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"model-switch.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAI/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,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AO,CAAC,aAAa,EAAE,CAAC,CAiClK;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAmD5I"}
@@ -1,6 +1,6 @@
1
- import { join } from 'node:path';
1
+ import { isAbsolute, join } from 'node:path';
2
2
  import { rankFileCandidates } from '../../utils/fileSuggestions.js';
3
- import { homeDir } from '../../utils/paths.js';
3
+ import { expandHomePrefix, homeDir } from '../../utils/paths.js';
4
4
  /** Trailing path segment (`C:/a/b` → `b`). */
5
5
  export function basename(path) {
6
6
  const parts = path.split(/[\\/]/);
@@ -69,13 +69,15 @@ export async function listPathCandidates(fs, cwd, query, signal, topK) {
69
69
  const displayDirectoryPart = rawSlash < 0 ? (bareDir ? `${query}/` : '') : query.slice(0, rawSlash + 1);
70
70
  const displaySeparator = displayDirectoryPart.endsWith('\\') ? '\\' : '/';
71
71
  const nameQuery = slash < 0 || bareDir ? '' : normalized.slice(slash + 1);
72
- // `~/` expands against the host home (matches the cwd resolution rules);
73
- // drive-letter and POSIX-absolute prefixes pass through untouched.
74
- const expanded = directoryPart === '~/'
75
- ? `${homeDir()}/`
76
- : directoryPart.startsWith('/') || /^[A-Za-z]:\//.test(directoryPart)
77
- ? directoryPart
78
- : join(cwd, directoryPart || '.');
72
+ // A leading literal `~/` (or `~\`) expands against the host home at ANY
73
+ // depth — issue #1706: after picking `~/Downloads/` the next level used to be
74
+ // joined onto the workspace and the menu silently vanished. Drive-letter and
75
+ // POSIX-absolute prefixes still pass through untouched; `isAbsolute` also
76
+ // keeps a UNC home (`\\server\share\user`) off the workspace join.
77
+ const homeExpanded = expandHomePrefix(directoryPart);
78
+ const expanded = isAbsolute(homeExpanded) || /^[A-Za-z]:[\\/]/.test(homeExpanded)
79
+ ? homeExpanded
80
+ : join(cwd, homeExpanded || '.');
79
81
  try {
80
82
  if (signal?.aborted)
81
83
  return [];
@@ -7,7 +7,7 @@ type Binding = DshChannelBinding;
7
7
  type LiveAdoptionState = Pick<ChannelState, 'status' | 'agentId' | 'sessionId' | 'cwd' | 'displayCwd' | 'agentPreset' | 'provider' | 'model' | 'loadedContext' | 'contextWindow' | 'effortLevels' | 'reasoningEffort' | 'tps' | 'tpsSamples' | 'lastUsage' | 'turnUsage' | 'working' | 'emit'> & Parameters<typeof resetSessionProjection>[0];
8
8
  /** Adopt an already-live agent, preserving a meaningful previous handle in the background ledger. */
9
9
  export declare function createLiveAgentAdoption(state: LiveAdoptionState, deps: {
10
- binding: Pick<Binding, 'switchTo'>;
10
+ binding: Pick<Binding, 'switchTo' | 'handle'>;
11
11
  /** Wrap the target (and the parked handle this channel owns for it, if
12
12
  * any) as the session handed to the binding. */
13
13
  openSession(agent: Agent, handle: AgentHandle | undefined): AgentSession;
@@ -1 +1 @@
1
- {"version":3,"file":"session-live-adoption.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-live-adoption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAM1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE5D,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,iBAAiB,GAAG,IAAI,CAC3B,YAAY,EACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,YAAY,GACZ,aAAa,GACb,UAAU,GACV,OAAO,GACP,eAAe,GACf,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,KAAK,GACL,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,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CAAA;IAC7F,eAAe,IAAI,IAAI,CAAA;CACxB,IAEa,QAAQ,KAAK,KAAG,OAAO,CAAC,YAAY,CAAC,CA8DpD"}
1
+ {"version":3,"file":"session-live-adoption.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-live-adoption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAM1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE5D,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,iBAAiB,GAAG,IAAI,CAC3B,YAAY,EACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,YAAY,GACZ,aAAa,GACb,UAAU,GACV,OAAO,GACP,eAAe,GACf,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,KAAK,GACL,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,MAAM,CACT,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhD,qGAAqG;AACrG,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE;IACJ,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAA;IAC7C;qDACiD;IACjD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAA;IACxE,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAC3C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,cAAc,IAAI,IAAI,CAAA;IACtB,cAAc,IAAI,IAAI,CAAA;IACtB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACpC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACjC,SAAS,IAAI,IAAI,CAAA;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,OAAO,0BAA0B,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IAChF,YAAY,IAAI,IAAI,CAAA;IACpB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxD,gBAAgB,IAAI,IAAI,CAAA;IACxB,SAAS,IAAI,IAAI,CAAA;IACjB,eAAe,IAAI,IAAI,CAAA;IACvB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iBAAiB,IAAI,IAAI,CAAA;IACzB;6CACyC;IACzC,iBAAiB,IAAI,IAAI,CAAA;IACzB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7F,eAAe,IAAI,IAAI,CAAA;CACxB,IAEa,QAAQ,KAAK,KAAG,OAAO,CAAC,YAAY,CAAC,CAkEpD"}
@@ -6,7 +6,12 @@ import { runningPresetOf } from '../presets.js';
6
6
  import { resetSessionProjection } from './session-reset.js';
7
7
  /** Adopt an already-live agent, preserving a meaningful previous handle in the background ledger. */
8
8
  export function createLiveAgentAdoption(state, deps) {
9
- return async (target) => deps.binding.switchTo(deps.openSession(target, deps.backgroundHandles.get(String(target.id))), (committed, disposePrevious) => {
9
+ return async (target) => deps.binding.switchTo(
10
+ // The screen's own agent, live under a session that ended with its
11
+ // listeners (#1651), is rebound with the handle the screen holds: a
12
+ // session without it would leave that handle to the default disposal.
13
+ deps.openSession(target, deps.backgroundHandles.get(String(target.id))
14
+ ?? (deps.binding.handle?.agent === target ? deps.binding.handle : undefined)), (committed, disposePrevious) => {
10
15
  const previousHandle = committed.handle;
11
16
  const previousSessionId = String(committed.agent.session.id);
12
17
  const keepPrevious = previousHandle !== undefined
@@ -1 +1 @@
1
- {"version":3,"file":"session-reset.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-reset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,QAAQ,GACR,UAAU,GACV,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,SAAS,GACT,YAAY,GACZ,eAAe,GACf,aAAa,GACb,KAAK,GACL,YAAY,GACZ,WAAW,GACX,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,YAAY;AACd;;qEAEqE;GACnE,kBAAkB,CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACzB,cAAc,EAAE,MAAM,IAAI,EAC1B,cAAc,EAAE,MAAM,IAAI,EAC1B,SAAS,EAAE,MAAM,IAAI,GACpB,IAAI,CAoDN"}
1
+ {"version":3,"file":"session-reset.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-reset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,QAAQ,GACR,UAAU,GACV,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,SAAS,GACT,YAAY,GACZ,eAAe,GACf,aAAa,GACb,KAAK,GACL,YAAY,GACZ,WAAW,GACX,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,YAAY;AACd;;qEAEqE;GACnE,kBAAkB,CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACzB,cAAc,EAAE,MAAM,IAAI,EAC1B,cAAc,EAAE,MAAM,IAAI,EAC1B,SAAS,EAAE,MAAM,IAAI,GACpB,IAAI,CAsDN"}
@@ -12,7 +12,9 @@ export function resetSessionProjection(state, rowIds, resetProjector, resetSubag
12
12
  resetSubagents();
13
13
  resetJobs();
14
14
  state.todos = [];
15
- state.pending = [];
15
+ // Orphaned rows belong to no backend (their session ended or dropped
16
+ // them): they wait in the dock for the user, whichever session is next.
17
+ state.pending = state.pending.filter(item => item.orphaned === true);
16
18
  state.goal = undefined;
17
19
  state.sessionTitle = '';
18
20
  state.sessionColor = '';
@@ -19,7 +19,7 @@ export declare function createSessionResumeActions(ctx: Context, state: ResumeSt
19
19
  model: string;
20
20
  }, deps: {
21
21
  owner: Pick<ChannelOwner, 'current'>;
22
- binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent' | 'prepare' | 'abandon' | 'adopt' | 'waitForDisposal'>;
22
+ binding: Pick<Binding, 'agent' | 'session' | 'capture' | 'isCurrent' | 'prepare' | 'abandon' | 'adopt' | 'waitForDisposal'>;
23
23
  /**
24
24
  * Adopt an agent this process already has live. `/resume` uses it so a
25
25
  * target that is already running here is re-attached in place (parking the
@@ -1 +1 @@
1
- {"version":3,"file":"session-resume.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-resume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW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AC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iBAAiB,IAAI,IAAI,CAAA;IACzB;6CACyC;IACzC,iBAAiB,IAAI,IAAI,CAAA;IACzB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,mBAAmB,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,YAAY,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACtG,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,qBAAqB,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChH,OAAO,EAAE,qBAAqB,CAAA;CAC/B;4BA+MoC,MAAM,QAAQ,QAAQ,GAAG,YAAY,eAAe,OAAO,KAAG,OAAO,CAAC,YAAY,CAAC;0BAiDrF,MAAM,KAAG,OAAO,CAAC,YAAY,CAAC;;EAmKlE"}
@@ -126,7 +126,12 @@ export function createSessionResumeActions(ctx, state, options, deps) {
126
126
  // normal return is a commit, which is what the outer finally keys on.
127
127
  const result = deps.binding.adopt(candidate, adoption, (committedBinding, disposePrevious) => {
128
128
  const previousSessionId = String(committedBinding.agent.session.id);
129
- const keepPrevious = keepCurrent && committedBinding.handle !== undefined
129
+ // Reopening the screen's own ended session (#1651) is not a switch:
130
+ // the handle it replaces is the disposed one, and parking it would put
131
+ // a dead entry in the background ledger under the id this adoption now
132
+ // owns — the live-adoption lookup prefers that entry over the screen's
133
+ // current handle. Dispose it instead (idempotent).
134
+ const keepPrevious = keepCurrent && previousSessionId !== sessionId && committedBinding.handle !== undefined
130
135
  && (committedBinding.handle.agent.status === 'running' || agentViewHasTurns(snapshotLiveSessionEvents(committedBinding.handle.agent.session)));
131
136
  if (keepCurrent && (committedBinding.handle === undefined || keepPrevious))
132
137
  deps.parkSubagents(committedBinding.agent);
@@ -275,8 +280,10 @@ export function createSessionResumeActions(ctx, state, options, deps) {
275
280
  // default disposition disposes the handle that IS running, so a second
276
281
  // Enter on the `current` row stopped the live turn while reporting success.
277
282
  // `attachToAgent()` has always short-circuited here; this is the same rule
278
- // for the unified screen's `/resume` path.
279
- if (String(sessionId) === String(entrySession.id))
283
+ // for the unified screen's `/resume` path. A disposed foreground (its
284
+ // agent unloaded under the screen, #1651) has nothing running: resuming
285
+ // its own id reopens the log like any other disk resume.
286
+ if (String(sessionId) === String(entrySession.id) && deps.binding.session.status !== 'disposed')
280
287
  return { ok: true };
281
288
  // Switching away starts disposal without blocking the synchronous commit.
282
289
  // Do not adopt that closing Agent (or reopen its still-held JSONL writer).
@@ -9,7 +9,7 @@ type RewindState = Pick<ChannelState, 'working' | 'cwd' | 'provider' | 'model'>;
9
9
  /** Rewind a selected transcript row into a prepared, binding-owned fork. */
10
10
  export declare function createRewindToAction(ctx: Context, state: RewindState, deps: {
11
11
  owner: Pick<ChannelOwner, 'current'>;
12
- binding: Pick<Binding, 'agent' | 'capture' | 'prepare' | 'isCurrent' | 'abandon'>;
12
+ binding: Pick<Binding, 'agent' | 'session' | 'capture' | 'prepare' | 'isCurrent' | 'abandon'>;
13
13
  settleCompaction(): Promise<void>;
14
14
  notify: ChannelState['notify'];
15
15
  adoptForkedAgent(candidate: AgentSession, capture: ReturnType<Binding['capture']>, seed: readonly SessionEvent[], agentPreset: string | undefined, childId: SessionId): string;
@@ -1 +1 @@
1
- {"version":3,"file":"session-rewind.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-rewind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAYvE,OAAO,KAAK,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IAAW,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsHhF"}
@@ -10,6 +10,7 @@ import { composePreset, runningPresetOf } from '../presets.js';
10
10
  import { holdsNoConversation, latestPolicyFacts, replayPolicyFacts } from '../session-seed.js';
11
11
  import { attachSessionToWorkspace } from '../workspace.js';
12
12
  import { reserveNewSession } from '../../sessionMounts.js';
13
+ import { modelSeamOf } from './model-selection.js';
13
14
  async function waitForTurnEnd(session, fromSeq, timeoutMs) {
14
15
  const deadline = Date.now() + timeoutMs;
15
16
  while (Date.now() < deadline) {
@@ -33,8 +34,10 @@ export function createRewindToAction(ctx, state, deps) {
33
34
  }
34
35
  const wasWorking = state.working;
35
36
  const cancelSeq = liveSessionOffset(deps.binding.agent.session);
37
+ // Through the session: the queue it drops is this client's own discard,
38
+ // not inputs the backend lost (those the channel would keep for the user).
36
39
  if (wasWorking)
37
- deps.binding.agent.cancel({ kind: 'user' });
40
+ void deps.binding.session.cancel('switch');
38
41
  if (wasWorking && !await waitForTurnEnd(deps.binding.agent.session, cancelSeq, 30000)) {
39
42
  deps.notify(t('rewind-settling'), { color: 'error' });
40
43
  return null;
@@ -77,12 +80,14 @@ export function createRewindToAction(ctx, state, deps) {
77
80
  // beat.
78
81
  const { reservation } = await reserveNewSession(String(childId));
79
82
  let candidate;
83
+ // A branch keeps the live explicit pin, not an adapter-default UI readout.
84
+ const route = { ...(modelSeamOf(deps.binding.agent)?.current() ?? { provider: state.provider, model: state.model }) };
80
85
  try {
81
86
  const create = () => cutHoldsNoConversation
82
87
  ? createFreshAgent(ctx, agents, {
83
88
  sessionId: childId,
84
89
  meta: { cwd: state.cwd, ...(composed.agentPreset === undefined ? {} : { agentPreset: composed.agentPreset }) },
85
- agentOptions: { provider: state.provider, model: state.model },
90
+ agentOptions: route,
86
91
  setup: composed.setup,
87
92
  })
88
93
  : agents.create(liveSessionCreateOptions({
@@ -93,8 +98,9 @@ export function createRewindToAction(ctx, state, deps) {
93
98
  cwd: state.cwd,
94
99
  parentSession: source.id,
95
100
  agentPreset: composed.agentPreset,
96
- agentOptions: { provider: state.provider, model: state.model },
101
+ agentOptions: route,
97
102
  setup: async (agentCtx, agent) => {
103
+ modelSeamOf(agent)?.select(route);
98
104
  agent.inbox.clear();
99
105
  return composed.setup?.(agentCtx, agent);
100
106
  },
@@ -9,7 +9,7 @@ type TreeRewindState = Pick<ChannelState, 'working' | 'cwd' | 'provider' | 'mode
9
9
  /** Rewind or fork a selected tree node; loading foreign family logs stays in this persistence adapter seam. */
10
10
  export declare function createTreeRewindAction(ctx: Context, state: TreeRewindState, deps: {
11
11
  owner: Pick<ChannelOwner, 'current'>;
12
- binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent' | 'prepare' | 'abandon'>;
12
+ binding: Pick<Binding, 'agent' | 'session' | 'capture' | 'isCurrent' | 'prepare' | 'abandon'>;
13
13
  settleCompaction(): Promise<void>;
14
14
  notify: ChannelState['notify'];
15
15
  adoptForkedAgent(candidate: AgentSession, capture: ReturnType<Binding['capture']>, seed: readonly SessionEvent[], agentPreset: string | undefined, childId: SessionId): string;
@@ -1 +1 @@
1
- {"version":3,"file":"session-tree-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-tree-actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAY1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,G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KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAChC,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC,CAAA;AAYnF,+GAA+G;AAC/G,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC,CAAA;IAC7F,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAA;IAC9K,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACnG,IAEa,WAAW,MAAM,EAAE,KAAK,MAAM,EAAE,OAAM,QAAQ,GAAG,MAAiB,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyI1G"}
@@ -10,6 +10,7 @@ import { composePreset, resolvePersistedPreset, runningPresetOf } from '../prese
10
10
  import { holdsNoConversation, latestPolicyFacts, replayPolicyFacts } from '../session-seed.js';
11
11
  import { attachSessionToWorkspace } from '../workspace.js';
12
12
  import { reserveNewSession } from '../../sessionMounts.js';
13
+ import { modelSeamOf } from './model-selection.js';
13
14
  import { forkTarget, rewindTarget, turnUserText } from '../sessionTree.js';
14
15
  async function waitForTurnEnd(session, fromSeq, timeoutMs) {
15
16
  const deadline = Date.now() + timeoutMs;
@@ -77,8 +78,10 @@ export function createTreeRewindAction(ctx, state, deps) {
77
78
  }
78
79
  const wasWorking = state.working;
79
80
  const cancelSeq = liveSessionOffset(deps.binding.agent.session);
81
+ // Through the session: the queue it drops is this client's own discard,
82
+ // not inputs the backend lost (those the channel would keep for the user).
80
83
  if (wasWorking)
81
- deps.binding.agent.cancel({ kind: 'user' });
84
+ void deps.binding.session.cancel('switch');
82
85
  if (wasWorking && !await waitForTurnEnd(deps.binding.agent.session, cancelSeq, 30000)) {
83
86
  deps.notify(t('rewind-settling'), { color: 'error' });
84
87
  return null;
@@ -98,12 +101,14 @@ export function createTreeRewindAction(ctx, state, deps) {
98
101
  // the publisher only learns the id from the registry on its next beat.
99
102
  const { reservation } = await reserveNewSession(String(childId));
100
103
  let candidate;
104
+ // A branch keeps the live explicit pin, not an adapter-default UI readout.
105
+ const route = { ...(modelSeamOf(deps.binding.agent)?.current() ?? { provider: state.provider, model: state.model }) };
101
106
  try {
102
107
  const create = () => cutHoldsNoConversation
103
108
  ? createFreshAgent(ctx, agents, {
104
109
  sessionId: childId,
105
110
  meta: { cwd: sourceCwd, ...(composed.agentPreset === undefined ? {} : { agentPreset: composed.agentPreset }) },
106
- agentOptions: { provider: state.provider, model: state.model },
111
+ agentOptions: route,
107
112
  setup: composed.setup,
108
113
  })
109
114
  : agents.create(liveSessionCreateOptions({
@@ -114,14 +119,15 @@ export function createTreeRewindAction(ctx, state, deps) {
114
119
  cwd: sourceCwd,
115
120
  parentSession: SessionId(sessionId),
116
121
  agentPreset: composed.agentPreset,
117
- agentOptions: { provider: state.provider, model: state.model },
118
- setup: closeAfterCreate || mode === 'rewind' ? async (agentCtx, agent) => {
122
+ agentOptions: route,
123
+ setup: async (agentCtx, agent) => {
124
+ modelSeamOf(agent)?.select(route);
119
125
  if (closeAfterCreate)
120
126
  closeLiveForkTurn(agent.session, target.closeTurn);
121
127
  if (mode === 'rewind')
122
128
  agent.inbox.clear();
123
129
  return composed.setup?.(agentCtx, agent);
124
- } : composed.setup,
130
+ },
125
131
  }));
126
132
  candidate = await deps.binding.prepare(adoption, async () => {
127
133
  const handle = await create();
@@ -1 +1 @@
1
- {"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIvD,OAAO,KAAK,EAAE,qBAAqB,EAA8C,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAiBpJ,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CAsG1H;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,GAAG,aAAa,CAAC,CA2VlM"}
1
+ {"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIvD,OAAO,KAAK,EAAE,qBAAqB,EAA8C,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAiBpJ,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,qBAAqB,EAAE,GAAG,kBAAkB,EAAE,CAyG1H;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,GAAG,aAAa,CAAC,CA2VlM"}
@@ -32,15 +32,18 @@ export function webSettingsSections(ctx, namespaces) {
32
32
  const ns = entry.options.id;
33
33
  if (entry.fiber === undefined || !available.has(ns))
34
34
  continue;
35
- if (webOwner !== undefined && concreteService(entry.fiber) === concreteService(webOwner))
35
+ // Loader 1.1 retains the awaitable Fiber wrapper; its context still names
36
+ // the canonical owner, as on older Loaders that stored that owner directly.
37
+ const owner = concreteService(entry.fiber.ctx?.fiber ?? entry.fiber);
38
+ if (webOwner !== undefined && owner === concreteService(webOwner))
36
39
  webNs = ns;
37
40
  if (entry.fiber.runtime?.name === 'web-deepseek-api') {
38
41
  apiNs = ns;
39
- apiOwner = concreteService(entry.fiber);
42
+ apiOwner = owner;
40
43
  }
41
44
  if (entry.fiber.runtime?.name === 'web-search-deepseek') {
42
45
  messagesNs = ns;
43
- messagesOwner = concreteService(entry.fiber);
46
+ messagesOwner = owner;
44
47
  }
45
48
  }
46
49
  // This section is introduced together with live provider selection in rc.2.
@@ -1,7 +1,7 @@
1
1
  import { type SessionEvent } from '@deepseek-ai/dsh-session';
2
2
  import type { ChatRow, ToolResultView, ToolViewPresenter } from './types.js';
3
- import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT } from '../../channel/transcript.js';
4
- export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT };
3
+ import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows } from '../../channel/transcript.js';
4
+ export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows };
5
5
  /**
6
6
  * Fold the oldest rows beyond the transcript window cap: drop each row's
7
7
  * full-text fields (assistant/reasoning text, tool args/results) and keep
@@ -16,6 +16,7 @@ export declare function foldRows(rows: ChatRow[], cap: number, cursor?: {
16
16
  rows: unknown;
17
17
  index: number;
18
18
  head?: unknown;
19
+ boundary?: unknown;
19
20
  },
20
21
  /** Rows the backend can restore (default: every foldable kind); any
21
22
  * other row keeps its full text. */
@@ -1 +1 @@
1
- {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE5E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAI7H,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAE1F;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,OAAO,EAAE,EACf,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE;AACzD;qCACqC;AACrC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GACrC,MAAM,CA4CR;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,CAAC,E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AE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWxE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAUxF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CA2BnF"}
@@ -1,10 +1,10 @@
1
1
  import { toolResultPayload } from '../compat/messages.js';
2
2
  import { t } from '../../i18n.js';
3
3
  import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
4
- import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT } from '../../channel/transcript.js';
4
+ import { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows } from '../../channel/transcript.js';
5
5
  // Limits and the preview helper are backend-neutral (src/channel/transcript.ts);
6
6
  // re-exported here for the existing importers.
7
- export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, RESULT_PREVIEW_LIMIT };
7
+ export { ARGS_PREVIEW_LIMIT, LOCAL_OUTPUT_LIMIT, MAX_ROWS, preview, previewIndented, RESULT_PREVIEW_LIMIT, trimLocalRows };
8
8
  /**
9
9
  * Fold the oldest rows beyond the transcript window cap: drop each row's
10
10
  * full-text fields (assistant/reasoning text, tool args/results) and keep
@@ -32,7 +32,14 @@ restorable) {
32
32
  // there was the O(rows) per-frame term of long-session streaming. Rows
33
33
  // prepended ahead of the window (older history) shift every index: a new
34
34
  // head restarts the pass.
35
- const from = cursor === undefined ? 0 : cursor.rows === rows && cursor.head === rows[0] ? cursor.index : 0;
35
+ let from = cursor === undefined ? 0 : cursor.rows === rows && cursor.head === rows[0] ? cursor.index : 0;
36
+ // A local-block splice can move rows under the cursor with or without
37
+ // changing the array length, so the old boundary row is the witness: if it
38
+ // moved, rescan from the head — otherwise the shifted rows stay unfolded
39
+ // forever. A quiet streaming frame keeps the same boundary and stays
40
+ // incremental. This must run for every shift, not only the shrunken ones.
41
+ if (cursor !== undefined && from > 0 && rows[from - 1] !== cursor.boundary)
42
+ from = 0;
36
43
  if (cursor !== undefined) {
37
44
  cursor.rows = rows;
38
45
  cursor.head = rows[0];
@@ -66,8 +73,10 @@ restorable) {
66
73
  markChannelReadDirty(row);
67
74
  markChannelReadDirty(rows);
68
75
  }
69
- if (cursor !== undefined)
76
+ if (cursor !== undefined) {
70
77
  cursor.index = excess;
78
+ cursor.boundary = rows[excess - 1];
79
+ }
71
80
  return folded;
72
81
  }
73
82
  /**