@linxiraos/pi-tui 1.4.11 → 1.4.13

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 (265) hide show
  1. package/CHANGELOG.md +30 -233
  2. package/README.md +4 -1
  3. package/THIRD-PARTY-NOTICES.txt +4 -5
  4. package/dist/types/apps/shell-visualizer.d.ts +24 -0
  5. package/dist/types/autocomplete.d.ts +20 -0
  6. package/dist/types/chat/cache-invalidation-marker.d.ts +15 -7
  7. package/dist/types/chat/chat-transcript-builder.d.ts +5 -3
  8. package/dist/types/chat/display-preferences.d.ts +2 -0
  9. package/dist/types/chat/extension-types.d.ts +72 -1
  10. package/dist/types/chat/image-loading.d.ts +2 -2
  11. package/dist/types/chat/messages.d.ts +2 -3
  12. package/dist/types/chat/read-tool-group.d.ts +15 -2
  13. package/dist/types/chat/skill-message.d.ts +1 -0
  14. package/dist/types/chat/spotlight.d.ts +203 -0
  15. package/dist/types/chat/tool-execution.d.ts +26 -5
  16. package/dist/types/chat/transcript-actions.d.ts +11 -0
  17. package/dist/types/chat/transcript-browser.d.ts +9 -0
  18. package/dist/types/chat/transcript-presentation.d.ts +164 -0
  19. package/dist/types/chat/ttsr-notification.d.ts +2 -0
  20. package/dist/types/chrome/message-frame.d.ts +2 -0
  21. package/dist/types/chrome/transcript-container.d.ts +27 -6
  22. package/dist/types/components/loader.d.ts +0 -2
  23. package/dist/types/components/markdown.d.ts +11 -1
  24. package/dist/types/components/settings-list.d.ts +12 -2
  25. package/dist/types/frame-rate.d.ts +18 -0
  26. package/dist/types/hotkeys-markdown.d.ts +2 -0
  27. package/dist/types/index.d.ts +3 -0
  28. package/dist/types/keybinding-matchers.d.ts +4 -1
  29. package/dist/types/kitty-graphics.d.ts +1 -1
  30. package/dist/types/motion-effects.d.ts +10 -0
  31. package/dist/types/native/encode.d.ts +2 -0
  32. package/dist/types/native/measure.d.ts +10 -0
  33. package/dist/types/native/overlay.d.ts +1 -1
  34. package/dist/types/native/quiet.d.ts +5 -0
  35. package/dist/types/native/reconcile.d.ts +6 -1
  36. package/dist/types/native/spans.d.ts +6 -0
  37. package/dist/types/native/state.d.ts +4 -0
  38. package/dist/types/overlays/agent-hub.d.ts +6 -0
  39. package/dist/types/overlays/link-browser.d.ts +55 -0
  40. package/dist/types/overlays/running-subagent-badge.d.ts +1 -4
  41. package/dist/types/overlays/spotlight-sheet.d.ts +36 -0
  42. package/dist/types/prompt/composer-attachments.d.ts +5 -2
  43. package/dist/types/prompt/composer-cache.d.ts +7 -2
  44. package/dist/types/prompt/composer.d.ts +6 -11
  45. package/dist/types/prompt/custom-editor.d.ts +8 -2
  46. package/dist/types/prompt/gradient-highlight.d.ts +2 -2
  47. package/dist/types/prompt/magic-keywords.d.ts +2 -0
  48. package/dist/types/prompt/model-mention-autocomplete.d.ts +9 -7
  49. package/dist/types/prompt/model-mention-syntax.d.ts +6 -0
  50. package/dist/types/prompt/prompt-action-autocomplete.d.ts +2 -1
  51. package/dist/types/prompt/welcome.d.ts +19 -0
  52. package/dist/types/render/extension-links.d.ts +0 -6
  53. package/dist/types/render/index.d.ts +1 -0
  54. package/dist/types/render/link-hints.d.ts +78 -0
  55. package/dist/types/render/render-utils.d.ts +0 -2
  56. package/dist/types/setup/scenes/types.d.ts +8 -0
  57. package/dist/types/setup/scenes/updates.d.ts +6 -0
  58. package/dist/types/setup/wizard.d.ts +7 -2
  59. package/dist/types/spinner-clock.d.ts +34 -0
  60. package/dist/types/status-line/component.d.ts +8 -4
  61. package/dist/types/status-line/host.d.ts +62 -0
  62. package/dist/types/status-line/index.d.ts +1 -0
  63. package/dist/types/status-line/prompt-cache.d.ts +14 -0
  64. package/dist/types/status-line/schema.d.ts +1 -1
  65. package/dist/types/status-line/startup.d.ts +6 -0
  66. package/dist/types/status-line/types.d.ts +8 -21
  67. package/dist/types/theme/schema.d.ts +28 -1
  68. package/dist/types/theme/symbols.d.ts +1 -1
  69. package/dist/types/theme/theme-class.d.ts +12 -2
  70. package/dist/types/theme/theme.d.ts +1 -1
  71. package/dist/types/theme/tui-adapters.d.ts +7 -0
  72. package/dist/types/thinking.d.ts +12 -0
  73. package/dist/types/tools/ask.d.ts +1 -1
  74. package/dist/types/tools/bash.d.ts +21 -0
  75. package/dist/types/tools/find.d.ts +9 -1
  76. package/dist/types/tools/grep.d.ts +2 -1
  77. package/dist/types/tools/grouped-file-output.d.ts +17 -0
  78. package/dist/types/tools/job-widget.d.ts +2 -2
  79. package/dist/types/tools/lsp.d.ts +4 -2
  80. package/dist/types/tools/native-view.d.ts +4 -0
  81. package/dist/types/tools/renderer.d.ts +9 -1
  82. package/dist/types/tools/shell-trace.d.ts +10 -0
  83. package/dist/types/tools/shell-viz-render.d.ts +6 -0
  84. package/dist/types/tools/shell-viz.d.ts +16 -0
  85. package/dist/types/tools/wait.d.ts +2 -2
  86. package/dist/types/tools/web-search-types.d.ts +1 -0
  87. package/dist/types/tools/write.d.ts +2 -0
  88. package/dist/types/tui.d.ts +15 -1
  89. package/package.json +15 -11
  90. package/src/apps/shell-visualizer.d.ts +24 -0
  91. package/src/apps/shell-visualizer.ts +167 -0
  92. package/src/autocomplete.d.ts +20 -0
  93. package/src/autocomplete.ts +14 -0
  94. package/src/chat/assistant-message.ts +11 -6
  95. package/src/chat/cache-invalidation-marker.d.ts +15 -7
  96. package/src/chat/cache-invalidation-marker.ts +18 -9
  97. package/src/chat/chat-transcript-builder.d.ts +5 -3
  98. package/src/chat/chat-transcript-builder.ts +16 -12
  99. package/src/chat/display-preferences.d.ts +2 -0
  100. package/src/chat/display-preferences.ts +3 -0
  101. package/src/chat/extension-types.d.ts +72 -1
  102. package/src/chat/extension-types.ts +74 -1
  103. package/src/chat/image-loading.d.ts +2 -2
  104. package/src/chat/image-loading.ts +2 -2
  105. package/src/chat/messages.d.ts +2 -3
  106. package/src/chat/messages.ts +3 -8
  107. package/src/chat/read-tool-group.d.ts +15 -2
  108. package/src/chat/read-tool-group.ts +201 -41
  109. package/src/chat/skill-message.d.ts +1 -0
  110. package/src/chat/skill-message.ts +4 -0
  111. package/src/chat/spotlight.d.ts +203 -0
  112. package/src/chat/spotlight.ts +460 -0
  113. package/src/chat/tool-execution.d.ts +26 -5
  114. package/src/chat/tool-execution.ts +360 -38
  115. package/src/chat/transcript-actions.d.ts +11 -0
  116. package/src/chat/transcript-actions.ts +13 -1
  117. package/src/chat/transcript-browser.d.ts +9 -0
  118. package/src/chat/transcript-browser.ts +18 -0
  119. package/src/chat/transcript-presentation.d.ts +164 -0
  120. package/src/chat/transcript-presentation.ts +642 -0
  121. package/src/chat/ttsr-notification.d.ts +25 -0
  122. package/src/chat/ttsr-notification.ts +5 -0
  123. package/src/chrome/message-frame.d.ts +2 -0
  124. package/src/chrome/message-frame.ts +7 -0
  125. package/src/chrome/message-notice.d.ts +58 -0
  126. package/src/chrome/transcript-container.d.ts +27 -6
  127. package/src/chrome/transcript-container.ts +317 -66
  128. package/src/components/editor.ts +25 -1
  129. package/src/components/loader.d.ts +0 -2
  130. package/src/components/loader.ts +30 -18
  131. package/src/components/markdown.d.ts +11 -1
  132. package/src/components/markdown.ts +41 -16
  133. package/src/components/settings-list.d.ts +12 -2
  134. package/src/components/settings-list.ts +29 -13
  135. package/src/frame-rate.d.ts +18 -0
  136. package/src/frame-rate.ts +36 -0
  137. package/src/hotkeys-markdown.ts +9 -2
  138. package/src/index.d.ts +3 -0
  139. package/src/index.ts +3 -0
  140. package/src/keybinding-matchers.d.ts +4 -1
  141. package/src/keybinding-matchers.ts +13 -12
  142. package/src/kitty-graphics.d.ts +1 -1
  143. package/src/kitty-graphics.ts +3 -2
  144. package/src/motion-effects.d.ts +10 -0
  145. package/src/motion-effects.ts +27 -0
  146. package/src/native/backend.ts +66 -7
  147. package/src/native/encode.d.ts +2 -0
  148. package/src/native/encode.ts +2 -0
  149. package/src/native/measure.d.ts +10 -0
  150. package/src/native/measure.ts +185 -0
  151. package/src/native/overlay.d.ts +1 -1
  152. package/src/native/overlay.ts +1 -1
  153. package/src/native/quiet.d.ts +5 -0
  154. package/src/native/quiet.ts +105 -0
  155. package/src/native/reconcile.d.ts +6 -1
  156. package/src/native/reconcile.ts +16 -10
  157. package/src/native/spans.d.ts +6 -0
  158. package/src/native/spans.ts +40 -0
  159. package/src/native/state.d.ts +4 -0
  160. package/src/native/state.ts +18 -0
  161. package/src/overlays/agent-hub.ts +15 -2
  162. package/src/overlays/ask-dialog.ts +1 -0
  163. package/src/overlays/btw-history-panel.ts +73 -6
  164. package/src/overlays/link-browser.ts +295 -0
  165. package/src/overlays/running-subagent-badge.ts +2 -9
  166. package/src/overlays/settings-defs.ts +1 -1
  167. package/src/overlays/settings-selector.ts +17 -3
  168. package/src/overlays/spotlight-sheet.ts +478 -0
  169. package/src/overlays/usage-dashboard.ts +6 -5
  170. package/src/prompt/composer-attachments.d.ts +5 -2
  171. package/src/prompt/composer-attachments.ts +6 -6
  172. package/src/prompt/composer-cache.ts +17 -16
  173. package/src/prompt/composer.ts +30 -123
  174. package/src/prompt/custom-editor.ts +17 -13
  175. package/src/prompt/gradient-highlight.d.ts +2 -2
  176. package/src/prompt/gradient-highlight.ts +5 -4
  177. package/src/prompt/magic-keywords.d.ts +2 -0
  178. package/src/prompt/magic-keywords.ts +4 -1
  179. package/src/prompt/model-mention-autocomplete.ts +73 -20
  180. package/src/prompt/model-mention-syntax.d.ts +6 -0
  181. package/src/prompt/model-mention-syntax.ts +9 -0
  182. package/src/prompt/prompt-action-autocomplete.ts +49 -33
  183. package/src/prompt/tips.txt +1 -0
  184. package/src/prompt/welcome.ts +104 -2
  185. package/src/render/extension-links.d.ts +0 -6
  186. package/src/render/extension-links.ts +0 -20
  187. package/src/render/index.d.ts +1 -0
  188. package/src/render/index.ts +1 -0
  189. package/src/render/link-hints.d.ts +78 -0
  190. package/src/render/link-hints.ts +299 -0
  191. package/src/render/render-utils.d.ts +0 -2
  192. package/src/render/render-utils.ts +0 -5
  193. package/src/setup/scenes/glyph.ts +1 -1
  194. package/src/setup/scenes/types.ts +8 -0
  195. package/src/setup/scenes/updates.ts +116 -0
  196. package/src/setup/wizard.ts +19 -8
  197. package/src/spinner-clock.d.ts +34 -0
  198. package/src/spinner-clock.ts +79 -0
  199. package/src/status-line/component.ts +145 -53
  200. package/src/status-line/host.ts +51 -0
  201. package/src/status-line/index.ts +1 -0
  202. package/src/status-line/presets.ts +3 -1
  203. package/src/status-line/prompt-cache.ts +154 -0
  204. package/src/status-line/schema.ts +1 -1
  205. package/src/status-line/segments.ts +33 -22
  206. package/src/status-line/startup.ts +22 -4
  207. package/src/status-line/types.ts +8 -22
  208. package/src/stdin-buffer.ts +89 -46
  209. package/src/terminal-capabilities.ts +3 -3
  210. package/src/terminal.ts +1 -8
  211. package/src/theme/loader.ts +3 -2
  212. package/src/theme/schema.d.ts +28 -1
  213. package/src/theme/schema.ts +30 -1
  214. package/src/theme/symbols.d.ts +1 -1
  215. package/src/theme/symbols.ts +15 -3
  216. package/src/theme/theme-class.d.ts +12 -2
  217. package/src/theme/theme-class.ts +23 -0
  218. package/src/theme/theme-schema.json +1 -1
  219. package/src/theme/theme.d.ts +1 -1
  220. package/src/theme/theme.ts +3 -7
  221. package/src/theme/tui-adapters.d.ts +7 -0
  222. package/src/theme/tui-adapters.ts +33 -1
  223. package/src/thinking.d.ts +12 -0
  224. package/src/thinking.ts +31 -0
  225. package/src/tools/ask.d.ts +1 -1
  226. package/src/tools/ask.ts +99 -38
  227. package/src/tools/ast-edit.ts +51 -32
  228. package/src/tools/ast-grep.ts +31 -19
  229. package/src/tools/bash.d.ts +21 -0
  230. package/src/tools/bash.ts +166 -24
  231. package/src/tools/find.d.ts +9 -1
  232. package/src/tools/find.ts +23 -2
  233. package/src/tools/grep.d.ts +2 -1
  234. package/src/tools/grep.ts +52 -36
  235. package/src/tools/grouped-file-output.d.ts +17 -0
  236. package/src/tools/grouped-file-output.ts +20 -2
  237. package/src/tools/job-widget.d.ts +2 -2
  238. package/src/tools/job-widget.ts +2 -2
  239. package/src/tools/lsp.d.ts +4 -2
  240. package/src/tools/lsp.ts +537 -642
  241. package/src/tools/native-view.d.ts +4 -0
  242. package/src/tools/native-view.ts +8 -2
  243. package/src/tools/renderer.d.ts +9 -1
  244. package/src/tools/renderer.ts +9 -1
  245. package/src/tools/shell-trace.d.ts +10 -0
  246. package/src/tools/shell-trace.ts +80 -0
  247. package/src/tools/shell-viz-render.d.ts +6 -0
  248. package/src/tools/shell-viz-render.ts +156 -0
  249. package/src/tools/shell-viz.d.ts +16 -0
  250. package/src/tools/shell-viz.ts +181 -0
  251. package/src/tools/streaming-output.ts +18 -8
  252. package/src/tools/wait.d.ts +2 -2
  253. package/src/tools/wait.ts +39 -34
  254. package/src/tools/web-search-types.d.ts +1 -0
  255. package/src/tools/web-search-types.ts +1 -0
  256. package/src/tools/write.d.ts +2 -0
  257. package/src/tools/write.ts +2 -0
  258. package/src/tui.d.ts +15 -1
  259. package/src/tui.ts +63 -6
  260. package/src/windows-input-mode.ts +7 -1
  261. package/dist/types/chat/collab-prompt-message.d.ts +0 -14
  262. package/dist/types/chrome/collab-qrcode.d.ts +0 -35
  263. package/src/chat/collab-prompt-message.d.ts +0 -14
  264. package/src/chat/collab-prompt-message.ts +0 -46
  265. package/src/chrome/collab-qrcode.ts +0 -99
