@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
@@ -503,9 +503,14 @@ function HeaderTitle({ name, title, isTerminal, folded, displayArgs, argsLanguag
503
503
  onOpenFile(filePath);
504
504
  }, children: _jsx(Text, { underline: true, wrap: "truncate-end", children: filePath }) }), after !== '' && (_jsx(Text, { bold: false, color: "text", wrap: "truncate-end", children: after }))] }));
505
505
  }
506
- const space = trimmed.indexOf(' ');
507
- const head = space === -1 ? trimmed : trimmed.slice(0, space);
508
- const tail = space === -1 ? '' : trimmed.slice(space);
506
+ // The accent covers the leading word only. A title written as `Name(args)`
507
+ // (the session-search cards, or any presenter that echoes its input the way
508
+ // the terminal card does) has no space to split on, so the opening paren is
509
+ // a delimiter too — otherwise the whole header would carry the tool tone.
510
+ const cuts = [trimmed.indexOf(' '), trimmed.indexOf('(')].filter(at => at > 0);
511
+ const cut = cuts.length === 0 ? -1 : Math.min(...cuts);
512
+ const head = cut === -1 ? trimmed : trimmed.slice(0, cut);
513
+ const tail = cut === -1 ? '' : trimmed.slice(cut);
509
514
  return (_jsx(Box, { flexWrap: "nowrap", ...headerTooltip, children: _jsxs(Text, { bold: true, color: nameColor, wrap: "truncate-end", children: [head, _jsx(Text, { bold: false, color: "text", children: tail })] }) }));
510
515
  }
