@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
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type ActivityLineValue } from '../components/ActivityLine.js';
3
+ import type { TuiStatusFieldEntry } from '../dsh-adapter/status.js';
3
4
  import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
4
5
  /** 同上:partial channel 字面量可能早于 mainCost/subagentCost 字段(R4 兼容)。 */
5
6
  /** A reported session cost: `$0.0123` for USD (sub-dollar keeps 4 places,
@@ -9,10 +10,16 @@ export declare function formatCostReport(report: {
9
10
  readonly amount: number;
10
11
  }): string;
11
12
  import type { WaveBand } from '../dsh-adapter/types.js';
12
- export declare function StatusLine({ channel, selectionActive, helpOpen, backendMode, modelPicker, effortPicker, wake, activity: projectedActivity, }: {
13
+ export declare function StatusLine({ channel, selectionActive, helpOpen, backendMode, modelPicker, effortPicker, wake, activity: projectedActivity, pluginFields, }: {
13
14
  channel: Channel;
14
15
  selectionActive?: boolean;
15
16
  helpOpen?: boolean;
17
+ /** Plugin footer fields (`tuiStatus.setField`), already normalized by the
18
+ * adapter. They join the existing left/right groups in three slots —
19
+ * `left-tail` (left group's end), `right-head` (right group's start), and
20
+ * `right-tail` (the row's right edge). Absent/empty renders exactly the
21
+ * footer this seam found: no extra Box, no gap, no flex change. */
22
+ pluginFields?: readonly TuiStatusFieldEntry[];
16
23
  /** The backend's OWN permission mode (the typed `modes` capability):
17
24
  * `id` is the backend mode id (default / acceptEdits / plan /
18
25
  * bypassPermissions / dontAsk / auto …), `name` the label the backend
@@ -48,7 +55,7 @@ export declare function StatusLine({ channel, selectionActive, helpOpen, backend
48
55
  activity?: ActivityLineValue;
49
56
  /**
50
57
  * The session projected onto the status line's few columns, plus the
51
- * animation tick and the self-retiring key hint.
58
+ * self-retiring key hint. The mounted MiniWake owns its animation clock.
52
59
  *
53
60
  * A strip that shows the session's shape keeps earning its space in a way a
54
61
  * static label cannot, and it carries the failure signal in position rather
@@ -58,7 +65,6 @@ export declare function StatusLine({ channel, selectionActive, helpOpen, backend
58
65
  wake?: {
59
66
  band: WaveBand;
60
67
  hint?: string;
61
- tick: number;
62
68
  /** Click target for the strip: opens the trajectory scene. */
63
69
  onOpen?: () => void;
64
70
  /** Chord revealed while the pointer rests on the strip. */
@@ -1 +1 @@
1
- {"version":3,"file":"StatusLine.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,EAAoC,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AASxG,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,kEAAkE;AAClE;wEACwE;AACxE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAKvG;AAyBD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA4HvD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,eAAuB,EACvB,QAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,QAAQ,EAAE,iBAAiB,GAC5B,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;;;+EAU2E;IAC3E,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAC5B,CAAA;IACD;;;;0EAIsE;IACtE,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC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nB,2DAA2D;QAC3D,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,qBAwhBA;AAED,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAsTD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EACL;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACzD,SAAS,GACZ,MAAM,GAAG,SAAS,CAIpB"}
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { Box, Text, useTerminalSize, useTheme } from '../ui.js';
4
4
  import { formatTokens } from '../terminal-utils/format.js';
5
5
  import { t } from '../i18n.js';
6
- import { formatContextUsage, DEFAULT_STATUS_BAR, normalizeStatusBar } from '../tuiDisplayPrefs.js';
6
+ import { applyPluginFieldsOrder, formatContextUsage, DEFAULT_STATUS_BAR, normalizeStatusBar } from '../tuiDisplayPrefs.js';
7
7
  import { estimateSessionCostSnapshotCny, isDeepSeekOfficialProvider, isPeakHour } from '../deepseekPricing.js';
8
8
  import { getActiveBrand } from '../branding.js';
9
9
  import { ActivityLine, contextPressurePct } from '../components/ActivityLine.js';
@@ -30,7 +30,7 @@ import { MiniWake } from '../components/trajectory/MiniWake.js';
30
30
  import { getTheme, isLightThemeActive } from '../theme.js';
31
31
  import { ContextBarView } from '../components/ContextBarView.js';
32
32
  import { TooltipTarget } from '../components/Tooltip.js';
33
- import { formatProject } from '../sessions/format.js';
33
+ import { compactWorkingDirectory, displayWorkingDirectory, formatProject } from '../sessions/format.js';
34
34
  import { homeDir } from '../utils/paths.js';
35
35
  import { USED_SEGMENTS, channelContextOccupancy, attributeBarTokens, barSegments, contextBarBreakdown, contextBarSegmentColors, renderMiniContextBar, renderTpsGauge, renderTpsSparkline, speedColor, tpsStats, } from './StatusMetrics.js';
