@deepseek-harness-tui/dsh-tui 0.14.0 → 0.15.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 (735) hide show
  1. package/README.md +73 -14
  2. package/bin/dsh-tui.js +200 -34
  3. package/cordis.patch.yml +16 -52
  4. package/cordis.yml +6 -2
  5. package/guide/dsh-tui-guide/claude-backend.en.md +44 -7
  6. package/guide/dsh-tui-guide/claude-backend.md +28 -6
  7. package/guide/dsh-tui-guide/codex-backend.en.md +34 -7
  8. package/guide/dsh-tui-guide/codex-backend.md +17 -2
  9. package/guide/dsh-tui-guide/configuration.en.md +129 -16
  10. package/guide/dsh-tui-guide/configuration.md +110 -14
  11. package/guide/dsh-tui-guide/interaction.en.md +57 -24
  12. package/guide/dsh-tui-guide/interaction.md +42 -19
  13. package/guide/dsh-tui-guide/plugins.en.md +36 -3
  14. package/guide/dsh-tui-guide/plugins.md +21 -2
  15. package/guide/dsh-tui-guide/themes.en.md +23 -14
  16. package/guide/dsh-tui-guide/themes.md +19 -12
  17. package/guide/dsh-tui-guide/user-guide.en.md +51 -20
  18. package/guide/dsh-tui-guide/user-guide.md +41 -21
  19. package/lib/settings.json +103 -9
  20. package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
  21. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  22. package/lib/types/adapter/channel/ui-policy.js +3 -0
  23. package/lib/types/adapter/channel/ui.d.ts +2 -0
  24. package/lib/types/adapter/channel/ui.d.ts.map +1 -1
  25. package/lib/types/adapter/channel/ui.js +6 -2
  26. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  27. package/lib/types/adapter/kernel/runtime.js +2 -0
  28. package/lib/types/adapter/ports/channel-settings.d.ts +9 -0
  29. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  30. package/lib/types/adapter/ports/channel-ui.d.ts +50 -12
  31. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  32. package/lib/types/adapter/ports/channel-view.d.ts +21 -0
  33. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  34. package/lib/types/adapter/spec/backend-capabilities.d.ts +22 -0
  35. package/lib/types/adapter/spec/backend-capabilities.d.ts.map +1 -0
  36. package/lib/types/adapter/spec/backend-capabilities.js +49 -0
  37. package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -1
  38. package/lib/types/adapter/spec/protocol-constants.js +10 -3
  39. package/lib/types/adapter/spec/tui-contributions.d.ts +3 -0
  40. package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -1
  41. package/lib/types/adapter/spec/tui-contributions.js +7 -0
  42. package/lib/types/adapter/standard/registry.d.ts +6 -0
  43. package/lib/types/adapter/standard/registry.d.ts.map +1 -1
  44. package/lib/types/adapter/standard/registry.js +65 -15
  45. package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -1
  46. package/lib/types/adapter/standard/tui-extension.js +7 -1
  47. package/lib/types/adapter/standard/types.d.ts +10 -1
  48. package/lib/types/adapter/standard/types.d.ts.map +1 -1
  49. package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -1
  50. package/lib/types/adapter/upstream/host-descriptor-driver.js +52 -0
  51. package/lib/types/agent/backend-manifest.d.ts +152 -0
  52. package/lib/types/agent/backend-manifest.d.ts.map +1 -0
  53. package/lib/types/agent/backend-manifest.js +14 -0
  54. package/lib/types/agent/backend.d.ts +71 -5
  55. package/lib/types/agent/backend.d.ts.map +1 -1
  56. package/lib/types/agent/capabilities.d.ts +6 -0
  57. package/lib/types/agent/capabilities.d.ts.map +1 -1
  58. package/lib/types/agent/index.d.ts +2 -0
  59. package/lib/types/agent/index.d.ts.map +1 -1
  60. package/lib/types/agent/refs.d.ts +11 -1
  61. package/lib/types/agent/refs.d.ts.map +1 -1
  62. package/lib/types/agent/starting-session.d.ts +4 -0
  63. package/lib/types/agent/starting-session.d.ts.map +1 -0
  64. package/lib/types/agent/starting-session.js +19 -0
  65. package/lib/types/backends/claude/activity.d.ts +1 -1
  66. package/lib/types/backends/claude/activity.d.ts.map +1 -1
  67. package/lib/types/backends/claude/activity.js +5 -5
  68. package/lib/types/backends/claude/auth.d.ts.map +1 -1
  69. package/lib/types/backends/claude/auth.js +10 -3
  70. package/lib/types/backends/claude/backend.d.ts.map +1 -1
  71. package/lib/types/backends/claude/backend.js +103 -29
  72. package/lib/types/backends/claude/catalog.d.ts +2 -1
  73. package/lib/types/backends/claude/catalog.d.ts.map +1 -1
  74. package/lib/types/backends/claude/catalog.js +15 -5
  75. package/lib/types/backends/claude/channels.d.ts +5 -3
  76. package/lib/types/backends/claude/channels.d.ts.map +1 -1
  77. package/lib/types/backends/claude/channels.js +5 -4
  78. package/lib/types/backends/claude/contract.d.ts +4 -0
  79. package/lib/types/backends/claude/contract.d.ts.map +1 -1
  80. package/lib/types/backends/claude/contract.js +4 -0
  81. package/lib/types/backends/claude/controls.d.ts +4 -0
  82. package/lib/types/backends/claude/controls.d.ts.map +1 -1
  83. package/lib/types/backends/claude/controls.js +34 -42
  84. package/lib/types/backends/claude/dialogs.d.ts +8 -2
  85. package/lib/types/backends/claude/dialogs.d.ts.map +1 -1
  86. package/lib/types/backends/claude/dialogs.js +24 -16
  87. package/lib/types/backends/claude/images.d.ts +1 -1
  88. package/lib/types/backends/claude/images.d.ts.map +1 -1
  89. package/lib/types/backends/claude/images.js +7 -7
  90. package/lib/types/backends/claude/manifest.d.ts +21 -0
  91. package/lib/types/backends/claude/manifest.d.ts.map +1 -0
  92. package/lib/types/backends/claude/manifest.js +29 -0
  93. package/lib/types/backends/claude/older-history.js +2 -2
  94. package/lib/types/backends/claude/permissions.js +11 -11
  95. package/lib/types/backends/claude/prefs.d.ts +4 -2
  96. package/lib/types/backends/claude/prefs.d.ts.map +1 -1
  97. package/lib/types/backends/claude/prefs.js +4 -3
  98. package/lib/types/backends/claude/process.d.ts +16 -4
  99. package/lib/types/backends/claude/process.d.ts.map +1 -1
  100. package/lib/types/backends/claude/process.js +100 -37
  101. package/lib/types/backends/claude/send-message.d.ts +1 -1
  102. package/lib/types/backends/claude/send-message.d.ts.map +1 -1
  103. package/lib/types/backends/claude/session/auth.js +22 -22
  104. package/lib/types/backends/claude/session/channels.d.ts +4 -0
  105. package/lib/types/backends/claude/session/channels.d.ts.map +1 -1
  106. package/lib/types/backends/claude/session/channels.js +5 -3
  107. package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
  108. package/lib/types/backends/claude/session/lifecycle.js +31 -23
  109. package/lib/types/backends/claude/session/store.js +8 -8
  110. package/lib/types/backends/claude/session/subagents.js +2 -2
  111. package/lib/types/backends/claude/session/types.d.ts +7 -0
  112. package/lib/types/backends/claude/session/types.d.ts.map +1 -1
  113. package/lib/types/backends/claude/side-query.js +3 -3
  114. package/lib/types/backends/claude/task-output.js +5 -5
  115. package/lib/types/backends/claude/text.d.ts +778 -0
  116. package/lib/types/backends/claude/text.d.ts.map +1 -0
  117. package/lib/types/backends/claude/text.js +298 -0
  118. package/lib/types/backends/claude/transcript-file.d.ts +1 -1
  119. package/lib/types/backends/claude/transcript-file.d.ts.map +1 -1
  120. package/lib/types/backends/claude/transcript-file.js +4 -4
  121. package/lib/types/backends/claude/translate/attempts.js +2 -2
  122. package/lib/types/backends/claude/translate/core.js +3 -3
  123. package/lib/types/backends/claude/translate/messages.js +4 -4
  124. package/lib/types/backends/claude/translate/system.js +14 -14
  125. package/lib/types/backends/claude/translate/tasks.js +2 -2
  126. package/lib/types/backends/claude/translate/types.d.ts +1 -1
  127. package/lib/types/backends/claude/translate/types.d.ts.map +1 -1
  128. package/lib/types/backends/codex/auth/external-tokens.js +16 -16
  129. package/lib/types/backends/codex/auth/status.js +14 -14
  130. package/lib/types/backends/codex/backend.d.ts +4 -19
  131. package/lib/types/backends/codex/backend.d.ts.map +1 -1
  132. package/lib/types/backends/codex/backend.js +118 -25
  133. package/lib/types/backends/codex/catalog.d.ts +2 -1
  134. package/lib/types/backends/codex/catalog.d.ts.map +1 -1
  135. package/lib/types/backends/codex/catalog.js +63 -18
  136. package/lib/types/backends/codex/channels.d.ts +6 -3
  137. package/lib/types/backends/codex/channels.d.ts.map +1 -1
  138. package/lib/types/backends/codex/channels.js +15 -13
  139. package/lib/types/backends/codex/detect.d.ts.map +1 -1
  140. package/lib/types/backends/codex/detect.js +9 -6
  141. package/lib/types/backends/codex/manifest.d.ts +30 -0
  142. package/lib/types/backends/codex/manifest.d.ts.map +1 -0
  143. package/lib/types/backends/codex/manifest.js +23 -0
  144. package/lib/types/backends/codex/prefs.d.ts +4 -2
  145. package/lib/types/backends/codex/prefs.d.ts.map +1 -1
  146. package/lib/types/backends/codex/prefs.js +4 -3
  147. package/lib/types/backends/codex/rpc/hub.js +2 -2
  148. package/lib/types/backends/codex/session/activity.d.ts +1 -1
  149. package/lib/types/backends/codex/session/activity.d.ts.map +1 -1
  150. package/lib/types/backends/codex/session/activity.js +13 -13
  151. package/lib/types/backends/codex/session/approvals.js +30 -30
  152. package/lib/types/backends/codex/session/commands.d.ts +8 -2
  153. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  154. package/lib/types/backends/codex/session/commands.js +71 -23
  155. package/lib/types/backends/codex/session/controls.d.ts +1 -1
  156. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  157. package/lib/types/backends/codex/session/controls.js +21 -16
  158. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  159. package/lib/types/backends/codex/session/goals.js +3 -3
  160. package/lib/types/backends/codex/session/history.js +2 -2
  161. package/lib/types/backends/codex/session/images.js +8 -8
  162. package/lib/types/backends/codex/session/input.d.ts +6 -2
  163. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  164. package/lib/types/backends/codex/session/input.js +55 -13
  165. package/lib/types/backends/codex/session/plan-review.js +6 -6
  166. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  167. package/lib/types/backends/codex/session/session.js +66 -34
  168. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  169. package/lib/types/backends/codex/session/side-query.js +27 -9
  170. package/lib/types/backends/codex/session/state.d.ts +6 -1
  171. package/lib/types/backends/codex/session/state.d.ts.map +1 -1
  172. package/lib/types/backends/codex/session/subagents.js +5 -5
  173. package/lib/types/backends/codex/session/tasks.js +4 -4
  174. package/lib/types/backends/codex/text.d.ts +933 -0
  175. package/lib/types/backends/codex/text.d.ts.map +1 -0
  176. package/lib/types/backends/codex/text.js +313 -0
  177. package/lib/types/backends/codex/translate/items.js +4 -4
  178. package/lib/types/backends/codex/translate/live.d.ts.map +1 -1
  179. package/lib/types/backends/codex/translate/live.js +11 -8
  180. package/lib/types/backends/codex/translate/notices.js +10 -10
  181. package/lib/types/backends/shared/channel-slug.d.ts +4 -0
  182. package/lib/types/backends/shared/channel-slug.d.ts.map +1 -0
  183. package/lib/types/backends/shared/channel-slug.js +25 -0
  184. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  185. package/lib/types/backends/shared/channel-tokens.js +30 -23
  186. package/lib/types/{channel → backends/shared}/elicitation.d.ts +78 -21
  187. package/lib/types/backends/shared/elicitation.d.ts.map +1 -0
  188. package/lib/types/{channel → backends/shared}/elicitation.js +64 -66
  189. package/lib/types/backends/shared/image-size.d.ts +33 -0
  190. package/lib/types/backends/shared/image-size.d.ts.map +1 -0
  191. package/lib/types/backends/shared/image-size.js +134 -0
  192. package/lib/types/{utils → backends/shared}/jsonl.d.ts +5 -1
  193. package/lib/types/backends/shared/jsonl.d.ts.map +1 -0
  194. package/lib/types/{utils → backends/shared}/jsonl.js +5 -1
  195. package/lib/types/backends/shared/localized-text.d.ts +30 -0
  196. package/lib/types/backends/shared/localized-text.d.ts.map +1 -0
  197. package/lib/types/backends/shared/localized-text.js +24 -0
  198. package/lib/types/backends/shared/platform-text.d.ts +88 -0
  199. package/lib/types/backends/shared/platform-text.d.ts.map +1 -0
  200. package/lib/types/backends/shared/platform-text.js +33 -0
  201. package/lib/types/branding.d.ts +13 -0
  202. package/lib/types/branding.d.ts.map +1 -1
  203. package/lib/types/branding.js +18 -0
  204. package/lib/types/channel/channel-slug.d.ts +3 -1
  205. package/lib/types/channel/channel-slug.d.ts.map +1 -1
  206. package/lib/types/channel/channel-slug.js +3 -1
  207. package/lib/types/channel/sanitize.d.ts +7 -0
  208. package/lib/types/channel/sanitize.d.ts.map +1 -1
  209. package/lib/types/channel/sanitize.js +9 -0
  210. package/lib/types/channel/usage.d.ts.map +1 -1
  211. package/lib/types/channel/usage.js +5 -0
  212. package/lib/types/commands.d.ts +5 -0
  213. package/lib/types/commands.d.ts.map +1 -1
  214. package/lib/types/commands.js +47 -8
  215. package/lib/types/components/AgentMessageComposer.d.ts.map +1 -1
  216. package/lib/types/components/AgentMessageComposer.js +3 -2
  217. package/lib/types/components/BtwPanel.d.ts.map +1 -1
  218. package/lib/types/components/BtwPanel.js +4 -2
  219. package/lib/types/components/Chat/JobCard.js +3 -3
  220. package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
  221. package/lib/types/components/CommandSuggestions.js +20 -6
  222. package/lib/types/components/ContextBarView.d.ts +5 -1
  223. package/lib/types/components/ContextBarView.d.ts.map +1 -1
  224. package/lib/types/components/ContextBarView.js +6 -3
  225. package/lib/types/components/ExtensionDialog.d.ts.map +1 -1
  226. package/lib/types/components/ExtensionDialog.js +2 -3
  227. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  228. package/lib/types/components/GoalTodoPanel.js +14 -3
  229. package/lib/types/components/InlineMathParagraph.js +1 -1
  230. package/lib/types/components/KernelPicker.d.ts.map +1 -1
  231. package/lib/types/components/KernelPicker.js +1 -1
  232. package/lib/types/components/LogoV2.d.ts.map +1 -1
  233. package/lib/types/components/LogoV2.js +9 -6
  234. package/lib/types/components/MarkdownTable.d.ts.map +1 -1
  235. package/lib/types/components/MarkdownTable.js +4 -3
  236. package/lib/types/components/MessageList.d.ts.map +1 -1
  237. package/lib/types/components/MessageList.js +18 -5
  238. package/lib/types/components/ModelPicker.d.ts +24 -31
  239. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  240. package/lib/types/components/ModelPicker.js +115 -40
  241. package/lib/types/components/PromptEditor.d.ts +3 -3
  242. package/lib/types/components/PromptInput.d.ts +21 -3
  243. package/lib/types/components/PromptInput.d.ts.map +1 -1
  244. package/lib/types/components/PromptInput.js +58 -118
  245. package/lib/types/components/SdkInstallWizard.d.ts +3 -1
  246. package/lib/types/components/SdkInstallWizard.d.ts.map +1 -1
  247. package/lib/types/components/SdkInstallWizard.js +8 -1
  248. package/lib/types/components/SearchBox.d.ts +13 -15
  249. package/lib/types/components/SearchBox.d.ts.map +1 -1
  250. package/lib/types/components/SearchBox.js +58 -27
  251. package/lib/types/components/ThemePicker.d.ts +1 -1
  252. package/lib/types/components/ThemePicker.d.ts.map +1 -1
  253. package/lib/types/components/ThemePicker.js +14 -11
  254. package/lib/types/components/Tooltip.js +1 -1
  255. package/lib/types/components/WorkingSpinner.js +1 -1
  256. package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
  257. package/lib/types/components/WorkspaceFlowPicker.js +4 -3
  258. package/lib/types/components/composerImageTokens.d.ts +24 -0
  259. package/lib/types/components/composerImageTokens.d.ts.map +1 -0
  260. package/lib/types/components/composerImageTokens.js +37 -0
  261. package/lib/types/components/design-system/InputCaret.d.ts +7 -0
  262. package/lib/types/components/design-system/InputCaret.d.ts.map +1 -0
  263. package/lib/types/components/design-system/InputCaret.js +9 -0
  264. package/lib/types/components/design-system/ListItem.d.ts +13 -2
  265. package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
  266. package/lib/types/components/design-system/ListItem.js +11 -5
  267. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  268. package/lib/types/components/design-system/ThemeProvider.js +6 -8
  269. package/lib/types/components/kernelCatalog.d.ts +55 -11
  270. package/lib/types/components/kernelCatalog.d.ts.map +1 -1
  271. package/lib/types/components/kernelCatalog.js +42 -23
  272. package/lib/types/components/launchpadActions.d.ts +4 -0
  273. package/lib/types/components/launchpadActions.d.ts.map +1 -1
  274. package/lib/types/components/launchpadActions.js +5 -4
  275. package/lib/types/components/launchpadLayout.d.ts.map +1 -1
  276. package/lib/types/components/launchpadLayout.js +2 -2
  277. package/lib/types/components/messages/UserPromptMessage.d.ts +4 -3
  278. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
  279. package/lib/types/components/messages/UserPromptMessage.js +4 -3
  280. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  281. package/lib/types/components/questions/AskUserQuestionPanel.js +8 -3
  282. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  283. package/lib/types/components/questions/PlanReviewPanel.js +4 -3
  284. package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -1
  285. package/lib/types/components/questions/ProviderModelEditor.js +3 -13
  286. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -1
  287. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  288. package/lib/types/components/sessions/ForeignSessionRow.js +5 -2
  289. package/lib/types/components/sessions/SessionListRow.d.ts +3 -1
  290. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  291. package/lib/types/components/sessions/SessionListRow.js +5 -2
  292. package/lib/types/components/sidePanel/PanelBar.d.ts +1 -0
  293. package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
  294. package/lib/types/components/sidePanel/PanelBar.js +21 -17
  295. package/lib/types/components/sidePanel/SidePanelColumn.d.ts +1 -1
  296. package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
  297. package/lib/types/components/sidePanel/SidePanelColumn.js +2 -1
  298. package/lib/types/components/sidePanel/SidePanelLayout.d.ts +6 -4
  299. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  300. package/lib/types/components/sidePanel/SidePanelLayout.js +33 -7
  301. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +4 -2
  302. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  303. package/lib/types/components/sidePanel/btw/BtwComposer.js +12 -4
  304. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  305. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +59 -15
  306. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  307. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +4 -2
  308. package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +1 -1
  309. package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -1
  310. package/lib/types/components/sidePanel/btw/BtwThreadView.js +12 -6
  311. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -2
  312. package/lib/types/components/sidePanel/types.d.ts +1 -1
  313. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  314. package/lib/types/components/sidePanel/useSidePanel.d.ts +2 -0
  315. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  316. package/lib/types/components/sidePanel/useSidePanel.js +11 -1
  317. package/lib/types/components/splashFonts.d.ts +24 -1
  318. package/lib/types/components/splashFonts.d.ts.map +1 -1
  319. package/lib/types/components/splashFonts.js +40 -5
  320. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +3 -1
  321. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  322. package/lib/types/components/workspaces/HomeWorkspaceRow.js +5 -2
  323. package/lib/types/dsh-adapter/admission-loader.d.ts +20 -0
  324. package/lib/types/dsh-adapter/admission-loader.d.ts.map +1 -0
  325. package/lib/types/dsh-adapter/admission-loader.js +256 -0
  326. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  327. package/lib/types/dsh-adapter/backend/translate.js +3 -0
  328. package/lib/types/dsh-adapter/backend-admission.d.ts +64 -0
  329. package/lib/types/dsh-adapter/backend-admission.d.ts.map +1 -0
  330. package/lib/types/dsh-adapter/backend-admission.js +34 -0
  331. package/lib/types/dsh-adapter/backend-contribution.d.ts +26 -0
  332. package/lib/types/dsh-adapter/backend-contribution.d.ts.map +1 -0
  333. package/lib/types/dsh-adapter/backend-contribution.js +37 -0
  334. package/lib/types/dsh-adapter/backend-registry.d.ts +136 -0
  335. package/lib/types/dsh-adapter/backend-registry.d.ts.map +1 -0
  336. package/lib/types/dsh-adapter/backend-registry.js +285 -0
  337. package/lib/types/dsh-adapter/backends.d.ts +67 -24
  338. package/lib/types/dsh-adapter/backends.d.ts.map +1 -1
  339. package/lib/types/dsh-adapter/backends.generated.d.ts +12 -0
  340. package/lib/types/dsh-adapter/backends.generated.d.ts.map +1 -0
  341. package/lib/types/dsh-adapter/backends.generated.js +6 -0
  342. package/lib/types/dsh-adapter/backends.js +92 -46
  343. package/lib/types/dsh-adapter/channel/action-readiness.d.ts +2 -0
  344. package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
  345. package/lib/types/dsh-adapter/channel/action-readiness.js +9 -3
  346. package/lib/types/dsh-adapter/channel/agent-view-projection.js +2 -2
  347. package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
  348. package/lib/types/dsh-adapter/channel/background-action.js +8 -3
  349. package/lib/types/dsh-adapter/channel/binding-events.d.ts +16 -3
  350. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  351. package/lib/types/dsh-adapter/channel/binding-events.js +18 -46
  352. package/lib/types/dsh-adapter/channel/channel-host.d.ts +45 -0
  353. package/lib/types/dsh-adapter/channel/channel-host.d.ts.map +1 -0
  354. package/lib/types/dsh-adapter/channel/channel-host.js +1 -0
  355. package/lib/types/dsh-adapter/channel/command-completions.d.ts +5 -0
  356. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  357. package/lib/types/dsh-adapter/channel/command-completions.js +16 -0
  358. package/lib/types/dsh-adapter/channel/composer-images.d.ts +4 -2
  359. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  360. package/lib/types/dsh-adapter/channel/composer-images.js +36 -5
  361. package/lib/types/dsh-adapter/channel/cordis-host.d.ts +14 -0
  362. package/lib/types/dsh-adapter/channel/cordis-host.d.ts.map +1 -0
  363. package/lib/types/dsh-adapter/channel/cordis-host.js +35 -0
  364. package/lib/types/dsh-adapter/channel/core/actions.d.ts +3 -3
  365. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  366. package/lib/types/dsh-adapter/channel/core/actions.js +15 -6
  367. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +7 -3
  368. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  369. package/lib/types/dsh-adapter/channel/core/binding-feed.js +3 -0
  370. package/lib/types/dsh-adapter/channel/core/compose.d.ts +12 -28
  371. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  372. package/lib/types/dsh-adapter/channel/core/compose.js +318 -117
  373. package/lib/types/dsh-adapter/channel/core/files.d.ts +7 -2
  374. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  375. package/lib/types/dsh-adapter/channel/core/files.js +1 -0
  376. package/lib/types/dsh-adapter/channel/core/host.d.ts +12 -6
  377. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  378. package/lib/types/dsh-adapter/channel/core/host.js +69 -35
  379. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +5 -3
  380. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  381. package/lib/types/dsh-adapter/channel/core/local-actions.js +5 -2
  382. package/lib/types/dsh-adapter/channel/core/session-controls.js +2 -2
  383. package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +7 -4
  384. package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -1
  385. package/lib/types/dsh-adapter/channel/core/session-switch.js +8 -4
  386. package/lib/types/dsh-adapter/channel/core/sessions.d.ts +1 -1
  387. package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -1
  388. package/lib/types/dsh-adapter/channel/core/sessions.js +75 -16
  389. package/lib/types/dsh-adapter/channel/extensions.d.ts +4 -3
  390. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  391. package/lib/types/dsh-adapter/channel/extensions.js +41 -22
  392. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +2 -2
  393. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  394. package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
  395. package/lib/types/dsh-adapter/channel/job-projection.d.ts +4 -0
  396. package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
  397. package/lib/types/dsh-adapter/channel/job-projection.js +205 -24
  398. package/lib/types/dsh-adapter/channel/mentions.d.ts +3 -3
  399. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  400. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +1 -0
  401. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
  402. package/lib/types/dsh-adapter/channel/mode-permission-actions.js +138 -8
  403. package/lib/types/dsh-adapter/channel/model-actions.d.ts +5 -1
  404. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  405. package/lib/types/dsh-adapter/channel/model-actions.js +40 -28
  406. package/lib/types/dsh-adapter/channel/model-selection.d.ts +17 -0
  407. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -0
  408. package/lib/types/dsh-adapter/channel/model-selection.js +109 -0
  409. package/lib/types/dsh-adapter/channel/model-switch.d.ts +12 -21
  410. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  411. package/lib/types/dsh-adapter/channel/model-switch.js +39 -102
  412. package/lib/types/dsh-adapter/channel/projection.js +1 -1
  413. package/lib/types/dsh-adapter/channel/reports.d.ts +1 -1
  414. package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
  415. package/lib/types/dsh-adapter/channel/reports.js +11 -3
  416. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  417. package/lib/types/dsh-adapter/channel/session-fork.js +33 -20
  418. package/lib/types/dsh-adapter/channel/session-listing.d.ts +20 -0
  419. package/lib/types/dsh-adapter/channel/session-listing.d.ts.map +1 -0
  420. package/lib/types/dsh-adapter/channel/session-listing.js +51 -0
  421. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +3 -1
  422. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  423. package/lib/types/dsh-adapter/channel/session-metadata.js +56 -27
  424. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  425. package/lib/types/dsh-adapter/channel/session-resume.js +15 -8
  426. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  427. package/lib/types/dsh-adapter/channel/session-rewind.js +38 -24
  428. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  429. package/lib/types/dsh-adapter/channel/session-tree-actions.js +38 -24
  430. package/lib/types/dsh-adapter/channel/settings-host.d.ts +2 -2
  431. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  432. package/lib/types/dsh-adapter/channel/settings-host.js +1 -0
  433. package/lib/types/dsh-adapter/channel/state.d.ts +37 -1
  434. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  435. package/lib/types/dsh-adapter/channel/state.js +14 -1
  436. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  437. package/lib/types/dsh-adapter/channel/subagent-projection.js +66 -6
  438. package/lib/types/dsh-adapter/channel/task-completion.d.ts +6 -0
  439. package/lib/types/dsh-adapter/channel/task-completion.d.ts.map +1 -0
  440. package/lib/types/dsh-adapter/channel/task-completion.js +114 -0
  441. package/lib/types/dsh-adapter/channel/transcript.d.ts +1 -1
  442. package/lib/types/dsh-adapter/channel/transcript.js +1 -1
  443. package/lib/types/dsh-adapter/channel/upstream-retry.d.ts +81 -0
  444. package/lib/types/dsh-adapter/channel/upstream-retry.d.ts.map +1 -0
  445. package/lib/types/dsh-adapter/channel/upstream-retry.js +138 -0
  446. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
  447. package/lib/types/dsh-adapter/channel/workspace-actions.js +9 -8
  448. package/lib/types/dsh-adapter/channel-ui.d.ts +3 -1
  449. package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -1
  450. package/lib/types/dsh-adapter/channel-ui.js +4 -2
  451. package/lib/types/dsh-adapter/channel.d.ts +2 -2
  452. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  453. package/lib/types/dsh-adapter/channel.js +19 -5
  454. package/lib/types/dsh-adapter/context-occupancy.d.ts +81 -4
  455. package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
  456. package/lib/types/dsh-adapter/context-occupancy.js +108 -17
  457. package/lib/types/dsh-adapter/contract.d.ts +1 -1
  458. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  459. package/lib/types/dsh-adapter/contract.js +15 -0
  460. package/lib/types/dsh-adapter/entry-slot.d.ts +36 -0
  461. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -0
  462. package/lib/types/dsh-adapter/entry-slot.js +28 -0
  463. package/lib/types/dsh-adapter/fresh-agent.d.ts +22 -0
  464. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -0
  465. package/lib/types/dsh-adapter/fresh-agent.js +221 -0
  466. package/lib/types/dsh-adapter/host-access.d.ts +16 -1
  467. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  468. package/lib/types/dsh-adapter/host-access.js +53 -2
  469. package/lib/types/dsh-adapter/host-contract.d.ts +103 -0
  470. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -0
  471. package/lib/types/dsh-adapter/host-contract.js +76 -0
  472. package/lib/types/dsh-adapter/host-dsh.d.ts +106 -0
  473. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -0
  474. package/lib/types/dsh-adapter/host-dsh.js +466 -0
  475. package/lib/types/dsh-adapter/host-entry.d.ts +9 -0
  476. package/lib/types/dsh-adapter/host-entry.d.ts.map +1 -0
  477. package/lib/types/dsh-adapter/host-entry.js +228 -0
  478. package/lib/types/dsh-adapter/index.d.ts +55 -18
  479. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  480. package/lib/types/dsh-adapter/index.js +59 -7
  481. package/lib/types/dsh-adapter/install/executors.d.ts +44 -0
  482. package/lib/types/dsh-adapter/install/executors.d.ts.map +1 -0
  483. package/lib/types/dsh-adapter/install/executors.js +15 -0
  484. package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts +3 -0
  485. package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -0
  486. package/lib/types/dsh-adapter/install/pnpm-profile-add.js +150 -0
  487. package/lib/types/dsh-adapter/jobs.d.ts +7 -0
  488. package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
  489. package/lib/types/dsh-adapter/jobs.js +13 -0
  490. package/lib/types/dsh-adapter/lite-profile.d.ts +50 -0
  491. package/lib/types/dsh-adapter/lite-profile.d.ts.map +1 -0
  492. package/lib/types/dsh-adapter/lite-profile.js +49 -0
  493. package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -1
  494. package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
  495. package/lib/types/dsh-adapter/migrate/parse/jsonl.js +4 -3
  496. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  497. package/lib/types/dsh-adapter/oauth/profiles.js +5 -1
  498. package/lib/types/dsh-adapter/panels.d.ts +7 -0
  499. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  500. package/lib/types/dsh-adapter/panels.js +35 -2
  501. package/lib/types/dsh-adapter/plugin-completions.d.ts +32 -0
  502. package/lib/types/dsh-adapter/plugin-completions.d.ts.map +1 -0
  503. package/lib/types/dsh-adapter/plugin-completions.js +80 -0
  504. package/lib/types/dsh-adapter/plugin-declaration.d.ts +21 -0
  505. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -0
  506. package/lib/types/dsh-adapter/plugin-declaration.js +53 -0
  507. package/lib/types/dsh-adapter/plugin-host.d.ts +13 -2
  508. package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
  509. package/lib/types/dsh-adapter/plugin-host.js +34 -8
  510. package/lib/types/dsh-adapter/plugin-manager.d.ts +68 -0
  511. package/lib/types/dsh-adapter/plugin-manager.d.ts.map +1 -0
  512. package/lib/types/dsh-adapter/plugin-manager.js +51 -0
  513. package/lib/types/dsh-adapter/plugin.d.ts +50 -1
  514. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  515. package/lib/types/dsh-adapter/plugin.js +870 -233
  516. package/lib/types/dsh-adapter/plugins-info.d.ts +44 -8
  517. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  518. package/lib/types/dsh-adapter/plugins-info.js +354 -34
  519. package/lib/types/dsh-adapter/process-exit.d.ts +43 -0
  520. package/lib/types/dsh-adapter/process-exit.d.ts.map +1 -0
  521. package/lib/types/dsh-adapter/process-exit.js +60 -0
  522. package/lib/types/dsh-adapter/root-dispose.d.ts +18 -0
  523. package/lib/types/dsh-adapter/root-dispose.d.ts.map +1 -0
  524. package/lib/types/dsh-adapter/root-dispose.js +28 -0
  525. package/lib/types/dsh-adapter/session-list-metadata.d.ts +20 -0
  526. package/lib/types/dsh-adapter/session-list-metadata.d.ts.map +1 -0
  527. package/lib/types/dsh-adapter/session-list-metadata.js +56 -0
  528. package/lib/types/dsh-adapter/session-seed.d.ts +11 -0
  529. package/lib/types/dsh-adapter/session-seed.d.ts.map +1 -0
  530. package/lib/types/dsh-adapter/session-seed.js +47 -0
  531. package/lib/types/dsh-adapter/sessions/list.d.ts +3 -1
  532. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
  533. package/lib/types/dsh-adapter/sessions/list.js +11 -5
  534. package/lib/types/dsh-adapter/sessions/snapshot.d.ts +0 -2
  535. package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -1
  536. package/lib/types/dsh-adapter/sessions/snapshot.js +7 -70
  537. package/lib/types/dsh-adapter/startup-args.d.ts +2 -0
  538. package/lib/types/dsh-adapter/startup-args.d.ts.map +1 -1
  539. package/lib/types/dsh-adapter/startup-args.js +5 -0
  540. package/lib/types/dsh-adapter/subagents.d.ts +33 -1
  541. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  542. package/lib/types/dsh-adapter/subagents.js +110 -8
  543. package/lib/types/dsh-adapter/tui-settings.d.ts +57 -0
  544. package/lib/types/dsh-adapter/tui-settings.d.ts.map +1 -0
  545. package/lib/types/dsh-adapter/tui-settings.js +199 -0
  546. package/lib/types/effortPrefs.d.ts +6 -3
  547. package/lib/types/effortPrefs.d.ts.map +1 -1
  548. package/lib/types/effortPrefs.js +7 -4
  549. package/lib/types/hostEntryRoute.d.ts +18 -0
  550. package/lib/types/hostEntryRoute.d.ts.map +1 -0
  551. package/lib/types/hostEntryRoute.js +57 -0
  552. package/lib/types/i18n.d.ts +363 -1432
  553. package/lib/types/i18n.d.ts.map +1 -1
  554. package/lib/types/i18n.js +155 -385
  555. package/lib/types/ink/components/AlternateScreen.js +2 -2
  556. package/lib/types/ink/components/App.d.ts +1 -0
  557. package/lib/types/ink/components/App.d.ts.map +1 -1
  558. package/lib/types/ink/components/App.js +16 -4
  559. package/lib/types/ink/components/CursorDeclarationContext.d.ts +9 -0
  560. package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -1
  561. package/lib/types/ink/components/CursorDeclarationContext.js +2 -0
  562. package/lib/types/ink/hooks/use-copy-on-select.d.ts +2 -2
  563. package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
  564. package/lib/types/ink/hooks/use-copy-on-select.js +13 -7
  565. package/lib/types/ink/hooks/use-declared-cursor.d.ts +11 -3
  566. package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -1
  567. package/lib/types/ink/hooks/use-declared-cursor.js +30 -10
  568. package/lib/types/ink/ink.d.ts +22 -17
  569. package/lib/types/ink/ink.d.ts.map +1 -1
  570. package/lib/types/ink/ink.js +151 -40
  571. package/lib/types/ink/kitty-graphics.d.ts +2 -0
  572. package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
  573. package/lib/types/ink/kitty-graphics.js +6 -1
  574. package/lib/types/ink/node-cache.d.ts +2 -1
  575. package/lib/types/ink/node-cache.d.ts.map +1 -1
  576. package/lib/types/ink/output.d.ts +10 -4
  577. package/lib/types/ink/output.d.ts.map +1 -1
  578. package/lib/types/ink/output.js +14 -10
  579. package/lib/types/ink/render-node-to-output.d.ts +5 -2
  580. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  581. package/lib/types/ink/render-node-to-output.js +27 -9
  582. package/lib/types/ink/renderer.d.ts +1 -0
  583. package/lib/types/ink/renderer.d.ts.map +1 -1
  584. package/lib/types/ink/renderer.js +4 -3
  585. package/lib/types/ink/root.d.ts +4 -1
  586. package/lib/types/ink/root.d.ts.map +1 -1
  587. package/lib/types/ink/screen.d.ts +4 -2
  588. package/lib/types/ink/screen.d.ts.map +1 -1
  589. package/lib/types/ink/selection.d.ts +10 -1
  590. package/lib/types/ink/selection.d.ts.map +1 -1
  591. package/lib/types/ink/selection.js +94 -25
  592. package/lib/types/ink/stdin-handoff.d.ts +11 -0
  593. package/lib/types/ink/stdin-handoff.d.ts.map +1 -0
  594. package/lib/types/ink/stdin-handoff.js +20 -0
  595. package/lib/types/ink/styles.d.ts +2 -1
  596. package/lib/types/ink/styles.d.ts.map +1 -1
  597. package/lib/types/ink/terminal-image.d.ts +6 -4
  598. package/lib/types/ink/terminal-image.d.ts.map +1 -1
  599. package/lib/types/ink/terminal-image.js +16 -39
  600. package/lib/types/ink/terminal-notification.d.ts +8 -0
  601. package/lib/types/ink/terminal-notification.d.ts.map +1 -0
  602. package/lib/types/ink/terminal-notification.js +83 -0
  603. package/lib/types/ink/terminal.d.ts +9 -0
  604. package/lib/types/ink/terminal.d.ts.map +1 -1
  605. package/lib/types/ink/terminal.js +34 -1
  606. package/lib/types/ink/termio/csi.d.ts +11 -0
  607. package/lib/types/ink/termio/csi.d.ts.map +1 -1
  608. package/lib/types/ink/termio/csi.js +13 -0
  609. package/lib/types/ink/update-overflow-guard.d.ts +6 -0
  610. package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
  611. package/lib/types/ink/update-overflow-guard.js +17 -0
  612. package/lib/types/ink/wrap-text.d.ts +6 -0
  613. package/lib/types/ink/wrap-text.d.ts.map +1 -1
  614. package/lib/types/ink/wrap-text.js +17 -0
  615. package/lib/types/kernelPrefs.d.ts +129 -16
  616. package/lib/types/kernelPrefs.d.ts.map +1 -1
  617. package/lib/types/kernelPrefs.js +98 -35
  618. package/lib/types/math/inline-layout.d.ts +2 -0
  619. package/lib/types/math/inline-layout.d.ts.map +1 -1
  620. package/lib/types/math/inline-layout.js +5 -27
  621. package/lib/types/modelGroups.d.ts +15 -27
  622. package/lib/types/modelGroups.d.ts.map +1 -1
  623. package/lib/types/modelGroups.js +17 -31
  624. package/lib/types/modelPrefs.d.ts +5 -4
  625. package/lib/types/modelPrefs.d.ts.map +1 -1
  626. package/lib/types/modelPrefs.js +5 -4
  627. package/lib/types/modelRoute.d.ts +23 -9
  628. package/lib/types/modelRoute.d.ts.map +1 -1
  629. package/lib/types/modelRoute.js +25 -11
  630. package/lib/types/permissionPrefs.d.ts +34 -0
  631. package/lib/types/permissionPrefs.d.ts.map +1 -0
  632. package/lib/types/permissionPrefs.js +61 -0
  633. package/lib/types/plugin-host.d.ts +1 -0
  634. package/lib/types/plugin-host.d.ts.map +1 -1
  635. package/lib/types/presetPrefs.d.ts +17 -3
  636. package/lib/types/presetPrefs.d.ts.map +1 -1
  637. package/lib/types/presetPrefs.js +20 -3
  638. package/lib/types/reload.d.ts +6 -10
  639. package/lib/types/reload.d.ts.map +1 -1
  640. package/lib/types/reload.js +14 -14
  641. package/lib/types/screens/Chat.d.ts +22 -15
  642. package/lib/types/screens/Chat.d.ts.map +1 -1
  643. package/lib/types/screens/Chat.js +442 -272
  644. package/lib/types/screens/Launchpad.d.ts +27 -17
  645. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  646. package/lib/types/screens/Launchpad.js +241 -78
  647. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  648. package/lib/types/screens/SessionSupervisor.js +53 -12
  649. package/lib/types/screens/Settings.d.ts.map +1 -1
  650. package/lib/types/screens/Settings.js +6 -0
  651. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  652. package/lib/types/screens/StatusLine.js +24 -7
  653. package/lib/types/screens/StatusMetrics.d.ts +46 -1
  654. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  655. package/lib/types/screens/StatusMetrics.js +72 -0
  656. package/lib/types/screens/chat/useKernelPicker.d.ts +8 -4
  657. package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -1
  658. package/lib/types/screens/chat/useKernelPicker.js +61 -21
  659. package/lib/types/screens/chat/useModelPicker.d.ts +42 -0
  660. package/lib/types/screens/chat/useModelPicker.d.ts.map +1 -0
  661. package/lib/types/screens/chat/useModelPicker.js +182 -0
  662. package/lib/types/screens/chatOverlay.d.ts +11 -4
  663. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  664. package/lib/types/screens/chatOverlay.js +0 -1
  665. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +4 -1
  666. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  667. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +26 -5
  668. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  669. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  670. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +51 -29
  671. package/lib/types/sessionHistory.d.ts +5 -0
  672. package/lib/types/sessionHistory.d.ts.map +1 -1
  673. package/lib/types/sessionHistory.js +5 -0
  674. package/lib/types/sessions/listSnapshot.d.ts +6 -0
  675. package/lib/types/sessions/listSnapshot.d.ts.map +1 -0
  676. package/lib/types/sessions/listSnapshot.js +67 -0
  677. package/lib/types/settings/definitions.d.ts +50 -0
  678. package/lib/types/settings/definitions.d.ts.map +1 -1
  679. package/lib/types/settings/definitions.js +42 -8
  680. package/lib/types/terminal-utils/cjk-emphasis.d.ts +28 -0
  681. package/lib/types/terminal-utils/cjk-emphasis.d.ts.map +1 -0
  682. package/lib/types/terminal-utils/cjk-emphasis.js +31 -0
  683. package/lib/types/terminal-utils/markdown.d.ts +3 -1
  684. package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
  685. package/lib/types/terminal-utils/markdown.js +7 -2
  686. package/lib/types/theme.d.ts +29 -12
  687. package/lib/types/theme.d.ts.map +1 -1
  688. package/lib/types/theme.js +310 -23
  689. package/lib/types/themeCatalog.d.ts.map +1 -1
  690. package/lib/types/themeCatalog.js +21 -2
  691. package/lib/types/tips.js +4 -4
  692. package/lib/types/tuiSettingsFile.d.ts +56 -0
  693. package/lib/types/tuiSettingsFile.d.ts.map +1 -0
  694. package/lib/types/tuiSettingsFile.js +206 -0
  695. package/lib/types/ui.d.ts +2 -0
  696. package/lib/types/ui.d.ts.map +1 -1
  697. package/lib/types/ui.js +2 -0
  698. package/lib/types/update.d.ts +72 -26
  699. package/lib/types/update.d.ts.map +1 -1
  700. package/lib/types/update.js +131 -43
  701. package/lib/types/utils/bmp.d.ts +7 -0
  702. package/lib/types/utils/bmp.d.ts.map +1 -1
  703. package/lib/types/utils/bmp.js +27 -0
  704. package/lib/types/utils/bootTrace.d.ts +2 -0
  705. package/lib/types/utils/bootTrace.d.ts.map +1 -0
  706. package/lib/types/utils/bootTrace.js +20 -0
  707. package/lib/types/utils/clipboard.d.ts.map +1 -1
  708. package/lib/types/utils/clipboard.js +11 -3
  709. package/lib/types/utils/credentials.d.ts +14 -2
  710. package/lib/types/utils/credentials.d.ts.map +1 -1
  711. package/lib/types/utils/credentials.js +34 -11
  712. package/lib/types/utils/imageResize.d.ts +10 -20
  713. package/lib/types/utils/imageResize.d.ts.map +1 -1
  714. package/lib/types/utils/imageResize.js +61 -134
  715. package/lib/types/utils/inputPaste.d.ts +2 -2
  716. package/lib/types/utils/inputPaste.js +2 -2
  717. package/lib/types/utils/pastedImagePath.d.ts +5 -0
  718. package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
  719. package/lib/types/utils/pastedImagePath.js +33 -0
  720. package/package.json +36 -6
  721. package/presets/winbash.mjs +716 -0
  722. package/tui-profile/protocols/profile-definitions.d.ts +1 -0
  723. package/tui-profile/protocols/profile-definitions.js +14 -0
  724. package/tui-profile/protocols/tui-contributions.d.ts +55 -0
  725. package/tui-profile/protocols/tui-contributions.js +141 -0
  726. package/tui-profile/registry/contracts/backend-v1alpha1.json +13 -0
  727. package/tui-profile/registry/registry-0.15.json +12 -0
  728. package/lib/types/backends/claude/install.d.ts +0 -15
  729. package/lib/types/backends/claude/install.d.ts.map +0 -1
  730. package/lib/types/backends/claude/install.js +0 -91
  731. package/lib/types/channel/elicitation.d.ts.map +0 -1
  732. package/lib/types/dsh-adapter/channel/session-lineage.d.ts +0 -42
  733. package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +0 -1
  734. package/lib/types/dsh-adapter/channel/session-lineage.js +0 -51
  735. package/lib/types/utils/jsonl.d.ts.map +0 -1
