@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 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ink/styles.ts"],"names":[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AAqB,CAAC,EAAE,OAAO,CAAA;IAExC;;;;;;;;OAQG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAEtC;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAA;CACrC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;QAC1B,wEAAwE;QACxE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KACvC,CAAA;IAED;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AA+VD;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM,GACV,MAAM,UAAU,EAChB,QAAO,MAAW,EAClB,gBAAgB,MAAM,KACrB,IAUF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * The Windows toast transport (DESIGN D3/D4/D8/D10/D11/D12): the only place the
3
+ * renderer talks to the Windows shell about task-completion notifications.
4
+ *
5
+ * It answers two questions, and a caller should not need anything else:
6
+ * - show one {@link notifyWindowsToast}
7
+ * - yield when the caller confirms an active external notifier
8
+ *
9
+ * Every system side effect sits behind the win32 guard and behind the injected
10
+ * ports, so a POSIX process that reaches this module anyway neither writes the
11
+ * registry nor spawns anything (AC-7/D12). Reaching it is the unusual case:
12
+ * nothing imports it at load time - the host loads it for the first toast - so a
13
+ * POSIX process does not load it at all.
14
+ *
15
+ * Showing is in-box PowerShell 5.1 + WinRT, one process per notification (D3):
16
+ * the ~3 s cold start of `powershell.exe` is the accepted cost of adding no
17
+ * resident helper (R1). That process is started without a console of this one's
18
+ * ({@link toastHostSpawnOptions}), because a PowerShell host renames the console
19
+ * it runs on. Nothing here waits for the user either: `Show()` hands the
20
+ * notification to the shell and the process exits.
21
+ */
22
+ import type { SpawnOptions } from 'node:child_process';
23
+ import type { ExecFileNoThrowOptions, ExecFileNoThrowResult } from '../utils/execFileNoThrow.js';
24
+ /** The process runner the ports below drive, as `execFileNoThrow` provides it. */
25
+ type RunCommand = (file: string, args: readonly string[], options?: ExecFileNoThrowOptions) => Promise<ExecFileNoThrowResult>;
26
+ /** The AppUserModelID the toast is shown under (spike H, 2026-10-16). */
27
+ export declare const TOAST_AUMID = "dsh-tui";
28
+ /**
29
+ * The AUMID key. Writing it is what makes the toast display at all: an
30
+ * unregistered AUMID answers `Show()` in 15 ms without an error and shows
31
+ * nothing (E2), which is why "registration succeeded" - not `Show()` - is the
32
+ * success signal this module reports (D11).
33
+ */
34
+ export declare const AUMID_REGISTRY_KEY = "HKCU\\Software\\Classes\\AppUserModelId\\dsh-tui";
35
+ /**
36
+ * How the toast host is started: as a console application with no console.
37
+ *
38
+ * Showing a toast means running in-box `powershell.exe` (D3), and a PowerShell
39
+ * host sets the console title as it starts. A child that inherits this process's
40
+ * console therefore renames the session's tab - measured 2026-10-16, before and
41
+ * after one toast: `✦ 🐋 [dsh-tui:42672]` became `Windows PowerShell` (UAT-M4).
42
+ *
43
+ * `windowsHide` is what keeps that console away: Windows starts the child with
44
+ * CREATE_NO_WINDOW, so it has none of its own to retitle, while the pipes below
45
+ * still carry its XML and its failure text. Both halves were measured on a real
46
+ * machine (2026-10-16): the host runs - a write to disk and its stdout arrive,
47
+ * exit 0, 2.1 s for the real toast body whose `Show()` did not throw - and the
48
+ * console title is left alone, against the same measurement with today's options,
49
+ * which clobbered it with `Windows PowerShell`.
50
+ *
51
+ * `detached: true` (DETACHED_PROCESS) was measured and rejected: the title
52
+ * survived there too, but the host exited after ~0.4 s without running the script
53
+ * at all - a silent no-op that would trade a dead click for a toast that never
54
+ * appears. Do not swap one for the other without repeating that measurement.
55
+ * @returns The spawn options the toast host is started with.
56
+ */
57
+ export declare function toastHostSpawnOptions(): SpawnOptions;
58
+ /**
59
+ * Escape the four characters that would otherwise end a text node (AC-8). A
60
+ * summary is arbitrary model output, so nothing may reach the XML unescaped.
61
+ * @param text Raw text from the renderer.
62
+ * @returns The same text, safe inside an XML text node.
63
+ */
64
+ export declare function escapeXmlText(text: string): string;
65
+ /** The parts of a task-completion toast. */
66
+ export interface ToastContent {
67
+ /** First line; the renderer passes its localized title (AC-1). */
68
+ title: string;
69
+ /** Second line: the single-line summary. Omitted when empty, clipped by {@link clampSummary}. */
70
+ message?: string;
71
+ }
72
+ /**
73
+ * Build the ToastGeneric document (D10).
74
+ * @param content Title and summary.
75
+ * @returns The XML handed to `XmlDocument.LoadXml` on the PowerShell side.
76
+ */
77
+ export declare function toastXml(content: ToastContent): string;
78
+ /** One HKCU value write; the default port shells out to in-box `reg.exe`. */
79
+ export interface RegistryPort {
80
+ /**
81
+ * @param key One of this module's own keys.
82
+ * @param name Value name, or null for the key's default value.
83
+ * @param value The string to store.
84
+ * @returns Success, or the reason the write was refused. Never throws.
85
+ */
86
+ setValue(key: string, name: string | null, value: string): Promise<RegistryWriteResult>;
87
+ }
88
+ export type RegistryWriteResult = {
89
+ ok: true;
90
+ } | {
91
+ ok: false;
92
+ detail: string;
93
+ };
94
+ /** Every port is injectable so the regression never writes the registry or spawns. */
95
+ export interface WindowsToastTransportOptions {
96
+ /** Platform override for the regression; production is `process.platform`. */
97
+ platform?: NodeJS.Platform;
98
+ /** Environment for the `%WINDIR%` lookups; defaults to `process.env`. */
99
+ env?: Record<string, string | undefined>;
100
+ /** Registry port; defaults to in-box `reg.exe` on this module's own HKCU keys. */
101
+ registry?: RegistryPort;
102
+ /**
103
+ * Where the toast's icon comes from; defaults to {@link shippedToastIcon},
104
+ * which looks for the file the package ships. `undefined` registers no icon
105
+ * at all rather than a path the shell cannot read.
106
+ */
107
+ iconPath?: () => string | undefined;
108
+ /**
109
+ * Process runner for `reg.exe`; defaults to `execFileNoThrow`. Not the toast
110
+ * host's: that one must not inherit this console, so it has
111
+ * {@link WindowsToastTransportOptions.runToastHost}.
112
+ */
113
+ run?: RunCommand;
114
+ /**
115
+ * Process runner for the toast host; defaults to the console-less spawn
116
+ * ({@link toastHostSpawnOptions}). A port of its own because "which runner"
117
+ * is exactly the difference between a session whose tab keeps its title and
118
+ * one whose tab a PowerShell host renames (UAT-M4).
119
+ */
120
+ runToastHost?: RunCommand;
121
+ /** Clock, so the log can report how long the toast spawn took (R1); defaults to `Date.now`. */
122
+ now?: () => number;
123
+ /** Log sink; defaults to `logForDebugging`. */
124
+ log?: (message: string, fields?: Record<string, unknown>) => void;
125
+ }
126
+ export type WindowsToastFailure = 'not-win32'
127
+ /** No `%WINDIR%`, so neither in-box tool can be located. */
128
+ | 'system-root-missing'
129
+ /** D11: the toast cannot display, so the caller has to ring the bell instead (AC-5). */
130
+ | 'aumid-registration-failed'
131
+ /** The toast process failed; the caller rings the bell rather than going silent. */
132
+ | 'toast-failed' | 'unexpected';
133
+ export type WindowsToastAvailability = {
134
+ available: true;
135
+ } | {
136
+ available: false;
137
+ reason: 'yielded' | WindowsToastFailure;
138
+ detail?: string;
139
+ };
140
+ export type WindowsToastResult = {
141
+ status: 'shown';
142
+ }
143
+ /** An external notifier owns task completions: no toast and no bell (AC-6). */
144
+ | {
145
+ status: 'yielded';
146
+ }
147
+ /** The caller revoked this pending delivery: no toast and no bell. */
148
+ | {
149
+ status: 'suppressed';
150
+ }
151
+ /** Nothing was delivered: the caller falls back to the bell, never to silence. */
152
+ | {
153
+ status: 'unavailable';
154
+ reason: WindowsToastFailure;
155
+ detail?: string;
156
+ };
157
+ export interface WindowsToastInput {
158
+ /** The localized title (AC-1). */
159
+ title: string;
160
+ /** Single-line summary; empty shows the title alone. */
161
+ message?: string;
162
+ /** The host confirmed an enabled, active DSH notifier in its live inventory. */
163
+ externalNotifierActive?: boolean;
164
+ /** Recheck live permission before dispatch, without repeating the focus gate. */
165
+ canDispatch?: () => boolean;
166
+ }
167
+ /** The two overrides a caller may need before a notification exists. */
168
+ export interface WindowsToastAvailabilityQuery {
169
+ /** Platform override for a regression; defaults to the transport's platform. */
170
+ platform?: NodeJS.Platform;
171
+ /** Active notifier ownership, supplied by the host rather than inferred from installed files. */
172
+ externalNotifierActive?: boolean;
173
+ }
174
+ export interface WindowsToastTransport {
175
+ /** Dedup, register, show. Never rejects: the caller treats this as fire-and-forget. */
176
+ notify(input: WindowsToastInput): Promise<WindowsToastResult>;
177
+ }
178
+ /**
179
+ * Create a transport with its own registration state. Production shares one
180
+ * instance through {@link notifyWindowsToast}, because "the AUMID is registered"
181
+ * is a per-process fact (D11).
182
+ * @param options Ports and paths; every one of them has a production default.
183
+ * @returns The transport.
184
+ */
185
+ export declare function createWindowsToastTransport(options?: WindowsToastTransportOptions): WindowsToastTransport;
186
+ /**
187
+ * Show one task-completion toast: stand down for an external notifier, register
188
+ * once, then spawn the in-box host. Never rejects, and an unavailable transport
189
+ * is reported so the caller can ring the bell instead (AC-5).
190
+ * @param input Title, summary and the profile document for the dedup read.
191
+ * @returns What happened, in terms the caller can act on.
192
+ */
193
+ export declare function notifyWindowsToast(input: WindowsToastInput): Promise<WindowsToastResult>;
194
+ export {};
195
+ //# sourceMappingURL=terminal-notification-windows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-notification-windows.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal-notification-windows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAIhG,kFAAkF;AA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;IACjF,WAAW,CAAC,EAAE,MAAM,OAAO,CAAA;CAC5B;AAED,wEAAwE;AACxE,MAAM,WAAW,6BAA6B;IAC5C,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,iGAAiG;IACjG,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,qBAAqB;IACpC,uFAAuF;IACvF,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC9D;AASD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,qBAAqB,CAiG7G;AAuFD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAExF"}
@@ -0,0 +1,433 @@
1
+ /**
2
+ * The Windows toast transport (DESIGN D3/D4/D8/D10/D11/D12): the only place the
3
+ * renderer talks to the Windows shell about task-completion notifications.
4
+ *
5
+ * It answers two questions, and a caller should not need anything else:
6
+ * - show one {@link notifyWindowsToast}
7
+ * - yield when the caller confirms an active external notifier
8
+ *
9
+ * Every system side effect sits behind the win32 guard and behind the injected
10
+ * ports, so a POSIX process that reaches this module anyway neither writes the
11
+ * registry nor spawns anything (AC-7/D12). Reaching it is the unusual case:
12
+ * nothing imports it at load time - the host loads it for the first toast - so a
13
+ * POSIX process does not load it at all.
14
+ *
15
+ * Showing is in-box PowerShell 5.1 + WinRT, one process per notification (D3):
16
+ * the ~3 s cold start of `powershell.exe` is the accepted cost of adding no
17
+ * resident helper (R1). That process is started without a console of this one's
18
+ * ({@link toastHostSpawnOptions}), because a PowerShell host renames the console
19
+ * it runs on. Nothing here waits for the user either: `Show()` hands the
20
+ * notification to the shell and the process exits.
21
+ */
22
+ import { spawn } from 'node:child_process';
23
+ import { existsSync } from 'node:fs';
24
+ import { join } from 'node:path';
25
+ import { fileURLToPath } from 'node:url';
26
+ import { logForDebugging } from '../utils/debug.js';
27
+ import { execFileNoThrow } from '../utils/execFileNoThrow.js';
28
+ import { stringWidth } from './stringWidth.js';
29
+ import { getGraphemeSegmenter } from '../utils/intl.js';
30
+ /** The AppUserModelID the toast is shown under (spike H, 2026-10-16). */
31
+ export const TOAST_AUMID = 'dsh-tui';
32
+ /**
33
+ * The AUMID key. Writing it is what makes the toast display at all: an
34
+ * unregistered AUMID answers `Show()` in 15 ms without an error and shows
35
+ * nothing (E2), which is why "registration succeeded" - not `Show()` - is the
36
+ * success signal this module reports (D11).
37
+ */
38
+ export const AUMID_REGISTRY_KEY = `HKCU\\Software\\Classes\\AppUserModelId\\${TOAST_AUMID}`;
39
+ /**
40
+ * The icon the AUMID registers, and the two depths it can be found at: tsc
41
+ * emits this module into `lib/types/ink/` (the packaged tree) while the source
42
+ * sits at `src/ink/` (the repo), so the same pair of relative paths
43
+ * `components/maidPortrait.tsx` resolves its art with. `assets` is in the
44
+ * package's `files`, so an installed package really ships it.
45
+ *
46
+ * The shell resolves `IconUri` with no working directory of ours, and the UAT
47
+ * (2026-10-16) found the previous value - in-box `powershell.exe`, an executable
48
+ * with no icon index - rendering no icon at all. A path that does not exist is
49
+ * therefore worse than no icon: it leaves nothing to diagnose.
50
+ */
51
+ const TOAST_ICON_CANDIDATES = [
52
+ '../../../assets/whale-girl/whale-girl.png',
53
+ '../../assets/whale-girl/whale-girl.png',
54
+ ];
55
+ /**
56
+ * The image file this package ships for the toast, or undefined when the
57
+ * install has none (a pruned tree, a layout change) - {@link registerAumid}
58
+ * then registers no icon rather than a broken one.
59
+ */
60
+ function shippedToastIcon() {
61
+ return TOAST_ICON_CANDIDATES
62
+ .map(relative => fileURLToPath(new URL(relative, import.meta.url)))
63
+ .find(candidate => existsSync(candidate));
64
+ }
65
+ /** `reg.exe` answers in milliseconds; a write that takes longer is stuck, not slow. */
66
+ const REGISTRY_TIMEOUT_MS = 15_000;
67
+ /** Why nothing can be delivered when `%WINDIR%` is missing; the one wording for both answers. */
68
+ const SYSTEM_ROOT_MISSING_DETAIL = '%WINDIR% is not set, so reg.exe and powershell.exe cannot be located';
69
+ /** PowerShell's cold start measures 3.1-3.4 s and the toast body 0.8-1.1 s (spike C/E1). */
70
+ const TOAST_TIMEOUT_MS = 30_000;
71
+ /**
72
+ * The toast body, run by in-box PowerShell 5.1 (D3). Two details are load
73
+ * bearing and were both measured on a real machine:
74
+ * - the three WinRT types have to be loaded explicitly. Windows PowerShell
75
+ * does not project them on demand, and `New-Object` otherwise fails with
76
+ * "Cannot find type [Windows.Data.Xml.Dom.XmlDocument]";
77
+ * - the XML arrives on stdin and is decoded as UTF-8 explicitly, because
78
+ * `[Console]::In` decodes with the console code page (CP936 on this
79
+ * machine), which mangles every non-ASCII summary.
80
+ */
81
+ const TOAST_SCRIPT = `$ErrorActionPreference='Stop'
82
+ [Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
83
+ [Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
84
+ [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
85
+ $i=[Console]::OpenStandardInput()
86
+ $m=New-Object System.IO.MemoryStream
87
+ $i.CopyTo($m)
88
+ $x=[System.Text.Encoding]::UTF8.GetString($m.ToArray())
89
+ $d=New-Object Windows.Data.Xml.Dom.XmlDocument
90
+ $d.LoadXml($x)
91
+ $t=New-Object Windows.UI.Notifications.ToastNotification $d
92
+ [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('${TOAST_AUMID}').Show($t)`;
93
+ // --- how the toast host is started (T-FIX-05) ----------------------------------
94
+ /** How much of a host's output is kept; the bound `execFileNoThrow` applies too. */
95
+ const MAX_CAPTURE_BYTES = 64 * 1024;
96
+ /**
97
+ * How the toast host is started: as a console application with no console.
98
+ *
99
+ * Showing a toast means running in-box `powershell.exe` (D3), and a PowerShell
100
+ * host sets the console title as it starts. A child that inherits this process's
101
+ * console therefore renames the session's tab - measured 2026-10-16, before and
102
+ * after one toast: `✦ 🐋 [dsh-tui:42672]` became `Windows PowerShell` (UAT-M4).
103
+ *
104
+ * `windowsHide` is what keeps that console away: Windows starts the child with
105
+ * CREATE_NO_WINDOW, so it has none of its own to retitle, while the pipes below
106
+ * still carry its XML and its failure text. Both halves were measured on a real
107
+ * machine (2026-10-16): the host runs - a write to disk and its stdout arrive,
108
+ * exit 0, 2.1 s for the real toast body whose `Show()` did not throw - and the
109
+ * console title is left alone, against the same measurement with today's options,
110
+ * which clobbered it with `Windows PowerShell`.
111
+ *
112
+ * `detached: true` (DETACHED_PROCESS) was measured and rejected: the title
113
+ * survived there too, but the host exited after ~0.4 s without running the script
114
+ * at all - a silent no-op that would trade a dead click for a toast that never
115
+ * appears. Do not swap one for the other without repeating that measurement.
116
+ * @returns The spawn options the toast host is started with.
117
+ */
118
+ export function toastHostSpawnOptions() {
119
+ return {
120
+ windowsHide: true,
121
+ stdio: ['pipe', 'pipe', 'pipe'],
122
+ };
123
+ }
124
+ /**
125
+ * Run the toast host under {@link toastHostSpawnOptions}, with `execFileNoThrow`'s
126
+ * contract: never throws, bounded output, and a timeout. `code` is 1 when the
127
+ * host could not be started at all.
128
+ *
129
+ * A spawn of its own rather than that helper, because the console has to be kept
130
+ * from this one child: `reg.exe` shares the caller's console with no
131
+ * consequence, and `execFileNoThrow` - which it uses - inherits it, with no
132
+ * option to say otherwise.
133
+ * @param file - The in-box host to run.
134
+ * @param args - Its argv.
135
+ * @param options - The stdin payload and the timeout, as `execFileNoThrow` takes them.
136
+ * @returns What the host answered.
137
+ */
138
+ function spawnConsoleLess(file, args, options) {
139
+ return new Promise(resolve => {
140
+ let child;
141
+ try {
142
+ child = spawn(file, args, { ...toastHostSpawnOptions(), timeout: options?.timeout });
143
+ }
144
+ catch {
145
+ resolve({ code: 1, stdout: '', stderr: '' });
146
+ return;
147
+ }
148
+ const stdoutChunks = [];
149
+ const stderrChunks = [];
150
+ const stdoutTotal = { value: 0 };
151
+ const stderrTotal = { value: 0 };
152
+ let settled = false;
153
+ const finish = (code) => {
154
+ if (settled)
155
+ return;
156
+ settled = true;
157
+ resolve({
158
+ code,
159
+ stdout: Buffer.concat(stdoutChunks).toString('utf8'),
160
+ stderr: Buffer.concat(stderrChunks).toString('utf8'),
161
+ });
162
+ };
163
+ const collect = (chunks, total) => (chunk) => {
164
+ if (total.value >= MAX_CAPTURE_BYTES)
165
+ return;
166
+ const part = chunk.subarray(0, MAX_CAPTURE_BYTES - total.value);
167
+ chunks.push(part);
168
+ total.value += part.length;
169
+ };
170
+ child.stdout?.on('data', collect(stdoutChunks, stdoutTotal));
171
+ child.stderr?.on('data', collect(stderrChunks, stderrTotal));
172
+ child.stdin?.on('error', () => { });
173
+ child.on('error', () => finish(1));
174
+ child.on('close', code => finish(code));
175
+ if (options?.input !== undefined)
176
+ child.stdin?.write(options.input);
177
+ child.stdin?.end();
178
+ });
179
+ }
180
+ // --- the pure layer (D10) ------------------------------------------------------
181
+ /**
182
+ * Escape the four characters that would otherwise end a text node (AC-8). A
183
+ * summary is arbitrary model output, so nothing may reach the XML unescaped.
184
+ * @param text Raw text from the renderer.
185
+ * @returns The same text, safe inside an XML text node.
186
+ */
187
+ export function escapeXmlText(text) {
188
+ // `&` first: escaping it after `&lt;` would double-escape the entities.
189
+ return text
190
+ .replaceAll('&', '&amp;')
191
+ .replaceAll('<', '&lt;')
192
+ .replaceAll('>', '&gt;')
193
+ .replaceAll('"', '&quot;');
194
+ }
195
+ /**
196
+ * How much summary the toast body may carry, in display columns. Windows clips
197
+ * the body itself at around four rendered lines and stops mid-sentence with no
198
+ * ellipsis at all - the UAT screenshot (2026-10-16) ended on "…(和 Claude (" -
199
+ * so the budget has to be ours. Two of the roughly 43-column lines that
200
+ * screenshot rendered is ~86 columns; 80 leaves margin for the wider glyphs of
201
+ * other locales and is measured with {@link stringWidth}, the display width the
202
+ * terminal side uses, so a CJK summary is not silently given twice the room of
203
+ * a Latin one.
204
+ */
205
+ const TOAST_MESSAGE_MAX_WIDTH = 80;
206
+ /**
207
+ * Clip a summary to {@link TOAST_MESSAGE_MAX_WIDTH}, with an ellipsis that says
208
+ * the text continues. The ellipsis is one of those columns, so the text keeps
209
+ * the rest. Cuts between grapheme clusters so combined emoji stay whole.
210
+ * @param message The single-line summary from the renderer.
211
+ * @returns The summary, whole or clipped.
212
+ */
213
+ function clampSummary(message) {
214
+ if (stringWidth(message) <= TOAST_MESSAGE_MAX_WIDTH)
215
+ return message;
216
+ let width = 0;
217
+ let clipped = '';
218
+ for (const { segment } of getGraphemeSegmenter().segment(message)) {
219
+ const segmentWidth = stringWidth(segment);
220
+ if (width + segmentWidth > TOAST_MESSAGE_MAX_WIDTH - 1)
221
+ break;
222
+ clipped += segment;
223
+ width += segmentWidth;
224
+ }
225
+ return `${clipped}…`;
226
+ }
227
+ /**
228
+ * Build the ToastGeneric document (D10).
229
+ * @param content Title and summary.
230
+ * @returns The XML handed to `XmlDocument.LoadXml` on the PowerShell side.
231
+ */
232
+ export function toastXml(content) {
233
+ const texts = [`<text>${escapeXmlText(content.title)}</text>`];
234
+ if (content.message !== undefined && content.message !== '') {
235
+ texts.push(`<text>${escapeXmlText(clampSummary(content.message))}</text>`);
236
+ }
237
+ return `<toast><visual><binding template="ToastGeneric">${texts.join('')}</binding></visual></toast>`;
238
+ }
239
+ /**
240
+ * Create a transport with its own registration state. Production shares one
241
+ * instance through {@link notifyWindowsToast}, because "the AUMID is registered"
242
+ * is a per-process fact (D11).
243
+ * @param options Ports and paths; every one of them has a production default.
244
+ * @returns The transport.
245
+ */
246
+ export function createWindowsToastTransport(options = {}) {
247
+ const platform = options.platform ?? process.platform;
248
+ const env = options.env ?? process.env;
249
+ const run = options.run ?? execFileNoThrow;
250
+ const toastHost = options.runToastHost ?? spawnConsoleLess;
251
+ const log = options.log ?? logForDebugging;
252
+ const now = options.now ?? Date.now;
253
+ const tools = toolsFor(env);
254
+ const registry = options.registry ?? regExeRegistry(run, tools);
255
+ const icon = options.iconPath ?? shippedToastIcon;
256
+ let settled;
257
+ let pending;
258
+ const fail = (reason, detail) => {
259
+ log('windows toast unavailable', detail === undefined ? { reason } : { reason, detail });
260
+ return detail === undefined ? { ok: false, reason } : { ok: false, reason, detail };
261
+ };
262
+ const unavailable = (reason, detail) => detail === undefined ? { status: 'unavailable', reason } : { status: 'unavailable', reason, detail };
263
+ function available(query = {}) {
264
+ if ((query.platform ?? platform) !== 'win32')
265
+ return { available: false, reason: 'not-win32' };
266
+ if (query.externalNotifierActive === true) {
267
+ return { available: false, reason: 'yielded' };
268
+ }
269
+ // The same two refusals `register()` makes, in the same order: without an
270
+ // in-box host to render the toast there is nothing to register.
271
+ if (tools === null)
272
+ return { available: false, reason: 'system-root-missing', detail: SYSTEM_ROOT_MISSING_DETAIL };
273
+ // Once a registration has failed it is final for this process (D11).
274
+ if (settled !== undefined && !settled.ok) {
275
+ return settled.detail === undefined
276
+ ? { available: false, reason: settled.reason }
277
+ : { available: false, reason: settled.reason, detail: settled.detail };
278
+ }
279
+ return { available: true };
280
+ }
281
+ function resolve() {
282
+ // One attempt per process: a policy that refuses the key will refuse it
283
+ // again, and retrying it per notification would only add a round trip.
284
+ pending ??= register()
285
+ .catch((error) => fail('unexpected', describe(error)))
286
+ .then(result => {
287
+ settled = result;
288
+ return result;
289
+ });
290
+ return pending;
291
+ }
292
+ async function register() {
293
+ // D12: the platform gate comes before every other check, so a POSIX process
294
+ // that reached this module still cannot write a key.
295
+ if (platform !== 'win32')
296
+ return fail('not-win32');
297
+ if (tools === null)
298
+ return fail('system-root-missing', SYSTEM_ROOT_MISSING_DETAIL);
299
+ const aumidFailure = await registerAumid(registry, icon(), log);
300
+ if (aumidFailure !== undefined)
301
+ return fail('aumid-registration-failed', aumidFailure);
302
+ return { ok: true, tools };
303
+ }
304
+ async function show(input, powershell) {
305
+ const xml = toastXml({ title: input.title, message: input.message });
306
+ const started = now();
307
+ const result = await toastHost(powershell, ['-NoProfile', '-Command', TOAST_SCRIPT], { input: xml, timeout: TOAST_TIMEOUT_MS });
308
+ if (result.code !== 0) {
309
+ // The caller answers an `unavailable` with the bell, so the cause is the
310
+ // only thing that explains why both a toast and a bell were needed.
311
+ const detail = failureCause(result);
312
+ log('windows toast failed to appear', { detail });
313
+ return unavailable('toast-failed', detail);
314
+ }
315
+ log('windows toast shown', { ms: now() - started });
316
+ return { status: 'shown' };
317
+ }
318
+ return {
319
+ async notify(input) {
320
+ try {
321
+ if (input.canDispatch?.() === false)
322
+ return { status: 'suppressed' };
323
+ const judgement = available({ externalNotifierActive: input.externalNotifierActive });
324
+ if (!judgement.available) {
325
+ if (judgement.reason === 'yielded')
326
+ return { status: 'yielded' };
327
+ return unavailable(judgement.reason, judgement.detail);
328
+ }
329
+ const registration = await resolve();
330
+ if (!registration.ok)
331
+ return unavailable(registration.reason, registration.detail);
332
+ if (input.canDispatch?.() === false)
333
+ return { status: 'suppressed' };
334
+ return await show(input, registration.tools.powershell);
335
+ }
336
+ catch (error) {
337
+ // The caller's path is fire-and-forget (the renderer cannot await a
338
+ // notification), so a rejection here would surface as an unhandled one.
339
+ log('windows toast failed', { detail: describe(error) });
340
+ return unavailable('unexpected', describe(error));
341
+ }
342
+ },
343
+ };
344
+ }
345
+ /**
346
+ * The in-box tools under `%WINDIR%`, or null when there is no system root to
347
+ * find them under. Resolved by absolute path, never through `PATH`.
348
+ */
349
+ function toolsFor(env) {
350
+ const windir = env.windir;
351
+ if (windir === undefined || windir === '')
352
+ return null;
353
+ return {
354
+ reg: join(windir, 'System32', 'reg.exe'),
355
+ powershell: join(windir, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
356
+ };
357
+ }
358
+ /**
359
+ * Create the AUMID key the shell needs before it will display anything (D11).
360
+ *
361
+ * DisplayName goes first because it is the write that creates the key. The
362
+ * order cannot be repaired afterwards: the shell fixes an AUMID's identity the
363
+ * first time it sees a notification for it, and never re-reads the key. The
364
+ * 2026-10-16 UAT still showed the bare AUMID `dsh-tui` above a toast whose key
365
+ * held `DisplayName` = `dsh-TUI` - and the notification database dates that
366
+ * first sighting eight hours before this write first existed
367
+ * (`NotificationHandler`, primary id `dsh-tui`, created 2026-10-15 21:33:04,
368
+ * never modified). What this can promise is the order: every process writes
369
+ * both values before its first `Show()`.
370
+ *
371
+ * @param registry The HKCU writer.
372
+ * @param iconUri The image file to register, or undefined to register none.
373
+ * @param log Where a refusal that costs only the icon is reported.
374
+ * @returns Why the key could not be registered, or undefined on success.
375
+ */
376
+ async function registerAumid(registry, iconUri, log) {
377
+ const display = await registry.setValue(AUMID_REGISTRY_KEY, 'DisplayName', 'dsh-TUI');
378
+ if (!display.ok)
379
+ return `DisplayName: ${display.detail}`;
380
+ if (iconUri === undefined) {
381
+ // An icon is decoration: the toast renders without one, and a path the
382
+ // shell cannot read renders nothing either - with nothing left to
383
+ // diagnose. So a missing file registers no value instead of a bad one.
384
+ log('windows toast: no icon file to register, the toast shows without one');
385
+ return undefined;
386
+ }
387
+ // IconUri only decorates the entry in Settings > Notifications, so a refusal
388
+ // there costs the icon, not the toast.
389
+ const icon = await registry.setValue(AUMID_REGISTRY_KEY, 'IconUri', iconUri);
390
+ if (!icon.ok)
391
+ log('windows toast: the AUMID icon was refused, the toast is unaffected', { detail: icon.detail });
392
+ return undefined;
393
+ }
394
+ /**
395
+ * The production registry port: one `reg.exe add` per value, always against the
396
+ * key it is given - which is always one of this module's own HKCU keys.
397
+ */
398
+ function regExeRegistry(run, tools) {
399
+ return {
400
+ async setValue(key, name, value) {
401
+ if (tools === null)
402
+ return { ok: false, detail: '%WINDIR% is not set, so reg.exe cannot be located' };
403
+ const args = ['add', key, ...(name === null ? ['/ve'] : ['/v', name]), '/t', 'REG_SZ', '/d', value, '/f'];
404
+ const result = await run(tools.reg, args, { timeout: REGISTRY_TIMEOUT_MS });
405
+ // `reg.exe` is chatty about success too; only a non-zero exit matters.
406
+ return result.code === 0 ? { ok: true } : { ok: false, detail: failureCause(result) };
407
+ },
408
+ };
409
+ }
410
+ /** The first line of a failed command's output, the only clue the caller gets. */
411
+ function failureCause(result) {
412
+ for (const stream of [result.stderr, result.stdout]) {
413
+ const line = stream.trim().split(/\r?\n/u)[0];
414
+ if (line !== '')
415
+ return line;
416
+ }
417
+ return `exited with code ${result.code}`;
418
+ }
419
+ function describe(error) {
420
+ return error instanceof Error ? error.message : String(error);
421
+ }
422
+ // --- the shared instance ------------------------------------------------------
423
+ let shared;
424
+ /**
425
+ * Show one task-completion toast: stand down for an external notifier, register
426
+ * once, then spawn the in-box host. Never rejects, and an unavailable transport
427
+ * is reported so the caller can ring the bell instead (AC-5).
428
+ * @param input Title, summary and the profile document for the dedup read.
429
+ * @returns What happened, in terms the caller can act on.
430
+ */
431
+ export function notifyWindowsToast(input) {
432
+ return (shared ??= createWindowsToastTransport()).notify(input);
433
+ }