@opengeni/react 0.48.0 → 0.57.0

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 (325) hide show
  1. package/README.md +138 -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 +199 -0
  13. package/dist/artifacts.js.map +1 -0
  14. package/dist/{chunk-NJ7M2B6Z.js → chunk-5UQPNLIO.js} +16 -8
  15. package/dist/{chunk-NJ7M2B6Z.js.map → chunk-5UQPNLIO.js.map} +1 -1
  16. package/dist/{chunk-LHLYWG5R.js → chunk-6KLX2RH5.js} +461 -38
  17. package/dist/chunk-6KLX2RH5.js.map +1 -0
  18. package/dist/chunk-7WCLAEFV.js +2828 -0
  19. package/dist/chunk-7WCLAEFV.js.map +1 -0
  20. package/dist/{chunk-I4MPFDRP.js → chunk-B6WPZSTT.js} +104 -104
  21. package/dist/{chunk-I4MPFDRP.js.map → chunk-B6WPZSTT.js.map} +1 -1
  22. package/dist/{chunk-EKZH6IDG.js → chunk-C5ZPSSS5.js} +111 -1
  23. package/dist/chunk-C5ZPSSS5.js.map +1 -0
  24. package/dist/{chunk-OL6QVXGF.js → chunk-HA46CYQK.js} +152 -8
  25. package/dist/chunk-HA46CYQK.js.map +1 -0
  26. package/dist/chunk-HUIKIDM5.js +2148 -0
  27. package/dist/chunk-HUIKIDM5.js.map +1 -0
  28. package/dist/{chunk-FWXGSNXT.js → chunk-IGC6A2ZI.js} +585 -34
  29. package/dist/chunk-IGC6A2ZI.js.map +1 -0
  30. package/dist/chunk-JVYQRRC4.js +53 -0
  31. package/dist/chunk-JVYQRRC4.js.map +1 -0
  32. package/dist/chunk-KCGXPP5V.js +157 -0
  33. package/dist/chunk-KCGXPP5V.js.map +1 -0
  34. package/dist/chunk-LLOLUHVG.js +5937 -0
  35. package/dist/chunk-LLOLUHVG.js.map +1 -0
  36. package/dist/{chunk-WYA65Y3F.js → chunk-MKPIAGVL.js} +13 -3
  37. package/dist/chunk-MKPIAGVL.js.map +1 -0
  38. package/dist/chunk-PEI6RANI.js +3234 -0
  39. package/dist/chunk-PEI6RANI.js.map +1 -0
  40. package/dist/chunk-R3AZOAB5.js +933 -0
  41. package/dist/chunk-R3AZOAB5.js.map +1 -0
  42. package/dist/{chunk-O4VXOBGF.js → chunk-WSK7G5LE.js} +70 -2
  43. package/dist/chunk-WSK7G5LE.js.map +1 -0
  44. package/dist/{chunk-23EJ676W.js → chunk-XBZWOM2K.js} +9 -4
  45. package/dist/chunk-XBZWOM2K.js.map +1 -0
  46. package/dist/{chunk-XCNTXWBB.js → chunk-Y7OEDUJ5.js} +856 -338
  47. package/dist/chunk-Y7OEDUJ5.js.map +1 -0
  48. package/dist/client.d.ts +10 -2
  49. package/dist/clipboard.d.ts +1 -0
  50. package/dist/clipboard.js +7 -0
  51. package/dist/clipboard.js.map +1 -0
  52. package/dist/commands/index.d.ts +3 -3
  53. package/dist/commands/registry.d.ts +1 -1
  54. package/dist/commands/types.d.ts +1 -1
  55. package/dist/components/approval-surface.d.ts +2 -2
  56. package/dist/components/artifacts/artifact-surface.d.ts +18 -0
  57. package/dist/components/artifacts/document-editor.d.ts +172 -0
  58. package/dist/components/artifacts/editable-artifact-ui.d.ts +13 -0
  59. package/dist/components/artifacts/editable-artifact-workbench.d.ts +49 -0
  60. package/dist/components/artifacts/editable-document.d.ts +24 -0
  61. package/dist/components/artifacts/editable-presentation.d.ts +24 -0
  62. package/dist/components/artifacts/editable-spreadsheet.d.ts +32 -0
  63. package/dist/components/artifacts/index.d.ts +9 -0
  64. package/dist/components/artifacts/presentation-editor.d.ts +297 -0
  65. package/dist/components/artifacts/published-html-artifact-frame.d.ts +14 -0
  66. package/dist/components/artifacts/spreadsheet-canvas.d.ts +120 -0
  67. package/dist/components/artifacts/spreadsheet-grid.d.ts +113 -0
  68. package/dist/components/browser-input.d.ts +7 -0
  69. package/dist/components/browser-viewer.d.ts +30 -0
  70. package/dist/components/chat-composer.d.ts +8 -8
  71. package/dist/components/code-editor.d.ts +25 -3
  72. package/dist/components/command-palette.d.ts +2 -2
  73. package/dist/components/composer-transcription-control.d.ts +2 -2
  74. package/dist/components/composer.d.ts +17 -17
  75. package/dist/components/computer-viewer.d.ts +24 -0
  76. package/dist/components/copy-button.d.ts +2 -2
  77. package/dist/components/desktop-viewer.d.ts +50 -22
  78. package/dist/components/diff-view.d.ts +1 -1
  79. package/dist/components/enrollment-consent.d.ts +1 -1
  80. package/dist/components/enrollment-device-flow.d.ts +1 -1
  81. package/dist/components/file-browser.d.ts +2 -2
  82. package/dist/components/fleet-tile.d.ts +1 -1
  83. package/dist/components/generated-video-player.d.ts +10 -0
  84. package/dist/components/human-input-form.d.ts +1 -1
  85. package/dist/components/human-input-surface.d.ts +2 -2
  86. package/dist/components/interaction-intervention-banner.d.ts +11 -0
  87. package/dist/components/interactive-workbench-viewers.d.ts +2 -0
  88. package/dist/components/machine-card.d.ts +2 -2
  89. package/dist/components/machine-dock-bar.d.ts +3 -3
  90. package/dist/components/machine-health-pill.d.ts +2 -2
  91. package/dist/components/machine-input-display.d.ts +1 -1
  92. package/dist/components/machine-metrics.d.ts +2 -2
  93. package/dist/components/machine-status-pill.d.ts +4 -4
  94. package/dist/components/machines/health.d.ts +1 -1
  95. package/dist/components/machines/machine-detail.d.ts +3 -3
  96. package/dist/components/machines/metric-history-chart.d.ts +1 -1
  97. package/dist/components/machines/metric-sparkline.d.ts +2 -2
  98. package/dist/components/machines/series.d.ts +2 -2
  99. package/dist/components/machines-dashboard.d.ts +2 -2
  100. package/dist/components/markdown.d.ts +1 -1
  101. package/dist/components/message-timeline.d.ts +12 -5
  102. package/dist/components/model-picker.d.ts +2 -2
  103. package/dist/components/model-policy-picker.d.ts +7 -7
  104. package/dist/components/pierre-diff.d.ts +1 -1
  105. package/dist/components/pierre-file.d.ts +1 -1
  106. package/dist/components/queue-draft-policy.d.ts +1 -1
  107. package/dist/components/queue-surface-implementation.d.ts +3 -3
  108. package/dist/components/queue-surface-state.d.ts +4 -4
  109. package/dist/components/queue-surface.d.ts +5 -5
  110. package/dist/components/sandbox-files.d.ts +3 -3
  111. package/dist/components/sandbox-terminal.d.ts +24 -4
  112. package/dist/components/sandbox-workspace.d.ts +28 -9
  113. package/dist/components/session-chrome.d.ts +4 -4
  114. package/dist/components/session-status.d.ts +2 -2
  115. package/dist/components/timeline-annotation-selection.d.ts +9 -0
  116. package/dist/components/timeline-annotations-dialog.d.ts +16 -0
  117. package/dist/components/timeline-annotations.d.ts +13 -0
  118. package/dist/components/tooltip.d.ts +4 -4
  119. package/dist/components/user-message-body.d.ts +2 -2
  120. package/dist/components/workbench-changes.d.ts +2 -2
  121. package/dist/components/workspace-dock.d.ts +1 -1
  122. package/dist/composer.d.ts +11 -11
  123. package/dist/composer.js +7 -7
  124. package/dist/hooks/internal.d.ts +1 -1
  125. package/dist/hooks/use-attached-browsers.d.ts +21 -0
  126. package/dist/hooks/use-auth-runs.d.ts +32 -0
  127. package/dist/hooks/use-available-models.d.ts +2 -2
  128. package/dist/hooks/use-billing-usage.d.ts +1 -1
  129. package/dist/hooks/use-browser-downloads.d.ts +25 -0
  130. package/dist/hooks/use-browser-frame-stream.d.ts +28 -0
  131. package/dist/hooks/use-browser-identities.d.ts +30 -0
  132. package/dist/hooks/use-browser-session.d.ts +29 -0
  133. package/dist/hooks/use-browser-sessions.d.ts +32 -0
  134. package/dist/hooks/use-channels.d.ts +26 -0
  135. package/dist/hooks/use-codex-accounts.d.ts +2 -2
  136. package/dist/hooks/use-composer.d.ts +36 -9
  137. package/dist/hooks/use-computer-frame-stream.d.ts +24 -0
  138. package/dist/hooks/use-computer-session.d.ts +29 -0
  139. package/dist/hooks/use-computer-sessions.d.ts +28 -0
  140. package/dist/hooks/use-desktop-stream.d.ts +5 -1
  141. package/dist/hooks/use-environments.d.ts +1 -1
  142. package/dist/hooks/use-file-attachments.d.ts +1 -1
  143. package/dist/hooks/use-goal.d.ts +2 -2
  144. package/dist/hooks/use-human-input.d.ts +2 -2
  145. package/dist/hooks/use-interaction-interventions.d.ts +27 -0
  146. package/dist/hooks/use-interaction-invalidation.d.ts +19 -0
  147. package/dist/hooks/use-last-started-turn-policy.d.ts +2 -2
  148. package/dist/hooks/use-machine-chip.d.ts +2 -2
  149. package/dist/hooks/use-machines.d.ts +4 -4
  150. package/dist/hooks/use-network-routes.d.ts +25 -0
  151. package/dist/hooks/use-packs.d.ts +7 -2
  152. package/dist/hooks/use-rigs.d.ts +1 -1
  153. package/dist/hooks/use-sandbox-files.d.ts +6 -4
  154. package/dist/hooks/use-sandbox-git.d.ts +6 -5
  155. package/dist/hooks/use-sandbox-terminal.d.ts +1 -1
  156. package/dist/hooks/use-scheduled-tasks.d.ts +1 -1
  157. package/dist/hooks/use-session-capabilities.d.ts +5 -4
  158. package/dist/hooks/use-session-control.d.ts +1 -1
  159. package/dist/hooks/use-session-events.d.ts +2 -2
  160. package/dist/hooks/use-session-lineage.d.ts +1 -1
  161. package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
  162. package/dist/hooks/use-session.d.ts +2 -2
  163. package/dist/hooks/use-site-auth-connections.d.ts +25 -0
  164. package/dist/hooks/use-slash-commands.d.ts +1 -1
  165. package/dist/hooks/use-supergrok-accounts.d.ts +26 -0
  166. package/dist/hooks/use-terminal-stream.d.ts +11 -2
  167. package/dist/hooks/use-turn-queue.d.ts +2 -2
  168. package/dist/hooks/use-video-artifact-playback.d.ts +9 -0
  169. package/dist/hooks/use-voice-input.d.ts +1 -1
  170. package/dist/hooks/use-workspace-capture.d.ts +1 -1
  171. package/dist/hooks/use-workspace-edit.d.ts +1 -1
  172. package/dist/hooks/use-workspace-sessions.d.ts +1 -1
  173. package/dist/hooks/use-workspaces.d.ts +1 -1
  174. package/dist/index.d.ts +162 -155
  175. package/dist/index.js +1822 -1703
  176. package/dist/index.js.map +1 -1
  177. package/dist/interaction.d.ts +33 -0
  178. package/dist/interaction.js +550 -0
  179. package/dist/interaction.js.map +1 -0
  180. package/dist/interactive-workbench-viewers-TOHBXJEE.js +15 -0
  181. package/dist/interactive-workbench-viewers-TOHBXJEE.js.map +1 -0
  182. package/dist/lib/host-platform.d.ts +5 -0
  183. package/dist/lib/relay-wire.d.ts +24 -1
  184. package/dist/lib/sandbox-liveness.d.ts +9 -0
  185. package/dist/lib/terminal-capability.d.ts +5 -0
  186. package/dist/lib/xterm-theme.d.ts +1 -1
  187. package/dist/machines.d.ts +30 -30
  188. package/dist/machines.js +2 -2
  189. package/dist/model-policy.d.ts +1 -1
  190. package/dist/model-policy.js +1 -1
  191. package/dist/provider.d.ts +6 -5
  192. package/dist/{queue-surface-implementation-U5JFG7HT.js → queue-surface-implementation-2KVJTYXH.js} +100 -48
  193. package/dist/queue-surface-implementation-2KVJTYXH.js.map +1 -0
  194. package/dist/realtime/dropdown-menu.d.ts +8 -8
  195. package/dist/realtime/realtime-control.d.ts +8 -8
  196. package/dist/realtime.d.ts +4 -4
  197. package/dist/realtime.js +38 -11
  198. package/dist/realtime.js.map +1 -1
  199. package/dist/session-context.d.ts +28 -2
  200. package/dist/session-ui.d.ts +14 -14
  201. package/dist/session-ui.js +5 -4
  202. package/dist/session.d.ts +28 -28
  203. package/dist/session.js +10 -10
  204. package/dist/timeline/activity-rail.d.ts +5 -3
  205. package/dist/timeline/disclosure-context.d.ts +1 -1
  206. package/dist/timeline/fleet-decision-projection.d.ts +1 -1
  207. package/dist/timeline/fleet-decision-row.d.ts +3 -3
  208. package/dist/timeline/index.d.ts +19 -19
  209. package/dist/timeline/parsers.d.ts +4 -1
  210. package/dist/timeline/projection.d.ts +3 -3
  211. package/dist/timeline/registry.d.ts +8 -2
  212. package/dist/timeline/screenshot-lightbox.d.ts +2 -2
  213. package/dist/timeline/shared.d.ts +21 -10
  214. package/dist/timeline/tool-diff.d.ts +2 -2
  215. package/dist/timeline/tool-renderers.d.ts +1 -1
  216. package/dist/timeline/turn-summary.d.ts +3 -3
  217. package/dist/timeline/types.d.ts +44 -3
  218. package/dist/timeline-annotation-selection-3L7LHGG2.js +187 -0
  219. package/dist/timeline-annotation-selection-3L7LHGG2.js.map +1 -0
  220. package/dist/timeline-annotations-dialog-U7EVLR75.js +196 -0
  221. package/dist/timeline-annotations-dialog-U7EVLR75.js.map +1 -0
  222. package/package.json +36 -7
  223. package/src/artifacts-document.ts +31 -0
  224. package/src/artifacts-presentation.ts +36 -0
  225. package/src/artifacts-spreadsheet.ts +21 -0
  226. package/src/artifacts.ts +89 -0
  227. package/src/client.ts +157 -1
  228. package/src/clipboard.ts +2 -0
  229. package/src/components/artifacts/artifact-surface.tsx +93 -0
  230. package/src/components/artifacts/document-editor.tsx +2255 -0
  231. package/src/components/artifacts/editable-artifact-ui.tsx +89 -0
  232. package/src/components/artifacts/editable-artifact-workbench.tsx +203 -0
  233. package/src/components/artifacts/editable-document.tsx +657 -0
  234. package/src/components/artifacts/editable-presentation.tsx +1020 -0
  235. package/src/components/artifacts/editable-spreadsheet.tsx +733 -0
  236. package/src/components/artifacts/index.ts +104 -0
  237. package/src/components/artifacts/presentation-editor.tsx +3148 -0
  238. package/src/components/artifacts/published-html-artifact-frame.tsx +38 -0
  239. package/src/components/artifacts/spreadsheet-canvas.ts +799 -0
  240. package/src/components/artifacts/spreadsheet-grid.tsx +2129 -0
  241. package/src/components/browser-input.ts +65 -0
  242. package/src/components/browser-viewer.tsx +2702 -0
  243. package/src/components/chat-composer.tsx +13 -0
  244. package/src/components/code-editor.tsx +89 -30
  245. package/src/components/composer-transcription-control.tsx +10 -6
  246. package/src/components/computer-viewer.tsx +1636 -0
  247. package/src/components/desktop-viewer.tsx +215 -74
  248. package/src/components/generated-video-player.tsx +89 -0
  249. package/src/components/interaction-intervention-banner.tsx +99 -0
  250. package/src/components/interactive-workbench-viewers.ts +2 -0
  251. package/src/components/machine-input-display.ts +3 -0
  252. package/src/components/machines/machine-detail.tsx +1 -1
  253. package/src/components/message-timeline.tsx +289 -32
  254. package/src/components/model-policy-picker.tsx +15 -0
  255. package/src/components/queue-surface-implementation.tsx +116 -60
  256. package/src/components/sandbox-files.tsx +2 -2
  257. package/src/components/sandbox-terminal.tsx +128 -46
  258. package/src/components/sandbox-workspace.tsx +256 -90
  259. package/src/components/session-chrome.tsx +53 -13
  260. package/src/components/timeline-annotation-selection.tsx +221 -0
  261. package/src/components/timeline-annotations-dialog.tsx +213 -0
  262. package/src/components/timeline-annotations.tsx +84 -0
  263. package/src/components/workbench-changes.tsx +188 -31
  264. package/src/components/workspace-dock.tsx +59 -5
  265. package/src/hooks/use-attached-browsers.ts +154 -0
  266. package/src/hooks/use-auth-runs.ts +278 -0
  267. package/src/hooks/use-browser-downloads.ts +218 -0
  268. package/src/hooks/use-browser-frame-stream.ts +425 -0
  269. package/src/hooks/use-browser-identities.ts +266 -0
  270. package/src/hooks/use-browser-session.ts +543 -0
  271. package/src/hooks/use-browser-sessions.ts +286 -0
  272. package/src/hooks/use-channels.ts +99 -0
  273. package/src/hooks/use-composer.ts +769 -24
  274. package/src/hooks/use-computer-frame-stream.ts +434 -0
  275. package/src/hooks/use-computer-session.ts +462 -0
  276. package/src/hooks/use-computer-sessions.ts +251 -0
  277. package/src/hooks/use-desktop-stream.ts +39 -7
  278. package/src/hooks/use-interaction-interventions.ts +242 -0
  279. package/src/hooks/use-interaction-invalidation.ts +66 -0
  280. package/src/hooks/use-machine-chip.ts +15 -3
  281. package/src/hooks/use-machines.ts +33 -3
  282. package/src/hooks/use-network-routes.ts +214 -0
  283. package/src/hooks/use-packs.ts +51 -0
  284. package/src/hooks/use-sandbox-files.ts +98 -55
  285. package/src/hooks/use-sandbox-git.ts +93 -38
  286. package/src/hooks/use-sandbox-terminal.ts +3 -2
  287. package/src/hooks/use-session-capabilities.ts +59 -46
  288. package/src/hooks/use-site-auth-connections.ts +226 -0
  289. package/src/hooks/use-supergrok-accounts.ts +81 -0
  290. package/src/hooks/use-terminal-stream.ts +359 -47
  291. package/src/hooks/use-video-artifact-playback.ts +28 -0
  292. package/src/hooks/use-workspace-edit.ts +2 -1
  293. package/src/index.ts +18 -0
  294. package/src/interaction.ts +101 -0
  295. package/src/lib/host-platform.ts +10 -0
  296. package/src/lib/relay-wire.ts +47 -4
  297. package/src/lib/sandbox-liveness.ts +11 -0
  298. package/src/lib/terminal-capability.ts +10 -0
  299. package/src/model-policy.ts +19 -4
  300. package/src/provider.tsx +133 -1
  301. package/src/realtime/realtime-control.tsx +34 -6
  302. package/src/session-context.ts +156 -1
  303. package/src/timeline/activity-rail.tsx +25 -3
  304. package/src/timeline/index.ts +3 -0
  305. package/src/timeline/parsers.ts +14 -1
  306. package/src/timeline/projection.ts +269 -14
  307. package/src/timeline/registry.ts +13 -1
  308. package/src/timeline/screenshot-lightbox.tsx +19 -9
  309. package/src/timeline/shared.tsx +56 -8
  310. package/src/timeline/tool-renderers.tsx +303 -50
  311. package/src/timeline/types.ts +57 -3
  312. package/styles/compiled.css +312 -21
  313. package/styles/index.css +15 -0
  314. package/styles/responsive.css +13 -1
  315. package/dist/chunk-23EJ676W.js.map +0 -1
  316. package/dist/chunk-EKZH6IDG.js.map +0 -1
  317. package/dist/chunk-FWXGSNXT.js.map +0 -1
  318. package/dist/chunk-LHLYWG5R.js.map +0 -1
  319. package/dist/chunk-O4VXOBGF.js.map +0 -1
  320. package/dist/chunk-OL6QVXGF.js.map +0 -1
  321. package/dist/chunk-WYA65Y3F.js.map +0 -1
  322. package/dist/chunk-XCNTXWBB.js.map +0 -1
  323. package/dist/fleet-decision-projection-SLNZMS42.js +0 -241
  324. package/dist/fleet-decision-projection-SLNZMS42.js.map +0 -1
  325. package/dist/queue-surface-implementation-U5JFG7HT.js.map +0 -1