package/README.md CHANGED
@@ -17,23 +17,27 @@
17
17
 
18
18
  # dsh-TUI
19
19
 
20
- > An interactive terminal UI plugin for DeepSeek Harness. It ships a
21
- > pixel-whale header, live work status, streaming thinking, double-Esc time
22
- > rewind, a context progress bar, and a TPS gauge. It mounts as a pure plugin,
23
- > with no core changes. Install to enable; uninstall leaves no patches behind.
20
+ > An interactive terminal UI for DeepSeek Harness. It ships a pixel-whale
21
+ > header, live work status, streaming thinking, double-Esc time rewind, a
22
+ > context progress bar, and a TPS gauge. Zero core changes: it consumes only
23
+ > DSH's public exports, and is moving from a mounted plugin to an app with its
24
+ > own entry and composition root, where DSH loads in process as the first-party
25
+ > backend. Install to enable; uninstall leaves no patches behind.
24
26
 
25
27
  ## Highlights
26
28
 
27
29
  - **Pixel whale pet** — three startup intros, click to wake; freezes after the first task.
28
- - **Launchpad and first-run guide** — every launch lands on a landing page with a **real input box** (big text + whale + quick actions, dropping whole blocks on short/narrow terminals); the first run walks a four-step wizard (API key / language+theme / model+workspace / shortcuts), re-runnable with `/setup`.
30
+ - **Launchpad and first-run guide** — every ordinary launch lands on a landing page with a **real input box** (big text + whale + quick actions, dropping whole blocks on short/narrow terminals; on by default — /settings `launchpad` off boots straight into chat); command completion matches chat: `Tab` fills the input, `Enter` runs the command and clears it. The first run walks a four-step wizard (API key / language+theme / model+workspace / shortcuts), re-runnable with `/setup`.
29
31
  - **Terminal-native UI** — streaming Markdown, tool cards, `/` and `@` completion, `#L12-14` ranges, history search, zh/en UI.