@@ -0,0 +1,78 @@
1
+ /** An extension link label drawn on a shown row: what a click or hint tag lands on. */
2
+ export interface ViewportLink {
3
+ readonly url: string;
4
+ /** Shown row the label is drawn on (its first row, for a label wrapped across rows). */
5
+ readonly row: number;
6
+ /** First cell of the label's part on that row. */
7
+ readonly start: number;
8
+ }
9
+ /** A label {@link viewportLinkTargets} found: where it is drawn, its marker id and its text. */
10
+ export interface ViewportLinkTarget extends ViewportLink {
11
+ /** The label's marker id ({@link ExtensionLinkLabel.id}). */
12
+ readonly id: string;
13
+ /** The label's text, across every shown row it wraps to; its tag prefers these letters. */
14
+ readonly text: string;
15
+ /** Where each shown row's part of the label starts, top to bottom; the first is `row`/`start`. */
16
+ readonly parts: readonly {
17
+ readonly row: number;
18
+ readonly start: number;
19
+ }[];
20
+ }
21
+ /**
22
+ * The extension link labels drawn on `rows`, top to bottom, a wrapped label once at its first row:
23
+ * a row's first label continues the previous row's last label when that has the same marker id
24
+ * and ends its row.
25
+ */
26
+ export declare function viewportLinkTargets(rows: readonly string[]): ViewportLinkTarget[];
27
+ /**
28
+ * The tags of one hint session and the letters typed so far. A tag is drawn over the first cell of
29
+ * its label, so it prefers the letters it covers: the label's first letter, then its others, then
30
+ * the home row. Tags never prefix one another.
31
+ */
32
+ export declare class LinkHints {
33
+ #private;
34
+ /** Whether labels have been tagged since construction. */
35
+ get tagged(): boolean;
36
+ /** Tag every label `rows` draw afresh and forget the letters typed; returns how many were tagged. */
37
+ assign(rows: readonly string[]): number;
38
+ /**
39
+ * Keep the tags while `rows` still draw the tagged labels first, in the same order and columns
40
+ * (they may sit on other rows, and links may be added after them), following them to the rows
41
+ * they are on now. Returns false, keeping nothing to pick, when they no longer are.
42
+ */
43
+ follow(rows: readonly string[]): boolean;
44
+ /**
45
+ * Tag what `rows` draw now, keeping each label's tag while it stays in view: tags of labels no
46
+ * longer drawn are dropped and only newly drawn labels get one, top to bottom. A label is the
47
+ * same across repaints when one of its row parts is: that part's row (shown row plus `origin`,
48
+ * so a scrolling surface passes the row its first shown row has in the whole content), first
49
+ * cell, marker id and URL; marker ids alone repeat across replies. Matching any part keeps a
50
+ * wrapped label's tag while only some of its rows stay in view.
51
+ *
52
+ * The one time existing tags change: a new label finds no tag that keeps the set prefix-free
53
+ * (every letter is already a single-letter tag, say a 27th label joins 26). Then every label is
54
+ * tagged afresh with two letters, and the letters typed are forgotten.
55
+ */
56
+ update(rows: readonly string[], origin?: number): void;
57
+ /**
58
+ * The content moved under the tags, as when a reply above some labels is redrawn taller or
59
+ * shorter: `move` maps the row a label was last drawn on in the whole content to the row it is
60
+ * on now, so the next {@link update} finds it there with its tag.
61
+ */
62
+ moveRows(move: (row: number) => number): void;
63
+ /** Whether some row holds more tag cells than `width`, so its tags could not all be read side by side. */
64
+ crowded(width: number): boolean;
65
+ /**
66
+ * Type one letter of a tag. Returns the link whose whole tag is now typed, `true` while the
67
+ * letters still lead to several tags, and `false` when none starts with them. A pick or a miss
68
+ * forgets the letters typed.
69
+ */
70
+ type(letter: string): ViewportLink | boolean;
71
+ /**
72
+ * Draw every tag the typed letters still lead to over the start of its label, within the first
73
+ * `width` cells of each row (cells past it, such as a scrollbar, are kept). Tags on one row never
74
+ * overlap: one that would land on an earlier tag moves right, and tags that would run past
75
+ * `width` move left, so each stays readable as long as the row has room for them all.
76
+ */
77
+ paint(rows: readonly string[], width: number): string[];
78
+ }
@@ -167,8 +167,6 @@ export declare function capPreviewLines(lines: string[], theme: Theme, options?:
167
167
  prefix?: string;
168
168
  expandHint?: boolean;
169
169
  }): string[];
