@deepseek-harness-tui/dsh-tui 0.16.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/README.md +213 -34
  2. package/assets/plugin-icon.svg +13 -0
  3. package/assets/windows-installer.cs +308 -0
  4. package/assets/windows-installer.ps1 +17 -0
  5. package/bin/dsh-tui.js +64 -5
  6. package/cli/adapters/dsh/index.mjs +111 -0
  7. package/cli/adapters/dsh/locate.mjs +73 -0
  8. package/cli/adapters/dsh/management-plugin.mjs +111 -0
  9. package/cli/args.mjs +154 -0
  10. package/cli/contracts.d.ts +48 -0
  11. package/cli/engine.mjs +92 -0
  12. package/cli/entry.mjs +48 -0
  13. package/cli/process.mjs +118 -0
  14. package/cli/protocol.mjs +23 -0
  15. package/cli/schema-v1.json +33 -0
  16. package/cordis.patch.yml +3 -1
  17. package/cordis.yml +3 -1
  18. package/guide/dsh-tui-guide/SKILL.md +1 -0
  19. package/guide/dsh-tui-guide/cli.en.md +114 -0
  20. package/guide/dsh-tui-guide/cli.md +114 -0
  21. package/guide/dsh-tui-guide/configuration.en.md +7 -5
  22. package/guide/dsh-tui-guide/configuration.md +7 -5
  23. package/guide/dsh-tui-guide/getting-started.en.md +33 -3
  24. package/guide/dsh-tui-guide/getting-started.md +23 -2
  25. package/guide/dsh-tui-guide/interaction.en.md +50 -17
  26. package/guide/dsh-tui-guide/interaction.md +35 -13
  27. package/guide/dsh-tui-guide/plugins.en.md +63 -11
  28. package/guide/dsh-tui-guide/plugins.md +41 -7
  29. package/guide/dsh-tui-guide/user-guide.en.md +55 -34
  30. package/guide/dsh-tui-guide/user-guide.md +45 -28
  31. package/lib/settings.json +85 -42
  32. package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
  33. package/lib/types/adapter/channel/plugins.js +8 -0
  34. package/lib/types/adapter/channel/ui-policy.d.ts +2 -1
  35. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  36. package/lib/types/adapter/channel/ui-policy.js +4 -0
  37. package/lib/types/adapter/ports/channel-display.d.ts +10 -0
  38. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  39. package/lib/types/adapter/ports/channel-session.d.ts +2 -0
  40. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  41. package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
  42. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  43. package/lib/types/adapter/ports/channel-ui.d.ts +22 -2
  44. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  45. package/lib/types/adapter/ports/channel-view.d.ts +11 -1
  46. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  47. package/lib/types/adapter/ports/channel.d.ts +7 -0
  48. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  49. package/lib/types/adapter/standard/grants.d.ts +60 -0
  50. package/lib/types/adapter/standard/grants.d.ts.map +1 -1
  51. package/lib/types/adapter/standard/grants.js +74 -0
  52. package/lib/types/agent/capabilities.d.ts +2 -0
  53. package/lib/types/agent/capabilities.d.ts.map +1 -1
  54. package/lib/types/agent/events.d.ts +15 -1
  55. package/lib/types/agent/events.d.ts.map +1 -1
  56. package/lib/types/api.d.ts +2 -2
  57. package/lib/types/api.d.ts.map +1 -1
  58. package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
  59. package/lib/types/backends/claude/translate/events.js +2 -1
  60. package/lib/types/backends/codex/auth/status.js +1 -1
  61. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  62. package/lib/types/backends/codex/session/controls.js +6 -5
  63. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  64. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  65. package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
  66. package/lib/types/backends/codex/translate/events.js +3 -1
  67. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  68. package/lib/types/backends/shared/channel-tokens.js +9 -8
  69. package/lib/types/channel/history-restore.d.ts.map +1 -1
  70. package/lib/types/channel/history-restore.js +2 -0
  71. package/lib/types/channel/interaction.d.ts.map +1 -1
  72. package/lib/types/channel/interaction.js +1 -0
  73. package/lib/types/channel/projection.d.ts +1 -1
  74. package/lib/types/channel/projection.d.ts.map +1 -1
  75. package/lib/types/channel/projection.js +19 -4
  76. package/lib/types/channel/questions.d.ts +2 -0
  77. package/lib/types/channel/questions.d.ts.map +1 -1
  78. package/lib/types/channel/sanitize.d.ts +14 -0
  79. package/lib/types/channel/sanitize.d.ts.map +1 -1
  80. package/lib/types/channel/sanitize.js +55 -0
  81. package/lib/types/channel/working-directory.d.ts +9 -0
  82. package/lib/types/channel/working-directory.d.ts.map +1 -0
  83. package/lib/types/channel/working-directory.js +7 -0
  84. package/lib/types/commands.d.ts +8 -1
  85. package/lib/types/commands.d.ts.map +1 -1
  86. package/lib/types/commands.js +14 -5
  87. package/lib/types/components/ChatTitle.d.ts +7 -0
  88. package/lib/types/components/ChatTitle.d.ts.map +1 -0
  89. package/lib/types/components/ChatTitle.js +15 -0
  90. package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
  91. package/lib/types/components/CodeBlockFrame.js +10 -5
  92. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
  93. package/lib/types/components/CompactionStatusRow.js +24 -3
  94. package/lib/types/components/GoalTodoPanel.d.ts +73 -6
  95. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  96. package/lib/types/components/GoalTodoPanel.js +165 -17
  97. package/lib/types/components/Markdown.d.ts +9 -1
  98. package/lib/types/components/Markdown.d.ts.map +1 -1
  99. package/lib/types/components/Markdown.js +5 -4
  100. package/lib/types/components/MessageList.d.ts.map +1 -1
  101. package/lib/types/components/MessageList.js +20 -14
  102. package/lib/types/components/PluginGrantList.d.ts +45 -0
  103. package/lib/types/components/PluginGrantList.d.ts.map +1 -0
  104. package/lib/types/components/PluginGrantList.js +126 -0
  105. package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
  106. package/lib/types/components/PluginInstallPane.js +35 -6
  107. package/lib/types/components/PluginManagePane.d.ts.map +1 -1
  108. package/lib/types/components/PluginManagePane.js +65 -8
  109. package/lib/types/components/PromptInput.d.ts +13 -5
  110. package/lib/types/components/PromptInput.d.ts.map +1 -1
  111. package/lib/types/components/PromptInput.js +190 -108
  112. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  113. package/lib/types/components/SplitDiffView.js +232 -22
  114. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  115. package/lib/types/components/SubagentDashboard.js +10 -0
  116. package/lib/types/components/SubagentDetailScene.d.ts +3 -1
  117. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  118. package/lib/types/components/SubagentDetailScene.js +17 -1
  119. package/lib/types/components/Whale.d.ts.map +1 -1
  120. package/lib/types/components/Whale.js +8 -5
  121. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  122. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  123. package/lib/types/components/approvals/ApprovalPanel.js +93 -11
  124. package/lib/types/components/bigfont.d.ts.map +1 -1
  125. package/lib/types/components/bigfont.js +2 -1
  126. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
  127. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  128. package/lib/types/components/messages/AssistantToolUseMessage.js +24 -11
  129. package/lib/types/components/onboardingModel.d.ts +2 -2
  130. package/lib/types/components/onboardingModel.js +3 -3
  131. package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
  132. package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
  133. package/lib/types/components/onboardingProviderPlan.js +78 -0
  134. package/lib/types/components/previewRows.d.ts +19 -0
  135. package/lib/types/components/previewRows.d.ts.map +1 -0
  136. package/lib/types/components/previewRows.js +46 -0
  137. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  138. package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
  139. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
  140. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  141. package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
  142. package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
  143. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  144. package/lib/types/components/sessions/SessionListRow.js +18 -10
  145. package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
  146. package/lib/types/components/sidePanel/InfoPanel.js +4 -3
  147. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  148. package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
  149. package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
  150. package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
  151. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
  152. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  153. package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
  154. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  155. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
  156. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
  157. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  158. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
  159. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
  160. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
  161. package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
  162. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  163. package/lib/types/components/sidePanel/builtinPanels.js +36 -18
  164. package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
  165. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
  166. package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
  167. package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
  168. package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
  169. package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
  170. package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
  171. package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
  172. package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
  173. package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
  174. package/lib/types/components/sidePanel/types.d.ts +2 -0
  175. package/lib/types/components/sidePanel/types.d.ts.map +1 -1
  176. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  177. package/lib/types/components/sidePanel/useSidePanel.js +39 -7
  178. package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
  179. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  180. package/lib/types/components/trajectory/MiniWake.js +7 -3
  181. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  182. package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
  183. package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
  184. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  185. package/lib/types/dsh-adapter/backend/session.js +62 -6
  186. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/backend/translate.js +18 -4
  188. package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
  189. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  190. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  191. package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
  192. package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
  193. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  194. package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
  195. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
  197. package/lib/types/dsh-adapter/channel/composer-images.d.ts +11 -1
  198. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/channel/composer-images.js +121 -113
  200. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  201. package/lib/types/dsh-adapter/channel/composer-mentions.js +38 -17
  202. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
  203. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  204. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
  205. package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
  206. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  207. package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
  208. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +10 -1
  209. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  210. package/lib/types/dsh-adapter/channel/core/binding-feed.js +48 -3
  211. package/lib/types/dsh-adapter/channel/core/compose.d.ts +5 -2
  212. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  213. package/lib/types/dsh-adapter/channel/core/compose.js +7 -0
  214. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  215. package/lib/types/dsh-adapter/channel/core/files.js +2 -1
  216. package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
  217. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  218. package/lib/types/dsh-adapter/channel/core/host.js +192 -13
  219. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
  220. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  221. package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
  222. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  223. package/lib/types/dsh-adapter/channel/extensions.js +31 -5
  224. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  225. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  226. package/lib/types/dsh-adapter/channel/input-actions.js +34 -0
  227. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +5 -2
  228. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  229. package/lib/types/dsh-adapter/channel/input-delivery.js +31 -4
  230. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
  231. package/lib/types/dsh-adapter/channel/mentions.js +21 -7
  232. package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
  233. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  234. package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
  235. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  236. package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
  237. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  238. package/lib/types/dsh-adapter/channel/paths.js +11 -9
  239. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  240. package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
  241. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
  242. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  243. package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
  244. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  245. package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
  246. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  247. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  248. package/lib/types/dsh-adapter/channel/session-reset.js +7 -1
  249. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
  250. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  251. package/lib/types/dsh-adapter/channel/session-resume.js +56 -36
  252. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
  253. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  254. package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
  255. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
  256. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  257. package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
  258. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  259. package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
  260. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  261. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  262. package/lib/types/dsh-adapter/channel/state.js +2 -2
  263. package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
  264. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  265. package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
  266. package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
  267. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
  268. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  269. package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
  270. package/lib/types/dsh-adapter/contract.d.ts +7 -5
  271. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  272. package/lib/types/dsh-adapter/contract.js +10 -5
  273. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  274. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  275. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  276. package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
  277. package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
  278. package/lib/types/dsh-adapter/experimental-bundles.d.ts +29 -0
  279. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
  280. package/lib/types/dsh-adapter/experimental-bundles.js +15 -0
  281. package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
  282. package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
  283. package/lib/types/dsh-adapter/grant-file.js +178 -0
  284. package/lib/types/dsh-adapter/host-access.d.ts +4 -0
  285. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  286. package/lib/types/dsh-adapter/host-access.js +54 -4
  287. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  288. package/lib/types/dsh-adapter/host-contract.js +2 -2
  289. package/lib/types/dsh-adapter/host-dsh.js +3 -3
  290. package/lib/types/dsh-adapter/index.d.ts +8 -4
  291. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  292. package/lib/types/dsh-adapter/index.js +17 -12
  293. package/lib/types/dsh-adapter/panels.d.ts +28 -8
  294. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  295. package/lib/types/dsh-adapter/panels.js +11 -56
  296. package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
  297. package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
  298. package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
  299. package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
  300. package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
  301. package/lib/types/dsh-adapter/plugin-install.js +160 -13
  302. package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
  303. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  304. package/lib/types/dsh-adapter/plugin-manage.js +240 -51
  305. package/lib/types/dsh-adapter/plugin.d.ts +81 -0
  306. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  307. package/lib/types/dsh-adapter/plugin.js +378 -84
  308. package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
  309. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  310. package/lib/types/dsh-adapter/plugins-info.js +99 -31
  311. package/lib/types/dsh-adapter/presets.d.ts +19 -6
  312. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  313. package/lib/types/dsh-adapter/presets.js +69 -12
  314. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  315. package/lib/types/dsh-adapter/process-exit.js +1 -1
  316. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
  317. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  318. package/lib/types/dsh-adapter/providerWizard.js +11 -5
  319. package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
  320. package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
  321. package/lib/types/dsh-adapter/row-attachment.js +29 -0
  322. package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
  323. package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
  324. package/lib/types/dsh-adapter/session-tools.js +39 -0
  325. package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
  326. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  327. package/lib/types/dsh-adapter/settings-sections.js +73 -0
  328. package/lib/types/dsh-adapter/status.d.ts +88 -1
  329. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  330. package/lib/types/dsh-adapter/status.js +318 -3
  331. package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
  332. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  333. package/lib/types/dsh-adapter/team-mode.js +76 -112
  334. package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
  335. package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
  336. package/lib/types/dsh-adapter/worktree-tool.js +87 -0
  337. package/lib/types/extensions.d.ts +1 -1
  338. package/lib/types/extensions.d.ts.map +1 -1
  339. package/lib/types/force-production-react.js +3 -3
  340. package/lib/types/heldInputs.d.ts +36 -0
  341. package/lib/types/heldInputs.d.ts.map +1 -0
  342. package/lib/types/heldInputs.js +173 -0
  343. package/lib/types/i18n.d.ts +543 -73
  344. package/lib/types/i18n.d.ts.map +1 -1
  345. package/lib/types/i18n.js +265 -46
  346. package/lib/types/ink/colorize.d.ts +7 -1
  347. package/lib/types/ink/colorize.d.ts.map +1 -1
  348. package/lib/types/ink/colorize.js +29 -8
  349. package/lib/types/ink/components/App.d.ts +2 -1
  350. package/lib/types/ink/components/App.d.ts.map +1 -1
  351. package/lib/types/ink/components/App.js +10 -3
  352. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  353. package/lib/types/ink/components/ScrollBox.js +1 -0
  354. package/lib/types/ink/dom.d.ts +1 -0
  355. package/lib/types/ink/dom.d.ts.map +1 -1
  356. package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
  357. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
  358. package/lib/types/ink/hooks/use-program-status.js +96 -0
  359. package/lib/types/ink/ink.d.ts +13 -4
  360. package/lib/types/ink/ink.d.ts.map +1 -1
  361. package/lib/types/ink/ink.js +119 -25
  362. package/lib/types/ink/output.d.ts +17 -2
  363. package/lib/types/ink/output.d.ts.map +1 -1
  364. package/lib/types/ink/output.js +85 -2
  365. package/lib/types/ink/parse-keypress.d.ts +1 -0
  366. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  367. package/lib/types/ink/parse-keypress.js +5 -4
  368. package/lib/types/ink/render-node-to-output.d.ts +2 -0
  369. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  370. package/lib/types/ink/render-node-to-output.js +79 -10
  371. package/lib/types/ink/root.d.ts +8 -0
  372. package/lib/types/ink/root.d.ts.map +1 -1
  373. package/lib/types/ink/root.js +12 -3
  374. package/lib/types/ink/screen.d.ts +11 -0
  375. package/lib/types/ink/screen.d.ts.map +1 -1
  376. package/lib/types/ink/screen.js +44 -0
  377. package/lib/types/ink/selection.d.ts +7 -2
  378. package/lib/types/ink/selection.d.ts.map +1 -1
  379. package/lib/types/ink/selection.js +187 -44
  380. package/lib/types/ink/shutdown-input.d.ts +15 -0
  381. package/lib/types/ink/shutdown-input.d.ts.map +1 -0
  382. package/lib/types/ink/shutdown-input.js +28 -0
  383. package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
  384. package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
  385. package/lib/types/ink/sixel-cursor-heal.js +62 -0
  386. package/lib/types/ink/sixel-graphics.d.ts +6 -0
  387. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  388. package/lib/types/ink/sixel-graphics.js +18 -0
  389. package/lib/types/ink/styles.d.ts +8 -1
  390. package/lib/types/ink/styles.d.ts.map +1 -1
  391. package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
  392. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
  393. package/lib/types/ink/terminal-notification-windows.js +433 -0
  394. package/lib/types/ink/terminal-notification.d.ts +3 -1
  395. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  396. package/lib/types/ink/terminal-notification.js +4 -1
  397. package/lib/types/ink/terminal-querier.d.ts +9 -1
  398. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  399. package/lib/types/ink/terminal-querier.js +32 -1
  400. package/lib/types/ink/terminal.d.ts +23 -2
  401. package/lib/types/ink/terminal.d.ts.map +1 -1
  402. package/lib/types/ink/terminal.js +32 -2
  403. package/lib/types/ink/termio/osc.d.ts +2 -1
  404. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  405. package/lib/types/ink/termio/osc.js +37 -8
  406. package/lib/types/ink/termio/osc7501.d.ts +102 -0
  407. package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
  408. package/lib/types/ink/termio/osc7501.js +229 -0
  409. package/lib/types/ink/termio/tokenize.js +5 -7
  410. package/lib/types/onboardingDraft.d.ts +143 -0
  411. package/lib/types/onboardingDraft.d.ts.map +1 -0
  412. package/lib/types/onboardingDraft.js +71 -0
  413. package/lib/types/panels.d.ts +1 -1
  414. package/lib/types/panels.d.ts.map +1 -1
  415. package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
  416. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  417. package/lib/types/screens/AgentTranscriptScene.js +5 -1
  418. package/lib/types/screens/Chat.d.ts +6 -6
  419. package/lib/types/screens/Chat.d.ts.map +1 -1
  420. package/lib/types/screens/Chat.js +394 -141
  421. package/lib/types/screens/Launchpad.d.ts +8 -2
  422. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  423. package/lib/types/screens/Launchpad.js +32 -12
  424. package/lib/types/screens/Onboarding.d.ts +22 -3
  425. package/lib/types/screens/Onboarding.d.ts.map +1 -1
  426. package/lib/types/screens/Onboarding.js +606 -36
  427. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  428. package/lib/types/screens/SessionSupervisor.js +31 -21
  429. package/lib/types/screens/Settings.d.ts +5 -1
  430. package/lib/types/screens/Settings.d.ts.map +1 -1
  431. package/lib/types/screens/Settings.js +528 -51
  432. package/lib/types/screens/StatusLine.d.ts +9 -3
  433. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  434. package/lib/types/screens/StatusLine.js +91 -15
  435. package/lib/types/screens/StatusMetrics.d.ts +2 -11
  436. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  437. package/lib/types/screens/StatusMetrics.js +20 -14
  438. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  439. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
  440. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  441. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  442. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
  443. package/lib/types/sessionMounts.d.ts +14 -0
  444. package/lib/types/sessionMounts.d.ts.map +1 -1
  445. package/lib/types/sessionMounts.js +20 -9
  446. package/lib/types/sessions/format.d.ts +39 -0
  447. package/lib/types/sessions/format.d.ts.map +1 -1
  448. package/lib/types/sessions/format.js +83 -0
  449. package/lib/types/sessions/resumeFailure.d.ts +4 -0
  450. package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
  451. package/lib/types/sessions/resumeFailure.js +12 -4
  452. package/lib/types/sessions/workspaceCounts.d.ts +6 -0
  453. package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
  454. package/lib/types/sessions/workspaceCounts.js +24 -0
  455. package/lib/types/settings/definitions.d.ts +24 -0
  456. package/lib/types/settings/definitions.d.ts.map +1 -1
  457. package/lib/types/settings/definitions.js +40 -15
  458. package/lib/types/tips.js +2 -2
  459. package/lib/types/tuiDisplayPrefs.d.ts +113 -5
  460. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  461. package/lib/types/tuiDisplayPrefs.js +276 -14
  462. package/lib/types/update.d.ts +15 -14
  463. package/lib/types/update.d.ts.map +1 -1
  464. package/lib/types/update.js +163 -115
  465. package/lib/types/updateProcess.d.ts +28 -0
  466. package/lib/types/updateProcess.d.ts.map +1 -0
  467. package/lib/types/updateProcess.js +135 -0
  468. package/lib/types/utils/inputWordBoundary.d.ts +5 -0
  469. package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
  470. package/lib/types/utils/inputWordBoundary.js +18 -0
  471. package/lib/types/utils/keymap.d.ts +1 -1
  472. package/lib/types/utils/keymap.d.ts.map +1 -1
  473. package/lib/types/utils/keymap.js +6 -1
  474. package/lib/types/utils/paths.d.ts +15 -0
  475. package/lib/types/utils/paths.d.ts.map +1 -1
  476. package/lib/types/utils/paths.js +25 -0
  477. package/lib/types/windowsInstaller.d.ts +4 -0
  478. package/lib/types/windowsInstaller.d.ts.map +1 -0
  479. package/lib/types/windowsInstaller.js +237 -0
  480. package/locale/en.json +6 -0
  481. package/locale/zh.json +6 -0
  482. package/package.json +130 -111
  483. package/presets/liangshen/custom-bash.mjs +13 -1
  484. package/presets/liangshen/instruction-hint.mjs +4 -1
  485. package/presets/liangshen/skill-search.mjs +14 -2
  486. package/presets/winbash.mjs +16 -4
  487. package/tui-profile/feed/README.md +17 -8
  488. package/tui-profile/feed/first-party.json +1 -1
