@deepseek-harness-tui/dsh-tui 0.16.0 → 0.17.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 (401) hide show
  1. package/README.md +214 -34
  2. package/assets/plugin-icon.svg +13 -0
  3. package/assets/windows-installer.cs +308 -0
  4. package/assets/windows-installer.ps1 +17 -0
  5. package/bin/dsh-tui.js +64 -5
  6. package/cli/adapters/dsh/index.mjs +111 -0
  7. package/cli/adapters/dsh/locate.mjs +73 -0
  8. package/cli/adapters/dsh/management-plugin.mjs +111 -0
  9. package/cli/args.mjs +154 -0
  10. package/cli/contracts.d.ts +48 -0
  11. package/cli/engine.mjs +92 -0
  12. package/cli/entry.mjs +48 -0
  13. package/cli/process.mjs +118 -0
  14. package/cli/protocol.mjs +23 -0
  15. package/cli/schema-v1.json +33 -0
  16. package/cordis.patch.yml +3 -1
  17. package/cordis.yml +3 -1
  18. package/guide/dsh-tui-guide/SKILL.md +1 -0
  19. package/guide/dsh-tui-guide/claude-backend.en.md +8 -0
  20. package/guide/dsh-tui-guide/claude-backend.md +5 -0
  21. package/guide/dsh-tui-guide/cli.en.md +114 -0
  22. package/guide/dsh-tui-guide/cli.md +114 -0
  23. package/guide/dsh-tui-guide/configuration.en.md +6 -5
  24. package/guide/dsh-tui-guide/configuration.md +6 -5
  25. package/guide/dsh-tui-guide/getting-started.en.md +44 -10
  26. package/guide/dsh-tui-guide/getting-started.md +31 -9
  27. package/guide/dsh-tui-guide/interaction.en.md +22 -10
  28. package/guide/dsh-tui-guide/interaction.md +18 -8
  29. package/guide/dsh-tui-guide/plugins.en.md +35 -4
  30. package/guide/dsh-tui-guide/plugins.md +23 -2
  31. package/guide/dsh-tui-guide/user-guide.en.md +30 -23
  32. package/guide/dsh-tui-guide/user-guide.md +29 -22
  33. package/lib/settings.json +83 -40
  34. package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
  35. package/lib/types/adapter/channel/plugins.js +8 -0
  36. package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
  37. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  38. package/lib/types/adapter/channel/ui-policy.js +3 -0
  39. package/lib/types/adapter/ports/channel-display.d.ts +10 -0
  40. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  41. package/lib/types/adapter/ports/channel-session.d.ts +2 -0
  42. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  43. package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
  44. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  45. package/lib/types/adapter/ports/channel-ui.d.ts +17 -2
  46. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  47. package/lib/types/adapter/ports/channel-view.d.ts +8 -1
  48. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  49. package/lib/types/adapter/ports/channel.d.ts +7 -0
  50. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  51. package/lib/types/agent/capabilities.d.ts +2 -0
  52. package/lib/types/agent/capabilities.d.ts.map +1 -1
  53. package/lib/types/agent/events.d.ts +8 -0
  54. package/lib/types/agent/events.d.ts.map +1 -1
  55. package/lib/types/api.d.ts +2 -2
  56. package/lib/types/api.d.ts.map +1 -1
  57. package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
  58. package/lib/types/backends/claude/translate/events.js +2 -1
  59. package/lib/types/backends/codex/auth/status.js +1 -1
  60. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  61. package/lib/types/backends/codex/session/controls.js +6 -5
  62. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  63. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  64. package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
  65. package/lib/types/backends/codex/translate/events.js +3 -1
  66. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  67. package/lib/types/backends/shared/channel-tokens.js +9 -8
  68. package/lib/types/channel/history-restore.d.ts.map +1 -1
  69. package/lib/types/channel/history-restore.js +2 -0
  70. package/lib/types/channel/interaction.d.ts.map +1 -1
  71. package/lib/types/channel/interaction.js +1 -0
  72. package/lib/types/channel/projection.d.ts +1 -1
  73. package/lib/types/channel/projection.d.ts.map +1 -1
  74. package/lib/types/channel/projection.js +19 -4
  75. package/lib/types/channel/questions.d.ts +2 -0
  76. package/lib/types/channel/questions.d.ts.map +1 -1
  77. package/lib/types/channel/sanitize.d.ts +14 -0
  78. package/lib/types/channel/sanitize.d.ts.map +1 -1
  79. package/lib/types/channel/sanitize.js +55 -0
  80. package/lib/types/channel/working-directory.d.ts +9 -0
  81. package/lib/types/channel/working-directory.d.ts.map +1 -0
  82. package/lib/types/channel/working-directory.js +7 -0
  83. package/lib/types/commands.d.ts +8 -1
  84. package/lib/types/commands.d.ts.map +1 -1
  85. package/lib/types/commands.js +13 -4
  86. package/lib/types/components/ChatTitle.d.ts +7 -0
  87. package/lib/types/components/ChatTitle.d.ts.map +1 -0
  88. package/lib/types/components/ChatTitle.js +15 -0
  89. package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
  90. package/lib/types/components/CodeBlockFrame.js +10 -5
  91. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
  92. package/lib/types/components/CompactionStatusRow.js +24 -3
  93. package/lib/types/components/GoalTodoPanel.d.ts +3 -1
  94. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  95. package/lib/types/components/GoalTodoPanel.js +2 -2
  96. package/lib/types/components/Markdown.d.ts +9 -1
  97. package/lib/types/components/Markdown.d.ts.map +1 -1
  98. package/lib/types/components/Markdown.js +5 -4
  99. package/lib/types/components/MessageList.d.ts.map +1 -1
  100. package/lib/types/components/MessageList.js +17 -12
  101. package/lib/types/components/PromptInput.d.ts +13 -5
  102. package/lib/types/components/PromptInput.d.ts.map +1 -1
  103. package/lib/types/components/PromptInput.js +189 -107
  104. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  105. package/lib/types/components/SplitDiffView.js +232 -22
  106. package/lib/types/components/SubagentDetailScene.d.ts +3 -1
  107. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  108. package/lib/types/components/SubagentDetailScene.js +5 -1
  109. package/lib/types/components/Whale.d.ts.map +1 -1
  110. package/lib/types/components/Whale.js +8 -5
  111. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  112. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  113. package/lib/types/components/approvals/ApprovalPanel.js +93 -11
  114. package/lib/types/components/bigfont.d.ts.map +1 -1
  115. package/lib/types/components/bigfont.js +2 -1
  116. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  117. package/lib/types/components/messages/AssistantToolUseMessage.js +13 -6
  118. package/lib/types/components/previewRows.d.ts +19 -0
  119. package/lib/types/components/previewRows.d.ts.map +1 -0
  120. package/lib/types/components/previewRows.js +46 -0
  121. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  122. package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
  123. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
  124. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  125. package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
  126. package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
  127. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  128. package/lib/types/components/sessions/SessionListRow.js +18 -10
  129. package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
  130. package/lib/types/components/sidePanel/InfoPanel.js +4 -3
  131. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  132. package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
  133. package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
  134. package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
  135. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  136. package/lib/types/components/sidePanel/builtinPanels.js +22 -16
  137. package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
  138. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
  139. package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
  140. package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
  141. package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
  142. package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
  143. package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
  144. package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
  145. package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
  146. package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
  147. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  148. package/lib/types/components/sidePanel/useSidePanel.js +24 -6
  149. package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
  150. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  151. package/lib/types/components/trajectory/MiniWake.js +7 -3
  152. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  153. package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
  154. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  155. package/lib/types/dsh-adapter/backend/translate.js +11 -1
  156. package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
  157. package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
  158. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  159. package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
  160. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  161. package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
  162. package/lib/types/dsh-adapter/channel/composer-images.d.ts +9 -1
  163. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  164. package/lib/types/dsh-adapter/channel/composer-images.js +111 -111
  165. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  166. package/lib/types/dsh-adapter/channel/composer-mentions.js +16 -10
  167. package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
  168. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
  170. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +4 -1
  171. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/channel/core/binding-feed.js +13 -2
  173. package/lib/types/dsh-adapter/channel/core/compose.d.ts +4 -1
  174. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  175. package/lib/types/dsh-adapter/channel/core/compose.js +2 -0
  176. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  177. package/lib/types/dsh-adapter/channel/core/files.js +2 -1
  178. package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
  179. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/channel/core/host.js +192 -13
  181. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
  182. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  183. package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
  184. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  185. package/lib/types/dsh-adapter/channel/extensions.js +31 -5
  186. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/channel/input-actions.js +4 -0
  188. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +4 -1
  189. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  190. package/lib/types/dsh-adapter/channel/input-delivery.js +24 -1
  191. package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
  192. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  193. package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
  194. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  195. package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
  196. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  197. package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
  198. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
  200. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  201. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/channel/session-reset.js +4 -0
  203. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  204. package/lib/types/dsh-adapter/channel/session-resume.js +46 -33
  205. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  206. package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
  207. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  208. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  209. package/lib/types/dsh-adapter/channel/state.js +2 -2
  210. package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
  211. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  212. package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
  213. package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
  214. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
  215. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  216. package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
  217. package/lib/types/dsh-adapter/contract.d.ts +6 -5
  218. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  219. package/lib/types/dsh-adapter/contract.js +7 -5
  220. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  221. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  222. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  223. package/lib/types/dsh-adapter/experimental-bundles.d.ts +26 -0
  224. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
  225. package/lib/types/dsh-adapter/experimental-bundles.js +11 -0
  226. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  227. package/lib/types/dsh-adapter/host-access.js +4 -0
  228. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  229. package/lib/types/dsh-adapter/host-contract.js +2 -2
  230. package/lib/types/dsh-adapter/host-dsh.js +3 -3
  231. package/lib/types/dsh-adapter/host-entry.js +5 -3
  232. package/lib/types/dsh-adapter/index.d.ts +8 -4
  233. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  234. package/lib/types/dsh-adapter/index.js +9 -7
  235. package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -1
  236. package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
  237. package/lib/types/dsh-adapter/panels.d.ts +21 -7
  238. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  239. package/lib/types/dsh-adapter/panels.js +11 -56
  240. package/lib/types/dsh-adapter/plugin.d.ts +81 -0
  241. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  242. package/lib/types/dsh-adapter/plugin.js +318 -70
  243. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  244. package/lib/types/dsh-adapter/plugins-info.js +65 -10
  245. package/lib/types/dsh-adapter/presets.d.ts +15 -6
  246. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  247. package/lib/types/dsh-adapter/presets.js +51 -12
  248. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  249. package/lib/types/dsh-adapter/process-exit.js +1 -1
  250. package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
  251. package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
  252. package/lib/types/dsh-adapter/session-tools.js +39 -0
  253. package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
  254. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  255. package/lib/types/dsh-adapter/settings-sections.js +73 -0
  256. package/lib/types/dsh-adapter/status.d.ts +88 -1
  257. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  258. package/lib/types/dsh-adapter/status.js +318 -3
  259. package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
  260. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  261. package/lib/types/dsh-adapter/team-mode.js +76 -112
  262. package/lib/types/extensions.d.ts +1 -1
  263. package/lib/types/extensions.d.ts.map +1 -1
  264. package/lib/types/force-production-react.js +3 -3
  265. package/lib/types/i18n.d.ts +195 -52
  266. package/lib/types/i18n.d.ts.map +1 -1
  267. package/lib/types/i18n.js +96 -30
  268. package/lib/types/ink/colorize.d.ts +7 -1
  269. package/lib/types/ink/colorize.d.ts.map +1 -1
  270. package/lib/types/ink/colorize.js +29 -8
  271. package/lib/types/ink/components/App.d.ts +2 -1
  272. package/lib/types/ink/components/App.d.ts.map +1 -1
  273. package/lib/types/ink/components/App.js +10 -3
  274. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  275. package/lib/types/ink/components/ScrollBox.js +1 -0
  276. package/lib/types/ink/dom.d.ts +1 -0
  277. package/lib/types/ink/dom.d.ts.map +1 -1
  278. package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
  279. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
  280. package/lib/types/ink/hooks/use-program-status.js +96 -0
  281. package/lib/types/ink/ink.d.ts +13 -4
  282. package/lib/types/ink/ink.d.ts.map +1 -1
  283. package/lib/types/ink/ink.js +119 -25
  284. package/lib/types/ink/output.d.ts +17 -2
  285. package/lib/types/ink/output.d.ts.map +1 -1
  286. package/lib/types/ink/output.js +85 -2
  287. package/lib/types/ink/parse-keypress.d.ts +1 -0
  288. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  289. package/lib/types/ink/parse-keypress.js +5 -4
  290. package/lib/types/ink/render-node-to-output.d.ts +2 -0
  291. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  292. package/lib/types/ink/render-node-to-output.js +79 -10
  293. package/lib/types/ink/root.d.ts +8 -0
  294. package/lib/types/ink/root.d.ts.map +1 -1
  295. package/lib/types/ink/root.js +12 -3
  296. package/lib/types/ink/screen.d.ts +11 -0
  297. package/lib/types/ink/screen.d.ts.map +1 -1
  298. package/lib/types/ink/screen.js +44 -0
  299. package/lib/types/ink/selection.d.ts +7 -2
  300. package/lib/types/ink/selection.d.ts.map +1 -1
  301. package/lib/types/ink/selection.js +187 -44
  302. package/lib/types/ink/shutdown-input.d.ts +15 -0
  303. package/lib/types/ink/shutdown-input.d.ts.map +1 -0
  304. package/lib/types/ink/shutdown-input.js +28 -0
  305. package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
  306. package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
  307. package/lib/types/ink/sixel-cursor-heal.js +62 -0
  308. package/lib/types/ink/sixel-graphics.d.ts +6 -0
  309. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  310. package/lib/types/ink/sixel-graphics.js +18 -0
  311. package/lib/types/ink/styles.d.ts +8 -1
  312. package/lib/types/ink/styles.d.ts.map +1 -1
  313. package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
  314. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
  315. package/lib/types/ink/terminal-notification-windows.js +433 -0
  316. package/lib/types/ink/terminal-notification.d.ts +3 -1
  317. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  318. package/lib/types/ink/terminal-notification.js +4 -1
  319. package/lib/types/ink/terminal-querier.d.ts +9 -1
  320. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  321. package/lib/types/ink/terminal-querier.js +32 -1
  322. package/lib/types/ink/terminal.d.ts +23 -2
  323. package/lib/types/ink/terminal.d.ts.map +1 -1
  324. package/lib/types/ink/terminal.js +32 -2
  325. package/lib/types/ink/termio/osc.d.ts +2 -1
  326. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  327. package/lib/types/ink/termio/osc.js +37 -8
  328. package/lib/types/ink/termio/osc7501.d.ts +102 -0
  329. package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
  330. package/lib/types/ink/termio/osc7501.js +229 -0
  331. package/lib/types/ink/termio/tokenize.js +5 -7
  332. package/lib/types/panels.d.ts +1 -1
  333. package/lib/types/panels.d.ts.map +1 -1
  334. package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
  335. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  336. package/lib/types/screens/AgentTranscriptScene.js +5 -1
  337. package/lib/types/screens/Chat.d.ts +6 -6
  338. package/lib/types/screens/Chat.d.ts.map +1 -1
  339. package/lib/types/screens/Chat.js +304 -111
  340. package/lib/types/screens/Launchpad.d.ts +8 -2
  341. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  342. package/lib/types/screens/Launchpad.js +32 -12
  343. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  344. package/lib/types/screens/SessionSupervisor.js +31 -21
  345. package/lib/types/screens/Settings.d.ts +5 -1
  346. package/lib/types/screens/Settings.d.ts.map +1 -1
  347. package/lib/types/screens/Settings.js +528 -51
  348. package/lib/types/screens/StatusLine.d.ts +9 -3
  349. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  350. package/lib/types/screens/StatusLine.js +91 -15
  351. package/lib/types/screens/StatusMetrics.d.ts +2 -11
  352. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  353. package/lib/types/screens/StatusMetrics.js +20 -14
  354. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  355. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
  356. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  357. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  358. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
  359. package/lib/types/sessionMounts.d.ts +14 -0
  360. package/lib/types/sessionMounts.d.ts.map +1 -1
  361. package/lib/types/sessionMounts.js +20 -9
  362. package/lib/types/sessions/format.d.ts +39 -0
  363. package/lib/types/sessions/format.d.ts.map +1 -1
  364. package/lib/types/sessions/format.js +83 -0
  365. package/lib/types/sessions/resumeFailure.d.ts +4 -0
  366. package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
  367. package/lib/types/sessions/resumeFailure.js +12 -4
  368. package/lib/types/sessions/workspaceCounts.d.ts +6 -0
  369. package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
  370. package/lib/types/sessions/workspaceCounts.js +24 -0
  371. package/lib/types/settings/definitions.d.ts +24 -0
  372. package/lib/types/settings/definitions.d.ts.map +1 -1
  373. package/lib/types/settings/definitions.js +38 -13
  374. package/lib/types/tips.js +2 -2
  375. package/lib/types/tuiDisplayPrefs.d.ts +113 -5
  376. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  377. package/lib/types/tuiDisplayPrefs.js +276 -14
  378. package/lib/types/update.d.ts +46 -36
  379. package/lib/types/update.d.ts.map +1 -1
  380. package/lib/types/update.js +248 -157
  381. package/lib/types/updateProcess.d.ts +28 -0
  382. package/lib/types/updateProcess.d.ts.map +1 -0
  383. package/lib/types/updateProcess.js +135 -0
  384. package/lib/types/utils/inputWordBoundary.d.ts +5 -0
  385. package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
  386. package/lib/types/utils/inputWordBoundary.js +18 -0
  387. package/lib/types/utils/keymap.d.ts +1 -1
  388. package/lib/types/utils/keymap.d.ts.map +1 -1
  389. package/lib/types/utils/keymap.js +6 -1
  390. package/lib/types/windowsInstaller.d.ts +4 -0
  391. package/lib/types/windowsInstaller.d.ts.map +1 -0
  392. package/lib/types/windowsInstaller.js +237 -0
  393. package/locale/en.json +6 -0
  394. package/locale/zh.json +6 -0
  395. package/package.json +127 -111
  396. package/presets/liangshen/custom-bash.mjs +13 -1
  397. package/presets/liangshen/instruction-hint.mjs +4 -1
  398. package/presets/liangshen/skill-search.mjs +14 -2
  399. package/presets/winbash.mjs +16 -4
  400. package/tui-profile/feed/README.md +17 -8
  401. package/tui-profile/feed/first-party.json +1 -1
