@linxiraos/pi-tui 1.4.6 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/CHANGELOG.md +162 -244
  2. package/README.md +41 -35
  3. package/dist/types/app-keybindings.d.ts +20 -0
  4. package/dist/types/apps/session-picker.d.ts +5 -0
  5. package/dist/types/charts/chart-plan.d.ts +9 -7
  6. package/dist/types/charts/table-data.d.ts +4 -2
  7. package/dist/types/chat/assistant-message.d.ts +15 -3
  8. package/dist/types/chat/bash-execution.d.ts +6 -1
  9. package/dist/types/chat/display-preferences.d.ts +2 -0
  10. package/dist/types/chat/eval-execution.d.ts +2 -0
  11. package/dist/types/chat/execution-shared.d.ts +14 -8
  12. package/dist/types/chat/extension-types.d.ts +31 -0
  13. package/dist/types/chat/figure-markdown.d.ts +2 -0
  14. package/dist/types/chat/reply-write.d.ts +48 -0
  15. package/dist/types/chat/svg-figure.d.ts +5 -0
  16. package/dist/types/chat/table-chart.d.ts +6 -3
  17. package/dist/types/chat/tool-execution.d.ts +1 -2
  18. package/dist/types/chat/transcript-outline.d.ts +7 -0
  19. package/dist/types/chat/transcript-render-helpers.d.ts +13 -3
  20. package/dist/types/chrome/dynamic-border.d.ts +6 -0
  21. package/dist/types/chrome/index.d.ts +1 -0
  22. package/dist/types/chrome/transcript-notice.d.ts +35 -0
  23. package/dist/types/chrome/transcript-status.d.ts +21 -9
  24. package/dist/types/components/editor.d.ts +23 -6
  25. package/dist/types/components/image.d.ts +6 -0
  26. package/dist/types/components/loader.d.ts +2 -0
  27. package/dist/types/components/markdown.d.ts +7 -0
  28. package/dist/types/keybinding-matchers.d.ts +7 -0
  29. package/dist/types/native/blobs.d.ts +2 -1
  30. package/dist/types/native/describe.d.ts +4 -2
  31. package/dist/types/native/node.d.ts +2 -3
  32. package/dist/types/native/overlay.d.ts +42 -2
  33. package/dist/types/native/picker.d.ts +4 -4
  34. package/dist/types/native/state.d.ts +4 -0
  35. package/dist/types/overlays/annotation-overlay.d.ts +7 -1
  36. package/dist/types/overlays/annotation-types.d.ts +28 -0
  37. package/dist/types/overlays/btw-history-panel.d.ts +15 -0
  38. package/dist/types/overlays/btw-history.d.ts +24 -0
  39. package/dist/types/overlays/btw-inject.d.ts +22 -0
  40. package/dist/types/overlays/btw-panel.d.ts +7 -0
  41. package/dist/types/overlays/hook-editor.d.ts +2 -0
  42. package/dist/types/overlays/jobs-panel.d.ts +4 -0
  43. package/dist/types/overlays/login-dialog.d.ts +5 -1
  44. package/dist/types/overlays/model-browser.d.ts +11 -2
  45. package/dist/types/overlays/oauth-selector.d.ts +23 -0
  46. package/dist/types/overlays/plan-review-overlay.d.ts +2 -0
  47. package/dist/types/overlays/rewind-selector.d.ts +1 -1
  48. package/dist/types/overlays/session-selector.d.ts +33 -4
  49. package/dist/types/prompt/composer.d.ts +56 -5
  50. package/dist/types/prompt/interactive-context-helpers.d.ts +10 -3
  51. package/dist/types/render/extension-links.d.ts +65 -0
  52. package/dist/types/render/hyperlink.d.ts +25 -7
  53. package/dist/types/render/index.d.ts +1 -0
  54. package/dist/types/render/render-utils.d.ts +23 -1
  55. package/dist/types/setup/scenes/glyph.d.ts +1 -1
  56. package/dist/types/setup/scenes/model.d.ts +1 -1
  57. package/dist/types/setup/scenes/outro.d.ts +5 -4
  58. package/dist/types/setup/scenes/sign-in.d.ts +13 -8
  59. package/dist/types/setup/scenes/types.d.ts +16 -1
  60. package/dist/types/setup/startup-splash.d.ts +1 -1
  61. package/dist/types/setup/wizard-overlay.d.ts +11 -7
  62. package/dist/types/setup/wizard.d.ts +5 -1
  63. package/dist/types/status-line/component.d.ts +1 -1
  64. package/dist/types/status-line/context-usage.d.ts +28 -6
  65. package/dist/types/status-line/host.d.ts +6 -2
  66. package/dist/types/status-line/startup.d.ts +0 -15
  67. package/dist/types/terminal-capabilities.d.ts +1 -1
  68. package/dist/types/theme/symbols.d.ts +3 -1
  69. package/dist/types/theme/theme-class.d.ts +1 -0
  70. package/dist/types/theme/theme.d.ts +1 -24
  71. package/dist/types/theme/tui-adapters.d.ts +2 -0
  72. package/dist/types/thinking.d.ts +8 -6
  73. package/dist/types/tools/ast-grep.d.ts +2 -0
  74. package/dist/types/tools/bash-interactive.d.ts +6 -0
  75. package/dist/types/tools/bash.d.ts +2 -0
  76. package/dist/types/tools/default-renderer.d.ts +6 -4
  77. package/dist/types/tools/eval.d.ts +2 -0
  78. package/dist/types/tools/find.d.ts +1 -1
  79. package/dist/types/tools/grouped-file-output.d.ts +100 -19
  80. package/dist/types/tools/hashline-format.d.ts +5 -0
  81. package/dist/types/tools/irc.d.ts +6 -0
  82. package/dist/types/tools/json-tree.d.ts +23 -4
  83. package/dist/types/tools/lsp.d.ts +2 -0
  84. package/dist/types/tools/mcp.d.ts +6 -5
  85. package/dist/types/tools/native-view.d.ts +3 -1
  86. package/dist/types/tools/output-meta.d.ts +27 -0
  87. package/dist/types/tools/read.d.ts +14 -4
  88. package/dist/types/tools/renderer.d.ts +2 -0
  89. package/dist/types/tools/streaming-output.d.ts +11 -0
  90. package/dist/types/tools/task.d.ts +13 -4
  91. package/dist/types/tools/url-scheme-host.d.ts +17 -0
  92. package/dist/types/tools/wait.d.ts +2 -0
  93. package/dist/types/tools/yield.d.ts +1 -1
  94. package/dist/types/tui.d.ts +19 -2
  95. package/dist/types/utils.d.ts +4 -0
  96. package/package.json +10 -14
  97. package/src/app-keybindings.d.ts +20 -0
  98. package/src/app-keybindings.ts +20 -0
  99. package/src/apps/git/git-tui.ts +10 -17
  100. package/src/apps/git/sidebar.ts +21 -35
  101. package/src/apps/ps-top.ts +4 -12
  102. package/src/apps/session-picker.ts +7 -0
  103. package/src/charts/chart-plan.d.ts +9 -7
  104. package/src/charts/chart-plan.ts +20 -79
  105. package/src/charts/table-data.d.ts +4 -2
  106. package/src/charts/table-data.ts +55 -6
  107. package/src/chat/advisor-message.ts +2 -0
  108. package/src/chat/assistant-message.d.ts +15 -3
  109. package/src/chat/assistant-message.ts +137 -19
  110. package/src/chat/background-tan-message.ts +4 -0
  111. package/src/chat/bash-execution.d.ts +6 -1
  112. package/src/chat/bash-execution.ts +26 -9
  113. package/src/chat/chat-transcript-builder.ts +63 -30
  114. package/src/chat/compaction-summary-message.ts +2 -1
  115. package/src/chat/display-preferences.d.ts +2 -0
  116. package/src/chat/display-preferences.ts +3 -0
  117. package/src/chat/eval-execution.d.ts +2 -0
  118. package/src/chat/eval-execution.ts +14 -7
  119. package/src/chat/execution-shared.d.ts +14 -8
  120. package/src/chat/execution-shared.ts +39 -18
  121. package/src/chat/extension-types.d.ts +31 -0
  122. package/src/chat/extension-types.ts +34 -0
  123. package/src/chat/figure-markdown.d.ts +2 -0
  124. package/src/chat/figure-markdown.ts +6 -4
  125. package/src/chat/read-tool-group.ts +56 -36
  126. package/src/chat/reply-write.d.ts +48 -0
  127. package/src/chat/reply-write.ts +127 -0
  128. package/src/chat/svg-figure.d.ts +5 -0
  129. package/src/chat/svg-figure.ts +55 -16
  130. package/src/chat/table-chart.d.ts +6 -3
  131. package/src/chat/table-chart.ts +29 -6
  132. package/src/chat/tool-execution.d.ts +1 -2
  133. package/src/chat/tool-execution.ts +20 -13
  134. package/src/chat/transcript-outline.d.ts +7 -0
  135. package/src/chat/transcript-outline.ts +27 -0
  136. package/src/chat/transcript-render-helpers.d.ts +13 -3
  137. package/src/chat/transcript-render-helpers.ts +134 -44
  138. package/src/chrome/dynamic-border.d.ts +6 -0
  139. package/src/chrome/dynamic-border.ts +28 -2
  140. package/src/chrome/index.ts +1 -0
  141. package/src/chrome/transcript-notice.d.ts +35 -0
  142. package/src/chrome/transcript-notice.ts +83 -0
  143. package/src/chrome/transcript-status.d.ts +21 -9
  144. package/src/chrome/transcript-status.ts +32 -30
  145. package/src/components/editor.d.ts +23 -6
  146. package/src/components/editor.ts +133 -25
  147. package/src/components/image.d.ts +6 -0
  148. package/src/components/image.ts +13 -0
  149. package/src/components/key-value-list.ts +9 -9
  150. package/src/components/loader.d.ts +2 -0
  151. package/src/components/loader.ts +7 -0
  152. package/src/components/markdown.d.ts +7 -0
  153. package/src/components/markdown.ts +116 -6
  154. package/src/components/section.ts +1 -9
  155. package/src/components/table.ts +1 -9
  156. package/src/hotkeys-markdown.ts +1 -0
  157. package/src/keybinding-matchers.d.ts +7 -0
  158. package/src/keybinding-matchers.ts +13 -0
  159. package/src/native/backend.ts +10 -67
  160. package/src/native/blobs.d.ts +2 -1
  161. package/src/native/blobs.ts +3 -2
  162. package/src/native/describe.d.ts +4 -2
  163. package/src/native/describe.ts +9 -4
  164. package/src/native/node.d.ts +2 -3
  165. package/src/native/node.ts +2 -3
  166. package/src/native/overlay.d.ts +42 -2
  167. package/src/native/overlay.ts +124 -16
  168. package/src/native/picker.d.ts +4 -4
  169. package/src/native/picker.ts +4 -4
  170. package/src/native/state.d.ts +4 -0
  171. package/src/native/state.ts +25 -5
  172. package/src/overlays/advisor-config.ts +1 -10
  173. package/src/overlays/annotation-overlay.ts +125 -37
  174. package/src/overlays/annotation-types.ts +24 -0
  175. package/src/overlays/btw-history-panel.ts +106 -14
  176. package/src/overlays/btw-history.ts +65 -0
  177. package/src/overlays/btw-inject.ts +91 -0
  178. package/src/overlays/btw-panel.ts +53 -12
  179. package/src/overlays/extensions/extension-dashboard.ts +7 -8
  180. package/src/overlays/hook-editor.ts +6 -0
  181. package/src/overlays/hook-selector.ts +2 -2
  182. package/src/overlays/jobs-panel.ts +82 -22
  183. package/src/overlays/login-dialog.ts +39 -31
  184. package/src/overlays/mcp-add-wizard.ts +1 -1
  185. package/src/overlays/model-browser.ts +106 -10
  186. package/src/overlays/model-hub.ts +1 -7
  187. package/src/overlays/model-picker.ts +1 -10
  188. package/src/overlays/oauth-selector.ts +44 -6
  189. package/src/overlays/plan-review-overlay.ts +13 -2
  190. package/src/overlays/rewind-selector.ts +29 -12
  191. package/src/overlays/session-selector.ts +338 -47
  192. package/src/overlays/settings-defs.ts +2 -2
  193. package/src/overlays/tree-selector.ts +83 -27
  194. package/src/overlays/usage-dashboard.ts +9 -18
  195. package/src/prompt/composer.ts +233 -6
  196. package/src/prompt/custom-editor.ts +6 -1
  197. package/src/prompt/emoji-autocomplete.ts +0 -2
  198. package/src/prompt/interactive-context-helpers.ts +29 -4
  199. package/src/render/code-cell.ts +1 -1
  200. package/src/render/extension-links.d.ts +65 -0
  201. package/src/render/extension-links.ts +214 -0
  202. package/src/render/file-list.ts +4 -7
  203. package/src/render/hyperlink.d.ts +25 -7
  204. package/src/render/hyperlink.ts +65 -9
  205. package/src/render/index.d.ts +1 -0
  206. package/src/render/index.ts +1 -0
  207. package/src/render/render-utils.d.ts +23 -1
  208. package/src/render/render-utils.ts +38 -6
  209. package/src/setup/scenes/composer.ts +2 -0
  210. package/src/setup/scenes/glyph.ts +4 -2
  211. package/src/setup/scenes/model.ts +192 -29
  212. package/src/setup/scenes/outro.ts +33 -15
  213. package/src/setup/scenes/sign-in.ts +196 -400
  214. package/src/setup/scenes/theme.ts +2 -0
  215. package/src/setup/scenes/types.ts +18 -1
  216. package/src/setup/startup-splash.ts +8 -7
  217. package/src/setup/wizard-overlay.ts +164 -35
  218. package/src/setup/wizard.ts +11 -2
  219. package/src/status-line/component.ts +4 -10
  220. package/src/status-line/context-usage.ts +72 -21
  221. package/src/status-line/host.ts +6 -2
  222. package/src/status-line/startup.ts +36 -70
  223. package/src/terminal-capabilities.d.ts +1 -1
  224. package/src/terminal-capabilities.ts +5 -0
  225. package/src/terminal.ts +24 -2
  226. package/src/theme/defaults.json +1 -0
  227. package/src/theme/loader.ts +1 -1
  228. package/src/theme/symbols.d.ts +3 -1
  229. package/src/theme/symbols.ts +16 -9
  230. package/src/theme/theme-class.d.ts +1 -0
  231. package/src/theme/theme-class.ts +15 -3
  232. package/src/theme/theme.d.ts +1 -24
  233. package/src/theme/theme.ts +3 -75
  234. package/src/theme/tui-adapters.d.ts +2 -0
  235. package/src/theme/tui-adapters.ts +8 -3
  236. package/src/thinking.d.ts +8 -6
  237. package/src/thinking.ts +17 -11
  238. package/src/tmux.ts +1 -0
  239. package/src/tools/agent-tree.ts +13 -11
  240. package/src/tools/ask.ts +24 -37
  241. package/src/tools/ast-edit.ts +48 -93
  242. package/src/tools/ast-grep.d.ts +2 -0
  243. package/src/tools/ast-grep.ts +31 -67
  244. package/src/tools/bash-interactive.d.ts +49 -0
  245. package/src/tools/bash-interactive.ts +6 -1
  246. package/src/tools/bash.d.ts +2 -0
  247. package/src/tools/bash.ts +9 -0
  248. package/src/tools/default-renderer.d.ts +6 -4
  249. package/src/tools/default-renderer.ts +10 -7
  250. package/src/tools/edit.ts +50 -43
  251. package/src/tools/eval.d.ts +2 -0
  252. package/src/tools/eval.ts +16 -4
  253. package/src/tools/fetch.ts +2 -1
  254. package/src/tools/find.d.ts +1 -1
  255. package/src/tools/find.ts +13 -5
  256. package/src/tools/github.ts +14 -46
  257. package/src/tools/glob.ts +2 -1
  258. package/src/tools/grep.ts +47 -277
  259. package/src/tools/grouped-file-output.d.ts +100 -19
  260. package/src/tools/grouped-file-output.ts +414 -103
  261. package/src/tools/hashline-format.d.ts +5 -0
  262. package/src/tools/hashline-format.ts +5 -0
  263. package/src/tools/irc.d.ts +6 -0
  264. package/src/tools/irc.ts +6 -0
  265. package/src/tools/job-widget.ts +13 -1
  266. package/src/tools/json-tree.d.ts +23 -4
  267. package/src/tools/json-tree.ts +132 -46
  268. package/src/tools/lsp.d.ts +2 -0
  269. package/src/tools/lsp.ts +246 -47
  270. package/src/tools/mcp.d.ts +6 -5
  271. package/src/tools/mcp.ts +20 -12
  272. package/src/tools/native-view.d.ts +3 -1
  273. package/src/tools/native-view.ts +12 -6
  274. package/src/tools/output-meta.d.ts +27 -0
  275. package/src/tools/output-meta.ts +68 -4
  276. package/src/tools/proc-render.ts +3 -3
  277. package/src/tools/read.d.ts +14 -4
  278. package/src/tools/read.ts +20 -5
  279. package/src/tools/renderer.d.ts +2 -0
  280. package/src/tools/renderer.ts +2 -0
  281. package/src/tools/streaming-output.d.ts +11 -0
  282. package/src/tools/streaming-output.ts +41 -0
  283. package/src/tools/task.d.ts +13 -4
  284. package/src/tools/task.ts +100 -97
  285. package/src/tools/url-scheme-host.d.ts +17 -0
  286. package/src/tools/url-scheme-host.ts +21 -0
  287. package/src/tools/vibe.ts +4 -4
  288. package/src/tools/wait.d.ts +2 -0
  289. package/src/tools/wait.ts +8 -5
  290. package/src/tools/write.ts +17 -27
  291. package/src/tools/yield.d.ts +1 -1
  292. package/src/tools/yield.ts +19 -10
  293. package/src/tui.d.ts +19 -2
  294. package/src/tui.ts +134 -24
  295. package/src/utils.d.ts +4 -0
  296. package/src/utils.ts +10 -0
  297. package/dist/types/theme/defaults/index.d.ts +0 -10289
  298. package/src/theme/defaults/alabaster.json +0 -103
  299. package/src/theme/defaults/amethyst.json +0 -106
  300. package/src/theme/defaults/anthracite.json +0 -103
  301. package/src/theme/defaults/basalt.json +0 -101
  302. package/src/theme/defaults/birch.json +0 -105
  303. package/src/theme/defaults/dark-abyss.json +0 -101
  304. package/src/theme/defaults/dark-arctic.json +0 -114
  305. package/src/theme/defaults/dark-aurora.json +0 -105
  306. package/src/theme/defaults/dark-catppuccin.json +0 -117
  307. package/src/theme/defaults/dark-cavern.json +0 -101
  308. package/src/theme/defaults/dark-celestial.json +0 -116
  309. package/src/theme/defaults/dark-copper.json +0 -105
  310. package/src/theme/defaults/dark-cosmos.json +0 -100
  311. package/src/theme/defaults/dark-cyberpunk.json +0 -112
  312. package/src/theme/defaults/dark-dracula.json +0 -108
  313. package/src/theme/defaults/dark-eclipse.json +0 -101
  314. package/src/theme/defaults/dark-ember.json +0 -105
  315. package/src/theme/defaults/dark-equinox.json +0 -100
  316. package/src/theme/defaults/dark-forest.json +0 -106
  317. package/src/theme/defaults/dark-github.json +0 -115
  318. package/src/theme/defaults/dark-gruvbox.json +0 -122
  319. package/src/theme/defaults/dark-lavender.json +0 -105
  320. package/src/theme/defaults/dark-lunar.json +0 -99
  321. package/src/theme/defaults/dark-midnight.json +0 -105
  322. package/src/theme/defaults/dark-monochrome.json +0 -104
  323. package/src/theme/defaults/dark-monokai.json +0 -108
  324. package/src/theme/defaults/dark-nebula.json +0 -100
  325. package/src/theme/defaults/dark-neon-noir.json +0 -110
  326. package/src/theme/defaults/dark-nord.json +0 -108
  327. package/src/theme/defaults/dark-ocean.json +0 -111
  328. package/src/theme/defaults/dark-one.json +0 -110
  329. package/src/theme/defaults/dark-poimandres.json +0 -125
  330. package/src/theme/defaults/dark-rainforest.json +0 -101
  331. package/src/theme/defaults/dark-reef.json +0 -101
  332. package/src/theme/defaults/dark-retro.json +0 -102
  333. package/src/theme/defaults/dark-rose-pine.json +0 -106
  334. package/src/theme/defaults/dark-sakura.json +0 -105
  335. package/src/theme/defaults/dark-slate.json +0 -105
  336. package/src/theme/defaults/dark-solarized.json +0 -107
  337. package/src/theme/defaults/dark-solstice.json +0 -100
  338. package/src/theme/defaults/dark-starfall.json +0 -101
  339. package/src/theme/defaults/dark-sunset.json +0 -109
  340. package/src/theme/defaults/dark-swamp.json +0 -100
  341. package/src/theme/defaults/dark-synthwave.json +0 -113
  342. package/src/theme/defaults/dark-taiga.json +0 -101
  343. package/src/theme/defaults/dark-terminal.json +0 -105
  344. package/src/theme/defaults/dark-tokyo-night.json +0 -111
  345. package/src/theme/defaults/dark-tundra.json +0 -101
  346. package/src/theme/defaults/dark-twilight.json +0 -101
  347. package/src/theme/defaults/dark-volcanic.json +0 -101
  348. package/src/theme/defaults/graphite.json +0 -102
  349. package/src/theme/defaults/index.d.ts +0 -10289
  350. package/src/theme/defaults/index.ts +0 -203
  351. package/src/theme/defaults/light-arctic.json +0 -117
  352. package/src/theme/defaults/light-aurora-day.json +0 -101
  353. package/src/theme/defaults/light-canyon.json +0 -101
  354. package/src/theme/defaults/light-catppuccin.json +0 -116
  355. package/src/theme/defaults/light-cirrus.json +0 -100
  356. package/src/theme/defaults/light-coral.json +0 -105
  357. package/src/theme/defaults/light-cyberpunk.json +0 -106
  358. package/src/theme/defaults/light-dawn.json +0 -100
  359. package/src/theme/defaults/light-dunes.json +0 -101
  360. package/src/theme/defaults/light-eucalyptus.json +0 -105
  361. package/src/theme/defaults/light-forest.json +0 -110
  362. package/src/theme/defaults/light-frost.json +0 -105
  363. package/src/theme/defaults/light-github.json +0 -125
  364. package/src/theme/defaults/light-glacier.json +0 -101
  365. package/src/theme/defaults/light-gruvbox.json +0 -118
  366. package/src/theme/defaults/light-haze.json +0 -100
  367. package/src/theme/defaults/light-honeycomb.json +0 -105
  368. package/src/theme/defaults/light-lagoon.json +0 -101
  369. package/src/theme/defaults/light-lavender.json +0 -105
  370. package/src/theme/defaults/light-meadow.json +0 -101
  371. package/src/theme/defaults/light-mint.json +0 -105
  372. package/src/theme/defaults/light-monochrome.json +0 -111
  373. package/src/theme/defaults/light-ocean.json +0 -109
  374. package/src/theme/defaults/light-one.json +0 -109
  375. package/src/theme/defaults/light-opal.json +0 -101
  376. package/src/theme/defaults/light-orchard.json +0 -101
  377. package/src/theme/defaults/light-paper.json +0 -105
  378. package/src/theme/defaults/light-poimandres.json +0 -125
  379. package/src/theme/defaults/light-prism.json +0 -100
  380. package/src/theme/defaults/light-retro.json +0 -108
  381. package/src/theme/defaults/light-sand.json +0 -105
  382. package/src/theme/defaults/light-savanna.json +0 -101
  383. package/src/theme/defaults/light-solarized.json +0 -112
  384. package/src/theme/defaults/light-soleil.json +0 -100
  385. package/src/theme/defaults/light-sunset.json +0 -109
  386. package/src/theme/defaults/light-synthwave.json +0 -108
  387. package/src/theme/defaults/light-tokyo-night.json +0 -121
  388. package/src/theme/defaults/light-wetland.json +0 -101
  389. package/src/theme/defaults/light-zenith.json +0 -99
  390. package/src/theme/defaults/limestone.json +0 -104
  391. package/src/theme/defaults/mahogany.json +0 -107
  392. package/src/theme/defaults/marble.json +0 -103
  393. package/src/theme/defaults/obsidian.json +0 -101
  394. package/src/theme/defaults/onyx.json +0 -101
  395. package/src/theme/defaults/pearl.json +0 -103
  396. package/src/theme/defaults/porcelain.json +0 -101
  397. package/src/theme/defaults/quartz.json +0 -106
  398. package/src/theme/defaults/sandstone.json +0 -105
  399. package/src/theme/defaults/titanium.json +0 -100
