@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
@@ -5,7 +5,7 @@ import { getCustomThemesDir } from "@linxiraos/pi-utils/dirs";
5
5
  import { isEnoent } from "@linxiraos/pi-utils/fs-error";
6
6
  import { detectColorMode, resolveThemeColors } from "./color";
7
7
  import darkThemeJson from "./dark.json" with { type: "json" };
8
- import { defaultThemes } from "./defaults";
8
+ import defaultThemes from "./defaults.json" with { type: "json" };
9
9
  import lightThemeJson from "./light.json" with { type: "json" };
10
10
  import type { ColorMode, ThemeBg, ThemeColor, ThemeJson } from "./schema";
11
11
  import { normalizeSpinnerFramesOverride, type SymbolPreset } from "./symbols";
@@ -2,7 +2,9 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
2
2
  /**
3
3
  * All available symbol keys organized by category.
4
4
  */
5
- export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "context.content" | "context.messages" | "context.buffer" | "context.free" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "icon.vimReplace" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
5
+ export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted"
6
+ /** @deprecated Alias of `status.success`; kept so extensions and theme overrides that name it keep working. */
7
+ | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "context.content" | "context.messages" | "context.buffer" | "context.free" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "icon.vimReplace" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "btw.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
6
8
  export type SymbolMap = Record<SymbolKey, string>;
7
9
  /**
8
10
  * Icon vocabulary for slash-command autocomplete type indicators. Each name
@@ -19,6 +19,7 @@ export type SymbolKey =
19
19
  | "status.running"
20
20
  | "status.shadowed"
21
21
  | "status.aborted"
22
+ /** @deprecated Alias of `status.success`; kept so extensions and theme overrides that name it keep working. */
22
23
  | "status.done"
23
24
  // Navigation
24
25
  | "nav.cursor"
@@ -212,6 +213,8 @@ export type SymbolKey =
212
213
  | "advisor.rail"
213
214
  // Skill callout rail (user turn that opened with a skill chip)
214
215
  | "skill.rail"
216
+ // /btw steering-prompt rail (the <inject> block a side answer drafted)
217
+ | "btw.rail"
215
218
  // Language/file type icons
216
219
  | "lang.default"
217
220
  | "lang.typescript"
