@opengeni/react 0.29.0 → 0.32.1

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 (207) hide show
  1. package/dist/approvals.d.ts +14 -0
  2. package/dist/{chunk-M7X4JZOD.js → chunk-4QOQ2DSR.js} +8 -1
  3. package/dist/chunk-4QOQ2DSR.js.map +1 -0
  4. package/dist/{chunk-HQFPO7VX.js → chunk-7CJOAW3V.js} +24 -3
  5. package/dist/{chunk-HQFPO7VX.js.map → chunk-7CJOAW3V.js.map} +1 -1
  6. package/dist/{chunk-CSJBF3QJ.js → chunk-A2WITZTI.js} +377 -113
  7. package/dist/chunk-A2WITZTI.js.map +1 -0
  8. package/dist/{chunk-BC6RKIHS.js → chunk-GZ4KR67U.js} +11 -11
  9. package/dist/{chunk-AVLMIWYO.js → chunk-KZRUYCL4.js} +12 -6
  10. package/dist/chunk-KZRUYCL4.js.map +1 -0
  11. package/dist/{chunk-OKXCECLG.js → chunk-TCCE5ZU5.js} +171 -22
  12. package/dist/chunk-TCCE5ZU5.js.map +1 -0
  13. package/dist/chunk-U255M5EZ.js +178 -0
  14. package/dist/chunk-U255M5EZ.js.map +1 -0
  15. package/dist/{chunk-IPVOVOW6.js → chunk-WY2QN2CX.js} +2539 -2174
  16. package/dist/chunk-WY2QN2CX.js.map +1 -0
  17. package/dist/chunk-ZNNE2VES.js +6413 -0
  18. package/dist/chunk-ZNNE2VES.js.map +1 -0
  19. package/dist/client.d.ts +33 -0
  20. package/dist/commands/index.d.ts +3 -0
  21. package/dist/commands/registry.d.ts +41 -0
  22. package/dist/commands/types.d.ts +85 -0
  23. package/dist/components/approval-surface.d.ts +28 -0
  24. package/dist/components/chat-composer.d.ts +51 -0
  25. package/dist/components/code-editor.d.ts +43 -0
  26. package/dist/components/command-palette.d.ts +25 -0
  27. package/dist/components/composer-transcription-control.d.ts +36 -0
  28. package/dist/components/composer.d.ts +277 -0
  29. package/dist/components/copy-button.d.ts +26 -0
  30. package/dist/components/desktop-viewer.d.ts +85 -0
  31. package/dist/components/diff-view.d.ts +38 -0
  32. package/dist/components/enrollment-consent.d.ts +33 -0
  33. package/dist/components/enrollment-device-flow.d.ts +27 -0
  34. package/dist/components/file-browser.d.ts +47 -0
  35. package/dist/components/fleet-tile.d.ts +18 -0
  36. package/dist/components/human-input-form.d.ts +47 -0
  37. package/dist/components/machine-card.d.ts +21 -0
  38. package/dist/components/machine-dock-bar.d.ts +31 -0
  39. package/dist/components/machine-health-pill.d.ts +9 -0
  40. package/dist/components/machine-metrics.d.ts +15 -0
  41. package/dist/components/machine-status-pill.d.ts +54 -0
  42. package/dist/components/machines/health.d.ts +25 -0
  43. package/dist/components/machines/machine-detail.d.ts +14 -0
  44. package/dist/components/machines/metric-history-chart.d.ts +24 -0
  45. package/dist/components/machines/metric-sparkline.d.ts +9 -0
  46. package/dist/components/machines/series.d.ts +24 -0
  47. package/dist/components/machines-dashboard.d.ts +30 -0
  48. package/dist/components/markdown.d.ts +31 -0
  49. package/dist/components/message-timeline.d.ts +98 -0
  50. package/dist/components/model-picker.d.ts +19 -0
  51. package/dist/components/pierre-diff.d.ts +34 -0
  52. package/dist/components/pierre-file.d.ts +27 -0
  53. package/dist/components/queue-draft-policy.d.ts +7 -0
  54. package/dist/components/queue-surface-implementation.d.ts +20 -0
  55. package/dist/components/queue-surface-state.d.ts +12 -0
  56. package/dist/components/queue-surface.d.ts +12 -0
  57. package/dist/components/sandbox-files.d.ts +49 -0
  58. package/dist/components/sandbox-terminal.d.ts +123 -0
  59. package/dist/components/sandbox-workspace.d.ts +128 -0
  60. package/dist/components/session-chrome.d.ts +70 -0
  61. package/dist/components/session-status.d.ts +25 -0
  62. package/dist/components/soften-streaming-markdown.d.ts +13 -0
  63. package/dist/components/stream-reveal.d.ts +37 -0
  64. package/dist/components/tip-follow.d.ts +139 -0
  65. package/dist/components/tooltip.d.ts +16 -0
  66. package/dist/components/workbench-changes.d.ts +34 -0
  67. package/dist/components/workspace-dock.d.ts +35 -0
  68. package/dist/composer.d.ts +11 -7
  69. package/dist/composer.js +9 -6
  70. package/dist/hooks/internal.d.ts +46 -0
  71. package/dist/hooks/use-available-models.d.ts +37 -0
  72. package/dist/hooks/use-billing-usage.d.ts +26 -0
  73. package/dist/hooks/use-codex-accounts.d.ts +69 -0
  74. package/dist/{use-composer-ClHy1rkL.d.ts → hooks/use-composer.d.ts} +16 -24
  75. package/dist/hooks/use-desktop-stream.d.ts +43 -0
  76. package/dist/hooks/use-environments.d.ts +35 -0
  77. package/dist/{use-file-attachments-BmT8WtqO.d.ts → hooks/use-file-attachments.d.ts} +6 -9
  78. package/dist/hooks/use-goal.d.ts +46 -0
  79. package/dist/hooks/use-human-input.d.ts +26 -0
  80. package/dist/hooks/use-last-started-turn-policy.d.ts +27 -0
  81. package/dist/hooks/use-machine-chip.d.ts +54 -0
  82. package/dist/hooks/use-machines.d.ts +81 -0
  83. package/dist/hooks/use-packs.d.ts +27 -0
  84. package/dist/hooks/use-relay-frame-stream.d.ts +53 -0
  85. package/dist/hooks/use-rigs.d.ts +87 -0
  86. package/dist/hooks/use-sandbox-files.d.ts +108 -0
  87. package/dist/hooks/use-sandbox-git.d.ts +58 -0
  88. package/dist/hooks/use-sandbox-terminal.d.ts +62 -0
  89. package/dist/hooks/use-scheduled-tasks.d.ts +15 -0
  90. package/dist/hooks/use-session-capabilities.d.ts +83 -0
  91. package/dist/hooks/use-session-control.d.ts +22 -0
  92. package/dist/hooks/use-session-events.d.ts +92 -0
  93. package/dist/hooks/use-session-lineage.d.ts +17 -0
  94. package/dist/hooks/use-session-mcp-approval-policy.d.ts +23 -0
  95. package/dist/hooks/use-session.d.ts +23 -0
  96. package/dist/hooks/use-slash-commands.d.ts +66 -0
  97. package/dist/hooks/use-terminal-stream.d.ts +46 -0
  98. package/dist/hooks/use-transcription.d.ts +73 -0
  99. package/dist/hooks/use-turn-queue.d.ts +44 -0
  100. package/dist/hooks/use-voice-input.d.ts +25 -0
  101. package/dist/hooks/use-windowed-sections.d.ts +42 -0
  102. package/dist/hooks/use-workspace-capture.d.ts +49 -0
  103. package/dist/hooks/use-workspace-edit.d.ts +73 -0
  104. package/dist/hooks/use-workspace-sessions.d.ts +30 -0
  105. package/dist/hooks/use-workspaces.d.ts +22 -0
  106. package/dist/human-input.d.ts +18 -0
  107. package/dist/index.d.ts +144 -2119
  108. package/dist/index.js +421 -324
  109. package/dist/index.js.map +1 -1
  110. package/dist/lib/clipboard.d.ts +7 -0
  111. package/dist/lib/cn.d.ts +3 -0
  112. package/dist/lib/format.d.ts +48 -0
  113. package/dist/lib/git-patch.d.ts +8 -0
  114. package/dist/lib/motion-inspect.d.ts +5 -0
  115. package/dist/lib/motion.d.ts +14 -0
  116. package/dist/lib/noto-sans-arabic-loader.d.ts +1 -0
  117. package/dist/lib/noto-sans-jp-loader.generated.d.ts +1 -0
  118. package/dist/lib/relay-wire.d.ts +30 -0
  119. package/dist/lib/use-portal-token-style.d.ts +9 -0
  120. package/dist/lib/use-theme-type.d.ts +5 -0
  121. package/dist/lib/use-unicode-fonts.d.ts +12 -0
  122. package/dist/lib/xterm-renderer.d.ts +19 -0
  123. package/dist/lib/xterm-theme.d.ts +75 -0
  124. package/dist/machines.d.ts +30 -413
  125. package/dist/machines.js +3 -3
  126. package/dist/model-policy.d.ts +32 -0
  127. package/dist/model-policy.js +33 -0
  128. package/dist/model-policy.js.map +1 -0
  129. package/dist/provider.d.ts +16 -0
  130. package/dist/{queue-surface-implementation-UQ535OKQ.js → queue-surface-implementation-THPAKGMD.js} +2 -2
  131. package/dist/{queue-surface-implementation-UQ535OKQ.js.map → queue-surface-implementation-THPAKGMD.js.map} +1 -1
  132. package/dist/session-context.d.ts +82 -0
  133. package/dist/session-ui.d.ts +10 -7
  134. package/dist/session-ui.js +9 -5
  135. package/dist/session.d.ts +28 -6
  136. package/dist/session.js +11 -11
  137. package/dist/timeline/activity-rail.d.ts +19 -0
  138. package/dist/timeline/disclosure-context.d.ts +14 -0
  139. package/dist/timeline/entrance.d.ts +14 -0
  140. package/dist/timeline/fleet-decision-projection.d.ts +9 -0
  141. package/dist/timeline/fleet-decision-row.d.ts +11 -0
  142. package/dist/timeline/fold-memory.d.ts +15 -0
  143. package/dist/timeline/index.d.ts +18 -0
  144. package/dist/timeline/parsers.d.ts +96 -0
  145. package/dist/timeline/projection.d.ts +38 -0
  146. package/dist/timeline/registry.d.ts +40 -0
  147. package/dist/timeline/screenshot-lightbox.d.ts +26 -0
  148. package/dist/timeline/seen-activity-ids.d.ts +2 -0
  149. package/dist/timeline/shared.d.ts +125 -0
  150. package/dist/timeline/tool-diff.d.ts +8 -0
  151. package/dist/timeline/tool-display-name.d.ts +10 -0
  152. package/dist/timeline/tool-renderers.d.ts +5 -0
  153. package/dist/timeline/turn-summary.d.ts +116 -0
  154. package/dist/{use-turn-queue-D_1a8W_l.d.ts → timeline/types.d.ts} +41 -69
  155. package/dist/types/machines.d.ts +11 -0
  156. package/package.json +8 -4
  157. package/src/client.ts +1 -0
  158. package/src/components/composer-transcription-control.tsx +278 -130
  159. package/src/components/composer.tsx +20 -15
  160. package/src/components/copy-button.tsx +127 -0
  161. package/src/components/markdown.tsx +231 -32
  162. package/src/components/message-timeline.tsx +1304 -378
  163. package/src/components/model-picker.tsx +83 -43
  164. package/src/components/queue-surface-implementation.tsx +1 -1
  165. package/src/components/session-chrome.tsx +942 -0
  166. package/src/components/soften-streaming-markdown.ts +205 -0
  167. package/src/components/stream-reveal.ts +195 -0
  168. package/src/components/tip-follow.ts +459 -0
  169. package/src/components/tooltip.tsx +103 -0
  170. package/src/composer.ts +6 -0
  171. package/src/hooks/internal.ts +30 -4
  172. package/src/hooks/use-available-models.ts +51 -4
  173. package/src/hooks/use-composer.ts +23 -3
  174. package/src/hooks/use-last-started-turn-policy.ts +95 -0
  175. package/src/hooks/use-session-events.ts +359 -5
  176. package/src/hooks/use-voice-input.ts +232 -0
  177. package/src/index.ts +47 -1
  178. package/src/lib/clipboard.ts +58 -0
  179. package/src/lib/format.ts +18 -0
  180. package/src/lib/motion-inspect.ts +5 -0
  181. package/src/lib/motion.ts +80 -0
  182. package/src/model-policy.ts +210 -0
  183. package/src/session-ui.ts +7 -0
  184. package/src/timeline/activity-rail.tsx +46 -7
  185. package/src/timeline/entrance.tsx +10 -0
  186. package/src/timeline/fold-memory.ts +52 -0
  187. package/src/timeline/index.ts +9 -1
  188. package/src/timeline/projection.ts +226 -41
  189. package/src/timeline/seen-activity-ids.ts +19 -0
  190. package/src/timeline/shared.tsx +1 -1
  191. package/src/timeline/tool-renderers.tsx +75 -6
  192. package/src/timeline/turn-summary.tsx +387 -97
  193. package/src/timeline/types.ts +21 -0
  194. package/styles/index.css +99 -7
  195. package/styles/tokens.css +44 -3
  196. package/dist/chunk-AVLMIWYO.js.map +0 -1
  197. package/dist/chunk-CSJBF3QJ.js.map +0 -1
  198. package/dist/chunk-IPVOVOW6.js.map +0 -1
  199. package/dist/chunk-M7X4JZOD.js.map +0 -1
  200. package/dist/chunk-OKXCECLG.js.map +0 -1
  201. package/dist/chunk-ZMNPFZWL.js +0 -3918
  202. package/dist/chunk-ZMNPFZWL.js.map +0 -1
  203. package/dist/composer-BMzimGTO.d.ts +0 -528
  204. package/dist/session-DaONt-dY.d.ts +0 -264
  205. package/dist/session-context-CAjlaeZb.d.ts +0 -84
  206. package/dist/session-ui-B5_roA95.d.ts +0 -259
  207. /package/dist/{chunk-BC6RKIHS.js.map → chunk-GZ4KR67U.js.map} +0 -0
