@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
@@ -11,7 +11,7 @@ import { envThemeOverride } from '../components/design-system/ThemeProvider.js';
11
11
  import { resolveBrand, setActiveBrand } from '../branding.js';
12
12
  import { hasPath } from '../dsh-adapter/settingsEditor.js';
13
13
  import { planReload } from '../reload.js';
14
- import { AlternateScreen, Box, Image, Text, InputCaret, useInput, ScrollBox, useTheme, useTerminalSize } from '../ui.js';
14
+ import { AlternateScreen, Box, Image, Text, InputCaret, useInput, useApp, useStdin, ScrollBox, useTheme, useTerminalSize } from '../ui.js';
15
15
  import { usePageInset } from '../components/PageMargin.js';
16
16
  import { POINTER } from '../terminal-utils/figures.js';
17
17
  import { previousCodePoint } from '../components/AgentMessageComposer.js';
@@ -20,8 +20,10 @@ import { actionMatches, effectiveComboDisplay, primaryComboString } from '../uti
20
20
  import { formatTokens } from '../terminal-utils/format.js';
21
21
  import { formatClock } from '../trajectory/format.js';
22
22
  import { homeDir } from '../utils/paths.js';
23
+ import { displayWorkingDirectory } from '../sessions/format.js';
24
+ import { sessionWorkingDirectory } from '../channel/working-directory.js';
23
25
  import { execFileNoThrow } from '../utils/execFileNoThrow.js';
24
- import { cleanBlockLines, cleanRenderText, cleanScalarText } from '../dsh-adapter/sanitize.js';
26
+ import { cleanBlockLines, cleanCommandReport, cleanRenderText, cleanScalarText } from '../dsh-adapter/sanitize.js';
25
27
  import { readModelRecents, recordModelUse } from '../modelRecents.js';
26
28
  import { WORKING_GATE_NOTICES } from '../commands.js';
27
29
  import { TuiDialogStore } from '../dsh-adapter/dialogs.js';
@@ -46,9 +48,12 @@ import { AskUserQuestionPanel } from '../components/questions/AskUserQuestionPan
46
48
  import { ApprovalPanel } from '../components/approvals/ApprovalPanel.js';
47
49
  import { ExtensionDialog } from '../components/ExtensionDialog.js';
48
50
  import { consumeBoundaryRecoveryRemount } from '../ink/update-overflow-guard.js';
51
+ import { InputEvent } from '../ink/events/input-event.js';
49
52
  import { useSearchHighlight } from '../ink/hooks/use-search-highlight.js';
50
- import { useTerminalTitle } from '../ink/hooks/use-terminal-title.js';
53
+ import { ChatTitle } from '../components/ChatTitle.js';
51
54
  import { useTerminalFocus } from '../ink/hooks/use-terminal-focus.js';
55
+ import { useProgramStatus } from '../ink/hooks/use-program-status.js';
56
+ import { supportsProgramStatus } from '../ink/termio/osc7501.js';
52
57
  import { useCopyOnSelect } from '../ink/hooks/use-copy-on-select.js';
53
58
  import { useSelection } from '../ink/hooks/use-selection.js';
54
59
  import { NoSelect } from '../ink/components/NoSelect.js';
@@ -65,6 +70,7 @@ import { PromptInput, composerImageRefsForText } from '../components/PromptInput
65
70
  import { turnUsageParts } from '../components/TurnUsageRow.js';
66
71
  import { AgentTranscriptScene } from './AgentTranscriptScene.js';
67
72
  import { agentViewStore } from '../components/sidePanel/agentViewStore.js';
73
+ import { subagentFailureRead, subagentFailureScope } from '../components/sidePanel/subagentFailureRead.js';
68
74
  import { agentComposeTargetOf } from '../components/messages/agentTeam.js';
69
75
  import { resolveBindingGeneration } from '../components/promptDraftCache.js';
70
76
  import { PromptEditorLayer, usePromptEditorOpen } from '../components/PromptEditor.js';
@@ -140,7 +146,6 @@ import { statSync } from 'node:fs';
140
146
  import { setClipboard } from '../ink/termio/osc.js';
141
147
  import { TerminalWriteContext } from '../ink/useTerminalNotification.js';
142
148
  import instances from '../ink/instances.js';
143
- import { useAnimationFrame } from '../ink/hooks/use-animation-frame.js';
144
149
  import { useExternalVersion } from '../hooks/useExternalVersion.js';
145
150
  import { TrajectoryScene } from './TrajectoryScene.js';
146
151
  import { markHomeSeen } from '../homePrefs.js';
@@ -184,6 +189,15 @@ const LOCAL_BLOCK_CELLS = 4000;
184
189
  * file, but a healthy import of thousands of conversations finishes well
185
190
  * inside this; without a cap a wedged child would hang the loop forever. */
186
191
  const MIGRATE_CHILD_TIMEOUT_MS = 30 * 60 * 1000;
192
+ /**
193
+ * How long an interrupt may stay unconverged before the TUI says so. A normal
194
+ * abort ends the turn in well under a second; a tool that ignores its
195
+ * `AbortSignal` keeps the agent loop waiting forever (dsh-agent-loop awaits
196
+ * every dispatched tool on abort), so `working`/`cancelPending` never clear.
197
+ * The notice names `/restart` as the recovery hatch; this only ends the silent
198
+ * dead end in which every key seemed to do nothing.
199
+ */
200
+ const INTERRUPT_STUCK_MS = 10_000;
187
201
  /**
188
202
  * 落地页参数行四段能点开的既有选择器(第五版):模型 → /model、思考深度 →
189
203
  * /effort、模式 → /plan、权限预设 → /permission。盖在落地页之上时键盘归
@@ -277,8 +291,6 @@ function contextOccupancyLine(channel) {
277
291
  window: formatTokens(occupancy.contextWindow),
278
292
  });
279
293
  }
280
- /** Terminal-title spinner frames. */
281
- const TITLE_SPINNER_FRAMES = ['⠂', '⠐'];
282
294
  /** Searchable transcript text for one row (`/` incsearch):
283
295
  * user text, assistant text, thinking, tool args/results, local output). */
284
296
  function searchableText(row) {
@@ -332,6 +344,7 @@ function peekKey(image, title) {
332
344
  return `${title ?? ''} ${image.id}`;
333
345
  }
334
346
  export function Chat({ channel, questionStore, approvalStore, extensionDialogs, bonusNotices, extensionStatus, activityStore, extensionShortcuts, themeHost, onExit, onUpdate, onRestart, onSwitchBackend, onRestartFreshSession, onProbeKernels, kernelEntries = EMPTY_KERNEL_ENTRIES, onResolveSdkInstall, onPluginInstall, onPluginManage, onTeamCommand, kernelPinned, fullscreen = false, trajectorySeen: trajectorySeenProp, injectControllerRef, promptControllerRef: promptControllerRefProp, renderScene, openHomeOnBoot, launchpadOnBoot, onboardingOnBoot, starPrompt, }) {
347
+ const { internal_eventEmitter: inputEmitter } = useStdin();
335
348
  const writeRaw = React.useContext(TerminalWriteContext);
336
349
  // Re-render whenever the channel mutates; rows/status are read fresh below.
337
350
  // DEFAULT lane on purpose (useExternalVersion): the channel version bumps
@@ -342,8 +355,10 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
342
355
  // the process (beta.3; the reveal-store half was PR #680, this is the
343
356
  // channel half — the surviving source on Windows timer granularity).
344
357
  useExternalVersion(channel.subscribe, () => channel.version);
345
- // Re-render on language switches so the whole UI hot-swaps its strings.
346
- React.useSyncExternalStore(subscribeLang, getLang);
358
+ const failureScope = subagentFailureScope(channel);
359
+ // Re-render on language switches so the whole UI hot-swaps its strings; the
360
+ // value itself is what memoized strings key their language dependency on.
361
+ const lang = React.useSyncExternalStore(subscribeLang, getLang);
347
362
  const promptEditorOpen = usePromptEditorOpen();
348
363
  // The pending ask-user-question (DSH user-interaction seam): the model's
349
364
  // `ask_user_question` tool parks here until the panel is answered.
@@ -373,6 +388,18 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
373
388
  const subscribeStatus = React.useCallback((listener) => statusContributions.subscribe(listener), [statusContributions]);
374
389
  const statusEntries = React.useSyncExternalStore(subscribeStatus, () => statusContributions.getSnapshot());
375
390
  const statusViews = React.useSyncExternalStore(subscribeStatus, () => statusContributions.getViewSnapshot());
391
+ // Plugin footer fields (tuiStatus.setField): same subscription/store as the
392
+ // text line, own snapshot — a mutation rebuilds only the affected list.
393
+ const statusFields = React.useSyncExternalStore(subscribeStatus, () => statusContributions.getFieldSnapshot());
394
+ // A plugin's footer-field click that threw is logged by the service; the
395
+ // user-facing signal is a toast naming the key (same shape as the shortcut
396
+ // handler above). The service never lets the throw reach the renderer.
397
+ React.useEffect(() => {
398
+ statusContributions.setFieldErrorHandler(key => {
399
+ channel.notify(t('ext-status-field-failed', { key }), { color: 'error', timeoutMs: 4000 });
400
+ });
401
+ return () => statusContributions.setFieldErrorHandler(undefined);
402
+ }, [statusContributions, channel]);
376
403
  // Shortcut handler failures surface as toasts (the registry also logs
377
404
  // them); the hook is re-pointed on every mount so a stale closure never
378
405
  // outlives its channel.
@@ -674,9 +701,8 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
674
701
  /**
675
702
  * 打开**整屏界面**的命令(第七版):从落地页触发这些命令时**不收掉落地页**
676
703
  * ——整屏盖在落地页之上渲染(它们的 early-return 排在落地页分支之前),
677
- * Esc 退出整屏回到落地页(草稿/参数/焦点原样保留)。这是「从启动页进入
678
- * 对话页的唯一路径 = Enter 提交一条非命令消息」的落地:任何返回键都不再
679
- * 把人甩到对话页。其余命令(star / update / help / 转录输出类)的反馈在
704
+ * Esc 退出整屏回到落地页(草稿/参数/焦点原样保留),返回键不会切到对话页。
705
+ * 其余命令(star / update / help / 转录输出类)的反馈在
680
706
  * 对话页,仍按旧约收掉落地页再执行。
681
707
  */
682
708
  const launchpadScreenCommands = React.useMemo(() => new Set(['home', 'resume', 'agentview', 'settings', 'jobs', 'tree', 'agents', 'setup', 'bg', 'background']), []);
@@ -791,6 +817,10 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
791
817
  runSdkInstall(dir);
792
818
  });