@@ -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
 
@@ -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, 0.2.1-rc.3, 0.2.1-rc.4 and 0.2.1-rc.5**; 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、0.2.1-rc.4 与 0.2.1-rc.5**;其他版本在任务开始前拒绝。`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.5)
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,11 +405,13 @@ 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 |
411
412
  | `DSH_TUI_RESUME_BACKEND` | The backend `DSH_TUI_RESUME_SESSION` was read from; set only when the launcher **derived** the target (a bare `--resume` reading that backend's last session, or the safe-mode retry following the last-run record). When the boot lands on another backend — an uninstalled id falling back to `dsh`, or the remembered kernel when `DSH_TUI_BACKEND` is absent — that target **refuses with a non-zero exit**: never carried across, never a silent cold start, never a new session (the safe-mode retry is the one exception, degrading to a warning plus a cold start). An id the user passed explicitly carries no mark and is handed over as it is |
412
413
  | `DSH_TUI_RESUME_RETRY` | One-shot marker: this boot is safe mode's "retry normal startup". A retry derives its target from the last-run record, whose backend may no longer be registered, so a launch carrying this marker degrades a revoked resume target to a warning plus a cold start instead of failing. The boot deletes it from `process.env` as soon as it reads it |
414
+ | `DSH_TUI_HELD_INPUTS` | The queued-message file a `/restart` hands its replacement (`~/.dsh-tui/held-inputs-<pid>-<random>.json`); the replacement removes the variable from `process.env` at boot and deletes the file once the texts are back as held messages (a replacement that exits before that leaves it). It appears in the printed resume command when a restart stalls or fails to start (on Windows in the PowerShell form `$env:DSH_TUI_HELD_INPUTS='…'; …`); a file nobody resumed within 7 days is removed at a later launch |
413
415
  | `DSH_TUI_BACKEND` | Session backend (built-in `dsh` / `claude` / `codex`, or an installed plugin backend), normally set by `dsh-tui --backend`; an uninstalled or misspelled id starts on `dsh` with a warning (with a resume request in play it refuses instead, see above) |
414
416
  | `DSH_TUI_HOST_ENTRY` | Set to `0` to start both kernels through `dsh --profile` (by default both start from the package's own entry). When the entry cannot use the installed dsh (the `dsh` on `PATH` is not `@deepseek-ai/dsh`, its launcher script cannot be followed, or a module or export it needs is missing), a DSH launch falls back to `dsh --profile` by itself and says why in the terminal and on screen |
415
417
  | `DSH_TUI_CLAUDE_PERMISSION_MODE` | Start permission mode of the Claude backend (`default`/`acceptEdits`/`plan`/`dontAsk`/`bypassPermissions`); wins over the mode `/permission` remembered |
@@ -475,7 +477,7 @@ The `/provider` add branch signs in to ChatGPT/Codex (`openai-codex`), Claude
475
477
  (`anthropic`), or Grok (`xai`) subscriptions. When the installed host's pi-ai
476
478
  catalog ships the corresponding flows, it also offers OpenAI direct ChatGPT sign-in
477
479
  (`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
