@opengeni/react 0.48.0 → 0.52.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 (284) hide show
  1. package/README.md +90 -2
  2. package/dist/artifacts-document.d.ts +3 -0
  3. package/dist/artifacts-document.js +17 -0
  4. package/dist/artifacts-document.js.map +1 -0
  5. package/dist/artifacts-presentation.d.ts +3 -0
  6. package/dist/artifacts-presentation.js +17 -0
  7. package/dist/artifacts-presentation.js.map +1 -0
  8. package/dist/artifacts-spreadsheet.d.ts +3 -0
  9. package/dist/artifacts-spreadsheet.js +17 -0
  10. package/dist/artifacts-spreadsheet.js.map +1 -0
  11. package/dist/artifacts.d.ts +2 -0
  12. package/dist/artifacts.js +170 -0
  13. package/dist/artifacts.js.map +1 -0
  14. package/dist/chunk-6BBWWOOU.js +82 -0
  15. package/dist/chunk-6BBWWOOU.js.map +1 -0
  16. package/dist/{chunk-FWXGSNXT.js → chunk-724BW4TW.js} +585 -34
  17. package/dist/chunk-724BW4TW.js.map +1 -0
  18. package/dist/chunk-7I2KB3OK.js +3895 -0
  19. package/dist/chunk-7I2KB3OK.js.map +1 -0
  20. package/dist/chunk-7WCLAEFV.js +2828 -0
  21. package/dist/chunk-7WCLAEFV.js.map +1 -0
  22. package/dist/{chunk-I4MPFDRP.js → chunk-FWS3KC3Z.js} +3 -3
  23. package/dist/{chunk-EKZH6IDG.js → chunk-HDBG7XGO.js} +62 -1
  24. package/dist/chunk-HDBG7XGO.js.map +1 -0
  25. package/dist/chunk-HUIKIDM5.js +2148 -0
  26. package/dist/chunk-HUIKIDM5.js.map +1 -0
  27. package/dist/{chunk-XCNTXWBB.js → chunk-JAGDUCZQ.js} +854 -340
  28. package/dist/chunk-JAGDUCZQ.js.map +1 -0
  29. package/dist/{chunk-LHLYWG5R.js → chunk-JR3QFY6B.js} +413 -37
  30. package/dist/chunk-JR3QFY6B.js.map +1 -0
  31. package/dist/chunk-JVYQRRC4.js +53 -0
  32. package/dist/chunk-JVYQRRC4.js.map +1 -0
  33. package/dist/chunk-KCGXPP5V.js +157 -0
  34. package/dist/chunk-KCGXPP5V.js.map +1 -0
  35. package/dist/chunk-PEI6RANI.js +3234 -0
  36. package/dist/chunk-PEI6RANI.js.map +1 -0
  37. package/dist/{chunk-NJ7M2B6Z.js → chunk-ROIRTM37.js} +18 -10
  38. package/dist/{chunk-NJ7M2B6Z.js.map → chunk-ROIRTM37.js.map} +1 -1
  39. package/dist/{chunk-O4VXOBGF.js → chunk-WSK7G5LE.js} +70 -2
  40. package/dist/chunk-WSK7G5LE.js.map +1 -0
  41. package/dist/{chunk-OL6QVXGF.js → chunk-X4S56Y2H.js} +27 -7
  42. package/dist/{chunk-OL6QVXGF.js.map → chunk-X4S56Y2H.js.map} +1 -1
  43. package/dist/client.d.ts +7 -1
  44. package/dist/clipboard.d.ts +1 -0
  45. package/dist/clipboard.js +7 -0
  46. package/dist/clipboard.js.map +1 -0
  47. package/dist/commands/index.d.ts +3 -3
  48. package/dist/commands/registry.d.ts +1 -1
  49. package/dist/commands/types.d.ts +1 -1
  50. package/dist/components/approval-surface.d.ts +2 -2
  51. package/dist/components/artifacts/artifact-surface.d.ts +18 -0
  52. package/dist/components/artifacts/document-editor.d.ts +172 -0
  53. package/dist/components/artifacts/editable-artifact-ui.d.ts +13 -0
  54. package/dist/components/artifacts/editable-artifact-workbench.d.ts +49 -0
  55. package/dist/components/artifacts/editable-document.d.ts +24 -0
  56. package/dist/components/artifacts/editable-presentation.d.ts +24 -0
  57. package/dist/components/artifacts/editable-spreadsheet.d.ts +32 -0
  58. package/dist/components/artifacts/index.d.ts +8 -0
  59. package/dist/components/artifacts/presentation-editor.d.ts +297 -0
  60. package/dist/components/artifacts/spreadsheet-canvas.d.ts +120 -0
  61. package/dist/components/artifacts/spreadsheet-grid.d.ts +113 -0
  62. package/dist/components/browser-viewer.d.ts +29 -0
  63. package/dist/components/chat-composer.d.ts +8 -8
  64. package/dist/components/code-editor.d.ts +25 -3
  65. package/dist/components/command-palette.d.ts +2 -2
  66. package/dist/components/composer-transcription-control.d.ts +2 -2
  67. package/dist/components/composer.d.ts +17 -17
  68. package/dist/components/computer-viewer.d.ts +23 -0
  69. package/dist/components/copy-button.d.ts +2 -2
  70. package/dist/components/desktop-viewer.d.ts +25 -21
  71. package/dist/components/diff-view.d.ts +1 -1
  72. package/dist/components/enrollment-consent.d.ts +1 -1
  73. package/dist/components/enrollment-device-flow.d.ts +1 -1
  74. package/dist/components/file-browser.d.ts +2 -2
  75. package/dist/components/fleet-tile.d.ts +1 -1
  76. package/dist/components/generated-video-player.d.ts +10 -0
  77. package/dist/components/human-input-form.d.ts +1 -1
  78. package/dist/components/human-input-surface.d.ts +2 -2
  79. package/dist/components/interactive-workbench-viewers.d.ts +2 -0
  80. package/dist/components/machine-card.d.ts +2 -2
  81. package/dist/components/machine-dock-bar.d.ts +3 -3
  82. package/dist/components/machine-health-pill.d.ts +2 -2
  83. package/dist/components/machine-input-display.d.ts +1 -1
  84. package/dist/components/machine-metrics.d.ts +2 -2
  85. package/dist/components/machine-status-pill.d.ts +4 -4
  86. package/dist/components/machines/health.d.ts +1 -1
  87. package/dist/components/machines/machine-detail.d.ts +3 -3
  88. package/dist/components/machines/metric-history-chart.d.ts +1 -1
  89. package/dist/components/machines/metric-sparkline.d.ts +2 -2
  90. package/dist/components/machines/series.d.ts +2 -2
  91. package/dist/components/machines-dashboard.d.ts +2 -2
  92. package/dist/components/markdown.d.ts +1 -1
  93. package/dist/components/message-timeline.d.ts +12 -5
  94. package/dist/components/model-picker.d.ts +2 -2
  95. package/dist/components/model-policy-picker.d.ts +7 -7
  96. package/dist/components/pierre-diff.d.ts +1 -1
  97. package/dist/components/pierre-file.d.ts +1 -1
  98. package/dist/components/queue-draft-policy.d.ts +1 -1
  99. package/dist/components/queue-surface-implementation.d.ts +3 -3
  100. package/dist/components/queue-surface-state.d.ts +4 -4
  101. package/dist/components/queue-surface.d.ts +5 -5
  102. package/dist/components/sandbox-files.d.ts +3 -3
  103. package/dist/components/sandbox-terminal.d.ts +21 -4
  104. package/dist/components/sandbox-workspace.d.ts +25 -9
  105. package/dist/components/session-chrome.d.ts +4 -4
  106. package/dist/components/session-status.d.ts +2 -2
  107. package/dist/components/timeline-annotation-selection.d.ts +9 -0
  108. package/dist/components/timeline-annotations-dialog.d.ts +16 -0
  109. package/dist/components/timeline-annotations.d.ts +13 -0
  110. package/dist/components/tooltip.d.ts +4 -4
  111. package/dist/components/user-message-body.d.ts +2 -2
  112. package/dist/components/workbench-changes.d.ts +2 -2
  113. package/dist/components/workspace-dock.d.ts +1 -1
  114. package/dist/composer.d.ts +11 -11
  115. package/dist/composer.js +5 -5
  116. package/dist/hooks/internal.d.ts +1 -1
  117. package/dist/hooks/use-attached-browsers.d.ts +21 -0
  118. package/dist/hooks/use-available-models.d.ts +2 -2
  119. package/dist/hooks/use-billing-usage.d.ts +1 -1
  120. package/dist/hooks/use-browser-frame-stream.d.ts +28 -0
  121. package/dist/hooks/use-browser-identities.d.ts +26 -0
  122. package/dist/hooks/use-browser-session.d.ts +28 -0
  123. package/dist/hooks/use-browser-sessions.d.ts +32 -0
  124. package/dist/hooks/use-codex-accounts.d.ts +2 -2
  125. package/dist/hooks/use-composer.d.ts +36 -9
  126. package/dist/hooks/use-computer-frame-stream.d.ts +24 -0
  127. package/dist/hooks/use-computer-session.d.ts +28 -0
  128. package/dist/hooks/use-computer-sessions.d.ts +28 -0
  129. package/dist/hooks/use-desktop-stream.d.ts +1 -1
  130. package/dist/hooks/use-environments.d.ts +1 -1
  131. package/dist/hooks/use-file-attachments.d.ts +1 -1
  132. package/dist/hooks/use-goal.d.ts +2 -2
  133. package/dist/hooks/use-human-input.d.ts +2 -2
  134. package/dist/hooks/use-last-started-turn-policy.d.ts +2 -2
  135. package/dist/hooks/use-machine-chip.d.ts +2 -2
  136. package/dist/hooks/use-machines.d.ts +4 -4
  137. package/dist/hooks/use-packs.d.ts +7 -2
  138. package/dist/hooks/use-rigs.d.ts +1 -1
  139. package/dist/hooks/use-sandbox-files.d.ts +6 -4
  140. package/dist/hooks/use-sandbox-git.d.ts +6 -5
  141. package/dist/hooks/use-sandbox-terminal.d.ts +1 -1
  142. package/dist/hooks/use-scheduled-tasks.d.ts +1 -1
  143. package/dist/hooks/use-session-capabilities.d.ts +5 -4
  144. package/dist/hooks/use-session-control.d.ts +1 -1
  145. package/dist/hooks/use-session-events.d.ts +2 -2
  146. package/dist/hooks/use-session-lineage.d.ts +1 -1
  147. package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
  148. package/dist/hooks/use-session.d.ts +2 -2
  149. package/dist/hooks/use-slash-commands.d.ts +1 -1
  150. package/dist/hooks/use-terminal-stream.d.ts +8 -2
  151. package/dist/hooks/use-turn-queue.d.ts +2 -2
  152. package/dist/hooks/use-video-artifact-playback.d.ts +9 -0
  153. package/dist/hooks/use-voice-input.d.ts +1 -1
  154. package/dist/hooks/use-workspace-capture.d.ts +1 -1
  155. package/dist/hooks/use-workspace-edit.d.ts +1 -1
  156. package/dist/hooks/use-workspace-sessions.d.ts +1 -1
  157. package/dist/hooks/use-workspaces.d.ts +1 -1
  158. package/dist/index.d.ts +158 -155
  159. package/dist/index.js +906 -462
  160. package/dist/index.js.map +1 -1
  161. package/dist/interaction.d.ts +23 -0
  162. package/dist/interaction.js +36 -0
  163. package/dist/interaction.js.map +1 -0
  164. package/dist/interactive-workbench-viewers-KHNOHWQE.js +13 -0
  165. package/dist/interactive-workbench-viewers-KHNOHWQE.js.map +1 -0
  166. package/dist/lib/relay-wire.d.ts +4 -0
  167. package/dist/lib/sandbox-liveness.d.ts +9 -0
  168. package/dist/lib/terminal-capability.d.ts +5 -0
  169. package/dist/lib/xterm-theme.d.ts +1 -1
  170. package/dist/machines.d.ts +30 -30
  171. package/dist/machines.js +3 -3
  172. package/dist/provider.d.ts +4 -4
  173. package/dist/{queue-surface-implementation-U5JFG7HT.js → queue-surface-implementation-2KVJTYXH.js} +100 -48
  174. package/dist/queue-surface-implementation-2KVJTYXH.js.map +1 -0
  175. package/dist/realtime/dropdown-menu.d.ts +8 -8
  176. package/dist/realtime/realtime-control.d.ts +6 -6
  177. package/dist/realtime.d.ts +4 -4
  178. package/dist/realtime.js +3 -3
  179. package/dist/session-context.d.ts +19 -1
  180. package/dist/session-ui.d.ts +14 -14
  181. package/dist/session-ui.js +5 -4
  182. package/dist/session.d.ts +28 -28
  183. package/dist/session.js +5 -5
  184. package/dist/timeline/activity-rail.d.ts +5 -3
  185. package/dist/timeline/disclosure-context.d.ts +1 -1
  186. package/dist/timeline/fleet-decision-projection.d.ts +1 -1
  187. package/dist/timeline/fleet-decision-row.d.ts +3 -3
  188. package/dist/timeline/index.d.ts +19 -19
  189. package/dist/timeline/parsers.d.ts +4 -1
  190. package/dist/timeline/projection.d.ts +3 -3
  191. package/dist/timeline/registry.d.ts +8 -2
  192. package/dist/timeline/screenshot-lightbox.d.ts +2 -2
  193. package/dist/timeline/shared.d.ts +21 -10
  194. package/dist/timeline/tool-diff.d.ts +2 -2
  195. package/dist/timeline/tool-renderers.d.ts +1 -1
  196. package/dist/timeline/turn-summary.d.ts +3 -3
  197. package/dist/timeline/types.d.ts +39 -3
  198. package/dist/timeline-annotation-selection-3L7LHGG2.js +187 -0
  199. package/dist/timeline-annotation-selection-3L7LHGG2.js.map +1 -0
  200. package/dist/timeline-annotations-dialog-U7EVLR75.js +196 -0
  201. package/dist/timeline-annotations-dialog-U7EVLR75.js.map +1 -0
  202. package/package.json +36 -7
  203. package/src/artifacts-document.ts +31 -0
  204. package/src/artifacts-presentation.ts +36 -0
  205. package/src/artifacts-spreadsheet.ts +21 -0
  206. package/src/artifacts.ts +86 -0
  207. package/src/client.ts +87 -1
  208. package/src/clipboard.ts +2 -0
  209. package/src/components/artifacts/artifact-surface.tsx +93 -0
  210. package/src/components/artifacts/document-editor.tsx +2255 -0
  211. package/src/components/artifacts/editable-artifact-ui.tsx +89 -0
  212. package/src/components/artifacts/editable-artifact-workbench.tsx +203 -0
  213. package/src/components/artifacts/editable-document.tsx +657 -0
  214. package/src/components/artifacts/editable-presentation.tsx +1020 -0
  215. package/src/components/artifacts/editable-spreadsheet.tsx +733 -0
  216. package/src/components/artifacts/index.ts +99 -0
  217. package/src/components/artifacts/presentation-editor.tsx +3148 -0
  218. package/src/components/artifacts/spreadsheet-canvas.ts +799 -0
  219. package/src/components/artifacts/spreadsheet-grid.tsx +2129 -0
  220. package/src/components/browser-viewer.tsx +1592 -0
  221. package/src/components/chat-composer.tsx +13 -0
  222. package/src/components/code-editor.tsx +89 -30
  223. package/src/components/composer-transcription-control.tsx +10 -6
  224. package/src/components/computer-viewer.tsx +1139 -0
  225. package/src/components/desktop-viewer.tsx +101 -73
  226. package/src/components/generated-video-player.tsx +89 -0
  227. package/src/components/interactive-workbench-viewers.ts +2 -0
  228. package/src/components/machine-input-display.ts +3 -0
  229. package/src/components/message-timeline.tsx +289 -32
  230. package/src/components/queue-surface-implementation.tsx +116 -60
  231. package/src/components/sandbox-files.tsx +2 -2
  232. package/src/components/sandbox-terminal.tsx +106 -41
  233. package/src/components/sandbox-workspace.tsx +215 -87
  234. package/src/components/session-chrome.tsx +53 -13
  235. package/src/components/timeline-annotation-selection.tsx +221 -0
  236. package/src/components/timeline-annotations-dialog.tsx +213 -0
  237. package/src/components/timeline-annotations.tsx +84 -0
  238. package/src/components/workbench-changes.tsx +188 -31
  239. package/src/hooks/use-attached-browsers.ts +152 -0
  240. package/src/hooks/use-browser-frame-stream.ts +316 -0
  241. package/src/hooks/use-browser-identities.ts +225 -0
  242. package/src/hooks/use-browser-session.ts +476 -0
  243. package/src/hooks/use-browser-sessions.ts +281 -0
  244. package/src/hooks/use-composer.ts +769 -24
  245. package/src/hooks/use-computer-frame-stream.ts +311 -0
  246. package/src/hooks/use-computer-session.ts +442 -0
  247. package/src/hooks/use-computer-sessions.ts +245 -0
  248. package/src/hooks/use-machine-chip.ts +5 -3
  249. package/src/hooks/use-machines.ts +33 -3
  250. package/src/hooks/use-packs.ts +51 -0
  251. package/src/hooks/use-sandbox-files.ts +98 -55
  252. package/src/hooks/use-sandbox-git.ts +93 -38
  253. package/src/hooks/use-sandbox-terminal.ts +3 -2
  254. package/src/hooks/use-session-capabilities.ts +59 -46
  255. package/src/hooks/use-terminal-stream.ts +102 -23
  256. package/src/hooks/use-video-artifact-playback.ts +28 -0
  257. package/src/hooks/use-workspace-edit.ts +2 -1
  258. package/src/index.ts +10 -0
  259. package/src/interaction.ts +71 -0
  260. package/src/lib/relay-wire.ts +4 -0
  261. package/src/lib/sandbox-liveness.ts +11 -0
  262. package/src/lib/terminal-capability.ts +10 -0
  263. package/src/session-context.ts +90 -0
  264. package/src/timeline/activity-rail.tsx +19 -3
  265. package/src/timeline/index.ts +3 -0
  266. package/src/timeline/parsers.ts +14 -1
  267. package/src/timeline/projection.ts +211 -14
  268. package/src/timeline/registry.ts +13 -1
  269. package/src/timeline/screenshot-lightbox.tsx +19 -9
  270. package/src/timeline/shared.tsx +56 -8
  271. package/src/timeline/tool-renderers.tsx +303 -50
  272. package/src/timeline/types.ts +55 -3
  273. package/styles/compiled.css +248 -15
  274. package/styles/index.css +15 -0
  275. package/styles/responsive.css +13 -1
  276. package/dist/chunk-EKZH6IDG.js.map +0 -1
  277. package/dist/chunk-FWXGSNXT.js.map +0 -1
  278. package/dist/chunk-LHLYWG5R.js.map +0 -1
  279. package/dist/chunk-O4VXOBGF.js.map +0 -1
  280. package/dist/chunk-XCNTXWBB.js.map +0 -1
  281. package/dist/fleet-decision-projection-SLNZMS42.js +0 -241
  282. package/dist/fleet-decision-projection-SLNZMS42.js.map +0 -1
  283. package/dist/queue-surface-implementation-U5JFG7HT.js.map +0 -1
  284. /package/dist/{chunk-I4MPFDRP.js.map → chunk-FWS3KC3Z.js.map} +0 -0