36
36
  /**
@@ -72,7 +72,22 @@ const MINIMAL_UI_STATUS_BAR = Object.freeze({
72
72
  activity: false,
73
73
  trajectory: false,
74
74
  shortcutHint: false,
75
+ // Explicit even though it starts from the default: plugin text must never
76
+ // follow a future default flip into the minimal UI.
77
+ pluginFields: false,
75
78
  });
79
+ /** Stable empty default so a footer with no plugin fields allocates nothing
80
+ * and splices into the groups exactly as before this seam existed. */
81
+ const NO_PLUGIN_FIELDS = Object.freeze([]);
82
+ /** Semantic tone → theme colour. Footer fields never take literal colours;
83
+ * `dim` is the muted default and rides `dimColor` instead of a palette key. */
84
+ const FIELD_TONE_COLOR = {
85
+ dim: undefined,
86
+ accent: 'professionalBlue',
87
+ success: 'success',
88
+ warning: 'warning',
89
+ error: 'error',
90
+ };
76
91
  /**
77
92
  * Render field parts as sibling shrinkable Boxes joined by the Byline
78
93
  * separator (` · `). The Box-per-field layout is what makes individual
@@ -82,9 +97,24 @@ const MINIMAL_UI_STATUS_BAR = Object.freeze({
82
97
  */
83
98
  function FieldLine({ parts, hoverProps, }) {
84
99
  const visible = parts.filter(part => part.node !== null && part.node !== undefined && part.node !== false);
85
- return (_jsx(_Fragment, { children: visible.map((part, index) => (_jsxs(React.Fragment, { children: [index > 0 ? _jsx(Text, { dimColor: true, children: " \u00B7 " }) : null, _jsx(Box, { flexShrink: 1, ...(part.id === undefined ? {} : hoverProps(part.id)), ...(part.onClick === undefined ? {} : { onClick: part.onClick }), children: part.tooltip === undefined || part.tooltip === '' ? (_jsx(Text, { wrap: "truncate", children: part.node })) : (_jsx(TooltipTarget, { content: part.tooltip, children: _jsx(Text, { wrap: "truncate", children: part.node }) })) })] }, part.key))) }));
100
+ return (_jsx(_Fragment, { children: visible.map((part, index) => (_jsxs(React.Fragment, { children: [index > 0 ? _jsx(Text, { dimColor: true, wrap: "truncate", children: " \u00B7 " }) : null, _jsx(Box, { flexShrink: part.flexShrink ?? 1, ...(part.id === undefined ? {} : hoverProps(part.id)), ...(part.onClick === undefined ? {} : { onClick: part.onClick }), children: part.tooltip === undefined || part.tooltip === '' ? (_jsx(Text, { wrap: "truncate", children: part.node })) : (_jsx(TooltipTarget, { content: part.tooltip, children: _jsx(Text, { wrap: "truncate", children: part.node }) })) })] }, part.key))) }));
86
101
  }
87
- export function StatusLine({ channel, selectionActive = false, helpOpen = false, backendMode, modelPicker, effortPicker, wake, activity: projectedActivity, }) {
102
+ /** Admit one host-normalized plugin field into a `FieldPart`. The id (and
103
+ * therefore the hover affordance) exists only when the plugin declared a
104
+ * detail: a field with nothing to say on hover must not catch the pointer. */
105
+ function toFieldPart(field) {
106
+ const id = `plugin:${field.key}`;
107
+ const color = FIELD_TONE_COLOR[field.tone];
108
+ return {
109
+ key: id,
110
+ ...(field.detail === undefined ? {} : { id }),
111
+ ...(field.onClick === undefined ? {} : { onClick: field.onClick }),
112
+ node: color === undefined
113
+ ? _jsx(Text, { dimColor: true, children: field.text })
114
+ : _jsx(Text, { color: color, children: field.text }),
115
+ };
116
+ }
117
+ export function StatusLine({ channel, selectionActive = false, helpOpen = false, backendMode, modelPicker, effortPicker, wake, activity: projectedActivity, pluginFields, }) {
88
118
  const { columns } = useTerminalSize();
89
119
  const [themeName] = useTheme();
90
120
  const [hover, setHover] = React.useState(null);
@@ -99,11 +129,23 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
99
129
  // footer can never grow decorations regardless of saved preferences.
100
130
  ? MINIMAL_UI_STATUS_BAR
101
131
  : normalizeStatusBar(channel.statusBar);
132
+ // Plugin fields pass three gates: the user switch (off also in the minimal
133
+ // UI), the user's ordered list (empty = none, `*` = all unchanged, groups =
134
+ // ordered and re-slotted), and their own `minColumns`. Everything below
135
+ // splices them into the SAME groups the built-ins use, so the empty case is
136
+ // a no-op.
137
+ const pluginFieldsVisible = statusBar.pluginFields && channel.minimalUi !== true;
138
+ const visibleFields = pluginFieldsVisible
139
+ ? applyPluginFieldsOrder(pluginFields ?? NO_PLUGIN_FIELDS, statusBar.pluginFieldsOrder)
140
+ .filter(field => columns >= field.minColumns)
141
+ : NO_PLUGIN_FIELDS;
142
+ const inSlot = (slot) => visibleFields.filter(field => field.slot === slot).map(toFieldPart);
102
143
  // Provider workspaces expose a remote display path alongside a host alias;
103
144
  // only the local target has identical cwd/displayCwd values to fold.
145
+ const currentCwd = displayWorkingDirectory(channel);
104
146
  const displayCwd = channel.displayCwd === channel.cwd
105
- ? formatProject(channel.displayCwd, homeDir())
106
- : channel.displayCwd;
147
+ ? formatProject(currentCwd, homeDir())
148
+ : currentCwd;
107
149
  const usage = channel.lastUsage;
108
150
  // ONE occupancy reading behind every ctx surface in this footer (the field,
109
151
  // its hover gauge, the segmented bar, the working line's pressure prefix):
@@ -259,10 +301,10 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
259
301
  node: _jsx(Text, { color: "warning", children: t('status-starting', { backend: channel.backendCapabilities?.backendLabel ?? 'DSH' }) }),
260
302
  }
261
303
  : undefined;
262
- const leftFields = [
304
+ const builtinLeft = [
263
305
  ...(startingPart !== undefined ? [startingPart] : []),
264
306
  ...(statusBar.model
265
- ? [{ key: 'model', id: 'model', ...(modelPicker === undefined ? {} : { onClick: modelPicker.onOpen }), node: _jsx(Text, { color: "inactiveShimmer", children: channel.modelDisplay ?? channel.model }) }]
307
+ ? [{ key: 'model', id: 'model', flexShrink: 0, ...(modelPicker === undefined ? {} : { onClick: modelPicker.onOpen }), node: _jsx(Text, { color: "inactiveShimmer", children: channel.modelDisplay ?? channel.model }) }]
266
308
  : []),
267
309
  ...(tpsPart !== undefined ? [tpsPart] : []),
268
310
  ...(jobsPart !== undefined ? [jobsPart] : []),
@@ -312,7 +354,7 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
312
354
  })()
313
355
  : []),