@@ -1,19 +1,23 @@
1
- import {
2
- EmptyQueueStateSurface,
3
- requestQueueDraftEdit
4
- } from "./chunk-O4VXOBGF.js";
5
1
  import {
6
2
  buildTimeline,
7
3
  groupTimeline,
8
4
  mcpToolLeaf,
9
5
  toolDisplayName
10
- } from "./chunk-LHLYWG5R.js";
6
+ } from "./chunk-6KLX2RH5.js";
7
+ import {
8
+ EmptyQueueStateSurface,
9
+ TimelineAnnotationsChip,
10
+ requestQueueDraftEdit
11
+ } from "./chunk-WSK7G5LE.js";
11
12
  import {
12
13
  Tooltip,
13
14
  TooltipContent,
14
15
  TooltipProvider,
15
16
  TooltipTrigger
16
17
  } from "./chunk-FK6VG4LL.js";
18
+ import {
19
+ usePortalTokenStyle
20
+ } from "./chunk-VZTQ73XT.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 });
@@ -5105,7 +5354,11 @@ function WorkerRow({
5105
5354
  children: title
5106
5355
  }
5107
5356
  ),
5108
- item.prompt ? /* @__PURE__ */ jsx13("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null
5357
+ item.prompt ? /* @__PURE__ */ jsx13("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null,
5358
+ failed && item.failure ? /* @__PURE__ */ jsxs10("div", { className: "mt-1 min-w-0 text-og-sm text-og-status-failed", children: [
5359
+ /* @__PURE__ */ jsx13("p", { className: "font-og-mono text-og-xs", children: item.failure.code }),
5360
+ /* @__PURE__ */ jsx13("p", { className: "mt-0.5 break-words", children: item.failure.message })
5361
+ ] }) : null
5109
5362
  ] }),
