@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
@@ -4,6 +4,8 @@
4
4
  * the interactive host registers the one handler that runs omp's existing
5
5
  * commands for them, so a click and the key binding take the same path.
6
6
  */
7
+ import type { SpotlightDetails } from "./spotlight";
8
+
7
9
  export type TranscriptAction =
8
10
  /** Retry the last failed turn (`app.retry`). */
9
11
  | { readonly act: "retry" }
@@ -14,7 +16,17 @@ export type TranscriptAction =
14
16
  /** Resume the session stored at `path` (a welcome card's recent session). */
15
17
  | { readonly act: "resume"; readonly path: string }
16
18
  /** Put `text` on the clipboard. */
17
- | { readonly act: "copy"; readonly text: string };
19
+ | { readonly act: "copy"; readonly text: string }
20
+ /**
21
+ * Open the Spotlight sheet of a shaped tool result: its original beside `reduced`, the text the model saw (a
22
+ * held-out result's sheet shows the would-be text its trace's `shapedUrl` names instead).
23
+ */
24
+ | {
25
+ readonly act: "spotlight";
26
+ readonly toolCallId: string;
27
+ readonly spotlight: SpotlightDetails;
28
+ readonly reduced: string;
29
+ };
18
30
 
19
31
  type Handler = (action: TranscriptAction) => void;
20
32
 
