@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
@@ -1,30 +1,41 @@
1
1
  /**
2
- * Agent Teams on and off at run time (issue #1241, see
2
+ * Agent Teams status at run time (issue #1241, see
3
3
  * docs/agent-teams-design.md「开关机制」).
4
4
  *
5
- * The switch is the upstream team bundle itself: `/team on|off` selects or
6
- * drops its layer through the host plugin manager (the same write
7
- * `/plugin enable|disable` makes), which persists to the profile and, with
8
- * `hmr` mounted, applies at once. The team tool plugin installs into every
9
- * live root Agent and uninstalls on disposal, so the sessions already running
10
- * follow. What stays here is the one decision that cannot live in a preset —
11
- * which legacy delegation tools a request carries — and the `/team` command.
5
+ * Switching is the upstream team bundle itself: `/plugin enable|disable`
6
+ * selects or drops its layer through the host plugin manager, which persists
7
+ * to the profile and, with `hmr` mounted, applies at once. `/team` is the
8
+ * read-only side: it reports the bundle, the service and this session's
9
+ * teammates, and is exposed only while the `agentTeams` service is mounted —
10
+ * the same availability the desktop UI gives the feature. A typed `/team`
11
+ * before that still answers with the enable route instead of reaching the
12
+ * model.
13
+ *
14
+ * What stays here besides the command is the one decision that cannot live in
15
+ * a preset — which legacy delegation tools a request carries.
12
16
  *
13
17
  * @module
14
18
  */
15
19
  import type { Context } from '@deepseek-ai/cordis';
16
20
  import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
17
- import { type PluginManageFlow, type PluginManageSink, type TeamActiveMembers } from './plugin-manage.js';
21
+ import type { LocalCommand } from '../commands.js';
22
+ import type { TeamActiveMembers } from './plugin-manage.js';
23
+ /**
24
+ * Whether the team service is mounted. This is the one signal `/team` appears
25
+ * on: the desktop UI shows the same feature only while its service is there.
26
+ * @param ctx - Host context of the composition root.
27
+ */
28
+ export declare function teamServiceActive(ctx: Context): boolean;
18
29
  /**
19
- * The install spec the hints name. The team packages ship in lockstep with
20
- * DSH and pin their DSH peers exactly, so only the bundle of the running
21
- * kernel's own version installs into this host (npm `latest` and `next`
22
- * both name other lines).
23
- * @param kernel - The running DSH version; unknown falls back to the validated line.
24
- * @returns `<bundle>@<version>`, or undefined on a known kernel that is not a
25
- * team line: no bundle installs there, DSH has to move to a team line first.
30
+ * Hide `/team` from Help and `/` completion while the service is not mounted.
31
+ * The typed form stays a local command (`isLocalCommandName` still knows the
32
+ * name), so it can answer with the enable route instead of becoming text sent
33
+ * to the model.
34
+ * @param commands - The current command catalog.
35
+ * @param visible - Whether the team service is mounted.
36
+ * @returns The catalog with `/team` removed when it is not.
26
37
  */
27
- export declare function teamBundleSpec(kernel: string | undefined): string | undefined;
38
+ export declare function withTeamCommandVisibility(commands: readonly LocalCommand[], visible: boolean): readonly LocalCommand[];
28
39
  /**
29
40
  * Keep one delegation tool set per request. Presets keep their legacy rows,
30
41
  * so whether the team replaces them is decided where the tools are known: an
@@ -39,36 +50,34 @@ export declare function teamBundleSpec(kernel: string | undefined): string | und
39
50
  export declare function filterTeamReplacedTools(assembly: PromptAssembly): PromptAssembly;
40
51
  /** What `/team` was asked. */
41
52
  export type TeamCommand = {
42
- readonly kind: 'on' | 'off' | 'status';
53
+ readonly kind: 'status';
54
+ }
55
+ /** `on` / `off`: the switch moved to `/plugin enable|disable`. */
56
+ | {
57
+ readonly kind: 'switch';
43
58
  } | {
44
59
  readonly kind: 'unknown';
45
60
  readonly sub: string;
46
61
  };