170
- /** Join metadata with the theme separator and muted styling. */
171
- export declare function formatMeta(meta: string[], theme: Theme): string;
172
170
  /**
173
171
  * Split multi-line tool text into TUI-safe display lines.
174
172
  * Splits CRLF/LF, collapses stray `\r` progress overwrites to the final
@@ -30,6 +30,8 @@ export interface SetupHost extends SetupUiHost {
30
30
  readonly disabledProviders: readonly string[];
31
31
  /** Effective UI/settings language; the onboarding language scene starts here. */
32
32
  readonly language: SetupLanguage;
33
+ /** Whether background self-update (`update.auto`) is on. */
34
+ readonly autoUpdate: boolean;
33
35
  readonly authStorage: AuthStorage;
34
36
  readonly modelSource: ModelBrowserSource;
35
37
  /** Available and catalog models of every kind; role chips resolve over all of them, rows list chat models. */
@@ -46,6 +48,12 @@ export interface SetupHost extends SetupUiHost {
46
48
  saveLanguage(language: SetupLanguage): Promise<void> | void;
47
49
  saveColorBlindMode(enabled: boolean): void;
48
50
  saveTheme(mode: "dark" | "light", name: string): void;
51
+ /**
52
+ * Whether this omp can install its own updates; false where something else
53
+ * owns them: Tern (which updates its omp itself), Nix, a source checkout.
54
+ */
55
+ canAutoUpdate(): Promise<boolean>;
56
+ saveAutoUpdate(enabled: boolean): Promise<void>;
49
57
  captureBrowserSession(request: OAuthBrowserSessionRequest, signal?: AbortSignal): Promise<string>;
50
58
  openInBrowser(url: string): void;
51
59
  markComplete(version: number): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { SetupScene } from "./types.js";
2
+ /**
3
+ * Opt in to background self-update (`update.auto`). Skipped where omp cannot
4
+ * update itself, notably under Tern, which keeps its omp current on its own.
5
+ */
6
+ export declare const updatesSetupScene: SetupScene;
@@ -5,7 +5,7 @@ export type { SetupScene, SetupSceneController, SetupSceneHost, SetupSceneResult
5
5
  export { runStartupSplash } from "./startup-splash.js";
6
6
  export { CURRENT_SETUP_VERSION };
7
7
  /** Ordered onboarding scenes with independent version gates. */
8
- export declare const ALL_SCENES: readonly [SetupScene, SetupScene, SetupScene, SetupScene, SetupScene, SetupScene];
8
+ export declare const ALL_SCENES: readonly [SetupScene, SetupScene, SetupScene, SetupScene, SetupScene, SetupScene, SetupScene];
9
9
  /** Environment and invocation gates for onboarding scene selection. */
10
10
  export interface SetupSceneSelectionOptions {
11
11
  resuming?: boolean;
@@ -14,7 +14,12 @@ export interface SetupSceneSelectionOptions {
14
14
  setupWizardEnabled?: boolean;
15
15
  force?: boolean;
16
16
  }
17
- /** Select scenes newer than the stored version, honoring hard environment gates. */
17
+ /**
18
+ * Whether this launch may show onboarding at all: a TTY and, unless forced,
19
+ * not resuming, not skipped by `OMP_SKIP_SETUP` or `startup.setupWizard`.
20
+ */
21
+ export declare function setupWizardAllowed(options?: SetupSceneSelectionOptions): boolean;
22
+ /** Select scenes newer than the stored version, honoring hard environment gates ({@link setupWizardAllowed}). */
18
23
  export declare function selectSetupScenes(storedVersion: number, scenes: readonly SetupScene[], ctx?: SetupHost, options?: SetupSceneSelectionOptions): Promise<SetupScene[]>;
19
24
  /** Control completion persistence and the post-setup welcome animation. */
20
25
  export interface RunSetupWizardOptions {
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The shared spinner clock (`tui.spinnerInterval`): one period and one phase for every spinner the
3
+ * TUI draws and for the host's terminal-title spinner. Dependency-free: the host's flag table
4
+ * imports it during CLI bootstrap.
5
+ */
6
+ /** Default spinner period, in milliseconds (the historical cadence). */
7
+ export declare const DEFAULT_SPINNER_INTERVAL_MS = 80;
8
+ /** Interval value for a static spinner: frame 0 is drawn and no spinner timer runs. */
9
+ export declare const SPINNER_INTERVAL_STATIC = 0;
10
+ /** The live spinner period in milliseconds; {@link SPINNER_INTERVAL_STATIC} when spinners are still. */
11
+ export declare function spinnerInterval(): number;
12
+ /** Whether spinners advance at all. */
13
+ export declare function spinnerAnimated(): boolean;
14
+ /** Set the period for every spinner; callers pass a value {@link parseSpinnerInterval} accepted. */
15
+ export declare function setSpinnerInterval(next: number): void;
16
+ /** Observe period changes, for timers that would otherwise stay parked; returns the unsubscribe. */
17
+ export declare function onSpinnerIntervalChange(listener: () => void): () => void;
18
+ /**
19
+ * Glyph index on the shared clock, or frame 0 when spinners are static. Every spinner reads
20
+ * wall-clock time, so they share a phase as well as a period.
21
+ */
22
+ export declare function sharedSpinnerFrame(frameCount: number, now?: number): number;
23
+ /**
24
+ * Milliseconds until the next multiple of `periodMs` on the wall clock. Timers armed from this fire
25
+ * together whoever owns them, so N spinners cost one frame per period instead of N.
26
+ */
27
+ export declare function spinnerTickDelay(periodMs: number, now?: number): number;
28
+ /**
29
+ * Canonicalize a configured spinner interval: 0 (static) or an integer ≥ 50. Numeric strings are
30
+ * accepted so one parser serves the CLI flag, the environment variable, and the setting.
31
+ *
32
+ * @throws Error on a non-numeric, negative, fractional, or too-small value.
33
+ */
34
+ export declare function parseSpinnerInterval(value: unknown): number;
@@ -4,9 +4,9 @@ import type { Editor } from "../components/editor.js";
4
4
  import { type CodexResetFireworksEvent } from "../overlays/codex-reset-fireworks.js";
5
5
  import { type SegmentContext } from "./segments.js";
6
6
  import type { NativeNode, NativeUiEvent } from "../native/node.js";
7
- import type { CollabStatus, ComposerFacts, ComposerFactsSource, EffectiveStatusLineSettings, StatusLineSettings } from "./types.js";
8
- /** What a click on a native status segment asks zeta to open. */
9
- export type StatusLineNativeAction = "status.model" | "status.context" | "status.git" | "status.cost" | "status.path";
7
+ import type { ComposerFacts, ComposerFactsSource, EffectiveStatusLineSettings, StatusLineSettings } from "./types.js";
8
+ /** What a click on a native status segment asks omp to open. */
9
+ export type StatusLineNativeAction = "status.model" | "status.context" | "status.git" | "status.cost" | "status.path" | "status.cache";
10
10
  /** Pull request the native tab title carries. */
11
11
  export interface StatusLinePullRequest {
12
12
  readonly number: number;
@@ -106,12 +106,16 @@ export declare class StatusLineComponent<TSession extends StatusLineSession = St
106
106
  * `undefined` to clear.
107
107
  */
108
108
  setVibeWorkerTokenRateProvider(provider: (() => number | null) | undefined): void;
109
- setCollabStatus(status: CollabStatus | null): void;
110
109
  setStreamStatus(status: {
111
110
  viewers: number;
112
111
  } | null): void;
113
112
  /** Toggle the `● REC` badge shown while `/record` captures the screen. */
114
113
  setRecording(recording: boolean): void;
114
+ /** Mark one session pinned or unpinned; `session_name` shows the pin for the viewed session. */
115
+ setSessionPinned(sessionId: string, pinned: boolean): void;
116
+ /** Replace the whole pinned-session set (a fresh read of the pins file). */
117
+ setPinnedSessionIds(sessionIds: ReadonlySet<string>): void;
118
+ isSessionPinned(sessionId: string | undefined): boolean;
115
119
  /** Set the callback that presents detected Codex reset celebrations, or clear it with `undefined`. */
116
120
  setCodexResetFireworksHandler(handler: ((event: CodexResetFireworksEvent) => void) | undefined): void;
117
121
  /** Set the callback that presents pool-wide saved-reset expiry warnings, or clear it with `undefined`. */
@@ -17,6 +17,63 @@ export interface ActiveRepoContext {
17
17
  relativeRepoRoot: string;
18
18
  source: "single-direct-child-repo";
19
19
  }
20
+ /** Why the next request rewrites the cached prompt prefix instead of reading it. */
21
+ export type PromptCacheColdReason = {
22
+ kind: "expired";
23
+ at: number;
24
+ }
25
+ /** omp's warm refresh found the entry gone. */
26
+ | {
27
+ kind: "refresh-missed";
28
+ } | {
29
+ kind: "model";
30
+ from: string;
31
+ to: string;
32
+ } | {
33
+ kind: "thinking";
34
+ from: string;
35
+ to: string;
36
+ } | {
37
+ kind: "tools";
38
+ } | {
39
+ kind: "system-prompt";
40
+ } | {
41
+ kind: "retention";
42
+ } | {
43
+ kind: "compaction";
44
+ };
45
+ /** omp's cache warmer as it concerns the entry. */
46
+ export interface PromptCacheWarming {
47
+ /** `scheduled`: a refresh decision is armed; `refreshing`: a refresh was sent and is in flight. */
48
+ state: "scheduled" | "refreshing" | "inactive";
49
+ /** When the armed refresh decides. */
50
+ nextWarmAt?: number;
51
+ /** When warming gives up: its 60-minute streaming or 30-minute idle safety window. */
52
+ stopsAt?: number;
53
+ /** Why nothing is scheduled. */
54
+ reason?: string;
55
+ }
56
+ /** What the next request finds in the prompt cache: the `cache` segment's marker and its details. */
57
+ export interface PromptCacheStatus {
58
+ /** `cold`: the next request rewrites the cached prefix. */
59
+ state: "warm" | "cold";
60
+ /** Why it is cold; absent while warm. */
61
+ reason?: PromptCacheColdReason;
62
+ /** Read off the transcript of a reopened session, not a response this process saw: thinking level, tools and credential are unknown. */
63
+ inferred: boolean;
64
+ /** Retention tier the entry was written under: `short` (5m) or `long` (1h). */
65
+ tier: "short" | "long";
66
+ /** Send time of the last request that read or wrote the entry. */
67
+ touchedAt: number;
68
+ /** Lifetime after the last touch; undefined when the provider never expires the entry. */
69
+ ttlMs?: number;
70
+ /** Prompt tokens of the request that wrote or last read the entry: what a warm cache serves. */
71
+ cachedTokens: number;
72
+ /** Estimated prompt tokens of the next request. */
73
+ nextTokens: number;
74
+ /** Absent when the entry was inferred. */
75
+ warming?: PromptCacheWarming;
76
+ }
20
77
  export interface StatusLineSession {
21
78
  state: {
22
79
  model?: Model;
@@ -93,6 +150,11 @@ export interface StatusLineSession {
93
150
  };
94
151
  getAdvisorCost?(): number;
95
152
  isAdvisorUsingSubscription?(): boolean;
153
+ /**
154
+ * What the next request finds in the prompt cache at `nowMs`; undefined when there is nothing to reason about.
155
+ * `nextTokens` is the caller's current context token count, so the session need not recount it.
156
+ */
157
+ getPromptCacheStatus?(nowMs: number, nextTokens?: number): PromptCacheStatus | undefined;
96
158
  }
97
159
  export interface FooterSession {
98
160
  state: Pick<StatusLineSession["state"], "model" | "thinkingLevel">;
@@ -1,6 +1,7 @@
1
1
  export * from "./component.js";
2
2
  export * from "./metrics.js";
3
3
  export * from "./presets.js";
4
+ export * from "./prompt-cache.js";
4
5
  export * from "./segments.js";
5
6
  export * from "./separators.js";
6
7
  export * from "./types.js";
@@ -0,0 +1,14 @@
1
+ import type { PromptCacheStatus } from "./host.js";
2
+ /** One `label: value` line of the prompt-cache details. */
3
+ export interface PromptCacheDetailRow {
4
+ label: string;
5
+ value: string;
6
+ tone?: "warning";
7
+ }
8
+ /**
9
+ * The hover card's two lines: whether the next message reads the cache (until when, or why not), then what it
10
+ * sends. The terminal shows the card later without repainting it, so it names no time relative to now.
11
+ */
12
+ export declare function promptCacheBrief(status: PromptCacheStatus, nowMs: number): readonly [string, string];
13
+ /** The `/session` rows, in display order; times say how long ago or ahead of `nowMs` they are. */
14
+ export declare function promptCacheDetails(status: PromptCacheStatus, nowMs: number): PromptCacheDetailRow[];
@@ -1,5 +1,5 @@
1
1
  /** Status line segment identifiers accepted by custom status-line settings. */
2
- export declare const STATUS_LINE_SEGMENT_IDS: readonly ["pi", "status", "model", "mode", "path", "git", "pr", "subagents", "token_in", "token_out", "token_total", "token_rate", "cost", "context_pct", "context_total", "time_spent", "time", "session", "hostname", "cache_read", "cache_write", "cache_hit", "session_name", "usage", "turn_stats", "collab", "stream", "vim"];
2
+ export declare const STATUS_LINE_SEGMENT_IDS: readonly ["pi", "status", "model", "mode", "path", "git", "pr", "subagents", "token_in", "token_out", "token_total", "token_rate", "cost", "context_pct", "context_total", "time_spent", "time", "session", "hostname", "cache_read", "cache_write", "cache_hit", "cache", "session_name", "usage", "turn_stats", "stream", "vim"];
3
3
  /** One identifier from the supported status-line segment catalog. */
4
4
  export type StatusLineSegmentId = (typeof STATUS_LINE_SEGMENT_IDS)[number];
5
5
  /** Baseline segments used when Custom is selected without segment overrides. */
@@ -1,5 +1,6 @@
1
1
  import type { ThinkingLevel } from "@linxiraos/pi-agent-core";
2
2
  import type { Model } from "@linxiraos/pi-catalog/types";
3
+ import type { ComposerNativeState } from "../prompt/custom-editor.js";
3
4
  import { StatusLineComponent } from "./component.js";
4
5
  import type { CompactionBoundaries } from "./context-usage.js";
5
6
  import type { StatusLineSettings } from "./types.js";
@@ -17,6 +18,11 @@ export interface StatusLineStartupData {
17
18
  readonly autoCompactEnabled: boolean;
18
19
  readonly compactionBoundaries: CompactionBoundaries | null;
19
20
  }
21
+ /**
22
+ * TSP composer state for the first frame: the cached thinking level on the
23
+ * effort chip (or as the model chip's icon), until InteractiveMode wires the live one.
24
+ */
25
+ export declare function startupComposerState(data: StatusLineStartupData): ComposerNativeState;
20
26
  /** Build the prepaint status line; the caller disposes it once the session-bound bar mounts. */
21
27
  export declare function createStartupStatusLine(data: StatusLineStartupData): StatusLineComponent;
22
28
  /** Validate persisted {@link StatusLineStartupData}; `undefined` for anything malformed. */
@@ -1,8 +1,7 @@
1
- import type { Model } from "@linxiraos/pi-ai";
2
- import type { SessionState, TspSpan, TspTone } from "@linxiraos/pi-wire";
1
+ import type { TspSpan, TspTone } from "@linxiraos/pi-wire";
3
2
  import type { NativeNode, NativeUiEvent } from "../native/node.js";
4
3
  import type { ContextLineMode, StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "./schema.js";
5
- import type { ActiveRepoContext, StatusLineSession } from "./host.js";
4
+ import type { ActiveRepoContext, PromptCacheStatus, StatusLineSession } from "./host.js";
6
5
  import type { LoopConditionConfig, LoopLimitRuntime } from "./loop.js";
7
6
  export type { ContextLineMode, StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle };
8
7
  /** Context-window occupancy shown by the status line and exposed to extensions. */
@@ -13,23 +12,6 @@ export interface ContextUsage {
13
12
  /** Context usage as percentage of context window. */
14
13
  percent: number;
15
14
  }
16
- /** Debounced footer snapshot a collab host broadcasts to guests. */
17
- export type CollabSessionState = SessionState & {
18
- /**
19
- * Host model (full catalog object). Guests apply it to their replica
20
- * agent state so model display and context-window math are native.
21
- */
22
- model?: Model;
23
- /** Host status-line context numbers (guest system prompt/tools differ, so local estimates drift). */
24
- contextUsage?: ContextUsage;
25
- };
26
- /** Collab session indicator + (guest-only) host-state override for segments. */
27
- export interface CollabStatus {
28
- role: "host" | "guest";
29
- participantCount: number;
30
- /** Guest only: host footer snapshot that overrides locally computed values. */
31
- stateOverride?: CollabSessionState | null;
32
- }
33
15
  export interface StatusLineSegmentOptions {
34
16
  pi?: {
35
17
  showProfile?: boolean;
@@ -86,6 +68,8 @@ export interface SegmentContext {
86
68
  sessionAccent?: boolean;
87
69
  /** Stand-in session title for previews; `session_name` renders it when the session is unnamed. */
88
70
  previewTitle?: string;
71
+ /** The viewed session is pinned; `session_name` prefixes the pin icon. */
72
+ isPinned?: boolean;
89
73
  activeRepo: ActiveRepoContext | null;
90
74
  width: number;
91
75
  options: StatusLineSegmentOptions;
@@ -125,7 +109,6 @@ export interface SegmentContext {
125
109
  /** `tui.vimModeDisplay`: how the mode renders in the status line. */
126
110
  display: "text" | "icon" | "none";
127
111
  } | null;
128
- collab: CollabStatus | null;
129
112
  stream: {
130
113
  viewers: number;
131
114
  } | null;
@@ -231,6 +214,8 @@ export interface SegmentContext {
231
214
  expiring?: StatusResetExpiry;
232
215
  };
233
216
  } | null;
217
+ /** What the next request finds in the prompt cache; read only when the `cache` segment is configured. */
218
+ promptCache?: PromptCacheStatus;
234
219
  }
235
220
  /** How close an account's saved resets are to expiring, when it is worth a warning. */
236
221
  export interface StatusResetExpiry {
@@ -274,6 +259,8 @@ export interface ComposerFacts {
274
259
  /**
275
260
  * `status` (role `zeta.composer.extras`, `grow: 1`) of the other configured
276
261
  * segments as `seg`s; the bar's flexible space, so present even when empty.
262
+ * The prompt cache's (role `zeta.composer.cache`) sits on its right side, beside
263
+ * the usage, with a hover card and a click opening `/session`.
277
264
  */
278
265
  readonly extras: NativeNode;
279
266
  /** `text` (role `zeta.composer.usage`): the session cost (empty when there is none). */
@@ -1,5 +1,28 @@
1
1
  import type { SpinnerFramesOverride } from "./symbols.js";
2
2
  export type ColorValue = string | number;
3
+ /**
4
+ * Index of each slot in a theme's 16-color `terminal.ansi` palette (0–7
5
+ * normal, 8–15 bright). `Theme.ansiFg()` paints by slot name.
6
+ */
7
+ export declare const ANSI_COLOR_INDEX: {
8
+ readonly black: 0;
9
+ readonly red: 1;
10
+ readonly green: 2;
11
+ readonly yellow: 3;
12
+ readonly blue: 4;
13
+ readonly magenta: 5;
14
+ readonly cyan: 6;
15
+ readonly white: 7;
16
+ readonly brightBlack: 8;
17
+ readonly brightRed: 9;
18
+ readonly brightGreen: 10;
19
+ readonly brightYellow: 11;
20
+ readonly brightBlue: 12;
21
+ readonly brightMagenta: 13;
22
+ readonly brightCyan: 14;
23
+ readonly brightWhite: 15;
24
+ };
25
+ export type AnsiColor = keyof typeof ANSI_COLOR_INDEX;
3
26
  /**
4
27
  * Tokens a theme is allowed to omit. They resolve to the terminal default
5
28
  * foreground, so `Theme.fg()` stays total for callers that paint a token a theme
@@ -36,7 +59,11 @@ export interface ThemeJson {
36
59
  chrome?: ColorValue;
37
60
  /** Lifted surfaces: popovers, menus, buttons. */
38
61
  widget?: ColorValue;
39
- /** ANSI colors 0–15: exactly 16. */
62
+ /**
63
+ * ANSI colors 0–15: exactly 16. omp also paints colorful Markdown
64
+ * (headings, emphasis, table headers) from this palette; slots it
65
+ * omits fall back to the terminal's own palette.
66
+ */
40
67
  ansi?: ColorValue[];
41
68
  };
42
69
  symbols?: {
@@ -4,7 +4,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
4
4
  */
5
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
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";
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.cacheWarm" | "icon.cacheCold" | "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";
8
8
  export type SymbolMap = Record<SymbolKey, string>;
9
9
  /**
10
10
  * Icon vocabulary for slash-command autocomplete type indicators. Each name
@@ -1,4 +1,4 @@
1
- import { type ColorMode, type ThemeBg, type ThemeColor } from "./schema.js";
1
+ import { type AnsiColor, type ColorMode, type ThemeBg, type ThemeColor } from "./schema.js";
2
2
  import type { SessionAccentTheme } from "./session-color.js";
3
3
  import { type SlashCommandIconName, type SpinnerType, type SymbolKey, type SymbolPreset } from "./symbols.js";
4
4
  /** Theme token of a thinking/effort level name (`off`…`max`); unknown levels (`auto`) map to `thinkingOff`. */
@@ -15,7 +15,7 @@ export declare class Theme {
15
15
  * otherwise-light theme.
16
16
  */
17
17
  readonly statusLineLuminance: number | undefined;
18
- constructor(fgColors: Record<ThemeColor, string | number>, bgColors: Record<ThemeBg, string | number>, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial<Record<SymbolKey, string>>, spinnerFramesOverrides?: Partial<Record<SpinnerType, string[]>>);
18
+ constructor(fgColors: Record<ThemeColor, string | number>, bgColors: Record<ThemeBg, string | number>, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial<Record<SymbolKey, string>>, spinnerFramesOverrides?: Partial<Record<SpinnerType, string[]>>, ansiPalette?: ReadonlyArray<string | number>);
19
19
  /** True when the active theme has a light status-line background. */
20
20
  get isLight(): boolean;
21
21
  /**
@@ -62,6 +62,12 @@ export declare class Theme {
62
62
  */
63
63
  hasColor(color: ThemeColor): boolean;
64
64
  fg(color: ThemeColor, text: string): string;
65
+ /**
66
+ * Color `text` with slot `color` of the theme's `terminal.ansi` palette, or
67
+ * the terminal's own palette when the theme ships none. Like {@link fg}, the
68
+ * color resumes after nested foreground resets.
69
+ */
70
+ ansiFg(color: AnsiColor, text: string): string;
65
71
  /** Apply a foreground, replacing terminal-default tokens with the theme's contrast-safe fallback. */
66
72
  fgResolved(color: ThemeColor, text: string): string;
67
73
  bg(color: ThemeBg, text: string): string;
@@ -79,6 +85,8 @@ export declare class Theme {
79
85
  */
80
86
  fgOnBg(color: ThemeColor, background: ThemeBg, text: string): string;
81
87
  bold(text: string): string;
88
+ /** Reduce terminal intensity without replacing the text's foreground colors. */
89
+ faint(text: string): string;
82
90
  italic(text: string): string;
83
91
  underline(text: string): string;
84
92
  strikethrough(text: string): string;
@@ -228,6 +236,8 @@ export declare class Theme {
228
236
  job: string;
229
237
  cache: string;
230
238
  cacheMiss: string;
239
+ cacheWarm: string;
240
+ cacheCold: string;
231
241
  input: string;
232
242
  output: string;
233
243
  throughput: string;
@@ -6,7 +6,7 @@ export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, type T
6
6
  export { isValidThemeColor, type ThemeBg, type ThemeColor } from "./schema.js";
7
7
  export { getAvailableSymbolPresets, isValidSymbolPreset, type SpinnerType, type SymbolKey, type SymbolPreset, } from "./symbols.js";
8
8
  export { Theme } from "./theme-class.js";
9
- export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, isHighlightLanguage, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters.js";
9
+ export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, isHighlightLanguage, setMarkdownColorful, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters.js";
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.
@@ -22,6 +22,13 @@ export declare function getSymbolTheme(): SymbolTheme;
22
22
  export declare function canCacheMarkdownListItems(candidate: MarkdownTheme): boolean;
23
23
  export declare function getMarkdownThemeWithLinkTargets(targets: ReadonlyMap<string, string>): MarkdownTheme;
24
24
  export declare function setMarkdownMermaidRendering(enabled: boolean): void;
25
+ /**
26
+ * Toggle colorful Markdown (`tui.colorfulMarkdown`): headings, emphasis, inline
27
+ * code and table headers take distinct hues from the theme's `terminal.ansi`
28
+ * palette instead of one heading color and plain bold/italic. Components built
29
+ * afterwards pick it up; callers rebuild existing transcript rows.
30
+ */
31
+ export declare function setMarkdownColorful(enabled: boolean): void;
25
32
  export declare function getMarkdownTheme(): MarkdownTheme;
26
33
  export declare function getSelectListTheme(): SelectListTheme;
27
34
  /**
@@ -53,6 +53,18 @@ export declare const AUTO_THINKING: "auto";
53
53
  export type { ConfiguredThinkingLevel } from "./render/render-utils.js";
54
54
  /** Maps the session-level `auto` sentinel to `undefined`; concrete levels pass through. */
55
55
  export declare function concreteThinkingLevel(level: ConfiguredThinkingLevel | undefined): ThinkingLevel | undefined;
56
+ /**
57
+ * Selector a new session on `model` starts with when neither the launch nor a
58
+ * restored session pins one: the default role's explicit selector, then the
59
+ * model's own default level (unless the configured default is `auto`), then the
60
+ * configured default. Shared by session startup and the next launch's prepaint.
61
+ */
62
+ export declare function newSessionThinkingLevel(model: Model | undefined, roleLevel: ConfiguredThinkingLevel | undefined, configuredDefault: ConfiguredThinkingLevel | undefined): ConfiguredThinkingLevel | undefined;
63
+ /**
64
+ * Concrete level `selector` runs at on `model`: clamped to its ladder, or the
65
+ * provisional effort while `auto` awaits its first per-turn classification.
66
+ */
67
+ export declare function resolveConfiguredThinkingLevel(model: Model | undefined, selector: ConfiguredThinkingLevel | undefined): ResolvedThinkingLevel | undefined;
56
68
  /**
57
69
  * True when a prewalk hand-off from `current`/`currentLevel` to
58
70
  * `target`/`targetLevel` would change nothing observable: same model id, same
@@ -69,6 +69,6 @@ export declare const askToolRenderer: {
69
69
  text?: string;
70
70
  }>;
71
71
  details?: AskToolDetails;
72
- }, _options: RenderResultOptions, uiTheme: Theme): Component;
72
+ }, _options: RenderResultOptions, uiTheme: Theme, args?: AskRenderArgs): Component;
73
73
  };
74
74
  export {};
@@ -2,6 +2,8 @@ import type { Component } from "../tui.js";
2
2
  import { type Theme } from "../theme/theme.js";
3
3
  import { type OutputMeta } from "./output-meta.js";
4
4
  import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
5
+ import { type ShellTrace } from "@linxiraos/pi-wire";
6
+ import type { SpotlightDetails } from "../chat/spotlight.js";
5
7
  /** Default collapsed shell output preview height. */
6
8
  export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
7
9
  /**
@@ -26,6 +28,21 @@ export interface BashToolDetails {
26
28
  timedOut?: boolean;
27
29
  /** Text the command wrote to `out://`, oldest first; transcripts draw each as a reply after the call. */
28
30
  replies?: string[];
31
+ /**
32
+ * The embedded shell's live trace of the command (pi-shell `RunTrace`): every frame carries the
33
+ * latest snapshot and the final result the last one. Absent on the PTY and user-shell paths.
34
+ */
35
+ trace?: ShellTrace;
36
+ /**
37
+ * Working directory the command ran in when the call set one, explicitly or by the
38
+ * executor hoisting a leading `cd <dir>`; absent when it ran in the session cwd.
39
+ * Pairs with {@link trace}: the traced script is the command after hoisting.
40
+ */
41
+ cwd?: string;
42
+ /** `;` when the hoisted leading cd was `cd <dir>;`, so the card redraws it as written; absent means `&&`. */
43
+ cdSeparator?: ";";
44
+ /** What the session's Spotlight shaping did to the output. */
45
+ spotlight?: SpotlightDetails;
29
46
  /** Live ACP update only; completed results refer to released terminals. */
30
47
  terminalId?: string;
31
48
  service?: {
@@ -54,6 +71,8 @@ export interface BashRenderArgs {
54
71
  env?: Record<string, unknown>;
55
72
  timeout?: number;
56
73
  cwd?: string;
74
+ /** How the `cd <dir>` prefix joins the command: `;` as written by the model, else `&&`. */
75
+ cdSeparator?: ";";
57
76
  __partialJson?: string;
58
77
  [key: string]: unknown;
59
78
  }
@@ -88,6 +107,8 @@ export declare function getBashEnvForDisplay(args: BashRenderArgs): Record<strin
88
107
  * `theme.fg("dim", ...)` form render only the first line as dim.
89
108
  */
90
109
  export declare function formatBashCommandLines(args: BashRenderArgs, uiTheme: Theme): string[];
110
+ /** The dim `$ cd <dir> && NAME="…" ` prefix ahead of a command's first line (trailing space included). */
111
+ export declare function bashCommandPrefix(args: BashRenderArgs, uiTheme: Theme): string;
91
112
  /**
92
113
  * Plain (unstyled) command line for native views: `cd <dir> && NAME="…" <command>`,
93
114
  * built from the same decoded display args (incl. streamed `__partialJson` env) as the ANSI path.