@@ -1,19 +1,23 @@
1
+ import {
2
+ Tooltip,
3
+ TooltipContent,
4
+ TooltipProvider,
5
+ TooltipTrigger
6
+ } from "./chunk-FK6VG4LL.js";
1
7
  import {
2
8
  EmptyQueueStateSurface,
9
+ TimelineAnnotationsChip,
3
10
  requestQueueDraftEdit
4
- } from "./chunk-O4VXOBGF.js";
11
+ } from "./chunk-WSK7G5LE.js";
12
+ import {
13
+ usePortalTokenStyle
14
+ } from "./chunk-VZTQ73XT.js";
5
15
  import {
6
16
  buildTimeline,
7
17
  groupTimeline,
8
18
  mcpToolLeaf,
9
19
  toolDisplayName
10
- } from "./chunk-LHLYWG5R.js";
11
- import {
12
- Tooltip,
13
- TooltipContent,
14
- TooltipProvider,
15
- TooltipTrigger
16
- } from "./chunk-FK6VG4LL.js";
20
+ } from "./chunk-JR3QFY6B.js";
17
21
  import {
18
22
  formatClockTime,
19
23
  formatRelativeTime,
@@ -21,18 +25,19 @@ import {
21
25
  truncate,
22
26
  tryParseJson
23
27
  } from "./chunk-LAKLF4PA.js";
24
- import {
25
- usePortalTokenStyle
26
- } from "./chunk-VZTQ73XT.js";
27
28
  import {
28
29
  cn
29
30
  } from "./chunk-22KP6LR5.js";
31
+ import {
32
+ copyTextToClipboard,
33
+ tableElementToTsv
34
+ } from "./chunk-JVYQRRC4.js";
30
35
 
31
36
  // src/components/queue-surface.tsx
32
37
  import { Loader2Icon } from "lucide-react";
33
38
  import { lazy, Suspense } from "react";
34
39
  import { jsx, jsxs } from "react/jsx-runtime";
35
- var loadQueueSurface = () => import("./queue-surface-implementation-U5JFG7HT.js");
40
+ var loadQueueSurface = () => import("./queue-surface-implementation-2KVJTYXH.js");
36
41
  var QueueSurface = createQueueSurface(loadQueueSurface);
37
42
  function createQueueSurface(loadImplementation) {
38
43
  const LazyQueueSurface = lazy(async () => ({
@@ -224,6 +229,8 @@ function SessionChrome({
224
229
  queuedTurns: currentTurnId ? turns.filter((turn) => turn.id !== currentTurnId) : turns
225
230
  };
226
231
  }, [composerSteering, queue.pendingByTurn, turns]);
232
+ const stoppingKind = composer?.stoppingAttempt ?? (queue.stoppingPreviousAttempt ? queue.effectiveControl?.state === "paused" ? "current" : "previous" : null);
233
+ const stopping = stoppingKind !== null;
227
234
  const canMutateQueue = !readOnly && composer !== void 0;
228
235
  const liveGoal = record?.status === "active" && record.continuation?.state === "running" && record.continuation.reason === "goal_turn_running";
229
236
  const elapsed = useLiveElapsed(
@@ -246,13 +253,13 @@ function SessionChrome({
246
253
  icon: /* @__PURE__ */ jsx2(InboxIcon, { className: "size-3" })
247
254
  });
248
255
  }
249
- if (steering) {
256
+ if (steering || stopping) {
250
257
  rows.push({
251
258
  id: "steering",
252
- label: "Changing direction\u2026",
253
- detail: steering.text,
254
- tone: "accent",
255
- icon: steering.phase === "submitting" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
259
+ label: stopping ? stoppingKind === "current" ? "Stopping current work\u2026" : "Stopping previous work\u2026" : "Changing direction\u2026",
260
+ ...steering?.text ? { detail: steering.text } : {},
261
+ tone: stopping ? "waiting" : "accent",
262
+ icon: steering?.phase === "submitting" || stopping ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
256
263
  });
257
264
  }
258
265
  if (queuedTurns.length > 0) {
@@ -291,7 +298,17 @@ function SessionChrome({
291
298
  });
292
299
  }
293
300
  return rows;
294
- }, [agentsSignal, elapsed, goalState, incoming, queuedTurns, record, steering]);
301
+ }, [
302
+ agentsSignal,
303
+ elapsed,
304
+ goalState,
305
+ incoming,
306
+ queuedTurns,
307
+ record,
308
+ steering,
309
+ stopping,
310
+ stoppingKind
311
+ ]);
295
312
  const [activeUncontrolled, setActiveUncontrolled] = useState(
296
313
  defaultActive
297
314
  );
@@ -375,7 +392,14 @@ function SessionChrome({
375
392
  const shellDuration = reduceMotion ? 0 : 0.22;
376
393
  const crossfadeDuration = reduceMotion ? 0 : 0.18;
377
394
  const ease = [0.22, 1, 0.36, 1];
378
- const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "steering" && steering ? /* @__PURE__ */ jsx2(SteeringPanel, { phase: steering.phase, text: steering.text }) : active === "queue" ? /* @__PURE__ */ jsx2(
395
+ const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "steering" && (steering || stopping) ? /* @__PURE__ */ jsx2(
396
+ SteeringPanel,
397
+ {
398
+ phase: stopping ? "stopping" : steering?.phase ?? "accepted",
399
+ stoppingKind,
400
+ text: steering?.text
401
+ }
402
+ ) : active === "queue" ? /* @__PURE__ */ jsx2(
379
403
  QueuePanel,
380
404
  {
381
405
  turns: queuedTurns,
@@ -621,7 +645,11 @@ function IncomingPanel({
621
645
  }
622
646
  );
623
647
  }
624
- function SteeringPanel({ phase, text }) {
648
+ function SteeringPanel({
649
+ phase,
650
+ stoppingKind,
651
+ text
652
+ }) {
625
653
  return /* @__PURE__ */ jsxs2(
626
654
  "div",
627
655
  {
@@ -630,10 +658,10 @@ function SteeringPanel({ phase, text }) {
630
658
  "aria-live": "polite",
631
659
  "data-og-session-chrome-panel": "steering",
632
660
  children: [
633
- /* @__PURE__ */ jsx2("span", { className: "mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-og-accent-soft text-og-accent", children: phase === "submitting" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3", "aria-hidden": "true" }) }),
661
+ /* @__PURE__ */ jsx2("span", { className: "mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-og-accent-soft text-og-accent", children: phase === "submitting" || phase === "stopping" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3", "aria-hidden": "true" }) }),
634
662
  /* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
635
- /* @__PURE__ */ jsx2("p", { className: "truncate text-og-xs font-medium leading-4 text-og-fg", children: text }),
636
- /* @__PURE__ */ jsx2("p", { className: "mt-0.5 text-[10px] leading-4 text-og-fg-muted", children: phase === "submitting" ? "Sending your latest direction\u2026" : "Direction accepted. The agent will continue from it." })
663
+ text ? /* @__PURE__ */ jsx2("p", { className: "truncate text-og-xs font-medium leading-4 text-og-fg", children: text }) : null,
664
+ /* @__PURE__ */ jsx2("p", { className: cn(text && "mt-0.5", "text-[10px] leading-4 text-og-fg-muted"), children: phase === "submitting" ? "Sending your latest direction\u2026" : phase === "stopping" ? stoppingKind === "previous" ? "Direction saved. Waiting for the previous command to stop safely." : "Waiting for the current command to stop safely." : "Direction accepted. The agent will continue from it." })
637
665
  ] })
638
666
  ]
639
667
  }
@@ -1520,7 +1548,10 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
1520
1548
  }
1521
1549
 
1522
1550
  // src/timeline/parsers.ts
1523
- import { normalizeMcpOutput } from "@opengeni/sdk";
1551
+ import {
1552
+ normalizeMcpOutput,
1553
+ parseGeneratedImageReceipt
1554
+ } from "@opengeni/sdk";
1524
1555
  function sandboxCommandExitCode(out) {
1525
1556
  const match = String(out ?? "").match(/Process exited with code (-?\d+)/);
1526
1557
  return match ? Number(match[1]) : null;
@@ -1916,6 +1947,9 @@ function retainedScreenshotMetadata(out) {
1916
1947
  }
1917
1948
  return value.kind === "computer_screenshot" && value.contentType === "image/png" && typeof value.originalBytes === "number" && typeof value.sha256 === "string" && value.dimensions !== null && typeof value.dimensions === "object" && value.retention !== null && typeof value.retention === "object" && value.retention.policy === "session_screenshot" ? value : null;
1918
1949
  }
1950
+ function generatedImageReceipt(out) {
1951
+ return parseGeneratedImageReceipt(out);
1952
+ }
1919
1953
  function mediaPreviewFact(out) {
1920
1954
  if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
1921
1955
  const parsed = tryParseJson(out);
@@ -2009,10 +2043,13 @@ function LightboxRoot({ children }) {
2009
2043
  const [state, setState] = useState3(null);
2010
2044
  const [tokenSource, setTokenSource] = useState3(null);
2011
2045
  const portalStyle = usePortalTokenStyle(tokenSource);
2012
- const open = useCallback((src, caption, source) => {
2013
- setTokenSource(source ?? null);
2014
- setState(caption ? { src, caption } : { src });
2015
- }, []);
2046
+ const open = useCallback(
2047
+ (src, caption, source, label = "Screenshot") => {
2048
+ setTokenSource(source ?? null);
2049
+ setState(caption ? { src, caption, label } : { src, label });
2050
+ },
2051
+ []
2052
+ );
2016
2053
  const close = useCallback(() => {
2017
2054
  setState(null);
2018
2055
  setTokenSource(null);
@@ -2037,7 +2074,7 @@ function LightboxRoot({ children }) {
2037
2074
  {
2038
2075
  asChild: true,
2039
2076
  forceMount: true,
2040
- "aria-label": "Screenshot",
2077
+ "aria-label": state.label,
2041
2078
  onOpenAutoFocus: (event) => event.preventDefault(),
2042
2079
  children: /* @__PURE__ */ jsxs4(
2043
2080
  motion2.div,
@@ -2054,14 +2091,15 @@ function LightboxRoot({ children }) {
2054
2091
  className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
2055
2092
  style: portalStyle,
2056
2093
  children: [
2057
- /* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
2094
+ /* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children: state.label }),
2095
+ /* @__PURE__ */ jsx6(Dialog.Description, { className: "sr-only", children: state.caption ?? `Expanded ${state.label.toLowerCase()}` }),
2058
2096
  /* @__PURE__ */ jsxs4("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
2059
2097
  /* @__PURE__ */ jsxs4("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
2060
2098
  /* @__PURE__ */ jsx6(
2061
2099
  "img",
2062
2100
  {
2063
2101
  src: state.src,
2064
- alt: state.caption ?? "Screenshot",
2102
+ alt: state.caption ?? state.label,
2065
2103
  className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
2066
2104
  }
2067
2105
  ),
@@ -2091,8 +2129,15 @@ function LightboxRoot({ children }) {
2091
2129
 
2092
2130
  // src/timeline/shared.tsx
2093
2131
  import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
2094
- import { useState as useState4 } from "react";
2132
+ import { createContext as createContext3, useContext as useContext3, useState as useState4 } from "react";
2095
2133
  import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2134
+ var ToolCallTruncationContext = createContext3(null);
2135
+ function ToolCallTruncationProvider({
2136
+ value,
2137
+ children
2138
+ }) {
2139
+ return /* @__PURE__ */ jsx7(ToolCallTruncationContext.Provider, { value, children });
2140
+ }
2096
2141
  var ICON_TONE = {
2097
2142
  accent: "text-og-accent",
2098
2143
  failed: "text-og-status-failed",
@@ -2111,13 +2156,15 @@ function ActivityDisclosure({
2111
2156
  failed,
2112
2157
  cancelled,
2113
2158
  expandable = true,
2159
+ defaultOpen,
2114
2160
  children
2115
2161
  }) {
2116
2162
  const iconTone = failed && iconToneProp === "muted" ? "failed" : iconToneProp;
2117
2163
  const chip = chipProp ?? (failed ? { tone: "bad", text: "failed" } : cancelled ? { tone: "interrupted", text: "interrupted" } : void 0);
2118
2164
  const forcedDefaultOpen = useForcedDefaultOpen();
2119
- const [open, setOpen] = useState4(forcedDefaultOpen ?? false);
2120
- const hasBody = expandable && children != null;
2165
+ const [open, setOpen] = useState4(defaultOpen ?? forcedDefaultOpen ?? false);
2166
+ const truncation = useContext3(ToolCallTruncationContext);
2167
+ const hasBody = expandable && (children != null || truncation != null);
2121
2168
  const previewVisible = preview != null && !open;
2122
2169
  const rowClass = cn(
2123
2170
  "group/disclosure flex w-full min-w-0 items-center gap-2 rounded-og-sm px-1.5 py-1.5 text-left text-og-base",
@@ -2141,7 +2188,7 @@ function ActivityDisclosure({
2141
2188
  }
2142
2189
  ),
2143
2190
  previewVisible && !media ? /* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx7("span", { className: "flex-1" }),
2144
- media ? /* @__PURE__ */ jsx7("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx7(Chip, { chip }) }) : null
2191
+ media && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx7(Chip, { chip }) }) : null
2145
2192
  ] });
2146
2193
  const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
2147
2194
  if (!hasBody) {
@@ -2171,7 +2218,22 @@ function ActivityDisclosure({
2171
2218
  children: inner
2172
2219
  }
2173
2220
  ),
2174
- open ? /* @__PURE__ */ jsx7("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children }) : null
2221
+ open ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children: [
2222
+ children,
2223
+ truncation ? /* @__PURE__ */ jsx7(ToolCallTruncationNotice, { truncation }) : null
2224
+ ] }) : null
2225
+ ] });
2226
+ }
2227
+ function ToolCallTruncationNotice({ truncation }) {
2228
+ const fullEvidence = truncation.fullEvidence.available ? "retained" : truncation.fullEvidence.reason ?? "unavailable";
2229
+ return /* @__PURE__ */ jsxs5("div", { "data-og-tool-output-truncation": "", className: "text-og-sm leading-5 text-og-fg-subtle", children: [
2230
+ "Output bounded at ",
2231
+ /* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: truncation.surface }),
2232
+ truncation.omittedBytes != null && truncation.omittedBytes > 0 ? ` \xB7 ${truncation.omittedBytes.toLocaleString()} bytes omitted` : null,
2233
+ " \xB7 reason ",
2234
+ /* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: truncation.reason }),
2235
+ " \xB7 full evidence ",
2236
+ /* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: fullEvidence })
2175
2237
  ] });
2176
2238
  }
2177
2239
  function Chip({ chip }) {
@@ -2300,7 +2362,9 @@ function MediaEmpty() {
2300
2362
  function Thumbnail({
2301
2363
  src,
2302
2364
  caption,
2303
- alt = "screenshot"
2365
+ alt = "screenshot",
2366
+ expandLabel = "Expand screenshot",
2367
+ lightboxLabel = "Screenshot"
2304
2368
  }) {
2305
2369
  const lightbox = useLightboxOptional();
2306
2370
  const [failed, setFailed] = useState4(false);
@@ -2325,7 +2389,7 @@ function Thumbnail({
2325
2389
  type: "button",
2326
2390
  onClick: (event) => {
2327
2391
  event.stopPropagation();
2328
- lightbox.open(src, caption, event.currentTarget);
2392
+ lightbox.open(src, caption, event.currentTarget, lightboxLabel);
2329
2393
  },
2330
2394
  onKeyDown: (event) => {
2331
2395
  if (event.key === "Enter" || event.key === " ") {
@@ -2337,7 +2401,7 @@ function Thumbnail({
2337
2401
  "group/thumb relative inline-flex overflow-hidden bg-og-bg outline-hidden",
2338
2402
  "focus-visible:ring-2 focus-visible:ring-og-accent"
2339
2403
  ),
2340
- "aria-label": "Expand screenshot",
2404
+ "aria-label": expandLabel,
2341
2405
  children: img
2342
2406
  }
2343
2407
  );
@@ -2345,7 +2409,9 @@ function Thumbnail({
2345
2409
  function ScreenshotFigure({
2346
2410
  src,
2347
2411
  caption,
2348
- alt = "screenshot"
2412
+ alt = "screenshot",
2413
+ expandLabel = "Expand screenshot",
2414
+ lightboxLabel = "Screenshot"
2349
2415
  }) {
2350
2416
  const lightbox = useLightboxOptional();
2351
2417
  const [failed, setFailed] = useState4(false);
@@ -2364,9 +2430,9 @@ function ScreenshotFigure({
2364
2430
  "button",
2365
2431
  {
2366
2432
  type: "button",
2367
- onClick: (event) => lightbox.open(src, caption, event.currentTarget),
2433
+ onClick: (event) => lightbox.open(src, caption, event.currentTarget, lightboxLabel),
2368
2434
  className: surface,
2369
- "aria-label": "Expand screenshot",
2435
+ "aria-label": expandLabel,
2370
2436
  children: img
2371
2437
  }
2372
2438
  ) : /* @__PURE__ */ jsx7("div", { className: surface, children: img }),
@@ -2554,16 +2620,17 @@ import {
2554
2620
  Share2Icon,
2555
2621
  TargetIcon,
2556
2622
  TerminalIcon,
2623
+ VideoIcon,
2557
2624
  WrenchIcon
2558
2625
  } from "lucide-react";
2559
- import { useEffect as useEffect6, useState as useState8 } from "react";
2626
+ import { useEffect as useEffect6, useRef as useRef4, useState as useState8 } from "react";
2560
2627
 
2561
2628
  // src/timeline/compute-label.tsx
2562
- import { createContext as createContext3, useContext as useContext3 } from "react";
2563
- var TimelineComputeLabelContext = createContext3(null);
2629
+ import { createContext as createContext4, useContext as useContext4 } from "react";
2630
+ var TimelineComputeLabelContext = createContext4(null);
2564
2631
  var TimelineComputeLabelProvider = TimelineComputeLabelContext.Provider;
2565
2632
  function useTimelineComputeLabel() {
2566
- return useContext3(TimelineComputeLabelContext);
2633
+ return useContext4(TimelineComputeLabelContext);
2567
2634
  }
2568
2635
 
2569
2636
  // src/timeline/tool-diff.tsx
@@ -3091,12 +3158,15 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
3091
3158
  );
3092
3159
  }
3093
3160
  return /* @__PURE__ */ jsx10(
3094
- RetainedScreenshotDisclosure,
3161
+ RetainedSessionImageDisclosure,
3095
3162
  {
3096
3163
  artifact: retained,
3097
3164
  load: loadRetainedScreenshot,
3098
- verb,
3099
- countSuffix,
3165
+ title: `${verb}${countSuffix}`,
3166
+ caption: `${verb}${countSuffix}`,
3167
+ noun: "screenshot",
3168
+ icon: /* @__PURE__ */ jsx10(CameraIcon2, { className: ICON_SIZE }),
3169
+ lightboxLabel: "Screenshot",
3100
3170
  batched,
3101
3171
  failed: isFailed,
3102
3172
  cancelled: isCancelled
@@ -3177,16 +3247,14 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
3177
3247
  }
3178
3248
  );
3179
3249
  }
3180
- function RetainedScreenshotDisclosure({
3181
- artifact,
3182
- load,
3183
- verb,
3184
- countSuffix,
3185
- batched,
3186
- failed,
3187
- cancelled
3188
- }) {
3250
+ function useRetainedImageObjectUrl(artifact, load) {
3189
3251
  const [state, setState] = useState8({ kind: "loading" });
3252
+ const artifactValue = retainedArtifactValue(artifact);
3253
+ const stableArtifactRef = useRef4({ value: artifactValue, artifact });
3254
+ if (stableArtifactRef.current.value !== artifactValue) {
3255
+ stableArtifactRef.current = { value: artifactValue, artifact };
3256
+ }
3257
+ const stableArtifact = stableArtifactRef.current.artifact;
3190
3258
  useEffect6(() => {
3191
3259
  if (!load) {
3192
3260
  setState({ kind: "unavailable", label: "retrieval is not configured" });
@@ -3195,47 +3263,110 @@ function RetainedScreenshotDisclosure({
3195
3263
  const controller = new AbortController();
3196
3264
  let objectUrl = null;
3197
3265
  setState({ kind: "loading" });
3198
- void load(artifact, controller.signal).then((bytes) => {
3266
+ void load(stableArtifact, controller.signal).then((source) => {
3199
3267
  if (controller.signal.aborted) return;
3200
- if (!bytes) {
3268
+ if (!source) {
3201
3269
  setState({ kind: "unavailable", label: "bytes are unavailable" });
3202
3270
  return;
3203
3271
  }
3204
- objectUrl = URL.createObjectURL(new Blob([Uint8Array.from(bytes)], { type: "image/png" }));
3272
+ if (!(source instanceof Uint8Array)) {
3273
+ if (!source.url.trim()) {
3274
+ setState({ kind: "unavailable", label: "URL is unavailable" });
3275
+ return;
3276
+ }
3277
+ setState({ kind: "ready", url: source.url });
3278
+ return;
3279
+ }
3280
+ objectUrl = URL.createObjectURL(
3281
+ new Blob([source], { type: stableArtifact.contentType })
3282
+ );
3205
3283
  setState({ kind: "ready", url: objectUrl });
3206
3284
  }).catch((error) => {
3207
3285
  if (controller.signal.aborted) return;
3208
3286
  const status = error && typeof error === "object" && "status" in error ? Number(error.status) : null;
3209
3287
  setState(
3210
- status === 404 ? { kind: "unavailable", label: "deleted" } : status === 410 ? { kind: "unavailable", label: "expired or unavailable" } : {
3211
- kind: "error",
3212
- message: "retrieval failed"
3213
- }
3288
+ status === 404 ? { kind: "unavailable", label: "deleted" } : status === 410 ? { kind: "unavailable", label: "expired or unavailable" } : { kind: "error", message: "retrieval failed" }
3214
3289
  );
3215
3290
  });
3216
3291
  return () => {
3217
3292
  controller.abort();
3218
3293
  if (objectUrl) URL.revokeObjectURL(objectUrl);
3219
3294
  };
3220
- }, [artifact, load]);
3221
- const caption = `${verb}${countSuffix}`;
3295
+ }, [stableArtifact, load]);
3296
+ return state;
3297
+ }
3298
+ function retainedArtifactValue(artifact) {
3299
+ return [
3300
+ artifact.artifactId,
3301
+ artifact.kind,
3302
+ artifact.contentType,
3303
+ artifact.originalBytes,
3304
+ artifact.sha256,
3305
+ artifact.retainedAt,
3306
+ artifact.dimensions?.width ?? "",
3307
+ artifact.dimensions?.height ?? "",
3308
+ artifact.retention.policy,
3309
+ artifact.retention.expiresAt ?? "",
3310
+ artifact.retrieval.method,
3311
+ artifact.retrieval.path,
3312
+ artifact.retrieval.acceptRanges,
3313
+ artifact.retrieval.maxRangeBytes
3314
+ ].join("\0");
3315
+ }
3316
+ function RetainedSessionImageDisclosure({
3317
+ artifact,
3318
+ load,
3319
+ title,
3320
+ caption,
3321
+ noun,
3322
+ icon,
3323
+ lightboxLabel,
3324
+ batched,
3325
+ failed,
3326
+ cancelled
3327
+ }) {
3328
+ const state = useRetainedImageObjectUrl(artifact, load);
3222
3329
  return /* @__PURE__ */ jsxs7(
3223
3330
  ActivityDisclosure,
3224
3331
  {
3225
- icon: /* @__PURE__ */ jsx10(CameraIcon2, { className: ICON_SIZE }),
3332
+ icon,
3226
3333
  iconTone: failed ? "failed" : state.kind === "ready" ? "accent" : "muted",
3227
- title: caption,
3334
+ title,
3228
3335
  failed,
3229
3336
  cancelled,
3230
- preview: state.kind === "loading" ? "loading retained screenshot\u2026" : state.kind === "error" ? "screenshot retrieval failed" : state.kind === "unavailable" ? `screenshot ${state.label}` : void 0,
3231
- media: state.kind === "ready" ? /* @__PURE__ */ jsx10(Thumbnail, { src: state.url, caption }) : state.kind === "loading" ? /* @__PURE__ */ jsx10(MediaSkeleton, {}) : /* @__PURE__ */ jsx10(MediaEmpty, {}),
3337
+ preview: state.kind === "loading" ? `loading retained ${noun}\u2026` : state.kind === "error" ? `${noun} retrieval failed` : state.kind === "unavailable" ? `${noun} ${state.label}` : void 0,
3338
+ media: state.kind === "ready" ? /* @__PURE__ */ jsx10(
3339
+ Thumbnail,
3340
+ {
3341
+ src: state.url,
3342
+ caption,
3343
+ alt: caption,
3344
+ expandLabel: `Expand ${noun}`,
3345
+ lightboxLabel
3346
+ }
3347
+ ) : state.kind === "loading" ? /* @__PURE__ */ jsx10(MediaSkeleton, {}) : /* @__PURE__ */ jsx10(MediaEmpty, {}),
3232
3348
  children: [
3233
- state.kind === "ready" ? /* @__PURE__ */ jsx10(ScreenshotFigure, { src: state.url, caption }) : state.kind === "loading" ? /* @__PURE__ */ jsx10(BodyNote, { children: "Loading the retained screenshot\u2026" }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3234
- "Screenshot ",
3349
+ state.kind === "ready" ? /* @__PURE__ */ jsx10(
3350
+ ScreenshotFigure,
3351
+ {
3352
+ src: state.url,
3353
+ caption,
3354
+ alt: caption,
3355
+ expandLabel: `Expand ${noun}`,
3356
+ lightboxLabel
3357
+ }
3358
+ ) : state.kind === "loading" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3359
+ "Loading the retained ",
3360
+ noun,
3361
+ "\u2026"
3362
+ ] }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3363
+ noun === "screenshot" ? "Screenshot" : "Image",
3364
+ " ",
3235
3365
  state.label,
3236
3366
  "."
3237
3367
  ] }) : /* @__PURE__ */ jsxs7(BodyNote, { tone: "error", children: [
3238
- "Screenshot retrieval failed: ",
3368
+ noun === "screenshot" ? "Screenshot" : "Image",
3369
+ " retrieval failed: ",
3239
3370
  state.message
3240
3371
  ] }),
3241
3372
  batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
@@ -3246,6 +3377,119 @@ function RetainedScreenshotDisclosure({
3246
3377
  }
3247
3378
  );
3248
3379
  }
3380
+ function GeneratedImageRenderer({ item, loadRetainedArtifact }) {
3381
+ const args = parseToolArgs(item.arguments);
3382
+ const prompt = typeof args.prompt === "string" ? args.prompt : "";
3383
+ const raw = item.raw && typeof item.raw === "object" && !Array.isArray(item.raw) ? item.raw : null;
3384
+ const receipt = generatedImageReceipt(item.output) ?? generatedImageReceipt(raw?.output);
3385
+ if (item.status === "running") {
3386
+ return /* @__PURE__ */ jsx10(
3387
+ ActivityDisclosure,
3388
+ {
3389
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
3390
+ iconTone: "running",
3391
+ title: "Generating image",
3392
+ running: true,
3393
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: truncatePreview(prompt, 72) || "creating\u2026" }),
3394
+ media: /* @__PURE__ */ jsx10(MediaSkeleton, {}),
3395
+ children: prompt ? /* @__PURE__ */ jsx10(BodyNote, { children: prompt }) : null
3396
+ }
3397
+ );
3398
+ }
3399
+ if (!receipt) return /* @__PURE__ */ jsx10(GenericRenderer, { item });
3400
+ return /* @__PURE__ */ jsx10(
3401
+ GeneratedImageDisclosure,
3402
+ {
3403
+ receipt,
3404
+ load: loadRetainedArtifact,
3405
+ prompt,
3406
+ failed: item.status === "failed",
3407
+ cancelled: item.status === "cancelled"
3408
+ }
3409
+ );
3410
+ }
3411
+ function GeneratedVideoRenderer({ item }) {
3412
+ const args = parseToolArgs(item.arguments);
3413
+ const prompt = typeof args.prompt === "string" ? args.prompt : "";
3414
+ const parsedOutput = typeof item.output === "string" ? tryParseJson(item.output) : item.output;
3415
+ const accepted = parsedOutput && typeof parsedOutput === "object" && !Array.isArray(parsedOutput) && parsedOutput.status === "accepted";
3416
+ const failed = item.status === "failed";
3417
+ const cancelled = item.status === "cancelled";
3418
+ const running = item.status === "running";
3419
+ return /* @__PURE__ */ jsxs7(
3420
+ ActivityDisclosure,
3421
+ {
3422
+ icon: /* @__PURE__ */ jsx10(VideoIcon, { className: ICON_SIZE }),
3423
+ iconTone: failed ? "failed" : running ? "running" : accepted ? "accent" : "muted",
3424
+ title: running ? "Starting video generation" : accepted ? "Generating video" : "Generate video",
3425
+ running,
3426
+ failed,
3427
+ cancelled,
3428
+ preview: truncatePreview(prompt, 88) || (accepted ? "request accepted" : void 0),
3429
+ children: [
3430
+ prompt ? /* @__PURE__ */ jsx10(BodyNote, { children: prompt }) : null,
3431
+ accepted ? /* @__PURE__ */ jsx10(BodyNote, { children: "The video will appear here when it is ready." }) : item.output !== void 0 ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Output", value: item.output }) : null
3432
+ ]
3433
+ }
3434
+ );
3435
+ }
3436
+ function GeneratedImageDisclosure({
3437
+ receipt,
3438
+ load,
3439
+ prompt,
3440
+ failed,
3441
+ cancelled
3442
+ }) {
3443
+ const state = useRetainedImageObjectUrl(receipt.artifact, load);
3444
+ const dimensions = receipt.artifact.dimensions;
3445
+ const title = failed ? "Image generation failed" : "Generated image";
3446
+ const caption = prompt || `Generated image \xB7 ${dimensions.width}\xD7${dimensions.height}`;
3447
+ return /* @__PURE__ */ jsxs7(
3448
+ ActivityDisclosure,
3449
+ {
3450
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
3451
+ iconTone: failed ? "failed" : state.kind === "ready" ? "accent" : "muted",
3452
+ title,
3453
+ defaultOpen: !failed && !cancelled,
3454
+ failed,
3455
+ cancelled,
3456
+ preview: state.kind === "loading" ? "loading image\u2026" : state.kind === "error" ? "image retrieval failed" : state.kind === "unavailable" ? `image ${state.label}` : truncatePreview(prompt, 88) || `${dimensions.width}\xD7${dimensions.height}`,
3457
+ media: state.kind === "ready" ? /* @__PURE__ */ jsx10(
3458
+ Thumbnail,
3459
+ {
3460
+ src: state.url,
3461
+ caption,
3462
+ alt: caption,
3463
+ expandLabel: "Expand generated image",
3464
+ lightboxLabel: "Generated image"
3465
+ }
3466
+ ) : state.kind === "loading" ? /* @__PURE__ */ jsx10(MediaSkeleton, {}) : /* @__PURE__ */ jsx10(MediaEmpty, {}),
3467
+ children: [
3468
+ state.kind === "ready" ? /* @__PURE__ */ jsx10(
3469
+ ScreenshotFigure,
3470
+ {
3471
+ src: state.url,
3472
+ caption,
3473
+ alt: caption,
3474
+ expandLabel: "Expand generated image",
3475
+ lightboxLabel: "Generated image"
3476
+ }
3477
+ ) : state.kind === "loading" ? /* @__PURE__ */ jsx10(BodyNote, { children: "Loading the generated image\u2026" }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3478
+ "Image ",
3479
+ state.label,
3480
+ "."
3481
+ ] }) : /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "Image retrieval failed." }),
3482
+ /* @__PURE__ */ jsxs7(BodyNote, { children: [
3483
+ dimensions.width,
3484
+ "\xD7",
3485
+ dimensions.height,
3486
+ " \xB7 ",
3487
+ receipt.sandboxPath
3488
+ ] })
3489
+ ]
3490
+ }
3491
+ );
3492
+ }
3249
3493
  function webSearchQueryFromArguments(args) {
3250
3494
  if (typeof args === "string") {
3251
3495
  const trimmed = args.trim();
@@ -3344,11 +3588,12 @@ var VIEW_IMAGE_ERRORS = [
3344
3588
  "is not a supported image",
3345
3589
  "unable to read image"
3346
3590
  ];
3347
- function ViewImageRenderer({ item }) {
3591
+ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
3348
3592
  const args = parseToolArgs(item.arguments);
3349
3593
  const path = typeof args.path === "string" ? args.path : "";
3350
3594
  const out = item.output;
3351
3595
  const text = typeof out === "string" ? out : "";
3596
+ const retained = retainedScreenshotMetadata(out);
3352
3597
  const omittedMedia = mediaPreviewFact(out);
3353
3598
  if (item.status === "running") {
3354
3599
  return /* @__PURE__ */ jsx10(
@@ -3366,6 +3611,46 @@ function ViewImageRenderer({ item }) {
3366
3611
  }
3367
3612
  const viewFailed = item.status === "failed";
3368
3613
  const viewCancelled = item.status === "cancelled";
3614
+ if (retained) {
3615
+ const title = `Viewed ${basename(path)}`;
3616
+ if (!retained.available) {
3617
+ const state = retained.reason === "expired" || retained.reason === "deleted" ? retained.reason : "unavailable";
3618
+ return /* @__PURE__ */ jsx10(
3619
+ ActivityDisclosure,
3620
+ {
3621
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
3622
+ iconTone: viewFailed ? "failed" : "muted",
3623
+ title: `${title} \xB7 ${state}`,
3624
+ failed: viewFailed,
3625
+ cancelled: viewCancelled,
3626
+ preview: `image ${state}`,
3627
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
3628
+ children: /* @__PURE__ */ jsxs7(BodyNote, { tone: viewFailed ? "error" : void 0, children: [
3629
+ "Image ",
3630
+ state,
3631
+ ": ",
3632
+ retained.reason.replaceAll("_", " "),
3633
+ "."
3634
+ ] })
3635
+ }
3636
+ );
3637
+ }
3638
+ return /* @__PURE__ */ jsx10(
3639
+ RetainedSessionImageDisclosure,
3640
+ {
3641
+ artifact: retained,
3642
+ load: loadRetainedScreenshot,
3643
+ title,
3644
+ caption: path || title,
3645
+ noun: "image",
3646
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
3647
+ lightboxLabel: "Image",
3648
+ batched: null,
3649
+ failed: viewFailed,
3650
+ cancelled: viewCancelled
3651
+ }
3652
+ );
3653
+ }
3369
3654
  const errMatch = VIEW_IMAGE_ERRORS.find((p) => text.includes(p));
3370
3655
  if (errMatch) {
3371
3656
  const tooBig = text.includes("exceeded the allowed size");
@@ -4063,7 +4348,6 @@ var BASE_ENTRIES = [
4063
4348
  // truth and is consulted first by the registry.
4064
4349
  { match: "rawType", type: "apply_patch_call", render: ApplyPatchRenderer },
4065
4350
  { match: "rawType", type: "computer_call", render: ComputerCallRenderer },
4066
- { match: "rawType", type: "hosted_tool_call", render: WebSearchRenderer },
4067
4351
  { match: "rawType", type: "tool_search_call", render: ToolSearchRenderer },
4068
4352
  // First-party sandbox + MCP tools resolve by name (exact or MCP leaf).
4069
4353
  { match: "name", name: "exec_command", render: ExecRenderer },
@@ -4083,6 +4367,9 @@ var BASE_ENTRIES = [
4083
4367
  { match: "name", name: "computer_keypress", render: ComputerCallRenderer },
4084
4368
  { match: "name", name: "computer_drag", render: ComputerCallRenderer },
4085
4369
  { match: "name", name: "web_search_call", render: WebSearchRenderer },
4370
+ { match: "name", name: "image_generation_call", render: GeneratedImageRenderer },
4371
+ { match: "name", name: "generate_image", render: GeneratedImageRenderer },
4372
+ { match: "name", name: "generate_video", render: GeneratedVideoRenderer },
4086
4373
  { match: "name", name: "tool_search", render: ToolSearchRenderer },
4087
4374
  { match: "name", name: "view_image", render: ViewImageRenderer },
4088
4375
  { match: "name", name: "environment_set_variable", render: SecretSetRenderer },
@@ -4098,57 +4385,9 @@ function createDefaultToolRegistry(options = {}) {
4098
4385
  return createToolRegistry(BASE_ENTRIES, GenericRenderer, options);
4099
4386
  }
4100
4387
 
4101
- // src/lib/clipboard.ts
4102
- async function copyTextToClipboard(text) {
4103
- const value = text.replace(/\u00a0/g, " ");
4104
- if (value.length === 0) {
4105
- return false;
4106
- }
4107
- try {
4108
- if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
4109
- await navigator.clipboard.writeText(value);
4110
- return true;
4111
- }
4112
- } catch {
4113
- }
4114
- if (typeof document === "undefined") {
4115
- return false;
4116
- }
4117
- try {
4118
- const area = document.createElement("textarea");
4119
- area.value = value;
4120
- area.setAttribute("readonly", "");
4121
- area.style.position = "fixed";
4122
- area.style.left = "-9999px";
4123
- area.style.top = "0";
4124
- document.body.appendChild(area);
4125
- area.select();
4126
- const ok = document.execCommand("copy");
4127
- document.body.removeChild(area);
4128
- return ok;
4129
- } catch {
4130
- return false;
4131
- }
4132
- }
4133
- function tableElementToTsv(table) {
4134
- if (!table) {
4135
- return "";
4136
- }
4137
- const rows = Array.from(table.querySelectorAll("tr"));
4138
- return rows.map(
4139
- (row) => Array.from(row.querySelectorAll("th,td")).map((cell) => {
4140
- const raw = (cell.textContent ?? "").replace(/\s+/g, " ").trim();
4141
- if (/[\t\n"]/.test(raw)) {
4142
- return `"${raw.replace(/"/g, '""')}"`;
4143
- }
4144
- return raw;
4145
- }).join(" ")
4146
- ).filter((line) => line.length > 0).join("\n");
4147
- }
4148
-
4149
4388
  // src/components/copy-button.tsx
4150
4389
  import { CheckIcon, CopyIcon } from "lucide-react";
4151
- import { useEffect as useEffect7, useRef as useRef4, useState as useState9 } from "react";
4390
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState9 } from "react";
4152
4391
  import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
4153
4392
  var COPIED_MS = 1600;
4154
4393
  function CopyButton({
@@ -4159,7 +4398,7 @@ function CopyButton({
4159
4398
  }) {
4160
4399
  const [copied, setCopied] = useState9(false);
4161
4400
  const [tipOpen, setTipOpen] = useState9(false);
4162
- const timerRef = useRef4(null);
4401
+ const timerRef = useRef5(null);
4163
4402
  useEffect7(() => {
4164
4403
  return () => {
4165
4404
  if (timerRef.current !== null) {
@@ -4263,7 +4502,7 @@ import {
4263
4502
  memo,
4264
4503
  useEffect as useEffect8,
4265
4504
  useReducer,
4266
- useRef as useRef5,
4505
+ useRef as useRef6,
4267
4506
  useState as useState10
4268
4507
  } from "react";
4269
4508
  import ReactMarkdown from "react-markdown";
@@ -4724,7 +4963,7 @@ function MarkdownCodeBlock({ children }) {
4724
4963
  ] });
4725
4964
  }
4726
4965
  function MarkdownTable({ children, className, ...props }) {
4727
- const tableRef = useRef5(null);
4966
+ const tableRef = useRef6(null);
4728
4967
  return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
4729
4968
  /* @__PURE__ */ jsx12("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx12("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx12(
4730
4969
  CopyButton,
@@ -4746,11 +4985,11 @@ function MarkdownTable({ children, className, ...props }) {
4746
4985
  ] });
4747
4986
  }
4748
4987
  function MarkdownImpl({ children, className, streaming = false }) {
4749
- const revealRef = useRef5(null);
4750
- const bodyRef = useRef5(null);
4988
+ const revealRef = useRef6(null);
4989
+ const bodyRef = useRef6(null);
4751
4990
  const [, bump] = useReducer((n) => n + 1, 0);
4752
4991
  const [settling, setSettling] = useState10(false);
4753
- const hadRevealRef = useRef5(false);
4992
+ const hadRevealRef = useRef6(false);
4754
4993
  const now = typeof performance !== "undefined" ? performance.now() : Date.now();
4755
4994
  const crystallize = (mutate) => {
4756
4995
  mutate();
@@ -4796,7 +5035,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
4796
5035
  }
4797
5036
  };
4798
5037
  }, [streaming]);
4799
- const wasStreamingRef = useRef5(streaming);
5038
+ const wasStreamingRef = useRef6(streaming);
4800
5039
  useEffect8(() => {
4801
5040
  const ended = wasStreamingRef.current && !streaming;
4802
5041
  wasStreamingRef.current = streaming;
@@ -4839,28 +5078,28 @@ import {
4839
5078
  BrainIcon,
4840
5079
  SquareTerminalIcon
4841
5080
  } from "lucide-react";
4842
- import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef7 } from "react";
5081
+ import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef8 } from "react";
4843
5082
  import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
4844
5083
 
4845
5084
  // src/timeline/entrance.tsx
4846
- import { createContext as createContext4, useContext as useContext4, useRef as useRef6 } from "react";
4847
- var EntranceAnimationContext = createContext4(true);
5085
+ import { createContext as createContext5, useContext as useContext5, useRef as useRef7 } from "react";
5086
+ var EntranceAnimationContext = createContext5(true);
4848
5087
  var EntranceAnimationProvider = EntranceAnimationContext.Provider;
4849
5088
  function useEntranceAnimationLive() {
4850
- return useContext4(EntranceAnimationContext);
5089
+ return useContext5(EntranceAnimationContext);
4851
5090
  }
4852
5091
  function useEntranceAnimation() {
4853
- const enabled = useContext4(EntranceAnimationContext);
4854
- const captured = useRef6(enabled);
5092
+ const enabled = useContext5(EntranceAnimationContext);
5093
+ const captured = useRef7(enabled);
4855
5094
  return captured.current;
4856
5095
  }
4857
5096
 
4858
5097
  // src/timeline/seen-activity-ids.ts
4859
- import { createContext as createContext5, useContext as useContext5 } from "react";
4860
- var SeenActivityIdsContext = createContext5(null);
5098
+ import { createContext as createContext6, useContext as useContext6 } from "react";
5099
+ var SeenActivityIdsContext = createContext6(null);
4861
5100
  var SeenActivityIdsProvider = SeenActivityIdsContext.Provider;
4862
5101
  function useSeenActivityIds() {
4863
- return useContext5(SeenActivityIdsContext);
5102
+ return useContext6(SeenActivityIdsContext);
4864
5103
  }
4865
5104
 
4866
5105
  // src/timeline/activity-rail.tsx
@@ -4878,6 +5117,7 @@ function ActivityRail({
4878
5117
  onOpenSession,
4879
5118
  onMemoryClick,
4880
5119
  loadRetainedScreenshot,
5120
+ loadRetainedArtifact,
4881
5121
  bare,
4882
5122
  className
4883
5123
  }) {
@@ -4885,7 +5125,7 @@ function ActivityRail({
4885
5125
  const enterLive = useEntranceAnimationLive();
4886
5126
  const seenIds = useSeenActivityIds();
4887
5127
  const enter = seenIds ? enterLive : enterMounted;
4888
- const previousIdsRef = useRef7(null);
5128
+ const previousIdsRef = useRef8(null);
4889
5129
  const enteringIds = /* @__PURE__ */ new Set();
4890
5130
  if (enter) {
4891
5131
  for (const item of items) {
@@ -4927,12 +5167,14 @@ function ActivityRail({
4927
5167
  toolRegistry,
4928
5168
  onOpenSession,
4929
5169
  onMemoryClick,
4930
- loadRetainedScreenshot
5170
+ loadRetainedScreenshot,
5171
+ loadRetainedArtifact
4931
5172
  );
4932
5173
  return /* @__PURE__ */ jsx13(
4933
5174
  "div",
4934
5175
  {
4935
5176
  "data-og-timeline-row-anchor": "",
5177
+ "data-og-annotation-source-key": item.kind === "tool-call" ? item.annotationSource?.eventId : void 0,
4936
5178
  className: cn(newFamily && "mt-3", enteringIds.has(item.id) && "animate-og-row-enter"),
4937
5179
  children: row
4938
5180
  },
@@ -4945,13 +5187,20 @@ function ActivityRail({
4945
5187
  function assertNever(item) {
4946
5188
  throw new Error(`ActivityRail: unhandled activity item ${JSON.stringify(item)}`);
4947
5189
  }
4948
- function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRetainedScreenshot) {
5190
+ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRetainedScreenshot, loadRetainedArtifact) {
4949
5191
  switch (item.kind) {
4950
5192
  case "reasoning":
4951
5193
  return /* @__PURE__ */ jsx13(ReasoningRow, { item });
4952
5194
  case "tool-call": {
4953
5195
  const Renderer = toolRegistry.resolve(item);
4954
- return /* @__PURE__ */ jsx13(Renderer, { item, loadRetainedScreenshot });
5196
+ return /* @__PURE__ */ jsx13(ToolCallTruncationProvider, { value: item.truncation ?? null, children: /* @__PURE__ */ jsx13(
5197
+ Renderer,
5198
+ {
5199
+ item,
5200
+ loadRetainedScreenshot,
5201
+ loadRetainedArtifact
5202
+ }
5203
+ ) });
4955
5204
  }
4956
5205
  case "worker":
4957
5206
  return /* @__PURE__ */ jsx13(WorkerRow, { item, onOpenSession });
@@ -5140,21 +5389,21 @@ function WorkerRow({
5140
5389
  import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
5141
5390
  import {
5142
5391
  Component,
5143
- createContext as createContext7,
5144
- useContext as useContext7,
5392
+ createContext as createContext8,
5393
+ useContext as useContext8,
5145
5394
  useEffect as useEffect9,
5146
5395
  useMemo as useMemo4,
5147
- useRef as useRef8,
5396
+ useRef as useRef9,
5148
5397
  useState as useState11
5149
5398
  } from "react";
5150
5399
  import { Collapsible } from "radix-ui";
5151
5400
 
5152
5401
  // src/timeline/fold-memory.ts
5153
- import { createContext as createContext6, useContext as useContext6 } from "react";
5154
- var FoldMemoryContext = createContext6(null);
5402
+ import { createContext as createContext7, useContext as useContext7 } from "react";
5403
+ var FoldMemoryContext = createContext7(null);
5155
5404
  var FoldMemoryProvider = FoldMemoryContext.Provider;
5156
5405
  function useFoldMemory() {
5157
- return useContext6(FoldMemoryContext);
5406
+ return useContext7(FoldMemoryContext);
5158
5407
  }
5159
5408
  function inheritFoldRestingState(memory, targetKey, sourceKeys) {
5160
5409
  if (memory.has(targetKey) || sourceKeys.length !== 1) {
@@ -5168,9 +5417,9 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
5168
5417
 
5169
5418
  // src/timeline/turn-summary.tsx
5170
5419
  import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
5171
- var TurnSettleChromeContext = createContext7(false);
5420
+ var TurnSettleChromeContext = createContext8(false);
5172
5421
  function useTurnSettleOpen() {
5173
- return useContext7(TurnSettleChromeContext);
5422
+ return useContext8(TurnSettleChromeContext);
5174
5423
  }
5175
5424
  var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
5176
5425
  "steps",
@@ -5208,11 +5457,11 @@ function TurnSummary({
5208
5457
  const [settlePhase, setSettlePhase] = useState11(initialSettle);
5209
5458
  const [nestSuppressLatch, setNestSuppressLatch] = useState11(initialSettle);
5210
5459
  const [expandReady, setExpandReady] = useState11(!initialSettle);
5211
- const settleTimerRef = useRef8(null);
5212
- const settleCloseDoneRef = useRef8(null);
5213
- const nestLatchClearRef = useRef8(null);
5214
- const settleFoldSeenRef = useRef8(Boolean(settleFold));
5215
- const settleArmedRef = useRef8(false);
5460
+ const settleTimerRef = useRef9(null);
5461
+ const settleCloseDoneRef = useRef9(null);
5462
+ const nestLatchClearRef = useRef9(null);
5463
+ const settleFoldSeenRef = useRef9(Boolean(settleFold));
5464
+ const settleArmedRef = useRef9(false);
5216
5465
  const clearNestLatchTimer = () => {
5217
5466
  if (nestLatchClearRef.current !== null) {
5218
5467
  clearTimeout(nestLatchClearRef.current);
@@ -5260,7 +5509,7 @@ function TurnSummary({
5260
5509
  }, SETTLE_COLLAPSE_MS);
5261
5510
  }, SETTLE_FOLD_BEAT_MS);
5262
5511
  };
5263
- const mountSettleRef = useRef8(initialSettle);
5512
+ const mountSettleRef = useRef9(initialSettle);
5264
5513
  useEffect9(() => {
5265
5514
  if (mountSettleRef.current) {
5266
5515
  armSettleCollapse();
@@ -5597,12 +5846,12 @@ function formatDurationFacet(durationMs) {
5597
5846
 
5598
5847
  // src/components/user-message-body.tsx
5599
5848
  import {
5600
- createContext as createContext8,
5849
+ createContext as createContext9,
5601
5850
  useCallback as useCallback2,
5602
- useContext as useContext8,
5851
+ useContext as useContext9,
5603
5852
  useId as useId3,
5604
5853
  useLayoutEffect as useLayoutEffect3,
5605
- useRef as useRef9,
5854
+ useRef as useRef10,
5606
5855
  useState as useState12
5607
5856
  } from "react";
5608
5857
  import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -5685,7 +5934,7 @@ function collectInteractionBoundaries(root) {
5685
5934
  function isFullyInsideVisiblePreview(rect, clipRect) {
5686
5935
  return rect.width > 0 && rect.height > 0 && rect.top >= clipRect.top - 1 && rect.bottom <= clipRect.bottom + 1 && rect.left >= clipRect.left - 1 && rect.right <= clipRect.right + 1;
5687
5936
  }
5688
- var UserMessageDisclosureContext = createContext8(null);
5937
+ var UserMessageDisclosureContext = createContext9(null);
5689
5938
  function UserMessageDisclosureProvider({
5690
5939
  value,
5691
5940
  children
@@ -5697,17 +5946,17 @@ function userMessageLikelyNeedsDisclosure(text) {
5697
5946
  return lines.length > FALLBACK_LINE_THRESHOLD || text.length > FALLBACK_TEXT_THRESHOLD || lines.some((line) => line.length > FALLBACK_UNBROKEN_THRESHOLD);
5698
5947
  }
5699
5948
  function UserMessageBody({ messageId, text, children, className }) {
5700
- const disclosure = useContext8(UserMessageDisclosureContext);
5949
+ const disclosure = useContext9(UserMessageDisclosureContext);
5701
5950
  const [expanded, setExpanded] = useState12(
5702
5951
  () => disclosure?.expandedByMessageId.get(messageId) ?? false
5703
5952
  );
5704
5953
  const [collapsible, setCollapsible] = useState12(() => userMessageLikelyNeedsDisclosure(text));
5705
- const rootRef = useRef9(null);
5706
- const clipRef = useRef9(null);
5707
- const contentRef = useRef9(null);
5708
- const thresholdRef = useRef9(null);
5709
- const pendingRestoreRef = useRef9(null);
5710
- const managedInertDescendantsRef = useRef9(/* @__PURE__ */ new Set());
5954
+ const rootRef = useRef10(null);
5955
+ const clipRef = useRef10(null);
5956
+ const contentRef = useRef10(null);
5957
+ const thresholdRef = useRef10(null);
5958
+ const pendingRestoreRef = useRef10(null);
5959
+ const managedInertDescendantsRef = useRef10(/* @__PURE__ */ new Set());
5711
5960
  const contentId = `og-user-message-${useId3().replace(/:/g, "")}`;
5712
5961
  const collapsed = collapsible && !expanded;
5713
5962
  const restoreManagedInertDescendants = useCallback2(() => {
@@ -5866,8 +6115,82 @@ function UserMessageBody({ messageId, text, children, className }) {
5866
6115
  );
5867
6116
  }
5868
6117
 
6118
+ // src/components/generated-video-player.tsx
6119
+ import { useEffect as useEffect10, useState as useState13 } from "react";
6120
+ import { jsx as jsx16 } from "react/jsx-runtime";
6121
+ function GeneratedVideoPlayer({
6122
+ receipt,
6123
+ loadPlaybackSource,
6124
+ className,
6125
+ label = "Generated video"
6126
+ }) {
6127
+ const [retry, setRetry] = useState13(0);
6128
+ const [state, setState] = useState13({ kind: "loading" });
6129
+ useEffect10(() => {
6130
+ const controller = new AbortController();
6131
+ setState({ kind: "loading" });
6132
+ void loadPlaybackSource(receipt.artifact.artifactId, controller.signal).then(
6133
+ (source) => {
6134
+ if (!controller.signal.aborted) setState({ kind: "ready", source });
6135
+ },
6136
+ (error) => {
6137
+ if (controller.signal.aborted) return;
6138
+ setState({
6139
+ kind: "error",
6140
+ message: error instanceof Error ? error.message : "Playback is unavailable."
6141
+ });
6142
+ }
6143
+ );
6144
+ return () => controller.abort();
6145
+ }, [loadPlaybackSource, receipt.artifact.artifactId, retry]);
6146
+ if (state.kind === "loading") {
6147
+ return /* @__PURE__ */ jsx16(
6148
+ "div",
6149
+ {
6150
+ "aria-label": `Loading ${label.toLowerCase()}`,
6151
+ className: cn(
6152
+ "aspect-video w-full animate-pulse rounded-og-md bg-og-surface-2 motion-reduce:animate-none",
6153
+ className
6154
+ )
6155
+ }
6156
+ );
6157
+ }
6158
+ if (state.kind === "error") {
6159
+ return /* @__PURE__ */ jsx16(
6160
+ "div",
6161
+ {
6162
+ role: "status",
6163
+ className: cn(
6164
+ "rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3 py-2 text-og-sm text-og-status-failed",
6165
+ className
6166
+ ),
6167
+ children: state.message
6168
+ }
6169
+ );
6170
+ }
6171
+ return /* @__PURE__ */ jsx16(
6172
+ "video",
6173
+ {
6174
+ "aria-label": label,
6175
+ className: cn(
6176
+ "max-h-[32rem] w-full rounded-og-md bg-black object-contain shadow-sm",
6177
+ className
6178
+ ),
6179
+ controls: true,
6180
+ playsInline: true,
6181
+ preload: "metadata",
6182
+ src: state.source.url,
6183
+ onError: () => {
6184
+ if (retry === 0) setRetry(1);
6185
+ else setState({ kind: "error", message: "Video playback failed." });
6186
+ }
6187
+ },
6188
+ state.source.url
6189
+ );
6190
+ }
6191
+
5869
6192
  // src/components/session-status.tsx
5870
- import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
6193
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
5871
6194
  var SESSION_STATUS_META = {
5872
6195
  queued: {
5873
6196
  label: "Queued",
@@ -5931,7 +6254,7 @@ function SessionStatus({ status, label, size = "md", className }) {
5931
6254
  className
5932
6255
  ),
5933
6256
  children: [
5934
- /* @__PURE__ */ jsx16(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
6257
+ /* @__PURE__ */ jsx17(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
5935
6258
  label ?? meta.label
5936
6259
  ]
5937
6260
  }
@@ -5939,7 +6262,7 @@ function SessionStatus({ status, label, size = "md", className }) {
5939
6262
  }
5940
6263
  function StatusDot({ status, className }) {
5941
6264
  const meta = SESSION_STATUS_META[status];
5942
- return /* @__PURE__ */ jsx16(
6265
+ return /* @__PURE__ */ jsx17(
5943
6266
  "span",
5944
6267
  {
5945
6268
  className: cn(
@@ -5947,7 +6270,7 @@ function StatusDot({ status, className }) {
5947
6270
  meta.dotClassName,
5948
6271
  className
5949
6272
  ),
5950
- children: meta.pulse ? /* @__PURE__ */ jsx16("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
6273
+ children: meta.pulse ? /* @__PURE__ */ jsx17("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
5951
6274
  }
5952
6275
  );
5953
6276
  }
@@ -5976,13 +6299,15 @@ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/r
5976
6299
  import { Collapsible as Collapsible2 } from "radix-ui";
5977
6300
  import {
5978
6301
  Component as Component2,
6302
+ Suspense as Suspense4,
6303
+ lazy as lazy4,
5979
6304
  memo as memo2,
5980
6305
  useCallback as useCallback3,
5981
- useEffect as useEffect10,
6306
+ useEffect as useEffect11,
5982
6307
  useLayoutEffect as useLayoutEffect4,
5983
6308
  useMemo as useMemo5,
5984
- useRef as useRef10,
5985
- useState as useState13
6309
+ useRef as useRef11,
6310
+ useState as useState14
5986
6311
  } from "react";
5987
6312
 
5988
6313
  // src/components/tip-follow.ts
@@ -6258,7 +6583,8 @@ var MACHINE_INPUT_META = {
6258
6583
  goal_continuation: "Goal continued",
6259
6584
  agent_message: "Agent update",
6260
6585
  agent_steer_instruction: "Agent direction",
6261
- child_terminal_result: "Agent finished"
6586
+ child_terminal_result: "Agent finished",
6587
+ media_generation_result: "Video update"
6262
6588
  };
6263
6589
  function machineInputBatchLabel(members) {
6264
6590
  if (members.length === 0) return "Updates";
@@ -6280,6 +6606,8 @@ function machineInputBatchLabel(members) {
6280
6606
  return n === 1 ? "Agent update" : `${n} agent updates`;
6281
6607
  case "agent_steer_instruction":
6282
6608
  return n === 1 ? "Agent direction" : `${n} agent directions`;
6609
+ case "media_generation_result":
6610
+ return n === 1 ? "Video ready" : `${n} video updates`;
6283
6611
  }
6284
6612
  }
6285
6613
  const parts = [...counts.entries()].map(([kind, count]) => {
@@ -6311,7 +6639,8 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
6311
6639
  }
6312
6640
 
6313
6641
  // src/components/message-timeline.tsx
6314
- import { Fragment as Fragment7, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
6642
+ import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
6643
+ var TimelineAnnotationSelection = lazy4(() => import("./timeline-annotation-selection-3L7LHGG2.js"));
6315
6644
  var PIN_THRESHOLD_PX = 48;
6316
6645
  var OLDER_PREFETCH_MARGIN_PX = 400;
6317
6646
  var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
@@ -6362,9 +6691,12 @@ function MessageTimeline({
6362
6691
  resolveProviderLogo,
6363
6692
  toolRegistry = defaultToolRegistry,
6364
6693
  loadRetainedScreenshot,
6694
+ loadRetainedArtifact,
6695
+ loadVideoArtifactPlayback,
6365
6696
  computeLabel = null,
6366
6697
  turnSummary,
6367
6698
  autoFollow = true,
6699
+ onAnnotate,
6368
6700
  hasOlder = false,
6369
6701
  loadingOlder = false,
6370
6702
  onLoadOlder,
@@ -6386,41 +6718,50 @@ function MessageTimeline({
6386
6718
  return projected.filter((item) => item.kind !== "auth-needed" || shouldRenderAuthNeeded(item));
6387
6719
  }, [items, events, shouldRenderAuthNeeded]);
6388
6720
  const allGroups = useMemo5(() => groupTimeline(resolvedItems), [resolvedItems]);
6721
+ const annotationSources = useMemo5(() => {
6722
+ const sources = /* @__PURE__ */ new Map();
6723
+ for (const item of resolvedItems) {
6724
+ if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
6725
+ sources.set(item.annotationSource.eventId, item.annotationSource);
6726
+ }
6727
+ }
6728
+ return sources;
6729
+ }, [resolvedItems]);
6389
6730
  const groups = useStableTimelineGroupKeys(allGroups);
6390
- const scrollRef = useRef10(null);
6391
- const topSentinelRef = useRef10(null);
6392
- const bottomSentinelRef = useRef10(null);
6393
- const previousBulkFirstKeyRef = useRef10(void 0);
6394
- const [pinned, setPinned] = useState13(true);
6395
- const [bulkActive, setBulkActive] = useState13(true);
6396
- const olderPrefetchArmedRef = useRef10(false);
6397
- const [olderPrefetchArmed, setOlderPrefetchArmed] = useState13(false);
6398
- const olderLoadGateRef = useRef10("armed");
6399
- const resizeFollowRafRef = useRef10(null);
6731
+ const scrollRef = useRef11(null);
6732
+ const topSentinelRef = useRef11(null);
6733
+ const bottomSentinelRef = useRef11(null);
6734
+ const previousBulkFirstKeyRef = useRef11(void 0);
6735
+ const [pinned, setPinned] = useState14(true);
6736
+ const [bulkActive, setBulkActive] = useState14(true);
6737
+ const olderPrefetchArmedRef = useRef11(false);
6738
+ const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
6739
+ const olderLoadGateRef = useRef11("armed");
6740
+ const resizeFollowRafRef = useRef11(null);
6400
6741
  const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
6401
- const [revealed, setRevealed] = useState13(false);
6402
- const pinnedRef = useRef10(true);
6403
- const hasNewerRef = useRef10(hasNewer);
6742
+ const [revealed, setRevealed] = useState14(false);
6743
+ const pinnedRef = useRef11(true);
6744
+ const hasNewerRef = useRef11(hasNewer);
6404
6745
  hasNewerRef.current = hasNewer;
6405
- const wantPinRef = useRef10(false);
6406
- const pendingJumpToStartRef = useRef10(false);
6407
- const jumpToStartSeqRef = useRef10(0);
6408
- const previousFirstItemIdRef = useRef10(null);
6409
- const previousScrollHeightRef = useRef10(0);
6410
- const lastScrollTopRef = useRef10(0);
6411
- const lastMaxScrollRef = useRef10(0);
6412
- const lastScrollHeightRef = useRef10(0);
6413
- const lastClientHeightRef = useRef10(0);
6414
- const readerIntentArmRef = useRef10(false);
6415
- const programmaticScrollRef = useRef10(0);
6416
- const disclosureKeepsUnpinnedRef = useRef10(false);
6417
- const pendingReaderLeaveRef = useRef10(false);
6418
- const leaveFallbackRafRef = useRef10(null);
6419
- const foldMemoryRef = useRef10(/* @__PURE__ */ new Map());
6420
- const userMessageDisclosureMemoryRef = useRef10(/* @__PURE__ */ new Map());
6421
- const seenActivityIdsRef = useRef10(/* @__PURE__ */ new Set());
6422
- const groupKeyByItemIdRef = useRef10(/* @__PURE__ */ new Map());
6423
- const groupOffsetByKeyRef = useRef10(/* @__PURE__ */ new Map());
6746
+ const wantPinRef = useRef11(false);
6747
+ const pendingJumpToStartRef = useRef11(false);
6748
+ const jumpToStartSeqRef = useRef11(0);
6749
+ const previousFirstItemIdRef = useRef11(null);
6750
+ const previousScrollHeightRef = useRef11(0);
6751
+ const lastScrollTopRef = useRef11(0);
6752
+ const lastMaxScrollRef = useRef11(0);
6753
+ const lastScrollHeightRef = useRef11(0);
6754
+ const lastClientHeightRef = useRef11(0);
6755
+ const readerIntentArmRef = useRef11(false);
6756
+ const programmaticScrollRef = useRef11(0);
6757
+ const disclosureKeepsUnpinnedRef = useRef11(false);
6758
+ const pendingReaderLeaveRef = useRef11(false);
6759
+ const leaveFallbackRafRef = useRef11(null);
6760
+ const foldMemoryRef = useRef11(/* @__PURE__ */ new Map());
6761
+ const userMessageDisclosureMemoryRef = useRef11(/* @__PURE__ */ new Map());
6762
+ const seenActivityIdsRef = useRef11(/* @__PURE__ */ new Set());
6763
+ const groupKeyByItemIdRef = useRef11(/* @__PURE__ */ new Map());
6764
+ const groupOffsetByKeyRef = useRef11(/* @__PURE__ */ new Map());
6424
6765
  const firstItemId = resolvedItems[0]?.id ?? null;
6425
6766
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
6426
6767
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
@@ -6430,10 +6771,10 @@ function MessageTimeline({
6430
6771
  setPinned(value);
6431
6772
  }
6432
6773
  }, []);
6433
- const revealedRef = useRef10(revealed);
6774
+ const revealedRef = useRef11(revealed);
6434
6775
  revealedRef.current = revealed;
6435
- const followRef = useRef10(createTipFollowState());
6436
- const followFrameRef = useRef10(null);
6776
+ const followRef = useRef11(createTipFollowState());
6777
+ const followFrameRef = useRef11(null);
6437
6778
  const syncScrollBaseline = useCallback3((node) => {
6438
6779
  lastScrollTopRef.current = node.scrollTop;
6439
6780
  lastMaxScrollRef.current = maxScrollOf(node);
@@ -6620,7 +6961,7 @@ function MessageTimeline({
6620
6961
  }),
6621
6962
  [beginUserMessageDisclosureChange]
6622
6963
  );
6623
- const driveFollowRef = useRef10(() => void 0);
6964
+ const driveFollowRef = useRef11(() => void 0);
6624
6965
  const driveFollow = useCallback3(
6625
6966
  (node, nowMs) => {
6626
6967
  if (!pinnedRef.current || hasNewerRef.current) {
@@ -6709,8 +7050,8 @@ function MessageTimeline({
6709
7050
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
6710
7051
  );
6711
7052
  driveFollowRef.current = driveFollow;
6712
- useEffect10(() => stopFollow, [stopFollow]);
6713
- useEffect10(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
7053
+ useEffect11(() => stopFollow, [stopFollow]);
7054
+ useEffect11(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
6714
7055
  useLayoutEffect4(() => {
6715
7056
  const node = scrollRef.current;
6716
7057
  if (!node) {
@@ -6863,7 +7204,7 @@ function MessageTimeline({
6863
7204
  const frame = requestFrame(() => setBulkActive(false));
6864
7205
  return () => cancelFrame(frame);
6865
7206
  }, [bulkRender, firstGroupKey]);
6866
- useEffect10(() => {
7207
+ useEffect11(() => {
6867
7208
  const root = scrollRef.current;
6868
7209
  const target = topSentinelRef.current;
6869
7210
  if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
@@ -6887,7 +7228,7 @@ function MessageTimeline({
6887
7228
  observer.observe(target);
6888
7229
  return () => observer.disconnect();
6889
7230
  }, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
6890
- useEffect10(() => {
7231
+ useEffect11(() => {
6891
7232
  const root = scrollRef.current;
6892
7233
  const target = bottomSentinelRef.current;
6893
7234
  if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
@@ -6904,7 +7245,7 @@ function MessageTimeline({
6904
7245
  observer.observe(target);
6905
7246
  return () => observer.disconnect();
6906
7247
  }, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
6907
- useEffect10(() => {
7248
+ useEffect11(() => {
6908
7249
  const node = scrollRef.current;
6909
7250
  const inner = node?.firstElementChild;
6910
7251
  if (!node || !inner || typeof ResizeObserver === "undefined") {
@@ -6940,7 +7281,7 @@ function MessageTimeline({
6940
7281
  }
6941
7282
  };
6942
7283
  }, [autoFollow, driveFollow, snapToBottom]);
6943
- useEffect10(() => {
7284
+ useEffect11(() => {
6944
7285
  if (hasNewer) {
6945
7286
  stopFollow();
6946
7287
  applyPinned(false);
@@ -7063,8 +7404,16 @@ function MessageTimeline({
7063
7404
  }
7064
7405
  releasePinAfterScrollSettled(node);
7065
7406
  };
7066
- return /* @__PURE__ */ jsx17(LightboxProvider, { children: /* @__PURE__ */ jsx17(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx17(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx17(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx17(EntranceAnimationProvider, { value: !bulkRender, children: /* @__PURE__ */ jsx17(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsxs14("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
7067
- /* @__PURE__ */ jsx17(
7407
+ return /* @__PURE__ */ jsx18(LightboxProvider, { children: /* @__PURE__ */ jsx18(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx18(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx18(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx18(EntranceAnimationProvider, { value: !bulkRender, children: /* @__PURE__ */ jsx18(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsxs14("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
7408
+ onAnnotate ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
7409
+ TimelineAnnotationSelection,
7410
+ {
7411
+ rootRef: scrollRef,
7412
+ sources: annotationSources,
7413
+ onAnnotate
7414
+ }
7415
+ ) }) : null,
7416
+ /* @__PURE__ */ jsx18(
7068
7417
  "div",
7069
7418
  {
7070
7419
  ref: scrollRef,
@@ -7084,11 +7433,11 @@ function MessageTimeline({
7084
7433
  autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
7085
7434
  ),
7086
7435
  children: /* @__PURE__ */ jsxs14("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
7087
- groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx17("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
7436
+ groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx18("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
7088
7437
  hasOlder && olderPrefetchArmed ? (
7089
7438
  // Overlaid, not a layout row: mounting/unmounting the sentinel
7090
7439
  // must never shift content (that shift was itself a wobble).
7091
- /* @__PURE__ */ jsx17(
7440
+ /* @__PURE__ */ jsx18(
7092
7441
  "div",
7093
7442
  {
7094
7443
  ref: topSentinelRef,
@@ -7102,7 +7451,7 @@ function MessageTimeline({
7102
7451
  groups.map(({ group, key }, index) => {
7103
7452
  const next = groups[index + 1]?.group;
7104
7453
  const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && next?.kind === "item" && next.item.kind === "context-compaction" && next.item.phase === "compacted" ? 1 : 0;
7105
- return /* @__PURE__ */ jsx17("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx17(
7454
+ return /* @__PURE__ */ jsx18("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx18(
7106
7455
  TimelineGroupRenderBoundary,
7107
7456
  {
7108
7457
  resetKeys: [
@@ -7114,9 +7463,11 @@ function MessageTimeline({
7114
7463
  resolveProviderLogo,
7115
7464
  toolRegistry,
7116
7465
  loadRetainedScreenshot,
7466
+ loadRetainedArtifact,
7467
+ loadVideoArtifactPlayback,
7117
7468
  turnSummary
7118
7469
  ],
7119
- children: /* @__PURE__ */ jsx17(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx17(
7470
+ children: /* @__PURE__ */ jsx18(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx18(
7120
7471
  TimelineGroupView,
7121
7472
  {
7122
7473
  group,
@@ -7127,6 +7478,8 @@ function MessageTimeline({
7127
7478
  resolveProviderLogo,
7128
7479
  toolRegistry,
7129
7480
  loadRetainedScreenshot,
7481
+ loadRetainedArtifact,
7482
+ loadVideoArtifactPlayback,
7130
7483
  turnSummary,
7131
7484
  foldLiveCluster: isAgentProgress(next),
7132
7485
  trailingAgentText: trailingAgentTextAfterTurn(group, next),
@@ -7136,8 +7489,8 @@ function MessageTimeline({
7136
7489
  }
7137
7490
  ) }, key);
7138
7491
  }),
7139
- groups.length > 0 && trailingState ? /* @__PURE__ */ jsx17("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7140
- hasNewer ? /* @__PURE__ */ jsx17(
7492
+ groups.length > 0 && trailingState ? /* @__PURE__ */ jsx18("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7493
+ hasNewer ? /* @__PURE__ */ jsx18(
7141
7494
  "div",
7142
7495
  {
7143
7496
  ref: bottomSentinelRef,
@@ -7150,7 +7503,7 @@ function MessageTimeline({
7150
7503
  ] })
7151
7504
  }
7152
7505
  ),
7153
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
7506
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
7154
7507
  // Floating over the scroller (not a timeline row) so showing and
7155
7508
  // hiding it never reflows history under the reader.
7156
7509
  /* @__PURE__ */ jsxs14(
@@ -7164,7 +7517,7 @@ function MessageTimeline({
7164
7517
  "aria-live": "polite",
7165
7518
  className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
7166
7519
  children: [
7167
- loadingOlder || loadingOldest ? /* @__PURE__ */ jsx17("span", { className: "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
7520
+ loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className: "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
7168
7521
  hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs14(
7169
7522
  "button",
7170
7523
  {
@@ -7201,7 +7554,7 @@ function MessageTimeline({
7201
7554
  "hover:border-og-border-strong disabled:opacity-60"
7202
7555
  ),
7203
7556
  children: [
7204
- /* @__PURE__ */ jsx17(ArrowUpToLineIcon, { className: "size-3.5" }),
7557
+ /* @__PURE__ */ jsx18(ArrowUpToLineIcon, { className: "size-3.5" }),
7205
7558
  "Jump to start"
7206
7559
  ]
7207
7560
  }
@@ -7210,7 +7563,7 @@ function MessageTimeline({
7210
7563
  }
7211
7564
  )
7212
7565
  ) : null }),
7213
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx17(
7566
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx18(
7214
7567
  motion3.div,
7215
7568
  {
7216
7569
  initial: { opacity: 0, y: 6 },
@@ -7220,10 +7573,10 @@ function MessageTimeline({
7220
7573
  "data-og-loading-newer": "",
7221
7574
  "aria-live": "polite",
7222
7575
  className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
7223
- children: /* @__PURE__ */ jsx17("span", { className: "inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
7576
+ children: /* @__PURE__ */ jsx18("span", { className: "inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
7224
7577
  }
7225
7578
  ) : null }),
7226
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
7579
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
7227
7580
  motion3.button,
7228
7581
  {
7229
7582
  type: "button",
@@ -7268,7 +7621,7 @@ function MessageTimeline({
7268
7621
  "hover:border-og-border-strong"
7269
7622
  ),
7270
7623
  children: [
7271
- /* @__PURE__ */ jsx17(ArrowDownIcon2, { className: "size-3.5" }),
7624
+ /* @__PURE__ */ jsx18(ArrowDownIcon2, { className: "size-3.5" }),
7272
7625
  "Jump to latest"
7273
7626
  ]
7274
7627
  }
@@ -7276,7 +7629,7 @@ function MessageTimeline({
7276
7629
  ] }) }) }) }) }) }) });
7277
7630
  }
7278
7631
  function useStableTimelineGroupKeys(allGroups) {
7279
- const previousRef = useRef10([]);
7632
+ const previousRef = useRef11([]);
7280
7633
  const keyedGroups = useMemo5(() => {
7281
7634
  const previousByItemId = /* @__PURE__ */ new Map();
7282
7635
  for (const previous of previousRef.current) {
@@ -7350,10 +7703,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
7350
7703
  role: "status",
7351
7704
  className: "flex items-start gap-2 rounded-lg border border-og-border bg-og-surface-muted px-3 py-2 text-og-menu text-og-fg-muted",
7352
7705
  children: [
7353
- /* @__PURE__ */ jsx17(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
7706
+ /* @__PURE__ */ jsx18(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
7354
7707
  /* @__PURE__ */ jsxs14("div", { children: [
7355
- /* @__PURE__ */ jsx17("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
7356
- /* @__PURE__ */ jsx17("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
7708
+ /* @__PURE__ */ jsx18("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
7709
+ /* @__PURE__ */ jsx18("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
7357
7710
  ] })
7358
7711
  ]
7359
7712
  }
@@ -7371,6 +7724,8 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7371
7724
  resolveProviderLogo,
7372
7725
  toolRegistry,
7373
7726
  loadRetainedScreenshot,
7727
+ loadRetainedArtifact,
7728
+ loadVideoArtifactPlayback,
7374
7729
  turnSummary,
7375
7730
  insideTurn = false,
7376
7731
  nestClusterChips = false,
@@ -7382,8 +7737,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7382
7737
  const settleChrome = useTurnSettleOpen();
7383
7738
  const foldMemory = useFoldMemory();
7384
7739
  const activityShouldFold = group.kind === "activity" && Boolean(group.outcome || foldLiveCluster && clusterIsSettled(group));
7740
+ const containsGeneratedImage = timelineGroupContainsGeneratedImage(group);
7385
7741
  const liveActivitySettle = useLiveSettleFold(activityShouldFold && !insideTurn);
7386
- const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group));
7742
+ const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group) || containsGeneratedImage);
7387
7743
  if (group.kind === "turn" && foldMemory && !insideTurn) {
7388
7744
  inheritFoldRestingState(
7389
7745
  foldMemory,
@@ -7395,9 +7751,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7395
7751
  switch (group.kind) {
7396
7752
  case "activity":
7397
7753
  if (insideTurn) {
7398
- const useNestedChip = nestClusterChips && activityShouldFold;
7754
+ const useNestedChip = nestClusterChips && activityShouldFold && !containsGeneratedImage;
7399
7755
  if (!useNestedChip) {
7400
- return /* @__PURE__ */ jsx17(
7756
+ return /* @__PURE__ */ jsx18(
7401
7757
  ActivityRail,
7402
7758
  {
7403
7759
  items: group.items,
@@ -7405,11 +7761,12 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7405
7761
  onMemoryClick,
7406
7762
  toolRegistry,
7407
7763
  loadRetainedScreenshot,
7764
+ loadRetainedArtifact,
7408
7765
  bare: true
7409
7766
  }
7410
7767
  );
7411
7768
  }
7412
- return /* @__PURE__ */ jsx17(
7769
+ return /* @__PURE__ */ jsx18(
7413
7770
  TurnSummary,
7414
7771
  {
7415
7772
  items: group.items,
@@ -7420,7 +7777,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7420
7777
  foldKey: group.id,
7421
7778
  facets: turnSummary?.facets,
7422
7779
  contextCompactionCount,
7423
- children: /* @__PURE__ */ jsx17(
7780
+ children: /* @__PURE__ */ jsx18(
7424
7781
  ActivityRail,
7425
7782
  {
7426
7783
  items: group.items,
@@ -7428,6 +7785,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7428
7785
  onMemoryClick,
7429
7786
  toolRegistry,
7430
7787
  loadRetainedScreenshot,
7788
+ loadRetainedArtifact,
7431
7789
  bare: true
7432
7790
  }
7433
7791
  )
@@ -7435,7 +7793,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7435
7793
  settleChrome ? "settle" : "rest"
7436
7794
  );
7437
7795
  }
7438
- return /* @__PURE__ */ jsx17(
7796
+ return /* @__PURE__ */ jsx18(
7439
7797
  TurnSummary,
7440
7798
  {
7441
7799
  items: group.items,
@@ -7446,7 +7804,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7446
7804
  facets: turnSummary?.facets,
7447
7805
  settleFold,
7448
7806
  contextCompactionCount,
7449
- children: /* @__PURE__ */ jsx17(FoldBody, { children: /* @__PURE__ */ jsx17(TurnRailFrame, { children: /* @__PURE__ */ jsx17(
7807
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: /* @__PURE__ */ jsx18(TurnRailFrame, { children: /* @__PURE__ */ jsx18(
7450
7808
  ActivityRail,
7451
7809
  {
7452
7810
  items: group.items,
@@ -7454,6 +7812,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7454
7812
  onMemoryClick,
7455
7813
  toolRegistry,
7456
7814
  loadRetainedScreenshot,
7815
+ loadRetainedArtifact,
7457
7816
  bare: true
7458
7817
  }
7459
7818
  ) }) })
@@ -7465,7 +7824,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7465
7824
  const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
7466
7825
  const body = group.groups.map((child) => {
7467
7826
  const key = timelineGroupKey(child);
7468
- return /* @__PURE__ */ jsx17(
7827
+ return /* @__PURE__ */ jsx18(
7469
7828
  TimelineGroupRenderBoundary,
7470
7829
  {
7471
7830
  resetKeys: [
@@ -7477,9 +7836,11 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7477
7836
  resolveProviderLogo,
7478
7837
  toolRegistry,
7479
7838
  loadRetainedScreenshot,
7839
+ loadRetainedArtifact,
7840
+ loadVideoArtifactPlayback,
7480
7841
  turnSummary
7481
7842
  ],
7482
- children: /* @__PURE__ */ jsx17(
7843
+ children: /* @__PURE__ */ jsx18(
7483
7844
  TimelineGroupView2,
7484
7845
  {
7485
7846
  group: child,
@@ -7490,6 +7851,8 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7490
7851
  resolveProviderLogo,
7491
7852
  toolRegistry,
7492
7853
  loadRetainedScreenshot,
7854
+ loadRetainedArtifact,
7855
+ loadVideoArtifactPlayback,
7493
7856
  turnSummary,
7494
7857
  insideTurn: true,
7495
7858
  nestClusterChips: nestClusters
@@ -7499,7 +7862,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7499
7862
  key
7500
7863
  );
7501
7864
  });
7502
- return /* @__PURE__ */ jsx17(
7865
+ return /* @__PURE__ */ jsx18(
7503
7866
  TurnSummary,
7504
7867
  {
7505
7868
  items: activityItems,
@@ -7513,36 +7876,37 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7513
7876
  settleFold,
7514
7877
  copyText: insideTurn ? void 0 : turnCopyText,
7515
7878
  contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
7516
- children: /* @__PURE__ */ jsx17(FoldBody, { children: insideTurn ? (
7879
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: insideTurn ? (
7517
7880
  // A nested turn is already on an ancestor rail — its body just stacks
7518
7881
  // flush (the bare-node body already indents it), so no second rule.
7519
- /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4", children: body })
7520
- ) : /* @__PURE__ */ jsx17(TurnRailFrame, { children: body }) })
7882
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4", children: body })
7883
+ ) : /* @__PURE__ */ jsx18(TurnRailFrame, { children: body }) })
7521
7884
  }
7522
7885
  );
7523
7886
  }
7524
7887
  case "item":
7525
- return /* @__PURE__ */ jsx17(
7888
+ return /* @__PURE__ */ jsx18(
7526
7889
  TimelineRow,
7527
7890
  {
7528
7891
  item: group.item,
7529
7892
  renderMessageText,
7530
7893
  onReconnect,
7531
7894
  resolveProviderLogo,
7532
- onOpenSession
7895
+ onOpenSession,
7896
+ loadVideoArtifactPlayback
7533
7897
  }
7534
7898
  );
7535
7899
  }
7536
7900
  });
7537
7901
  function FoldBody({ children }) {
7538
- return /* @__PURE__ */ jsx17(Fragment7, { children });
7902
+ return /* @__PURE__ */ jsx18(Fragment7, { children });
7539
7903
  }
7540
7904
  function TurnRailFrame({ children }) {
7541
- return /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
7905
+ return /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
7542
7906
  }
7543
7907
  function useLiveSettleFold(folded) {
7544
- const previousFoldedRef = useRef10(folded);
7545
- const latchedRef = useRef10(false);
7908
+ const previousFoldedRef = useRef11(folded);
7909
+ const latchedRef = useRef11(false);
7546
7910
  if (!previousFoldedRef.current && folded) {
7547
7911
  latchedRef.current = true;
7548
7912
  }
@@ -7571,6 +7935,18 @@ function timelineGroupContainsAuthNeeded(group) {
7571
7935
  return group.groups.some(timelineGroupContainsAuthNeeded);
7572
7936
  }
7573
7937
  }
7938
+ function timelineGroupContainsGeneratedImage(group) {
7939
+ switch (group.kind) {
7940
+ case "item":
7941
+ return false;
7942
+ case "activity":
7943
+ return group.items.some(
7944
+ (item) => item.kind === "tool-call" && item.name === "generate_image"
7945
+ );
7946
+ case "turn":
7947
+ return group.groups.some(timelineGroupContainsGeneratedImage);
7948
+ }
7949
+ }
7574
7950
  function timelineGroupItemIds(group) {
7575
7951
  switch (group.kind) {
7576
7952
  case "item":
@@ -7696,27 +8072,28 @@ function TimelineRow({
7696
8072
  renderMessageText,
7697
8073
  onReconnect,
7698
8074
  resolveProviderLogo,
7699
- onOpenSession
8075
+ onOpenSession,
8076
+ loadVideoArtifactPlayback
7700
8077
  }) {
7701
8078
  switch (item.kind) {
7702
8079
  case "user-message":
7703
- return /* @__PURE__ */ jsx17(UserMessageRow, { item, renderMessageText });
8080
+ return /* @__PURE__ */ jsx18(UserMessageRow, { item, renderMessageText });
7704
8081
  case "agent-message":
7705
- return /* @__PURE__ */ jsx17(AgentMessageRow, { item, renderMessageText });
8082
+ return /* @__PURE__ */ jsx18(AgentMessageRow, { item, renderMessageText });
7706
8083
  case "worker-completion":
7707
- return /* @__PURE__ */ jsx17(WorkerCompletionRow, { item, onOpenSession });
8084
+ return /* @__PURE__ */ jsx18(WorkerCompletionRow, { item, onOpenSession });
7708
8085
  case "session-status":
7709
- return /* @__PURE__ */ jsx17(SessionStatusRow, { item });
8086
+ return /* @__PURE__ */ jsx18(SessionStatusRow, { item });
7710
8087
  case "goal":
7711
- return /* @__PURE__ */ jsx17(GoalRow, { item });
8088
+ return /* @__PURE__ */ jsx18(GoalRow, { item });
7712
8089
  case "machine-input-batch":
7713
- return /* @__PURE__ */ jsx17(MachineInputBatchRow, { item });
8090
+ return /* @__PURE__ */ jsx18(MachineInputBatchRow, { item, loadVideoArtifactPlayback });
7714
8091
  case "notice":
7715
- return /* @__PURE__ */ jsx17(NoticeRow, { item });
8092
+ return /* @__PURE__ */ jsx18(NoticeRow, { item });
7716
8093
  case "context-compaction":
7717
- return /* @__PURE__ */ jsx17(CompactionRow, { item });
8094
+ return /* @__PURE__ */ jsx18(CompactionRow, { item });
7718
8095
  case "auth-needed":
7719
- return /* @__PURE__ */ jsx17(
8096
+ return /* @__PURE__ */ jsx18(
7720
8097
  AuthNeededRow,
7721
8098
  {
7722
8099
  item,
@@ -7742,7 +8119,7 @@ function CompactionRow({ item }) {
7742
8119
  const title = item.phase === "started" ? "Compacting conversation history\u2026" : item.phase === "compacted" ? before && after ? `Conversation history compacted \xB7 ~${before} \u2192 ~${after} estimated history tokens` : "Conversation history compacted" : "Couldn\u2019t compact conversation history";
7743
8120
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
7744
8121
  const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
7745
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
8122
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
7746
8123
  "div",
7747
8124
  {
7748
8125
  className: cn(
@@ -7752,13 +8129,13 @@ function CompactionRow({ item }) {
7752
8129
  role: "status",
7753
8130
  children: [
7754
8131
  /* @__PURE__ */ jsxs14("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
7755
- /* @__PURE__ */ jsx17(ShrinkIcon, { className: "size-3.5 shrink-0" }),
8132
+ /* @__PURE__ */ jsx18(ShrinkIcon, { className: "size-3.5 shrink-0" }),
7756
8133
  /* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
7757
8134
  title,
7758
8135
  trigger ? ` \xB7 ${trigger}` : ""
7759
8136
  ] })
7760
8137
  ] }),
7761
- subtitle ? /* @__PURE__ */ jsx17("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
8138
+ subtitle ? /* @__PURE__ */ jsx18("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
7762
8139
  ]
7763
8140
  }
7764
8141
  ) });
@@ -7778,7 +8155,7 @@ function compactionSkipSubtitle(reason) {
7778
8155
  }
7779
8156
  }
7780
8157
  function MessageFooterTime({ occurredAt }) {
7781
- return /* @__PURE__ */ jsx17(
8158
+ return /* @__PURE__ */ jsx18(
7782
8159
  "time",
7783
8160
  {
7784
8161
  dateTime: occurredAt,
@@ -7796,34 +8173,68 @@ function UserMessageRow({
7796
8173
  renderMessageText
7797
8174
  }) {
7798
8175
  const enter = useEntranceAnimation();
7799
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsx17("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: /* @__PURE__ */ jsx17(
7800
- CopyHoverFrame,
7801
- {
7802
- copyText: item.text,
7803
- label: "Copy message",
7804
- className: "w-fit max-w-full min-w-0",
7805
- trailing: /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
7806
- children: /* @__PURE__ */ jsx17("div", { className: "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg", children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx17(Markdown, { children: item.text }) }) })
7807
- }
7808
- ) }) });
8176
+ const deliveryLabel = item.delivery?.state === "sending" ? "Sending\u2026" : item.delivery?.state === "queued" ? "Queued" : item.delivery?.state === "failed" ? "Not sent" : null;
8177
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs14("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
8178
+ /* @__PURE__ */ jsx18(
8179
+ CopyHoverFrame,
8180
+ {
8181
+ copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
8182
+ ${annotation.note}`).join("\n\n"),
8183
+ label: "Copy message",
8184
+ className: "w-fit max-w-full min-w-0",
8185
+ trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
8186
+ children: /* @__PURE__ */ jsxs14("div", { className: "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg", children: [
8187
+ item.text ? /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx18(Markdown, { children: item.text }) }) }) : null,
8188
+ (item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx18(
8189
+ TimelineAnnotationsChip,
8190
+ {
8191
+ annotations: item.annotations ?? [],
8192
+ className: item.text ? "mt-2" : void 0
8193
+ }
8194
+ ) : null
8195
+ ] })
8196
+ }
8197
+ ),
8198
+ deliveryLabel ? /* @__PURE__ */ jsxs14("div", { className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-fg-subtle", children: [
8199
+ /* @__PURE__ */ jsx18("span", { title: item.delivery?.error, children: deliveryLabel }),
8200
+ item.delivery?.state === "failed" && item.delivery.onRetry ? /* @__PURE__ */ jsx18(
8201
+ "button",
8202
+ {
8203
+ type: "button",
8204
+ className: "font-medium text-og-fg underline decoration-og-border underline-offset-2 hover:text-og-fg-strong",
8205
+ onClick: item.delivery.onRetry,
8206
+ children: "Retry"
8207
+ }
8208
+ ) : null,
8209
+ item.delivery?.state === "failed" && item.delivery.onRemove ? /* @__PURE__ */ jsx18(
8210
+ "button",
8211
+ {
8212
+ type: "button",
8213
+ className: "font-medium text-og-fg-subtle underline decoration-og-border underline-offset-2 hover:text-og-fg",
8214
+ onClick: item.delivery.onRemove,
8215
+ children: "Remove"
8216
+ }
8217
+ ) : null
8218
+ ] }) : null
8219
+ ] }) });
7809
8220
  }
7810
8221
  function AgentMessageRow({
7811
8222
  item,
7812
8223
  renderMessageText
7813
8224
  }) {
7814
8225
  const enter = useEntranceAnimation();
7815
- const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(Markdown, { streaming: item.streaming, children: item.text });
7816
- return /* @__PURE__ */ jsx17(
8226
+ const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(Markdown, { streaming: item.streaming, children: item.text });
8227
+ return /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: /* @__PURE__ */ jsx18(
7817
8228
  CopyHoverFrame,
7818
8229
  {
7819
8230
  copyText: item.text,
7820
8231
  label: "Copy message",
7821
8232
  align: "start",
7822
8233
  className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
7823
- trailing: item.streaming ? null : /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
8234
+ trailing: item.streaming ? null : /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
7824
8235
  children: body
7825
8236
  }
7826
- );
8237
+ ) });
7827
8238
  }
7828
8239
  function workerCompletionMeta(item) {
7829
8240
  if (item.childStatus === "failed") {
@@ -7862,7 +8273,7 @@ function WorkerCompletionRow({
7862
8273
  onOpenSession
7863
8274
  }) {
7864
8275
  const enter = useEntranceAnimation();
7865
- const [open, setOpen] = useState13(false);
8276
+ const [open, setOpen] = useState14(false);
7866
8277
  const meta = workerCompletionMeta(item);
7867
8278
  const Icon = meta.icon;
7868
8279
  const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && Boolean(item.pausedReason?.trim());
@@ -7872,11 +8283,11 @@ function WorkerCompletionRow({
7872
8283
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
7873
8284
  ];
7874
8285
  const hasDetails = details.length > 0;
7875
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
8286
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
7876
8287
  /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2.5", children: [
7877
- /* @__PURE__ */ jsx17("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx17(Icon, { className: "size-4" }) }),
7878
- /* @__PURE__ */ jsx17("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs14("p", { className: "text-og-base leading-5 text-og-fg", children: [
7879
- /* @__PURE__ */ jsx17("span", { className: "font-medium", children: meta.label }),
8288
+ /* @__PURE__ */ jsx18("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx18(Icon, { className: "size-4" }) }),
8289
+ /* @__PURE__ */ jsx18("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs14("p", { className: "text-og-base leading-5 text-og-fg", children: [
8290
+ /* @__PURE__ */ jsx18("span", { className: "font-medium", children: meta.label }),
7880
8291
  item.goalText ? /* @__PURE__ */ jsxs14("span", { className: "text-og-fg-muted", children: [
7881
8292
  " \xB7 ",
7882
8293
  truncate(item.goalText, 90)
@@ -7894,13 +8305,13 @@ function WorkerCompletionRow({
7894
8305
  ),
7895
8306
  children: [
7896
8307
  "View session",
7897
- /* @__PURE__ */ jsx17(ArrowRightIcon2, { className: "size-3.5" })
8308
+ /* @__PURE__ */ jsx18(ArrowRightIcon2, { className: "size-3.5" })
7898
8309
  ]
7899
8310
  }
7900
8311
  ) : null
7901
8312
  ] }),
7902
8313
  hasDetails ? /* @__PURE__ */ jsxs14(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
7903
- /* @__PURE__ */ jsx17(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
8314
+ /* @__PURE__ */ jsx18(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
7904
8315
  "button",
7905
8316
  {
7906
8317
  type: "button",
@@ -7909,14 +8320,14 @@ function WorkerCompletionRow({
7909
8320
  "outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
7910
8321
  ),
7911
8322
  children: [
7912
- /* @__PURE__ */ jsx17(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
8323
+ /* @__PURE__ */ jsx18(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
7913
8324
  open ? "Hide details" : "Show details"
7914
8325
  ]
7915
8326
  }
7916
8327
  ) }),
7917
- /* @__PURE__ */ jsx17(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx17("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
7918
- /* @__PURE__ */ jsx17("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
7919
- /* @__PURE__ */ jsx17(
8328
+ /* @__PURE__ */ jsx18(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx18("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
8329
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
8330
+ /* @__PURE__ */ jsx18(
7920
8331
  "p",
7921
8332
  {
7922
8333
  className: cn(
@@ -7942,14 +8353,14 @@ function SessionStatusRow({ item }) {
7942
8353
  ),
7943
8354
  role: "status",
7944
8355
  children: [
7945
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" }),
8356
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" }),
7946
8357
  /* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1.5", children: [
7947
- /* @__PURE__ */ jsx17(StatusDot, { status: item.status, className: "size-1" }),
8358
+ /* @__PURE__ */ jsx18(StatusDot, { status: item.status, className: "size-1" }),
7948
8359
  meta.label.toLowerCase(),
7949
8360
  " \xB7 ",
7950
8361
  formatRelativeTime(item.occurredAt)
7951
8362
  ] }),
7952
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" })
8363
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" })
7953
8364
  ]
7954
8365
  }
7955
8366
  );
@@ -7979,7 +8390,7 @@ var GOAL_META = {
7979
8390
  function GoalRow({ item }) {
7980
8391
  const enter = useEntranceAnimation();
7981
8392
  const { label, pill, icon: Icon } = GOAL_META[item.action];
7982
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
8393
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
7983
8394
  "span",
7984
8395
  {
7985
8396
  className: cn(
@@ -7987,7 +8398,7 @@ function GoalRow({ item }) {
7987
8398
  pill
7988
8399
  ),
7989
8400
  children: [
7990
- /* @__PURE__ */ jsx17(Icon, { className: "size-3.5 shrink-0" }),
8401
+ /* @__PURE__ */ jsx18(Icon, { className: "size-3.5 shrink-0" }),
7991
8402
  /* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
7992
8403
  label,
7993
8404
  item.text ? `: ${truncate(item.text, 90)}` : ""
@@ -7996,15 +8407,27 @@ function GoalRow({ item }) {
7996
8407
  }
7997
8408
  ) });
7998
8409
  }
7999
- function MachineInputBatchRow({ item }) {
8410
+ function MachineInputBatchRow({
8411
+ item,
8412
+ loadVideoArtifactPlayback
8413
+ }) {
8000
8414
  const enter = useEntranceAnimation();
8001
8415
  const label = machineInputBatchLabel(item.members);
8002
8416
  const single = item.members.length === 1 ? item.members[0] : null;
8417
+ if (single?.kind === "media_generation_result" && single.result) {
8418
+ return /* @__PURE__ */ jsx18(
8419
+ VideoGenerationResultRow,
8420
+ {
8421
+ result: single.result,
8422
+ loadVideoArtifactPlayback
8423
+ }
8424
+ );
8425
+ }
8003
8426
  const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
8004
8427
  const showCollapsedSummary = single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
8005
8428
  return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
8006
8429
  /* @__PURE__ */ jsxs14("details", { className: "group w-full max-w-full", "data-og-machine-input-batch": "", children: [
8007
- /* @__PURE__ */ jsx17("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs14(
8430
+ /* @__PURE__ */ jsx18("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs14(
8008
8431
  "span",
8009
8432
  {
8010
8433
  className: cn(
@@ -8012,37 +8435,122 @@ function MachineInputBatchRow({ item }) {
8012
8435
  NEUTRAL_PILL
8013
8436
  ),
8014
8437
  children: [
8015
- /* @__PURE__ */ jsx17(
8438
+ /* @__PURE__ */ jsx18(
8016
8439
  ChevronRightIcon3,
8017
8440
  {
8018
8441
  "aria-hidden": true,
8019
8442
  className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
8020
8443
  }
8021
8444
  ),
8022
- /* @__PURE__ */ jsx17("span", { className: "truncate", children: label })
8445
+ /* @__PURE__ */ jsx18("span", { className: "truncate", children: label })
8023
8446
  ]
8024
8447
  }
8025
8448
  ) }),
8026
- /* @__PURE__ */ jsx17("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: item.members.map((member) => /* @__PURE__ */ jsx17(MachineInputRow, { member }, member.id)) })
8449
+ /* @__PURE__ */ jsx18("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: item.members.map((member) => /* @__PURE__ */ jsx18(
8450
+ MachineInputRow,
8451
+ {
8452
+ member,
8453
+ loadVideoArtifactPlayback
8454
+ },
8455
+ member.id
8456
+ )) })
8027
8457
  ] }),
8028
- showCollapsedSummary ? /* @__PURE__ */ jsx17("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
8458
+ showCollapsedSummary ? /* @__PURE__ */ jsx18("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
8029
8459
  ] });
8030
8460
  }
8031
- function MachineInputRow({ member }) {
8461
+ function MachineInputRow({
8462
+ member,
8463
+ loadVideoArtifactPlayback
8464
+ }) {
8465
+ if (member.kind === "media_generation_result" && member.result) {
8466
+ return /* @__PURE__ */ jsx18(
8467
+ VideoGenerationResultRow,
8468
+ {
8469
+ result: member.result,
8470
+ loadVideoArtifactPlayback,
8471
+ compact: true
8472
+ }
8473
+ );
8474
+ }
8032
8475
  const source = readableMachineInputSource(member.sourceId);
8033
8476
  const summary = cleanMachineInputSummary(member.summary);
8034
8477
  return /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-start gap-2.5", children: [
8035
- /* @__PURE__ */ jsx17("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
8478
+ /* @__PURE__ */ jsx18("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
8036
8479
  /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
8037
- /* @__PURE__ */ jsx17("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
8480
+ /* @__PURE__ */ jsx18("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
8038
8481
  source && /* @__PURE__ */ jsxs14("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
8039
8482
  "from ",
8040
8483
  source
8041
8484
  ] }),
8042
- summary ? /* @__PURE__ */ jsx17("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-og-menu leading-5 text-og-fg", children: truncate(summary, 320) }) : null
8485
+ summary ? /* @__PURE__ */ jsx18("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-og-menu leading-5 text-og-fg", children: truncate(summary, 320) }) : null
8043
8486
  ] })
8044
8487
  ] });
8045
8488
  }
8489
+ function VideoGenerationResultRow({
8490
+ result,
8491
+ loadVideoArtifactPlayback,
8492
+ compact = false
8493
+ }) {
8494
+ const enter = useEntranceAnimation();
8495
+ if (result.status !== "ready") {
8496
+ return /* @__PURE__ */ jsxs14(
8497
+ "div",
8498
+ {
8499
+ className: cn(
8500
+ enter && "animate-og-enter",
8501
+ "mx-auto w-full max-w-lg rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3.5 py-3"
8502
+ ),
8503
+ children: [
8504
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
8505
+ /* @__PURE__ */ jsx18(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
8506
+ "Video generation failed"
8507
+ ] }),
8508
+ /* @__PURE__ */ jsx18("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
8509
+ ]
8510
+ }
8511
+ );
8512
+ }
8513
+ const { receipt } = result;
8514
+ const facts = receipt.video;
8515
+ return /* @__PURE__ */ jsxs14(
8516
+ "section",
8517
+ {
8518
+ "aria-label": "Generated video",
8519
+ className: cn(
8520
+ enter && "animate-og-enter",
8521
+ "mx-auto w-full max-w-2xl overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 shadow-sm",
8522
+ compact && "max-w-lg"
8523
+ ),
8524
+ children: [
8525
+ loadVideoArtifactPlayback ? /* @__PURE__ */ jsx18(
8526
+ GeneratedVideoPlayer,
8527
+ {
8528
+ receipt,
8529
+ loadPlaybackSource: loadVideoArtifactPlayback,
8530
+ className: "rounded-none border-0 shadow-none"
8531
+ }
8532
+ ) : /* @__PURE__ */ jsx18("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx18(PlayIcon2, { "aria-hidden": true, className: "size-6" }) }),
8533
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
8534
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
8535
+ /* @__PURE__ */ jsx18("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
8536
+ /* @__PURE__ */ jsxs14("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
8537
+ facts.width,
8538
+ "\xD7",
8539
+ facts.height,
8540
+ " \xB7 ",
8541
+ formatVideoDuration(facts.durationSeconds),
8542
+ facts.hasAudio ? " \xB7 Audio" : ""
8543
+ ] })
8544
+ ] }),
8545
+ /* @__PURE__ */ jsx18(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
8546
+ ] })
8547
+ ]
8548
+ }
8549
+ );
8550
+ }
8551
+ function formatVideoDuration(seconds) {
8552
+ return `${Math.round(seconds * 10) / 10}s`;
8553
+ }
8046
8554
  function NoticeRow({ item }) {
8047
8555
  const enter = useEntranceAnimation();
8048
8556
  const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
@@ -8056,20 +8564,20 @@ function NoticeRow({ item }) {
8056
8564
  ),
8057
8565
  role: "status",
8058
8566
  children: [
8059
- /* @__PURE__ */ jsx17(
8567
+ /* @__PURE__ */ jsx18(
8060
8568
  TriangleAlertIcon3,
8061
8569
  {
8062
8570
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
8063
8571
  }
8064
8572
  ),
8065
8573
  /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
8066
- /* @__PURE__ */ jsx17("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
8574
+ /* @__PURE__ */ jsx18("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
8067
8575
  item.details ? /* @__PURE__ */ jsxs14("details", { className: "mt-2 text-og-control", children: [
8068
- /* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
8069
- /* @__PURE__ */ jsx17("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
8576
+ /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
8577
+ /* @__PURE__ */ jsx18("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
8070
8578
  ] }) : null
8071
8579
  ] }),
8072
- item.action ? /* @__PURE__ */ jsx17(
8580
+ item.action ? /* @__PURE__ */ jsx18(
8073
8581
  "a",
8074
8582
  {
8075
8583
  className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
@@ -8089,12 +8597,15 @@ function AuthNeededRow({
8089
8597
  resolveProviderLogo
8090
8598
  }) {
8091
8599
  const enter = useEntranceAnimation();
8092
- const [busy, setBusy] = useState13(false);
8093
- const [failed, setFailed] = useState13(false);
8094
- const provider = item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain);
8600
+ const [busy, setBusy] = useState14(false);
8601
+ const [failed, setFailed] = useState14(false);
8602
+ const recommendation = item.capability ?? null;
8603
+ const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
8095
8604
  const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
8096
8605
  const missing = item.reason === "missing_connection";
8097
- const actionLabel = missing ? "Connect" : "Reconnect";
8606
+ const actionLabel = recommendation ? recommendation.action === "connect" ? "Connect" : "Review" : missing ? "Connect" : "Reconnect";
8607
+ const title = recommendation ? recommendation.action === "connect" ? `Connect ${provider}` : recommendation.action === "add_credentials" ? `Set up ${provider}` : `Enable ${provider}` : unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}`;
8608
+ const reasonLine = recommendation?.rationale ?? authReasonLine(item.reason);
8098
8609
  const start = async () => {
8099
8610
  if (!onReconnect || busy) {
8100
8611
  return;
@@ -8112,7 +8623,7 @@ function AuthNeededRow({
8112
8623
  return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
8113
8624
  /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 rounded-og-lg border border-og-border bg-og-surface-1 px-3.5 py-3 sm:flex-row sm:items-center", children: [
8114
8625
  /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
8115
- /* @__PURE__ */ jsx17(
8626
+ /* @__PURE__ */ jsx18(
8116
8627
  AuthProviderLogo,
8117
8628
  {
8118
8629
  src: resolveProviderLogo?.(item.providerDomain) ?? null,
@@ -8120,8 +8631,16 @@ function AuthNeededRow({
8120
8631
  }
8121
8632
  ),
8122
8633
  /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
8123
- /* @__PURE__ */ jsx17("p", { className: "truncate text-og-md font-medium text-og-fg", children: unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}` }),
8124
- /* @__PURE__ */ jsx17("p", { className: "truncate text-og-sm text-og-fg-subtle", children: authReasonLine(item.reason) })
8634
+ /* @__PURE__ */ jsx18("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
8635
+ /* @__PURE__ */ jsx18("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
8636
+ recommendation ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
8637
+ "Provider: ",
8638
+ item.providerDomain
8639
+ ] }) : null,
8640
+ recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
8641
+ "Needs variables: ",
8642
+ recommendation.requiredVariables.join(", ")
8643
+ ] }) : null
8125
8644
  ] })
8126
8645
  ] }),
8127
8646
  !unavailable && onReconnect ? /* @__PURE__ */ jsxs14(
@@ -8135,7 +8654,7 @@ function AuthNeededRow({
8135
8654
  "transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
8136
8655
  ),
8137
8656
  children: [
8138
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
8657
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
8139
8658
  busy ? "Opening\u2026" : actionLabel
8140
8659
  ]
8141
8660
  }
@@ -8150,17 +8669,13 @@ function AuthNeededRow({
8150
8669
  "transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
8151
8670
  ),
8152
8671
  children: [
8153
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
8672
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
8154
8673
  actionLabel
8155
8674
  ]
8156
8675
  }
8157
8676
  ) : null
8158
8677
  ] }),
8159
- !unavailable ? /* @__PURE__ */ jsxs14("p", { className: "px-1 text-og-xs text-og-fg-subtle", children: [
8160
- "This tool call wasn't replayed. After ",
8161
- missing ? "connecting" : "reconnecting",
8162
- ", send a new message to try again."
8163
- ] }) : null,
8678
+ !unavailable ? /* @__PURE__ */ jsx18("p", { className: "px-1 text-og-xs text-og-fg-subtle", children: recommendation ? "No access has been granted. Review and confirm the provider before continuing." : `This tool call wasn't replayed. After ${missing ? "connecting" : "reconnecting"}, send a new message to try again.` }) : null,
8164
8679
  failed ? /* @__PURE__ */ jsxs14("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
8165
8680
  "Couldn't start ",
8166
8681
  missing ? "connecting" : "reconnecting",
@@ -8171,15 +8686,15 @@ function AuthNeededRow({
8171
8686
  ] });
8172
8687
  }
8173
8688
  function AuthProviderLogo({ src, label }) {
8174
- const [failed, setFailed] = useState13(false);
8175
- useEffect10(() => setFailed(false), [src]);
8689
+ const [failed, setFailed] = useState14(false);
8690
+ useEffect11(() => setFailed(false), [src]);
8176
8691
  const showImage = src && !failed;
8177
- return /* @__PURE__ */ jsx17(
8692
+ return /* @__PURE__ */ jsx18(
8178
8693
  "span",
8179
8694
  {
8180
8695
  className: "relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-og-md border border-og-border bg-og-surface-2 text-og-menu font-semibold text-og-fg-muted",
8181
8696
  "aria-hidden": true,
8182
- children: showImage ? /* @__PURE__ */ jsx17(
8697
+ children: showImage ? /* @__PURE__ */ jsx18(
8183
8698
  "img",
8184
8699
  {
8185
8700
  src,
@@ -8189,7 +8704,7 @@ function AuthProviderLogo({ src, label }) {
8189
8704
  className: "size-full object-contain p-1.5",
8190
8705
  onError: () => setFailed(true)
8191
8706
  }
8192
- ) : /* @__PURE__ */ jsx17("span", { children: monogram(label) })
8707
+ ) : /* @__PURE__ */ jsx18("span", { children: monogram(label) })
8193
8708
  }
8194
8709
  );
8195
8710
  }
@@ -8273,8 +8788,6 @@ export {
8273
8788
  PierreDiff,
8274
8789
  defaultToolRegistry,
8275
8790
  createDefaultToolRegistry,
8276
- copyTextToClipboard,
8277
- tableElementToTsv,
8278
8791
  CopyButton,
8279
8792
  CopyHoverFrame,
8280
8793
  Markdown,
@@ -8283,10 +8796,11 @@ export {
8283
8796
  TurnSummary,
8284
8797
  userMessageLikelyNeedsDisclosure,
8285
8798
  UserMessageBody,
8799
+ GeneratedVideoPlayer,
8286
8800
  SESSION_STATUS_META,
8287
8801
  SessionStatus,
8288
8802
  StatusDot,
8289
8803
  MessageTimeline,
8290
8804
  TimelineRow
8291
8805
  };
8292
- //# sourceMappingURL=chunk-XCNTXWBB.js.map
8806
+ //# sourceMappingURL=chunk-JAGDUCZQ.js.map