@opengeni/react 7.4.0 → 7.5.0-canary.36927100590001

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 (210) hide show
  1. package/README.md +124 -27
  2. package/dist/artifacts-document.js +3 -2
  3. package/dist/artifacts-presentation.js +3 -2
  4. package/dist/artifacts-spreadsheet.js +2 -2
  5. package/dist/artifacts.d.ts +1 -0
  6. package/dist/artifacts.js +516 -1413
  7. package/dist/artifacts.js.map +1 -1
  8. package/dist/{browser-viewer-2E6R2Y4W.js → browser-viewer-Z7S7QEJL.js} +6 -5
  9. package/dist/chat-interactive-block-UGBTNB3L.js +11 -0
  10. package/dist/{chunk-Y3QTZN2F.js → chunk-2VFNCX4E.js} +6 -6
  11. package/dist/{chunk-UDD6DLLT.js → chunk-3IJJEYW4.js} +15 -3
  12. package/dist/chunk-3IJJEYW4.js.map +1 -0
  13. package/dist/chunk-4RVYOY4O.js +379 -0
  14. package/dist/chunk-4RVYOY4O.js.map +1 -0
  15. package/dist/chunk-5CVXZA3Y.js +292 -0
  16. package/dist/chunk-5CVXZA3Y.js.map +1 -0
  17. package/dist/{chunk-5YK2ZDIG.js → chunk-5J4FOW6Q.js} +2 -10
  18. package/dist/chunk-5J4FOW6Q.js.map +1 -0
  19. package/dist/{chunk-KVERXCFY.js → chunk-5KYZIQFY.js} +40 -3
  20. package/dist/chunk-5KYZIQFY.js.map +1 -0
  21. package/dist/{chunk-KNDIXZN6.js → chunk-7UAMYXJY.js} +25 -18
  22. package/dist/{chunk-KNDIXZN6.js.map → chunk-7UAMYXJY.js.map} +1 -1
  23. package/dist/{chunk-SEEVCT36.js → chunk-A4UJB2MM.js} +2 -2
  24. package/dist/{chunk-X4HIN6TV.js → chunk-AFLPWUQ7.js} +71 -162
  25. package/dist/chunk-AFLPWUQ7.js.map +1 -0
  26. package/dist/chunk-B3V6TG77.js +41 -0
  27. package/dist/chunk-B3V6TG77.js.map +1 -0
  28. package/dist/{chunk-XEJEOAOV.js → chunk-B7WMS3CS.js} +51 -40
  29. package/dist/chunk-B7WMS3CS.js.map +1 -0
  30. package/dist/{chunk-S5JQ4R22.js → chunk-BDKR6BAR.js} +54 -24
  31. package/dist/chunk-BDKR6BAR.js.map +1 -0
  32. package/dist/{chunk-4MDLEHXL.js → chunk-DYWBUX5Q.js} +24 -12
  33. package/dist/chunk-DYWBUX5Q.js.map +1 -0
  34. package/dist/{chunk-YZ3YYMOM.js → chunk-E3G7SAYZ.js} +252 -624
  35. package/dist/chunk-E3G7SAYZ.js.map +1 -0
  36. package/dist/chunk-JT4JW7BC.js +54 -0
  37. package/dist/chunk-JT4JW7BC.js.map +1 -0
  38. package/dist/{chunk-5AZSK6MV.js → chunk-LWNLETQT.js} +5 -5
  39. package/dist/{chunk-USXVQACU.js → chunk-M7LBYP63.js} +5 -4
  40. package/dist/{chunk-USXVQACU.js.map → chunk-M7LBYP63.js.map} +1 -1
  41. package/dist/{chunk-L4OSXQ6H.js → chunk-NBOHNRLJ.js} +1289 -1060
  42. package/dist/chunk-NBOHNRLJ.js.map +1 -0
  43. package/dist/chunk-RHREZ7BO.js +11 -0
  44. package/dist/chunk-RHREZ7BO.js.map +1 -0
  45. package/dist/chunk-SCOTPE2I.js +589 -0
  46. package/dist/chunk-SCOTPE2I.js.map +1 -0
  47. package/dist/chunk-WEHMPOXK.js +39 -0
  48. package/dist/chunk-WEHMPOXK.js.map +1 -0
  49. package/dist/chunk-WRHIZYZF.js +988 -0
  50. package/dist/chunk-WRHIZYZF.js.map +1 -0
  51. package/dist/{chunk-3E2AITTZ.js → chunk-WUISZ3WU.js} +32 -28
  52. package/dist/{chunk-3E2AITTZ.js.map → chunk-WUISZ3WU.js.map} +1 -1
  53. package/dist/chunk-XCHWDJ22.js +107 -0
  54. package/dist/chunk-XCHWDJ22.js.map +1 -0
  55. package/dist/{chunk-DUEBTL3N.js → chunk-Y2PRMYLC.js} +4 -3
  56. package/dist/{chunk-DUEBTL3N.js.map → chunk-Y2PRMYLC.js.map} +1 -1
  57. package/dist/chunk-YBXQDQFX.js +1772 -0
  58. package/dist/chunk-YBXQDQFX.js.map +1 -0
  59. package/dist/chunk-YV4L3ILF.js +9 -0
  60. package/dist/chunk-YV4L3ILF.js.map +1 -0
  61. package/dist/{chunk-V2ABIVYJ.js → chunk-ZXSEDZP7.js} +70 -6
  62. package/dist/chunk-ZXSEDZP7.js.map +1 -0
  63. package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
  64. package/dist/components/artifacts/artifact-sandbox.d.ts +27 -0
  65. package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
  66. package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
  67. package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
  68. package/dist/components/artifacts/editable-artifact-view.d.ts +46 -0
  69. package/dist/components/artifacts/index.d.ts +7 -0
  70. package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
  71. package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
  72. package/dist/components/artifacts/site-view.d.ts +23 -0
  73. package/dist/components/browser-select-control.d.ts +3 -1
  74. package/dist/components/code-editor.d.ts +1 -4
  75. package/dist/components/desktop-viewer.d.ts +1 -1
  76. package/dist/components/message-timeline.d.ts +20 -3
  77. package/dist/components/open-geni-links.d.ts +16 -0
  78. package/dist/components/session-conversation.d.ts +20 -1
  79. package/dist/components/timeline-pill-geometry.d.ts +8 -0
  80. package/dist/components/timeline-pill-placement.d.ts +24 -0
  81. package/dist/components/usage-limit-notice.d.ts +49 -0
  82. package/dist/components/usage-member-list.d.ts +91 -0
  83. package/dist/components/usage-meter.d.ts +73 -0
  84. package/dist/composer.js +5 -5
  85. package/dist/{computer-viewer-WMJE6OA3.js → computer-viewer-KJWLH3GI.js} +7 -5
  86. package/dist/connect.js +7 -6
  87. package/dist/connect.js.map +1 -1
  88. package/dist/conversation-timeline.d.ts +1 -1
  89. package/dist/desktop.d.ts +7 -0
  90. package/dist/desktop.js +26 -0
  91. package/dist/desktop.js.map +1 -0
  92. package/dist/editor.d.ts +7 -0
  93. package/dist/editor.js +21 -0
  94. package/dist/editor.js.map +1 -0
  95. package/dist/hooks/latest-question.d.ts +1 -1
  96. package/dist/hooks/use-composer.d.ts +4 -0
  97. package/dist/hooks/use-desktop-stream.d.ts +1 -1
  98. package/dist/hooks/use-usage.d.ts +40 -0
  99. package/dist/index.d.ts +7 -2
  100. package/dist/index.js +460 -1386
  101. package/dist/index.js.map +1 -1
  102. package/dist/interaction.js +8 -6
  103. package/dist/interaction.js.map +1 -1
  104. package/dist/{latest-question-QB4EUCW5.js → latest-question-IS445HOW.js} +3 -3
  105. package/dist/lib/format.d.ts +6 -1
  106. package/dist/lib/workbench-peers.d.ts +36 -0
  107. package/dist/machines.js +2 -2
  108. package/dist/{markdown-table-layout-PFUEZ2U4.js → markdown-table-layout-QXSLK4BY.js} +37 -5
  109. package/dist/markdown-table-layout-QXSLK4BY.js.map +1 -0
  110. package/dist/{queue-surface-implementation-IM2HD3SK.js → queue-surface-implementation-2CAQAIHM.js} +2 -2
  111. package/dist/realtime.js +3 -3
  112. package/dist/{sandbox-files-PXPIZAFG.js → sandbox-files-AEJTWGT4.js} +8 -5
  113. package/dist/sandbox-files-AEJTWGT4.js.map +1 -0
  114. package/dist/session-ui.d.ts +9 -2
  115. package/dist/session-ui.js +39 -20
  116. package/dist/session-ui.js.map +1 -1
  117. package/dist/session.js +4 -4
  118. package/dist/sites.js +4 -289
  119. package/dist/sites.js.map +1 -1
  120. package/dist/terminal.d.ts +8 -0
  121. package/dist/terminal.js +31 -0
  122. package/dist/terminal.js.map +1 -0
  123. package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
  124. package/dist/timeline/genie-loading.d.ts +3 -1
  125. package/dist/timeline/types.d.ts +8 -1
  126. package/dist/{timeline-annotation-selection-ODLVF4OI.js → timeline-annotation-selection-DMLMM2TX.js} +6 -1
  127. package/dist/timeline-annotation-selection-DMLMM2TX.js.map +1 -0
  128. package/dist/timeline-pill-geometry-Z23V243M.js +110 -0
  129. package/dist/timeline-pill-geometry-Z23V243M.js.map +1 -0
  130. package/dist/usage/allowance-copy.d.ts +25 -0
  131. package/dist/usage/summary.d.ts +35 -0
  132. package/dist/usage.d.ts +13 -0
  133. package/dist/usage.js +1073 -0
  134. package/dist/usage.js.map +1 -0
  135. package/package.json +19 -3
  136. package/src/artifacts.ts +37 -0
  137. package/src/components/artifacts/artifact-chrome.tsx +413 -0
  138. package/src/components/artifacts/artifact-sandbox.tsx +185 -0
  139. package/src/components/artifacts/chat-interactive-block.tsx +260 -0
  140. package/src/components/artifacts/deferred-chat-media.tsx +67 -0
  141. package/src/components/artifacts/editable-artifact-ui.tsx +3 -1
  142. package/src/components/artifacts/editable-artifact-view.tsx +187 -0
  143. package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
  144. package/src/components/artifacts/editable-document.tsx +34 -36
  145. package/src/components/artifacts/editable-presentation.tsx +21 -16
  146. package/src/components/artifacts/index.ts +41 -0
  147. package/src/components/artifacts/latest-task-runner.ts +49 -0
  148. package/src/components/artifacts/session-artifact-viewer.tsx +376 -0
  149. package/src/components/artifacts/site-view.tsx +116 -0
  150. package/src/components/browser-select-control.tsx +4 -1
  151. package/src/components/browser-viewer.tsx +81 -22
  152. package/src/components/code-editor.tsx +13 -16
  153. package/src/components/computer-viewer.tsx +51 -23
  154. package/src/components/desktop-viewer.tsx +1 -1
  155. package/src/components/markdown-table-layout.ts +49 -5
  156. package/src/components/markdown.tsx +5 -2
  157. package/src/components/message-timeline.tsx +557 -516
  158. package/src/components/open-geni-links.tsx +24 -0
  159. package/src/components/sandbox-terminal.tsx +48 -11
  160. package/src/components/session-chrome.tsx +22 -3
  161. package/src/components/session-conversation.tsx +195 -102
  162. package/src/components/timeline-annotation-selection.tsx +7 -0
  163. package/src/components/timeline-pill-geometry.ts +169 -0
  164. package/src/components/timeline-pill-placement.ts +99 -0
  165. package/src/components/usage-limit-notice.tsx +179 -0
  166. package/src/components/usage-member-list.tsx +792 -0
  167. package/src/components/usage-meter.tsx +382 -0
  168. package/src/conversation-timeline.ts +10 -2
  169. package/src/desktop.ts +24 -0
  170. package/src/editor.ts +13 -0
  171. package/src/hooks/use-available-models.ts +1 -1
  172. package/src/hooks/use-composer.ts +57 -2
  173. package/src/hooks/use-desktop-stream.ts +19 -28
  174. package/src/hooks/use-usage.ts +100 -0
  175. package/src/index.ts +22 -0
  176. package/src/lib/format.ts +32 -6
  177. package/src/lib/workbench-peers.ts +62 -0
  178. package/src/session-ui.ts +22 -0
  179. package/src/terminal.ts +26 -0
  180. package/src/timeline/activity-rail.tsx +5 -3
  181. package/src/timeline/allowance-exhausted-row.tsx +86 -0
  182. package/src/timeline/genie-loading.tsx +16 -6
  183. package/src/timeline/projection.ts +78 -4
  184. package/src/timeline/types.ts +8 -0
  185. package/src/usage/allowance-copy.ts +64 -0
  186. package/src/usage/summary.ts +93 -0
  187. package/src/usage.ts +50 -0
  188. package/styles/compiled.css +325 -0
  189. package/dist/chunk-4MDLEHXL.js.map +0 -1
  190. package/dist/chunk-5YK2ZDIG.js.map +0 -1
  191. package/dist/chunk-KVERXCFY.js.map +0 -1
  192. package/dist/chunk-L4OSXQ6H.js.map +0 -1
  193. package/dist/chunk-S5JQ4R22.js.map +0 -1
  194. package/dist/chunk-UDD6DLLT.js.map +0 -1
  195. package/dist/chunk-UGMKPUEM.js +0 -299
  196. package/dist/chunk-UGMKPUEM.js.map +0 -1
  197. package/dist/chunk-V2ABIVYJ.js.map +0 -1
  198. package/dist/chunk-X4HIN6TV.js.map +0 -1
  199. package/dist/chunk-XEJEOAOV.js.map +0 -1
  200. package/dist/chunk-YZ3YYMOM.js.map +0 -1
  201. package/dist/markdown-table-layout-PFUEZ2U4.js.map +0 -1
  202. package/dist/timeline-annotation-selection-ODLVF4OI.js.map +0 -1
  203. /package/dist/{browser-viewer-2E6R2Y4W.js.map → browser-viewer-Z7S7QEJL.js.map} +0 -0
  204. /package/dist/{computer-viewer-WMJE6OA3.js.map → chat-interactive-block-UGBTNB3L.js.map} +0 -0
  205. /package/dist/{chunk-Y3QTZN2F.js.map → chunk-2VFNCX4E.js.map} +0 -0
  206. /package/dist/{chunk-SEEVCT36.js.map → chunk-A4UJB2MM.js.map} +0 -0
  207. /package/dist/{chunk-5AZSK6MV.js.map → chunk-LWNLETQT.js.map} +0 -0
  208. /package/dist/{sandbox-files-PXPIZAFG.js.map → computer-viewer-KJWLH3GI.js.map} +0 -0
  209. /package/dist/{latest-question-QB4EUCW5.js.map → latest-question-IS445HOW.js.map} +0 -0
  210. /package/dist/{queue-surface-implementation-IM2HD3SK.js.map → queue-surface-implementation-2CAQAIHM.js.map} +0 -0
@@ -1,3 +1,6 @@
1
+ import {
2
+ useThemeType
3
+ } from "./chunk-UK4TINKT.js";
1
4
  import {
2
5
  EmptyQueueStateSurface,
3
6
  QUEUE_ITEM_CONTENT_UNAVAILABLE,
@@ -6,17 +9,9 @@ import {
6
9
  queueItemContent,
7
10
  requestQueueDraftEdit
8
11
  } from "./chunk-YCGBREUV.js";
9
- import {
10
- useThemeType
11
- } from "./chunk-UK4TINKT.js";
12
12
  import {
13
13
  TimelineAnnotationSourceRootContext
14
14
  } from "./chunk-5QHL6BLH.js";
15
- import {
16
- loadPierreDiffs,
17
- pierreDiffsRevision,
18
- subscribePierreDiffs
19
- } from "./chunk-A2PI6UMY.js";
20
15
  import {
21
16
  isRetainedImageContentType,
22
17
  timelineGroupContainsPresentedImage,
@@ -33,15 +28,51 @@ import {
33
28
  useSessionControl,
34
29
  useSessionEvents,
35
30
  useTurnQueue
36
- } from "./chunk-USXVQACU.js";
31
+ } from "./chunk-M7LBYP63.js";
37
32
  import {
38
33
  buildTimeline,
39
34
  groupTimeline
40
- } from "./chunk-V2ABIVYJ.js";
35
+ } from "./chunk-ZXSEDZP7.js";
41
36
  import {
42
37
  mcpToolLeaf,
43
38
  toolDisplayName
44
39
  } from "./chunk-ERGYJIBB.js";