30
- - **Images** — Kitty/Sixel thumbnails, centered preview with zoom and pan, paste-time fitting, text fallback.
32
+ - **Task completion notifications** — DSH, Claude and Codex notify after successful live work settles, with no queued follow-up or active goal. The title is “dsh-TUI · Task complete”; the body shows the latest settled reply as a single-line plain-text preview (Markdown formatting removed, up to 200 characters). OSC 777/9 apply an additional 2048-byte sequence budget, including title and protocol bytes, preserving whole graphemes. No reply shows only the title; BEL only rings. `/settings` → Conversation: `taskNotifications` = `unfocused` (default), `always`, or `off`; `notificationMethod` = `auto` (default), `osc9`, or `bel`. Auto uses separate title/body fields on Ghostty/WezTerm (OSC 777) and Kitty (OSC 99); iTerm2/Warp and explicit `osc9` use a title prefix; other terminals ring the bell; delivery follows your terminal's notification/bell settings. tmux requires `set -g allow-passthrough on` for OSC notifications and `set -g focus-events on` for focus reporting. Terminals without focus reporting need `always`. Replay, cancellation and failures do not notify. Works in inline and fullscreen modes.
33
+ - **Native cursor** — focused text inputs inherit your terminal's cursor shape, color, blinking, and enabled animation or trail effects in both inline and fullscreen modes. The `/model` picker shows the same cursor during movement between provider tabs, model rows, and effort levels, then hides it after **0.5 seconds at rest**; clipped regions fall back to the model row. The session manager also moves this cursor between the workspace rail, session rows, and search box; typing claims the search caret, and navigation returns it to the focused row. Configure animation and trail effects in your terminal.
34
+ - **Images** — Kitty/Sixel thumbnails, centered preview with zoom and pan, paste-time fitting, text fallback. Kitty images scale to the reserved cells' physical pixels, including on HiDPI terminals.
31
35
  - **Mermaid diagrams** — ````mermaid ```` fences drawn as Unicode diagrams.