511
516
  /**
@@ -569,9 +574,11 @@ export function AssistantToolUseMessage({ tool, marginTopOnTurn, verbose, isSele
569
574
  const elapsedText = elapsedMs !== undefined ? ` · ${formatDuration(elapsedMs)}` : '';
570
575
  // Body lines: the structured view first, raw result text as the fallback
571
576
  // (tools without a presenter, or a folded row awaiting loadOlder).
572
- // Wide terminals render diffs as a two-pane side-by-side instead: one
573
- // source line per terminal row (truncate) keeps the panes row-aligned,
574
- // which the flat add/del line model cannot express.
577
+ // Wide terminals render diffs as a two-pane side-by-side instead: the
578
+ // collapsed preview keeps one source line per terminal row (truncate) so the
579
+ // card keeps a fixed height, while the expanded view wraps each pane and pads
580
+ // the shorter side so the two stay row-aligned. Neither fits the flat
581
+ // add/del line model.
575
582
  const { columns } = useTerminalSize();
576
583
  // Interactive rows grow a ▾/▴ disclose column while the pointer dwells
577
584
  // (fixed, no layout shift elsewhere). The tooltip resolves at show time —
@@ -0,0 +1,19 @@
1
+ import type { ScrollBoxHandle } from '../ui.js';
2
+ /** Page immediately: keyboard navigation must not leave queued wheel motion. */
3
+ export declare function pagePreview(scroll: ScrollBoxHandle | null, direction: -1 | 1): void;
4
+ export interface PreviewRowView {
5
+ /** Display rows to paint, each at most `cells` wide, in order. */
6
+ readonly rows: readonly string[];
7
+ /** Source rows that did not fit under the budget (0 = nothing cut). */
8
+ readonly omitted: number;
9
+ }
10
+ /**
11
+ * Wrap `text` to `cells` display cells and keep at most `maxRows` rows,
12
+ * reserving the last row for the omitted marker when anything is cut.
13
+ *
14
+ * @param text - the backend text (may contain newlines, wide chars, ANSI).
15
+ * @param cells - content width in display cells (the row's real width).
16
+ * @param maxRows - rows this block may occupy, marker included (≥1).
17
+ */
18
+ export declare function clipPreviewRows(text: string, cells: number, maxRows: number): PreviewRowView;
19
+ //# sourceMappingURL=previewRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewRows.d.ts","sourceRoot":"","sources":["../../../src/components/previewRows.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAMnF;AAED,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAU5F"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Preview text clipped to a row budget — the shared bound for in-flow panels
3
+ * that show backend-authored text (an approval's command/reason/title, a
4
+ * questionnaire's question/detail) above their interactive tail.
5
+ *
6
+ * Those panels sit in the bottom chrome with `flexShrink: 0`, so their height
7
+ * IS their content height: unbounded text pushed the option rows and the key
8
+ * hint past the viewport, and the renderer clips rows below the screen — the
9
+ * user saw a wall of command text and no button to answer (#1664). Wrapping
10
+ * to the real content width first is what makes the budget exact: counting
11
+ * `split('\n')` rows under `wrap="wrap"` undercounts every long line.
12
+ *
13
+ * The caller renders one row per entry, then the omitted marker when
14
+ * `omitted > 0`. `rows.length + (omitted > 0 ? 1 : 0)` never exceeds
15
+ * `maxRows`, so a caller can subtract that from its budget.
16
+ */
17
+ import wrapText from '../ink/wrap-text.js';
18
+ /** Page immediately: keyboard navigation must not leave queued wheel motion. */
19
+ export function pagePreview(scroll, direction) {
20
+ if (scroll === null)
21
+ return;
22
+ const rows = scroll.getViewportHeight();
23
+ const maxTop = Math.max(0, scroll.getFreshScrollHeight() - rows);
24
+ const next = scroll.getScrollTop() + direction * Math.max(1, rows - 1);
25
+ scroll.scrollTo(Math.max(0, Math.min(maxTop, next)));
26
+ }
27
+ /**
28
+ * Wrap `text` to `cells` display cells and keep at most `maxRows` rows,
29
+ * reserving the last row for the omitted marker when anything is cut.
30
+ *
31
+ * @param text - the backend text (may contain newlines, wide chars, ANSI).
32
+ * @param cells - content width in display cells (the row's real width).
33
+ * @param maxRows - rows this block may occupy, marker included (≥1).
34
+ */
35
+ export function clipPreviewRows(text, cells, maxRows) {
36
+ // wrapText hard-wraps at `cells`, so every returned row renders as exactly
37
+ // one row (the Text node re-wraps but each line already fits).
38
+ const rows = wrapText(text, Math.max(1, Math.floor(cells)), 'wrap').split('\n');
39
+ const budget = Math.max(1, Math.floor(maxRows));
40
+ if (rows.length <= budget)
41
+ return { rows, omitted: 0 };
42
+ // A one-row budget can only say "there is more"; two rows show the first
43
+ // line plus the marker, and so on.
44
+ const shown = budget >= 2 ? rows.slice(0, budget - 1) : [];
45
+ return { rows: shown, omitted: rows.length - shown.length };
46
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"AskUserQuestionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/questions/AskUserQuestionPanel.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"AskUserQuestionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/questions/AskUserQuestionPanel.tsx"],"names":[],"mappings":"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"}
@@ -29,7 +29,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
29
29
  */
30
30
  import React from 'react';
31
31
  import { t } from '../../i18n.js';
32
- import { Box, Text, useInput, useTerminalSize } from '../../ui.js';
32
+ import { Box, Text, ScrollBox, useInput, useTerminalSize } from '../../ui.js';
33
+ import wrapText from '../../ink/wrap-text.js';
33
34
  import { useDeclaredCursor, useNativeCursor } from '../../ink/hooks/use-declared-cursor.js';
34
35
  import { Divider } from '../design-system/Divider.js';
35
36
  import { POINTER } from '../../terminal-utils/figures.js';
@@ -42,6 +43,7 @@ import { flattenPasteInline } from '../../dsh-adapter/sanitize.js';
42
43
  import { readClipboard } from '../../utils/clipboard.js';
43
44
  import { createHyperlink } from '../../terminal-utils/hyperlink.js';
44
45
  import { listWindow } from '../listWindow.js';
46
+ import { clipPreviewRows, pagePreview } from '../previewRows.js';
45
47
  /** Unmodified arrows switch questions; Ctrl/Alt/Super/Shift stay caret motion. */
46
48
  function isPlainArrow(key) {
47
49
  return key.ctrl !== true && key.meta !== true && key.super !== true && key.shift !== true;
@@ -61,6 +63,14 @@ const SECRET_MASK = '•';
61
63
  * PlanReviewPanel (the two panels share the same input contract).
62
64
  */
63
65
  const ANSWER_PASTE_MAX_POINTS = 8000;
66
+ /**
67
+ * Preview caps (#1664): each field contributes at most these rows to the
68
+ * shared body viewport, keeping the option list and key hint on screen. A
69
+ * short terminal shrinks them further through QUESTION_CHROME_ROWS — the
70
+ * rows the chrome and the panel scaffolding need before any preview text.
71
+ */
72
+ const QUESTION_PREVIEW_MAX_ROWS = 6;
73
+ const QUESTION_CHROME_ROWS = 20;
64
74
  export function AskUserQuestionPanel({ question, position, total, answered, initialDraft, onAnswer, onCancel, onEscape, onBack, onForward, readClipboardOverride, collapsed = false, onExpand, onToggleFold, fullscreen = false, }) {
65
75
  // Plan-mode's exit_plan_mode ask carries a presentation intent: render
66
76
  // the plan decision card instead of the generic questionnaire. The
@@ -78,7 +88,7 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
78
88
  // Opening Tab and later keys may share one stdin batch. Stop the list
79
89
  // synchronously, before the nested editor has had a chance to mount.
80
90
  const editingRef = React.useRef(false);
81
- const { rows: terminalRows } = useTerminalSize();
91
+ const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
82
92
  /** Rows: the real options plus the inline input row at the tail. */
83
93
  const rowCount = options.length + (hideCustomInput ? 0 : 1);
84
94
  // A saved draft wins over the wizard's default selection (returning to a
@@ -150,6 +160,7 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
150
160
  };
151
161
  const onInputRow = () => !hideCustomInput && focusRef.current === options.length;
152
162
  const [error, setError] = React.useState(null);
163
+ const bodyScrollRef = React.useRef(null);
153
164
  const inputFocused = !hideCustomInput && focusIndex === options.length;
154
165
  // Chat chrome + panel scaffolding consume twelve rows before the option
155
166
  // list: status line, outer/divider/question/list/hint spacing and content.
@@ -157,16 +168,55 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
157
168
  // lists then use fixed one/two-line rows so listWindow's budget is exact;
158
169
  // short questionnaires retain their existing wrapped presentation.
159
170
  const linkText = question.link === undefined || question.link === '' ? '' : createHyperlink(question.link);
160
- const detailRows = (question.detail === undefined ? 0 : question.detail.split('\n').length + 1)
161
- + (linkText === '' ? 0 : question.detail === undefined ? 2 : 1);
171
+ // The question and its detail are preview text above the option list, and
172
+ // `wrap` re-flows every long line: counting source lines undercounts the
173
+ // rows they really take, and neither text had a cap — a long question
174
+ // pushed the options and the hint off screen with nothing left to answer
175
+ // (#1664). Pre-wrap to the panel's content width, fold past the cap, and
176
+ // charge the REAL row count to the option budget below.
177
+ const contentCells = Math.max(8, terminalColumns - 4);
178
+ const previewMaxRows = Math.max(2, Math.min(QUESTION_PREVIEW_MAX_ROWS, terminalRows - QUESTION_CHROME_ROWS));
179
+ const questionView = clipPreviewRows(question.question, contentCells, previewMaxRows);
180
+ const questionBlockRows = questionView.rows.length + (questionView.omitted > 0 ? 1 : 0);
181
+ // The question's unused allowance flows to the detail — but only the rows
182
+ // the terminal frees up beyond the chrome floor. On a terminal already at
183
+ // that floor every preview row is contested, and the cap is what keeps the
184
+ // option list and the hint on screen; above it a one-line question must not
185
+ // fold the detail against a budget the question never needed.
186
+ const sparePreviewRows = Math.max(0, terminalRows - QUESTION_CHROME_ROWS - questionBlockRows);
187
+ const detailMaxRows = Math.max(2, Math.min(QUESTION_PREVIEW_MAX_ROWS, previewMaxRows + sparePreviewRows));
188
+ const detailView = question.detail === undefined
189
+ ? undefined
190
+ : clipPreviewRows(question.detail, contentCells, detailMaxRows);
191
+ const detailRows = detailView === undefined
192
+ ? (linkText === '' ? 0 : 2)
193
+ : detailView.rows.length + (detailView.omitted > 0 ? 1 : 0) + 1 + (linkText === '' ? 0 : 1);
194
+ // One viewport keeps the question and its detail independently reachable:
195
+ // a question without a detail must still be readable beyond its preview.
196
+ const bodyRows = questionView.rows.length + questionView.omitted
197
+ + (detailView === undefined ? 0 : detailView.rows.length + detailView.omitted)
198
+ + (question.detail !== undefined || linkText !== '' ? 1 : 0)
199
+ + (linkText === '' ? 0 : wrapText(linkText, contentCells, 'wrap').split('\n').length);
200
+ const previewRows = questionBlockRows + detailRows;
201
+ const bodyScrollRows = bodyRows > previewRows ? Math.max(1, previewRows - 1) : 0;
202
+ const submitRows = multiSelect && fullscreen && (checked.size > 0 || textRef.current !== '') ? 2 : 0;
162
203
  const reservedRows = 12
163
204
  + (question.header === undefined ? 0 : 1)
205
+ + (questionBlockRows - 1)
164
206
  + detailRows
165
207
  + (hideCustomInput ? 0 : 1)
166
- + (error === null ? 0 : 2);
208
+ + (error === null ? 0 : 2)
209
+ + submitRows;
167
210
  const optionBudget = Math.max(terminalRows - reservedRows, 2);
168
211
  const optionHeights = options.map(option => option.description === undefined ? 1 : 2);
169
- const windowedOptions = optionHeights.reduce((sum, height) => sum + height, 0) > optionBudget;
212
+ const optionLabels = options.map(option => option.label + (modelEditor?.edited(option.label) ? ` ${t('provider-model-edited')}` : ''));
213
+ // Non-windowed rows wrap at their actual text width. Reducing the preview
214
+ // must not disable windowing just because a multiline description was
215
+ // counted as one line. Windowed rows below still have fixed 1/2-row heights.
216
+ const optionCells = Math.max(1, contentCells - 3);
217
+ const wrappedOptionRows = options.reduce((sum, option, index) => sum + wrapText(optionLabels[index], optionCells, 'wrap').split('\n').length
218
+ + (option.description === undefined ? 0 : wrapText(option.description, optionCells, 'wrap').split('\n').length), 0);
219
+ const windowedOptions = wrappedOptionRows > optionBudget;
170
220
  const optionFocus = Math.min(focusIndex, Math.max(options.length - 1, 0));
171
221
  const optionWindow = windowedOptions
172
222
  ? listWindow(optionHeights, optionFocus, optionBudget)
@@ -372,6 +422,15 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
372
422
  }
373
423
  return;
374
424
  }
425
+ if (bodyScrollRows > 0) {
426
+ const up = actionMatches('questionDetailUp', input, key);
427
+ const down = actionMatches('questionDetailDown', input, key);
428
+ if (up || down) {
429
+ pagePreview(bodyScrollRef.current, up ? -1 : 1);
430
+ event.stopImmediatePropagation();
431
+ return;
432
+ }
433
+ }
375
434
  if (key.ctrl && input === 'c') {
376
435
  onCancel();
377
436
  return;
@@ -596,12 +655,13 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
596
655
  : absoluteIndex === optionWindow.end - 1 && optionWindow.end < options.length
597
656
  ? '↓'
598
657
  : ' ';
599
- const label = windowedOptions ? option.label.replace(/\s+/gu, ' ').trim() : option.label;
658
+ const optionLabel = optionLabels[absoluteIndex];
659
+ const label = windowedOptions ? optionLabel.replace(/\s+/gu, ' ').trim() : optionLabel;
600
660
  const description = windowedOptions
601
661
  ? option.description?.replace(/\s+/gu, ' ').trim()
602
662
  : option.description;
603
- return (_jsxs(Box, { flexDirection: "row", marginTop: !windowedOptions && focused ? 1 : 0, onClick: () => clickOption(absoluteIndex), onMouseEnter: () => setHoverIndex(absoluteIndex), onMouseLeave: () => setHoverIndex(current => (current === absoluteIndex ? -1 : current)), backgroundColor: hoverIndex === absoluteIndex && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: focused, children: pointer }) }), _jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: selected, children: selected ? (multiSelect ? CHECKED : '●') : UNCHECKED }) }), _jsxs(Box, { flexDirection: "column", marginLeft: 1, children: [_jsxs(Text, { bold: focused || selected, color: focused ? 'accent' : undefined, wrap: windowedOptions ? 'truncate' : 'wrap', children: [label, modelEditor?.edited(option.label) ? ` ${t('provider-model-edited')}` : ''] }), description !== undefined && (_jsx(Text, { dimColor: true, wrap: windowedOptions ? 'truncate' : 'wrap', children: description }))] })] }, `${absoluteIndex}:${option.label}`));
604
- }), hideCustomInput ? null : renderInputRow(), multiSelect && fullscreen && (checked.size > 0 || textRef.current !== '') && (_jsxs(Box, { flexDirection: "row", height: 1, marginTop: 1, onClick: submitOptions, onMouseEnter: () => setSubmitHovered(true), onMouseLeave: () => setSubmitHovered(false), backgroundColor: submitHovered ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Text, { color: "accent", children: "\u2713 " }), _jsx(Text, { dimColor: true, children: t('question-submit-selection') })] }))] }));
663
+ return (_jsxs(Box, { flexDirection: "row", marginTop: !windowedOptions && focused ? 1 : 0, onClick: () => clickOption(absoluteIndex), onMouseEnter: () => setHoverIndex(absoluteIndex), onMouseLeave: () => setHoverIndex(current => (current === absoluteIndex ? -1 : current)), backgroundColor: hoverIndex === absoluteIndex && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: focused, children: pointer }) }), _jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'accent' : undefined, bold: selected, children: selected ? (multiSelect ? CHECKED : '●') : UNCHECKED }) }), _jsxs(Box, { flexDirection: "column", marginLeft: 1, children: [_jsx(Text, { bold: focused || selected, color: focused ? 'accent' : undefined, wrap: windowedOptions ? 'truncate' : 'wrap', children: label }), description !== undefined && (_jsx(Text, { dimColor: true, wrap: windowedOptions ? 'truncate' : 'wrap', children: description }))] })] }, `${absoluteIndex}:${option.label}`));
664
+ }), hideCustomInput ? null : renderInputRow(), submitRows > 0 && (_jsxs(Box, { flexDirection: "row", height: 1, marginTop: 1, onClick: submitOptions, onMouseEnter: () => setSubmitHovered(true), onMouseLeave: () => setSubmitHovered(false), backgroundColor: submitHovered ? 'userMessageBackgroundHover' : undefined, children: [_jsx(Text, { color: "accent", children: "\u2713 " }), _jsx(Text, { dimColor: true, children: t('question-submit-selection') })] }))] }));
605
665
  const hintParts = inputFocused