314
356
  ];
315
- const rightFields = [
357
+ const builtinRight = [
316
358
  // Live IDE-selection badge first: it tracks the user's in-editor gesture,
317
359
  // the freshest signal in the footer (T-FIX-02). Absent without an IDE —
318
360
  // no placeholder, matching the official Claude Code footer.
@@ -343,7 +385,8 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
343
385
  ? [{
344
386
  key: 'cwd',
345
387
  id: 'cwd',
346
- node: (_jsx(Text, { color: "inactiveShimmer", children: statusBar.compact ? basename(displayCwd) : displayCwd })),
388
+ flexShrink: 2,
389
+ node: (_jsx(Text, { color: "inactiveShimmer", children: statusBar.compact ? compactCwd(channel, displayCwd) : displayCwd })),
347
390
  }]
348
391
  : []),
349
392
  ...(statusBar.sessionTitle && channel.sessionTitle
@@ -367,10 +410,23 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
367
410
  }]
368
411
  : []),
369
412
  ];
413
+ // Plugin fields join the built-in groups by slot — no third group, no new
414
+ // Box. `left-tail` and `right-head` do not move any host cell; `right-tail`
415
+ // pushes the right group left, which is that slot's explicit cost.
416
+ const leftFields = [...builtinLeft, ...inSlot('left-tail')];
417
+ const rightFields = [
418
+ ...inSlot('right-head'),
419
+ ...builtinRight,
420
+ ...inSlot('right-tail'),
421
+ ];
370
422
  const hint = selectionActive
371
423
  ? t('statusline-hint-select')
372
424
  : channel.working
373
- ? t('statusline-hint-working')
425
+ // An interrupt already requested but not yet converged: "esc to
426
+ // interrupt" would promise an action the channel ignores by contract
427
+ // (and a wedged turn can hold this state forever). Say what the state
428
+ // is instead, so the key never looks dead.
429
+ ? t(channel.cancelPending ? 'statusline-hint-interrupting' : 'statusline-hint-working')
374
430
  : statusBar.shortcutHint && !helpOpen
375
431
  ? t('statusline-hint-shortcuts')
376
432
  : '';
@@ -401,7 +457,7 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
401
457
  contextWindow !== undefined;
402
458
  // The supplemental-row readout for the hovered field: replaces the idle
403
459
  // hint (never the activity line) while the pointer dwells on a field.
404
- const detail = buildHoverDetail(hover, channel, occupancy, usage, columns, barColors, backendMode, modelPicker, contextBarSegmentColors(getTheme(themeName)));
460
+ const detail = buildHoverDetail(hover, visibleFields, channel, occupancy, usage, columns, barColors, backendMode, modelPicker, contextBarSegmentColors(getTheme(themeName)));
405
461
  const trailer = detail !== null
406
462
  ? detail
407
463
  : hint !== ''
@@ -424,7 +480,7 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
424
480
  showActivity ||
425
481
  showTrajectory ||
426
482
  hint !== '';