32
36
  - **LaTeX math** — `$…$` and `$$…$$` formulas as Unicode text, fractions and limits stacked in display blocks; `mathRendering: image` typesets block and one-row inline formulas as terminal images on graphics terminals.
33
37
  - **Timeline rail** — every turn clickable; timeline / scrollbar / hidden gutter.
34
- - **Side panel** — `Ctrl+B` splits the chat with a panel column once the terminal is wide enough; all eight built-in panels are enabled by default. Narrow terminals and inline mode keep full-screen panels.
38
+ - **Side panel** — `Ctrl+B` splits the chat with a panel column once the terminal is wide enough; drag the divider to resize it. All eight built-in panels are enabled by default. The header shows each inactive panel's symbol; hover to see its name. Narrow terminals and inline mode keep full-screen panels.
35
39
  - **Live state** — activity animation, context bar, TPS, cache hit rate, effort, tokens, session cost estimate (main + subagents), Git and session metadata.
36
- Context-bar fill follows backend occupancy; colors estimate content composition. Compaction clears obsolete estimates, and missing composition displays a single used block.
40
+ Context-bar fill follows backend occupancy; colors estimate content composition. Compaction clears obsolete estimates, and missing composition displays a single used block with a measured used count in both hover details.
37
41
  - **One session manager** — `/resume` `/home` `/agentview` `/bg` `⌸`.
