@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
@@ -3,6 +3,7 @@ import { replaceTabs } from "../render/render-utils";
3
3
  import { theme } from "../theme";
4
4
  import type { TranscriptBlock } from "../chrome/transcript-container";
5
5
  import { TranscriptStatusBlock } from "../chrome/transcript-status";
6
+ import { span } from "../native/describe";
6
7
 
7
8
  const TAN_WORK_PREVIEW_LENGTH = 56;
8
9
 
@@ -22,6 +23,8 @@ export function createBackgroundTanDispatchBlock(message: CustomMessage<unknown>
22
23
  const details = (message as CustomMessage<Partial<BackgroundTanDispatchDetails>>).details;
23
24
  const jobId = details?.jobId ?? "unknown";
24
25
  const work = details?.work ? previewWork(details.work) : undefined;
26
+ const spans = [span("Tangent dispatched"), span(" · ", "dim"), span(`task ${jobId}`, "dim")];
27
+ if (work) spans.push(span(" · ", "dim"), span(work, "dim"));
25
28
  return new TranscriptStatusBlock([
26
29
  {
27
30
  parts: [
@@ -30,6 +33,7 @@ export function createBackgroundTanDispatchBlock(message: CustomMessage<unknown>
30
33
  { text: jobId, color: "accent" },
31
34
  work ? { text: `${theme.format.dash} ${work}`, color: "dim" } : undefined,
32
35
  ],
36
+ native: { tone: "info", icon: "output", message: spans },
33
37
  },
34
38
  ]);
35
39
  }
@@ -4,7 +4,7 @@
4
4
  import type { ImageContent } from "@linxiraos/pi-ai";
5
5
  import { Container, type TUI } from "../tui";
6
6
  import type { OutputArtifactError } from "../tools/streaming-output";
7
- import type { TruncationMeta } from "../tools/output-meta";
7
+ import type { MinimizedMeta, TruncationMeta } from "../tools/output-meta";
8
8
  import { type DescribeContext, type NativeNode, type NativeUiEvent } from "../native/node";
9
9
  /** PTY size for `!` commands: the execution frame's inner content area. */
10
10
  export declare function bashPtyViewport(ui: TUI): {
@@ -37,13 +37,18 @@ export declare class BashExecutionComponent extends Container {
37
37
  appendOutput(chunk: string): void;
38
38
  /** Switch to PTY rendering and feed raw terminal bytes through the vterm replay. */
39
39
  appendPtyChunk(chunk: string): void;
40
+ /** Bytes a terminal would send for a key event, honoring the command's cursor-key mode; "" for key releases. */
41
+ encodePtyInput(data: string): string;
40
42
  setComplete(exitCode: number | undefined, cancelled: boolean, options?: {
41
43
  output?: string;
42
44
  truncation?: TruncationMeta;
43
45
  artifactError?: OutputArtifactError;
46
+ minimized?: MinimizedMeta;
44
47
  images?: readonly ImageContent[];
45
48
  showImages?: boolean;
46
49
  }): void;
50
+ /** The loader animates the bottom border from outside the child tree, so teardown stops it here. */
51
+ dispose(): void;
47
52
  render(width: number): readonly string[];
48
53
  /**
49
54
  * Get the raw output for creating BashExecutionMessage.
@@ -12,10 +12,11 @@ import { sanitizeText } from "@linxiraos/pi-utils";
12
12
  import type { Terminal as XtermTerminalType } from "@linxiraos/pi-utils/vterm";
13
13
  import { theme } from "../theme/theme";
14
14
  import type { OutputArtifactError } from "../tools/streaming-output";
15
- import type { TruncationMeta } from "../tools/output-meta";
15
+ import type { MinimizedMeta, TruncationMeta } from "../tools/output-meta";
16
16
  import { resolveImageOptions } from "../render/render-utils";
17
17
  import { OutputPane } from "../render/output-pane";
18
18
  import { loadXtermTerminal, readTerminalRows, styleTerminalRow } from "../tools/terminal-output";
19
+ import { normalizeInputForPty } from "../tools/bash-interactive";
19
20
  import { getSixelLineMask, isSixelPassthroughEnabled, sanitizeWithOptionalSixelPassthrough } from "../render/sixel";
20
21
  import {
21
22
  buildExecutionFrame,
@@ -25,6 +26,7 @@ import {
25
26
  describeExecutionTool,
26
27
  type ExecutionColorKey,
27
28
  type ExecutionStatus,
29
+ executionStatusLabel,
28
30
  PREVIEW_LINES,
29
31
  resolveExecutionStatus,
30
32
  } from "./execution-shared";
@@ -33,6 +35,7 @@ import { type DescribeContext, type NativeNode, type NativeUiEvent, rootToggleEx
33
35
  import { NativeImageCache } from "../native/blobs";
34
36
  import { imageLinksEnabled, linkedImageSpan, linkedImageText } from "../prompt/image-references";
35
37
  import { Memo } from "../native/memo";
38
+ import type { DynamicBorder } from "../chrome/dynamic-border";
36
39
 
37
40
  const STREAMING_LINE_CAP = PREVIEW_LINES * 5;
38
41
  // Minimum interval between processing incoming chunks for display (ms).
@@ -58,8 +61,10 @@ export class BashExecutionComponent extends Container {
58
61
  #status: ExecutionStatus = "running";
59
62
  #exitCode: number | undefined = undefined;
60
63
  #loader: Loader;
64
+ readonly #bottomBorder: DynamicBorder;
61
65
  #truncation?: TruncationMeta;
62
66
  #artifactError?: OutputArtifactError;
67
+ #minimized?: MinimizedMeta;
63
68
  #expanded = false;
64
69
  // Post-finalize mutation counter (FinalizableBlock.getTranscriptBlockVersion):
65
70
  // a completed command's block still mutates on expansion toggles, and the
@@ -102,9 +107,10 @@ export class BashExecutionComponent extends Container {
102
107
  // Use dim border for excluded-from-context commands (!! prefix)
103
108
  const colorKey = excludeFromContext ? "dim" : "bashMode";
104
109
  this.#colorKey = colorKey;
105
- const { contentContainer, loader } = buildExecutionFrame(this, ui, colorKey);
110
+ const { contentContainer, loader, bottomBorder } = buildExecutionFrame(this, ui, colorKey);
106
111
  this.#contentContainer = contentContainer;
107
112
  this.#loader = loader;
113
+ this.#bottomBorder = bottomBorder;
108
114
  this.#outputPane = new OutputPane(theme, {
109
115
  expanded: false,
110
116
  collapsedMaxLines: PREVIEW_LINES,
@@ -120,7 +126,6 @@ export class BashExecutionComponent extends Container {
120
126
  // Command header
121
127
  this.#headerText = new Text(theme.fg(colorKey, theme.bold(`$ ${command}`)), 1, 0);
122
128
  this.#contentContainer.addChild(this.#headerText);
123
- this.#contentContainer.addChild(this.#loader);
124
129
  }
125
130
 
126
131
  /**
@@ -199,6 +204,7 @@ export class BashExecutionComponent extends Container {
199
204
  exitCode: this.#exitCode,
200
205
  truncation: this.#truncation,
201
206
  artifactError: this.#artifactError,
207
+ minimized: this.#minimized,
202
208
  };
203
209
  return dataFirst
204
210
  ? describeExecutionTool({
@@ -286,6 +292,11 @@ export class BashExecutionComponent extends Container {
286
292
  this.#drainPtyQueue();
287
293
  }
288
294
 
295
+ /** Bytes a terminal would send for a key event, honoring the command's cursor-key mode; "" for key releases. */
296
+ encodePtyInput(data: string): string {
297
+ return normalizeInputForPty(data, this.#ptyTerminal?.modes.applicationCursorKeysMode ?? false);
298
+ }
299
+
289
300
  #drainPtyQueue(): void {
290
301
  const terminal = this.#ptyTerminal;
291
302
  if (!terminal || this.#ptyWriting) return;
@@ -352,6 +363,7 @@ export class BashExecutionComponent extends Container {
352
363
  output?: string;
353
364
  truncation?: TruncationMeta;
354
365
  artifactError?: OutputArtifactError;
366
+ minimized?: MinimizedMeta;
355
367
  images?: readonly ImageContent[];
356
368
  showImages?: boolean;
357
369
  },
@@ -361,6 +373,7 @@ export class BashExecutionComponent extends Container {
361
373
  this.#endedAt ??= performance.now();
362
374
  this.#truncation = options?.truncation;
363
375
  this.#artifactError = options?.artifactError;
376
+ this.#minimized = options?.minimized;
364
377
  this.#images = options?.images ?? [];
365
378
  this.#showImages = options?.showImages ?? true;
366
379
  if (options?.output !== undefined && !this.#ptyMode) {
@@ -377,6 +390,12 @@ export class BashExecutionComponent extends Container {
377
390
  this.#updateDisplay();
378
391
  }
379
392
 
393
+ /** The loader animates the bottom border from outside the child tree, so teardown stops it here. */
394
+ override dispose(): void {
395
+ this.#loader.dispose();
396
+ super.dispose();
397
+ }
398
+
380
399
  override render(width: number): readonly string[] {
381
400
  if (this.#displayDirty) {
382
401
  this.#displayDirty = false;
@@ -434,15 +453,13 @@ export class BashExecutionComponent extends Container {
434
453
  }
435
454
  }
436
455
 
437
- // Loader or status
438
- if (this.#status === "running") {
439
- this.#contentContainer.addChild(this.#loader);
440
- } else {
456
+ // The bottom border keeps the live loader until the run settles, then its exit/cancel marker.
457
+ if (this.#status !== "running") {
458
+ this.#bottomBorder.setLabel(executionStatusLabel(this.#status, this.#exitCode));
441
459
  const footer = buildStatusFooter({
442
- status: this.#status,
443
- exitCode: this.#exitCode,
444
460
  truncation: this.#truncation,
445
461
  artifactError: this.#artifactError,
462
+ minimized: this.#minimized,
446
463
  hiddenLineCount,
447
464
  suppressHiddenCount: hasSixelOutput,
448
465
  });
@@ -37,7 +37,7 @@ import { theme } from "../theme";
37
37
  import {
38
38
  assistantHasVisibleContent,
39
39
  assistantUsageIsBilled,
40
- buildAsyncResultBlock,
40
+ buildAsyncResultComponent,
41
41
  buildFileMentionBlock,
42
42
  buildIrcMessageCard,
43
43
  buildLaunchCompletionBlock,
@@ -65,8 +65,9 @@ import {
65
65
  routeLateDiagnostics,
66
66
  } from "./late-diagnostics-message";
67
67
  import { groupedReadUsageCallIds, ReadToolGroupComponent, readArgsCollapseIntoGroup } from "./read-tool-group";
68
+ import { isReplyWrite, ReplyWriteComponent, replyDisplayMessage, toolResultReplies } from "./reply-write";
68
69
  import { SkillMessageComponent } from "./skill-message";
69
- import { ToolExecutionComponent } from "./tool-execution";
70
+ import { ToolExecutionComponent, type ToolExecutionHandle } from "./tool-execution";
70
71
  import { TranscriptContainer } from "../chrome/transcript-container";
71
72
  import { createUsageRowBlock, TurnUsageTally, turnElapsedMs } from "../overlays/usage-row";
72
73
  import { CollapsedSyntheticMessageComponent, UserMessageComponent } from "./user-message";
@@ -90,7 +91,7 @@ export interface ChatTranscriptBuilderDeps {
90
91
 
91
92
  export class ChatTranscriptBuilder {
92
93
  readonly container = new TranscriptContainer();
93
- #pendingTools = new Map<string, ToolExecutionComponent | ReadToolGroupComponent>();
94
+ #pendingTools = new Map<string, ToolExecutionHandle>();
94
95
  #readArgs = new Map<string, Record<string, unknown>>();
95
96
  #readGroup: ReadToolGroupComponent | null = null;
96
97
  #pendingUsage: Usage | undefined;
@@ -203,6 +204,15 @@ export class ChatTranscriptBuilder {
203
204
  this.#expandables.push(component);
204
205
  }
205
206
 
207
+ /** Append assistant prose (a reply, a post-tool segment, or an `out://` reply write) with the transcript's display preferences. */
208
+ #mountProse(component: AssistantMessageComponent): void {
209
+ component.setImagesVisible(displayPreferences.showImages);
210
+ component.setToolResultImagesVisible(!displayPreferences.hideToolActivity);
211
+ component.setTableChartsVisible(this.#deps.tableCharts !== false);
212
+ this.#trackExpandable(component);
213
+ this.container.addChild(component);
214
+ }
215
+
206
216
  /** A `wait` showing all-running is displaced by the next `wait` call. */
207
217
  #resolveWaitingPoll(nextToolName?: string): void {
208
218
  const previous = this.#waitingPoll;
@@ -346,6 +356,7 @@ export class ChatTranscriptBuilder {
346
356
  component.setComplete(message.exitCode, message.cancelled, {
347
357
  truncation: message.meta?.truncation,
348
358
  artifactError: message.meta?.artifactError,
359
+ minimized: message.meta?.minimized,
349
360
  images: message.images,
350
361
  showImages: displayPreferences.showImages,
351
362
  });
@@ -417,12 +428,8 @@ export class ChatTranscriptBuilder {
417
428
  this.#deps.linkTargets,
418
429
  expandThinkingBlocks,
419
430
  );
420
- assistantComponent.setImagesVisible(displayPreferences.showImages);
421
- assistantComponent.setToolResultImagesVisible(!displayPreferences.hideToolActivity);
422
- assistantComponent.setTableChartsVisible(this.#deps.tableCharts !== false);
423
- this.#trackExpandable(assistantComponent);
424
431
  assistantComponent.pickReactionTarget(this.container.children);
425
- this.container.addChild(assistantComponent);
432
+ this.#mountProse(assistantComponent);
426
433
  let lastAssistantComponent = assistantComponent;
427
434
 
428
435
  if (displayPreferences.cacheMissMarker) {
@@ -456,11 +463,7 @@ export class ChatTranscriptBuilder {
456
463
  this.#deps.linkTargets,
457
464
  expandThinkingBlocks,
458
465
  );
459
- component.setImagesVisible(displayPreferences.showImages);
460
- component.setToolResultImagesVisible(!displayPreferences.hideToolActivity);
461
- component.setTableChartsVisible(this.#deps.tableCharts !== false);
462
- this.#trackExpandable(component);
463
- this.container.addChild(component);
466
+ this.#mountProse(component);
464
467
  lastAssistantComponent = component;
465
468
  };
466
469
 
@@ -492,22 +495,37 @@ export class ChatTranscriptBuilder {
492
495
 
493
496
  this.#readGroup?.seal();
494
497
  this.#readGroup = null;
495
- const component = new ToolExecutionComponent(
496
- content.name,
497
- content.arguments,
498
- {
499
- useBuiltInRenderer: this.#deps.isBuiltInTool?.(content.name) ?? true,
500
- // Stable ids and Kitty placeholder cells keep images anchored
501
- // while the transcript viewport scrolls and reflows.
502
- showImages: displayPreferences.showImages,
503
- },
504
- this.#deps.getTool?.(content.name),
505
- this.#deps.ui,
506
- this.#deps.cwd,
507
- content.id,
508
- );
509
- this.#trackExpandable(component);
510
- this.container.addChild(component);
498
+ const builtIn = this.#deps.isBuiltInTool?.(content.name) ?? true;
499
+ let component: ToolExecutionHandle;
500
+ if (builtIn && isReplyWrite(content.name, content.arguments) === true) {
501
+ const reply = new ReplyWriteComponent({
502
+ requestRender: () => this.#deps.requestRender(),
503
+ imageBudget: this.#deps.ui.imageBudget,
504
+ linkTargets: this.#deps.linkTargets,
505
+ });
506
+ reply.updateArgs(content.arguments);
507
+ reply.setArgsComplete();
508
+ this.#mountProse(reply);
509
+ component = reply;
510
+ } else {
511
+ const card = new ToolExecutionComponent(
512
+ content.name,
513
+ content.arguments,
514
+ {
515
+ useBuiltInRenderer: builtIn,
516
+ // Stable ids and Kitty placeholder cells keep images anchored
517
+ // while the transcript viewport scrolls and reflows.
518
+ showImages: displayPreferences.showImages,
519
+ },
520
+ this.#deps.getTool?.(content.name),
521
+ this.#deps.ui,
522
+ this.#deps.cwd,
523
+ content.id,
524
+ );
525
+ this.#trackExpandable(card);
526
+ this.container.addChild(card);
527
+ component = card;
528
+ }
511
529
 
512
530
  if (hasErrorStop && errorMessage) {
513
531
  component.updateResult(
@@ -549,6 +567,19 @@ export class ChatTranscriptBuilder {
549
567
  this.#readArgs.delete(message.toolCallId);
550
568
  return;
551
569
  }
570
+ for (const reply of toolResultReplies(message.details)) {
571
+ this.#mountProse(
572
+ new AssistantMessageComponent(
573
+ replyDisplayMessage(reply),
574
+ false,
575
+ () => this.#deps.requestRender(),
576
+ [],
577
+ this.#deps.ui.imageBudget,
578
+ true,
579
+ this.#deps.linkTargets,
580
+ ),
581
+ );
582
+ }
552
583
  if (!pending) return;
553
584
  pending.updateResult(message, false, message.toolCallId);
554
585
  this.#pendingTools.delete(message.toolCallId);
@@ -569,7 +600,9 @@ export class ChatTranscriptBuilder {
569
600
  #appendCustomMessage(message: Extract<AgentMessage, { role: "custom" | "hookMessage" }>): void {
570
601
  if (!message.display) return;
571
602
  if (message.customType === "async-result") {
572
- const component = buildAsyncResultBlock(message);
603
+ const renderer = this.#deps.getMessageRenderer?.(message.customType);
604
+ const component = buildAsyncResultComponent(message, renderer);
605
+ this.#trackExpandable(component);
573
606
  this.container.addChild(component);
574
607
  return;
575
608
  }
@@ -10,6 +10,7 @@ import type { TspSpan } from "@linxiraos/pi-wire";
10
10
  import { md, node, span, text } from "../native/describe";
11
11
  import { type NativeChild, type NativeNode, type NativeUiEvent, rootToggleExpanded } from "../native/node";
12
12
  import { Memo } from "../native/memo";
13
+ import { noticeRow } from "../chrome/transcript-notice";
13
14
 
14
15
  /** Divider labels per compaction method; unknown/legacy methods fall back to "compacted". */
15
16
  const COMPACTION_METHOD_LABELS: Record<string, string> = {
@@ -237,7 +238,7 @@ function compactionNativeDetail(message: CompactionSummaryMessage): NativeChild[
237
238
  ? `Summary · ${frames} snapcompact frame${frames === 1 ? "" : "s"} attached`
238
239
  : "Summary of the earlier conversation";
239
240
  const detail: NativeChild[] = [text([span(caption, "dim")], { role: "zeta.compaction.caption", key: "caption" })];
240
- if (message.warning) detail.push(text([span(message.warning, "warning")], { wrap: "word", key: "warning" }));
241
+ if (message.warning) detail.push(noticeRow("warning", message.warning, { key: "warning" }));
241
242
  detail.push(md(message.summary, { key: "summary" }));
242
243
  return detail;
243
244
  }
@@ -6,6 +6,8 @@ export interface ChatTranscriptDisplayPreferences {
6
6
  cacheMissMarker: boolean;
7
7
  showTokenUsage: boolean;
8
8
  showTurnTime: boolean;
9
+ /** Max rows a collapsed advisor card shows below its header; 0 = no cap. */
10
+ advisorCollapsedLines: number;
9
11
  }
10
12
  /** Current transcript display preferences. */
11
13
  export declare const chatTranscriptDisplayPreferences: ChatTranscriptDisplayPreferences;
@@ -6,6 +6,8 @@ export interface ChatTranscriptDisplayPreferences {
6
6
  cacheMissMarker: boolean;
7
7
  showTokenUsage: boolean;
8
8
  showTurnTime: boolean;
9
+ /** Max rows a collapsed advisor card shows below its header; 0 = no cap. */
10
+ advisorCollapsedLines: number;
9
11
  }
10
12
 
11
13
  /** Current transcript display preferences. */
@@ -16,6 +18,7 @@ export const chatTranscriptDisplayPreferences: ChatTranscriptDisplayPreferences
16
18
  cacheMissMarker: false,
17
19
  showTokenUsage: false,
18
20
  showTurnTime: false,
21
+ advisorCollapsedLines: 0,
19
22
  };
20
23
 
21
24
  /** Apply host display preferences without pulling settings into the renderer. */
@@ -32,6 +32,8 @@ export declare class EvalExecutionComponent extends Container {
32
32
  truncation?: TruncationMeta;
33
33
  artifactError?: OutputArtifactError;
34
34
  }): void;
35
+ /** The loader animates the bottom border from outside the child tree, so teardown stops it here. */
36
+ dispose(): void;
35
37
  getOutput(): string;
36
38
  getCode(): string;
37
39
  }
@@ -19,12 +19,14 @@ import {
19
19
  describeExecutionTool,
20
20
  type ExecutionColorKey,
21
21
  type ExecutionStatus,
22
+ executionStatusLabel,
22
23
  PREVIEW_LINES,
23
24
  resolveExecutionStatus,
24
25
  } from "./execution-shared";
25
26
  import { code, span } from "../native/describe";
26
27
  import { type DescribeContext, type NativeNode, type NativeUiEvent, rootToggleExpanded } from "../native/node";
27
28
  import { Memo } from "../native/memo";
29
+ import type { DynamicBorder } from "../chrome/dynamic-border";
28
30
 
29
31
  export type EvalExecutionLanguage = "python" | "js";
30
32
 
@@ -32,6 +34,7 @@ export class EvalExecutionComponent extends Container {
32
34
  #status: ExecutionStatus = "running";
33
35
  #exitCode: number | undefined = undefined;
34
36
  #loader: Loader;
37
+ readonly #bottomBorder: DynamicBorder;
35
38
  #truncation?: TruncationMeta;
36
39
  #artifactError?: OutputArtifactError;
37
40
  #expanded = false;
@@ -72,9 +75,10 @@ export class EvalExecutionComponent extends Container {
72
75
  this.#language = language;
73
76
 
74
77
  const colorKey: ExecutionColorKey = this.#excludeFromContext ? "dim" : "pythonMode";
75
- const { contentContainer, loader } = buildExecutionFrame(this, ui, colorKey);
78
+ const { contentContainer, loader, bottomBorder } = buildExecutionFrame(this, ui, colorKey);
76
79
  this.#contentContainer = contentContainer;
77
80
  this.#loader = loader;
81
+ this.#bottomBorder = bottomBorder;
78
82
  this.#outputPane = new OutputPane(theme, {
79
83
  expanded: false,
80
84
  collapsedMaxLines: PREVIEW_LINES,
@@ -89,7 +93,6 @@ export class EvalExecutionComponent extends Container {
89
93
  });
90
94
 
91
95
  this.#contentContainer.addChild(this.#formatHeader(colorKey));
92
- this.#contentContainer.addChild(this.#loader);
93
96
  }
94
97
 
95
98
  /**
@@ -188,6 +191,12 @@ export class EvalExecutionComponent extends Container {
188
191
  this.#updateDisplay();
189
192
  }
190
193
 
194
+ /** The loader animates the bottom border from outside the child tree, so teardown stops it here. */
195
+ override dispose(): void {
196
+ this.#loader.dispose();
197
+ super.dispose();
198
+ }
199
+
191
200
  #updateDisplay(): void {
192
201
  // Only the collapsed preview hides lines; when expanded the footer must
193
202
  // not keep advertising hidden lines / ctrl+o.
@@ -200,12 +209,10 @@ export class EvalExecutionComponent extends Container {
200
209
 
201
210
  if (this.#outputPane.lineCount > 0) this.#contentContainer.addChild(this.#outputPane);
202
211
 
203
- if (this.#status === "running") {
204
- this.#contentContainer.addChild(this.#loader);
205
- } else {
212
+ // The bottom border keeps the live loader until the run settles, then its exit/cancel marker.
213
+ if (this.#status !== "running") {
214
+ this.#bottomBorder.setLabel(executionStatusLabel(this.#status, this.#exitCode));
206
215
  const footer = buildStatusFooter({
207
- status: this.#status,
208
- exitCode: this.#exitCode,
209
216
  truncation: this.#truncation,
210
217
  artifactError: this.#artifactError,
211
218
  hiddenLineCount,
@@ -10,7 +10,8 @@ import { Loader } from "../components/loader";
10
10
  import { Text } from "../components/text";
11
11
  import { Container, type TUI } from "../tui";
12
12
  import type { OutputArtifactError } from "../tools/streaming-output";
13
- import { type TruncationMeta } from "../tools/output-meta";
13
+ import { type MinimizedMeta, type TruncationMeta } from "../tools/output-meta";
14
+ import { DynamicBorder } from "../chrome/dynamic-border";
14
15
  import type { TspText } from "@linxiraos/pi-wire";
15
16
  import type { NativeChild, NativeNode } from "../native/node";
16
17
  /** Output rows shown while an execution is collapsed. */
@@ -25,23 +26,26 @@ export type ExecutionColorKey = "dim" | "bashMode" | "pythonMode";
25
26
  /**
26
27
  * Build the spacer + top border + content container + bottom border scaffold
27
28
  * that bash and eval execution components share. The caller appends the
28
- * header (command vs `>>>` prompt) and the returned loader to
29
- * `contentContainer` so per-mode order is preserved.
29
+ * header (command vs `>>>` prompt) to `contentContainer` and keeps the run's
30
+ * state in `bottomBorder` ({@link executionStatusLabel}); the returned loader
31
+ * animates that label rather than taking a row of its own.
30
32
  */
31
33
  export declare function buildExecutionFrame(parent: Container, ui: TUI, colorKey: ExecutionColorKey): {
32
34
  contentContainer: Container;
33
35
  loader: Loader;
36
+ bottomBorder: DynamicBorder;
34
37
  };
38
+ /** The bottom-border marker of a settled run: `exit N` for a failure, `cancelled` for a cancel. */
39
+ export declare function executionStatusLabel(status: Exclude<ExecutionStatus, "running">, exitCode: number | undefined): string | undefined;
35
40
  /**
36
- * Build the post-run status block (hidden-line hint, exit/cancel marker,
37
- * truncation notice). Returns undefined when there is nothing to display so
38
- * callers can skip appending a stray Text child.
41
+ * Build the post-run status block (hidden-line hint, truncation notice).
42
+ * Returns undefined when there is nothing to display so callers can skip
43
+ * appending a stray Text child.
39
44
  */
40
45
  export declare function buildStatusFooter(opts: {
41
- status: ExecutionStatus;
42
- exitCode: number | undefined;
43
46
  truncation: TruncationMeta | undefined;
44
47
  artifactError?: OutputArtifactError;
48
+ minimized?: MinimizedMeta;
45
49
  hiddenLineCount: number;
46
50
  /** Suppress the "… N more lines" hint (used when sixel passthrough renders the full output). */
47
51
  suppressHiddenCount?: boolean;
@@ -64,6 +68,7 @@ export interface ExecutionCardInput {
64
68
  readonly exitCode: number | undefined;
65
69
  readonly truncation: TruncationMeta | undefined;
66
70
  readonly artifactError?: OutputArtifactError;
71
+ readonly minimized?: MinimizedMeta;
67
72
  }
68
73
  /**
69
74
  * Native card shared by user bash/eval runs: the head with a live `elapsed`
@@ -94,6 +99,7 @@ export interface ExecutionToolInput {
94
99
  readonly exitCode: number | undefined;
95
100
  readonly truncation: TruncationMeta | undefined;
96
101
  readonly artifactError?: OutputArtifactError;
102
+ readonly minimized?: MinimizedMeta;
97
103
  }
98
104
  /**
99
105
  * A user `!`/`$` run as the agent's `tool` frame (§6.6): a head with a `you`
@@ -10,9 +10,15 @@
10
10
  import { Loader } from "../components/loader";
11
11
  import { Text } from "../components/text";
12
12
  import { Container, type TUI } from "../tui";
13
- import { getSymbolTheme, theme } from "../theme/theme";
13
+ import { theme } from "../theme/theme";
14
14
  import type { OutputArtifactError } from "../tools/streaming-output";
15
- import { formatArtifactErrorNotice, formatTruncationMetaNotice, type TruncationMeta } from "../tools/output-meta";
15
+ import {
16
+ formatArtifactErrorNotice,
17
+ formatMinimizedMeta,
18
+ formatTruncationMetaNotice,
19
+ type MinimizedMeta,
20
+ type TruncationMeta,
21
+ } from "../tools/output-meta";
16
22
  import { DynamicBorder } from "../chrome/dynamic-border";
17
23
  import { Ellipsis, truncateToWidth, visibleWidth } from "../utils";
18
24
  import { interruptKey } from "../chrome/keybinding-hints";
@@ -46,14 +52,15 @@ export type ExecutionColorKey = "dim" | "bashMode" | "pythonMode";
46
52
  /**
47
53
  * Build the spacer + top border + content container + bottom border scaffold
48
54
  * that bash and eval execution components share. The caller appends the
49
- * header (command vs `>>>` prompt) and the returned loader to
50
- * `contentContainer` so per-mode order is preserved.
55
+ * header (command vs `>>>` prompt) to `contentContainer` and keeps the run's
56
+ * state in `bottomBorder` ({@link executionStatusLabel}); the returned loader
57
+ * animates that label rather than taking a row of its own.
51
58
  */
52
59
  export function buildExecutionFrame(
53
60
  parent: Container,
54
61
  ui: TUI,
55
62
  colorKey: ExecutionColorKey,
56
- ): { contentContainer: Container; loader: Loader } {
63
+ ): { contentContainer: Container; loader: Loader; bottomBorder: DynamicBorder } {
57
64
  const borderColor = (str: string) => theme.fg(colorKey, str);
58
65
 
59
66
  parent.addChild(new DynamicBorder(borderColor));
@@ -66,23 +73,35 @@ export function buildExecutionFrame(
66
73
  spinner => theme.fg(colorKey, spinner),
67
74
  text => theme.fg("muted", text),
68
75
  `Running… (${interruptKey()} to cancel)`,
69
- getSymbolTheme().spinnerFrames,
76
+ // The status spinner, as on a running tool card's header.
77
+ theme.spinnerFrames,
70
78
  );
71
79
 
72
- parent.addChild(new DynamicBorder(borderColor));
73
- return { contentContainer, loader };
80
+ const bottomBorder = new DynamicBorder(borderColor);
81
+ bottomBorder.setLabel(() => loader.inlineText());
82
+ parent.addChild(bottomBorder);
83
+ return { contentContainer, loader, bottomBorder };
84
+ }
85
+
86
+ /** The bottom-border marker of a settled run: `exit N` for a failure, `cancelled` for a cancel. */
87
+ export function executionStatusLabel(
88
+ status: Exclude<ExecutionStatus, "running">,
89
+ exitCode: number | undefined,
90
+ ): string | undefined {
91
+ if (status === "cancelled") return theme.fg("warning", "cancelled");
92
+ if (status === "error") return theme.fg("error", `exit ${exitCode}`);
93
+ return undefined;
74
94
  }
75
95
 
76
96
  /**
77
- * Build the post-run status block (hidden-line hint, exit/cancel marker,
78
- * truncation notice). Returns undefined when there is nothing to display so
79
- * callers can skip appending a stray Text child.
97
+ * Build the post-run status block (hidden-line hint, truncation notice).
98
+ * Returns undefined when there is nothing to display so callers can skip
99
+ * appending a stray Text child.
80
100
  */
81
101
  export function buildStatusFooter(opts: {
82
- status: ExecutionStatus;
83
- exitCode: number | undefined;
84
102
  truncation: TruncationMeta | undefined;
85
103
  artifactError?: OutputArtifactError;
104
+ minimized?: MinimizedMeta;
86
105
  hiddenLineCount: number;
87
106
  /** Suppress the "… N more lines" hint (used when sixel passthrough renders the full output). */
88
107
  suppressHiddenCount?: boolean;
@@ -92,17 +111,15 @@ export function buildStatusFooter(opts: {
92
111
  if (opts.hiddenLineCount > 0 && !opts.suppressHiddenCount) {
93
112
  parts.push(theme.fg("dim", `… ${opts.hiddenLineCount} more lines (${expandKeyHint()} to expand)`));
94
113
  }
95
- if (opts.status === "cancelled") {
96
- parts.push(theme.fg("warning", "(cancelled)"));
97
- } else if (opts.status === "error") {
98
- parts.push(theme.fg("error", `(exit ${opts.exitCode})`));
99
- }
100
114
  if (opts.truncation) {
101
115
  parts.push(theme.fg("warning", formatTruncationMetaNotice(opts.truncation)));
102
116
  }
103
117
  if (opts.artifactError) {
104
118
  parts.push(theme.fg("warning", formatArtifactErrorNotice(opts.artifactError)));
105
119
  }
120
+ if (opts.minimized) {
121
+ parts.push(theme.fg("dim", `Minimized: ${formatMinimizedMeta(opts.minimized)}`));
122
+ }
106
123
 
107
124
  if (parts.length === 0) return undefined;
108
125
  return new Text(`\n${parts.join("\n")}`, 1, 0);
@@ -133,6 +150,7 @@ export interface ExecutionCardInput {
133
150
  readonly exitCode: number | undefined;
134
151
  readonly truncation: TruncationMeta | undefined;
135
152
  readonly artifactError?: OutputArtifactError;
153
+ readonly minimized?: MinimizedMeta;
136
154
  }
137
155
 
138
156
  /**
@@ -170,6 +188,7 @@ export function describeExecutionCard(input: ExecutionCardInput): NativeNode {
170
188
  if (input.status === "cancelled") note("(cancelled)", "warning");
171
189
  else if (input.status === "error") note(`(exit ${input.exitCode})`, "error");
172
190
  if (input.truncation) note(formatTruncationMetaNotice(input.truncation), "warning");
191
+ if (input.minimized) note(`Minimized: ${formatMinimizedMeta(input.minimized)}`, "muted");
173
192
  if (input.artifactError) note(formatArtifactErrorNotice(input.artifactError), "warning");
174
193
  if (notes.length > 0) children.push(text(notes, { wrap: "word", key: "notes" }));
175
194
  return card(
@@ -207,6 +226,7 @@ export interface ExecutionToolInput {
207
226
  readonly exitCode: number | undefined;
208
227
  readonly truncation: TruncationMeta | undefined;
209
228
  readonly artifactError?: OutputArtifactError;
229
+ readonly minimized?: MinimizedMeta;
210
230
  }
211
231
 
212
232
  const EXECUTION_RUN_STATE: Record<ExecutionStatus, RunState> = {
@@ -244,6 +264,7 @@ export function describeExecutionTool(input: ExecutionToolInput): NativeNode {
244
264
  state,
245
265
  exitCode: input.exitCode,
246
266
  elapsedMs: ms,
267
+ facts: input.minimized ? [`Minimized ${formatMinimizedMeta(input.minimized)}`] : undefined,
247
268
  meta: { truncation: input.truncation, artifactError: input.artifactError },
248
269
  }),
249
270
  ],