793
819
  };
820
+ /** `/plugin` reports keep section indentation and blank rows. */
821
+ const pushPluginLocal = (lines) => {
822
+ channel.pushLocal('/plugin', lines, { preserveWhitespace: true });
823
+ };
794
824
  /**
795
825
  * `/plugin install <spec>` 的步骤态(C-4)。六件套(ref / state / 收尾 / 结算 /
796
826
  * 栅栏 / 起步)与 manage 侧共用 `usePluginWriteFlow`,两处的差异只有「关浮层
@@ -800,7 +830,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
800
830
  overlayKind: 'plugin-install',
801
831
  overlay,
802
832
  dispatchOverlay,
803
- pushLocal: lines => channel.pushLocal('/plugin', lines),
833
+ pushLocal: pushPluginLocal,
804
834
  initialStep: { kind: 'done' },
805
835
  // 装了半截就关浮层会把 profile 留在半装状态:取消由服务自己结算(回滚)。
806
836
  cancelOnClose: flow => flow.cancel(),
@@ -812,7 +842,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
812
842
  binding: () => channel.agentBindingGeneration,
813
843
  // 回合运行中改 profile 会触发应用/HMR:门禁在流程里(inspect 之前与写入之前各查一次)。
814
844
  busy: () => channel.working,
815
- onLines: lines => channel.pushLocal('/plugin', lines),
845
+ onLines: pushPluginLocal,
816
846
  });
817
847
  if (flow === undefined)
818
848
  return false;
@@ -840,7 +870,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
840
870
  overlayKind: 'plugin-manage',
841
871
  overlay,
842
872
  dispatchOverlay,
843
- pushLocal: lines => channel.pushLocal('/plugin', lines),
873
+ pushLocal: pushPluginLocal,
844
874
  initialStep: { kind: 'done' },
845
875
  failureLine: error => t('plugins-manage-failed', { reason: cleanScalarText(error, COMMAND_RESULT_CELLS) }),
846
876
  });
@@ -855,7 +885,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
855
885
  binding: () => channel.agentBindingGeneration,
856
886
  // 回合运行中改 profile 会触发应用/HMR:门禁在流程里(解析之前与写入之前各查一次)。
857
887
  busy: () => channel.working,
858
- onLines: lines => channel.pushLocal('/plugin', lines),
888
+ onLines: pushPluginLocal,
859
889
  teamActiveMembers: teamMembers,
860
890
  });
861
891
  if (flow === undefined)
@@ -1168,6 +1198,32 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1168
1198
  const questionMinimized = questionSnapshot !== null && minimizedQuestionKey === questionSnapshot.key;
1169
1199
  /** Fold state for the GoalTodoPanel todo section (ctrl/cmd+q or click). */
1170
1200
  const [todoCollapsed, setTodoCollapsed] = React.useState(false);
1201
+ // Dismiss only this idle projection; new goal/todo data or a session switch
1202
+ // reveals the footer again without changing the backend's canonical state.
1203
+ const [todoFooterOverride, setTodoFooterOverride] = React.useState(undefined);
1204
+ const todoFooterOverrideMatches = !channel.working && todoFooterOverride !== undefined
1205
+ && todoFooterOverride.agentId === channel.agentId
1206
+ && todoFooterOverride.goal === channel.goal
1207
+ && todoFooterOverride.todos === channel.todos;
1208
+ const completedTodoSnapshot = React.useRef(undefined);
1209
+ if (channel.goal?.phase !== 'complete')
1210
+ completedTodoSnapshot.current = undefined;
1211
+ else if (channel.working || completedTodoSnapshot.current?.goal !== channel.goal
1212
+ || completedTodoSnapshot.current?.agentId !== channel.agentId) {
1213
+ completedTodoSnapshot.current = { agentId: channel.agentId, goal: channel.goal, todos: channel.todos };
1214
+ }
1215
+ const completedTodoFooter = channel.goal?.phase === 'complete' && !channel.working
1216
+ && completedTodoSnapshot.current?.todos === channel.todos;
1217
+ const todoFooterHidden = todoFooterOverrideMatches ? todoFooterOverride.hidden : completedTodoFooter;
1218
+ const toggleTodoFooter = () => {
1219
+ if (channel.working)
1220
+ setTodoCollapsed(previous => !previous);
1221
+ else
1222
+ setTodoFooterOverride({
1223
+ hidden: !todoFooterHidden,
1224
+ agentId: channel.agentId, goal: channel.goal, todos: channel.todos,
1225
+ });
1226
+ };
1171
1227
  const [thinkingVisible, setThinkingVisible] = React.useState(true);
1172
1228
  /** ctrl+r history-search entries (loaded on open, persists). */
1173
1229
  const [historyEntries, setHistoryEntries] = React.useState([]);
@@ -1177,10 +1233,11 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1177
1233
  * a row they are no longer looking at). */
1178
1234
  const rewindRequestRef = React.useRef(0);
1179
1235
  /** /btw side-question thread: pure UI state in btwThreads — the answers
1180
- * never enter the transcript or the session log. The floating overlay is
1181
- * only the FALLBACK surface (btw panel not enabled); with the panel
1182
- * enabled the same thread routes to the sidebar instead — one answer,
1183
- * exactly one surface. */
1236
+ * never enter the transcript or the session log. Two surfaces, one owner:
1237
+ * the sidebar panel when the split can render AND is showing the btw
1238
+ * panel, otherwise the floating overlay in the conversation. This flag
1239
+ * records that the fallback is wanted; `btwOverlayVisible` decides whether
1240
+ * it actually owns the screen. */
1184
1241
  const [btwOverlayOpen, setBtwOverlayOpen] = React.useState(false);
1185
1242
  /** ⤢ fullscreen thread scene (openPanelFullscreen 'btw' route). */
1186
1243
  const [btwSceneOpen, setBtwSceneOpen] = React.useState(false);
@@ -1600,14 +1657,16 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1600
1657
  * in the effect below) resolves every clickable target the transcript
1601
1658
  * renders — http(s) links open the browser, `dsh-file:`/`file://` paths
1602
1659
  * open the file-action menu. `dsh-file:` payloads are RAW display paths
1603
- * (possibly relative), so they resolve against the CURRENT channel cwd
1604
- * at click time (read through a ref so this callback keeps a stable
1605
- * identity — it is threaded into memoized row components).
1660
+ * (possibly relative), so they resolve against the session's CURRENT
1661
+ * directory at click time — where it moved after opening, else its cwd
1662
+ * (read through a ref so this callback keeps a stable identity — it is
1663
+ * threaded into memoized row components).
1606
1664
  */