606
666
  ? [
607
667
  t('question-hint-type'),
@@ -639,5 +699,10 @@ export function AskUserQuestionPanel({ question, position, total, answered, init
639
699
  setEditingModel(null);
640
700
  }, onAbort: onCancel, readClipboardOverride: readClipboardOverride });
641
701
  }
642
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, paddingRight: 2, width: "100%", children: [_jsx(Box, { flexDirection: "column", onClick: onToggleFold, onMouseEnter: () => setHeaderHovered(true), onMouseLeave: () => setHeaderHovered(false), backgroundColor: headerHovered ? 'userMessageBackgroundHover' : undefined, children: _jsx(Divider, { color: "permission", title: `▾${headerTitle}` }) }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [question.header !== undefined && (_jsxs(Text, { color: "suggestion", bold: true, children: ["\u25C8 ", question.header] })), _jsx(Text, { bold: true, wrap: "wrap", children: question.question }), (question.detail !== undefined || linkText !== '') && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [question.detail?.split('\n').map((line, index) => (_jsx(Text, { dimColor: true, italic: true, wrap: "wrap", children: line }, index))), linkText !== '' && _jsx(Text, { wrap: "wrap", children: linkText })] }))] }), renderOptions(), error !== null && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: error }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: hintParts.join(' · ') }) })] }));
702
+ const body = (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, wrap: "wrap", children: question.question }), (question.detail !== undefined || linkText !== '') && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [question.detail !== undefined && _jsx(Text, { dimColor: true, italic: true, wrap: "wrap", children: question.detail }), linkText !== '' && _jsx(Text, { wrap: "wrap", children: linkText })] }))] }));
703
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, paddingRight: 2, width: "100%", children: [_jsx(Box, { flexDirection: "column", onClick: onToggleFold, onMouseEnter: () => setHeaderHovered(true), onMouseLeave: () => setHeaderHovered(false), backgroundColor: headerHovered ? 'userMessageBackgroundHover' : undefined, children: _jsx(Divider, { color: "permission", title: `▾${headerTitle}` }) }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [question.header !== undefined && (_jsxs(Text, { color: "suggestion", bold: true, children: ["\u25C8 ", question.header] })), bodyScrollRows > 0 ? (_jsxs(_Fragment, { children: [_jsx(ScrollBox, { ref: bodyScrollRef, flexDirection: "column", height: bodyScrollRows, flexShrink: 0, children: body }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('question-detail-scroll', {
704
+ count: bodyRows - bodyScrollRows,
705
+ up: effectiveComboDisplay('questionDetailUp'),
706
+ down: effectiveComboDisplay('questionDetailDown'),
707
+ }) })] })) : body] }), renderOptions(), error !== null && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: error }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: hintParts.join(' · ') }) })] }));
643
708
  }
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { ClickEvent } from '../../ink/events/click-event.js';
3
3
  import type { ForeignSessionRow as ForeignSessionSummary } from '../../adapter/ports/channel-session.js';
