@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
@@ -0,0 +1,35 @@
1
+ import type { TspText } from "@linxiraos/pi-wire";
2
+ import type { NativeNode } from "../native/node.js";
3
+ import type { Component } from "../tui.js";
4
+ import { TranscriptBlock } from "./transcript-container.js";
5
+ /** How loud an inline transcript notice is; a native terminal styles it as `zeta.notice.<tone>`. */
6
+ export type NoticeTone = "info" | "success" | "warning" | "error";
7
+ /** Optional parts of a {@link noticeRow}. */
8
+ export interface NoticeRowOptions {
9
+ /** Icon name in place of the tone's own (`read` for a file read, `download` for an update). */
10
+ readonly icon?: string;
11
+ readonly key?: string;
12
+ }
13
+ /**
14
+ * One inline transcript notice for a native terminal (`zeta.notice.<tone>`): a
15
+ * leading icon beside the wrapped message. Warnings, errors, background-job
16
+ * completions and prompt file reads all draw as this row, so they read alike.
17
+ * The tone colors the icon (an info notice keeps it quiet); the message spans
18
+ * carry emphasis only (`path`, `mono`, `dim`), never the tone itself.
19
+ */
20
+ export declare function noticeRow(tone: NoticeTone, message: TspText, options?: NoticeRowOptions): NativeNode;
21
+ /**
22
+ * A transcript block that a native terminal draws as one {@link noticeRow}
23
+ * while a text terminal draws `ansi`.
24
+ */
25
+ export declare class TranscriptNotice extends TranscriptBlock {
26
+ #private;
27
+ constructor(native: NativeNode, ansi: readonly Component[]);
28
+ /**
29
+ * `showWarning` / `showError`: a blank row and the `Warning: …` / `Error: …`
30
+ * line in its color in a text terminal; natively the tone's icon and the
31
+ * message, the label left to the icon.
32
+ */
33
+ static line(tone: "warning" | "error", message: string): TranscriptNotice;
34
+ describe(): NativeNode;
35
+ }
@@ -1,24 +1,36 @@
1
+ import type { TspSpan } from "@linxiraos/pi-wire";
1
2
  import type { NativeNode } from "../native/node.js";
2
3
  import { type ThemeColor } from "../theme/index.js";
3
4
  import { TranscriptBlock } from "./transcript-container.js";
4
- /** One themed run of a status row. */
5
+ import { type NoticeTone } from "./transcript-notice.js";
6
+ /** One themed run of a status row's terminal line. */
5
7
  export interface TranscriptStatusPart {
6
8
  readonly text: string;
7
9
  readonly color: ThemeColor;
8
- /** Glyph art (tree connectors) drawn only in rows; native terminals draw their own structure. */
9
- readonly rowsOnly?: boolean;
10
10
  }
11
- /** One compact transcript status row assembled from themed parts, joined by single spaces. */
11
+ /** A status row in a native terminal: its {@link noticeRow}'s tone, icon and message. */
12
+ export interface TranscriptStatusNative {
13
+ readonly tone: NoticeTone;
14
+ /** Icon name in place of the tone's own. */
15
+ readonly icon?: string;
16
+ readonly message: readonly TspSpan[];
17
+ }
18
+ /**
19
+ * One compact transcript status row: the terminal line's themed parts (joined
20
+ * by single spaces, glyphs and brackets included) and the same row natively.
21
+ */
12
22
  export interface TranscriptStatusRow {
13
23
  readonly parts: readonly (TranscriptStatusPart | undefined)[];
14
24
  readonly indent?: number;
25
+ readonly native: TranscriptStatusNative;
15
26
  }
16
- /** Shared compact status-pill block used by notices and background activity. */
27
+ /**
28
+ * Shared compact status block for background activity and prompt file reads:
29
+ * one themed line per row in a text terminal, one notice row per row natively
30
+ * (`zeta.status-block`).
31
+ */
17
32
  export declare class TranscriptStatusBlock extends TranscriptBlock {
18
33
  #private;
19
34
  constructor(rows: readonly TranscriptStatusRow[]);
20
- /** Append a supplemental line such as an artifact warning. */
21
- addLine(parts: readonly (TranscriptStatusPart | undefined)[], indent?: number): void;
22
- /** One wrapped text line per status row. */
23
35
  describe(): NativeNode;
24
36
  }