1607
- const cwdRef = React.useRef(channel.cwd);
1665
+ const currentCwd = sessionWorkingDirectory(channel);
1666
+ const cwdRef = React.useRef(currentCwd);
1608
1667
  React.useEffect(() => {
1609
- cwdRef.current = channel.cwd;
1610
- }, [channel.cwd]);
1668
+ cwdRef.current = currentCwd;
1669
+ }, [currentCwd]);
1611
1670
  const openFileActions = React.useCallback((rawPath) => {
1612
1671
  const resolved = resolveTargetPath(rawPath, cwdRef.current);
1613
1672
  // Whether the target is a directory decides the first menu row's label
@@ -1857,6 +1916,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1857
1916
  * the user into a different conversation.
1858
1917
  */
1859
1918
  const promptDraftRef = React.useRef({ current: null });
1919
+ const launchpadPendingInputRef = React.useRef([]);
1860
1920
  /**
1861
1921
  * Latest channel for the unmount release below: that effect must not re-run
1862
1922
  * on a channel identity change, yet its cleanup must release against the
@@ -1962,6 +2022,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
1962
2022
  // A stored draft can only belong to the conversation being replaced: the
1963
2023
  // composer is the one that writes it, and it writes it on the way out.
1964
2024
  promptDraftRef.current.current = null;
2025
+ launchpadPendingInputRef.current = [];
1965
2026
  if (pendingFillRef.current === draftSessionId) {
1966
2027
  pendingFillRef.current = null;
1967
2028
  return;
@@ -2051,12 +2112,10 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2051
2112
  uploadTokensRef.current = lastUploadTokens;
2052
2113
  loadingStartTimeRef.current = channel.turnStart;
2053
2114
  const thinkingStatus = useThinkingStatus(channel.spinnerMode === 'thinking');
2054
- // Terminal tab title: the session
2055
- // title when set, else "dsh-TUI"; a `⠂/⠐` spinner prefix while a turn is
2056
- // working (960ms cadence, only while the terminal is focused), a static
2057
- // `✦` otherwise. dsh-TUI brands the idle prefix with the DeepSeek whale.
2058
- const [titleFrame, setTitleFrame] = React.useState(0);
2059
2115
  const terminalFocused = useTerminalFocus();
2116
+ // Gate the stream this app renders to; embedders may replace process.stdout.
2117
+ const { stdout: appStdout } = useApp();
2118
+ const programStatusEnabled = React.useMemo(() => supportsProgramStatus(appStdout.isTTY === true), [appStdout]);
2060
2119
  // Mouse text selection auto-copy: active only in
2061
2120
  // fullscreen (<AlternateScreen> supplies mouse tracking); a no-op
2062
2121
  // subscription in inline mode, where selection belongs to the terminal.
@@ -2106,18 +2165,39 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2106
2165
  // letting the highlight vanish silently.
2107
2166
  () => channel.notify(t('copy-refused-stale'), { timeoutMs: 2500 }));
2108
2167
  const { clearSelection: clearMouseSelection, hasSelection: hasMouseSelection, getState: getMouseSelectionState, } = useSelection();
2109
- React.useEffect(() => {
2110
- if (!channel.working || !terminalFocused)
2111
- return;
2112
- const interval = setInterval(() => {
2113
- setTitleFrame(f => (f + 1) % TITLE_SPINNER_FRAMES.length);
2114
- }, 960);
2115
- return () => { clearInterval(interval); };
2116
- }, [channel.working, terminalFocused]);
2117
- const titlePrefix = channel.working
2118
- ? (TITLE_SPINNER_FRAMES[titleFrame] ?? '✦')
2119
- : '✦';
2120
- useTerminalTitle(`${titlePrefix} 🐋 ${channel.sessionTitle}`);
2168
+ // OSC 7501 program status: tell the terminal (and any agentic inbox) whether
2169
+ // this session is working, parked on the user, or finished. Precedence
2170
+ // matches the UI's own: a parked ask outranks a running turn. The pending
2171
+ // prompt is reduced to the one-line message the protocol carries.
2172
+ const programStatusBlocked = React.useMemo(() => {
2173
+ if (approvalSnapshot !== null) {
2174
+ const detail = approvalSnapshot.command ?? approvalSnapshot.reason ?? approvalSnapshot.title;
2175
+ return {
2176
+ kind: 'permission',
2177
+ message: t('program-status-approval', {
2178
+ tool: detail === undefined
2179
+ ? approvalSnapshot.toolName
2180
+ : `${approvalSnapshot.toolName} · ${detail}`,
2181
+ }),
2182
+ };
2183
+ }
2184
+ if (dialogSnapshot !== null) {
2185
+ return { kind: 'question', message: t('program-status-dialog', { title: dialogSnapshot.title }) };
2186
+ }
2187
+ if (questionSnapshot !== null) {
2188
+ const { header, question, purpose } = questionSnapshot.question;
2189
+ return { kind: purpose === 'auth' ? 'auth' : 'question', message: t('program-status-question', { question: header ?? question }) };
2190
+ }
2191
+ return null;
2192
+ }, [approvalSnapshot, dialogSnapshot, questionSnapshot, lang]);
2193
+ // The hook reads the channel's own projected fields (`working`,
2194
+ // `turnOutcome` from `turn.end.reason`, the title and the session id), so
2195
+ // the usage ledger's stale outcome can never stand in for the turn's close.
2196
+ useProgramStatus({
2197
+ channel,
2198
+ blocked: programStatusBlocked,
2199
+ enabled: programStatusEnabled,
2200
+ });
2121
2201
  const handleWorkspaceResult = (result) => {
2122
2202
  workspaceFlowAbortRef.current = null;
2123
2203
  if (result.kind === 'target') {
@@ -2234,7 +2314,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2234
2314
  * Dispatch a slash command; false lets the input flow to the model.
2235
2315
  * Built-in names run the local switch; anything registered by a DSH
2236
2316
  * plugin (plan/goal/…) dispatches through the command registry, whose
2237
- * result text lands as a notification. `rawInput` carries the text after
2317
+ * result text lands as a local report for generic plugin commands. `rawInput` carries the text after
2238
2318
  * the command name (`/plan off` → ` off`).
2239
2319
  *
2240
2320
  * `render.block` prints a multi-line report the way `/plugins` prints one:
@@ -2253,7 +2333,21 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2253
2333
  channel.notify(t('command-not-found', { name }), { color: 'error' });
2254
2334
  return false;
2255
2335
  }
2256
- if (render?.block === true && outcome.kind !== 'error') {
2336
+ if (render?.report === true) {
2337
+ const { lines, truncated } = cleanCommandReport(outcome.text);
2338
+ if (truncated)
2339
+ lines.push(t('command-output-truncated'));
2340
+ // The report already has a cell cap. Avoid a second UTF-16 preview cut
2341
+ // splitting an emoji or a combining sequence in the local row sink.
2342
+ if (lines.length > 0)
2343
+ channel.pushLocal(`/${name}`, lines, { lineLimit: 65_536, preserveWhitespace: true });
2344
+ if (outcome.kind === 'error') {
2345
+ const cleaned = cleanRenderText(outcome.text, COMMAND_RESULT_CELLS);
2346
+ if (cleaned !== '')
2347
+ channel.notify(cleaned, { color: 'error' });
2348
+ }
2349
+ }
2350
+ else if (render?.block === true && outcome.kind !== 'error') {
2257
2351
  // Per-line sanitize: the newlines here are the report's structure.
2258
2352
  const lines = cleanBlockLines(outcome.text, LOCAL_BLOCK_CELLS);
2259
2353
  if (lines.length > 0)
@@ -2419,6 +2513,27 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
2419
2513
  channel.notify(t('startup-not-ready', { backend: kernelCurrentOption?.shortLabel ?? channel.backendCapabilities.backendId }), { color: 'warning', timeoutMs: 2500 });
2420
2514
  return true;
2421
2515
  };
2516
+ /** Move the unsent draft to chat, inserting a newline at the launchpad caret. */
2517
+ const newlineLaunchpad = (text, cursor) => {
2518
+ promptDraftRef.current.current = {
2519
+ ownerAgentId: String(channel.agentId),
2520
+ bindingGeneration: resolveBindingGeneration(channel),
2521
+ value: text.slice(0, cursor) + '\n' + text.slice(cursor),
2522
+ cursor: cursor + 1,
2523
+ foldBlock: null,
2524
+ expanded: false,
2525
+ vimEnabled: false,
2526
+ vimInsert: true,
2527
+ images: [...launchpadImagesRef.current],
2528
+ };
2529
+ // The composer snapshot now owns the capabilities behind the image chips.
2530
+ launchpadImagesRef.current.clear();
2531
+ setSupervisorOpen(false);
2532
+ setLaunchpadOpen(false);
2533
+ setLaunchpadFocus(-1);
2534
+ setLaunchpadDraft('');
2535
+ setLaunchpadCaret(0);
2536
+ };
2422
2537
  /**
2423
2538
  * Submit launchpad input or a selected command through the chat routes.
2424
2539
  *
@@ -3168,7 +3283,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3168
3283
  `${t('status-model', { model: channel.model })}${channel.reasoningEffort ? ` · ${capitalize(channel.reasoningEffort)} effort` : ''}`,
3169
3284
  `${t('status-state', { state: channel.working ? t('status-working') : t('status-idle') })}`,
3170
3285
  `${t('status-session', { id: channel.agentId })}`,
3171
- `${t('status-dir', { cwd: channel.displayCwd })}${channel.gitBranch ? ` · ${channel.gitBranch}` : ''}`,
3286
+ `${t('status-dir', { cwd: displayWorkingDirectory(channel) })}${channel.gitBranch ? ` · ${channel.gitBranch}` : ''}`,
3172
3287
  t('tokens-session-total', {
3173
3288
  input: formatTokens(channel.tokens.input),
3174
3289
  output: formatTokens(channel.tokens.output),
@@ -3410,30 +3525,20 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3410
3525
  void channel.pluginsInfo(rawInput).then((lines) => {
3411
3526
  if (channel.agentBindingGeneration !== originAgentBinding)
3412
3527
  return;
3413
- channel.pushLocal('/plugin', lines);
3528
+ pushPluginLocal(lines);
3414
3529
  });
3415
3530
  return true;
3416
3531
  }
3417
3532
  case 'team': {
3418
- // `/team` 是团队 bundle 的启停(team-mode.ts):on/off 走与 /plugin 同一个
3419
- // 生命周期流程与确认浮层,status 是一段报告;都按发起时的绑定落行。
3533
+ // `/team` 只报告团队状态(team-mode.ts);开关是 /plugin enable|disable。
3534
+ // 服务未挂载时这一行不在命令表里,但手敲仍会走到这里,拿回开启提示。
3420
3535
  setHelpOpen(false);
3421
3536
  if (onTeamCommand === undefined) {
3422
3537
  channel.pushLocal('/team', [t('team-cmd-unavailable')]);
3423
3538
  return true;
3424
3539
  }
3425
3540
  const originAgentBinding = channel.agentBindingGeneration;
3426
- const outcome = onTeamCommand(rawInput, {
3427
- binding: () => channel.agentBindingGeneration,
3428
- busy: () => channel.working,
3429
- onLines: lines => channel.pushLocal('/team', lines),
3430
- members: teamMembers,
3431
- });
3432
- if (outcome.kind === 'flow') {
3433
- pluginManage.start(outcome.flow, outcome.flow.begin());
3434
- return true;
3435
- }
3436
- void outcome.lines.then((lines) => {
3541
+ void onTeamCommand(rawInput, { members: teamMembers }).then((lines) => {
3437
3542
  if (channel.agentBindingGeneration !== originAgentBinding)
3438
3543
  return;
3439
3544
  channel.pushLocal('/team', [...lines]);
@@ -3883,15 +3988,19 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3883
3988
  // (cordis.yml root config, frozen fullscreen layout, newly built
3884
3989
  // code), so /restart respawns the process with the original argv and
3885
3990
  // resumes this session — the /update handoff minus the pnpm step.
3991
+ // Allowed mid-turn on purpose: a turn whose abort never converges
3992
+ // (a tool ignoring its AbortSignal) can leave `working` true forever,
3993
+ // and refusing the one command that can rebuild the process would
3994
+ // leave the user with no way out. The handoff notice written by the
3995
+ // exit funnel owns the visible copy (and says what the restart
3996
+ // interrupts); this toast only covers embedders whose onRestart does
3997
+ // not tear the screen down.
3886
3998
  setHelpOpen(false);
3887
3999
  if (onRestart === undefined) {
3888
4000
  channel.notify(t('restart-unavailable'), { color: 'warning' });
3889
4001
  }
3890
- else if (channel.working) {
3891
- channel.notify(t(WORKING_GATE_NOTICES.restart), { color: 'warning' });
3892
- }
3893
4002
  else {
3894
- channel.notify(t('restart-starting'));
4003
+ channel.notify(t(channel.working ? 'restart-during-turn' : 'restart-starting'), channel.working ? { color: 'warning', timeoutMs: 6_000 } : undefined);
3895
4004
  onRestart();
3896
4005
  }
3897
4006
  return true;
@@ -3944,9 +4053,12 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3944
4053
  }
3945
4054
  case 'btw': {
3946
4055
  // `/btw`:单轮无工具侧问,线程只在内存里(btwThreads,按会话
3947
- // 隔离),不打断主回合、不写会话历史。空参数只提示用法。启用了
3948
- // btw 面板就进面板线程(有模态界面时不抢开,只标未读);没启用
3949
- // 就用浮层。同一个问答只出现在一处。
4056
+ // 隔离),不打断主回合、不写会话历史。空参数只提示用法。分栏
4057
+ // 渲染得出来才进面板线程;否则退浮层——面板「已启用」只是配置,
4058
+ // 不代表分栏真的上屏(窄屏 / inline / 编辑器展开 /
4059
+ // splitEnabled=false 都会把它掩掉,issue #1631)。屏被别的浮层或
4060
+ // 整屏界面占着时两个表面都不抢开,只发通知。同一个问答只出现在
4061
+ // 一处。
3950
4062
  setHelpOpen(false);
3951
4063
  const question = rawInput.trim();
3952
4064
  if (!question) {
@@ -3958,12 +4070,18 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3958
4070
  channel.notify(t('btw-thread-busy'), { color: 'warning', timeoutMs: 3000 });
3959
4071
  return true;
3960
4072
  }
3961
- if (sidePanel.enabledPanelIds.includes('btw')) {
3962
- if (btwSurfaceFree())
4073
+ const btwPanelEnabled = sidePanel.enabledPanelIds.includes('btw');
4074
+ if (btwSurfaceFree()) {
4075
+ if (btwPanelEnabled && sidePanel.splitAvailable)
3963
4076
  sidePanel.openPanel('btw');
4077
+ else
4078
+ setBtwOverlayOpen(true);
3964
4079
  }
3965
4080
  else {
3966
- setBtwOverlayOpen(true);
4081
+ // 屏被别的浮层/整屏界面占着:侧问照常发出,但只在通知通道里说一
4082
+ // 句——既不把答案静默塞进看不见的地方,也不挂一个既看不见、又
4083
+ // 会先吃掉按键的浮层。
4084
+ channel.notify(t('btw-surface-busy'), { color: 'warning', timeoutMs: 4000 });
3967
4085
  }
3968
4086
  return true;
3969
4087
  }
@@ -3996,7 +4114,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
3996
4114
  const external = channel.commandList.find(command => command.external && command.name === name);
3997
4115
  if (external) {
3998
4116
  setHelpOpen(false);
3999
- return runExternalCommand(name, rawInput, images);
4117
+ return runExternalCommand(name, rawInput, images, { report: true });
4000
4118
  }
4001
4119
  return false;
4002
4120
  }
@@ -4113,6 +4231,24 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
4113
4231
  fullscreen: fullscreen && !launchpadShown,
4114
4232
  editorOpen: promptEditorOpen,
4115
4233
  });
4234
+ /**
4235
+ * 「面板上屏」不等于「分栏在渲染」:分栏画出的是 activePanelId 那一块,
4236
+ * 而活动面板默认是启用列表第一项。浮层只在侧栏真的显示 btw 线程时让位;
4237
+ * 侧栏停在别的面板上时把浮层卸掉,等于让用户什么都看不到(issue #1631
4238
+ * 的同一条静默路径)。
4239
+ */
4240
+ const btwPanelOnScreen = sidePanel.enabledPanelIds.includes('btw') && sidePanel.split && sidePanel.activePanelId === 'btw';
4241
+ /**
4242
+ * 浮层是否真的占着屏幕(因而可以接管输入)。渲染门与所有「让位 / 暂停
4243
+ * 输入」的判定都读这一个值:`btwOverlayOpen` 只是「想要浮层」,分栏重新
4244
+ * 出现后它可能为真却什么都不画——那时不能再让 PromptInput 与 Chat 的按键
4245
+ * 处理器让位(否则 composer 消失、Esc/Ctrl+C 都失效)。
4246
+ */
4247
+ // 编辑器展开会收起分栏;此时不能复活浮层并暂停 PromptInput,否则编辑器
4248
+ // 发布/撤下与分栏恢复会循环触发。主任务问卷也先接管显示和键盘,结束后
4249
+ // 再恢复浮层请求,保留在途侧问。
4250
+ const btwOverlayVisible = btwOverlayOpen && !btwPanelOnScreen
4251
+ && !promptEditorOpen && questionSnapshot === null;
4116
4252
  /**
4117
4253
  * 「全屏」出口(PanelBar 的 ⤢):把侧栏里那个面板的内容切到它原本的整屏
4118
4254
  * 形态。只映射**真的有整屏对应物**的面板 id(能力位 capabilities.fullscreen
@@ -4176,7 +4312,6 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
4176
4312
  // length is the honest dependency; its identity never changes.
4177
4313
  // oxlint-disable-next-line react-hooks/exhaustive-deps
4178
4314
  [trajectory.nodes, trajectory.counts.rows, wakeWidth]);
4179
- const [wakeTickRef, wakeTime] = useAnimationFrame(channel.working ? 120 : null);
4180
4315
  /**
4181
4316
  * The key hint beside the strip retires itself once the trajectory has been
4182
4317
  * opened — teaching belongs in the first minute, not on every frame forever.
@@ -4328,7 +4463,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
4328
4463
  const lastModalEnterAtRef = React.useRef(0);
4329
4464
  const couponVisible = coupon !== null && starModal === null
4330
4465
  && approvalSnapshot === null && dialogSnapshot === null && questionSnapshot === null
4331
- && overlay.kind === 'none' && !btwOverlayOpen && recap === null
4466
+ && overlay.kind === 'none' && !btwOverlayVisible && recap === null
4332
4467
  && !supervisorOpen && !treeOpen && !settingsOpen && !jobsPanelOpen
4333
4468
  && !sceneOpen && !subagentDashboardOpen && subagentDetailId === null
4334
4469
  && !btwSceneOpen;
@@ -4339,6 +4474,41 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
4339
4474
  if (coupon !== null)
4340
4475
  bonusNotices?.dismiss(coupon.orderId);
4341
4476
  }, [bonusNotices, coupon]);
4477
+ /**
4478
+ * Escalation surface for a wedged abort. `cancelPending` means a turn was
4479
+ * asked to stop and has not produced its terminal event yet; a tool that
4480
+ * never settles can hold that state forever. The channel-side `cancel()`
4481
+ * ignores repeats while the abort converges, so a repeated Esc used to be a
4482
+ * silent no-op — the user's "I pressed Esc and nothing happened". The
4483
+ * watchdog raises the warning once per interrupt episode and Esc answers
4484
+ * every press; `/restart` (no longer gated on `working`) is the way out.
4485
+ */
4486
+ const interruptWatchdogRef = React.useRef(null);
4487
+ const interruptWarnedRef = React.useRef(false);
4488
+ const clearInterruptWatchdog = React.useCallback(() => {
4489
+ if (interruptWatchdogRef.current !== null)
4490
+ clearTimeout(interruptWatchdogRef.current);
4491
+ interruptWatchdogRef.current = null;
4492
+ }, []);
4493
+ React.useEffect(() => {
4494
+ if (!channel.working || !channel.cancelPending) {
4495
+ // The turn settled (or the session was replaced): the next interrupt
4496
+ // episode starts with a fresh warning.
4497
+ clearInterruptWatchdog();
4498
+ interruptWarnedRef.current = false;
4499
+ return;
4500
+ }
4501
+ if (interruptWatchdogRef.current !== null)
4502
+ return;
4503
+ interruptWatchdogRef.current = setTimeout(() => {
4504
+ interruptWatchdogRef.current = null;
4505
+ if (!channel.working || !channel.cancelPending || interruptWarnedRef.current)
4506
+ return;
4507
+ interruptWarnedRef.current = true;
4508
+ channel.notify(t('interrupt-stuck'), { color: 'warning', timeoutMs: 10_000 });
4509
+ }, INTERRUPT_STUCK_MS);
4510
+ }, [channel.working, channel.cancelPending]);
4511
+ React.useEffect(() => () => clearInterruptWatchdog(), [clearInterruptWatchdog]);
4342
4512
  useInput((input, key, event) => {
4343
4513
  // 开屏"求 star"弹窗开着时键盘全归它(↑/↓/Enter/Esc 由它自己的
4344
4514
  // useInput 处理),滚轮也不许滚动它身后的转录——和下面的整屏界面
@@ -4350,7 +4520,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
4350
4520
  // still lets the panel receive them. PromptInput now stays mounted but
4351
4521
  // suspended to preserve async command drafts, making this guard also
4352
4522
  // essential for Ctrl+C: it must never clear the hidden composer.
4353
- if (btwOverlayOpen
4523
+ if (btwOverlayVisible
4354
4524
  || overlay.kind === 'tips'
4355
4525
  || (recap !== null && (!recap.auto || recap.expanded)))
4356
4526
  return;
@@ -5384,8 +5554,9 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5384
5554
  }
5385
5555
  }
5386
5556
  else if (key.escape && promptControllerRef.current?.consumeEscape()) {
5387
- // Selection/editor Esc stays with the composer even though Chat's
5388
- // global listener runs first. Consume it before interrupting the turn.
5557
+ // Local menu/preview/selection/editor Esc stays with the composer even
5558
+ // though Chat's global listener runs first. Only an unconsumed Esc
5559
+ // reaches the working-turn interrupt below.
5389
5560
  event.stopImmediatePropagation();
5390
5561
  }
5391
5562
  else if (key.escape && channel.working && !helpOpen && !promptControllerRef.current?.vimActive()) {
@@ -5399,10 +5570,23 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5399
5570
  // vim mode (either submode) yields: there Esc is a MODE key (INSERT→
5400
5571
  // NORMAL, NORMAL = no-op/cancel pending d) and the prompt owns it;
5401
5572
  // interrupting still works via Ctrl+C / Ctrl+Enter.
5402
- if (channel.pending.length > 0) {
5403
- if (channel.interruptAndDock() === 0)
5573
+ const undocked = channel.pending.some(item => item.docked !== true);
5574
+ if (undocked) {
5575
+ // Docking is Esc's documented meaning for queued rows, and it starts
5576
+ // its own interrupt; keep it even while a plain abort is in flight.
5577
+ if (channel.interruptAndDock() === 0 && !channel.cancelPending)
5404
5578
  channel.cancel();
5405
5579
  }
5580
+ else if (channel.cancelPending) {
5581
+ // The abort is already in flight: `cancel()`/`interruptAndDock()`
5582
+ // ignore repeats by contract, so answer the press instead of
5583
+ // swallowing it. Past the watchdog window the turn is wedged, and
5584
+ // the warning names `/restart` (allowed mid-turn) as the way out.
5585
+ channel.notify(t(interruptWarnedRef.current ? 'interrupt-stuck' : 'interrupt-pending'), {
5586
+ color: 'warning',
5587
+ timeoutMs: interruptWarnedRef.current ? 10_000 : 4_000,
5588
+ });
5589
+ }
5406
5590
  else {
5407
5591
  channel.cancel();
5408
5592
  }
@@ -5517,10 +5701,8 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5517
5701
  event.stopImmediatePropagation();
5518
5702
  }
5519
5703
  else if (actionMatches('todoFold', input, key)) {
5520
- // Fold/unfold the GoalTodoPanel todo section (default Ctrl+Q) — works
5521
- // mid-turn too: the collapsed line keeps the done/total count and the
5522
- // live task preview, so long todo lists stop crowding the prompt.
5523
- setTodoCollapsed(previous => !previous);
5704
+ // Fold running work; hide/restore the idle footer without mutating todos.
5705
+ toggleTodoFooter();
5524
5706
  // Consume: same readline-shadowing rule as dashboard/showAll above.
5525
5707
  event.stopImmediatePropagation();
5526
5708
  }
@@ -5802,13 +5984,15 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5802
5984
  dispatchOverlay({ type: 'close' });
5803
5985
  runFileAction(index, path);
5804
5986
  } }) })), overlay.kind === 'search' && _jsx(TranscriptSearch, { query: searchQuery, cursorOffset: searchCursor, count: searchCount, current: searchCurrent })] }));