40
+ import {
41
+ ActivityDisclosure,
42
+ BodyNote,
43
+ CompactActivityContext,
44
+ CopyButton,
45
+ CopyHoverFrame,
46
+ MOTION_INSPECT_SCALE,
47
+ Markdown,
48
+ MediaEmpty,
49
+ MediaSkeleton,
50
+ PayloadBlock,
51
+ ScreenshotFigure,
52
+ TermBlock,
53
+ Thumbnail,
54
+ TimelineSearchRevealContext,
55
+ ToolCallTruncationProvider,
56
+ isTimelineSearchTarget,
57
+ useForcedDefaultOpen,
58
+ useTimelineSearchNavigation,
59
+ useTimelineSearchReveal
60
+ } from "./chunk-AFLPWUQ7.js";
61
+ import {
62
+ prefersReducedMotion
63
+ } from "./chunk-GIMRELBW.js";
64
+ import {
65
+ OpenGeniLinkProvider,
66
+ chainLinkResolvers,
67
+ sessionLinkResolver,
68
+ useOpenGeniLinkResolver,
69
+ viewerLinkResolver
70
+ } from "./chunk-XCHWDJ22.js";
71
+ import {
72
+ loadPierreDiffs,
73
+ pierreDiffsRevision,
74
+ subscribePierreDiffs
75
+ } from "./chunk-A2PI6UMY.js";
45
76
  import {
46
77
  Actions,
47
78
  AttachButton,
@@ -64,52 +95,10 @@ import {
64
95
  Status,
65
96
  Surface,
66
97
  useChatComposerController
67
- } from "./chunk-Y3QTZN2F.js";
68
- import {
69
- ModelPolicyPicker
70
- } from "./chunk-UINDK6C3.js";
98
+ } from "./chunk-2VFNCX4E.js";
71
99
  import {
72
100
  useComposer
73
- } from "./chunk-KVERXCFY.js";
74
- import {
75
- projectPickerRows,
76
- sortPickerRows
77
- } from "./chunk-CHPKSLPN.js";
78
- import {
79
- usePolledValue
80
- } from "./chunk-KZ73RL76.js";
81
- import {
82
- useOpenGeni,
83
- useOpenGeniClient
84
- } from "./chunk-NEXLLTP4.js";
85
- import {
86
- ActivityDisclosure,
87
- BodyNote,
88
- CompactActivityContext,
89
- CopyButton,
90
- CopyHoverFrame,
91
- MOTION_INSPECT_SCALE,
92
- Markdown,
93
- MediaEmpty,
94
- MediaSkeleton,
95
- OpenGeniLinkProvider,
96
- PayloadBlock,
97
- ScreenshotFigure,
98
- TermBlock,
99
- Thumbnail,
100
- TimelineSearchRevealContext,
101
- ToolCallTruncationProvider,
102
- chainLinkResolvers,
103
- isTimelineSearchTarget,
104
- sessionLinkResolver,
105
- useForcedDefaultOpen,
106
- useOpenGeniLinkResolver,
107
- useTimelineSearchNavigation,
108
- useTimelineSearchReveal
109
- } from "./chunk-X4HIN6TV.js";
110
- import {
111
- prefersReducedMotion
112
- } from "./chunk-GIMRELBW.js";
101
+ } from "./chunk-5KYZIQFY.js";
113
102
  import {
114
103
  LightboxProvider,
115
104
  Tooltip,
@@ -117,6 +106,13 @@ import {
117
106
  TooltipProvider,
118
107
  TooltipTrigger
119
108
  } from "./chunk-BRM6FVZA.js";
109
+ import {
110
+ ModelPolicyPicker
111
+ } from "./chunk-UINDK6C3.js";
112
+ import {
113
+ projectPickerRows,
114
+ sortPickerRows
115
+ } from "./chunk-CHPKSLPN.js";
120
116
  import {
121
117
  formatBytes,
122
118
  formatClockTime,
@@ -124,7 +120,19 @@ import {
124
120
  stringifyPayload,
125
121
  truncate,
126
122
  tryParseJson
127
- } from "./chunk-UDD6DLLT.js";
123
+ } from "./chunk-3IJJEYW4.js";
124
+ import {
125
+ allowanceLabels,
126
+ allowanceResetSentence,
127
+ formatAllowanceInstant
128
+ } from "./chunk-B3V6TG77.js";
129
+ import {
130
+ usePolledValue
131
+ } from "./chunk-KZ73RL76.js";
132
+ import {
133
+ useOpenGeni,
134
+ useOpenGeniClient
135
+ } from "./chunk-NEXLLTP4.js";
128
136
  import {
129
137
  cn
130
138
  } from "./chunk-22KP6LR5.js";
@@ -3881,13 +3889,16 @@ var PHRASES = [
3881
3889
  "Putting a wish into motion\u2026",
3882
3890
  "A little hocus. A little pocus\u2026"
3883
3891
  ];
3892
+ var WAITING_PHRASES = ["Waiting for a response\u2026"];
3884
3893
  function GenieLoading({
3885
3894
  startedAt,
3895
+ phase = "preparing",
3886
3896
  onShowDetails,
3887
3897
  detailsOpen = false
3888
3898
  }) {
3889
3899
  const options = useContext4(GenieLoadingOptionsContext);
3890
- const phrases = options?.phrases?.length ? options.phrases : PHRASES;
3900
+ const waiting = phase === "waiting";
3901
+ const phrases = options?.phrases?.length ? options.phrases : waiting ? WAITING_PHRASES : PHRASES;
3891
3902
  const theme = useThemeType(void 0);
3892
3903
  const [phrase, setPhrase] = useState7(0);
3893
3904
  const [showDetails, setShowDetails] = useState7(false);
@@ -3902,7 +3913,7 @@ function GenieLoading({
3902
3913
  const timer = window.setInterval(update, 5e3);
3903
3914
  return () => window.clearInterval(timer);
3904
3915
  }, [startedAt, phrases]);
3905
- if (options?.render) return options.render({ startedAt, detailsOpen, onShowDetails });
3916
+ if (options?.render) return options.render({ startedAt, phase, detailsOpen, onShowDetails });
3906
3917
  return /* @__PURE__ */ jsxs6("div", { className: "og-genie-loading", children: [
3907
3918
  /* @__PURE__ */ jsx8(
3908
3919
  "div",
@@ -3918,8 +3929,8 @@ function GenieLoading({
3918
3929
  }
3919
3930
  ),
3920
3931
  /* @__PURE__ */ jsxs6("div", { className: "og-genie-copy", children: [
3921
- /* @__PURE__ */ jsx8("span", { className: "sr-only", role: "status", children: slow ? options?.messages?.slowStatus ?? "Preparing your task. Taking longer than usual." : options?.messages?.status ?? "Preparing your task." }),
3922
- /* @__PURE__ */ jsx8("span", { className: "og-genie-phrase", "aria-hidden": "true", children: slow ? options?.messages?.slowText ?? "A little longer than usual\u2026" : phrases[phrase % phrases.length] }, slow ? "slow" : phrase),
3932
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", role: "status", children: slow ? options?.messages?.slowStatus ?? (waiting ? "Waiting for a response. Taking longer than usual." : "Preparing your task. Taking longer than usual.") : options?.messages?.status ?? (waiting ? "Waiting for a response." : "Preparing your task.") }),
3933
+ /* @__PURE__ */ jsx8("span", { className: "og-genie-phrase", "aria-hidden": "true", children: slow ? options?.messages?.slowText ?? (waiting ? "Still waiting for a response\u2026" : "A little longer than usual\u2026") : phrases[phrase % phrases.length] }, slow ? "slow" : phrase),
3923
3934
  showDetails || detailsOpen ? /* @__PURE__ */ jsxs6(
3924
3935
  "button",
3925
3936
  {
@@ -3928,7 +3939,7 @@ function GenieLoading({
3928
3939
  "aria-expanded": detailsOpen,
3929
3940
  onClick: onShowDetails,
3930
3941
  children: [
3931
- detailsOpen ? options?.messages?.hideDetails ?? "Hide details" : options?.messages?.showDetails ?? "Behind the magic",
3942
+ detailsOpen ? options?.messages?.hideDetails ?? "Hide details" : options?.messages?.showDetails ?? (waiting ? "Show details" : "Behind the magic"),
3932
3943
  /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: " \u2197" })
3933
3944
  ]
3934
3945
  }
@@ -4014,7 +4025,8 @@ function ActivityRail({
4014
4025
  const providerResponded = phases.some(
4015
4026
  (item) => item.phase === "provider_first_byte" && item.status === "complete"
4016
4027
  );
4017
- const preparing = !hasWork && !interrupted && (startupActive ?? (!providerResponded && phases.some((item) => item.status === "running")));
4028
+ const responsePending = phases.some((item) => item.phase === "provider_first_byte");
4029
+ const loading = !hasWork && !interrupted && (startupActive ?? (!providerResponded && phases.some((item) => item.status === "running")));
4018
4030
  const visibleItems = debug || detailsOpen ? items : items.filter(
4019
4031
  (item) => item.kind === "startup-phase" ? item.status === "failed" || item.status === "cancelled" : item.kind !== "reasoning" || item.text.trim().length > 0
4020
4032
  );
@@ -4062,7 +4074,7 @@ function ActivityRail({
4062
4074
  className
4063
4075
  ),
4064
4076
  children: [
4065
- /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: preparing && !debug ? /* @__PURE__ */ jsx10(
4077
+ /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: loading && !debug ? /* @__PURE__ */ jsx10(
4066
4078
  motion.div,
4067
4079
  {
4068
4080
  initial: { opacity: 0 },
@@ -4081,6 +4093,7 @@ function ActivityRail({
4081
4093
  GenieLoading,
4082
4094
  {
4083
4095
  startedAt,
4096
+ phase: responsePending ? "waiting" : "preparing",
4084
4097
  detailsOpen,
4085
4098
  onShowDetails: () => setDetailsOpen((open) => !open)
4086
4099
  }
@@ -4088,7 +4101,7 @@ function ActivityRail({
4088
4101
  },
4089
4102
  "startup"
4090
4103
  ) : null }),
4091
- detailsOpen && !debug && !preparing ? /* @__PURE__ */ jsx10(
4104
+ detailsOpen && !debug && !loading ? /* @__PURE__ */ jsx10(
4092
4105
  "button",
4093
4106
  {
4094
4107
  type: "button",
@@ -5564,11 +5577,11 @@ import {
5564
5577
  lazy as lazy3,
5565
5578
  memo,
5566
5579
  useCallback as useCallback3,
5567
- useEffect as useEffect9,
5580
+ useEffect as useEffect10,
5568
5581
  useLayoutEffect as useLayoutEffect4,
5569
- useMemo as useMemo4,
5582
+ useMemo as useMemo5,
5570
5583
  useRef as useRef9,
5571
- useState as useState14
5584
+ useState as useState15
5572
5585
  } from "react";
5573
5586
 
5574
5587
  // src/components/timeline-anchor.tsx
@@ -5710,6 +5723,76 @@ function useReadingProgress(projected, pinned, scroller) {
5710
5723
  return { groups, release };
5711
5724
  }
5712
5725
 
5726
+ // src/components/timeline-pill-placement.ts
5727
+ import { useEffect as useEffect9, useState as useState14 } from "react";
5728
+ var RECHECK_MS = 1e3;
5729
+ function useTimelinePillPlacement({
5730
+ pillRef,
5731
+ scrollerRef,
5732
+ active,
5733
+ preference,
5734
+ allowDownwardFallback = false
5735
+ }) {
5736
+ const [position, setPosition] = useState14({
5737
+ placement: preference[0],
5738
+ offsetY: 0
5739
+ });
5740
+ const key = preference.join(",");
5741
+ useEffect9(() => {
5742
+ if (!active) {
5743
+ setPosition({ placement: preference[0], offsetY: 0 });
5744
+ return;
5745
+ }
5746
+ const scroller = scrollerRef.current;
5747
+ if (!scroller) return;
5748
+ let frame = 0;
5749
+ let current = { placement: preference[0], offsetY: 0 };
5750
+ let geometry = null;
5751
+ let disposed = false;
5752
+ void import("./timeline-pill-geometry-Z23V243M.js").then((loaded) => {
5753
+ if (disposed) return;
5754
+ geometry = loaded;
5755
+ schedule();
5756
+ });
5757
+ const evaluate = () => {
5758
+ frame = 0;
5759
+ const pill = pillRef.current;
5760
+ const frameElement = pill?.offsetParent;
5761
+ if (!geometry || !pill || !(frameElement instanceof HTMLElement)) return;
5762
+ const next = allowDownwardFallback ? geometry.chooseQuestionPosition(pill, frameElement, scroller, preference, current) : {
5763
+ placement: geometry.choosePlacement(
5764
+ pill,
5765
+ frameElement,
5766
+ scroller,
5767
+ preference,
5768
+ current.placement
5769
+ ),
5770
+ offsetY: 0
5771
+ };
5772
+ if (next.placement !== current.placement || next.offsetY !== current.offsetY) {
5773
+ current = next;
5774
+ setPosition(next);
5775
+ }
5776
+ };
5777
+ const schedule = () => {
5778
+ if (frame === 0) frame = requestAnimationFrame(evaluate);
5779
+ };
5780
+ schedule();
5781
+ const view = scroller.ownerDocument.defaultView;
5782
+ scroller.addEventListener("scroll", schedule, { passive: true });
5783
+ view?.addEventListener("resize", schedule);
5784
+ const timer = setInterval(schedule, RECHECK_MS);
5785
+ return () => {
5786
+ disposed = true;
5787
+ if (frame !== 0) cancelAnimationFrame(frame);
5788
+ scroller.removeEventListener("scroll", schedule);
5789
+ view?.removeEventListener("resize", schedule);
5790
+ clearInterval(timer);
5791
+ };
5792
+ }, [active, key, pillRef, scrollerRef, allowDownwardFallback]);
5793
+ return active ? position : { placement: preference[0], offsetY: 0 };
5794
+ }
5795
+
5713
5796
  // src/components/timeline-settlement.ts
5714
5797
  function captureTimelineSettlement(scroller, groups) {
5715
5798
  if (timelineHasReader(scroller)) return null;
@@ -6125,13 +6208,77 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
6125
6208
  return true;
6126
6209
  }
6127
6210
 
6128
- // src/components/message-timeline.tsx
6211
+ // src/timeline/allowance-exhausted-row.tsx
6212
+ import { GaugeIcon } from "lucide-react";
6213
+ import { createContext as createContext10, useContext as useContext11, useMemo as useMemo4 } from "react";
6129
6214
  import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
6130
- var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-ODLVF4OI.js"));
6215
+ var AllowancePresentationContext = createContext10({
6216
+ render: void 0,
6217
+ labels: allowanceLabels()
6218
+ });
6219
+ function AllowancePresentationProvider({
6220
+ render,
6221
+ labels,
6222
+ children
6223
+ }) {
6224
+ const value = useMemo4(() => ({ render, labels: allowanceLabels(labels) }), [render, labels]);
6225
+ return /* @__PURE__ */ jsx17(AllowancePresentationContext.Provider, { value, children });
6226
+ }
6227
+ function AllowanceExhaustedRow({ refusal }) {
6228
+ const { render, labels } = useContext11(AllowancePresentationContext);
6229
+ const enter = useEntranceAnimation();
6230
+ const workspace = refusal.scope === "workspace";
6231
+ const defaultRow = /* @__PURE__ */ jsxs12(
6232
+ "div",
6233
+ {
6234
+ className: cn(
6235
+ enter && "animate-og-enter",
6236
+ "flex items-start gap-2.5 rounded-og-md border border-og-status-waiting/35 bg-og-status-waiting/8 px-3.5 py-2.5 text-og-menu text-og-fg"
6237
+ ),
6238
+ role: "status",
6239
+ "data-og-allowance-exhausted": refusal.scope,
6240
+ children: [
6241
+ /* @__PURE__ */ jsx17(GaugeIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-og-status-waiting" }),
6242
+ /* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
6243
+ /* @__PURE__ */ jsx17("p", { className: "font-medium", children: workspace ? labels.workspaceLimitReachedTitle : labels.memberLimitReachedTitle }),
6244
+ /* @__PURE__ */ jsxs12("p", { className: "mt-0.5 text-og-fg-muted", children: [
6245
+ workspace ? labels.workspaceRemedy : labels.memberRemedy,
6246
+ " ",
6247
+ /* @__PURE__ */ jsx17(
6248
+ "span",
6249
+ {
6250
+ title: refusal.resetsAt ? formatAllowanceInstant(refusal.resetsAt) : void 0,
6251
+ className: "whitespace-nowrap",
6252
+ children: allowanceResetSentence(labels, refusal.resetsAt)
6253
+ }
6254
+ )
6255
+ ] })
6256
+ ] })
6257
+ ]
6258
+ }
6259
+ );
6260
+ return /* @__PURE__ */ jsx17(Fragment5, { children: render?.(refusal, { labels, defaultRow }) ?? defaultRow });
6261
+ }
6262
+
6263
+ // src/components/message-timeline.tsx
6264
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
6265
+ var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-DMLMM2TX.js"));
6131
6266
  var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-markers-GNDHTGBD.js"));
6132
6267
  var PIN_THRESHOLD_PX = 48;
6133
6268
  var JUMP_TO_LATEST_CATCHUP_DEBT_PX = 240;
6134
6269
  var QUESTION_NAV_MARGIN_PX = 12;
6270
+ var JUMP_PILL_PLACEMENTS = ["center", "end", "start"];
6271
+ var QUESTION_PILL_PLACEMENTS = ["end", "center", "start"];
6272
+ var JUMP_PILL_PLACEMENT_CLASS = {
6273
+ center: "inset-x-0 mx-auto",
6274
+ end: "right-4 sm:right-6",
6275
+ start: "left-4 sm:left-6"
6276
+ };
6277
+ var QUESTION_PILL_PLACEMENT_CLASS = {
6278
+ center: "justify-center",
6279
+ end: "justify-end",
6280
+ start: "justify-start"
6281
+ };
6135
6282
  var OLDER_PREFETCH_MARGIN_PX = 400;
6136
6283
  var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
6137
6284
  var PRIMARY_ACTION_CLASS = "inline-flex w-full shrink-0 items-center justify-center gap-1.5 rounded-og-md border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-1.5 text-og-menu font-medium sm:w-auto";
@@ -6208,11 +6355,12 @@ var QUESTION_NAV_HIDDEN_PX = 24;
6208
6355
  function readQuestionNav(node) {
6209
6356
  const view = node.getBoundingClientRect();
6210
6357
  const prompts = [...node.querySelectorAll("[data-og-prompt]")];
6211
- const prompt = prompts.at(-1);
6358
+ const middle = view.top + view.height / 2;
6359
+ const prompt = prompts.reverse().find((candidate) => candidate.getBoundingClientRect().top <= middle);
6212
6360
  const key = prompt?.dataset.ogGroupKey;
6213
6361
  if (!prompt || !key) return null;
6214
- const top = prompt.getBoundingClientRect().top;
6215
- if (top >= view.top - QUESTION_NAV_HIDDEN_PX && top < view.bottom) {
6362
+ const bounds = prompt.getBoundingClientRect();
6363
+ if (bounds.top >= view.top - QUESTION_NAV_HIDDEN_PX || bounds.bottom > view.top) {
6216
6364
  return null;
6217
6365
  }
6218
6366
  return { key };
@@ -6228,6 +6376,7 @@ function cssEscapeAttribute(value) {
6228
6376
  }
6229
6377
  function MessageTimeline({
6230
6378
  resolveLink,
6379
+ renderInteractiveBlock,
6231
6380
  userMessageDisclosureLabels,
6232
6381
  searchTarget,
6233
6382
  events,
@@ -6239,6 +6388,8 @@ function MessageTimeline({
6239
6388
  onMemoryClick,
6240
6389
  onReconnect,
6241
6390
  renderAuthNeeded,
6391
+ renderAllowanceExhausted,
6392
+ allowanceExhaustedLabels,
6242
6393
  shouldRenderAuthNeeded,
6243
6394
  resolveProviderLogo,
6244
6395
  toolRegistry = defaultToolRegistry,
@@ -6261,12 +6412,11 @@ function MessageTimeline({
6261
6412
  loadingNewer = false,
6262
6413
  onLoadNewer,
6263
6414
  onJumpToLatest,
6264
- onJumpToLatestQuestion,
6265
6415
  trailingState,
6266
6416
  emptyState,
6267
6417
  className
6268
6418
  }) {
6269
- const resolvedItems = useMemo4(() => {
6419
+ const resolvedItems = useMemo5(() => {
6270
6420
  const projectedItems = items ?? buildTimeline(events ?? []);
6271
6421
  if (!shouldRenderAuthNeeded) {
6272
6422
  return projectedItems;
@@ -6284,21 +6434,22 @@ function MessageTimeline({
6284
6434
  ]) : null;
6285
6435
  const searchTargetRef = useRef9(searchTarget);
6286
6436
  searchTargetRef.current = searchTarget;
6287
- const renderSearchableMessageText = useMemo4(
6437
+ const renderSearchableMessageText = useMemo5(
6288
6438
  () => renderMessageText ? (text, item) => renderMessageText(text, item, {
6289
6439
  searchTarget: searchItem?.id === item.id ? searchTarget ?? null : null
6290
6440
  }) : (text, item) => {
6291
- const body = /* @__PURE__ */ jsx17(
6441
+ const body = /* @__PURE__ */ jsx18(
6292
6442
  Markdown,
6293
6443
  {
6294
6444
  searchTarget: searchItem?.id === item.id ? searchTarget : null,
6295
6445
  streaming: item.kind === "agent-message" && item.streaming,
6446
+ renderInteractiveBlock: item.kind === "agent-message" ? renderInteractiveBlock : void 0,
6296
6447
  children: text
6297
6448
  }
6298
6449
  );
6299
- return item.kind === "user-message" ? /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text, children: body }) : body;
6450
+ return item.kind === "user-message" ? /* @__PURE__ */ jsx18(UserMessageBody, { messageId: item.id, text, children: body }) : body;
6300
6451
  },
6301
- [renderMessageText, searchItem?.id, searchTarget]
6452
+ [renderInteractiveBlock, renderMessageText, searchItem?.id, searchTarget]
6302
6453
  );
6303
6454
  const sourceItems = events ?? items;
6304
6455
  const olderBoundaryKey = sourceItems?.[0]?.id;
@@ -6307,9 +6458,9 @@ function MessageTimeline({
6307
6458
  newerScopeRef.current = newerBoundaryKey;
6308
6459
  const newerAttemptRef = useRef9(null);
6309
6460
  const newerRetryButtonRef = useRef9(null);
6310
- const [newerRetryPending, setNewerRetryPending] = useState14(false);
6311
- const [newerFailure, setNewerFailure] = useState14(null);
6312
- useEffect9(() => {
6461
+ const [newerRetryPending, setNewerRetryPending] = useState15(false);
6462
+ const [newerFailure, setNewerFailure] = useState15(null);
6463
+ useEffect10(() => {
6313
6464
  newerScopeRef.current = newerBoundaryKey;
6314
6465
  newerAttemptRef.current = null;
6315
6466
  setNewerFailure(null);
@@ -6361,14 +6512,14 @@ function MessageTimeline({
6361
6512
  settlementAnimationRef.current = null;
6362
6513
  }, []);
6363
6514
  const olderPageBudgetRef = useRef9(0);
6364
- const [olderDemand, setOlderDemand] = useState14(0);
6515
+ const [olderDemand, setOlderDemand] = useState15(0);
6365
6516
  const readableTurns = turnSummary?.rolling === true;
6366
- const projectedGroups = useMemo4(
6517
+ const projectedGroups = useMemo5(
6367
6518
  () => groupTimeline(resolvedItems, { readableTurns }),
6368
6519
  [resolvedItems, readableTurns]
6369
6520
  );
6370
6521
  useLayoutEffect4(() => stopSettlement, [projectedGroups, stopSettlement]);
6371
- const annotationSources = useMemo4(() => {
6522
+ const annotationSources = useMemo5(() => {
6372
6523
  const sources = /* @__PURE__ */ new Map();
6373
6524
  for (const item of resolvedItems) {
6374
6525
  if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
@@ -6381,31 +6532,43 @@ function MessageTimeline({
6381
6532
  const topSentinelRef = useRef9(null);
6382
6533
  const bottomSentinelRef = useRef9(null);
6383
6534
  const previousBulkFirstKeyRef = useRef9(void 0);
6384
- const [pinned, setPinned] = useState14(true);
6535
+ const [pinned, setPinned] = useState15(true);
6385
6536
  const { groups: allGroups, release: releaseProgress } = useReadingProgress(
6386
6537
  projectedGroups,
6387
6538
  autoFollow && pinned && !hasNewer,
6388
6539
  scrollRef.current
6389
6540
  );
6390
- const [canSkipTipCatchup, setCanSkipTipCatchup] = useState14(false);
6541
+ const [canSkipTipCatchup, setCanSkipTipCatchup] = useState15(false);
6391
6542
  const canSkipTipCatchupRef = useRef9(false);
6392
- const [bulkActive, setBulkActive] = useState14(true);
6543
+ const [bulkActive, setBulkActive] = useState15(true);
6393
6544
  const olderPrefetchArmedRef = useRef9(false);
6394
- const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
6545
+ const [olderPrefetchArmed, setOlderPrefetchArmed] = useState15(false);
6395
6546
  const olderLoadAttemptRef = useRef9(null);
6396
- const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState14(
6547
+ const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState15(
6397
6548
  null
6398
6549
  );
6399
6550
  const underfillRetryReadyRef = useRef9(false);
6400
6551
  const resizeFollowRafRef = useRef9(null);
6401
6552
  const questionNavFrameRef = useRef9(null);
6402
- const [questionNav, setQuestionNav] = useState14(null);
6403
- const [questionTarget, setQuestionTarget] = useState14(null);
6404
- const [questionPending, setQuestionPending] = useState14(false);
6405
- const [questionError, setQuestionError] = useState14(null);
6406
- const questionRequestRef = useRef9(0);
6553
+ const [questionNav, setQuestionNav] = useState15(null);
6554
+ const jumpPillRef = useRef9(null);
6555
+ const questionPillRef = useRef9(null);
6556
+ const jumpPillShown = autoFollow && (!pinned || hasNewer || canSkipTipCatchup);
6557
+ const jumpPillPlacement = useTimelinePillPlacement({
6558
+ pillRef: jumpPillRef,
6559
+ scrollerRef: scrollRef,
6560
+ active: jumpPillShown,
6561
+ preference: JUMP_PILL_PLACEMENTS
6562
+ });
6563
+ const questionPillPlacement = useTimelinePillPlacement({
6564
+ pillRef: questionPillRef,
6565
+ scrollerRef: scrollRef,
6566
+ active: questionNav !== null,
6567
+ preference: QUESTION_PILL_PLACEMENTS,
6568
+ allowDownwardFallback: true
6569
+ });
6407
6570
  const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
6408
- const [revealed, setRevealed] = useState14(resolvedItems[0]?.id === "c");
6571
+ const [revealed, setRevealed] = useState15(resolvedItems[0]?.id === "c");
6409
6572
  const pinnedRef = useRef9(true);
6410
6573
  const hasNewerRef = useRef9(hasNewer);
6411
6574
  hasNewerRef.current = hasNewer;
@@ -6435,7 +6598,7 @@ function MessageTimeline({
6435
6598
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
6436
6599
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
6437
6600
  const groups = useStableTimelineGroupKeys(allGroups, !bulkRender);
6438
- const turnsWithOutput = useMemo4(
6601
+ const turnsWithOutput = useMemo5(
6439
6602
  () => new Set(
6440
6603
  resolvedItems.flatMap(
6441
6604
  (item) => "turnId" in item && item.turnId && (item.kind === "tool-call" || (item.kind === "agent-message" || item.kind === "reasoning") && item.text.trim()) ? [item.turnId] : []
@@ -6530,7 +6693,7 @@ function MessageTimeline({
6530
6693
  setOlderPrefetchArmed(true);
6531
6694
  }
6532
6695
  }, [autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]);
6533
- useEffect9(() => {
6696
+ useEffect10(() => {
6534
6697
  if (!readableTurns) return;
6535
6698
  const node = scrollRef.current;
6536
6699
  if (!node) return;
@@ -6689,7 +6852,7 @@ function MessageTimeline({
6689
6852
  },
6690
6853
  [applyPinned, autoFollow, snapToBottom, syncScrollBaseline, writeScrollTop]
6691
6854
  );
6692
- const userMessageDisclosureContext = useMemo4(
6855
+ const userMessageDisclosureContext = useMemo5(
6693
6856
  () => ({
6694
6857
  expandedByMessageId: userMessageDisclosureMemoryRef.current,
6695
6858
  beginChange: beginUserMessageDisclosureChange,
@@ -6704,7 +6867,7 @@ function MessageTimeline({
6704
6867
  userMessageDisclosureLabels?.showLess
6705
6868
  ]
6706
6869
  );
6707
- const timelineGroupEntryContext = useMemo4(
6870
+ const timelineGroupEntryContext = useMemo5(
6708
6871
  () => ({
6709
6872
  userMessageDisclosureContext,
6710
6873
  behavior: {
@@ -6788,11 +6951,11 @@ function MessageTimeline({
6788
6951
  questionNavFrameRef.current = requestFrame(() => {
6789
6952
  questionNavFrameRef.current = null;
6790
6953
  const node = scrollRef.current;
6791
- const next = hasNewer ? onJumpToLatestQuestion ? { key: null } : null : node ? readQuestionNav(node) ?? (onJumpToLatestQuestion && !node.querySelector("[data-og-prompt]") ? { key: null } : null) : null;
6954
+ const next = node ? readQuestionNav(node) : null;
6792
6955
  setQuestionNav((current) => sameQuestionNav(current, next) ? current : next);
6793
6956
  });
6794
- }, [readableTurns, hasNewer, onJumpToLatestQuestion]);
6795
- useEffect9(
6957
+ }, [readableTurns]);
6958
+ useEffect10(
6796
6959
  () => () => {
6797
6960
  if (questionNavFrameRef.current != null) {
6798
6961
  cancelFrame(questionNavFrameRef.current);
@@ -6815,28 +6978,6 @@ function MessageTimeline({
6815
6978
  syncScrollBaseline(node);
6816
6979
  scheduleQuestionNav();
6817
6980
  };
6818
- const jumpToLatestQuestion = async () => {
6819
- if (!onJumpToLatestQuestion) {
6820
- if (!hasNewer && questionNav?.key) jumpToQuestion(questionNav.key);
6821
- return;
6822
- }
6823
- const request = ++questionRequestRef.current;
6824
- releasePinFromReader();
6825
- wantPinRef.current = false;
6826
- setQuestionPending(true);
6827
- setQuestionError(null);
6828
- try {
6829
- const sequence = await onJumpToLatestQuestion();
6830
- if (request === questionRequestRef.current) setQuestionTarget(sequence);
6831
- } catch (reason) {
6832
- if (request === questionRequestRef.current)
6833
- setQuestionError(
6834
- reason instanceof Error && reason.name === "LatestQuestionQueuedError" ? "The latest question is in the prompt queue." : "Could not load the latest question. Try again."
6835
- );
6836
- } finally {
6837
- if (request === questionRequestRef.current) setQuestionPending(false);
6838
- }
6839
- };
6840
6981
  const driveFollowRef = useRef9(
6841
6982
  requestOlderIfUnderfilled
6842
6983
  );
@@ -6940,8 +7081,8 @@ function MessageTimeline({
6940
7081
  [applyCanSkipTipCatchup, cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
6941
7082
  );
6942
7083
  driveFollowRef.current = driveFollow;
6943
- useEffect9(() => stopFollow, [stopFollow]);
6944
- useEffect9(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
7084
+ useEffect10(() => stopFollow, [stopFollow]);
7085
+ useEffect10(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
6945
7086
  useLayoutEffect4(() => {
6946
7087
  const node = scrollRef.current;
6947
7088
  if (!node) {
@@ -7004,13 +7145,7 @@ function MessageTimeline({
7004
7145
  }
7005
7146
  }
7006
7147
  };
7007
- const questionGroup = questionTarget === null ? void 0 : groups.find(
7008
- ({ group }) => group.kind === "item" && group.item.kind === "user-message" && (group.item.sourceEvents?.some((source) => source.sequence === questionTarget) || group.item.annotationSource?.sequence === questionTarget)
7009
- );
7010
- if (questionGroup) {
7011
- jumpToQuestion(questionGroup.key);
7012
- setQuestionTarget(null);
7013
- } else if (pendingJumpToStartRef.current && firstItemChanged) {
7148
+ if (pendingJumpToStartRef.current && firstItemChanged) {
7014
7149
  pendingJumpToStartRef.current = false;
7015
7150
  stopFollow();
7016
7151
  writeScrollTop(node, 0);
@@ -7166,7 +7301,7 @@ function MessageTimeline({
7166
7301
  seenActivityIdsRef.current.clear();
7167
7302
  applyPinned(true);
7168
7303
  }, [allGroups.length, revealed, applyPinned, clearReaderIntent]);
7169
- useEffect9(() => {
7304
+ useEffect10(() => {
7170
7305
  const node = scrollRef.current;
7171
7306
  if (node) {
7172
7307
  requestOlderIfUnderfilled(node);
@@ -7181,7 +7316,7 @@ function MessageTimeline({
7181
7316
  const frame = requestFrame(() => setBulkActive(false));
7182
7317
  return () => cancelFrame(frame);
7183
7318
  }, [bulkRender, firstGroupKey]);
7184
- useEffect9(() => {
7319
+ useEffect10(() => {
7185
7320
  const root = scrollRef.current;
7186
7321
  const target = topSentinelRef.current;
7187
7322
  if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
@@ -7232,7 +7367,7 @@ function MessageTimeline({
7232
7367
  onLoadOlder,
7233
7368
  requestOlderIfUnderfilled
7234
7369
  ]);
7235
- useEffect9(() => {
7370
+ useEffect10(() => {
7236
7371
  const root = scrollRef.current;
7237
7372
  const target = bottomSentinelRef.current;
7238
7373
  if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
@@ -7249,7 +7384,7 @@ function MessageTimeline({
7249
7384
  observer.observe(target);
7250
7385
  return () => observer.disconnect();
7251
7386
  }, [hasNewer, loadingNewer, onLoadNewer, requestNewer, firstGroupKey]);
7252
- useEffect9(() => {
7387
+ useEffect10(() => {
7253
7388
  const node = scrollRef.current;
7254
7389
  const inner = node?.firstElementChild;
7255
7390
  if (!node || !inner || typeof ResizeObserver === "undefined") {
@@ -7286,7 +7421,7 @@ function MessageTimeline({
7286
7421
  }
7287
7422
  };
7288
7423
  }, [autoFollow, driveFollow, requestOlderIfUnderfilled, snapToBottom]);
7289
- useEffect9(() => {
7424
+ useEffect10(() => {
7290
7425
  if (searchTargetRef.current) return;
7291
7426
  if (hasNewer) {
7292
7427
  stopFollow();
@@ -7426,355 +7561,377 @@ function MessageTimeline({
7426
7561
  }
7427
7562
  releasePinAfterScrollSettled(node);
7428
7563
  };
7429
- const timeline = /* @__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: false, children: /* @__PURE__ */ jsx17(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx17(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs12(
7430
- "div",
7564
+ const timeline = /* @__PURE__ */ jsx18(
7565
+ AllowancePresentationProvider,
7431
7566
  {
7432
- className: cn("og-root relative flex min-h-0 flex-col", className),
7433
- style: { "--og-work-header-top": "-4rem" },
7434
- children: [
7435
- onAnnotate ? /* @__PURE__ */ jsx17(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx17(
7436
- TimelineAnnotationSelection,
7437
- {
7438
- rootRef: scrollRef,
7439
- sources: annotationSources,
7440
- onAnnotate
7441
- }
7442
- ) }) : null,
7443
- /* @__PURE__ */ jsx17(
7444
- "div",
7445
- {
7446
- ref: scrollRef,
7447
- "data-og-timeline-scroller": "",
7448
- "data-og-bottom-follow": autoFollow && pinned && !hasNewer ? "true" : "false",
7449
- tabIndex: -1,
7450
- onScroll,
7451
- onScrollEnd,
7452
- onWheel,
7453
- onTouchStart: (event) => {
7454
- stopSettlement();
7455
- const touch = event.touches.length === 1 ? event.touches[0] : void 0;
7456
- touchPositionRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
7457
- },
7458
- onTouchMove: (event) => {
7459
- const touch = event.touches[0];
7460
- const previous = touchPositionRef.current;
7461
- if (!touch || !previous || event.touches.length !== 1) {
7462
- touchPositionRef.current = null;
7463
- return;
7464
- }
7465
- const deltaX = previous.x - touch.clientX;
7466
- const deltaY = previous.y - touch.clientY;
7467
- if (Math.max(Math.abs(deltaX), Math.abs(deltaY)) < 4) return;
7468
- touchPositionRef.current = { x: touch.clientX, y: touch.clientY };
7469
- onWheel({
7470
- deltaX,
7471
- deltaY,
7472
- target: event.target,
7473
- currentTarget: event.currentTarget
7474
- });
7475
- },
7476
- onTouchEnd: () => {
7477
- touchPositionRef.current = null;
7478
- },
7479
- onTouchCancel: () => {
7480
- touchPositionRef.current = null;
7481
- },
7482
- onClickCapture: (event) => {
7483
- const target = event.target instanceof Element ? event.target.closest("button[aria-expanded]") : null;
7484
- if (target) {
7485
- if (target.hasAttribute("data-og-work-header")) {
7486
- releaseProgress(
7487
- target.closest("[data-og-group-key]")?.getAttribute("data-og-group-key") ?? null
7488
- );
7489
- }
7490
- releasePinFromReader();
7491
- disclosureKeepsUnpinnedRef.current = true;
7492
- }
7493
- },
7494
- onFocusCapture: (event) => {
7495
- if (readableTurns && event.target !== event.currentTarget) {
7496
- stopSettlement();
7497
- releasePinFromReader();
7498
- disclosureKeepsUnpinnedRef.current = true;
7567
+ render: renderAllowanceExhausted,
7568
+ labels: allowanceExhaustedLabels,
7569
+ children: /* @__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: false, children: /* @__PURE__ */ jsx18(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx18(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs13(
7570
+ "div",
7571
+ {
7572
+ className: cn("og-root relative flex min-h-0 flex-col", className),
7573
+ style: { "--og-work-header-top": "-4rem" },
7574
+ children: [
7575
+ onAnnotate ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
7576
+ TimelineAnnotationSelection,
7577
+ {
7578
+ rootRef: scrollRef,
7579
+ sources: annotationSources,
7580
+ onAnnotate
7499
7581
  }
7500
- },
7501
- onPointerDown,
7502
- onKeyDown,
7503
- style: groups.length > 0 && !revealed ? { visibility: "hidden" } : void 0,
7504
- className: cn(
7505
- // tabIndex=-1 is programmatic only — never paint a focus ring on
7506
- // the whole scroller (click + Shift used to flash a blue outline).
7507
- "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-16 pb-6 sm:px-6 outline-hidden",
7508
- autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
7509
- ),
7510
- children: /* @__PURE__ */ jsx17(
7511
- TimelineBeforeLayout,
7582
+ ) }) : null,
7583
+ /* @__PURE__ */ jsx18(
7584
+ "div",
7512
7585
  {
7513
- capture: () => {
7514
- if (readableTurns && timelineHasReader(scrollRef.current)) {
7586
+ ref: scrollRef,
7587
+ "data-og-timeline-scroller": "",
7588
+ "data-og-bottom-follow": autoFollow && pinned && !hasNewer ? "true" : "false",
7589
+ tabIndex: -1,
7590
+ onScroll,
7591
+ onScrollEnd,
7592
+ onWheel,
7593
+ onTouchStart: (event) => {
7594
+ stopSettlement();
7595
+ const touch = event.touches.length === 1 ? event.touches[0] : void 0;
7596
+ touchPositionRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
7597
+ },
7598
+ onTouchMove: (event) => {
7599
+ const touch = event.touches[0];
7600
+ const previous = touchPositionRef.current;
7601
+ if (!touch || !previous || event.touches.length !== 1) {
7602
+ touchPositionRef.current = null;
7603
+ return;
7604
+ }
7605
+ const deltaX = previous.x - touch.clientX;
7606
+ const deltaY = previous.y - touch.clientY;
7607
+ if (Math.max(Math.abs(deltaX), Math.abs(deltaY)) < 4) return;
7608
+ touchPositionRef.current = { x: touch.clientX, y: touch.clientY };
7609
+ onWheel({
7610
+ deltaX,
7611
+ deltaY,
7612
+ target: event.target,
7613
+ currentTarget: event.currentTarget
7614
+ });
7615
+ },
7616
+ onTouchEnd: () => {
7617
+ touchPositionRef.current = null;
7618
+ },
7619
+ onTouchCancel: () => {
7620
+ touchPositionRef.current = null;
7621
+ },
7622
+ onClickCapture: (event) => {
7623
+ const target = event.target instanceof Element ? event.target.closest("button[aria-expanded]") : null;
7624
+ if (target) {
7625
+ if (target.hasAttribute("data-og-work-header")) {
7626
+ releaseProgress(
7627
+ target.closest("[data-og-group-key]")?.getAttribute("data-og-group-key") ?? null
7628
+ );
7629
+ }
7515
7630
  releasePinFromReader();
7631
+ disclosureKeepsUnpinnedRef.current = true;
7516
7632
  }
7517
- readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
7518
- settlementRef.current = readableTurns && autoFollow && pinnedRef.current && revealedRef.current && !hasNewer && !pendingReaderLeaveRef.current && !disclosureKeepsUnpinnedRef.current && !prefersReducedMotion() && scrollRef.current ? captureTimelineSettlement(scrollRef.current, groups) : null;
7519
7633
  },
7520
- children: /* @__PURE__ */ jsxs12("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
7521
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
7522
- // Reserved top gutter: controls scroll with history and cannot
7523
- // cover a disclosure. Visibility never changes content height.
7524
- /* @__PURE__ */ jsxs12(
7525
- motion3.div,
7526
- {
7527
- initial: { opacity: 0, y: -6 },
7528
- animate: { opacity: 1, y: 0 },
7529
- exit: { opacity: 0, y: -6 },
7530
- transition: { duration: 0.15, ease: "easeOut" },
7531
- "data-og-loading-older": "",
7532
- "aria-live": "polite",
7533
- className: cn(
7534
- "pointer-events-none absolute inset-x-0 -top-11 z-10 flex",
7535
- // The scrolling history control and fixed question
7536
- // action must never share the same pointer region.
7537
- questionNav ? "max-w-[calc(50%-0.5rem)] justify-start" : "justify-center"
7538
- ),
7539
- children: [
7540
- loadingOlder || loadingOldest ? /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
7541
- hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx17(
7542
- "button",
7543
- {
7544
- type: "button",
7545
- "data-og-retry": underfillRetryReady || void 0,
7546
- "data-og-jump-to-start": !underfillRetryReady || void 0,
7547
- onClick: () => {
7548
- const node = scrollRef.current;
7549
- if (underfillRetryReady) {
7550
- if (node && underfillRetryReadyRef.current) {
7551
- requestOlderIfUnderfilled(node, underfillSettledAttempt);
7552
- }
7553
- return;
7554
- }
7555
- applyPinned(false);
7556
- pendingJumpToStartRef.current = true;
7557
- const seq = ++jumpToStartSeqRef.current;
7558
- void Promise.resolve(onJumpToStart()).then(
7559
- () => {
7560
- const scroller = scrollRef.current ?? node;
7561
- if (scroller) {
7562
- scroller.scrollTop = 0;
7563
- }
7564
- requestFrame(() => {
7565
- if (jumpToStartSeqRef.current === seq) {
7566
- pendingJumpToStartRef.current = false;
7567
- }
7568
- });
7569
- },
7570
- () => {
7571
- if (jumpToStartSeqRef.current === seq) {
7572
- pendingJumpToStartRef.current = false;
7573
- }
7574
- }
7575
- );
7576
- },
7577
- className: "pointer-events-auto rounded-full border border-og-border px-3 py-1.5 text-og-control",
7578
- children: underfillRetryReady ? underfillSettledAttempt?.[2]?.tailPreserved ? "Load earlier activity" : "Retry earlier activity" : "Jump to start"
7579
- }
7580
- ) : null
7581
- ]
7582
- }
7583
- )
7584
- ) : null }),
7585
- !groups.length ? emptyState ?? /* @__PURE__ */ jsx17("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
7586
- hasOlder && olderPrefetchArmed ? (
7587
- // Overlaid, not a layout row: mounting/unmounting the sentinel
7588
- // must never shift content (that shift was itself a wobble).
7589
- // End at the scroll origin above the pt-16 gutter so the
7590
- // observer and scrollTop cooldown share the same 400px band.
7591
- /* @__PURE__ */ jsx17(
7592
- "div",
7593
- {
7594
- ref: topSentinelRef,
7595
- "data-og-top-sentinel": "",
7596
- "data-og-timeline-chrome": "",
7597
- "aria-hidden": "true",
7598
- className: "pointer-events-none absolute inset-x-0 -top-16 h-px -translate-y-full"
7634
+ onFocusCapture: (event) => {
7635
+ if (readableTurns && event.target !== event.currentTarget) {
7636
+ stopSettlement();
7637
+ releasePinFromReader();
7638
+ disclosureKeepsUnpinnedRef.current = true;
7639
+ }
7640
+ },
7641
+ onPointerDown,
7642
+ onKeyDown,
7643
+ style: groups.length > 0 && !revealed ? { visibility: "hidden" } : void 0,
7644
+ className: cn(
7645
+ // tabIndex=-1 is programmatic only — never paint a focus ring on
7646
+ // the whole scroller (click + Shift used to flash a blue outline).
7647
+ "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-16 pb-6 sm:px-6 outline-hidden",
7648
+ autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
7649
+ ),
7650
+ children: /* @__PURE__ */ jsx18(
7651
+ TimelineBeforeLayout,
7652
+ {
7653
+ capture: () => {
7654
+ if (readableTurns && timelineHasReader(scrollRef.current)) {
7655
+ releasePinFromReader();
7599
7656
  }
7600
- )
7601
- ) : null,
7602
- groups.map(({ group, key, entranceEnabled }, index) => {
7603
- return /* @__PURE__ */ jsx17(
7604
- TimelineSearchRevealContext.Provider,
7605
- {
7606
- value: searchItem && timelineGroupItemIds(group).includes(searchItem.id) ? searchRevealKey : null,
7607
- children: /* @__PURE__ */ jsx17(
7608
- TimelineGroupEntry,
7657
+ readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
7658
+ settlementRef.current = readableTurns && autoFollow && pinnedRef.current && revealedRef.current && !hasNewer && !pendingReaderLeaveRef.current && !disclosureKeepsUnpinnedRef.current && !prefersReducedMotion() && scrollRef.current ? captureTimelineSettlement(scrollRef.current, groups) : null;
7659
+ },
7660
+ children: /* @__PURE__ */ jsxs13("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
7661
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
7662
+ // Reserved top gutter: controls scroll with history and cannot
7663
+ // cover a disclosure. Visibility never changes content height.
7664
+ /* @__PURE__ */ jsxs13(
7665
+ motion3.div,
7609
7666
  {
7610
- groupKey: key,
7611
- group,
7612
- nextGroup: groups[index + 1]?.group,
7613
- startupDismissed: group.kind === "activity" && group.items.some(
7614
- (item) => item.turnId && turnsWithOutput.has(item.turnId)
7667
+ initial: { opacity: 0, y: -6 },
7668
+ animate: { opacity: 1, y: 0 },
7669
+ exit: { opacity: 0, y: -6 },
7670
+ transition: { duration: 0.15, ease: "easeOut" },
7671
+ "data-og-loading-older": "",
7672
+ "aria-live": "polite",
7673
+ className: cn(
7674
+ "pointer-events-none absolute inset-x-0 -top-11 z-10 flex",
7675
+ // The scrolling history control and fixed question
7676
+ // action must never share the same pointer region.
7677
+ questionNav ? "max-w-[calc(50%-0.5rem)] justify-start" : "justify-center"
7615
7678
  ),
7616
- entranceEnabled,
7617
- liveEntranceEnabled: group.kind === "activity" ? !bulkRender : void 0,
7618
- context: timelineGroupEntryContext
7679
+ children: [
7680
+ loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
7681
+ hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx18(
7682
+ "button",
7683
+ {
7684
+ type: "button",
7685
+ "data-og-retry": underfillRetryReady || void 0,
7686
+ "data-og-jump-to-start": !underfillRetryReady || void 0,
7687
+ onClick: () => {
7688
+ const node = scrollRef.current;
7689
+ if (underfillRetryReady) {
7690
+ if (node && underfillRetryReadyRef.current) {
7691
+ requestOlderIfUnderfilled(
7692
+ node,
7693
+ underfillSettledAttempt
7694
+ );
7695
+ }
7696
+ return;
7697
+ }
7698
+ applyPinned(false);
7699
+ pendingJumpToStartRef.current = true;
7700
+ const seq = ++jumpToStartSeqRef.current;
7701
+ void Promise.resolve(onJumpToStart()).then(
7702
+ () => {
7703
+ const scroller = scrollRef.current ?? node;
7704
+ if (scroller) {
7705
+ scroller.scrollTop = 0;
7706
+ }
7707
+ requestFrame(() => {
7708
+ if (jumpToStartSeqRef.current === seq) {
7709
+ pendingJumpToStartRef.current = false;
7710
+ }
7711
+ });
7712
+ },
7713
+ () => {
7714
+ if (jumpToStartSeqRef.current === seq) {
7715
+ pendingJumpToStartRef.current = false;
7716
+ }
7717
+ }
7718
+ );
7719
+ },
7720
+ className: "pointer-events-auto rounded-full border border-og-border px-3 py-1.5 text-og-control",
7721
+ children: underfillRetryReady ? underfillSettledAttempt?.[2]?.tailPreserved ? "Load earlier activity" : "Retry earlier activity" : "Jump to start"
7722
+ }
7723
+ ) : null
7724
+ ]
7619
7725
  }
7620
7726
  )
7621
- },
7622
- key
7623
- );
7624
- }),
7625
- groups.length > 0 && trailingState ? /* @__PURE__ */ jsx17("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7626
- hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs12(
7627
- "div",
7628
- {
7629
- "data-og-newer-error": "",
7630
- className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
7631
- children: [
7632
- /* @__PURE__ */ jsxs12("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
7633
- "Couldn\u2019t load later activity. ",
7634
- newerFailure.message
7635
- ] }),
7636
- /* @__PURE__ */ jsx17(
7637
- "button",
7727
+ ) : null }),
7728
+ !groups.length ? emptyState ?? /* @__PURE__ */ jsx18("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
7729
+ hasOlder && olderPrefetchArmed ? (
7730
+ // Overlaid, not a layout row: mounting/unmounting the sentinel
7731
+ // must never shift content (that shift was itself a wobble).
7732
+ // End at the scroll origin above the pt-16 gutter so the
7733
+ // observer and scrollTop cooldown share the same 400px band.
7734
+ /* @__PURE__ */ jsx18(
7735
+ "div",
7638
7736
  {
7639
- ref: newerRetryButtonRef,
7640
- type: "button",
7641
- "data-og-retry-newer": "",
7642
- className: "min-h-11 rounded-og-md border border-og-border px-3 py-2 text-og-fg hover:bg-og-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent",
7643
- "aria-disabled": loadingNewer || newerRetryPending,
7644
- "aria-busy": newerRetryPending,
7645
- onClick: () => requestNewer(true),
7646
- children: newerRetryPending ? "Retrying later activity\u2026" : "Retry later activity"
7737
+ ref: topSentinelRef,
7738
+ "data-og-top-sentinel": "",
7739
+ "data-og-timeline-chrome": "",
7740
+ "aria-hidden": "true",
7741
+ className: "pointer-events-none absolute inset-x-0 -top-16 h-px -translate-y-full"
7647
7742
  }
7648
7743
  )
7649
- ]
7650
- }
7651
- ) : null,
7652
- hasNewer ? /* @__PURE__ */ jsx17(
7653
- "div",
7654
- {
7655
- ref: bottomSentinelRef,
7656
- "data-og-bottom-sentinel": "",
7657
- "data-og-timeline-chrome": "",
7658
- "aria-hidden": "true",
7659
- className: "h-px w-full"
7660
- }
7661
- ) : null
7662
- ] })
7744
+ ) : null,
7745
+ groups.map(({ group, key, entranceEnabled }, index) => {
7746
+ return /* @__PURE__ */ jsx18(
7747
+ TimelineSearchRevealContext.Provider,
7748
+ {
7749
+ value: searchItem && timelineGroupItemIds(group).includes(searchItem.id) ? searchRevealKey : null,
7750
+ children: /* @__PURE__ */ jsx18(
7751
+ TimelineGroupEntry,
7752
+ {
7753
+ groupKey: key,
7754
+ group,
7755
+ nextGroup: groups[index + 1]?.group,
7756
+ startupDismissed: group.kind === "activity" && group.items.some(
7757
+ (item) => item.turnId && turnsWithOutput.has(item.turnId)
7758
+ ),
7759
+ entranceEnabled,
7760
+ liveEntranceEnabled: group.kind === "activity" ? !bulkRender : void 0,
7761
+ context: timelineGroupEntryContext
7762
+ }
7763
+ )
7764
+ },
7765
+ key
7766
+ );
7767
+ }),
7768
+ groups.length > 0 && trailingState ? /* @__PURE__ */ jsx18("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
7769
+ hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs13(
7770
+ "div",
7771
+ {
7772
+ "data-og-newer-error": "",
7773
+ className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
7774
+ children: [
7775
+ /* @__PURE__ */ jsxs13("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
7776
+ "Couldn\u2019t load later activity. ",
7777
+ newerFailure.message
7778
+ ] }),
7779
+ /* @__PURE__ */ jsx18(
7780
+ "button",
7781
+ {
7782
+ ref: newerRetryButtonRef,
7783
+ type: "button",
7784
+ "data-og-retry-newer": "",
7785
+ className: "min-h-11 rounded-og-md border border-og-border px-3 py-2 text-og-fg hover:bg-og-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent",
7786
+ "aria-disabled": loadingNewer || newerRetryPending,
7787
+ "aria-busy": newerRetryPending,
7788
+ onClick: () => requestNewer(true),
7789
+ children: newerRetryPending ? "Retrying later activity\u2026" : "Retry later activity"
7790
+ }
7791
+ )
7792
+ ]
7793
+ }
7794
+ ) : null,
7795
+ hasNewer ? /* @__PURE__ */ jsx18(
7796
+ "div",
7797
+ {
7798
+ ref: bottomSentinelRef,
7799
+ "data-og-bottom-sentinel": "",
7800
+ "data-og-timeline-chrome": "",
7801
+ "aria-hidden": "true",
7802
+ className: "h-px w-full"
7803
+ }
7804
+ ) : null
7805
+ ] })
7806
+ }
7807
+ )
7663
7808
  }
7664
- )
7665
- }
7666
- ),
7667
- draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */ jsx17(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx17(
7668
- TimelineAnnotationMarkers,
7669
- {
7670
- rootRef: scrollRef,
7671
- annotations: draftAnnotations,
7672
- onSelect: onDraftAnnotationSelect
7673
- }
7674
- ) }) : null,
7675
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsx17(
7676
- motion3.div,
7677
- {
7678
- initial: { opacity: 0, y: -6 },
7679
- animate: { opacity: 1, y: 0 },
7680
- exit: { opacity: 0, y: -6 },
7681
- transition: { duration: 0.15, ease: "easeOut" },
7682
- "data-og-question-nav": "",
7683
- className: "pointer-events-none absolute inset-x-0 top-11 z-10 flex justify-end px-4 sm:px-6 pointer-coarse:top-14",
7684
- children: /* @__PURE__ */ jsxs12("div", { className: "pointer-events-auto inline-flex max-w-[calc(50%-0.5rem)] items-center rounded-full border border-og-border bg-og-surface-3/90 text-og-control font-medium text-og-fg shadow-og-md backdrop-blur", children: [
7685
- /* @__PURE__ */ jsxs12(
7686
- "button",
7687
- {
7688
- type: "button",
7689
- "data-og-jump-to-question": "",
7690
- onClick: () => void jumpToLatestQuestion(),
7691
- disabled: questionPending,
7692
- "aria-busy": questionPending,
7693
- title: questionError ?? void 0,
7694
- className: "inline-flex min-w-0 items-center gap-1.5 px-3 py-1.5 hover:text-og-fg pointer-coarse:min-h-11",
7695
- children: [
7696
- /* @__PURE__ */ jsx17(ArrowUpIcon, { "aria-hidden": true, className: "size-3.5" }),
7697
- "Latest question"
7698
- ]
7699
- }
7700
- ),
7701
- questionError && /* @__PURE__ */ jsx17("span", { role: "status", className: "px-2 text-og-xs", children: questionError })
7702
- ] })
7703
- },
7704
- "question-nav"
7705
- ) : null }),
7706
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx17(
7707
- motion3.div,
7708
- {
7709
- initial: { opacity: 0, y: 6 },
7710
- animate: { opacity: 1, y: 0 },
7711
- exit: { opacity: 0, y: 6 },
7712
- transition: { duration: 0.15, ease: "easeOut" },
7713
- "data-og-loading-newer": "",
7714
- "aria-live": "polite",
7715
- className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
7716
- children: /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
7717
- }
7718
- ) : null }),
7719
- /* @__PURE__ */ jsx17(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer || canSkipTipCatchup) && autoFollow ? /* @__PURE__ */ jsxs12(
7720
- motion3.button,
7721
- {
7722
- type: "button",
7723
- "data-og-jump-to-latest": "",
7724
- initial: { opacity: 0, y: 8 },
7725
- animate: { opacity: 1, y: 0 },
7726
- exit: { opacity: 0, y: 8 },
7727
- transition: { duration: 0.15, ease: "easeOut" },
7728
- onClick: () => {
7729
- const viewport = scrollRef.current;
7730
- const selection = viewport?.ownerDocument.getSelection();
7731
- if (selection && !selection.isCollapsed && (viewport?.contains(selection.anchorNode) || viewport?.contains(selection.focusNode)))
7732
- selection.removeAllRanges();
7733
- disclosureKeepsUnpinnedRef.current = false;
7734
- if (hasNewer) {
7735
- wantPinRef.current = true;
7736
- const node2 = scrollRef.current;
7737
- if (onJumpToLatest) {
7738
- void Promise.resolve(onJumpToLatest()).then(
7739
- () => {
7740
- const current = scrollRef.current;
7741
- if (current && wantPinRef.current && !hasNewerRef.current) {
7742
- wantPinRef.current = false;
7743
- applyPinned(true);
7744
- snapToBottom(current);
7809
+ ),
7810
+ draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
7811
+ TimelineAnnotationMarkers,
7812
+ {
7813
+ rootRef: scrollRef,
7814
+ annotations: draftAnnotations,
7815
+ onSelect: onDraftAnnotationSelect
7816
+ }
7817
+ ) }) : null,
7818
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsx18(
7819
+ motion3.div,
7820
+ {
7821
+ initial: { opacity: 0, y: -6 },
7822
+ animate: { opacity: 1, y: 0 },
7823
+ exit: { opacity: 0, y: -6 },
7824
+ transition: { duration: 0.15, ease: "easeOut" },
7825
+ "data-og-question-nav": "",
7826
+ "data-og-pill-placement": questionPillPlacement.placement,
7827
+ style: { marginTop: questionPillPlacement.offsetY },
7828
+ className: cn(
7829
+ "pointer-events-none absolute inset-x-0 top-11 z-10 flex px-4 sm:px-6 pointer-coarse:top-14",
7830
+ QUESTION_PILL_PLACEMENT_CLASS[questionPillPlacement.placement]
7831
+ ),
7832
+ children: /* @__PURE__ */ jsx18(
7833
+ motion3.div,
7834
+ {
7835
+ ref: questionPillRef,
7836
+ layout: "position",
7837
+ transition: { duration: 0.18, ease: "easeOut" },
7838
+ className: "pointer-events-auto inline-flex max-w-full items-center rounded-full border border-og-border bg-og-surface-3/90 text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
7839
+ children: /* @__PURE__ */ jsxs13(
7840
+ "button",
7841
+ {
7842
+ type: "button",
7843
+ "data-og-jump-to-question": "",
7844
+ onClick: () => jumpToQuestion(questionNav.key),
7845
+ className: "inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap px-3 py-1.5 hover:text-og-fg pointer-coarse:min-h-11",
7846
+ children: [
7847
+ /* @__PURE__ */ jsx18(ArrowUpIcon, { "aria-hidden": true, className: "size-3.5" }),
7848
+ "Back to your message"
7849
+ ]
7745
7850
  }
7746
- },
7747
- () => {
7748
- wantPinRef.current = false;
7749
- }
7750
- );
7751
- } else if (node2) {
7752
- snapToBottom(node2);
7753
- }
7754
- return;
7851
+ )
7852
+ }
7853
+ )
7854
+ },
7855
+ "question-nav"
7856
+ ) : null }),
7857
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx18(
7858
+ motion3.div,
7859
+ {
7860
+ initial: { opacity: 0, y: 6 },
7861
+ animate: { opacity: 1, y: 0 },
7862
+ exit: { opacity: 0, y: 6 },
7863
+ transition: { duration: 0.15, ease: "easeOut" },
7864
+ "data-og-loading-newer": "",
7865
+ "aria-live": "polite",
7866
+ className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
7867
+ children: /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
7755
7868
  }
7756
- const node = scrollRef.current;
7757
- if (node) {
7758
- applyPinned(true);
7759
- snapToBottom(node);
7869
+ ) : null }),
7870
+ /* @__PURE__ */ jsx18(AnimatePresence3, { children: jumpPillShown ? /* @__PURE__ */ jsxs13(
7871
+ motion3.button,
7872
+ {
7873
+ ref: jumpPillRef,
7874
+ type: "button",
7875
+ "data-og-jump-to-latest": "",
7876
+ "data-og-pill-placement": jumpPillPlacement.placement,
7877
+ layout: "position",
7878
+ initial: { opacity: 0, y: 8 },
7879
+ animate: { opacity: 1, y: 0 },
7880
+ exit: { opacity: 0, y: 8 },
7881
+ transition: { duration: 0.15, ease: "easeOut" },
7882
+ onClick: () => {
7883
+ const viewport = scrollRef.current;
7884
+ const selection = viewport?.ownerDocument.getSelection();
7885
+ if (selection && !selection.isCollapsed && (viewport?.contains(selection.anchorNode) || viewport?.contains(selection.focusNode)))
7886
+ selection.removeAllRanges();
7887
+ disclosureKeepsUnpinnedRef.current = false;
7888
+ if (hasNewer) {
7889
+ wantPinRef.current = true;
7890
+ const node2 = scrollRef.current;
7891
+ if (onJumpToLatest) {
7892
+ void Promise.resolve(onJumpToLatest()).then(
7893
+ () => {
7894
+ const current = scrollRef.current;
7895
+ if (current && wantPinRef.current && !hasNewerRef.current) {
7896
+ wantPinRef.current = false;
7897
+ applyPinned(true);
7898
+ snapToBottom(current);
7899
+ }
7900
+ },
7901
+ () => {
7902
+ wantPinRef.current = false;
7903
+ }
7904
+ );
7905
+ } else if (node2) {
7906
+ snapToBottom(node2);
7907
+ }
7908
+ return;
7909
+ }
7910
+ const node = scrollRef.current;
7911
+ if (node) {
7912
+ applyPinned(true);
7913
+ snapToBottom(node);
7914
+ }
7915
+ },
7916
+ className: cn(
7917
+ "absolute bottom-4 w-fit",
7918
+ JUMP_PILL_PLACEMENT_CLASS[jumpPillPlacement.placement],
7919
+ "inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
7920
+ "text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
7921
+ "hover:border-og-border-strong"
7922
+ ),
7923
+ children: [
7924
+ /* @__PURE__ */ jsx18(ArrowDownIcon, { className: "size-3.5" }),
7925
+ "Jump to latest"
7926
+ ]
7760
7927
  }
7761
- },
7762
- className: cn(
7763
- "absolute inset-x-0 bottom-4 mx-auto w-fit",
7764
- "inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
7765
- "text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
7766
- "hover:border-og-border-strong"
7767
- ),
7768
- children: [
7769
- /* @__PURE__ */ jsx17(ArrowDownIcon, { className: "size-3.5" }),
7770
- "Jump to latest"
7771
- ]
7772
- }
7773
- ) : null })
7774
- ]
7928
+ ) : null })
7929
+ ]
7930
+ }
7931
+ ) }) }) }) }) }) }) })
7775
7932
  }
7776
- ) }) }) }) }) }) }) });
7777
- return /* @__PURE__ */ jsx17(OpenGeniLinkProvider, { resolveLink, children: timeline });
7933
+ );
7934
+ return /* @__PURE__ */ jsx18(OpenGeniLinkProvider, { resolveLink, children: timeline });
7778
7935
  }
7779
7936
  function timelineGroupsRenderEqual(previous, next) {
7780
7937
  try {
@@ -7785,7 +7942,7 @@ function timelineGroupsRenderEqual(previous, next) {
7785
7942
  }
7786
7943
  function useStableTimelineGroupKeys(allGroups, entranceEnabled) {
7787
7944
  const previousRef = useRef9([]);
7788
- const keyedGroups = useMemo4(() => {
7945
+ const keyedGroups = useMemo5(() => {
7789
7946
  const previousByItemId = /* @__PURE__ */ new Map();
7790
7947
  for (const previous of previousRef.current) {
7791
7948
  for (const itemId of timelineGroupItemIds(previous.group)) {
@@ -7860,17 +8017,17 @@ var TimelineGroupRenderBoundary = class extends Component3 {
7860
8017
  }
7861
8018
  render() {
7862
8019
  if (this.state.failed) {
7863
- return /* @__PURE__ */ jsxs12(
8020
+ return /* @__PURE__ */ jsxs13(
7864
8021
  "div",
7865
8022
  {
7866
8023
  "data-testid": "timeline-group-render-error",
7867
8024
  role: "status",
7868
8025
  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",
7869
8026
  children: [
7870
- /* @__PURE__ */ jsx17(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
7871
- /* @__PURE__ */ jsxs12("div", { children: [
7872
- /* @__PURE__ */ jsx17("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
7873
- /* @__PURE__ */ jsx17("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
8027
+ /* @__PURE__ */ jsx18(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
8028
+ /* @__PURE__ */ jsxs13("div", { children: [
8029
+ /* @__PURE__ */ jsx18("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
8030
+ /* @__PURE__ */ jsx18("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
7874
8031
  ] })
7875
8032
  ]
7876
8033
  }
@@ -7891,7 +8048,7 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
7891
8048
  const reducedMotion = useReducedMotion3();
7892
8049
  const { behavior, userMessageDisclosureContext } = context;
7893
8050
  const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && nextGroup?.kind === "item" && nextGroup.item.kind === "context-compaction" && nextGroup.item.phase === "compacted" ? 1 : 0;
7894
- const content = /* @__PURE__ */ jsx17(ActivityNoteTextContext.Provider, { value: behavior.renderMessageText ?? null, children: /* @__PURE__ */ jsx17(
8051
+ const content = /* @__PURE__ */ jsx18(ActivityNoteTextContext.Provider, { value: behavior.renderMessageText ?? null, children: /* @__PURE__ */ jsx18(
7895
8052
  TimelineGroupView,
7896
8053
  {
7897
8054
  ...behavior,
@@ -7902,14 +8059,14 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
7902
8059
  contextCompactionCount: contextCompactionCount > 0 ? contextCompactionCount : void 0
7903
8060
  }
7904
8061
  ) });
7905
- return /* @__PURE__ */ jsx17(GenieLoadingOptionsContext.Provider, { value: behavior.genieLoading, children: /* @__PURE__ */ jsx17(
8062
+ return /* @__PURE__ */ jsx18(GenieLoadingOptionsContext.Provider, { value: behavior.genieLoading, children: /* @__PURE__ */ jsx18(
7906
8063
  "div",
7907
8064
  {
7908
8065
  "data-og-timeline-group-anchor": "",
7909
8066
  "data-og-group-key": groupKey,
7910
8067
  "data-og-prompt": group.kind === "item" && group.item.kind === "user-message" ? "" : void 0,
7911
8068
  tabIndex: group.kind === "item" && group.item.kind === "user-message" ? -1 : void 0,
7912
- children: /* @__PURE__ */ jsx17(EntranceAnimationProvider, { value: entranceEnabled, liveValue: liveEntranceEnabled, children: /* @__PURE__ */ jsx17(TimelineGroupRenderBoundary, { resetKeys: [group, behavior], children: /* @__PURE__ */ jsx17(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: group.kind === "item" ? /* @__PURE__ */ jsx17("div", { children: content }) : /* @__PURE__ */ jsx17(AnimatePresence3, { initial: false, children: /* @__PURE__ */ jsx17(
8069
+ children: /* @__PURE__ */ jsx18(EntranceAnimationProvider, { value: entranceEnabled, liveValue: liveEntranceEnabled, children: /* @__PURE__ */ jsx18(TimelineGroupRenderBoundary, { resetKeys: [group, behavior], children: /* @__PURE__ */ jsx18(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: group.kind === "item" ? /* @__PURE__ */ jsx18("div", { children: content }) : /* @__PURE__ */ jsx18(AnimatePresence3, { initial: false, children: /* @__PURE__ */ jsx18(
7913
8070
  motion3.div,
7914
8071
  {
7915
8072
  initial: false,
@@ -7975,7 +8132,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
7975
8132
  (item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
7976
8133
  ) && !phases.some((item) => item.status === "failed" || item.status === "cancelled");
7977
8134
  if (preparing) {
7978
- return /* @__PURE__ */ jsx17(
8135
+ return /* @__PURE__ */ jsx18(
7979
8136
  ActivityRail,
7980
8137
  {
7981
8138
  items: group.items,
@@ -7993,7 +8150,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
7993
8150
  const status = end ? { kind: "worked", durationMs: durationBetween(group.work.startedAt, end) } : group.work.waiting ? { kind: "waiting", ...group.work.waiting } : {
7994
8151
  kind: "working",
7995
8152
  since: group.work.startedAt,
7996
- preview: containsPresentedImage ? void 0 : /* @__PURE__ */ jsx17(
8153
+ preview: containsPresentedImage ? void 0 : /* @__PURE__ */ jsx18(
7997
8154
  RollingActivity,
7998
8155
  {
7999
8156
  items: group.items,
@@ -8002,7 +8159,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8002
8159
  }
8003
8160
  )
8004
8161
  };
8005
- return /* @__PURE__ */ jsx17(
8162
+ return /* @__PURE__ */ jsx18(
8006
8163
  TurnSummary,
8007
8164
  {
8008
8165
  items: group.items,
@@ -8013,7 +8170,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8013
8170
  defaultOpen: containsPresentedImage || group.outcome === "failed" || phases.some((item) => item.status === "failed" || item.status === "cancelled") ? true : void 0,
8014
8171
  facets: turnSummary?.facets,
8015
8172
  contextCompactionCount: compactedLandmarkCount(group.work.details),
8016
- children: /* @__PURE__ */ jsx17(TurnRailFrame, { compact: true, children: renderFoldedGroups(
8173
+ children: /* @__PURE__ */ jsx18(TurnRailFrame, { compact: true, children: renderFoldedGroups(
8017
8174
  group.work.details,
8018
8175
  {
8019
8176
  renderMessageActions,
@@ -8038,7 +8195,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8038
8195
  if (!startupDetails && !insideTurn && !group.outcome && group.items.every(
8039
8196
  (item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
8040
8197
  )) {
8041
- return /* @__PURE__ */ jsx17(
8198
+ return /* @__PURE__ */ jsx18(
8042
8199
  ActivityRail,
8043
8200
  {
8044
8201
  items: group.items,
@@ -8053,7 +8210,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8053
8210
  );
8054
8211
  }
8055
8212
  if (turnSummary?.rolling && insideTurn && !startupDetails && !hasRememberedImageFold && group.items.filter((item) => item.kind !== "startup-phase").length === 1) {
8056
- return /* @__PURE__ */ jsx17(
8213
+ return /* @__PURE__ */ jsx18(
8057
8214
  ActivityRail,
8058
8215
  {
8059
8216
  items: group.items,
@@ -8072,7 +8229,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8072
8229
  const singleThought = !startupDetails && visibleActivity.length === 1 && visibleActivity[0]?.kind === "reasoning";
8073
8230
  const useNestedChip = nestClusterChips && (activityShouldFold || hasRememberedImageFold) && !singleThought;
8074
8231
  if (!useNestedChip) {
8075
- return /* @__PURE__ */ jsx17(
8232
+ return /* @__PURE__ */ jsx18(
8076
8233
  ActivityRail,
8077
8234
  {
8078
8235
  items: group.items,
@@ -8086,7 +8243,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8086
8243
  }
8087
8244
  );
8088
8245
  }
8089
- return /* @__PURE__ */ jsx17(
8246
+ return /* @__PURE__ */ jsx18(
8090
8247
  TurnSummary,
8091
8248
  {
8092
8249
  items: group.items,
@@ -8097,7 +8254,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8097
8254
  foldKey: group.id,
8098
8255
  facets: turnSummary?.facets,
8099
8256
  contextCompactionCount,
8100
- children: /* @__PURE__ */ jsx17(
8257
+ children: /* @__PURE__ */ jsx18(
8101
8258
  ActivityRail,
8102
8259
  {
8103
8260
  items: group.items,
@@ -8113,14 +8270,14 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8113
8270
  settleChrome ? "settle" : "rest"
8114
8271
  );
8115
8272
  }
8116
- return /* @__PURE__ */ jsx17(
8273
+ return /* @__PURE__ */ jsx18(
8117
8274
  TurnSummary,
8118
8275
  {
8119
8276
  items: group.items,
8120
8277
  outcome: group.outcome,
8121
8278
  failureText: group.failureText,
8122
8279
  defaultOpen: group.outcome === "failed" || containsPresentedImage || !turnSummary?.rolling && !activityShouldFold ? true : void 0,
8123
- liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */ jsx17(
8280
+ liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */ jsx18(
8124
8281
  RollingActivity,
8125
8282
  {
8126
8283
  items: group.items,
@@ -8132,7 +8289,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8132
8289
  facets: turnSummary?.facets,
8133
8290
  settleFold,
8134
8291
  contextCompactionCount,
8135
- children: /* @__PURE__ */ jsx17(FoldBody, { children: /* @__PURE__ */ jsx17(TurnRailFrame, { children: /* @__PURE__ */ jsx17(
8292
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: /* @__PURE__ */ jsx18(TurnRailFrame, { children: /* @__PURE__ */ jsx18(
8136
8293
  ActivityRail,
8137
8294
  {
8138
8295
  items: group.items,
@@ -8154,7 +8311,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8154
8311
  (item) => item.kind === "startup-phase" && item.status === "complete"
8155
8312
  )
8156
8313
  ))
8157
- return /* @__PURE__ */ jsx17(ActivityRail, { items: activityItems, startupActive: false, bare: true });
8314
+ return /* @__PURE__ */ jsx18(ActivityRail, { items: activityItems, startupActive: false, bare: true });
8158
8315
  const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
8159
8316
  const body = renderFoldedGroups(group.groups, {
8160
8317
  renderMessageActions,
@@ -8171,7 +8328,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8171
8328
  turnSummary
8172
8329
  });
8173
8330
  const durationMs = durationBetween(group.startedAt, group.endedAt);
8174
- return /* @__PURE__ */ jsx17(
8331
+ return /* @__PURE__ */ jsx18(
8175
8332
  TurnSummary,
8176
8333
  {
8177
8334
  items: activityItems,
@@ -8185,16 +8342,16 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8185
8342
  settleFold,
8186
8343
  copyText: insideTurn ? void 0 : turnCopyText,
8187
8344
  contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
8188
- children: /* @__PURE__ */ jsx17(FoldBody, { children: insideTurn ? (
8345
+ children: /* @__PURE__ */ jsx18(FoldBody, { children: insideTurn ? (
8189
8346
  // A nested turn is already on an ancestor rail — its body just stacks
8190
8347
  // flush (the bare-node body already indents it), so no second rule.
8191
- /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4", children: body })
8192
- ) : /* @__PURE__ */ jsx17(TurnRailFrame, { children: body }) })
8348
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4", children: body })
8349
+ ) : /* @__PURE__ */ jsx18(TurnRailFrame, { children: body }) })
8193
8350
  }
8194
8351
  );
8195
8352
  }
8196
8353
  case "item":
8197
- return /* @__PURE__ */ jsx17(
8354
+ return /* @__PURE__ */ jsx18(
8198
8355
  TimelineRow,
8199
8356
  {
8200
8357
  item: group.item,
@@ -8211,7 +8368,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
8211
8368
  });
8212
8369
  function renderFoldedGroups(groups, behavior, readableWork = false) {
8213
8370
  const nestClusters = foldableActivityClusterCount(groups) >= 2;
8214
- return groups.map((child, index) => /* @__PURE__ */ jsx17(
8371
+ return groups.map((child, index) => /* @__PURE__ */ jsx18(
8215
8372
  TimelineGroupRenderBoundary,
8216
8373
  {
8217
8374
  resetKeys: [
@@ -8229,13 +8386,13 @@ function renderFoldedGroups(groups, behavior, readableWork = false) {
8229
8386
  behavior.loadVideoArtifactPlayback,
8230
8387
  behavior.turnSummary
8231
8388
  ],
8232
- children: readableWork ? /* @__PURE__ */ jsx17(
8389
+ children: readableWork ? /* @__PURE__ */ jsx18(
8233
8390
  "div",
8234
8391
  {
8235
8392
  className: index > 0 && (child.kind !== "activity" || groups[index - 1]?.kind !== "activity") ? "mt-3" : void 0,
8236
- children: /* @__PURE__ */ jsx17(TimelineGroupView, { ...behavior, group: child, insideTurn: true, startupDismissed: true })
8393
+ children: /* @__PURE__ */ jsx18(TimelineGroupView, { ...behavior, group: child, insideTurn: true, startupDismissed: true })
8237
8394
  }
8238
- ) : /* @__PURE__ */ jsx17(TimelineGroupView, { ...behavior, group: child, insideTurn: true, nestClusterChips: nestClusters })
8395
+ ) : /* @__PURE__ */ jsx18(TimelineGroupView, { ...behavior, group: child, insideTurn: true, nestClusterChips: nestClusters })
8239
8396
  },
8240
8397
  timelineGroupKey(child)
8241
8398
  ));
@@ -8246,10 +8403,10 @@ function compactedLandmarkCount(groups) {
8246
8403
  ).length;
8247
8404
  }
8248
8405
  function FoldBody({ children }) {
8249
- return /* @__PURE__ */ jsx17(Fragment5, { children });
8406
+ return /* @__PURE__ */ jsx18(Fragment6, { children });
8250
8407
  }
8251
8408
  function TurnRailFrame({ children, compact = false }) {
8252
- return /* @__PURE__ */ jsx17(
8409
+ return /* @__PURE__ */ jsx18(
8253
8410
  "div",
8254
8411
  {
8255
8412
  className: cn(
@@ -8440,7 +8597,7 @@ function TimelineRow({
8440
8597
  }) {
8441
8598
  switch (item.kind) {
8442
8599
  case "user-message":
8443
- return /* @__PURE__ */ jsx17(
8600
+ return /* @__PURE__ */ jsx18(
8444
8601
  UserMessageRow,
8445
8602
  {
8446
8603
  item,
@@ -8449,9 +8606,9 @@ function TimelineRow({
8449
8606
  }
8450
8607
  );
8451
8608
  case "human-input":
8452
- return /* @__PURE__ */ jsx17(HumanInputConversationRow, { item });
8609
+ return /* @__PURE__ */ jsx18(HumanInputConversationRow, { item });
8453
8610
  case "agent-message":
8454
- return /* @__PURE__ */ jsx17(
8611
+ return /* @__PURE__ */ jsx18(
8455
8612
  AgentMessageRow,
8456
8613
  {
8457
8614
  item,
@@ -8460,13 +8617,13 @@ function TimelineRow({
8460
8617
  }
8461
8618
  );
8462
8619
  case "worker-completion":
8463
- return /* @__PURE__ */ jsx17(WorkerCompletionRow, { item, onOpenSession });
8620
+ return /* @__PURE__ */ jsx18(WorkerCompletionRow, { item, onOpenSession });
8464
8621
  case "session-status":
8465
- return /* @__PURE__ */ jsx17(SessionStatusRow, { item });
8622
+ return /* @__PURE__ */ jsx18(SessionStatusRow, { item });
8466
8623
  case "goal":
8467
- return /* @__PURE__ */ jsx17(GoalRow, { item });
8624
+ return /* @__PURE__ */ jsx18(GoalRow, { item });
8468
8625
  case "machine-input-batch":
8469
- return /* @__PURE__ */ jsx17(
8626
+ return /* @__PURE__ */ jsx18(
8470
8627
  MachineInputBatchRow,
8471
8628
  {
8472
8629
  item,
@@ -8475,11 +8632,11 @@ function TimelineRow({
8475
8632
  }
8476
8633
  );
8477
8634
  case "notice":
8478
- return /* @__PURE__ */ jsx17(NoticeRow, { item });
8635
+ return /* @__PURE__ */ jsx18(NoticeRow, { item });
8479
8636
  case "context-compaction":
8480
- return /* @__PURE__ */ jsx17(CompactionRow, { item });
8637
+ return /* @__PURE__ */ jsx18(CompactionRow, { item });
8481
8638
  case "auth-needed":
8482
- return renderAuthNeeded?.(item) ?? /* @__PURE__ */ jsx17(
8639
+ return renderAuthNeeded?.(item) ?? /* @__PURE__ */ jsx18(
8483
8640
  AuthNeededRow,
8484
8641
  {
8485
8642
  item,
@@ -8505,7 +8662,7 @@ function CompactionRow({ item }) {
8505
8662
  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";
8506
8663
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason, item.providerRejection) : null;
8507
8664
  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" ? WAITING_PILL_CLASS : NEUTRAL_PILL;
8508
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs12(
8665
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
8509
8666
  "div",
8510
8667
  {
8511
8668
  className: cn(
@@ -8514,20 +8671,20 @@ function CompactionRow({ item }) {
8514
8671
  ),
8515
8672
  role: "status",
8516
8673
  children: [
8517
- /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
8518
- /* @__PURE__ */ jsx17(ShrinkIcon2, { className: "size-3.5 shrink-0" }),
8519
- /* @__PURE__ */ jsxs12("span", { className: "truncate", children: [
8674
+ /* @__PURE__ */ jsxs13("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
8675
+ /* @__PURE__ */ jsx18(ShrinkIcon2, { className: "size-3.5 shrink-0" }),
8676
+ /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
8520
8677
  title,
8521
8678
  trigger ? ` \xB7 ${trigger}` : ""
8522
8679
  ] })
8523
8680
  ] }),
8524
- subtitle ? /* @__PURE__ */ jsx17("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
8681
+ subtitle ? /* @__PURE__ */ jsx18("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
8525
8682
  ]
8526
8683
  }
8527
8684
  ) });
8528
8685
  }
8529
8686
  function MessageFooterTime({ occurredAt }) {
8530
- return /* @__PURE__ */ jsx17(
8687
+ return /* @__PURE__ */ jsx18(
8531
8688
  "time",
8532
8689
  {
8533
8690
  dateTime: occurredAt,
@@ -8547,28 +8704,28 @@ function UserMessageRow({
8547
8704
  }) {
8548
8705
  const enter = useEntranceAnimation();
8549
8706
  const deliveryFailed = item.delivery?.state === "failed";
8550
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs12("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
8551
- /* @__PURE__ */ jsx17(
8707
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs13("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
8708
+ /* @__PURE__ */ jsx18(
8552
8709
  CopyHoverFrame,
8553
8710
  {
8554
8711
  copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
8555
8712
  ${annotation.note}`).join("\n\n"),
8556
8713
  label: "Copy message",
8557
8714
  className: "w-fit max-w-full min-w-0",
8558
- trailing: /* @__PURE__ */ jsxs12(Fragment5, { children: [
8715
+ trailing: /* @__PURE__ */ jsxs13(Fragment6, { children: [
8559
8716
  renderMessageActions?.(item),
8560
- /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt })
8717
+ /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt })
8561
8718
  ] }),
8562
- children: /* @__PURE__ */ jsxs12("div", { className: MESSAGE_BUBBLE_CLASS, children: [
8563
- item.text ? /* @__PURE__ */ jsx17(
8719
+ children: /* @__PURE__ */ jsxs13("div", { className: MESSAGE_BUBBLE_CLASS, children: [
8720
+ item.text ? /* @__PURE__ */ jsx18(
8564
8721
  "div",
8565
8722
  {
8566
8723
  "data-og-search-item": item.id,
8567
8724
  "data-og-annotation-source-key": item.annotationSource?.eventId,
8568
- children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx17(Markdown, { children: item.text }) })
8725
+ children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx18(Markdown, { children: item.text }) })
8569
8726
  }
8570
8727
  ) : null,
8571
- (item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx17(
8728
+ (item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx18(
8572
8729
  TimelineAnnotationCards,
8573
8730
  {
8574
8731
  annotations: item.annotations ?? [],
@@ -8578,34 +8735,45 @@ ${annotation.note}`).join("\n\n"),
8578
8735
  ] })
8579
8736
  }
8580
8737
  ),
8581
- deliveryFailed ? /* @__PURE__ */ jsxs12(
8738
+ deliveryFailed ? /* @__PURE__ */ jsxs13(
8582
8739
  "div",
8583
8740
  {
8584
8741
  role: "status",
8585
- className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-status-failed",
8742
+ className: "flex max-w-full flex-col items-start gap-1 px-1 text-og-xs text-og-status-failed",
8586
8743
  children: [
8587
- /* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1", title: item.delivery?.error, children: [
8588
- /* @__PURE__ */ jsx17(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
8589
- /* @__PURE__ */ jsx17("span", { children: "Message not sent" })
8744
+ /* @__PURE__ */ jsxs13("span", { className: "flex min-w-0 items-start gap-1", children: [
8745
+ /* @__PURE__ */ jsx18(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
8746
+ /* @__PURE__ */ jsx18("span", { className: "min-w-0 break-words", children: item.delivery?.error || "Message not sent" })
8590
8747
  ] }),
8591
- item.delivery?.onRetry ? /* @__PURE__ */ jsx17(
8592
- "button",
8593
- {
8594
- type: "button",
8595
- className: "font-medium text-og-status-failed underline decoration-og-status-failed/50 underline-offset-2 hover:text-og-fg",
8596
- onClick: item.delivery.onRetry,
8597
- children: "Retry"
8598
- }
8599
- ) : null,
8600
- item.delivery?.onRemove ? /* @__PURE__ */ jsx17(
8601
- "button",
8602
- {
8603
- type: "button",
8604
- className: "font-medium text-og-fg-subtle underline decoration-og-border underline-offset-2 hover:text-og-fg",
8605
- onClick: item.delivery.onRemove,
8606
- children: "Remove"
8607
- }
8608
- ) : null
8748
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-2", children: [
8749
+ item.delivery?.onEdit ? /* @__PURE__ */ jsx18(
8750
+ "button",
8751
+ {
8752
+ type: "button",
8753
+ className: "font-medium text-og-status-failed underline decoration-og-status-failed/50 underline-offset-2 hover:text-og-fg",
8754
+ onClick: item.delivery.onEdit,
8755
+ children: "Edit message"
8756
+ }
8757
+ ) : null,
8758
+ item.delivery?.onRetry ? /* @__PURE__ */ jsx18(
8759
+ "button",
8760
+ {
8761
+ type: "button",
8762
+ className: "font-medium text-og-status-failed underline decoration-og-status-failed/50 underline-offset-2 hover:text-og-fg",
8763
+ onClick: item.delivery.onRetry,
8764
+ children: "Retry"
8765
+ }
8766
+ ) : null,
8767
+ item.delivery?.onRemove ? /* @__PURE__ */ jsx18(
8768
+ "button",
8769
+ {
8770
+ type: "button",
8771
+ className: "font-medium text-og-fg-subtle underline decoration-og-border underline-offset-2 hover:text-og-fg",
8772
+ onClick: item.delivery.onRemove,
8773
+ children: "Remove"
8774
+ }
8775
+ ) : null
8776
+ ] })
8609
8777
  ]
8610
8778
  }
8611
8779
  ) : null
@@ -8619,26 +8787,26 @@ function HumanInputConversationRow({ item }) {
8619
8787
  );
8620
8788
  const settledLabel = item.response.outcome === "answered" ? "You answered" : item.response.outcome === "skipped" ? "Skipped" : item.response.outcome === "expired" ? "Expired" : "Cancelled";
8621
8789
  const copyText = humanInputConversationCopyText(item, settledLabel);
8622
- return /* @__PURE__ */ jsxs12(
8790
+ return /* @__PURE__ */ jsxs13(
8623
8791
  "div",
8624
8792
  {
8625
8793
  className: cn(enter && "animate-og-enter", "flex w-full flex-col gap-2.5"),
8626
8794
  "data-human-input-history": item.requestId,
8627
8795
  children: [
8628
- /* @__PURE__ */ jsxs12("div", { className: "flex max-w-[90%] items-start gap-3 rounded-og-lg rounded-bl-og-xs border border-og-border bg-og-surface-1 px-3.5 py-3 sm:max-w-[82%]", children: [
8629
- /* @__PURE__ */ jsx17("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/10 text-og-status-waiting", children: /* @__PURE__ */ jsx17(MessageCircleQuestionIcon3, { "aria-hidden": "true", className: "size-4" }) }),
8630
- /* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
8631
- /* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
8632
- /* @__PURE__ */ jsx17("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs12("div", { children: [
8633
- question.label ? /* @__PURE__ */ jsxs12("p", { className: "text-og-sm font-semibold text-og-fg", children: [
8634
- multipleQuestions ? /* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8796
+ /* @__PURE__ */ jsxs13("div", { className: "flex max-w-[90%] items-start gap-3 rounded-og-lg rounded-bl-og-xs border border-og-border bg-og-surface-1 px-3.5 py-3 sm:max-w-[82%]", children: [
8797
+ /* @__PURE__ */ jsx18("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/10 text-og-status-waiting", children: /* @__PURE__ */ jsx18(MessageCircleQuestionIcon3, { "aria-hidden": "true", className: "size-4" }) }),
8798
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
8799
+ /* @__PURE__ */ jsx18("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
8800
+ /* @__PURE__ */ jsx18("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs13("div", { children: [
8801
+ question.label ? /* @__PURE__ */ jsxs13("p", { className: "text-og-sm font-semibold text-og-fg", children: [
8802
+ multipleQuestions ? /* @__PURE__ */ jsxs13("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8635
8803
  index + 1,
8636
8804
  "."
8637
8805
  ] }) : null,
8638
8806
  multipleQuestions ? " " : null,
8639
8807
  question.label
8640
8808
  ] }) : null,
8641
- /* @__PURE__ */ jsxs12(
8809
+ /* @__PURE__ */ jsxs13(
8642
8810
  "p",
8643
8811
  {
8644
8812
  className: cn(
@@ -8646,7 +8814,7 @@ function HumanInputConversationRow({ item }) {
8646
8814
  question.label && "mt-0.5 text-og-sm text-og-fg-muted"
8647
8815
  ),
8648
8816
  children: [
8649
- !question.label && multipleQuestions ? /* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8817
+ !question.label && multipleQuestions ? /* @__PURE__ */ jsxs13("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8650
8818
  index + 1,
8651
8819
  "."
8652
8820
  ] }) : null,
@@ -8655,29 +8823,29 @@ function HumanInputConversationRow({ item }) {
8655
8823
  ]
8656
8824
  }
8657
8825
  )
8658
- ] }, question.id)) : /* @__PURE__ */ jsx17("p", { className: "text-og-sm text-og-fg-muted", children: "The agent requested structured input." }) })
8826
+ ] }, question.id)) : /* @__PURE__ */ jsx18("p", { className: "text-og-sm text-og-fg-muted", children: "The agent requested structured input." }) })
8659
8827
  ] })
8660
8828
  ] }),
8661
- /* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(
8829
+ /* @__PURE__ */ jsx18("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx18(
8662
8830
  CopyHoverFrame,
8663
8831
  {
8664
8832
  copyText,
8665
8833
  label: "Copy answer",
8666
8834
  className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
8667
- trailing: /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
8668
- children: /* @__PURE__ */ jsxs12("div", { className: MESSAGE_BUBBLE_CLASS, children: [
8669
- /* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
8670
- item.response.outcome === "answered" ? /* @__PURE__ */ jsx17("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs12("div", { children: [
8671
- multipleQuestions ? /* @__PURE__ */ jsxs12("p", { className: "text-og-sm font-semibold text-og-fg", children: [
8672
- /* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8835
+ trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
8836
+ children: /* @__PURE__ */ jsxs13("div", { className: MESSAGE_BUBBLE_CLASS, children: [
8837
+ /* @__PURE__ */ jsx18("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
8838
+ item.response.outcome === "answered" ? /* @__PURE__ */ jsx18("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs13("div", { children: [
8839
+ multipleQuestions ? /* @__PURE__ */ jsxs13("p", { className: "text-og-sm font-semibold text-og-fg", children: [
8840
+ /* @__PURE__ */ jsxs13("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
8673
8841
  questionNumberById.get(answer.questionId) ?? answerIndex + 1,
8674
8842
  "."
8675
8843
  ] }),
8676
8844
  " ",
8677
8845
  answer.label
8678
8846
  ] }) : null,
8679
- /* @__PURE__ */ jsx17("div", { className: cn("text-og-md text-og-fg", multipleQuestions && "mt-0.5"), children: answer.values.length > 1 ? /* @__PURE__ */ jsx17("ul", { className: "list-disc space-y-0.5 pl-5", children: answer.values.map((value) => /* @__PURE__ */ jsx17("li", { children: value }, `${answer.questionId}-${value}`)) }) : /* @__PURE__ */ jsx17("p", { children: answer.values[0] || "Answered" }) })
8680
- ] }, answer.questionId)) : /* @__PURE__ */ jsx17("p", { children: "Answered" }) }) : null
8847
+ /* @__PURE__ */ jsx18("div", { className: cn("text-og-md text-og-fg", multipleQuestions && "mt-0.5"), children: answer.values.length > 1 ? /* @__PURE__ */ jsx18("ul", { className: "list-disc space-y-0.5 pl-5", children: answer.values.map((value) => /* @__PURE__ */ jsx18("li", { children: value }, `${answer.questionId}-${value}`)) }) : /* @__PURE__ */ jsx18("p", { children: answer.values[0] || "Answered" }) })
8848
+ ] }, answer.questionId)) : /* @__PURE__ */ jsx18("p", { children: "Answered" }) }) : null
8681
8849
  ] })
8682
8850
  }
8683
8851
  ) })
@@ -8705,19 +8873,19 @@ function AgentMessageRow({
8705
8873
  renderMessageText
8706
8874
  }) {
8707
8875
  const enter = useEntranceAnimation();
8708
- const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(Markdown, { streaming: item.streaming, children: item.text });
8709
- return /* @__PURE__ */ jsx17(
8876
+ const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(Markdown, { streaming: item.streaming, children: item.text });
8877
+ return /* @__PURE__ */ jsx18(
8710
8878
  CopyHoverFrame,
8711
8879
  {
8712
8880
  copyText: item.text,
8713
8881
  label: "Copy message",
8714
8882
  align: "start",
8715
8883
  className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
8716
- trailing: item.streaming ? null : /* @__PURE__ */ jsxs12(Fragment5, { children: [
8884
+ trailing: item.streaming ? null : /* @__PURE__ */ jsxs13(Fragment6, { children: [
8717
8885
  renderMessageActions?.(item),
8718
- /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt })
8886
+ /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt })
8719
8887
  ] }),
8720
- children: /* @__PURE__ */ jsx17(
8888
+ children: /* @__PURE__ */ jsx18(
8721
8889
  "div",
8722
8890
  {
8723
8891
  "data-og-wide-table-message": "",
@@ -8766,7 +8934,7 @@ function WorkerCompletionRow({
8766
8934
  onOpenSession
8767
8935
  }) {
8768
8936
  const enter = useEntranceAnimation();
8769
- const [open, setOpen] = useState14(false);
8937
+ const [open, setOpen] = useState15(false);
8770
8938
  const meta = workerCompletionMeta(item);
8771
8939
  const Icon = meta.icon;
8772
8940
  const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && !!item.pausedReason?.trim();
@@ -8776,17 +8944,17 @@ function WorkerCompletionRow({
8776
8944
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
8777
8945
  ];
8778
8946
  const hasDetails = details.length > 0;
8779
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs12("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
8780
- /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-2.5", children: [
8781
- /* @__PURE__ */ jsx17("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx17(Icon, { className: "size-4" }) }),
8782
- /* @__PURE__ */ jsx17("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs12("p", { className: "text-og-base leading-5 text-og-fg", children: [
8783
- /* @__PURE__ */ jsx17("span", { className: "font-medium", children: meta.label }),
8784
- item.goalText ? /* @__PURE__ */ jsxs12("span", { className: "text-og-fg-muted", children: [
8947
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs13("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
8948
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2.5", children: [
8949
+ /* @__PURE__ */ jsx18("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx18(Icon, { className: "size-4" }) }),
8950
+ /* @__PURE__ */ jsx18("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("p", { className: "text-og-base leading-5 text-og-fg", children: [
8951
+ /* @__PURE__ */ jsx18("span", { className: "font-medium", children: meta.label }),
8952
+ item.goalText ? /* @__PURE__ */ jsxs13("span", { className: "text-og-fg-muted", children: [
8785
8953
  " \xB7 ",
8786
8954
  truncate(item.goalText, 90)
8787
8955
  ] }) : null
8788
8956
  ] }) }),
8789
- item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs12(
8957
+ item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs13(
8790
8958
  "button",
8791
8959
  {
8792
8960
  type: "button",
@@ -8798,13 +8966,13 @@ function WorkerCompletionRow({
8798
8966
  ),
8799
8967
  children: [
8800
8968
  "View session",
8801
- /* @__PURE__ */ jsx17(ArrowRightIcon2, { className: "size-3.5" })
8969
+ /* @__PURE__ */ jsx18(ArrowRightIcon2, { className: "size-3.5" })
8802
8970
  ]
8803
8971
  }
8804
8972
  ) : null
8805
8973
  ] }),
8806
- hasDetails ? /* @__PURE__ */ jsxs12(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
8807
- /* @__PURE__ */ jsx17(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
8974
+ hasDetails ? /* @__PURE__ */ jsxs13(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
8975
+ /* @__PURE__ */ jsx18(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
8808
8976
  "button",
8809
8977
  {
8810
8978
  type: "button",
@@ -8813,14 +8981,14 @@ function WorkerCompletionRow({
8813
8981
  "outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
8814
8982
  ),
8815
8983
  children: [
8816
- /* @__PURE__ */ jsx17(ChevronRightIcon2, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
8984
+ /* @__PURE__ */ jsx18(ChevronRightIcon2, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
8817
8985
  open ? "Hide details" : "Show details"
8818
8986
  ]
8819
8987
  }
8820
8988
  ) }),
8821
- /* @__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__ */ jsxs12("div", { className: "min-w-0", children: [
8822
- /* @__PURE__ */ jsx17("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
8823
- /* @__PURE__ */ jsx17(
8989
+ /* @__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__ */ jsxs13("div", { className: "min-w-0", children: [
8990
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
8991
+ /* @__PURE__ */ jsx18(
8824
8992
  "p",
8825
8993
  {
8826
8994
  className: cn(
@@ -8839,7 +9007,7 @@ function SessionStatusRow({
8839
9007
  }) {
8840
9008
  const enter = useEntranceAnimation();
8841
9009
  const meta = SESSION_STATUS_META[item.status];
8842
- return /* @__PURE__ */ jsxs12(
9010
+ return /* @__PURE__ */ jsxs13(
8843
9011
  "div",
8844
9012
  {
8845
9013
  className: cn(
@@ -8848,15 +9016,15 @@ function SessionStatusRow({
8848
9016
  ),
8849
9017
  role: "status",
8850
9018
  children: [
8851
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" }),
8852
- /* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1.5", children: [
8853
- item.resolvedAt ? null : /* @__PURE__ */ jsx17(StatusDot, { status: item.status, className: "size-1" }),
9019
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" }),
9020
+ /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1.5", children: [
9021
+ item.resolvedAt ? null : /* @__PURE__ */ jsx18(StatusDot, { status: item.status, className: "size-1" }),
8854
9022
  item.resolvedAt ? "work resumed" : meta.label.toLowerCase(),
8855
9023
  " \xB7",
8856
9024
  " ",
8857
9025
  formatRelativeTime(item.resolvedAt ?? item.occurredAt)
8858
9026
  ] }),
8859
- /* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" })
9027
+ /* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" })
8860
9028
  ]
8861
9029
  }
8862
9030
  );
@@ -8894,7 +9062,7 @@ function goalMeta(action) {
8894
9062
  function GoalRow({ item }) {
8895
9063
  const enter = useEntranceAnimation();
8896
9064
  const { label, pill, icon: Icon } = goalMeta(item.action);
8897
- return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs12(
9065
+ return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
8898
9066
  "span",
8899
9067
  {
8900
9068
  className: cn(
@@ -8902,8 +9070,8 @@ function GoalRow({ item }) {
8902
9070
  pill
8903
9071
  ),
8904
9072
  children: [
8905
- /* @__PURE__ */ jsx17(Icon, { className: "size-3.5 shrink-0" }),
8906
- /* @__PURE__ */ jsxs12("span", { className: "truncate", children: [
9073
+ /* @__PURE__ */ jsx18(Icon, { className: "size-3.5 shrink-0" }),
9074
+ /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
8907
9075
  label,
8908
9076
  item.text ? `: ${truncate(item.text, 90)}` : ""
8909
9077
  ] })
@@ -8920,7 +9088,7 @@ function MachineInputBatchRow({
8920
9088
  const label = machineInputBatchLabel(item.members);
8921
9089
  const single = item.members.length === 1 ? item.members[0] : null;
8922
9090
  if (single?.kind === "media_generation_result" && single.result) {
8923
- return /* @__PURE__ */ jsx17(
9091
+ return /* @__PURE__ */ jsx18(
8924
9092
  VideoGenerationResultRow,
8925
9093
  {
8926
9094
  result: single.result,
@@ -8930,15 +9098,15 @@ function MachineInputBatchRow({
8930
9098
  }
8931
9099
  const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
8932
9100
  const showCollapsedSummary = !item.compact && single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
8933
- return /* @__PURE__ */ jsxs12("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
8934
- /* @__PURE__ */ jsxs12(
9101
+ return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
9102
+ /* @__PURE__ */ jsxs13(
8935
9103
  "details",
8936
9104
  {
8937
9105
  className: "group w-full max-w-full",
8938
9106
  "data-og-machine-input-batch": "",
8939
9107
  title: `Received ${formatClockTime(item.occurredAt)}`,
8940
9108
  children: [
8941
- /* @__PURE__ */ jsx17("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs12(
9109
+ /* @__PURE__ */ jsx18("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs13(
8942
9110
  "span",
8943
9111
  {
8944
9112
  className: cn(
@@ -8946,23 +9114,23 @@ function MachineInputBatchRow({
8946
9114
  NEUTRAL_PILL
8947
9115
  ),
8948
9116
  children: [
8949
- /* @__PURE__ */ jsx17(
9117
+ /* @__PURE__ */ jsx18(
8950
9118
  ChevronRightIcon2,
8951
9119
  {
8952
9120
  "aria-hidden": true,
8953
9121
  className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
8954
9122
  }
8955
9123
  ),
8956
- /* @__PURE__ */ jsx17("span", { className: "truncate", children: label })
9124
+ /* @__PURE__ */ jsx18("span", { className: "truncate", children: label })
8957
9125
  ]
8958
9126
  }
8959
9127
  ) }),
8960
- /* @__PURE__ */ jsxs12("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
8961
- /* @__PURE__ */ jsxs12("p", { className: "text-og-xs text-og-fg-subtle", children: [
9128
+ /* @__PURE__ */ jsxs13("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
9129
+ /* @__PURE__ */ jsxs13("p", { className: "text-og-xs text-og-fg-subtle", children: [
8962
9130
  "Received ",
8963
- /* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
9131
+ /* @__PURE__ */ jsx18("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
8964
9132
  ] }),
8965
- item.members.map((member) => /* @__PURE__ */ jsx17(
9133
+ item.members.map((member) => /* @__PURE__ */ jsx18(
8966
9134
  MachineInputRow,
8967
9135
  {
8968
9136
  member,
@@ -8975,7 +9143,7 @@ function MachineInputBatchRow({
8975
9143
  ]
8976
9144
  }
8977
9145
  ),
8978
- 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
9146
+ 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
8979
9147
  ] });
8980
9148
  }
8981
9149
  function MachineInputRow({
@@ -8984,7 +9152,7 @@ function MachineInputRow({
8984
9152
  loadVideoArtifactPlayback
8985
9153
  }) {
8986
9154
  if (member.kind === "media_generation_result" && member.result) {
8987
- return /* @__PURE__ */ jsx17(
9155
+ return /* @__PURE__ */ jsx18(
8988
9156
  VideoGenerationResultRow,
8989
9157
  {
8990
9158
  result: member.result,
@@ -8995,16 +9163,16 @@ function MachineInputRow({
8995
9163
  }
8996
9164
  const source = readableMachineInputSource(member.sourceId);
8997
9165
  const summary = cleanMachineInputSummary(member.summary);
8998
- return /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 items-start gap-2.5", children: [
8999
- /* @__PURE__ */ jsx17("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
9000
- /* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
9001
- /* @__PURE__ */ jsx17("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
9002
- source && /* @__PURE__ */ jsxs12("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
9166
+ return /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-start gap-2.5", children: [
9167
+ /* @__PURE__ */ jsx18("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
9168
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
9169
+ /* @__PURE__ */ jsx18("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
9170
+ source && /* @__PURE__ */ jsxs13("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
9003
9171
  "from ",
9004
9172
  source
9005
9173
  ] }),
9006
- 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,
9007
- /* @__PURE__ */ jsx17(
9174
+ 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,
9175
+ /* @__PURE__ */ jsx18(
9008
9176
  ChildSessionLink,
9009
9177
  {
9010
9178
  kind: member.kind,
@@ -9022,7 +9190,7 @@ function VideoGenerationResultRow({
9022
9190
  }) {
9023
9191
  const enter = useEntranceAnimation();
9024
9192
  if (result.status !== "ready") {
9025
- return /* @__PURE__ */ jsxs12(
9193
+ return /* @__PURE__ */ jsxs13(
9026
9194
  "div",
9027
9195
  {
9028
9196
  className: cn(
@@ -9030,18 +9198,18 @@ function VideoGenerationResultRow({
9030
9198
  "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"
9031
9199
  ),
9032
9200
  children: [
9033
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
9034
- /* @__PURE__ */ jsx17(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
9201
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
9202
+ /* @__PURE__ */ jsx18(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
9035
9203
  "Video generation failed"
9036
9204
  ] }),
9037
- /* @__PURE__ */ jsx17("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
9205
+ /* @__PURE__ */ jsx18("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
9038
9206
  ]
9039
9207
  }
9040
9208
  );
9041
9209
  }
9042
9210
  const { receipt } = result;
9043
9211
  const facts = receipt.video;
9044
- return /* @__PURE__ */ jsxs12(
9212
+ return /* @__PURE__ */ jsxs13(
9045
9213
  "section",
9046
9214
  {
9047
9215
  "aria-label": "Generated video",
@@ -9051,18 +9219,18 @@ function VideoGenerationResultRow({
9051
9219
  compact && "max-w-lg"
9052
9220
  ),
9053
9221
  children: [
9054
- loadVideoArtifactPlayback ? /* @__PURE__ */ jsx17(
9222
+ loadVideoArtifactPlayback ? /* @__PURE__ */ jsx18(
9055
9223
  GeneratedVideoPlayer,
9056
9224
  {
9057
9225
  receipt,
9058
9226
  loadPlaybackSource: loadVideoArtifactPlayback,
9059
9227
  className: "rounded-none border-0 shadow-none"
9060
9228
  }
9061
- ) : /* @__PURE__ */ jsx17("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx17(PlayIcon, { "aria-hidden": true, className: "size-6" }) }),
9062
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
9063
- /* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
9064
- /* @__PURE__ */ jsx17("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
9065
- /* @__PURE__ */ jsxs12("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
9229
+ ) : /* @__PURE__ */ jsx18("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx18(PlayIcon, { "aria-hidden": true, className: "size-6" }) }),
9230
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
9231
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
9232
+ /* @__PURE__ */ jsx18("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
9233
+ /* @__PURE__ */ jsxs13("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
9066
9234
  facts.width,
9067
9235
  "\xD7",
9068
9236
  facts.height,
@@ -9071,7 +9239,7 @@ function VideoGenerationResultRow({
9071
9239
  facts.hasAudio ? " \xB7 Audio" : ""
9072
9240
  ] })
9073
9241
  ] }),
9074
- /* @__PURE__ */ jsx17(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
9242
+ /* @__PURE__ */ jsx18(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
9075
9243
  ] })
9076
9244
  ]
9077
9245
  }
@@ -9082,31 +9250,32 @@ function formatVideoDuration(seconds) {
9082
9250
  }
9083
9251
  function NoticeRow({ item }) {
9084
9252
  const enter = useEntranceAnimation();
9253
+ if (item.allowance) return /* @__PURE__ */ jsx18(AllowanceExhaustedRow, { refusal: item.allowance });
9085
9254
  if (item.recordedOutcome) {
9086
- return /* @__PURE__ */ jsxs12(
9255
+ return /* @__PURE__ */ jsxs13(
9087
9256
  "details",
9088
9257
  {
9089
9258
  className: "group text-og-sm text-og-fg-muted",
9090
9259
  role: "note",
9091
9260
  "data-og-recorded-outcome": "wait",
9092
9261
  children: [
9093
- /* @__PURE__ */ jsxs12("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
9094
- /* @__PURE__ */ jsx17(
9262
+ /* @__PURE__ */ jsxs13("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
9263
+ /* @__PURE__ */ jsx18(
9095
9264
  ChevronRightIcon2,
9096
9265
  {
9097
9266
  "aria-hidden": true,
9098
9267
  className: "size-3.5 transition-transform group-open:rotate-90"
9099
9268
  }
9100
9269
  ),
9101
- /* @__PURE__ */ jsx17("span", { title: new Date(item.occurredAt).toLocaleString(), children: recordedWaitSummary(item) })
9270
+ /* @__PURE__ */ jsx18("span", { title: new Date(item.occurredAt).toLocaleString(), children: recordedWaitSummary(item) })
9102
9271
  ] }),
9103
- /* @__PURE__ */ jsx17("p", { className: "mt-1 whitespace-pre-wrap break-words pl-5 text-og-fg-muted", children: item.text })
9272
+ /* @__PURE__ */ jsx18("p", { className: "mt-1 whitespace-pre-wrap break-words pl-5 text-og-fg-muted", children: item.text })
9104
9273
  ]
9105
9274
  }
9106
9275
  );
9107
9276
  }
9108
9277
  const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" && !item.resolvedAt ? WAITING_PILL_CLASS : NEUTRAL_PILL;
9109
- return /* @__PURE__ */ jsxs12(
9278
+ return /* @__PURE__ */ jsxs13(
9110
9279
  "div",
9111
9280
  {
9112
9281
  className: cn(
@@ -9116,20 +9285,20 @@ function NoticeRow({ item }) {
9116
9285
  ),
9117
9286
  role: "status",
9118
9287
  children: [
9119
- /* @__PURE__ */ jsx17(
9288
+ /* @__PURE__ */ jsx18(
9120
9289
  TriangleAlertIcon2,
9121
9290
  {
9122
9291
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
9123
9292
  }
9124
9293
  ),
9125
- /* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
9126
- /* @__PURE__ */ jsx17("span", { className: "whitespace-pre-wrap break-words", children: item.resolvedAt && item.text.startsWith("Approval needed") ? "Approval was needed." : item.text }),
9127
- item.details ? /* @__PURE__ */ jsxs12("details", { className: "mt-2 text-og-control", children: [
9128
- /* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
9129
- /* @__PURE__ */ jsx17("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-og-fg/5 p-2 font-mono", children: JSON.stringify(item.details.value, null, 2) })
9294
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
9295
+ /* @__PURE__ */ jsx18("span", { className: "whitespace-pre-wrap break-words", children: item.resolvedAt && item.text.startsWith("Approval needed") ? "Approval was needed." : item.text }),
9296
+ item.details ? /* @__PURE__ */ jsxs13("details", { className: "mt-2 text-og-control", children: [
9297
+ /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
9298
+ /* @__PURE__ */ jsx18("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-og-fg/5 p-2 font-mono", children: JSON.stringify(item.details.value, null, 2) })
9130
9299
  ] }) : null
9131
9300
  ] }),
9132
- item.action ? /* @__PURE__ */ jsx17(
9301
+ item.action ? /* @__PURE__ */ jsx18(
9133
9302
  "a",
9134
9303
  {
9135
9304
  className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
@@ -9148,22 +9317,22 @@ function recordedWaitSummary(item) {
9148
9317
  const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
9149
9318
  const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
9150
9319
  if (waitedMs !== void 0) {
9151
- return /* @__PURE__ */ jsxs12(Fragment5, { children: [
9320
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
9152
9321
  "Waited",
9153
9322
  target,
9154
9323
  " \xB7",
9155
9324
  " ",
9156
- /* @__PURE__ */ jsx17("time", { dateTime: `PT${Math.floor(waitedMs / 1e3)}S`, children: formatElapsed(waitedMs) })
9325
+ /* @__PURE__ */ jsx18("time", { dateTime: `PT${Math.floor(waitedMs / 1e3)}S`, children: formatElapsed(waitedMs) })
9157
9326
  ] });
9158
9327
  }
9159
9328
  const started = new Date(item.occurredAt);
9160
9329
  const sameDay = started.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
9161
- return /* @__PURE__ */ jsxs12(Fragment5, { children: [
9330
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
9162
9331
  item.waitEndedAt ? "Waited" : "Waiting",
9163
9332
  target,
9164
9333
  " \xB7 since",
9165
9334
  " ",
9166
- /* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: sameDay ? formatClockTime(item.occurredAt) : started.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }) })
9335
+ /* @__PURE__ */ jsx18("time", { dateTime: item.occurredAt, children: sameDay ? formatClockTime(item.occurredAt) : started.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }) })
9167
9336
  ] });
9168
9337
  }
9169
9338
  function AuthNeededRow({
@@ -9172,8 +9341,8 @@ function AuthNeededRow({
9172
9341
  resolveProviderLogo
9173
9342
  }) {
9174
9343
  const enter = useEntranceAnimation();
9175
- const [busy, setBusy] = useState14(false);
9176
- const [failed, setFailed] = useState14(false);
9344
+ const [busy, setBusy] = useState15(false);
9345
+ const [failed, setFailed] = useState15(false);
9177
9346
  const recommendation = item.capability ?? null;
9178
9347
  const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
9179
9348
  const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
@@ -9196,30 +9365,30 @@ function AuthNeededRow({
9196
9365
  setBusy(false);
9197
9366
  }
9198
9367
  };
9199
- return /* @__PURE__ */ jsxs12("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
9200
- /* @__PURE__ */ jsxs12("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: [
9201
- /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
9202
- /* @__PURE__ */ jsx17(
9368
+ return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
9369
+ /* @__PURE__ */ jsxs13("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: [
9370
+ /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
9371
+ /* @__PURE__ */ jsx18(
9203
9372
  AuthProviderLogo,
9204
9373
  {
9205
9374
  src: resolveProviderLogo?.(item.providerDomain) ?? null,
9206
9375
  label: provider
9207
9376
  }
9208
9377
  ),
9209
- /* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
9210
- /* @__PURE__ */ jsx17("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
9211
- /* @__PURE__ */ jsx17("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
9212
- recommendation ? /* @__PURE__ */ jsxs12("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
9378
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
9379
+ /* @__PURE__ */ jsx18("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
9380
+ /* @__PURE__ */ jsx18("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
9381
+ recommendation ? /* @__PURE__ */ jsxs13("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
9213
9382
  "Provider: ",
9214
9383
  item.providerDomain
9215
9384
  ] }) : null,
9216
- recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs12("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
9385
+ recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs13("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
9217
9386
  "Needs variables: ",
9218
9387
  recommendation.requiredVariables.join(", ")
9219
9388
  ] }) : null
9220
9389
  ] })
9221
9390
  ] }),
9222
- hostAuthorizationUrl ? /* @__PURE__ */ jsxs12(
9391
+ hostAuthorizationUrl ? /* @__PURE__ */ jsxs13(
9223
9392
  "a",
9224
9393
  {
9225
9394
  href: hostAuthorizationUrl,
@@ -9230,11 +9399,11 @@ function AuthNeededRow({
9230
9399
  "transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
9231
9400
  ),
9232
9401
  children: [
9233
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
9402
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
9234
9403
  actionLabel
9235
9404
  ]
9236
9405
  }
9237
- ) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs12(
9406
+ ) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs13(
9238
9407
  "button",
9239
9408
  {
9240
9409
  type: "button",
@@ -9245,11 +9414,11 @@ function AuthNeededRow({
9245
9414
  "transition-colors hover:bg-og-primary-hover disabled:opacity-50 pointer-coarse:min-h-9"
9246
9415
  ),
9247
9416
  children: [
9248
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
9417
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
9249
9418
  busy ? "Opening\u2026" : actionLabel
9250
9419
  ]
9251
9420
  }
9252
- ) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs12(
9421
+ ) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs13(
9253
9422
  "a",
9254
9423
  {
9255
9424
  href: item.authorizationUrl,
@@ -9260,14 +9429,14 @@ function AuthNeededRow({
9260
9429
  "transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
9261
9430
  ),
9262
9431
  children: [
9263
- /* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
9432
+ /* @__PURE__ */ jsx18(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
9264
9433
  actionLabel
9265
9434
  ]
9266
9435
  }
9267
9436
  ) : null
9268
9437
  ] }),
9269
- !unavailable ? /* @__PURE__ */ jsx17("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,
9270
- failed ? /* @__PURE__ */ jsxs12("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
9438
+ !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,
9439
+ failed ? /* @__PURE__ */ jsxs13("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
9271
9440
  "Couldn't start ",
9272
9441
  missing ? "connecting" : "reconnecting",
9273
9442
  " ",
@@ -9277,15 +9446,15 @@ function AuthNeededRow({
9277
9446
  ] });
9278
9447
  }
9279
9448
  function AuthProviderLogo({ src, label }) {
9280
- const [failed, setFailed] = useState14(false);
9281
- useEffect9(() => setFailed(false), [src]);
9449
+ const [failed, setFailed] = useState15(false);
9450
+ useEffect10(() => setFailed(false), [src]);
9282
9451
  const showImage = src && !failed;
9283
- return /* @__PURE__ */ jsx17(
9452
+ return /* @__PURE__ */ jsx18(
9284
9453
  "span",
9285
9454
  {
9286
9455
  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",
9287
9456
  "aria-hidden": true,
9288
- children: showImage ? /* @__PURE__ */ jsx17(
9457
+ children: showImage ? /* @__PURE__ */ jsx18(
9289
9458
  "img",
9290
9459
  {
9291
9460
  src,
@@ -9295,7 +9464,7 @@ function AuthProviderLogo({ src, label }) {
9295
9464
  className: "size-full object-contain p-1.5",
9296
9465
  onError: () => setFailed(true)
9297
9466
  }
9298
- ) : /* @__PURE__ */ jsx17("span", { children: monogram(label) })
9467
+ ) : /* @__PURE__ */ jsx18("span", { children: monogram(label) })
9299
9468
  }
9300
9469
  );
9301
9470
  }
@@ -9340,8 +9509,8 @@ function authReasonLine(reason) {
9340
9509
  // src/components/queue-surface.tsx
9341
9510
  import { Loader2Icon } from "lucide-react";
9342
9511
  import { lazy as lazy4, Suspense as Suspense5 } from "react";
9343
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
9344
- var loadQueueSurface = () => import("./queue-surface-implementation-IM2HD3SK.js");
9512
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
9513
+ var loadQueueSurface = () => import("./queue-surface-implementation-2CAQAIHM.js");
9345
9514
  var QueueSurface = createQueueSurface(loadQueueSurface);
9346
9515
  function createQueueSurface(loadImplementation) {
9347
9516
  const LazyQueueSurface = lazy4(async () => ({
@@ -9351,21 +9520,21 @@ function createQueueSurface(loadImplementation) {
9351
9520
  const { queue } = props;
9352
9521
  if (queue.queue.length + queue.pendingInputs.length === 0) {
9353
9522
  if (!queue.stoppingPreviousAttempt && !queue.error && !queue.mutationError) return null;
9354
- return /* @__PURE__ */ jsx18(EmptyQueueStateSurface, { queue });
9523
+ return /* @__PURE__ */ jsx19(EmptyQueueStateSurface, { queue });
9355
9524
  }
9356
- return /* @__PURE__ */ jsx18(Suspense5, { fallback: /* @__PURE__ */ jsx18(QueueSurfaceFallback, {}), children: /* @__PURE__ */ jsx18(LazyQueueSurface, { ...props }) });
9525
+ return /* @__PURE__ */ jsx19(Suspense5, { fallback: /* @__PURE__ */ jsx19(QueueSurfaceFallback, {}), children: /* @__PURE__ */ jsx19(LazyQueueSurface, { ...props }) });
9357
9526
  };
9358
9527
  }
9359
9528
  function QueueSurfaceFallback() {
9360
- return /* @__PURE__ */ jsx18(
9529
+ return /* @__PURE__ */ jsx19(
9361
9530
  "div",
9362
9531
  {
9363
9532
  "aria-live": "polite",
9364
9533
  className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
9365
9534
  "data-testid": "queue-surface-loading",
9366
9535
  role: "status",
9367
- children: /* @__PURE__ */ jsx18("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
9368
- /* @__PURE__ */ jsx18(
9536
+ children: /* @__PURE__ */ jsx19("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
9537
+ /* @__PURE__ */ jsx19(
9369
9538
  Loader2Icon,
9370
9539
  {
9371
9540
  "aria-hidden": "true",
@@ -9407,7 +9576,7 @@ function useWorkspaceModelCatalog(options) {
9407
9576
  }
9408
9577
  const [catalog, config] = await Promise.all([
9409
9578
  client.getWorkspaceModelCatalog(options.workspaceId, { signal }),
9410
- client.getClientConfig({ signal })
9579
+ client.getClientConfig({ signal, workspaceId: options.workspaceId })
9411
9580
  ]);
9412
9581
  return {
9413
9582
  models: catalog.models,
@@ -9436,7 +9605,7 @@ import { LayoutGroup, motion as motion4 } from "motion/react";
9436
9605
  import {
9437
9606
  useImperativeHandle
9438
9607
  } from "react";
9439
- import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
9608
+ import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
9440
9609
  function ChatComposer({
9441
9610
  composer,
9442
9611
  responsiveBasis,
@@ -9494,15 +9663,15 @@ function ChatComposer({
9494
9663
  useImperativeHandle(focusRef, () => ({ focusInput: controller.focusInput }), [
9495
9664
  controller.focusInput
9496
9665
  ]);
9497
- return /* @__PURE__ */ jsx19(Fragment6, { children: /* @__PURE__ */ jsxs14(Root, { controller, responsiveBasis, className, children: [
9498
- /* @__PURE__ */ jsxs14(Frame, { children: [
9499
- /* @__PURE__ */ jsx19(CommandPalette, {}),
9500
- /* @__PURE__ */ jsxs14(Surface, { className: surfaceClassName, children: [
9501
- /* @__PURE__ */ jsx19(PausedState, {}),
9502
- /* @__PURE__ */ jsx19(RestoredResources, {}),
9503
- /* @__PURE__ */ jsx19(Attachments, {}),
9666
+ return /* @__PURE__ */ jsx20(Fragment7, { children: /* @__PURE__ */ jsxs15(Root, { controller, responsiveBasis, className, children: [
9667
+ /* @__PURE__ */ jsxs15(Frame, { children: [
9668
+ /* @__PURE__ */ jsx20(CommandPalette, {}),
9669
+ /* @__PURE__ */ jsxs15(Surface, { className: surfaceClassName, children: [
9670
+ /* @__PURE__ */ jsx20(PausedState, {}),
9671
+ /* @__PURE__ */ jsx20(RestoredResources, {}),
9672
+ /* @__PURE__ */ jsx20(Attachments, {}),
9504
9673
  header,
9505
- composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */ jsx19("div", { className: "px-3.5 pt-2 md:px-4", children: /* @__PURE__ */ jsx19(
9674
+ composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */ jsx20("div", { className: "px-3.5 pt-2 md:px-4", children: /* @__PURE__ */ jsx20(
9506
9675
  TimelineAnnotationsChip,
9507
9676
  {
9508
9677
  annotations: composer.annotations,
@@ -9514,21 +9683,21 @@ function ChatComposer({
9514
9683
  onCommit: controller.focusInput
9515
9684
  }
9516
9685
  ) }) : null,
9517
- /* @__PURE__ */ jsx19(Input, { ...inputProps, placeholder, autoFocus }),
9518
- controller.confirmState ? /* @__PURE__ */ jsx19(Confirmation, {}) : footer !== void 0 ? footer : /* @__PURE__ */ jsx19(
9686
+ /* @__PURE__ */ jsx20(Input, { ...inputProps, placeholder, autoFocus }),
9687
+ controller.confirmState ? /* @__PURE__ */ jsx20(Confirmation, {}) : footer !== void 0 ? footer : /* @__PURE__ */ jsx20(
9519
9688
  Footer,
9520
9689
  {
9521
9690
  "data-og-stack-actions": stackActions ? "" : void 0,
9522
9691
  className: stackActions ? "max-sm:flex-nowrap sm:flex-wrap" : void 0,
9523
- children: /* @__PURE__ */ jsxs14(LayoutGroup, { id: "og-composer-footer", children: [
9524
- hasControls ? /* @__PURE__ */ jsxs14(
9692
+ children: /* @__PURE__ */ jsxs15(LayoutGroup, { id: "og-composer-footer", children: [
9693
+ hasControls ? /* @__PURE__ */ jsxs15(
9525
9694
  Controls,
9526
9695
  {
9527
9696
  className: stackActions ? "min-w-0 max-sm:flex-1 sm:w-auto" : void 0,
9528
9697
  children: [
9529
9698
  controlsLeading,
9530
- /* @__PURE__ */ jsx19(AttachButton, { className: attachButtonClassName }),
9531
- transcription ? /* @__PURE__ */ jsx19(
9699
+ /* @__PURE__ */ jsx20(AttachButton, { className: attachButtonClassName }),
9700
+ transcription ? /* @__PURE__ */ jsx20(
9532
9701
  ComposerTranscriptionControl,
9533
9702
  {
9534
9703
  ...transcription,
@@ -9536,13 +9705,13 @@ function ChatComposer({
9536
9705
  className: [transcription.className, transcriptionClassName].filter(Boolean).join(" ")
9537
9706
  }
9538
9707
  ) : null,
9539
- models ? /* @__PURE__ */ jsx19(
9708
+ models ? /* @__PURE__ */ jsx20(
9540
9709
  motion4.span,
9541
9710
  {
9542
9711
  layout: true,
9543
9712
  transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
9544
9713
  className: "inline-flex min-w-0",
9545
- children: /* @__PURE__ */ jsx19(
9714
+ children: /* @__PURE__ */ jsx20(
9546
9715
  ModelPicker,
9547
9716
  {
9548
9717
  models,
@@ -9552,7 +9721,7 @@ function ChatComposer({
9552
9721
  )
9553
9722
  }
9554
9723
  ) : null,
9555
- controlsStart ? /* @__PURE__ */ jsx19(
9724
+ controlsStart ? /* @__PURE__ */ jsx20(
9556
9725
  motion4.span,
9557
9726
  {
9558
9727
  layout: true,
@@ -9563,15 +9732,15 @@ function ChatComposer({
9563
9732
  ) : null
9564
9733
  ]
9565
9734
  }
9566
- ) : /* @__PURE__ */ jsx19(Hint, { children: hint }),
9567
- /* @__PURE__ */ jsxs14(
9735
+ ) : /* @__PURE__ */ jsx20(Hint, { children: hint }),
9736
+ /* @__PURE__ */ jsxs15(
9568
9737
  Actions,
9569
9738
  {
9570
9739
  className: stackActions ? "max-sm:shrink-0 sm:w-auto sm:justify-end" : void 0,
9571
9740
  children: [
9572
9741
  actionsStart,
9573
- /* @__PURE__ */ jsx19(PauseButton, {}),
9574
- /* @__PURE__ */ jsx19(SendButton, {})
9742
+ /* @__PURE__ */ jsx20(PauseButton, {}),
9743
+ /* @__PURE__ */ jsx20(SendButton, {})
9575
9744
  ]
9576
9745
  }
9577
9746
  )
@@ -9580,8 +9749,8 @@ function ChatComposer({
9580
9749
  )
9581
9750
  ] })
9582
9751
  ] }),
9583
- /* @__PURE__ */ jsx19(Help, {}),
9584
- /* @__PURE__ */ jsx19(Status, {})
9752
+ /* @__PURE__ */ jsx20(Help, {}),
9753
+ /* @__PURE__ */ jsx20(Status, {})
9585
9754
  ] }) });
9586
9755
  }
9587
9756
 
@@ -9607,8 +9776,8 @@ import {
9607
9776
  TargetIcon as TargetIcon3
9608
9777
  } from "lucide-react";
9609
9778
  import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
9610
- import { useEffect as useEffect10, useId as useId4, useMemo as useMemo5, useRef as useRef10, useState as useState15 } from "react";
9611
- import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
9779
+ import { useEffect as useEffect11, useId as useId4, useMemo as useMemo6, useRef as useRef10, useState as useState16 } from "react";
9780
+ import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
9612
9781
  var GOAL_LABEL = {
9613
9782
  pursuing: "Pursuing",
9614
9783
  waiting: "Waiting",
@@ -9723,8 +9892,8 @@ function formatCoarseElapsed(ms) {
9723
9892
  }
9724
9893
  function useLiveElapsed(startIso, live, endIso) {
9725
9894
  const start = startIso ? Date.parse(startIso) : Number.NaN;
9726
- const [now, setNow] = useState15(() => Date.now());
9727
- useEffect10(() => {
9895
+ const [now, setNow] = useState16(() => Date.now());
9896
+ useEffect11(() => {
9728
9897
  if (!live) return;
9729
9898
  const id = setInterval(() => setNow(Date.now()), 1e3);
9730
9899
  return () => clearInterval(id);
@@ -9796,7 +9965,7 @@ function SessionChrome({
9796
9965
  defaultActive = null,
9797
9966
  onActiveChange
9798
9967
  }) {
9799
- const [activityRequested, setActivityOpen] = useState15(
9968
+ const [activityRequested, setActivityOpen] = useState16(
9800
9969
  Boolean(defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
9801
9970
  );
9802
9971
  const reactId = useId4();
@@ -9806,12 +9975,12 @@ function SessionChrome({
9806
9975
  const incoming = queue.pendingInputs;
9807
9976
  const turns = queue.queue;
9808
9977
  const queueMutationFor = queue.mutationFor;
9809
- const queuedTurns = useMemo5(
9978
+ const queuedTurns = useMemo6(
9810
9979
  () => turns.filter((turn) => isAuthoritativeQueuedTurn(turn, queueMutationFor)),
9811
9980
  [queueMutationFor, turns]
9812
9981
  );
9813
- const queuedTurnIds = useMemo5(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
9814
- const optimisticQueued = useMemo5(
9982
+ const queuedTurnIds = useMemo6(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
9983
+ const optimisticQueued = useMemo6(
9815
9984
  () => (composer?.optimisticMessages ?? []).filter(
9816
9985
  (message) => isOptimisticQueuedMessage(message, queuedTurnIds, queue.snapshot)
9817
9986
  ),
@@ -9826,7 +9995,7 @@ function SessionChrome({
9826
9995
  queue.queue,
9827
9996
  queue.mutationFor
9828
9997
  );
9829
- const [activeUncontrolled, setActiveUncontrolled] = useState15(
9998
+ const [activeUncontrolled, setActiveUncontrolled] = useState16(
9830
9999
  () => sessionChromeInitialActive({
9831
10000
  defaultActive,
9832
10001
  authoritativeQueuedCount: initialAuthoritativeQueuedCount
@@ -9837,13 +10006,13 @@ function SessionChrome({
9837
10006
  const openedQueueTargetRef = useRef10(null);
9838
10007
  const focusedQueueTargetRef = useRef10(null);
9839
10008
  const queueTargetKey = queueFocusTarget ? `${queueFocusTarget.turnId}:${queueFocusTarget.requestId}` : null;
9840
- useEffect10(() => {
10009
+ useEffect11(() => {
9841
10010
  if (!queueTargetKey || openedQueueTargetRef.current === queueTargetKey) return;
9842
10011
  openedQueueTargetRef.current = queueTargetKey;
9843
10012
  if (activeControlled === void 0) setActiveUncontrolled("queue");
9844
10013
  onActiveChange?.("queue");
9845
10014
  }, [queueTargetKey, activeControlled, onActiveChange]);
9846
- useEffect10(() => {
10015
+ useEffect11(() => {
9847
10016
  if (!queueFocusTarget || active !== "queue" || focusedQueueTargetRef.current === queueTargetKey)
9848
10017
  return;
9849
10018
  const root = rootRef.current;
@@ -9885,7 +10054,7 @@ function SessionChrome({
9885
10054
  onActiveChange?.(next);
9886
10055
  };
9887
10056
  const hasCommandsPanel = commandsPanel != null;
9888
- const signals = useMemo5(() => {
10057
+ const signals = useMemo6(() => {
9889
10058
  const rows = [];
9890
10059
  if (incoming.length > 0) {
9891
10060
  const detail = incoming[0]?.summary;
@@ -9896,7 +10065,7 @@ function SessionChrome({
9896
10065
  tone: incoming.some(
9897
10066
  (item) => item.classification === "action_required" || item.classification === "failure"
9898
10067
  ) ? "waiting" : "neutral",
9899
- icon: /* @__PURE__ */ jsx20(InboxIcon, { className: "size-3" })
10068
+ icon: /* @__PURE__ */ jsx21(InboxIcon, { className: "size-3" })
9900
10069
  });
9901
10070
  }
9902
10071
  const queuedCount = queuedTurns.length + optimisticQueued.length;
@@ -9913,7 +10082,7 @@ function SessionChrome({
9913
10082
  label: queueProblem ? queuedCount > 0 ? `${queuedCount} queued \xB7 needs attention` : "Queue needs attention" : allVoiceRequests ? queuedCount === 1 ? "Voice request queued" : `${queuedCount} voice requests queued` : onlyVoiceHandoff ? "Voice handoff queued" : `${queuedCount} queued prompt${queuedCount === 1 ? "" : "s"}`,
9914
10083
  ...detail ? { detail } : {},
9915
10084
  tone: queueProblem ? "waiting" : "neutral",
9916
- icon: queueProblem ? /* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3" }) : voiceOnly ? /* @__PURE__ */ jsx20(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx20(ListOrderedIcon, { className: "size-3" })
10085
+ icon: queueProblem ? /* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3" }) : voiceOnly ? /* @__PURE__ */ jsx21(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx21(ListOrderedIcon, { className: "size-3" })
9917
10086
  });
9918
10087
  }
9919
10088
  if (record && goalState) {
@@ -9925,7 +10094,7 @@ function SessionChrome({
9925
10094
  detail: elapsed ? `${elapsed} \xB7 ${record.text}` : record.text,
9926
10095
  ...explanation ? { title: explanation } : {},
9927
10096
  tone: waiting ? "waiting" : goalState === "pursuing" || goalState === "scheduled" ? "accent" : "neutral",
9928
- icon: /* @__PURE__ */ jsx20(TargetIcon3, { className: "size-3" })
10097
+ icon: /* @__PURE__ */ jsx21(TargetIcon3, { className: "size-3" })
9929
10098
  });
9930
10099
  }
9931
10100
  if (agentsSignal && agentsSignal.count > 0) {
@@ -9935,7 +10104,7 @@ function SessionChrome({
9935
10104
  label: `${agentsSignal.count} agent${agentsSignal.count === 1 ? "" : "s"}`,
9936
10105
  ...detail ? { detail } : {},
9937
10106
  tone: agentsSignal.tone ?? "neutral",
9938
- icon: /* @__PURE__ */ jsx20(BotIcon3, { className: "size-3" })
10107
+ icon: /* @__PURE__ */ jsx21(BotIcon3, { className: "size-3" })
9939
10108
  });
9940
10109
  }
9941
10110
  if (commandsCount > 0 || active === "commands" && hasCommandsPanel) {
@@ -9943,7 +10112,7 @@ function SessionChrome({
9943
10112
  id: "commands",
9944
10113
  label: commandsCount > 0 ? `${commandsCount} command${commandsCount === 1 ? "" : "s"}` : "Commands",
9945
10114
  tone: commandsCount > 0 ? "running" : "neutral",
9946
- icon: /* @__PURE__ */ jsx20(TerminalIcon2, { className: "size-3" })
10115
+ icon: /* @__PURE__ */ jsx21(TerminalIcon2, { className: "size-3" })
9947
10116
  });
9948
10117
  }
9949
10118
  return rows;
@@ -9963,8 +10132,8 @@ function SessionChrome({
9963
10132
  ]);
9964
10133
  const optimisticQueueKeys = optimisticQueued.map((message) => message.clientEventId).join(",");
9965
10134
  const previousOptimisticQueueKeys = useRef10(optimisticQueueKeys);
9966
- const [queueArrivalNonce, setQueueArrivalNonce] = useState15(0);
9967
- useEffect10(() => {
10135
+ const [queueArrivalNonce, setQueueArrivalNonce] = useState16(0);
10136
+ useEffect11(() => {
9968
10137
  const previous = new Set(previousOptimisticQueueKeys.current.split(",").filter(Boolean));
9969
10138
  const arrived = optimisticQueued.some((message) => !previous.has(message.clientEventId));
9970
10139
  previousOptimisticQueueKeys.current = optimisticQueueKeys;
@@ -9975,13 +10144,13 @@ function SessionChrome({
9975
10144
  }
9976
10145
  }, [active, activeControlled, optimisticQueueKeys, optimisticQueued]);
9977
10146
  const queueOccupied = queuedTurns.length > 0 || optimisticQueued.length > 0;
9978
- useEffect10(() => {
10147
+ useEffect11(() => {
9979
10148
  if (queueOccupied) return;
9980
10149
  queueOfferAdmissionSuppressedRef.current = false;
9981
10150
  queueOfferDismissedSessionIdsRef.current.clear();
9982
10151
  }, [queueOccupied]);
9983
10152
  const queueOfferSuppressed = queueOfferAdmissionSuppressedRef.current || occupancySessionId != null && queueOfferDismissedSessionIdsRef.current.has(occupancySessionId);
9984
- useEffect10(() => {
10153
+ useEffect11(() => {
9985
10154
  if (!sessionChromeShouldOfferQueue({
9986
10155
  controlled: activeControlled !== void 0,
9987
10156
  active,
@@ -10002,28 +10171,28 @@ function SessionChrome({
10002
10171
  queueOfferSuppressed,
10003
10172
  queuedTurns.length
10004
10173
  ]);
10005
- const [replaceDraftFor, setReplaceDraftFor] = useState15(null);
10174
+ const [replaceDraftFor, setReplaceDraftFor] = useState16(null);
10006
10175
  const chipRefs = useRef10({});
10007
10176
  const railRef = useRef10(null);
10008
- const [pill, setPill] = useState15({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
10177
+ const [pill, setPill] = useState16({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
10009
10178
  const signalIds = signals.map((signal) => signal.id).join(",");
10010
- useEffect10(() => {
10179
+ useEffect11(() => {
10011
10180
  if (!signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)))
10012
10181
  setActivityOpen(false);
10013
10182
  }, [signals]);
10014
- useEffect10(() => {
10183
+ useEffect11(() => {
10015
10184
  if (active && !signalIds.split(",").includes(active)) {
10016
10185
  if (activeControlled === void 0) setActiveUncontrolled(null);
10017
10186
  onActiveChange?.(null);
10018
10187
  }
10019
10188
  }, [active, activeControlled, onActiveChange, signalIds]);
10020
- useEffect10(() => {
10189
+ useEffect11(() => {
10021
10190
  if (active !== "queue" || !replaceDraftFor) return;
10022
10191
  if (!queuedTurns.some((turn) => turn.id === replaceDraftFor)) {
10023
10192
  setReplaceDraftFor(null);
10024
10193
  }
10025
10194
  }, [active, queuedTurns, replaceDraftFor]);
10026
- useEffect10(() => {
10195
+ useEffect11(() => {
10027
10196
  const rail = railRef.current;
10028
10197
  const measure = () => {
10029
10198
  if (!rail || !active) {
@@ -10063,14 +10232,14 @@ function SessionChrome({
10063
10232
  const shellDuration = reduceMotion ? 0 : 0.22;
10064
10233
  const crossfadeDuration = reduceMotion ? 0 : 0.18;
10065
10234
  const ease = [0.22, 1, 0.36, 1];
10066
- const panelBody = active === "incoming" ? /* @__PURE__ */ jsx20(
10235
+ const panelBody = active === "incoming" ? /* @__PURE__ */ jsx21(
10067
10236
  IncomingPanel,
10068
10237
  {
10069
10238
  inputs: incoming,
10070
10239
  onDismiss: onDismissIncoming,
10071
10240
  onOpenSession
10072
10241
  }
10073
- ) : active === "queue" ? /* @__PURE__ */ jsx20(
10242
+ ) : active === "queue" ? /* @__PURE__ */ jsx21(
10074
10243
  QueuePanel,
10075
10244
  {
10076
10245
  turns: queuedTurns,
@@ -10080,6 +10249,7 @@ function SessionChrome({
10080
10249
  onRefresh: queue.refresh,
10081
10250
  onClearMutationError: queue.clearMutationError,
10082
10251
  onRetryOptimistic: composer?.retryOptimisticMessage,
10252
+ onRestoreOptimistic: composer?.restoreOptimisticMessage,
10083
10253
  onRemoveOptimistic: composer?.removeOptimisticMessage,
10084
10254
  readOnly: !canMutateQueue,
10085
10255
  mutationFor: queue.mutationFor,
@@ -10127,8 +10297,8 @@ function SessionChrome({
10127
10297
  void queue.moveTurn(turnId, beforeTurnId);
10128
10298
  } : void 0
10129
10299
  }
10130
- ) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx20(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "commands" ? /* @__PURE__ */ jsx20("div", { "data-og-session-chrome-panel": "commands", children: commandsPanel }) : active === "agents" ? /* @__PURE__ */ jsx20("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx20("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
10131
- return /* @__PURE__ */ jsx20(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx20(
10300
+ ) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx21(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "commands" ? /* @__PURE__ */ jsx21("div", { "data-og-session-chrome-panel": "commands", children: commandsPanel }) : active === "agents" ? /* @__PURE__ */ jsx21("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx21("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
10301
+ return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx21(
10132
10302
  "div",
10133
10303
  {
10134
10304
  className: cn("og-session-chrome og-root w-full", className),
@@ -10136,7 +10306,7 @@ function SessionChrome({
10136
10306
  ref: rootRef,
10137
10307
  "data-og-session-chrome": "",
10138
10308
  "data-og-session-chrome-open": open ? "true" : "false",
10139
- children: /* @__PURE__ */ jsxs15(
10309
+ children: /* @__PURE__ */ jsxs16(
10140
10310
  "div",
10141
10311
  {
10142
10312
  className: cn(
@@ -10152,7 +10322,7 @@ function SessionChrome({
10152
10322
  transitionTimingFunction: "var(--_og-session-chrome-ease)"
10153
10323
  },
10154
10324
  children: [
10155
- /* @__PURE__ */ jsx20(
10325
+ /* @__PURE__ */ jsx21(
10156
10326
  "div",
10157
10327
  {
10158
10328
  className: "relative",
@@ -10162,7 +10332,7 @@ function SessionChrome({
10162
10332
  paddingLeft: "var(--og-session-chrome-rail-pad)",
10163
10333
  paddingRight: "var(--og-session-chrome-rail-pad)"
10164
10334
  },
10165
- children: /* @__PURE__ */ jsxs15(
10335
+ children: /* @__PURE__ */ jsxs16(
10166
10336
  "div",
10167
10337
  {
10168
10338
  ref: railRef,
@@ -10171,7 +10341,7 @@ function SessionChrome({
10171
10341
  gap: "10px"
10172
10342
  },
10173
10343
  children: [
10174
- /* @__PURE__ */ jsx20(
10344
+ /* @__PURE__ */ jsx21(
10175
10345
  motion5.div,
10176
10346
  {
10177
10347
  "aria-hidden": true,
@@ -10193,7 +10363,7 @@ function SessionChrome({
10193
10363
  ),
10194
10364
  signals.filter((signal) => !["incoming", "agents", "commands"].includes(signal.id)).map((signal) => {
10195
10365
  const selected = active === signal.id;
10196
- return /* @__PURE__ */ jsxs15(
10366
+ return /* @__PURE__ */ jsxs16(
10197
10367
  "div",
10198
10368
  {
10199
10369
  role: "group",
@@ -10204,7 +10374,7 @@ function SessionChrome({
10204
10374
  selected && "bg-og-surface-3"
10205
10375
  ),
10206
10376
  children: [
10207
- /* @__PURE__ */ jsxs15(
10377
+ /* @__PURE__ */ jsxs16(
10208
10378
  "button",
10209
10379
  {
10210
10380
  type: "button",
@@ -10233,7 +10403,7 @@ function SessionChrome({
10233
10403
  paddingInline: "var(--og-session-chrome-chip-pad-x)"
10234
10404
  },
10235
10405
  children: [
10236
- signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */ jsx20(
10406
+ signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */ jsx21(
10237
10407
  motion5.span,
10238
10408
  {
10239
10409
  "aria-hidden": "true",
@@ -10245,26 +10415,26 @@ function SessionChrome({
10245
10415
  },
10246
10416
  queueArrivalNonce
10247
10417
  ) : null,
10248
- /* @__PURE__ */ jsx20("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
10249
- /* @__PURE__ */ jsxs15("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
10418
+ /* @__PURE__ */ jsx21("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
10419
+ /* @__PURE__ */ jsxs16("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
10250
10420
  signal.id === "goal" ? "Goal \xB7 " : null,
10251
10421
  signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : signal.id === "queue" ? queue.error || queue.mutationError ? signal.label : `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
10252
10422
  ] })
10253
10423
  ]
10254
10424
  }
10255
10425
  ),
10256
- signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
10257
- record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx20(
10426
+ signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs16("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
10427
+ record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx21(
10258
10428
  IconAction,
10259
10429
  {
10260
10430
  label: record.status === "paused" ? "Resume goal" : "Pause goal",
10261
10431
  tip: record.status === "paused" ? "Resume goal" : "Pause goal",
10262
10432
  disabled: goal.updating,
10263
10433
  onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
10264
- children: goal.updating ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx20(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx20(PauseIcon2, { className: "size-3" })
10434
+ children: goal.updating ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx21(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx21(PauseIcon2, { className: "size-3" })
10265
10435
  }
10266
10436
  ) : null,
10267
- /* @__PURE__ */ jsx20(
10437
+ /* @__PURE__ */ jsx21(
10268
10438
  IconAction,
10269
10439
  {
10270
10440
  label: "Clear goal",
@@ -10272,10 +10442,10 @@ function SessionChrome({
10272
10442
  danger: true,
10273
10443
  disabled: goal.updating,
10274
10444
  onClick: () => void goal.deleteGoal(),
10275
- children: /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
10445
+ children: /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
10276
10446
  }
10277
10447
  )
10278
- ] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */ jsx20("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: /* @__PURE__ */ jsx20(
10448
+ ] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */ jsx21("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: /* @__PURE__ */ jsx21(
10279
10449
  IconAction,
10280
10450
  {
10281
10451
  label: "Steer first queued message",
@@ -10284,7 +10454,7 @@ function SessionChrome({
10284
10454
  tip: QUEUE_STEER_TIP,
10285
10455
  disabled: queue.mutating || Boolean(queue.mutationFor(queuedTurns[0].id)),
10286
10456
  onClick: () => void queue.steerTurn(queuedTurns[0].id),
10287
- children: /* @__PURE__ */ jsx20(CornerDownRightIcon, { className: "size-3" })
10457
+ children: /* @__PURE__ */ jsx21(CornerDownRightIcon, { className: "size-3" })
10288
10458
  }
10289
10459
  ) }) : null
10290
10460
  ]
@@ -10292,7 +10462,7 @@ function SessionChrome({
10292
10462
  signal.id
10293
10463
  );
10294
10464
  }),
10295
- signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs15(
10465
+ signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs16(
10296
10466
  "button",
10297
10467
  {
10298
10468
  type: "button",
@@ -10314,27 +10484,27 @@ function SessionChrome({
10314
10484
  activityOpen ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg"
10315
10485
  ),
10316
10486
  children: [
10317
- /* @__PURE__ */ jsx20(ActivityIcon, { className: "size-3.5" }),
10318
- /* @__PURE__ */ jsx20("span", { className: "sr-only", children: "Activity" }),
10319
- commandsCount > 0 ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
10320
- /* @__PURE__ */ jsx20(
10487
+ /* @__PURE__ */ jsx21(ActivityIcon, { className: "size-3.5" }),
10488
+ /* @__PURE__ */ jsx21("span", { className: "sr-only", children: "Activity" }),
10489
+ commandsCount > 0 ? /* @__PURE__ */ jsxs16(Fragment8, { children: [
10490
+ /* @__PURE__ */ jsx21(
10321
10491
  "span",
10322
10492
  {
10323
10493
  "aria-hidden": "true",
10324
10494
  className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-fg-muted motion-reduce:animate-none"
10325
10495
  }
10326
10496
  ),
10327
- /* @__PURE__ */ jsxs15("span", { id: `${panelId}-commands-count`, children: [
10497
+ /* @__PURE__ */ jsxs16("span", { id: `${panelId}-commands-count`, children: [
10328
10498
  commandsCount,
10329
10499
  " command",
10330
10500
  commandsCount === 1 ? "" : "s"
10331
10501
  ] })
10332
10502
  ] }) : null,
10333
- incoming.length > 0 ? /* @__PURE__ */ jsx20("span", { className: "size-1.5 rounded-full bg-og-accent" }) : null
10503
+ incoming.length > 0 ? /* @__PURE__ */ jsx21("span", { className: "size-1.5 rounded-full bg-og-accent" }) : null
10334
10504
  ]
10335
10505
  }
10336
10506
  ) : null,
10337
- stopping ? /* @__PURE__ */ jsxs15(
10507
+ stopping ? /* @__PURE__ */ jsxs16(
10338
10508
  "span",
10339
10509
  {
10340
10510
  role: "status",
@@ -10342,7 +10512,7 @@ function SessionChrome({
10342
10512
  className: "inline-flex min-h-[var(--og-session-chrome-chip-min-height)] items-center gap-1.5 px-1.5 text-og-xs text-og-fg-muted",
10343
10513
  "data-testid": "session-chrome-stopping",
10344
10514
  children: [
10345
- /* @__PURE__ */ jsx20(
10515
+ /* @__PURE__ */ jsx21(
10346
10516
  Loader2Icon2,
10347
10517
  {
10348
10518
  "aria-hidden": "true",
@@ -10358,7 +10528,7 @@ function SessionChrome({
10358
10528
  )
10359
10529
  }
10360
10530
  ),
10361
- /* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: activityOpen ? /* @__PURE__ */ jsx20(
10531
+ /* @__PURE__ */ jsx21(AnimatePresence4, { initial: false, children: activityOpen ? /* @__PURE__ */ jsx21(
10362
10532
  motion5.div,
10363
10533
  {
10364
10534
  initial: { height: 0, opacity: 0 },
@@ -10366,7 +10536,7 @@ function SessionChrome({
10366
10536
  exit: { height: 0, opacity: 0 },
10367
10537
  transition: { duration: shellDuration, ease },
10368
10538
  style: { overflow: "hidden" },
10369
- children: /* @__PURE__ */ jsx20("div", { className: "mt-1 flex items-center gap-1 rounded-t-og-lg bg-og-surface-2/50 px-2 py-1", children: signals.filter((signal) => ["incoming", "agents", "commands"].includes(signal.id)).map((signal) => /* @__PURE__ */ jsxs15(
10539
+ children: /* @__PURE__ */ jsx21("div", { className: "mt-1 flex items-center gap-1 rounded-t-og-lg bg-og-surface-2/50 px-2 py-1", children: signals.filter((signal) => ["incoming", "agents", "commands"].includes(signal.id)).map((signal) => /* @__PURE__ */ jsxs16(
10370
10540
  "button",
10371
10541
  {
10372
10542
  type: "button",
@@ -10388,11 +10558,11 @@ function SessionChrome({
10388
10558
  },
10389
10559
  "activity-tabs"
10390
10560
  ) : null }),
10391
- goal?.mutationError ? /* @__PURE__ */ jsxs15("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
10561
+ goal?.mutationError ? /* @__PURE__ */ jsxs16("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
10392
10562
  "Goal action not confirmed. ",
10393
10563
  goal.mutationError.message
10394
10564
  ] }) : null,
10395
- /* @__PURE__ */ jsx20(
10565
+ /* @__PURE__ */ jsx21(
10396
10566
  "div",
10397
10567
  {
10398
10568
  id: panelId,
@@ -10408,7 +10578,7 @@ function SessionChrome({
10408
10578
  transitionDuration: "var(--og-session-chrome-duration)",
10409
10579
  transitionTimingFunction: "var(--_og-session-chrome-ease)"
10410
10580
  },
10411
- children: /* @__PURE__ */ jsx20("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs15(
10581
+ children: /* @__PURE__ */ jsx21("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs16(
10412
10582
  "div",
10413
10583
  {
10414
10584
  className: cn(
@@ -10421,7 +10591,7 @@ function SessionChrome({
10421
10591
  paddingBlock: "var(--og-session-chrome-panel-pad-y)"
10422
10592
  },
10423
10593
  children: [
10424
- /* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: active && active !== "commands" && panelBody ? /* @__PURE__ */ jsx20(
10594
+ /* @__PURE__ */ jsx21(AnimatePresence4, { initial: false, children: active && active !== "commands" && panelBody ? /* @__PURE__ */ jsx21(
10425
10595
  motion5.div,
10426
10596
  {
10427
10597
  "data-og-session-chrome-panel-frame": active,
@@ -10439,7 +10609,7 @@ function SessionChrome({
10439
10609
  },
10440
10610
  active
10441
10611
  ) : null }),
10442
- active === "commands" ? /* @__PURE__ */ jsx20(
10612
+ active === "commands" ? /* @__PURE__ */ jsx21(
10443
10613
  motion5.div,
10444
10614
  {
10445
10615
  initial: reduceMotion ? false : { opacity: 0 },
@@ -10465,20 +10635,20 @@ function IncomingPanel({
10465
10635
  onDismiss,
10466
10636
  onOpenSession
10467
10637
  }) {
10468
- return /* @__PURE__ */ jsxs15("div", { children: [
10469
- /* @__PURE__ */ jsx20("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
10470
- /* @__PURE__ */ jsx20(
10638
+ return /* @__PURE__ */ jsxs16("div", { children: [
10639
+ /* @__PURE__ */ jsx21("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
10640
+ /* @__PURE__ */ jsx21(
10471
10641
  "ul",
10472
10642
  {
10473
10643
  className: "flex flex-col gap-0.5",
10474
10644
  "aria-label": "Incoming updates",
10475
10645
  "data-og-session-chrome-panel": "incoming",
10476
- children: inputs.map((input) => /* @__PURE__ */ jsxs15(
10646
+ children: inputs.map((input) => /* @__PURE__ */ jsxs16(
10477
10647
  "li",
10478
10648
  {
10479
10649
  className: "group flex items-start gap-1.5 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--_og-session-chrome-row-hover)]",
10480
10650
  children: [
10481
- /* @__PURE__ */ jsx20(
10651
+ /* @__PURE__ */ jsx21(
10482
10652
  "span",
10483
10653
  {
10484
10654
  className: cn(
@@ -10488,9 +10658,9 @@ function IncomingPanel({
10488
10658
  children: pendingKindLabel(input.kind)
10489
10659
  }
10490
10660
  ),
10491
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
10492
- /* @__PURE__ */ jsx20("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
10493
- /* @__PURE__ */ jsx20(
10661
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
10662
+ /* @__PURE__ */ jsx21("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
10663
+ /* @__PURE__ */ jsx21(
10494
10664
  ChildSessionLink,
10495
10665
  {
10496
10666
  kind: input.kind,
@@ -10499,14 +10669,14 @@ function IncomingPanel({
10499
10669
  }
10500
10670
  )
10501
10671
  ] }),
10502
- onDismiss ? /* @__PURE__ */ jsx20("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: /* @__PURE__ */ jsx20(
10672
+ onDismiss ? /* @__PURE__ */ jsx21("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: /* @__PURE__ */ jsx21(
10503
10673
  IconAction,
10504
10674
  {
10505
10675
  label: `Dismiss incoming ${pendingKindLabel(input.kind)}`,
10506
10676
  tip: "Dismiss",
10507
10677
  onClick: () => onDismiss(input.id),
10508
10678
  danger: true,
10509
- children: /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
10679
+ children: /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
10510
10680
  }
10511
10681
  ) }) : null
10512
10682
  ]
@@ -10525,6 +10695,7 @@ function QueuePanel({
10525
10695
  onRefresh,
10526
10696
  onClearMutationError,
10527
10697
  onRetryOptimistic,
10698
+ onRestoreOptimistic,
10528
10699
  onRemoveOptimistic,
10529
10700
  readOnly,
10530
10701
  mutationFor,
@@ -10538,10 +10709,10 @@ function QueuePanel({
10538
10709
  }) {
10539
10710
  const reduceMotion = useReducedMotion4();
10540
10711
  const turnIdsKey = turns.map((turn) => turn.id).join(",");
10541
- const [interactiveTurnIds, setInteractiveTurnIds] = useState15(
10712
+ const [interactiveTurnIds, setInteractiveTurnIds] = useState16(
10542
10713
  () => /* @__PURE__ */ new Set()
10543
10714
  );
10544
- useEffect10(() => {
10715
+ useEffect11(() => {
10545
10716
  const visibleTurnIds = new Set(turnIdsKey ? turnIdsKey.split(",") : []);
10546
10717
  setInteractiveTurnIds((current) => {
10547
10718
  const retained = new Set([...current].filter((turnId) => visibleTurnIds.has(turnId)));
@@ -10554,7 +10725,7 @@ function QueuePanel({
10554
10725
  );
10555
10726
  return () => clearTimeout(timer);
10556
10727
  }, [reduceMotion, turnIdsKey]);
10557
- return /* @__PURE__ */ jsxs15(
10728
+ return /* @__PURE__ */ jsxs16(
10558
10729
  "ol",
10559
10730
  {
10560
10731
  className: "flex flex-col gap-0.5",
@@ -10570,52 +10741,52 @@ function QueuePanel({
10570
10741
  const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
10571
10742
  const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
10572
10743
  const confirmingReplace = replaceDraftFor === turn.id;
10573
- return /* @__PURE__ */ jsxs15(
10744
+ return /* @__PURE__ */ jsxs16(
10574
10745
  "li",
10575
10746
  {
10576
10747
  "data-queue-turn-id": turn.id,
10577
10748
  tabIndex: -1,
10578
10749
  className: "group flex flex-col gap-1 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--_og-session-chrome-row-hover)]",
10579
10750
  children: [
10580
- /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-1.5", children: [
10581
- voice ? /* @__PURE__ */ jsx20(
10751
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-1.5", children: [
10752
+ voice ? /* @__PURE__ */ jsx21(
10582
10753
  AudioLinesIcon,
10583
10754
  {
10584
10755
  "aria-hidden": "true",
10585
10756
  className: "mt-0.5 size-3 shrink-0 text-og-accent"
10586
10757
  }
10587
- ) : /* @__PURE__ */ jsx20("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
10588
- /* @__PURE__ */ jsx20(
10758
+ ) : /* @__PURE__ */ jsx21("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
10759
+ /* @__PURE__ */ jsx21(
10589
10760
  CompactQueueItemContent,
10590
10761
  {
10591
10762
  text: presentation.text,
10592
10763
  annotations: turn.annotations ?? []
10593
10764
  }
10594
10765
  ),
10595
- showActions ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: [
10596
- onMove && turns.length > 1 ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
10597
- /* @__PURE__ */ jsx20(
10766
+ showActions ? /* @__PURE__ */ jsxs16("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: [
10767
+ onMove && turns.length > 1 ? /* @__PURE__ */ jsxs16(Fragment8, { children: [
10768
+ /* @__PURE__ */ jsx21(
10598
10769
  IconAction,
10599
10770
  {
10600
10771
  label: `Move queued prompt ${index + 1} up`,
10601
10772
  tip: "Move up",
10602
10773
  disabled: settling || pending !== null || index === 0,
10603
10774
  onClick: () => onMove(turn.id, beforeUp),
10604
- children: /* @__PURE__ */ jsx20(ArrowUpIcon2, { className: "size-3" })
10775
+ children: /* @__PURE__ */ jsx21(ArrowUpIcon2, { className: "size-3" })
10605
10776
  }
10606
10777
  ),
10607
- /* @__PURE__ */ jsx20(
10778
+ /* @__PURE__ */ jsx21(
10608
10779
  IconAction,
10609
10780
  {
10610
10781
  label: `Move queued prompt ${index + 1} down`,
10611
10782
  tip: "Move down",
10612
10783
  disabled: settling || pending !== null || index >= turns.length - 1,
10613
10784
  onClick: () => onMove(turn.id, beforeDown),
10614
- children: /* @__PURE__ */ jsx20(ArrowDownIcon2, { className: "size-3" })
10785
+ children: /* @__PURE__ */ jsx21(ArrowDownIcon2, { className: "size-3" })
10615
10786
  }
10616
10787
  )
10617
10788
  ] }) : null,
10618
- onSteer ? /* @__PURE__ */ jsx20(
10789
+ onSteer ? /* @__PURE__ */ jsx21(
10619
10790
  IconAction,
10620
10791
  {
10621
10792
  label: `Steer queued prompt ${index + 1}`,
@@ -10624,20 +10795,20 @@ function QueuePanel({
10624
10795
  tip: QUEUE_STEER_TIP,
10625
10796
  disabled: settling || pending !== null,
10626
10797
  onClick: () => onSteer(turn.id),
10627
- children: pending === "steer" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(CornerDownRightIcon, { className: "size-3" })
10798
+ children: pending === "steer" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(CornerDownRightIcon, { className: "size-3" })
10628
10799
  }
10629
10800
  ) : null,
10630
- onEdit ? /* @__PURE__ */ jsx20(
10801
+ onEdit ? /* @__PURE__ */ jsx21(
10631
10802
  IconAction,
10632
10803
  {
10633
10804
  label: `Edit queued prompt ${index + 1}`,
10634
10805
  tip: QUEUE_EDIT_TIP,
10635
10806
  disabled: settling || pending !== null,
10636
10807
  onClick: () => onEdit(turn),
10637
- children: pending === "edit" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(PencilIcon, { className: "size-3" })
10808
+ children: pending === "edit" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(PencilIcon, { className: "size-3" })
10638
10809
  }
10639
10810
  ) : null,
10640
- onRemove ? /* @__PURE__ */ jsx20(
10811
+ onRemove ? /* @__PURE__ */ jsx21(
10641
10812
  IconAction,
10642
10813
  {
10643
10814
  label: `Remove queued prompt ${index + 1}`,
@@ -10645,16 +10816,16 @@ function QueuePanel({
10645
10816
  disabled: settling || pending !== null,
10646
10817
  onClick: () => onRemove(turn.id),
10647
10818
  danger: true,
10648
- children: pending === "delete" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
10819
+ children: pending === "delete" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
10649
10820
  }
10650
10821
  ) : null
10651
10822
  ] }) : null
10652
10823
  ] }),
10653
- confirmingReplace ? /* @__PURE__ */ jsxs15("div", { className: "rounded-og-sm border border-og-status-waiting/30 bg-og-status-waiting/10 p-2 text-og-xs text-og-fg", children: [
10654
- /* @__PURE__ */ jsx20("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
10655
- /* @__PURE__ */ jsx20("p", { className: "mt-0.5 text-og-fg-muted", children: "The current draft will be permanently discarded; this queued prompt is preserved until you confirm." }),
10656
- /* @__PURE__ */ jsxs15("div", { className: "mt-2 flex justify-end gap-1.5", children: [
10657
- /* @__PURE__ */ jsx20(
10824
+ confirmingReplace ? /* @__PURE__ */ jsxs16("div", { className: "rounded-og-sm border border-og-status-waiting/30 bg-og-status-waiting/10 p-2 text-og-xs text-og-fg", children: [
10825
+ /* @__PURE__ */ jsx21("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
10826
+ /* @__PURE__ */ jsx21("p", { className: "mt-0.5 text-og-fg-muted", children: "The current draft will be permanently discarded; this queued prompt is preserved until you confirm." }),
10827
+ /* @__PURE__ */ jsxs16("div", { className: "mt-2 flex justify-end gap-1.5", children: [
10828
+ /* @__PURE__ */ jsx21(
10658
10829
  "button",
10659
10830
  {
10660
10831
  type: "button",
@@ -10663,7 +10834,7 @@ function QueuePanel({
10663
10834
  children: "Keep current draft"
10664
10835
  }
10665
10836
  ),
10666
- /* @__PURE__ */ jsx20(
10837
+ /* @__PURE__ */ jsx21(
10667
10838
  "button",
10668
10839
  {
10669
10840
  type: "button",
@@ -10679,7 +10850,7 @@ function QueuePanel({
10679
10850
  turn.id
10680
10851
  );
10681
10852
  }),
10682
- /* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs15(
10853
+ /* @__PURE__ */ jsx21(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs16(
10683
10854
  motion5.li,
10684
10855
  {
10685
10856
  "aria-live": "polite",
@@ -10692,11 +10863,14 @@ function QueuePanel({
10692
10863
  message.state === "failed" ? "bg-og-danger/8 text-og-danger" : "bg-og-accent-soft/45"
10693
10864
  ),
10694
10865
  children: [
10695
- /* @__PURE__ */ jsx20("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
10696
- /* @__PURE__ */ jsx20(CompactQueueItemContent, { text: message.text, annotations: message.annotations }),
10697
- /* @__PURE__ */ jsx20("span", { className: "sr-only", children: message.state === "failed" ? "Not confirmed" : message.state === "sending" ? "Placing in queue" : "Queued" }),
10698
- message.state === "failed" ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
10699
- onRetryOptimistic ? /* @__PURE__ */ jsx20(
10866
+ /* @__PURE__ */ jsx21("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
10867
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
10868
+ /* @__PURE__ */ jsx21(CompactQueueItemContent, { text: message.text, annotations: message.annotations }),
10869
+ message.state === "failed" && message.error ? /* @__PURE__ */ jsx21("p", { className: "break-words text-og-xs", children: message.error }) : null
10870
+ ] }),
10871
+ /* @__PURE__ */ jsx21("span", { className: "sr-only", children: message.state === "failed" ? message.outcomeUnknown ? "Not confirmed" : "Message not sent" : message.state === "sending" ? "Placing in queue" : "Queued" }),
10872
+ message.state === "failed" ? /* @__PURE__ */ jsxs16("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
10873
+ message.retryable !== false && onRetryOptimistic ? /* @__PURE__ */ jsx21(
10700
10874
  "button",
10701
10875
  {
10702
10876
  type: "button",
@@ -10705,36 +10879,45 @@ function QueuePanel({
10705
10879
  children: "Retry"
10706
10880
  }
10707
10881
  ) : null,
10708
- onRemoveOptimistic ? /* @__PURE__ */ jsx20(
10882
+ message.retryable === false && onRestoreOptimistic ? /* @__PURE__ */ jsx21(
10883
+ "button",
10884
+ {
10885
+ type: "button",
10886
+ className: "rounded-og-sm px-1.5 py-1 font-medium hover:bg-og-surface-2 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
10887
+ onClick: () => onRestoreOptimistic(message.clientEventId),
10888
+ children: "Edit message"
10889
+ }
10890
+ ) : null,
10891
+ onRemoveOptimistic ? /* @__PURE__ */ jsx21(
10709
10892
  "button",
10710
10893
  {
10711
10894
  type: "button",
10712
10895
  "aria-label": "Dismiss unconfirmed queued prompt",
10713
10896
  className: "rounded-og-sm p-1 text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-11 pointer-coarse:min-w-11",
10714
10897
  onClick: () => onRemoveOptimistic(message.clientEventId),
10715
- children: /* @__PURE__ */ jsx20(XIcon2, { className: "size-3" })
10898
+ children: /* @__PURE__ */ jsx21(XIcon2, { className: "size-3" })
10716
10899
  }
10717
10900
  ) : null
10718
- ] }) : message.state === "sending" ? /* @__PURE__ */ jsx20(
10901
+ ] }) : message.state === "sending" ? /* @__PURE__ */ jsx21(
10719
10902
  Loader2Icon2,
10720
10903
  {
10721
10904
  "aria-hidden": "true",
10722
10905
  className: "size-3 shrink-0 animate-og-spin text-og-accent motion-reduce:animate-none"
10723
10906
  }
10724
- ) : /* @__PURE__ */ jsx20(CheckIcon3, { "aria-hidden": "true", className: "size-3 shrink-0 text-og-accent" })
10907
+ ) : /* @__PURE__ */ jsx21(CheckIcon3, { "aria-hidden": "true", className: "size-3 shrink-0 text-og-accent" })
10725
10908
  ]
10726
10909
  },
10727
10910
  message.clientEventId
10728
10911
  )) }),
10729
- loadError ? /* @__PURE__ */ jsxs15(
10912
+ loadError ? /* @__PURE__ */ jsxs16(
10730
10913
  "li",
10731
10914
  {
10732
10915
  role: "alert",
10733
10916
  className: "flex items-center gap-1.5 rounded-og-sm bg-og-danger/8 px-1.5 py-1 text-og-xs text-og-danger",
10734
10917
  children: [
10735
- /* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
10736
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1", children: "Queue unavailable." }),
10737
- /* @__PURE__ */ jsx20(
10918
+ /* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
10919
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1", children: "Queue unavailable." }),
10920
+ /* @__PURE__ */ jsx21(
10738
10921
  "button",
10739
10922
  {
10740
10923
  type: "button",
@@ -10746,15 +10929,15 @@ function QueuePanel({
10746
10929
  ]
10747
10930
  }
10748
10931
  ) : null,
10749
- mutationError ? /* @__PURE__ */ jsxs15(
10932
+ mutationError ? /* @__PURE__ */ jsxs16(
10750
10933
  "li",
10751
10934
  {
10752
10935
  role: "alert",
10753
10936
  className: "flex items-center gap-1.5 rounded-og-sm bg-og-danger/8 px-1.5 py-1 text-og-xs text-og-danger",
10754
10937
  children: [
10755
- /* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
10756
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1", children: "Not confirmed. Check the queue before retrying." }),
10757
- /* @__PURE__ */ jsx20(
10938
+ /* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
10939
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1", children: "Not confirmed. Check the queue before retrying." }),
10940
+ /* @__PURE__ */ jsx21(
10758
10941
  "button",
10759
10942
  {
10760
10943
  type: "button",
@@ -10775,9 +10958,9 @@ function CompactQueueItemContent({
10775
10958
  annotations
10776
10959
  }) {
10777
10960
  const content = queueItemContent(text, annotations.length);
10778
- return /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
10779
- content === "text" ? /* @__PURE__ */ jsx20("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: text }) : content === "unavailable" ? /* @__PURE__ */ jsx20("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg-muted italic", children: QUEUE_ITEM_CONTENT_UNAVAILABLE }) : null,
10780
- annotations.length > 0 ? /* @__PURE__ */ jsx20(TimelineAnnotationsChip, { annotations, className: "shrink-0", compact: true }) : null
10961
+ return /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
10962
+ content === "text" ? /* @__PURE__ */ jsx21("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: text }) : content === "unavailable" ? /* @__PURE__ */ jsx21("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg-muted italic", children: QUEUE_ITEM_CONTENT_UNAVAILABLE }) : null,
10963
+ annotations.length > 0 ? /* @__PURE__ */ jsx21(TimelineAnnotationsChip, { annotations, className: "shrink-0", compact: true }) : null
10781
10964
  ] });
10782
10965
  }
10783
10966
  function GoalPanel({
@@ -10790,26 +10973,26 @@ function GoalPanel({
10790
10973
  if (!record) return null;
10791
10974
  const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
10792
10975
  const explanation = sessionChromeGoalPillExplanation(state, record);
10793
- return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
10794
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
10795
- /* @__PURE__ */ jsx20("span", { children: sessionChromeGoalPillLabel(state, record) }),
10796
- elapsed ? /* @__PURE__ */ jsxs15("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
10976
+ return /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
10977
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
10978
+ /* @__PURE__ */ jsx21("span", { children: sessionChromeGoalPillLabel(state, record) }),
10979
+ elapsed ? /* @__PURE__ */ jsxs16("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
10797
10980
  "\xB7 Created ",
10798
10981
  elapsed,
10799
10982
  " ago"
10800
10983
  ] }) : null,
10801
- /* @__PURE__ */ jsxs15("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
10984
+ /* @__PURE__ */ jsxs16("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
10802
10985
  "\xB7 v",
10803
10986
  record.version
10804
10987
  ] })
10805
10988
  ] }),
10806
- /* @__PURE__ */ jsx20("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
10807
- record.successCriteria ? /* @__PURE__ */ jsxs15("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
10808
- /* @__PURE__ */ jsx20("span", { className: "font-medium text-og-fg", children: "Done when" }),
10989
+ /* @__PURE__ */ jsx21("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
10990
+ record.successCriteria ? /* @__PURE__ */ jsxs16("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
10991
+ /* @__PURE__ */ jsx21("span", { className: "font-medium text-og-fg", children: "Done when" }),
10809
10992
  " ",
10810
10993
  record.successCriteria
10811
10994
  ] }) : null,
10812
- explanation ? /* @__PURE__ */ jsx20(
10995
+ explanation ? /* @__PURE__ */ jsx21(
10813
10996
  "p",
10814
10997
  {
10815
10998
  "data-og-session-chrome-goal-explanation": true,
@@ -10817,20 +11000,20 @@ function GoalPanel({
10817
11000
  children: explanation
10818
11001
  }
10819
11002
  ) : null,
10820
- record.continuation?.lastError ? /* @__PURE__ */ jsx20("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children: record.continuation.lastError }) : null,
10821
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
10822
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
10823
- /* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
11003
+ record.continuation?.lastError ? /* @__PURE__ */ jsx21("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children: record.continuation.lastError }) : null,
11004
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
11005
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
11006
+ /* @__PURE__ */ jsxs16("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
10824
11007
  record.autoContinuations,
10825
11008
  " consecutive unattended continues"
10826
11009
  ] }),
10827
- /* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
11010
+ /* @__PURE__ */ jsxs16("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
10828
11011
  record.noProgressStreak,
10829
11012
  " stalled"
10830
11013
  ] })
10831
11014
  ] }),
10832
- !readOnly ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-0.5", children: [
10833
- canToggle ? /* @__PURE__ */ jsxs15(
11015
+ !readOnly ? /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-0.5", children: [
11016
+ canToggle ? /* @__PURE__ */ jsxs16(
10834
11017
  "button",
10835
11018
  {
10836
11019
  type: "button",
@@ -10838,12 +11021,12 @@ function GoalPanel({
10838
11021
  onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
10839
11022
  className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
10840
11023
  children: [
10841
- goal.updating ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx20(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx20(PauseIcon2, { className: "size-3" }),
11024
+ goal.updating ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx21(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx21(PauseIcon2, { className: "size-3" }),
10842
11025
  record.status === "paused" ? "Resume" : "Pause"
10843
11026
  ]
10844
11027
  }
10845
11028
  ) : null,
10846
- /* @__PURE__ */ jsxs15(
11029
+ /* @__PURE__ */ jsxs16(
10847
11030
  "button",
10848
11031
  {
10849
11032
  type: "button",
@@ -10851,7 +11034,7 @@ function GoalPanel({
10851
11034
  onClick: () => void goal.deleteGoal(),
10852
11035
  className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-subtle outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-danger focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
10853
11036
  children: [
10854
- /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" }),
11037
+ /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" }),
10855
11038
  "Clear"
10856
11039
  ]
10857
11040
  }
@@ -10860,9 +11043,9 @@ function GoalPanel({
10860
11043
  ] })
10861
11044
  ] });
10862
11045
  }
10863
- var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs15("span", { className: "flex flex-col gap-0.5 text-left", children: [
10864
- /* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Steer" }),
10865
- /* @__PURE__ */ jsx20("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
11046
+ var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs16("span", { className: "flex flex-col gap-0.5 text-left", children: [
11047
+ /* @__PURE__ */ jsx21("span", { className: "font-medium", children: "Steer" }),
11048
+ /* @__PURE__ */ jsx21("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
10866
11049
  ] });
10867
11050
  var QUEUE_EDIT_TIP = "Edit in composer";
10868
11051
  var QUEUE_DELETE_TIP = "Delete this queued prompt";
@@ -10876,8 +11059,8 @@ function IconAction({
10876
11059
  danger,
10877
11060
  children
10878
11061
  }) {
10879
- return /* @__PURE__ */ jsxs15(Tooltip, { children: [
10880
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
11062
+ return /* @__PURE__ */ jsxs16(Tooltip, { children: [
11063
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
10881
11064
  "button",
10882
11065
  {
10883
11066
  type: "button",
@@ -10899,21 +11082,34 @@ function IconAction({
10899
11082
  ]
10900
11083
  }
10901
11084
  ) }),
10902
- /* @__PURE__ */ jsx20(TooltipContent, { side: "top", children: tip })
11085
+ /* @__PURE__ */ jsx21(TooltipContent, { side: "top", children: tip })
10903
11086
  ] });
10904
11087
  }
10905
11088
 
10906
11089
  // src/components/session-conversation.tsx
10907
- import { useEffect as useEffect11, useMemo as useMemo6, useRef as useRef11, useState as useState16 } from "react";
10908
- import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
11090
+ import { SESSION_SCOPE_HEADER } from "@opengeni/sdk";
11091
+ import {
11092
+ lazy as lazy5,
11093
+ Suspense as Suspense6,
11094
+ useCallback as useCallback5,
11095
+ useEffect as useEffect12,
11096
+ useMemo as useMemo7,
11097
+ useRef as useRef11,
11098
+ useState as useState17
11099
+ } from "react";
11100
+ import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
10909
11101
  function SessionConversation(props) {
10910
- return /* @__PURE__ */ jsx21(Conversation, { ...props }, `${props.workspaceId ?? ""}:${props.sessionId}`);
11102
+ return /* @__PURE__ */ jsx22(Conversation, { ...props }, `${props.workspaceId ?? ""}:${props.sessionId}`);
10911
11103
  }
10912
11104
  function Conversation({
10913
11105
  sessionId,
10914
11106
  renderMessageText,
10915
11107
  resolveLink,
11108
+ onOpenArtifact,
11109
+ renderInteractiveBlock,
10916
11110
  toolRegistry,
11111
+ renderAllowanceExhausted,
11112
+ allowanceExhaustedLabels,
10917
11113
  attachments: attachmentsRequested = true,
10918
11114
  modelPicker,
10919
11115
  userMessageDisclosureLabels,
@@ -10926,8 +11122,6 @@ function Conversation({
10926
11122
  }) {
10927
11123
  const scope = { client, workspaceId };
10928
11124
  const context = useOpenGeni(scope);
10929
- const scopeRef = useRef11(context);
10930
- scopeRef.current = context;
10931
11125
  const config = useClientConfigFlags(context.client);
10932
11126
  const showModelPicker = modelPicker ?? config.modelSelection;
10933
11127
  const catalog = useWorkspaceModelCatalog({
@@ -10939,14 +11133,14 @@ function Conversation({
10939
11133
  const options = { ...scope, events: feed.events };
10940
11134
  const detail = useSession(sessionId, options);
10941
11135
  const queue = useTurnQueue(sessionId, options);
10942
- const [queueFocusTarget, setQueueFocusTarget] = useState16();
10943
11136
  const human = useHumanInputRequests(sessionId, options);
10944
11137
  const control = useSessionControl(sessionId, scope);
10945
- const approvals = useMemo6(() => projectPendingApprovals(feed.events), [feed.events]);
11138
+ const approvals = useMemo7(() => projectPendingApprovals(feed.events), [feed.events]);
10946
11139
  const files = useFileAttachments(scope);
10947
11140
  const uploadsEnabled = attachmentsRequested && config.uploads;
10948
11141
  const status = feed.sessionStatus ?? detail.session?.status;
10949
11142
  const terminal = status === "cancelled";
11143
+ const importedArchive = detail.session?.importedArchive?.readOnly === true;
10950
11144
  const releaseSentFiles = (input) => files.removeReadyFiles(
10951
11145
  (input.resources ?? []).flatMap(
10952
11146
  (resource) => resource.kind === "file" ? [resource.fileId] : []
@@ -10964,8 +11158,13 @@ function Conversation({
10964
11158
  } : {}
10965
11159
  });
10966
11160
  const region = useRef11(null);
11161
+ const defaultInteractiveBlock = useDefaultInteractiveBlock(
11162
+ context.client,
11163
+ context.workspaceId,
11164
+ sessionId
11165
+ );
10967
11166
  const inheritedLinks = useOpenGeniLinkResolver();
10968
- const defaultLinks = useMemo6(
11167
+ const defaultLinks = useMemo7(
10969
11168
  () => sessionLinkResolver({
10970
11169
  client: context.client,
10971
11170
  workspaceId: context.workspaceId,
@@ -10974,12 +11173,22 @@ function Conversation({
10974
11173
  }),
10975
11174
  [context.client, context.workspaceId, sessionId, config.sandboxFiles]
10976
11175
  );
10977
- const links = useMemo6(
10978
- () => chainLinkResolvers(resolveLink, inheritedLinks, defaultLinks) ?? void 0,
10979
- [resolveLink, inheritedLinks, defaultLinks]
11176
+ const onOpenArtifactRef = useRef11(onOpenArtifact);
11177
+ onOpenArtifactRef.current = onOpenArtifact;
11178
+ const opensArtifacts = onOpenArtifact !== void 0;
11179
+ const viewerLinks = useMemo7(
11180
+ () => opensArtifacts ? viewerLinkResolver({
11181
+ workspaceId: context.workspaceId,
11182
+ open: (target) => onOpenArtifactRef.current?.(target)
11183
+ }) : null,
11184
+ [context.workspaceId, opensArtifacts]
11185
+ );
11186
+ const links = useMemo7(
11187
+ () => chainLinkResolvers(resolveLink, viewerLinks, inheritedLinks, defaultLinks) ?? void 0,
11188
+ [resolveLink, viewerLinks, inheritedLinks, defaultLinks]
10980
11189
  );
10981
11190
  const error = detail.error ?? feed.error ?? human.error;
10982
- return /* @__PURE__ */ jsxs16(
11191
+ return /* @__PURE__ */ jsxs17(
10983
11192
  "div",
10984
11193
  {
10985
11194
  className: cn(
@@ -10990,13 +11199,16 @@ function Conversation({
10990
11199
  style: { height },
10991
11200
  "data-og-conversation": "",
10992
11201
  children: [
10993
- error && /* @__PURE__ */ jsx21("p", { role: "alert", children: error.message }),
10994
- /* @__PURE__ */ jsx21(
11202
+ error && /* @__PURE__ */ jsx22("p", { role: "alert", children: error.message }),
11203
+ /* @__PURE__ */ jsx22(
10995
11204
  MessageTimeline,
10996
11205
  {
10997
11206
  renderMessageText,
10998
11207
  resolveLink: links,
11208
+ renderInteractiveBlock: renderInteractiveBlock === false ? void 0 : renderInteractiveBlock ?? defaultInteractiveBlock,
10999
11209
  userMessageDisclosureLabels,
11210
+ renderAllowanceExhausted,
11211
+ allowanceExhaustedLabels,
11000
11212
  className: "min-h-0 flex-1",
11001
11213
  ...toolRegistry ? { toolRegistry } : {},
11002
11214
  events: feed.events,
@@ -11014,103 +11226,120 @@ function Conversation({
11014
11226
  },
11015
11227
  loadingOldest: feed.loadingOldest,
11016
11228
  onJumpToLatest: feed.jumpToLatest,
11017
- onJumpToLatestQuestion: () => feed.jumpToLatestQuestion({
11018
- onQueuedQuestion: async (turn, navigation) => {
11019
- await queue.refresh();
11020
- if (!navigation.isCurrent() || scopeRef.current.client !== context.client || scopeRef.current.workspaceId !== context.workspaceId)
11021
- return;
11022
- setQueueFocusTarget((previous) => ({
11023
- turnId: turn.id,
11024
- requestId: (previous?.requestId ?? 0) + 1
11025
- }));
11026
- }
11027
- }),
11028
- onAnnotate: composer.addAnnotation
11229
+ onAnnotate: importedArchive ? void 0 : composer.addAnnotation
11029
11230
  }
11030
11231
  ),
11031
- /* @__PURE__ */ jsxs16("div", { className: "min-h-0 max-h-[40%] shrink-0 overflow-y-auto", "data-og-conversation-inputs": "", children: [
11032
- approvals.length > 0 && !terminal ? /* @__PURE__ */ jsx21(
11033
- ApprovalSurface,
11034
- {
11035
- className: "mx-auto max-w-3xl",
11036
- approvals,
11037
- onApprove: async (approval) => {
11038
- await control.approve(approval.id);
11039
- },
11040
- onReject: async (approval) => {
11041
- await control.reject(approval.id);
11042
- },
11043
- responding: control.responding,
11044
- error: control.error
11045
- }
11046
- ) : null,
11047
- /* @__PURE__ */ jsx21(
11048
- HumanInputSurface,
11232
+ importedArchive ? /* @__PURE__ */ jsx22("p", { className: "shrink-0 px-4 py-2 text-center text-sm text-og-muted", role: "status", children: "Archived conversation \xB7 Read only" }) : /* @__PURE__ */ jsxs17(Fragment9, { children: [
11233
+ /* @__PURE__ */ jsxs17(
11234
+ "div",
11049
11235
  {
11050
- loadSkillReview,
11051
- requests: human.requests,
11052
- onSubmit: async (id, response) => {
11053
- await human.respond(id, response);
11054
- },
11055
- respondingRequestId: human.respondingRequestId,
11056
- error: human.mutationError?.message,
11057
- autoFocus: false
11236
+ className: "min-h-0 max-h-[40%] shrink-0 overflow-y-auto",
11237
+ "data-og-conversation-inputs": "",
11238
+ children: [
11239
+ approvals.length > 0 && !terminal ? /* @__PURE__ */ jsx22(
11240
+ ApprovalSurface,
11241
+ {
11242
+ className: "mx-auto max-w-3xl",
11243
+ approvals,
11244
+ onApprove: async (approval) => {
11245
+ await control.approve(approval.id);
11246
+ },
11247
+ onReject: async (approval) => {
11248
+ await control.reject(approval.id);
11249
+ },
11250
+ responding: control.responding,
11251
+ error: control.error
11252
+ }
11253
+ ) : null,
11254
+ /* @__PURE__ */ jsx22(
11255
+ HumanInputSurface,
11256
+ {
11257
+ loadSkillReview,
11258
+ requests: human.requests,
11259
+ onSubmit: async (id, response) => {
11260
+ await human.respond(id, response);
11261
+ },
11262
+ respondingRequestId: human.respondingRequestId,
11263
+ error: human.mutationError?.message,
11264
+ autoFocus: false
11265
+ }
11266
+ ),
11267
+ terminal ? /* @__PURE__ */ jsx22(SessionChrome, { queue, sessionStatus: status, readOnly: true }) : /* @__PURE__ */ jsx22(
11268
+ SessionChrome,
11269
+ {
11270
+ queue,
11271
+ composer,
11272
+ sessionStatus: status,
11273
+ onComposerFocus: () => region.current?.querySelector("textarea")?.focus()
11274
+ }
11275
+ )
11276
+ ]
11058
11277
  }
11059
11278
  ),
11060
- terminal ? /* @__PURE__ */ jsx21(
11061
- SessionChrome,
11279
+ /* @__PURE__ */ jsx22("div", { className: "shrink-0", "data-og-conversation-composer": "", children: /* @__PURE__ */ jsx22(
11280
+ ChatComposer,
11062
11281
  {
11063
- queue,
11064
- queueFocusTarget,
11065
- sessionStatus: status,
11066
- readOnly: true
11067
- }
11068
- ) : /* @__PURE__ */ jsx21(
11069
- SessionChrome,
11070
- {
11071
- queue,
11072
- queueFocusTarget,
11282
+ ...composerProps,
11073
11283
  composer,
11074
- sessionStatus: status,
11075
- onComposerFocus: () => region.current?.querySelector("textarea")?.focus()
11284
+ attachments: uploadsEnabled ? files : void 0,
11285
+ disabled: terminal || composerProps?.disabled,
11286
+ controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */ jsx22(
11287
+ ModelPolicyPicker,
11288
+ {
11289
+ rows: catalog.rows,
11290
+ model: composer.policy.model,
11291
+ effort: composer.policy.reasoningEffort,
11292
+ latencyMode: composer.policy.latencyMode,
11293
+ loading: catalog.loading,
11294
+ error: catalog.error?.message,
11295
+ disabled: terminal,
11296
+ sessionKey: sessionId,
11297
+ onModelChange: (model) => composer.setModel?.(model),
11298
+ onEffortChange: (effort) => composer.setReasoningEffort?.(effort),
11299
+ onLatencyModeChange: (mode) => composer.setLatencyMode?.(mode)
11300
+ }
11301
+ )),
11302
+ responsiveBasis: composerProps?.responsiveBasis ?? "container",
11303
+ effectiveControl: composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl,
11304
+ queuedAheadCount: queue.queue.length
11076
11305
  }
11077
- )
11078
- ] }),
11079
- /* @__PURE__ */ jsx21("div", { className: "shrink-0", "data-og-conversation-composer": "", children: /* @__PURE__ */ jsx21(
11080
- ChatComposer,
11081
- {
11082
- ...composerProps,
11083
- composer,
11084
- attachments: uploadsEnabled ? files : void 0,
11085
- disabled: terminal || composerProps?.disabled,
11086
- controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */ jsx21(
11087
- ModelPolicyPicker,
11088
- {
11089
- rows: catalog.rows,
11090
- model: composer.policy.model,
11091
- effort: composer.policy.reasoningEffort,
11092
- latencyMode: composer.policy.latencyMode,
11093
- loading: catalog.loading,
11094
- error: catalog.error?.message,
11095
- disabled: terminal,
11096
- sessionKey: sessionId,
11097
- onModelChange: (model) => composer.setModel?.(model),
11098
- onEffortChange: (effort) => composer.setReasoningEffort?.(effort),
11099
- onLatencyModeChange: (mode) => composer.setLatencyMode?.(mode)
11100
- }
11101
- )),
11102
- responsiveBasis: composerProps?.responsiveBasis ?? "container",
11103
- effectiveControl: composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl,
11104
- queuedAheadCount: queue.queue.length
11105
- }
11106
- ) })
11306
+ ) })
11307
+ ] })
11107
11308
  ]
11108
11309
  }
11109
11310
  );
11110
11311
  }
11312
+ var LazyChatInteractiveBlock = lazy5(
11313
+ () => import("./chat-interactive-block-UGBTNB3L.js").then((module) => ({
11314
+ default: module.ChatInteractiveBlock
11315
+ }))
11316
+ );
11317
+ function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
11318
+ const scoped = useMemo7(() => {
11319
+ let resolved = null;
11320
+ const get = () => {
11321
+ const candidate = client;
11322
+ resolved ??= typeof candidate.withHeaders === "function" ? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId }) : candidate;
11323
+ return resolved;
11324
+ };
11325
+ return {
11326
+ getWorkspaceArtifact: (...args) => get().getWorkspaceArtifact(...args),
11327
+ getWorkspaceArtifactHtml: (...args) => get().getWorkspaceArtifactHtml(...args),
11328
+ getWorkspaceArtifactContent: (...args) => {
11329
+ const target = get();
11330
+ if (!target.getWorkspaceArtifactContent) throw new Error("Site version unavailable");
11331
+ return target.getWorkspaceArtifactContent(...args);
11332
+ }
11333
+ };
11334
+ }, [client, sessionId]);
11335
+ return useCallback5(
11336
+ (block) => /* @__PURE__ */ jsx22(Suspense6, { fallback: /* @__PURE__ */ jsx22("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx22(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
11337
+ [scoped, workspaceId]
11338
+ );
11339
+ }
11111
11340
  function useClientConfigFlags(client) {
11112
- const [flags, setFlags] = useState16({ uploads: false, modelSelection: true, sandboxFiles: false });
11113
- useEffect11(() => {
11341
+ const [flags, setFlags] = useState17({ uploads: false, modelSelection: true, sandboxFiles: false });
11342
+ useEffect12(() => {
11114
11343
  let live = true;
11115
11344
  client.getClientConfig().then(
11116
11345
  (config) => {
@@ -11132,7 +11361,7 @@ function useClientConfigFlags(client) {
11132
11361
  }
11133
11362
 
11134
11363
  // src/hooks/use-workspace-sessions.ts
11135
- import { useCallback as useCallback5, useEffect as useEffect12, useRef as useRef12 } from "react";
11364
+ import { useCallback as useCallback6, useEffect as useEffect13, useRef as useRef12 } from "react";
11136
11365
  function useWorkspaceSessions(options = {}) {
11137
11366
  const { client, workspaceId } = useOpenGeni(options);
11138
11367
  const limit = options.limit;
@@ -11160,10 +11389,10 @@ function useWorkspaceSessions(options = {}) {
11160
11389
  ].join("\0");
11161
11390
  const previousQueryKey = useRef12(queryKey);
11162
11391
  const queryKeyTransition = previousQueryKey.current !== queryKey;
11163
- useEffect12(() => {
11392
+ useEffect13(() => {
11164
11393
  previousQueryKey.current = queryKey;
11165
11394
  }, [queryKey]);
11166
- const load = useCallback5(
11395
+ const load = useCallback6(
11167
11396
  async (signal) => {
11168
11397
  const readGeneration = beginRead?.() ?? ++nextReadGeneration.current;
11169
11398
  const page2 = await client.listSessionPage(workspaceId, {
@@ -11229,8 +11458,8 @@ function useWorkspaceSessions(options = {}) {
11229
11458
  // src/components/session-list.tsx
11230
11459
  import { deriveSessionDisplayTitle } from "@opengeni/sdk";
11231
11460
  import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
11232
- import { useEffect as useEffect13, useRef as useRef13, useState as useState17 } from "react";
11233
- import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
11461
+ import { useEffect as useEffect14, useRef as useRef13, useState as useState18 } from "react";
11462
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
11234
11463
  var DEFAULT_LABELS = {
11235
11464
  heading: "Chats",
11236
11465
  newChat: "New chat",
@@ -11259,7 +11488,7 @@ function SessionList({
11259
11488
  const labels = { ...DEFAULT_LABELS, ...labelOverrides };
11260
11489
  const scope = { client, workspaceId };
11261
11490
  const context = useOpenGeni(scope);
11262
- const [limit, setLimit] = useState17(pageSize);
11491
+ const [limit, setLimit] = useState18(pageSize);
11263
11492
  const list = useWorkspaceSessions({
11264
11493
  ...scope,
11265
11494
  parentSessionId: null,
@@ -11269,14 +11498,14 @@ function SessionList({
11269
11498
  });
11270
11499
  const refresh = list.refresh;
11271
11500
  const firstRefreshKey = useRef13(refreshKey);
11272
- useEffect13(() => {
11501
+ useEffect14(() => {
11273
11502
  if (Object.is(refreshKey, firstRefreshKey.current)) return;
11274
11503
  firstRefreshKey.current = refreshKey;
11275
11504
  void refresh();
11276
11505
  }, [refresh, refreshKey]);
11277
- const [editing, setEditing] = useState17(null);
11278
- const [busy, setBusy] = useState17(null);
11279
- const [error, setError] = useState17(null);
11506
+ const [editing, setEditing] = useState18(null);
11507
+ const [busy, setBusy] = useState18(null);
11508
+ const [error, setError] = useState18(null);
11280
11509
  const archiveClient = context.client;
11281
11510
  const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
11282
11511
  const run = async (id, action) => {
@@ -11310,16 +11539,16 @@ function SessionList({
11310
11539
  onArchived?.(session.id);
11311
11540
  });
11312
11541
  const sessions = list.sessions;
11313
- return /* @__PURE__ */ jsxs17(
11542
+ return /* @__PURE__ */ jsxs18(
11314
11543
  "nav",
11315
11544
  {
11316
11545
  className: cn("flex min-h-0 min-w-0 flex-col gap-1 text-og-fg", className),
11317
11546
  "aria-label": labels.heading,
11318
11547
  "data-og-session-list": "",
11319
11548
  children: [
11320
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
11321
- /* @__PURE__ */ jsx22("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
11322
- onNewChat ? /* @__PURE__ */ jsxs17(
11549
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
11550
+ /* @__PURE__ */ jsx23("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
11551
+ onNewChat ? /* @__PURE__ */ jsxs18(
11323
11552
  "button",
11324
11553
  {
11325
11554
  type: "button",
@@ -11327,22 +11556,22 @@ function SessionList({
11327
11556
  className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-og-control text-og-fg hover:bg-og-surface-2",
11328
11557
  "data-og-new-chat": "",
11329
11558
  children: [
11330
- /* @__PURE__ */ jsx22(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
11559
+ /* @__PURE__ */ jsx23(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
11331
11560
  labels.newChat
11332
11561
  ]
11333
11562
  }
11334
11563
  ) : null
11335
11564
  ] }),
11336
- error ? /* @__PURE__ */ jsx22("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: error }) : null,
11337
- /* @__PURE__ */ jsxs17("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
11338
- list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx22("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
11339
- !list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx22("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
11565
+ error ? /* @__PURE__ */ jsx23("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: error }) : null,
11566
+ /* @__PURE__ */ jsxs18("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
11567
+ list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx23("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
11568
+ !list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx23("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
11340
11569
  sessions.map((session) => {
11341
11570
  const selected = session.id === selectedSessionId;
11342
11571
  const title = deriveSessionDisplayTitle(session);
11343
11572
  if (editing?.id === session.id) {
11344
- return /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs17("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
11345
- /* @__PURE__ */ jsx22(
11573
+ return /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs18("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
11574
+ /* @__PURE__ */ jsx23(
11346
11575
  "input",
11347
11576
  {
11348
11577
  "aria-label": labels.rename,
@@ -11356,7 +11585,7 @@ function SessionList({
11356
11585
  className: "min-w-0 flex-1 rounded-md border border-og-border bg-og-bg px-2 py-1 text-og-sm text-og-fg"
11357
11586
  }
11358
11587
  ),
11359
- /* @__PURE__ */ jsx22(
11588
+ /* @__PURE__ */ jsx23(
11360
11589
  "button",
11361
11590
  {
11362
11591
  type: "submit",
@@ -11366,8 +11595,8 @@ function SessionList({
11366
11595
  )
11367
11596
  ] }) }, session.id);
11368
11597
  }
11369
- return /* @__PURE__ */ jsxs17("li", { className: "group relative", children: [
11370
- /* @__PURE__ */ jsxs17(
11598
+ return /* @__PURE__ */ jsxs18("li", { className: "group relative", children: [
11599
+ /* @__PURE__ */ jsxs18(
11371
11600
  "button",
11372
11601
  {
11373
11602
  type: "button",
@@ -11380,36 +11609,36 @@ function SessionList({
11380
11609
  ),
11381
11610
  "data-og-session-row": "",
11382
11611
  children: [
11383
- /* @__PURE__ */ jsx22("span", { className: "w-full truncate pr-12 text-og-sm text-og-fg", children: title }),
11384
- /* @__PURE__ */ jsx22("span", { className: "text-og-xs text-og-fg-subtle", children: formatRelativeTime(session.updatedAt) })
11612
+ /* @__PURE__ */ jsx23("span", { className: "w-full truncate pr-12 text-og-sm text-og-fg", children: title }),
11613
+ /* @__PURE__ */ jsx23("span", { className: "text-og-xs text-og-fg-subtle", children: formatRelativeTime(session.updatedAt) })
11385
11614
  ]
11386
11615
  }
11387
11616
  ),
11388
- /* @__PURE__ */ jsxs17("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
11389
- rename ? /* @__PURE__ */ jsx22(
11617
+ /* @__PURE__ */ jsxs18("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
11618
+ rename ? /* @__PURE__ */ jsx23(
11390
11619
  "button",
11391
11620
  {
11392
11621
  type: "button",
11393
11622
  "aria-label": `${labels.rename}: ${title}`,
11394
11623
  onClick: () => setEditing({ id: session.id, title: session.title ?? title }),
11395
11624
  className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
11396
- children: /* @__PURE__ */ jsx22(PencilIcon2, { className: "size-3.5", "aria-hidden": true })
11625
+ children: /* @__PURE__ */ jsx23(PencilIcon2, { className: "size-3.5", "aria-hidden": true })
11397
11626
  }
11398
11627
  ) : null,
11399
- canArchive ? /* @__PURE__ */ jsx22(
11628
+ canArchive ? /* @__PURE__ */ jsx23(
11400
11629
  "button",
11401
11630
  {
11402
11631
  type: "button",
11403
11632
  "aria-label": `${labels.archive}: ${title}`,
11404
11633
  onClick: () => archiveSession(session),
11405
11634
  className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
11406
- children: /* @__PURE__ */ jsx22(ArchiveIcon, { className: "size-3.5", "aria-hidden": true })
11635
+ children: /* @__PURE__ */ jsx23(ArchiveIcon, { className: "size-3.5", "aria-hidden": true })
11407
11636
  }
11408
11637
  ) : null
11409
11638
  ] })
11410
11639
  ] }, session.id);
11411
11640
  }),
11412
- list.nextCursor ? /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsx22(
11641
+ list.nextCursor ? /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsx23(
11413
11642
  "button",
11414
11643
  {
11415
11644
  type: "button",
@@ -11426,8 +11655,8 @@ function SessionList({
11426
11655
 
11427
11656
  // src/components/open-geni-chat.tsx
11428
11657
  import { MenuIcon, SendIcon, XIcon as XIcon3 } from "lucide-react";
11429
- import { useCallback as useCallback6, useRef as useRef14, useState as useState18 } from "react";
11430
- import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
11658
+ import { useCallback as useCallback7, useRef as useRef14, useState as useState19 } from "react";
11659
+ import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
11431
11660
  var DEFAULT_LABELS2 = {
11432
11661
  openChats: "Open chats",
11433
11662
  closeChats: "Close chats",
@@ -11452,11 +11681,11 @@ function OpenGeniChat({
11452
11681
  const labels = { ...DEFAULT_LABELS2, ...labelOverrides };
11453
11682
  const scope = { client, workspaceId };
11454
11683
  const context = useOpenGeni(scope);
11455
- const [uncontrolled, setUncontrolled] = useState18(defaultSessionId);
11684
+ const [uncontrolled, setUncontrolled] = useState19(defaultSessionId);
11456
11685
  const selected = controlledSessionId !== void 0 ? controlledSessionId : uncontrolled;
11457
- const [drawerOpen, setDrawerOpen] = useState18(false);
11458
- const [listRevision, setListRevision] = useState18(0);
11459
- const select = useCallback6(
11686
+ const [drawerOpen, setDrawerOpen] = useState19(false);
11687
+ const [listRevision, setListRevision] = useState19(0);
11688
+ const select = useCallback7(
11460
11689
  (next) => {
11461
11690
  if (controlledSessionId === void 0) setUncontrolled(next);
11462
11691
  onSessionChange?.(next);
@@ -11464,7 +11693,7 @@ function OpenGeniChat({
11464
11693
  },
11465
11694
  [controlledSessionId, onSessionChange]
11466
11695
  );
11467
- const create = useCallback6(
11696
+ const create = useCallback7(
11468
11697
  async (initialMessage, idempotencyKey) => {
11469
11698
  if (createSession) return await createSession(initialMessage, idempotencyKey);
11470
11699
  const creator = context.client.createSession;
@@ -11477,7 +11706,7 @@ function OpenGeniChat({
11477
11706
  },
11478
11707
  [context.client, context.workspaceId, createSession, labels.newChatUnavailable]
11479
11708
  );
11480
- const list = /* @__PURE__ */ jsx23(
11709
+ const list = /* @__PURE__ */ jsx24(
11481
11710
  SessionList,
11482
11711
  {
11483
11712
  ...scope,
@@ -11493,14 +11722,14 @@ function OpenGeniChat({
11493
11722
  className: "h-full"
11494
11723
  }
11495
11724
  );
11496
- return /* @__PURE__ */ jsxs18(
11725
+ return /* @__PURE__ */ jsxs19(
11497
11726
  "div",
11498
11727
  {
11499
11728
  className: cn("og-root og-chat relative flex min-h-0 min-w-0 bg-og-bg text-og-fg", className),
11500
11729
  style: { height },
11501
11730
  "data-og-chat": "",
11502
11731
  children: [
11503
- /* @__PURE__ */ jsx23(
11732
+ /* @__PURE__ */ jsx24(
11504
11733
  "aside",
11505
11734
  {
11506
11735
  className: "og-chat-sidebar min-h-0 w-64 shrink-0 flex-col border-r border-og-border",
@@ -11508,21 +11737,21 @@ function OpenGeniChat({
11508
11737
  children: list
11509
11738
  }
11510
11739
  ),
11511
- drawerOpen ? /* @__PURE__ */ jsxs18("div", { className: "og-chat-drawer absolute inset-0 z-20 flex", "data-og-chat-drawer": "", children: [
11512
- /* @__PURE__ */ jsxs18("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-xl", children: [
11513
- /* @__PURE__ */ jsx23("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx23(
11740
+ drawerOpen ? /* @__PURE__ */ jsxs19("div", { className: "og-chat-drawer absolute inset-0 z-20 flex", "data-og-chat-drawer": "", children: [
11741
+ /* @__PURE__ */ jsxs19("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-xl", children: [
11742
+ /* @__PURE__ */ jsx24("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx24(
11514
11743
  "button",
11515
11744
  {
11516
11745
  type: "button",
11517
11746
  "aria-label": labels.closeChats,
11518
11747
  onClick: () => setDrawerOpen(false),
11519
11748
  className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
11520
- children: /* @__PURE__ */ jsx23(XIcon3, { className: "size-4", "aria-hidden": true })
11749
+ children: /* @__PURE__ */ jsx24(XIcon3, { className: "size-4", "aria-hidden": true })
11521
11750
  }
11522
11751
  ) }),
11523
- /* @__PURE__ */ jsx23("div", { className: "min-h-0 flex-1", children: list })
11752
+ /* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: list })
11524
11753
  ] }),
11525
- /* @__PURE__ */ jsx23(
11754
+ /* @__PURE__ */ jsx24(
11526
11755
  "button",
11527
11756
  {
11528
11757
  type: "button",
@@ -11532,9 +11761,9 @@ function OpenGeniChat({
11532
11761
  }
11533
11762
  )
11534
11763
  ] }) : null,
11535
- /* @__PURE__ */ jsxs18("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
11536
- /* @__PURE__ */ jsxs18("div", { className: "og-chat-menu flex items-center gap-2 border-b border-og-border px-2 py-1", children: [
11537
- /* @__PURE__ */ jsx23(
11764
+ /* @__PURE__ */ jsxs19("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
11765
+ /* @__PURE__ */ jsxs19("div", { className: "og-chat-menu flex items-center gap-2 border-b border-og-border px-2 py-1", children: [
11766
+ /* @__PURE__ */ jsx24(
11538
11767
  "button",
11539
11768
  {
11540
11769
  type: "button",
@@ -11543,12 +11772,12 @@ function OpenGeniChat({
11543
11772
  onClick: () => setDrawerOpen(true),
11544
11773
  className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
11545
11774
  "data-og-chat-menu": "",
11546
- children: /* @__PURE__ */ jsx23(MenuIcon, { className: "size-4", "aria-hidden": true })
11775
+ children: /* @__PURE__ */ jsx24(MenuIcon, { className: "size-4", "aria-hidden": true })
11547
11776
  }
11548
11777
  ),
11549
- /* @__PURE__ */ jsx23("span", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading })
11778
+ /* @__PURE__ */ jsx24("span", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading })
11550
11779
  ] }),
11551
- /* @__PURE__ */ jsx23("div", { className: "min-h-0 flex-1 px-3 pb-3 pt-1", children: selected ? /* @__PURE__ */ jsx23(
11780
+ /* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1 px-3 pb-3 pt-1", children: selected ? /* @__PURE__ */ jsx24(
11552
11781
  SessionConversation,
11553
11782
  {
11554
11783
  ...conversationProps,
@@ -11556,7 +11785,7 @@ function OpenGeniChat({
11556
11785
  sessionId: selected,
11557
11786
  height: "100%"
11558
11787
  }
11559
- ) : /* @__PURE__ */ jsx23(
11788
+ ) : /* @__PURE__ */ jsx24(
11560
11789
  NewChat,
11561
11790
  {
11562
11791
  labels,
@@ -11577,9 +11806,9 @@ function NewChat({
11577
11806
  create,
11578
11807
  onCreated
11579
11808
  }) {
11580
- const [text, setText] = useState18("");
11581
- const [sending, setSending] = useState18(false);
11582
- const [error, setError] = useState18(null);
11809
+ const [text, setText] = useState19("");
11810
+ const [sending, setSending] = useState19(false);
11811
+ const [error, setError] = useState19(null);
11583
11812
  const idempotencyKey = useRef14(crypto.randomUUID());
11584
11813
  const submit = async (event) => {
11585
11814
  event.preventDefault();
@@ -11598,16 +11827,16 @@ function NewChat({
11598
11827
  setSending(false);
11599
11828
  }
11600
11829
  };
11601
- return /* @__PURE__ */ jsxs18(
11830
+ return /* @__PURE__ */ jsxs19(
11602
11831
  "form",
11603
11832
  {
11604
11833
  onSubmit: (event) => void submit(event),
11605
11834
  className: "flex h-full flex-col justify-end gap-2 p-3",
11606
11835
  "data-og-new-chat-composer": "",
11607
11836
  children: [
11608
- error ? /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null,
11609
- /* @__PURE__ */ jsxs18("div", { className: "flex items-end gap-2 rounded-lg border border-og-border bg-og-surface-1 p-2", children: [
11610
- /* @__PURE__ */ jsx23(
11837
+ error ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null,
11838
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-end gap-2 rounded-lg border border-og-border bg-og-surface-1 p-2", children: [
11839
+ /* @__PURE__ */ jsx24(
11611
11840
  "textarea",
11612
11841
  {
11613
11842
  value: text,
@@ -11625,14 +11854,14 @@ function NewChat({
11625
11854
  className: "min-h-10 flex-1 resize-none bg-transparent text-og-base text-og-fg outline-hidden placeholder:text-og-fg-subtle"
11626
11855
  }
11627
11856
  ),
11628
- /* @__PURE__ */ jsx23(
11857
+ /* @__PURE__ */ jsx24(
11629
11858
  "button",
11630
11859
  {
11631
11860
  type: "submit",
11632
11861
  "aria-label": labels.send,
11633
11862
  disabled: sending || !text.trim(),
11634
11863
  className: "rounded-md bg-og-accent p-2 text-og-accent-fg disabled:opacity-50",
11635
- children: /* @__PURE__ */ jsx23(SendIcon, { className: "size-4", "aria-hidden": true })
11864
+ children: /* @__PURE__ */ jsx24(SendIcon, { className: "size-4", "aria-hidden": true })
11636
11865
  }
11637
11866
  )
11638
11867
  ] })
@@ -11643,14 +11872,14 @@ function NewChat({
11643
11872
 
11644
11873
  // src/components/session-commands-panel.tsx
11645
11874
  import { ChevronRightIcon as ChevronRightIcon3, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
11646
- import { useState as useState19 } from "react";
11647
- import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
11875
+ import { useState as useState20 } from "react";
11876
+ import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
11648
11877
  function SessionCommandsPanel({
11649
11878
  commands: state,
11650
11879
  readOnly = false
11651
11880
  }) {
11652
- const [pending, setPending] = useState19(null);
11653
- const [error, setError] = useState19(null);
11881
+ const [pending, setPending] = useState20(null);
11882
+ const [error, setError] = useState20(null);
11654
11883
  const active = state.commands.filter(
11655
11884
  (command) => command.state === "running" || command.state === "stopping"
11656
11885
  );
@@ -11665,11 +11894,11 @@ function SessionCommandsPanel({
11665
11894
  setPending(null);
11666
11895
  }
11667
11896
  };
11668
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
11669
- state.loading && active.length === 0 ? /* @__PURE__ */ jsx24("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
11670
- state.error ? /* @__PURE__ */ jsxs19("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
11671
- /* @__PURE__ */ jsx24("span", { children: "Commands unavailable." }),
11672
- /* @__PURE__ */ jsx24(
11897
+ return /* @__PURE__ */ jsxs20("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
11898
+ state.loading && active.length === 0 ? /* @__PURE__ */ jsx25("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
11899
+ state.error ? /* @__PURE__ */ jsxs20("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
11900
+ /* @__PURE__ */ jsx25("span", { children: "Commands unavailable." }),
11901
+ /* @__PURE__ */ jsx25(
11673
11902
  "button",
11674
11903
  {
11675
11904
  type: "button",
@@ -11679,18 +11908,18 @@ function SessionCommandsPanel({
11679
11908
  }
11680
11909
  )
11681
11910
  ] }) : null,
11682
- !state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx24("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
11683
- active.length > 0 ? /* @__PURE__ */ jsx24("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs19("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
11684
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
11685
- /* @__PURE__ */ jsxs19("details", { className: "group/command", children: [
11686
- /* @__PURE__ */ jsxs19(
11911
+ !state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx25("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
11912
+ active.length > 0 ? /* @__PURE__ */ jsx25("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs20("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
11913
+ /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
11914
+ /* @__PURE__ */ jsxs20("details", { className: "group/command", children: [
11915
+ /* @__PURE__ */ jsxs20(
11687
11916
  "summary",
11688
11917
  {
11689
11918
  className: "flex cursor-pointer list-none items-center gap-1.5 rounded-og-sm font-mono text-og-fg outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
11690
11919
  title: "Expand command",
11691
11920
  children: [
11692
- /* @__PURE__ */ jsx24(ChevronRightIcon3, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
11693
- /* @__PURE__ */ jsx24(
11921
+ /* @__PURE__ */ jsx25(ChevronRightIcon3, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
11922
+ /* @__PURE__ */ jsx25(
11694
11923
  "span",
11695
11924
  {
11696
11925
  className: "min-w-0 truncate",
@@ -11701,9 +11930,9 @@ function SessionCommandsPanel({
11701
11930
  ]
11702
11931
  }
11703
11932
  ),
11704
- /* @__PURE__ */ jsxs19("div", { className: "mt-2 space-y-1", children: [
11705
- /* @__PURE__ */ jsx24("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
11706
- /* @__PURE__ */ jsxs19(
11933
+ /* @__PURE__ */ jsxs20("div", { className: "mt-2 space-y-1", children: [
11934
+ /* @__PURE__ */ jsx25("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
11935
+ /* @__PURE__ */ jsxs20(
11707
11936
  "time",
11708
11937
  {
11709
11938
  className: "block text-og-fg-subtle",
@@ -11717,9 +11946,9 @@ function SessionCommandsPanel({
11717
11946
  )
11718
11947
  ] })
11719
11948
  ] }),
11720
- /* @__PURE__ */ jsx24("p", { className: "mt-1 text-og-fg-subtle", children: command.observationStatus === "unavailable" ? command.state === "stopping" ? "Stop requested \xB7 status unavailable" : "Command status unavailable" : command.state === "stopping" ? "Stopping\u2026" : "Running" })
11949
+ /* @__PURE__ */ jsx25("p", { className: "mt-1 text-og-fg-subtle", children: command.observationStatus === "unavailable" ? command.state === "stopping" ? "Stop requested \xB7 status unavailable" : "Command status unavailable" : command.state === "stopping" ? "Stopping\u2026" : "Running" })
11721
11950
  ] }),
11722
- !readOnly ? /* @__PURE__ */ jsxs19(
11951
+ !readOnly ? /* @__PURE__ */ jsxs20(
11723
11952
  "button",
11724
11953
  {
11725
11954
  type: "button",
@@ -11728,22 +11957,22 @@ function SessionCommandsPanel({
11728
11957
  onClick: () => void stop(command.id),
11729
11958
  className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm px-2 text-og-fg-muted outline-hidden hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50 pointer-coarse:min-h-11",
11730
11959
  children: [
11731
- pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx24(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx24(SquareIcon, { className: "size-3" }),
11960
+ pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx25(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx25(SquareIcon, { className: "size-3" }),
11732
11961
  "Stop"
11733
11962
  ]
11734
11963
  }
11735
11964
  ) : null
11736
11965
  ] }, command.id)) }) : null,
11737
- error ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-og-danger", children: error }) : null
11966
+ error ? /* @__PURE__ */ jsx25("p", { role: "alert", className: "text-og-danger", children: error }) : null
11738
11967
  ] });
11739
11968
  }
11740
11969
 
11741
11970
  // src/hooks/use-session-background-commands.ts
11742
- import { useCallback as useCallback7, useEffect as useEffect14, useRef as useRef15 } from "react";
11971
+ import { useCallback as useCallback8, useEffect as useEffect15, useRef as useRef15 } from "react";
11743
11972
  function useSessionBackgroundCommands(sessionId, options = {}) {
11744
11973
  const { client, workspaceId } = useOpenGeni(options);
11745
11974
  const enabled = (options.enabled ?? true) && Boolean(sessionId);
11746
- const load = useCallback7(
11975
+ const load = useCallback8(
11747
11976
  async (signal) => {
11748
11977
  if (!sessionId) return { commands: [] };
11749
11978
  if (!client.listSessionBackgroundCommands) {
@@ -11759,13 +11988,13 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
11759
11988
  });
11760
11989
  const refresh = state.refresh;
11761
11990
  const generation = useRef15(0);
11762
- useEffect14(() => {
11991
+ useEffect15(() => {
11763
11992
  generation.current += 1;
11764
11993
  return () => {
11765
11994
  generation.current += 1;
11766
11995
  };
11767
11996
  }, [client, workspaceId, sessionId, enabled]);
11768
- const cancel = useCallback7(
11997
+ const cancel = useCallback8(
11769
11998
  async (commandId) => {
11770
11999
  if (!sessionId) return;
11771
12000
  if (!client.cancelSessionBackgroundCommand) {
@@ -11787,7 +12016,7 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
11787
12016
  }
11788
12017
 
11789
12018
  // src/components/session-commands.tsx
11790
- import { jsx as jsx25 } from "react/jsx-runtime";
12019
+ import { jsx as jsx26 } from "react/jsx-runtime";
11791
12020
  function SessionCommands({
11792
12021
  sessionId,
11793
12022
  readOnly = false,
@@ -11797,11 +12026,11 @@ function SessionCommands({
11797
12026
  pollIntervalMs: 3e3,
11798
12027
  ...options
11799
12028
  });
11800
- return /* @__PURE__ */ jsx25(SessionCommandsPanel, { commands, readOnly });
12029
+ return /* @__PURE__ */ jsx26(SessionCommandsPanel, { commands, readOnly });
11801
12030
  }
11802
12031
 
11803
12032
  // src/timeline/startup-timings.tsx
11804
- import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
12033
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
11805
12034
  var LABELS = {
11806
12035
  queue: "Worker queue",
11807
12036
  sandbox: "Sandbox",
@@ -11814,7 +12043,7 @@ var LABELS = {
11814
12043
  };
11815
12044
  function StartupTimings({ phases }) {
11816
12045
  if (!phases.length)
11817
- return /* @__PURE__ */ jsx26("p", { className: "text-og-sm text-og-fg-subtle", children: "No startup timings recorded yet." });
12046
+ return /* @__PURE__ */ jsx27("p", { className: "text-og-sm text-og-fg-subtle", children: "No startup timings recorded yet." });
11818
12047
  const byTurn = /* @__PURE__ */ new Map();
11819
12048
  for (const phase of phases) {
11820
12049
  const group = byTurn.get(phase.turnId) ?? [];
@@ -11829,9 +12058,9 @@ function StartupTimings({ phases }) {
11829
12058
  turnPhases[0].startedAt
11830
12059
  )
11831
12060
  })).sort((a, b) => b.startedAt.localeCompare(a.startedAt));
11832
- return /* @__PURE__ */ jsxs20("div", { className: "space-y-3", children: [
11833
- /* @__PURE__ */ jsx26("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
11834
- turns.map((turn, index) => /* @__PURE__ */ jsx26(
12061
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
12062
+ /* @__PURE__ */ jsx27("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
12063
+ turns.map((turn, index) => /* @__PURE__ */ jsx27(
11835
12064
  StartupTurn,
11836
12065
  {
11837
12066
  ...turn,
@@ -11848,53 +12077,53 @@ function StartupTurn({
11848
12077
  latest
11849
12078
  }) {
11850
12079
  const status = phases.some((phase) => phase.status === "failed") ? "Failed" : phases.some((phase) => phase.status === "running") ? "In progress" : phases.some((phase) => phase.status === "cancelled") ? "Interrupted" : "Ready";
11851
- return /* @__PURE__ */ jsxs20("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
11852
- /* @__PURE__ */ jsxs20("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
11853
- /* @__PURE__ */ jsx26("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
11854
- /* @__PURE__ */ jsx26("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
12080
+ return /* @__PURE__ */ jsxs21("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
12081
+ /* @__PURE__ */ jsxs21("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
12082
+ /* @__PURE__ */ jsx27("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
12083
+ /* @__PURE__ */ jsx27("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
11855
12084
  hour: "2-digit",
11856
12085
  minute: "2-digit",
11857
12086
  second: "2-digit"
11858
12087
  }) }),
11859
- /* @__PURE__ */ jsx26(
12088
+ /* @__PURE__ */ jsx27(
11860
12089
  "span",
11861
12090
  {
11862
12091
  className: status === "Failed" ? "ml-2 text-og-xs text-og-status-failed" : "ml-2 text-og-xs text-og-fg-subtle",
11863
12092
  children: status
11864
12093
  }
11865
12094
  ),
11866
- /* @__PURE__ */ jsx26("span", { className: "mt-1 block break-all pl-4 font-og-mono text-og-xs text-og-fg-subtle", children: turnId ?? "No turn ID recorded" })
12095
+ /* @__PURE__ */ jsx27("span", { className: "mt-1 block break-all pl-4 font-og-mono text-og-xs text-og-fg-subtle", children: turnId ?? "No turn ID recorded" })
11867
12096
  ] }),
11868
- /* @__PURE__ */ jsxs20("div", { className: "pb-2", children: [
11869
- /* @__PURE__ */ jsxs20("p", { className: "text-og-xs text-og-fg-subtle", children: [
12097
+ /* @__PURE__ */ jsxs21("div", { className: "pb-2", children: [
12098
+ /* @__PURE__ */ jsxs21("p", { className: "text-og-xs text-og-fg-subtle", children: [
11870
12099
  "Started ",
11871
- /* @__PURE__ */ jsx26("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
12100
+ /* @__PURE__ */ jsx27("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
11872
12101
  ] }),
11873
- /* @__PURE__ */ jsx26("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs20("table", { className: "w-full text-left text-og-xs", children: [
11874
- /* @__PURE__ */ jsxs20("caption", { className: "sr-only", children: [
12102
+ /* @__PURE__ */ jsx27("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs21("table", { className: "w-full text-left text-og-xs", children: [
12103
+ /* @__PURE__ */ jsxs21("caption", { className: "sr-only", children: [
11875
12104
  "Startup phases for ",
11876
12105
  turnId ?? "unassigned events"
11877
12106
  ] }),
11878
- /* @__PURE__ */ jsx26("thead", { children: /* @__PURE__ */ jsxs20("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
11879
- /* @__PURE__ */ jsx26("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
11880
- /* @__PURE__ */ jsx26("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
11881
- /* @__PURE__ */ jsx26("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
12107
+ /* @__PURE__ */ jsx27("thead", { children: /* @__PURE__ */ jsxs21("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
12108
+ /* @__PURE__ */ jsx27("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
12109
+ /* @__PURE__ */ jsx27("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
12110
+ /* @__PURE__ */ jsx27("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
11882
12111
  ] }) }),
11883
- /* @__PURE__ */ jsx26("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs20(
12112
+ /* @__PURE__ */ jsx27("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs21(
11884
12113
  "tr",
11885
12114
  {
11886
12115
  className: "border-b border-og-border/40",
11887
12116
  title: `Turn: ${phase.turnId ?? "unknown"} \xB7 Started: ${phase.startedAt}`,
11888
12117
  children: [
11889
- /* @__PURE__ */ jsx26("th", { scope: "row", className: "py-2.5 font-normal text-og-fg-muted", children: LABELS[phase.phase] }),
11890
- /* @__PURE__ */ jsx26(
12118
+ /* @__PURE__ */ jsx27("th", { scope: "row", className: "py-2.5 font-normal text-og-fg-muted", children: LABELS[phase.phase] }),
12119
+ /* @__PURE__ */ jsx27(
11891
12120
  "td",
11892
12121
  {
11893
12122
  className: `px-3 py-2.5 ${phase.status === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"}`,
11894
12123
  children: phase.status === "running" ? "In progress" : phase.status
11895
12124
  }
11896
12125
  ),
11897
- /* @__PURE__ */ jsx26("td", { className: "py-2.5 text-right font-og-mono tabular-nums text-og-fg-muted", children: phase.durationMs === null ? "\u2014" : phase.durationMs < 1e3 ? `${Math.round(phase.durationMs)} ms` : `${(phase.durationMs / 1e3).toFixed(1)} s` })
12126
+ /* @__PURE__ */ jsx27("td", { className: "py-2.5 text-right font-og-mono tabular-nums text-og-fg-muted", children: phase.durationMs === null ? "\u2014" : phase.durationMs < 1e3 ? `${Math.round(phase.durationMs)} ms` : `${(phase.durationMs / 1e3).toFixed(1)} s` })
11898
12127
  ]
11899
12128
  },
11900
12129
  phase.id
@@ -11963,4 +12192,4 @@ export {
11963
12192
  SessionCommands,
11964
12193
  StartupTimings
11965
12194
  };
11966
- //# sourceMappingURL=chunk-L4OSXQ6H.js.map
12195
+ //# sourceMappingURL=chunk-NBOHNRLJ.js.map