@deepseek-harness-tui/dsh-tui 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/README.md +214 -34
  2. package/assets/plugin-icon.svg +13 -0
  3. package/assets/windows-installer.cs +308 -0
  4. package/assets/windows-installer.ps1 +17 -0
  5. package/bin/dsh-tui.js +64 -5
  6. package/cli/adapters/dsh/index.mjs +111 -0
  7. package/cli/adapters/dsh/locate.mjs +73 -0
  8. package/cli/adapters/dsh/management-plugin.mjs +111 -0
  9. package/cli/args.mjs +154 -0
  10. package/cli/contracts.d.ts +48 -0
  11. package/cli/engine.mjs +92 -0
  12. package/cli/entry.mjs +48 -0
  13. package/cli/process.mjs +118 -0
  14. package/cli/protocol.mjs +23 -0
  15. package/cli/schema-v1.json +33 -0
  16. package/cordis.patch.yml +3 -1
  17. package/cordis.yml +3 -1
  18. package/guide/dsh-tui-guide/SKILL.md +1 -0
  19. package/guide/dsh-tui-guide/claude-backend.en.md +8 -0
  20. package/guide/dsh-tui-guide/claude-backend.md +5 -0
  21. package/guide/dsh-tui-guide/cli.en.md +114 -0
  22. package/guide/dsh-tui-guide/cli.md +114 -0
  23. package/guide/dsh-tui-guide/configuration.en.md +6 -5
  24. package/guide/dsh-tui-guide/configuration.md +6 -5
  25. package/guide/dsh-tui-guide/getting-started.en.md +44 -10
  26. package/guide/dsh-tui-guide/getting-started.md +31 -9
  27. package/guide/dsh-tui-guide/interaction.en.md +22 -10
  28. package/guide/dsh-tui-guide/interaction.md +18 -8
  29. package/guide/dsh-tui-guide/plugins.en.md +35 -4
  30. package/guide/dsh-tui-guide/plugins.md +23 -2
  31. package/guide/dsh-tui-guide/user-guide.en.md +30 -23
  32. package/guide/dsh-tui-guide/user-guide.md +29 -22
  33. package/lib/settings.json +83 -40
  34. package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
  35. package/lib/types/adapter/channel/plugins.js +8 -0
  36. package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
  37. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  38. package/lib/types/adapter/channel/ui-policy.js +3 -0
  39. package/lib/types/adapter/ports/channel-display.d.ts +10 -0
  40. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  41. package/lib/types/adapter/ports/channel-session.d.ts +2 -0
  42. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  43. package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
  44. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  45. package/lib/types/adapter/ports/channel-ui.d.ts +17 -2
  46. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  47. package/lib/types/adapter/ports/channel-view.d.ts +8 -1
  48. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  49. package/lib/types/adapter/ports/channel.d.ts +7 -0
  50. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  51. package/lib/types/agent/capabilities.d.ts +2 -0
  52. package/lib/types/agent/capabilities.d.ts.map +1 -1
  53. package/lib/types/agent/events.d.ts +8 -0
  54. package/lib/types/agent/events.d.ts.map +1 -1
  55. package/lib/types/api.d.ts +2 -2
  56. package/lib/types/api.d.ts.map +1 -1
  57. package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
  58. package/lib/types/backends/claude/translate/events.js +2 -1
  59. package/lib/types/backends/codex/auth/status.js +1 -1
  60. package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
  61. package/lib/types/backends/codex/session/controls.js +6 -5
  62. package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
  63. package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
  64. package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
  65. package/lib/types/backends/codex/translate/events.js +3 -1
  66. package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
  67. package/lib/types/backends/shared/channel-tokens.js +9 -8
  68. package/lib/types/channel/history-restore.d.ts.map +1 -1
  69. package/lib/types/channel/history-restore.js +2 -0
  70. package/lib/types/channel/interaction.d.ts.map +1 -1
  71. package/lib/types/channel/interaction.js +1 -0
  72. package/lib/types/channel/projection.d.ts +1 -1
  73. package/lib/types/channel/projection.d.ts.map +1 -1
  74. package/lib/types/channel/projection.js +19 -4
  75. package/lib/types/channel/questions.d.ts +2 -0
  76. package/lib/types/channel/questions.d.ts.map +1 -1
  77. package/lib/types/channel/sanitize.d.ts +14 -0
  78. package/lib/types/channel/sanitize.d.ts.map +1 -1
  79. package/lib/types/channel/sanitize.js +55 -0
  80. package/lib/types/channel/working-directory.d.ts +9 -0
  81. package/lib/types/channel/working-directory.d.ts.map +1 -0
  82. package/lib/types/channel/working-directory.js +7 -0
  83. package/lib/types/commands.d.ts +8 -1
  84. package/lib/types/commands.d.ts.map +1 -1
  85. package/lib/types/commands.js +13 -4
  86. package/lib/types/components/ChatTitle.d.ts +7 -0
  87. package/lib/types/components/ChatTitle.d.ts.map +1 -0
  88. package/lib/types/components/ChatTitle.js +15 -0
  89. package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
  90. package/lib/types/components/CodeBlockFrame.js +10 -5
  91. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
  92. package/lib/types/components/CompactionStatusRow.js +24 -3
  93. package/lib/types/components/GoalTodoPanel.d.ts +3 -1
  94. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  95. package/lib/types/components/GoalTodoPanel.js +2 -2
  96. package/lib/types/components/Markdown.d.ts +9 -1
  97. package/lib/types/components/Markdown.d.ts.map +1 -1
  98. package/lib/types/components/Markdown.js +5 -4
  99. package/lib/types/components/MessageList.d.ts.map +1 -1
  100. package/lib/types/components/MessageList.js +17 -12
  101. package/lib/types/components/PromptInput.d.ts +13 -5
  102. package/lib/types/components/PromptInput.d.ts.map +1 -1
  103. package/lib/types/components/PromptInput.js +189 -107
  104. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  105. package/lib/types/components/SplitDiffView.js +232 -22
  106. package/lib/types/components/SubagentDetailScene.d.ts +3 -1
  107. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  108. package/lib/types/components/SubagentDetailScene.js +5 -1
  109. package/lib/types/components/Whale.d.ts.map +1 -1
  110. package/lib/types/components/Whale.js +8 -5
  111. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  112. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  113. package/lib/types/components/approvals/ApprovalPanel.js +93 -11
  114. package/lib/types/components/bigfont.d.ts.map +1 -1
  115. package/lib/types/components/bigfont.js +2 -1
  116. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  117. package/lib/types/components/messages/AssistantToolUseMessage.js +13 -6
  118. package/lib/types/components/previewRows.d.ts +19 -0
  119. package/lib/types/components/previewRows.d.ts.map +1 -0
  120. package/lib/types/components/previewRows.js +46 -0
  121. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  122. package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
  123. package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
  124. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
  125. package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
  126. package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
  127. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  128. package/lib/types/components/sessions/SessionListRow.js +18 -10
  129. package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
  130. package/lib/types/components/sidePanel/InfoPanel.js +4 -3
  131. package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
  132. package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
  133. package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
  134. package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
  135. package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
  136. package/lib/types/components/sidePanel/builtinPanels.js +22 -16
  137. package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
  138. package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
  139. package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
  140. package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
  141. package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
  142. package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
  143. package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
  144. package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
  145. package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
  146. package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
  147. package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
  148. package/lib/types/components/sidePanel/useSidePanel.js +24 -6
  149. package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
  150. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
  151. package/lib/types/components/trajectory/MiniWake.js +7 -3
  152. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  153. package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
  154. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  155. package/lib/types/dsh-adapter/backend/translate.js +11 -1
  156. package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
  157. package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
  158. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  159. package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
  160. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
  161. package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
  162. package/lib/types/dsh-adapter/channel/composer-images.d.ts +9 -1
  163. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  164. package/lib/types/dsh-adapter/channel/composer-images.js +111 -111
  165. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
  166. package/lib/types/dsh-adapter/channel/composer-mentions.js +16 -10
  167. package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
  168. package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
  170. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +4 -1
  171. package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/channel/core/binding-feed.js +13 -2
  173. package/lib/types/dsh-adapter/channel/core/compose.d.ts +4 -1
  174. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  175. package/lib/types/dsh-adapter/channel/core/compose.js +2 -0
  176. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  177. package/lib/types/dsh-adapter/channel/core/files.js +2 -1
  178. package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
  179. package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
  180. package/lib/types/dsh-adapter/channel/core/host.js +192 -13
  181. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
  182. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  183. package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
  184. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  185. package/lib/types/dsh-adapter/channel/extensions.js +31 -5
  186. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/channel/input-actions.js +4 -0
  188. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +4 -1
  189. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  190. package/lib/types/dsh-adapter/channel/input-delivery.js +24 -1
  191. package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
  192. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  193. package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
  194. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  195. package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
  196. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  197. package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
  198. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  199. package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
  200. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  201. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  202. package/lib/types/dsh-adapter/channel/session-reset.js +4 -0
  203. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  204. package/lib/types/dsh-adapter/channel/session-resume.js +46 -33
  205. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  206. package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
  207. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  208. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  209. package/lib/types/dsh-adapter/channel/state.js +2 -2
  210. package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
  211. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  212. package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
  213. package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
  214. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
  215. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  216. package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
  217. package/lib/types/dsh-adapter/contract.d.ts +6 -5
  218. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  219. package/lib/types/dsh-adapter/contract.js +7 -5
  220. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  221. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  222. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  223. package/lib/types/dsh-adapter/experimental-bundles.d.ts +26 -0
  224. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
  225. package/lib/types/dsh-adapter/experimental-bundles.js +11 -0
  226. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  227. package/lib/types/dsh-adapter/host-access.js +4 -0
  228. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  229. package/lib/types/dsh-adapter/host-contract.js +2 -2
  230. package/lib/types/dsh-adapter/host-dsh.js +3 -3
  231. package/lib/types/dsh-adapter/host-entry.js +5 -3
  232. package/lib/types/dsh-adapter/index.d.ts +8 -4
  233. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  234. package/lib/types/dsh-adapter/index.js +9 -7
  235. package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -1
  236. package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
  237. package/lib/types/dsh-adapter/panels.d.ts +21 -7
  238. package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
  239. package/lib/types/dsh-adapter/panels.js +11 -56
  240. package/lib/types/dsh-adapter/plugin.d.ts +81 -0
  241. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  242. package/lib/types/dsh-adapter/plugin.js +318 -70
  243. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  244. package/lib/types/dsh-adapter/plugins-info.js +65 -10
  245. package/lib/types/dsh-adapter/presets.d.ts +15 -6
  246. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  247. package/lib/types/dsh-adapter/presets.js +51 -12
  248. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  249. package/lib/types/dsh-adapter/process-exit.js +1 -1
  250. package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
  251. package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
  252. package/lib/types/dsh-adapter/session-tools.js +39 -0
  253. package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
  254. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  255. package/lib/types/dsh-adapter/settings-sections.js +73 -0
  256. package/lib/types/dsh-adapter/status.d.ts +88 -1
  257. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  258. package/lib/types/dsh-adapter/status.js +318 -3
  259. package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
  260. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  261. package/lib/types/dsh-adapter/team-mode.js +76 -112
  262. package/lib/types/extensions.d.ts +1 -1
  263. package/lib/types/extensions.d.ts.map +1 -1
  264. package/lib/types/force-production-react.js +3 -3
  265. package/lib/types/i18n.d.ts +195 -52
  266. package/lib/types/i18n.d.ts.map +1 -1
  267. package/lib/types/i18n.js +96 -30
  268. package/lib/types/ink/colorize.d.ts +7 -1
  269. package/lib/types/ink/colorize.d.ts.map +1 -1
  270. package/lib/types/ink/colorize.js +29 -8
  271. package/lib/types/ink/components/App.d.ts +2 -1
  272. package/lib/types/ink/components/App.d.ts.map +1 -1
  273. package/lib/types/ink/components/App.js +10 -3
  274. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  275. package/lib/types/ink/components/ScrollBox.js +1 -0
  276. package/lib/types/ink/dom.d.ts +1 -0
  277. package/lib/types/ink/dom.d.ts.map +1 -1
  278. package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
  279. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
  280. package/lib/types/ink/hooks/use-program-status.js +96 -0
  281. package/lib/types/ink/ink.d.ts +13 -4
  282. package/lib/types/ink/ink.d.ts.map +1 -1
  283. package/lib/types/ink/ink.js +119 -25
  284. package/lib/types/ink/output.d.ts +17 -2
  285. package/lib/types/ink/output.d.ts.map +1 -1
  286. package/lib/types/ink/output.js +85 -2
  287. package/lib/types/ink/parse-keypress.d.ts +1 -0
  288. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  289. package/lib/types/ink/parse-keypress.js +5 -4
  290. package/lib/types/ink/render-node-to-output.d.ts +2 -0
  291. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  292. package/lib/types/ink/render-node-to-output.js +79 -10
  293. package/lib/types/ink/root.d.ts +8 -0
  294. package/lib/types/ink/root.d.ts.map +1 -1
  295. package/lib/types/ink/root.js +12 -3
  296. package/lib/types/ink/screen.d.ts +11 -0
  297. package/lib/types/ink/screen.d.ts.map +1 -1
  298. package/lib/types/ink/screen.js +44 -0
  299. package/lib/types/ink/selection.d.ts +7 -2
  300. package/lib/types/ink/selection.d.ts.map +1 -1
  301. package/lib/types/ink/selection.js +187 -44
  302. package/lib/types/ink/shutdown-input.d.ts +15 -0
  303. package/lib/types/ink/shutdown-input.d.ts.map +1 -0
  304. package/lib/types/ink/shutdown-input.js +28 -0
  305. package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
  306. package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
  307. package/lib/types/ink/sixel-cursor-heal.js +62 -0
  308. package/lib/types/ink/sixel-graphics.d.ts +6 -0
  309. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  310. package/lib/types/ink/sixel-graphics.js +18 -0
  311. package/lib/types/ink/styles.d.ts +8 -1
  312. package/lib/types/ink/styles.d.ts.map +1 -1
  313. package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
  314. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
  315. package/lib/types/ink/terminal-notification-windows.js +433 -0
  316. package/lib/types/ink/terminal-notification.d.ts +3 -1
  317. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  318. package/lib/types/ink/terminal-notification.js +4 -1
  319. package/lib/types/ink/terminal-querier.d.ts +9 -1
  320. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  321. package/lib/types/ink/terminal-querier.js +32 -1
  322. package/lib/types/ink/terminal.d.ts +23 -2
  323. package/lib/types/ink/terminal.d.ts.map +1 -1
  324. package/lib/types/ink/terminal.js +32 -2
  325. package/lib/types/ink/termio/osc.d.ts +2 -1
  326. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  327. package/lib/types/ink/termio/osc.js +37 -8
  328. package/lib/types/ink/termio/osc7501.d.ts +102 -0
  329. package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
  330. package/lib/types/ink/termio/osc7501.js +229 -0
  331. package/lib/types/ink/termio/tokenize.js +5 -7
  332. package/lib/types/panels.d.ts +1 -1
  333. package/lib/types/panels.d.ts.map +1 -1
  334. package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
  335. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  336. package/lib/types/screens/AgentTranscriptScene.js +5 -1
  337. package/lib/types/screens/Chat.d.ts +6 -6
  338. package/lib/types/screens/Chat.d.ts.map +1 -1
  339. package/lib/types/screens/Chat.js +304 -111
  340. package/lib/types/screens/Launchpad.d.ts +8 -2
  341. package/lib/types/screens/Launchpad.d.ts.map +1 -1
  342. package/lib/types/screens/Launchpad.js +32 -12
  343. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  344. package/lib/types/screens/SessionSupervisor.js +31 -21
  345. package/lib/types/screens/Settings.d.ts +5 -1
  346. package/lib/types/screens/Settings.d.ts.map +1 -1
  347. package/lib/types/screens/Settings.js +528 -51
  348. package/lib/types/screens/StatusLine.d.ts +9 -3
  349. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  350. package/lib/types/screens/StatusLine.js +91 -15
  351. package/lib/types/screens/StatusMetrics.d.ts +2 -11
  352. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  353. package/lib/types/screens/StatusMetrics.js +20 -14
  354. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  355. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
  356. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
  357. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  358. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
  359. package/lib/types/sessionMounts.d.ts +14 -0
  360. package/lib/types/sessionMounts.d.ts.map +1 -1
  361. package/lib/types/sessionMounts.js +20 -9
  362. package/lib/types/sessions/format.d.ts +39 -0
  363. package/lib/types/sessions/format.d.ts.map +1 -1
  364. package/lib/types/sessions/format.js +83 -0
  365. package/lib/types/sessions/resumeFailure.d.ts +4 -0
  366. package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
  367. package/lib/types/sessions/resumeFailure.js +12 -4
  368. package/lib/types/sessions/workspaceCounts.d.ts +6 -0
  369. package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
  370. package/lib/types/sessions/workspaceCounts.js +24 -0
  371. package/lib/types/settings/definitions.d.ts +24 -0
  372. package/lib/types/settings/definitions.d.ts.map +1 -1
  373. package/lib/types/settings/definitions.js +38 -13
  374. package/lib/types/tips.js +2 -2
  375. package/lib/types/tuiDisplayPrefs.d.ts +113 -5
  376. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  377. package/lib/types/tuiDisplayPrefs.js +276 -14
  378. package/lib/types/update.d.ts +46 -36
  379. package/lib/types/update.d.ts.map +1 -1
  380. package/lib/types/update.js +248 -157
  381. package/lib/types/updateProcess.d.ts +28 -0
  382. package/lib/types/updateProcess.d.ts.map +1 -0
  383. package/lib/types/updateProcess.js +135 -0
  384. package/lib/types/utils/inputWordBoundary.d.ts +5 -0
  385. package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
  386. package/lib/types/utils/inputWordBoundary.js +18 -0
  387. package/lib/types/utils/keymap.d.ts +1 -1
  388. package/lib/types/utils/keymap.d.ts.map +1 -1
  389. package/lib/types/utils/keymap.js +6 -1
  390. package/lib/types/windowsInstaller.d.ts +4 -0
  391. package/lib/types/windowsInstaller.d.ts.map +1 -0
  392. package/lib/types/windowsInstaller.js +237 -0
  393. package/locale/en.json +6 -0
  394. package/locale/zh.json +6 -0
  395. package/package.json +127 -111
  396. package/presets/liangshen/custom-bash.mjs +13 -1
  397. package/presets/liangshen/instruction-hint.mjs +4 -1
  398. package/presets/liangshen/skill-search.mjs +14 -2
  399. package/presets/winbash.mjs +16 -4
  400. package/tui-profile/feed/README.md +17 -8
  401. package/tui-profile/feed/first-party.json +1 -1