5987
+ // Every scene retains the title, while its frame state stays in a null leaf.
5988
+ const withTitle = (content) => (_jsxs(_Fragment, { children: [_jsx(ChatTitle, { title: channel.sessionTitle, working: channel.working, focused: terminalFocused }), content] }));
5805
5989
  const screenOpen = channel.pluginScene !== undefined || supervisorOpen || settingsOpen
5806
5990
  || subagentDetailId !== null || subagentDashboardOpen || sceneOpen
5807
5991
  || agentView !== null
5808
5992
  || launchpadShown || onboardingOpen;
5809
5993
  if (interruptPanel !== null && screenOpen) {
5810
5994
  const node = (_jsx(Box, { flexDirection: "column", width: "100%", paddingX: 1, children: interruptPanel }));
5811
- return fullscreen ? node : _jsx(AlternateScreen, { children: node });
5995
+ return withTitle(fullscreen ? node : _jsx(AlternateScreen, { children: node }));
5812
5996
  }
5813
5997
  // A plugin scene (dsh-tui-scenes) takes the whole terminal the same way
5814
5998
  // the trajectory scene does, and sits at the TOP of this return chain:
@@ -5829,7 +6013,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5829
6013
  channel.notify(t('plugin-scene-crashed', { id, err: error.message }), { color: 'error' });