@@ -404,7 +407,7 @@ const UNICODE_SYMBOLS: SymbolMap = {
404
407
  "status.running": "⟳",
405
408
  "status.shadowed": "○",
406
409
  "status.aborted": "⏹",
407
- "status.done": "•",
410
+ "status.done": "✔",
408
411
  // Navigation
409
412
  "nav.cursor": "❯",
410
413
  "nav.selected": "➤",
@@ -598,6 +601,7 @@ const UNICODE_SYMBOLS: SymbolMap = {
598
601
  // Advisor note rail (heavier than md.quoteBorder so notes read as a distinct voice)
599
602
  "advisor.rail": "▎",
600
603
  "skill.rail": "▎",
604
+ "btw.rail": "▎",
601
605
  // Language/file icons (emoji-centric, no Nerd Font required)
602
606
  "lang.default": "⌘",
603
607
  "lang.typescript": "🟦",
@@ -721,8 +725,8 @@ const NERD_SYMBOLS: SymbolMap = {
721
725
  "status.shadowed": "\uf10c",
722
726
  // pick:  | alt:  
723
727
  "status.aborted": "\uf04d",
724
- // pick: • | alt: ● ·
725
- "status.done": "•",
728
+ // alias of status.success
729
+ "status.done": "\uf00c",
726
730
  // Navigation
727
731
  // pick:  | alt:  
728
732
  "nav.cursor": "\uf054",
@@ -1072,6 +1076,7 @@ const NERD_SYMBOLS: SymbolMap = {
1072
1076
  // pick: ▎ | alt: ┃ │
1073
1077
  "advisor.rail": "▎",
1074
1078
  "skill.rail": "▎",
1079
+ "btw.rail": "▎",
1075
1080
  // Language icons (nerd font devicons)
1076
1081
  "lang.default": "",
1077
1082
  "lang.typescript": "\u{E628}",
@@ -1186,17 +1191,17 @@ const NERD_SYMBOLS: SymbolMap = {
1186
1191
 
1187
1192
  const ASCII_SYMBOLS: SymbolMap = {
1188
1193
  // Status Indicators
1189
- "status.success": "[ok]",
1190
- "status.error": "[!!]",
1194
+ "status.success": "[+]",
1195
+ "status.error": "[-]",
1191
1196
  "status.warning": "[!]",
1192
1197
  "status.info": "[i]",
1193
- "status.pending": "[*]",
1198
+ "status.pending": "[ ]",
1194
1199
  "status.disabled": "[ ]",
1195
1200
  "status.enabled": "[x]",
1196
1201
  "status.running": "[~]",
1197
1202
  "status.shadowed": "[/]",
1198
- "status.aborted": "[-]",
1199
- "status.done": "*",
1203
+ "status.aborted": "[#]",
1204
+ "status.done": "[+]",
1200
1205
  // Navigation
1201
1206
  "nav.cursor": ">",
1202
1207
  "nav.selected": "->",
@@ -1386,6 +1391,7 @@ const ASCII_SYMBOLS: SymbolMap = {
1386
1391
  "md.colorSwatch": "[]",
1387
1392
  "advisor.rail": "|",
1388
1393
  "skill.rail": "|",
1394
+ "btw.rail": "|",
1389
1395
  // Language icons (ASCII uses abbreviations)
1390
1396
  "lang.default": "code",
1391
1397
  "lang.typescript": "ts",
@@ -1502,7 +1508,8 @@ export const SPINNER_FRAMES: Record<SymbolPreset, Record<SpinnerType, string[]>>
1502
1508
  activity: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
1503
1509
  },
1504
1510
  ascii: {
1505
- status: ["|", "/", "-", "\\"],
1511
+ // Bracketed like the `status.*` glyphs, so a settling call keeps its column width.
1512
+ status: ["[|]", "[/]", "[-]", "[\\]"],
1506
1513
  activity: ["-", "\\", "|", "/"],
1507
1514
  },
1508
1515
  };
@@ -129,6 +129,7 @@ export declare class Theme {
129
129
  running: string;
130
130
  shadowed: string;
131
131
  aborted: string;
132
+ /** @deprecated Alias of `success`. */
132
133
  done: string;
133
134
  };
134
135
  get nav(): {
@@ -138,6 +138,15 @@ const LANG_BRAND_COLORS: Partial<Record<SymbolKey, string>> = {
138
138
  const BACKGROUND_RESET_PATTERN = /\x1b\[(?:0|49)m/g;
139
139
  const FOREGROUND_RESET_PATTERN = /\x1b\[(?:0|39)m/g;
140
140
 
141
+ /**
142
+ * Color `text` with the foreground `ansi`, restoring it after every nested reset so the rest of `text`
143
+ * keeps it (`fg("dim", `${fg("success", "+2")} more`)`); only the foreground is reset at the end.
144
+ */
145
+ function wrapForeground(ansi: string, text: string): string {
146
+ const body = text.includes("\x1b[") ? text.replace(FOREGROUND_RESET_PATTERN, `$&${ansi}`) : text;
147
+ return `${ansi}${body}\x1b[39m`;
148
+ }
149
+
141
150
  // Prebuilt stylers: each `chalk.<style>` access builds a fresh builder. Builders share the
142
151
  // root chalk context, so later `chalk.level` changes still apply.
143
152
  const boldStyler = chalk.bold;
@@ -234,6 +243,8 @@ export class Theme {
234
243
  logger.debug("Invalid symbol key in override", { key, availableKeys: Object.keys(this.#symbols) });
235
244
  }
236
245
  }
246
+ // `status.done` aliases `status.success` unless a theme overrides it explicitly.
247
+ if (!("status.done" in symbolOverrides)) this.#symbols["status.done"] = this.#symbols["status.success"];
237
248
  this.#spinnerFramesOverrides = spinnerFramesOverrides;
238
249
  }
239
250
 
@@ -350,7 +361,7 @@ export class Theme {
350
361
  fg(color: ThemeColor, text: string): string {
351
362
  const ansi = this.#fgColors[color];
352
363
  if (!ansi) throw new Error(`Unknown theme color: ${color}`);
353
- return `${ansi}${text}\x1b[39m`; // Reset only foreground color
364
+ return wrapForeground(ansi, text);
354
365
  }
355
366
 
356
367
  /** Apply a foreground, replacing terminal-default tokens with the theme's contrast-safe fallback. */
@@ -362,7 +373,7 @@ export class Theme {
362
373
  resolved = ansi === "\x1b[39m" ? colorToAnsi(this.getColorHex(color), this.mode) : ansi;
363
374
  this.#resolvedFgColors.set(color, resolved);
364
375
  }
365
- return `${resolved}${text.replace(FOREGROUND_RESET_PATTERN, `$&${resolved}`)}\x1b[39m`;
376
+ return wrapForeground(resolved, text);
366
377
  }
367
378
 
368
379
  bg(color: ThemeBg, text: string): string {
@@ -390,7 +401,7 @@ export class Theme {
390
401
  */
391
402
  fgOnBg(color: ThemeColor, background: ThemeBg, text: string): string {
392
403
  const ansi = this.getFgOnBgAnsi(color, background);
393
- return `${ansi}${text.replace(FOREGROUND_RESET_PATTERN, `$&${ansi}`)}\x1b[39m`;
404
+ return wrapForeground(ansi, text);
394
405
  }
395
406
 
396
407
  bold(text: string): string {
@@ -519,6 +530,7 @@ export class Theme {
519
530
  running: this.#symbols["status.running"],
520
531
  shadowed: this.#symbols["status.shadowed"],
521
532
  aborted: this.#symbols["status.aborted"],
533
+ /** @deprecated Alias of `success`. */
522
534
  done: this.#symbols["status.done"],
523
535
  };
524
536
  }
@@ -6,7 +6,7 @@ export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, type T
6
6
  export { isValidThemeColor, type ThemeBg, type ThemeColor } from "./schema";
7
7
  export { getAvailableSymbolPresets, isValidSymbolPreset, type SpinnerType, type SymbolKey, type SymbolPreset, } from "./symbols";
8
8
  export { Theme } from "./theme-class";
9
- export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters";
9
+ export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, isHighlightLanguage, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters";
10
10
  /**
11
11
  * Subscribe to native fallback appearance changes independently of theme changes.
12
12
  * Consumers must re-check the effective background: COLORFGBG can override it.
@@ -114,29 +114,6 @@ export declare function stopThemeWatcher(): void;
114
114
  * Used by HTML export to generate CSS custom properties.
115
115
  */
116
116
  export declare function getResolvedThemeColors(themeName?: string): Promise<Record<string, string>>;
117
- /** One appearance variant of {@link NativeThemePalette}: token name → `#rrggbb`. */
118
- export type NativeThemeVariant = Record<string, string>;
119
- /** omp's resolved theme for a Tern Surface Protocol terminal (the `t` verb body minus `sf`). */
120
- export interface NativeThemePalette {
121
- dark?: NativeThemeVariant;
122
- light?: NativeThemeVariant;
123
- name: {
124
- dark?: string;
125
- light?: string;
126
- };
127
- }
128
- /**
129
- * Cheap identity of everything {@link getNativeThemePalette} depends on;
130
- * recompute the palette only when it changes.
131
- */
132
- export declare function getNativeThemePaletteKey(): string;
133
- /**
134
- * omp's theme for a native surface: with auto theme, the configured dark and
135
- * light themes; otherwise (or while the theme selector previews one) the
136
- * active theme under its own appearance only. Themes without a loadable
137
- * definition (in-memory instances) contribute nothing.
138
- */
139
- export declare function getNativeThemePalette(): NativeThemePalette;
140
117
  /**
141
118
  * Check if a theme is a "light" theme by analyzing its status-line background
142
119
  * luminance. Loads theme JSON synchronously (built-in or custom file on disk)
@@ -8,16 +8,8 @@ import * as logger from "@linxiraos/pi-utils/logger";
8
8
  import { isTerminalBackgroundQueryTrusted } from "../terminal-multiplexer";
9
9
  import { setActiveSymbolTheme } from "./active-symbols";
10
10
  import { ansi256ToHex, resolveThemeColors, resolveVarRefs } from "./color";
11
- import {
12
- type CreateThemeOptions,
13
- createTheme,
14
- getBuiltinThemes,
15
- loadTheme,
16
- loadThemeJson,
17
- loadThemeJsonSync,
18
- loadThemeSync,
19
- } from "./loader";
20
- import { isValidThemeBg, isValidThemeColor, type ThemeColor, type ThemeJson } from "./schema";
11
+ import { type CreateThemeOptions, getBuiltinThemes, loadTheme, loadThemeJson, loadThemeSync } from "./loader";
12
+ import { type ThemeColor, type ThemeJson } from "./schema";
21
13
  import type { SymbolPreset } from "./symbols";
22
14
  import type { Theme } from "./theme-class";
23
15
 
@@ -40,6 +32,7 @@ export {
40
32
  getSettingsListTheme,
41
33
  getSymbolTheme,
42
34
  highlightCode,
35
+ isHighlightLanguage,
43
36
  setMarkdownMermaidRendering,
44
37
  warmHighlighter,
45
38
  } from "./tui-adapters";
@@ -843,71 +836,6 @@ export async function getResolvedThemeColors(themeName?: string): Promise<Record
843
836
  return cssColors;
844
837
  }
845
838
 
846
- /** One appearance variant of {@link NativeThemePalette}: token name → `#rrggbb`. */
847
- export type NativeThemeVariant = Record<string, string>;
848
-
849
- /** omp's resolved theme for a Tern Surface Protocol terminal (the `t` verb body minus `sf`). */
850
- export interface NativeThemePalette {
851
- dark?: NativeThemeVariant;
852
- light?: NativeThemeVariant;
853
- name: { dark?: string; light?: string };
854
- }
855
-
856
- /**
857
- * Cheap identity of everything {@link getNativeThemePalette} depends on;
858
- * recompute the palette only when it changes.
859
- */
860
- export function getNativeThemePaletteKey(): string {
861
- return `${themeEpoch}|${autoDetectedTheme}|${autoDarkTheme}|${autoLightTheme}|${currentThemeName}|${previewThemeName}|${currentColorBlindMode}`;
862
- }
863
-
864
- /** Every token of theme `name` as hex (terminal-default tokens omitted), plus its export colours. */
865
- function nativeThemeVariant(name: string): { light: boolean; colors: NativeThemeVariant } {
866
- const themeJson = loadThemeJsonSync(name);
867
- const built = createTheme(themeJson, getCurrentThemeOptions());
868
- const raw = resolveThemeColors(themeJson.colors, themeJson.vars);
869
- const colors: NativeThemeVariant = {};
870
- for (const key in raw) {
871
- // Terminal-default tokens stay unset; keys outside the schema are ignored like the theme does.
872
- if (raw[key as keyof typeof raw] === "") continue;
873
- if (isValidThemeColor(key)) colors[key] = built.getColorHex(key);
874
- else if (isValidThemeBg(key)) colors[key] = built.getBgHex(key);
875
- }
876
- const exported = resolveThemeExportColors(themeJson);
877
- for (const key of ["pageBg", "cardBg", "infoBg"] as const) {
878
- const value = exported[key];
879
- if (value) colors[key] = value;
880
- }
881
- return { light: isLightThemeJson(themeJson), colors };
882
- }
883
-
884
- /**
885
- * omp's theme for a native surface: with auto theme, the configured dark and
886
- * light themes; otherwise (or while the theme selector previews one) the
887
- * active theme under its own appearance only. Themes without a loadable
888
- * definition (in-memory instances) contribute nothing.
889
- */
890
- export function getNativeThemePalette(): NativeThemePalette {
891
- const palette: NativeThemePalette = { name: {} };
892
- const add = (name: string, as?: "dark" | "light"): void => {
893
- try {
894
- const variant = nativeThemeVariant(name);
895
- const slot = as ?? (variant.light ? "light" : "dark");
896
- palette[slot] = variant.colors;
897
- palette.name[slot] = name;
898
- } catch (error) {
899
- logger.debug("Native theme palette: theme not loadable", { name, error: String(error) });
900
- }
901
- };
902
- const single = previewThemeName ?? (autoDetectedTheme ? undefined : currentThemeName);
903
- if (single !== undefined) add(single);
904
- else {
905
- add(autoDarkTheme, "dark");
906
- add(autoLightTheme, "light");
907
- }
908
- return palette;
909
- }
910
-
911
839
  /**
912
840
  * Check if a theme is a "light" theme by analyzing its status-line background
913
841
  * luminance. Loads theme JSON synchronously (built-in or custom file on disk)
@@ -6,6 +6,8 @@ import type { SettingsListTheme } from "../components/settings-list";
6
6
  import type { SymbolTheme } from "../symbols";
7
7
  import type { SlashCommandIconName } from "./symbols";
8
8
  import type { Theme } from "./theme-class";
9
+ /** Whether {@link highlightCode} colors `lang`; text in any other language comes back unstyled. */
10
+ export declare function isHighlightLanguage(lang: string | undefined): lang is string;
9
11
  /**
10
12
  * Highlight code with syntax coloring based on file extension or language.
11
13
  * Returns array of highlighted lines.
@@ -96,12 +96,17 @@ function highlightCached(code: string, validLang: string | undefined, highlightT
96
96
  return highlighted;
97
97
  }
98
98
 
99
+ /** Whether {@link highlightCode} colors `lang`; text in any other language comes back unstyled. */
100
+ export function isHighlightLanguage(lang: string | undefined): lang is string {
101
+ return lang !== undefined && nativeSupportsLanguage(lang);
102
+ }
103
+
99
104
  /**
100
105
  * Highlight code with syntax coloring based on file extension or language.
101
106
  * Returns array of highlighted lines.
102
107
  */
103
108
  export function highlightCode(code: string, lang?: string, highlightTheme: Theme = theme): string[] {
104
- const validLang = lang && nativeSupportsLanguage(lang) ? lang : undefined;
109
+ const validLang = isHighlightLanguage(lang) ? lang : undefined;
105
110
  const highlighted = highlightCached(code, validLang, highlightTheme);
106
111
  // Always return a fresh array: callers (e.g. renderCodeCell) push extra lines
107
112
  // onto the result, which would corrupt the cached string otherwise.
@@ -110,7 +115,7 @@ export function highlightCode(code: string, lang?: string, highlightTheme: Theme
110
115
 
111
116
  /** Create a stateful highlighter for progressive terminal rendering. */
112
117
  export function createHighlightStream(lang?: string, highlightTheme: Theme = theme): NativeHighlightStream | null {
113
- const validLang = lang && nativeSupportsLanguage(lang) ? lang : undefined;
118
+ const validLang = isHighlightLanguage(lang) ? lang : undefined;
114
119
  if (!validLang) return null;
115
120
  // Workspace loads skip the natives version sentinel, so a stale local
116
121
  // `.node` can omit `HighlightStream` after a pull. Napi constructors can
@@ -305,7 +310,7 @@ export function getMarkdownTheme(): MarkdownTheme {
305
310
  })
306
311
  : undefined,
307
312
  highlightCode: (code: string, lang?: string): string[] => {
308
- const validLang = lang && nativeSupportsLanguage(lang) ? lang : undefined;
313
+ const validLang = isHighlightLanguage(lang) ? lang : undefined;
309
314
  const highlighted = highlightCached(code, validLang, theme);
310
315
  if (highlighted !== null) return highlighted.split("\n");
311
316
  return code.split("\n").map(line => theme.fg("mdCodeBlock", line));
package/src/thinking.d.ts CHANGED
@@ -137,12 +137,12 @@ export type TaskEffort = (typeof TASK_EFFORTS)[number];
137
137
  export declare function resolveTaskEffortLevel(model: Model | undefined, effort: TaskEffort, maxEffort?: Effort): Effort | undefined;
138
138
  /**
139
139
  * Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a
140
- * task spawn's `task.maxEffort`-capped effort hint). `off`/`inherit`/
141
- * `undefined` pass through, as do levels already at or below the ceiling.
142
- * Levels above it snap to the highest model-supported effort at or below the
143
- * ceiling. A model whose floor exceeds the ceiling has nothing valid to snap
144
- * to; the requested level is returned unchanged and the caller is responsible
145
- * for rejecting or skipping such models (see {@link modelSupportsEffortCeiling}).
140
+ * task spawn's `task.maxEffort`). Unset/`inherit`/`off` retain their existing
141
+ * meaning, as do levels already at or below the ceiling. Levels above it snap
142
+ * to the highest model-supported effort at or below the ceiling. A model whose
143
+ * floor exceeds the ceiling has nothing valid to snap to; the requested level
144
+ * is returned unchanged and the caller must reject or skip such models (see
145
+ * {@link modelSupportsEffortCeiling}).
146
146
  */
147
147
  export declare function clampThinkingLevelToCeiling(model: Model | undefined, level: Effort | undefined, ceiling: Effort | undefined): Effort | undefined;
148
148
  export declare function clampThinkingLevelToCeiling(model: Model | undefined, level: ThinkingLevel | undefined, ceiling: Effort | undefined): ThinkingLevel | undefined;
@@ -153,6 +153,8 @@ export declare function clampThinkingLevelToCeiling(model: Model | undefined, le
153
153
  * skip models whose floor would force the session above the ceiling.
154
154
  */
155
155
  export declare function modelSupportsEffortCeiling(model: Model, ceiling: Effort): boolean;
156
+ /** Throws when `model` has no supported effort at or below `task.maxEffort`, so a capped spawn fails instead of running at its floor. */
157
+ export declare function assertModelSupportsEffortCeiling(model: Model, maxEffort: Effort): void;
156
158
  /**
157
159
  * The provisional concrete level shown while `auto` is configured but before a
158
160
  * turn has been classified, and the fallback when classification fails. Prefers
package/src/thinking.ts CHANGED
@@ -312,23 +312,21 @@ export function resolveTaskEffortLevel(
312
312
  break;
313
313
  }
314
314
  if (maxEffort === undefined) return resolved;
315
+ if (model) assertModelSupportsEffortCeiling(model, maxEffort);
315
316
  const maxIndex = THINKING_EFFORTS.indexOf(maxEffort);
316
- const ceiling = supported.findLast(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex);
317
- if (ceiling === undefined) {
318
- const modelName = model ? `${model.provider}/${model.id}` : "Selected model";
319
- throw new RangeError(`${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort}`);
320
- }
317
+ // Without a model the full canonical range always holds `maxEffort` itself.
318
+ const ceiling = supported.findLast(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex) ?? maxEffort;
321
319
  return THINKING_EFFORTS.indexOf(resolved) > THINKING_EFFORTS.indexOf(ceiling) ? ceiling : resolved;
322
320
  }
323
321
 
324
322
  /**
325
323
  * Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a
326
- * task spawn's `task.maxEffort`-capped effort hint). `off`/`inherit`/
327
- * `undefined` pass through, as do levels already at or below the ceiling.
328
- * Levels above it snap to the highest model-supported effort at or below the
329
- * ceiling. A model whose floor exceeds the ceiling has nothing valid to snap
330
- * to; the requested level is returned unchanged and the caller is responsible
331
- * for rejecting or skipping such models (see {@link modelSupportsEffortCeiling}).
324
+ * task spawn's `task.maxEffort`). Unset/`inherit`/`off` retain their existing
325
+ * meaning, as do levels already at or below the ceiling. Levels above it snap
326
+ * to the highest model-supported effort at or below the ceiling. A model whose
327
+ * floor exceeds the ceiling has nothing valid to snap to; the requested level
328
+ * is returned unchanged and the caller must reject or skip such models (see
329
+ * {@link modelSupportsEffortCeiling}).
332
330
  */
333
331
  export function clampThinkingLevelToCeiling(
334
332
  model: Model | undefined,
@@ -367,6 +365,14 @@ export function modelSupportsEffortCeiling(model: Model, ceiling: Effort): boole
367
365
  return supported.some(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex);
368
366
  }
369
367
 
368
+ /** Throws when `model` has no supported effort at or below `task.maxEffort`, so a capped spawn fails instead of running at its floor. */
369
+ export function assertModelSupportsEffortCeiling(model: Model, maxEffort: Effort): void {
370
+ if (modelSupportsEffortCeiling(model, maxEffort)) return;
371
+ throw new RangeError(
372
+ `${model.provider}/${model.id} has no supported thinking effort at or below task.maxEffort=${maxEffort}`,
373
+ );
374
+ }
375
+
370
376
  /**
371
377
  * The provisional concrete level shown while `auto` is configured but before a
372
378
  * turn has been classified, and the fallback when classification fails. Prefers
package/src/tmux.ts CHANGED
@@ -21,6 +21,7 @@ const CLIENT_TERMINAL_TIMEOUT_MS = 2_000;
21
21
  const CLIENT_TERMNAME_PROGRAMS: ReadonlyArray<readonly [RegExp, string]> = [
22
22
  [/^xterm-kitty$/u, "kitty"],
23
23
  [/^xterm-ghostty$/u, "ghostty"],
24
+ [/^xterm-rex$/u, "rex"],
24
25
  [/^wezterm$/u, "wezterm"],
25
26
  ];
26
27
  let cachedClientTerminalNames: readonly string[] | undefined;
@@ -74,20 +74,22 @@ export function renderAgentTreeRow(
74
74
  const task = options.presentation === "task";
75
75
  const live = status === "pending" || status === "running";
76
76
  const failed = status === "failed" || status === "aborted";
77
- const iconColor = status === "completed" ? "success" : failed ? "error" : "accent";
78
77
  const nameColor = task && live && options.frozen ? "dim" : task && status === "completed" ? "text" : "accent";
79
- const iconStatus = status === "failed" ? "error" : status === "completed" ? "done" : status;
78
+ const iconStatus = status === "failed" ? "error" : status === "completed" ? "success" : status;
79
+ // Task rows draw a static glyph, so their bytes hold across spinner frames; eval rows animate.
80
+ const spinnerFrame = !task && status === "running" ? options.spinnerFrame : undefined;
81
+ // formatStatusIcon colors every glyph except a raw spinner frame, which eval rows paint accent.
82
+ // A frozen snapshot of a live Task row dims its glyph with its name, so it stops reading as in flight.
80
83
  const icon =
81
- task && !failed
82
- ? theme.styledSymbol("status.done", nameColor)
83
- : !task && status === "completed"
84
- ? theme.styledSymbol("tool.eval", "accent")
85
- : theme.fg(
86
- iconColor,
87
- formatStatusIcon(iconStatus, theme, status === "running" ? options.spinnerFrame : undefined),
88
- );
84
+ !task && status === "completed"
85
+ ? theme.styledSymbol("tool.eval", "accent")
86
+ : task && live && options.frozen
87
+ ? theme.fg("dim", status === "running" ? theme.status.running : theme.status.pending)
88
+ : spinnerFrame === undefined
89
+ ? formatStatusIcon(iconStatus, theme)
90
+ : theme.fg("accent", formatStatusIcon(iconStatus, theme, spinnerFrame));
89
91
  const lead = `${options.prefix}${options.prefix || !task ? " " : ""}${icon} `;
90
- const statusBadge = options.statusBadge ?? (failed ? ` ${formatBadge(status, iconColor, theme)}` : "");
92
+ const statusBadge = options.statusBadge ?? (failed ? ` ${formatBadge(status, "error", theme)}` : "");
91
93
  const id = Number.isFinite(width)
92
94
  ? truncateToWidth(options.id, Math.max(0, width - visibleWidth(lead) - visibleWidth(statusBadge)))
93
95
  : options.id;