47
62
  export declare function parseTeamArgs(args: string): TeamCommand;
48
- /** What the screen supplies: the plugin flow's sink, plus the team's live state. */
49
- export interface TeamCommandSink extends PluginManageSink {
63
+ /** What the screen supplies: the bound session's live team counts. */
64
+ export interface TeamCommandSink {
50
65
  /** Teammates of the bound session, how many are running or provisioning, and how many may be running. */
51
66
  readonly members: () => {
52
67
  readonly total: number;
53
68
  } & TeamActiveMembers;
54
69
  }
55
- /** What one `/team` input turned into. */
56
- export type TeamCommandOutcome = {
57
- readonly kind: 'flow';
58
- readonly flow: PluginManageFlow;
59
- } | {
60
- readonly kind: 'lines';
61
- readonly lines: Promise<readonly string[]>;
62
- };
70
+ /** The entry the screen calls: argument text in, report lines out. */
71
+ export type TeamCommandEntry = (args: string, sink: TeamCommandSink) => Promise<readonly string[]>;
63
72
  /**
64
- * Wire `/team` to the running composition.
73
+ * Wire `/team` to the running composition. The command only reports; the
74
+ * bundle switch is `/plugin enable|disable`, which shares the lifecycle flow
75
+ * and its confirmations.
65
76
  * @param ctx - Host context of the composition root.
66
- * @param options - The profile a manual route names, and the running host's
67
- * DSH version (this package's entry; otherwise the installed one is read).
77
+ * @param options - The profile a CLI route names.
68
78
  * @returns the command entry the screen calls.
69
79
  */
70
80
  export declare function createTeamCommandEntry(ctx: Context, options?: {
71
81
  readonly profileName?: string | undefined;
72
- readonly kernelVersion?: string | undefined;
73
- }): (args: string, sink: TeamCommandSink) => TeamCommandOutcome;
82
+ }): TeamCommandEntry;
74
83
  //# sourceMappingURL=team-mode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE,OAAO,EAA0B,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAejI;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG7E;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAIhF;AAED,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKvD;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,yGAAyG;IACzG,QAAQ,CAAC,OAAO,EAAE,MAAM;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,iBAAiB,CAAA;CACvE;AAED,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;CAAE,CAAA;AAE1E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GACvG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,kBAAkB,CAqE7D"}
1
+ {"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAS3D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,YAAY,EAAE,CAEtH;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAIhF;AAED,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE;AAC7B,kEAAkE;GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKvD;AAED,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,yGAAyG;IACzG,QAAQ,CAAC,OAAO,EAAE,MAAM;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,iBAAiB,CAAA;CACvE;AAED,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;AAElG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAC1D,gBAAgB,CAiBlB"}
@@ -1,32 +1,29 @@
1
1
  import { t } from '../i18n.js';
2
- import { resolveDshProfileName } from '../update.js';
3
- import { installedKernelVersion, UPSTREAM_VALIDATED_VERSION } from './contract.js';
4
- import { createPluginManageFlow } from './plugin-manage.js';
5
2
  import { pluginManagerOf } from './plugin-manager.js';
6
3
  import { cell } from './plugins-info.js';
7
4
  import { TEAM_BUNDLE } from './team-roster.js';
8
5
  import { TEAM_SPAWN_TOOL } from './team-tools.js';
6
+ /** The slash-command name this module owns. */
7
+ const TEAM_COMMAND_NAME = 'team';
9
8
  /**
10
- * The DSH lines whose team bundle this adapter reads: the validated line,
11
- * 0.2.1-alpha.5 (its team packages differ from rc.2 only in version) and the
12
- * 0.2.0 compat line (compat/agent-team-0.2.0.ts; rc.1 ships the same team
13
- * code as rc.2). Other lines' team projection may lack the `wire` view
14
- * `channel.team` needs.
9
+ * Whether the team service is mounted. This is the one signal `/team` appears
10
+ * on: the desktop UI shows the same feature only while its service is there.
11
+ * @param ctx - Host context of the composition root.
15
12
  */