5830
6014
  channel.closePluginScene();
5831
6015
  }, children: renderScene ? renderScene(pluginScene.id, channel) : _jsxs(Text, { children: ["Scene unavailable: ", pluginScene.id] }) }));
5832
- return fullscreen ? node : _jsx(AlternateScreen, { children: node });
6016
+ return withTitle(fullscreen ? node : _jsx(AlternateScreen, { children: node }));
5833
6017
  }
5834
6018
  /**
5835
6019
  * The first-run guide — the FIRST frame of a fresh installation.
@@ -5852,7 +6036,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5852
6036
  closeOnboarding('skipped');
5853
6037
  void runCommand(name, '');
5854
6038
  } }));
5855
- return fullscreen ? node : _jsx(AlternateScreen, { children: node });
6039
+ return withTitle(fullscreen ? node : _jsx(AlternateScreen, { children: node }));
5856
6040
  }
5857
6041
  /**
5858
6042
  * The session supervisor: a screen in the same sense as the tree — an early
@@ -5922,9 +6106,11 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5922
6106
  return undefined;
5923
6107
  return { status: channel.working ? 'working' : 'idle', live: true, current: true, summary: '' };
5924
6108
  } }));
6109
+ // Tooltip 单例层挂在最外层末尾:被截断的工作区路径条 hover 后由它画完整路径。
6110
+ const supervisorScene = (_jsxs(_Fragment, { children: [supervisorNode, _jsx(TooltipLayer, {})] }));
5925
6111
  // Inline hosts enter the alternate screen for the duration; full-screen
5926
6112
  // hosts are already in it and must not nest a second one.
5927
- return fullscreen ? supervisorNode : _jsx(AlternateScreen, { children: supervisorNode });
6113
+ return withTitle(fullscreen ? supervisorScene : _jsx(AlternateScreen, { children: supervisorScene }));
5928
6114
  }
5929
6115
  // The session tree follows the browser's rule exactly: it REPLACES the
5930
6116
  // conversation (an early return after every hook above has run), so there
@@ -5938,14 +6124,14 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5938
6124
  pendingFillRef.current = String(channel.agentId);
5939
6125
  setHistoryFill(text);
5940
6126
  } }));
5941
- return fullscreen ? tree : _jsx(AlternateScreen, { children: tree });
6127
+ return withTitle(fullscreen ? tree : _jsx(AlternateScreen, { children: tree }));
5942
6128
  }
5943
6129
  // The settings screen follows the browser's rule exactly: it REPLACES the
5944
6130
  // conversation (an early return after every hook above has run), so there
5945
6131
  // is no transcript underneath to be repainted or bled through.
5946
6132
  if (settingsOpen && launchpadGate()) {
5947
- const screen = _jsx(Settings, { channel: channel, onClose: () => setSettingsOpen(false) });
5948
- return fullscreen ? screen : _jsx(AlternateScreen, { children: screen });
6133
+ const screen = _jsx(Settings, { channel: channel, onClose: () => setSettingsOpen(false), statusFields: statusFields });
6134
+ return withTitle(fullscreen ? screen : _jsx(AlternateScreen, { children: screen }));
5949
6135
  }
5950
6136
  // Main-screen read-only Agent View: a scene over the mounted Chat, with no
5951
6137
  // second Channel and no change of the bound session. It borrows the screen
@@ -5964,11 +6150,11 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5964
6150
  const loadTranscript = channel.subagentControl?.history;
5965
6151
  const viewMessages = messageControl === undefined ? [] : messageControl.messages().filter(m => m.from === agentView.agentId || m.to === agentView.agentId);
5966
6152
  const viewTarget = agentComposeTargetOf(agentView.agentId, new Map(channel.subagents.map(s => [s.agentId, s.description])));
5967
- const viewScene = (_jsx(AgentTranscriptScene, { subagent: viewSubagent, source: agentView.source, onExit: () => exitAgentView(agentView.source), ...(loadTranscript === undefined ? {} : { loadTranscript }), messages: viewMessages, ...(messageControl === undefined ? {} : { compose: { control: messageControl, target: viewTarget } }), roster: channel.subagents,
6153
+ const viewScene = (_jsx(AgentTranscriptScene, { subagent: viewSubagent, onFailureRead: agent => subagentFailureRead.acknowledge(failureScope, agent), source: agentView.source, onExit: () => exitAgentView(agentView.source), ...(loadTranscript === undefined ? {} : { loadTranscript }), messages: viewMessages, ...(messageControl === undefined ? {} : { compose: { control: messageControl, target: viewTarget } }), roster: channel.subagents,
5968
6154
  // Switching to a sibling or the parent swaps the viewed agent in
5969
6155
  // place; Esc still returns to the original entry point.
5970
6156
  onSwitchAgent: switchViewedAgent }));
5971
- return fullscreen ? viewScene : _jsx(AlternateScreen, { children: viewScene });
6157
+ return withTitle(fullscreen ? viewScene : _jsx(AlternateScreen, { children: viewScene }));
5972
6158
  }
5973
6159
  // Subagent detail scene: displays detailed view of a specific subagent.
5974
6160
  // Like the browser and settings, it replaces the conversation entirely.
@@ -5983,11 +6169,11 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5983
6169
  const detailControl = channel.subagentControl?.message;
5984
6170
  const detailMessages = detailControl === undefined ? [] : detailControl.messages().filter(m => m.from === subagent.agentId || m.to === subagent.agentId);
5985
6171
  const detailTarget = agentComposeTargetOf(subagent.agentId, new Map(channel.subagents.map(s => [s.agentId, s.description])));
5986
- const scene = (_jsx(SubagentDetailScene, { subagent: subagent, onInterrupt: (id) => channel.subagentControl?.interrupt(id), ...(channel.subagentControl?.history === undefined ? {} : { loadTranscript: channel.subagentControl.history }), onOpenView: () => openAgentView(subagent.agentId, { kind: 'agent-detail', agentId: subagent.agentId }), messages: detailMessages, ...(detailControl === undefined ? {} : { compose: { control: detailControl, target: detailTarget } }), onBack: () => {
6172
+ const scene = (_jsx(SubagentDetailScene, { subagent: subagent, onFailureRead: agent => subagentFailureRead.acknowledge(failureScope, agent), onInterrupt: (id) => channel.subagentControl?.interrupt(id), ...(channel.subagentControl?.history === undefined ? {} : { loadTranscript: channel.subagentControl.history }), onOpenView: () => openAgentView(subagent.agentId, { kind: 'agent-detail', agentId: subagent.agentId }), messages: detailMessages, ...(detailControl === undefined ? {} : { compose: { control: detailControl, target: detailTarget } }), onBack: () => {
5987
6173
  setSubagentDetailId(null);
5988
6174
  setSubagentDashboardOpen(true);
5989
6175
  } }));
5990
- return fullscreen ? scene : _jsx(AlternateScreen, { children: scene });
6176
+ return withTitle(fullscreen ? scene : _jsx(AlternateScreen, { children: scene }));
5991
6177
  }
5992
6178
  // Jobs panel: background jobs (running/killed) with kill/inspect actions.
5993
6179
  // Like the browser and settings, it replaces the conversation entirely.
@@ -5999,7 +6185,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
5999
6185
  channel.notify(t('jobs-kill-failed', { id }), { color: 'error' });
6000
6186
  }
6001
6187
  } }));
6002
- return fullscreen ? panel : _jsx(AlternateScreen, { children: panel });
6188
+ return withTitle(fullscreen ? panel : _jsx(AlternateScreen, { children: panel }));
6003
6189
  }
6004
6190
  // ⤢ btw thread scene (openPanelFullscreen 'btw'): the whole-terminal form
6005
6191
  // of the sidebar panel. Esc returns to the sidebar exactly as it was — the
@@ -6009,7 +6195,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6009
6195
  // 送聊天之后整屏场景让位:关场景 + 焦点回主输入框——与侧栏形态里
6010
6196
  // 「面板留着、焦点回输入框」的落点一致(见 BtwThreadScene.sendToChat)。
6011
6197
  onFocusChat: sidePanel.focusChat }));
6012
- return fullscreen ? scene : _jsx(AlternateScreen, { children: scene });
6198
+ return withTitle(fullscreen ? scene : _jsx(AlternateScreen, { children: scene }));
6013
6199
  }
6014
6200
  // Subagent dashboard: displays all active and completed subagents.
6015
6201
  // Like the browser and settings, it replaces the conversation entirely.
@@ -6020,12 +6206,12 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6020
6206
  setSubagentDashboardOpen(false);
6021
6207
  setSubagentDetailId(id);
6022
6208
  }, onOpenView: (id) => openAgentView(id, { kind: 'agents-dashboard' }), messages: channel.subagentControl?.message?.messages(), onClose: () => setSubagentDashboardOpen(false) }));
6023
- return fullscreen ? dashboard : _jsx(AlternateScreen, { children: dashboard });
6209
+ return withTitle(fullscreen ? dashboard : _jsx(AlternateScreen, { children: dashboard }));
6024
6210
  }
6025
6211
  /** Prompt input is inert while a modal dialog owns the keyboard. The
6026
6212
  * overlay union covers every picker/dialog and /tips in one check;
6027
6213
  * message-selection mode and the /btw panel live outside it. */