@@ -0,0 +1,15 @@
1
+ export type FoldRestingState = "open" | "closed";
2
+ /** Provide a per-timeline resting-state map (MessageTimeline owns one). */
3
+ export declare const FoldMemoryProvider: import("react").Provider<Map<string, FoldRestingState> | null>;
4
+ /** The ancestor fold-memory map, or null when none is mounted (inert). */
5
+ export declare function useFoldMemory(): Map<string, FoldRestingState> | null;
6
+ /**
7
+ * Single-cluster activity→turn wrap: copy the activity resting state onto the
8
+ * new turn-* key. Those ids differ across the wrap; without this the turn
9
+ * remounts settleFold and re-opens a chip the reader already watched collapse.
10
+ *
11
+ * Multi-cluster wraps deliberately do NOT inherit — the outer turn chip is new
12
+ * and still takes one settle beat; nested clusters keep their own activity-*
13
+ * memory so they stay closed under that beat.
14
+ */
15
+ export declare function inheritFoldRestingState(memory: Map<string, FoldRestingState>, targetKey: string, sourceKeys: readonly string[]): void;
@@ -0,0 +1,18 @@
1
+ export { buildTimeline, creditExhaustedFromEvents, extractSessionRef, groupTimeline, sessionStatusFromEvents, toolDisplayName, } from "./projection";
2
+ export type { ActivityItem, AgentMessageItem, AuthNeededItem, ContextCompactionItem, FleetDecisionItem, FleetDecisionScoreItem, GoalItem, MachineInputBatchItem, MachineInputMember, MemoryItem, NoticeItem, ReasoningItem, SandboxItem, SessionStatusItem, TimelineGroup, TimelineItem, TurnEndItem, ToolCallItem, UserMessageItem, WorkerCompletionItem, WorkerItem, } from "./types";
3
+ export { createToolRegistry, rawTypeOf } from "./registry";
4
+ export type { CreateToolRegistryOptions, ToolRegistry, ToolRegistryEntry, ToolRenderer, ToolRendererProps, } from "./registry";
5
+ export { createDefaultToolRegistry, defaultToolRegistry } from "./tool-renderers";
6
+ export { ActivityRail } from "./activity-rail";
7
+ export type { ActivityRailProps } from "./activity-rail";
8
+ export { ActivityDisclosure, BodyNote, MediaEmpty, MediaSkeleton, PayloadBlock, ScreenshotFigure, TermBlock, Thumbnail, } from "./shared";
9
+ export type { ActivityDisclosureProps, DisclosureChip } from "./shared";
10
+ export { LightboxProvider, useLightbox, useLightboxOptional } from "./screenshot-lightbox";
11
+ export { DisclosureDefaultsProvider, useForcedDefaultOpen } from "./disclosure-context";
12
+ export { FoldMemoryProvider, inheritFoldRestingState, useFoldMemory } from "./fold-memory";
13
+ export type { FoldRestingState } from "./fold-memory";
14
+ export { SeenActivityIdsProvider, useSeenActivityIds } from "./seen-activity-ids";
15
+ export { BUILT_IN_TURN_SUMMARY_FACET_IDS, TurnSummary, useTurnSettleOpen } from "./turn-summary";
16
+ export type { BuiltInTurnSummaryFacetId, TurnOutcome, TurnSummaryContext, TurnSummaryFacet, TurnSummaryFacetConfiguration, TurnSummaryFacetResult, TurnSummaryOptions, TurnSummaryProps, } from "./turn-summary";
17
+ export { applyPatchOps, controlCaret, execTruncated, isApplyPatch, isExecSessionLostBanner, looksBinary, parseExecBannerSessionId, parseToolArgs, redactSecrets, sandboxCommandExitCode, stripExecBanner, tailPeek, unwrapMcpOutput, v4aToGitFileDiff, } from "./parsers";
18
+ export type { ApplyPatchOperation } from "./parsers";
@@ -0,0 +1,96 @@
1
+ import { type GitFileDiff } from "@opengeni/sdk";
2
+ /** Recover the exit code from a sandbox exec banner (`Process exited with code N`). */
3
+ export declare function sandboxCommandExitCode(out: unknown): number | null;
4
+ /**
5
+ * Recover the numeric exec-session id the sandbox embeds for a STILL-RUNNING
6
+ * (backgrounded) process (`Process running with session ID N`). A finished
7
+ * command emits `Process exited with code N` instead, which yields `null`.
8
+ */
9
+ export declare function parseExecBannerSessionId(out: unknown): number | null;
10
+ /** Strip the exec banner (`Chunk ID ...\n...\nOutput:\n`) down to the command's stdout. */
11
+ export declare function stripExecBanner(out: unknown): string;
12
+ /** The sandbox clamped the output (token/line truncation markers in the banner). */
13
+ export declare function execTruncated(out: unknown): boolean;
14
+ /** A `write_stdin` whose target PTY vanished (`write_stdin failed: session not found: N`). */
15
+ export declare function isExecSessionLostBanner(out: unknown): boolean;
16
+ /** True when the exec stdout looks binary/garbled (a NUL byte or ELF magic). */
17
+ export declare function looksBinary(text: string): boolean;
18
+ /**
19
+ * Render unprintable control characters as caret notation (0x03 -> `^C`) so a
20
+ * `write_stdin` keystroke payload reads cleanly in the row title.
21
+ */
22
+ export declare function controlCaret(printable: string): string;
23
+ /** One operation inside an `apply_patch_call` (a V4A file edit). */
24
+ export type ApplyPatchOperation = {
25
+ /**
26
+ * The V4A op kind. The three canonical values are `create_file`,
27
+ * `update_file`, and `delete_file`; the open `string` tail tolerates a
28
+ * forward-compatible/unknown op kind from the provider without a type error
29
+ * (it falls through to the "Edited" treatment).
30
+ */
31
+ type: "create_file" | "update_file" | "delete_file" | (string & {});
32
+ path: string;
33
+ /** Rename target -- when present the op is a move/rename. */
34
+ moveTo?: string | null | undefined;
35
+ /** The V4A hunk string (`@@ ...` lines with `+`/`-`/context prefixes). */
36
+ diff?: string | undefined;
37
+ };
38
+ /**
39
+ * Parse a single V4A `apply_patch` operation into the SDK's `GitFileDiff` shape
40
+ * so it can flow into the SAME `DiffView` / `PierreDiff` the Files tab uses.
41
+ * Throws on a hunk string it cannot structure (no `@@` anchor on an update); the
42
+ * renderer catches and falls back to a raw-patch view.
43
+ */
44
+ export declare function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff;
45
+ /**
46
+ * Extract the `apply_patch` operations from a provider-native tool item's `raw`
47
+ * payload, normalizing the two wire shapes (`raw.operations[]` for a multi-file
48
+ * patch, `raw.operation` for a single op). The single owner of this shape so the
49
+ * renderer and the turn-summary facet counter never drift.
50
+ */
51
+ export declare function applyPatchOps(raw: unknown): ApplyPatchOperation[];
52
+ /**
53
+ * True when a tool item is an `apply_patch_call` — by its provider-native
54
+ * `raw.type` (the live-wire source of truth) or by tool `name` (first-party
55
+ * replays that omit `raw`). Centralizes the rawType-or-name check.
56
+ */
57
+ export declare function isApplyPatch(item: {
58
+ name: string;
59
+ raw: unknown;
60
+ }): boolean;
61
+ /** Deep-redact secret-looking values so arguments never leak a key into the UI. */
62
+ export declare function redactSecrets(value: unknown): unknown;
63
+ /** Parse tool arguments that may arrive as a JSON string or an object. */
64
+ export declare function parseToolArgs(args: unknown): Record<string, unknown>;
65
+ /** The last non-empty line of a string -- the compact "what happened" peek. */
66
+ export declare function tailPeek(text: string): string;
67
+ /**
68
+ * Unwrap an MCP tool result (`{ content: [{ type: "text", text }], isError? }`)
69
+ * into a flat `{ text, isError }`. Non-MCP outputs pass through as their string
70
+ * form.
71
+ */
72
+ export declare function unwrapMcpOutput(output: unknown): {
73
+ text: string;
74
+ isError: boolean;
75
+ };
76
+ /**
77
+ * Extract a renderable `data:` URL from a computer-use screenshot output,
78
+ * whatever transport produced it. The hosted `computer_call` and the
79
+ * function-text mode persist a plain `data:image/...` string; the
80
+ * function-image mode (codex-backed sessions) persists the STRUCTURED image
81
+ * output — `{type:"image", image:{data, mediaType}}` with `data` arriving as a
82
+ * number array / index map / Buffer-JSON / base64 string after event
83
+ * serialization — or the agents-core normalized `input_image` content item.
84
+ * Returns null when the output carries no image (so callers fall back to their
85
+ * text/empty presentation).
86
+ */
87
+ export declare function screenshotDataUrl(out: unknown): string | null;
88
+ export type TimelineMediaPreview = {
89
+ type: "media_preview";
90
+ mediaType: string;
91
+ inlineBytes: number | null;
92
+ fullOutputAvailable: false;
93
+ preview: string;
94
+ };
95
+ /** Find the explicit non-retained inline-media fact in a tool output. */
96
+ export declare function mediaPreviewFact(out: unknown): TimelineMediaPreview | null;
@@ -0,0 +1,38 @@
1
+ import type { SessionEvent, SessionStatus } from "@opengeni/sdk";
2
+ import type { TimelineGroup, TimelineItem } from "./types";
3
+ /** Readable label for a tool call, without leaking an MCP server prefix. */
4
+ export declare function toolDisplayName(name: string): string;
5
+ export declare function buildTimeline(events: SessionEvent[]): TimelineItem[];
6
+ /**
7
+ * Codex subscription web search can return private citation handles without
8
+ * the URL annotation table that would make them resolvable. Keep the canonical
9
+ * model-history item untouched, but never expose those unusable handles in the
10
+ * human timeline. Ordinary markdown links and structured URL citations remain.
11
+ */
12
+ export declare function stripOpaqueCitationTokens(text: string): string;
13
+ /**
14
+ * Whether the session's most recent turn ended in credit exhaustion — the
15
+ * terminal credit state apps key their "add credits" affordances on. Derived
16
+ * from the LAST turn-end event (completed/failed/cancelled): a later turn that
17
+ * settles any other way (someone topped up and kept working) clears it.
18
+ */
19
+ export declare function creditExhaustedFromEvents(events: SessionEvent[]): boolean;
20
+ /** The latest session status carried in the event log, if any. */
21
+ export declare function sessionStatusFromEvents(events: SessionEvent[]): SessionStatus | null;
22
+ export declare function groupTimeline(items: TimelineItem[]): TimelineGroup[];
23
+ /**
24
+ * Find a session id in orchestration tool arguments or output. Handles raw
25
+ * objects, JSON strings, and MCP tool results (`{ content: [{ type: "text",
26
+ * text: "{...}" }], structuredContent? }`).
27
+ */
28
+ export declare function extractSessionRef(value: unknown, depth?: number): string | null;
29
+ /**
30
+ * Readable label for a tool call ("session_create" -> "session create").
31
+ *
32
+ * MCP tools are namespaced `<serverId>__<toolName>` (see prefixedMcpToolName),
33
+ * and for catalog-imported servers that serverId is an opaque slug+hash
34
+ * ("mcp-integrations-sh-supabase-com-34ed9dcf1390-0i6tcf8"). De-slugging the
35
+ * whole thing leaked that id into the timeline; strip the server prefix and show
36
+ * just the tool ("list organizations"). Names without the `__` boundary (plain
37
+ * built-ins like "session_create") are unaffected.
38
+ */
@@ -0,0 +1,40 @@
1
+ import type { ComponentType } from "react";
2
+ import type { ToolCallItem } from "./types";
3
+ export type ToolRendererProps = {
4
+ item: ToolCallItem;
5
+ };
6
+ export type ToolRenderer = ComponentType<ToolRendererProps>;
7
+ /** A registry entry: which key it matches and the component that renders it. */
8
+ export type ToolRegistryEntry = {
9
+ match: "rawType";
10
+ type: string;
11
+ render: ToolRenderer;
12
+ } | {
13
+ match: "name";
14
+ name: string;
15
+ render: ToolRenderer;
16
+ };
17
+ export type ToolRegistry = {
18
+ /** Resolve the renderer for a call (never null — falls back to generic). */
19
+ resolve: (item: ToolCallItem) => ToolRenderer;
20
+ /** The generic fallback renderer. */
21
+ fallback: ToolRenderer;
22
+ };
23
+ export type CreateToolRegistryOptions = {
24
+ /**
25
+ * Entries that take precedence over the built-ins. Earlier entries win, so a
26
+ * consumer can shadow a default renderer for the same key.
27
+ */
28
+ entries?: ToolRegistryEntry[] | undefined;
29
+ /** Replace the generic fallback used for unmatched tools. */
30
+ fallback?: ToolRenderer | undefined;
31
+ };
32
+ /** The `raw.type` of a projected tool call, when the provider item carries one. */
33
+ export declare function rawTypeOf(item: ToolCallItem): string | null;
34
+ /**
35
+ * Build a tool registry from a set of entries and a fallback. The returned
36
+ * registry resolves in priority order: `raw.type` entries first, then `name`
37
+ * entries, then the fallback. Consumer `entries` are consulted before the
38
+ * built-in `baseEntries`, so they shadow defaults cleanly.
39
+ */
40
+ export declare function createToolRegistry(baseEntries: ToolRegistryEntry[], baseFallback: ToolRenderer, options?: CreateToolRegistryOptions): ToolRegistry;
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ type LightboxController = {
3
+ open: (src: string, caption?: string) => void;
4
+ };
5
+ /** Open the app-level screenshot lightbox. No-op outside a `LightboxProvider`. */
6
+ export declare function useLightbox(): LightboxController;
7
+ /**
8
+ * The lightbox controller when one is mounted, or `null` outside a
9
+ * `LightboxProvider`. Lets a media primitive degrade to a non-interactive image
10
+ * (rather than a dead "Expand" button that announces an action it cannot do).
11
+ */
12
+ export declare function useLightboxOptional(): LightboxController | null;
13
+ /**
14
+ * The app-level screenshot lightbox. Render once near the timeline; renderers
15
+ * call `useLightbox().open(src)`.
16
+ *
17
+ * Idempotent by design: when an ancestor `LightboxProvider` already exists (e.g.
18
+ * a `MessageTimeline` mounted inside an app that already wraps its shell), this
19
+ * one becomes a pass-through and does NOT mount a second focus-trapping Dialog.
20
+ * That keeps `MessageTimeline` self-sufficient (it owns its own provider) while
21
+ * composing cleanly when nested.
22
+ */
23
+ export declare function LightboxProvider({ children }: {
24
+ children: ReactNode;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const SeenActivityIdsProvider: import("react").Provider<Set<string> | null>;
2
+ export declare function useSeenActivityIds(): Set<string> | null;
@@ -0,0 +1,125 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * A subtle settle signal — see the CHIP DOCTRINE above. The closed tone set.
4
+ * `"interrupted"` is a calm neutral tone for cancelled items — no dot, same
5
+ * quiet weight as `"muted"`, but semantically distinct from metadata.
6
+ */
7
+ export type DisclosureChip = {
8
+ tone: "ok" | "bad" | "muted" | "interrupted";
9
+ text: string;
10
+ };
11
+ export type ActivityDisclosureProps = {
12
+ icon: ReactNode;
13
+ /** Icon tint. Defaults to the muted foreground; renderers pass accent/failed. */
14
+ iconTone?: "accent" | "failed" | "running" | "muted" | undefined;
15
+ title: ReactNode;
16
+ /** Render the title in the mono face (commands, paths). */
17
+ titleMono?: boolean | undefined;
18
+ /** Shimmer the title while the tool is in-flight. */
19
+ running?: boolean | undefined;
20
+ /**
21
+ * Quiet single-line secondary text (truncated). It is detail-on-demand: hidden
22
+ * when a media preview is set, AND hidden once the row is expanded (the body
23
+ * then owns the detail), so a stat/path never appears twice at once.
24
+ */
25
+ preview?: ReactNode | undefined;
26
+ /** A small inline media preview (a screenshot thumbnail) shown in place of `preview`. */
27
+ media?: ReactNode | undefined;
28
+ /** At most one quiet settle chip, right-aligned to the gutter. */
29
+ chip?: DisclosureChip | undefined;
30
+ /**
31
+ * When true the row carries the standard failure affordance: the icon is tinted
32
+ * red and a "failed" bad-chip appears in the right gutter (unless an explicit
33
+ * `chip` is already supplied — the caller's chip wins). Output is still visible
34
+ * on expand; this is a quiet status signal, not a blocking banner.
35
+ *
36
+ * Renderers should pass `failed={item.status === "failed"}` on their settled
37
+ * (non-running) paths so any tool with a failed status shows a consistent
38
+ * affordance without each renderer having to duplicate the logic.
39
+ */
40
+ failed?: boolean | undefined;
41
+ /**
42
+ * When true the row carries a calm "interrupted" affordance: the icon stays
43
+ * muted (no red) and a quiet "interrupted" chip appears in the right gutter
44
+ * (unless an explicit `chip` is already supplied — the caller's chip wins).
45
+ * This is the cancelled-status analogue of `failed`, but deliberately calm
46
+ * and neutral — it is NOT an error; the user chose to stop.
47
+ *
48
+ * Renderers should pass `cancelled={item.status === "cancelled"}` so any
49
+ * in-flight item that was interrupted on turn.cancelled reads consistently.
50
+ * `cancelled` is ignored when `failed` is also true (failure takes precedence).
51
+ */
52
+ cancelled?: boolean | undefined;
53
+ /** When false the row is a static line (no expand affordance). */
54
+ expandable?: boolean | undefined;
55
+ children?: ReactNode | undefined;
56
+ };
57
+ /**
58
+ * The one disclosure row shape every activity row reuses (tool calls, reasoning,
59
+ * sandbox ops): a chevron, a tinted icon, a title, an optional muted preview or
60
+ * inline media, and at most one right-gutter settle chip. Compact by default;
61
+ * the body mounts only when expanded.
62
+ */
63
+ export declare function ActivityDisclosure({ icon, iconTone: iconToneProp, title, titleMono, running, preview, media, chip: chipProp, failed, cancelled, expandable, children, }: ActivityDisclosureProps): import("react/jsx-runtime").JSX.Element;
64
+ export declare function TermBlock({ command, workdir, output, live, tailLines, failed, }: {
65
+ /**
66
+ * The command shown in the prompt header. Pass `null` when the row title
67
+ * already carries it (e.g. an exec row titled `$ cmd`): the header then drops
68
+ * the command — and the whole prompt line if there is no workdir either — so
69
+ * the command never reads twice, stacked, above the output.
70
+ */
71
+ command: string | null;
72
+ workdir?: string | null | undefined;
73
+ /** The FULL output. TermBlock owns the tail/full slicing internally. */
74
+ output: string;
75
+ live?: boolean | undefined;
76
+ /** A non-zero exit / failed call — tints the left accent red (the one hue). */
77
+ failed?: boolean | undefined;
78
+ /**
79
+ * When the output exceeds the tail window, only the last `tailLines` are shown
80
+ * with a "show full output" toggle. The component holds the full text, so the
81
+ * toggle reveals the rest (never a dead affordance). Defaults to 12.
82
+ */
83
+ tailLines?: number | undefined;
84
+ }): import("react/jsx-runtime").JSX.Element;
85
+ export declare function PayloadBlock({ label, value, failed, }: {
86
+ label: string;
87
+ value: unknown;
88
+ failed?: boolean | undefined;
89
+ }): import("react/jsx-runtime").JSX.Element | null;
90
+ /** A quiet inline note inside an expanded body (lost output, empty frame, …). */
91
+ export declare function BodyNote({ children, tone, }: {
92
+ children: ReactNode;
93
+ tone?: "error" | "muted" | undefined;
94
+ }): import("react/jsx-runtime").JSX.Element;
95
+ /**
96
+ * A loading screenshot placeholder. A faint camera glyph over a shimmering box,
97
+ * so a still frame of the running state reads unambiguously as "capturing" — not
98
+ * a broken thumbnail.
99
+ */
100
+ export declare function MediaSkeleton(): import("react/jsx-runtime").JSX.Element;
101
+ /** A standardized "tool ran, produced no image" placeholder in the media slot. */
102
+ export declare function MediaEmpty(): import("react/jsx-runtime").JSX.Element;
103
+ /**
104
+ * A small inline screenshot thumbnail that opens the app lightbox on click.
105
+ *
106
+ * Requires a `LightboxProvider` ancestor for the click-to-expand affordance.
107
+ * Outside one it degrades to a plain, non-interactive image — never a dead
108
+ * "Expand" button that announces an action it cannot perform.
109
+ */
110
+ export declare function Thumbnail({ src, caption, alt, }: {
111
+ src: string;
112
+ caption?: string | undefined;
113
+ alt?: string;
114
+ }): import("react/jsx-runtime").JSX.Element;
115
+ /**
116
+ * The expanded screenshot inside a tool body: a contained, clickable preview
117
+ * (opens the lightbox) with a quiet caption. Constrained height + object-contain
118
+ * so it never breaks the row layout. Like {@link Thumbnail}, it degrades to a
119
+ * plain image outside a `LightboxProvider`.
120
+ */
121
+ export declare function ScreenshotFigure({ src, caption, alt, }: {
122
+ src: string;
123
+ caption?: string | undefined;
124
+ alt?: string;
125
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { GitFileDiff } from "@opengeni/sdk";
2
+ export declare function ToolDiff({ files }: {
3
+ files: GitFileDiff[];
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ /** Raw-patch fallback for a V4A hunk string the parser could not structure. */
6
+ export declare function RawPatch({ diff }: {
7
+ diff: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Readable label for a tool call ("session_create" -> "session create").
3
+ *
4
+ * MCP tools are namespaced `<serverId>__<toolName>` (see prefixedMcpToolName),
5
+ * and for catalog-imported servers that serverId is an opaque slug+hash.
6
+ * De-slugging the whole thing leaked that id into the timeline; strip the
7
+ * server prefix and show just the tool. Names without the `__` boundary (plain
8
+ * built-ins like "session_create") are unaffected.
9
+ */
10
+ export declare function toolDisplayName(name: string): string;
@@ -0,0 +1,5 @@
1
+ import { createToolRegistry, type ToolRegistry } from "./registry";
2
+ /** The built-in tool renderer registry: every first-party tool plus a fallback. */
3
+ export declare const defaultToolRegistry: ToolRegistry;
4
+ /** Build a registry that extends the built-ins with consumer entries/fallback. */
5
+ export declare function createDefaultToolRegistry(options?: Parameters<typeof createToolRegistry>[2]): ToolRegistry;
@@ -0,0 +1,116 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ActivityItem, ToolCallItem, TurnOutcome } from "./types";
3
+ export type { TurnOutcome } from "./types";
4
+ /**
5
+ * True while settle chrome is active (open beat, slow collapse, or the short
6
+ * cancel-close latch). Nested cluster chips stay mounted and forced OPEN for
7
+ * this window so the body keeps a stable height — never flat-map to bare
8
+ * rails, and never remount closed nested chips mid-collapse (that yanked).
9
+ */
10
+ export declare function useTurnSettleOpen(): boolean;
11
+ export declare const BUILT_IN_TURN_SUMMARY_FACET_IDS: readonly ["steps", "files", "commands", "screenshots", "memories", "compacted", "duration"];
12
+ export type BuiltInTurnSummaryFacetId = (typeof BUILT_IN_TURN_SUMMARY_FACET_IDS)[number];
13
+ export type TurnSummaryContext = Readonly<{
14
+ /** Every normalized activity item folded into this summary. */
15
+ items: readonly ActivityItem[];
16
+ /** Tool calls from `items`, retained in timeline order for convenient aggregation. */
17
+ toolCalls: readonly ToolCallItem[];
18
+ /** The settled turn verdict, or absent for a neutral/incomplete cluster. */
19
+ outcome: TurnOutcome | undefined;
20
+ /** The bounded failure reason rendered by the enclosing summary, when present. */
21
+ failureText: string | undefined;
22
+ /** Total turn duration when the enclosing group has both valid timestamps. */
23
+ durationMs: number | undefined;
24
+ /** False when any projected activity is still running or streaming. */
25
+ settled: boolean;
26
+ /**
27
+ * Adjacent compaction landmarks next to this fold. Landmark remains the
28
+ * primary UI; this is a secondary chip signal only.
29
+ */
30
+ contextCompactionCount: number;
31
+ }>;
32
+ export type TurnSummaryFacetResult = Readonly<{
33
+ icon?: ReactNode;
34
+ content: ReactNode;
35
+ ariaLabel?: string;
36
+ title?: string;
37
+ }>;
38
+ export type TurnSummaryFacet = Readonly<{
39
+ /** Stable identity used for removal and deterministic de-duplication. */
40
+ id: string;
41
+ /** Return null when this facet has nothing useful to show. */
42
+ summarize(context: TurnSummaryContext): TurnSummaryFacetResult | null;
43
+ }>;
44
+ type ModifyTurnSummaryFacets = Readonly<{
45
+ /** Appended after the remaining built-ins, in supplied order. */
46
+ add?: readonly TurnSummaryFacet[];
47
+ /** Built-ins to omit before custom facets are appended. */
48
+ remove?: readonly BuiltInTurnSummaryFacetId[];
49
+ replace?: never;
50
+ }>;
51
+ type ReplaceTurnSummaryFacets = Readonly<{
52
+ /** The complete ordered facet list. Mutually exclusive with add/remove. */
53
+ replace: readonly TurnSummaryFacet[];
54
+ add?: never;
55
+ remove?: never;
56
+ }>;
57
+ export type TurnSummaryFacetConfiguration = ModifyTurnSummaryFacets | ReplaceTurnSummaryFacets;
58
+ export type TurnSummaryOptions = Readonly<{
59
+ facets?: TurnSummaryFacetConfiguration;
60
+ }>;
61
+ export type TurnSummaryProps = {
62
+ /** The activity items in the turn (used only to compute the facet counts). */
63
+ items: ActivityItem[];
64
+ /**
65
+ * The settled verdict — or absent for a completed CLUSTER of a still-running
66
+ * turn, which folds neutrally: no verdict glyph (the turn has none yet), a
67
+ * quiet pulse dot in its place so alignment and the running feel both hold.
68
+ */
69
+ outcome?: TurnOutcome | undefined;
70
+ /** A short failure reason shown inline on a failed chip (never hidden). */
71
+ failureText?: string | undefined;
72
+ /** Elapsed turn duration; shown as a trailing facet when at least 1s. */
73
+ durationMs?: number | undefined;
74
+ /** Start expanded. */
75
+ defaultOpen?: boolean | undefined;
76
+ /**
77
+ * A nested fold — a cluster or sub-turn INSIDE an already-expanded turn. It
78
+ * drops the bordered/filled chip and renders as a plain disclosure node on the
79
+ * parent's rail (chevron + glyph + facets), so expanding a turn reveals a thread
80
+ * of nodes, never a stack of boxes-in-boxes. The top-level fold stays a chip.
81
+ */
82
+ bare?: boolean | undefined;
83
+ /** Per-instance facet customization. Omit to preserve the built-in summary exactly. */
84
+ facets?: TurnSummaryFacetConfiguration | undefined;
85
+ /**
86
+ * Settle choreography: this fold replaced rows the reader was just watching
87
+ * live. Instead of yanking them behind a chip in one frame, the fold mounts
88
+ * OPEN with the summary chip easing in above the still-visible rows, holds a
89
+ * short beat so the reader registers the settle, then glides closed. Any
90
+ * user interaction during the beat cancels the auto-collapse. Captured at
91
+ * mount; ignored when the fold starts expanded (e.g. a failed turn).
92
+ */
93
+ settleFold?: boolean | undefined;
94
+ /**
95
+ * Durable identity (timeline group id) for cross-remount fold memory. When
96
+ * an ancestor provides a {@link FoldMemoryProvider} map, reaching a resting
97
+ * state is recorded under this key: "closed" when the settle choreography
98
+ * completes its collapse or the reader closes the chip, "open" when the
99
+ * reader expands it. A later remount under the same key restores that
100
+ * resting state and never replays the open settle beat — the activity→turn
101
+ * wrap and the nested force-open during settle chrome must not re-expand a
102
+ * fold that already settled closed.
103
+ */
104
+ foldKey?: string | undefined;
105
+ /**
106
+ * When set, a hover/focus copy control sits on the chip row (outside the
107
+ * disclosure trigger) so the reader can copy the turn's assistant prose
108
+ * without toggling the fold.
109
+ */
110
+ copyText?: string | undefined;
111
+ /** Adjacent compaction landmark count for the secondary chip facet. */
112
+ contextCompactionCount?: number | undefined;
113
+ /** The rendered activity rail revealed on expand. */
114
+ children: ReactNode;
115
+ };
116
+ export declare function TurnSummary({ items, outcome, failureText, durationMs, defaultOpen, bare, facets: facetConfiguration, settleFold, foldKey, copyText, contextCompactionCount, children, }: TurnSummaryProps): import("react/jsx-runtime").JSX.Element;