@linxiraos/pi-tui 1.4.4 → 1.4.7

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 (363) hide show
  1. package/CHANGELOG.md +208 -207
  2. package/README.md +34 -34
  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/chat/assistant-message.d.ts +15 -3
  7. package/dist/types/chat/bash-execution.d.ts +2 -0
  8. package/dist/types/chat/display-preferences.d.ts +2 -0
  9. package/dist/types/chat/extension-types.d.ts +31 -0
  10. package/dist/types/chat/reply-write.d.ts +48 -0
  11. package/dist/types/chat/table-chart.d.ts +4 -3
  12. package/dist/types/chat/tool-execution.d.ts +1 -2
  13. package/dist/types/chat/transcript-outline.d.ts +7 -0
  14. package/dist/types/chat/transcript-render-helpers.d.ts +2 -0
  15. package/dist/types/chrome/context-map.d.ts +15 -0
  16. package/dist/types/chrome/context-presentation.d.ts +48 -0
  17. package/dist/types/chrome/context-view-model.d.ts +77 -0
  18. package/dist/types/chrome/index.d.ts +1 -0
  19. package/dist/types/chrome/transcript-notice.d.ts +35 -0
  20. package/dist/types/chrome/transcript-status.d.ts +20 -8
  21. package/dist/types/components/editor.d.ts +8 -0
  22. package/dist/types/components/image.d.ts +20 -0
  23. package/dist/types/components/loader.d.ts +1 -1
  24. package/dist/types/components/markdown.d.ts +7 -0
  25. package/dist/types/native/blobs.d.ts +11 -1
  26. package/dist/types/native/picker.d.ts +4 -4
  27. package/dist/types/overlays/advisor-config.d.ts +6 -0
  28. package/dist/types/overlays/agent-hub-projection.d.ts +3 -1
  29. package/dist/types/overlays/annotation-overlay.d.ts +7 -1
  30. package/dist/types/overlays/annotation-types.d.ts +28 -0
  31. package/dist/types/overlays/ask-dialog.d.ts +12 -3
  32. package/dist/types/overlays/btw-history-panel.d.ts +16 -2
  33. package/dist/types/overlays/btw-history.d.ts +7 -0
  34. package/dist/types/overlays/btw-panel.d.ts +2 -0
  35. package/dist/types/overlays/context-viewer-format.d.ts +42 -0
  36. package/dist/types/overlays/context-viewer-overview.d.ts +70 -0
  37. package/dist/types/overlays/context-viewer.d.ts +25 -0
  38. package/dist/types/overlays/hook-input.d.ts +1 -0
  39. package/dist/types/overlays/login-dialog.d.ts +5 -1
  40. package/dist/types/overlays/mcp-add-wizard.d.ts +2 -0
  41. package/dist/types/overlays/model-browser.d.ts +10 -1
  42. package/dist/types/overlays/oauth-selector.d.ts +23 -0
  43. package/dist/types/overlays/pause-screen.d.ts +13 -3
  44. package/dist/types/overlays/plan-review-overlay.d.ts +2 -0
  45. package/dist/types/overlays/rewind-selector.d.ts +1 -1
  46. package/dist/types/overlays/running-subagent-badge.d.ts +7 -1
  47. package/dist/types/overlays/session-selector.d.ts +22 -2
  48. package/dist/types/prompt/composer.d.ts +43 -0
  49. package/dist/types/prompt/interactive-context-helpers.d.ts +10 -3
  50. package/dist/types/prompt/macos-spelling.d.ts +2 -2
  51. package/dist/types/render/extension-links.d.ts +65 -0
  52. package/dist/types/render/hyperlink.d.ts +38 -7
  53. package/dist/types/render/index.d.ts +1 -0
  54. package/dist/types/render/output-pane.d.ts +1 -1
  55. package/dist/types/render/render-utils.d.ts +7 -1
  56. package/dist/types/setup/scenes/glyph.d.ts +1 -1
  57. package/dist/types/setup/scenes/model.d.ts +1 -1
  58. package/dist/types/setup/scenes/outro.d.ts +5 -4
  59. package/dist/types/setup/scenes/sign-in.d.ts +13 -8
  60. package/dist/types/setup/scenes/types.d.ts +16 -1
  61. package/dist/types/setup/startup-splash.d.ts +1 -1
  62. package/dist/types/setup/wizard-overlay.d.ts +11 -7
  63. package/dist/types/setup/wizard.d.ts +5 -1
  64. package/dist/types/status-line/component.d.ts +3 -3
  65. package/dist/types/status-line/context-usage.d.ts +42 -35
  66. package/dist/types/status-line/host.d.ts +6 -2
  67. package/dist/types/terminal-capabilities.d.ts +7 -0
  68. package/dist/types/theme/symbols.d.ts +1 -1
  69. package/dist/types/theme/theme.d.ts +0 -23
  70. package/dist/types/tools/ask.d.ts +4 -0
  71. package/dist/types/tools/bash-interactive.d.ts +6 -0
  72. package/dist/types/tools/bash.d.ts +2 -0
  73. package/dist/types/tools/default-renderer.d.ts +6 -4
  74. package/dist/types/tools/edit.d.ts +3 -1
  75. package/dist/types/tools/fetch.d.ts +1 -0
  76. package/dist/types/tools/github.d.ts +3 -0
  77. package/dist/types/tools/grouped-file-output.d.ts +2 -0
  78. package/dist/types/tools/irc.d.ts +6 -0
  79. package/dist/types/tools/json-tree.d.ts +23 -4
  80. package/dist/types/tools/lsp.d.ts +2 -0
  81. package/dist/types/tools/mcp.d.ts +7 -6
  82. package/dist/types/tools/native-view.d.ts +1 -1
  83. package/dist/types/tools/read.d.ts +3 -0
  84. package/dist/types/tools/renderer.d.ts +2 -0
  85. package/dist/types/tools/streaming-output.d.ts +11 -0
  86. package/dist/types/tools/task.d.ts +9 -1
  87. package/dist/types/tools/url-scheme-host.d.ts +17 -0
  88. package/dist/types/tools/wait.d.ts +16 -2
  89. package/dist/types/tools/yield.d.ts +1 -1
  90. package/dist/types/tui.d.ts +9 -2
  91. package/dist/types/vim.d.ts +39 -0
  92. package/package.json +10 -14
  93. package/src/app-keybindings.d.ts +20 -0
  94. package/src/app-keybindings.ts +20 -0
  95. package/src/apps/session-picker.ts +7 -0
  96. package/src/charts/chart-plan.d.ts +9 -7
  97. package/src/charts/chart-plan.ts +20 -50
  98. package/src/chat/advisor-message.ts +2 -0
  99. package/src/chat/assistant-message.d.ts +15 -3
  100. package/src/chat/assistant-message.ts +137 -19
  101. package/src/chat/background-tan-message.ts +4 -0
  102. package/src/chat/bash-execution.d.ts +2 -0
  103. package/src/chat/bash-execution.ts +13 -1
  104. package/src/chat/chat-transcript-builder.ts +58 -28
  105. package/src/chat/compaction-summary-message.ts +2 -1
  106. package/src/chat/display-preferences.d.ts +2 -0
  107. package/src/chat/display-preferences.ts +3 -0
  108. package/src/chat/extension-types.d.ts +31 -0
  109. package/src/chat/extension-types.ts +34 -0
  110. package/src/chat/read-tool-group.ts +1 -2
  111. package/src/chat/reply-write.d.ts +48 -0
  112. package/src/chat/reply-write.ts +127 -0
  113. package/src/chat/skill-message.ts +2 -6
  114. package/src/chat/table-chart.d.ts +4 -3
  115. package/src/chat/table-chart.ts +10 -4
  116. package/src/chat/tool-execution.d.ts +1 -2
  117. package/src/chat/tool-execution.ts +20 -13
  118. package/src/chat/transcript-outline.d.ts +7 -0
  119. package/src/chat/transcript-outline.ts +27 -0
  120. package/src/chat/transcript-render-helpers.d.ts +2 -0
  121. package/src/chat/transcript-render-helpers.ts +66 -24
  122. package/src/chrome/context-map.ts +62 -0
  123. package/src/chrome/context-presentation.ts +26 -0
  124. package/src/chrome/context-view-model.ts +73 -0
  125. package/src/chrome/index.ts +1 -0
  126. package/src/chrome/transcript-container.ts +89 -59
  127. package/src/chrome/transcript-notice.d.ts +35 -0
  128. package/src/chrome/transcript-notice.ts +83 -0
  129. package/src/chrome/transcript-status.d.ts +20 -8
  130. package/src/chrome/transcript-status.ts +29 -29
  131. package/src/components/editor.d.ts +8 -0
  132. package/src/components/editor.ts +465 -14
  133. package/src/components/image.d.ts +20 -0
  134. package/src/components/image.ts +83 -18
  135. package/src/components/loader.d.ts +1 -1
  136. package/src/components/loader.ts +1 -1
  137. package/src/components/markdown.d.ts +7 -0
  138. package/src/components/markdown.ts +225 -13
  139. package/src/hotkeys-markdown.ts +2 -0
  140. package/src/native/backend.ts +5 -66
  141. package/src/native/blobs.d.ts +11 -1
  142. package/src/native/blobs.ts +5 -3
  143. package/src/native/picker.d.ts +4 -4
  144. package/src/native/picker.ts +4 -4
  145. package/src/overlays/advisor-config.ts +10 -12
  146. package/src/overlays/agent-hub-projection.d.ts +3 -1
  147. package/src/overlays/agent-hub-projection.ts +6 -5
  148. package/src/overlays/agent-hub.ts +51 -42
  149. package/src/overlays/annotation-overlay.ts +125 -37
  150. package/src/overlays/annotation-types.ts +24 -0
  151. package/src/overlays/ask-dialog.ts +125 -35
  152. package/src/overlays/btw-history-panel.ts +124 -12
  153. package/src/overlays/btw-history.ts +11 -0
  154. package/src/overlays/btw-panel.ts +8 -4
  155. package/src/overlays/context-viewer-format.ts +145 -0
  156. package/src/overlays/context-viewer-overview.ts +381 -0
  157. package/src/overlays/context-viewer.ts +728 -0
  158. package/src/overlays/hook-input.ts +2 -0
  159. package/src/overlays/hook-selector.ts +2 -2
  160. package/src/overlays/login-dialog.ts +31 -5
  161. package/src/overlays/mcp-add-wizard.ts +6 -1
  162. package/src/overlays/model-browser.ts +37 -0
  163. package/src/overlays/model-hub.ts +1 -7
  164. package/src/overlays/model-picker.ts +1 -10
  165. package/src/overlays/oauth-selector.ts +44 -6
  166. package/src/overlays/pause-screen.ts +166 -33
  167. package/src/overlays/plan-review-overlay.ts +13 -2
  168. package/src/overlays/rewind-selector.ts +29 -12
  169. package/src/overlays/running-subagent-badge.ts +12 -1
  170. package/src/overlays/session-selector.ts +313 -42
  171. package/src/overlays/settings-defs.ts +1 -0
  172. package/src/overlays/usage-dashboard.ts +20 -14
  173. package/src/prompt/composer.ts +216 -1
  174. package/src/prompt/custom-editor.ts +6 -1
  175. package/src/prompt/emoji-autocomplete.ts +0 -2
  176. package/src/prompt/interactive-context-helpers.ts +29 -4
  177. package/src/prompt/macos-spelling.ts +24 -15
  178. package/src/render/extension-links.d.ts +65 -0
  179. package/src/render/extension-links.ts +214 -0
  180. package/src/render/hyperlink.d.ts +38 -7
  181. package/src/render/hyperlink.ts +102 -23
  182. package/src/render/index.d.ts +1 -0
  183. package/src/render/index.ts +1 -0
  184. package/src/render/output-pane.d.ts +1 -1
  185. package/src/render/output-pane.ts +60 -17
  186. package/src/render/render-utils.d.ts +7 -1
  187. package/src/render/render-utils.ts +11 -2
  188. package/src/setup/scenes/composer.ts +2 -0
  189. package/src/setup/scenes/glyph.ts +3 -1
  190. package/src/setup/scenes/model.ts +192 -29
  191. package/src/setup/scenes/outro.ts +33 -15
  192. package/src/setup/scenes/sign-in.ts +194 -392
  193. package/src/setup/scenes/theme.ts +2 -0
  194. package/src/setup/scenes/types.ts +18 -1
  195. package/src/setup/startup-splash.ts +8 -7
  196. package/src/setup/wizard-overlay.ts +164 -35
  197. package/src/setup/wizard.ts +11 -2
  198. package/src/status-line/component.ts +10 -14
  199. package/src/status-line/context-usage.ts +122 -597
  200. package/src/status-line/host.ts +6 -2
  201. package/src/terminal-capabilities.d.ts +7 -0
  202. package/src/terminal-capabilities.ts +10 -0
  203. package/src/terminal.ts +24 -2
  204. package/src/theme/defaults.json +1 -0
  205. package/src/theme/loader.ts +1 -1
  206. package/src/theme/symbols.d.ts +1 -1
  207. package/src/theme/symbols.ts +16 -0
  208. package/src/theme/theme.d.ts +0 -23
  209. package/src/theme/theme.ts +2 -75
  210. package/src/tools/ask.d.ts +4 -0
  211. package/src/tools/ask.ts +4 -0
  212. package/src/tools/ast-grep.ts +3 -2
  213. package/src/tools/bash-interactive.d.ts +49 -0
  214. package/src/tools/bash-interactive.ts +6 -1
  215. package/src/tools/bash.d.ts +2 -0
  216. package/src/tools/bash.ts +7 -23
  217. package/src/tools/default-renderer.d.ts +6 -4
  218. package/src/tools/default-renderer.ts +9 -6
  219. package/src/tools/edit.d.ts +3 -1
  220. package/src/tools/edit.ts +8 -4
  221. package/src/tools/eval.ts +14 -4
  222. package/src/tools/fetch.d.ts +1 -0
  223. package/src/tools/fetch.ts +1 -0
  224. package/src/tools/find.ts +3 -10
  225. package/src/tools/github.d.ts +3 -0
  226. package/src/tools/github.ts +23 -3
  227. package/src/tools/glob.ts +4 -3
  228. package/src/tools/grep.ts +3 -4
  229. package/src/tools/grouped-file-output.d.ts +2 -0
  230. package/src/tools/grouped-file-output.ts +8 -2
  231. package/src/tools/irc.d.ts +6 -0
  232. package/src/tools/irc.ts +6 -0
  233. package/src/tools/job-widget.ts +13 -1
  234. package/src/tools/json-tree.d.ts +23 -4
  235. package/src/tools/json-tree.ts +132 -42
  236. package/src/tools/lsp.d.ts +2 -0
  237. package/src/tools/lsp.ts +36 -15
  238. package/src/tools/mcp.d.ts +7 -6
  239. package/src/tools/mcp.ts +41 -15
  240. package/src/tools/native-view.d.ts +1 -1
  241. package/src/tools/native-view.ts +3 -3
  242. package/src/tools/read.d.ts +3 -0
  243. package/src/tools/read.ts +3 -1
  244. package/src/tools/renderer.d.ts +2 -0
  245. package/src/tools/renderer.ts +2 -0
  246. package/src/tools/streaming-output.d.ts +11 -0
  247. package/src/tools/streaming-output.ts +41 -0
  248. package/src/tools/task.d.ts +9 -1
  249. package/src/tools/task.ts +59 -16
  250. package/src/tools/url-scheme-host.d.ts +17 -0
  251. package/src/tools/url-scheme-host.ts +21 -0
  252. package/src/tools/vibe.ts +14 -3
  253. package/src/tools/wait.d.ts +16 -2
  254. package/src/tools/wait.ts +16 -2
  255. package/src/tools/yield.d.ts +1 -1
  256. package/src/tools/yield.ts +18 -9
  257. package/src/tui.d.ts +9 -2
  258. package/src/tui.ts +102 -34
  259. package/src/vim.d.ts +39 -0
  260. package/src/vim.ts +313 -22
  261. package/dist/types/theme/defaults/index.d.ts +0 -10289
  262. package/src/theme/defaults/alabaster.json +0 -103
  263. package/src/theme/defaults/amethyst.json +0 -106
  264. package/src/theme/defaults/anthracite.json +0 -103
  265. package/src/theme/defaults/basalt.json +0 -101
  266. package/src/theme/defaults/birch.json +0 -105
  267. package/src/theme/defaults/dark-abyss.json +0 -101
  268. package/src/theme/defaults/dark-arctic.json +0 -114
  269. package/src/theme/defaults/dark-aurora.json +0 -105
  270. package/src/theme/defaults/dark-catppuccin.json +0 -117
  271. package/src/theme/defaults/dark-cavern.json +0 -101
  272. package/src/theme/defaults/dark-celestial.json +0 -116
  273. package/src/theme/defaults/dark-copper.json +0 -105
  274. package/src/theme/defaults/dark-cosmos.json +0 -100
  275. package/src/theme/defaults/dark-cyberpunk.json +0 -112
  276. package/src/theme/defaults/dark-dracula.json +0 -108
  277. package/src/theme/defaults/dark-eclipse.json +0 -101
  278. package/src/theme/defaults/dark-ember.json +0 -105
  279. package/src/theme/defaults/dark-equinox.json +0 -100
  280. package/src/theme/defaults/dark-forest.json +0 -106
  281. package/src/theme/defaults/dark-github.json +0 -115
  282. package/src/theme/defaults/dark-gruvbox.json +0 -122
  283. package/src/theme/defaults/dark-lavender.json +0 -105
  284. package/src/theme/defaults/dark-lunar.json +0 -99
  285. package/src/theme/defaults/dark-midnight.json +0 -105
  286. package/src/theme/defaults/dark-monochrome.json +0 -104
  287. package/src/theme/defaults/dark-monokai.json +0 -108
  288. package/src/theme/defaults/dark-nebula.json +0 -100
  289. package/src/theme/defaults/dark-neon-noir.json +0 -110
  290. package/src/theme/defaults/dark-nord.json +0 -108
  291. package/src/theme/defaults/dark-ocean.json +0 -111
  292. package/src/theme/defaults/dark-one.json +0 -110
  293. package/src/theme/defaults/dark-poimandres.json +0 -125
  294. package/src/theme/defaults/dark-rainforest.json +0 -101
  295. package/src/theme/defaults/dark-reef.json +0 -101
  296. package/src/theme/defaults/dark-retro.json +0 -102
  297. package/src/theme/defaults/dark-rose-pine.json +0 -106
  298. package/src/theme/defaults/dark-sakura.json +0 -105
  299. package/src/theme/defaults/dark-slate.json +0 -105
  300. package/src/theme/defaults/dark-solarized.json +0 -107
  301. package/src/theme/defaults/dark-solstice.json +0 -100
  302. package/src/theme/defaults/dark-starfall.json +0 -101
  303. package/src/theme/defaults/dark-sunset.json +0 -109
  304. package/src/theme/defaults/dark-swamp.json +0 -100
  305. package/src/theme/defaults/dark-synthwave.json +0 -113
  306. package/src/theme/defaults/dark-taiga.json +0 -101
  307. package/src/theme/defaults/dark-terminal.json +0 -105
  308. package/src/theme/defaults/dark-tokyo-night.json +0 -111
  309. package/src/theme/defaults/dark-tundra.json +0 -101
  310. package/src/theme/defaults/dark-twilight.json +0 -101
  311. package/src/theme/defaults/dark-volcanic.json +0 -101
  312. package/src/theme/defaults/graphite.json +0 -102
  313. package/src/theme/defaults/index.d.ts +0 -10289
  314. package/src/theme/defaults/index.ts +0 -203
  315. package/src/theme/defaults/light-arctic.json +0 -117
  316. package/src/theme/defaults/light-aurora-day.json +0 -101
  317. package/src/theme/defaults/light-canyon.json +0 -101
  318. package/src/theme/defaults/light-catppuccin.json +0 -116
  319. package/src/theme/defaults/light-cirrus.json +0 -100
  320. package/src/theme/defaults/light-coral.json +0 -105
  321. package/src/theme/defaults/light-cyberpunk.json +0 -106
  322. package/src/theme/defaults/light-dawn.json +0 -100
  323. package/src/theme/defaults/light-dunes.json +0 -101
  324. package/src/theme/defaults/light-eucalyptus.json +0 -105
  325. package/src/theme/defaults/light-forest.json +0 -110
  326. package/src/theme/defaults/light-frost.json +0 -105
  327. package/src/theme/defaults/light-github.json +0 -125
  328. package/src/theme/defaults/light-glacier.json +0 -101
  329. package/src/theme/defaults/light-gruvbox.json +0 -118
  330. package/src/theme/defaults/light-haze.json +0 -100
  331. package/src/theme/defaults/light-honeycomb.json +0 -105
  332. package/src/theme/defaults/light-lagoon.json +0 -101
  333. package/src/theme/defaults/light-lavender.json +0 -105
  334. package/src/theme/defaults/light-meadow.json +0 -101
  335. package/src/theme/defaults/light-mint.json +0 -105
  336. package/src/theme/defaults/light-monochrome.json +0 -111
  337. package/src/theme/defaults/light-ocean.json +0 -109
  338. package/src/theme/defaults/light-one.json +0 -109
  339. package/src/theme/defaults/light-opal.json +0 -101
  340. package/src/theme/defaults/light-orchard.json +0 -101
  341. package/src/theme/defaults/light-paper.json +0 -105
  342. package/src/theme/defaults/light-poimandres.json +0 -125
  343. package/src/theme/defaults/light-prism.json +0 -100
  344. package/src/theme/defaults/light-retro.json +0 -108
  345. package/src/theme/defaults/light-sand.json +0 -105
  346. package/src/theme/defaults/light-savanna.json +0 -101
  347. package/src/theme/defaults/light-solarized.json +0 -112
  348. package/src/theme/defaults/light-soleil.json +0 -100
  349. package/src/theme/defaults/light-sunset.json +0 -109
  350. package/src/theme/defaults/light-synthwave.json +0 -108
  351. package/src/theme/defaults/light-tokyo-night.json +0 -121
  352. package/src/theme/defaults/light-wetland.json +0 -101
  353. package/src/theme/defaults/light-zenith.json +0 -99
  354. package/src/theme/defaults/limestone.json +0 -104
  355. package/src/theme/defaults/mahogany.json +0 -107
  356. package/src/theme/defaults/marble.json +0 -103
  357. package/src/theme/defaults/obsidian.json +0 -101
  358. package/src/theme/defaults/onyx.json +0 -101
  359. package/src/theme/defaults/pearl.json +0 -103
  360. package/src/theme/defaults/porcelain.json +0 -101
  361. package/src/theme/defaults/quartz.json +0 -106
  362. package/src/theme/defaults/sandstone.json +0 -105
  363. package/src/theme/defaults/titanium.json +0 -100