@@ -22,11 +22,12 @@ import { stringWidth } from '../ink/stringWidth.js';
22
22
  import { truncateToWidth } from '../ink/truncateToWidth.js';
23
23
  import { getGraphemeSegmenter } from '../utils/intl.js';
24
24
  import { draftWordRangeAt, isDraftWordBoundary } from '../utils/draftWordBoundary.js';
25
+ import { wordBoundaryLeft, wordBoundaryRight } from '../utils/inputWordBoundary.js';
25
26
  import { formatClipboardInsert, readClipboard } from '../utils/clipboard.js';
26
27
  import { imagePathMediaType, parsePastedImagePath, readBoundedRegularFile, stageClipboardFilePaths } from '../utils/pastedImagePath.js';
27
28
  import { editInExternalEditor } from '../utils/externalEditor.js';
28
29
  import { setPromptEditorNode, EditorButton } from './PromptEditor.js';
29
- import { isBootSafeCommand, isHiddenCommandName, isUnavailableLocalCommand, parseCommandName, workingHoldOf } from '../commands.js';
30
+ import { isBootSafeCommand, isHiddenCommandName, isLocalCommandName, isUnavailableLocalCommand, parseCommandName, workingHoldOf } from '../commands.js';
30
31
  import { appendHistory, HISTORY_LIMIT, historyProjectKey, loadHistoryOldestFirst } from '../history.js';