427
- return (_jsx(Box, { paddingX: 1, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [barVisible ? (_jsx(ContextBarView, { segments: channel.contextSegments, breakdown: channel.contextBreakdown, usedTokens: contextUsed ?? 0, contextWindow: contextWindow ?? 0, width: barWidth, colors: barColors, onHover: hovered => setHover(current => hovered ? 'bar' : current === 'bar' ? null : current) })) : null, hasStatusFields ? statusBar.compact ? (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: compactFields, hoverProps: hoverProps }) }), ctxNode !== undefined ? (_jsx(Box, { flexShrink: 0, ...hoverProps('ctx'), children: _jsx(Text, { wrap: "truncate", children: ctxNode }) })) : null] })) : (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: fullLeftFields, hoverProps: hoverProps }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: rightFields, hoverProps: hoverProps }) })] })) : null, showSupplementalRow ? _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsxs(Box, { flexDirection: "row", flexGrow: 1, justifyContent: showActivity && trailer !== null ? 'space-between' : 'flex-start', gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(occupancy), warnDanger: (contextPressurePct(occupancy) ?? 0) >= 95 })) : trailer, showActivity ? trailer : null] }), showTrajectory && wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, tick: wake.tick, onOpen: wake.onOpen, hoverHint: wake.hoverHint })) : null] }) : null] }) }));
483
+ return (_jsx(Box, { paddingX: 1, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [barVisible ? (_jsx(ContextBarView, { segments: channel.contextSegments, breakdown: channel.contextBreakdown, usedTokens: contextUsed ?? 0, contextWindow: contextWindow ?? 0, width: barWidth, colors: barColors, onHover: hovered => setHover(current => hovered ? 'bar' : current === 'bar' ? null : current) })) : null, hasStatusFields ? statusBar.compact ? (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: compactFields, hoverProps: hoverProps }) }), ctxNode !== undefined ? (_jsx(Box, { flexShrink: 0, ...hoverProps('ctx'), children: _jsx(Text, { wrap: "truncate", children: ctxNode }) })) : null] })) : (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: fullLeftFields, hoverProps: hoverProps }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, flexDirection: "row", overflow: "hidden", children: _jsx(FieldLine, { parts: rightFields, hoverProps: hoverProps }) })] })) : null, showSupplementalRow ? _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsxs(Box, { flexDirection: "row", flexGrow: 1, justifyContent: showActivity && trailer !== null ? 'space-between' : 'flex-start', gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(occupancy), warnDanger: (contextPressurePct(occupancy) ?? 0) >= 95 })) : trailer, showActivity ? trailer : null] }), showTrajectory && wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, working: channel.working, onOpen: wake.onOpen, hoverHint: wake.hoverHint })) : null] }) : null] }) }));
428
484
  }
429
485
  /**
430
486
  * The supplemental-row readout for a hovered footer field. Technical label
@@ -443,9 +499,19 @@ function formatRateLimit(rateLimit) {
443
499
  : name === 'seven_day' ? t('status-rate-limit-seven-day') : name;
444
500
  return windows.map(window => `${label(window.name)} ${Math.round(window.utilization * 100)}%`).join(' · ');
445
501
  }
446
- function buildHoverDetail(hover, channel, occupancy, usage, columns, barColors, backendMode, modelPicker, usedColors) {
502
+ function buildHoverDetail(hover, fields, channel, occupancy, usage, columns, barColors, backendMode, modelPicker, usedColors) {
447
503
  if (hover === null)
448
504
  return null;
505
+ // Plugin fields first: their detail is verbatim host-sanitized text. A field
506
+ // that vanished mid-hover (disposed, reloaded, filtered out) is simply not
507
+ // found and falls through to null — the idle hint returns by the same
508
+ // guarded-leave rule the built-ins use.
509
+ if (hover.startsWith('plugin:')) {
510
+ const field = fields.find(candidate => `plugin:${candidate.key}` === hover);
511
+ return field?.detail === undefined
512
+ ? null
513
+ : _jsx(Text, { color: "inactiveShimmer", children: field.detail });
514
+ }
449
515
  const contextUsed = occupancy?.usedTokens;
450
516
  // The hover surfaces report the SAME occupancy the field/bar above show; the
451
517
  // 'model' chip below stays a pure route-capacity readout.
@@ -594,7 +660,7 @@ function buildHoverDetail(hover, channel, occupancy, usage, columns, barColors,
594
660
  case 'sessionId':
595
661
  return (_jsxs(Text, { wrap: "truncate", children: [dim('# '), channel.sessionRef?.sessionId ?? channel.agentId, " \u00B7 ", t('status-detail-session-id')] }));
596
662
  case 'cwd':
597
- return (_jsxs(Text, { wrap: "truncate", children: [dim('cwd '), channel.displayCwd] }));
663
+ return (_jsxs(Text, { wrap: "truncate", children: [dim('cwd '), displayWorkingDirectory(channel)] }));
598
664
  case 'title':
599
665
  return (_jsxs(Text, { wrap: "truncate", children: [dim('title '), channel.sessionTitle] }));
600
666
  default:
@@ -628,3 +694,13 @@ function basename(path) {
628
694
  const parts = path.split(/[\\/]/);
629
695
  return parts[parts.length - 1] ?? path;
630
696
  }
697
+ /** Compact footer cwd: the plain project name until the session moves, then a
698
+ * breadcrumb that keeps the project as the anchor (`project›relative`) and
699
+ * names the directory a move out of the project landed in. The anchor is
700
+ * dimmed so the relative half reads as position, not as part of the name. */
701
+ function compactCwd(channel, displayCwd) {
702
+ const breadcrumb = compactWorkingDirectory(channel, homeDir());
703
+ if (breadcrumb === undefined)
704
+ return basename(displayCwd);
705
+ return (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: breadcrumb.anchor }), `${breadcrumb.separator}${breadcrumb.target}`] }));
706
+ }
@@ -1,12 +1,3 @@
1
- /**
2
- * Status-line metric renderers, ported from two pi extensions:
3
- * - `pi-nano-context`: segmented context progress bar (morandi pastel
4
- * segments by content type, free space right-aligned with the usage
5
- * readout, largest-remainder column allocation).
6
- * - `pi-tps-meter`: live 1/8-cell gauge while streaming and a min-max
7
- * normalized sparkline after each completed turn; colors green ≥ 50 tps,
8
- * yellow ≥ 20, red below.
9
- */
10
1
  import type { Color } from '../ink/styles.js';
