@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.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 (488) hide show
  1. package/README.md +213 -34
  2. package/assets/plugin-icon.svg +13 -0
  3. package/assets/windows-installer.cs +308 -0
  4. package/assets/windows-installer.ps1 +17 -0
  5. package/bin/dsh-tui.js +64 -5
  6. package/cli/adapters/dsh/index.mjs +111 -0
  7. package/cli/adapters/dsh/locate.mjs +73 -0
  8. package/cli/adapters/dsh/management-plugin.mjs +111 -0
  9. package/cli/args.mjs +154 -0
  10. package/cli/contracts.d.ts +48 -0
  11. package/cli/engine.mjs +92 -0
  12. package/cli/entry.mjs +48 -0
  13. package/cli/process.mjs +118 -0
  14. package/cli/protocol.mjs +23 -0
  15. package/cli/schema-v1.json +33 -0
  16. package/cordis.patch.yml +3 -1
  17. package/cordis.yml +3 -1
  18. package/guide/dsh-tui-guide/SKILL.md +1 -0
  19. package/guide/dsh-tui-guide/cli.en.md +114 -0
  20. package/guide/dsh-tui-guide/cli.md +114 -0
  21. package/guide/dsh-tui-guide/configuration.en.md +7 -5
  22. package/guide/dsh-tui-guide/configuration.md +7 -5
  23. package/guide/dsh-tui-guide/getting-started.en.md +33 -3
  24. package/guide/dsh-tui-guide/getting-started.md +23 -2
  25. package/guide/dsh-tui-guide/interaction.en.md +50 -17
  26. package/guide/dsh-tui-guide/interaction.md +35 -13
  27. package/guide/dsh-tui-guide/plugins.en.md +63 -11
  28. package/guide/dsh-tui-guide/plugins.md +41 -7
  29. package/guide/dsh-tui-guide/user-guide.en.md +55 -34
  30. package/guide/dsh-tui-guide/user-guide.md +45 -28
  31. package/lib/settings.json +85 -42
  32. package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
  33. package/lib/types/adapter/channel/plugins.js +8 -0
  34. package/lib/types/adapter/channel/ui-policy.d.ts +2 -1
  35. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  36. package/lib/types/adapter/channel/ui-policy.js +4 -0
  37. package/lib/types/adapter/ports/channel-display.d.ts +10 -0
  38. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  39. package/lib/types/adapter/ports/channel-session.d.ts +2 -0
  40. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  41. package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
  42. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  43. package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
  44. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  45. package/lib/types/adapter/ports/channel-view.d.ts +11 -1
  46. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  47. package/lib/types/adapter/ports/channel.d.ts +7 -0
  48. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  49. package/lib/types/adapter/standard/grants.d.ts +60 -0
  50. package/lib/types/adapter/standard/grants.d.ts.map +1 -1
  51. package/lib/types/adapter/standard/grants.js +74 -0
  52. package/lib/types/agent/capabilities.d.ts +2 -0
  53. package/lib/types/agent/capabilities.d.ts.map +1 -1
  54. package/lib/types/agent/events.d.ts +15 -1
  55. package/lib/types/agent/events.d.ts.map +1 -1
  56. package/lib/types/api.d.ts +2 -2
  57. package/lib/types/api.d.ts.map +1 -1
  58. package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
  59. package/lib/types/backends/claude/translate/events.js +2 -1
  60. package/lib/types/backends/codex/auth/status.js +1 -1
  61. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  62. package/lib/types/backends/codex/session/controls.js +6 -5
  63. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  64. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  65. package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
  66. package/lib/types/backends/codex/translate/events.js +3 -1
  67. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  68. package/lib/types/backends/shared/channel-tokens.js +9 -8
  69. package/lib/types/channel/history-restore.d.ts.map +1 -1
  70. package/lib/types/channel/history-restore.js +2 -0
  71. package/lib/types/channel/interaction.d.ts.map +1 -1
  72. package/lib/types/channel/interaction.js +1 -0
  73. package/lib/types/channel/projection.d.ts +1 -1
  74. package/lib/types/channel/projection.d.ts.map +1 -1
  75. package/lib/types/channel/projection.js +19 -4
  76. package/lib/types/channel/questions.d.ts +2 -0
  77. package/lib/types/channel/questions.d.ts.map +1 -1
  78. package/lib/types/channel/sanitize.d.ts +14 -0
  79. package/lib/types/channel/sanitize.d.ts.map +1 -1
  80. package/lib/types/channel/sanitize.js +55 -0
  81. package/lib/types/channel/working-directory.d.ts +9 -0
  82. package/lib/types/channel/working-directory.d.ts.map +1 -0
  83. package/lib/types/channel/working-directory.js +7 -0
  84. package/lib/types/commands.d.ts +8 -1
  85. package/lib/types/commands.d.ts.map +1 -1
  86. package/lib/types/commands.js +14 -5
  87. package/lib/types/components/ChatTitle.d.ts +7 -0
  88. package/lib/types/components/ChatTitle.d.ts.map +1 -0
  89. package/lib/types/components/ChatTitle.js +15 -0
  90. package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
  91. package/lib/types/components/CodeBlockFrame.js +10 -5
  92. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
  93. package/lib/types/components/CompactionStatusRow.js +24 -3
  94. package/lib/types/components/GoalTodoPanel.d.ts +73 -6
  95. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  96. package/lib/types/components/GoalTodoPanel.js +165 -17
  97. package/lib/types/components/Markdown.d.ts +9 -1
  98. package/lib/types/components/Markdown.d.ts.map +1 -1
  99. package/lib/types/components/Markdown.js +5 -4
  100. package/lib/types/components/MessageList.d.ts.map +1 -1
  101. package/lib/types/components/MessageList.js +20 -14
  102. package/lib/types/components/PluginGrantList.d.ts +45 -0
  103. package/lib/types/components/PluginGrantList.d.ts.map +1 -0
  104. package/lib/types/components/PluginGrantList.js +126 -0
  105. package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
  106. package/lib/types/components/PluginInstallPane.js +35 -6
  107. package/lib/types/components/PluginManagePane.d.ts.map +1 -1
  108. package/lib/types/components/PluginManagePane.js +65 -8
  109. package/lib/types/components/PromptInput.d.ts +13 -5
  110. package/lib/types/components/PromptInput.d.ts.map +1 -1
  111. package/lib/types/components/PromptInput.js +190 -108
  112. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  113. package/lib/types/components/SplitDiffView.js +232 -22
  114. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  115. package/lib/types/components/SubagentDashboard.js +10 -0
  116. package/lib/types/components/SubagentDetailScene.d.ts +3 -1
  117. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  118. package/lib/types/components/SubagentDetailScene.js +17 -1
  119. package/lib/types/components/Whale.d.ts.map +1 -1
  120. package/lib/types/components/Whale.js +8 -5
  121. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  122. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  123. package/lib/types/components/approvals/ApprovalPanel.js +93 -11
  124. package/lib/types/components/bigfont.d.ts.map +1 -1
  125. package/lib/types/components/bigfont.js +2 -1
  126. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
  127. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  128. package/lib/types/components/messages/AssistantToolUseMessage.js +24 -11
  129. package/lib/types/components/onboardingModel.d.ts +2 -2
  130. package/lib/types/components/onboardingModel.js +3 -3
  131. package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
  132. package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
  133. package/lib/types/components/onboardingProviderPlan.js +78 -0
  134. package/lib/types/components/previewRows.d.ts +19 -0
  135. package/lib/types/components/previewRows.d.ts.map +1 -0
  136. package/lib/types/components/previewRows.js +46 -0
  137. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  138. package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
  139. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
  140. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  141. package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
  142. package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
  143. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  144. package/lib/types/components/sessions/SessionListRow.js +18 -10
  145. package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
  146. package/lib/types/components/sidePanel/InfoPanel.js +4 -3
  147. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  148. package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
  149. package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
  150. package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
  151. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
  152. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  153. package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
  154. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  155. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
  156. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
  157. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  158. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
  159. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
  160. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
  161. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
  162. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  163. package/lib/types/components/sidePanel/builtinPanels.js +36 -18
  164. package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
  165. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
  166. package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
  167. package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
  168. package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
  169. package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
  170. package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
  171. package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
  172. package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
  173. package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
  174. package/lib/types/components/sidePanel/types.d.ts +2 -0
  175. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  176. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  177. package/lib/types/components/sidePanel/useSidePanel.js +39 -7
  178. package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
  179. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  180. package/lib/types/components/trajectory/MiniWake.js +7 -3
  181. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  182. package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
  183. package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
  184. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  185. package/lib/types/dsh-adapter/backend/session.js +62 -6
  186. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/backend/translate.js +18 -4
  188. package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
  189. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  190. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  191. package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
  192. package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
  193. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  194. package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
  195. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
  197. package/lib/types/dsh-adapter/channel/composer-images.d.ts +11 -1
  198. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
  200. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  201. package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
  202. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
  203. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  204. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
  205. package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
  206. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  207. package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
  208. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -1
  209. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  210. package/lib/types/dsh-adapter/channel/core/binding-feed.js +48 -3
  211. package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
  212. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/channel/core/compose.js +7 -0
  214. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  215. package/lib/types/dsh-adapter/channel/core/files.js +2 -1
  216. package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
  217. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/channel/core/host.js +192 -13
  219. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
  220. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  221. package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
  222. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  223. package/lib/types/dsh-adapter/channel/extensions.js +31 -5
  224. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  225. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  226. package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
  227. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
  228. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  229. package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
  230. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  231. package/lib/types/dsh-adapter/channel/mentions.js +21 -7
  232. package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
  233. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  234. package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
  235. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  236. package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
  237. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  238. package/lib/types/dsh-adapter/channel/paths.js +11 -9
  239. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  240. package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
  241. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
  242. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  243. package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
  244. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  245. package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
  246. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  247. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  248. package/lib/types/dsh-adapter/channel/session-reset.js +7 -1
  249. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
  250. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  251. package/lib/types/dsh-adapter/channel/session-resume.js +56 -36
  252. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
  253. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  254. package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
  255. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
  256. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  257. package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
  258. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  259. package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
  260. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  261. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  262. package/lib/types/dsh-adapter/channel/state.js +2 -2
  263. package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
  264. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  265. package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
  266. package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
  267. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
  268. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  269. package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
  270. package/lib/types/dsh-adapter/contract.d.ts +7 -5
  271. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  272. package/lib/types/dsh-adapter/contract.js +10 -5
  273. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  274. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  275. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  276. package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
  277. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  278. package/lib/types/dsh-adapter/experimental-bundles.d.ts +29 -0
  279. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
  280. package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
  281. package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
  282. package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
  283. package/lib/types/dsh-adapter/grant-file.js +178 -0
  284. package/lib/types/dsh-adapter/host-access.d.ts +4 -0
  285. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  286. package/lib/types/dsh-adapter/host-access.js +54 -4
  287. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  288. package/lib/types/dsh-adapter/host-contract.js +2 -2
  289. package/lib/types/dsh-adapter/host-dsh.js +3 -3
  290. package/lib/types/dsh-adapter/index.d.ts +8 -4
  291. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  292. package/lib/types/dsh-adapter/index.js +17 -12
  293. package/lib/types/dsh-adapter/panels.d.ts +28 -8
  294. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  295. package/lib/types/dsh-adapter/panels.js +11 -56
  296. package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
  297. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  298. package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
  299. package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
  300. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
  301. package/lib/types/dsh-adapter/plugin-install.js +160 -13
  302. package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
  303. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  304. package/lib/types/dsh-adapter/plugin-manage.js +240 -51
  305. package/lib/types/dsh-adapter/plugin.d.ts +81 -0
  306. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  307. package/lib/types/dsh-adapter/plugin.js +378 -84
  308. package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
  309. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  310. package/lib/types/dsh-adapter/plugins-info.js +99 -31
  311. package/lib/types/dsh-adapter/presets.d.ts +19 -6
  312. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  313. package/lib/types/dsh-adapter/presets.js +69 -12
  314. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  315. package/lib/types/dsh-adapter/process-exit.js +1 -1
  316. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
  317. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  318. package/lib/types/dsh-adapter/providerWizard.js +11 -5
  319. package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
  320. package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
  321. package/lib/types/dsh-adapter/row-attachment.js +29 -0
  322. package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
  323. package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
  324. package/lib/types/dsh-adapter/session-tools.js +39 -0
  325. package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
  326. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  327. package/lib/types/dsh-adapter/settings-sections.js +73 -0
  328. package/lib/types/dsh-adapter/status.d.ts +88 -1
  329. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  330. package/lib/types/dsh-adapter/status.js +318 -3
  331. package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
  332. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  333. package/lib/types/dsh-adapter/team-mode.js +76 -112
  334. package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
  335. package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
  336. package/lib/types/dsh-adapter/worktree-tool.js +87 -0
  337. package/lib/types/extensions.d.ts +1 -1
  338. package/lib/types/extensions.d.ts.map +1 -1
  339. package/lib/types/force-production-react.js +3 -3
  340. package/lib/types/heldInputs.d.ts +36 -0
  341. package/lib/types/heldInputs.d.ts.map +1 -0
  342. package/lib/types/heldInputs.js +173 -0
  343. package/lib/types/i18n.d.ts +543 -73
  344. package/lib/types/i18n.d.ts.map +1 -1
  345. package/lib/types/i18n.js +265 -46
  346. package/lib/types/ink/colorize.d.ts +7 -1
  347. package/lib/types/ink/colorize.d.ts.map +1 -1
  348. package/lib/types/ink/colorize.js +29 -8
  349. package/lib/types/ink/components/App.d.ts +2 -1
  350. package/lib/types/ink/components/App.d.ts.map +1 -1
  351. package/lib/types/ink/components/App.js +10 -3
  352. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  353. package/lib/types/ink/components/ScrollBox.js +1 -0
  354. package/lib/types/ink/dom.d.ts +1 -0
  355. package/lib/types/ink/dom.d.ts.map +1 -1
  356. package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
  357. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
  358. package/lib/types/ink/hooks/use-program-status.js +96 -0
  359. package/lib/types/ink/ink.d.ts +13 -4
  360. package/lib/types/ink/ink.d.ts.map +1 -1
  361. package/lib/types/ink/ink.js +119 -25
  362. package/lib/types/ink/output.d.ts +17 -2
  363. package/lib/types/ink/output.d.ts.map +1 -1
  364. package/lib/types/ink/output.js +85 -2
  365. package/lib/types/ink/parse-keypress.d.ts +1 -0
  366. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  367. package/lib/types/ink/parse-keypress.js +5 -4
  368. package/lib/types/ink/render-node-to-output.d.ts +2 -0
  369. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  370. package/lib/types/ink/render-node-to-output.js +79 -10
  371. package/lib/types/ink/root.d.ts +8 -0
  372. package/lib/types/ink/root.d.ts.map +1 -1
  373. package/lib/types/ink/root.js +12 -3
  374. package/lib/types/ink/screen.d.ts +11 -0
  375. package/lib/types/ink/screen.d.ts.map +1 -1
  376. package/lib/types/ink/screen.js +44 -0
  377. package/lib/types/ink/selection.d.ts +7 -2
  378. package/lib/types/ink/selection.d.ts.map +1 -1
  379. package/lib/types/ink/selection.js +187 -44
  380. package/lib/types/ink/shutdown-input.d.ts +15 -0
  381. package/lib/types/ink/shutdown-input.d.ts.map +1 -0
  382. package/lib/types/ink/shutdown-input.js +28 -0
  383. package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
  384. package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
  385. package/lib/types/ink/sixel-cursor-heal.js +62 -0
  386. package/lib/types/ink/sixel-graphics.d.ts +6 -0
  387. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  388. package/lib/types/ink/sixel-graphics.js +18 -0
  389. package/lib/types/ink/styles.d.ts +8 -1
  390. package/lib/types/ink/styles.d.ts.map +1 -1
  391. package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
  392. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
  393. package/lib/types/ink/terminal-notification-windows.js +433 -0
  394. package/lib/types/ink/terminal-notification.d.ts +3 -1
  395. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  396. package/lib/types/ink/terminal-notification.js +4 -1
  397. package/lib/types/ink/terminal-querier.d.ts +9 -1
  398. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  399. package/lib/types/ink/terminal-querier.js +32 -1
  400. package/lib/types/ink/terminal.d.ts +23 -2
  401. package/lib/types/ink/terminal.d.ts.map +1 -1
  402. package/lib/types/ink/terminal.js +32 -2
  403. package/lib/types/ink/termio/osc.d.ts +2 -1
  404. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  405. package/lib/types/ink/termio/osc.js +37 -8
  406. package/lib/types/ink/termio/osc7501.d.ts +102 -0
  407. package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
  408. package/lib/types/ink/termio/osc7501.js +229 -0
  409. package/lib/types/ink/termio/tokenize.js +5 -7
  410. package/lib/types/onboardingDraft.d.ts +143 -0
  411. package/lib/types/onboardingDraft.d.ts.map +1 -0
  412. package/lib/types/onboardingDraft.js +71 -0
  413. package/lib/types/panels.d.ts +1 -1
  414. package/lib/types/panels.d.ts.map +1 -1
  415. package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
  416. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  417. package/lib/types/screens/AgentTranscriptScene.js +5 -1
  418. package/lib/types/screens/Chat.d.ts +6 -6
  419. package/lib/types/screens/Chat.d.ts.map +1 -1
  420. package/lib/types/screens/Chat.js +394 -141
  421. package/lib/types/screens/Launchpad.d.ts +8 -2
  422. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  423. package/lib/types/screens/Launchpad.js +32 -12
  424. package/lib/types/screens/Onboarding.d.ts +22 -3
  425. package/lib/types/screens/Onboarding.d.ts.map +1 -1
  426. package/lib/types/screens/Onboarding.js +606 -36
  427. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  428. package/lib/types/screens/SessionSupervisor.js +31 -21
  429. package/lib/types/screens/Settings.d.ts +5 -1
  430. package/lib/types/screens/Settings.d.ts.map +1 -1
  431. package/lib/types/screens/Settings.js +528 -51
  432. package/lib/types/screens/StatusLine.d.ts +9 -3
  433. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  434. package/lib/types/screens/StatusLine.js +91 -15
  435. package/lib/types/screens/StatusMetrics.d.ts +2 -11
  436. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  437. package/lib/types/screens/StatusMetrics.js +20 -14
  438. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  439. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
  440. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  441. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  442. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
  443. package/lib/types/sessionMounts.d.ts +14 -0
  444. package/lib/types/sessionMounts.d.ts.map +1 -1
  445. package/lib/types/sessionMounts.js +20 -9
  446. package/lib/types/sessions/format.d.ts +39 -0
  447. package/lib/types/sessions/format.d.ts.map +1 -1
  448. package/lib/types/sessions/format.js +83 -0
  449. package/lib/types/sessions/resumeFailure.d.ts +4 -0
  450. package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
  451. package/lib/types/sessions/resumeFailure.js +12 -4
  452. package/lib/types/sessions/workspaceCounts.d.ts +6 -0
  453. package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
  454. package/lib/types/sessions/workspaceCounts.js +24 -0
  455. package/lib/types/settings/definitions.d.ts +24 -0
  456. package/lib/types/settings/definitions.d.ts.map +1 -1
  457. package/lib/types/settings/definitions.js +40 -15
  458. package/lib/types/tips.js +2 -2
  459. package/lib/types/tuiDisplayPrefs.d.ts +113 -5
  460. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  461. package/lib/types/tuiDisplayPrefs.js +276 -14
  462. package/lib/types/update.d.ts +15 -14
  463. package/lib/types/update.d.ts.map +1 -1
  464. package/lib/types/update.js +163 -115
  465. package/lib/types/updateProcess.d.ts +28 -0
  466. package/lib/types/updateProcess.d.ts.map +1 -0
  467. package/lib/types/updateProcess.js +135 -0
  468. package/lib/types/utils/inputWordBoundary.d.ts +5 -0
  469. package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
  470. package/lib/types/utils/inputWordBoundary.js +18 -0
  471. package/lib/types/utils/keymap.d.ts +1 -1
  472. package/lib/types/utils/keymap.d.ts.map +1 -1
  473. package/lib/types/utils/keymap.js +6 -1
  474. package/lib/types/utils/paths.d.ts +15 -0
  475. package/lib/types/utils/paths.d.ts.map +1 -1
  476. package/lib/types/utils/paths.js +25 -0
  477. package/lib/types/windowsInstaller.d.ts +4 -0
  478. package/lib/types/windowsInstaller.d.ts.map +1 -0
  479. package/lib/types/windowsInstaller.js +237 -0
  480. package/locale/en.json +6 -0
  481. package/locale/zh.json +6 -0
  482. package/package.json +130 -111
  483. package/presets/liangshen/custom-bash.mjs +13 -1
  484. package/presets/liangshen/instruction-hint.mjs +4 -1
  485. package/presets/liangshen/skill-search.mjs +14 -2
  486. package/presets/winbash.mjs +16 -4
  487. package/tui-profile/feed/README.md +17 -8
  488. package/tui-profile/feed/first-party.json +1 -1
