@linxiraos/pi-tui 1.4.6 → 1.4.9

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 (399) hide show
  1. package/CHANGELOG.md +162 -244
  2. package/README.md +41 -35
  3. package/dist/types/app-keybindings.d.ts +20 -0
  4. package/dist/types/apps/session-picker.d.ts +5 -0
  5. package/dist/types/charts/chart-plan.d.ts +9 -7
  6. package/dist/types/charts/table-data.d.ts +4 -2
  7. package/dist/types/chat/assistant-message.d.ts +15 -3
  8. package/dist/types/chat/bash-execution.d.ts +6 -1
  9. package/dist/types/chat/display-preferences.d.ts +2 -0
  10. package/dist/types/chat/eval-execution.d.ts +2 -0
  11. package/dist/types/chat/execution-shared.d.ts +14 -8
  12. package/dist/types/chat/extension-types.d.ts +31 -0
  13. package/dist/types/chat/figure-markdown.d.ts +2 -0
  14. package/dist/types/chat/reply-write.d.ts +48 -0
  15. package/dist/types/chat/svg-figure.d.ts +5 -0
  16. package/dist/types/chat/table-chart.d.ts +6 -3
  17. package/dist/types/chat/tool-execution.d.ts +1 -2
  18. package/dist/types/chat/transcript-outline.d.ts +7 -0
  19. package/dist/types/chat/transcript-render-helpers.d.ts +13 -3
  20. package/dist/types/chrome/dynamic-border.d.ts +6 -0
  21. package/dist/types/chrome/index.d.ts +1 -0
  22. package/dist/types/chrome/transcript-notice.d.ts +35 -0
  23. package/dist/types/chrome/transcript-status.d.ts +21 -9
  24. package/dist/types/components/editor.d.ts +23 -6
  25. package/dist/types/components/image.d.ts +6 -0
  26. package/dist/types/components/loader.d.ts +2 -0
  27. package/dist/types/components/markdown.d.ts +7 -0
  28. package/dist/types/keybinding-matchers.d.ts +7 -0
  29. package/dist/types/native/blobs.d.ts +2 -1
  30. package/dist/types/native/describe.d.ts +4 -2
  31. package/dist/types/native/node.d.ts +2 -3
  32. package/dist/types/native/overlay.d.ts +42 -2
  33. package/dist/types/native/picker.d.ts +4 -4
  34. package/dist/types/native/state.d.ts +4 -0
  35. package/dist/types/overlays/annotation-overlay.d.ts +7 -1
  36. package/dist/types/overlays/annotation-types.d.ts +28 -0
  37. package/dist/types/overlays/btw-history-panel.d.ts +15 -0
  38. package/dist/types/overlays/btw-history.d.ts +24 -0
  39. package/dist/types/overlays/btw-inject.d.ts +22 -0
  40. package/dist/types/overlays/btw-panel.d.ts +7 -0
  41. package/dist/types/overlays/hook-editor.d.ts +2 -0
  42. package/dist/types/overlays/jobs-panel.d.ts +4 -0
  43. package/dist/types/overlays/login-dialog.d.ts +5 -1
  44. package/dist/types/overlays/model-browser.d.ts +11 -2
  45. package/dist/types/overlays/oauth-selector.d.ts +23 -0
  46. package/dist/types/overlays/plan-review-overlay.d.ts +2 -0
  47. package/dist/types/overlays/rewind-selector.d.ts +1 -1
  48. package/dist/types/overlays/session-selector.d.ts +33 -4
  49. package/dist/types/prompt/composer.d.ts +56 -5
  50. package/dist/types/prompt/interactive-context-helpers.d.ts +10 -3
  51. package/dist/types/render/extension-links.d.ts +65 -0
  52. package/dist/types/render/hyperlink.d.ts +25 -7
  53. package/dist/types/render/index.d.ts +1 -0
  54. package/dist/types/render/render-utils.d.ts +23 -1
  55. package/dist/types/setup/scenes/glyph.d.ts +1 -1
  56. package/dist/types/setup/scenes/model.d.ts +1 -1
  57. package/dist/types/setup/scenes/outro.d.ts +5 -4
  58. package/dist/types/setup/scenes/sign-in.d.ts +13 -8
  59. package/dist/types/setup/scenes/types.d.ts +16 -1
  60. package/dist/types/setup/startup-splash.d.ts +1 -1
  61. package/dist/types/setup/wizard-overlay.d.ts +11 -7
  62. package/dist/types/setup/wizard.d.ts +5 -1
  63. package/dist/types/status-line/component.d.ts +1 -1
  64. package/dist/types/status-line/context-usage.d.ts +28 -6
  65. package/dist/types/status-line/host.d.ts +6 -2
  66. package/dist/types/status-line/startup.d.ts +0 -15
  67. package/dist/types/terminal-capabilities.d.ts +1 -1
  68. package/dist/types/theme/symbols.d.ts +3 -1
  69. package/dist/types/theme/theme-class.d.ts +1 -0
  70. package/dist/types/theme/theme.d.ts +1 -24
  71. package/dist/types/theme/tui-adapters.d.ts +2 -0
  72. package/dist/types/thinking.d.ts +8 -6
  73. package/dist/types/tools/ast-grep.d.ts +2 -0
  74. package/dist/types/tools/bash-interactive.d.ts +6 -0
  75. package/dist/types/tools/bash.d.ts +2 -0
  76. package/dist/types/tools/default-renderer.d.ts +6 -4
  77. package/dist/types/tools/eval.d.ts +2 -0
  78. package/dist/types/tools/find.d.ts +1 -1
  79. package/dist/types/tools/grouped-file-output.d.ts +100 -19
  80. package/dist/types/tools/hashline-format.d.ts +5 -0
  81. package/dist/types/tools/irc.d.ts +6 -0
  82. package/dist/types/tools/json-tree.d.ts +23 -4
  83. package/dist/types/tools/lsp.d.ts +2 -0
  84. package/dist/types/tools/mcp.d.ts +6 -5
  85. package/dist/types/tools/native-view.d.ts +3 -1
  86. package/dist/types/tools/output-meta.d.ts +27 -0
  87. package/dist/types/tools/read.d.ts +14 -4
  88. package/dist/types/tools/renderer.d.ts +2 -0
  89. package/dist/types/tools/streaming-output.d.ts +11 -0
  90. package/dist/types/tools/task.d.ts +13 -4
  91. package/dist/types/tools/url-scheme-host.d.ts +17 -0
  92. package/dist/types/tools/wait.d.ts +2 -0
  93. package/dist/types/tools/yield.d.ts +1 -1
  94. package/dist/types/tui.d.ts +19 -2
  95. package/dist/types/utils.d.ts +4 -0
  96. package/package.json +10 -14
  97. package/src/app-keybindings.d.ts +20 -0
  98. package/src/app-keybindings.ts +20 -0
  99. package/src/apps/git/git-tui.ts +10 -17
  100. package/src/apps/git/sidebar.ts +21 -35
  101. package/src/apps/ps-top.ts +4 -12
  102. package/src/apps/session-picker.ts +7 -0
  103. package/src/charts/chart-plan.d.ts +9 -7
  104. package/src/charts/chart-plan.ts +20 -79
  105. package/src/charts/table-data.d.ts +4 -2
  106. package/src/charts/table-data.ts +55 -6
  107. package/src/chat/advisor-message.ts +2 -0
  108. package/src/chat/assistant-message.d.ts +15 -3
  109. package/src/chat/assistant-message.ts +137 -19
  110. package/src/chat/background-tan-message.ts +4 -0
  111. package/src/chat/bash-execution.d.ts +6 -1
  112. package/src/chat/bash-execution.ts +26 -9
  113. package/src/chat/chat-transcript-builder.ts +63 -30
  114. package/src/chat/compaction-summary-message.ts +2 -1
  115. package/src/chat/display-preferences.d.ts +2 -0
  116. package/src/chat/display-preferences.ts +3 -0
  117. package/src/chat/eval-execution.d.ts +2 -0
  118. package/src/chat/eval-execution.ts +14 -7
  119. package/src/chat/execution-shared.d.ts +14 -8
  120. package/src/chat/execution-shared.ts +39 -18
  121. package/src/chat/extension-types.d.ts +31 -0
  122. package/src/chat/extension-types.ts +34 -0
  123. package/src/chat/figure-markdown.d.ts +2 -0
  124. package/src/chat/figure-markdown.ts +6 -4
  125. package/src/chat/read-tool-group.ts +56 -36
  126. package/src/chat/reply-write.d.ts +48 -0
  127. package/src/chat/reply-write.ts +127 -0
  128. package/src/chat/svg-figure.d.ts +5 -0
  129. package/src/chat/svg-figure.ts +55 -16
  130. package/src/chat/table-chart.d.ts +6 -3
  131. package/src/chat/table-chart.ts +29 -6
  132. package/src/chat/tool-execution.d.ts +1 -2
  133. package/src/chat/tool-execution.ts +20 -13
  134. package/src/chat/transcript-outline.d.ts +7 -0
  135. package/src/chat/transcript-outline.ts +27 -0
  136. package/src/chat/transcript-render-helpers.d.ts +13 -3
  137. package/src/chat/transcript-render-helpers.ts +134 -44
  138. package/src/chrome/dynamic-border.d.ts +6 -0
  139. package/src/chrome/dynamic-border.ts +28 -2
  140. package/src/chrome/index.ts +1 -0
  141. package/src/chrome/transcript-notice.d.ts +35 -0
  142. package/src/chrome/transcript-notice.ts +83 -0
  143. package/src/chrome/transcript-status.d.ts +21 -9
  144. package/src/chrome/transcript-status.ts +32 -30
  145. package/src/components/editor.d.ts +23 -6
  146. package/src/components/editor.ts +133 -25
  147. package/src/components/image.d.ts +6 -0
  148. package/src/components/image.ts +13 -0
  149. package/src/components/key-value-list.ts +9 -9
  150. package/src/components/loader.d.ts +2 -0
  151. package/src/components/loader.ts +7 -0
  152. package/src/components/markdown.d.ts +7 -0
  153. package/src/components/markdown.ts +116 -6
  154. package/src/components/section.ts +1 -9
  155. package/src/components/table.ts +1 -9
  156. package/src/hotkeys-markdown.ts +1 -0
  157. package/src/keybinding-matchers.d.ts +7 -0
  158. package/src/keybinding-matchers.ts +13 -0
  159. package/src/native/backend.ts +10 -67
  160. package/src/native/blobs.d.ts +2 -1
  161. package/src/native/blobs.ts +3 -2
  162. package/src/native/describe.d.ts +4 -2
  163. package/src/native/describe.ts +9 -4
  164. package/src/native/node.d.ts +2 -3
  165. package/src/native/node.ts +2 -3
  166. package/src/native/overlay.d.ts +42 -2
  167. package/src/native/overlay.ts +124 -16
  168. package/src/native/picker.d.ts +4 -4
  169. package/src/native/picker.ts +4 -4
  170. package/src/native/state.d.ts +4 -0
  171. package/src/native/state.ts +25 -5
  172. package/src/overlays/advisor-config.ts +1 -10
  173. package/src/overlays/annotation-overlay.ts +125 -37
  174. package/src/overlays/annotation-types.ts +24 -0
  175. package/src/overlays/btw-history-panel.ts +106 -14
  176. package/src/overlays/btw-history.ts +65 -0
  177. package/src/overlays/btw-inject.ts +91 -0
  178. package/src/overlays/btw-panel.ts +53 -12
  179. package/src/overlays/extensions/extension-dashboard.ts +7 -8
  180. package/src/overlays/hook-editor.ts +6 -0
  181. package/src/overlays/hook-selector.ts +2 -2
  182. package/src/overlays/jobs-panel.ts +82 -22
  183. package/src/overlays/login-dialog.ts +39 -31
  184. package/src/overlays/mcp-add-wizard.ts +1 -1
  185. package/src/overlays/model-browser.ts +106 -10
  186. package/src/overlays/model-hub.ts +1 -7
  187. package/src/overlays/model-picker.ts +1 -10
  188. package/src/overlays/oauth-selector.ts +44 -6
  189. package/src/overlays/plan-review-overlay.ts +13 -2
  190. package/src/overlays/rewind-selector.ts +29 -12
  191. package/src/overlays/session-selector.ts +338 -47
  192. package/src/overlays/settings-defs.ts +2 -2
  193. package/src/overlays/tree-selector.ts +83 -27
  194. package/src/overlays/usage-dashboard.ts +9 -18
  195. package/src/prompt/composer.ts +233 -6
  196. package/src/prompt/custom-editor.ts +6 -1
  197. package/src/prompt/emoji-autocomplete.ts +0 -2
  198. package/src/prompt/interactive-context-helpers.ts +29 -4
  199. package/src/render/code-cell.ts +1 -1
  200. package/src/render/extension-links.d.ts +65 -0
  201. package/src/render/extension-links.ts +214 -0
  202. package/src/render/file-list.ts +4 -7
  203. package/src/render/hyperlink.d.ts +25 -7
  204. package/src/render/hyperlink.ts +65 -9
  205. package/src/render/index.d.ts +1 -0
  206. package/src/render/index.ts +1 -0
  207. package/src/render/render-utils.d.ts +23 -1
  208. package/src/render/render-utils.ts +38 -6
  209. package/src/setup/scenes/composer.ts +2 -0
  210. package/src/setup/scenes/glyph.ts +4 -2
  211. package/src/setup/scenes/model.ts +192 -29
  212. package/src/setup/scenes/outro.ts +33 -15
  213. package/src/setup/scenes/sign-in.ts +196 -400
  214. package/src/setup/scenes/theme.ts +2 -0
  215. package/src/setup/scenes/types.ts +18 -1
  216. package/src/setup/startup-splash.ts +8 -7
  217. package/src/setup/wizard-overlay.ts +164 -35
  218. package/src/setup/wizard.ts +11 -2
  219. package/src/status-line/component.ts +4 -10
  220. package/src/status-line/context-usage.ts +72 -21
  221. package/src/status-line/host.ts +6 -2
  222. package/src/status-line/startup.ts +36 -70
  223. package/src/terminal-capabilities.d.ts +1 -1
  224. package/src/terminal-capabilities.ts +5 -0
  225. package/src/terminal.ts +24 -2
  226. package/src/theme/defaults.json +1 -0
  227. package/src/theme/loader.ts +1 -1
  228. package/src/theme/symbols.d.ts +3 -1
  229. package/src/theme/symbols.ts +16 -9
  230. package/src/theme/theme-class.d.ts +1 -0
  231. package/src/theme/theme-class.ts +15 -3
  232. package/src/theme/theme.d.ts +1 -24
  233. package/src/theme/theme.ts +3 -75
  234. package/src/theme/tui-adapters.d.ts +2 -0
  235. package/src/theme/tui-adapters.ts +8 -3
  236. package/src/thinking.d.ts +8 -6
  237. package/src/thinking.ts +17 -11
  238. package/src/tmux.ts +1 -0
  239. package/src/tools/agent-tree.ts +13 -11
  240. package/src/tools/ask.ts +24 -37
  241. package/src/tools/ast-edit.ts +48 -93
  242. package/src/tools/ast-grep.d.ts +2 -0
  243. package/src/tools/ast-grep.ts +31 -67
  244. package/src/tools/bash-interactive.d.ts +49 -0
  245. package/src/tools/bash-interactive.ts +6 -1
  246. package/src/tools/bash.d.ts +2 -0
  247. package/src/tools/bash.ts +9 -0
  248. package/src/tools/default-renderer.d.ts +6 -4
  249. package/src/tools/default-renderer.ts +10 -7
  250. package/src/tools/edit.ts +50 -43
  251. package/src/tools/eval.d.ts +2 -0
  252. package/src/tools/eval.ts +16 -4
  253. package/src/tools/fetch.ts +2 -1
  254. package/src/tools/find.d.ts +1 -1
  255. package/src/tools/find.ts +13 -5
  256. package/src/tools/github.ts +14 -46
  257. package/src/tools/glob.ts +2 -1
  258. package/src/tools/grep.ts +47 -277
  259. package/src/tools/grouped-file-output.d.ts +100 -19
  260. package/src/tools/grouped-file-output.ts +414 -103
  261. package/src/tools/hashline-format.d.ts +5 -0
  262. package/src/tools/hashline-format.ts +5 -0
  263. package/src/tools/irc.d.ts +6 -0
  264. package/src/tools/irc.ts +6 -0
  265. package/src/tools/job-widget.ts +13 -1
  266. package/src/tools/json-tree.d.ts +23 -4
  267. package/src/tools/json-tree.ts +132 -46
  268. package/src/tools/lsp.d.ts +2 -0
  269. package/src/tools/lsp.ts +246 -47
  270. package/src/tools/mcp.d.ts +6 -5
  271. package/src/tools/mcp.ts +20 -12
  272. package/src/tools/native-view.d.ts +3 -1
  273. package/src/tools/native-view.ts +12 -6
  274. package/src/tools/output-meta.d.ts +27 -0
  275. package/src/tools/output-meta.ts +68 -4
  276. package/src/tools/proc-render.ts +3 -3
  277. package/src/tools/read.d.ts +14 -4
  278. package/src/tools/read.ts +20 -5
  279. package/src/tools/renderer.d.ts +2 -0
  280. package/src/tools/renderer.ts +2 -0
  281. package/src/tools/streaming-output.d.ts +11 -0
  282. package/src/tools/streaming-output.ts +41 -0
  283. package/src/tools/task.d.ts +13 -4
  284. package/src/tools/task.ts +100 -97
  285. package/src/tools/url-scheme-host.d.ts +17 -0
  286. package/src/tools/url-scheme-host.ts +21 -0
  287. package/src/tools/vibe.ts +4 -4
  288. package/src/tools/wait.d.ts +2 -0
  289. package/src/tools/wait.ts +8 -5
  290. package/src/tools/write.ts +17 -27
  291. package/src/tools/yield.d.ts +1 -1
  292. package/src/tools/yield.ts +19 -10
  293. package/src/tui.d.ts +19 -2
  294. package/src/tui.ts +134 -24
  295. package/src/utils.d.ts +4 -0
  296. package/src/utils.ts +10 -0
  297. package/dist/types/theme/defaults/index.d.ts +0 -10289
  298. package/src/theme/defaults/alabaster.json +0 -103
  299. package/src/theme/defaults/amethyst.json +0 -106
  300. package/src/theme/defaults/anthracite.json +0 -103
  301. package/src/theme/defaults/basalt.json +0 -101
  302. package/src/theme/defaults/birch.json +0 -105
  303. package/src/theme/defaults/dark-abyss.json +0 -101
  304. package/src/theme/defaults/dark-arctic.json +0 -114
  305. package/src/theme/defaults/dark-aurora.json +0 -105
  306. package/src/theme/defaults/dark-catppuccin.json +0 -117
  307. package/src/theme/defaults/dark-cavern.json +0 -101
  308. package/src/theme/defaults/dark-celestial.json +0 -116
  309. package/src/theme/defaults/dark-copper.json +0 -105
  310. package/src/theme/defaults/dark-cosmos.json +0 -100
  311. package/src/theme/defaults/dark-cyberpunk.json +0 -112
  312. package/src/theme/defaults/dark-dracula.json +0 -108
  313. package/src/theme/defaults/dark-eclipse.json +0 -101
  314. package/src/theme/defaults/dark-ember.json +0 -105
  315. package/src/theme/defaults/dark-equinox.json +0 -100
  316. package/src/theme/defaults/dark-forest.json +0 -106
  317. package/src/theme/defaults/dark-github.json +0 -115
  318. package/src/theme/defaults/dark-gruvbox.json +0 -122
  319. package/src/theme/defaults/dark-lavender.json +0 -105
  320. package/src/theme/defaults/dark-lunar.json +0 -99
  321. package/src/theme/defaults/dark-midnight.json +0 -105
  322. package/src/theme/defaults/dark-monochrome.json +0 -104
  323. package/src/theme/defaults/dark-monokai.json +0 -108
  324. package/src/theme/defaults/dark-nebula.json +0 -100
  325. package/src/theme/defaults/dark-neon-noir.json +0 -110
  326. package/src/theme/defaults/dark-nord.json +0 -108
  327. package/src/theme/defaults/dark-ocean.json +0 -111
  328. package/src/theme/defaults/dark-one.json +0 -110
  329. package/src/theme/defaults/dark-poimandres.json +0 -125
  330. package/src/theme/defaults/dark-rainforest.json +0 -101
  331. package/src/theme/defaults/dark-reef.json +0 -101
  332. package/src/theme/defaults/dark-retro.json +0 -102
  333. package/src/theme/defaults/dark-rose-pine.json +0 -106
  334. package/src/theme/defaults/dark-sakura.json +0 -105
  335. package/src/theme/defaults/dark-slate.json +0 -105
  336. package/src/theme/defaults/dark-solarized.json +0 -107
  337. package/src/theme/defaults/dark-solstice.json +0 -100
  338. package/src/theme/defaults/dark-starfall.json +0 -101
  339. package/src/theme/defaults/dark-sunset.json +0 -109
  340. package/src/theme/defaults/dark-swamp.json +0 -100
  341. package/src/theme/defaults/dark-synthwave.json +0 -113
  342. package/src/theme/defaults/dark-taiga.json +0 -101
  343. package/src/theme/defaults/dark-terminal.json +0 -105
  344. package/src/theme/defaults/dark-tokyo-night.json +0 -111
  345. package/src/theme/defaults/dark-tundra.json +0 -101
  346. package/src/theme/defaults/dark-twilight.json +0 -101
  347. package/src/theme/defaults/dark-volcanic.json +0 -101
  348. package/src/theme/defaults/graphite.json +0 -102
  349. package/src/theme/defaults/index.d.ts +0 -10289
  350. package/src/theme/defaults/index.ts +0 -203
  351. package/src/theme/defaults/light-arctic.json +0 -117
  352. package/src/theme/defaults/light-aurora-day.json +0 -101
  353. package/src/theme/defaults/light-canyon.json +0 -101
  354. package/src/theme/defaults/light-catppuccin.json +0 -116
  355. package/src/theme/defaults/light-cirrus.json +0 -100
  356. package/src/theme/defaults/light-coral.json +0 -105
  357. package/src/theme/defaults/light-cyberpunk.json +0 -106
  358. package/src/theme/defaults/light-dawn.json +0 -100
  359. package/src/theme/defaults/light-dunes.json +0 -101
  360. package/src/theme/defaults/light-eucalyptus.json +0 -105
  361. package/src/theme/defaults/light-forest.json +0 -110
  362. package/src/theme/defaults/light-frost.json +0 -105
  363. package/src/theme/defaults/light-github.json +0 -125
  364. package/src/theme/defaults/light-glacier.json +0 -101
  365. package/src/theme/defaults/light-gruvbox.json +0 -118
  366. package/src/theme/defaults/light-haze.json +0 -100
  367. package/src/theme/defaults/light-honeycomb.json +0 -105
  368. package/src/theme/defaults/light-lagoon.json +0 -101
  369. package/src/theme/defaults/light-lavender.json +0 -105
  370. package/src/theme/defaults/light-meadow.json +0 -101
  371. package/src/theme/defaults/light-mint.json +0 -105
  372. package/src/theme/defaults/light-monochrome.json +0 -111
  373. package/src/theme/defaults/light-ocean.json +0 -109
  374. package/src/theme/defaults/light-one.json +0 -109
  375. package/src/theme/defaults/light-opal.json +0 -101
  376. package/src/theme/defaults/light-orchard.json +0 -101
  377. package/src/theme/defaults/light-paper.json +0 -105
  378. package/src/theme/defaults/light-poimandres.json +0 -125
  379. package/src/theme/defaults/light-prism.json +0 -100
  380. package/src/theme/defaults/light-retro.json +0 -108
  381. package/src/theme/defaults/light-sand.json +0 -105
  382. package/src/theme/defaults/light-savanna.json +0 -101
  383. package/src/theme/defaults/light-solarized.json +0 -112
  384. package/src/theme/defaults/light-soleil.json +0 -100
  385. package/src/theme/defaults/light-sunset.json +0 -109
  386. package/src/theme/defaults/light-synthwave.json +0 -108
  387. package/src/theme/defaults/light-tokyo-night.json +0 -121
  388. package/src/theme/defaults/light-wetland.json +0 -101
  389. package/src/theme/defaults/light-zenith.json +0 -99
  390. package/src/theme/defaults/limestone.json +0 -104
  391. package/src/theme/defaults/mahogany.json +0 -107
  392. package/src/theme/defaults/marble.json +0 -103
  393. package/src/theme/defaults/obsidian.json +0 -101
  394. package/src/theme/defaults/onyx.json +0 -101
  395. package/src/theme/defaults/pearl.json +0 -103
  396. package/src/theme/defaults/porcelain.json +0 -101
  397. package/src/theme/defaults/quartz.json +0 -106
  398. package/src/theme/defaults/sandstone.json +0 -105
  399. package/src/theme/defaults/titanium.json +0 -100
