@linxiraos/pi-tui 1.4.10 → 1.4.12

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 (269) hide show
  1. package/CHANGELOG.md +34 -237
  2. package/README.md +4 -1
  3. package/THIRD-PARTY-NOTICES.txt +99 -0
  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/index.d.ts +3 -0
  27. package/dist/types/keybinding-matchers.d.ts +4 -1
  28. package/dist/types/kitty-graphics.d.ts +1 -1
  29. package/dist/types/motion-effects.d.ts +10 -0
  30. package/dist/types/native/encode.d.ts +2 -0
  31. package/dist/types/native/measure.d.ts +10 -0
  32. package/dist/types/native/overlay.d.ts +1 -1
  33. package/dist/types/native/quiet.d.ts +5 -0
  34. package/dist/types/native/reconcile.d.ts +6 -1
  35. package/dist/types/native/spans.d.ts +6 -0
  36. package/dist/types/native/state.d.ts +4 -0
  37. package/dist/types/overlays/agent-hub.d.ts +6 -0
  38. package/dist/types/overlays/link-browser.d.ts +55 -0
  39. package/dist/types/overlays/running-subagent-badge.d.ts +1 -4
  40. package/dist/types/overlays/settings-selector.d.ts +1 -1
  41. package/dist/types/overlays/snapcompact-shape-preview.d.ts +1 -1
  42. package/dist/types/overlays/spotlight-sheet.d.ts +36 -0
  43. package/dist/types/prompt/composer-attachments.d.ts +5 -2
  44. package/dist/types/prompt/composer-cache.d.ts +7 -2
  45. package/dist/types/prompt/composer.d.ts +6 -11
  46. package/dist/types/prompt/custom-editor.d.ts +8 -2
  47. package/dist/types/prompt/gradient-highlight.d.ts +2 -2
  48. package/dist/types/prompt/magic-keywords.d.ts +2 -0
  49. package/dist/types/prompt/model-mention-autocomplete.d.ts +9 -7
  50. package/dist/types/prompt/model-mention-syntax.d.ts +6 -0
  51. package/dist/types/prompt/prompt-action-autocomplete.d.ts +2 -1
  52. package/dist/types/prompt/welcome.d.ts +19 -0
  53. package/dist/types/render/extension-links.d.ts +0 -6
  54. package/dist/types/render/index.d.ts +1 -0
  55. package/dist/types/render/link-hints.d.ts +78 -0
  56. package/dist/types/render/render-utils.d.ts +0 -2
  57. package/dist/types/setup/scenes/types.d.ts +8 -0
  58. package/dist/types/setup/scenes/updates.d.ts +6 -0
  59. package/dist/types/setup/wizard.d.ts +7 -2
  60. package/dist/types/spinner-clock.d.ts +34 -0
  61. package/dist/types/status-line/component.d.ts +8 -4
  62. package/dist/types/status-line/host.d.ts +62 -0
  63. package/dist/types/status-line/index.d.ts +1 -0
  64. package/dist/types/status-line/prompt-cache.d.ts +14 -0
  65. package/dist/types/status-line/schema.d.ts +1 -1
  66. package/dist/types/status-line/startup.d.ts +6 -0
  67. package/dist/types/status-line/types.d.ts +8 -21
  68. package/dist/types/theme/schema.d.ts +28 -1
  69. package/dist/types/theme/symbols.d.ts +1 -1
  70. package/dist/types/theme/theme-class.d.ts +12 -2
  71. package/dist/types/theme/theme.d.ts +1 -1
  72. package/dist/types/theme/tui-adapters.d.ts +7 -0
  73. package/dist/types/thinking.d.ts +12 -0
  74. package/dist/types/tools/ask.d.ts +1 -1
  75. package/dist/types/tools/bash.d.ts +21 -0
  76. package/dist/types/tools/find.d.ts +9 -1
  77. package/dist/types/tools/grep.d.ts +2 -1
  78. package/dist/types/tools/grouped-file-output.d.ts +17 -0
  79. package/dist/types/tools/job-widget.d.ts +2 -2
  80. package/dist/types/tools/lsp.d.ts +4 -2
  81. package/dist/types/tools/native-view.d.ts +4 -0
  82. package/dist/types/tools/renderer.d.ts +9 -1
  83. package/dist/types/tools/shell-trace.d.ts +10 -0
  84. package/dist/types/tools/shell-viz-render.d.ts +6 -0
  85. package/dist/types/tools/shell-viz.d.ts +16 -0
  86. package/dist/types/tools/wait.d.ts +2 -2
  87. package/dist/types/tools/web-search-types.d.ts +1 -0
  88. package/dist/types/tools/write.d.ts +2 -0
  89. package/dist/types/tui.d.ts +15 -1
  90. package/package.json +15 -11
  91. package/src/apps/shell-visualizer.d.ts +24 -0
  92. package/src/apps/shell-visualizer.ts +167 -0
  93. package/src/autocomplete.d.ts +20 -0
  94. package/src/autocomplete.ts +14 -0
  95. package/src/chat/assistant-message.ts +11 -6
  96. package/src/chat/cache-invalidation-marker.d.ts +15 -7
  97. package/src/chat/cache-invalidation-marker.ts +18 -9
  98. package/src/chat/chat-transcript-builder.d.ts +5 -3
  99. package/src/chat/chat-transcript-builder.ts +16 -12
  100. package/src/chat/display-preferences.d.ts +2 -0
  101. package/src/chat/display-preferences.ts +3 -0
  102. package/src/chat/extension-types.d.ts +72 -1
  103. package/src/chat/extension-types.ts +74 -1
  104. package/src/chat/image-loading.d.ts +2 -2
  105. package/src/chat/image-loading.ts +2 -2
  106. package/src/chat/messages.d.ts +2 -3
  107. package/src/chat/messages.ts +3 -8
  108. package/src/chat/read-tool-group.d.ts +15 -2
  109. package/src/chat/read-tool-group.ts +201 -41
  110. package/src/chat/skill-message.d.ts +1 -0
  111. package/src/chat/skill-message.ts +4 -0
  112. package/src/chat/spotlight.d.ts +203 -0
  113. package/src/chat/spotlight.ts +460 -0
  114. package/src/chat/tool-execution.d.ts +26 -5
  115. package/src/chat/tool-execution.ts +360 -38
  116. package/src/chat/transcript-actions.d.ts +11 -0
  117. package/src/chat/transcript-actions.ts +13 -1
  118. package/src/chat/transcript-browser.d.ts +9 -0
  119. package/src/chat/transcript-browser.ts +18 -0
  120. package/src/chat/transcript-presentation.d.ts +164 -0
  121. package/src/chat/transcript-presentation.ts +642 -0
  122. package/src/chat/ttsr-notification.d.ts +25 -0
  123. package/src/chat/ttsr-notification.ts +5 -0
  124. package/src/chrome/message-frame.d.ts +2 -0
  125. package/src/chrome/message-frame.ts +7 -0
  126. package/src/chrome/message-notice.d.ts +58 -0
  127. package/src/chrome/transcript-container.d.ts +27 -6
  128. package/src/chrome/transcript-container.ts +317 -66
  129. package/src/components/editor.ts +25 -1
  130. package/src/components/loader.d.ts +0 -2
  131. package/src/components/loader.ts +30 -18
  132. package/src/components/markdown.d.ts +11 -1
  133. package/src/components/markdown.ts +41 -16
  134. package/src/components/settings-list.d.ts +12 -2
  135. package/src/components/settings-list.ts +29 -13
  136. package/src/frame-rate.d.ts +18 -0
  137. package/src/frame-rate.ts +36 -0
  138. package/src/hotkeys-markdown.ts +4 -1
  139. package/src/index.d.ts +3 -0
  140. package/src/index.ts +3 -0
  141. package/src/keybinding-matchers.d.ts +4 -1
  142. package/src/keybinding-matchers.ts +13 -12
  143. package/src/kitty-graphics.d.ts +1 -1
  144. package/src/kitty-graphics.ts +3 -2
  145. package/src/motion-effects.d.ts +10 -0
  146. package/src/motion-effects.ts +27 -0
  147. package/src/native/backend.ts +66 -7
  148. package/src/native/encode.d.ts +2 -0
  149. package/src/native/encode.ts +2 -0
  150. package/src/native/measure.d.ts +10 -0
  151. package/src/native/measure.ts +185 -0
  152. package/src/native/overlay.d.ts +1 -1
  153. package/src/native/overlay.ts +1 -1
  154. package/src/native/quiet.d.ts +5 -0
  155. package/src/native/quiet.ts +105 -0
  156. package/src/native/reconcile.d.ts +6 -1
  157. package/src/native/reconcile.ts +16 -10
  158. package/src/native/spans.d.ts +6 -0
  159. package/src/native/spans.ts +40 -0
  160. package/src/native/state.d.ts +4 -0
  161. package/src/native/state.ts +18 -0
  162. package/src/overlays/agent-hub.ts +15 -2
  163. package/src/overlays/ask-dialog.ts +1 -0
  164. package/src/overlays/btw-history-panel.ts +73 -6
  165. package/src/overlays/link-browser.ts +295 -0
  166. package/src/overlays/running-subagent-badge.ts +2 -9
  167. package/src/overlays/settings-defs.ts +2 -1
  168. package/src/overlays/settings-selector.ts +18 -4
  169. package/src/overlays/snapcompact-shape-preview.ts +1 -1
  170. package/src/overlays/spotlight-sheet.ts +478 -0
  171. package/src/overlays/usage-dashboard.ts +6 -5
  172. package/src/prompt/composer-attachments.d.ts +5 -2
  173. package/src/prompt/composer-attachments.ts +6 -6
  174. package/src/prompt/composer-cache.ts +17 -16
  175. package/src/prompt/composer.ts +30 -123
  176. package/src/prompt/custom-editor.ts +17 -13
  177. package/src/prompt/gradient-highlight.d.ts +2 -2
  178. package/src/prompt/gradient-highlight.ts +5 -4
  179. package/src/prompt/magic-keywords.d.ts +2 -0
  180. package/src/prompt/magic-keywords.ts +4 -1
  181. package/src/prompt/model-mention-autocomplete.ts +73 -20
  182. package/src/prompt/model-mention-syntax.d.ts +6 -0
  183. package/src/prompt/model-mention-syntax.ts +9 -0
  184. package/src/prompt/prompt-action-autocomplete.ts +49 -33
  185. package/src/prompt/tips.txt +1 -0
  186. package/src/prompt/welcome.ts +104 -2
  187. package/src/render/extension-links.d.ts +0 -6
  188. package/src/render/extension-links.ts +0 -20
  189. package/src/render/index.d.ts +1 -0
  190. package/src/render/index.ts +1 -0
  191. package/src/render/link-hints.d.ts +78 -0
  192. package/src/render/link-hints.ts +299 -0
  193. package/src/render/render-utils.d.ts +0 -2
  194. package/src/render/render-utils.ts +0 -5
  195. package/src/setup/scenes/glyph.ts +1 -1
  196. package/src/setup/scenes/types.ts +8 -0
  197. package/src/setup/scenes/updates.ts +116 -0
  198. package/src/setup/wizard.ts +19 -8
  199. package/src/spinner-clock.d.ts +34 -0
  200. package/src/spinner-clock.ts +79 -0
  201. package/src/status-line/component.ts +145 -53
  202. package/src/status-line/host.ts +51 -0
  203. package/src/status-line/index.ts +1 -0
  204. package/src/status-line/presets.ts +3 -1
  205. package/src/status-line/prompt-cache.ts +154 -0
  206. package/src/status-line/schema.ts +1 -1
  207. package/src/status-line/segments.ts +33 -22
  208. package/src/status-line/startup.ts +23 -5
  209. package/src/status-line/types.ts +8 -22
  210. package/src/stdin-buffer.ts +89 -46
  211. package/src/terminal-capabilities.ts +3 -3
  212. package/src/terminal.ts +1 -8
  213. package/src/theme/loader.ts +3 -2
  214. package/src/theme/schema-validation.ts +1 -1
  215. package/src/theme/schema.d.ts +28 -1
  216. package/src/theme/schema.ts +30 -1
  217. package/src/theme/symbols.d.ts +1 -1
  218. package/src/theme/symbols.ts +15 -3
  219. package/src/theme/theme-class.d.ts +12 -2
  220. package/src/theme/theme-class.ts +23 -0
  221. package/src/theme/theme-schema.json +1 -1
  222. package/src/theme/theme.d.ts +1 -1
  223. package/src/theme/theme.ts +3 -7
  224. package/src/theme/tui-adapters.d.ts +7 -0
  225. package/src/theme/tui-adapters.ts +33 -1
  226. package/src/thinking.d.ts +12 -0
  227. package/src/thinking.ts +31 -0
  228. package/src/tools/ask.d.ts +1 -1
  229. package/src/tools/ask.ts +99 -38
  230. package/src/tools/ast-edit.ts +51 -32
  231. package/src/tools/ast-grep.ts +31 -19
  232. package/src/tools/bash.d.ts +21 -0
  233. package/src/tools/bash.ts +166 -24
  234. package/src/tools/find.d.ts +9 -1
  235. package/src/tools/find.ts +23 -2
  236. package/src/tools/grep.d.ts +2 -1
  237. package/src/tools/grep.ts +52 -36
  238. package/src/tools/grouped-file-output.d.ts +17 -0
  239. package/src/tools/grouped-file-output.ts +20 -2
  240. package/src/tools/job-widget.d.ts +2 -2
  241. package/src/tools/job-widget.ts +2 -2
  242. package/src/tools/lsp.d.ts +4 -2
  243. package/src/tools/lsp.ts +537 -642
  244. package/src/tools/native-view.d.ts +4 -0
  245. package/src/tools/native-view.ts +8 -2
  246. package/src/tools/renderer.d.ts +9 -1
  247. package/src/tools/renderer.ts +9 -1
  248. package/src/tools/shell-trace.d.ts +10 -0
  249. package/src/tools/shell-trace.ts +80 -0
  250. package/src/tools/shell-viz-render.d.ts +6 -0
  251. package/src/tools/shell-viz-render.ts +156 -0
  252. package/src/tools/shell-viz.d.ts +16 -0
  253. package/src/tools/shell-viz.ts +181 -0
  254. package/src/tools/streaming-output.ts +18 -8
  255. package/src/tools/task.ts +1 -1
  256. package/src/tools/wait.d.ts +2 -2
  257. package/src/tools/wait.ts +39 -34
  258. package/src/tools/web-search-types.d.ts +1 -0
  259. package/src/tools/web-search-types.ts +1 -0
  260. package/src/tools/write.d.ts +2 -0
  261. package/src/tools/write.ts +2 -0
  262. package/src/tui.d.ts +15 -1
  263. package/src/tui.ts +63 -6
  264. package/src/windows-input-mode.ts +7 -1
  265. package/dist/types/chat/collab-prompt-message.d.ts +0 -14
  266. package/dist/types/chrome/collab-qrcode.d.ts +0 -35
  267. package/src/chat/collab-prompt-message.d.ts +0 -14
  268. package/src/chat/collab-prompt-message.ts +0 -46
  269. package/src/chrome/collab-qrcode.ts +0 -99