@@ -8,6 +8,7 @@ import { installedMeetsVersion } from '../contract.js';
8
8
  import { createDshSession } from '../backend/session.js';
9
9
  import { createDshTranslator, dshPricingWindow } from '../backend/translate.js';
10
10
  import { concreteService } from '../host-access.js';
11
+ import { teamServiceActive, withTeamCommandVisibility } from '../team-mode.js';
11
12
  import { getHostMessageObserver } from '../message-observer.js';
12
13
  import { createForeignBrowser } from '../migrate/browse.js';
13
14
  import { createPluginCompletionCatalog } from '../plugin-completions.js';
@@ -46,6 +47,7 @@ import { createSkillCatalog } from './skill-catalog.js';
46
47
  import { createSubagentProjection } from './subagent-projection.js';
47
48
  import { readChildTranscriptPage } from './subagent-transcript.js';
48
49
  import { DSH_BACKEND_LABEL } from './state.js';
50
+ import { sessionWorkingDirectory } from '../../channel/working-directory.js';
49
51
  import { ensureUpstreamRetry } from './upstream-retry.js';
50
52
  import { foldBack } from './transcript.js';
51
53
  import { createWorkspaceActions } from './workspace-actions.js';
@@ -206,10 +208,27 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
206
208
  // service lookups, so both consumers may call it freely: the public