31
32
  import { mentionAtCaret } from '../utils/mentions.js';
32
33
  import { preserveSelection } from '../utils/fileSuggestions.js';
@@ -150,25 +151,6 @@ export function composerImageRefsForText(text, stagedByToken) {
150
151
  }
151
152
  return refs;
152
153
  }
153
- /** Index of the word boundary at or before `cursor` (readline alt+b). */
154
- function wordBoundaryLeft(text, cursor) {
155
- let index = cursor;
156
- while (index > 0 && /\s/.test(text[index - 1]))
157
- index--;
158
- while (index > 0 && !/\s/.test(text[index - 1]))
159
- index--;
160
- return index;
161
- }
162
- /** Index of the word boundary after `cursor` (readline alt+f). */
163
- function wordBoundaryRight(text, cursor) {
164
- const length = text.length;
165
- let index = cursor;
166
- while (index < length && !/\s/.test(text[index]))
167
- index++;
168
- while (index < length && /\s/.test(text[index]))
169
- index++;
170
- return index;
171
- }
172
154
  // --- vim normal-mode helpers -----------------------------------------------
173
155
  // `/vim` 编辑模式的 normal 键位几何:行/词移动与删除目标。空白分词
174
156
  // (不区分 vim 的 word/WORD),对输入框场景足够且行为直观。