@@ -1,12 +1,13 @@
1
1
  import type { StatusLineComponent } from "../status-line/component.js";
2
+ import { type ViewportLink } from "../render/link-hints.js";
2
3
  import type { StatusLineSession } from "../status-line/host.js";
3
4
  import { type StatusLineStartupData } from "../status-line/startup.js";
4
5
  import { type Terminal } from "../terminal.js";
5
6
  import { type Component, Container, type ResizeScrollbackMode, type TerminalFramePlan, type TerminalFrameProvider, TUI, type TUIOptions, type ViewportSize } from "../tui.js";
6
- import type { NativeSurface, NativeSurfaceProvider } from "../native/node.js";
7
+ import type { DescribeContext, NativeSurface, NativeSurfaceProvider } from "../native/node.js";
7
8
  import { CustomEditor } from "./custom-editor.js";
8
9
  import type { WordCompletionMethod } from "./word-completion.js";
9
- import { WelcomeComponent } from "./welcome.js";
10
+ import { type VersionUpdate, WelcomeComponent } from "./welcome.js";
10
11
  /** Live settings that affect the composer before and after session adoption. */
11
12
  export interface ComposerPreferences {
12
13
  readonly quiet: boolean;
@@ -27,6 +28,8 @@ export declare const COMPOSER_DEFAULTS: ComposerPreferences;
27
28
  /** Welcome data that can be supplied initially or patched as startup resolves it. */
28
29
  export interface ComposerWelcomeUpdate {
29
30
  readonly version?: string;
31
+ /** Background self-update activity after the version label; `null` clears it. */
32
+ readonly versionUpdate?: VersionUpdate | null;
30
33
  }
31
34
  /**
32
35
  * Status-bar inputs persisted by the last session. The first frame renders
@@ -115,14 +118,6 @@ export interface ViewportClickRowTarget {
115
118
  * decides focusability and recency.
116
119
  */
117
120
  export declare function routeViewportClick(spans: readonly ViewportClickSpan[], index: number): string[];
118
- /** An extension link label drawn on a mutable-viewport line: what a click or hint tag lands on. */
119
- export interface ViewportLink {
120
- readonly url: string;
121
- /** Mutable-viewport line the label is drawn on. */
122
- readonly row: number;
123
- /** First cell of the label's part on that line. */
124
- readonly start: number;
125
- }
126
121
  /**
127
122
  * Called once when link-hint mode ends; `reason` is `"crowded"` when a row held more links than
128
123
  * their tags could fit side by side, so no tags were drawn.
@@ -160,7 +155,7 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
160
155
  * row, the editor and the status line. There is no history/viewport split:
161
156
  * retirement, resize replay and hover bands are ANSI concerns.
162
157
  */
163
- describeSurface(): NativeSurface;
158
+ describeSurface(cx: DescribeContext): NativeSurface;
164
159
  /**
165
160
  * Candidate subagent ids under a mutable-viewport line, for click-to-focus.
166
161
  * Empty when the line has no click target (chrome, separators, retired rows
@@ -169,8 +169,14 @@ export declare class CustomEditor extends Editor {
169
169
  * to "none known".
170
170
  */
171
171
  skillFilePath: (name: string) => string | undefined;
172
- /** Host-owned model probe: maps a mentionable selector to its display chip label. */
173
- modelMentionLabel: (selector: string) => string | undefined;
172
+ /**
173
+ * Host-owned model probe: a mentionable `provider/id[:level]` selector's chip label and
174
+ * canonical selector, so equivalent spellings (`:hi`/`:high`, bare/`:auto`) share a chip.
175
+ */
176
+ resolveModelMention: (selector: string) => {
177
+ label: string;
178
+ selector: string;
179
+ } | undefined;
174
180
  /** Host-owned session probe: maps a persisted model pseudonym back to its selector. */
175
181
  modelMentionSelector: (agent: string) => string | undefined;
176
182
  /**
@@ -19,8 +19,8 @@ export interface GradientHighlightSpec {
19
19
  hue: (t: number) => number;
20
20
  /** HSL saturation percentage. Default 90. */
21
21
  saturation?: number;
22
- /** HSL lightness percentage. Default 62. */
23
- lightness?: number;
22
+ /** Maps a normalized position `t` in [0, 1) to an HSL lightness percentage. Default: 62 everywhere. */
23
+ lightness?: (t: number) => number;
24
24
  }