11
2
  import type { Theme } from '../theme.js';
12
3
  import type { ContextBreakdown, ContextOccupancy } from '../adapter/ports/channel-view.js';
@@ -232,7 +223,7 @@ export declare function renderContextBar(segments: ContextSegments, usedTokens:
232
223
  /** Pressure-colored text: green below 80%, amber ≥ 80, red ≥ 95.
233
224
  * @param pct - Context occupancy percent (0–100+).
234
225
  * @param text - Text to color.
235
- * @returns The ANSI 24-bit color-wrapped text.
226
+ * @returns The capability-aware color-wrapped text.
236
227
  */
237
228
  export declare function pressureColor(pct: number, text: string): string;
238
229
  /** Compact 1/8-cell context gauge for the footer's ctx field on hover:
@@ -247,7 +238,7 @@ export declare function renderMiniContextBar(usedTokens: number, contextWindow:
247
238
  /** Speed color: green ≥ 50, yellow ≥ 20, red below (pi-tps-meter).
248
239
  * @param tps - Tokens per second; selects the color threshold.
249
240
  * @param text - Text to color.
250
- * @returns The ANSI 24-bit color-wrapped text.
241
+ * @returns The capability-aware color-wrapped text.
251
242
  */
252
243
  export declare function speedColor(tps: number, text: string): string;
253
244
  /** Live 1/8-cell horizontal gauge: `▕███████▋···▏`.
@@ -1 +1 @@
1
- {"version":3,"file":"StatusMetrics.d.ts","sourceRoot":"","sources":["../../../src/screens/StatusMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAM1F;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC/C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;IACzF,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3C,GAAG,gBAAgB,GAAG,SAAS,CAK/B;AAED;;;;;;;;;;;uCAWuC;AACvC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAMhB,CAAA;AA0CV;;kCAEkC;AAClC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG,KAAK,CAQ9E;AAED;;;;;yCAK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,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAYxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC9C,MAAM,CAqBR;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,KAAK,SAAK,GACT,MAAM,CAaR;AAYD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAYD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAYhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAqB9E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IACxF,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAUA"}
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Status-line metric renderers, ported from two pi extensions:
3
+ * - `pi-nano-context`: segmented context progress bar (morandi pastel
4
+ * segments by content type, free space right-aligned with the usage
5
+ * readout, largest-remainder column allocation).
6
+ * - `pi-tps-meter`: live 1/8-cell gauge while streaming and a min-max
7
+ * normalized sparkline after each completed turn; colors green ≥ 50 tps,
8
+ * yellow ≥ 20, red below.
9
+ */
10
+ import { colorize } from '../ink/colorize.js';
1
11
  import { stringWidth } from '../ink/stringWidth.js';
2
12
  import { resolveContextOccupancy } from '../dsh-adapter/context-occupancy.js';
3
13
  import { getActiveBrand } from '../branding.js';
@@ -115,11 +125,7 @@ const ANSI_RE = /\x1b\[[0-9;]*m/g;
115
125
  const stripAnsi = (text) => text.replace(ANSI_RE, '');
116
126
  const plainWidth = (text) => Array.from(stripAnsi(text)).length;
117
127
  function ansiColor(mode, hex, text) {
118
- const value = Number.parseInt(hex.replace(/^#/, ''), 16);
119
- const red = (value >> 16) & 0xff;
120
- const green = (value >> 8) & 0xff;
121
- const blue = value & 0xff;
122
- return `\x1b[${mode};2;${red};${green};${blue}m${text}\x1b[${mode === 38 ? 39 : 49}m`;
128
+ return colorize(text, hex, mode === 38 ? 'foreground' : 'background');
123
129
  }
124
130
  const foreground = (hex, text) => ansiColor(38, hex, text);
125
131
  const background = (hex, text) => ansiColor(48, hex, text);
@@ -455,11 +461,11 @@ export function renderContextBar(segments, usedTokens, contextWindow, width, col
455
461
  /** Pressure-colored text: green below 80%, amber ≥ 80, red ≥ 95.
456
462
  * @param pct - Context occupancy percent (0–100+).
457
463
  * @param text - Text to color.
458
- * @returns The ANSI 24-bit color-wrapped text.
464
+ * @returns The capability-aware color-wrapped text.
459
465
  */
460
466
  export function pressureColor(pct, text) {
461
467
  const key = contextPressureStep(pct) ?? 'success';
462
- return `\x1b[38;2;${colorHex(key)}m${text}\x1b[39m`;
468
+ return colorize(text, colorHex(key), 'foreground');
463
469
  }
464
470
  /** Compact 1/8-cell context gauge for the footer's ctx field on hover:
465
471
  * `▕██████▋···▏`, fill proportional to context occupancy, colored by the
@@ -495,20 +501,20 @@ const MED = 20;
495
501
  /** Speed color: green ≥ 50, yellow ≥ 20, red below (pi-tps-meter).
496
502
  * @param tps - Tokens per second; selects the color threshold.
497
503
  * @param text - Text to color.
498
- * @returns The ANSI 24-bit color-wrapped text.
504
+ * @returns The capability-aware color-wrapped text.
499
505
  */
500
506
  export function speedColor(tps, text) {
501
507
  const color = tps >= FAST ? 'success' : tps >= MED ? 'warning' : 'error';
502
- return `\x1b[38;2;${colorHex(color)}m${text}\x1b[39m`;
508
+ return colorize(text, colorHex(color), 'foreground');
503
509
  }
504
510
  function colorHex(key) {
505
- // dsh-tui dark theme values (theme.ts), semicolon-separated for raw ANSI.
511
+ // dsh-tui dark theme values (theme.ts), passed through shared color policy.
506
512
  const palette = {
507
- success: '78;186;101',
508
- warning: '202;138;4',
509
- error: '255;107;128',
513
+ success: '#4eba65',
514
+ warning: '#ca8a04',
515
+ error: '#ff6b80',
510
516
  };
511
- return palette[key] ?? '255;255;255';
517
+ return palette[key] ?? '#ffffff';
512
518
  }
513
519
  /** Live 1/8-cell horizontal gauge: `▕███████▋···▏`.
514
520
  * @param tps - Current tokens per second.
@@ -1 +1 @@
1
- {"version":3,"file":"ForeignSessionPanes.d.ts","sourceRoot":"","sources":["../../../../src/screens/sessionSupervisor/ForeignSessionPanes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACJ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE;IACD,KAAK,EAAE,oBAAoB,CAAA;IAC3B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IAC5D,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,iBAAiB,EAAE,OAAO,CAAA;IAC1B,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACtC,GAAG,KAAK,CAAC,SAAS,CAkKlB"}
1
+ {"version":3,"file":"ForeignSessionPanes.d.ts","sourceRoot":"","sources":["../../../../src/screens/sessionSupervisor/ForeignSessionPanes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACJ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,aAAa,GACd,EAAE;IACD,KAAK,EAAE,oBAAoB,CAAA;IAC3B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IAC5D,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,iBAAiB,EAAE,OAAO,CAAA;IAC1B,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACtC,GAAG,KAAK,CAAC,SAAS,CAiKlB"}
@@ -78,7 +78,7 @@ export function ForeignSessionPanes({ model, sourceLabel, home, now, query, noti
78
78
  }, children: _jsx(SearchBox, { query: query, isFocused: pane === 'list' || searchCursor, declareCursor: cursorActive && searchCursor, isTerminalFocused: isTerminalFocused, placeholder: truncateWidth(t('supervisor-foreign-filter-placeholder'), Math.max(8, sessionWidth - 6)), prefix: "/", borderless: true, width: Math.max(8, sessionWidth - 2) }) }), _jsxs("ink-box", { style: { flexDirection: 'column', flexGrow: 1, flexShrink: 1, overflow: 'hidden' }, onMouseEnter: () => onFilterFocus(false), onWheel: (event) => {
79
79
  onFilterFocus(false);
80
80
  model.moveList(event.deltaY >= 0 ? 1 : -1);
81
- }, children: [loading && _jsx(Text, { dimColor: true, italic: true, children: ` ${truncateWidth(t('supervisor-foreign-loading', { source: sourceLabel }), sessionWidth - 2)}` }), !loading && visibleRows.length === 0 && (_jsx(Text, { dimColor: true, italic: true, children: ` ${truncateWidth(filtered ? t('supervisor-no-matches') : t('supervisor-foreign-empty', { source: sourceLabel }), sessionWidth - 2)}` })), listRows.map((row, index) => (_jsx(ForeignSessionRow, { session: row, width: sessionWidth, focused: pane === 'list' && listTop + index === rowIndex, declareCursor: cursorActive && !searchCursor, home: home, now: now, onClick: (event) => {
81
+ }, children: [loading && _jsx(Text, { dimColor: true, italic: true, children: ` ${truncateWidth(t('supervisor-foreign-loading', { source: sourceLabel }), sessionWidth - 2)}` }), !loading && visibleRows.length === 0 && (_jsx(Text, { dimColor: true, italic: true, children: ` ${truncateWidth(filtered ? t('supervisor-no-matches') : t('supervisor-foreign-empty', { source: sourceLabel }), sessionWidth - 2)}` })), listRows.map((row, index) => (_jsx(ForeignSessionRow, { session: row, width: sessionWidth, focused: pane === 'list' && listTop + index === rowIndex, declareCursor: cursorActive && !searchCursor, now: now, onClick: (event) => {
82
82
  event.stopImmediatePropagation();
83
83
  model.focusRow(row);
84
84
  model.openRow(row);
@@ -68,7 +68,7 @@ export declare function useSessionSupervisor(input: SessionSupervisorInput): {
68
68
  query: string;
69
69
  setQuery: React.Dispatch<React.SetStateAction<string>>;
70
70
  holderOf: (sessionId: string) => number | undefined;
71
- listedSessions: SessionSummary[];
71
+ listedSessions: readonly SessionSummary[];
72
72
  railEntries: readonly RailEntry[];
73
73
  countOf: (entry: RailEntry) => number;
74
74
  railFocus: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useSessionSupervisor.d.ts","sourceRoot":"","sources":["../../../../src/screens/sessionSupervisor/useSessionSupervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAiD,MAAM,OAAO,CAAA;AAQrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB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OAAO,KAAG,IAAI;yBAmD1B,SAAS,KAAG,IAAI;2BAqBd,cAAc,KAAG,IAAI;0BAqBtB,iBAAiB,KAAG,IAAI;wBAgB1B,MAAM,SAAS,MAAM,KAAG,IAAI;wBAe5B,MAAM,KAAG,IAAI;2BAcV,cAAc,KAAG,IAAI;qBAiB7B,IAAI;0BAKG,SAAS,QAAQ,MAAM,KAAG,IAAI;mBAcrC,CAAC,GAAG,CAAC,CAAC,KAAG,IAAI;sBAWV,CAAC,GAAG,CAAC,CAAC,KAAG,IAAI;;EA+EnD"}
@@ -16,6 +16,7 @@ import { basename } from 'node:path';
16
16
  import { formatSessionRef } from '../../agent/refs.js';
17
17
  import { t } from '../../i18n.js';
18
18
  import { normalizeWorkspaceCwd } from '../../sessions/view.js';
19
+ import { visibleWorkspaceSessions } from '../../sessions/workspaceCounts.js';
19
20
  import { readSessionPins, sessionPinsDir, setSessionPinned } from '../../sessionPins.js';
20
21
  import { readSessionOwners } from '../../sessionMounts.js';
21
22
  import { resumeFailureText } from '../../sessions/resumeFailure.js';
@@ -123,19 +124,7 @@ export function useSessionSupervisor(input) {
123
124
  * the current row already represents. `buildView` hides the current id as
124
125
  * well because its list has no live-state column to mark it with.
125
126
  */
126
- const listedSessions = useMemo(() => {
127
- const byId = new Map(sessions.map(session => [session.id, session]));
128
- const ancestors = new Set();
129
- let cursor = byId.get(channel.agentId);
130
- while (cursor?.kind.kind === 'fork') {
131
- const parent = cursor.kind.parent;
132
- if (parent === undefined || ancestors.has(parent))
133
- break;
134
- ancestors.add(parent);
135
- cursor = byId.get(parent);
136
- }
137
- return sessions.filter(session => session.hasPrompt && session.kind.kind !== 'subagent' && !ancestors.has(session.id));
138
- }, [sessions, channel.agentId]);
127
+ const listedSessions = useMemo(() => visibleWorkspaceSessions(sessions, channel.agentId), [sessions, channel.agentId]);
139
128
  /**
140
129
  * The rail's rows: the durable registry, plus rows for sessions that live in
141
130
  * a directory the registry does not know (or while it cannot be read at all).
@@ -312,6 +301,9 @@ export function useSessionSupervisor(input) {
312
301
  // rows the newer listing has already corrected.
313
302
  const slot = snapshotSlot(channel);
314
303
  const generation = ++slot.requestGeneration;
304
+ const bindingGeneration = channel.agentBindingGeneration;
305
+ const current = () => slot.requestGeneration === generation
306
+ && channel.agentBindingGeneration === bindingGeneration;
315
307
  setRefreshing(true);
316
308
  // The two reads are independent, and the session listing is the half this
317
309
  // screen cannot work without: a registry that rejects (bare composition,
@@ -322,14 +314,14 @@ export function useSessionSupervisor(input) {
322
314
  (async () => {
323
315
  try {
324
316
  const fresh = await channel.listSessions(enriched => {
325
- if (slot.requestGeneration !== generation)
317
+ if (!current())
326
318
  return;
327
319
  slot.rows = slot.rows?.map(row => row.id === enriched.id ? enriched : row);
328
320
  setSessions(current => current.map(row => row.id === enriched.id ? enriched : row));
329
321
  }, partial => {
330
322
  // Fresh workspace rows supersede cached metadata immediately;
331
323
  // retain other cached workspaces until the full listing arrives.
332
- if (slot.requestGeneration !== generation)
324
+ if (!current())
333
325
  return;
334
326
  setSessions(current => [...new Map([...current, ...partial].map(row => [row.id, row])).values()]
335
327
  .sort((left, right) => right.updatedAt - left.updatedAt));
@@ -337,14 +329,14 @@ export function useSessionSupervisor(input) {
337
329
  });
338
330
  // Recorded only after success: a failed listing keeps the previous
339
331
  // snapshot, and only the newest reload may write it.
340
- if (slot.requestGeneration !== generation)
332
+ if (!current())
341
333
  return;
342
334
  slot.rows = fresh;
343
335
  setSessions(fresh);
344
336
  setNotice(current => (current?.tone === 'error' ? undefined : current));
345
337
  }
346
338
  catch (error) {
347
- if (slot.requestGeneration !== generation)
339
+ if (!current())
348
340
  return;
349
341
  setNotice({ text: t('home-sessions-failed', { err: message(error) }), tone: 'error' });
350
342
  }
@@ -354,24 +346,24 @@ export function useSessionSupervisor(input) {
354
346
  const registry = typeof channel.listWorkspaceRegistry === 'function' && workspaceLedger
355
347
  ? await channel.listWorkspaceRegistry()
356
348
  : [];
357
- if (slot.requestGeneration !== generation)
349
+ if (!current())
358
350
  return;
359
351
  setEntries(registry.map(entry => ({ ...entry, from: 'registry' })));
360
352
  }
361
353
  catch {
362
354
  // An unreadable registry is not an empty history: the sessions stay
363
355
  // listed (and resumable) under the cwd-derived fallback groups.
364
- if (slot.requestGeneration !== generation)
356
+ if (!current())
365
357
  return;
366
358
  setEntries([]);
367
359
  }
368
360
  })(),
369
361
  ]);
370
- if (slot.requestGeneration === generation) {
362
+ if (current()) {
371
363
  setLoading(false);
372
364
  setRefreshing(false);
373
365
  }
374
- }, [channel, workspaceLedger, channel.cwd, channel.ready]);
366
+ }, [channel, workspaceLedger, channel.cwd, channel.ready, channel.agentBindingGeneration]);
375
367
  React.useEffect(() => {
376
368
  void reload();
377
369
  }, [reload]);
@@ -75,6 +75,13 @@ export type SessionOccupancy = {
75
75
  * names a transient collision worth retrying, and `unavailable` means the
76
76
  * occupancy question could not be answered at all. Folding them together is
77
77
  * how "we did not manage to check" turns into "there was nothing to check".
78
+ *
79
+ * `damaged` splits `unavailable` one step further, because only one of its
80
+ * causes has anything the user can do: the file was read and is not a ledger
81
+ * document, so deleting it clears the refusal. A failure that is not marked
82
+ * (permissions, a directory in its place, a lock we could not take) must not
83
+ * be described as deformation — sending someone to delete a path that may be
84
+ * their own data is worse than telling them nothing (issue #1579).
78
85
  */
79
86
  export type MountFailure = {
80
87
  readonly ok: false;
@@ -87,6 +94,7 @@ export type MountFailure = {
87
94
  readonly ok: false;
88
95
  readonly reason: 'unavailable';
89
96
  readonly detail: string;
97
+ readonly damaged?: true;
90
98
  };
91
99
  /**
92
100
  * Outcome of {@link claimMount}: either this process now owns the session, or
@@ -124,6 +132,9 @@ export declare function readMountLedger(): readonly SessionMountOwner[];
124
132
  * Outcome of the authoritative read. `unavailable` carries a sentence naming
125
133
  * what was wrong, so a refusal can say "cannot verify occupancy" instead of
126
134
  * inventing a holder.
135
+ *
136
+ * `damaged` is the read's half of {@link MountFailure}: set only when the bytes
137
+ * were in hand and they are not a ledger document.
127
138
  */
128
139
  export type MountLedgerRead = {
129
140
  readonly ok: true;
@@ -131,6 +142,7 @@ export type MountLedgerRead = {
131
142
  } | {
132
143
  readonly ok: false;
133
144
  readonly detail: string;
145
+ readonly damaged?: true;
134
146
  };
135
147
  /**
136
148
  * Read the ledger for DECIDING, where "I could not read it" must not pass for
@@ -142,6 +154,8 @@ export type MountLedgerRead = {
142
154
  * a bad record and writing the ledger anyway is not an option either: the
143
155
  * record that failed to parse may be another writer's only claim, so the safe
144
156
  * move is to leave the file exactly as it is and ask the user to repair it.
157
+ * The five refusals that mean "read, but not a ledger document" carry
158
+ * `damaged`; a failure to read at all carries no verdict.
145
159
  */
146
160
  export declare function readMountLedgerStrict(): MountLedgerRead;
147
161
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sessionMounts.d.ts","sourceRoot":"","sources":["../../src/sessionMounts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAwCH,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CACvC;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAE7D;AAED,uDAAuD;AACvD,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAIvD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ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