4
4
  /**
5
- * One conversation of another agent in a source tab: its title, and a facts
6
- * line with when it last moved and where it ran.
5
+ * One conversation of another agent in a source tab: its title and age.
6
+ * The directory is shown once for the selected group above both panes.
7
7
  *
8
8
  * It looks like a DSH session row on purpose — the same two lines, the same
9
9
  * `❯`, green selection and blue hover (see SessionListRow) — so the tabs read
@@ -14,20 +14,14 @@ import type { ForeignSessionRow as ForeignSessionSummary } from '../../adapter/p
14
14
  * opens the copy an earlier selection made), so "imported or not" is a detail
15
15
  * of the selection, not a fact the user has to read before choosing; showing it
16
16
  * would also invite a sync the feature does not do.
17
- *
18
- * The working directory rides on the facts line here, unlike the DSH row: the
19
- * rail groups by directory, but a search spans every group of the source and
20
- * "which project was this" is the question a foreign title answers worst.
21
17
  */
22
- export declare function ForeignSessionRow({ session, width, focused, declareCursor, home, now, onClick, }: {
18
+ export declare function ForeignSessionRow({ session, width, focused, declareCursor, now, onClick, }: {
23
19
  session: ForeignSessionSummary;
24
20
  /** Columns available to the row. */
25
21
  width: number;
26
22
  focused: boolean;
27
23
  /** Park the native caret on this row while the list owns it. */
28
24
  declareCursor?: boolean;
29
- /** Home directory, for collapsing the path to `~`. */
30
- home: string;
31
25
  /** Epoch ms used for every relative time in this render pass. */
32
26
  now: number;
33
27
  /** Mouse click: import and open (same path as Enter). */
@@ -1 +1 @@
1
- {"version":3,"file":"ForeignSessionRow.d.ts","sourceRoot":"","sources":["../../../../src/components/sessions/ForeignSessionRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAGjE,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAGxG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAK,EACL,OAAO,EACP,aAAqB,EACrB,IAAI,EACJ,GAAG,EACH,OAAO,GACR,EAAE;IACD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAA;IACX,yDAAyD;IACzD,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;CAClC,GAAG,KAAK,CAAC,SAAS,CAqClB"}
1
+ {"version":3,"file":"ForeignSessionRow.d.ts","sourceRoot":"","sources":["../../../../src/components/sessions/ForeignSessionRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAGjE,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAGxG;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAK,EACL,OAAO,EACP,aAAqB,EACrB,GAAG,EACH,OAAO,GACR,EAAE;IACD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAA;IACX,yDAAyD;IACzD,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;CAClC,GAAG,KAAK,CAAC,SAAS,CAqClB"}
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { Box, Text } from '../../ui.js';
4
4
  import { useTooltip } from '../Tooltip.js';
5
- import { formatAbsolute, formatProject, formatWhen, truncateWidth } from '../../sessions/format.js';
5
+ import { formatAbsolute, formatWhen, truncateWidth } from '../../sessions/format.js';
6
6
  import { useDeclaredCursor, useNativeCursor } from '../../ink/hooks/use-declared-cursor.js';
7
7
  /**
8
- * One conversation of another agent in a source tab: its title, and a facts
9
- * line with when it last moved and where it ran.
8
+ * One conversation of another agent in a source tab: its title and age.
9
+ * The directory is shown once for the selected group above both panes.
10
10
  *
11
11
  * It looks like a DSH session row on purpose — the same two lines, the same
12
12
  * `❯`, green selection and blue hover (see SessionListRow) — so the tabs read
@@ -17,12 +17,8 @@ import { useDeclaredCursor, useNativeCursor } from '../../ink/hooks/use-declared
17
17
  * opens the copy an earlier selection made), so "imported or not" is a detail
18
18
  * of the selection, not a fact the user has to read before choosing; showing it
19
19
  * would also invite a sync the feature does not do.
20
- *
21
- * The working directory rides on the facts line here, unlike the DSH row: the
22
- * rail groups by directory, but a search spans every group of the source and
23
- * "which project was this" is the question a foreign title answers worst.
24
20
  */
25
- export function ForeignSessionRow({ session, width, focused, declareCursor = false, home, now, onClick, }) {
21
+ export function ForeignSessionRow({ session, width, focused, declareCursor = false, now, onClick, }) {
26
22
  const [hovered, setHovered] = useState(false);
27
23
  const nativeCursor = useNativeCursor();
28
24
  const cursorRef = useDeclaredCursor({ line: 0, column: 0, active: focused && declareCursor, visible: nativeCursor, hideOnIdle: true });
@@ -38,9 +34,9 @@ export function ForeignSessionRow({ session, width, focused, declareCursor = fal
38
34
  parts.push(session.cwd);
39
35
  return parts.join('\n');
40
36
  });
41
- const facts = [formatWhen(session.updatedAt, now), formatProject(session.cwd, home)];
37
+ const when = formatWhen(session.updatedAt, now);
42
38
  return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, onClick: onClick, onMouseEnter: onClick === undefined ? undefined : () => setHovered(true), onMouseLeave: onClick === undefined ? undefined : () => setHovered(false),
43
39
  // Hover is the blue prompt and never marks the focused row; selection is
44
40
  // the green foreground below, as on the DSH row.
45
- backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Box, { ref: cursorRef, children: [_jsx(Text, { color: focused ? 'success' : 'subtle', children: focused ? '❯ ' : ' ' }), _jsx(Box, { ...titleTooltip, children: _jsx(Text, { color: focused ? 'success' : undefined, bold: focused, children: shownTitle }) })] }), _jsx(Text, { color: focused ? 'success' : undefined, dimColor: !focused, children: ` ${truncateWidth(facts.join(' · '), body)}` })] }));
41
+ backgroundColor: hovered && !focused ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Box, { ref: cursorRef, children: [_jsx(Text, { color: focused ? 'success' : 'subtle', children: focused ? '❯ ' : ' ' }), _jsx(Box, { ...titleTooltip, children: _jsx(Text, { color: focused ? 'success' : undefined, bold: focused, children: shownTitle }) })] }), _jsx(Text, { color: focused ? 'success' : undefined, dimColor: !focused, children: ` ${truncateWidth(when, body)}` })] }));
46
42
  }