@@ -9,7 +9,7 @@ import { renderStatusLine, type StatusLineOptions } from "../render/status-line"
9
9
  import { plainToolCard, type ToolCardPhase } from "../render/tool-card";
10
10
  import { clipCollapsed } from "../render/render-utils";
11
11
  import {
12
- describeJsonTree,
12
+ describeJsonValue,
13
13
  formatArgsInline,
14
14
  JSON_TREE_MAX_DEPTH_COLLAPSED,
15
15
  JSON_TREE_MAX_DEPTH_EXPANDED,
@@ -51,7 +51,7 @@ function buildDefaultToolStatus(input: DefaultToolRenderInput): { status: Status
51
51
  ? "info"
52
52
  : result?.isError
53
53
  ? "error"
54
- : "done",
54
+ : "success",
55
55
  spinnerFrame: options.spinnerFrame,
56
56
  title: input.label,
57
57
  };
@@ -186,10 +186,12 @@ const NATIVE_ARGS_SUMMARY_CHARS = 160;
186
186
 
187
187
  /**
188
188
  * TSP view of the generic fallback card: the tool label with a one-line args
189
- * summary as the head target; the result as a JSON tree or raw `ansi` output.
190
- * The complete output goes over the wire — the card-level disclosure clamp the
191
- * terminal applies is the only bound, so an expanded card keeps every row. JSON
192
- * the tree's depth, node or scalar caps would cut keeps the raw path instead.
189
+ * summary as the head target; the result as JSON (the host's `json` viewer,
190
+ * else a JSON tree) or raw `ansi` output. The complete output goes over the
191
+ * wire — the card-level disclosure clamp the terminal applies is the only
192
+ * bound, so an expanded card keeps every row. The `json` viewer never cuts;
193
+ * JSON the fallback tree's depth, node or scalar caps would cut keeps the raw
194
+ * path instead.
193
195
  */
194
196
  export function describeDefaultToolExecution(input: DefaultToolRenderInput): NativeToolView {
195
197
  const { result } = input;
@@ -212,7 +214,8 @@ export function describeDefaultToolExecution(input: DefaultToolRenderInput): Nat
212
214
  }
213
215
  if (parsed !== undefined) {
214
216
  let truncated = false;
215
- const tree = describeJsonTree(parsed, {
217
+ const tree = describeJsonValue(parsed, {
218
+ native: input.options.json,
216
219
  // A result's own `i` or `__partialJson` keys are data, not call metadata.
217
220
  hiddenRootKeys: [],
218
221
  onTruncated: () => {
package/src/tools/edit.ts CHANGED
@@ -45,7 +45,13 @@ import {
45
45
  import type { ToolActivityContext, ToolActivitySummary } from "./renderer";
46
46
  import { fileHyperlink, Hasher, type RenderCache, renderStatusLine, truncateToWidth, WidthAwareText } from "../render";
47
47
  import { framedToolCard } from "../render/tool-card";
48
- import { HL_FILE_PREFIX, HL_FILE_SUFFIX, HL_MOVE_KEYWORD, HL_REM_KEYWORD } from "./hashline-format";
48
+ import {
49
+ HASHLINE_TAG_SUFFIX_RE,
50
+ HL_FILE_PREFIX,
51
+ HL_FILE_SUFFIX,
52
+ HL_MOVE_KEYWORD,
53
+ HL_REM_KEYWORD,
54
+ } from "./hashline-format";
49
55
 
50
56
  /** Edit payload syntax selected by the caller. */
51
57
  export type EditMode = "replace" | "patch" | "hashline" | "apply_patch" | "sloppy";
@@ -354,7 +360,8 @@ function renderEditHeader(
354
360
  width: number,
355
361
  uiTheme: Theme,
356
362
  options: {
357
- icon?: "pending" | "success" | "error";
363
+ icon?: "pending" | "running" | "success" | "error";
364
+ spinnerFrame?: number;
358
365
  iconOverride?: string;
359
366
  op?: Operation;
360
367
  rawPath: string;
@@ -380,6 +387,7 @@ function renderEditHeader(
380
387
  renderStatusLine(
381
388
  {
382
389
  icon: options.icon,
390
+ spinnerFrame: options.spinnerFrame,
383
391
  iconOverride: options.iconOverride,
384
392
  title,
385
393
  description,
@@ -546,8 +554,6 @@ function formatStreamingDiff(
546
554
  width: number,
547
555
  uiTheme: Theme,
548
556
  expanded: boolean,
549
- label = "streaming",
550
- spinnerFrame?: number,
551
557
  cache?: RenderedStringCache,
552
558
  ): string {
553
559
  if (!diff) return "";
@@ -564,7 +570,7 @@ function formatStreamingDiff(
564
570
  // innerWidth/budget are in the cache salt so a resize re-slices.
565
571
  const innerWidth = Math.max(1, width - 2);
566
572
  const budget = expanded ? previewWindowRows() : Math.min(PREVIEW_LIMITS.EXPANDED_LINES, previewWindowRows());
567
- let text = cachedRenderedString(cache, uiTheme, expanded, `${rawPath}:${innerWidth}:${budget}`, diff, () => {
573
+ return cachedRenderedString(cache, uiTheme, expanded, `${rawPath}:${innerWidth}:${budget}`, diff, () => {
568
574
  // "Cursor" tail window: pin the last rows to the bottom so freshly streamed
569
575
  // changes stay on screen. The whole-file diff is recomputed every chunk and
570
576
  // its Myers alignment is not monotonic in payload length, so a hunk-aware
@@ -580,18 +586,6 @@ function formatStreamingDiff(
580
586
  rendered += renderDiffColored(tail.content, { filePath: rawPath, theme: uiTheme });
581
587
  return rendered;
582
588
  });
583
- // The animated glyph rides this trailing line — inside the transcript's
584
- // volatile-tail holdback — never the block header: an animating head row
585
- // pins the native-scrollback commit boundary at the top of the block, so a
586
- // tall expanded preview could never scroll-append mid-stream.
587
- const spinner = spinnerFrame !== undefined ? `${formatStatusIcon("running", uiTheme, spinnerFrame)} ` : "";
588
- // Expanded approval previews hide the "(preview)" label (#1992) but keep
589
- // the animated glyph when one is active so the volatile tail stays live.
590
- const hideLabel = expanded && label === "preview";
591
- if (spinner || !hideLabel) {
592
- text += `\n${hideLabel ? spinner.trimEnd() : `${spinner}${uiTheme.fg("dim", `(${label})`)}`}`;
593
- }
594
- return text;
595
589
  }
596
590
 
597
591
  function formatMultiFileStreamingDiff(
@@ -599,7 +593,6 @@ function formatMultiFileStreamingDiff(
599
593
  width: number,
600
594
  uiTheme: Theme,
601
595
  expanded: boolean,
602
- spinnerFrame?: number,
603
596
  caches?: RenderedStringCache[],
604
597
  ): string {
605
598
  const parts: string[] = [];
@@ -612,19 +605,19 @@ function formatMultiFileStreamingDiff(
612
605
  continue;
613
606
  }
614
607
  if (preview.diff) {
615
- // Only the last file's preview carries the animated streaming glyph;
616
- // earlier files have settled and must stay byte-stable so their rows
617
- // can commit to native scrollback mid-stream.
618
- const isLast = index === previews.length - 1;
619
608
  const cache = previewCacheAt(caches, index);
620
- parts.push(
621
- `${header}${formatStreamingDiff(preview.diff, preview.path, width, uiTheme, expanded, "preview", isLast ? spinnerFrame : undefined, cache)}`,
622
- );
609
+ parts.push(`${header}${formatStreamingDiff(preview.diff, preview.path, width, uiTheme, expanded, cache)}`);
623
610
  }
624
611
  }
625
612
  return parts.join("");
626
613
  }
627
614
 
615
+ /** A call's streamed preview body, and the label its card shows in the bottom border. */
616
+ interface CallPreview {
617
+ text: string;
618
+ footer?: "preview" | "streaming";
619
+ }
620
+
628
621
  function getCallPreview(
629
622
  args: EditRenderArgs,
630
623
  rawPath: string,
@@ -632,41 +625,49 @@ function getCallPreview(
632
625
  uiTheme: Theme,
633
626
  renderContext: EditRenderContext | undefined,
634
627
  expanded: boolean,
635
- spinnerFrame?: number,
636
628
  caches?: RenderedStringCache[],
637
- ): string {
629
+ ): CallPreview {
638
630
  const multi = renderContext?.perFileDiffPreview;
639
631
  if (multi && multi.length > 1 && multi.some(p => p.diff || p.error)) {
640
- return formatMultiFileStreamingDiff(multi, width, uiTheme, expanded, spinnerFrame, caches);
632
+ return {
633
+ text: formatMultiFileStreamingDiff(multi, width, uiTheme, expanded, caches),
634
+ footer: multi.some(p => p.diff) ? "preview" : undefined,
635
+ };
641
636
  }
642
637
  const cache = previewCacheAt(caches, 0);
643
638
  if (args.previewDiff) {
644
- return formatStreamingDiff(args.previewDiff, rawPath, width, uiTheme, expanded, "preview", spinnerFrame, cache);
639
+ return {
640
+ text: formatStreamingDiff(args.previewDiff, rawPath, width, uiTheme, expanded, cache),
641
+ footer: "preview",
642
+ };
645
643
  }
646
644
  if (args.diff && args.op) {
647
- return formatStreamingDiff(args.diff, rawPath, width, uiTheme, expanded, "streaming", spinnerFrame, cache);
645
+ return { text: formatStreamingDiff(args.diff, rawPath, width, uiTheme, expanded, cache), footer: "streaming" };
648
646
  }
649
647
  if (args.diff) {
650
- return renderPlainTextPreview(args.diff, uiTheme, rawPath);
648
+ return { text: renderPlainTextPreview(args.diff, uiTheme, rawPath) };
651
649
  }
652
650
  if (args.newText || args.patch) {
653
- return renderPlainTextPreview(args.newText ?? args.patch ?? "", uiTheme, rawPath);
651
+ return { text: renderPlainTextPreview(args.newText ?? args.patch ?? "", uiTheme, rawPath) };
654
652
  }
655
653
  if (renderContext?.editStreamingFallback) {
656
- return renderContext.editStreamingFallback;
654
+ return { text: renderContext.editStreamingFallback };
657
655
  }
658
656
  const contextPreview = renderContext?.editDiffPreview;
659
657
  if (contextPreview && "error" in contextPreview && contextPreview.error) {
660
- return uiTheme.fg("error", replaceTabs(contextPreview.error));
658
+ return { text: uiTheme.fg("error", replaceTabs(contextPreview.error)) };
661
659
  }
662
- return "";
660
+ return { text: "" };
663
661
  }
664
662
 
665
663
  const MISSING_APPLY_PATCH_END_ERROR = "The last line of the patch must be '*** End Patch'";
666
664
 
665
+ /** A model-typed `[path#tag]` header may spell the tag in lowercase. */
666
+ const TYPED_TAG_SUFFIX_RE = new RegExp(HASHLINE_TAG_SUFFIX_RE.source, "i");
667
+
667
668
  function normalizeHashlineInputPreviewPath(rawPath: string): string {
668
669
  const trimmed = rawPath.trim();
669
- const hashStart = /#[0-9a-fA-F]{4}$/u.exec(trimmed)?.index;
670
+ const hashStart = TYPED_TAG_SUFFIX_RE.exec(trimmed)?.index;
670
671
  const withoutHash = hashStart === undefined ? trimmed : trimmed.slice(0, hashStart);
671
672
  if (withoutHash.length < 2) return withoutHash;
672
673
  const first = withoutHash[0];
@@ -1143,34 +1144,40 @@ export const editToolRenderer = {
1143
1144
  return framedToolCard(
1144
1145
  uiTheme,
1145
1146
  ({ width }) => {
1146
- // No status icon on the head row: it's the head of the framed block,
1147
- // and native-scrollback commits are prefix-only — an animated glyph
1148
- // would pin the commit boundary at the top, and the pending hourglass
1149
- // just adds noise. The liveness cue rides the trailing "(preview)" /
1150
- // "(streaming)" line instead.
1147
+ // Only a live spinner fills the icon slot: a pending hourglass after it
1148
+ // stops would read as a step backwards while the edit executes.
1151
1149
  const header = renderEditHeader(width, uiTheme, {
1150
+ icon: options.spinnerFrame === undefined ? undefined : "running",
1151
+ spinnerFrame: options.spinnerFrame,
1152
1152
  op,
1153
1153
  rawPath,
1154
1154
  rename,
1155
1155
  extraSuffix: fileCount > 1 ? uiTheme.fg("dim", ` (+${fileCount - 1} more)`) : undefined,
1156
1156
  });
1157
- let body = getCallPreview(
1157
+ const preview = getCallPreview(
1158
1158
  editArgs,
1159
1159
  rawPath,
1160
1160
  width,
1161
1161
  uiTheme,
1162
1162
  renderContext,
1163
1163
  options.expanded,
1164
- options?.spinnerFrame,
1165
1164
  callPreviewCaches,
1166
1165
  );
1166
+ let body = preview.text;
1167
1167
  if (applyPatchError) {
1168
1168
  body += `\n${uiTheme.fg("error", truncateToWidth(replaceTabs(applyPatchError), Math.max(1, width - 2)))}`;
1169
1169
  }
1170
1170
  const bodyLines = body ? body.split("\n") : [];
1171
1171
  while (bodyLines.length > 0 && bodyLines[0].trim() === "") bodyLines.shift();
1172
+ // Expanded approval previews hide the "preview" label (#1992); "streaming" ends with the args.
1173
+ const footer =
1174
+ (preview.footer === "preview" && options.expanded) ||
1175
+ (preview.footer === "streaming" && options.argsComplete)
1176
+ ? undefined
1177
+ : preview.footer;
1172
1178
  return {
1173
1179
  header,
1180
+ footerMeta: footer ? uiTheme.fg("dim", footer) : undefined,
1174
1181
  sections:
1175
1182
  bodyLines.length > 0
1176
1183
  ? [{ content: bodyLines.flatMap(line => wrapEditRendererLine(line, Math.max(1, width - 2))) }]
@@ -71,6 +71,8 @@ export interface EvalToolDetails {
71
71
  statusEvents?: EvalStatusEvent[];
72
72
  /** Evictable events dropped from the front of `statusEvents` (see {@link recordStatusEvent}). */
73
73
  statusEventsElided?: number;
74
+ /** Text the cell's tool calls sent to `out://`, oldest first; transcripts draw each as a reply after the call. */
75
+ replies?: string[];
74
76
  isError?: boolean;
75
77
  meta?: OutputMeta;
76
78
  /** First backend that produced cells. Kept for transcript compatibility. */
package/src/tools/eval.ts CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  JSON_TREE_MAX_LINES_EXPANDED,
32
32
  JSON_TREE_SCALAR_LEN_COLLAPSED,
33
33
  JSON_TREE_SCALAR_LEN_EXPANDED,
34
- describeJsonTree,
34
+ describeJsonValue,
35
35
  renderJsonTreeLines,
36
36
  } from "./json-tree";
37
37
  import { formatStyledTruncationWarning, stripOutputNotice } from "./output-meta";
@@ -120,6 +120,8 @@ export interface EvalToolDetails {
120
120
  statusEvents?: EvalStatusEvent[];
121
121
  /** Evictable events dropped from the front of `statusEvents` (see {@link recordStatusEvent}). */
122
122
  statusEventsElided?: number;
123
+ /** Text the cell's tool calls sent to `out://`, oldest first; transcripts draw each as a reply after the call. */
124
+ replies?: string[];
123
125
  isError?: boolean;
124
126
  meta?: OutputMeta;
125
127
  /** First backend that produced cells. Kept for transcript compatibility. */
@@ -820,11 +822,14 @@ function evalTableNode(view: Extract<EvalView, { kind: "table" }>, key: string):
820
822
  /**
821
823
  * One cell's outputs in order: printed text (following its tail, clamped to
822
824
  * the last `previewLines` while folded) with each view in place of its text.
825
+ * A json view is the host's own JSON viewer (`json`), top-level entries
826
+ * listed and containers folded, when it draws the kind; else a JSON tree.
823
827
  */
824
828
  function evalOutputNodes(
825
829
  output: string,
826
830
  views: readonly EvalViewEntry[] | undefined,
827
831
  previewLines: number,
832
+ json: boolean,
828
833
  ): NativeNode[] {
829
834
  if (output.trim().length === 0) return [];
830
835
  return splitEvalOutput(output, views).map((part, i) => {
@@ -837,7 +842,9 @@ function evalOutputNodes(
837
842
  }
838
843
  const view = part.view;
839
844
  if (view.kind === "table") return evalTableNode(view, `table-${i}`);
840
- if (view.kind === "json") return keyed(describeJsonTree(view.value, { hiddenRootKeys: [] }), `json-${i}`);
845
+ if (view.kind === "json") {
846
+ return keyed(describeJsonValue(view.value, { native: json, hiddenRootKeys: [] }), `json-${i}`);
847
+ }
841
848
  return keyed(md(view.text), `markdown-${i}`);
842
849
  });
843
850
  }
@@ -1307,7 +1314,7 @@ export const evalToolRenderer = {
1307
1314
  language,
1308
1315
  code: formatEvalCodeForDisplay(cell.code, language),
1309
1316
  title: cell.title,
1310
- outputs: [...evalOutputNodes(cell.output, cell.views, previewLines)],
1317
+ outputs: [...evalOutputNodes(cell.output, cell.views, previewLines, options.json === true)],
1311
1318
  status: evalStatusSection(cell, expanded),
1312
1319
  foot: state && {
1313
1320
  state,
@@ -1332,7 +1339,12 @@ export const evalToolRenderer = {
1332
1339
  const rawOutput = options.renderContext?.output ?? resultText(result).trimEnd();
1333
1340
  const state: RunState = cancelled ? "cancelled" : isPartial ? "running" : result.isError ? "failed" : "done";
1334
1341
  const last: Omit<EvalCellRun, "language" | "code" | "title"> = {
1335
- outputs: evalOutputNodes(stripOutputNotice(rawOutput, details?.meta).trimEnd(), undefined, previewLines),
1342
+ outputs: evalOutputNodes(
1343
+ stripOutputNotice(rawOutput, details?.meta).trimEnd(),
1344
+ undefined,
1345
+ previewLines,
1346
+ options.json === true,
1347
+ ),
1336
1348
  status: evalStatusSection(details ?? {}, expanded),
1337
1349
  foot: { state, elapsedMs: options.elapsedMs, ...callFacts },
1338
1350
  };
@@ -14,6 +14,7 @@ import { framedToolCard } from "../render/tool-card";
14
14
  import {
15
15
  formatExpandHint,
16
16
  formatMoreItems,
17
+ formatStatusIcon,
17
18
  getDomain,
18
19
  PREVIEW_LIMITS,
19
20
  sanitizeDisplayLines,
@@ -274,7 +275,7 @@ export function renderReadUrlResult(
274
275
  metadataLines.push(`${uiTheme.fg("muted", "Lines:")} ${lineLabel}`);
275
276
  metadataLines.push(`${uiTheme.fg("muted", "Chars:")} ${charCount}`);
276
277
  if (truncated) {
277
- metadataLines.push(uiTheme.fg("warning", `${uiTheme.status.warning} Output truncated`));
278
+ metadataLines.push(`${formatStatusIcon("warning", uiTheme)} ${uiTheme.fg("warning", "Output truncated")}`);
278
279
  if (truncation?.artifactId) metadataLines.push(formatStyledArtifactReference(truncation.artifactId, uiTheme));
279
280
  }
280
281
  if (hasNotes) {
@@ -1,4 +1,4 @@
1
- import type { Theme } from "../theme/theme";
1
+ import { type Theme } from "../theme/theme";
2
2
  import type { Component } from "../tui";
3
3
  import type { OutputMeta } from "./output-meta";
4
4
  import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer";
package/src/tools/find.ts CHANGED
@@ -10,14 +10,17 @@ import { Text } from "../components/text";
10
10
  import { fileHyperlink, getTreeBranch, renderStatusLine, renderTreeList, uriHyperlink } from "../render";
11
11
  import {
12
12
  createCachedComponent,
13
+ FILE_NAME_COLOR,
13
14
  fitHeaderedRows,
14
15
  formatCount,
15
16
  formatEmptyMessage,
16
17
  formatErrorMessage,
18
+ formatStyledPath,
17
19
  PREVIEW_LIMITS,
18
20
  replaceTabs,
19
21
  } from "../render/render-utils";
20
- import type { Theme, ThemeColor } from "../theme/theme";
22
+ import { getLanguageFromPath } from "../lang-from-path";
23
+ import { highlightCode, isHighlightLanguage, type Theme, type ThemeColor } from "../theme/theme";
21
24
  import type { Component } from "../tui";
22
25
  import type { OutputMeta } from "./output-meta";
23
26
  import type {
@@ -167,14 +170,19 @@ function renderHit(hit: FindHit, rangeLimit: number, cwd: string | undefined, ra
167
170
  return absPath === undefined ? text : fileHyperlink(absPath, text, { line });
168
171
  };
169
172
  const coverage = hit.truncated ? `${hit.linesSeen} lines judged, partial` : `${hit.linesSeen} lines judged`;
170
- const lines = [
171
- `${gauge(hit.contentScore, theme)} ${theme.fg(scoreColor(hit.contentScore), hit.contentScore.toFixed(2))} ${link(theme.fg("accent", hit.rel))} ${theme.fg("dim", coverage)}`,
172
- ];
173
+ // URL hits show whole in the file-name color; file hits get the dim directory.
174
+ const label = isUrlHit ? theme.fg(FILE_NAME_COLOR, hit.rel) : formatStyledPath(hit.rel, theme);
175
+ const score = theme.fg(scoreColor(hit.contentScore), hit.contentScore.toFixed(2));
176
+ const lines = [`${gauge(hit.contentScore, theme)} ${score} ${link(label)} ${theme.fg("dim", coverage)}`];
173
177
  const ranges = [...hit.ranges].sort((a, b) => b.p - a.p || a.start - b.start).slice(0, rangeLimit);
178
+ const lang = getLanguageFromPath(hit.rel);
174
179
  ranges.forEach((range, index) => {
175
180
  const span = range.start === range.end ? String(range.start) : `${range.start}-${range.end}`;
176
181
  const ref = link(theme.fg("muted", `:${span}`), range.start);
177
- const snippet = theme.fg("toolOutput", replaceTabs(range.snippet.trim()));
182
+ const source = replaceTabs(range.snippet.trim());
183
+ const snippet = isHighlightLanguage(lang)
184
+ ? highlightCode(source, lang, theme).join("\n")
185
+ : theme.fg("toolOutput", source);
178
186
  const branch = theme.fg("dim", getTreeBranch(index === ranges.length - 1, theme));
179
187
  lines.push(` ${branch} ${ref} ${theme.fg("dim", range.p.toFixed(2))} ${snippet}`);
180
188
  });
@@ -18,7 +18,6 @@ import {
18
18
  formatStatusIcon,
19
19
  PREVIEW_LIMITS,
20
20
  replaceTabs,
21
- type ToolUIColor,
22
21
  type ToolUIStatus,
23
22
  TRUNCATE_LENGTHS,
24
23
  sanitizeDisplayWarning,
@@ -165,52 +164,22 @@ function formatRunLine(run: GhRunWatchRunDetails, theme: Theme): string {
165
164
  return [title, ...meta].join(" ");
166
165
  }
167
166
 
168
- function getJobStateVisual(
169
- job: GhRunWatchJobDetails,
170
- theme: Theme,
171
- ): { iconRaw: string; iconColor: ToolUIColor; textColor: ThemeColor } {
172
- if (job.conclusion && SUCCESS_CONCLUSIONS.has(job.conclusion)) {
173
- return {
174
- iconRaw: theme.status.success,
175
- iconColor: "accent",
176
- textColor: "success",
177
- };
178
- }
179
-
180
- if (job.conclusion && FAILURE_CONCLUSIONS.has(job.conclusion)) {
181
- return {
182
- iconRaw: theme.status.error,
183
- iconColor: "error",
184
- textColor: "error",
185
- };
186
- }
187
-
188
- if (job.status && RUNNING_STATUSES.has(job.status)) {
189
- return {
190
- iconRaw: theme.status.enabled,
191
- iconColor: "warning",
192
- textColor: "warning",
193
- };
194
- }
195
-
196
- if (job.status && PENDING_STATUSES.has(job.status)) {
197
- return {
198
- iconRaw: theme.status.shadowed,
199
- iconColor: "muted",
200
- textColor: "muted",
201
- };
202
- }
203
-
204
- return {
205
- iconRaw: theme.status.shadowed,
206
- iconColor: "muted",
207
- textColor: "muted",
208
- };
167
+ function getJobStateVisual(job: GhRunWatchJobDetails, theme: Theme): { icon: string; textColor: ThemeColor } {
168
+ if (job.conclusion && SUCCESS_CONCLUSIONS.has(job.conclusion))
169
+ return { icon: formatStatusIcon("success", theme), textColor: "success" };
170
+ if (job.conclusion && FAILURE_CONCLUSIONS.has(job.conclusion))
171
+ return { icon: formatStatusIcon("error", theme), textColor: "error" };
172
+ if (job.status && RUNNING_STATUSES.has(job.status))
173
+ return { icon: formatStatusIcon("running", theme), textColor: "warning" };
174
+ if (job.status && PENDING_STATUSES.has(job.status))
175
+ return { icon: formatStatusIcon("pending", theme), textColor: "muted" };
176
+ // An unrecognized state (e.g. a finished job with a new conclusion) claims neither queued nor settled.
177
+ return { icon: theme.styledSymbol("status.shadowed", "muted"), textColor: "muted" };
209
178
  }
210
179
 
211
180
  function renderJobLine(job: GhRunWatchJobDetails, width: number, theme: Theme): string {
212
181
  const visual = getJobStateVisual(job, theme);
213
- const prefix = theme.fg(visual.iconColor, `${visual.iconRaw} `);
182
+ const prefix = `${visual.icon} `;
214
183
  const durationLabel = job.durationSeconds !== undefined ? `${job.durationSeconds}s` : undefined;
215
184
  const styledDuration = durationLabel ? theme.fg(visual.textColor, durationLabel) : undefined;
216
185
  const reservedWidth = visibleWidth(prefix) + (styledDuration ? 1 + visibleWidth(styledDuration) : 0);
@@ -255,9 +224,8 @@ function renderFailedLogs(
255
224
  const lines: string[] = [];
256
225
  for (const entry of failedLogs) {
257
226
  const context = entry.workflowName ? `${entry.workflowName} #${entry.runId}` : `run #${entry.runId}`;
258
- lines.push(
259
- theme.fg("error", `${theme.status.error} ${replaceTabs(entry.jobName)} ${theme.fg("muted", context)}`),
260
- );
227
+ const jobName = theme.fg("error", replaceTabs(entry.jobName));
228
+ lines.push(`${formatStatusIcon("error", theme)} ${jobName} ${theme.fg("muted", context)}`);
261
229
 
262
230
  if (!entry.available || !entry.tail) {
263
231
  lines.push(theme.fg("dim", truncateVisualWidth(` ${formatUnavailableLog(entry)}`, Math.max(8, width))));
package/src/tools/glob.ts CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  formatCount,
23
23
  formatEmptyMessage,
24
24
  formatErrorMessage,
25
+ formatStyledPath,
25
26
  PREVIEW_LIMITS,
26
27
  } from "../render/render-utils";
27
28
  import { formatFullOutputReference } from "./output-meta";
@@ -202,7 +203,7 @@ export const globToolRenderer = {
202
203
  expanded: options.expanded,
203
204
  maxCollapsed: PREVIEW_LIMITS.COLLAPSED_ITEMS,
204
205
  itemType: "file",
205
- renderItem: line => uiTheme.fg("accent", line),
206
+ renderItem: line => formatStyledPath(line, uiTheme),
206
207
  },
207
208
  uiTheme,
208
209
  );