16
- const TEAM_LINES = new Set([UPSTREAM_VALIDATED_VERSION, '0.2.1-alpha.5', '0.2.0-rc.1', '0.2.0-rc.2']);
13
+ export function teamServiceActive(ctx) {
14
+ return ctx.get('agentTeams', false) !== undefined;
15
+ }
17
16
  /**
18
- * The install spec the hints name. The team packages ship in lockstep with
19
- * DSH and pin their DSH peers exactly, so only the bundle of the running
20
- * kernel's own version installs into this host (npm `latest` and `next`
21
- * both name other lines).
22
- * @param kernel - The running DSH version; unknown falls back to the validated line.
23
- * @returns `<bundle>@<version>`, or undefined on a known kernel that is not a
24
- * team line: no bundle installs there, DSH has to move to a team line first.
17
+ * Hide `/team` from Help and `/` completion while the service is not mounted.
18
+ * The typed form stays a local command (`isLocalCommandName` still knows the
19
+ * name), so it can answer with the enable route instead of becoming text sent
20
+ * to the model.
21
+ * @param commands - The current command catalog.
22
+ * @param visible - Whether the team service is mounted.
23
+ * @returns The catalog with `/team` removed when it is not.
25
24
  */
26
- export function teamBundleSpec(kernel) {
27
- if (kernel === undefined)
28
- return `${TEAM_BUNDLE}@${UPSTREAM_VALIDATED_VERSION}`;
29
- return TEAM_LINES.has(kernel) ? `${TEAM_BUNDLE}@${kernel}` : undefined;
25
+ export function withTeamCommandVisibility(commands, visible) {
26
+ return visible ? commands : commands.filter(command => command.name !== TEAM_COMMAND_NAME);
30
27
  }
31
28
  /**
32
29
  * Legacy delegation tools that `spawn_teammate` replaces. The four control
@@ -58,126 +55,93 @@ export function parseTeamArgs(args) {
58
55
  if (sub === '' || sub === 'status')
59
56
  return { kind: 'status' };
60
57
  if (sub === 'on' || sub === 'off')
61
- return { kind: sub };
58
+ return { kind: 'switch' };
62
59
  return { kind: 'unknown', sub };
63
60
  }
64
61
  /**
65
- * Wire `/team` to the running composition.
62
+ * Wire `/team` to the running composition. The command only reports; the
63
+ * bundle switch is `/plugin enable|disable`, which shares the lifecycle flow
64
+ * and its confirmations.
66
65
  * @param ctx - Host context of the composition root.
67
- * @param options - The profile a manual route names, and the running host's
68
- * DSH version (this package's entry; otherwise the installed one is read).
66
+ * @param options - The profile a CLI route names.
69
67
  * @returns the command entry the screen calls.
70
68
  */
71
69
  export function createTeamCommandEntry(ctx, options = {}) {
72
- const profile = () => options.profileName ?? resolveDshProfileName() ?? 'dsh-tui';
73
- // The version does not change in a process: read it once, on the first hint.
74
- let kernel;
75
- const hint = (key) => {
76
- kernel ??= { version: options.kernelVersion ?? installedKernelVersion() };
77
- const spec = teamBundleSpec(kernel.version);
78
- return spec === undefined
79
- ? t('team-cmd-kernel-unsupported', { version: cell(kernel.version ?? ''), lines: [...TEAM_LINES].join(' / ') })
80
- : t(key, { profile: cell(profile()), bundle: spec });
81
- };
82
- return (args, sink) => {
70
+ const profile = options.profileName ?? 'dsh-tui';
71
+ return async (args, sink) => {
83
72
  const parsed = parseTeamArgs(args);
84
73
  if (parsed.kind === 'unknown') {
85
- return { kind: 'lines', lines: Promise.resolve([t('team-cmd-usage', { sub: cell(parsed.sub) })]) };
74
+ return [t('team-cmd-usage', { sub: cell(parsed.sub) })];
86
75
  }
87
- const manager = pluginManagerOf(ctx);
88
- if (parsed.kind === 'status')
89
- return { kind: 'lines', lines: teamStatusLines(ctx, sink, hint) };
90
- if (manager === undefined) {
91
- return { kind: 'lines', lines: Promise.resolve([hint('team-cmd-no-manager')]) };
76
+ // The mounted service is the only state `/team` reports on.
77
+ if (parsed.kind === 'status' && teamServiceActive(ctx)) {
78
+ return teamStatusLines(ctx, sink);
92
79
  }
93
- const flow = createPluginManageFlow({
94
- manager,
95
- action: parsed.kind === 'on' ? 'enable' : 'disable',
96
- target: TEAM_BUNDLE,
97
- binding: sink.binding,
98
- busy: sink.busy,
99
- onLines: sink.onLines,
100
- profileName: profile(),
101
- teamActiveMembers: sink.members,
102
- });
103
- // Without the package the lifecycle flow would answer with its generic
104
- // "no such target" and every addressable name. Say what is missing
105
- // instead: `on` with how to install it (installing stays an explicit
106
- // `/plugin install`, it runs third-party code behind its own trust step),
107
- // `off` that there is nothing to switch off.
108
- const bindingAtStart = sink.binding();
109
- return {
110
- kind: 'flow',
111
- flow: {
112
- ...flow,
113
- async begin() {
114
- let installed = true;
115
- let enabled = false;
116
- try {
117
- const entry = (await manager.listBundles()).find(candidate => candidate.name === TEAM_BUNDLE);
118
- installed = entry !== undefined;
119
- enabled = entry?.enabled === true;
120
- }
121
- catch {
122
- // A failing read is the flow's to report: it reads the same list.
123
- }
124
- if (parsed.kind === 'off') {
125
- if (installed)
126
- return flow.begin();
127
- if (sink.binding() === bindingAtStart)
128
- sink.onLines([t('team-cmd-off-not-installed')]);
129
- return { kind: 'done' };
130
- }
131
- // Already selected: no trust question about code already running,
132
- // no no-op write. Say whether it is actually running.
133
- if (installed && !enabled)
134
- return flow.begin();
135
- if (sink.binding() === bindingAtStart) {
136
- sink.onLines(!installed
137
- ? [hint('team-cmd-not-installed')]
138
- : [t('team-cmd-already-on'), ...ctx.get('agentTeams', false) === undefined ? [t('team-cmd-pending-on')] : []]);
139
- }
140
- return { kind: 'done' };
141
- },
142
- },
143
- };
80
+ // Everything else answers where the switch is: but only with a route this
81
+ // launch can take. Without the profile plugin service that route cannot run
82
+ // here, and a bundle the running installation does not ship has no target
83
+ // at all (`/plugin` would answer with every addressable name).
84
+ return teamSwitchRouteLines(ctx, profile, parsed.kind === 'switch' ? 'switch' : 'not-enabled');
144
85
  };
145
86
  }
146
87
  /**
147
- * `/team` and `/team status`: whether the profile selects the bundle, whether
148
- * the team service is running in this process, and the bound session's team.
88
+ * Where the switch went, checked against this launch: the in-session lifecycle
89
+ * command only when the plugin service can run it and the installation lists
90
+ * the bundle; the CLI route or the DSH-line reason otherwise. A bundle the
91
+ * profile already selects is not told to enable itself: with no service running
92
+ * the answer is the restart or the failed activation.
149
93
  */
150
- async function teamStatusLines(ctx, sink, hint) {
94
+ async function teamSwitchRouteLines(ctx, profile, kind) {
95
+ const manager = pluginManagerOf(ctx);
96
+ if (manager === undefined) {
97
+ return [t('team-cmd-no-manager-route', { profile: cell(profile), bundle: TEAM_BUNDLE })];
98
+ }
99
+ let listed = true;
100
+ let selected = false;
101
+ try {
102
+ const bundle = (await manager.listBundles()).find(candidate => candidate.name === TEAM_BUNDLE);
103
+ listed = bundle !== undefined;
104
+ selected = bundle?.enabled === true;
105
+ }
106
+ catch {
107
+ // A failing read is the status path's to report; name the general route.
108
+ }
109
+ if (!listed)
110
+ return [t('team-cmd-bundle-absent', { bundle: TEAM_BUNDLE })];
111
+ // Selected but nothing runs: `/plugin enable` would be a no-op, so name the
112
+ // state instead (a restart, or an activation that failed — see the log).
113
+ if (kind === 'not-enabled' && selected)
114
+ return [t('team-cmd-pending-on')];
115
+ return [t(kind === 'switch' ? 'team-cmd-switch-moved' : 'team-cmd-not-enabled', { bundle: TEAM_BUNDLE })];
116
+ }
117
+ /**
118
+ * `/team` and `/team status`: whether the profile selects the bundle and the
119
+ * bound session's team. The caller only runs this while the service is mounted,
120
+ * so the service line states that state instead of re-reading it.
121
+ */
122
+ async function teamStatusLines(ctx, sink) {
151
123
  const manager = pluginManagerOf(ctx);
152
- const service = ctx.get('agentTeams', false) !== undefined;
153
124
  const lines = [];
154
125
  if (manager === undefined) {
155
- lines.push(t('team-cmd-service', { state: t(service ? 'team-cmd-running' : 'team-cmd-stopped') }));
156
- lines.push(hint('team-cmd-no-manager'));
126
+ lines.push(t('team-cmd-service', { state: t('team-cmd-running') }));
127
+ lines.push(t('team-cmd-no-manager'));
157
128
  }
158
129
  else {
159
130
  let selected;
160
- let installed = false;
161
131
  try {
162
132
  const bundle = (await manager.listBundles()).find(candidate => candidate.name === TEAM_BUNDLE);
163
- installed = bundle !== undefined;
164
133
  selected = bundle?.enabled;
134
+ lines.push(selected === undefined
135
+ ? t('team-cmd-bundle-unknown')
136
+ : t('team-cmd-bundle', { state: t(selected ? 'team-cmd-on' : 'team-cmd-off') }));
165
137
  }
166
138
  catch (error) {
167
139
  lines.push(t('plugins-service-error', { err: cell(error instanceof Error ? error.message : String(error)) }));
168
140
  }
169
- if (selected !== undefined || installed) {
170
- lines.push(t('team-cmd-bundle', { state: t(selected === true ? 'team-cmd-on' : 'team-cmd-off') }));
171
- }
172
- else if (lines.length === 0) {
173
- lines.push(hint('team-cmd-not-installed'));
174
- }
175
- lines.push(t('team-cmd-service', { state: t(service ? 'team-cmd-running' : 'team-cmd-stopped') }));
176
- // The profile says on but nothing runs (a startup-only profile, or the
177
- // service failed to activate), or the reverse: say which one wins now.
178
- if (selected === true && !service)
179
- lines.push(t('team-cmd-pending-on'));
180
- if (selected === false && service)
141
+ lines.push(t('team-cmd-service', { state: t('team-cmd-running') }));
142
+ // The service is mounted (the caller gates on that), so a profile that
143
+ // already deselected the bundle is the case that waits for a restart.
144
+ if (selected === false)
181
145
  lines.push(t('team-cmd-pending-off'));
182
146
  }
183
147
  const { total, active, unseen } = sink.members();
@@ -0,0 +1,27 @@
1
+ import type { ToolCallView, ToolResultView } from './channel/types.js';
2
+ /** The tool name, which is also its pinned upstream call title. */
3
+ export declare const WORKTREE_TOOL = "create_worktree";
4
+ /**
5
+ * Put the requested branch name in a `create_worktree` call card's header.
6
+ *
7
+ * @param name - Tool name.
8
+ * @param view - The upstream presentation view for this call, if any.
9
+ * @param rawArgs - The call's JSON arguments, as persisted.
10
+ * @returns The upstream view untouched unless the tool, the pinned title and a
11
+ * non-empty string `name` all line up; else a retitled copy. A call
12
+ * without a name keeps the plain title until its result names the
13
+ * generated branch.
14
+ */
15
+ export declare function refineWorktreeCallTitle(name: string, view: ToolCallView | undefined, rawArgs: string): ToolCallView | undefined;
16
+ /**
17
+ * Summarize a settled `create_worktree` result.
18
+ *
19
+ * @param name - Tool name.
20
+ * @param rawArgs - The call's JSON arguments, as persisted.
21
+ * @param text - The result's text payload (the tool's JSON output).
22
+ * @returns A generic card titled with the created branch, whose body is the
23
+ * checkout path (relative to the repository when inside it) and the
24
+ * revision it started from; undefined for any other tool or shape.
25
+ */
26
+ export declare function worktreeResultView(name: string, rawArgs: string, text: string): ToolResultView | undefined;
27
+ //# sourceMappingURL=worktree-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-tool.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/worktree-tool.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEtE,mEAAmE;AACnE,eAAO,MAAM,aAAa,oBAAoB,CAAA;AAgB9C;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GACd,YAAY,GAAG,SAAS,CAK1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAmB1G"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Card shape for the experimental `create_worktree` tool.
3
+ *
4
+ * `@deepseek-ai/dsh-experimental-tool-worktree@0.2.1-rc.3` titles every call
5
+ * with the bare tool name and ships no result presenter, so the card reads
6
+ * `create_worktree` over one line of JSON (`path`, `branch`, `baseCommit`,
7
+ * `repositoryRoot`) that a narrow terminal breaks mid-field. This adapter is
8
+ * the layer allowed to decide presentation (`agent/presentation.ts`), so the
9
+ * call header names the branch the way the session-search cards name their
10
+ * query (`session-tools.ts`), and a settled result becomes two lines: where
11
+ * the checkout is and what it started from.
12
+ *
13
+ * Self-expiring like those cards: the header is rewritten only while the
14
+ * upstream title is still the pinned tool name, and the result only while the
15
+ * tool has no presenter of its own (the caller checks), so an upstream
16
+ * presentation wins without editing this app.
17
+ *
18
+ * @module
19
+ */
20
+ import { displayPath } from '../backends/shared/display-path.js';
21
+ import { t } from '../i18n.js';
22
+ /** The tool name, which is also its pinned upstream call title. */
23
+ export const WORKTREE_TOOL = 'create_worktree';
24
+ /** `Worktree("name")`: JSON-encoding keeps the one-line header printable
25
+ * whatever the model put in the name (`session-tools.ts`). */
26
+ const header = (branch) => `Worktree(${JSON.stringify(branch)})`;
27
+ /** The model's `{ name?, from? }` arguments, or undefined when unparseable. */
28
+ function argsOf(rawArgs) {
29
+ try {
30
+ const args = JSON.parse(rawArgs);
31
+ return typeof args === 'object' && args !== null ? args : undefined;
32
+ }
33
+ catch {
34
+ return undefined;
35
+ }
36
+ }
37
+ /**
38
+ * Put the requested branch name in a `create_worktree` call card's header.
39
+ *
40
+ * @param name - Tool name.
41
+ * @param view - The upstream presentation view for this call, if any.
42
+ * @param rawArgs - The call's JSON arguments, as persisted.
43
+ * @returns The upstream view untouched unless the tool, the pinned title and a
44
+ * non-empty string `name` all line up; else a retitled copy. A call
45
+ * without a name keeps the plain title until its result names the
46
+ * generated branch.
47
+ */
48
+ export function refineWorktreeCallTitle(name, view, rawArgs) {
49
+ if (name !== WORKTREE_TOOL || view === undefined || view.card !== 'generic' || view.title !== WORKTREE_TOOL)
50
+ return view;
51
+ const branch = argsOf(rawArgs)?.name;
52
+ if (typeof branch !== 'string' || branch.trim() === '')
53
+ return view;
54
+ return { ...view, title: header(branch.trim()) };
55
+ }
56
+ /**
57
+ * Summarize a settled `create_worktree` result.
58
+ *
59
+ * @param name - Tool name.
60
+ * @param rawArgs - The call's JSON arguments, as persisted.
61
+ * @param text - The result's text payload (the tool's JSON output).
62
+ * @returns A generic card titled with the created branch, whose body is the
63
+ * checkout path (relative to the repository when inside it) and the
64
+ * revision it started from; undefined for any other tool or shape.
65
+ */
66
+ export function worktreeResultView(name, rawArgs, text) {
67
+ if (name !== WORKTREE_TOOL)
68
+ return undefined;
69
+ let value;
70
+ try {
71
+ value = JSON.parse(text);
72
+ }
73
+ catch {
74
+ return undefined;
75
+ }
76
+ const { path, branch, baseCommit, repositoryRoot } = (value ?? {});
77
+ if (typeof path !== 'string' || typeof branch !== 'string' || typeof baseCommit !== 'string' || typeof repositoryRoot !== 'string') {
78
+ return undefined;
79
+ }
80
+ const from = argsOf(rawArgs)?.from;
81
+ const lines = [
82
+ displayPath(path, repositoryRoot),
83
+ t('worktree-result-base', { from: typeof from === 'string' && from !== '' ? from : 'HEAD', commit: baseCommit.slice(0, 7) }),
84
+ ];
85
+ // One block: a generic card joins its text blocks without a separator.
86
+ return { card: 'generic', title: header(branch), content: [{ type: 'text', text: lines.join('\n') }] };
87
+ }
@@ -4,7 +4,7 @@ export type { TuiDecisionContext, TuiInputEvent, TuiInputDecision, TuiRewindProm
4
4
  export { DIALOG_DEFAULT_TIMEOUT_MS, INPUT_CELLS, TuiDialogRuntime, TuiDialogStore, } from './dsh-adapter/dialogs.js';
5
5
  export type { TuiDialogAnswer, TuiDialogBase, TuiDialogConfirmRequest, TuiDialogInputRequest, TuiDialogSelectOption, TuiDialogSelectRequest, TuiDialogSnapshot, } from './dsh-adapter/dialogs.js';
6
6
  export { TuiStatusRuntime, TuiStatusStore } from './dsh-adapter/status.js';
7
- export type { TuiStatusEntry, TuiStatusViewDescriptor, TuiStatusViewDisposer, TuiStatusViewMaxRows, TuiStatusViewProps, TuiStatusViewUi, } from './dsh-adapter/status.js';
7
+ export type { TuiStatusEntry, TuiStatusFieldOptions, TuiStatusFieldSlot, TuiStatusFieldTone, TuiStatusViewDescriptor, TuiStatusViewDisposer, TuiStatusViewMaxRows, TuiStatusViewProps, TuiStatusViewUi, } from './dsh-adapter/status.js';
8
8
  export type { TerminalImageSource } from './ink/terminal-image.js';
9
9
  export { matchShortcut, parseShortcutCombo, TuiShortcutRuntime } from './dsh-adapter/shortcuts.js';
10
10
  export type { TuiShortcutKey, TuiShortcutOptions } from './dsh-adapter/shortcuts.js';
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAQA,cAAc,6BAA6B,CAAA;AAI3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAI1C,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC1E,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAClG,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG7F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAQA,cAAc,6BAA6B,CAAA;AAI3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAI1C,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC1E,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAClG,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG7F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA"}
@@ -6,7 +6,7 @@
6
6
  * forces production, but a direct `dsh --profile dsh-tui` boot loads this
7
7
  * plugin without one and silently regressed to the dev build. This module
8
8
  * must stay the FIRST import of the package entry so its body runs before
9
- * any module in the plugin graph requires react. `??=` keeps an explicit
10
- * environment choice (a debugging session) in control.
9
+ * any module in the plugin graph requires react. A workspace's NODE_ENV
10
+ * does not opt the TUI into development; use DSH_TUI_REACT_DEV=1 explicitly.
11
11
  */
12
- process.env.NODE_ENV ??= 'production';
12
+ process.env.NODE_ENV = process.env.DSH_TUI_REACT_DEV === '1' ? 'development' : 'production';
@@ -0,0 +1,36 @@
1
+ /** env marker naming the file the replacement takes its held texts from. */
2
+ export declare const HELD_INPUTS_ENV = "DSH_TUI_HELD_INPUTS";
3
+ /**
4
+ * Write the texts for a replacement process to take.
5
+ * @returns The env marker to hand the replacement, or undefined when there
6
+ * is nothing to carry or the write failed (best effort: a restart never
7
+ * waits on it).
8
+ */
9
+ export declare function writeHeldInputs(texts: readonly string[], dir?: string, pid?: number): Record<string, string> | undefined;
10
+ /**
11
+ * The replacement's side: park the texts a `/restart` handed this process as
12
+ * held rows once the screen's channel is ready (never sent by themselves).
13
+ * A pass that cannot reach a ready channel leaves the handoff pending for the
14
+ * next `apply()` instead of dropping it.
15
+ * @returns What stops waiting for a channel that is not ready yet.
16
+ */
17
+ export declare function adoptHeldInputs(channel: {
18
+ readonly ready: boolean;
19
+ subscribe(listener: () => void): () => void;
20
+ holdInputs(texts: readonly string[]): number;
21
+ }, env?: NodeJS.ProcessEnv, dir?: string): (() => void) | undefined;
22
+ /**
23
+ * The resume command after a restart that ended before any replacement took
24
+ * the held texts (a stall, a failed spawn): their file stays, and the command
25
+ * hands it to the next launch. Windows has no shared env-assignment syntax:
26
+ * PowerShell and cmd.exe each get their own copy-pasteable line.
27
+ */
28
+ export declare function heldInputsResumeCommand(command: string, env: Readonly<Record<string, string>> | undefined, platform?: NodeJS.Platform): string;
29
+ /**
30
+ * Take (read and delete) the texts a `/restart` handed this process. One
31
+ * shot: the env marker is consumed too, so no child inherits it.
32
+ */
33
+ export declare function takeHeldInputs(env?: NodeJS.ProcessEnv, dir?: string): string[];
34
+ /** Remove held-input files older than the resume window (best effort). */
35
+ export declare function sweepHeldInputs(dir?: string, now?: number): void;
36
+ //# sourceMappingURL=heldInputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heldInputs.d.ts","sourceRoot":"","sources":["../../src/heldInputs.ts"],"names":[],"mappings":"AAaA,4EAA4E;AAC5E,eAAO,MAAM,eAAe,wBAAwB,CAAA;AAOpD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,MAAiB,EAAE,GAAG,GAAE,MAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAc/I;AAyBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAAC,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAA;CAAE,EAC/H,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAiB,GACrB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA8B1B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAShK;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,GAAG,GAAE,MAAiB,GAAG,MAAM,EAAE,CAMrG;AAmBD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAiB,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAetF"}