@@ -15,7 +15,7 @@ export declare const yieldToolRenderer: {
15
15
  renderCall(args: YieldRenderArgs, options: RenderResultOptions, theme: Theme): Component;
16
16
  renderResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, theme: Theme, args?: YieldRenderArgs): Component;
17
17
  describeCall(args: YieldRenderArgs, options: RenderResultOptions): NativeToolView;
18
- describeResult(result: ToolRenderResult<YieldItem>, _options: RenderResultContextOptions, args?: YieldRenderArgs): NativeToolView;
18
+ describeResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, args?: YieldRenderArgs): NativeToolView;
19
19
  mergeCallAndResult: true;
20
20
  animatedPendingPreview: true;
21
21
  };
@@ -80,7 +80,9 @@ export interface TUIStartOptions {
80
80
  * switches to raw input and replays the kernel-buffered keystrokes.
81
81
  *
82
82
  * A terminal expected to speak TSP needs raw input from the start, so it
83
- * gets it; its keystrokes are held instead (TSP events and the cell-size
83
+ * gets it. Plain typing (printable text, Backspace) still edits the focused
84
+ * component live, as the kernel echo shows it elsewhere; the first other key
85
+ * and every key after it are held instead (TSP events and the cell-size
84
86
  * reply still apply) until {@link TUI.releaseHeldInput} replays them.
85
87
  */
86
88
  deferInput?: boolean;
@@ -363,6 +365,8 @@ export declare class TUI extends Container {
363
365
  * observers (live stream publisher, session recorder) coexist.
364
366
  */
365
367
  addPaintListener(listener: PaintListener): () => void;
368
+ /** Observe actual ANSI frame writes, including transient resize paints; returns the unsubscribe. */
369
+ addFrameWriteListener(listener: (data: string) => void): () => void;
366
370
  /** Install the product-owned bounded frame provider. */
367
371
  setFrameProvider(provider: TerminalFrameProvider | undefined): void;
368
372
  get fullRedraws(): number;
@@ -523,7 +527,10 @@ export declare class TUI extends Container {
523
527
  * never come.
524
528
  */
525
529
  addStartListener(listener: StartListener): () => void;
526
- addInputListener(listener: InputListener): () => void;
530
+ /** Registers a key listener; `prepend` gives a foreground input owner first refusal over global shortcuts. */
531
+ addInputListener(listener: InputListener, options?: {
532
+ prepend?: boolean;
533
+ }): () => void;
527
534
  removeInputListener(listener: InputListener): void;
528
535
  stop(): void;
529
536
  /**
@@ -64,13 +64,43 @@ export type VimCommand = {
64
64
  fromLine: number;
65
65
  toLine: number;
66
66
  out: boolean;
67
+ } | {
68
+ kind: "retype";
69
+ record: VimInsertRecord;
70
+ times: number;
71
+ newline: boolean;
72
+ overwrite: boolean;
67
73
  };
74
+ /** What an Insert/Replace session typed, relative to where it started; `.` replays it. */
75
+ export interface VimInsertRecord {
76
+ /** Graphemes removed before the session's start cursor (Backspace past the insert point). */
77
+ deleteBefore: number;
78
+ /** Graphemes removed after it (forward delete). */
79
+ deleteAfter: number;
80
+ text: string;
81
+ }
68
82
  /** Start offset of the grapheme after `col`, clamped to `text.length`. */
69
83
  export declare function nextGraphemeStart(text: string, col: number): number;
70
84
  /** Start offset of the grapheme before `col`, clamped to 0. */
71
85
  export declare function prevGraphemeStart(text: string, col: number): number;
72
86
  /** Offset of the final grapheme — where a Normal-mode cursor rests on a non-empty line. */
73
87
  export declare function lastGraphemeStart(text: string): number;
88
+ export declare function countGraphemes(text: string): number;
89
+ /** Offset `count` graphemes forward or backward from `offset`, clamped to the text. */
90
+ export declare function stepGraphemes(text: string, offset: number, count: number, forward: boolean): number;
91
+ /**
92
+ * What a session turned `before` into, anchored at its start `cursor`: the prefix match stops at the
93
+ * cursor and the suffix match never crosses it, so typing `aa` before an existing `a` records `aa`
94
+ * at the cursor rather than after the old one. Comparisons are whole graphemes, so a shared high
95
+ * surrogate cannot split an emoji into the replayed text.
96
+ */
97
+ export declare function diffInsertSession(before: string, cursor: number, after: string): VimInsertRecord;
98
+ /** Buffer flattened to one string plus the cursor's offset in it, so scans can cross lines. */
99
+ export declare function flatten(buf: VimBuffer): {
100
+ text: string;
101
+ cursor: number;
102
+ };
103
+ export declare function offsetToPos(lines: readonly string[], offset: number): VimPosition;
74
104
  export declare class VimState {
75
105
  #private;
76
106
  mode: VimMode;
@@ -94,6 +124,15 @@ export declare class VimState {
94
124
  * through to its regular handling (and, for Escape in Normal mode, to the app's interrupt).
95
125
  */
96
126
  handleKey(key: string, buf: VimBuffer): VimCommand[] | null;
127
+ /**
128
+ * Attach what an Insert/Replace session typed to the change that opened it. After an arrow key
129
+ * split the session, Vim's redo becomes a plain insert of the text typed since.
130
+ */
131
+ recordInsert(record: VimInsertRecord, afterArrow: boolean): void;
132
+ /** Commit a staged change when the editor confirms text changed. */
133
+ commitChange(): void;
134
+ /** Discard a staged change when the command was a no-op (e.g. `J` on the last line). */
135
+ discardChange(): void;
97
136
  }
98
137
  /**
99
138
  * Normalized, end-exclusive span covered by a Visual selection.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@linxiraos/pi-tui",
4
- "version": "1.4.4",
4
+ "version": "1.4.7",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://linxira-os.github.io/zeta/",
7
7
  "author": "Linxira-OS",
@@ -38,20 +38,20 @@
38
38
  "gen:glyphs": "bun scripts/gen-glyphs.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@linxiraos/pi-omptype": "1.4.4",
42
- "@linxiraos/pi-agent-core": "1.4.4",
43
- "@linxiraos/pi-ai": "1.4.4",
44
- "@linxiraos/pi-catalog": "1.4.4",
45
- "@linxiraos/pi-natives": "1.4.4",
46
- "@linxiraos/pi-utils": "1.4.4",
47
- "@linxiraos/pi-wire": "1.4.4",
48
- "@linxiraos/pi-snapcompact": "1.4.4"
41
+ "@linxiraos/pi-omptype": "1.4.7",
42
+ "@linxiraos/pi-agent-core": "1.4.7",
43
+ "@linxiraos/pi-ai": "1.4.7",
44
+ "@linxiraos/pi-catalog": "1.4.7",
45
+ "@linxiraos/pi-natives": "1.4.7",
46
+ "@linxiraos/pi-utils": "1.4.7",
47
+ "@linxiraos/pi-wire": "1.4.7",
48
+ "@linxiraos/pi-snapcompact": "1.4.7"
49
49
  },
50
50
  "devDependencies": {
51
51
  "kitty-vt-wasm": "^0.2.0"
52
52
  },
53
53
  "engines": {
54
- "bun": ">=1.3.14"
54
+ "bun": ">=1.4.4"
55
55
  },
56
56
  "files": [
57
57
  "src",
@@ -70,10 +70,6 @@
70
70
  "types": "./dist/types/theme/index.d.ts",
71
71
  "import": "./src/theme/index.ts"
72
72
  },
73
- "./theme/defaults": {
74
- "types": "./dist/types/theme/defaults/index.d.ts",
75
- "import": "./src/theme/defaults/index.ts"
76
- },
77
73
  "./theme/*": {
78
74
  "types": "./dist/types/theme/*.d.ts",
79
75
  "import": "./src/theme/*.ts"
@@ -20,6 +20,7 @@ interface AppKeybindings {
20
20
  "app.ask.hide": true;
21
21
  "app.approval.approve": true;
22
22
  "app.editor.external": true;
23
+ "app.local.open": true;
23
24
  "app.message.followUp": true;
24
25
  "app.retry": true;
25
26
  "app.message.dequeue": true;
@@ -38,10 +39,13 @@ interface AppKeybindings {
38
39
  "app.session.rename": true;
39
40
  "app.session.delete": true;
40
41
  "app.session.deleteNoninvasive": true;
42
+ "app.session.pin": true;
43
+ "app.session.unpin": true;
41
44
  "app.tree.previousBranch": true;
42
45
  "app.tree.nextBranch": true;
43
46
  "app.plan.toggle": true;
44
47
  "app.history.search": true;
48
+ "app.links.hint": true;
45
49
  "app.stt.pushToTalk": true;
46
50
  "app.stt.toggle": true;
47
51
  "app.live.toggle": true;
@@ -252,6 +256,10 @@ export declare const KEYBINDINGS: {
252
256
  readonly defaultKeys: "ctrl+g";
253
257
  readonly description: "Open external editor";
254
258
  };
259
+ readonly "app.local.open": {
260
+ readonly defaultKeys: "alt+g";
261
+ readonly description: "Open a local:// file in external editor";
262
+ };
255
263
  readonly "app.message.followUp": {
256
264
  readonly defaultKeys: ["ctrl+q", "ctrl+enter"];
257
265
  readonly description: "Send follow-up message";
@@ -324,6 +332,14 @@ export declare const KEYBINDINGS: {
324
332
  readonly defaultKeys: "ctrl+backspace";
325
333
  readonly description: "Delete session (non-invasive)";
326
334
  };
335
+ readonly "app.session.pin": {
336
+ readonly defaultKeys: "alt+k";
337
+ readonly description: "Pin the selected session in the resume picker";
338
+ };
339
+ readonly "app.session.unpin": {
340
+ readonly defaultKeys: "alt+shift+k";
341
+ readonly description: "Unpin the selected session in the resume picker";
342
+ };
327
343
  readonly "app.tree.previousBranch": {
328
344
  readonly defaultKeys: [];
329
345
  readonly description: "Jump to the previous branch in /tree";
@@ -340,6 +356,10 @@ export declare const KEYBINDINGS: {
340
356
  readonly defaultKeys: "ctrl+r";
341
357
  readonly description: "Search history";
342
358
  };
359
+ readonly "app.links.hint": {
360
+ readonly defaultKeys: "alt+o";
361
+ readonly description: "Pick an extension link on screen by its hint tag";
362
+ };
343
363
  readonly "app.stt.pushToTalk": {
344
364
  readonly defaultKeys: "space";
345
365
  readonly description: "Hold to record speech-to-text";
@@ -40,6 +40,7 @@ interface AppKeybindings {
40
40
  "app.ask.hide": true;
41
41
  "app.approval.approve": true;
42
42
  "app.editor.external": true;
43
+ "app.local.open": true;
43
44
  "app.message.followUp": true;
44
45
  "app.retry": true;
45
46
  "app.message.dequeue": true;
@@ -58,10 +59,13 @@ interface AppKeybindings {
58
59
  "app.session.rename": true;
59
60
  "app.session.delete": true;
60
61
  "app.session.deleteNoninvasive": true;
62
+ "app.session.pin": true;
63
+ "app.session.unpin": true;
61
64
  "app.tree.previousBranch": true;
62
65
  "app.tree.nextBranch": true;
63
66
  "app.plan.toggle": true;
64
67
  "app.history.search": true;
68
+ "app.links.hint": true;
65
69
  "app.stt.pushToTalk": true;
66
70
  "app.stt.toggle": true;
67
71
  "app.live.toggle": true;
@@ -154,6 +158,10 @@ export const KEYBINDINGS = {
154
158
  defaultKeys: "ctrl+g",
155
159
  description: "Open external editor",
156
160
  },
161
+ "app.local.open": {
162
+ defaultKeys: "alt+g",
163
+ description: "Open a local:// file in external editor",
164
+ },
157
165
  "app.message.followUp": {
158
166
  // Ctrl+Enter is preserved for terminals that deliver it (Kitty/iTerm2/WezTerm/Ghostty),
159
167
  // but Windows Terminal does not emit a distinct event for Ctrl+Enter — Ctrl+Q is listed
@@ -234,6 +242,14 @@ export const KEYBINDINGS = {
234
242
  defaultKeys: "ctrl+backspace",
235
243
  description: "Delete session (non-invasive)",
236
244
  },
245
+ "app.session.pin": {
246
+ defaultKeys: "alt+k",
247
+ description: "Pin the selected session in the resume picker",
248
+ },
249
+ "app.session.unpin": {
250
+ defaultKeys: "alt+shift+k",
251
+ description: "Unpin the selected session in the resume picker",
252
+ },
237
253
  "app.tree.previousBranch": {
238
254
  defaultKeys: [],
239
255
  description: "Jump to the previous branch in /tree",
@@ -250,6 +266,10 @@ export const KEYBINDINGS = {
250
266
  defaultKeys: "ctrl+r",
251
267
  description: "Search history",
252
268
  },
269
+ "app.links.hint": {
270
+ defaultKeys: "alt+o",
271
+ description: "Pick an extension link on screen by its hint tag",
272
+ },
253
273
  "app.stt.pushToTalk": {
254
274
  defaultKeys: "space",
255
275
  description: "Hold to record speech-to-text",
@@ -14,6 +14,9 @@ export interface SessionPickerHost<T extends SessionSelectorEntry = SessionSelec
14
14
  loadPinnedIds?(): Promise<ReadonlySet<string>>;
15
15
  loadHistoryMatcher?(): SessionHistoryMatcher;
16
16
  deleteSession?(session: T): Promise<boolean>;
17
+ /** Rename the session and resolve with the title as stored, or null when it did not happen. */
18
+ renameSession?(session: T, title: string): Promise<string | null>;
19
+ setSessionPinned?(session: T, pinned: boolean): Promise<void>;
17
20
  loadAllSessions?(): Promise<T[]>;
18
21
  /** Builds the three-level resume source for the standalone `--resume` tree. */
19
22
  loadResumeSource?(deleteMode: "trash" | "permanent", workspacePath?: string): Promise<ResumeTreeSource | undefined>;
@@ -26,6 +29,8 @@ export interface SessionPickerOptions<T extends SessionSelectorEntry = SessionSe
26
29
  scopeLabel?: string | false;
27
30
  showCwd?: boolean;
28
31
  allowDelete?: boolean;
32
+ /** Rename the selected session; resolve with the title as stored, or null when it did not happen. */
33
+ onRename?: (session: T, title: string) => Promise<string | null>;
29
34
  allowGlobalScope?: boolean;
30
35
  historySearch?: boolean;
31
36
  pinnedIds?: ReadonlySet<string>;
@@ -79,6 +84,8 @@ export async function selectSession<T extends SessionSelectorEntry>(
79
84
  },
80
85
  {
81
86
  onDelete: options.allowDelete === false ? undefined : host.deleteSession,
87
+ onRename: options.onRename ?? host.renameSession,
88
+ onSetPinned: host.setSessionPinned,
82
89
  historyMatcher,
83
90
  loadAllSessions: options.allowGlobalScope === false ? undefined : host.loadAllSessions,
84
91
  allSessions: options.allSessions,
@@ -419,9 +419,10 @@ export type ChartAnnotation = {
419
419
  export declare function planChart(table: TableAnalysis): ChartPlan | undefined;
420
420
  /**
421
421
  * Whether a model should pick `table`'s chart (`tui.autoGraph: smart`):
422
- * multi-series tables, and tables whose rows may be named by a number the
423
- * `guess` plots (`Thread | State`, `Finding | Current`), where only meaning
424
- * tells a name from a measure.
422
+ * multi-series tables, tables whose rows may be named by a number the
423
+ * `guess` plots (`Thread | State`, `Finding | Current`), and any other chart
424
+ * the guess would draw — only meaning tells a measure from page references,
425
+ * step numbers or figures quoted in prose, which the judge charts as none.
425
426
  */
426
427
  export declare function shouldJudge(table: TableAnalysis, guess: ChartPlan | undefined): boolean;
427
428
  /** Measure columns before `guess`'s text label column: numbers that may only name their rows. */
@@ -446,10 +447,11 @@ export declare function tableTakeaways(table: TableAnalysis, plan: ChartPlan, co
446
447
  */
447
448
  export declare function drawnNames(spec: ChartSpec): Set<string>;
448
449
  /**
449
- * The local guess at what `plan`'s rows and measures mean: header keywords
450
- * for each measure's {@link Polarity} (resources like tokens or memory only
451
- * beside a baseline), rivals from the label's header, focus from bolded or
452
- * `(current)` row names, and a status column whose cells vary.
450
+ * The local guess at what `plan`'s rows and measures mean: each measure's
451
+ * {@link Polarity} as far as its unit says ({@link dimPolarity}; what a name
452
+ * means — `Memory` as a capacity or a cost — is the judge's call), rivals from
453
+ * the label's header, focus from bolded or `(current)` row names, and a status
454
+ * column whose cells vary.
453
455
  */
454
456
  export declare function guessMeaning(table: TableAnalysis, plan: ChartPlan): Pick<ChartPlan, "polarity" | "rowPolarity" | "rivals" | "focus" | "status">;
455
457
  /** Whether `plan`'s rows may each be a metric of their own: a `change`, a transposed table, or mixed-unit columns. */
@@ -33,7 +33,6 @@ import {
33
33
  isNumber,
34
34
  type NumberCell,
35
35
  parseCell,
36
- plainCell,
37
36
  type Status,
38
37
  type TableAnalysis,
39
38
  type TableColumn,
@@ -536,20 +535,6 @@ const NEST_SEPARATORS = [" — ", " – ", ": ", " · ", ", ", " ", "/", "-", "_
536
535
  /** Where a long row name's description starts (`Payroll (10 people…)`, `@watzon — #19, #53`). */
537
536
  const DESCRIPTION = / [—–] | - |: | \(/;
538
537
 
539
- /**
540
- * Measures that improve upward, by header: pass and success rates, retrieval
541
- * scores, throughput, speedups and savings.
542
- */
543
- const HIGHER_BETTER =
544
- /(?:^|[^\w])(?:pass(?:ed|es|ing)?|pass ?%|pass ?rate|success(?:es|ful)?|succeeded|accuracy|acc|recall|precision|prec|f1|em|exact[_ ]?match|scores?|wins?|win ?rate|hit ?rate|throughput|qps|rps|ops\/s|req\/s|tok\/s|tokens\/s|speedup|faster|improvement|savings?|saved|gain|coverage|quality|relevance|correct|solved|ok|renders|completion ?rate|uptime|performance|profits?|roi|pnl|growth|per \$|\/\$)(?![\w])/i;
545
- /** Measures that improve downward, by header: cost, time, failures. */
546
- const LOWER_BETTER =
547
- /(?:^|[^\w])(?:cost|costs|price|bill|spend|usd|latency|time|duration|wall(?: ?clock)?|elapsed|errors?|err|fail(?:s|ed|ures?)?|timeouts?|miss(?:es)?|crash(?:es)?|regressions?|bugs?|warnings?|retries|turns|p\d{2}|blockers|violations|leaks?|stalls?|load|\$\/\w+)(?![\w])/i;
548
- /** Resources a before/after change aims to shrink: lower is better only beside a baseline. */
549
- const LOWER_IN_CHANGE =
550
- /(?:^|[^\w])(?:tokens?|tok|rss|memory|mem|heap|allocs?|allocations?|clones|size|bytes|cpu|gc|input|output)(?![\w])/i;
551
- /** Names of shares and counts that describe rather than score: no polarity whatever else they say. */
552
- const NEUTRAL = /(?:^|[^\w])(?:share|shares|% of|portion|fraction|distribution|breakdown)(?![\w])/i;
553
538
  /** Label headers naming rival options a table compares (models, configs, arms). */
554
539
  const RIVALS =
555
540
  /(?:^|[^\w])(?:models?|config(?:uration)?s?|arms?|variants?|approach(?:es)?|options?|plans?|polic(?:y|ies)|providers?|modes?|strateg(?:y|ies)|candidates?|settings?|shapes?|backends?|engines?|librar(?:y|ies)|implementations?|vendors?|tools?|methods?|algorithms?|setups?|runs?)(?![\w])/i;
@@ -606,13 +591,16 @@ export function planChart(table: TableAnalysis): ChartPlan | undefined {
606
591
 
607
592
  /**
608
593
  * Whether a model should pick `table`'s chart (`tui.autoGraph: smart`):
609
- * multi-series tables, and tables whose rows may be named by a number the
610
- * `guess` plots (`Thread | State`, `Finding | Current`), where only meaning
611
- * tells a name from a measure.
594
+ * multi-series tables, tables whose rows may be named by a number the
595
+ * `guess` plots (`Thread | State`, `Finding | Current`), and any other chart
596
+ * the guess would draw — only meaning tells a measure from page references,
597
+ * step numbers or figures quoted in prose, which the judge charts as none.
612
598
  */
613
599
  export function shouldJudge(table: TableAnalysis, guess: ChartPlan | undefined): boolean {
614
600
  if (!guess || table.rows.length < 3) return false;
615
- return table.measures.length >= 2 || leadingMeasures(table, guess).length > 0;
601
+ if (table.measures.length >= 2 || leadingMeasures(table, guess).length > 0) return true;
602
+ const spec = buildChart(table, guess);
603
+ return spec !== undefined && worthCharting(spec);
616
604
  }
617
605
 
618
606
  /** Measure columns before `guess`'s text label column: numbers that may only name their rows. */
@@ -696,38 +684,33 @@ export function drawnNames(spec: ChartSpec): Set<string> {
696
684
  }
697
685
 
698
686
  /**
699
- * The local guess at what `plan`'s rows and measures mean: header keywords
700
- * for each measure's {@link Polarity} (resources like tokens or memory only
701
- * beside a baseline), rivals from the label's header, focus from bolded or
702
- * `(current)` row names, and a status column whose cells vary.
687
+ * The local guess at what `plan`'s rows and measures mean: each measure's
688
+ * {@link Polarity} as far as its unit says ({@link dimPolarity}; what a name
689
+ * means — `Memory` as a capacity or a cost — is the judge's call), rivals from
690
+ * the label's header, focus from bolded or `(current)` row names, and a status
691
+ * column whose cells vary.
703
692
  */
704
693
  export function guessMeaning(
705
694
  table: TableAnalysis,
706
695
  plan: ChartPlan,
707
696
  ): Pick<ChartPlan, "polarity" | "rowPolarity" | "rivals" | "focus" | "status"> {
708
697
  const label = plan.label === undefined ? undefined : table.columns[plan.label];
709
- // A comparison of two conditions reads resources (tokens, memory) the way a change does.
698
+ // A comparison of two conditions reads money and sizes the way a change does: as what it cuts.
710
699
  const change =
711
700
  plan.kind === "change" || plan.kind === "stat" || table.columns.some(column => BEFORE.test(column.header));
712
701
  const polarity: Record<number, Polarity> = {};
713
702
  for (const column of table.columns) {
714
- if (column === label) continue;
715
703
  // A signed delta's sign convention (saved vs. spent) is not in its unit.
716
- const delta = DELTA.test(column.header) || column.signedShare >= 0.5;
717
- const guessed =
718
- headerPolarity(column.header, change) ??
719
- (column.role === "measure" && !delta
720
- ? dimPolarity(column.dim, column.unit, change, column.scores)
721
- : undefined);
704
+ if (column === label || column.role !== "measure" || DELTA.test(column.header) || column.signedShare >= 0.5)
705
+ continue;
706
+ const guessed = dimPolarity(column.dim, column.unit, change, column.scores);
722
707
  if (guessed) polarity[column.index] = guessed;
723
708
  }
724
709
  const rowPolarity: Record<number, Polarity> = {};
725
710
  if (label && rowsAreMetrics(table, plan))
726
711
  for (const row of [...table.rows, ...table.totals]) {
727
712
  const first = plan.series.map(index => table.columns[index]!.cells[row]).find(isNumber);
728
- const guessed =
729
- headerPolarity(label.cells[row]!.text, true) ??
730
- (first ? dimPolarity(first.dim, first.unit, true, false) : undefined);
713
+ const guessed = first && dimPolarity(first.dim, first.unit, change, false);
731
714
  if (guessed) rowPolarity[row] = guessed;
732
715
  }
733
716
  return {
@@ -745,23 +728,10 @@ export function rowsAreMetrics(table: TableAnalysis, plan: ChartPlan): boolean {
745
728
  }
746
729
 
747
730
  /**
748
- * A measure's {@link Polarity} from its name (`undefined` when it names
749
- * none); `change` admits resources a change aims to shrink.
750
- */
751
- function headerPolarity(name: string, change: boolean): Polarity | undefined {
752
- // `gtTagRelevance`: camelCase words read apart.
753
- const plain = plainCell(name).text.replace(/([a-z])([A-Z])/g, "$1 $2");
754
- if (NEUTRAL.test(plain)) return undefined;
755
- if (HIGHER_BETTER.test(plain)) return "higher";
756
- if (LOWER_BETTER.test(plain)) return "lower";
757
- if (change && LOWER_IN_CHANGE.test(plain)) return "lower";
758
- return undefined;
759
- }
760
-
761
- /**
762
- * A measure's {@link Polarity} from its unit when its name gives none:
731
+ * A measure's {@link Polarity} from the unit its values are written in:
763
732
  * scores out of a total and rates per second climb, durations shrink, and
764
- * money and sizes shrink beside a baseline.
733
+ * money and sizes shrink beside a baseline (`change`). Elsewhere a size may
734
+ * be a capacity (`L2 cache`, `Memory`) and money a budget: no polarity.
765
735
  */
766
736
  function dimPolarity(dim: Dimension | undefined, unit: string, change: boolean, scores: boolean): Polarity | undefined {
767
737
  if (scores) return "higher";
@@ -2,6 +2,7 @@ import { type Component } from "../tui";
2
2
  import { Disclosure } from "../components/disclosure";
3
3
  import { visibleWidth } from "../utils";
4
4
  import type { AdvisorMessageDetails, AdvisorNote, AdvisorSeverity } from "./messages";
5
+ import { chatTranscriptDisplayPreferences } from "./display-preferences";
5
6
  import { formatBadge, replaceTabs, type ToolUIColor, wrapTextWithAnsi } from "../render/render-utils";
6
7
  import { Ellipsis, truncateToWidth } from "../render";
7
8
  import type { Theme } from "../theme";
@@ -274,6 +275,7 @@ export function createAdvisorMessageCard(
274
275
  body: () => new AdvisorNotes(notes, 0, uiTheme),
275
276
  expanded: getExpanded(),
276
277
  paddingX: 1,
278
+ maxCollapsedRows: chatTranscriptDisplayPreferences.advisorCollapsedLines || undefined,
277
279
  });
278
280
  // The tool-output toggle owns expansion state; synchronize the controlled
279
281
  // disclosure from the callback on every render.
@@ -1,7 +1,7 @@
1
1
  import type { AssistantMessage, ImageContent } from "@linxiraos/pi-ai";
2
2
  import { type Component, Container } from "../tui";
3
3
  import { type ImageBudget } from "../components/image";
4
- import type { AssistantThinkingRenderer } from "./extension-types";
4
+ import type { AssistantTextRenderer, AssistantTextRendering, AssistantThinkingRenderer } from "./extension-types";
5
5
  import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node";
6
6
  import { type CacheInvalidation } from "./cache-invalidation-marker";
7
7
  import { type ServedModelMismatch } from "./served-model-marker";
@@ -38,7 +38,7 @@ export declare class AssistantMessageComponent extends Container {
38
38
  * for lack of a target is re-rendered with its reaction stripped.
39
39
  */
40
40
  pickReactionTarget(transcript: readonly Component[]): void;
41
- constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string>, expandThinkingBlocks?: boolean);
41
+ constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string>, expandThinkingBlocks?: boolean, textRendering?: AssistantTextRendering);
42
42
  /**
43
43
  * Show or clear the trailing cache-invalidation divider. Set at `message_end`
44
44
  * (live) or during rebuild, once the turn's usage is known and compared
@@ -87,7 +87,7 @@ export declare class AssistantMessageComponent extends Container {
87
87
  */
88
88
  setExpanded(expanded: boolean): void;
89
89
  isTranscriptBlockFinalized(): boolean;
90
- /** Whether a figure still waits for the raster of its final source; the transcript holds retirement meanwhile. */
90
+ /** Hold image and figure rendering until the completed block can enter immutable scrollback. */
91
91
  isTranscriptBlockPending(): boolean;
92
92
  render(width: number): readonly string[];
93
93
  /**
@@ -122,7 +122,19 @@ export declare class AssistantMessageComponent extends Container {
122
122
  renderTranscriptBlockEmergencyRow(width: number): string | undefined;
123
123
  getTranscriptBlockVersion(): number;
124
124
  markTranscriptBlockFinalized(): void;
125
+ /**
126
+ * Swap the extension text renderers (the setting enabling them changed) and redraw with them.
127
+ * Enabling them also drops rows already published as stable, since a renderer may rewrite them;
128
+ * callers MUST pair this with a scrollback-clearing display reset, as for
129
+ * {@link resetTranscriptStableRows}.
130
+ */
131
+ setTextRenderers(renderers: readonly AssistantTextRenderer[]): void;
125
132
  applyRetryRecovery(retryRecovery: AssistantMessage["retryRecovery"]): void;
133
+ /**
134
+ * Draw the current message again when it is the reply sent at `timestamp`, re-running the
135
+ * extension text renderers; returns whether it was. The caller schedules the frame.
136
+ */
137
+ rerenderMessage(timestamp: number): boolean;
126
138
  messagePersistenceKey(): string | undefined;
127
139
  /** Toggle rendering for assistant-native and tool-result images. */
128
140
  setImagesVisible(visible: boolean): void;