@@ -354,7 +336,7 @@ const DOUBLE_CLICK_MS = 500;
354
336
  * working) interrupts the turn and delivers them right away; Ctrl+Enter
355
337
  * aborts the turn and sends the current input immediately.
356
338
  */
357
- export function PromptInput({ channel, toastSuppressed, suspended = false, cursorParking = true, draftCache, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen = false, onDismissCaretPreview, now = Date.now, }) {
339
+ export function PromptInput({ channel, toastSuppressed, suspended = false, cursorParking = true, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen = false, onDismissCaretPreview, now = Date.now, }) {
358
340
  const [themeName] = useTheme();
359
341
  const nativeCursor = useNativeCursor();
360
342
  /**
@@ -749,7 +731,10 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
749
731
  // hand-off below. A commit-time write would run BEFORE the restore effect
750
732
  // has consumed the slot, so the composer's own first (empty) value would
751
733
  // erase the draft it just came back for.
752
- // Publish the live controller (fresh closure over `value` every render).
734
+ // Publish the live controller. `hasText()` reads the ref, not the render
735
+ // closure: a draft restored in a passive effect (the launchpad hand-off
736
+ // replays its keys from there) is already in `valueRef` while this facade
737
+ // still carries the empty first value.
753
738
  // A prompt-slot panel withdraws the handle in the same commit: external
754
739
  // injection must not append/submit a hidden command draft while it waits
755
740
  // for a decision. clear() mirrors the double-tap-Esc clear.
@@ -761,7 +746,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
761
746
  return;
762
747
  }
763
748
  controllerRef.current = {
764
- hasText: () => value.length > 0,
749
+ hasText: () => valueRef.current.length > 0,
765
750
  text: () => valueRef.current,
766
751
  previewImages: () => composerImageRefsForText(valueRef.current, draftImagesRef.current).flatMap(ref => {
767
752
  const image = channel.stagedImage(ref.stageId);
@@ -817,7 +802,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
817
802
  // The selection stays: copy never clears it (Esc/typing/delete do).
818
803
  return true;
819
804
  },
820
- consumeEscape: consumeEditingEscape,
805
+ consumeEscape: consumeLocalEscape,
821
806
  toggleVim: () => {
822
807
  const next = !vimEnabledRef.current;
823
808
  vimEnabledRef.current = next;
@@ -844,7 +829,15 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
844
829
  // tell the caller to clear it.
845
830
  const lastFill = React.useRef(null);
846
831
  React.useLayoutEffect(() => {
847
- if (fillText && fillText !== lastFill.current) {
832
+ // The caller clears a fill once it lands (`fillText` returns to null).
833
+ // Drop the dedupe key with it: keeping the key past the clear made the
834
+ // next recall of the SAME text look like a duplicate re-render and
835
+ // silently swallowed it (#1665).
836
+ if (!fillText) {
837
+ lastFill.current = null;
838
+ return;
839
+ }
840
+ if (fillText !== lastFill.current) {
848
841
  lastFill.current = fillText;
849
842
  syncImageGeneration();
850
843
  discardDraftImages();
@@ -864,6 +857,16 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
864
857
  const editorBusyRef = React.useRef(false);
865
858
  /** Enter dedupe window: cmd pipelines can deliver one Enter as `\r`+`\n`. */
866
859
  const lastEnterAtRef = React.useRef(0);
860
+ /**
861
+ * Ctrl+Enter already carried the non-docked queue through its interrupt and
862
+ * re-queued it: those previews are the parked copies now, so a second
863
+ * Ctrl+Enter during the same convergence must not list them again.
864
+ */
865
+ const interruptRequeuedRef = React.useRef(false);
866
+ React.useEffect(() => {
867
+ if (!channel.cancelPending)
868
+ interruptRequeuedRef.current = false;
869
+ }, [channel.cancelPending]);
867
870
  React.useEffect(() => {
868
871
  return () => {
869
872
  if (escTimerRef.current)
@@ -1003,15 +1006,15 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1003
1006
  }, [channel, mention?.query, atTrigger]);
1004
1007
  // Esc dismisses the overlay for the token being edited (it reopens once the
1005
1008
  // text changes); it must NOT clear a mid-message input.
1006
- const fileEscRef = React.useRef(-1);
1007
- React.useEffect(() => {
1008
- fileEscRef.current = -1;
1009
- }, [value]);
1010
- const fileOverlayOpen = fileMatches.length > 0 &&
1009
+ const fileEscRef = React.useRef(null);
1010
+ const [, refreshFileMenu] = React.useState(0);
1011
+ const fileMenuDismissed = (start) => fileEscRef.current?.edit === inputEditSequenceRef.current && fileEscRef.current.start === start;
1012
+ const fileOverlayOpen = mention !== undefined &&
1013
+ fileMatches.length > 0 &&
1011
1014
  !expanded &&
1012
1015
  !helpOpen &&
1013
1016
  !selectionActive &&
1014
- fileEscRef.current !== mention?.start;
1017
+ !fileMenuDismissed(mention.start);
1015
1018
  /**
1016
1019
  * The `[Image #N]` tokens of `text` that carry a live draft capability.
1017
1020
  * These are atomic: the caret never rests inside one, ←/→ step over the
@@ -1369,6 +1372,24 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1369
1372
  setSelectedCommand(0);
1370
1373
  setFileSelected(0);
1371
1374
  };
1375
+ /**
1376
+ * A channel action that throws synchronously (owner/lifetime race while the
1377
+ * process is tearing down or a registration changed) is swallowed by Ink's
1378
+ * stdin pump — stderr only, no UI. Reporting it here is the difference
1379
+ * between "the send failed" and "my text vanished". The draft is never
1380
+ * cleared before the call succeeds, so the text stays editable either way.
1381
+ */
1382
+ const reportSendFailure = (error) => {
1383
+ const message = error instanceof Error ? error.message : String(error);
1384
+ try {
1385
+ channel.notify(t('send-failed', { err: message }), { color: 'error' });
1386
+ }
1387
+ catch {
1388
+ // A channel whose owner is already gone cannot show a toast either.
1389
+ // The draft surviving is the important half; the renderer's stdin
1390
+ // catch only writes the throw to stderr.
1391
+ }
1392
+ };
1372
1393
  const submitText = (text, notice) => {
1373
1394
  const trimmed = text.trim();
1374
1395
  if (!trimmed)
@@ -1377,8 +1398,14 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1377
1398
  if (shellImagesUnsupported(trimmed, images))
1378
1399
  return;
1379
1400
  rememberHistory(trimmed, images);
1401
+ try {
1402
+ channel.submit(trimmed, images);
1403
+ }
1404
+ catch (error) {
1405
+ reportSendFailure(error);
1406
+ return;
1407
+ }
1380
1408
  clearDeliveredDraft();
1381
- channel.submit(trimmed, images);
1382
1409
  if (notice) {
1383
1410
  channel.notify(notice, { timeoutMs: 2500 });
1384
1411
  }
@@ -1399,8 +1426,21 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1399
1426
  return;
1400
1427
  const images = imageRefsFor(trimmed);
1401
1428
  rememberHistory(trimmed, images);
1429
+ try {
1430
+ channel.steer(trimmed, images);
1431
+ }
1432
+ catch (error) {
1433
+ reportSendFailure(error);
1434
+ return;
1435
+ }
1402
1436
  clearDeliveredDraft();
1403
- channel.steer(trimmed, images);
1437
+ // While an abort is still converging the step boundary this steer waits
1438
+ // for may be the very thing the wedged turn never reaches: do not promise
1439
+ // an immediate next step then.
1440
+ if (channel.cancelPending) {
1441
+ channel.notify(t('input-steer-pending'), { color: 'warning', timeoutMs: 4000 });
1442
+ return;
1443
+ }
1404
1444
  channel.notify(t('input-interrupted-next'), { timeoutMs: 2500 });
1405
1445
  };
1406
1446
  /**
@@ -1415,8 +1455,14 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1415
1455
  if (shellImagesUnsupported(trimmed, images))
1416
1456
  return;
1417
1457
  rememberHistory(trimmed, images);
1458
+ try {
1459
+ channel.submit(trimmed, images);
1460
+ }
1461
+ catch (error) {
1462
+ reportSendFailure(error);
1463
+ return;
1464
+ }
1418
1465
  clearDeliveredDraft();
1419
- channel.submit(trimmed, images);
1420
1466
  channel.notify(t('input-queued-after-turn'), { timeoutMs: 2500 });
1421
1467
  };
1422
1468
  /**
@@ -1479,7 +1525,15 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1479
1525
  /** Send the whole dock now (⏎ on an empty draft, or the hint row click):
1480
1526
  * FIFO, exactly once, through the channel's own delivery chain. */
1481
1527
  const sendDocked = () => {
1482
- const sent = channel.deliverDocked();
1528
+ let sent;
1529
+ try {
1530
+ sent = channel.deliverDocked();
1531
+ }
1532
+ catch (error) {
1533
+ // The dock rows are still parked: no "sent" claim may be made here.
1534
+ reportSendFailure(error);
1535
+ return;
1536
+ }
1483
1537
  if (sent > 0)
1484
1538
  channel.notify(t('input-dock-sent', { n: sent }), { timeoutMs: 2500 });
1485
1539
  setDockSelected(null);
@@ -1565,16 +1619,47 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1565
1619
  // immediately once the abort settles. Docked rows are NOT listed here:
1566
1620
  // the channel's interruptAndDeliver takes the dock itself first (same
1567
1621
  // FIFO order), so including them would send each docked text twice.
1622
+ const interruptWasPending = channel.cancelPending;
1568
1623
  const images = imageRefsFor(trimmed);
1624
+ // A cancel already in flight did NOT carry the queue: either it is a plain
1625
+ // Esc/Ctrl+C cancel (the backend kept the rows, and the interrupt below
1626
+ // drops them, so re-listing them here is what re-delivers them) or a
1627
+ // previous Ctrl+Enter already re-queued them (re-listing would duplicate
1628
+ // every one). `interruptRequeuedRef` tells the two apart across the
1629
+ // convergence window.
1630
+ const includePending = !interruptWasPending || !interruptRequeuedRef.current;
1569
1631
  const queued = [
1570
- ...channel.pending.filter(item => item.docked !== true).map(item => ({ text: item.text, images: item.images ?? [] })),
1632
+ ...(includePending
1633
+ ? channel.pending.filter(item => item.docked !== true).map(item => ({ text: item.text, images: item.images ?? [] }))
1634
+ : []),
1571
1635
  { text: value, images },
1572
1636
  ];
1573
- const count = channel.interruptAndDeliver(queued);
1637
+ const count = (() => {
1638
+ try {
1639
+ return channel.interruptAndDeliver(queued);
1640
+ }
1641
+ catch (error) {
1642
+ reportSendFailure(error);
1643
+ return 0;
1644
+ }
1645
+ })();
1574
1646
  if (count === 0)
1575
1647
  return;
1648
+ // This request owns the queue's re-delivery from here on — including the
1649
+ // fresh draft, whose preview enters `pending` as a followup. A later
1650
+ // Ctrl+Enter during the same convergence must not list that preview again
1651
+ // (a repeated interrupt does not drop the earlier copies).
1652
+ if (includePending)
1653
+ interruptRequeuedRef.current = true;
1576
1654
  rememberHistory(trimmed, images);
1577
1655
  clearDeliveredDraft();
1656
+ // A cancel already in flight means the text was re-queued behind an abort
1657
+ // that has not converged; the "immediate" claim would be false until it
1658
+ // does (the wedged-turn case). The channel keeps the messages queued.
1659
+ if (interruptWasPending) {
1660
+ channel.notify(t('input-interrupt-deferred'), { color: 'warning', timeoutMs: 4000 });
1661
+ return;
1662
+ }
1578
1663
  channel.notify(t('input-interrupt-immediate'), { timeoutMs: 2500 });
1579
1664
  };
1580
1665
  /** The startup phase's refusal (see `ChannelUi.ready`). */
@@ -1614,7 +1699,10 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1614
1699
  });
1615
1700
  return true;
1616
1701
  }