5110
5363
  failed ? /* @__PURE__ */ jsxs10("span", { className: "inline-flex shrink-0 self-center items-center gap-1.5 font-og-mono text-og-xs leading-none text-og-status-failed", children: [
5111
5364
  /* @__PURE__ */ jsx13("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
@@ -5140,21 +5393,21 @@ function WorkerRow({
5140
5393
  import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
5141
5394
  import {
5142
5395
  Component,
5143
- createContext as createContext7,
5144
- useContext as useContext7,
5396
+ createContext as createContext8,
5397
+ useContext as useContext8,
5145
5398
  useEffect as useEffect9,
5146
5399
  useMemo as useMemo4,
5147
- useRef as useRef8,
5400
+ useRef as useRef9,
5148
5401
  useState as useState11
5149
5402
  } from "react";
5150
5403
  import { Collapsible } from "radix-ui";
5151
5404
 
5152
5405
  // src/timeline/fold-memory.ts
5153
- import { createContext as createContext6, useContext as useContext6 } from "react";
5154
- var FoldMemoryContext = createContext6(null);
5406
+ import { createContext as createContext7, useContext as useContext7 } from "react";
5407
+ var FoldMemoryContext = createContext7(null);
5155
5408
  var FoldMemoryProvider = FoldMemoryContext.Provider;
5156
5409
  function useFoldMemory() {
5157
- return useContext6(FoldMemoryContext);
5410
+ return useContext7(FoldMemoryContext);
5158
5411
  }
5159
5412
  function inheritFoldRestingState(memory, targetKey, sourceKeys) {
5160
5413
  if (memory.has(targetKey) || sourceKeys.length !== 1) {
@@ -5168,9 +5421,9 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
5168
5421
 
5169
5422
  // src/timeline/turn-summary.tsx
5170
5423
  import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
5171
- var TurnSettleChromeContext = createContext7(false);
5424
+ var TurnSettleChromeContext = createContext8(false);
5172
5425
  function useTurnSettleOpen() {
5173
- return useContext7(TurnSettleChromeContext);
5426
+ return useContext8(TurnSettleChromeContext);
5174
5427
  }
5175
5428
  var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
5176
5429
  "steps",
@@ -5208,11 +5461,11 @@ function TurnSummary({
5208
5461
  const [settlePhase, setSettlePhase] = useState11(initialSettle);
5209
5462
  const [nestSuppressLatch, setNestSuppressLatch] = useState11(initialSettle);
5210
5463
  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);
5464
+ const settleTimerRef = useRef9(null);
5465
+ const settleCloseDoneRef = useRef9(null);
5466
+ const nestLatchClearRef = useRef9(null);
5467
+ const settleFoldSeenRef = useRef9(Boolean(settleFold));
5468
+ const settleArmedRef = useRef9(false);
5216
5469
  const clearNestLatchTimer = () => {
5217
5470
  if (nestLatchClearRef.current !== null) {
5218
5471
  clearTimeout(nestLatchClearRef.current);
@@ -5260,7 +5513,7 @@ function TurnSummary({
5260
5513
  }, SETTLE_COLLAPSE_MS);
5261
5514
  }, SETTLE_FOLD_BEAT_MS);
5262
5515
  };
5263
- const mountSettleRef = useRef8(initialSettle);
5516
+ const mountSettleRef = useRef9(initialSettle);
5264
5517
  useEffect9(() => {
5265
5518
  if (mountSettleRef.current) {
5266
5519
  armSettleCollapse();
@@ -5597,12 +5850,12 @@ function formatDurationFacet(durationMs) {
5597
5850
 
5598
5851
  // src/components/user-message-body.tsx
5599
5852
  import {
5600
- createContext as createContext8,
5853
+ createContext as createContext9,
5601
5854
  useCallback as useCallback2,
5602
- useContext as useContext8,
5855
+ useContext as useContext9,
5603
5856
  useId as useId3,
5604
5857
  useLayoutEffect as useLayoutEffect3,
5605
- useRef as useRef9,
5858
+ useRef as useRef10,
5606
5859
  useState as useState12
5607
5860
  } from "react";
5608
5861
  import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -5685,7 +5938,7 @@ function collectInteractionBoundaries(root) {
5685
5938
  function isFullyInsideVisiblePreview(rect, clipRect) {
5686
5939
  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
5940
  }
5688
- var UserMessageDisclosureContext = createContext8(null);
5941
+ var UserMessageDisclosureContext = createContext9(null);
5689
5942
  function UserMessageDisclosureProvider({
5690
5943
  value,
5691
5944
  children
@@ -5697,17 +5950,17 @@ function userMessageLikelyNeedsDisclosure(text) {
5697
5950
  return lines.length > FALLBACK_LINE_THRESHOLD || text.length > FALLBACK_TEXT_THRESHOLD || lines.some((line) => line.length > FALLBACK_UNBROKEN_THRESHOLD);
5698
5951
  }
5699
5952
  function UserMessageBody({ messageId, text, children, className }) {
5700
- const disclosure = useContext8(UserMessageDisclosureContext);
5953
+ const disclosure = useContext9(UserMessageDisclosureContext);
5701
5954
  const [expanded, setExpanded] = useState12(
5702
5955
  () => disclosure?.expandedByMessageId.get(messageId) ?? false
5703
5956
  );
5704
5957
  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());
5958
+ const rootRef = useRef10(null);
5959
+ const clipRef = useRef10(null);
5960
+ const contentRef = useRef10(null);
5961
+ const thresholdRef = useRef10(null);
5962
+ const pendingRestoreRef = useRef10(null);
5963
+ const managedInertDescendantsRef = useRef10(/* @__PURE__ */ new Set());
5711
5964
  const contentId = `og-user-message-${useId3().replace(/:/g, "")}`;
5712
5965
  const collapsed = collapsible && !expanded;
5713
5966
  const restoreManagedInertDescendants = useCallback2(() => {
@@ -5866,8 +6119,82 @@ function UserMessageBody({ messageId, text, children, className }) {
5866
6119
  );
5867
6120
  }
5868
6121
 
6122
+ // src/components/generated-video-player.tsx
6123
+ import { useEffect as useEffect10, useState as useState13 } from "react";
6124
+ import { jsx as jsx16 } from "react/jsx-runtime";
6125
+ function GeneratedVideoPlayer({
6126
+ receipt,
6127
+ loadPlaybackSource,
6128
+ className,
6129
+ label = "Generated video"
6130
+ }) {
6131
+ const [retry, setRetry] = useState13(0);
6132
+ const [state, setState] = useState13({ kind: "loading" });
6133
+ useEffect10(() => {
6134
+ const controller = new AbortController();
6135
+ setState({ kind: "loading" });
6136
+ void loadPlaybackSource(receipt.artifact.artifactId, controller.signal).then(
6137
+ (source) => {
6138
+ if (!controller.signal.aborted) setState({ kind: "ready", source });
6139
+ },
6140
+ (error) => {
6141
+ if (controller.signal.aborted) return;
6142
+ setState({
6143
+ kind: "error",
6144
+ message: error instanceof Error ? error.message : "Playback is unavailable."
6145
+ });
6146
+ }
6147
+ );
6148
+ return () => controller.abort();
6149
+ }, [loadPlaybackSource, receipt.artifact.artifactId, retry]);
6150
+ if (state.kind === "loading") {
6151
+ return /* @__PURE__ */ jsx16(
6152
+ "div",
6153
+ {
6154
+ "aria-label": `Loading ${label.toLowerCase()}`,
6155
+ className: cn(
6156
+ "aspect-video w-full animate-pulse rounded-og-md bg-og-surface-2 motion-reduce:animate-none",
6157
+ className
6158
+ )
6159
+ }
6160
+ );
6161
+ }
6162
+ if (state.kind === "error") {
6163
+ return /* @__PURE__ */ jsx16(
6164
+ "div",
6165
+ {
6166
+ role: "status",
6167
+ className: cn(
6168
+ "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",
6169
+ className
6170
+ ),
6171
+ children: state.message
6172
+ }
6173
+ );
6174
+ }
6175
+ return /* @__PURE__ */ jsx16(
6176
+ "video",
6177
+ {
6178
+ "aria-label": label,
6179
+ className: cn(
6180
+ "max-h-[32rem] w-full rounded-og-md bg-black object-contain shadow-sm",
6181
+ className
6182
+ ),
6183
+ controls: true,
6184
+ playsInline: true,
6185
+ preload: "metadata",
6186
+ src: state.source.url,
6187
+ onError: () => {
6188
+ if (retry === 0) setRetry(1);
6189
+ else setState({ kind: "error", message: "Video playback failed." });
6190
+ }
6191
+ },
6192
+ state.source.url
6193
+ );
6194
+ }
6195
+
5869
6196
  // src/components/session-status.tsx
5870
- import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
6197
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
5871
6198
  var SESSION_STATUS_META = {
5872
6199
  queued: {
5873
6200
  label: "Queued",
@@ -5931,7 +6258,7 @@ function SessionStatus({ status, label, size = "md", className }) {
5931
6258
  className
5932
6259
  ),
5933
6260
  children: [
5934
- /* @__PURE__ */ jsx16(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
6261
+ /* @__PURE__ */ jsx17(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
5935
6262
  label ?? meta.label
5936
6263
  ]
5937
6264
  }
@@ -5939,7 +6266,7 @@ function SessionStatus({ status, label, size = "md", className }) {
5939
6266
  }
5940
6267
  function StatusDot({ status, className }) {
5941
6268
  const meta = SESSION_STATUS_META[status];
5942
- return /* @__PURE__ */ jsx16(
6269
+ return /* @__PURE__ */ jsx17(
5943
6270
  "span",
5944
6271
  {
5945
6272
  className: cn(
@@ -5947,7 +6274,7 @@ function StatusDot({ status, className }) {
5947
6274
  meta.dotClassName,
5948
6275
  className
5949
6276
  ),
5950
- children: meta.pulse ? /* @__PURE__ */ jsx16("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
6277
+ children: meta.pulse ? /* @__PURE__ */ jsx17("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
5951
6278
  }
5952
6279
  );
5953
6280
  }
@@ -5976,13 +6303,15 @@ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/r
5976
6303
  import { Collapsible as Collapsible2 } from "radix-ui";
5977
6304
  import {
5978
6305
  Component as Component2,
6306
+ Suspense as Suspense4,
6307
+ lazy as lazy4,
5979
6308
  memo as memo2,
5980
6309
  useCallback as useCallback3,
5981
- useEffect as useEffect10,
6310
+ useEffect as useEffect11,
5982
6311
  useLayoutEffect as useLayoutEffect4,
5983
6312
  useMemo as useMemo5,
5984
- useRef as useRef10,
5985
- useState as useState13
6313
+ useRef as useRef11,
6314
+ useState as useState14
5986
6315
  } from "react";
5987
6316
 
5988
6317
  // src/components/tip-follow.ts
@@ -6258,7 +6587,8 @@ var MACHINE_INPUT_META = {
6258
6587
  goal_continuation: "Goal continued",
6259
6588
  agent_message: "Agent update",
6260
6589
  agent_steer_instruction: "Agent direction",
6261
- child_terminal_result: "Agent finished"
6590
+ child_terminal_result: "Agent finished",
6591
+ media_generation_result: "Video update"
6262
6592
  };
6263
6593
  function machineInputBatchLabel(members) {
6264
6594
  if (members.length === 0) return "Updates";
@@ -6280,6 +6610,8 @@ function machineInputBatchLabel(members) {
6280
6610
  return n === 1 ? "Agent update" : `${n} agent updates`;
6281
6611
  case "agent_steer_instruction":
6282
6612
  return n === 1 ? "Agent direction" : `${n} agent directions`;
6613
+ case "media_generation_result":
6614
+ return n === 1 ? "Video ready" : `${n} video updates`;
6283
6615
  }
6284
6616
  }
6285
6617
  const parts = [...counts.entries()].map(([kind, count]) => {
@@ -6311,7 +6643,8 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
6311
6643
  }
6312
6644
 
6313
6645
  // src/components/message-timeline.tsx
6314
- import { Fragment as Fragment7, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
6646
+ import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
6647
+ var TimelineAnnotationSelection = lazy4(() => import("./timeline-annotation-selection-3L7LHGG2.js"));
6315
6648
  var PIN_THRESHOLD_PX = 48;
6316
6649
  var OLDER_PREFETCH_MARGIN_PX = 400;
6317
6650
  var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
@@ -6362,9 +6695,12 @@ function MessageTimeline({
6362
6695
  resolveProviderLogo,
6363
6696
  toolRegistry = defaultToolRegistry,
6364
6697
  loadRetainedScreenshot,
6698
+ loadRetainedArtifact,
6699
+ loadVideoArtifactPlayback,
6365
6700
  computeLabel = null,
6366
6701
  turnSummary,
6367
6702
  autoFollow = true,
6703
+ onAnnotate,
6368
6704
  hasOlder = false,
6369
6705
  loadingOlder = false,
6370
6706
  onLoadOlder,
@@ -6386,41 +6722,50 @@ function MessageTimeline({
6386
6722
  return projected.filter((item) => item.kind !== "auth-needed" || shouldRenderAuthNeeded(item));
6387
6723
  }, [items, events, shouldRenderAuthNeeded]);
6388
6724
  const allGroups = useMemo5(() => groupTimeline(resolvedItems), [resolvedItems]);
6725
+ const annotationSources = useMemo5(() => {
6726
+ const sources = /* @__PURE__ */ new Map();
6727
+ for (const item of resolvedItems) {
6728
+ if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
6729
+ sources.set(item.annotationSource.eventId, item.annotationSource);
6730
+ }
6731
+ }
6732
+ return sources;
6733
+ }, [resolvedItems]);
6389
6734
  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);
6735
+ const scrollRef = useRef11(null);
6736
+ const topSentinelRef = useRef11(null);
6737
+ const bottomSentinelRef = useRef11(null);
6738
+ const previousBulkFirstKeyRef = useRef11(void 0);
6739
+ const [pinned, setPinned] = useState14(true);
6740
+ const [bulkActive, setBulkActive] = useState14(true);
6741
+ const olderPrefetchArmedRef = useRef11(false);
6742
+ const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
6743
+ const olderLoadGateRef = useRef11("armed");
6744
+ const resizeFollowRafRef = useRef11(null);
6400
6745
  const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
6401
- const [revealed, setRevealed] = useState13(false);
6402
- const pinnedRef = useRef10(true);
6403
- const hasNewerRef = useRef10(hasNewer);
6746
+ const [revealed, setRevealed] = useState14(false);
6747
+ const pinnedRef = useRef11(true);
6748
+ const hasNewerRef = useRef11(hasNewer);
6404
6749
  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());
6750
+ const wantPinRef = useRef11(false);
6751
+ const pendingJumpToStartRef = useRef11(false);
6752
+ const jumpToStartSeqRef = useRef11(0);
6753
+ const previousFirstItemIdRef = useRef11(null);
6754
+ const previousScrollHeightRef = useRef11(0);
6755
+ const lastScrollTopRef = useRef11(0);
6756
+ const lastMaxScrollRef = useRef11(0);
6757
+ const lastScrollHeightRef = useRef11(0);
6758
+ const lastClientHeightRef = useRef11(0);
6759
+ const readerIntentArmRef = useRef11(false);
6760
+ const programmaticScrollRef = useRef11(0);
6761
+ const disclosureKeepsUnpinnedRef = useRef11(false);
6762
+ const pendingReaderLeaveRef = useRef11(false);
6763
+ const leaveFallbackRafRef = useRef11(null);
6764
+ const foldMemoryRef = useRef11(/* @__PURE__ */ new Map());
6765
+ const userMessageDisclosureMemoryRef = useRef11(/* @__PURE__ */ new Map());
6766
+ const seenActivityIdsRef = useRef11(/* @__PURE__ */ new Set());
6767
+ const groupKeyByItemIdRef = useRef11(/* @__PURE__ */ new Map());
6768
+ const groupOffsetByKeyRef = useRef11(/* @__PURE__ */ new Map());
6424
6769
  const firstItemId = resolvedItems[0]?.id ?? null;
6425
6770
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
6426
6771
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
@@ -6430,10 +6775,10 @@ function MessageTimeline({
6430
6775
  setPinned(value);
6431
6776
  }
6432
6777
  }, []);
6433
- const revealedRef = useRef10(revealed);
6778
+ const revealedRef = useRef11(revealed);
6434
6779
  revealedRef.current = revealed;
6435
- const followRef = useRef10(createTipFollowState());
6436
- const followFrameRef = useRef10(null);
6780
+ const followRef = useRef11(createTipFollowState());
6781
+ const followFrameRef = useRef11(null);
6437
6782
  const syncScrollBaseline = useCallback3((node) => {
6438
6783
  lastScrollTopRef.current = node.scrollTop;
6439
6784
  lastMaxScrollRef.current = maxScrollOf(node);
@@ -6620,7 +6965,7 @@ function MessageTimeline({
6620
6965
  }),
6621
6966
  [beginUserMessageDisclosureChange]
6622
6967
  );
6623
- const driveFollowRef = useRef10(() => void 0);
6968
+ const driveFollowRef = useRef11(() => void 0);
6624
6969
  const driveFollow = useCallback3(
6625
6970
  (node, nowMs) => {
6626
6971
  if (!pinnedRef.current || hasNewerRef.current) {
@@ -6709,8 +7054,8 @@ function MessageTimeline({
6709
7054
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
6710
7055
  );
6711
7056
  driveFollowRef.current = driveFollow;
6712
- useEffect10(() => stopFollow, [stopFollow]);
6713
- useEffect10(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
7057
+ useEffect11(() => stopFollow, [stopFollow]);
7058
+ useEffect11(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
6714
7059
  useLayoutEffect4(() => {
6715
7060
  const node = scrollRef.current;
6716
7061
  if (!node) {
@@ -6863,7 +7208,7 @@ function MessageTimeline({
6863
7208
  const frame = requestFrame(() => setBulkActive(false));
6864
7209
  return () => cancelFrame(frame);
6865
7210
  }, [bulkRender, firstGroupKey]);
6866
- useEffect10(() => {
7211
+ useEffect11(() => {
6867
7212
  const root = scrollRef.current;
6868
7213
  const target = topSentinelRef.current;
6869
7214
  if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
@@ -6887,7 +7232,7 @@ function MessageTimeline({
6887
7232
  observer.observe(target);
6888
7233
  return () => observer.disconnect();
6889
7234
  }, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
6890
- useEffect10(() => {
7235
+ useEffect11(() => {
6891
7236
  const root = scrollRef.current;
6892
7237
  const target = bottomSentinelRef.current;
6893
7238
  if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
@@ -6904,7 +7249,7 @@ function MessageTimeline({
6904
7249
  observer.observe(target);
6905
7250
  return () => observer.disconnect();
6906
7251
  }, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
6907
- useEffect10(() => {
7252
+ useEffect11(() => {
6908
7253
  const node = scrollRef.current;
6909
7254
  const inner = node?.firstElementChild;
6910
7255
  if (!node || !inner || typeof ResizeObserver === "undefined") {
@@ -6940,7 +7285,7 @@ function MessageTimeline({
6940
7285
  }
6941
7286
  };
6942
7287
  }, [autoFollow, driveFollow, snapToBottom]);
6943
- useEffect10(() => {
7288
+ useEffect11(() => {
6944
7289
  if (hasNewer) {
6945
7290
  stopFollow();
6946
7291
  applyPinned(false);
@@ -7063,8 +7408,16 @@ function MessageTimeline({
7063
7408
  }
7064
7409
  releasePinAfterScrollSettled(node);
7065
7410
  };
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(
7411
+ 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: [
7412
+ onAnnotate ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
7413
+ TimelineAnnotationSelection,
7414
+ {
7415
+ rootRef: scrollRef,
7416
+ sources: annotationSources,
7417
+ onAnnotate
7418
+ }
7419
+ ) }) : null,
7420
+ /* @__PURE__ */ jsx18(
7068
7421
  "div",
7069
7422
  {
7070
7423
  ref: scrollRef,
@@ -7084,11 +7437,11 @@ function MessageTimeline({
7084
7437
  autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
7085
7438
  ),
7086
7439
  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,
7440
+ 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
7441
  hasOlder && olderPrefetchArmed ? (
7089
7442
  // Overlaid, not a layout row: mounting/unmounting the sentinel
7090
7443
  // must never shift content (that shift was itself a wobble).
7091
- /* @__PURE__ */ jsx17(
7444
+ /* @__PURE__ */ jsx18(
7092
7445
  "div",
7093
7446
  {
7094
7447
  ref: topSentinelRef,
@@ -7102,7 +7455,7 @@ function MessageTimeline({
7102
7455
  groups.map(({ group, key }, index) => {
7103
7456
  const next = groups[index + 1]?.group;
7104
7457
  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(
7458
+ return /* @__PURE__ */ jsx18("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx18(
7106
7459
  TimelineGroupRenderBoundary,
7107
7460
  {
7108
7461
  resetKeys: [
@@ -7114,9 +7467,11 @@ function MessageTimeline({
7114
7467
  resolveProviderLogo,
7115
7468
  toolRegistry,
7116
7469
  loadRetainedScreenshot,
7470
+ loadRetainedArtifact,
7471
+ loadVideoArtifactPlayback,
7117
7472
  turnSummary
7118
7473
  ],
7119
- children: /* @__PURE__ */ jsx17(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx17(
7474
+ children: /* @__PURE__ */ jsx18(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx18(
7120
7475
  TimelineGroupView,
7121
7476
  {
7122
7477
  group,
@@ -7127,6 +7482,8 @@ function MessageTimeline({
7127
7482
  resolveProviderLogo,
7128
7483
  toolRegistry,
7129
7484
  loadRetainedScreenshot,
7485
+ loadRetainedArtifact,
7486
+ loadVideoArtifactPlayback,
7130
7487
  turnSummary,
7131
7488
  foldLiveCluster: isAgentProgress(next),
7132
7489
  trailingAgentText: trailingAgentTextAfterTurn(group, next),
@@ -7136,8 +7493,8 @@ function MessageTimeline({
7136
7493
  }
7137
7494
  ) }, key);
7138
7495
  }),
7139
- groups.length > 0 && trailingState ? /* @__PURE__ */ jsx17("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7140
- hasNewer ? /* @__PURE__ */ jsx17(
7496
+ groups.length > 0 && trailingState ? /* @__PURE__ */ jsx18("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7497
+ hasNewer ? /* @__PURE__ */ jsx18(
7141
7498
  "div",
7142
7499
  {
7143
7500
  ref: bottomSentinelRef,
@@ -7150,7 +7507,7 @@ function MessageTimeline({
7150
7507
  ] })
7151
7508
  }
7152
7509
  ),
7153
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
7510
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
7154
7511
  // Floating over the scroller (not a timeline row) so showing and
7155
7512
  // hiding it never reflows history under the reader.
7156
7513
  /* @__PURE__ */ jsxs14(
@@ -7164,7 +7521,7 @@ function MessageTimeline({
7164
7521
  "aria-live": "polite",
7165
7522
  className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
7166
7523
  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,
7524
+ 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
7525
  hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs14(
7169
7526
  "button",
7170
7527
  {
@@ -7201,7 +7558,7 @@ function MessageTimeline({
7201
7558
  "hover:border-og-border-strong disabled:opacity-60"
7202
7559
  ),
7203
7560
  children: [
7204
- /* @__PURE__ */ jsx17(ArrowUpToLineIcon, { className: "size-3.5" }),
7561
+ /* @__PURE__ */ jsx18(ArrowUpToLineIcon, { className: "size-3.5" }),
7205
7562
  "Jump to start"
7206
7563
  ]
7207
7564
  }
@@ -7210,7 +7567,7 @@ function MessageTimeline({
7210
7567
  }
7211
7568
  )
7212
7569
  ) : null }),
7213
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx17(
7570
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx18(
7214
7571
  motion3.div,
7215
7572
  {
7216
7573
  initial: { opacity: 0, y: 6 },
@@ -7220,10 +7577,10 @@ function MessageTimeline({
7220
7577
  "data-og-loading-newer": "",
7221
7578
  "aria-live": "polite",
7222
7579
  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" }) })
7580
+ 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
7581
  }
7225
7582
  ) : null }),
7226
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
7583
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
7227
7584
  motion3.button,
7228
7585
  {
7229
7586
  type: "button",
@@ -7268,7 +7625,7 @@ function MessageTimeline({
7268
7625
  "hover:border-og-border-strong"
7269
7626
  ),
7270
7627
  children: [
7271
- /* @__PURE__ */ jsx17(ArrowDownIcon2, { className: "size-3.5" }),
7628
+ /* @__PURE__ */ jsx18(ArrowDownIcon2, { className: "size-3.5" }),
7272
7629
  "Jump to latest"
7273
7630
  ]
7274
7631
  }
@@ -7276,7 +7633,7 @@ function MessageTimeline({
7276
7633
  ] }) }) }) }) }) }) });
7277
7634
  }
7278
7635
  function useStableTimelineGroupKeys(allGroups) {
7279
- const previousRef = useRef10([]);
7636
+ const previousRef = useRef11([]);
7280
7637
  const keyedGroups = useMemo5(() => {
7281
7638
  const previousByItemId = /* @__PURE__ */ new Map();
7282
7639
  for (const previous of previousRef.current) {
@@ -7350,10 +7707,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
7350
7707
  role: "status",
7351
7708
  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
7709
  children: [
7353
- /* @__PURE__ */ jsx17(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
7710
+ /* @__PURE__ */ jsx18(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
7354
7711
  /* @__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." })
7712
+ /* @__PURE__ */ jsx18("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
7713
+ /* @__PURE__ */ jsx18("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
7357
7714
  ] })
7358
7715
  ]
7359
7716
  }
@@ -7371,6 +7728,8 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7371
7728
  resolveProviderLogo,
7372
7729
  toolRegistry,
7373
7730
  loadRetainedScreenshot,
7731
+ loadRetainedArtifact,
7732
+ loadVideoArtifactPlayback,
7374
7733
  turnSummary,
7375
7734
  insideTurn = false,
7376
7735
  nestClusterChips = false,
@@ -7382,8 +7741,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7382
7741
  const settleChrome = useTurnSettleOpen();
7383
7742
  const foldMemory = useFoldMemory();
7384
7743
  const activityShouldFold = group.kind === "activity" && Boolean(group.outcome || foldLiveCluster && clusterIsSettled(group));
7744
+ const containsGeneratedImage = timelineGroupContainsGeneratedImage(group);
7385
7745
  const liveActivitySettle = useLiveSettleFold(activityShouldFold && !insideTurn);
7386
- const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group));
7746
+ const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group) || containsGeneratedImage);
7387
7747
  if (group.kind === "turn" && foldMemory && !insideTurn) {
7388
7748
  inheritFoldRestingState(
7389
7749
  foldMemory,
@@ -7395,9 +7755,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7395
7755
  switch (group.kind) {
7396
7756
  case "activity":
7397
7757
  if (insideTurn) {
7398
- const useNestedChip = nestClusterChips && activityShouldFold;
7758
+ const useNestedChip = nestClusterChips && activityShouldFold && !containsGeneratedImage;
7399
7759
  if (!useNestedChip) {
7400
- return /* @__PURE__ */ jsx17(
7760
+ return /* @__PURE__ */ jsx18(
7401
7761
  ActivityRail,
7402
7762
  {
7403
7763
  items: group.items,
@@ -7405,11 +7765,12 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7405
7765
  onMemoryClick,
7406
7766
  toolRegistry,
7407
7767
  loadRetainedScreenshot,
7768
+ loadRetainedArtifact,
7408
7769
  bare: true
7409
7770
  }
7410
7771
  );
7411
7772
  }
7412
- return /* @__PURE__ */ jsx17(
7773
+ return /* @__PURE__ */ jsx18(
7413
7774
  TurnSummary,
7414
7775
  {
7415
7776
  items: group.items,
@@ -7420,7 +7781,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7420
7781
  foldKey: group.id,
7421
7782
  facets: turnSummary?.facets,
7422
7783
  contextCompactionCount,
7423
- children: /* @__PURE__ */ jsx17(
7784
+ children: /* @__PURE__ */ jsx18(
7424
7785
  ActivityRail,
7425
7786
  {
7426
7787
  items: group.items,
@@ -7428,6 +7789,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7428
7789
  onMemoryClick,
7429
7790
  toolRegistry,
7430
7791
  loadRetainedScreenshot,
7792
+ loadRetainedArtifact,
7431
7793
  bare: true
7432
7794
  }
7433
7795
  )
@@ -7435,7 +7797,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7435
7797
  settleChrome ? "settle" : "rest"
7436
7798
  );
7437
7799
  }
7438
- return /* @__PURE__ */ jsx17(
7800
+ return /* @__PURE__ */ jsx18(
7439
7801
  TurnSummary,
7440
7802
  {
7441
7803
  items: group.items,
@@ -7446,7 +7808,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7446
7808
  facets: turnSummary?.facets,
7447
7809
  settleFold,
7448
7810
  contextCompactionCount,
7449
- children: /* @__PURE__ */ jsx17(FoldBody, { children: /* @__PURE__ */ jsx17(TurnRailFrame, { children: /* @__PURE__ */ jsx17(
7811
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: /* @__PURE__ */ jsx18(TurnRailFrame, { children: /* @__PURE__ */ jsx18(
7450
7812
  ActivityRail,
7451
7813
  {
7452
7814
  items: group.items,
@@ -7454,6 +7816,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7454
7816
  onMemoryClick,
7455
7817
  toolRegistry,
7456
7818
  loadRetainedScreenshot,
7819
+ loadRetainedArtifact,
7457
7820
  bare: true
7458
7821
  }
7459
7822
  ) }) })
@@ -7465,7 +7828,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7465
7828
  const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
7466
7829
  const body = group.groups.map((child) => {
7467
7830
  const key = timelineGroupKey(child);
7468
- return /* @__PURE__ */ jsx17(
7831
+ return /* @__PURE__ */ jsx18(
7469
7832
  TimelineGroupRenderBoundary,
7470
7833
  {
7471
7834
  resetKeys: [
@@ -7477,9 +7840,11 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7477
7840
  resolveProviderLogo,
7478
7841
  toolRegistry,
7479
7842
  loadRetainedScreenshot,
7843
+ loadRetainedArtifact,
7844
+ loadVideoArtifactPlayback,
7480
7845
  turnSummary
7481
7846
  ],
7482
- children: /* @__PURE__ */ jsx17(
7847
+ children: /* @__PURE__ */ jsx18(
7483
7848
  TimelineGroupView2,
7484
7849
  {
7485
7850
  group: child,
@@ -7490,6 +7855,8 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7490
7855
  resolveProviderLogo,
7491
7856
  toolRegistry,
7492
7857
  loadRetainedScreenshot,
7858
+ loadRetainedArtifact,
7859
+ loadVideoArtifactPlayback,
7493
7860
  turnSummary,
7494
7861
  insideTurn: true,
7495
7862
  nestClusterChips: nestClusters
@@ -7499,7 +7866,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7499
7866
  key
7500
7867
  );
7501
7868
  });
7502
- return /* @__PURE__ */ jsx17(
7869
+ return /* @__PURE__ */ jsx18(
7503
7870
  TurnSummary,
7504
7871
  {
7505
7872
  items: activityItems,
@@ -7513,36 +7880,37 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
7513
7880
  settleFold,
7514
7881
  copyText: insideTurn ? void 0 : turnCopyText,
7515
7882
  contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
7516
- children: /* @__PURE__ */ jsx17(FoldBody, { children: insideTurn ? (
7883
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: insideTurn ? (
7517
7884
  // A nested turn is already on an ancestor rail — its body just stacks
7518
7885
  // 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 }) })
7886
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4", children: body })
7887
+ ) : /* @__PURE__ */ jsx18(TurnRailFrame, { children: body }) })
7521
7888
  }
7522
7889
  );
7523
7890
  }
7524
7891
  case "item":
7525
- return /* @__PURE__ */ jsx17(
7892
+ return /* @__PURE__ */ jsx18(
7526
7893
  TimelineRow,
7527
7894
  {
7528
7895
  item: group.item,
7529
7896
  renderMessageText,
7530
7897
  onReconnect,
7531
7898
  resolveProviderLogo,
7532
- onOpenSession
7899
+ onOpenSession,
7900
+ loadVideoArtifactPlayback
7533
7901
  }
7534
7902
  );
7535
7903
  }
7536
7904
  });
7537
7905
  function FoldBody({ children }) {
7538
- return /* @__PURE__ */ jsx17(Fragment7, { children });
7906
+ return /* @__PURE__ */ jsx18(Fragment7, { children });
7539
7907
  }
7540
7908
  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 });
7909
+ return /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
7542
7910
  }
7543
7911
  function useLiveSettleFold(folded) {
7544
- const previousFoldedRef = useRef10(folded);
7545
- const latchedRef = useRef10(false);
7912
+ const previousFoldedRef = useRef11(folded);
7913
+ const latchedRef = useRef11(false);
7546
7914
  if (!previousFoldedRef.current && folded) {
7547
7915
  latchedRef.current = true;
7548
7916
  }
@@ -7571,6 +7939,18 @@ function timelineGroupContainsAuthNeeded(group) {
7571
7939
  return group.groups.some(timelineGroupContainsAuthNeeded);
7572
7940
  }
7573
7941
  }
7942
+ function timelineGroupContainsGeneratedImage(group) {
7943
+ switch (group.kind) {
7944
+ case "item":
7945
+ return false;
7946
+ case "activity":
7947
+ return group.items.some(
7948
+ (item) => item.kind === "tool-call" && item.name === "generate_image"
7949
+ );
7950
+ case "turn":
7951
+ return group.groups.some(timelineGroupContainsGeneratedImage);
7952
+ }
7953
+ }
7574
7954
  function timelineGroupItemIds(group) {
7575
7955
  switch (group.kind) {
7576
7956
  case "item":
@@ -7696,27 +8076,28 @@ function TimelineRow({
7696
8076
  renderMessageText,
7697
8077
  onReconnect,
7698
8078
  resolveProviderLogo,
7699
- onOpenSession
8079
+ onOpenSession,
8080
+ loadVideoArtifactPlayback
7700
8081
  }) {
7701
8082
  switch (item.kind) {
7702
8083
  case "user-message":
7703
- return /* @__PURE__ */ jsx17(UserMessageRow, { item, renderMessageText });
8084
+ return /* @__PURE__ */ jsx18(UserMessageRow, { item, renderMessageText });
7704
8085
  case "agent-message":
7705
- return /* @__PURE__ */ jsx17(AgentMessageRow, { item, renderMessageText });
8086
+ return /* @__PURE__ */ jsx18(AgentMessageRow, { item, renderMessageText });
7706
8087
  case "worker-completion":
7707
- return /* @__PURE__ */ jsx17(WorkerCompletionRow, { item, onOpenSession });
8088
+ return /* @__PURE__ */ jsx18(WorkerCompletionRow, { item, onOpenSession });
7708
8089
  case "session-status":
7709
- return /* @__PURE__ */ jsx17(SessionStatusRow, { item });
8090
+ return /* @__PURE__ */ jsx18(SessionStatusRow, { item });
7710
8091
  case "goal":
7711
- return /* @__PURE__ */ jsx17(GoalRow, { item });
8092
+ return /* @__PURE__ */ jsx18(GoalRow, { item });
7712
8093
  case "machine-input-batch":
7713
- return /* @__PURE__ */ jsx17(MachineInputBatchRow, { item });
8094
+ return /* @__PURE__ */ jsx18(MachineInputBatchRow, { item, loadVideoArtifactPlayback });
7714
8095
  case "notice":
7715
- return /* @__PURE__ */ jsx17(NoticeRow, { item });
8096
+ return /* @__PURE__ */ jsx18(NoticeRow, { item });
7716
8097
  case "context-compaction":
7717
- return /* @__PURE__ */ jsx17(CompactionRow, { item });
8098
+ return /* @__PURE__ */ jsx18(CompactionRow, { item });
7718
8099
  case "auth-needed":
7719
- return /* @__PURE__ */ jsx17(
8100
+ return /* @__PURE__ */ jsx18(
7720
8101
  AuthNeededRow,
7721
8102
  {
7722
8103
  item,
@@ -7742,7 +8123,7 @@ function CompactionRow({ item }) {
7742
8123
  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
8124
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
7744
8125
  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(
8126
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
7746
8127
  "div",
7747
8128
  {
7748
8129
  className: cn(
@@ -7752,13 +8133,13 @@ function CompactionRow({ item }) {
7752
8133
  role: "status",
7753
8134
  children: [
7754
8135
  /* @__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" }),
8136
+ /* @__PURE__ */ jsx18(ShrinkIcon, { className: "size-3.5 shrink-0" }),
7756
8137
  /* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
7757
8138
  title,
7758
8139
  trigger ? ` \xB7 ${trigger}` : ""
7759
8140
  ] })
7760
8141
  ] }),
7761
- subtitle ? /* @__PURE__ */ jsx17("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
8142
+ subtitle ? /* @__PURE__ */ jsx18("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
7762
8143
  ]
7763
8144
  }
7764
8145
  ) });
@@ -7778,7 +8159,7 @@ function compactionSkipSubtitle(reason) {
7778
8159
  }
7779
8160
  }
7780
8161
  function MessageFooterTime({ occurredAt }) {
7781
- return /* @__PURE__ */ jsx17(
8162
+ return /* @__PURE__ */ jsx18(
7782
8163
  "time",
7783
8164
  {
7784
8165
  dateTime: occurredAt,
@@ -7796,34 +8177,68 @@ function UserMessageRow({
7796
8177
  renderMessageText
7797
8178
  }) {
7798
8179
  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
- ) }) });
8180
+ const deliveryLabel = item.delivery?.state === "sending" ? "Sending\u2026" : item.delivery?.state === "queued" ? "Queued" : item.delivery?.state === "failed" ? "Not sent" : null;
8181
+ 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: [
8182
+ /* @__PURE__ */ jsx18(
8183
+ CopyHoverFrame,
8184
+ {
8185
+ copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
8186
+ ${annotation.note}`).join("\n\n"),
8187
+ label: "Copy message",
8188
+ className: "w-fit max-w-full min-w-0",
8189
+ trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
8190
+ 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: [
8191
+ 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,
8192
+ (item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx18(
8193
+ TimelineAnnotationsChip,
8194
+ {
8195
+ annotations: item.annotations ?? [],
8196
+ className: item.text ? "mt-2" : void 0
8197
+ }
8198
+ ) : null
8199
+ ] })
8200
+ }
8201
+ ),
8202
+ deliveryLabel ? /* @__PURE__ */ jsxs14("div", { className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-fg-subtle", children: [
8203
+ /* @__PURE__ */ jsx18("span", { title: item.delivery?.error, children: deliveryLabel }),
8204
+ item.delivery?.state === "failed" && item.delivery.onRetry ? /* @__PURE__ */ jsx18(
8205
+ "button",
8206
+ {
8207
+ type: "button",
8208
+ className: "font-medium text-og-fg underline decoration-og-border underline-offset-2 hover:text-og-fg-strong",
8209
+ onClick: item.delivery.onRetry,
8210
+ children: "Retry"
8211
+ }
8212
+ ) : null,
8213
+ item.delivery?.state === "failed" && item.delivery.onRemove ? /* @__PURE__ */ jsx18(
8214
+ "button",
8215
+ {
8216
+ type: "button",
8217
+ className: "font-medium text-og-fg-subtle underline decoration-og-border underline-offset-2 hover:text-og-fg",
8218
+ onClick: item.delivery.onRemove,
8219
+ children: "Remove"
8220
+ }
8221
+ ) : null
8222
+ ] }) : null
8223
+ ] }) });
7809
8224
  }
7810
8225
  function AgentMessageRow({
7811
8226
  item,
7812
8227
  renderMessageText
7813
8228
  }) {
7814
8229
  const enter = useEntranceAnimation();
7815
- const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(Markdown, { streaming: item.streaming, children: item.text });
7816
- return /* @__PURE__ */ jsx17(
8230
+ const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(Markdown, { streaming: item.streaming, children: item.text });
8231
+ return /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: /* @__PURE__ */ jsx18(
7817
8232
  CopyHoverFrame,
7818
8233
  {
7819
8234
  copyText: item.text,
7820
8235
  label: "Copy message",
7821
8236
  align: "start",
7822
8237
  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 }),
8238
+ trailing: item.streaming ? null : /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
7824
8239
  children: body
7825
8240
  }
7826
- );
8241
+ ) });
7827
8242
  }
7828
8243
  function workerCompletionMeta(item) {
7829
8244
  if (item.childStatus === "failed") {
@@ -7862,7 +8277,7 @@ function WorkerCompletionRow({
7862
8277
  onOpenSession
7863
8278
  }) {
7864
8279
  const enter = useEntranceAnimation();
7865
- const [open, setOpen] = useState13(false);
8280
+ const [open, setOpen] = useState14(false);
7866
8281
  const meta = workerCompletionMeta(item);
7867
8282
  const Icon = meta.icon;
7868
8283
  const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && Boolean(item.pausedReason?.trim());
@@ -7872,11 +8287,11 @@ function WorkerCompletionRow({
7872
8287
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
7873
8288
  ];
7874
8289
  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: [
8290
+ 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
8291
  /* @__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 }),
8292
+ /* @__PURE__ */ jsx18("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx18(Icon, { className: "size-4" }) }),
8293
+ /* @__PURE__ */ jsx18("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs14("p", { className: "text-og-base leading-5 text-og-fg", children: [
8294
+ /* @__PURE__ */ jsx18("span", { className: "font-medium", children: meta.label }),
7880
8295
  item.goalText ? /* @__PURE__ */ jsxs14("span", { className: "text-og-fg-muted", children: [
7881
8296
  " \xB7 ",
7882
8297
  truncate(item.goalText, 90)
@@ -7894,13 +8309,13 @@ function WorkerCompletionRow({
7894
8309
  ),
7895
8310
  children: [
7896
8311
  "View session",
7897
- /* @__PURE__ */ jsx17(ArrowRightIcon2, { className: "size-3.5" })
8312
+ /* @__PURE__ */ jsx18(ArrowRightIcon2, { className: "size-3.5" })
7898
8313
  ]
7899
8314
  }
7900
8315
  ) : null
7901
8316
  ] }),
7902
8317
  hasDetails ? /* @__PURE__ */ jsxs14(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
7903
- /* @__PURE__ */ jsx17(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
8318
+ /* @__PURE__ */ jsx18(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
7904
8319
  "button",
7905
8320
  {
7906
8321
  type: "button",
@@ -7909,14 +8324,14 @@ function WorkerCompletionRow({
7909
8324
  "outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
7910
8325
  ),
7911
8326
  children: [
7912
- /* @__PURE__ */ jsx17(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
8327
+ /* @__PURE__ */ jsx18(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
7913
8328
  open ? "Hide details" : "Show details"
7914
8329
  ]
7915
8330
  }
7916
8331
  ) }),
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(
8332
+ /* @__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: [
8333
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
8334
+ /* @__PURE__ */ jsx18(
7920
8335
  "p",
7921
8336
  {
7922
8337
  className: cn(
@@ -7942,14 +8357,14 @@ function SessionStatusRow({ item }) {
7942
8357
  ),
7943
8358
  role: "status",
7944
8359
  children: [
7945
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" }),
8360
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" }),
7946
8361
  /* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1.5", children: [
7947
- /* @__PURE__ */ jsx17(StatusDot, { status: item.status, className: "size-1" }),
8362
+ /* @__PURE__ */ jsx18(StatusDot, { status: item.status, className: "size-1" }),
7948
8363
  meta.label.toLowerCase(),
7949
8364
  " \xB7 ",
7950
8365
  formatRelativeTime(item.occurredAt)
7951
8366
  ] }),
7952
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" })
8367
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" })
7953
8368
  ]
7954
8369
  }
7955
8370
  );
@@ -7979,7 +8394,7 @@ var GOAL_META = {
7979
8394
  function GoalRow({ item }) {
7980
8395
  const enter = useEntranceAnimation();
7981
8396
  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(
8397
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
7983
8398
  "span",
7984
8399
  {
7985
8400
  className: cn(
@@ -7987,7 +8402,7 @@ function GoalRow({ item }) {
7987
8402
  pill
7988
8403
  ),
7989
8404
  children: [
7990
- /* @__PURE__ */ jsx17(Icon, { className: "size-3.5 shrink-0" }),
8405
+ /* @__PURE__ */ jsx18(Icon, { className: "size-3.5 shrink-0" }),
7991
8406
  /* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
7992
8407
  label,
7993
8408
  item.text ? `: ${truncate(item.text, 90)}` : ""
@@ -7996,15 +8411,27 @@ function GoalRow({ item }) {
7996
8411
  }
7997
8412
  ) });
7998
8413
  }
7999
- function MachineInputBatchRow({ item }) {
8414
+ function MachineInputBatchRow({
8415
+ item,
8416
+ loadVideoArtifactPlayback
8417
+ }) {
8000
8418
  const enter = useEntranceAnimation();
8001
8419
  const label = machineInputBatchLabel(item.members);
8002
8420
  const single = item.members.length === 1 ? item.members[0] : null;
8421
+ if (single?.kind === "media_generation_result" && single.result) {
8422
+ return /* @__PURE__ */ jsx18(
8423
+ VideoGenerationResultRow,
8424
+ {
8425
+ result: single.result,
8426
+ loadVideoArtifactPlayback
8427
+ }
8428
+ );
8429
+ }
8003
8430
  const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
8004
8431
  const showCollapsedSummary = single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
8005
8432
  return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
8006
8433
  /* @__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(
8434
+ /* @__PURE__ */ jsx18("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs14(
8008
8435
  "span",
8009
8436
  {
8010
8437
  className: cn(
@@ -8012,37 +8439,122 @@ function MachineInputBatchRow({ item }) {
8012
8439
  NEUTRAL_PILL
8013
8440
  ),
8014
8441
  children: [
8015
- /* @__PURE__ */ jsx17(
8442
+ /* @__PURE__ */ jsx18(
8016
8443
  ChevronRightIcon3,
8017
8444
  {
8018
8445
  "aria-hidden": true,
8019
8446
  className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
8020
8447
  }
8021
8448
  ),
8022
- /* @__PURE__ */ jsx17("span", { className: "truncate", children: label })
8449
+ /* @__PURE__ */ jsx18("span", { className: "truncate", children: label })
8023
8450
  ]
8024
8451
  }
8025
8452
  ) }),
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)) })
8453
+ /* @__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(
8454
+ MachineInputRow,
8455
+ {
8456
+ member,
8457
+ loadVideoArtifactPlayback
8458
+ },
8459
+ member.id
8460
+ )) })
8027
8461
  ] }),
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
8462
+ 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
8463
  ] });
8030
8464
  }
8031
- function MachineInputRow({ member }) {
8465
+ function MachineInputRow({
8466
+ member,
8467
+ loadVideoArtifactPlayback
8468
+ }) {
8469
+ if (member.kind === "media_generation_result" && member.result) {
8470
+ return /* @__PURE__ */ jsx18(
8471
+ VideoGenerationResultRow,
8472
+ {
8473
+ result: member.result,
8474
+ loadVideoArtifactPlayback,
8475
+ compact: true
8476
+ }
8477
+ );
8478
+ }
8032
8479
  const source = readableMachineInputSource(member.sourceId);
8033
8480
  const summary = cleanMachineInputSummary(member.summary);
8034
8481
  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 }),
8482
+ /* @__PURE__ */ jsx18("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
8036
8483
  /* @__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] }),
8484
+ /* @__PURE__ */ jsx18("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
8038
8485
  source && /* @__PURE__ */ jsxs14("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
8039
8486
  "from ",
8040
8487
  source
8041
8488
  ] }),
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
8489
+ 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
8490
  ] })
8044
8491
  ] });
8045
8492
  }
8493
+ function VideoGenerationResultRow({
8494
+ result,
8495
+ loadVideoArtifactPlayback,
8496
+ compact = false
8497
+ }) {
8498
+ const enter = useEntranceAnimation();
8499
+ if (result.status !== "ready") {
8500
+ return /* @__PURE__ */ jsxs14(
8501
+ "div",
8502
+ {
8503
+ className: cn(
8504
+ enter && "animate-og-enter",
8505
+ "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"
8506
+ ),
8507
+ children: [
8508
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
8509
+ /* @__PURE__ */ jsx18(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
8510
+ "Video generation failed"
8511
+ ] }),
8512
+ /* @__PURE__ */ jsx18("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
8513
+ ]
8514
+ }
8515
+ );
8516
+ }
8517
+ const { receipt } = result;
8518
+ const facts = receipt.video;
8519
+ return /* @__PURE__ */ jsxs14(
8520
+ "section",
8521
+ {
8522
+ "aria-label": "Generated video",
8523
+ className: cn(
8524
+ enter && "animate-og-enter",
8525
+ "mx-auto w-full max-w-2xl overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 shadow-sm",
8526
+ compact && "max-w-lg"
8527
+ ),
8528
+ children: [
8529
+ loadVideoArtifactPlayback ? /* @__PURE__ */ jsx18(
8530
+ GeneratedVideoPlayer,
8531
+ {
8532
+ receipt,
8533
+ loadPlaybackSource: loadVideoArtifactPlayback,
8534
+ className: "rounded-none border-0 shadow-none"
8535
+ }
8536
+ ) : /* @__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" }) }),
8537
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
8538
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
8539
+ /* @__PURE__ */ jsx18("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
8540
+ /* @__PURE__ */ jsxs14("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
8541
+ facts.width,
8542
+ "\xD7",
8543
+ facts.height,
8544
+ " \xB7 ",
8545
+ formatVideoDuration(facts.durationSeconds),
8546
+ facts.hasAudio ? " \xB7 Audio" : ""
8547
+ ] })
8548
+ ] }),
8549
+ /* @__PURE__ */ jsx18(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
8550
+ ] })
8551
+ ]
8552
+ }
8553
+ );
8554
+ }
8555
+ function formatVideoDuration(seconds) {
8556
+ return `${Math.round(seconds * 10) / 10}s`;
8557
+ }
8046
8558
  function NoticeRow({ item }) {
8047
8559
  const enter = useEntranceAnimation();
8048
8560
  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 +8568,20 @@ function NoticeRow({ item }) {
8056
8568
  ),
8057
8569
  role: "status",
8058
8570
  children: [
8059
- /* @__PURE__ */ jsx17(
8571
+ /* @__PURE__ */ jsx18(
8060
8572
  TriangleAlertIcon3,
8061
8573
  {
8062
8574
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
8063
8575
  }
8064
8576
  ),
8065
8577
  /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
8066
- /* @__PURE__ */ jsx17("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
8578
+ /* @__PURE__ */ jsx18("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
8067
8579
  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) })
8580
+ /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
8581
+ /* @__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
8582
  ] }) : null
8071
8583
  ] }),
8072
- item.action ? /* @__PURE__ */ jsx17(
8584
+ item.action ? /* @__PURE__ */ jsx18(
8073
8585
  "a",
8074
8586
  {
8075
8587
  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 +8601,15 @@ function AuthNeededRow({
8089
8601
  resolveProviderLogo
8090
8602
  }) {
8091
8603
  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);
8604
+ const [busy, setBusy] = useState14(false);
8605
+ const [failed, setFailed] = useState14(false);
8606
+ const recommendation = item.capability ?? null;
8607
+ const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
8095
8608
  const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
8096
8609
  const missing = item.reason === "missing_connection";
8097
- const actionLabel = missing ? "Connect" : "Reconnect";
8610
+ const actionLabel = recommendation ? recommendation.action === "connect" ? "Connect" : "Review" : missing ? "Connect" : "Reconnect";
8611
+ const title = recommendation ? recommendation.action === "connect" ? `Connect ${provider}` : recommendation.action === "add_credentials" ? `Set up ${provider}` : `Enable ${provider}` : unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}`;
8612
+ const reasonLine = recommendation?.rationale ?? authReasonLine(item.reason);
8098
8613
  const start = async () => {
8099
8614
  if (!onReconnect || busy) {
8100
8615
  return;
@@ -8112,7 +8627,7 @@ function AuthNeededRow({
8112
8627
  return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
8113
8628
  /* @__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
8629
  /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
8115
- /* @__PURE__ */ jsx17(
8630
+ /* @__PURE__ */ jsx18(
8116
8631
  AuthProviderLogo,
8117
8632
  {
8118
8633
  src: resolveProviderLogo?.(item.providerDomain) ?? null,
@@ -8120,8 +8635,16 @@ function AuthNeededRow({
8120
8635
  }
8121
8636
  ),
8122
8637
  /* @__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) })
8638
+ /* @__PURE__ */ jsx18("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
8639
+ /* @__PURE__ */ jsx18("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
8640
+ recommendation ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
8641
+ "Provider: ",
8642
+ item.providerDomain
8643
+ ] }) : null,
8644
+ recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
8645
+ "Needs variables: ",
8646
+ recommendation.requiredVariables.join(", ")
8647
+ ] }) : null
8125
8648
  ] })
8126
8649
  ] }),
8127
8650
  !unavailable && onReconnect ? /* @__PURE__ */ jsxs14(
@@ -8135,7 +8658,7 @@ function AuthNeededRow({
8135
8658
  "transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
8136
8659
  ),
8137
8660
  children: [
8138
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
8661
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
8139
8662
  busy ? "Opening\u2026" : actionLabel
8140
8663
  ]
8141
8664
  }
@@ -8150,17 +8673,13 @@ function AuthNeededRow({
8150
8673
  "transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
8151
8674
  ),
8152
8675
  children: [
8153
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
8676
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
8154
8677
  actionLabel
8155
8678
  ]
8156
8679
  }
8157
8680
  ) : null
8158
8681
  ] }),
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,
8682
+ !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
8683
  failed ? /* @__PURE__ */ jsxs14("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
8165
8684
  "Couldn't start ",
8166
8685
  missing ? "connecting" : "reconnecting",
@@ -8171,15 +8690,15 @@ function AuthNeededRow({
8171
8690
  ] });
8172
8691
  }
8173
8692
  function AuthProviderLogo({ src, label }) {
8174
- const [failed, setFailed] = useState13(false);
8175
- useEffect10(() => setFailed(false), [src]);
8693
+ const [failed, setFailed] = useState14(false);
8694
+ useEffect11(() => setFailed(false), [src]);
8176
8695
  const showImage = src && !failed;
8177
- return /* @__PURE__ */ jsx17(
8696
+ return /* @__PURE__ */ jsx18(
8178
8697
  "span",
8179
8698
  {
8180
8699
  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
8700
  "aria-hidden": true,
8182
- children: showImage ? /* @__PURE__ */ jsx17(
8701
+ children: showImage ? /* @__PURE__ */ jsx18(
8183
8702
  "img",
8184
8703
  {
8185
8704
  src,
@@ -8189,7 +8708,7 @@ function AuthProviderLogo({ src, label }) {
8189
8708
  className: "size-full object-contain p-1.5",
8190
8709
  onError: () => setFailed(true)
8191
8710
  }
8192
- ) : /* @__PURE__ */ jsx17("span", { children: monogram(label) })
8711
+ ) : /* @__PURE__ */ jsx18("span", { children: monogram(label) })
8193
8712
  }
8194
8713
  );
8195
8714
  }
@@ -8273,8 +8792,6 @@ export {
8273
8792
  PierreDiff,
8274
8793
  defaultToolRegistry,
8275
8794
  createDefaultToolRegistry,
8276
- copyTextToClipboard,
8277
- tableElementToTsv,
8278
8795
  CopyButton,
8279
8796
  CopyHoverFrame,
8280
8797
  Markdown,
@@ -8283,10 +8800,11 @@ export {
8283
8800
  TurnSummary,
8284
8801
  userMessageLikelyNeedsDisclosure,
8285
8802
  UserMessageBody,
8803
+ GeneratedVideoPlayer,
8286
8804
  SESSION_STATUS_META,
8287
8805
  SessionStatus,
8288
8806
  StatusDot,
8289
8807
  MessageTimeline,
8290
8808
  TimelineRow
8291
8809
  };
8292
- //# sourceMappingURL=chunk-XCNTXWBB.js.map
8810
+ //# sourceMappingURL=chunk-Y7OEDUJ5.js.map