@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
@@ -489,6 +489,8 @@ export const themeSetupScene: SetupScene = {
489
489
  get title(): string {
490
490
  return tuiText("setupThemeTitle", "Pick a theme");
491
491
  },
492
+ step: "Theme",
492
493
  minVersion: 1,
494
+ ansiOnly: true,
493
495
  mount: host => new ThemeSceneController(host),
494
496
  };
@@ -39,7 +39,6 @@ export interface SetupHost extends SetupUiHost {
39
39
  saveColorBlindMode(enabled: boolean): void;
40
40
  saveTheme(mode: "dark" | "light", name: string): void;
41
41
  captureBrowserSession(request: OAuthBrowserSessionRequest, signal?: AbortSignal): Promise<string>;
42
- copyToClipboard(text: string): Promise<void>;
43
42
  openInBrowser(url: string): void;
44
43
  markComplete(version: number): Promise<void>;
45
44
  playWelcomeIntro(): void;
@@ -81,11 +80,29 @@ export interface SetupSceneController extends Component {
81
80
  routeMouse?(event: SgrMouseEvent, line: number, col: number): void;
82
81
  }
83
82
 
83
+ /**
84
+ * Role of the sheet (`picker` or `overlay`) an interactive scene presents in a
85
+ * TSP terminal. The terminal's setup stylesheet seats it under the wizard's
86
+ * brand and stepper instead of floating it over a dimmed page.
87
+ */
88
+ export const SETUP_SHEET_ROLE = "zeta.setup.sheet";
89
+
90
+ /** Surface role of the setup page (wizard and startup splash) in a TSP terminal. */
91
+ export const SETUP_SURFACE_ROLE = "zeta.app.setup";
92
+
84
93
  /** Versioned onboarding scene definition. */
85
94
  export interface SetupScene {
86
95
  id: string;
87
96
  title: string;
97
+ /** Short label for the wizard's stepper (`Sign in`, `Model`). */
98
+ step: string;
88
99
  minVersion: number;
100
+ /**
101
+ * Configures something only the cell-grid renderer draws (glyphs, composer
102
+ * shape, theme). A TSP terminal draws those itself, so the wizard skips the
103
+ * scene while a native surface is live.
104
+ */
105
+ ansiOnly?: boolean;
89
106
  shouldRun?(ctx: SetupHost): boolean | Promise<boolean>;
90
107
  mount(host: SetupSceneHost): SetupSceneController;
91
108
  }
@@ -1,10 +1,8 @@
1
1
  import { type Component, type OverlayFocusOwner } from "../tui";
2
2
  import { matchesKey } from "../keys";
3
- import { col } from "../native/describe";
4
- import type { NativeNode, NativeUiEvent } from "../native/node";
5
- import { Memo } from "../native/memo";
3
+ import type { NativeNode, NativeScreen, NativeUiEvent } from "../native/node";
6
4
  import { isNativeRendering } from "../native/state";
7
- import type { SetupUiHost } from "./scenes/types";
5
+ import { SETUP_SURFACE_ROLE, type SetupUiHost } from "./scenes/types";
8
6
  import { describeSetupSplash, renderSetupSplash, SETUP_SPLASH_MS, SETUP_TICK_MS } from "./scenes/splash";
9
7
 
10
8
  /** Timing controls for the standalone startup animation. */
@@ -19,7 +17,6 @@ class StartupSplashComponent implements Component, OverlayFocusOwner {
19
17
  #timer: NodeJS.Timeout | undefined;
20
18
  /** Native path: one-shot at the end of the splash; the terminal clocks the motion. */
21
19
  #deadline: NodeJS.Timeout | undefined;
22
- #native = new Memo();
23
20
  #done = Promise.withResolvers<void>();
24
21
  #disposed = false;
25
22
  readonly #durationMs: number;
@@ -67,9 +64,13 @@ class StartupSplashComponent implements Component, OverlayFocusOwner {
67
64
  return renderSetupSplash(Math.max(1, width), Math.max(1, this.ctx.ui.terminal.rows), elapsedMs);
68
65
  }
69
66
 
67
+ /** The setup page's splash, on a screen surface of the setup page's role. */
68
+ describeScreen(): NativeScreen {
69
+ return { role: SETUP_SURFACE_ROLE, main: [this], dock: [] };
70
+ }
71
+
70
72
  describe(): NativeNode {
71
- const splash = describeSetupSplash();
72
- return this.#native.get([splash], () => col([splash], { grow: 1, role: "zeta.app.startup-splash" }));
73
+ return describeSetupSplash();
73
74
  }
74
75
 
75
76
  handleNativeEvent(event: NativeUiEvent): void {
@@ -7,16 +7,23 @@ import { padToWidth } from "../render/utils";
7
7
  import { tuiText, tuiTextFmt } from "../i18n";
8
8
  import { routeSgrMouseInput, type SgrMouseEvent } from "../mouse";
9
9
  import { APP_NAME } from "@linxiraos/pi-utils";
10
- import { gradientLogo, logoNode, ZETA_LOGO } from "../prompt/welcome";
10
+ import { gradientLogo, ZETA_LOGO } from "../prompt/welcome";
11
11
  import { theme } from "../theme/theme";
12
- import { col, node, span, text } from "../native/describe";
13
- import type { NativeNode, NativeUiEvent } from "../native/node";
12
+ import { col, keyed, node, row, span, text } from "../native/describe";
13
+ import type { DescribeContext, NativeChild, NativeNode, NativeScreen, NativeUiEvent } from "../native/node";
14
14
  import { Memo } from "../native/memo";
15
+ import { actionButton } from "../native/overlay";
15
16
  import { isNativeRendering } from "../native/state";
16
17
  import type { SetupHost } from "./scenes/types";
17
18
  import { describeSetupOutro, renderSetupOutro, SETUP_OUTRO_MS } from "./scenes/outro";
18
19
  import { describeSetupSplash, renderSetupSplash, SETUP_SPLASH_MS, SETUP_TICK_MS } from "./scenes/splash";
19
- import type { SetupScene, SetupSceneController, SetupSceneHost, SetupSceneResult } from "./scenes/types";
20
+ import {
21
+ SETUP_SURFACE_ROLE,
22
+ type SetupScene,
23
+ type SetupSceneController,
24
+ type SetupSceneHost,
25
+ type SetupSceneResult,
26
+ } from "./scenes/types";
20
27
 
21
28
  type WizardPhase = "splash" | "transition" | "scene" | "outro" | "done";
22
29
 
@@ -35,6 +42,30 @@ const PHASE_LIMIT_MS: Partial<Record<WizardPhase, number>> = {
35
42
  /** Nothing left to show once the wizard completed. */
36
43
  const DONE_NODE = col([]);
37
44
 
45
+ /** Whether `scene` is asked under the current renderer: a TSP surface draws `ansiOnly` settings itself. */
46
+ export function setupSceneApplies(scene: SetupScene): boolean {
47
+ return !scene.ansiOnly || !isNativeRendering();
48
+ }
49
+
50
+ /** Stepper state of one step: before, at, or after the active scene. */
51
+ type StepState = "done" | "current" | "next";
52
+
53
+ const STEP_TONE = { done: "success", current: "accent", next: "muted" } as const;
54
+
55
+ /** One stepper entry: a disc (check once done, else the step number) and the label. */
56
+ function stepNode(label: string, position: number, state: StepState): NativeNode {
57
+ const disc =
58
+ state === "done"
59
+ ? node("icon", { name: "check", role: "zeta.setup.step.disc" })
60
+ : text(String(position + 1), { wrap: "none", role: "zeta.setup.step.disc" });
61
+ return node(
62
+ "row",
63
+ { align: "center", gap: "xs", role: "zeta.setup.step", tone: STEP_TONE[state] },
64
+ [disc, text(label, { wrap: "none", role: "zeta.setup.step.label" })],
65
+ `step:${position}`,
66
+ );
67
+ }
68
+
38
69
  function sceneFooterHint(): string {
39
70
  const navKeys = editorKeys("tui.select.up", "tui.select.down");
40
71
  return `${navKeys} select · ${editorKey("tui.select.confirm")} confirm · ${editorKey("tui.select.cancel")} skip · ${formatKeyHint("ctrl+c")} exit setup`;
@@ -76,8 +107,11 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
76
107
  #timer: NodeJS.Timeout | undefined;
77
108
  /** Native path: one-shot at the end of a timed phase; the terminal clocks the motion. */
78
109
  #deadline: NodeJS.Timeout | undefined;
110
+ #nativeHead = new Memo();
79
111
  #nativeScene = new Memo();
80
112
  #nativeRoot = new Memo();
113
+ /** Display name of the default model the outro reports; `null` once looked up and absent. */
114
+ #outroModel: string | null | undefined;
81
115
  #done = Promise.withResolvers<void>();
82
116
  #disposed = false;
83
117
  /** Screen row where the active scene's body began in the last rendered frame. */
@@ -90,7 +124,11 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
90
124
  ) {}
91
125
 
92
126
  run(): Promise<void> {
93
- this.#phase = this.scenes.length === 0 ? "outro" : "splash";
127
+ if (!this.scenes.some(setupSceneApplies)) {
128
+ this.#complete();
129
+ return this.#done.promise;
130
+ }
131
+ this.#phase = "splash";
94
132
  this.#phaseStartedAt = performance.now();
95
133
  this.#startTimer();
96
134
  this.ctx.ui.requestRender();
@@ -104,6 +142,7 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
104
142
  }
105
143
 
106
144
  invalidate(): void {
145
+ this.#nativeHead.clear();
107
146
  this.#nativeScene.clear();
108
147
  this.#activeScene?.invalidate?.();
109
148
  }
@@ -207,13 +246,18 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
207
246
  return this.#fitToScreen(lines, safeWidth, height);
208
247
  }
209
248
 
249
+ /** The wizard is a page of its own: a screen surface styled by {@link SETUP_SURFACE_ROLE}. */
250
+ describeScreen(_cx: DescribeContext): NativeScreen {
251
+ return { role: SETUP_SURFACE_ROLE, main: [this], dock: [] };
252
+ }
253
+
210
254
  /**
211
- * Fullscreen description: splash, the active scene inside the wizard
212
- * frame (brand header, step counter, title, footer hints), or the outro.
213
- * The splash→scene dissolve is a row effect with no native counterpart, so
214
- * a transition describes as the scene.
255
+ * Fullscreen description: splash, the active scene under the setup
256
+ * header (brand, stepper, Exit setup), or the outro. The splash→scene
257
+ * dissolve is a row effect with no native counterpart, so a transition
258
+ * describes as the scene.
215
259
  */
216
- describe(): NativeNode {
260
+ describe(cx: DescribeContext): NativeNode {
217
261
  let content: NativeNode;
218
262
  switch (this.#phase) {
219
263
  case "splash":
@@ -221,10 +265,10 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
221
265
  break;
222
266
  case "transition":
223
267
  case "scene":
224
- content = this.#describeScene();
268
+ content = this.#describeScene(cx.supports("picker"));
225
269
  break;
226
270
  case "outro":
227
- content = describeSetupOutro();
271
+ content = describeSetupOutro(this.#outroModelName());
228
272
  break;
229
273
  case "done":
230
274
  content = DONE_NODE;
@@ -242,53 +286,133 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
242
286
  if (event.type !== "action") return;
243
287
  if (event.act === "skip" && this.#phase === "splash") this.#beginScene();
244
288
  else if (event.act === "continue" && this.#phase === "outro") this.#complete();
289
+ else if (event.act === "exit" && (this.#phase === "scene" || this.#phase === "transition")) this.#beginOutro();
290
+ }
291
+
292
+ /**
293
+ * The steps the stepper and the ANSI counter show: every scene that
294
+ * applies to the current renderer, plus the active one (so a renderer
295
+ * switch mid-scene never orphans it), and the active one's position.
296
+ */
297
+ #steps(): { scenes: SetupScene[]; current: number } {
298
+ const scenes: SetupScene[] = [];
299
+ let current = 0;
300
+ this.scenes.forEach((scene, index) => {
301
+ if (index === this.#sceneIndex) current = scenes.length;
302
+ if (index === this.#sceneIndex || setupSceneApplies(scene)) scenes.push(scene);
303
+ });
304
+ return { scenes, current };
305
+ }
306
+
307
+ /**
308
+ * The setup header, a fixed-height row: the compact brand lockup (the
309
+ * builtin `zeta` mark and wordmark), the stepper of the applicable scenes
310
+ * (done = check in the success tone, current = accent, upcoming = muted,
311
+ * hairline connectors between), and a quiet Exit setup button (⌃C).
312
+ */
313
+ #describeHead(): NativeNode {
314
+ return this.#nativeHead.get([this.#sceneIndex], () => {
315
+ const { scenes, current } = this.#steps();
316
+ const steps: NativeChild[] = [];
317
+ scenes.forEach((scene, position) => {
318
+ if (position > 0) {
319
+ steps.push(
320
+ node(
321
+ "rule",
322
+ { role: "zeta.setup.step.line", tone: position <= current ? "success" : "muted" },
323
+ undefined,
324
+ `line:${position}`,
325
+ ),
326
+ );
327
+ }
328
+ steps.push(
329
+ stepNode(scene.step, position, position < current ? "done" : position === current ? "current" : "next"),
330
+ );
331
+ });
332
+ return keyed(
333
+ row(
334
+ [
335
+ keyed(
336
+ row(
337
+ [
338
+ node(
339
+ "image",
340
+ { builtin: "zeta", alt: APP_NAME, w: 22, role: "zeta.setup.mark" },
341
+ undefined,
342
+ "logo",
343
+ ),
344
+ keyed(
345
+ text([span(APP_NAME, "strong")], { wrap: "none", role: "zeta.setup.brand.name" }),
346
+ "name",
347
+ ),
348
+ keyed(
349
+ text([span("Setup", "muted")], { wrap: "none", role: "zeta.setup.brand.label" }),
350
+ "label",
351
+ ),
352
+ ],
353
+ { align: "center", role: "zeta.setup.brand" },
354
+ ),
355
+ "brand",
356
+ ),
357
+ keyed(row(steps, { align: "center", role: "zeta.setup.steps" }), "steps"),
358
+ actionButton("Exit setup", "exit", { keys: "ctrl+c" }),
359
+ ],
360
+ { align: "center", role: "zeta.setup.head" },
361
+ ),
362
+ "head",
363
+ );
364
+ });
245
365
  }
246
366
 
247
- #describeScene(): NativeNode {
367
+ /**
368
+ * The scene page: the setup header over the body. A terminal that draws
369
+ * `picker` sheets gets the active scene alone (its sheet, titled with the
370
+ * scene, hoists into the layer and sits under the header); otherwise the
371
+ * scene title and subtitle head the scene's inline content.
372
+ */
373
+ #describeScene(pickers: boolean): NativeNode {
248
374
  const scene = this.scenes[this.#sceneIndex];
249
375
  const active = this.#activeScene;
250
376
  const title = active?.title ?? scene?.title ?? "Setup";
251
377
  const subtitle = active?.subtitle;
252
- const footer = sceneFooterHint();
253
- return this.#nativeScene.get([this.#sceneIndex, this.scenes.length, active, title, subtitle, footer], () => {
254
- const heading: NativeNode[] = [text([span(title, "strong")])];
255
- if (subtitle) heading.push(text([span(subtitle, "muted")]));
378
+ const head = this.#describeHead();
379
+ return this.#nativeScene.get([head, active, title, subtitle, pickers], () => {
380
+ const body: NativeChild[] = [];
381
+ if (!pickers) {
382
+ body.push(keyed(text([span(title, "strong")], { role: "zeta.setup.title" }), "title"));
383
+ if (subtitle)
384
+ body.push(keyed(text([span(subtitle, "muted")], { role: "zeta.setup.subtitle" }), "subtitle"));
385
+ }
386
+ if (active) body.push(active);
256
387
  return col(
257
388
  [
258
- col(
259
- [
260
- logoNode(ZETA_LOGO, false),
261
- text([span(APP_NAME, "accent strong")], { wrap: "none" }),
262
- text([span(`Setup step ${this.#sceneIndex + 1} of ${this.scenes.length}`, "muted")], {
263
- wrap: "none",
264
- }),
265
- ],
266
- { align: "center" },
267
- ),
268
- col(heading),
389
+ head,
269
390
  // Keyed by scene so a new scene's nodes never reuse the previous one's ids.
270
- node("col", { grow: 1 }, active ? [active] : [], `body:${scene?.id ?? this.#sceneIndex}`),
271
- col([text([span(footer, "dim")])], { align: "center" }),
391
+ node("col", { grow: 1, role: "zeta.setup.body" }, body, `body:${scene?.id ?? this.#sceneIndex}`),
272
392
  ],
273
- { gap: "md", grow: 1, role: "zeta.setup.scene" },
393
+ { grow: 1, role: "zeta.setup.scene" },
274
394
  );
275
395
  });
276
396
  }
277
397
 
398
+ /** The default model's display name for the outro, looked up once per outro. */
399
+ #outroModelName(): string | undefined {
400
+ if (this.#outroModel === undefined) this.#outroModel = this.ctx.getModels().current?.name ?? null;
401
+ return this.#outroModel ?? undefined;
402
+ }
403
+
278
404
  #renderScene(width: number, height: number): string[] {
279
405
  const scene = this.scenes[this.#sceneIndex];
280
406
  const title = this.#activeScene?.title ?? scene?.title ?? tuiText("setupFallbackTitle", "Setup");
281
407
  const subtitle = this.#activeScene?.subtitle;
408
+ const { scenes: steps, current } = this.#steps();
282
409
  const contentWidth = Math.max(MIN_CONTENT_WIDTH, width - SCENE_MARGIN_X * 2);
283
410
  const logo = gradientLogo(ZETA_LOGO, 0);
284
411
  const header = [
285
412
  ...logo.map(line => centerLine(line, width)),
286
413
  centerLine(theme.bold(theme.fg("accent", APP_NAME)), width),
287
414
  centerLine(
288
- theme.fg(
289
- "muted",
290
- tuiTextFmt("setupStepFmt", "Setup step %s of %s", this.#sceneIndex + 1, this.scenes.length),
291
- ),
415
+ theme.fg("muted", tuiTextFmt("setupStepFmt", "Setup step %s of %s", current + 1, steps.length)),
292
416
  width,
293
417
  ),
294
418
  "",
@@ -373,6 +497,10 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
373
497
  #mountSceneController(targetPhase: "scene" | "transition"): void {
374
498
  if (this.#disposed) return;
375
499
  this.#unmountActiveScene();
500
+ // Decided at mount time, so a native surface opened or closed mid-wizard is honored.
501
+ while (this.#sceneIndex < this.scenes.length && !setupSceneApplies(this.scenes[this.#sceneIndex])) {
502
+ this.#sceneIndex += 1;
503
+ }
376
504
  if (this.#sceneIndex >= this.scenes.length) {
377
505
  this.#beginOutro();
378
506
  return;
@@ -428,6 +556,7 @@ export class SetupWizardComponent implements Component, OverlayFocusOwner {
428
556
  if (this.#phase === "done") return;
429
557
  this.#unmountActiveScene();
430
558
  this.#phase = "outro";
559
+ this.#outroModel = undefined;
431
560
  this.#phaseStartedAt = performance.now();
432
561
  this.ctx.ui.setFocus(this);
433
562
  this.#startTimer();
@@ -6,7 +6,7 @@ import { modelSetupScene } from "./scenes/model";
6
6
  import { providersSetupScene } from "./scenes/sign-in";
7
7
  import { themeSetupScene } from "./scenes/theme";
8
8
  import type { SetupScene } from "./scenes/types";
9
- import { SetupWizardComponent } from "./wizard-overlay";
9
+ import { SetupWizardComponent, setupSceneApplies } from "./wizard-overlay";
10
10
 
11
11
  export type { SetupScene, SetupSceneController, SetupSceneHost, SetupSceneResult } from "./scenes/types";
12
12
 
@@ -70,13 +70,22 @@ export interface RunSetupWizardOptions {
70
70
  playWelcomeIntro?: boolean;
71
71
  }
72
72
 
73
- /** Own the fullscreen setup overlay until its scenes and outro finish. */
73
+ /**
74
+ * Own the fullscreen setup overlay until its scenes and outro finish. When
75
+ * none of `scenes` applies to the current renderer (a TSP surface skips
76
+ * `ansiOnly` ones) nothing is shown, but completion is still persisted.
77
+ */
74
78
  export async function runSetupWizard(
75
79
  ctx: SetupHost,
76
80
  scenes: readonly SetupScene[] = ALL_SCENES,
77
81
  options: RunSetupWizardOptions = {},
78
82
  ): Promise<void> {
79
83
  if (scenes.length === 0) return;
84
+ if (!scenes.some(setupSceneApplies)) {
85
+ if (options.markComplete !== false) await ctx.markComplete(CURRENT_SETUP_VERSION);
86
+ if (options.playWelcomeIntro !== false) ctx.playWelcomeIntro();
87
+ return;
88
+ }
80
89
  const component = new SetupWizardComponent(ctx, scenes);
81
90
  const overlay = ctx.ui.showOverlay(component, {
82
91
  width: "100%",
@@ -828,8 +828,6 @@ export class StatusLineComponent<TSession extends StatusLineSession = StatusLine
828
828
  #codexResetSnapshots = new Map<string, CodexResetUsageSnapshot>();
829
829
  #onCodexResetFireworks: ((event: CodexResetFireworksEvent) => void) | undefined;
830
830
  #onResetExpiryNotice: ((notice: string) => void) | undefined;
831
- /** Conversations already warned about expiring saved resets: later refreshes stay quiet. */
832
- #resetExpiryNoticedSessions = new Set<string>();
833
831
  // Context-usage memo. The status line redraws on every agent event, so the
834
832
  // hot path must not recompute context tokens unless an input changed.
835
833
  // `getContextUsage()` anchors on the last assistant's real prompt-token
@@ -1249,7 +1247,7 @@ export class StatusLineComponent<TSession extends StatusLineSession = StatusLine
1249
1247
  this.#onCodexResetFireworks = handler;
1250
1248
  }
1251
1249
 
1252
- /** Set the callback that presents the first pool-wide saved-reset expiry warning, or clear it with `undefined`. */
1250
+ /** Set the callback that presents pool-wide saved-reset expiry warnings, or clear it with `undefined`. */
1253
1251
  setResetExpiryNoticeHandler(handler: ((notice: string) => void) | undefined): void {
1254
1252
  this.#onResetExpiryNotice = handler;
1255
1253
  }
@@ -2132,7 +2130,7 @@ export class StatusLineComponent<TSession extends StatusLineSession = StatusLine
2132
2130
  }
2133
2131
 
2134
2132
  #noticeResetExpiry(session: TSession, reports: unknown): void {
2135
- // A focused subagent's view is not a conversation the user started; warn in their own.
2133
+ // A focused subagent's view is not a conversation the user started; leave the warning for their own.
2136
2134
  if (
2137
2135
  this.#focusedAgentId !== undefined ||
2138
2136
  !this.#onResetExpiryNotice ||
@@ -2141,8 +2139,6 @@ export class StatusLineComponent<TSession extends StatusLineSession = StatusLine
2141
2139
  ) {
2142
2140
  return;
2143
2141
  }
2144
- const sessionId = session.sessionManager.getSessionId();
2145
- if (this.#resetExpiryNoticedSessions.has(sessionId)) return;
2146
2142
  // fetchUsageReports supplies normalized rows; keep only entries shaped like reports.
2147
2143
  const usageReports = reports.filter(
2148
2144
  (report): report is UsageReport =>
@@ -2152,10 +2148,8 @@ export class StatusLineComponent<TSession extends StatusLineSession = StatusLine
2152
2148
  "limits" in report &&
2153
2149
  Array.isArray(report.limits),
2154
2150
  );
2155
- const notice = this.host.resetExpiryNotice(usageReports, Date.now());
2156
- if (!notice) return;
2157
- this.#resetExpiryNoticedSessions.add(sessionId);
2158
- this.#onResetExpiryNotice(notice);
2151
+ const notice = this.host.resetExpiryNotice(session, usageReports, Date.now());
2152
+ if (notice) this.#onResetExpiryNotice(notice);
2159
2153
  }
2160
2154
 
2161
2155
  #observeLateUsageRefresh(session: TSession, reportsPromise: Promise<unknown>, sequence: number): void {