@@ -79,8 +79,17 @@ export declare class TranscriptBrowser implements Component {
79
79
  handleScrollKey(data: string): boolean;
80
80
  scrollToTop(): void;
81
81
  scrollToBottom(): void;
82
+ /** Whether the view shows the first body row. */
83
+ get atTop(): boolean;
84
+ /** One past the last logical body row in view. */
85
+ get visibleEnd(): number;
82
86
  /** Whether an anchor identity has successfully been applied to the viewport. */
83
87
  hasAnchored(id: string): boolean;
88
+ /**
89
+ * What to add to a body row of the last frame to get its logical body row, as
90
+ * {@link toContentPoint} maps it; it follows the scroll, so a content row keeps its sum.
91
+ */
92
+ get frameRowOffset(): number;
84
93
  /**
85
94
  * Translate a 0-based frame mouse point into the logical, scrolled body.
86
95
  * Returns undefined for borders, header/footer rows, and unpainted body rows.
@@ -189,11 +189,29 @@ export class TranscriptBrowser implements Component {
189
189
  this.#syncFollowBottom();
190
190
  }
191
191
 
192
+ /** Whether the view shows the first body row. */
193
+ get atTop(): boolean {
194
+ return this.#scrollView.getScrollOffset() === 0;
195
+ }
196
+
197
+ /** One past the last logical body row in view. */
198
+ get visibleEnd(): number {
199
+ return this.#scrollView.getVisibleRange().end;
200
+ }
201
+
192
202
  /** Whether an anchor identity has successfully been applied to the viewport. */
193
203
  hasAnchored(id: string): boolean {
194
204
  return this.#scrollView.hasRevealedRange(id);
195
205
  }
196
206
 
207
+ /**
208
+ * What to add to a body row of the last frame to get its logical body row, as
209
+ * {@link toContentPoint} maps it; it follows the scroll, so a content row keeps its sum.
210
+ */
211
+ get frameRowOffset(): number {
212
+ return this.#scrollView.getVisibleRange().start - (this.#layout?.bodyTop ?? 0);
213
+ }
214
+
197
215
  /**
198
216
  * Translate a 0-based frame mouse point into the logical, scrolled body.
199
217
  * Returns undefined for borders, header/footer rows, and unpainted body rows.
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Extension transcript presenters (`pi.registerTranscriptPresenter`). The host installs them with
3
+ * {@link setTranscriptPresenters}; each presentable block draws from its
4
+ * {@link TranscriptPresentationState}.
5
+ */
6
+ import type { TspText } from "@linxiraos/pi-wire";
7
+ import { type Component, Container } from "../tui";
8
+ import { type DescribeContext, type NativeNode, type NativeUiEvent } from "../native/node";
9
+ import type { AnimationFrame, CompactTranscriptBlock } from "../chrome/transcript-container";
10
+ import type { TranscriptBlock, TranscriptPresentation, TranscriptPresenter } from "./extension-types";
11
+ import { type BashExecutionMessage, type CustomMessage, type HookMessage, type PythonExecutionMessage } from "./messages";
12
+ /** A block's presentation once every presenter has answered. */
13
+ export type ResolvedPresentation = {
14
+ readonly mode: "full";
15
+ } | {
16
+ readonly mode: "hidden";
17
+ } | {
18
+ readonly mode: "compact";
19
+ readonly label?: TspText;
20
+ readonly rows: readonly TspText[];
21
+ };
22
+ export type CompactPresentation = Extract<ResolvedPresentation, {
23
+ mode: "compact";
24
+ }>;
25
+ /**
26
+ * Install the presenters the transcript draws with, in extension load order; true when the set
27
+ * changed. They are called as given: the installer guards them (the extension runner reports a
28
+ * throw or an unknown answer, and answers `"full"` instead).
29
+ */
30
+ export declare function setTranscriptPresenters(next: readonly TranscriptPresenter[]): boolean;
31
+ /** An extension registered or disposed a presenter; the host installs the set again and refreshes. */
32
+ export declare function notifyTranscriptPresentersChanged(): void;
33
+ /** Call `listener` on {@link notifyTranscriptPresentersChanged}; returns the unsubscribe. */
34
+ export declare function onTranscriptPresentersChanged(listener: () => void): () => void;
35
+ /**
36
+ * Call `listener` when a block draws a presentation other than the one it last drew, outside a
37
+ * refresh (a late result, say): the host replays the scrollback when that block has rows in it.
38
+ * Returns the unsubscribe.
39
+ */
40
+ export declare function onTranscriptPresentationRedrawn(listener: (owner: Component) => void): () => void;
41
+ /**
42
+ * A presenter's answer as plain data when it is a {@link TranscriptPresentation}; `null` for
43
+ * anything else (a misspelt mode, the Promise of an async presenter, a `compact` that is not a
44
+ * plain object), which draws the block in full. It reads every field the transcript uses once,
45
+ * so a throwing getter or Proxy in the answer throws here, inside the caller's guard, and never
46
+ * while drawing. Labels and rows that are not `TspText` are dropped.
47
+ */
48
+ export declare function readTranscriptPresentation(answer: unknown): TranscriptPresentation | null;
49
+ /**
50
+ * One block's presentation, resolved lazily after {@link markStale}. The resolved object keeps
51
+ * its identity while the answer is the same, so it can sit in render memo keys.
52
+ */
53
+ export declare class TranscriptPresentationState {
54
+ #private;
55
+ /**
56
+ * `snapshot` is the block presenters see (`undefined`: always full); `expanded` tells whether
57
+ * the user expanded it, which always draws it in full. `owner` is the transcript block it draws
58
+ * ({@link onTranscriptPresentationRedrawn} names it).
59
+ */
60
+ constructor(snapshot: () => TranscriptBlock | undefined, expanded: () => boolean, owner?: Component);
61
+ /** The block's data changed: ask again before the next draw. */
62
+ markStale(): void;
63
+ /** What the block draws now. */
64
+ get shown(): ResolvedPresentation;
65
+ /** The last answer {@link shown} resolved, without asking the presenters again. */
66
+ get resolved(): ResolvedPresentation;
67
+ /** {@link shown}, for the block's render or description: what {@link refresh} compares against. */
68
+ draw(): ResolvedPresentation;
69
+ /**
70
+ * The block's data changed where nothing may draw it again (rows retired to scrollback): ask now,
71
+ * and report an answer other than the drawn one as {@link draw} would. What was drawn stays the
72
+ * baseline until the block draws again.
73
+ */
74
+ recheck(): void;
75
+ /**
76
+ * Ask again now when `ids` selects this block (every block when `undefined`); true when the
77
+ * answer differs from what the block last drew. A block in terminal scrollback is not drawn
78
+ * again, so a change its data made since (a late result) still counts. A change it reports is
79
+ * the caller's to redraw, so the next draw does not report it again.
80
+ */
81
+ refresh(ids?: ReadonlySet<string>): boolean;
82
+ }
83
+ /** A transcript block whose display presenters choose. */
84
+ export interface TranscriptPresentable {
85
+ /**
86
+ * Ask again for the parts whose id is in `ids` (all when `undefined`); true when the drawing
87
+ * changed. True obliges the caller to redraw the block (and replay scrollback holding its rows):
88
+ * the change is not reported again.
89
+ */
90
+ refreshTranscriptPresentation(ids?: ReadonlySet<string>): boolean;
91
+ }
92
+ export declare function isTranscriptPresentable(component: Component): component is Component & TranscriptPresentable;
93
+ /**
94
+ * A compact block's terminal rows: `• <head>` (the presenter's `label` replacing `head`), then one
95
+ * indented row per presenter row. Plain strings arrive sanitized (see `normalize`) and keep their
96
+ * spacing; span arrays are styled.
97
+ */
98
+ export declare function compactRows(head: string, presentation: CompactPresentation, width: number, glyph?: string): string[];
99
+ /** omp's own one-row head: the bold title, then a muted detail (raw input, sanitized to one line). */
100
+ export declare function compactHead(title: string, detail?: string): string;
101
+ /** How a block names itself in a compact native card when its full drawing is not a `tool` node. */
102
+ export interface CompactNativeHead {
103
+ readonly role: string;
104
+ readonly title: string;
105
+ readonly target?: TspText;
106
+ }
107
+ /**
108
+ * A block's native drawing under `presentation`. Hidden stays mounted through the `hidden` prop.
109
+ * Compact folds a `tool` node to one inline, collapsed row (its toggle asks for the full block);
110
+ * any other drawing becomes the body of a collapsed card headed by `head`.
111
+ */
112
+ export declare function presentNative(full: NativeNode, presentation: ResolvedPresentation, head: CompactNativeHead): NativeNode;
113
+ type WrappedTranscriptBlock = Exclude<TranscriptBlock, {
114
+ type: "toolCall";
115
+ }>;
116
+ /** The `message` block of a session message: its id is the decimal `timestamp`. */
117
+ export declare function messageBlock(message: CustomMessage | HookMessage | BashExecutionMessage | PythonExecutionMessage): WrappedTranscriptBlock;
118
+ /** A process-unique id for an `event` block. */
119
+ export declare function eventBlockId(kind: string): string;
120
+ /** Transcript hooks a wrapped component may have; the wrapper forwards the ones it has. */
121
+ interface WrappedComponent extends Component, CompactTranscriptBlock {
122
+ setExpanded?(expanded: boolean): void;
123
+ /**
124
+ * Whether the user expanded it, including through a nested disclosure no root toggle reports
125
+ * (the skill's `prompt`). True forces the block full, so it must default to false.
126
+ */
127
+ isExpanded?(): boolean;
128
+ setToolActivityVisible?(visible: boolean): void;
129
+ isTranscriptBlockFinalized?(): boolean;
130
+ setTranscriptAllocation?(rows: number, frame: AnimationFrame): void;
131
+ }
132
+ /**
133
+ * A non-tool transcript block (advisor, skill, late diagnostics, `!`/`$` run, background job,
134
+ * supervised process, TTSR, todo reminder) with the presenters' answer applied around the
135
+ * component that draws it. In full it draws and describes as `inner` does; expansion, native
136
+ * events, tool-activity visibility and finalization reach `inner`.
137
+ */
138
+ export declare class PresentedBlock<T extends WrappedComponent = WrappedComponent> extends Container implements TranscriptPresentable {
139
+ #private;
140
+ readonly inner: T;
141
+ /** Only where `inner` has it: the transcript container detects tool activity by its presence. */
142
+ readonly setToolActivityVisible?: (visible: boolean) => void;
143
+ constructor(inner: T, block: WrappedTranscriptBlock);
144
+ get block(): WrappedTranscriptBlock;
145
+ /**
146
+ * The block's data changed (a `!`/`$` run was recorded, TTSR rules merged in). A block already
147
+ * in scrollback is not drawn again, so a changed answer is reported now for a one-time replay.
148
+ */
149
+ setBlock(block: WrappedTranscriptBlock): void;
150
+ setExpanded(expanded: boolean): void;
151
+ /** The compact row's toggle, or `inner`'s own root toggle, expands the block. */
152
+ handleNativeEvent(event: NativeUiEvent): void;
153
+ refreshTranscriptPresentation(ids?: ReadonlySet<string>): boolean;
154
+ isTranscriptBlockFinalized(): boolean;
155
+ /** A squeezed compact block keeps its head and as many rows as fit; in full, `inner` decides. */
156
+ setTranscriptAllocation(rows: number, frame: AnimationFrame): void;
157
+ /** Compact while drawn as compact rows; in full, as compact as `inner` says. */
158
+ isTranscriptBlockCompact(): boolean;
159
+ /** The cached head row carries theme colours and glyphs. */
160
+ invalidate(): void;
161
+ render(width: number): readonly string[];
162
+ describe(cx: DescribeContext): NativeNode | null;
163
+ }
164
+ export {};