207
209
  // `capabilities()` accessor and the command-list annotation below.
208
210
  const capabilitiesOf = () => resolveAgentCapabilities(agentCapabilityEvidence(ctx, binding.agent));
211
+ // `/team` is gated on its service, not on a backend capability: Help and `/`
212
+ // completion read `commandList`, so this is the one catalog that can hide it
213
+ // while `agentTeams` is absent. Keep the unfiltered list so a later service
214
+ // mount restores the row without waiting for a skill-catalog refresh.
215
+ let commandBase = LOCAL_COMMANDS;
216
+ const publishCommandList = (commands, emit = true) => {
217
+ state.commandList = annotateCommandCapabilities(withTeamCommandVisibility(commands, teamServiceActive(ctx)), capabilitiesOf());
218
+ if (emit)
219
+ state.emit();
220
+ };
209
221
  // Annotated from the start: Help and `/` completion read `commandList`
210
222
  // before the first skill-catalog refresh publishes a new one, and a command
211
223
  // whose capability is missing must never look usable in that window.
212
- state.commandList = annotateCommandCapabilities(LOCAL_COMMANDS, capabilitiesOf());
224
+ publishCommandList(LOCAL_COMMANDS, false);
225
+ // The team service appears and disappears with its bundle (HMR, a CLI or
226
+ // Web write). Follow the same `internal/service` signal the team store reads,
227
+ // so the command catalog and the Help/`/` popup change with it.
228
+ owner.own(ctx.on('internal/service', ((name) => {
229
+ if (name === 'agentTeams')
230
+ publishCommandList(commandBase);
231
+ })));
213
232
  Object.defineProperty(state, 'autoRecapOnOpen', {
214
233
  configurable: true,
215
234
  enumerable: true,
@@ -383,13 +402,13 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
383
402
  owner,
384
403
  commandService,
385
404
  agent: () => binding.agent,
386
- cwd: () => state.cwd,
405
+ cwd: () => sessionWorkingDirectory(state),
387
406
  setCommands(commands) {
388
407
  // Annotate before publishing: Help and `/` completion both read
389
408
  // `commandList`, so a command whose capability is missing says so
390
409
  // instead of looking usable and failing on use.
391
- state.commandList = annotateCommandCapabilities(commands, capabilitiesOf());
392
- state.emit();
410
+ commandBase = commands;
411
+ publishCommandList(commands);
393
412
  },
394
413
  commandDescriptions: name => commandTrees?.descriptions(name),
395
414
  // A skill gesture typed mid-turn stays immediate (steer at the next step
@@ -436,7 +455,7 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
436
455
  const loadedContext = createLoadedContextRefresher(ctx, {
437
456
  owner,
438
457
  agent: () => binding.agent,
439
- cwd: () => state.cwd,
458
+ cwd: () => sessionWorkingDirectory(state),
440
459
  skillRegistryFor,
441
460
  skillViewOptions,
442
461
  publish(context) { state.loadedContext = context; state.emit(); },
@@ -530,6 +549,13 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
530
549
  messageObserver,
531
550
  seedUpstreamRetry,
532
551
  retireAttachment: core.input.retireAttachment,
552
+ onWorkingDirectoryChange: () => {
553
+ // The 1s poll also re-probes the new directory; starting it here drops
554
+ // the stale-branch window on a move.
555
+ core.refreshGitBranch();
556
+ void refreshLoadedContext();
557
+ void refreshSkillCommands();
558
+ },
533
559
  });
534
560
  const sessionAdoption = createSessionAdoption(state, {
535
561
  binding,
@@ -25,12 +25,12 @@ export interface InputConvergence {
25
25
  * undefined when none is. */
26
26
  provisionalDockIds?: string[];
27
27
  }
28
- export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities'>, getSession: () => AgentSession, owner: {
28
+ export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities' | 'status'>, getSession: () => AgentSession, owner: {
29
29
  assertActive(): void;
30
30
  }, input: InputConvergence, composer: {
31
31
  includeLegacyImageRefs(text: string, images: readonly ComposerImageRef[]): readonly ComposerImageRef[];
32
32
  }, dispatchUserText: (text: string, placement: 'steer' | 'followup', images?: readonly ComposerImageRef[]) => void, runLocalCommand: (command: string, includeInContext: boolean) => Promise<void>,
33
33
  /** Move the used session to the front of the `/resume` MRU (DSH session
34
34
  * history); a backend whose sessions that list cannot open passes a no-op. */
35
- touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft'>;
35
+ touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft' | 'holdInputs'>;
36
36
  //# sourceMappingURL=input-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAsB,MAAM,YAAY,CAAA;AAEpF,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB;;6EAEyE;IACzE,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAClC;0EACsE;IACtE,uBAAuB,CAAC,EAAE,OAAO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103
  input.cancelInFlight = true;
104
104
  input.cancelCause = 'user';
105
105
  state.cancelPending = true;
106
+ // Publish the window: the UI needs to show that the interrupt was
107
+ // received (and its watchdog needs the state change) even when the
108
+ // abort never converges and no backend event follows.
109
+ state.emit();
106
110
  void session.cancel('user');
107
111
  },
108
112
  /** Esc with queued input while a turn runs (Claude Code parity: "Press
@@ -179,6 +183,11 @@ touch = touchSession) {
179
183
  // not the ones this receipt speaks about.
180
184
  if (getSession() !== session)
181
185
  return;
186
+ // The session ended meanwhile: its end held every row and their
187
+ // backend copies went with it, so this answer neither un-docks them
188
+ // nor reports a queue that will still run.
189
+ if (session.status === 'disposed')
190
+ return;
182
191
  // Every docked row this receipt cannot confirm dropped: the ids the
183
192
  // backend says it kept, plus every row docked after the request
184
193
  // fired (outside its snapshot). Those copies are still live: their
@@ -240,6 +249,12 @@ touch = touchSession) {
240
249
  const docked = state.pending.filter(item => item.docked === true);
241
250
  if (docked.length === 0)
242
251
  return 0;
252
+ // The session ended: nothing would run them, and a refused send would
253
+ // lose them. They stay docked for the next session.
254
+ if (state.status === 'disposed') {
255
+ state.notify(t('input-dock-session-disposed'), { color: 'warning', timeoutMs: 6000 });
256
+ return 0;
257
+ }
243
258
  // Provisional rows are always the newest dock batches, so the confirmed
244
259
  // remainder is a FIFO prefix; holding the tail never reorders anyone.
245
260
  const ready = docked.filter(item => !held(item.id));
@@ -278,6 +293,9 @@ touch = touchSession) {
278
293
  // the user a second copy the late revocation cannot reach.
279
294
  if (input.provisionalDockIds?.includes(id) === true)
280
295
  return false;
296
+ // The draft takes the swapped row's place: held for the next session
297
+ // when that row was (its own session ended), so `/new` keeps it too.
298
+ const orphaned = state.pending[index].orphaned === true;
281
299
  // A docked retract is purely local on every backend (see removePending).
282
300
  state.pending = [
283
301
  ...state.pending.filter(item => item.id !== id),
@@ -287,11 +305,27 @@ touch = touchSession) {
287
305
  images: [...(draft.images ?? [])],
288
306
  placement: 'followup',
289
307
  docked: true,
308
+ ...(orphaned ? { orphaned: true } : {}),
290
309
  },
291
310
  ];
292
311
  state.emit();
293
312
  return true;
294
313
  },
314
+ holdInputs(texts) {
315
+ owner.assertActive();
316
+ const state = getState();
317
+ // Local ids like the swap's: no backend copy exists, so no inbox event
318
+ // can match these rows and no interrupt receipt covers them.
319
+ const held = texts.filter(text => text.trim() !== '').map((text) => ({
320
+ id: `dock-held-${randomUUID()}`, text, images: [], placement: 'followup', docked: true, orphaned: true,
321
+ }));
322
+ if (held.length === 0)
323
+ return 0;
324
+ state.pending = [...state.pending, ...held];
325
+ state.emit();
326
+ state.notify(t('input-orphans-held', { count: held.length }), { color: 'warning', timeoutMs: 8000 });
327
+ return held.length;
328
+ },
295
329
  interruptAndDeliver(inputs) {
296
330
  owner.assertActive();
297
331
  const state = getState();
@@ -13,6 +13,9 @@ export interface UserTextOrigin {
13
13
  readonly agentId: string;
14
14
  readonly generation: number;
15
15
  readonly cwd: string;
16
+ /** Where `@` mentions resolve: the session's current directory, the same
17
+ * one the model-facing fs tools use (the project stays `cwd`). */
18
+ readonly workingDirectory: string;
16
19
  readonly fs: MentionFs | undefined;
17
20
  readonly attachments: MentionAttachments | undefined;
18
21
  /** The in-memory image store when the session takes images itself: the
@@ -31,11 +34,11 @@ export interface UserTextOrigin {
31
34
  /** Input FIFO, staged attachments and decision notice timers share one lifetime. */
32
35
  export declare function createInputDelivery(ctx: ChannelHost, owner: ChannelOwner, binding: {
33
36
  readonly session: AgentSession;
34
- }, state: () => Pick<ChannelState, 'cwd' | 'agentId' | 'agentBindingGeneration'>, notify: ChannelState['notify'], trackPending: (message: {
37
+ }, state: () => Pick<ChannelState, 'cwd' | 'workingDirectory' | 'agentId' | 'agentBindingGeneration'>, notify: ChannelState['notify'], trackPending: (message: {
35
38
  id: string;
36
39
  text: string;
37
40
  images?: readonly ComposerImageRef[];
38
- }, placement: PendingMessage['placement']) => void, untrackPending: (id: string) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
41
+ }, placement: PendingMessage['placement']) => void, untrackPending: (id: string, hold?: boolean) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
39
42
  /** The fs surface to use when the host mounts no `fs` service (a non-DSH
40
43
  * composition reads the local disk); absent = no fallback. */
41
44
  fallbackFs?: () => MentionFs | undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"input-delivery.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG1D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACjH,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAEnB;4EAC4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACpD;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attachIdeSelection } from './ide-selection.js';
9
9
  import { mentionAttachments, mentionFs } from './mentions.js';
10
+ import { sessionWorkingDirectory } from '../../channel/working-directory.js';
10
11
  /** Input FIFO, staged attachments and decision notice timers share one lifetime. */
11
12
  export function createInputDelivery(ctx, owner, binding, state, notify, trackPending, untrackPending, composer, selection, rememberSelection,
12
13
  /** The fs surface to use when the host mounts no `fs` service (a non-DSH
@@ -103,6 +104,7 @@ consumeAttachedContexts) {
103
104
  agentId: state().agentId,
104
105
  generation: state().agentBindingGeneration,
105
106
  cwd: state().cwd,
107
+ workingDirectory: sessionWorkingDirectory(state()),
106
108
  fs: mentionFs(ctx) ?? fallbackFs?.(),
107
109
  attachments: local ?? mentionAttachments(ctx),
108
110
  ...(local === undefined ? {} : { localImages: local }),
@@ -130,7 +132,7 @@ consumeAttachedContexts) {
130
132
  if (stale !== undefined) {
131
133
  notify(t('input-image-token-stale', { token: stale }), { color: 'warning', timeoutMs: 5000 });
132
134
  }
133
- const expansion = await expandComposerMentions(origin.fs, origin.cwd, text, origin.attachments, orderedImages);
135
+ const expansion = await expandComposerMentions(origin.fs, origin.workingDirectory, text, origin.attachments, orderedImages);
134
136
  // Mention reads can park for arbitrary I/O. A session switch during that
135
137
  // await invalidates the whole submission; neither the old nor the new
136
138
  // agent may receive a message assembled for a different conversation.
@@ -177,12 +179,20 @@ consumeAttachedContexts) {
177
179
  const result = await origin.session.submit({ text, blocks: message.content, clientMessageId: message.id, native: message, ...(images === undefined || images.length === 0 ? {} : { images }) }, placement);
178
180
  // A backend refusal need not emit pending.changed. Retire its preview
179
181
  // and attached context here, and show the refusal instead of queuing it.
182
+ // An ended session refuses every retry: its text stays as a held dock
183
+ // row instead (#1651), sent only when the user sends the dock.
180
184
  if (!result.accepted) {
181
185
  if (attach !== undefined)
182
186
  attachedByMessageId.delete(message.id);
183
- untrackPending(message.id);
184
- if (result.reason !== undefined && result.reason !== '')
185
- notify(result.reason, { color: 'warning', timeoutMs: 4000 });
187
+ const hold = origin.session.status === 'disposed';
188
+ untrackPending(message.id, hold);
189
+ // A refusal with no reason is still a refusal: say so, or the send
190
+ // looks successful while nothing was queued.
191
+ const reason = result.reason !== undefined && result.reason !== '' ? result.reason : t('input-not-accepted');
192
+ if (hold)
193
+ notify(t('input-refused-held', { reason }), { color: 'warning', timeoutMs: 6000 });
194
+ else
195
+ notify(reason, { color: 'warning', timeoutMs: 4000 });
186
196
  return;
187
197
  }
188
198
  }
@@ -192,6 +202,23 @@ consumeAttachedContexts) {
192
202
  untrackPending(message.id);
193
203
  throw error;
194
204
  }
205
+ if (current(origin)) {
206
+ for (const { path, adjustment } of expansion.imageAdjustments ?? []) {
207
+ const detail = [];
208
+ if (adjustment.resized)
209
+ detail.push(t('input-image-detail-resized', { width: adjustment.width, height: adjustment.height }));
210
+ if (adjustment.mediaType !== adjustment.sourceMediaType) {
211
+ const from = adjustment.sourceMediaType.replace(/^image\//u, '').toUpperCase();
212
+ const to = adjustment.mediaType.replace(/^image\//u, '').toUpperCase();
213
+ detail.push(t(adjustment.flattened ? 'input-image-detail-converted-flattened' : 'input-image-detail-converted', { from, to }));
214
+ }
215
+ if (detail.length > 0)
216
+ notify(t('mentions-image-adjusted', { path, detail: detail.join(' · ') }), { timeoutMs: 5000 });
217
+ }
218
+ for (const { path, reason } of expansion.imageFailures ?? []) {
219
+ notify(t('mentions-image-failed', { path, reason }), { color: 'warning', timeoutMs: 5000 });
220
+ }
221
+ }
195
222
  if (expansion.attached.length > 0) {
196
223
  notify(t('mentions-attached', { count: expansion.attached.length }), { timeoutMs: 2500 });
197
224
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe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MAAM,sBAAsB,QAAS,CAAA;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,SAAU,CAAA;AAE9C;eACe;AACf,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;wEACwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,kBAAkB,GAAG,SAAS,CAErF;AAED,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAMrF,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAErF;AAED;+EAC+E;AAC/E,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAS7G;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,kBAAkB,EAChC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAkM3B"}
@@ -1,6 +1,7 @@
1
1
  import { extname, isAbsolute, join } from 'node:path';
2
2
  import { extractMentions } from '../../utils/mentions.js';
3
3
  import { basename } from './paths.js';
4
+ import { expandHomePrefix } from '../../utils/paths.js';
4
5
  import { COMPOSER_IMAGE_TOKEN } from './composer-images.js';
5
6
  /** One attached file's contribution is capped so an absent-minded `@` of a
6
7
  * huge file cannot blow the context window. */
@@ -115,15 +116,21 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
115
116
  if (budget <= 0 && imageMediaType === undefined)
116
117
  continue;
117
118
  // Mentions resolve against the session cwd, same as the model-facing fs
118
- // tools; absolute paths pass through untouched. A `#L12-14` line suffix
119
- // (issue #359) is stripped before resolution; when the stripped path
120
- // misses, the typed literal (suffix intact) gets ONE fallback try so
121
- // filenames genuinely containing `#L…` still resolve as whole files.
122
- const absolute = isAbsolute(mention.path) ? mention.path : join(cwd, mention.path);
119
+ // tools; absolute paths pass through untouched, and a leading literal `~/`
120
+ // (or `~\`) expands to the host home exactly like completion does (issue
121
+ // #1706 — without this the typed path was joined onto the workspace and
122
+ // silently went missing). A `#L12-14` line suffix (issue #359) is stripped
123
+ // before resolution; when the stripped path misses, the typed literal
124
+ // (suffix intact) gets ONE fallback try so filenames genuinely containing
125
+ // `#L…` still resolve as whole files.
126
+ const mentionPath = expandHomePrefix(mention.path);
127
+ const absolute = isAbsolute(mentionPath) ? mentionPath : join(cwd, mentionPath);
123
128
  let resolved = await tryResolveMention(fs, absolute);
124
129
  let literalFallback = false;
130
+ let literalExpanded;
125
131
  if (resolved === undefined && mention.literal !== undefined) {
126
- const literalPath = isAbsolute(mention.literal) ? mention.literal : join(cwd, mention.literal);
132
+ literalExpanded = expandHomePrefix(mention.literal);
133
+ const literalPath = isAbsolute(literalExpanded) ? literalExpanded : join(cwd, literalExpanded);
127
134
  resolved = await tryResolveMention(fs, literalPath);
128
135
  literalFallback = resolved !== undefined;
129
136
  }
@@ -134,7 +141,14 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
134
141
  const { target, info } = resolved;
135
142
  // On a literal-fallback hit the attached file IS the typed name — the
136
143
  // model must see that path, not the suffix-stripped one.
137
- const shownPath = literalFallback ? display : mention.path;
144
+ //
145
+ // The model-facing path must also be resolvable by the fs tools, which
146
+ // resolve against the session cwd and do NOT expand `~` (issue #1706):
147
+ // when the typed path carried a home prefix, hand the model the expanded
148
+ // path. The user-visible `attached`/`missing` lists keep the typed string.
149
+ const shownPath = literalFallback
150
+ ? (literalExpanded !== undefined && isAbsolute(literalExpanded) ? literalExpanded : display)
151
+ : (isAbsolute(mentionPath) ? mentionPath : mention.path);
138
152
  // …and judge image-ness by the typed extension in that case too.
139
153
  const imageType = literalFallback && mention.literal !== undefined
140
154
  ? mentionImageMediaType(mention.literal)
@@ -23,7 +23,7 @@ export declare function createModelActions(ctx: Context, state: Pick<ChannelStat
23
23
  checkContextWarning(): void;
24
24
  }): {
25
25
  selection: ModelSelectionRef;
26
- applyPreferredEffort: () => Promise<void>;
26
+ applyPreferredEffort: (preserveSessionEffort?: boolean) => Promise<void>;
27
27
  refreshEffortLevels: () => void;
28
28
  listEfforts: (route?: {
29
29
  provider: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAOpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE1E,KAAK,OAAO,GAAG,iBAAiB,CAAA;AAEhC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,CAAC,EAC3I,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,C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IAAI;0BACR,IAAI;;6BASD,IAAI;;uBAOJ,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;6BAQxB,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;EAkChE"}
@@ -101,13 +101,19 @@ export function createModelActions(ctx, state, deps) {
101
101
  return 'error';
102
102
  }
103
103
  };
104
- const applyPreferredEffort = async () => {
104
+ const applyPreferredEffort = async (preserveSessionEffort = false) => {
105
105
  if (llmRuntime === undefined || typeof llmRuntime.resolveModelInfo !== 'function')
106
106
  return;
107
107
  const capture = captureEffort();
108
108
  const resolved = await resolveEfforts(capture);
109
109
  if (resolved === 'unavailable' || resolved === 'error' || resolved === 'stale' || !effortCurrent(capture))
110
110
  return;
111
+ // Passive bind only refreshes metadata for a session-owned selection.
112
+ // Explicit settings/model/effort actions retain the original default path.
113
+ if (preserveSessionEffort) {
114
+ state.emit();
115
+ return;
116
+ }
111
117
  // This same binding-time lookup is the route's initial tier refresh even
112
118
  // without a stored preference. Do not make a separate competing refresh
113
119
  // operation that could invalidate the selected preference completion.
@@ -1 +1 @@
1
- {"version":3,"file":"model-selection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAEtE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAElE;;gEAEgE;AAChE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IACvD,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,IAAI,KAAK,CAAA;CACf;;kBAesB,KAAK,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,IAAI;EA2E9E"}
1
+ {"version":3,"file":"model-selection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/model-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAEtE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAElE;;gEAEgE;AAChE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IACvD,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,IAAI,KAAK,CAAA;CACf;;kBAesB,KAAK,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,IAAI;EA6E9E"}
@@ -28,10 +28,12 @@ export function createModelSelection(ctx, deps) {
28
28
  // Restore a recorded pin only when the caller actually adopted that route.
29
29
  const usesRecordedRoute = recorded?.provider === route.provider && recorded?.model === route.model;
30
30
  const ref = {
31
- current: route.provider !== '' && route.model !== '' &&
32
- (!hasCreatedRoute || (usesRecordedRoute &&
33
- (route.provider !== agent.options.provider || route.model !== agent.options.model)))
34
- ? { ...route } : undefined,
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,
35
37
  assembled: undefined,
36
38
  };
37
39
  const lifetime = createChannelOwner();
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,8CAA8C;AAC9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AC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,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 [];
@@ -1 +1 @@
1
- {"version":3,"file":"session-fork.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-fork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAa,KAAK,OAAO,EAAqB,MAAM,0BAA0B,CAAA;AAYrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC,CAAA;AAE/G,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,MAAM,IAAI,OAAO,CAAA;IACjB,oBAAoB,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAA;CACrH,SAEgB,OAAO,CAAC,OAAO,CAAC,CA+FlC"}
1
+ {"version":3,"file":"session-fork.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-fork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAa,KAAK,OAAO,EAAqB,MAAM,0BAA0B,CAAA;AAYrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,KAAK,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC,CAAA;AAE/G,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE;IACJ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;IACpC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,MAAM,IAAI,OAAO,CAAA;IACjB,oBAAoB,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAA;CACrH,SAEgB,OAAO,CAAC,OAAO,CAAC,CAgGlC"}
@@ -67,6 +67,7 @@ export function createForkSessionAction(ctx, state, deps) {
67
67
  runtimeSession: source,
68
68
  inheritedCount: seed.length,
69
69
  cwd: state.cwd,
70
+ parentSession: source.id,
70
71
  agentPreset: forkComposed.agentPreset,
71
72
  agentOptions: { provider: state.provider, model: state.model },
72
73
  setup: forkComposed.setup,
@@ -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,GACT,MAAM,CACT,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,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K,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-metadata.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAoE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAK7H,OAAO,EAAoE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG5H,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAA;AAKnE,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,aAAa,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAA;QACtC,eAAe,EAAE;YAAE,IAAI,EAAE,eAAe,CAAA;SAAE,CAAA;KAC3C;CACF;AAKD,KAAK,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC,CAAA;AAEzE,6EAA6E;AAC7E,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IAC/D,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC,CAAA;IACvD,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,IAAI,MAAM,CAAA;IAClB,KAAK,IAAI,MAAM,CAAA;IACf,0EAA0E;IAC1E,GAAG,CAAC,IAAI,MAAM,CAAA;IACd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QL,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;iCAUvB,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;EAenF"}
@@ -15,6 +15,15 @@ export function createSessionMetadataActions(ctx, deps) {
15
15
  const current = (capture) => deps.owner.current() && deps.binding.isCurrent(capture);
16
16
  const persistence = () => ctx.get('sessionPersistence');
17
17
  const withOwnerSignal = (signal) => signal === undefined ? deps.owner.signal : AbortSignal.any([signal, deps.owner.signal]);
18
+ // The public registry-global getter is independent of workspace sessionIds:
19
+ // archived sessions deliberately retain their workspace accounting slot.
20
+ const archiveProjection = () => {
21
+ const registry = ctx.get('workspaceRegistry');
22
+ // Older hosts lack this capability. A present getter that throws must
23
+ // reject the listing rather than masquerading as an empty archive set.
24
+ const archived = new Set(registry?.archivedSessionIds ?? []);
25
+ return row => ({ ...row, archived: archived.has(row.id) });
26
+ };
18
27
  let lastListing;
19
28
  const remember = (source, rows) => {
20
29
  lastListing = { source: source.identity ?? source, rows };
@@ -25,9 +34,10 @@ export function createSessionMetadataActions(ctx, deps) {
25
34
  return undefined;
26
35
  // Providers without a durable scope still keep same-instance reopen fast.
27
36
  // A replaced service never inherits this in-memory view.
28
- return lastListing?.source === (source.identity ?? source)
37
+ const rows = lastListing?.source === (source.identity ?? source)
29
38
  ? lastListing.rows
30
39
  : readListingSnapshot(source);
40
+ return rows?.map(archiveProjection());
31
41
  };
32
42
  const listing = createSessionListing({
33
43
  owner: deps.owner,
@@ -51,20 +61,23 @@ export function createSessionMetadataActions(ctx, deps) {
51
61
  deps.setPersistedSessions([]);
52
62
  return [];
53
63
  }
64
+ const projectArchive = archiveProjection();
54
65
  let summaries = [];
55
66
  summaries = await listSummaries(source, deps.owner.signal, enriched => {
56
67
  if (!listingCurrent())
57
68
  return;
69
+ enriched = projectArchive(enriched);
58
70
  summaries = summaries.map(row => row.id === enriched.id ? enriched : row);
59
71
  remember(source, summaries);
60
72
  deps.setPersistedSessions(summaries);
61
73
  onEnriched(enriched);
62
74
  }, rows => {
63
75
  if (listingCurrent())
64
- onPartial(rows);
76
+ onPartial(rows.map(projectArchive));
65
77
  }, deps.cwd?.());
66
78
  if (!listingCurrent())
67
79
  return [];
80
+ summaries = summaries.map(projectArchive);
68
81
  remember(source, summaries);
69
82
  deps.setPersistedSessions(summaries);
70
83
  return summaries;
@@ -1,5 +1,5 @@
1
1
  import type { ChannelState } from './types.js';
2
- export type SessionResetState = Pick<ChannelState, 'rows' | 'todos' | 'pending' | 'goal' | 'sessionTitle' | 'sessionColor' | 'tokens' | 'mainCost' | 'subagentCost' | 'responseChars' | 'activeToolCount' | 'lastUserText' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'tps' | 'tpsSamples' | 'lastUsage' | 'turnUsage' | 'contextSegments' | 'costReport'
2
+ export type SessionResetState = Pick<ChannelState, 'rows' | 'todos' | 'pending' | 'goal' | 'sessionTitle' | 'sessionColor' | 'workingDirectory' | 'tokens' | 'mainCost' | 'subagentCost' | 'responseChars' | 'activeToolCount' | 'lastUserText' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'tps' | 'tpsSamples' | 'lastUsage' | 'turnUsage' | 'turnOutcome' | 'contextSegments' | 'costReport'
3
3
  /** Staged "Send to Chat" contexts belong to the composer that staged them:
4
4
  * an adopted session must never carry the previous conversation's chips
5
5
  * (or hand its model a panel context the user staged elsewhere). */
@@ -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,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,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,CAgDN"}
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"}