@@ -30,6 +30,7 @@ description: Use when the user asks about dsh-tui itself (usage, shortcuts, conf
30
30
  | Codex 后端:安装、登录、渠道、Plan、会话与原生能力 | `codex-backend.md` |
31
31
  | 主题、配色、自动检测、自定义主题 | `themes.md` |
32
32
  | 从 Claude Code / Codex / OMP / zcode / Grok 迁移会话 | `migrate.md` |
33
+ | 无界面执行、JSON 输出、CLI 会话查询与官方转接 | `cli.md` |
33
34
  | VS Code 集成、扩展、IDE 选区 | `vscode.md` |
34
35
  | 插件生态、接缝稳定性分级 | `plugins.md` |
35
36
 
@@ -32,6 +32,14 @@ You need:
32
32
  cd ~/.dsh/profiles/dsh-tui && pnpm add @anthropic-ai/claude-agent-sdk@0.3.287
33
33
  ```
34
34
 
35
+ The SDK ships as all-platform optional dependencies (one native bundle per
36
+ platform, about 230MB unpacked). The profile's
37
+ `ignoredOptionalDependencies` keeps only the running platform's bundle, and
38
+ the installer recomputes that list for the current machine, so a reinstall
39
+ after moving platforms still fetches exactly one. `/update` and
40
+ `dsh-tui update` never install the SDK on their own: when the profile does
41
+ not depend on it, they do not bring it in.
42
+
35
43
  - A Claude credential; see "Signing in" below.
36
44
  - The `claude` command is optional: dsh-TUI probes an **explicitly specified
37
45
  executable path** (an environment variable, used as set, with no version check;
@@ -25,6 +25,11 @@ dsh-TUI 可以把会话跑在 Claude Agent 后端上,而不是 DeepSeek Harnes
25
25
  cd ~/.dsh/profiles/dsh-tui && pnpm add @anthropic-ai/claude-agent-sdk@0.3.287
26
26
  ```
27
27
 
28
+ SDK 以全平台可选依赖分发(每个平台一个原生包,解包约 230MB)。profile 的
29
+ `ignoredOptionalDependencies` 只放行本机平台的包,安装器每次按当前机器重算
30
+ 这份名单,换平台后重装也只取对应那个。`/update` 与 `dsh-tui update` **不会**
31
+ 主动安装 SDK:profile 里没有这个依赖时,它们不会把它带进来。
32
+
28
33
  - 一份 Claude 凭据,见下面的「登录」。
29
34
  - `claude` 命令不是必需的:按**显式指定的可执行路径**(环境变量,设置后原样采用,不做版本校验;
30
35
  变量名见[多后端架构](agent-backend-design.md))→ `PATH` 上的 `claude` → 用户主目录下的
@@ -0,0 +1,114 @@
1
+ # Automation CLI
2
+
3
+ [Documentation index](README.md) · [简体中文](cli.md)
4
+
5
+ Plain `dst` / `dsh-tui` still opens the TUI. Explicit `run`, `-p`, or `cli` selects an independent automation application in root `cli/`, outside `src/`. It never loads React, Ink, the channel, TUI preferences, or bootstraps the TUI profile. Tracking: #1558 and #1559, under #1246.
6
+
7
+ ## Getting started
8
+
9
+ ```sh
10
+ dst -p "inspect this project"
11
+ echo "complete task" | dst run --json
12
+ echo "source material" | dst run "summarize the material below" --output-format stream-json
13
+ dst run --cwd ./repo --provider deepseek-official --model deepseek-flash "check types"
14
+ dst run --session-id session-123 "continue"
15
+ dst run --continue "continue this directory's latest compatible root session"
16
+ dst cli --help
17
+ ```
18
+
19
+ Install the official DSH CLI. The automation adapter currently validates **0.2.0-rc.2, 0.2.1-rc.2 and 0.2.1-rc.3**; other versions are rejected before a task starts. `dst dsh <args...>` bypasses protocol conversion and this version restriction. Resolution follows the first DSH installation on PATH. Use `--dsh-bin /path/to/dsh/lib/bin.js` or `DSH_TUI_CLI_DSH_BIN` for an explicit built JS entry belonging to the official package. The adapter never executes a `.cmd`, PowerShell command, or interpolated shell string.
20
+
21
+ ### Input, output and execution
22
+
23
+ - Positional prompt and piped stdin are joined with two newlines when both exist. Stdin UTF-8 and line endings are preserved. Everything after `--` is literal prompt text; a lone `-` selects stdin only.
24
+ - Input is capped at 8 MiB and each backend JSONL record at 32 MiB. The whole event stream is not retained in memory.
25
+ - `--cwd` / `--workspace` sets child cwd. `--profile` defaults to `headless`, not `dsh-tui`. DSH owns profile initialization, configuration, sessions, and policy under `$DSH_HOME` (the official default home when omitted).
26
+ - Repeatable `--patch` paths resolve relative to the invoking directory. Explicit model parameters become a temporary overlay with an exact provider/model route; no guessed route or persisted default-model change. Profiles and overlays execute trusted code, not a sandbox.
27
+ - `--permission-mode` accepts DSH `read-only`, `workspace-write`, or `danger-full-access`. TUI permission memory is not inherited. Permissions are never silently expanded. Without an answerer, official approval fails closed. DSH `approval: never` rejects approval requests; it does not auto-approve.
28
+ - `--timeout MS` covers input, execution, and management queries; default 0 is unlimited. Ctrl+C/SIGTERM stops the owned child tree and awaits cleanup, without safe mode or task replay. Windows process termination is not a cooperative POSIX signal; official log validation decides crash recovery.
29
+
30
+ | Format | Content |
31
+ | --- | --- |
32
+ | `text` (default) | Final answer; management data is pretty JSON, except Markdown export |
33
+ | `json` / `--json` | One `schemaVersion: 1` result with `ok` and `text/sessionId` or management `data` |
34
+ | `stream-json` | Versioned session/status/text/thinking/tool_call/tool_result records, followed by a verified result; failure emits error |
35
+
36
+ Text streams at **committed-message boundaries**, not per token. `ok: true` is published only after backend exit, completed outcome, and complete result validation. The shipped `cli/schema-v1.json` describes records. JSON failures carry `error.code`, `error.message`, and `exitCode`. Raw backend diagnostics, exception objects, and credentials are not reflected by default. Streaming includes model text, thinking and tool results; store logs accordingly.
37
+
38
+ Exit codes: 0 success, 1 task/runtime failure, 2 usage/input bound, 3 unavailable host/capability/session, 4 protocol/output bound, 124 deadline, 130 interrupted, 143 terminated. Native `dst dsh` preserves official streams, terminal descriptors and exit codes without JSON wrapping.
39
+
40
+ ## Management
41
+
42
+ ```sh
43
+ dst session list --json # current cwd, at most 50 rows by default
44
+ dst session list --all --limit 100 --json
45
+ dst session show <id> --json # validated official log snapshot
46
+ dst session export <id> > session.md # visible current-surface text, not a backup
47
+ dst models list --provider deepseek-official --json
48
+ dst skills list --json
49
+ dst mcp status --json
50
+ dst auth status --json
51
+ dst capabilities --json
52
+ dst dsh --profile headless --help
53
+ dst dsh plugin --profile dsh-tui add <package>
54
+ ```
55
+
56
+ A separate Cordis plugin calls public `sessionQuery`, `llm`, `skills`, `tools`, and `credentials` services. It does not scan JSONL, copy a credential store, read TUI caches, or write profile files. The chosen profile must be headless-compatible. Missing services, invalid records, and failed queries return explicit errors.
57
+
58
+ - `--session-id` resumes only existing, cwd-matching root sessions without a preset/fork/subagent identity. `--continue` selects by validated recent log activity through official queries, not TUI resume.txt; no compatible session means failure, never a silent fresh session. DSH revalidates after acquiring its write lease.
59
+ - `session export` is Markdown user/assistant text from the current visible surface, not attachments, complete tool output or ZIP. `show --json` is a validated event snapshot, not a physical backup.
60
+ - `skills list` reads the profile's global scope for this cwd, not a TUI preset's catalog.
61
+ - `mcp status` observes registered `mcp__...` tools and explicitly returns `connectionHealth: unavailable`; it cannot determine connectivity of a server with no tools.
62
+ - `auth status` describes only `DEEPSEEK_API_KEY` presence/source. It never returns the value or claims account login, key validity, or every provider's authentication. DSH 0.2.1 disables the credential service in its default headless profile, so this command returns `CAPABILITY_UNAVAILABLE` (exit 3). To query it, explicitly choose a compatible profile or `--patch` that mounts that service; the CLI does not enable the credential store itself.
63
+ - `capabilities` describes adapter operations and version limits, not proof that an arbitrary custom profile supplies every service.
64
+
65
+ ## Separation and migration
66
+
67
+ ```text
68
+ bin/dsh-tui.js (lazy dispatch only)
69
+ cli/entry.mjs (sole composition root)
70
+ args + engine + protocol + process
71
+ | injected CliAdapter
72
+ adapters/dsh/ (official subprocess + public-service plugin)
73
+ ```
74
+
75
+ `contracts.d.ts` defines the small internal adapter interface. The engine imports neither adapters, vendors, nor `src/`; entry alone selects an adapter. Add operations only when executable—no placeholder commands, empty classes or speculative general service locators. For a future official CLI, implement the same interface, run the same contract tests, and change composition wiring. Preserve user syntax; never duplicate domain logic or switch implementations after failure to replay a task. A new protocol version requires explicit adapter/schema/test validation; a higher version number alone proves nothing.
76
+
77
+ The global launcher prefers the updated profile's CLI, then its own shipped CLI. Missing files in a partial installation fail without installing anything. Plain help/version/safe remain independent. npm and installer distributions ship ready-to-run ESM, without tsx or TUI compilation output. Standalone invokes the same extracted CLI; automation subprocesses need system Node `^22.19 || >=24` (override `DSH_TUI_CLI_NODE`), rather than recursively treating the pkg binary as Node.
78
+
79
+ Not implemented: arbitrary TUI-preset resume, settings/credential writes, noninteractive OAuth, MCP reconnect, persistent background daemon, Claude/Codex automation adapters, or Claude cloud/Remote Control. Slash commands do not automatically become Shell commands. These are outside the current phase-two checklist and remain future scope under the parent issue.
80
+
81
+ ## Programmatic examples
82
+
83
+ Node (`shell:false`; on Windows locate the package JS bin instead of interpolating a `.cmd`):
84
+
85
+ ```js
86
+ import { spawn } from 'node:child_process'
87
+ const child = spawn(process.execPath, ['/absolute/dsh-tui/bin/dsh-tui.js', 'run', '--json'], { stdio: ['pipe', 'pipe', 'pipe'], shell: false })
88
+ child.stdin.end('inspect the current directory')
89
+ let text = ''
90
+ child.stdout.setEncoding('utf8').on('data', chunk => { text += chunk })
91
+ child.stderr.on('data', chunk => process.stderr.write(chunk))
92
+ child.on('close', code => { const result = JSON.parse(text); console.log(code, result.ok) })
93
+ ```
94
+
95
+ Python:
96
+
97
+ ```python
98
+ import json, subprocess
99
+ p = subprocess.run(['node', '/absolute/dsh-tui/bin/dsh-tui.js', 'run', '--json'], input='inspect the current directory', text=True, encoding='utf-8', capture_output=True)
100
+ result = json.loads(p.stdout)
101
+ print(p.returncode, result['ok'])
102
+ ```
103
+
104
+ PowerShell:
105
+
106
+ ```powershell
107
+ $result = & node 'C:\path\dsh-tui\bin\dsh-tui.js' run --json 'inspect the current directory'
108
+ $code = $LASTEXITCODE
109
+ $data = $result | ConvertFrom-Json
110
+ if ($code -ne 0) { throw $data.error.code }
111
+ $data.text
112
+ ```
113
+
114
+ Validation: `pnpm verify:cli` (cross-platform fake processes, separation and negative tests); `DST_TEST_DSH_BIN=<official JS bin> pnpm verify:cli:runtime` (real official profile in a temporary home with a fake provider, no paid model).
@@ -0,0 +1,114 @@
1
+ # 自动化 CLI
2
+
3
+ [文档索引](README.md) · [English](cli.en.md)
4
+
5
+ `dst` / `dsh-tui` 的普通启动仍进入 TUI。显式 `run`、`-p` 或 `cli` 进入独立的无界面 CLI;不会加载 React、Ink、channel、TUI 偏好或自举 TUI profile。实现位于根级 `cli/`,不在主应用 `src/` 中。跟踪:#1558、#1559(总目标 #1246)。
6
+
7
+ ## 快速开始
8
+
9
+ ```sh
10
+ dst -p "检查当前项目"
11
+ echo "完整任务正文" | dst run --json
12
+ echo "待分析材料" | dst run "总结以下材料" --output-format stream-json
13
+ dst run --cwd ./repo --provider deepseek-official --model deepseek-flash "检查类型"
14
+ dst run --session-id session-123 "继续"
15
+ dst run --continue "继续当前目录最近的兼容主会话"
16
+ dst cli --help
17
+ ```
18
+
19
+ 需要安装官方 DSH,当前自动化 adapter 验证版本是 **0.2.0-rc.2、0.2.1-rc.2 与 0.2.1-rc.3**;其他版本在任务开始前拒绝。`dst dsh <参数...>` 不经过本地协议转换,不限制官方版本。解析 PATH 上第一个 DSH 安装,也可用 `--dsh-bin /path/to/dsh/lib/bin.js` 或 `DSH_TUI_CLI_DSH_BIN` 指定官方包的已构建 JS 入口;不执行 `.cmd`、PowerShell 或任意 shell 字符串。
20
+
21
+ ### 输入、输出和执行
22
+
23
+ - 输入是位置提示词加 stdin(两者都有时以两个换行连接),保留 stdin 的 UTF-8 和行尾。`--` 后都是字面提示词。单独 `-` 表示只读 stdin。
24
+ - stdin 上限 8 MiB;单条后端 JSONL 记录上限 32 MiB。不会无限缓存整个运行事件。
25
+ - `--cwd` / `--workspace` 指定子进程目录;`--profile` 默认 `headless`,不是 `dsh-tui`。DSH 仍拥有 `$DSH_HOME`(默认官方 home)的 profile 初始化、配置、会话与策略。
26
+ - `--patch` 可重复,路径相对调用目录解析;模型参数最终以一次性 overlay 指定准确 provider/model,不猜渠道、不持久修改默认模型。用户 overlay 和 profile 是受信任代码,不是沙箱。
27
+ - `--permission-mode` 接受 DSH 的 `read-only`、`workspace-write`、`danger-full-access`。不继承 TUI 权限记忆;不自动放宽权限。没有审批答复者时官方服务 fail-closed。`approval: never` 在 DSH 中表示拒绝审批,不是自动批准。
28
+ - `--timeout <毫秒>` 覆盖输入等待、运行与管理查询;默认 0 为无期限。Ctrl+C/SIGTERM 停止本次子进程树,等待清理,不进入 TUI 安全模式、不重放任务。Windows 的进程终止不是可协作的 POSIX 信号,强制停止后的恢复由官方日志校验决定。
29
+
30
+ | 输出格式 | 内容 |
31
+ | --- | --- |
32
+ | `text`(默认) | 最终答案;管理查询输出 JSON 便于人读,Markdown 导出除外 |
33
+ | `json` / `--json` | 一条 `schemaVersion: 1` 的 `result`,含 `ok` 与 `text/sessionId` 或管理 `data` |
34
+ | `stream-json` | 带版本的 session/status/text/thinking/tool_call/tool_result 事件,最后输出验证过的 result;失败输出 error |
35
+
36
+ 流式正文来自**已提交消息**,不是逐 token 流。只有后端正常退出、结束原因为 completed、结果完整后才输出 `ok: true`。字段和类型见随包 `cli/schema-v1.json`;JSON 失败包含 `error.code`、`error.message`、`exitCode`。默认不把后端原始诊断、异常对象或凭据写进输出;明确选择流式格式会包含模型正文、思考及工具结果,应妥善保管日志。
37
+
38
+ 退出码:0 成功,1 任务/运行失败,2 用法或输入上限,3 宿主/能力/会话不可用,4 协议/输出上限,124 超时,130 中断,143 终止。`dst dsh` 保留官方输出、终端描述符和退出码,不加本地 JSON 包装。
39
+
40
+ ## 管理命令
41
+
42
+ ```sh
43
+ dst session list --json # 当前 cwd,默认最多 50 条
44
+ dst session list --all --limit 100 --json
45
+ dst session show <id> --json # 官方校验过的日志快照
46
+ dst session export <id> > session.md # 官方当前 surface 的可见文字,非完整备份
47
+ dst models list --provider deepseek-official --json
48
+ dst skills list --json
49
+ dst mcp status --json
50
+ dst auth status --json
51
+ dst capabilities --json
52
+ dst dsh --profile headless --help
53
+ dst dsh plugin --profile dsh-tui add <package>
54
+ ```
55
+
56
+ 管理命令经独立 Cordis 插件调用官方 `sessionQuery`、`llm`、`skills`、`tools`、`credentials` 服务。不会扫描 JSONL、复制凭据库、读取 TUI 缓存或自行写 profile。指定的 profile 必须兼容 headless 组合;缺服务、无效记录或查询失败明确报错。
57
+
58
+ - `--session-id` 只恢复已存在、cwd 匹配、没有 preset/fork/子代理身份的官方兼容主会话。`--continue` 用官方查询结果和最近日志活动选择,不读取 TUI 的 resume.txt;找不到兼容会话失败,不静默新建。查询后取得写租约时仍由官方重新校验。
59
+ - `session export` 仅输出当前可见 user/assistant 文字的 Markdown,不含附件、完整工具结果或 ZIP;`show --json` 是校验后的事件快照,不冒充物理备份。
60
+ - `skills list` 是当前 profile 全局作用域、当前 cwd 的目录,不代表某个 TUI preset 的技能。
61
+ - `mcp status` 只报告已注册的 `mcp__...` 工具,明确返回 `connectionHealth: unavailable`,不能据此判断无工具的服务器是否连接。
62
+ - `auth status` 只查 `DEEPSEEK_API_KEY` 的配置状态及来源,不返回值,不代表账号登录成功、key 有效或所有 provider 已认证。DSH 0.2.1 的默认 headless profile 禁用了凭据服务,此命令返回 `CAPABILITY_UNAVAILABLE`(退出码 3);需要查询时,显式选择挂载该服务的兼容 profile 或 `--patch`,CLI 不会自行启用凭据库。
63
+ - `capabilities` 声明 adapter 实现的命令及版本限制,不保证任意自定义 profile 都挂载了相应服务。
64
+
65
+ ## 与 TUI 和未来官方 CLI 的边界
66
+
67
+ ```text
68
+ bin/dsh-tui.js(只做惰性分发)
69
+ cli/entry.mjs(唯一组装根)
70
+ args + engine + protocol + process
71
+ │ 注入 CliAdapter
72
+ adapters/dsh/(官方子进程 + 公开服务插件)
73
+ ```
74
+
75
+ `contracts.d.ts` 定义小型内部 adapter 接口。引擎不 import adapter、厂商或 `src/`;只有 entry 选择 adapter。新增命令要有实际可执行能力,不用空类、万能 service locator 或大量预占方法。未来换官方 CLI 时,实现同一接口,运行同一契约测试,切换组装根;不要改用户语法,不复制领域实现,不因执行失败切另一引擎重跑。新协议版本需要显式更新 adapter 与 schema/测试,不能把新版号当兼容证明。
76
+
77
+ global 启动器优先使用已更新 profile 中的 CLI,缺席才使用自己随包的 CLI;半安装缺模块时退出,不自动安装。普通 help/version/safe 仍不依赖 CLI。npm 包和安装器随包分发现成 ESM,无需 tsx 或 TUI 编译产物。standalone 也从解压运行时调用同一 CLI;自动化子进程需要系统 Node `^22.19 || >=24`(可用 `DSH_TUI_CLI_NODE` 指定),不把 pkg 自身当普通 node 递归启动。
78
+
79
+ 暂未实现:任意 TUI preset 会话接续、设置/凭据写操作、OAuth 非交互登录、MCP 重连、常驻后台 daemon、Claude/Codex 自动化 adapter、Claude 云端/Remote Control。已有 slash 命令不因此自动变成 Shell 子命令;这些不属于二期当前验收清单,仍由总目标后续讨论。
80
+
81
+ ## 程序调用示例
82
+
83
+ Node(shell:false;Windows 请定位 npm 包的 JS bin,避免 `.cmd` 插值):
84
+
85
+ ```js
86
+ import { spawn } from 'node:child_process'
87
+ const child = spawn(process.execPath, ['/absolute/dsh-tui/bin/dsh-tui.js', 'run', '--json'], { stdio: ['pipe', 'pipe', 'pipe'], shell: false })
88
+ child.stdin.end('检查当前目录')
89
+ let text = ''
90
+ child.stdout.setEncoding('utf8').on('data', chunk => { text += chunk })
91
+ child.stderr.on('data', chunk => process.stderr.write(chunk))
92
+ child.on('close', code => { const result = JSON.parse(text); console.log(code, result.ok) })
93
+ ```
94
+
95
+ Python:
96
+
97
+ ```python
98
+ import json, subprocess
99
+ p = subprocess.run(['node', '/absolute/dsh-tui/bin/dsh-tui.js', 'run', '--json'], input='检查当前目录', text=True, encoding='utf-8', capture_output=True)
100
+ result = json.loads(p.stdout)
101
+ print(p.returncode, result['ok'])
102
+ ```
103
+
104
+ PowerShell:
105
+
106
+ ```powershell
107
+ $result = & node 'C:\path\dsh-tui\bin\dsh-tui.js' run --json '检查当前目录'
108
+ $code = $LASTEXITCODE
109
+ $data = $result | ConvertFrom-Json
110
+ if ($code -ne 0) { throw $data.error.code }
111
+ $data.text
112
+ ```
113
+
114
+ 验证:`pnpm verify:cli`(跨平台、假宿主、解耦与负向测试);`DST_TEST_DSH_BIN=<官方 JS bin> pnpm verify:cli:runtime`(临时 home + 假 provider 的真实官方运行时闭环,无付费模型)。
@@ -26,7 +26,7 @@ only for a genuinely new service.
26
26
  > When a row is overridden, its `config` block is replaced as a whole. It is
27
27
  > not deep-merged, so repeat every key that must remain active.
28
28
 
29
- ## Web search and fetch (DSH 0.2.1-rc.2)
29
+ ## Web search and fetch (DSH 0.2.1-rc.3)
30
30
 
31
31
  The standard DSH profile loads the new DeepSeek Search / Fetch API providers,
32
32
  while Messages search and local HTTP fetch remain the defaults. In `/settings`,
@@ -151,8 +151,8 @@ A complete common override looks like this:
151
151
  | `model` | Harness `agentDefaultModel`; bare compositions fall back to `deepseek-flash` | Startup model; `/model` selects the next request’s model within the same session. Precedence: the persisted `/model` choice (`~/.dsh-tui/model.json`, the route the last session ran, whole pair) > a complete `provider`+`model` pair here (deployment default) > the harness default. A half pin (provider or model alone) counts as unset and never merges with half the preference (issue #67) |
152
152
  | `cwd` | git worktree root containing the launch directory (`process.cwd()` when outside any worktree; a dotfiles repo at `$HOME` does not count) | TUI-side session workspace: agent meta, `@` completion/mention expansion, /resume filtering, statusline; resuming an existing session adopts that session's persisted cwd. Note the bash/fs-policy/sandbox roots are still owned by the composition layer's cordis config (default: the launch directory, governed by dsh-base) and may differ from this session-side cwd |
153
153
  | `workspace` | unset | Startup workspace target: a local path, `file://` URL, or plugin-provided URI; takes precedence over `cwd` |
154
- | `effort` | normally `max` in the bundle | Reasoning effort applied to every request (validated against the runtime model's levels; invalid levels silently fall back to the adapter default), also shown in the header at startup. Precedence: /settings `effortDefault` (`auto` defers) > the persisted `/effort` choice (`~/.dsh-tui/effort.json`, the level the last session ran on) > this field (deployment default) > the model default |
155
- | `effortDefault` | unset | Default reasoning effort for new sessions (the `/settings` user layer; an explicit value outranks the persisted `/effort` choice); `auto` defers to the persisted choice and `effort`; editable through `/settings` |
154
+ | `effort` | normally `max` in the bundle | Reasoning effort applied to every request (validated against the runtime model's levels; unsupported preferences fall back to a lower offered tier or the model default, with a notice), also shown in the header at startup. Precedence: /settings `effortDefault` (`auto` defers) > the persisted `/effort` choice (`~/.dsh-tui/effort.json`, the level the last session ran on) > this field (deployment default) > the model default |
155
+ | `effortDefault` | unset | Default reasoning effort (`/settings` user layer). On DSH, an explicit value outranks persisted `/effort`; `auto` defers to that choice and `effort`. Claude/Codex apply changes through their own controls and backend preferences; Auto at startup and resumed sessions retain those preferences, and explicitly choosing Auto resets the model default. `/settings` offers the current backend/model's actual effort catalog, including custom IDs. An unsupported saved value remains readable and stored; during loading/failure only Auto is selectable. Explicit changes reach the next request; resuming a session preserves its own effort |
156
156
  | `whale` / `whaleIdle` | `true` / `true` | Header whale and welcome-page idle animation |
157
157
  | `splashFont` | `daily` | Big-text face on the header splash: `daily` rotates by local date (the default), any other value is a face id (`bold` / `square` / `bevel` / `wide` / `dot` / `stencil` / `classic` / `slab`) pinning that one; an unknown value falls back to `daily`. Also editable through `/settings` |
158
158
  | `whaleGirl` | `false` | Maid-portrait toggle: For the DeepSeek brand, Companion skins deepy and whaleGirl take the splash art slot; choose whale and enable Maid portrait to show the maid. 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. "Companion skin" is `companion.skin`; when the toggle does apply, the portrait renders the real raster through the terminal image protocols (Kitty/Sixel) and falls back to the character-art maid without them. See the precedence table below |
@@ -160,7 +160,7 @@ A complete common override looks like this:
160
160
  | `sidePanel.splitEnabled` | `true` (boolean) | Master switch of the split layout: on, `Ctrl+B` and `/panel` open the side column next to the chat; off, neither splits and `/jobs` & co. keep their full-screen panels. Applies immediately |
161
161
  | `sidePanel.open` | `false` (boolean) | Whether a session opens with the sidebar already expanded; off by default, so the upgrade leaves the layout as it was. An in-session `Ctrl+B` / `/panel toggle` is not written back here. Applies immediately |
162
162
  | `sidePanel.ratio` | `0.68` (number, 0.1–0.95) | Chat column as a fraction of the content width; while the panel has focus, `+`/`-` nudge it live for the current session (not written back). Applies immediately |
163
- | `sidePanel.panels` | `todo,jobs,agents,info,trajectory,workspace,btw,companion` (comma-separated text) | All eight built-in panels are enabled by default; this controls their ids and order. A well-formed id no panel claims yet stays in the tab bar for a plugin to register later; a malformed entry is refused. The `⤢` on the right edge of the bar blows the active panel up to full screen (drawn only for panels that declare a fullscreen form). Applies immediately |
163
+ | `sidePanel.panels` | `*` (`*` or comma-separated text) | `*` (the default) enables every registered panel — the eight built-ins in their default order, then plugin panels in registry order; registering or unregistering a panel never rewrites this value. An explicit comma list enables **exactly** those ids, in PanelBar order: a registered panel it does not name (including one registered later) stays off, shown unchecked in `/settings` and one tick away; a well-formed id nothing claims yet stays in the tab bar as a checked placeholder for a plugin to register later. A malformed entry is refused (the store is tolerant: bad tokens are dropped, and a value with no usable id falls back to `*`). The `⤢` on the right edge of the bar blows the active panel up to full screen (drawn only for panels that declare a fullscreen form). Applies immediately. Temporary plugin panels show their titles and distinct run-local numbers; their toggles affect only this run and are never saved, and a legacy `actN:panel` placeholder never claims a panel — remove it and reselect. A verified Component named `actN` keeps its runtime address and is recorded as `component:actN:panel` only in saved preferences. |
164
164
  | `companion.skin` | `deepy` | Skin of the companion-panel pet: `deepy` (default, the deepy whale kit), `whaleGirl` (the whale-girl sticker pack, 22 animations incl. interaction reactions) or `whale` (the splash's layered pixel whale); the panel is enabled by default and can be changed in `sidePanel.panels`. **For the DeepSeek brand it also picks the splash (header) art slot**: while Companion skin is deepy or whaleGirl, that mascot takes the slot (neither the pixel whale nor the maid portrait is drawn) and the Maid-portrait toggle (`whaleGirl`) has no effect; set Companion skin to whale to get the original path back (the pixel whale, or the maid portrait once the toggle is on). Applies immediately; see the precedence table below |
165
165
  | `btw.contextTurns` | `4` (number, 1–8) | Completed Q/A pairs a `/btw` follow-up carries; older pairs stay in the thread and panel but are not sent. Applies immediately |
166
166
  | `btw.contextBudget` | `24000` (number, 1000–200000) | Character budget for the recent Q/A pairs a `/btw` follow-up carries; the oldest pairs drop first. Applies immediately |
@@ -405,6 +405,7 @@ for the complete field reference.
405
405
  | `DSH_TUI_PRESET` | Override the default Agent preset for new sessions |
406
406
  | `DSH_TUI_THEME` | Pin a built-in (`auto`/`light`/`dark`/`dark-ansi`/`pink-day`/`pink-night`/`pink-ansi`), static theme, or registered plugin theme ahead of persisted selection |
407
407
  | `DSH_TUI_DISABLE_MOUSE` | Temporarily disable mouse handling in fullscreen mode |
408
+ | `DSH_TUI_PROGRAM_STATUS` | Set to `0` (or `false`/`no`/`off`) to stop reporting session state to the terminal with [OSC 7501](https://www.superlogical.com/rex/docs/build/program-status); on by default and a no-op on terminals that do not implement it |
408
409
  | `DSH_TUI_DISABLE_TERMINAL_IMAGES` | Set to `1` to force Kitty/Sixel probing, preview reads/decoding, and terminal image rendering off, overriding config and /settings; text metadata remains visible |
409
410
  | `DSH_TUI_IMAGE_PROTOCOL` | `auto` (default), `kitty`, `sixel`, or `none`; override protocol selection without bypassing the preview preference, disable switch, non-fullscreen, accessibility or multiplexer guards |
410
411
  | `DSH_TUI_RESUME_SESSION` | Resume a session at startup, normally set by a launcher |
@@ -475,7 +476,7 @@ The `/provider` add branch signs in to ChatGPT/Codex (`openai-codex`), Claude
475
476
  (`anthropic`), or Grok (`xai`) subscriptions. When the installed host's pi-ai
476
477
  catalog ships the corresponding flows, it also offers OpenAI direct ChatGPT sign-in
477
478
  (`openai`, using the OpenAI API rather than the legacy Codex backend) and Meta
478
- Muse (`meta`). The primary validated DSH `0.2.1-rc.2` development fixture resolves pi-ai
479
+ Muse (`meta`). The primary validated DSH `0.2.1-rc.3` development fixture resolves pi-ai
479
480
  `1.2.0`, which includes Meta Muse and OpenAI direct sign-in.
480
481
  `/auth status`, `/auth login [provider]`, and `/auth logout <provider>` use
481
482
  that credential store for these pi-ai routes. Browser authorization tries to open the page
@@ -25,7 +25,7 @@ Profile 启动按顺序叠加:
25
25
  > 覆盖某一行时,`config` 是整块替换,不是逐字段深合并。需要继续生效的字段必须
26
26
  > 在用户补丁中全部重写。
27
27
 
28
- ## 网页搜索与抓取(DSH 0.2.1-rc.2)
28
+ ## 网页搜索与抓取(DSH 0.2.1-rc.3)
29
29
 
30
30
  标准 DSH profile 会加载新的 DeepSeek Search / Fetch API 提供者,默认仍使用
31
31
  Messages 搜索和本地 HTTP 抓取。在 `/settings` 的「网页搜索」分区,用左右键将
@@ -134,8 +134,8 @@ TUI bundle 继承已安装 DSH 官方组合的上报配置;上游未提供的
134
134
  | `model` | Harness `agentDefaultModel`;裸组合回落 `deepseek-flash` | 启动模型;`/model` 可在同一 session 内切换后续请求的模型。优先级:`/model` 持久化选择(`~/.dsh-tui/model.json`,上次实际运行的路由,完整 pair)> 此处的完整 `provider`+`model` 对(部署默认值)> Harness 默认。半 pin(只有 `provider` 或只有 `model`)视为未设置,绝不与偏好拼成半个路由(issue #67) |
135
135
  | `cwd` | 启动目录所在的 git worktree 根(不在任何 worktree 内时为 `process.cwd()`;家目录的 dotfiles 仓不算) | TUI 会话侧工作区:agent meta、`@` 补全/提及展开、/resume 过滤、状态栏;恢复已有会话时以该会话持久化的 cwd 为准。注意 bash/fs-policy/sandbox 的根仍由组合层 cordis 配置决定(默认启动目录,归 dsh-base 管),与这里的会话侧 cwd 可能不同 |
136
136
  | `workspace` | 未设置 | 启动工作区目标;可用本地路径、`file://` URI 或插件提供的 URI,设置后优先于 `cwd` |
137
- | `effort` | 配置层通常为 `max` | 每个请求实际生效的推理等级(按运行时模型档位校验,非法档位静默回落默认;兼作顶栏启动显示)。优先级:/settings 的 `effortDefault`(`auto` 时让位)> `/effort` 持久化选择(`~/.dsh-tui/effort.json`,上次实际运行的档位)> 本字段(部署默认值)> 模型默认 |
138
- | `effortDefault` | 未设置 | 新会话默认推理强度(`/settings` 用户层,显式设定时优先于持久化 `/effort`);`auto` 让位给持久化选择与 `effort`,可经 `/settings` 修改 |
137
+ | `effort` | 配置层通常为 `max` | 每个请求实际生效的推理等级(按运行时模型档位校验,不支持的偏好向下回落到可用档位,否则回到模型默认,并给出提示;兼作顶栏启动显示)。优先级:/settings 的 `effortDefault`(`auto` 时让位)> `/effort` 持久化选择(`~/.dsh-tui/effort.json`,上次实际运行的档位)> 本字段(部署默认值)> 模型默认 |
138
+ | `effortDefault` | 未设置 | 默认推理强度(`/settings` 用户层)。DSH 显式值优先于持久化 `/effort`;`auto` 让位给持久化选择与 `effort`。Claude/Codex 通过自身控制接口和后端偏好应用修改;启动采用自动模式或恢复会话时保留后端偏好,在设置中主动选择自动会重置为模型默认。`/settings` 使用当前后端/模型的实际档位目录,包括自定义 ID;未支持的已存值仍显示并保留,加载中或失败时仅可选自动。明确修改作用于下一请求;恢复会话保留会话自己的强度 |
139
139
  | `whale` / `whaleIdle` | `true` / `true` | 标题鲸鱼与欢迎页鲸鱼闲置动画 |
140
140
  | `splashFont` | `daily` | 开屏大字字体:`daily` 按本地日期轮换(默认),其余取字体 id(`bold` / `square` / `bevel` / `wide` / `dot` / `stencil` / `classic` / `slab`)pin 住那一款;非法值回落 `daily`。也可经 `/settings` 修改 |
141
141
  | `whaleGirl` | `false` | 女仆娘立绘开关:DeepSeek 品牌下,宠物皮肤 deepy 或 whaleGirl 会占据开屏艺术槽;选 whale 并开启「女仆娘立绘」才会显示女仆娘。Claude 使用自己的图案,Codex 使用自己的真图或女仆娘字符画回退;这两个品牌的开屏图案不受宠物皮肤和女仆娘开关影响。这里「宠物皮肤」即 `companion.skin`;立绘生效时优先走终端图像协议(Kitty/Sixel)的真图,终端不支持则回落字符画版女仆娘。见下方的优先级小表 |
@@ -143,7 +143,7 @@ TUI bundle 继承已安装 DSH 官方组合的上报配置;上游未提供的
143
143
  | `sidePanel.splitEnabled` | `true`(布尔) | 分栏总开关:开启时 `Ctrl+B` 与 `/panel` 在聊天右侧展开侧栏;关闭时两者都不再分栏,`/jobs` 等仍走整屏面板。立即生效 |
144
144
  | `sidePanel.open` | `false`(布尔) | 启动时侧栏是否已展开;默认关闭,升级后布局与原来一致。会话内的 `Ctrl+B` / `/panel toggle` 不写回这里。立即生效 |
145
145
  | `sidePanel.ratio` | `0.68`(数值,0.1–0.95) | 聊天列占内容宽度的比例;侧栏有焦点时 `+`/`-` 在当前会话内实时微调(不写回)。立即生效 |
146
- | `sidePanel.panels` | `todo,jobs,agents,info,trajectory,workspace,btw,companion`(逗号分隔文本) | 默认启用全部 8 个内置面板;这里控制面板 id 与顺序。格式合法但暂无面板认领的 id 会留在标签栏等插件注册,格式非法的条目被拒绝。面板栏右端的 `⤢` 把当前面板放大成整屏(只对声明了整屏形态的面板出现)。立即生效 |
146
+ | `sidePanel.panels` | `*`(`*` 或逗号分隔文本) | 默认 `*`:启用全部已注册面板——8 个内置按默认顺序,之后注册的插件面板按注册表顺序追加;插件注册/卸载不会改写这个值。写成显式逗号列表则**精确**启用列出的 id(顺序即标签栏顺序):列表里没有的已注册面板(包括之后才注册的插件面板)保持关闭,在 `/settings` 里显示为未勾选、点一下即可加回;格式合法但暂无面板认领的 id 会保留为已勾选占位行。格式非法的条目被拒绝(存储层宽容:非法 token 丢弃,整体无有效 id 时按 `*`)。面板栏右端的 `⤢` 把当前面板放大成整屏(只对声明了整屏形态的面板出现)。立即生效。临时插件面板显示标题与本次运行编号,勾选仅当前运行生效且不保存;旧 `actN:panel` 占位项永远不认领面板,应移除后重选。名为 `actN` 的可信 Component 保留运行时地址,仅在持久偏好中以 `component:actN:panel` 记录。 |
147
147
  | `companion.skin` | `deepy` | 宠物面板的皮肤:`deepy`(默认,deepy 小鲸鱼素材包)、`whaleGirl`(鲸娘表情包,22 个动画含互动反应)或 `whale`(与开屏同款分层像素鲸鱼);面板默认启用,可在 `sidePanel.panels` 调整。**DeepSeek 品牌下,它同时决定开屏(标题)艺术槽**:宠物皮肤为 deepy 或 whaleGirl 时,该槽由对应吉祥物占据(像素鲸鱼与女仆娘立绘都不出现),「女仆娘立绘」(`whaleGirl`)开关不生效;把宠物皮肤设为 whale 才回到原路径(像素鲸鱼;打开「女仆娘立绘」后为立绘)。立即生效,另见下方的优先级小表 |
148
148
  | `btw.contextTurns` | `4`(数值,1–8) | `/btw` 追问时带上的最近已完成问答组数;更早的组不进请求,线程和面板里仍保留。立即生效 |
149
149
  | `btw.contextBudget` | `24000`(数值,1000–200000) | `/btw` 追问携带的最近问答总字符数上限,超出时从最旧的一组开始丢。立即生效 |
@@ -356,6 +356,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
356
356
  | `DSH_TUI_PRESET` | 覆盖新会话默认 Agent preset |
357
357
  | `DSH_TUI_THEME` | 锁定内置(`auto`/`light`/`dark`/`dark-ansi`/`pink-day`/`pink-night`/`pink-ansi`)、静态主题或已注册的插件主题,优先于持久化选择 |
358
358
  | `DSH_TUI_DISABLE_MOUSE` | 在 fullscreen 模式临时关闭鼠标处理 |
359
+ | `DSH_TUI_PROGRAM_STATUS` | 设为 `0`(或 `false`/`no`/`off`)可停止用 [OSC 7501](https://www.superlogical.com/rex/docs/build/program-status) 向终端报告会话状态;默认开启,未实现该协议的终端上无副作用 |
359
360
  | `DSH_TUI_DISABLE_TERMINAL_IMAGES` | 设为 `1` 时强制关闭 Kitty/Sixel 探测、预览读取/解码与终端图片渲染,优先于 config 和 /settings;保留文字信息 |
360
361
  | `DSH_TUI_IMAGE_PROTOCOL` | `auto`(默认)、`kitty`、`sixel` 或 `none`;覆盖协议选择,但不绕过图片预览偏好、禁用开关、非全屏、无障碍和多路复用器限制 |
361
362
  | `DSH_TUI_RESUME_SESSION` | 启动时恢复指定会话,通常由启动器设置 |
@@ -414,7 +415,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
414
415
  `dsh-auth` 插件包**。`/provider` 的添加分支提供 ChatGPT/Codex(`openai-codex`)、
415
416
  Claude(`anthropic`)、Grok(`xai`)订阅账号登录。宿主 pi-ai catalog 提供相应流程
416
417
  时还可使用 OpenAI 直连 ChatGPT 登录(`openai`,使用 OpenAI API 而非旧版 Codex
417
- 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.1-rc.2` 的开发依赖解析到 pi-ai
418
+ 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.1-rc.3` 的开发依赖解析到 pi-ai
418
419
  `1.2.0`,包含 Meta Muse 与 OpenAI 直连登录。`/auth status`、`/auth login [provider]`、
419
420
  `/auth logout <provider>` 对这些 pi-ai 路由操作同一套凭据。浏览器授权会尝试自动打开页面,并在同一
420
421
  问卷中提供授权链接与手动粘贴回调 URL/代码的输入;设备码流程在轮询期间显示可复制的
@@ -114,6 +114,11 @@ dsh --profile dsh-tui
114
114
  The process starts in the current directory, which is also the Agent's default
115
115
  workspace. Change into the target project before starting it.
116
116
 
117
+ On DSH 0.2.1 and later the Agent can move its session to another directory
118
+ (the `working_directory` tool, or a Git worktree). The status line, Git branch,
119
+ `@` completion and `!` commands follow that directory, including after
120
+ `/resume`. The session stays registered under the project it started in.
121
+
117
122
  On Windows, the checkout also provides:
118
123
 
119
124
  ```bat
@@ -186,7 +191,7 @@ diagnostics, a profile plugin inventory, and repair guidance.
186
191
  reinstalls/aligns;
187
192
  - `dsh-tui doctor` runs environment diagnostics.
188
193
 
189
- ## Running in VS Code / Herdr
194
+ ## Running in VS Code / Herdr / any terminal
190
195
 
191
196
  - **VS Code**: run directly in the integrated terminal, or use the
192
197
  `dsh-tui-vscode` companion extension on the Marketplace (real terminal
@@ -196,6 +201,13 @@ diagnostics, a profile plugin inventory, and repair guidance.
196
201
  no extra setup; dsh-TUI reports `idle` / `working` / `blocked` through
197
202
  Herdr's local integration API (questionnaires and tool approvals count as
198
203
  `blocked`), and stays completely inactive outside Herdr.
204
+ - **Any terminal**: dsh-TUI reports `idle` / `working` / `blocked` / `done` /
205
+ `error` over the pty using
206
+ [OSC 7501 (Program Status Protocol)](https://www.superlogical.com/rex/docs/build/program-status),
207
+ so a terminal or agentic inbox that implements it can show what the session
208
+ is doing and when it needs you. Terminals that do not implement it ignore the
209
+ sequence, so there is nothing to configure; set `DSH_TUI_PROGRAM_STATUS=0` to
210
+ turn the reports off.
199
211
 
200
212
  ## Update to the latest version
201
213
 
@@ -234,15 +246,23 @@ allowBuilds:
234
246
  manual step needed.
235
247
 
236
248
  Updates also maintain `ignoredOptionalDependencies` covering foreign-platform
237
- `@img/sharp-*` natives:
238
-
239
- - sharp ships as all-platform optional dependencies, and an untouched
240
- `pnpm update` downloads every platform's binaries (about 200MB measured).
241
- - The list is recomputed for the running platform on every update. Foreign
242
- natives are skipped while this platform's own and the platform-agnostic wasm
243
- fallbacks stay.
244
- - Move the profile to another platform or musl container and the next update
245
- there refreshes it.
249
+ natives — `@img/sharp-*` and the Claude SDK's
250
+ `@anthropic-ai/claude-agent-sdk-*` bundles:
251
+
252
+ - Both ship as all-platform optional dependencies, and an untouched pnpm update
253
+ resolves and downloads every platform's binaries (about 200MB measured for
254
+ sharp; each SDK bundle unpacks to about 230MB, and one 0.15 → 0.16 update
255
+ pulled seven foreign bundles, roughly 1.6GB).
256
+ - The list is recomputed for the running platform on every update. This
257
+ platform's own natives and the platform-agnostic wasm fallbacks stay; foreign
258
+ ones are skipped at resolution, so they no longer appear in the lockfile
259
+ either.
260
+ - The SDK is never installed by an update: it only enters a profile when you
261
+ pick that backend in the kernel picker, and the installer recomputes the list
262
+ for the current machine first, so exactly one platform's bundle lands. An
263
+ unused backend keeps taking no space.
264
+ - Move the profile to another platform or musl container and the next update or
265
+ kernel install there refreshes it.
246
266
  - An existing profile's lockfile still lists every platform, so its first
247
267
  update downloads them once more before the filter takes effect.
248
268
  - Entries outside those two platform tables (a user's `fsevents`, a
@@ -314,6 +334,20 @@ After each source change, build, pack, install in isolation, and launch with:
314
334
  pnpm dev
315
335
  ```
316
336
 
337
+ `pnpm dev` keeps the full install/build/pack checks by default. For explicit local
338
+ iteration, set `DSH_TUI_DEV_FAST=1` (for example,
339
+ `DSH_TUI_DEV_FAST=1 pnpm dev -- --no-launch`). A miss runs frozen install,
340
+ `compile`, pack without repeating `prepare`, and isolated profile installation.
341
+ An unchanged hit skips all four stages only while source/config and compiler-loader contents,
342
+ Node/pnpm/npm/dsh versions, compiled and vendor output, the tarball, and the installed
343
+ package/profile match. Replacing pnpm/npm/dsh without changing its reported version
344
+ requires one normal (non-fast) development run.
345
+ Internal document links such as `CLAUDE.md -> AGENTS.md` are fingerprinted;
346
+ external, excluded, dangling or cyclic links and unreadable inputs disable reuse
347
+ with a diagnostic. Failures invalidate the success stamp before work begins.
348
+ The script prints stage durations and cache hits. Run normal `pnpm build` and
349
+ focused regressions before publishing; fast mode does not change release gates.
350
+
317
351
  `pnpm dev:copy-config` copies only `~/.dsh/settings.yaml` and
318
352
  `~/.dsh/.credentials.yaml`. Files are set to mode `0600` on Unix; Windows uses
319
353
  the OS-managed file ACL.
@@ -121,6 +121,10 @@ dsh --profile dsh-tui
121
121
  命令从当前目录启动,因此 Agent 的默认工作区也是当前目录。进入目标项目目录后再
122
122
  启动即可。
123
123
 
124
+ DSH 0.2.1 起,Agent 可以把会话切到别的目录(`working_directory` 工具或 Git
125
+ worktree)。状态栏、Git 分支、`@` 补全和 `!` 命令会跟随这个目录,`/resume` 后
126
+ 也一样;会话仍登记在启动时的项目下。
127
+
124
128
  Windows 仓库检出还提供:
125
129
 
126
130
  ```bat
@@ -178,7 +182,7 @@ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件
178
182
  重装对齐;
179
183
  - `dsh-tui doctor` 环境诊断。
180
184
 
181
- ## 在 VS Code / Herdr 中运行
185
+ ## 在 VS Code / Herdr / 任意终端中运行
182
186
 
183
187
  - **VS Code**:可在集成终端直接运行,或用已上架 Marketplace 的 companion 扩展
184
188
  `dsh-tui-vscode`(真实终端会话、会话历史、指定会话恢复、IDE 选区通道)。
@@ -186,6 +190,11 @@ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件
186
190
  - **Herdr**:直接在 [Herdr](https://herdr.dev) 窗格中运行 `dsh-tui`,无需额外
187
191
  配置;dsh-TUI 经 Herdr 本地集成 API 报告 `idle` / `working` / `blocked`
188
192
  (问卷与工具审批记为 `blocked`),在 Herdr 之外不做任何事。
193
+ - **任意终端**:dsh-TUI 经 pty 用
194
+ [OSC 7501(Program Status Protocol)](https://www.superlogical.com/rex/docs/build/program-status)
195
+ 报告 `idle` / `working` / `blocked` / `done` / `error`,实现了该协议的终端或
196
+ agent 收件箱可据此显示会话在做什么、何时需要你介入。未实现的终端会忽略该
197
+ 序列,因此无需配置;设 `DSH_TUI_PROGRAM_STATUS=0` 可关闭报告。
189
198
 
190
199
  ## 更新到最新版本
191
200
 
@@ -230,14 +239,18 @@ allowBuilds:
230
239
 
231
240
  `/update` 与 `dsh-tui update` 会自动写入这份配置,无需手工处理。
232
241
 
233
- 更新时还会维护 `ignoredOptionalDependencies`(忽略异平台的 `@img/sharp-*`
234
- 原生包):
235
-
236
- - sharp 以全平台可选依赖分发,不处理时 `pnpm update` 会把各平台二进制一起
237
- 下载(实测约 200MB)。
238
- - 名单每次更新按当前平台重算,异平台原生包不再下载(当前平台原生包与无平台
239
- 归属的 wasm 回退包保留)。
240
- - 把 profile 搬到别的平台或 musl 容器后,在那台机器上跑一次更新即可刷新。
242
+ 更新时还会维护 `ignoredOptionalDependencies`(忽略异平台原生包:`@img/sharp-*`
243
+ 与 Claude SDK 的 `@anthropic-ai/claude-agent-sdk-*`):
244
+
245
+ - sharp 与 Claude SDK 都以全平台可选依赖分发,不处理时 pnpm 的 update 路径会
246
+ 把各平台二进制一起解析/下载(实测 sharp 约 200MB;Claude SDK 单个包解包约
247
+ 230MB,0.15 → 0.16 的一次更新多下 7 个异平台包,约 1.6GB)。
248
+ - 名单每次更新按当前平台重算:当前平台的原生包与无平台归属的 wasm 回退包
249
+ 保留,异平台的整段跳过(pnpm 在解析阶段就不取它们,lockfile 里也不再出现)。
250
+ - SDK 本身不会被更新装进 profile:只有在内核选择器里选中该后端才安装,安装前
251
+ 也按当前机器重算名单,只装本平台对应的那个包。不用的后端一直不占空间。
252
+ - 把 profile 搬到别的平台或 musl 容器后,在那台机器上跑一次更新或内核安装
253
+ 即可刷新。
241
254
  - 老 profile 的 lockfile 里仍写着全平台条目,第一次更新会照旧下载一遍,之后
242
255
  才被忽略。
243
256
  - 块内不属于这两张平台表的条目(`fsevents`、自己写的 `@img/sharp-wasm32`
@@ -302,6 +315,15 @@ pnpm dev:copy-config
302
315
  pnpm dev
303
316
  ```
304
317
 
318
+ `pnpm dev` 默认保留完整 install/build/pack 检查。显式本地快速迭代可设置
319
+ `DSH_TUI_DEV_FAST=1`,例如 `DSH_TUI_DEV_FAST=1 pnpm dev -- --no-launch`。
320
+ 缓存未命中时执行 frozen install、`compile`、不重复 `prepare` 的打包与隔离安装。
321
+ 只有源码/配置与编译加载器内容、Node/pnpm/npm/dsh 版本、编译与 vendor 产物、tarball 和已安装包/profile 均匹配时,
322
+ 才跳过这四步。若替换 pnpm/npm/dsh 而报告版本不变,须先运行一次普通(非 fast)开发流程。内部文档链接(如 `CLAUDE.md -> AGENTS.md`)参与指纹;树外、被排除、
323
+ 悬空或循环链接以及不可读输入会禁用复用并打印原因。工作开始前即作废旧成功标记,
324
+ 失败不写新标记。脚本输出阶段耗时与命中状态。发布前仍须正常执行 `pnpm build`
325
+ 和聚焦回归;快速模式不改变发布门禁。
326
+
305
327
  `pnpm dev:copy-config` 只复制 `~/.dsh/settings.yaml` 与
306
328
  `~/.dsh/.credentials.yaml`。Unix 上文件权限设为 `0600`;Windows 使用系统管理的
307
329
  文件 ACL。