38
42
  - **Session workflow** — `/new` `/compact` `/export` `/btw`, model hot-switch, fork, rewind, vim, fullscreen draft editor.
39
43
  - **IDE selection channel** — a VS Code selection lands in the prompt.
@@ -103,6 +107,10 @@ IDs. It requires matching profile dependencies with `@deepseek-ai/schemastery`
103
107
  3.18.3 or newer; an incompatible schema stops TUI startup with repair guidance
104
108
  instead of showing an uneditable settings page. Older hosts keep their legacy settings scope.
105
109
 
110
+ The `dsh-tui` section of `/settings` is saved in `~/.dsh-tui/settings.json`, shared by
111
+ every kernel; the first launch imports it once from the profile's `cordis.patch.yml` (and an older host's `~/.dsh/settings.yaml`)
112
+ (see [configuration](docs/configuration.en.md#tui-configuration)).
113
+
106
114
  ```sh
107
115
  # Install the CLI and this plugin globally (ships the dsh-tui command)
108
116
  npm install -g @deepseek-ai/dsh @deepseek-harness-tui/dsh-tui
@@ -172,6 +180,18 @@ Full guide: [Session migration](docs/migrate.en.md).
172
180
 
173
181
  **VS Code**: use the integrated terminal or the `dsh-tui-vscode` extension. See [VS Code guide](docs/vscode.en.md). **Herdr**: run `dsh-tui` in a [Herdr](https://herdr.dev) pane; `idle` / `working` / `blocked` are reported through its local integration API.
174
182
 
183
+ Bare `--resume` (`-c`, `--continue`) reopens the last session of the backend this
184
+ launch selected. Startup recovery only ever targets that backend: a backend with no
185
+ last session, or a derived target that belongs to a different backend than the one
186
+ that actually booted (an unknown backend id falling back to DSH, `--backend` naming
187
+ a backend that is not installed, a remembered kernel that is not the marker's
188
+ source), refuses with a clear error and exit code 1 — never a silent cold start,
189
+ never another backend's session, never a new session. An explicit `--resume <id>`
190
+ passes that id to the selected backend as-is. The one exception is safe mode's
191
+ "retry normal startup": it retries the kernel and session recorded in
192
+ `last-run.json`, so a record whose backend is gone degrades to a warning plus a cold
193
+ start — that retry is the last way back.
194
+
175
195
  ### Experimental: Claude backend
176
196
 
177
197
  dsh-TUI can also run its session on Claude: the same interface, driving the
@@ -188,11 +208,15 @@ The easiest install: open the kernel picker (the launchpad "Kernel" entry or
188
208
  `/kernel`) and press Enter on the dim Claude row — the wizard locates the
189
209
  profile directory and installs the pinned SDK for you; the command above is
190
210
  its manual equivalent.
211
+ The confirmation shows the exact package and version. Closing the wizard,
212
+ including clicking outside it on the launchpad, cancels a pending installation.
191
213
 
192
214
  - **Sign-in**: a `/channel` relay profile, your dsh-auth `anthropic` sign-in
193
215
  (`/login`), `ANTHROPIC_API_KEY` or cloud-provider variables, or an existing
194
- `claude login`, in that order. A `claude` on `PATH` is used when present,
195
- otherwise the SDK's bundled binary.
216
+ `claude login`, in that order. A `claude` on `PATH` is used when present, then
217
+ one in the native install directory under your home (`~/.local/bin`, or
218
+ `%USERPROFILE%\.local\bin` on Windows); every candidate has to launch and
219
+ report a version, and the SDK's bundled binary is used only when none does.
196
220
  - **Works**: streaming, tool cards, approvals and questions, `/model`,
197
221
  `/effort`, Claude's permission modes (`/permission`, `Shift+Tab`),
198
222
  `/compact`, `/context`, `/mcp`, `/resume`, `/fork`, double-`Esc` rewind,
@@ -200,6 +224,11 @@ its manual equivalent.
200
224
  - **Not available**: DSH-only commands such as `/tree`, `/preset`,
201
225
  `/provider`, `/workspace`, `/agentview` and `/bg`. One process runs one
202
226
  backend; `/kernel` switches by restarting into a new session.
227
+ - **Startup**: the screen appears before the session opens, with only a light
228
+ profile composed (this package plus the profile's third-party plugins); see
229
+ [Claude backend](docs/claude-backend.en.md#known-limitations). The DSH kernel
230
+ starts from the same entry and loads DSH in the same process behind its first
231
+ screen; `DSH_TUI_HOST_ENTRY=0` restores the old launch path for every kernel.
203
232
 
204
233
  Details and known limitations: [Claude backend](docs/claude-backend.en.md).
205
234
 
@@ -230,7 +259,13 @@ settings are respected, not overwritten with defaults. `/login` offers
230
259
  ChatGPT OAuth, a device code or an API key (the last writes to Codex’s own
231
260
  credential store). Relay `/channel` connections take precedence; managed
232
261
  subscription tokens are only injected on first-party routes. dsh-TUI does
233
- not write `~/.codex/config.toml` or log out your native Codex account.
262
+ not write `~/.codex/config.toml` or log out your native Codex account. A
263
+ provider `env_key` from your own config (e.g. `DEEPSEEK_API_KEY`) that the
264
+ shell did not export is injected from the DSH credential store when the ref
265
+ is stored there — the active store first, then the default `~/.dsh` one — so
266
+ keep the key in the store, no per-shell export needed. When nothing can
267
+ supply it, the session still starts and the reason is reported once as a
268
+ start notice: Codex itself rejects every turn of that provider.
234
269
 
235
270
  TPS includes hidden reasoning time and excludes tool execution time. Live
236
271
  text estimates are corrected when Codex reports output token usage.
@@ -251,6 +286,10 @@ OpenAI’s terms. Full instructions and current boundaries:
251
286
 
252
287
  `Enter` send · `Tab` complete · `Ctrl+Enter` interrupt and send · `Alt+Up` recall the last message · `Esc` dismiss, double-`Esc` rewinds · `Ctrl+B` side panel · `Ctrl+O` details · `Ctrl+R` history (`↑`/`↓` and `Ctrl+R` are scoped to the current project) · `Ctrl+V` paste · `Ctrl+Shift+E` fullscreen draft editor · `?` shortcuts · `←` open the session manager (DSH backgrounds the current session first).
253
288
 
289
+ Text, cursor position and staged image attachments on the launchpad or in chat while the backend starts are preserved when the session becomes ready. Press `Enter` after it is ready to send; an earlier `Enter` preserves the draft without queuing it. Opening a new session while startup is pending clears the previous draft and its images.
290
+
291
+ The goal bar stays on one summary line: hovering truncated goal text in fullscreen or split shows the whole objective, and a bare `/goal` prints the full status — objective, phase, rounds or budget, available commands — as a transcript block in the `/plugins` shape. Inline mode sees no pointer events, so that block is how its users read a long objective.
292
+
254
293
  While the model is working: `Enter` steers, `Tab` queues a follow-up, `Ctrl+Enter` interrupts and sends. Input that names a command is still a command — with or without arguments — so `/model` or `/new` reach their own gate (and the `/` overlay sinks the commands that affect the running conversation) instead of silently becoming an interruption; only text that is not a command — and a direct skill gesture such as `/skill-name …` — steers.
255
294
 
256
295
  On native Windows, fragmented Win32 input records are reassembled across short input delays instead of appearing as numeric protocol text. The platform check only reports that this machine might run the private mode (win32-input-mode); a bare `ESC[` fragment is held only after one record has actually been decoded, while a fragment whose own shape is already record-specific holds on its own (which is how even the first record can survive a split). Windows terminals that never enter the mode (mintty, GitBash) therefore keep the classic VT path: a lone `Esc` keeps its normal response time, and a letter typed after a timed-out `ESC[` is not swallowed.
@@ -271,9 +310,13 @@ Fragmented SGR mouse reports no longer land in the prompt as text: an incomplete
271
310
 
272
311
  Mouse (fullscreen): drag to select and copy, double/triple click to select a word or line, click tool cards, timeline ticks and `[Image #N]` previews.
273
312
 
313
+ Automatic copies keep the text selected; press `Esc` to clear it or start a new selection to replace it. Selection highlighting skips trailing padding and blank rows while preserving spaces within text and code indentation. Inline mode uses the terminal's native selection.
314
+
315
+ During a fullscreen text drag, the native cursor follows the selected text's edge using your terminal's enabled cursor animation or trail effects. Moving into trailing padding or blank rows keeps it at the nearest selected text edge. Releasing or cancelling the drag restores the focused input's caret.
316
+
274
317
  File paths in prose can open the file-action menu; automatic detection does not extract a path from inside a slash-delimited token such as `working/idle/needs-input` or a date such as `2024/01/15`.
275
318
 
276
- **Pasting**: native and bracketed paste keeps ordinary text and newlines, and never submits itself on arrival. On Windows terminals that deliver a paste as win32-input-mode key records, a record stream leaked into the payload is decoded back into the characters its `Uc` field encodes — newlines included — so the composer's line count matches what was pasted; only records with no character meaning are stripped (a multi-line paste no longer leaves stray `_`), and a complete record is always consumed before an ESC-less tail, so no payload character is deleted along with an orphan escape. Pasted CRLF collapses to a single newline; genuine underscores and bracketed-paste text are untouched.
319
+ **Pasting**: the launchpad accepts clipboard images and pasted image paths as `[Image #N]` attachments; `Enter` sends them with the first message. Commands that do not accept images preserve the draft and its attachments. Image chips behave like chat: arrows step across them, Backspace at the end or Delete at the start removes the whole image, and Ctrl+W never splits a chip. Text pasted on the launchpad is folded to one line. In chat, native and bracketed paste keeps ordinary text and newlines, and never submits itself on arrival. On Windows terminals that deliver a paste as win32-input-mode key records, a record stream leaked into the payload is decoded back into the characters its `Uc` field encodes — newlines included — so the composer's line count matches what was pasted; only records with no character meaning are stripped (a multi-line paste no longer leaves stray `_`), and a complete record is always consumed before an ESC-less tail, so no payload character is deleted along with an orphan escape. Pasted CRLF collapses to a single newline; genuine underscores and bracketed-paste text are untouched.
277
320
 
278
321
  **Dropped files**: a native Windows desktop drop (Windows Terminal / OpenConsole) arrives as an OSC 8 hyperlink; the parser restores its `file://` URI to a decoded local path before paste hygiene runs, so the `]8;id=…;` parameter bytes never reach the draft. Image paths enter the existing image staging pipeline; other files are inserted as a referenceable path (a path containing whitespace arrives in the composer's quoted `"…"` single-token form). Only `file://` URIs are restored, and it is fail-closed: a remote authority/UNC, a payload carrying several distinct URIs, or a URI that carries several tokens is refused and stays literal text rather than guessed.
279
322
 
@@ -283,9 +326,17 @@ Full reference: [Interaction and commands](docs/interaction.en.md).
283
326
 
284
327
  `/resume` · `/home` · `/agentview` · `/bg` · `⌸` open the same session manager: workspace rail, live state, filter, ★ pins. Also `/model` `/new` `/compact` `/export` `/btw` `/tree` `/fork` `/rewind` `/settings` `/setup` `/status` `/cost` `/jobs` `/skills` `/mcp` `/provider` `/auth` `/login` `/update`.
285
328
 
329
+ `/dsh`, `/codex`, and `/claude` switch directly to the named kernel, just like choosing it in `/kernel`: the choice is remembered and the process restarts into a new session. A running turn blocks switching; choosing the current kernel keeps the session. Availability checks and the Claude install wizard follow the same picker flow.
330
+
331
+ `/model` shows models and reasoning effort on one page. DSH has provider tabs with **Recently used** first, moving the current model to the top; `Tab` / `Shift+Tab` select the next / previous provider. Codex and Claude open their model catalogs directly, without provider or recents tabs. `↑/↓` select a model, `←/→` adjust its effort, `Enter` applies the model and any explicit effort draft, and `Esc` cancels. Changing only the model preserves the backend's preference handling. Mouse users can click the available tabs, models, effort levels, and select/cancel hints; clicking an effort level immediately applies the focused model and that effort and closes the picker. The wheel moves through models.
332
+
333
+ Short terminals keep the focused model and select/cancel actions visible, hiding descriptions and neighboring models first, then the effort row when only two rows remain.
334
+ Shortcuts sit below the title and effort levels have their own section; DSH, Claude, and Codex use the terminal background while covering the text underneath.
335
+
286
336
  In `/provider`'s model list, focus a model and press `Tab` to edit its context window, max output tokens, reasoning efforts, and image input capability.
287
337
 
288
- The session manager paints the last successful list immediately while it checks the persistence store for changes. Titles that require a deeper log scan appear first with a fallback name and update in place when recovery finishes.
338
+ The session manager focuses the most recently used session in the current workspace; if there is no history, it focuses the new-session card. Moving between the workspace rail and session list preserves the selected session, including when the mouse enters the list. Switching to another workspace selects its latest session; switching back also starts from its latest session instead of restoring an earlier selection. Press `←` to move to the workspace rail. DST preloads the session list in the background after startup and updates the cache on success. The manager paints the last successful list immediately. Opening `/resume` while that read is pending shares the request and receives results that have already arrived. This first-paint snapshot survives restarts on DSH, Claude and Codex and is isolated by backend and storage directory. With or without a snapshot, all three backends prioritize the current workspace before filling in other workspaces. Fresh sessions and titles merge into the list immediately; cached rows from other workspaces remain until the full read finishes. Background updates preserve a session the user has selected manually. Claude and Codex first request up to 32 recent sessions within their native cwd scope: Claude's SDK includes Git worktrees in the same repository, while Codex matches the session cwd exactly. Codex listings reuse the running connection and read the first 32 regular results alongside the state DB shortcut, then fill in later pages. The browser groups sessions by their own cwd. DSH resolves the current workspace's metadata first and publishes it before reading other workspaces' logs, even when it has fewer than 32 sessions. Titles that require a deeper DSH log scan appear first with a fallback name and update in place when recovery finishes.
339
+ With DSH's current JSONL backend, startup and `/new` keep initial permission events in memory until further session activity saves the complete log. Flushing a session that holds only initialization leaves it unstored. Restarting an unstored empty session starts fresh.
289
340
  Removing a workspace registration keeps its sessions accessible under a "History only" directory in the rail.
290
341
  History-only directories offer edit and new-session actions; rename and remove are available for registered workspaces.
291
342
 
@@ -299,6 +350,10 @@ Full commands: [Interaction and commands](docs/interaction.en.md).
299
350
 
300
351
  Agent presets, themes, MCP servers, environment variables: [Configuration](docs/configuration.en.md) · [Themes](docs/themes.en.md).
301
352
 
353
+ With the DeepSeek brand, Companion skins `deepy` and `whaleGirl` replace the maid portrait; choose `whale` and enable Maid portrait to use it. Claude uses its own artwork; Codex uses its own raster portrait or the maid character-art fallback. Both brands ignore these settings for splash artwork. See [Configuration](docs/configuration.en.md).
354
+
355
+ DSH profiles inherit official reporting defaults: DeepSeek API requests carry plugin package identities and incremental Session logs to the configured `baseURL`, including third-party gateways, while OpenTelemetry uploads a Session-log prefix only after explicit feedback. User overrides remain supported; see [reporting settings](docs/configuration.en.md#official-request-metadata-and-feedback-reporting).
356
+
302
357
  ## How It Works
303
358
 
304
359
  ```text
@@ -313,7 +368,7 @@ Runtime path, module boundaries, performance notes and persistence locations: [A
313
368
  ## Known Limitations
314
369
 
315
370
  - Injected plugin context has no standalone display; it counts into the context segments.
316
- - `/model` switches by forking the session; the old session stays in `/resume` (a session nobody has typed into records no branch, so your first prompt there still gets a generated title).
371
+ - `/model` changes the next request’s route in the same session; history and session ID are preserved. The last used route is recorded when the next request starts. DSH versions before `0.1.2-alpha.3` refuse switching and prompt an upgrade because their subagents inherit the original route.
317
372
  - `Ctrl+V` needs platform clipboard tools; unsupported bitmap formats are rejected.
318
373
  - A dropped file is restored from its OSC 8 `file://` URI alone: multi-file drops, non-Windows terminal drop encodings and terminator-less truncated frames are not covered, and the hyperlink's own display name is never used.
319
374
  - A background session lives inside this process and stops when the TUI exits.
@@ -382,6 +437,10 @@ Everything, bilingual: [docs/README.md](docs/README.md).
382
437
 
383
438
  No sandbox of its own: dsh-TUI uses the active DSH profile's filesystem, shell, sandbox and approval policies. Permission presets come from the DSH `permissionPresets` registry.
384
439
 
440
+ **Permission persistence** (all three backends): the Claude and Codex backends keep their `/permission` picks in `~/.dsh-tui/backends/<id>/prefs.json`; the DSH pick is kept at `~/.dsh-tui/permission.json`. Every durable preset switch teaches it (picker, typed `/permission`, Shift+Tab static modes, or a switch the official command performed on its own), and a session that never customized its permission planes starts on the remembered preset — applied through the same official switch path. "Never customized" is about the user: the composition writes its own default preset into every fresh session at creation, and those events do not count. Plan-mode transients are excluded, a `DSH_PERMISSION_MODE` launch pin (this run's initial permission plane) outranks the file, and an identity the mounted roster no longer offers is skipped.
441
+
442
+ **Upstream auto-retry** (DSH): whenever a session binds (boot, `/model` switch, resume), the TUI seeds a retry policy — 5 attempts, transport-drop-aware failure codes including `STREAM_CLOSED` (a dropped upstream stream) — on **the provider route that session actually uses**, through the official `llm-pi-ai` settings section (the policy the kernel's `llm-retry` plugin executes). Only routes without an explicit `retryPolicy` are seeded — dormant channels are never written — and `upstreamRetry: false` in cordis.yml opts out.
443
+
385
444
  Details: [Permissions and security boundary](docs/architecture.en.md#permissions-and-security-boundary).
386
445
 
387
446
  ## Acknowledgments
package/bin/dsh-tui.js CHANGED
@@ -28,7 +28,7 @@
28
28
  * `DSH_TUI_LANG` 显式指定时从其值,否则默认中文(同 src/i18n.ts 的缺省)。
29
29
  */
30
30
  import { spawn, spawnSync } from 'node:child_process'
31
- import { existsSync, readFileSync, readdirSync, realpathSync, rmSync } from 'node:fs'
31
+ import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync } from 'node:fs'
32
32
  import { homedir } from 'node:os'
33
33
  import { dirname, isAbsolute, join, resolve } from 'node:path'
34
34
  import { fileURLToPath, pathToFileURL } from 'node:url'
@@ -63,7 +63,14 @@ const ownVersion = ownPackage?.name === '@deepseek-harness-tui/dsh-tui' ? ownPac
63
63
  const PACKAGE = '@deepseek-harness-tui/dsh-tui'
64
64
  const PROFILE = 'dsh-tui'
65
65
  // Kept local so the launcher also works without compiled modules.
66
- const KERNEL_IDS = ['dsh', 'claude', 'codex']
66
+ /** 内置内核:只用于文案("内置 dsh / claude / codex")与 rescue/safe 提示。
67
+ * **不是校验来源**——插件后端由各自 profile 提供,启动器看不到,所以
68
+ * `--backend` 只做 id 语法校验(P0 D1)。 */
69
+ const BUILTIN_BACKEND_IDS = ['dsh', 'claude', 'codex']
70
+ /** 后端 id 语法,与 src/agent/backend-manifest.ts 的 BACKEND_ID_PATTERN 同一规则
71
+ * (启动器要能在没有编译产物时工作,所以这里是副本;两边改动必须同步)。 */
72
+ const BACKEND_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,31}$/
73
+ const isBackendIdSyntax = value => typeof value === 'string' && BACKEND_ID_PATTERN.test(value)
67
74
 
68
75
  // 随包用户手册(guide/,见 scripts/build-guide.mjs):交给 dsh 当内核
69
76
  // dsh-skill-filesystem 的随包技能根(rank 600 的 bundledSkillDir 默认取这个
@@ -111,6 +118,26 @@ const shellOpt = isWin ? { shell: true } : {}
111
118
  const cmd = (command, args) =>
112
119
  isWin ? [`${command} ${shellQuote(args).join(' ')}`, []] : [command, args]
113
120
 
121
+ // dsh CLI 预检(`dsh --version`),异步起、不占关键路径:本包入口不需要 dsh CLI,
122
+ // 只有 `dsh --profile` 出口(`requireDsh()`)与入口失败后的提示判定才消费结果。
123
+ // **不能** unref:`requireDsh()` await 它时若这是唯一活跃句柄,Node 会把顶层 await
124
+ // 判成永不结算、以 exit 13 终止启动器。
125
+ let dshProbe
126
+ const probeDsh = () => {
127
+ dshProbe ??= new Promise(resolve => {
128
+ const child = spawn(...cmd('dsh', ['--version']), { stdio: 'ignore', ...shellOpt })
129
+ child.on('error', () => resolve(false))
130
+ child.on('exit', code => resolve(code === 0))
131
+ })
132
+ return dshProbe
133
+ }
134
+
135
+ const requireDsh = async () => {
136
+ if (await probeDsh()) return
137
+ console.error(msg('noDsh'))
138
+ process.exit(1)
139
+ }
140
+
114
141
  // 内联 semver(解析 + 严格大于):启动器可能在依赖不完整的环境里被执行
115
142
  // (迁移、半损坏安装、测试沙箱),零外部依赖是自保底线。覆盖 semver 的
116
143
  // 核心-先行版比较规则:先行版标识符逐段比(数字段按数值、小于字母段),
@@ -195,6 +222,13 @@ const MSG = {
195
222
  en: code => `[dsh-tui] dsh profile exited with code ${code}. Run it directly for diagnostics:\n dsh --profile ${PROFILE}`,
196
223
  zh: code => `[dsh-tui] dsh profile 已退出(退出码 ${code})。可直接运行以下命令查看诊断:\n dsh --profile ${PROFILE}`,
197
224
  },
225
+ // 裸 --resume / -c / --continue 派生不出目标(roadmap §6 第 11 条,B-2a):以前
226
+ // 这里不设 env,再把 --continue 交给下游=静默冷启动。恢复语义要求明确报错并非零
227
+ // 退出,用户去掉 --resume 之后才按普通启动流程处理。
228
+ resumeNoLastSession: {
229
+ en: backend => `[dsh-tui] No session to resume: the "${backend}" backend has not recorded one yet. Start without --resume for a fresh session, or name one with --resume <session id>.`,
230
+ zh: backend => `[dsh-tui] 没有可恢复的上次会话:后端「${backend}」还没有记录过会话。去掉 --resume 即可冷启动,或用 --resume <会话 id> 指定一个。`,
231
+ },
198
232
  safeAsk: {
199
233
  en: code => `dsh-tui exited unexpectedly (code ${code}). Enter safe mode? [Y/n] `,
200
234
  zh: code => `dsh-tui 异常退出(码 ${code})。进入安全模式?[Y/n] `,
@@ -466,7 +500,8 @@ const MSG = {
466
500
  `Options:\n` +
467
501
  ` --resume [id] Resume the last (or the given) session\n` +
468
502
  ` -c, --continue Same as --resume\n` +
469
- ` --backend <id> Agent backend: dsh | claude | codex (claude, codex: experimental)\n` +
503
+ ` --backend <id> Agent backend: dsh | claude | codex, or an installed plugin backend\n` +
504
+ ` (claude, codex and plugin backends: experimental)\n` +
470
505
  ` -- <prompt...> Treat the remaining arguments as literal prompt text\n` +
471
506
  ` <path|url> Open with the given workspace target\n\n` +
472
507
  `Leading DSH options (e.g. --dump-config, --patch <path>) are forwarded unchanged.\n` +
@@ -484,7 +519,8 @@ const MSG = {
484
519
  `选项:\n` +
485
520
  ` --resume [id] 恢复上次(或指定 id 的)会话\n` +
486
521
  ` -c, --continue 同 --resume\n` +
487
- ` --backend <id> Agent 后端:dsh | claude | codex(claude、codex 为实验性)\n` +
522
+ ` --backend <id> Agent 后端:dsh | claude | codex,或已安装的插件后端\n` +
523
+ ` (claude、codex 与插件后端均为实验性)\n` +
488
524
  ` -- <提示词...> 将剩余参数作为字面提示词\n` +
489
525
  ` <路径|URL> 以指定工作区目标启动\n\n` +
490
526
  `前置 DSH 选项(如 --dump-config、--patch <路径>)原样转发。\n` +
@@ -560,7 +596,20 @@ if (subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
560
596
  process.exit(0)
561
597
  }
562
598
  /**
563
- * Whether the DSH credential store declares a reference by this name.
599
+ * The credential documents a read may consult, most authoritative first: the
600
+ * active home's store, then the default `~/.dsh` store. A `DSH_HOME` override
601
+ * moves the harness home, but a key the user stored where both READMEs name it
602
+ * must keep counting as set instead of failing the doctor.
603
+ * @param home - The DSH home directory that owns `.credentials.yaml`.
604
+ * @returns Candidate file paths, most authoritative first.
605
+ */
606
+ const credentialStoreFiles = home => {
607
+ const active = join(home, '.credentials.yaml')
608
+ const fallback = join(homedir(), '.dsh', '.credentials.yaml')
609
+ return active === fallback ? [active] : [active, fallback]
610
+ }
611
+ /**
612
+ * Whether any DSH credential store declares a reference by this name.
564
613
  *
565
614
  * The launcher stays dependency-free, so the YAML is read as text: only the
566
615
  * top-level `refs:` block maps reference names to stored secrets, and matching
@@ -572,15 +621,17 @@ if (subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
572
621
  * @returns True when a `refs` entry with that name exists.
573
622
  */
574
623
  const credentialRefDeclared = (home, name) => {
575
- try {
576
- const text = readFileSync(join(home, '.credentials.yaml'), 'utf8')
577
- const block = /^refs:[ \t]*\r?\n((?:[ \t]+\S.*(?:\r?\n|$))*)/mu.exec(text)
578
- if (block === null) return false
579
- const escaped = name.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&')
580
- return new RegExp(`^[ \t]+${escaped}[ \t]*:`, 'mu').test(block[1])
581
- } catch {
582
- return false
624
+ const escaped = name.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&')
625
+ const pattern = new RegExp(`^[ \t]+${escaped}[ \t]*:`, 'mu')
626
+ for (const file of credentialStoreFiles(home)) {
627
+ try {
628
+ const block = /^refs:[ \t]*\r?\n((?:[ \t]+\S.*(?:\r?\n|$))*)/mu.exec(readFileSync(file, 'utf8'))
629
+ if (block !== null && pattern.test(block[1])) return true
630
+ } catch {
631
+ // An unreadable or absent store simply does not declare the ref.
632
+ }
583
633
  }
634
+ return false
584
635
  }
585
636
 
586
637
  // ─── doctor 检查逻辑(doctor 子命令与 safe 会话共用)──────────────────────────
@@ -756,13 +807,41 @@ const startDshSession = (dshArgs, profile = PROFILE, env = process.env) =>
756
807
  })
757
808
  })
758
809
 
810
+ // entry 子进程的 Node 编译缓存:纯 env 注入,替身进程继承。用户显式设过
811
+ // `NODE_COMPILE_CACHE`(含空串)不覆盖。
812
+ // 路径沿用 `join(homedir(), '.dsh-tui', …)` 写法,**不要**抽成共用的模块级常量:
813
+ // verify-safe-mode.mjs 把 readLastRunRecord 至「TTY 判定」注释之间的源码切进只注入
814
+ // 少数全局的 vm 沙箱,区间内引用的外部常量会是 `undefined`,套件静默转红。
815
+ // (别把那两处切片标记原文抄进注释:会让脚本的 indexOf 提前命中。)
816
+ const withCompileCache = env => {
817
+ if (env.NODE_COMPILE_CACHE !== undefined) return env
818
+ const cacheDir = join(homedir(), '.dsh-tui', 'compile-cache')
819
+ try {
820
+ mkdirSync(cacheDir, { recursive: true, mode: 0o700 })
821
+ } catch {
822
+ return env
823
+ }
824
+ return { ...env, NODE_COMPILE_CACHE: cacheDir }
825
+ }
826
+
827
+ // 本包自己的入口:`node <入口> <应用参数>`。结果模型与 startDshSession 相同。
828
+ const startEntrySession = (entry, appArgs, env = process.env) =>
829
+ new Promise(resolve => {
830
+ const child = spawn(process.execPath, [entry, ...appArgs], { stdio: 'inherit', env: withCompileCache(env) })
831
+ child.on('error', err => resolve({ kind: 'error', error: err }))
832
+ child.on('exit', (code, signal) => {
833
+ if (signal) resolve({ kind: 'signal', signal })
834
+ else resolve({ kind: 'exit', code: code ?? 0 })
835
+ })
836
+ })
837
+
759
838
  // 救援子进程的环境:显式构造,而不是把宿主 process.env 原样交给它。救援的
760
839
  // 语义是「干净冷启动」,而启动器自己写进 process.env 的会话控制变量会把刚
761
840
  // 崩掉的主 profile 的会话 id / 工作区目标带进救援——救援 profile 里并不存在
762
841
  // 那个会话,dsh 会在恢复时再报一次错,正好污染最该干净的通道。其余宿主变量
763
842
  // (PATH / DSH_HOME / 凭据…)是救援能工作的前提,照常继承。
764
843
  // home 层补丁不在此列:它由 createRescueProfile 的干净性门禁单独把关。
765
- const RESCUE_DROPPED_ENV = ['DSH_TUI_RESUME_SESSION', 'DSH_TUI_WORKSPACE_TARGET']
844
+ const RESCUE_DROPPED_ENV = ['DSH_TUI_RESUME_SESSION', 'DSH_TUI_RESUME_BACKEND', 'DSH_TUI_WORKSPACE_TARGET']
766
845
  const rescueEnv = () => {
767
846
  const env = { ...process.env }
768
847
  for (const key of RESCUE_DROPPED_ENV) delete env[key]
@@ -779,7 +858,7 @@ const readLastRunRecord = () => {
779
858
  try {
780
859
  const parsed = JSON.parse(readFileSync(join(homedir(), '.dsh-tui', 'last-run.json'), 'utf8'))
781
860
  if (parsed === null || typeof parsed !== 'object') return undefined
782
- if (!KERNEL_IDS.includes(parsed.backendId)) return undefined
861
+ if (!isBackendIdSyntax(parsed.backendId)) return undefined
783
862
  if (typeof parsed.sessionId !== 'string' || typeof parsed.cwd !== 'string' || typeof parsed.attemptId !== 'string') return undefined
784
863
  if (typeof parsed.updatedAt !== 'number' || !Number.isFinite(parsed.updatedAt)) return undefined
785
864
  return parsed
@@ -790,14 +869,19 @@ const readLastRunRecord = () => {
790
869
  // 记录 → 重试 env:DSH_TUI_BACKEND 与一次性的 DSH_TUI_BACKEND_HANDOFF(后者
791
870
  // 压过 Config 行)都设成记录里的内核;记录有可恢复的会话 id 才设
792
871
  // DSH_TUI_RESUME_SESSION,否则删掉继承来的值,在该内核上冷启动。
872
+ // DSH_TUI_RESUME_BACKEND 记下这个 id 是**从哪个内核读来的**:记录里的内核可能
873
+ // 已经不在注册表里,boot 会回落 dsh,届时这个 id 必须被撤销而不是交给 dsh
874
+ // (见 src/kernelPrefs.ts 的 resolveResumeTarget)。
793
875
  const envFromLastRun = record => {
794
876
  const env = { ...process.env }
795
877
  env.DSH_TUI_BACKEND = record.backendId
796
878
  env.DSH_TUI_BACKEND_HANDOFF = record.backendId
797
879
  if (typeof record.sessionId === 'string' && record.sessionId.trim() !== '') {
798
880
  env.DSH_TUI_RESUME_SESSION = record.sessionId
881
+ env.DSH_TUI_RESUME_BACKEND = record.backendId
799
882
  } else {
800
883
  delete env.DSH_TUI_RESUME_SESSION
884
+ delete env.DSH_TUI_RESUME_BACKEND
801
885
  }
802
886
  return env
803
887
  }
@@ -817,13 +901,34 @@ const readBackendLastSession = backendId => {
817
901
  return ''
818
902
  }
819
903
  }
904
+
905
+ // env 里的后端选择:先按 boot 侧 parseBackendId 的规则**归一**(trim + 小写)再判定。
906
+ // 拿原始值判定会让两侧分歧:`DSH_TUI_BACKEND=Codex` 时 boot 归一后起 codex,启动器
907
+ // 却当它没命中而读 dsh 的 resume.txt——codex 便拿着 DSH 的会话 id 去恢复(必报错)。
908
+ // 归一后 `dsh` 与非法/空值同样走 resume.txt 分支。
909
+ const backendChoiceFromEnv = () => {
910
+ const raw = process.env.DSH_TUI_BACKEND
911
+ if (typeof raw !== 'string') return undefined
912
+ const id = raw.trim().toLowerCase()
913
+ return isBackendIdSyntax(id) && id !== 'dsh' ? id : undefined
914
+ }
915
+
916
+ // 安全模式重试标记(与 src/kernelPrefs.ts 的 RESUME_RETRY_ENV 同一个字面量):重试
917
+ // 的目标派生自 last-run.json,而记录里的内核可能已经不在注册表里、boot 会回落 dsh
918
+ // 并撤销这个目标。重试是用户最后的退路,所以带这个标记的那次启动撤销后降级为告警 +
919
+ // 冷启动,而不是报错退出。一次性:boot 读到即从 process.env 删除,不传给子进程。
920
+ const RESUME_RETRY_ENV = 'DSH_TUI_RESUME_RETRY'
921
+
820
922
  // 安全模式「重试正常启动」的环境(菜单选项 1,首启 fallback 与 `safe` 共用):
821
923
  // 1. 本次启动之后写下的最后运行记录:崩溃时实际在跑的内核与会话,压过
822
924
  // env 里的 --resume(内核切换是用户更新的选择)。
823
925
  // 2. 没有这样的记录(崩得太早,或旧版本不写):env 里已有
824
926
  // DSH_TUI_RESUME_SESSION 就照用;否则按 env 的后端读它的上次会话
825
927
  // (resume.txt 或对应后端偏好文件),读不到就冷启动。
826
- const resumeEnvForRetry = () => {
928
+ // 三条分支派生出来的目标都带上 RESUME_RETRY_ENV:它们是"回到崩溃前"的重试,撤销
929
+ // 只能降级为冷启动,不能把用户最后的退路一起关掉。
930
+ const resumeEnvForRetry = () => ({ ...resumeEnvForRetryTarget(), [RESUME_RETRY_ENV]: '1' })
931
+ const resumeEnvForRetryTarget = () => {
827
932
  const chain = launchChain
828
933
  const record = readLastRunRecord()
829
934
  if (record !== undefined && chain !== null && record.updatedAt >= chain.startedAt) {
@@ -831,8 +936,13 @@ const resumeEnvForRetry = () => {
831
936
  }
832
937
  if (process.env.DSH_TUI_RESUME_SESSION !== undefined) return process.env
833
938
  let target = ''
834
- if (KERNEL_IDS.includes(process.env.DSH_TUI_BACKEND) && process.env.DSH_TUI_BACKEND !== 'dsh') {
835
- target = readBackendLastSession(process.env.DSH_TUI_BACKEND)
939
+ // 与裸 --resume 同理:这两个目标都是**派生**的,来源内核要一并记下,boot 回落
940
+ // 到别的内核时才撤得掉(显式 marker 走上面那条 return,不带来源)。
941
+ let source = 'dsh'
942
+ const backendChoice = backendChoiceFromEnv()
943
+ if (backendChoice !== undefined) {
944
+ target = readBackendLastSession(backendChoice)
945
+ source = backendChoice
836
946
  } else {
837
947
  try {
838
948
  target = readFileSync(join(homedir(), '.dsh-tui', 'resume.txt'), 'utf8').trim()
@@ -840,7 +950,9 @@ const resumeEnvForRetry = () => {
840
950
  // 没有历史会话可恢复——静默冷启动。
841
951
  }
842
952
  }
843
- return target === '' ? process.env : { ...process.env, DSH_TUI_RESUME_SESSION: target }
953
+ return target === ''
954
+ ? process.env
955
+ : { ...process.env, DSH_TUI_RESUME_SESSION: target, DSH_TUI_RESUME_BACKEND: source }
844
956
  }
845
957
 
846
958
  // TTY 判定:询问与菜单都要求 stdin/stdout 均可交互(readline 需要 stdin,
@@ -1385,14 +1497,8 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1385
1497
  forwardExit(child)
1386
1498
  } else {
1387
1499
  // ─── profile 副本(或源码运行):完整启动逻辑 ─────────────────────────────
1388
- // dsh CLI 预检(缺失时给安装指引,先于一切 profile 逻辑)。
1389
- {
1390
- const probe = spawnSync(...cmd('dsh', ['--version']), { stdio: 'pipe', ...shellOpt })
1391
- if (probe.error || probe.status !== 0) {
1392
- console.error(msg('noDsh'))
1393
- process.exit(1)
1394
- }
1395
- }
1500
+ // dsh CLI 预检:异步起,结果在要起 dsh 的出口才消费(见 probeDsh)。
1501
+ void probeDsh()
1396
1502
 
1397
1503
  let installedVersion
1398
1504
  try {
@@ -1417,8 +1523,12 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1417
1523
  if (!runningInsideProfile) checkProfileAlignment(installedVersion)
1418
1524
 
1419
1525
  // --resume / 工作区目标拦截(launcher 契约,见 src/sessionHistory.ts)。
1420
- const setResumeEnv = sessionId => {
1526
+ // sourceBackend 只在**派生**目标时给出(读的是那个内核的上次会话);显式敲的
1527
+ // id 传 undefined,把来源标记删掉——它归用户管,启动器不替它作证。
1528
+ const setResumeEnv = (sessionId, sourceBackend) => {
1421
1529
  process.env.DSH_TUI_RESUME_SESSION = sessionId
1530
+ if (sourceBackend === undefined) delete process.env.DSH_TUI_RESUME_BACKEND
1531
+ else process.env.DSH_TUI_RESUME_BACKEND = sourceBackend
1422
1532
  }
1423
1533
  const readLastResumeTarget = () => {
1424
1534
  try {
@@ -1466,8 +1576,13 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1466
1576
  if (a === '--backend' || a.startsWith('--backend=')) {
1467
1577
  const backend = a.startsWith('--backend=') ? a.slice('--backend='.length).trim() : (argv[i + 1] ?? '').trim()
1468
1578
  if (a === '--backend' && argv[i + 1] !== undefined) i += 1
1469
- if (!KERNEL_IDS.includes(backend)) {
1470
- console.error(lang === 'zh' ? `未知的 --backend:${backend}(可选 ${KERNEL_IDS.join(' / ')})` : `Unknown --backend: ${backend} (expected ${KERNEL_IDS.join(' or ')})`)
1579
+ // 只挡语法非法:合法但没装的 id(插件后端、或拼错的 id)进 TUI 后由 boot
1580
+ // 告警并回落 dsh——启动器拿不到 profile 里装了什么(P0 D1 的已知代价,
1581
+ // Stage C 的 /plugin 会让启动器读已装清单后恢复"装前即报错")。
1582
+ if (!isBackendIdSyntax(backend)) {
1583
+ console.error(lang === 'zh'
1584
+ ? `非法的 --backend:${backend}(后端 id 只能是小写字母、数字与连字符,最长 32 字符;内置 ${BUILTIN_BACKEND_IDS.join(' / ')},插件后端需已安装)`
1585
+ : `Invalid --backend: ${backend} (a backend id is lowercase letters, digits and dashes, at most 32 characters; built-in: ${BUILTIN_BACKEND_IDS.join(' or ')} — a plugin backend must be installed)`)
1471
1586
  process.exit(2)
1472
1587
  }
1473
1588
  process.env.DSH_TUI_BACKEND = backend
@@ -1494,10 +1609,40 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1494
1609
  }
1495
1610
 
1496
1611
  // 按出现顺序重放 --resume:裸 --resume 时 DSH 读 resume.txt(契约不变),
1497
- // 其他内核读各自的上次会话。
1612
+ // 其他内核读各自的上次会话。派生出来的目标同时记下**来源内核**
1613
+ // (DSH_TUI_RESUME_BACKEND),boot 若回落到别的内核就撤销它;显式给出的 id 不
1614
+ // 带来源,原样透传。
1615
+ // 裸请求**派生不出目标就是失败**(roadmap §6 第 11 条,B-2a):以前这里不设任何
1616
+ // env、随后把 --continue 交给下游,等于静默冷启动。只有最后那次请求算数(与
1617
+ // 上面"每个 flag 都设一次、最后者胜"一致),被后面的显式 id 顶掉的裸 flag 不报错。
1618
+ let bareWithoutTarget = ''
1498
1619
  for (const flag of resumeFlags) {
1499
- const sessionId = flag ?? (KERNEL_IDS.includes(process.env.DSH_TUI_BACKEND) && process.env.DSH_TUI_BACKEND !== 'dsh' ? readBackendLastSession(process.env.DSH_TUI_BACKEND) : readLastResumeTarget())
1500
- if (sessionId) setResumeEnv(sessionId)
1620
+ const backendChoice = backendChoiceFromEnv()
1621
+ if (flag !== null) {
1622
+ setResumeEnv(flag, undefined)
1623
+ bareWithoutTarget = ''
1624
+ continue
1625
+ }
1626
+ // 没有 --backend 时裸 --resume 读的是 DSH 的 resume.txt,来源即 dsh:内存里
1627
+ // 记着的内核(kernel.json)可能把它顶掉,那时这个 id 同样不该跟过去。
1628
+ const sourceBackend = backendChoice ?? 'dsh'
1629
+ const sessionId = backendChoice !== undefined ? readBackendLastSession(backendChoice) : readLastResumeTarget()
1630
+ if (sessionId) {
1631
+ setResumeEnv(sessionId, sourceBackend)
1632
+ bareWithoutTarget = ''
1633
+ } else {
1634
+ bareWithoutTarget = sourceBackend
1635
+ }
1636
+ }
1637
+ // Keep the final bare request until boot knows the effective backend. A
1638
+ // missing/foreign marker must not erase it. --continue takes no id, so the
1639
+ // next prompt token cannot accidentally become a resume target.
1640
+ if (resumeFlags.at(-1) === null) {
1641
+ if (bareWithoutTarget !== '') {
1642
+ console.error(msg('resumeNoLastSession')(bareWithoutTarget))
1643
+ process.exit(1)
1644
+ }
1645
+ args.unshift('--continue')
1501
1646
  }
1502
1647
 
1503
1648
  // 启动:被委托场景下本副本自己的版本即对齐诊断所见的启动器代际。
@@ -1508,7 +1653,28 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1508
1653
  // DSH consumes its own --; only the app tail belongs behind it. Preserve
1509
1654
  // the app-level separator too, and replay this same argv on a safe retry.
1510
1655
  const firstArgs = [...hostArgs, ...(args.length > 0 ? ['--', ...args] : [])]
1656
+
1657
+ // 内核分流(docs/standalone-host-design.md):默认所有内核都走本包入口,由入口
1658
+ // 判定内核(src/hostEntryRoute.ts)。DSH_TUI_HOST_ENTRY=0 让所有内核回到
1659
+ // `dsh --profile`;dsh 自己的 hostArgs(--version、--dump-config* 等)始终交给 dsh。
1660
+ const hostEntry = join(ownDir, 'lib', 'types', 'dsh-adapter', 'host-entry.js')
1661
+ const hostEntryEnabled = process.env.DSH_TUI_HOST_ENTRY !== '0' && existsSync(hostEntry)
1511
1662
  // 必须在首次 spawn 之前:本次启动的 TUI 写的记录都晚于这个时刻。
1512
1663
  noteLaunchChain()
1513
- settleFirstResult(await startDshSession(firstArgs), firstArgs)
1664
+ if (hostEntryEnabled && hostArgs.length === 0) {
1665
+ // 替身进程经它重起(src/update.ts restartArgv)。只在入口路线设置:带 hostArgs
1666
+ // (如 --patch)的 `dsh --profile` 启动重起时须原样重放整条 dsh argv。
1667
+ process.env.DSH_TUI_HOST_ENTRY_PATH = hostEntry
1668
+ process.env.DSH_TUI_PROFILE ??= PROFILE
1669
+ // The in-process DSH kernel reads the bundled guide skills like `dsh` does.
1670
+ const result = await startEntrySession(hostEntry, args, withGuideSkillDir(process.env))
1671
+ // 没有 dsh CLI:安全模式与排查提示都指向不存在的 `dsh --profile`(DSH 内核下
1672
+ // 入口已打印 noDsh),原样退出。
1673
+ if (result.kind === 'exit' && result.code !== 0 && !(await probeDsh())) process.exit(result.code)
1674
+ settleFirstResult(result, firstArgs)
1675
+ } else {
1676
+ // `dsh --profile` 出口:hostArgs,或入口被关闭的非默认路径。
1677
+ await requireDsh()
1678
+ settleFirstResult(await startDshSession(firstArgs), firstArgs)
1679
+ }
1514
1680
  }