@@ -98,6 +98,14 @@ export declare class Editor implements Component, Focusable {
98
98
  describeDecorations: ((lines: readonly string[]) => readonly TspEditorDecoration[]) | undefined;
99
99
  /** TSP code language of the buffer (`python`, `bash`): the terminal highlights it in the mono face. */
100
100
  describeLanguage: (() => string | undefined) | undefined;
101
+ /** Label the TSP field to disable host-side editing while another input owner handles raw keys. */
102
+ nativeKeyPassthrough: boolean;
103
+ /**
104
+ * Ask the TSP terminal to keep what is typed into this field and draw it at
105
+ * the caret until this clears, then send it: set while startup cannot read
106
+ * input yet (the prompt composer's deferred-input start).
107
+ */
108
+ nativeTypeahead: boolean;
101
109
  /**
102
110
  * TSP chrome around the `editor` node (the prompt composer's chips, mode
103
111
  * chip, send/stop): the root role, the children with `input` placed where
@@ -31,6 +31,21 @@ export interface ImageOptions {
31
31
  * synchronously instead of committing its reserved blank rows.
32
32
  */
33
33
  export declare function renderForScrollback<T>(render: () => T): T;
34
+ /**
35
+ * Run `render` to measure rows outside display order — a newest-first height
36
+ * walk, say. {@link ImageBudget} derives demotion from the order images are
37
+ * observed in, so a budgeted {@link Image} inside this scope claims no display
38
+ * slot: it replays the decision its slot in the surface's last full pass
39
+ * implies. `images` reports whether any budgeted image was observed; the caller
40
+ * MUST render every such block it lays out again, outside this scope and in
41
+ * display order, or its images keep no slot in the pass.
42
+ */
43
+ export declare function measureRender<T>(render: () => T): {
44
+ value: T;
45
+ images: boolean;
46
+ demoted: boolean;
47
+ unresolved: boolean;
48
+ };
34
49
  /** Widest an {@link Image} rendered at `width` columns draws; callers sizing a raster for it (`SvgFigure`) match it. */
35
50
  export declare function imageMaxColumns(width: number): number;
36
51
  /** Default count of inline images kept as live graphics before older ones fall back to text. */
@@ -118,6 +133,11 @@ export declare class ImageBudget {
118
133
  * During a `stable` pass ({@link beginPass}) the call order and visible subset
119
134
  * are not authoritative, so the decision is the surface's committed
120
135
  * on-terminal split, keyed by id — order- and partiality-independent.
136
+ *
137
+ * Inside {@link measureRender} the call claims no slot: it answers what the
138
+ * image's slot in the last full pass implies under the planned threshold,
139
+ * which is what the display-order render that follows will decide once the
140
+ * split has converged.
121
141
  */
122
142
  observe(imageId: number): boolean;
123
143
  /**
@@ -75,6 +75,6 @@ export declare class Loader extends Text {
75
75
  * session title). Re-evaluated every paint; dropped when the row leaves
76
76
  * less than a two-cell gap. */
77
77
  setTrailer(trailer: (() => string | undefined) | undefined): void;
78
- setMessage(message: string): void;
78
+ setMessage(message: string | (() => string)): void;
79
79
  }
80
80
  export {};
@@ -10,6 +10,13 @@ import type { Component } from "../tui.js";
10
10
  * byte-identical to rendering `text`.
11
11
  */
12
12
  export declare function streamingMarkdownSource(text: string): string;
13
+ /**
14
+ * Whether `text` ends inside a code fence the source never closed. The
15
+ * renderer still draws such a fence's closing border, so a caller publishing a
16
+ * settled source prefix must drop that fabricated row: it is not a prefix of
17
+ * the live block, which reaches the border only once the closer arrives.
18
+ */
19
+ export declare function endsInsideOpenFence(text: string): boolean;
13
20
  /**
14
21
  * Streaming `md` source for a native terminal, minus a still-growing table row:
15
22
  * the unterminated last line when a GFM table (a run of pipe lines holding a
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Content-addressed binary blobs (images) for `image` nodes.
3
+ *
4
+ * `describe()` registers the bytes and puts the returned id in `image.p.blob`;
5
+ * the native backend delivers each referenced blob once per terminal
6
+ * connection (asking the terminal first which it holds, or through its blob
7
+ * cache), else uploads it with verb `b` before the frame that first
8
+ * references it.
9
+ */
1
10
  import type { TspProps } from "@linxiraos/pi-wire";
2
11
  import type { NativeChild, NativeNode } from "./node.js";
3
12
  export interface NativeBlob {
@@ -20,7 +29,8 @@ export declare function base64ImageNode(data: string, mimeType: string, p?: Omit
20
29
  /**
21
30
  * Props that make an `image` node open the file at `filePath` (as a `file://` URL, the TSP
22
31
  * open-target form): a click zooms the image in the terminal, and the file opens from its
23
- * context menu. Empty without a file.
32
+ * context menu. Always uses a local file URL because the open action runs locally,
33
+ * even when remote file handlers are configured. Empty without a file.
24
34
  */
25
35
  export declare function openableImageProps(filePath: string | undefined): Pick<TspProps<"image">, "href" | "actions">;
26
36
  /**
@@ -16,14 +16,14 @@
16
16
  * the item id and `action` with an action id (plus `value` for
17
17
  * `scope`/`tab`/`strip`). {@link pickerEvent} folds them into one shape.
18
18
  */
19
- import type { TspPickerAction, TspPickerItem, TspPickerProps } from "@linxiraos/pi-wire";
19
+ import type { TspPickerAction, TspPickerItem, TspPickerProps, TspProps } from "@linxiraos/pi-wire";
20
20
  import type { KeyName } from "../key-hint-format.js";
21
21
  import { type Keybinding } from "../keybindings.js";
22
22
  import type { Input } from "../components/input.js";
23
23
  import type { SelectItem, SelectList } from "../components/select-list.js";
24
24
  import type { NativeChild, NativeNode, NativeUiEvent } from "./node.js";
25
25
  /** The picker sheet; `preview` children fill its preview pane. */
26
- export declare function picker(p: TspPickerProps, preview?: readonly NativeChild[]): NativeNode;
26
+ export declare function picker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode;
27
27
  /**
28
28
  * A picker's search field from the {@link Input} that edits it: the text and
29
29
  * its caret. `null` hides the field. Memoized pickers MUST key on the caret
@@ -37,7 +37,7 @@ export declare const PICKER_KEY = "picker";
37
37
  * the picker as child {@link PICKER_KEY}, which the reconciler hoists into
38
38
  * `layer`. Route its events with `pickerEvent(event, PICKER_KEY)`.
39
39
  */
40
- export declare function dockedPicker(p: TspPickerProps, preview?: readonly NativeChild[]): NativeNode;
40
+ export declare function dockedPicker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode;
41
41
  /** Keycap names for one key id (`"alt+enter"` → `["alt", "enter"]`, `"escape"` → `["esc"]`). */
42
42
  export declare function pickerKeys(key: KeyName | string): string[];
43
43
  /** The keycaps of a keybinding's primary key, empty when unbound. */
@@ -83,7 +83,7 @@ export interface SelectPickerOptions {
83
83
  readonly subtitle?: string;
84
84
  readonly icon?: string;
85
85
  readonly noun?: string;
86
- /** Show omp's filter text as the search field (lists that filter as you type). */
86
+ /** Show Zeta's filter text as the search field (lists that filter as you type). */
87
87
  readonly searchable?: boolean;
88
88
  /** Per-item extras (a thinking-level dot, a swatch mark, a budget fact). */
89
89
  readonly decorate?: (item: SelectItem) => Partial<Omit<TspPickerItem, "id">> | undefined;
@@ -22,8 +22,10 @@ import { type ModelBrowserSource } from "./model-browser.js";
22
22
  import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
23
23
  export declare const ADVISOR_REVIEW_MODES: readonly ["turn", "agent-end"];
24
24
  export declare const ADVISOR_SYNC_BACKLOG_MODES: readonly ["off", "1", "3", "5", "strict"];
25
+ export declare const ADVISOR_SESSION_SCOPES: readonly ["main", "subagent", "all"];
25
26
  export type AdvisorReviewMode = (typeof ADVISOR_REVIEW_MODES)[number];
26
27
  export type AdvisorSyncBacklog = (typeof ADVISOR_SYNC_BACKLOG_MODES)[number];
28
+ export type AdvisorSessionScope = (typeof ADVISOR_SESSION_SCOPES)[number];
27
29
  /** One advisor declared in `WATCHDOG.yml`; its instructions specialize the shared baseline. */
28
30
  export interface AdvisorConfig {
29
31
  name: string;
@@ -39,6 +41,10 @@ export interface AdvisorConfig {
39
41
  reviewMode?: AdvisorReviewMode;
40
42
  reviewInterval?: number;
41
43
  syncBacklog?: AdvisorSyncBacklog;
44
+ /** Which session kinds this advisor attaches to (`main`, `subagent`, or `all`; defaults to `all`). */
45
+ scope?: AdvisorSessionScope;
46
+ /** Whether primary assistant thinking blocks are included in updates sent to this advisor (defaults to `true`). */
47
+ includeReasoning?: boolean;
42
48
  }
43
49
  /** Which level a `WATCHDOG.yml` lives at: the project root or the user agent dir. */
44
50
  export type AdvisorConfigScope = "project" | "user";
@@ -44,5 +44,7 @@ export declare function aggregateMetrics<TRecord extends AgentRecordLike>(args:
44
44
  hasFallbackLiveSessions: boolean;
45
45
  };
46
46
  /** Parent-before-child projection preserving initial subtree rank and prepending new siblings. */
47
- export declare function projectAgentTree<TRecord extends AgentRecordLike>(refs: readonly TRecord[], rosterRank: ReadonlyMap<TRecord, number> | undefined): AgentTreeProjection<TRecord>;
47
+ export declare function projectAgentTree<TRecord extends AgentRecordLike>(refs: readonly TRecord[],
48
+ /** Rows spawned while the hub is open; such a child never lifts its parent's group. */
49
+ spawnedWhileOpen?: (ref: TRecord) => boolean): AgentTreeProjection<TRecord>;
48
50
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type Focusable, type TUI } from "../index.js";
2
2
  import { type KeybindingsManager } from "../app-keybindings.js";
3
3
  import { type Theme } from "../theme/theme.js";
4
- import type { CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
4
+ import type { AnnotationOverlayDraft, CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
5
5
  import type { TspSpan } from "@linxiraos/pi-wire";
6
6
  import { type NativeNode, type NativeUiEvent } from "../native/node.js";
7
7
  export declare const CONTINUE_CODE_REVIEW_ACTION = "Continue with LLM review";
@@ -20,6 +20,8 @@ export interface CodeReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
20
20
  export interface TextReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
21
21
  onComplete(result: TextReviewOverlayResult | undefined): void;
22
22
  }
23
+ /** Clears every note and closes; the host then has nothing to keep. Needs a second confirm. */
24
+ export declare const DISCARD_ANNOTATIONS_ACTION = "Discard notes and close";
23
25
  /** Splits a text source into the overlay's 1-based annotatable lines. */
24
26
  export declare function splitTextLines(text: string): string[];
25
27
  /** The native sheet: full-pane glass, titled by the review kind with what is under review after it. */
@@ -38,6 +40,10 @@ export declare class AnnotationOverlay implements Focusable {
38
40
  setUseTerminalCursor(useTerminalCursor: boolean): void;
39
41
  invalidate(): void;
40
42
  dispose(): void;
43
+ /** Notes, the unfinished note, and any source edit, in the form {@link restoreDraft} replays. */
44
+ getDraft(): AnnotationOverlayDraft;
45
+ /** Replay a draft taken from this same source; anything anchored outside it is dropped. */
46
+ restoreDraft(draft: AnnotationOverlayDraft): void;
41
47
  getAnnotations(): CodeReviewAnnotation[];
42
48
  getTextAnnotations(): TextReviewAnnotation[];
43
49
  /** Repo-relative path of the diff file under the cursor, if this is a code review. */
@@ -84,3 +84,31 @@ export interface TextReviewOverlayResult {
84
84
  /** Source text after an external-editor edit; absent when the source was not edited. */
85
85
  editedText?: string;
86
86
  }
87
+ export type AnnotationOverlayDraft = {
88
+ kind: "diff";
89
+ annotations: {
90
+ fileIndex: number;
91
+ sourceIndex: number;
92
+ annotation: CodeReviewAnnotation;
93
+ }[];
94
+ editor?: {
95
+ fileIndex: number;
96
+ sourceIndex: number;
97
+ scope: "file" | "line";
98
+ editingAnnotationIndex?: number;
99
+ text: string;
100
+ };
101
+ } | {
102
+ kind: "text";
103
+ annotations: {
104
+ sourceIndex: number;
105
+ annotation: TextReviewAnnotation;
106
+ }[];
107
+ editedText?: string;
108
+ editor?: {
109
+ sourceIndex: number;
110
+ scope: "text" | "line";
111
+ editingAnnotationIndex?: number;
112
+ text: string;
113
+ };
114
+ };
@@ -31,6 +31,8 @@ export interface ExtensionAskDialogResultItem {
31
31
  customInputImages?: ImageContent[];
32
32
  note?: string;
33
33
  noteImages?: ImageContent[];
34
+ /** Label of the option the note is on; unset when it is on the custom answer. */
35
+ noteOption?: string;
34
36
  timedOut?: boolean;
35
37
  }
36
38
  /** Answers submitted from the dialog. */
@@ -59,14 +61,21 @@ interface AskDialogCallbacks {
59
61
  /** Prompt that accepts pasted images; without it, prompts use `onPrompt`. */
60
62
  onImagePrompt?(prompt: AskDialogPrompt, prefill: AskDialogPromptValue | undefined): Promise<AskDialogPromptValue | undefined>;
61
63
  }
64
+ /**
65
+ * Routes typing to a composer draft that was in progress when the dialog
66
+ * opened, so in-flight keystrokes never answer by accident. The up/down select
67
+ * keys are the explicit hand-off: they release the guard for the rest of the
68
+ * dialog's life and the draft stays parked (intact) beneath it.
69
+ */
62
70
  interface AskDialogInputGuard {
63
71
  isBlocked(): boolean;
64
72
  handleInput(keyData: string): void;
73
+ /** Shown after the release keys while the guard holds input. */
65
74
  hint: string;
66
75
  /** Mirror the guard's blocked state onto the proxied draft surface each
67
76
  * render, so a draft that owns input shows a visible insertion cursor even
68
- * though this dialog holds TUI focus. */
69
- syncPresentation?(): void;
77
+ * though this dialog holds TUI focus, and drops it once the dialog takes over. */
78
+ syncPresentation?(blocked: boolean): void;
70
79
  }
71
80
  interface AskDialogOptions {
72
81
  timeout?: number;
@@ -116,7 +125,7 @@ export declare class AskDialogComponent implements Component {
116
125
  * Pointer actions: a tab click switches to it; a click on an answer row is
117
126
  * Enter on it (Space for a multi-select option, so it toggles; its
118
127
  * double-click `activate` is Enter); the action bar's Submit, Note and Skip
119
- * run exactly what Enter, `n` and Esc run on the highlighted row; Hide/Show
128
+ * run what Enter (see {@link #pressEnter} for Other), `n` and Esc run on the highlighted row; Hide/Show
120
129
  * collapse and restore the dialog.
121
130
  */
122
131
  handleNativeEvent(event: NativeUiEvent): void;
@@ -1,3 +1,4 @@
1
+ import type { ImageContent } from "@linxiraos/pi-ai";
1
2
  import { type Component, type Focusable, Input } from "../index.js";
2
3
  import { type BtwHistoryRecord } from "./btw-history.js";
3
4
  import type { SpaceHoldHandler } from "../space-hold.js";
@@ -9,7 +10,11 @@ interface BtwHistoryPanelOptions {
9
10
  onCopy: (record: BtwHistoryRecord) => void;
10
11
  onCancel: (record: BtwHistoryRecord) => void;
11
12
  canFollowUp?: (record: BtwHistoryRecord) => boolean;
12
- onFollowUp?: (record: BtwHistoryRecord, question: string, signal: AbortSignal) => Promise<boolean>;
13
+ onFollowUp?: (record: BtwHistoryRecord, question: string, signal: AbortSignal, images?: ImageContent[]) => Promise<boolean>;
14
+ /** Read a clipboard image into the follow-up (an empty paste, as terminals send for one). */
15
+ onPasteImage?: () => Promise<unknown>;
16
+ /** Attach an image file whose path was pasted or dropped into the follow-up. */
17
+ onPasteImagePath?: (path: string) => Promise<void>;
13
18
  /** Configured push-to-talk keys for a follow-up composer. */
14
19
  spaceHoldKeys?: readonly KeyId[];
15
20
  spaceHold?: (input: Input) => SpaceHoldHandler;
@@ -37,7 +42,16 @@ export declare class BtwHistoryPanel implements Component, Focusable {
37
42
  showRecord(recordId: string): void;
38
43
  /** Only an active follow-up composer can claim its configured push-to-talk keys. */
39
44
  capturesInput(data: string): boolean;
40
- /** Enhanced clipboard pastes belong only to the active composer. */
45
+ /** False while a follow-up is sent: it already took its images, and the composer clears after. */
46
+ get acceptsImages(): boolean;
47
+ /** Attach an image to the follow-up; returns its `[Image #N, WxH]` marker to paste. */
48
+ attachImage(image: ImageContent, dims?: {
49
+ width: number;
50
+ height: number;
51
+ }): string | undefined;
52
+ /** Reserve ordered delivery for an image paste. Completion delivers its marker once, or releases on undefined. */
53
+ beginPaste(): (text: string | undefined) => boolean;
54
+ /** Enhanced clipboard pastes belong only to the active composer, behind any image still loading. */
41
55
  pasteText(text: string): void;
42
56
  handleInput(data: string): void;
43
57
  /** A large glass sheet (the list beside the reader), palette-sized while there is nothing to list. */
@@ -1,5 +1,8 @@
1
+ import type { ImageContent } from "@linxiraos/pi-ai";
1
2
  export interface BtwHistoryTurn {
2
3
  question: string;
4
+ /** Images attached to the question, sent again with it on later follow-ups. */
5
+ images?: readonly ImageContent[];
3
6
  answer: string;
4
7
  status: "running" | "complete" | "cancelled" | "error" | "interrupted";
5
8
  createdAt: number;
@@ -9,8 +12,12 @@ export interface BtwHistoryTurn {
9
12
  export interface BtwHistoryRecord extends BtwHistoryTurn {
10
13
  id: string;
11
14
  leafId: string | null;
15
+ /** Display heading for the topic, e.g. `/sitrep`; `question` keeps the full text sent to the model. */
16
+ title?: string;
12
17
  followUps?: readonly BtwHistoryTurn[];
13
18
  }
19
+ /** The topic's display heading: its title, else the opening question. */
20
+ export declare function getBtwTopicLabel(record: BtwHistoryRecord): string;
14
21
  export declare function getBtwLatestTurn(record: BtwHistoryRecord): BtwHistoryTurn;
15
22
  export declare function getBtwTurns(record: BtwHistoryRecord): readonly BtwHistoryTurn[];
16
23
  /** Copy the most recent nonblank answer, preserving its original whitespace. */
@@ -3,6 +3,8 @@ import { OverlayPanel } from "../chrome/overlay-box.js";
3
3
  import type { NativeNode } from "../native/node.js";
4
4
  interface BtwPanelComponentOptions {
5
5
  question: string;
6
+ /** Heading shown instead of `/btw <question>`, e.g. `/sitrep the migration` for a side command. */
7
+ title?: string;
6
8
  tui: TUI;
7
9
  canBranch?: () => boolean;
8
10
  canFollowUp?: () => boolean;
@@ -0,0 +1,42 @@
1
+ import type { TspSpan } from "@linxiraos/pi-wire";
2
+ import type { ContextCategoryId, ContextThinkingGroup, ContextViewEntry } from "../chrome/context-view-model.js";
3
+ /** Normalized newlines, control characters removed, tabs expanded. */
4
+ export declare function safeContent(value: string): string;
5
+ /** {@link safeContent} with embedded home paths shortened, for labels and metadata. */
6
+ export declare function safeText(value: string): string;
7
+ /** {@link safeText} collapsed to one row. */
8
+ export declare function safeLine(value: string): string;
9
+ /** Token label of an entry or group: `—` for a grouped entry, `N/A · Interrupted`, else `N token(s)` (unscaled estimate). */
10
+ export declare function tokenEstimate(item: ContextViewEntry | ContextThinkingGroup): string;
11
+ /** `[label] N tokens` as ANSI. */
12
+ export declare function entryHeaderLine(entry: ContextViewEntry, category: ContextCategoryId): string;
13
+ /** `[label] N tokens` as spans. */
14
+ export declare function entryHeaderSpans(entry: ContextViewEntry, category: ContextCategoryId): TspSpan[];
15
+ /** Heading for a shared thinking group: label plus its token estimate. */
16
+ export declare function groupHeaderLine(group: ContextThinkingGroup, category: ContextCategoryId): string;
17
+ /** Truncation marker under a preview; the selected preview also advertises the open key. */
18
+ export declare function previewHint(selected: boolean): string;
19
+ /**
20
+ * Metadata rows: info and path, call id, timestamp. The full-content view also
21
+ * lists the thinking group, which previews show as a shared heading instead.
22
+ */
23
+ export declare function entryMetadata(entry: ContextViewEntry, options: {
24
+ hour12: boolean | undefined;
25
+ withGroup: boolean;
26
+ }): string[];
27
+ /** Preview row budget for a list of `height` rows: room for the entry heading, hint, and group heading. */
28
+ export declare function previewRows(entry: ContextViewEntry, height: number): number;
29
+ export interface EntryPreviewOptions {
30
+ /** Wrap width of preview rows. */
31
+ readonly width: number;
32
+ /** Maximum preview rows. */
33
+ readonly rows: number;
34
+ /** Viewport width; bounds the source read to `sourceWidth × rows × 2` characters before sanitizing and wrapping. */
35
+ readonly sourceWidth: number;
36
+ readonly hour12: boolean | undefined;
37
+ }
38
+ /** Dim metadata rows, then the indented body, cut to `rows`; `complete` is false when anything was omitted. */
39
+ export declare function entryPreview(entry: ContextViewEntry, options: EntryPreviewOptions): {
40
+ lines: string[];
41
+ complete: boolean;
42
+ };
@@ -0,0 +1,70 @@
1
+ import type { TspSpan } from "@linxiraos/pi-wire";
2
+ import type { ContextBreakdown } from "../status-line/context-usage.js";
3
+ import { type ContextMapCell } from "../chrome/context-map.js";
4
+ import { type ContextPresentationId } from "../chrome/context-presentation.js";
5
+ import type { NativeNode } from "../native/node.js";
6
+ import type { ThemeColor } from "../theme/index.js";
7
+ import { type ContextViewCategory, type ContextViewData } from "../chrome/context-view-model.js";
8
+ /** Columns between the map and the legend. */
9
+ export declare const MAP_LEGEND_GAP = 3;
10
+ export interface OverviewRow {
11
+ readonly key: string;
12
+ readonly id: ContextPresentationId;
13
+ readonly label: string;
14
+ /** Attributed usage; undefined when the weights cannot scale current usage. */
15
+ readonly tokens: number | undefined;
16
+ /** Category opened on confirm; undefined rows are listed but not selectable. */
17
+ readonly category?: ContextViewCategory;
18
+ readonly child?: boolean;
19
+ /** Right-aligned token column. */
20
+ readonly tokenColumn: string;
21
+ /** Right-aligned share column, including its leading separator. */
22
+ readonly shareColumn: string;
23
+ }
24
+ export interface MapGeometry {
25
+ readonly columns: number;
26
+ readonly rows: number;
27
+ readonly cellWidth: number;
28
+ readonly gap: string;
29
+ readonly width: number;
30
+ }
31
+ /**
32
+ * Attribute current usage to categories by weight, then each category's share to its children.
33
+ * Attributed values are not entry sums: entries keep their unscaled content/replay estimates.
34
+ * Undefined when the top-level weights cannot scale; unscalable children stay unattributed.
35
+ */
36
+ export declare function allocateUsage(categories: readonly ContextViewCategory[], usage: number): Map<ContextViewCategory, number> | undefined;
37
+ /** Overview row label for a category: its Overview-specific label when the weight differs from its content. */
38
+ export declare function overviewLabel(category: ContextViewCategory): string;
39
+ /** Category and child rows, then buffer and free space, with aligned token and share columns. */
40
+ export declare function buildOverviewRows(data: ContextViewData, allocation: ReadonlyMap<ContextViewCategory, number> | undefined): OverviewRow[];
41
+ /** ANSI legend row: cursor, swatch, label padded to `width`, token and share columns. */
42
+ export declare function legendLine(row: OverviewRow, selected: boolean, width: number): string;
43
+ /** Native legend item; `meterGlyphs` swaps map glyphs for the meter's bar glyphs. */
44
+ export declare function legendItem(row: OverviewRow, selected: boolean, meterGlyphs: boolean, window: number): NativeNode;
45
+ /** Map size beside a legend in a `width` × `height` body; undefined when either would not fit. */
46
+ export declare function mapGeometry(width: number, height: number): MapGeometry | undefined;
47
+ /** Map cells per row, in window order: categories, free space, then buffer. */
48
+ export declare function planMapRows(data: ContextViewData, allocation: ReadonlyMap<ContextViewCategory, number>, geometry: MapGeometry): ContextMapCell<ContextPresentationId>[][];
49
+ /** ANSI map row; partially filled cells are dim. */
50
+ export declare function mapRowLine(cells: readonly ContextMapCell<ContextPresentationId>[], geometry: MapGeometry): string;
51
+ /** Native map row; partially filled cells are dim. */
52
+ export declare function mapRowSpans(cells: readonly ContextMapCell<ContextPresentationId>[], geometry: MapGeometry): TspSpan[];
53
+ /** Snapcompact savings lines of the Overview; empty when no snapcompact setting is on. */
54
+ export declare function contextSnapcompactLines(breakdown: ContextBreakdown): string[];
55
+ interface ContextMeterData extends Pick<ContextBreakdown, "contextWindow" | "usedTokens" | "freeTokens" | "autoCompactBufferTokens" | "thresholdTokens"> {
56
+ categories: readonly {
57
+ label: string;
58
+ tokens: number;
59
+ color: ThemeColor;
60
+ }[];
61
+ }
62
+ /** Shared usage and compaction labels for ANSI and native context views. */
63
+ export declare function contextUsageSummary(breakdown: Pick<ContextBreakdown, "contextWindow" | "usedTokens" | "freeTokens" | "thresholdTokens">): {
64
+ used: string;
65
+ detail: string;
66
+ room: string;
67
+ };
68
+ /** Native usage summary and stacked bar; callers provide the category list. */
69
+ export declare function describeContextMeter(breakdown: ContextMeterData): [NativeNode, NativeNode];
70
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { ContextViewData } from "../chrome/context-view-model.js";
2
+ import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
3
+ import type { Component } from "../tui.js";
4
+ /**
5
+ * Read-only context snapshot with three states: Overview → category previews → full entry content.
6
+ * Navigation state is shared; `render` (ANSI) and `describe` (native) each draw every state,
7
+ * via `#render<State>` and `#describe<State>` respectively.
8
+ */
9
+ export declare class ContextViewer implements Component {
10
+ #private;
11
+ constructor(data: ContextViewData, options: {
12
+ onClose: () => void;
13
+ requestRender: () => void;
14
+ getRows: () => number;
15
+ });
16
+ invalidate(): void;
17
+ dispose(): void;
18
+ get nativeOverlay(): NonNullable<Component["nativeOverlay"]>;
19
+ /** Capture only handled navigation keys; the focus path consumes other modal input. */
20
+ capturesInput(data: string): boolean;
21
+ handleInput(data: string): void;
22
+ handleNativeEvent(event: NativeUiEvent): void;
23
+ render(width: number): readonly string[];
24
+ describe(cx: DescribeContext): NativeNode;
25
+ }
@@ -8,6 +8,7 @@ export interface HookInputOptions {
8
8
  tui?: TUI;
9
9
  timeout?: number;
10
10
  onTimeout?: () => void;
11
+ secret?: boolean;
11
12
  }
12
13
  export declare class HookInputComponent extends OverlayPanel {
13
14
  #private;
@@ -7,7 +7,11 @@ import type { NativeNode, NativeUiEvent } from "../native/node.js";
7
7
  */
8
8
  export declare class LoginDialogComponent extends OverlayPanel {
9
9
  #private;
10
- constructor(tui: TUI, providerId: string, onComplete: (success: boolean, message?: string) => void, openUrl: (url: string) => void);
10
+ constructor(tui: Pick<TUI, "requestRender">, providerId: string, onComplete: (success: boolean, message?: string) => void, openUrl: (url: string) => void);
11
+ /** Focus reaches the live field: it draws the caret (the hardware cursor when the terminal's is on). */
12
+ get focused(): boolean;
13
+ set focused(value: boolean);
14
+ setUseTerminalCursor(useTerminalCursor: boolean): void;
11
15
  get signal(): AbortSignal;
12
16
  /**
13
17
  * Called by the OAuth `onAuth` callback. Renders the full authorization URL
@@ -94,6 +94,8 @@ export declare class MCPAddWizard extends OverlayPanel {
94
94
  * arrows and pressing Enter; the footer's buttons run what their keys run.
95
95
  */
96
96
  handleNativeEvent(event: NativeUiEvent): void;
97
+ /** Route enhanced clipboard text into the active wizard field, never the hidden chat editor. */
98
+ pasteText(text: string): void;
97
99
  handleInput(keyData: string): void;
98
100
  }
99
101
  export {};
@@ -4,7 +4,7 @@ import type { Component } from "../tui.js";
4
4
  import type { SgrMouseEvent } from "../mouse.js";
5
5
  import { type ConfiguredThinkingLevel } from "../thinking.js";
6
6
  import { type ThemeColor } from "../theme/theme.js";
7
- import type { TspPickerColumn, TspPickerGroup, TspPickerItem, TspPickerMark } from "@linxiraos/pi-wire";
7
+ import type { TspPickerColumn, TspPickerGroup, TspPickerItem, TspPickerMark, TspPickerProps } from "@linxiraos/pi-wire";
8
8
  import type { NativeChild, NativeNode, NativeUiEvent } from "../native/node.js";
9
9
  /** Canonical display ordering of built-in model roles. */
10
10
  export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "commit" | "tiny" | "memory" | "task" | "advisor" | "widget" | "image" | "web" | "speech" | "dictation" | "judge";
@@ -232,6 +232,8 @@ export interface ModelPickerCatalogue {
232
232
  readonly itemsAdd?: readonly TspPickerItem[];
233
233
  readonly itemsDel?: readonly string[];
234
234
  }
235
+ /** The search, fact-column and row props every model `picker` sheet sends ({@link ModelBrowser.pickerRows}). */
236
+ export type ModelPickerRows = Pick<TspPickerProps, "query" | "cursor" | "columns" | "items" | "itemsAdd" | "itemsDel" | "order" | "hits" | "selected" | "current" | "total">;
235
237
  /** How {@link ModelBrowser.pickerOrder} heads its rows. */
236
238
  export interface ModelPickerGrouping {
237
239
  /** One group per provider after the Recent block (the unfiltered All models view). */
@@ -329,6 +331,13 @@ export declare class ModelBrowser implements Component {
329
331
  get baseCount(): number;
330
332
  /** The selected row's selector, null when nothing selectable is selected. */
331
333
  get pickerSelected(): string | null;
334
+ /**
335
+ * A model picker's search field, fact columns and rows: `catalogue` (from
336
+ * {@link pickerItems}) in `view` order (from {@link pickerOrder}), the
337
+ * selection, and `current` checked. Memoize hosts on its inputs plus
338
+ * {@link query}, {@link cursor} and {@link pickerSelected}.
339
+ */
340
+ pickerRows(catalogue: ModelPickerCatalogue, view: ModelPickerOrder, current: string | undefined): ModelPickerRows;
332
341
  /**
333
342
  * Picker rows for `catalogue`: the same object while the catalogue, roles
334
343
  * and row inputs are unchanged, so typing and scope hops never resend it.