@@ -7,16 +7,16 @@ import type { AgentViewStatus } from '../../adapter/ports/channel-view.js';
7
7
  * One session in the browser's list: a title line and a metadata line.
8
8
  *
9
9
  * Two lines rather than one because the two carry different jobs. The title
10
- * answers "is this the conversation I mean"; the metadata answers "which of
11
- * the three that look alike is it" — when it was, on what branch, how big,
12
- * under which model. Folding both onto one line makes the title compete with
10
+ * answers "is this the conversation I mean"; the metadata gives its age and
11
+ * branch. Size and model are available in the title tooltip rather than taking
12
+ * space in every row. Folding both lines into one makes the title compete with
13
13
  * facts nobody reads first, and on a narrow terminal the title is what loses.
14
14
  *
15
15
  * Widths are resolved here rather than delegated to flexbox: the row must
16
16
  * stay exactly two lines at every terminal width, and a row that wraps
17
17
  * destroys the alignment that lets the eye scan a list at all.
18
18
  */
19
- export declare function SessionListRow({ session, width, depth, focused, declareCursor, pinned, now, onClick, onContextMenu, onTogglePin, liveStatus, current, occupiedPid, spinner, }: {
19
+ export declare function SessionListRow({ session, width, depth, focused, declareCursor, pinned, now, onClick, onContextMenu, onTogglePin, liveStatus, current, occupiedPid, }: {
20
20
  session: SessionSummary;
21
21
  /** Columns available to the row, indentation included. */
22
22
  width: number;
@@ -51,10 +51,5 @@ export declare function SessionListRow({ session, width, depth, focused, declare
51
51
  * not break. Undefined means free, or already ours.
52
52
  */
53
53
  occupiedPid?: number;
54
- /** Shared animation clock for the working glyph. */
55
- spinner?: {
56
- frame: number;
57
- time: number;
58
- };
59
54
  }): React.ReactNode;
60
55
  //# sourceMappingURL=SessionListRow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionListRow.d.ts","sourceRoot":"","sources":["../../../../src/components/sessions/SessionListRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAa9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AA0B1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,aAAqB,EACrB,MAAM,EACN,GAAG,EACH,OAAO,EACP,aAAa,EACb,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,OAAO,GACR,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAA;IACf,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAA;IACX,4CAA4C;IAC5C,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC,gDAAgD;IAChD,aAAa,CAAC,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC7C,8CAA8C;IAC9C,WAAW,CAAC,IAAI,IAAI,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oDAAoD;IACpD,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1C,GAAG,KAAK,CAAC,SAAS,CA+HlB"}
1
+ {"version":3,"file":"SessionListRow.d.ts","sourceRoot":"","sources":["../../../../src/components/sessions/SessionListRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAe9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAqC1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,aAAqB,EACrB,MAAM,EACN,GAAG,EACH,OAAO,EACP,aAAa,EACb,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAA;IACf,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAA;IACX,4CAA4C;IAC5C,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC,gDAAgD;IAChD,aAAa,CAAC,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC7C,8CAA8C;IAC9C,WAAW,CAAC,IAAI,IAAI,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,KAAK,CAAC,SAAS,CA0HlB"}
@@ -4,6 +4,8 @@ import { Box, Text } from '../../ui.js';
4
4
  import { t } from '../../i18n.js';
5
5
  import { useTooltip } from '../Tooltip.js';
6
6
  import { SpinnerGlyph } from '../Spinner/SpinnerGlyph.js';
7
+ import { useAnimationFrame } from '../../ink/hooks/use-animation-frame.js';
8
+ import { useTerminalFocus } from '../../ink/hooks/use-terminal-focus.js';
7
9
  import { stringWidth } from '../../ink/stringWidth.js';
8
10
  import { useDeclaredCursor, useNativeCursor } from '../../ink/hooks/use-declared-cursor.js';
9
11
  import { formatAbsolute, formatBytes, formatWhen, kindMark, titleColor, truncateWidth, } from '../../sessions/format.js';
@@ -29,20 +31,26 @@ const LIVE_STATUS_COLOR = {
29
31
  idle: undefined,
30
32
  stopped: undefined,
31
33
  };
34
+ /** Only a visible working glyph subscribes; the session list does not tick. */
35
+ function WorkingGlyph() {
36
+ const focused = useTerminalFocus();
37
+ const [ref, time] = useAnimationFrame(focused ? 120 : null);
38
+ return (_jsx(Box, { ref: ref, children: _jsx(SpinnerGlyph, { frame: Math.floor(time / 120), time: time, messageColor: "suggestion", reducedMotion: false }) }));
39
+ }
32
40
  /**
33
41
  * One session in the browser's list: a title line and a metadata line.
34
42
  *
35
43
  * Two lines rather than one because the two carry different jobs. The title
36
- * answers "is this the conversation I mean"; the metadata answers "which of
37
- * the three that look alike is it" — when it was, on what branch, how big,
38
- * under which model. Folding both onto one line makes the title compete with
44
+ * answers "is this the conversation I mean"; the metadata gives its age and
45
+ * branch. Size and model are available in the title tooltip rather than taking
46
+ * space in every row. Folding both lines into one makes the title compete with
39
47
  * facts nobody reads first, and on a narrow terminal the title is what loses.
40
48
  *
41
49
  * Widths are resolved here rather than delegated to flexbox: the row must
42
50
  * stay exactly two lines at every terminal width, and a row that wraps
43
51
  * destroys the alignment that lets the eye scan a list at all.
44
52
  */
45
- export function SessionListRow({ session, width, depth, focused, declareCursor = false, pinned, now, onClick, onContextMenu, onTogglePin, liveStatus, current, occupiedPid, spinner, }) {
53
+ export function SessionListRow({ session, width, depth, focused, declareCursor = false, pinned, now, onClick, onContextMenu, onTogglePin, liveStatus, current, occupiedPid, }) {
46
54
  const indent = depth * 2;
47
55
  const nativeCursor = useNativeCursor();
48
56
  const cursorRef = useDeclaredCursor({ line: 0, column: indent, active: focused && declareCursor, visible: nativeCursor, hideOnIdle: true });
@@ -84,16 +92,16 @@ export function SessionListRow({ session, width, depth, focused, declareCursor =
84
92
  parts.push(formatAbsolute(session.updatedAt));
85
93
  if (session.cwd !== '')
86
94
  parts.push(session.cwd);
95
+ const size = formatBytes(session.bytes);
96
+ if (size !== undefined)
97
+ parts.push(size);
98
+ if (session.model !== undefined)
99
+ parts.push(session.model);
87
100
  return parts.join('\n');
88
101
  });
89
102
  const facts = [formatWhen(session.updatedAt, now)];
90
103
  if (session.branch !== undefined)
91
104
  facts.push(session.branch);
92
- const size = formatBytes(session.bytes);
93
- if (size !== undefined)
94
- facts.push(size);
95
- if (session.model !== undefined)
96
- facts.push(session.model);
97
105
  if (session.childCount > 0 && depth === 0) {
98
106
  facts.push(t('session-children', { n: session.childCount }));
99
107
  }
@@ -107,5 +115,5 @@ export function SessionListRow({ session, width, depth, focused, declareCursor =
107
115
  // toggles the pin and must never fall through to resume.
108
116
  event.stopImmediatePropagation();
109
117
  onTogglePin();
110
- }, children: _jsx(Text, { color: pinned ? 'remember' : undefined, dimColor: !pinned, children: pinned ? '★ ' : '☆ ' }) }), _jsx(Box, { children: liveStatus === 'working' && !occupied && spinner !== undefined ? (_jsx(SpinnerGlyph, { frame: spinner.frame, messageColor: "suggestion", reducedMotion: false, time: spinner.time })) : (_jsx(Text, { color: stateColor, dimColor: liveStatus === undefined && !occupied, children: `${stateGlyph} ` })) }), mark !== undefined && _jsx(Text, { color: mark.color, children: `${mark.glyph} ` }), _jsx(Box, { ...titleTooltip, children: _jsx(Text, { color: occupied ? 'error' : titleColor(session.title.source, focused), bold: focused, children: shownTitle }) }), occupiedText !== '' && _jsx(Text, { color: "error", children: occupiedText }), currentText !== '' && _jsx(Text, { color: "success", children: currentText })] }), _jsx(Box, { children: _jsx(Text, { color: focused ? 'success' : undefined, dimColor: !focused, children: `${' '.repeat(indent + 2)}${truncateWidth(facts.join(' · '), body)}` }) })] }));
118
+ }, children: _jsx(Text, { color: pinned ? 'remember' : undefined, dimColor: !pinned, children: pinned ? '★ ' : '☆ ' }) }), _jsx(Box, { children: liveStatus === 'working' && !occupied ? (_jsx(WorkingGlyph, {})) : (_jsx(Text, { color: stateColor, dimColor: liveStatus === undefined && !occupied, children: `${stateGlyph} ` })) }), mark !== undefined && _jsx(Text, { color: mark.color, children: `${mark.glyph} ` }), _jsx(Box, { ...titleTooltip, children: _jsx(Text, { color: occupied ? 'error' : titleColor(session.title.source, focused), bold: focused, children: shownTitle }) }), occupiedText !== '' && _jsx(Text, { color: "error", children: occupiedText }), currentText !== '' && _jsx(Text, { color: "success", children: currentText })] }), _jsx(Box, { children: _jsx(Text, { color: focused ? 'success' : undefined, dimColor: !focused, children: `${' '.repeat(indent + 2)}${truncateWidth(facts.join(' · '), body)}` }) })] }));
111
119
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InfoPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/InfoPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAwB5C,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,CA2J1F"}
1
+ {"version":3,"file":"InfoPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/InfoPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAwB5C,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,CA4J1F"}
@@ -22,7 +22,7 @@ import { modeDisplayName } from '../../sessionModes.js';
22
22
  import { estimateSessionCostSnapshotCny, isDeepSeekOfficialProvider, isPeakHour } from '../../deepseekPricing.js';