480
+ Muse (`meta`). The primary validated DSH `0.2.1-rc.5` development fixture resolves pi-ai
479
481
  `1.2.0`, which includes Meta Muse and OpenAI direct sign-in.
480
482
  `/auth status`, `/auth login [provider]`, and `/auth logout <provider>` use
481
483
  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.5)
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,11 +356,13 @@ 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` | 启动时恢复指定会话,通常由启动器设置 |
362
363
  | `DSH_TUI_RESUME_BACKEND` | `DSH_TUI_RESUME_SESSION` 的来源后端,只在启动器**派生**恢复目标时(裸 `--resume` 读该后端的上次会话、安全模式重试按最后运行记录)设置;boot 若落在别的后端(未装的 id 回落 `dsh`、没给 `DSH_TUI_BACKEND` 时跟随记住的内核),该目标一律**明确报错并非零退出**——不跨后端恢复、不静默冷启动、不新建会话(安全模式重试是唯一例外,降级为告警 + 冷启动)。用户显式给出的 id 不带此标记、原样透传 |
363
364
  | `DSH_TUI_RESUME_RETRY` | 一次性标记:本次启动是安全模式的「重试正常启动」。重试的目标派生自最后运行记录,记录里的内核可能已经不在注册表里,所以带此标记的那次启动在恢复目标被撤销时降级为告警 + 冷启动,而不是报错退出。boot 读到即从 `process.env` 删除 |
365
+ | `DSH_TUI_HELD_INPUTS` | `/restart` 交给替身进程的排队消息文件(`~/.dsh-tui/held-inputs-<pid>-<random>.json`),替身启动时把其中的文字作为暂存消息放回、启动时从 `process.env` 移除,放回为暂存消息后删除文件(就绪前退出则文件保留);重启卡住或启动失败时会出现在打印的恢复命令里(Windows 上是 PowerShell 形式 `$env:DSH_TUI_HELD_INPUTS='…'; …`),超过 7 天没人恢复的文件会在之后某次启动时清理 |
364
366
  | `DSH_TUI_BACKEND` | 会话后端(内置 `dsh` / `claude` / `codex`,或已装的插件后端),通常由 `dsh-tui --backend` 设置;未安装或写错的 id 按 `dsh` 启动并告警(若同时带了 `--resume` 请求则改为报错退出,见上) |
365
367
  | `DSH_TUI_HOST_ENTRY` | 设为 `0` 时两个内核都经 `dsh --profile` 启动(默认两个内核都从本包入口启动)。入口用不了已安装的 dsh(`PATH` 上的 `dsh` 不是 `@deepseek-ai/dsh`、启动脚本跟不进去、所需模块或导出缺失)时,DSH 启动自动回退到 `dsh --profile`,并在终端与界面里说明原因 |
366
368
  | `DSH_TUI_CLAUDE_PERMISSION_MODE` | Claude 后端的起始权限模式(`default`/`acceptEdits`/`plan`/`dontAsk`/`bypassPermissions`),优先于 `/permission` 记住的选择 |
@@ -414,7 +416,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
414
416
  `dsh-auth` 插件包**。`/provider` 的添加分支提供 ChatGPT/Codex(`openai-codex`)、
415
417
  Claude(`anthropic`)、Grok(`xai`)订阅账号登录。宿主 pi-ai catalog 提供相应流程
416
418
  时还可使用 OpenAI 直连 ChatGPT 登录(`openai`,使用 OpenAI API 而非旧版 Codex
417
- 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.1-rc.2` 的开发依赖解析到 pi-ai
419
+ 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.1-rc.5` 的开发依赖解析到 pi-ai
418
420
  `1.2.0`,包含 Meta Muse 与 OpenAI 直连登录。`/auth status`、`/auth login [provider]`、
419
421
  `/auth logout <provider>` 对这些 pi-ai 路由操作同一套凭据。浏览器授权会尝试自动打开页面,并在同一
420
422
  问卷中提供授权链接与手动粘贴回调 URL/代码的输入;设备码流程在轮询期间显示可复制的
@@ -29,8 +29,12 @@ PowerShell:
29
29
  $env:DEEPSEEK_API_KEY = 'your-key'
30
30
  ```