6028
- const promptSelectionActive = selectionActive || overlay.kind !== 'none' || btwOverlayOpen;
6214
+ const promptSelectionActive = selectionActive || overlay.kind !== 'none' || btwOverlayVisible;
6029
6215
  // These panels replace the visible composer, but PromptInput remains
6030
6216
  // mounted (suspended) so an async registry command cannot lose its exact
6031
6217
  // text/image draft while it waits for a user decision.
@@ -6033,7 +6219,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6033
6219
  || dialogSnapshot !== null
6034
6220
  || overlay.kind === 'tips'
6035
6221
  || (recap !== null && (!recap.auto || recap.expanded))
6036
- || btwOverlayOpen
6222
+ || btwOverlayVisible
6037
6223
  || questionPanelNode !== null
6038
6224
  || starModal !== null
6039
6225
  || couponVisible;
@@ -6047,7 +6233,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6047
6233
  // whole app back to the main screen.
6048
6234
  if (sceneOpen && launchpadGate()) {
6049
6235
  const scene = _jsx(TrajectoryScene, { channel: channel, build: trajectory, onClose: closeScene });
6050
- return fullscreen ? scene : _jsx(AlternateScreen, { children: scene });
6236
+ return withTitle(fullscreen ? scene : _jsx(AlternateScreen, { children: scene }));
6051
6237
  }