23
23
  import { formatCacheHitRate, formatCostReport } from '../../screens/StatusLine.js';
24
24
  import { contextPressureStep, speedColor } from '../../screens/StatusMetrics.js';
25
- import { formatProject } from '../../sessions/format.js';
25
+ import { displayWorkingDirectory, formatProject } from '../../sessions/format.js';
26
26
  import { homeDir } from '../../utils/paths.js';
27
27
  import { Divider } from '../design-system/Divider.js';
28
28
  import { useSidePanelChannel } from './SidePanelRuntimeContext.js';
@@ -68,9 +68,10 @@ export function InfoPanel({ width, height, focused, visible }) {
68
68
  usePanelInput(panelKeyHandler, { active: focused && visible });
69
69
  const usage = channel.lastUsage;
70
70
  const used = contextUsedOf(channel);
71
+ const currentCwd = displayWorkingDirectory(channel);
71
72
  const displayCwd = channel.displayCwd === channel.cwd
72
- ? formatProject(channel.displayCwd, homeDir())
73
- : channel.displayCwd;
73
+ ? formatProject(currentCwd, homeDir())
74
+ : currentCwd;
74
75
  // --- 值构造(全部复用状态栏口径) -------------------------------------
75
76
  const none = t('info-value-none');
76
77
  const modeName = modeDisplayName(channel.mode);
@@ -1 +1 @@
1
- {"version":3,"file":"SidePanelLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/SidePanelLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACnC;AAqED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,GACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,SAAS,CA2ExC"}
1
+ {"version":3,"file":"SidePanelLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/SidePanelLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACnC;AAqED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,GACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,SAAS,CA8ExC"}
@@ -85,6 +85,7 @@ function DividerColumn({ focused, rows, junctionRows, chatColumns, onResize, })
85
85
  }, children: _jsx(Text, { color: focused || hovered || dragging ? 'accent' : 'inactive', children: glyphs.join('\n') }) }));