31
31
 
32
- Never commit a real credential. A normal profile launch reads the environment
33
- variable directly.
32
+ Never commit a real credential. You can also set nothing at all: the **first step of the
33
+ first-run guide** signs in to a subscription (OAuth, including DeepSeek account browser
34
+ authorization) or adds a model provider with an API key, writes it into the DSH credential
35
+ store (`$DSH_HOME/.credentials.yaml`, by default `~/.dsh/.credentials.yaml`) and picks one of
36
+ the models it brought in as the default — the environment variable is only the "you can also
37
+ do this" path. A normal profile launch reads the environment variable directly when it is set.
34
38
 
35
39
  ## Install
36
40
 
@@ -114,6 +118,11 @@ dsh --profile dsh-tui
114
118
  The process starts in the current directory, which is also the Agent's default
115
119
  workspace. Change into the target project before starting it.
116
120
 
121
+ On DSH 0.2.1 and later the Agent can move its session to another directory
122
+ (the `working_directory` tool, or a Git worktree). The status line, Git branch,
123
+ `@` completion and `!` commands follow that directory, including after
124
+ `/resume`. The session stays registered under the project it started in.
125
+
117
126
  On Windows, the checkout also provides:
118
127
 
119
128
  ```bat
@@ -186,7 +195,7 @@ diagnostics, a profile plugin inventory, and repair guidance.
186
195
  reinstalls/aligns;
187
196
  - `dsh-tui doctor` runs environment diagnostics.
188
197
 
189
- ## Running in VS Code / Herdr
198
+ ## Running in VS Code / Herdr / any terminal
190
199
 
191
200
  - **VS Code**: run directly in the integrated terminal, or use the
192
201
  `dsh-tui-vscode` companion extension on the Marketplace (real terminal
@@ -196,6 +205,13 @@ diagnostics, a profile plugin inventory, and repair guidance.
196
205
  no extra setup; dsh-TUI reports `idle` / `working` / `blocked` through
197
206
  Herdr's local integration API (questionnaires and tool approvals count as
198
207
  `blocked`), and stays completely inactive outside Herdr.
208
+ - **Any terminal**: dsh-TUI reports `idle` / `working` / `blocked` / `done` /
209
+ `error` over the pty using
210
+ [OSC 7501 (Program Status Protocol)](https://www.superlogical.com/rex/docs/build/program-status),
211
+ so a terminal or agentic inbox that implements it can show what the session
212
+ is doing and when it needs you. Terminals that do not implement it ignore the
213
+ sequence, so there is nothing to configure; set `DSH_TUI_PROGRAM_STATUS=0` to
214
+ turn the reports off.
199
215
 
200
216
  ## Update to the latest version
201
217
 
@@ -322,6 +338,20 @@ After each source change, build, pack, install in isolation, and launch with:
322
338
  pnpm dev
323
339
  ```