@@ -1,9 +1,10 @@
1
1
  import type { Usage } from "@linxiraos/pi-ai";
2
2
  import type { ThemeColor } from "../theme/theme.js";
3
3
  import type { ConfiguredThinkingLevel } from "../render/render-utils.js";
4
- import type { RenderResultOptions, NativeToolView, ToolRenderResult } from "./renderer.js";
5
4
  import { type Component } from "../tui.js";
5
+ import type { RenderResultOptions } from "./renderer.js";
6
6
  import { type Theme } from "../theme/theme.js";
7
+ import type { NativeToolView, ToolRenderResult } from "./renderer.js";
7
8
  /** Render context threaded in from `ToolExecutionComponent.#buildRenderContext`. */
8
9
  interface TaskRenderContext {
9
10
  hasResult?: boolean;
@@ -103,10 +104,11 @@ export interface TaskItem {
103
104
  agent?: string;
104
105
  /** Historical source session selected by the bundled consult agent. */
105
106
  sourceSession?: string;
106
- /** Optional model selector override for the historical source session. */
107
+ /** Bundled seance: override for the source session's saved model. Any other agent: one exact per-call model, gated by `task.perCallModel`. */
107
108
  model?: string | string[];
108
- /** The work; required by the schema. */
109
+ /** Inline instructions; exactly one of task or taskFile is required. */
109
110
  task?: string;
111
+ taskFile?: string;
110
112
  /** How open-ended the work is; required by the schema and the child's sole `auto` thinking classification input. */
111
113
  solutionSpace?: string;
112
114
  /** Per-spawn thinking effort: lowest/middle/highest level the resolved model supports. Overrides the agent's default selector (e.g. `auto`). */
@@ -133,10 +135,12 @@ export interface TaskParams {
133
135
  agent?: string;
134
136
  /** Historical source session selected by the bundled consult agent. */
135
137
  sourceSession?: string;
136
- /** Optional model selector override for the historical source session. */
138
+ /** See {@link TaskItem.model}. */
137
139
  model?: string | string[];
138
140
  /** The work (flat form). */
139
141
  task?: string;
142
+ /** Absolute path or local:// URL to a UTF-8 file (flat form), mutually exclusive with task. */
143
+ taskFile?: string;
140
144
  /** How open-ended the work is (flat form); see {@link TaskItem.solutionSpace}. */
141
145
  solutionSpace?: string;
142
146
  /** Per-spawn thinking effort (flat form): lowest/middle/highest level the resolved model supports. */
@@ -212,6 +216,9 @@ export interface AgentProgress {
212
216
  status: "pending" | "running" | "completed" | "failed" | "aborted";
213
217
  task: string;
214
218
  assignment?: string;
219
+ taskFile?: string;
220
+ /** SHA-256 of the exact task file bytes before decoding and trimming. */
221
+ taskFileSha256?: string;
215
222
  description?: string;
216
223
  lastIntent?: string;
217
224
  currentTool?: string;
@@ -319,6 +326,8 @@ export interface SingleResult {
319
326
  agentSource: AgentSource;
320
327
  task: string;
321
328
  assignment?: string;
329
+ taskFile?: string;
330
+ taskFileSha256?: string;
322
331
  description?: string;
323
332
  lastIntent?: string;
324
333
  exitCode: number;
@@ -4,6 +4,15 @@
4
4
  * selector peeling and transcript renderers consult it instead of hardcoding
5
5
  * scheme names.
6
6
  */
7
+ /**
8
+ * Mutation class of a writable scheme; drives plan-mode and device-only `write` gates.
9
+ * - `workspace`: mutates user/external state; blocked in plan mode and device-only sessions.
10
+ * - `sandbox`: session scratch space (local://); allowed in plan mode and device-only sessions.
11
+ * - `coordination`: peer messaging (agent://); always allowed. `SchemeWritePolicy.cancels` grants the same per URL.
12
+ * - `device`: tool-device dispatch (xd://); always allowed, the device enforces its own policy.
13
+ * - `reply`: a message to the user (out://); always allowed, and transcripts draw the content as assistant prose.
14
+ */
15
+ export type SchemeWriteScope = "workspace" | "sandbox" | "coordination" | "device" | "reply";
7
16
  /** Renderer-relevant subset of a registered scheme's declared spec. */
8
17
  export interface InternalUrlSchemeSpec {
9
18
  /** `lines`: a trailing `:<selector>` chain is a read selector; `none`/`opaque`: never peel. */
@@ -12,16 +21,24 @@ export interface InternalUrlSchemeSpec {
12
21
  readonly portAuthority?: boolean;
13
22
  /** Read cards collapse into the compact read group like plain files instead of expanding. */
14
23
  readonly compactTranscript?: boolean;
24
+ /** Write policy; absent on read-only schemes. Transcripts draw `reply`-scoped writes as assistant prose. */
25
+ readonly write?: {
26
+ readonly scope: SchemeWriteScope;
27
+ };
15
28
  }
16
29
  /** Scheme registry capabilities installed by the internal URL host. */
17
30
  export interface InternalUrlSchemeHost {
18
31
  /** Declared spec of a registered scheme (case-insensitive); undefined when unregistered. */
19
32
  spec(scheme: string): InternalUrlSchemeSpec | undefined;
33
+ /** Declared specs of every registered scheme, keyed by lowercased scheme. */
34
+ specs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
20
35
  }
21
36
  /** Install the scheme registry. Until one is installed, no URL counts as an internal scheme. */
22
37
  export declare function setInternalUrlSchemeHost(host: InternalUrlSchemeHost): void;
23
38
  /** Declared spec of `scheme`; undefined when it is unregistered or no host is installed. */
24
39
  export declare function internalUrlSchemeSpec(scheme: string): InternalUrlSchemeSpec | undefined;
40
+ /** Declared specs of every registered scheme, keyed by lowercased scheme; empty when no host is installed. */
41
+ export declare function internalUrlSchemeSpecs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
25
42
  /** Split a hierarchical `scheme://rest` URL into its lowercased scheme and the text after `://`. */
26
43
  export declare function splitUrlScheme(input: string): {
27
44
  scheme: string;
@@ -17,6 +17,8 @@ export interface JobSnapshot {
17
17
  type: "bash" | "task" | "eval";
18
18
  status: "running" | "completed" | "failed" | "cancelled";
19
19
  label: string;
20
+ /** What the job is for, in the model's words (a process job's `label` is its command line). */
21
+ intent?: string;
20
22
  durationMs: number;
21
23
  /** Process exit status when the job reports one. */
22
24
  exitCode?: number;
@@ -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;
@@ -192,6 +194,18 @@ export interface Component {
192
194
  */
193
195
  dispose?(): void;
194
196
  }
197
+ /**
198
+ * A gutter component that can hand an external native renderer a semantic
199
+ * snapshot of the column it draws (see {@link TUI.setGutterComponent}). Such a
200
+ * component keeps rendering its ANSI rows — the snapshot only travels
201
+ * out-of-band — and a GUI that receives it draws the same content natively.
202
+ * Deliberately separate from {@link Component}: only a sidebar-shaped
203
+ * component describes itself for a whole external surface.
204
+ */
205
+ export interface NativeSnapshotSource {
206
+ /** JSON-serializable TSP node for an external native sidebar renderer. */
207
+ describeSnapshot(): NativeNode | null;
208
+ }
195
209
  /** Lets an overlay root delegate keyboard focus to components it owns. */
196
210
  export interface OverlayFocusOwner {
197
211
  /** Returns true when `component` is a focus target inside this overlay. */
@@ -525,7 +539,10 @@ export declare class TUI extends Container {
525
539
  * never come.
526
540
  */
527
541
  addStartListener(listener: StartListener): () => void;
528
- addInputListener(listener: InputListener): () => void;
542
+ /** Registers a key listener; `prepend` gives a foreground input owner first refusal over global shortcuts. */
543
+ addInputListener(listener: InputListener, options?: {
544
+ prepend?: boolean;
545
+ }): () => void;
529
546
  removeInputListener(listener: InputListener): void;
530
547
  stop(): void;
531
548
  /**
@@ -36,6 +36,10 @@ export declare function truncateToWidth(text: string, maxWidth: number, ellipsis
36
36
  export declare function wrapTextWithAnsi(text: string, width: number): string[];
37
37
  export declare function extractSegments(line: string, beforeEnd: number, afterStart: number, afterLen: number, strictAfter: boolean): ExtractSegmentsResult;
38
38
  export declare function replaceTabs(text: string): string;
39
+ /** Tabs expanded and line breaks collapsed to spaces, for text confined to one rendered row. */
40
+ export declare function singleLine(text: string): string;
41
+ /** A non-negative integer cell width; non-finite input becomes `fallback`. */
42
+ export declare function finiteWidth(width: number, fallback?: number): number;
39
43
  /**
40
44
  * Returns a string of n spaces. Uses a pre-allocated buffer for efficiency.
41
45
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@linxiraos/pi-tui",
4
- "version": "1.4.6",
4
+ "version": "1.4.9",
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.6",
42
- "@linxiraos/pi-agent-core": "1.4.6",
43
- "@linxiraos/pi-ai": "1.4.6",
44
- "@linxiraos/pi-catalog": "1.4.6",
45
- "@linxiraos/pi-natives": "1.4.6",
46
- "@linxiraos/pi-utils": "1.4.6",
47
- "@linxiraos/pi-wire": "1.4.6",
48
- "@linxiraos/pi-snapcompact": "1.4.6"
41
+ "@linxiraos/pi-omptype": "1.4.9",
42
+ "@linxiraos/pi-agent-core": "1.4.9",
43
+ "@linxiraos/pi-ai": "1.4.9",
44
+ "@linxiraos/pi-catalog": "1.4.9",
45
+ "@linxiraos/pi-natives": "1.4.9",
46
+ "@linxiraos/pi-utils": "1.4.9",
47
+ "@linxiraos/pi-wire": "1.4.9",
48
+ "@linxiraos/pi-snapcompact": "1.4.9"
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"
@@ -24,6 +24,7 @@ interface AppKeybindings {
24
24
  "app.message.followUp": true;
25
25
  "app.retry": true;
26
26
  "app.message.dequeue": true;
27
+ "app.btw.inject": true;
27
28
  "app.clipboard.pasteImage": true;
28
29
  "app.clipboard.pasteTextRaw": true;
29
30
  "app.clipboard.copyLine": true;
@@ -39,10 +40,13 @@ interface AppKeybindings {
39
40
  "app.session.rename": true;
40
41
  "app.session.delete": true;
41
42
  "app.session.deleteNoninvasive": true;
43
+ "app.session.pin": true;
44
+ "app.session.unpin": true;
42
45
  "app.tree.previousBranch": true;
43
46
  "app.tree.nextBranch": true;
44
47
  "app.plan.toggle": true;
45
48
  "app.history.search": true;
49
+ "app.links.hint": true;
46
50
  "app.stt.pushToTalk": true;
47
51
  "app.stt.toggle": true;
48
52
  "app.live.toggle": true;
@@ -269,6 +273,10 @@ export declare const KEYBINDINGS: {
269
273
  readonly defaultKeys: ["alt+up", "shift+up"];
270
274
  readonly description: "Dequeue message";
271
275
  };
276
+ readonly "app.btw.inject": {
277
+ readonly defaultKeys: "alt+i";
278
+ readonly description: "Send a /btw answer's steering prompt to the main session";
279
+ };
272
280
  readonly "app.clipboard.pasteImage": {
273
281
  readonly defaultKeys: KeyId[];
274
282
  readonly description: "Paste image or text from clipboard";
@@ -329,6 +337,14 @@ export declare const KEYBINDINGS: {
329
337
  readonly defaultKeys: "ctrl+backspace";
330
338
  readonly description: "Delete session (non-invasive)";
331
339
  };
340
+ readonly "app.session.pin": {
341
+ readonly defaultKeys: "alt+k";
342
+ readonly description: "Pin the selected session in the resume picker";
343
+ };
344
+ readonly "app.session.unpin": {
345
+ readonly defaultKeys: "alt+shift+k";
346
+ readonly description: "Unpin the selected session in the resume picker";
347
+ };
332
348
  readonly "app.tree.previousBranch": {
333
349
  readonly defaultKeys: [];
334
350
  readonly description: "Jump to the previous branch in /tree";
@@ -345,6 +361,10 @@ export declare const KEYBINDINGS: {
345
361
  readonly defaultKeys: "ctrl+r";
346
362
  readonly description: "Search history";
347
363
  };
364
+ readonly "app.links.hint": {
365
+ readonly defaultKeys: "alt+o";
366
+ readonly description: "Pick an extension link on screen by its hint tag";
367
+ };
348
368
  readonly "app.stt.pushToTalk": {
349
369
  readonly defaultKeys: "space";
350
370
  readonly description: "Hold to record speech-to-text";
@@ -44,6 +44,7 @@ interface AppKeybindings {
44
44
  "app.message.followUp": true;
45
45
  "app.retry": true;
46
46
  "app.message.dequeue": true;
47
+ "app.btw.inject": true;
47
48
  "app.clipboard.pasteImage": true;
48
49
  "app.clipboard.pasteTextRaw": true;
49
50
  "app.clipboard.copyLine": true;
@@ -59,10 +60,13 @@ interface AppKeybindings {
59
60
  "app.session.rename": true;
60
61
  "app.session.delete": true;
61
62
  "app.session.deleteNoninvasive": true;
63
+ "app.session.pin": true;
64
+ "app.session.unpin": true;
62
65
  "app.tree.previousBranch": true;
63
66
  "app.tree.nextBranch": true;
64
67
  "app.plan.toggle": true;
65
68
  "app.history.search": true;
69
+ "app.links.hint": true;
66
70
  "app.stt.pushToTalk": true;
67
71
  "app.stt.toggle": true;
68
72
  "app.live.toggle": true;
@@ -179,6 +183,10 @@ export const KEYBINDINGS = {
179
183
  defaultKeys: ["alt+up", "shift+up"],
180
184
  description: "Dequeue message",
181
185
  },
186
+ "app.btw.inject": {
187
+ defaultKeys: "alt+i",
188
+ description: "Send a /btw answer's steering prompt to the main session",
189
+ },
182
190
  "app.clipboard.pasteImage": {
183
191
  defaultKeys: getDefaultPasteImageKeys(),
184
192
  description: "Paste image or text from clipboard",
@@ -239,6 +247,14 @@ export const KEYBINDINGS = {
239
247
  defaultKeys: "ctrl+backspace",
240
248
  description: "Delete session (non-invasive)",
241
249
  },
250
+ "app.session.pin": {
251
+ defaultKeys: "alt+k",
252
+ description: "Pin the selected session in the resume picker",
253
+ },
254
+ "app.session.unpin": {
255
+ defaultKeys: "alt+shift+k",
256
+ description: "Unpin the selected session in the resume picker",
257
+ },
242
258
  "app.tree.previousBranch": {
243
259
  defaultKeys: [],
244
260
  description: "Jump to the previous branch in /tree",
@@ -255,6 +271,10 @@ export const KEYBINDINGS = {
255
271
  defaultKeys: "ctrl+r",
256
272
  description: "Search history",
257
273
  },
274
+ "app.links.hint": {
275
+ defaultKeys: "alt+o",
276
+ description: "Pick an extension link on screen by its hint tag",
277
+ },
258
278
  "app.stt.pushToTalk": {
259
279
  defaultKeys: "space",
260
280
  description: "Hold to record speech-to-text",
@@ -37,7 +37,7 @@ import { routeSgrMouseInput } from "../../mouse";
37
37
  import { col, compact, keyed, node, row, span, stableKey, text } from "../../native/describe";
38
38
  import { Memo } from "../../native/memo";
39
39
  import type { DescribeContext, NativeNode, NativeUiEvent } from "../../native/node";
40
- import { actionButton } from "../../native/overlay";
40
+ import { actionButton, iconButton, segmentedTabs } from "../../native/overlay";
41
41
  import { type Component, type OverlayHandle, TUI } from "../../tui";
42
42
  import { truncateToWidth, visibleWidth } from "../../utils";
43
43
  import { theme, warmHighlighter } from "../../theme/theme";
@@ -1039,35 +1039,28 @@ class GitTuiComponent implements Component {
1039
1039
  } else {
1040
1040
  left.push(text([span(this.#model.branch ?? "detached", "muted")], { role: "zeta.app.git.path" }));
1041
1041
  }
1042
- const iconButton = (name: string, act: string, title: string, on?: boolean): NativeNode =>
1043
- node(
1044
- "icon",
1045
- { name, title, aria: title, role: on ? "zeta.app.ibtn.set" : "zeta.app.ibtn", actions: { click: act } },
1046
- undefined,
1047
- act,
1048
- );
1042
+ const tool = (name: string, act: string, title: string, on?: boolean): NativeNode =>
1043
+ iconButton(name, act, title, { key: act, on });
1049
1044
  const right: NativeNode[] = [
1050
1045
  row(
1051
1046
  [
1052
- iconButton("chev-up", "prev-hunk", `Previous change (${formatTooltipKey("alt+up")})`),
1053
- iconButton("chev", "next-hunk", `Next change (${formatTooltipKey("alt+down")})`),
1047
+ tool("chev-up", "prev-hunk", `Previous change (${formatTooltipKey("alt+up")})`),
1048
+ tool("chev", "next-hunk", `Next change (${formatTooltipKey("alt+down")})`),
1054
1049
  ],
1055
1050
  { gap: "none", align: "center" },
1056
1051
  ),
1057
- node(
1058
- "tabs",
1052
+ segmentedTabs(
1059
1053
  {
1060
1054
  items: VIEW_TABS.map(tab => ({ id: tab.id, label: tab.label })),
1061
1055
  active: this.#pane.mode,
1062
1056
  role: "zeta.app.seg",
1063
1057
  },
1064
- undefined,
1065
1058
  "views",
1066
1059
  ),
1067
1060
  ];
1068
1061
  if (!narrow) {
1069
1062
  right.push(
1070
- iconButton(
1063
+ tool(
1071
1064
  "type",
1072
1065
  "whitespace",
1073
1066
  this.#whitespace === "off"
@@ -1077,7 +1070,7 @@ class GitTuiComponent implements Component {
1077
1070
  : `Ignoring formatting and imports; show all (${formatTooltipKey("b")})`,
1078
1071
  this.#whitespace !== "off",
1079
1072
  ),
1080
- iconButton("corner-down-right", "wrap", `Wrap lines (${formatTooltipKey("w")})`, this.#pane.wrap),
1073
+ tool("corner-down-right", "wrap", `Wrap lines (${formatTooltipKey("w")})`, this.#pane.wrap),
1081
1074
  );
1082
1075
  }
1083
1076
  if (file?.area === "unstaged" || file?.area === "staged") {
@@ -1089,8 +1082,8 @@ class GitTuiComponent implements Component {
1089
1082
  );
1090
1083
  }
1091
1084
  right.push(
1092
- iconButton("keyboard", "help", `Keyboard shortcuts (${formatTooltipKey("?")})`),
1093
- iconButton("x", "close", `Close (${formatTooltipKey("q")})`),
1085
+ tool("keyboard", "help", `Keyboard shortcuts (${formatTooltipKey("?")})`),
1086
+ tool("x", "close", `Close (${formatTooltipKey("q")})`),
1094
1087
  );
1095
1088
  return keyed(
1096
1089
  row(
@@ -20,6 +20,7 @@ import { matchesKey } from "../../keys";
20
20
  import { col, compact, item, keyed, list, node, row, span, stableKey, text } from "../../native/describe";
21
21
  import { Memo } from "../../native/memo";
22
22
  import type { DescribeContext, NativeChild, NativeNode, NativeUiEvent } from "../../native/node";
23
+ import { actionButton, iconButton, quietButton, segmentedTabs } from "../../native/overlay";
23
24
  import type { TspProps, TspSpan } from "@linxiraos/pi-wire";
24
25
  import { TERMINAL } from "../../terminal-capabilities";
25
26
  import { truncateToWidth, visibleWidth } from "../../utils";
@@ -237,11 +238,6 @@ class GitFileTree {
237
238
  }
238
239
  }
239
240
 
240
- /** A quiet text button (`Stage all`): a clickable row the role sheet draws as `.btn.quiet`. */
241
- function quietButton(label: string, act: string, title: string): NativeNode {
242
- return node("row", { role: "zeta.app.qbtn", actions: { click: act }, title }, [text(label)], act);
243
- }
244
-
245
241
  /** A text field at rest: its value (or placeholder) as text; a click starts editing it. */
246
242
  function fieldText(
247
243
  value: string,
@@ -1099,8 +1095,7 @@ export class Sidebar {
1099
1095
  }
1100
1096
 
1101
1097
  #describeStyleToggle(): NativeNode {
1102
- return node(
1103
- "tabs",
1098
+ return segmentedTabs(
1104
1099
  {
1105
1100
  items: [
1106
1101
  { id: "path", label: "Path" },
@@ -1109,7 +1104,6 @@ export class Sidebar {
1109
1104
  active: this.viewStyle,
1110
1105
  role: "zeta.app.seg",
1111
1106
  },
1112
- undefined,
1113
1107
  "style",
1114
1108
  );
1115
1109
  }
@@ -1128,18 +1122,10 @@ export class Sidebar {
1128
1122
  area === "unstaged"
1129
1123
  ? [
1130
1124
  quietButton("Stage all", "stage-all", "Stage every change (space on the head)"),
1131
- node(
1132
- "icon",
1133
- {
1134
- name: "wand",
1135
- role: "zeta.app.ibtn",
1136
- title: "Stage by description…",
1137
- aria: "Stage by description",
1138
- actions: { click: "stage-ai" },
1139
- },
1140
- undefined,
1141
- "ai",
1142
- ),
1125
+ iconButton("wand", "stage-ai", "Stage by description…", {
1126
+ key: "ai",
1127
+ aria: "Stage by description",
1128
+ }),
1143
1129
  ]
1144
1130
  : [quietButton("Unstage all", "unstage-all", "Unstage every change (space on the head)")];
1145
1131
  const head = row(
@@ -1264,8 +1250,13 @@ export class Sidebar {
1264
1250
  "zeta.app.git.body",
1265
1251
  );
1266
1252
  const hasChanges = this.#model.staged.length > 0 || this.#model.unstaged.length > 0 || this.amend;
1267
- const canCommit =
1268
- hasChanges && !this.generating && (summary.trim().length > 0 || description.trim().length === 0);
1253
+ const blocked = !hasChanges
1254
+ ? "Nothing to commit"
1255
+ : this.generating
1256
+ ? "Generating the commit message…"
1257
+ : summary.trim().length === 0 && description.trim().length > 0
1258
+ ? "Write a summary line first"
1259
+ : undefined;
1269
1260
  const label = this.generating
1270
1261
  ? "Generating message…"
1271
1262
  : summary.trim().length === 0 && description.trim().length === 0
@@ -1273,8 +1264,13 @@ export class Sidebar {
1273
1264
  : this.#model.staged.length > 0
1274
1265
  ? "Commit"
1275
1266
  : "Stage all & commit";
1276
- // The panels' button (zeta-panels.css `zeta.btn`): accent while the keyboard is on it, muted when it can't run.
1277
- const commitTone = !canCommit ? "muted" : on({ kind: "commit-button" }) ? "accent" : undefined;
1267
+ // The panels' button: the primary while the keyboard is on it, disabled (saying why) when it can't run.
1268
+ const commit = actionButton(label, "commit", {
1269
+ title: this.#model.staged.length > 0 ? "Commit the staged changes" : "Stage everything, then commit",
1270
+ busy: this.generating,
1271
+ disabled: blocked,
1272
+ tone: on({ kind: "commit-button" }) ? "accent" : undefined,
1273
+ });
1278
1274
  return col(
1279
1275
  [
1280
1276
  keyed(summaryField, "summary"),
@@ -1289,17 +1285,7 @@ export class Sidebar {
1289
1285
  actions: { click: "amend" },
1290
1286
  title: "Amend the previous commit",
1291
1287
  }),
1292
- row(compact([this.generating && node("spinner", { style: "dots" }), text(label)]), {
1293
- gap: "xs",
1294
- align: "center",
1295
- role: "zeta.btn",
1296
- tone: commitTone,
1297
- actions: canCommit ? { click: "commit" } : undefined,
1298
- title:
1299
- this.#model.staged.length > 0
1300
- ? "Commit the staged changes"
1301
- : "Stage everything, then commit",
1302
- }),
1288
+ commit,
1303
1289
  ],
1304
1290
  { justify: "between", align: "center", role: "zeta.app.git.foot" },
1305
1291
  ),
@@ -17,7 +17,7 @@ import { type Component, TUI } from "../tui";
17
17
  import type { TspSpan, TspText, TspTone } from "@linxiraos/pi-wire";
18
18
  import { col, compact, elapsed, keyed, node, row, span, stableKey, text } from "../native/describe";
19
19
  import type { NativeNode, NativeUiEvent } from "../native/node";
20
- import { actionBar, actionButton } from "../native/overlay";
20
+ import { actionBar, actionButton, iconButton, segmentedTabs } from "../native/overlay";
21
21
  import { Memo } from "../native/memo";
22
22
  import { truncateToWidth } from "../utils";
23
23
  import { formatDuration } from "@linxiraos/pi-utils";
@@ -410,13 +410,7 @@ export class PsTopComponent implements Component {
410
410
  );
411
411
  } else {
412
412
  left.push(
413
- node("icon", {
414
- name: "back",
415
- role: "zeta.app.ibtn",
416
- title: "Back esc",
417
- aria: "Back",
418
- actions: { click: "back" },
419
- }),
413
+ iconButton("back", "back", "Back esc", { aria: "Back" }),
420
414
  text(
421
415
  this.#view === "logs" ? `Logs · ${entry?.row.snapshot.name ?? "?"}` : (entry?.row.snapshot.name ?? "?"),
422
416
  {
@@ -432,8 +426,7 @@ export class PsTopComponent implements Component {
432
426
  const right: NativeNode[] = [];
433
427
  if (this.#view === "table") {
434
428
  right.push(
435
- node(
436
- "tabs",
429
+ segmentedTabs(
437
430
  {
438
431
  items: [
439
432
  {
@@ -448,7 +441,6 @@ export class PsTopComponent implements Component {
448
441
  active: this.#all ? "all" : "current",
449
442
  role: "zeta.app.seg",
450
443
  },
451
- undefined,
452
444
  "scope",
453
445
  ),
454
446
  );
@@ -468,7 +460,7 @@ export class PsTopComponent implements Component {
468
460
  align: "center",
469
461
  role: "zeta.app.fresh",
470
462
  }),
471
- node("icon", { name: "x", role: "zeta.app.ibtn", title: "Quit q", aria: "Quit", actions: { click: "quit" } }),
463
+ iconButton("x", "quit", "Quit q", { aria: "Quit" }),
472
464
  );
473
465
  return keyed(
474
466
  row(
@@ -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. */