25
25
  /**
26
26
  * Build a stateless highlighter that paints each standalone match of `highlight`
@@ -12,6 +12,8 @@ export interface MagicKeywordSpec {
12
12
  readonly word: string;
13
13
  /** HSL hue sweep `[from, to]` in degrees painted across the word; `to` may exceed 360 to wrap through red. */
14
14
  readonly hue: readonly [number, number];
15
+ /** HSL lightness sweep `[from, to]` in percent painted alongside `hue`; omitted keeps the default lightness. */
16
+ readonly lightness?: readonly [number, number];
15
17
  }
16
18
  export interface RegisteredKeyword {
17
19
  readonly word: string;
@@ -1,16 +1,18 @@
1
1
  import type { Model } from "@linxiraos/pi-ai";
2
- import type { AutocompleteItem } from "../index.js";
2
+ import type { AutocompleteItem, ModelMentionCompletion } from "../index.js";
3
3
  import type { ModelBrowserRegistry, ModelBrowserSource } from "../overlays/model-browser.js";
4
4
  import type { ModelBrowserItem } from "../overlays/model-browser.js";
5
- /** Supplies picker-ranked model candidates for the query after `^`. */
6
- export type ModelMentionCandidateSource = (query: string) => ReadonlyArray<ModelBrowserItem>;
5
+ /**
6
+ * Supplies picker-ranked model candidates for the query after `^`. `availableModelIds`
7
+ * lists every available model's selector, in or out of the picker scope.
8
+ */
9
+ export type ModelMentionCandidateSource = ((query: string) => ReadonlyArray<ModelBrowserItem>) & {
10
+ availableModelIds?: () => ReadonlySet<string>;
11
+ };
7
12
  /** Whether an autocomplete prefix belongs to a model mention. */
8
13
  export declare function isModelMentionPrefix(prefix: string): boolean;
9
14
  /** Build model mention choices for the whitespace-delimited token at the cursor. */
10
- export declare function getModelMentionSuggestions(textBeforeCursor: string, candidates: ModelMentionCandidateSource | undefined): {
11
- items: AutocompleteItem[];
12
- prefix: string;
13
- } | null;
15
+ export declare function getModelMentionSuggestions(textBeforeCursor: string, candidates: ModelMentionCandidateSource | undefined): ModelMentionCompletion;
14
16
  /** Replace the live mention token with the selected canonical selector and a trailing space. */
15
17
  export declare function applyModelMentionCompletion(lines: string[], cursorLine: number, cursorCol: number, item: AutocompleteItem, prefix: string): {
16
18
  lines: string[];
@@ -4,6 +4,7 @@
4
4
  * the startup composer prepaint graph never loads the catalog or task agents.
5
5
  */
6
6
  import type { Model } from "@linxiraos/pi-ai";
7
+ import type { Effort } from "@linxiraos/pi-catalog/effort";
7
8
  /** Whitespace-delimited token; groups are leading delimiter and selector. Reset lastIndex before reuse. */
8
9
  export declare const MODEL_MENTION_RE: RegExp;
9
10
  /** Submitted mention; groups are agent pseudonym and display name. */
@@ -11,8 +12,11 @@ export declare const MODEL_MENTION_TAG_RE: RegExp;
11
12
  /** A user-tagged model usable as a subagent pseudonym on the current session branch. */
12
13
  export interface ModelMention {
13
14
  agent: string;
15
+ /** Canonical selector: `provider/id`, plus `:<effort>` when the tag names one. */
14
16
  selector: string;
15
17
  name: string;
18
+ /** Initial effort from the tag's `:<level>` suffix; absent keeps the agent's default policy. */
19
+ thinkingLevel?: Effort;
16
20
  }
17
21
  /** Expand a composer atom back into its canonical model selector. */
18
22
  export declare function modelMentionToken(selector: string): string;
@@ -20,5 +24,7 @@ export declare function modelMentionToken(selector: string): string;
20
24
  export declare function modelMentionTag(mention: ModelMention): string;
21
25
  /** Use the catalog display name, without quotes, or the id when the name is empty. */
22
26
  export declare function modelMentionDisplayName(model: Model): string;
27
+ /** Display name of a mention, naming the tagged effort so tags of one model stay distinct. */
28
+ export declare function modelMentionName(displayName: string, thinkingLevel: Effort): string;
23
29
  /** Restore known submitted tags to editable selectors; leave unknown agents literal. */
24
30
  export declare function expandModelMentionTags(text: string, selectorFor: (agent: string) => string | undefined): string;
@@ -1,4 +1,4 @@
1
- import { type AutocompleteItem, type AutocompleteProvider, type SlashCommand } from "../index.js";
1
+ import { type AutocompleteItem, type AutocompleteProvider, type ModelMentionCompletion, type SlashCommand } from "../index.js";
2
2
  import { type KeybindingsManager } from "../app-keybindings.js";
3
3
  import { type InternalUrlCallerContext } from "./internal-url-autocomplete.js";
4
4
  import { type ModelMentionCandidateSource } from "./model-mention-autocomplete.js";
@@ -50,6 +50,7 @@ export declare class PromptActionAutocompleteProvider implements AutocompletePro
50
50
  items: AutocompleteItem[];
51
51
  prefix: string;
52
52
  } | null;
53
+ trySyncModelMentionCompletion(lines: string[], cursorLine: number, cursorCol: number): ModelMentionCompletion;
53
54
  trySyncInlineReplace(textBeforeCursor: string): {
54
55
  replaceLen: number;
55
56
  insert: string;
@@ -26,6 +26,23 @@ export declare function pickWeightedTip(tips: readonly string[], r: number): str
26
26
  * `width` leaves no room for a useful line.
27
27
  */
28
28
  export declare function renderWelcomeTip(tip: string, width: number, phase?: number, isNew?: boolean): string[];
29
+ /**
30
+ * Background self-update activity shown after the welcome banner's version
31
+ * label: `updating` while a newer `version` downloads (`fraction` once bytes
32
+ * are counted) or installs, `ready` once the next launch starts it, `failed`
33
+ * when the attempt stopped.
34
+ */
35
+ export type VersionUpdate = {
36
+ phase: "updating";
37
+ version: string;
38
+ fraction?: number;
39
+ } | {
40
+ phase: "ready";
41
+ version: string;
42
+ } | {
43
+ phase: "failed";
44
+ version: string;
45
+ };
29
46
  /**
30
47
  * The session's welcome banner. In a terminal: the gradient mark beside the
31
48
  * `Zeta` wordmark, with the version under the wordmark and the `Linxira-Zeta`
@@ -67,6 +84,8 @@ export declare class WelcomeComponent implements Component {
67
84
  stopIntro(): void;
68
85
  /** Update the version embedded in the welcome border title. */
69
86
  setVersion(version: string): void;
87
+ /** Show (or with `null`, clear) background self-update activity after the version label. */
88
+ setVersionUpdate(update: VersionUpdate | null): void;
70
89
  render(termWidth: number): readonly string[];
71
90
  }
72
91
  /** Brand mark: FIGlet `ANSI Shadow` render of `Z` (generated). */
@@ -31,12 +31,6 @@ export declare function extensionLinkScheme(href: string): string | undefined;
31
31
  * not change between renders of the same text, or rows rendered twice stop matching.
32
32
  */
33
33
  export declare function formatExtensionLink(label: string, href: string, key: string): string;
34
- /**
35
- * Tags for `count` links in keyboard link-hint mode: single letters while they suffice, otherwise
36
- * two letters each, so no tag is a prefix of another. At most the alphabet squared (676) are made;
37
- * links past that stay untagged.
38
- */
39
- export declare function linkHintTags(count: number): string[];
40
34
  /**
41
35
  * `line` without omp's extension-link markers (the OSC 8 open and close around each label), for
42
36
  * terminal output. Every other hyperlink is kept as is.
@@ -5,6 +5,7 @@ export * from "./code-cell.js";
5
5
  export * from "./extension-links.js";
6
6
  export * from "./file-list.js";
7
7
  export * from "./hyperlink.js";
8
+ export * from "./link-hints.js";
8
9
  export * from "./output-block.js";
9
10
  export * from "./output-pane.js";
10
11
  export * from "./render-utils.js";
@@ -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). */