@draht/coding-agent 2026.11.5 → 2026.11.14

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 (306) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/bundle/chunks/anthropic-messages-FKSSTO6N.js +6 -0
  3. package/dist/bundle/chunks/{azure-openai-responses-5YLWRJ4E.js → azure-openai-responses-AHIW4IRP.js} +1 -1
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  5. package/dist/bundle/chunks/chunk-2CHTECAU.js +2 -0
  6. package/dist/bundle/chunks/{chunk-SPVE2GM7.js → chunk-46NQOOTO.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-MKVW4KK2.js → chunk-4ALYWMDD.js} +1 -1
  8. package/dist/bundle/chunks/{chunk-EXZUXBS5.js → chunk-5K3TBDND.js} +12 -15
  9. package/dist/bundle/chunks/{chunk-PRT3JHOZ.js → chunk-DFFQ5ETM.js} +1 -1
  10. package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
  11. package/dist/bundle/chunks/{chunk-LJ3SEGWI.js → chunk-G7DJ6PIU.js} +5 -1
  12. package/dist/bundle/chunks/{chunk-3LFBXSCO.js → chunk-GR3JEDCL.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-JAT7HEFU.js → chunk-HIL6BIBX.js} +2 -2
  14. package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
  15. package/dist/bundle/chunks/chunk-NJDELBDB.js +82 -0
  16. package/dist/bundle/chunks/{chunk-CLNF6E5P.js → chunk-NLVN7RG3.js} +1 -1
  17. package/dist/bundle/chunks/chunk-NLYBRJ3F.js +9 -0
  18. package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-OPLOTJXH.js} +3 -1
  19. package/dist/bundle/chunks/{chunk-YUBUKEPQ.js → chunk-PPJRJAR3.js} +169 -130
  20. package/dist/bundle/chunks/chunk-RIPTEKPX.js +44 -0
  21. package/dist/bundle/chunks/chunk-ROB5AWV5.js +30 -0
  22. package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
  23. package/dist/bundle/chunks/{chunk-ABW2JATG.js → chunk-XEVRP72T.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-SKQFE2GA.js → chunk-XY64T2H6.js} +1 -1
  25. package/dist/bundle/chunks/chunk-ZZAOELWU.js +2 -0
  26. package/dist/bundle/chunks/{cli-7AMCJ2UG.js → cli-JDGPEN7N.js} +3 -3
  27. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QBCV2OWJ.js → cloudflare-workers-ai-system-one-ZPDQKK4H.js} +1 -1
  28. package/dist/bundle/chunks/codemode-worker.js +2 -0
  29. package/dist/bundle/chunks/{execute-VOIPQMCI.js → execute-YOMYOVUT.js} +2 -2
  30. package/dist/bundle/chunks/github-copilot.js +1 -1
  31. package/dist/bundle/chunks/google-generative-ai-EEDLVZAQ.js +2 -0
  32. package/dist/bundle/chunks/google-vertex-YQDP6U25.js +2 -0
  33. package/dist/bundle/chunks/{llama-cpp-classify-WGVYEPG2.js → llama-cpp-classify-SRUYBPZS.js} +1 -1
  34. package/dist/bundle/chunks/{mistral-conversations-PV6RDK65.js → mistral-conversations-QKVAIF57.js} +1 -1
  35. package/dist/bundle/chunks/{openai-codex-responses-SEOL3EDF.js → openai-codex-responses-2FIT2Z3L.js} +1 -1
  36. package/dist/bundle/chunks/{openai-completions-U32QPS37.js → openai-completions-42OND4EW.js} +3 -3
  37. package/dist/bundle/chunks/{openai-decisions-ULSYFV2A.js → openai-decisions-FAP6LRGH.js} +1 -1
  38. package/dist/bundle/chunks/{openai-responses-5MYZJYPK.js → openai-responses-BGC7WCIQ.js} +1 -1
  39. package/dist/bundle/chunks/{openrouter-images-SGOP5SDW.js → openrouter-images-EAWW57ZG.js} +1 -1
  40. package/dist/bundle/chunks/{pi-messages-QALFE2BD.js → pi-messages-JM6JDMH5.js} +1 -1
  41. package/dist/bundle/chunks/{runtime-GDH3ZURV.js → runtime-F63NCS5Y.js} +1 -1
  42. package/dist/bundle/chunks/{runtime-Z74VFUDD.js → runtime-S5WBSLTE.js} +1 -1
  43. package/dist/bundle/chunks/{settings-manager-T6UJFO2F.js → settings-manager-H3QEOPQ3.js} +1 -1
  44. package/dist/bundle/chunks/{typesafe-system-one-GTGS5MG6.js → typesafe-system-one-QOA2PTJR.js} +1 -1
  45. package/dist/bundle/chunks/virtual-modules-2BURZRW7.js +2 -0
  46. package/dist/bundle/cli-runtime.js +1 -1
  47. package/dist/bundle/index.js +1 -1
  48. package/dist/bundle/rpc-entry.js +1 -1
  49. package/dist/cli/args.d.ts.map +1 -1
  50. package/dist/cli/args.js +5 -3
  51. package/dist/cli/args.js.map +1 -1
  52. package/dist/cli/auth-command.d.ts.map +1 -1
  53. package/dist/cli/auth-command.js +30 -6
  54. package/dist/cli/auth-command.js.map +1 -1
  55. package/dist/cli/auth-login.d.ts +15 -0
  56. package/dist/cli/auth-login.d.ts.map +1 -0
  57. package/dist/cli/auth-login.js +232 -0
  58. package/dist/cli/auth-login.js.map +1 -0
  59. package/dist/cli/auth-logout.d.ts +14 -0
  60. package/dist/cli/auth-logout.d.ts.map +1 -0
  61. package/dist/cli/auth-logout.js +57 -0
  62. package/dist/cli/auth-logout.js.map +1 -0
  63. package/dist/cli/auth-terminal.d.ts +17 -0
  64. package/dist/cli/auth-terminal.d.ts.map +1 -0
  65. package/dist/cli/auth-terminal.js +63 -0
  66. package/dist/cli/auth-terminal.js.map +1 -0
  67. package/dist/core/agent-session-runtime.d.ts +5 -0
  68. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  69. package/dist/core/agent-session-runtime.js +16 -2
  70. package/dist/core/agent-session-runtime.js.map +1 -1
  71. package/dist/core/agent-session.d.ts +20 -9
  72. package/dist/core/agent-session.d.ts.map +1 -1
  73. package/dist/core/agent-session.js +71 -29
  74. package/dist/core/agent-session.js.map +1 -1
  75. package/dist/core/ai-schemas.d.ts +1 -0
  76. package/dist/core/ai-schemas.d.ts.map +1 -1
  77. package/dist/core/builtins/budgets.d.ts.map +1 -1
  78. package/dist/core/builtins/budgets.js +6 -3
  79. package/dist/core/builtins/budgets.js.map +1 -1
  80. package/dist/core/cache-warmer.d.ts +4 -37
  81. package/dist/core/cache-warmer.d.ts.map +1 -1
  82. package/dist/core/cache-warmer.js +11 -91
  83. package/dist/core/cache-warmer.js.map +1 -1
  84. package/dist/core/compaction/utils.d.ts.map +1 -1
  85. package/dist/core/compaction/utils.js +2 -1
  86. package/dist/core/compaction/utils.js.map +1 -1
  87. package/dist/core/exec.d.ts +1 -0
  88. package/dist/core/exec.d.ts.map +1 -1
  89. package/dist/core/exec.js +4 -1
  90. package/dist/core/exec.js.map +1 -1
  91. package/dist/core/export-html/ansi-to-html.d.ts +5 -0
  92. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  93. package/dist/core/export-html/ansi-to-html.js +57 -20
  94. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  95. package/dist/core/export-html/template.js +1 -1
  96. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  97. package/dist/core/export-html/tool-renderer.js +2 -3
  98. package/dist/core/export-html/tool-renderer.js.map +1 -1
  99. package/dist/core/extensions/types.d.ts +3 -2
  100. package/dist/core/extensions/types.d.ts.map +1 -1
  101. package/dist/core/extensions/types.js.map +1 -1
  102. package/dist/core/model-config.d.ts +13 -0
  103. package/dist/core/model-config.d.ts.map +1 -1
  104. package/dist/core/model-resolver.d.ts +0 -1
  105. package/dist/core/model-resolver.d.ts.map +1 -1
  106. package/dist/core/model-resolver.js +17 -24
  107. package/dist/core/model-resolver.js.map +1 -1
  108. package/dist/core/model-runtime.d.ts +5 -0
  109. package/dist/core/model-runtime.d.ts.map +1 -1
  110. package/dist/core/model-runtime.js +7 -0
  111. package/dist/core/model-runtime.js.map +1 -1
  112. package/dist/core/polyphase/render/format.d.ts +2 -0
  113. package/dist/core/polyphase/render/format.d.ts.map +1 -1
  114. package/dist/core/polyphase/render/format.js +6 -0
  115. package/dist/core/polyphase/render/format.js.map +1 -1
  116. package/dist/core/polyphase/render/run-block.d.ts +4 -0
  117. package/dist/core/polyphase/render/run-block.d.ts.map +1 -1
  118. package/dist/core/polyphase/render/run-block.js +71 -12
  119. package/dist/core/polyphase/render/run-block.js.map +1 -1
  120. package/dist/core/polyphase/render/snapshot.d.ts +1 -1
  121. package/dist/core/polyphase/render/snapshot.d.ts.map +1 -1
  122. package/dist/core/polyphase/render/snapshot.js +22 -7
  123. package/dist/core/polyphase/render/snapshot.js.map +1 -1
  124. package/dist/core/polyphase/ui/dock.d.ts.map +1 -1
  125. package/dist/core/polyphase/ui/dock.js +34 -2
  126. package/dist/core/polyphase/ui/dock.js.map +1 -1
  127. package/dist/core/polyphase/ui/inspector.d.ts +18 -6
  128. package/dist/core/polyphase/ui/inspector.d.ts.map +1 -1
  129. package/dist/core/polyphase/ui/inspector.js +125 -44
  130. package/dist/core/polyphase/ui/inspector.js.map +1 -1
  131. package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -1
  132. package/dist/core/polyphase/ui/transcript-layout.js +5 -1
  133. package/dist/core/polyphase/ui/transcript-layout.js.map +1 -1
  134. package/dist/core/preferred-providers.d.ts +17 -0
  135. package/dist/core/preferred-providers.d.ts.map +1 -0
  136. package/dist/core/preferred-providers.js +24 -0
  137. package/dist/core/preferred-providers.js.map +1 -0
  138. package/dist/core/prompt-templates.d.ts.map +1 -1
  139. package/dist/core/prompt-templates.js +18 -2
  140. package/dist/core/prompt-templates.js.map +1 -1
  141. package/dist/core/provider-composer.d.ts.map +1 -1
  142. package/dist/core/provider-composer.js +2 -0
  143. package/dist/core/provider-composer.js.map +1 -1
  144. package/dist/core/provider-matching.d.ts +6 -0
  145. package/dist/core/provider-matching.d.ts.map +1 -0
  146. package/dist/core/provider-matching.js +8 -0
  147. package/dist/core/provider-matching.js.map +1 -0
  148. package/dist/core/radius-mcp.d.ts +13 -0
  149. package/dist/core/radius-mcp.d.ts.map +1 -0
  150. package/dist/core/radius-mcp.js +29 -0
  151. package/dist/core/radius-mcp.js.map +1 -0
  152. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  153. package/dist/core/remote-catalog-provider.js +2 -0
  154. package/dist/core/remote-catalog-provider.js.map +1 -1
  155. package/dist/core/runtime-credentials.d.ts +8 -0
  156. package/dist/core/runtime-credentials.d.ts.map +1 -1
  157. package/dist/core/runtime-credentials.js +15 -1
  158. package/dist/core/runtime-credentials.js.map +1 -1
  159. package/dist/core/session-cwd.d.ts +7 -0
  160. package/dist/core/session-cwd.d.ts.map +1 -1
  161. package/dist/core/session-cwd.js +9 -1
  162. package/dist/core/session-cwd.js.map +1 -1
  163. package/dist/core/session-manager.d.ts.map +1 -1
  164. package/dist/core/session-manager.js +45 -36
  165. package/dist/core/session-manager.js.map +1 -1
  166. package/dist/core/settings-defaults.d.ts +1 -1
  167. package/dist/core/settings-defaults.d.ts.map +1 -1
  168. package/dist/core/settings-defaults.js +1 -1
  169. package/dist/core/settings-defaults.js.map +1 -1
  170. package/dist/core/tools/bash.d.ts.map +1 -1
  171. package/dist/core/tools/bash.js +35 -5
  172. package/dist/core/tools/bash.js.map +1 -1
  173. package/dist/core/tools/edit-diff.d.ts +23 -14
  174. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  175. package/dist/core/tools/edit-diff.js +182 -41
  176. package/dist/core/tools/edit-diff.js.map +1 -1
  177. package/dist/core/tools/edit.d.ts.map +1 -1
  178. package/dist/core/tools/edit.js +8 -7
  179. package/dist/core/tools/edit.js.map +1 -1
  180. package/dist/core/tools/find.d.ts.map +1 -1
  181. package/dist/core/tools/find.js +57 -16
  182. package/dist/core/tools/find.js.map +1 -1
  183. package/dist/core/tools/grep.d.ts +4 -0
  184. package/dist/core/tools/grep.d.ts.map +1 -1
  185. package/dist/core/tools/grep.js +20 -8
  186. package/dist/core/tools/grep.js.map +1 -1
  187. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  188. package/dist/core/tools/output-accumulator.js +4 -1
  189. package/dist/core/tools/output-accumulator.js.map +1 -1
  190. package/dist/core/tools/powershell.d.ts.map +1 -1
  191. package/dist/core/tools/powershell.js +15 -2
  192. package/dist/core/tools/powershell.js.map +1 -1
  193. package/dist/core/tools/read.d.ts +13 -0
  194. package/dist/core/tools/read.d.ts.map +1 -1
  195. package/dist/core/tools/read.js +146 -35
  196. package/dist/core/tools/read.js.map +1 -1
  197. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  198. package/dist/core/tools/renderers/read.js +6 -2
  199. package/dist/core/tools/renderers/read.js.map +1 -1
  200. package/dist/core/tools/truncate.d.ts +4 -0
  201. package/dist/core/tools/truncate.d.ts.map +1 -1
  202. package/dist/core/tools/truncate.js +24 -1
  203. package/dist/core/tools/truncate.js.map +1 -1
  204. package/dist/extensions/codemode/execute.js +4 -4
  205. package/dist/extensions/codemode/execute.js.map +1 -1
  206. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  207. package/dist/extensions/codemode/tool.js +34 -12
  208. package/dist/extensions/codemode/tool.js.map +1 -1
  209. package/dist/extensions/llama/provider.d.ts +1 -1
  210. package/dist/extensions/llama/provider.js +1 -1
  211. package/dist/extensions/llama/provider.js.map +1 -1
  212. package/dist/extensions/llama/ui.d.ts.map +1 -1
  213. package/dist/extensions/llama/ui.js +15 -3
  214. package/dist/extensions/llama/ui.js.map +1 -1
  215. package/dist/extensions/mcp/cli.js +5 -8
  216. package/dist/extensions/mcp/cli.js.map +1 -1
  217. package/dist/extensions/mcp/index.d.ts.map +1 -1
  218. package/dist/extensions/mcp/index.js +2 -1
  219. package/dist/extensions/mcp/index.js.map +1 -1
  220. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  221. package/dist/extensions/mcp/runtime.js +3 -2
  222. package/dist/extensions/mcp/runtime.js.map +1 -1
  223. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  224. package/dist/extensions/tool-search/tool.js +18 -6
  225. package/dist/extensions/tool-search/tool.js.map +1 -1
  226. package/dist/main.d.ts.map +1 -1
  227. package/dist/main.js +67 -15
  228. package/dist/main.js.map +1 -1
  229. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  230. package/dist/modes/interactive/components/login-dialog.js +2 -19
  231. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  232. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  233. package/dist/modes/interactive/components/model-selector.js +14 -6
  234. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  235. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  236. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  237. package/dist/modes/interactive/components/oauth-selector.js +32 -5
  238. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  239. package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
  240. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  241. package/dist/modes/interactive/components/provider-brand.js +66 -0
  242. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  243. package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
  244. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  245. package/dist/modes/interactive/components/radius-login-selector.js +6 -37
  246. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  247. package/dist/modes/interactive/components/session-selector.d.ts +6 -1
  248. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  249. package/dist/modes/interactive/components/session-selector.js +23 -5
  250. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  251. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  252. package/dist/modes/interactive/components/tool-execution.js +3 -1
  253. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  254. package/dist/modes/interactive/interactive-mode.d.ts +11 -1
  255. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  256. package/dist/modes/interactive/interactive-mode.js +133 -78
  257. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  258. package/dist/modes/interactive/session-share.js +2 -0
  259. package/dist/modes/interactive/session-share.js.map +1 -1
  260. package/dist/package-manager-cli.d.ts.map +1 -1
  261. package/dist/package-manager-cli.js +27 -4
  262. package/dist/package-manager-cli.js.map +1 -1
  263. package/dist/prompts/commands/test-audit.md +84 -0
  264. package/dist/utils/image-resize.d.ts.map +1 -1
  265. package/dist/utils/image-resize.js +3 -1
  266. package/dist/utils/image-resize.js.map +1 -1
  267. package/dist/utils/terminal-question.d.ts +8 -0
  268. package/dist/utils/terminal-question.d.ts.map +1 -0
  269. package/dist/utils/terminal-question.js +24 -0
  270. package/dist/utils/terminal-question.js.map +1 -0
  271. package/dist/utils/web-url.d.ts +12 -0
  272. package/dist/utils/web-url.d.ts.map +1 -0
  273. package/dist/utils/web-url.js +20 -0
  274. package/dist/utils/web-url.js.map +1 -0
  275. package/docs/cli.md +14 -1
  276. package/docs/extensions.md +6 -4
  277. package/docs/llama-cpp.md +5 -5
  278. package/docs/models-configuration.md +2 -1
  279. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  280. package/docs/polyphase.md +13 -1
  281. package/docs/prompt-templates.md +1 -1
  282. package/docs/providers.md +4 -2
  283. package/docs/quickstart.md +1 -1
  284. package/docs/rpc-commands.md +1 -1
  285. package/docs/rpc.md +1 -1
  286. package/docs/sessions.md +7 -1
  287. package/docs/settings.md +1 -1
  288. package/docs/tui.md +1 -1
  289. package/examples/extensions/gondolin/index.ts +4 -7
  290. package/examples/extensions/subagent/index.ts +5 -1
  291. package/package.json +10 -10
  292. package/prompts/commands/test-audit.md +84 -0
  293. package/schemas/models.schema.json +5 -1
  294. package/schemas/settings.schema.json +1 -1
  295. package/dist/bundle/chunks/anthropic-messages-TXQXPH4S.js +0 -6
  296. package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
  297. package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
  298. package/dist/bundle/chunks/chunk-J7QTCDIN.js +0 -2
  299. package/dist/bundle/chunks/chunk-NNYZSIKR.js +0 -9
  300. package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
  301. package/dist/bundle/chunks/chunk-THDNEOXP.js +0 -44
  302. package/dist/bundle/chunks/chunk-TK3LS5QZ.js +0 -82
  303. package/dist/bundle/chunks/chunk-TYAEYYRA.js +0 -30
  304. package/dist/bundle/chunks/google-generative-ai-NC5KHHW3.js +0 -2
  305. package/dist/bundle/chunks/google-vertex-GAPUJEF7.js +0 -2
  306. package/dist/bundle/chunks/virtual-modules-ZUI2T3XR.js +0 -2
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { visibleWidth, wrapTextWithAnsi } from "@draht/tui";
6
6
  import { combinedKeyHint, keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
7
- import { columns, fitLine, formatCost, formatDuration, formatModelLabel, formatTokens, oneLine, padToWidth, statusGlyph, } from "../render/format.js";
7
+ import { columns, fitLine, formatCost, formatDuration, formatModelLabel, formatTokens, oneLine, padToWidth, progressBar, statusGlyph, } from "../render/format.js";
8
8
  import { sanitizeChildText, sanitizeSnapshot } from "../render/run-block.js";
9
9
  import { snapshotFromDetails, snapshotFromRun } from "../render/snapshot.js";
10
10
  import { sanitizeForDisplay, TranscriptLineCache, tailWindowOf, } from "./transcript-layout.js";
@@ -135,6 +135,8 @@ function runSubtitleText(snapshot) {
135
135
  * status glyph must stay visible even when nothing else does. `columns()`'s own 1-column gap
136
136
  * supplies the separator space before the title, matching `› ● label` elsewhere in this file. */
137
137
  const RUNS_ROW_CURSOR_WIDTH = 3;
138
+ /** Cap for the runs view's widened counts cell, so it never squeezes the title to nothing. */
139
+ const RUNS_COUNTS_MAX_WIDTH = 20;
138
140
  function savedWorkflowSourceLabel(source) {
139
141
  return source === "project" ? "proj" : "user";
140
142
  }
@@ -210,6 +212,39 @@ function formatCounts(theme, now, counts) {
210
212
  function isFinishedAgentStatus(status) {
211
213
  return status === "done" || status === "failed" || status === "cancelled" || status === "skipped";
212
214
  }
215
+ /** `label · agentType · phase`, minus any part that repeats an earlier one (a workflow agent is
216
+ * often labelled after its type or its phase, which would otherwise read `cleanup · cleanup`). */
217
+ function agentTitleText(row, phaseTitle) {
218
+ const parts = [];
219
+ for (const part of [row.label, row.agentType, phaseTitle]) {
220
+ if (part && !parts.includes(part))
221
+ parts.push(part);
222
+ }
223
+ return parts.join(" · ");
224
+ }
225
+ /** `budget ███░░ 12.3k/50.0k tok · time ██░░░ 4:10/30:00` for a run with a token budget or a time
226
+ * limit, so how close the run is to being stopped is visible before it happens. */
227
+ function limitsGaugeText(snapshot, theme) {
228
+ const parts = [];
229
+ const gauge = (ratio, hit) => theme.fg(hit ? "error" : ratio >= 0.8 ? "warning" : "accent", progressBar(ratio, 10));
230
+ if (snapshot.budget) {
231
+ const { spentTokens, totalTokens, exhausted } = snapshot.budget;
232
+ parts.push(`budget ${gauge(spentTokens / totalTokens, exhausted)} ${formatTokens(spentTokens)}/${formatTokens(totalTokens)} tok`);
233
+ }
234
+ if (snapshot.timeLimit) {
235
+ const { totalMs, reached } = snapshot.timeLimit;
236
+ parts.push(`time ${gauge(snapshot.elapsedMs / totalMs, reached)} ${formatDuration(Math.min(snapshot.elapsedMs, totalMs))}/${formatDuration(totalMs)}`);
237
+ }
238
+ return parts.length > 0 ? parts.join(" · ") : undefined;
239
+ }
240
+ /** Joins hints with two spaces, dropping hints from just before the last one until the line fits,
241
+ * so the closing `back`/`close` hint stays visible on a narrow terminal instead of being cut. */
242
+ function fitHints(hints, width) {
243
+ const kept = [...hints];
244
+ while (kept.length > 2 && visibleWidth(kept.join(" ")) > width)
245
+ kept.splice(kept.length - 2, 1);
246
+ return kept.join(" ");
247
+ }
213
248
  /**
214
249
  * The `alt+a` popup. `render()` recomputes the live runs-view list, the current run's agent list
215
250
  * and the selected agent's transcript window on every call, since those come straight from the
@@ -349,18 +384,15 @@ export class PolyphaseInspector {
349
384
  topRight = snapshot ? this.runHeaderRight(snapshot) : "";
350
385
  bodyLines =
351
386
  width >= SPLIT_MIN_WIDTH
352
- ? this.renderSplitBody(innerWidth, bodyHeight, rows)
387
+ ? this.renderSplitBody(innerWidth, bodyHeight, snapshot, rows)
353
388
  : this.renderRunBody(innerWidth, bodyHeight, snapshot, rows);
354
389
  }
355
390
  else {
356
391
  const snapshot = this.currentRunSnapshot();
357
392
  const rows = this.sortedAgentsOf(snapshot);
358
393
  const row = rows.find((r) => r.i === this.currentAgentIndex);
359
- const phaseTitle = row?.phase !== undefined ? snapshot?.phases[row.phase]?.title : undefined;
360
- topTitle = row ? `${row.label} · ${row.agentType}${phaseTitle ? ` · ${phaseTitle}` : ""}` : "agent";
361
- topRight = row
362
- ? `${statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false })} ${headerActivityText(row)}${row.elapsedMs === undefined ? "" : ` ${formatDuration(row.elapsedMs)}`}`
363
- : "";
394
+ topTitle = row ? agentTitleText(row, this.phaseTitleOf(snapshot, row)) : "agent";
395
+ topRight = row ? this.agentStatusText(row) : "";
364
396
  bodyLines = this.renderAgentDetailBody(this.currentAgentIndex, innerWidth, bodyHeight, rows);
365
397
  }
366
398
  const padded = padLines(bodyLines, bodyHeight);
@@ -377,6 +409,15 @@ export class PolyphaseInspector {
377
409
  now() {
378
410
  return Date.now();
379
411
  }
412
+ phaseTitleOf(snapshot, row) {
413
+ return row.phase !== undefined ? snapshot?.phases[row.phase]?.title : undefined;
414
+ }
415
+ /** `● thinking 0:41`: the agent detail header's right side (§12.2). */
416
+ agentStatusText(row) {
417
+ const glyph = statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false });
418
+ const elapsed = row.elapsedMs === undefined ? "" : ` ${formatDuration(row.elapsedMs)}`;
419
+ return `${glyph} ${headerActivityText(row)}${elapsed}`;
420
+ }
380
421
  // ── Navigation ──────────────────────────────────────────────────────────
381
422
  resolveInitialView() {
382
423
  const initial = this.deps.initial;
@@ -720,7 +761,9 @@ export class PolyphaseInspector {
720
761
  return { items: agent.state.transcript, dropped: agent.state.droppedItems };
721
762
  }
722
763
  // ── Rendering ───────────────────────────────────────────────────────────
723
- formatRunsRow(row, width, selected) {
764
+ /** `countsWidth` is the widest counts cell across every listed run (at least the default), so
765
+ * multi-digit counts like `●10 ✓12` are never cut to `●1`. */
766
+ formatRunsRow(row, width, selected, countsWidth) {
724
767
  const cursor = selected ? "› " : " ";
725
768
  if (row.kind === "saved" && row.saved) {
726
769
  const saved = row.saved;
@@ -747,7 +790,10 @@ export class PolyphaseInspector {
747
790
  if (optional.subtitle > 0)
748
791
  cells.push({ text: runSubtitleText(snapshot), width: optional.subtitle });
749
792
  if (optional.counts > 0) {
750
- cells.push({ text: formatCounts(this.deps.theme, this.now(), snapshot.counts), width: optional.counts });
793
+ cells.push({
794
+ text: formatCounts(this.deps.theme, this.now(), snapshot.counts),
795
+ width: Math.max(optional.counts, countsWidth),
796
+ });
751
797
  }
752
798
  if (optional.duration > 0) {
753
799
  cells.push({ text: formatDuration(snapshot.elapsedMs), width: optional.duration, align: "right" });
@@ -767,6 +813,13 @@ export class PolyphaseInspector {
767
813
  const rows = this.runsRows;
768
814
  const lines = [];
769
815
  const lineForRow = [];
816
+ let countsWidth = 0;
817
+ for (const row of rows) {
818
+ if (row.snapshot) {
819
+ countsWidth = Math.max(countsWidth, visibleWidth(formatCounts(this.deps.theme, this.now(), row.snapshot.counts)));
820
+ }
821
+ }
822
+ countsWidth = Math.min(RUNS_COUNTS_MAX_WIDTH, countsWidth);
770
823
  let lastKind;
771
824
  rows.forEach((row, idx) => {
772
825
  if (row.kind !== lastKind) {
@@ -774,7 +827,7 @@ export class PolyphaseInspector {
774
827
  lastKind = row.kind;
775
828
  }
776
829
  lineForRow[idx] = lines.length;
777
- lines.push(this.formatRunsRow(row, width, idx === this.runsSelection));
830
+ lines.push(this.formatRunsRow(row, width, idx === this.runsSelection, countsWidth));
778
831
  });
779
832
  if (rows.length === 0) {
780
833
  lines.push('No agents yet. Put "polyphase" in a prompt or run /workflow <name>.');
@@ -782,16 +835,16 @@ export class PolyphaseInspector {
782
835
  const pivot = lineForRow[this.runsSelection] ?? 0;
783
836
  const contentHeight = Math.max(1, height - 1);
784
837
  const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
785
- return [...windowed, this.footerLine(this.runsHintLine(), width)];
838
+ return [...windowed, this.footerLine(this.runsHints(), width)];
786
839
  }
787
840
  formatAgentRow(row, width, selected) {
788
841
  const cursor = selected ? "› " : " ";
789
842
  const glyph = statusGlyph(row.status, this.deps.theme, { now: this.now(), animate: false });
790
- const model = formatModelLabel(row, { withProvider: false });
791
- const cells = [
792
- { text: `${cursor}${glyph} ${row.label}`, width: 18 },
793
- { text: model, width: 20 },
794
- ];
843
+ const cells = [{ text: `${cursor}${glyph} ${row.label}`, width: 18 }];
844
+ // Below 50 columns (the split view's left pane, a phase-indented row in it) the model column
845
+ // would leave no room for the activity; the split view's right pane names the model anyway.
846
+ if (width >= 50)
847
+ cells.push({ text: formatModelLabel(row, { withProvider: false }), width: 20 });
795
848
  // Dropped below 60 columns, the same threshold `layoutRun` uses for its elapsed column: at
796
849
  // the 40-column split-pane width there is no room for a 5th fixed cell ahead of the flex one.
797
850
  if (width >= 60) {
@@ -816,7 +869,7 @@ export class PolyphaseInspector {
816
869
  runHeaderRight(snapshot) {
817
870
  const parts = [formatCounts(this.deps.theme, this.now(), snapshot.counts), formatDuration(snapshot.elapsedMs)];
818
871
  if (snapshot.tokens > 0)
819
- parts.push(formatTokens(snapshot.tokens));
872
+ parts.push(`${formatTokens(snapshot.tokens)} tok`);
820
873
  const cost = formatCost(snapshot.cost);
821
874
  if (cost)
822
875
  parts.push(cost);
@@ -826,8 +879,22 @@ export class PolyphaseInspector {
826
879
  if (!snapshot)
827
880
  return [this.deps.theme.fg("muted", "run not found")];
828
881
  this.runSelection = clamp(this.runSelection, 0, Math.max(0, rows.length - 1));
882
+ const { lines, lineForAgent } = this.runListLines(snapshot, rows, width);
883
+ const pivot = lineForAgent[this.runSelection] ?? 0;
884
+ const contentHeight = Math.max(1, height - 1);
885
+ const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
886
+ return [...windowed, this.footerLine(this.runHints(), width)];
887
+ }
888
+ /** The run view's list (§12.2): a limits gauge when the run has a budget or time limit, then
889
+ * agents grouped by phase for workflows, numbered for chains, flat otherwise, then the newest log
890
+ * line or the result. Shared by the full-width run view and the split view's left pane, so the
891
+ * phase tree survives the split. */
892
+ runListLines(snapshot, rows, width) {
829
893
  const lines = [];
830
894
  const lineForAgent = [];
895
+ const gauge = limitsGaugeText(snapshot, this.deps.theme);
896
+ if (gauge)
897
+ lines.push(fitLine(gauge, width));
831
898
  if (snapshot.phases.length > 0) {
832
899
  // Agents spawned before any phase()/agent({phase}) call (§13.3) carry no phase index; they
833
900
  // are still selectable, so they get an ungrouped block ahead of the phase list instead of
@@ -872,25 +939,29 @@ export class PolyphaseInspector {
872
939
  else if (snapshot.resultPreview && snapshot.status !== "running") {
873
940
  lines.push(`→ ${oneLine(sanitizeForDisplay(snapshot.resultPreview))}`);
874
941
  }
875
- const pivot = lineForAgent[this.runSelection] ?? 0;
876
- const contentHeight = Math.max(1, height - 1);
877
- const windowed = padLines(windowAround(lines, contentHeight, pivot, this.deps.theme), contentHeight);
878
- return [...windowed, this.footerLine(this.runHintLine(), width)];
942
+ return { lines: lines.map((line) => fitLine(line, width)), lineForAgent };
879
943
  }
880
- renderSplitBody(width, height, rows) {
881
- const rightWidth = Math.max(1, width - SPLIT_LEFT_WIDTH - 1);
944
+ renderSplitBody(width, height, snapshot, rows) {
945
+ if (!snapshot)
946
+ return [this.deps.theme.fg("muted", "run not found")];
947
+ // The left list stops one column short of the divider, and one more column of air follows it.
948
+ const rightWidth = Math.max(1, width - SPLIT_LEFT_WIDTH - 2);
882
949
  this.runSelection = clamp(this.runSelection, 0, Math.max(0, rows.length - 1));
883
- const leftLines = rows.map((row, idx) => fitLine(this.formatAgentRow(row, SPLIT_LEFT_WIDTH, idx === this.runSelection), SPLIT_LEFT_WIDTH));
884
- const selectedAgentIndex = rows[this.runSelection]?.i;
885
- const rightLines = this.renderAgentDetailBody(selectedAgentIndex, rightWidth, height, rows);
886
- // Windowed the same way `renderRunBody` windows the flat agent list, so a run with more agents
887
- // than the pane has rows keeps the `›` cursor on screen instead of scrolling it off the top.
888
- const paddedLeft = padLines(windowAround(leftLines, height, this.runSelection, this.deps.theme), height);
950
+ const { lines: leftLines, lineForAgent } = this.runListLines(snapshot, rows, SPLIT_LEFT_WIDTH - 1);
951
+ const selected = rows[this.runSelection];
952
+ const rightLines = this.renderAgentDetailBody(selected?.i, rightWidth, height, rows, snapshot);
953
+ // Windowed the same way `renderRunBody` windows its list, so a run with more agents than the
954
+ // pane has rows keeps the `›` cursor on screen instead of scrolling it off the top.
955
+ const pivot = lineForAgent[this.runSelection] ?? 0;
956
+ const paddedLeft = padLines(windowAround(leftLines, height, pivot, this.deps.theme), height);
889
957
  const paddedRight = padLines(rightLines, height);
890
- return paddedLeft.map((line, idx) => `${padToWidth(line, SPLIT_LEFT_WIDTH)}│${paddedRight[idx] ?? ""}`);
958
+ const divider = this.deps.theme.fg("dim", "│");
959
+ return paddedLeft.map((line, idx) => `${padToWidth(line, SPLIT_LEFT_WIDTH)}${divider} ${paddedRight[idx] ?? ""}`);
891
960
  }
892
- renderAgentDetailBody(agentIndex, width, height, rows) {
893
- const footerFallback = this.agentHintLine();
961
+ /** `identityFrom` is set by the split view, whose border title names the run rather than the
962
+ * agent: the pane then opens with the agent's own title and status line. */
963
+ renderAgentDetailBody(agentIndex, width, height, rows, identityFrom) {
964
+ const footerFallback = this.agentHints();
894
965
  const contentHeight = Math.max(1, height - 1);
895
966
  if (agentIndex === undefined) {
896
967
  return [
@@ -906,6 +977,16 @@ export class PolyphaseInspector {
906
977
  ];
907
978
  }
908
979
  const header = [];
980
+ if (identityFrom) {
981
+ const status = this.agentStatusText(row);
982
+ header.push(columns([
983
+ {
984
+ text: this.deps.theme.bold(agentTitleText(row, this.phaseTitleOf(identityFrom, row))),
985
+ width: "flex",
986
+ },
987
+ { text: status, width: visibleWidth(status), align: "right" },
988
+ ], width));
989
+ }
909
990
  const modelLabel = formatModelLabel(row, { withProvider: true, withSource: true });
910
991
  const confirmText = row.modelConfirmed ? "confirmed" : "unconfirmed";
911
992
  const tokensText = row.tokens > 0 ? ` · ${formatTokens(row.tokens)} tok` : "";
@@ -915,7 +996,7 @@ export class PolyphaseInspector {
915
996
  header.push(oneLine(`${modelLabel} · ${confirmText} · ${turnsText} · ${toolsText}${tokensText}${costText}`));
916
997
  header.push(`task ${oneLine(row.task)}`);
917
998
  header.push("─".repeat(Math.max(0, width)));
918
- const footer = this.footerLine(this.agentHintLine(row.status), width);
999
+ const footer = this.footerLine(this.agentHints(row.status), width);
919
1000
  const transcript = this.currentAgentTranscriptFor(agentIndex);
920
1001
  if (!transcript) {
921
1002
  const OUTPUT_PREVIEW_MAX_LINES = 8;
@@ -979,30 +1060,30 @@ export class PolyphaseInspector {
979
1060
  const body = [...header, ...windowLines, ...followLine];
980
1061
  return [...padLines(body, contentHeight), footer];
981
1062
  }
982
- /** `width` is the same inner width the caller laid its body out to, so a hint line that does not
983
- * fit is ellipsised like every other row instead of being hard-cut by `sideLine`'s padding,
984
- * which carries no ellipsis of its own. */
985
- footerLine(hint, width) {
986
- return fitLine(this.footerNotice ? this.deps.theme.fg("warning", this.footerNotice) : hint, width);
1063
+ /** `width` is the same inner width the caller laid its body out to: hints that do not fit are
1064
+ * dropped by `fitHints`, and anything still too wide is ellipsised like every other row instead
1065
+ * of being hard-cut by `sideLine`'s padding, which carries no ellipsis of its own. */
1066
+ footerLine(hints, width) {
1067
+ return fitLine(this.footerNotice ? this.deps.theme.fg("warning", this.footerNotice) : fitHints(hints, width), width);
987
1068
  }
988
- runsHintLine() {
1069
+ runsHints() {
989
1070
  return [
990
1071
  combinedKeyHint(["tui.select.up", "tui.select.down"], "select"),
991
1072
  keyHint("tui.select.confirm", "open"),
992
1073
  keyHint("app.polyphase.cancelRun", "cancel run"),
993
1074
  keyHint("tui.select.cancel", "close"),
994
- ].join(" ");
1075
+ ];
995
1076
  }
996
- runHintLine() {
1077
+ runHints() {
997
1078
  return [
998
1079
  combinedKeyHint(["tui.select.up", "tui.select.down"], "select"),
999
1080
  keyHint("tui.select.confirm", "follow"),
1000
1081
  keyHint("app.polyphase.cancelAgent", "cancel agent"),
1001
1082
  keyHint("app.polyphase.cancelRun", "cancel run"),
1002
1083
  keyHint("tui.select.cancel", "back"),
1003
- ].join(" ");
1084
+ ];
1004
1085
  }
1005
- agentHintLine(status) {
1086
+ agentHints(status) {
1006
1087
  const finished = status !== undefined && isFinishedAgentStatus(status);
1007
1088
  return [
1008
1089
  keyHint("app.polyphase.nextAgent", "next agent"),
@@ -1010,7 +1091,7 @@ export class PolyphaseInspector {
1010
1091
  keyHint("app.thinking.toggle", "thinking"),
1011
1092
  ...(finished ? [] : [keyHint("app.polyphase.cancelAgent", "cancel")]),
1012
1093
  keyHint("tui.select.cancel", "back"),
1013
- ].join(" ");
1094
+ ];
1014
1095
  }
1015
1096
  }
1016
1097
  //# sourceMappingURL=inspector.js.map