324
340
 
341
+ `pnpm dev` keeps the full install/build/pack checks by default. For explicit local
342
+ iteration, set `DSH_TUI_DEV_FAST=1` (for example,
343
+ `DSH_TUI_DEV_FAST=1 pnpm dev -- --no-launch`). A miss runs frozen install,
344
+ `compile`, pack without repeating `prepare`, and isolated profile installation.
345
+ An unchanged hit skips all four stages only while source/config and compiler-loader contents,
346
+ Node/pnpm/npm/dsh versions, compiled and vendor output, the tarball, and the installed
347
+ package/profile match. Replacing pnpm/npm/dsh without changing its reported version
348
+ requires one normal (non-fast) development run.
349
+ Internal document links such as `CLAUDE.md -> AGENTS.md` are fingerprinted;
350
+ external, excluded, dangling or cyclic links and unreadable inputs disable reuse
351
+ with a diagnostic. Failures invalidate the success stamp before work begins.
352
+ The script prints stage durations and cache hits. Run normal `pnpm build` and
353
+ focused regressions before publishing; fast mode does not change release gates.
354
+
325
355
  `pnpm dev:copy-config` copies only `~/.dsh/settings.yaml` and
326
356
  `~/.dsh/.credentials.yaml`. Files are set to mode `0600` on Unix; Windows uses