6052
6238
  /**
6053
6239
  * The launchpad — the landing page an ordinary launch starts on.
@@ -6055,8 +6241,9 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6055
6241
  * 第七版渲染姿态:early-return 排在**所有整屏界面(会话浏览器 / 设置 /
6056
6242
  * 任务面板 / 家谱 / 子代理 / 轨迹场景)之后**——从落地页打开的整屏盖在
6057
6243
  * 落地页之上,Esc 退出整屏回到这里(草稿/参数/焦点原样保留)。硬约束:
6058
- * 从启动页进入对话页的唯一路径是**提交一条非命令消息**(Enter 发送);
6059
- * 任何 Esc/返回都回到启动页。参数行点开的选择器经 `pickerPanels` +
6244
+ * Enter 发送非命令消息后进入对话页;Shift/Option+Enter 则带着未发送的
6245
+ * 草稿进入对话页,并在当前光标处换行。Esc/返回都回到启动页。
6246
+ * 参数行点开的选择器经 `pickerPanels` +
6060
6247
  * `inputPaused` 渲染在本屏之上,Esc 关掉它也回到这里。
6061
6248
  */
6062
6249
  if (launchpadShown) {
@@ -6122,10 +6309,9 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6122
6309
  dispatchOverlay({ type: 'close' });
6123
6310
  }
6124
6311
  void runCommand(segment, '');
6125
- }, onQueryChange: changeLaunchpadDraft, onSubmit: submitLaunchpad, onFocusChange: setLaunchpadFocus, onAction: (action) => {
6312
+ }, onQueryChange: changeLaunchpadDraft, onSubmit: submitLaunchpad, onNewline: newlineLaunchpad, onHandoffInput: event => launchpadPendingInputRef.current.push(event.keypress), onFocusChange: setLaunchpadFocus, onAction: (action) => {
6126
6313
  // 第八版(用户实测:「刚点帮助,不知道为什么直接进入聊天页面了」):
6127
- // 帮助**不属于**离开启动页的两条路(Enter 发非命令消息 / 会话浏览
6128
- // 里选中会话)——它盖在落地页之上(overlay kind 'help'),再点同一
6314
+ // 帮助盖在落地页之上(overlay kind 'help'),再点同一
6129
6315
  // 入口 = 收起(与参数段同一条切换语义)。
6130
6316
  if (action.command === 'help') {
6131
6317
  dispatchOverlay(overlay.kind === 'help'
@@ -6187,7 +6373,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6187
6373
  // 离开被悬停的那一段,没有这个键时旧卡片会继续画在选择器上方(复核场景回归见
6188
6374
  // `verify-launchpad-onboarding-chat` 的 R4)。
6189
6375
  const node = (_jsxs(_Fragment, { children: [launchpad, _jsx(TooltipLayer, { invalidationKey: overlay.kind })] }));
6190
- return fullscreen ? node : _jsx(AlternateScreen, { children: node });
6376
+ return withTitle(fullscreen ? node : _jsx(AlternateScreen, { children: node }));
6191
6377
  }
6192
6378
  // 浮层整体挂载条件:与内部各面板的可见条件同值(数据门在
6193
6379
  // dialogOverlayVisible 里逐面板镜像)。关闭时把整个 absolute 浮层从树里
@@ -6232,7 +6418,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6232
6418
  ? () => setPeekSuppressed(peekKey(activePreview.image, activePreview.title))
6233
6419
  : () => dispatchOverlay({ type: 'close-if', kind: 'image-preview' }), region: imagePreviewRegion }))
6234
6420
  : null;