86
86
  }
87
87
  export function SidePanelLayout({ geometry, focus, side, onActivateChat, onActivatePanel, onResize, children, }) {
88
+ const paneId = React.useId();
88
89
  const outerEdges = useSurfaceEdges();
89
90
  const parentSize = useTerminalSize();
90
91
  const rows = parentSize.rows;
@@ -99,9 +100,8 @@ export function SidePanelLayout({ geometry, focus, side, onActivateChat, onActiv
99
100
  // eslint-disable-next-line react-hooks/exhaustive-deps -- geometry identity changes with the split
100
101
  [parentSize, geometry, rows, screenRows]);
101
102
  const panelSize = React.useMemo(() => ({ columns: panelColumns, rows, screenRows }), [panelColumns, rows, screenRows]);
102
- return (_jsxs(Box, { flexDirection: "row", flexGrow: 1, flexShrink: 1, overflow: split ? 'hidden' : undefined, children: [_jsx(SurfaceEdgesContext.Provider, { value: split ? chatEdges : outerEdges, children: _jsx(TerminalSizeContext.Provider, { value: chatSize, children: _jsx(Box, { flexDirection: "column", flexGrow: split ? 0 : 1, width: geometry === null ? undefined : geometry.chat, flexShrink: 0, overflow: split ? 'hidden' : undefined, onClick: split ? onActivateChat : undefined, children: children }) }) }), split && (_jsxs(_Fragment, { children: [_jsx(DividerColumn, { focused: focus === 'panel', rows: rows, junctionRows: [1, Math.max(1, rows - 2)], chatColumns: geometry.chat, onResize: onResize }), _jsx(SurfaceEdgesContext.Provider, { value: panelEdges, children: _jsx(TerminalSizeContext.Provider, { value: panelSize, children: _jsx(Box, { flexDirection: "column", width: panelColumns, flexShrink: 0, overflow: "hidden", onClick: onActivatePanel,
103
- /* The right column is fenced out of the fullscreen linear text
104
- selection: a drag across chat rows must not capture panel
105
- glyphs (design doc §4.6). Panels carry their own copy action. */
106
- noSelect: true, children: side }) }) })] }))] }));
103
+ return (_jsxs(Box, { flexDirection: "row", flexGrow: 1, flexShrink: 1, overflow: split ? 'hidden' : undefined, children: [_jsx(SurfaceEdgesContext.Provider, { value: split ? chatEdges : outerEdges, children: _jsx(TerminalSizeContext.Provider, { value: chatSize, children: _jsx(Box, { flexDirection: "column", flexGrow: split ? 0 : 1, width: geometry === null ? undefined : geometry.chat, flexShrink: 0, overflow: split ? 'hidden' : undefined, selectionPane: split ? paneId + '-chat' : undefined, selectionPaneViewport: true, onClick: split ? onActivateChat : undefined, children: children }) }) }), split && (_jsxs(_Fragment, { children: [_jsx(DividerColumn, { focused: focus === 'panel', rows: rows, junctionRows: [1, Math.max(1, rows - 2)], chatColumns: geometry.chat, onResize: onResize }), _jsx(SurfaceEdgesContext.Provider, { value: panelEdges, children: _jsx(TerminalSizeContext.Provider, { value: panelSize, children: _jsx(Box, { flexDirection: "column", width: panelColumns, flexShrink: 0, overflow: "hidden", onClick: onActivatePanel,
104
+ /* Ownership fences both directions; nested noSelect gutters
105
+ and copyRegion sources retain their existing semantics. */
106
+ selectionPane: paneId + '-panel', selectionPaneViewport: true, children: side }) }) })] }))] }));
107
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspacePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/WorkspacePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAgD5C,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,CAgK/F"}
1
+ {"version":3,"file":"WorkspacePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/WorkspacePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAgD5C,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,CA2K/F"}
@@ -5,6 +5,7 @@ import { t } from '../../i18n.js';
5
5
  import { truncateWidth, spreadRow } from '../../sessions/format.js';
6
6
  import { stringWidth } from '../../ink/stringWidth.js';
7
7
  import { normalizeWorkspaceCwd } from '../../sessions/view.js';
8
+ import { visibleWorkspaceSessions, workspaceSessionCounts } from '../../sessions/workspaceCounts.js';
8
9
  import { useSidePanelChannel, useSidePanelFullscreen } from './SidePanelRuntimeContext.js';
9
10
  import { usePanelInput } from './usePanelInput.js';
10
11
  /**
@@ -71,25 +72,36 @@ export function WorkspacePanel({ width, height, focused, visible }) {
71
72
  setFetchTick(tick => tick + 1);
72
73
  }, [visible]);
73
74
  React.useEffect(() => {
74
- if (fetchTick === 0)
75
+ if (fetchTick === 0 || visible === false)
75
76
  return;
76
77
  const nonce = nonceRef.current + 1;
77
78
  nonceRef.current = nonce;
78
79
  let live = true;
80
+ const bindingGeneration = channel.agentBindingGeneration;
81
+ const agentId = channel.agentId;
82
+ const sessionId = channel.sessionId;
83
+ const cwd = channel.cwd;
84
+ const backendId = channel.backendCapabilities?.backendId;
85
+ const current = () => live && nonce === nonceRef.current
86
+ && channel.agentBindingGeneration === bindingGeneration
87
+ && channel.agentId === agentId && channel.sessionId === sessionId
88
+ && channel.cwd === cwd && channel.backendCapabilities?.backendId === backendId;
79
89
  setLoadError(null);
80
- channel.listWorkspaceRegistry()
81
- .then(list => {
82
- if (!live || nonce !== nonceRef.current)
90
+ setEntries(null);
91
+ Promise.all([channel.listWorkspaceRegistry(), channel.listSessions()])
92
+ .then(([list, sessions]) => {
93
+ if (!current())
83
94
  return;
84
- setEntries(list);
95
+ const counts = workspaceSessionCounts(visibleWorkspaceSessions(sessions, agentId));
96
+ setEntries(list.map(entry => ({ ...entry, sessionCount: counts.get(normalizeWorkspaceCwd(entry.path)) ?? 0 })));
85
97
  })
86
98
  .catch((error) => {
87
- if (!live || nonceRef.current !== nonce)
99
+ if (!current())
88
100
  return;
89
101
  setLoadError(error instanceof Error ? error.message : String(error));
90
102
  });
91
103
  return () => { live = false; };
92
- }, [channel, fetchTick]);
104
+ }, [channel, fetchTick, visible, channel.agentBindingGeneration, channel.agentId, channel.sessionId, channel.cwd, channel.backendCapabilities?.backendId, channel.ready]);
93
105
  // ── 选中 / hover / 自管窗口滚动 ──────────────────────────────────────────
94
106
  // 不用 ScrollBox:它的内容平移/裁剪会让滚动后的指针事件错位
95
107
  // (TrajectoryPanel 的 ledger 同样自己管窗口)。行恒定 2 行,