327
357
  the OS-managed file ACL.
@@ -24,7 +24,10 @@ PowerShell:
24
24
  $env:DEEPSEEK_API_KEY = 'your-key'
25
25
  ```
26
26
 
27
- 不要把真实密钥提交到仓库。正常的 profile 启动直接读取环境变量。
27
+ 不要把真实密钥提交到仓库。也可以什么都不设:**首次启动的引导第一步**可以直接
28
+ `登录订阅账号(OAuth)`(含 DeepSeek 账号浏览器授权)或 `添加模型提供方(API key)`,
29
+ 写入 DSH 凭据库(`$DSH_HOME/.credentials.yaml`,默认 `~/.dsh/.credentials.yaml`),
30
+ 并把接入进来的模型选一个作为默认——环境变量只是「你也可以这样做」的那条路。
28
31
 
29
32
  ## 安装
30
33
 
@@ -121,6 +124,10 @@ dsh --profile dsh-tui
121
124
  命令从当前目录启动,因此 Agent 的默认工作区也是当前目录。进入目标项目目录后再
122
125
  启动即可。
123
126
 
127
+ DSH 0.2.1 起,Agent 可以把会话切到别的目录(`working_directory` 工具或 Git
128
+ worktree)。状态栏、Git 分支、`@` 补全和 `!` 命令会跟随这个目录,`/resume` 后
129
+ 也一样;会话仍登记在启动时的项目下。
130
+
124
131
  Windows 仓库检出还提供:
125
132
 
126
133
  ```bat