6235
- return (_jsxs(Box, { ref: wakeTickRef, flexDirection: "column", flexGrow: 1, width: "100%", children: [_jsxs(SidePanelLayout, { geometry: sidePanel.geometry, focus: sidePanel.focus, onActivateChat: sidePanel.focusChat, onActivatePanel: sidePanel.focusPanel, onResize: sidePanel.resize, side: _jsx(SidePanelColumn, { width: sidePanel.panelColumns, controller: sidePanel, channel: channel, activity: workingActivity, attention: {
6421
+ return withTitle(_jsxs(Box, { flexDirection: "column", flexGrow: 1, width: "100%", children: [_jsxs(SidePanelLayout, { geometry: sidePanel.geometry, focus: sidePanel.focus, onActivateChat: sidePanel.focusChat, onActivatePanel: sidePanel.focusPanel, onResize: sidePanel.resize, side: _jsx(SidePanelColumn, { width: sidePanel.panelColumns, controller: sidePanel, channel: channel, activity: workingActivity, attention: {
6236
6422
  approvals: approvalSnapshot !== null ? 1 : 0,
6237
6423
  questions: questionSnapshot !== null ? 1 : 0,
6238
6424
  }, trajectory: trajectory, onExpand: openPanelFullscreen }), children: [!isSticky && timeline.activeId !== null && (_jsx(PinnedTurnHeader, { text: anchorUserText || null, onClick: () => {
@@ -6285,7 +6471,8 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6285
6471
  // inflating the reading next to a real upload number). An
6286
6472
  // automatic compaction mid-turn badges THIS line too — it is
6287
6473
  // the spinner slot whenever real activity data exists.
6288
- suffix: `${lastUploadTokens > 0 ? ` · ↑ ${formatTokens(lastUploadTokens)}` : ''} · ↓ ${formatTokens(Math.round(channel.responseChars / 4))} tokens${compactionBadge === undefined ? '' : ` · ${compactionBadge}`}` }) })) : (_jsx(WorkingSpinner, { mode: channel.spinnerMode, hasActiveTools: channel.activeToolCount > 0, responseLengthRef: responseLengthRef, uploadTokensRef: uploadTokensRef, loadingStartTimeRef: loadingStartTimeRef, totalPausedMsRef: totalPausedMsRef, pauseStartTimeRef: pauseStartTimeRef, thinkingStatus: thinkingStatus, suffix: compactionBadge }))), !channel.working && channel.compaction !== undefined && (_jsx(CompactionStatusRow, { compaction: channel.compaction, activityPreset: activitySlot ? channel.activityFrames : undefined })), !(sidePanel.split && sidePanel.enabledPanelIds.includes('todo')) && (_jsx(GoalTodoPanel, { channel: channel, collapsed: todoCollapsed, onToggle: () => setTodoCollapsed(previous => !previous) })), recap !== null && recap.auto && !recap.expanded && (_jsx(AutoRecapRow, { summary: recap.summary, streaming: !recap.done, onExpand: () => setRecap(prev => (prev ? { ...prev, expanded: true } : prev)), onDismiss: () => closeRecap() })), balance !== null && (_jsx(BalanceReportRow, { result: balance.result, refreshing: balance.refreshing, tokens: channel.tokens, model: channel.modelDisplay ?? channel.model, provider: channel.provider, mainCost: channel.mainCost, subagentCost: channel.subagentCost, onRefresh: runBalance, onDismiss: () => setBalance(null) })), statusEntries.length > 0 && (_jsx(Text, { dimColor: true, wrap: "truncate", children: statusEntries.map(entry => entry.text).join(' · ') })), activePreview === null && statusViews.map(view => (_jsx(PluginStatusViewBoundary, { viewKey: view.key, onError: (key, error) => statusContributions.reportViewError(key, error), children: _jsx(Box, { flexDirection: "column", flexShrink: 0, maxHeight: view.maxRows, overflow: "hidden", children: _jsx(Box, { flexDirection: "column", flexShrink: 0, children: React.createElement(view.component, {
6474
+ suffix: `${lastUploadTokens > 0 ? ` · ↑ ${formatTokens(lastUploadTokens)}` : ''} · ↓ ${formatTokens(Math.round(channel.responseChars / 4))} tokens${compactionBadge === undefined ? '' : ` · ${compactionBadge}`}` }) })) : (_jsx(WorkingSpinner, { mode: channel.spinnerMode, hasActiveTools: channel.activeToolCount > 0, responseLengthRef: responseLengthRef, uploadTokensRef: uploadTokensRef, loadingStartTimeRef: loadingStartTimeRef, totalPausedMsRef: totalPausedMsRef, pauseStartTimeRef: pauseStartTimeRef, thinkingStatus: thinkingStatus, suffix: compactionBadge }))), !channel.working && channel.compaction !== undefined && (_jsx(CompactionStatusRow, { compaction: channel.compaction, activityPreset: activitySlot ? channel.activityFrames : undefined })), !(sidePanel.split && sidePanel.enabledPanelIds.includes('todo'))
6475
+ && !todoFooterHidden && (_jsx(GoalTodoPanel, { channel: channel, collapsed: todoCollapsed, onToggle: toggleTodoFooter, idleDismissal: true })), recap !== null && recap.auto && !recap.expanded && (_jsx(AutoRecapRow, { summary: recap.summary, streaming: !recap.done, onExpand: () => setRecap(prev => (prev ? { ...prev, expanded: true } : prev)), onDismiss: () => closeRecap() })), balance !== null && (_jsx(BalanceReportRow, { result: balance.result, refreshing: balance.refreshing, tokens: channel.tokens, model: channel.modelDisplay ?? channel.model, provider: channel.provider, mainCost: channel.mainCost, subagentCost: channel.subagentCost, onRefresh: runBalance, onDismiss: () => setBalance(null) })), statusEntries.length > 0 && (_jsx(Text, { dimColor: true, wrap: "truncate", children: statusEntries.map(entry => entry.text).join(' · ') })), activePreview === null && statusViews.map(view => (_jsx(PluginStatusViewBoundary, { viewKey: view.key, onError: (key, error) => statusContributions.reportViewError(key, error), children: _jsx(Box, { flexDirection: "column", flexShrink: 0, maxHeight: view.maxRows, overflow: "hidden", children: _jsx(Box, { flexDirection: "column", flexShrink: 0, children: React.createElement(view.component, {
6289
6476
  React,
6290
6477
  ui: STATUS_VIEW_UI,
6291
6478
  }) }) }) }, `${view.key}:${view.registrationId}`))), _jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [approvalPanelNode !== null ? (approvalPanelNode) : dialogSnapshot !== null ? (_jsx(ExtensionDialog, { dialog: dialogSnapshot, onDecide: value => dialogs.decide(dialogSnapshot.key, value), onCancel: () => dialogs.cancel(dialogSnapshot.key) }, dialogSnapshot.key)) : overlay.kind === 'tips' ? (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(TipsPanel, { onClose: () => dispatchOverlay({ type: 'close-if', kind: 'tips' }) }) })) : recap !== null && (!recap.auto || recap.expanded) ? (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(RecapPanel, { summary: recap.summary, title: recap.title, error: recap.error, streaming: !recap.done, titleApplied: recap.titleApplied, onClose: () => {
@@ -6307,7 +6494,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6307
6494
  channel.renameSession(recap.title);
6308
6495
  setRecap(prev => (prev ? { ...prev, titleApplied: true } : prev));
6309
6496
  channel.notify(t('recap-title-applied-notify', { title: recap.title }), { color: 'success' });
6310
- } }) })) : btwOverlayOpen && !sidePanel.enabledPanelIds.includes('btw') ? (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BtwPanelFallback, { thread: btwOverlayThread, onClose: closeBtwOverlay, onCopy: answer => {
6497
+ } }) })) : btwOverlayVisible ? (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BtwPanelFallback, { thread: btwOverlayThread, onClose: closeBtwOverlay, onCopy: answer => {
6311
6498
  void setClipboard(answer).then(raw => { if (raw)
6312
6499
  writeRaw?.(raw); });
6313
6500
  channel.notify(t('copied-chars', { n: answer.length }), { timeoutMs: 1500 });
@@ -6319,7 +6506,14 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6319
6506
  // 不再重复弹同一条(error 色除外——可能要行动的信号永远走 toast)。
6320
6507
  // 渲染期判定(split + activePanelId),与气泡同一次提交切换,不会
6321
6508
  // 先闪一帧 toast 再消失。
6322
- toastSuppressed: petSaysNotices, draftCache: promptDraftRef.current, helpOpen: helpOpen, onToggleHelp: () => { setHelpOpen(previous => !previous); }, onRunCommand: runCommand, selectionActive: promptSelectionActive, fillText: historyFill, onFillConsumed: () => setHistoryFill(null), onRewindRequest: openRewind, onBackgroundRequest: backgroundToAgentView,
6509
+ toastSuppressed: petSaysNotices, draftCache: promptDraftRef.current, onInputReady: () => {
6510
+ // Restore the draft and register the composer listener before
6511
+ // replaying keys captured during the launchpad's final stdin batch.
6512
+ const pending = launchpadPendingInputRef.current;
6513
+ launchpadPendingInputRef.current = [];
6514
+ for (const keypress of pending)
6515
+ inputEmitter.emit('input', new InputEvent(keypress));
6516
+ }, helpOpen: helpOpen, onToggleHelp: () => { setHelpOpen(previous => !previous); }, onRunCommand: runCommand, selectionActive: promptSelectionActive, fillText: historyFill, onFillConsumed: () => setHistoryFill(null), onRewindRequest: openRewind, onBackgroundRequest: backgroundToAgentView,
6323
6517
  // The 🏠 at the head of the input row opens the same session screen
6324
6518
  // `/resume` and `/agentview` open — one surface, three doors. It is
6325
6519
  // gated on this prop rather than a setting, so hosts that mount the
@@ -6341,7 +6535,7 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6341
6535
  // clock and shifting every row-count layout invariant.
6342
6536
  channel.agentViewRows !== undefined && backgroundAgentsNeedingInput > 0
6343
6537
  ? backgroundAgentsNeedingInput
6344
- : undefined, controllerRef: promptControllerRef, onCaretImage: handleCaretImage, caretPreviewOpen: peekPreview !== null, onDismissCaretPreview: dismissPeek }, "prompt-input"), _jsx(StatusLine, { channel: channel, activity: workingActivity, selectionActive: selectionActive, helpOpen: helpOpen,
6538
+ : undefined, controllerRef: promptControllerRef, onCaretImage: handleCaretImage, caretPreviewOpen: peekPreview !== null, onDismissCaretPreview: dismissPeek }, "prompt-input"), _jsx(StatusLine, { channel: channel, activity: workingActivity, selectionActive: selectionActive, helpOpen: helpOpen, pluginFields: statusFields,
6345
6539
  // Backend-native permission modes: the footer mode segment always
6346
6540
  // shows (the base mode included) and clicks into the same
6347
6541
  // /permission picker the command opens (the launchpad param row's
@@ -6355,10 +6549,9 @@ export function Chat({ channel, questionStore, approvalStore, extensionDialogs,
6355
6549
  : {
6356
6550
  band: wakeBand,
6357
6551
  hint: trajectorySeen ? undefined : primaryComboString('trajectory'),
6358
- tick: Math.floor(wakeTime / 120),
6359
6552
  onOpen: openScene,
6360
6553
  hoverHint: primaryComboString('trajectory'),
6361
- } }), dialogOverlayOpen && (_jsx(OverlayAbove, { maxHeight: Math.max(terminalRows - 8, 1), children: pickerPanels }))] })] }), _jsx(TooltipLayer, { invalidationKey: `${overlay.kind}:${dialogOverlayOpen}:${btwOverlayOpen}`, subscribeInvalidation: subscribeTooltipInvalidation })] }), _jsx(PromptEditorLayer, {}), promptEditorOpen && imagePreviewNode, starModal !== null && STAR_MILESTONES[starModal.index] !== undefined && (_jsx(StarPrompt, { milestone: STAR_MILESTONES[starModal.index], actions: starModalActions, onClose: closeStarModal, initialPhase: starModal.phase })), couponVisible && coupon !== null && (_jsx(WhaleCouponPrompt, { notice: coupon, onShown: markCouponShown, onClose: closeCoupon }))] }));
6554
+ } }), dialogOverlayOpen && (_jsx(OverlayAbove, { maxHeight: Math.max(terminalRows - 8, 1), children: pickerPanels }))] })] }), _jsx(TooltipLayer, { invalidationKey: `${overlay.kind}:${dialogOverlayOpen}:${btwOverlayVisible}`, subscribeInvalidation: subscribeTooltipInvalidation })] }), _jsx(PromptEditorLayer, {}), promptEditorOpen && imagePreviewNode, starModal !== null && STAR_MILESTONES[starModal.index] !== undefined && (_jsx(StarPrompt, { milestone: STAR_MILESTONES[starModal.index], actions: starModalActions, onClose: closeStarModal, initialPhase: starModal.phase })), couponVisible && coupon !== null && (_jsx(WhaleCouponPrompt, { notice: coupon, onShown: markCouponShown, onClose: closeCoupon }))] }));
6362
6555
  }
6363
6556
  /**
6364
6557
  * The pinned prompt header shown above the ScrollBox while the user has