1617
- const known = command !== undefined || isHiddenCommandName(parsed.name);
1702
+ // A local command may be intentionally absent from the published catalog
1703
+ // (the service-gated `/team`): a typed name is still this app's command,
1704
+ // never text for the model. Backend-unavailable locals were refused above.
1705
+ const known = command !== undefined || isHiddenCommandName(parsed.name) || isLocalCommandName(parsed.name);
1618
1706
  if (!known)
1619
1707
  return false;
1620
1708
  const generation = syncImageGeneration();
@@ -1789,14 +1877,39 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1789
1877
  };
1790
1878
  /** Local Esc layers, shared by the prompt listener and Chat's delegation.
1791
1879
  * Refs preserve this order even when expansion and Esc share a stdin batch. */
1792
- const consumeEditingEscape = () => {
1793
- // The docked-queue selector folds first: Esc leaves the selector and the
1794
- // dock itself stays put (⏎/↑ keep working afterwards).
1880
+ const consumeLocalEscape = () => {
1881
+ if (helpOpen) {
1882
+ onToggleHelp();
1883
+ return true;
1884
+ }
1885
+ if (caretPreviewOpen) {
1886
+ onDismissCaretPreview?.();
1887
+ return true;
1888
+ }
1889
+ // Read the live draft: typing `/`, Esc and more text can arrive in the
1890
+ // same stdin batch before React has rendered the command menu (#1310).
1891
+ const current = valueRef.current;
1892
+ if (!expandedRef.current && !selectionActive) {
1893
+ if (current.startsWith('/') && !current.includes('\n') && channel.commandCompletions(current).length > 0) {
1894
+ clearDraftUndoably();
1895
+ return true;
1896
+ }
1897
+ const currentMention = mentionAtCaret(current, cursorRef.current);
1898
+ if (currentMention !== undefined && fileMatches.length > 0 && !fileMenuDismissed(currentMention.start)) {
1899
+ // An edit sequence makes the dismissal token-local and resets it
1900
+ // on the next text edit, including one in the same stdin batch.
1901
+ fileEscRef.current = { edit: inputEditSequenceRef.current, start: currentMention.start };
1902
+ refreshFileMenu(tick => tick + 1);
1903
+ return true;
1904
+ }
1905
+ }
1906
+ // Esc leaves the docked-queue selector; the dock itself stays put
1907
+ // (⏎/↑ keep working afterwards).
1795
1908
  if (dockSelectedRef.current !== null) {
1796
1909
  setDockSelected(null);
1797
1910
  return true;
1798
1911
  }
1799
- if (selectionRef.current && !helpOpen && !overlayOpen && !fileOverlayOpen) {
1912
+ if (selectionRef.current) {
1800
1913
  clearSelection();
1801
1914
  return true;
1802
1915
  }
@@ -1804,6 +1917,18 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1804
1917
  collapseEditor();
1805
1918
  return true;
1806
1919
  }
1920
+ if (foldBlockRef.current !== null) {
1921
+ updateFoldBlock(null);
1922
+ return true;
1923
+ }
1924
+ // Send-to-Chat chips peel before the draft; that same Esc must not
1925
+ // interrupt a running turn. Vim keeps its existing mode-key ownership.
1926
+ const stagedContexts = channel.attachedContexts ?? [];
1927
+ if (!vimEnabledRef.current && stagedContexts.length > 0) {
1928
+ for (const staged of [...stagedContexts])
1929
+ channel.detachContext(staged.id);
1930
+ return true;
1931
+ }
1807
1932
  return false;
1808
1933
  };
1809
1934
  /** The editor's explicit send (Ctrl+Enter / Send button): the Enter main
@@ -1964,23 +2089,13 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1964
2089
  const value = valueRef.current;
1965
2090
  const cursor = cursorRef.current;
1966
2091
  const selection = selectionRef.current;
1967
- // ── caret-driven image preview ──────────────────────────────────────
1968
- // Esc dismisses the preview the caret opened, before any other Esc
1969
- // meaning (help stays above it: the help menu is modal over the prompt).
1970
- if (key.escape && caretPreviewOpen && !helpOpen) {
1971
- event?.stopImmediatePropagation();
1972
- onDismissCaretPreview?.();
1973
- return;
1974
- }
1975
- // ── mouse selection (drag / Shift+click / double-click) ─────────────
1976
- // Layered ahead of the fold-block rules: with an active selection, Esc
1977
- // ONLY drops the highlight (text untouched), and Backspace/Delete
1978
- // delete the selected span. Arrows/typing handle the selection at their
1979
- // own arms below.
1980
- if (key.escape && consumeEditingEscape()) {
2092
+ // Share the local Esc ladder with Chat's earlier global listener.
2093
+ if (key.escape && consumeLocalEscape()) {
1981
2094
  event.stopImmediatePropagation();
1982
2095
  return;
1983
2096
  }
2097
+ // Mouse selection (drag / Shift+click / double-click): Backspace/Delete
2098
+ // remove the span; arrows/typing handle it at their own arms below.
1984
2099
  if ((key.backspace || key.delete) && selection) {
1985
2100
  // Removing a selection is atomic: it must undo in one step, not fold
1986
2101
  // into whatever the caret-continuity rule would otherwise see.
@@ -2001,10 +2116,6 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2001
2116
  const clampRowStart = (pos) => block && cursor >= block.end ? Math.max(pos, block.end) : pos;
2002
2117
  const clampRowEnd = (pos) => block && cursor <= block.start ? Math.min(pos, block.start) : pos;
2003
2118
  if (block) {
2004
- if (key.escape) {
2005
- updateFoldBlock(null);
2006
- return;
2007
- }
2008
2119
  if ((key.backspace && cursor === block.end) || (key.delete && cursor === block.start)) {
2009
2120
  const next = value.slice(0, block.start) + value.slice(block.end);
2010
2121
  updateFoldBlock(null);
@@ -2647,7 +2758,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2647
2758
  }
2648
2759
  return;
2649
2760
  }
2650
- if (isMod(key) && key.leftArrow) {
2761
+ if ((isMod(key) || key.meta) && key.leftArrow) {
2651
2762
  // Jump to the previous word boundary (readline alt+b). Must precede the
2652
2763
  // bare-arrow arms: Ctrl+Left arrives as leftArrow + ctrl. An active
2653
2764
  // selection collapses to its START edge first (editor semantics).
@@ -2655,7 +2766,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2655
2766
  setInput(value, sel ? sel.start : wordBoundaryLeft(value, cursor));
2656
2767
  return;
2657
2768
  }
2658
- if (isMod(key) && key.rightArrow) {
2769
+ if ((isMod(key) || key.meta) && key.rightArrow) {
2659
2770
  // Jump to the next word boundary (readline alt+f).
2660
2771
  const sel = selectionRef.current;
2661
2772
  setInput(value, sel ? sel.end : wordBoundaryRight(value, cursor));
@@ -2682,7 +2793,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2682
2793
  setInput(value, sel ? sel.end : nextGraphemeBoundary(bounds, cursor));
2683
2794
  return;
2684
2795
  }
2685
- if (key.backspace) {
2796
+ if (key.backspace && !key.meta) {
2686
2797
  if (cursor === 0)
2687
2798
  return;
2688
2799
  const start = previousGraphemeBoundary(bounds, cursor);
@@ -2739,19 +2850,12 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2739
2850
  undoDraft();
2740
2851
  return;
2741
2852
  }
2742
- if (isMod(key) && input === 'w') {
2853
+ if ((isMod(key) && input === 'w') || (key.meta && key.backspace)) {
2743
2854
  // Delete the word before the cursor: readline's whitespace-delimited
2744
2855
  // rule (skip trailing whitespace, then the word). The ICU/CJK
2745
2856
  // alternative is a separate editor-UX change, not part of draft undo.
2746
2857
  // The deletion start never crosses into the block.
2747
- const before = value.slice(0, cursor);
2748
- let end = before.length;
2749
- while (end > 0 && /\s/.test(before[end - 1]))
2750
- end--;
2751
- let start = end;
2752
- while (start > 0 && !/\s/.test(before[start - 1]))
2753
- start--;
2754
- deleteInputRange(clampRowStart(start), cursor);
2858
+ deleteInputRange(clampRowStart(wordBoundaryLeft(value, cursor)), cursor);
2755
2859
  return;
2756
2860
  }
2757
2861
  // ── vim mode (`/vim`) ──────────────────────────────────────────────
@@ -3022,28 +3126,6 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
3022
3126
  }
3023
3127
  }
3024
3128
  if (key.escape) {
3025
- if (helpOpen) {
3026
- onToggleHelp();
3027
- return;
3028
- }
3029
- // A single Esc closes the open command menu first;
3030
- // the double-tap-clear semantics only apply to ordinary input.
3031
- if (overlayOpen) {
3032
- clearDraftUndoably();
3033
- return;
3034
- }
3035
- // File overlay: Esc dismisses the menu for THIS token only — clearing
3036
- // the input would nuke a mid-message `@` mention's surrounding text.
3037
- if (fileOverlayOpen) {
3038
- fileEscRef.current = mention?.start ?? -1;
3039
- return;
3040
- }
3041
- // The docked-queue selector folds before anything else: Esc leaves the
3042
- // selector (Chat's delegation reaches this through consumeEscape too).
3043
- if (dockSelectedRef.current !== null) {
3044
- setDockSelected(null);
3045
- return;
3046
- }
3047
3129
  // With pending messages while working, Esc = interrupt and DOCK the
3048
3130
  // queue (Claude Code parity): the previews park channel-side and the
3049
3131
  // dock hint offers ↑ to edit one / ⏎ to send them all — nothing
@@ -3054,18 +3136,6 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
3054
3136
  channel.cancel();
3055
3137
  return;
3056
3138
  }
3057
- // "Send to Chat" chips peel before the draft: the first Esc drops the
3058
- // contexts panels staged and leaves the typed text untouched, so a second
3059
- // Esc then clears the input as usual. The press is CONSUMED — this rung
3060
- // has exactly one meaning, and a running turn must not be interrupted by
3061
- // the same key that only dropped a chip.
3062
- const stagedContexts = channel.attachedContexts ?? [];
3063
- if (stagedContexts.length > 0) {
3064
- event?.stopImmediatePropagation();
3065
- for (const staged of [...stagedContexts])
3066
- channel.detachContext(staged.id);
3067
- return;
3068
- }
3069
3139
  // A single Esc clears the current input (if any); the double-tap
3070
3140
  // path below handles rewind/clear on an already-empty input. A BIG
3071
3141
  // input folds into a block instead (Esc = the fold toggle; the
@@ -3125,6 +3195,18 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
3125
3195
  setFileSelected(0);
3126
3196
  }
3127
3197
  }, { isActive: !suspended });
3198
+ // Readiness follows the listener's own gate. Announcing on mount regardless
3199
+ // lets the owner drain a replay queue into a handler that drops every key
3200
+ // while suspended (plugin dialog, approval, …), and a `[]` effect never
3201
+ // re-fires once the panel closes. The callback goes through a ref so an
3202
+ // inline closure from the parent cannot re-trigger the replay per render.
3203
+ const onInputReadyRef = React.useRef(onInputReady);
3204
+ React.useLayoutEffect(() => { onInputReadyRef.current = onInputReady; });
3205
+ React.useEffect(() => {
3206
+ if (suspended)
3207
+ return;
3208
+ onInputReadyRef.current?.();
3209
+ }, [suspended]);
3128
3210
  // === Render: hard-wrap every logical line at the input width, then show
3129
3211
  // the window of visual lines with the caret row always visible.
3130
3212
  // Narrow terminals: the usable width follows the real terminal down to a
@@ -3798,7 +3880,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
3798
3880
  // 点击提示行 = 全部发送(与空输入 ⏎ 同路径)
3799
3881
  , {
3800
3882
  // 点击提示行 = 全部发送(与空输入 ⏎ 同路径)
3801
- onClick: () => { sendDocked(); }, children: _jsxs(Text, { dimColor: true, children: [' ', t('input-pending-dock-hint')] }) })] })), _jsxs(Text, { dimColor: true, children: ["Alt+\u2191 ", t('input-pending-actions-hint')] })] })), fileOverlayOpen && (_jsx(FileSuggestions, { files: fileMatches, selectedIndex: fileSelected, columns: columns, query: mention?.query ?? '', accent: promptAccent,
3883
+ onClick: () => { sendDocked(); }, children: _jsxs(Text, { dimColor: true, children: [' ', t(channel.working ? 'input-pending-dock-hint-working' : 'input-pending-dock-hint')] }) })] })), _jsxs(Text, { dimColor: true, children: ["Alt+\u2191 ", t('input-pending-actions-hint')] })] })), fileOverlayOpen && (_jsx(FileSuggestions, { files: fileMatches, selectedIndex: fileSelected, columns: columns, query: mention?.query ?? '', accent: promptAccent,
3802
3884
  // 点击行 = 接受该项(与 Enter 同路径)
3803
3885
  onPick: (index) => {
3804
3886
  const file = fileMatches[index];
@@ -1 +1 @@
1
- {"version":3,"file":"SplitDiffView.d.ts","sourceRoot":"","sources":["../../../src/components/SplitDiffView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAO7D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAI/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AA4W3D,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,cAAuB,EACvB,MAAM,GACP,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C,GAAG,KAAK,CAAC,SAAS,CAmHlB"}
1
+ {"version":3,"file":"SplitDiffView.d.ts","sourceRoot":"","sources":["../../../src/components/SplitDiffView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAQ7D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAI/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAyhB3D,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,cAAuB,EACvB,MAAM,GACP,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C,GAAG,KAAK,CAAC,SAAS,CA0MlB"}