@@ -178,7 +185,7 @@ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件
178
185
  重装对齐;
179
186
  - `dsh-tui doctor` 环境诊断。
180
187
 
181
- ## 在 VS Code / Herdr 中运行
188
+ ## 在 VS Code / Herdr / 任意终端中运行
182
189
 
183
190
  - **VS Code**:可在集成终端直接运行,或用已上架 Marketplace 的 companion 扩展
184
191
  `dsh-tui-vscode`(真实终端会话、会话历史、指定会话恢复、IDE 选区通道)。
@@ -186,6 +193,11 @@ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件
186
193
  - **Herdr**:直接在 [Herdr](https://herdr.dev) 窗格中运行 `dsh-tui`,无需额外
187
194
  配置;dsh-TUI 经 Herdr 本地集成 API 报告 `idle` / `working` / `blocked`
188
195
  (问卷与工具审批记为 `blocked`),在 Herdr 之外不做任何事。
196
+ - **任意终端**:dsh-TUI 经 pty 用
197
+ [OSC 7501(Program Status Protocol)](https://www.superlogical.com/rex/docs/build/program-status)
198
+ 报告 `idle` / `working` / `blocked` / `done` / `error`,实现了该协议的终端或
199
+ agent 收件箱可据此显示会话在做什么、何时需要你介入。未实现的终端会忽略该
200
+ 序列,因此无需配置;设 `DSH_TUI_PROGRAM_STATUS=0` 可关闭报告。
189
201
 
190
202
  ## 更新到最新版本
191
203
 
@@ -306,6 +318,15 @@ pnpm dev:copy-config
306
318
  pnpm dev
307
319
  ```
308
320
 
321
+ `pnpm dev` 默认保留完整 install/build/pack 检查。显式本地快速迭代可设置
322
+ `DSH_TUI_DEV_FAST=1`,例如 `DSH_TUI_DEV_FAST=1 pnpm dev -- --no-launch`。
323
+ 缓存未命中时执行 frozen install、`compile`、不重复 `prepare` 的打包与隔离安装。
324
+ 只有源码/配置与编译加载器内容、Node/pnpm/npm/dsh 版本、编译与 vendor 产物、tarball 和已安装包/profile 均匹配时,
325
+ 才跳过这四步。若替换 pnpm/npm/dsh 而报告版本不变,须先运行一次普通(非 fast)开发流程。内部文档链接(如 `CLAUDE.md -> AGENTS.md`)参与指纹;树外、被排除、
326
+ 悬空或循环链接以及不可读输入会禁用复用并打印原因。工作开始前即作废旧成功标记,
327
+ 失败不写新标记。脚本输出阶段耗时与命中状态。发布前仍须正常执行 `pnpm build`
328
+ 和聚焦回归;快速模式不改变发布门禁。
329
+
309
330
  `pnpm dev:copy-config` 只复制 `~/.dsh/settings.yaml` 与
310
331
  `~/.dsh/.credentials.yaml`。Unix 上文件权限设为 `0600`;Windows 使用系统管理的
311
332
  文件 ACL。