@opengeni/react 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +21 -1
  2. package/dist/artifacts.js +2 -2
  3. package/dist/artifacts.js.map +1 -1
  4. package/dist/{chunk-ERGYJIBB.js → chunk-AWZLIMKX.js} +2 -2
  5. package/dist/{chunk-ERGYJIBB.js.map → chunk-AWZLIMKX.js.map} +1 -1
  6. package/dist/{chunk-FZCP527Y.js → chunk-CJUO7J5Z.js} +2 -2
  7. package/dist/{chunk-742CZ3L3.js → chunk-H5X55XH7.js} +16 -200
  8. package/dist/chunk-H5X55XH7.js.map +1 -0
  9. package/dist/{chunk-PGSX7UCP.js → chunk-LJ2UTJJE.js} +1369 -785
  10. package/dist/chunk-LJ2UTJJE.js.map +1 -0
  11. package/dist/{chunk-CY7WK5FD.js → chunk-LN6TCXD3.js} +22 -1
  12. package/dist/chunk-LN6TCXD3.js.map +1 -0
  13. package/dist/{chunk-TMYGL6X5.js → chunk-MBMPHOMA.js} +71 -6
  14. package/dist/chunk-MBMPHOMA.js.map +1 -0
  15. package/dist/{chunk-RC6BZ44Q.js → chunk-OA6HFRQP.js} +2 -2
  16. package/dist/{chunk-WWEUO2PL.js → chunk-WZMYFJD3.js} +190 -11
  17. package/dist/chunk-WZMYFJD3.js.map +1 -0
  18. package/dist/components/composer-transcription-control.d.ts +3 -0
  19. package/dist/components/open-geni-chat.d.ts +6 -2
  20. package/dist/components/session-conversation.d.ts +25 -19
  21. package/dist/components/session-list.d.ts +4 -1
  22. package/dist/components/tool-action-review.d.ts +29 -2
  23. package/dist/components/tool-review-history.d.ts +8 -4
  24. package/dist/composer.js +1 -1
  25. package/dist/connect.js +1 -1
  26. package/dist/hooks/use-client-config-flags.d.ts +37 -0
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +21 -11
  29. package/dist/index.js.map +1 -1
  30. package/dist/{latest-question-YTOBHCWR.js → latest-question-GPYM2JNU.js} +3 -3
  31. package/dist/realtime/realtime-control.d.ts +2 -0
  32. package/dist/realtime.js +25 -4
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/session-capability-policy.d.ts +20 -1
  35. package/dist/session-ui.js +6 -6
  36. package/dist/session.js +6 -6
  37. package/dist/timeline/index.d.ts +2 -0
  38. package/dist/timeline/retained-loaders.d.ts +27 -0
  39. package/package.json +3 -3
  40. package/src/components/approval-surface.tsx +190 -79
  41. package/src/components/artifacts/session-artifact-viewer.tsx +4 -2
  42. package/src/components/composer-transcription-control.tsx +14 -0
  43. package/src/components/composer.tsx +1 -0
  44. package/src/components/open-geni-chat.tsx +53 -13
  45. package/src/components/session-conversation.tsx +229 -63
  46. package/src/components/session-list.tsx +9 -2
  47. package/src/components/tool-action-review.tsx +502 -239
  48. package/src/components/tool-review-history.tsx +18 -43
  49. package/src/hooks/use-client-config-flags.ts +102 -0
  50. package/src/hooks/use-session-events.ts +19 -16
  51. package/src/hooks/use-transcription.ts +6 -0
  52. package/src/hooks/use-voice-input.ts +6 -0
  53. package/src/index.ts +9 -0
  54. package/src/realtime/realtime-control.tsx +28 -1
  55. package/src/session-capability-policy.ts +119 -6
  56. package/src/timeline/index.ts +10 -0
  57. package/src/timeline/retained-loaders.ts +86 -0
  58. package/src/timeline/tool-display-name.ts +5 -1
  59. package/src/timeline/tool-renderers.tsx +143 -10
  60. package/styles/compiled.css +65 -21
  61. package/styles/tokens.css +1 -1
  62. package/dist/chunk-742CZ3L3.js.map +0 -1
  63. package/dist/chunk-CY7WK5FD.js.map +0 -1
  64. package/dist/chunk-PGSX7UCP.js.map +0 -1
  65. package/dist/chunk-TMYGL6X5.js.map +0 -1
  66. package/dist/chunk-WWEUO2PL.js.map +0 -1
  67. /package/dist/{chunk-FZCP527Y.js.map → chunk-CJUO7J5Z.js.map} +0 -0
  68. /package/dist/{chunk-RC6BZ44Q.js.map → chunk-OA6HFRQP.js.map} +0 -0
  69. /package/dist/{latest-question-YTOBHCWR.js.map → latest-question-GPYM2JNU.js.map} +0 -0
@@ -16,7 +16,7 @@ import {
16
16
  isRetainedImageContentType,
17
17
  timelineGroupContainsPresentedImage,
18
18
  useRetainedImageObjectUrl
19
- } from "./chunk-FZCP527Y.js";
19
+ } from "./chunk-CJUO7J5Z.js";
20
20
  import {
21
21
  approvalsFromRequiresAction,
22
22
  conversationTimeline,
@@ -24,20 +24,21 @@ import {
24
24
  isActionableHumanInputRequest,
25
25
  projectPendingApprovals,
26
26
  useFileAttachments,
27
+ useGoal,
27
28
  useHumanInputRequests,
28
29
  useSession,
29
30
  useSessionControl,
30
31
  useSessionEvents,
31
32
  useTurnQueue
32
- } from "./chunk-WWEUO2PL.js";
33
+ } from "./chunk-WZMYFJD3.js";
33
34
  import {
34
35
  buildTimeline,
35
36
  groupTimeline
36
- } from "./chunk-RC6BZ44Q.js";
37
+ } from "./chunk-OA6HFRQP.js";
37
38
  import {
38
39
  mcpToolLeaf,
39
40
  toolDisplayName
40
- } from "./chunk-ERGYJIBB.js";
41
+ } from "./chunk-AWZLIMKX.js";
41
42
  import {
42
43
  OpenGeniProvider
43
44
  } from "./chunk-3CTRFMAK.js";
@@ -100,7 +101,7 @@ import {
100
101
  StopButton,
101
102
  Surface,
102
103
  useChatComposerController
103
- } from "./chunk-CY7WK5FD.js";
104
+ } from "./chunk-LN6TCXD3.js";
104
105
  import {
105
106
  FILE_ONLY_MESSAGE_TEXT,
106
107
  useComposer
@@ -987,33 +988,278 @@ function HumanInputSurface({
987
988
  }
988
989
 
989
990
  // src/components/tool-action-review.tsx
990
- import { ArrowLeftIcon, CheckIcon, ChevronRightIcon, LoaderCircleIcon } from "lucide-react";
991
+ import {
992
+ ArrowLeftIcon,
993
+ CheckIcon,
994
+ ChevronRightIcon,
995
+ CircleAlertIcon,
996
+ CircleSlashIcon,
997
+ LoaderCircleIcon,
998
+ ShieldCheckIcon
999
+ } from "lucide-react";
991
1000
  import { useEffect as useEffect3, useId as useId2, useRef as useRef3, useState as useState2 } from "react";
992
1001
  import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
993
1002
  var statusText = {
994
- pending: "Needs your approval",
995
- approved: "Approved \xB7 waiting to run",
996
- executing: "In progress",
997
- completed: "Completed",
998
- partial: "Partially completed",
999
- unknown: "Outcome uncertain",
1003
+ pending: "Approval needed",
1004
+ approved: "Approved",
1005
+ executing: "Approved \xB7 running",
1006
+ completed: "Approved \xB7 done",
1007
+ partial: "Partly done",
1008
+ unknown: "Outcome unknown",
1000
1009
  rejected: "Declined",
1001
1010
  cancelled: "Cancelled",
1002
- expired: "Review expired",
1011
+ expired: "Expired",
1003
1012
  revoked: "Access unavailable",
1004
- stale: "Action changed",
1005
- failed: "Action failed",
1013
+ blocked: "Blocked",
1014
+ stale: "No longer valid",
1015
+ failed: "Failed",
1006
1016
  unavailable: "Details unavailable"
1007
1017
  };
1008
1018
  var statusDetail = {
1009
- unknown: "Execution may have happened. Check the result before trying again.",
1010
- rejected: "This action was not run.",
1011
- cancelled: "This action will not run.",
1012
- expired: "Prepare a new action to continue.",
1013
- revoked: "Restore access before preparing a new action.",
1014
- stale: "The tool or account changed. A new review is needed.",
1015
- partial: "Some work completed. Review the results before continuing."
1019
+ unknown: "It may have run. Check the result before trying again.",
1020
+ rejected: "This action did not run.",
1021
+ cancelled: "This action did not run.",
1022
+ expired: "This action did not run. Ask the agent to prepare it again.",
1023
+ revoked: "This action did not run. Reconnect the account, then ask the agent to try again.",
1024
+ stale: "The tool or account changed after this was prepared, so it did not run.",
1025
+ partial: "Some of it ran. Check the result before continuing.",
1026
+ failed: "The action ran but returned an error."
1027
+ };
1028
+ var statusTone = {
1029
+ pending: "waiting",
1030
+ approved: "ok",
1031
+ executing: "ok",
1032
+ completed: "ok",
1033
+ partial: "failed",
1034
+ unknown: "failed",
1035
+ rejected: "muted",
1036
+ cancelled: "muted",
1037
+ expired: "muted",
1038
+ revoked: "muted",
1039
+ blocked: "muted",
1040
+ stale: "muted",
1041
+ failed: "failed",
1042
+ unavailable: "muted"
1016
1043
  };
1044
+ var toneText = {
1045
+ waiting: "text-og-status-waiting",
1046
+ ok: "text-og-fg-muted",
1047
+ failed: "text-og-status-failed",
1048
+ muted: "text-og-fg-muted"
1049
+ };
1050
+ var selectionPaths = /* @__PURE__ */ new Set([
1051
+ "/messageIds",
1052
+ "/messageId",
1053
+ "/threadId",
1054
+ "/addLabelIds",
1055
+ "/removeLabelIds",
1056
+ "/labelIds"
1057
+ ]);
1058
+ var UNRECOVERABLE_TEXT = "The details of this older request couldn't be recovered, so it can't be approved. Decline it to let the agent continue.";
1059
+ var VISIBLE_FIELDS = 6;
1060
+ function StatusIcon({ status, busy }) {
1061
+ const className = "size-4";
1062
+ if (busy || status === "executing" || status === "approved")
1063
+ return /* @__PURE__ */ jsx3(LoaderCircleIcon, { "aria-hidden": "true", className: cn(className, "animate-spin") });
1064
+ if (status === "pending") return /* @__PURE__ */ jsx3(ShieldCheckIcon, { "aria-hidden": "true", className });
1065
+ if (status === "completed") return /* @__PURE__ */ jsx3(CheckIcon, { "aria-hidden": "true", className });
1066
+ if (statusTone[status] === "failed")
1067
+ return /* @__PURE__ */ jsx3(CircleAlertIcon, { "aria-hidden": "true", className });
1068
+ return /* @__PURE__ */ jsx3(CircleSlashIcon, { "aria-hidden": "true", className });
1069
+ }
1070
+ function ToolReviewFrame({
1071
+ tone,
1072
+ icon,
1073
+ eyebrow,
1074
+ title,
1075
+ titleId,
1076
+ subtitle,
1077
+ children,
1078
+ footer,
1079
+ bare = false,
1080
+ ...rest
1081
+ }) {
1082
+ const waiting = tone === "waiting";
1083
+ return /* @__PURE__ */ jsxs2(
1084
+ "article",
1085
+ {
1086
+ "aria-labelledby": titleId,
1087
+ ...rest,
1088
+ className: cn(
1089
+ "min-w-0 text-og-fg",
1090
+ !bare && (waiting ? "overflow-hidden rounded-og-lg border border-og-status-waiting/35 bg-og-status-waiting/5 shadow-og-sm" : "overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1"),
1091
+ rest.className
1092
+ ),
1093
+ children: [
1094
+ /* @__PURE__ */ jsxs2("header", { className: cn("flex min-w-0 items-start gap-3", bare ? "pb-1" : "px-4 py-3"), children: [
1095
+ /* @__PURE__ */ jsx3(
1096
+ "span",
1097
+ {
1098
+ className: cn(
1099
+ "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md",
1100
+ waiting ? "bg-og-status-waiting/12 text-og-status-waiting" : tone === "failed" ? "bg-og-status-failed/10 text-og-status-failed" : "bg-og-fg/5 text-og-fg-muted"
1101
+ ),
1102
+ children: icon
1103
+ }
1104
+ ),
1105
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
1106
+ /* @__PURE__ */ jsx3(
1107
+ "p",
1108
+ {
1109
+ className: cn("m-0 text-og-xs font-medium", toneText[tone]),
1110
+ role: "status",
1111
+ "aria-live": "polite",
1112
+ children: eyebrow
1113
+ }
1114
+ ),
1115
+ /* @__PURE__ */ jsx3(
1116
+ "h3",
1117
+ {
1118
+ tabIndex: -1,
1119
+ id: titleId,
1120
+ className: "m-0 mt-0.5 break-words text-og-md font-semibold leading-snug text-og-fg outline-hidden [overflow-wrap:anywhere]",
1121
+ children: title
1122
+ }
1123
+ ),
1124
+ subtitle ? /* @__PURE__ */ jsx3("p", { className: "m-0 mt-0.5 break-words text-og-xs text-og-fg-muted [overflow-wrap:anywhere]", children: subtitle }) : null
1125
+ ] })
1126
+ ] }),
1127
+ children ? /* @__PURE__ */ jsx3(
1128
+ "div",
1129
+ {
1130
+ className: cn(
1131
+ "min-w-0",
1132
+ bare ? "pt-2" : "px-4 pb-3",
1133
+ !bare && "sm:pl-[3.75rem]"
1134
+ // Aligns with the title, past the icon.
1135
+ ),
1136
+ children
1137
+ }
1138
+ ) : null,
1139
+ footer ? /* @__PURE__ */ jsx3(
1140
+ "footer",
1141
+ {
1142
+ className: cn(
1143
+ "flex flex-wrap items-center gap-x-3 gap-y-2",
1144
+ bare ? "pt-3" : waiting ? "border-t border-og-status-waiting/20 px-4 py-3" : "border-t border-og-border px-4 py-3"
1145
+ ),
1146
+ children: footer
1147
+ }
1148
+ ) : null
1149
+ ]
1150
+ }
1151
+ );
1152
+ }
1153
+ var linkButton = "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40 inline-flex min-h-8 items-center gap-1 rounded-og-sm text-left text-og-sm text-og-fg underline decoration-og-border-strong underline-offset-4 hover:decoration-current [@media(pointer:coarse)]:min-h-11";
1154
+ function ReviewFacts({
1155
+ review,
1156
+ onViewDetails,
1157
+ showStatusDetail
1158
+ }) {
1159
+ const canOpen = Boolean(onViewDetails && review.detailsAvailable);
1160
+ const selection = review.selectionCount === void 0 ? void 0 : review.fields.find(
1161
+ (field) => ["/messageIds", "/messageId", "/threadId"].includes(field.path)
1162
+ );
1163
+ const fields = selection ? review.fields.filter((field) => !selectionPaths.has(field.path)) : review.fields;
1164
+ const shown = fields.slice(0, VISIBLE_FIELDS);
1165
+ const hiddenFields = fields.length - shown.length + review.moreFields;
1166
+ const effects = review.effects.filter(
1167
+ (effect) => effect !== review.approveLabel && !review.title.startsWith(effect)
1168
+ );
1169
+ const note = (showStatusDetail ? review.status === "blocked" ? `${review.reason || "Your permission settings block this action."} It did not run.` : statusDetail[review.status] : void 0) ?? review.consequence;
1170
+ const samples = review.samples ?? [];
1171
+ const count = review.selectionCount ?? 0;
1172
+ const noun = review.selectionKind === "threads" ? count === 1 ? "conversation" : "conversations" : count === 1 ? "message" : "messages";
1173
+ const hasContent = note || effects.length || selection || shown.length || hiddenFields > 0 || samples.length;
1174
+ if (!hasContent) return null;
1175
+ return /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-col gap-3 text-og-sm", children: [
1176
+ note ? /* @__PURE__ */ jsx3("p", { className: "m-0 leading-relaxed text-og-fg-muted", children: note }) : null,
1177
+ effects.length > 0 ? /* @__PURE__ */ jsx3("ul", { className: "m-0 list-none space-y-1 p-0", "aria-label": "Also changes", children: effects.map((effect) => /* @__PURE__ */ jsxs2("li", { className: "flex items-start gap-2 text-og-fg", children: [
1178
+ /* @__PURE__ */ jsx3(
1179
+ "span",
1180
+ {
1181
+ "aria-hidden": "true",
1182
+ className: "mt-[0.55em] size-1 shrink-0 rounded-full bg-og-fg-muted"
1183
+ }
1184
+ ),
1185
+ /* @__PURE__ */ jsx3("span", { className: "min-w-0 break-words", children: effect })
1186
+ ] }, effect)) }) : null,
1187
+ selection ? /* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
1188
+ samples.length > 0 ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
1189
+ /* @__PURE__ */ jsx3("p", { className: "m-0 mb-1 text-og-xs text-og-fg-muted", children: "Includes" }),
1190
+ /* @__PURE__ */ jsxs2("ul", { className: "m-0 list-none divide-y divide-og-border rounded-og-md border border-og-border bg-og-surface-1 p-0", children: [
1191
+ samples.map((sample) => /* @__PURE__ */ jsxs2("li", { className: "min-w-0 px-3 py-2", children: [
1192
+ /* @__PURE__ */ jsx3("p", { className: "m-0 truncate text-og-sm text-og-fg", children: sample.title }),
1193
+ sample.subtitle ? /* @__PURE__ */ jsx3("p", { className: "m-0 mt-0.5 truncate text-og-xs text-og-fg-muted", children: sample.subtitle }) : null
1194
+ ] }, sample.id)),
1195
+ count > samples.length ? /* @__PURE__ */ jsxs2("li", { className: "px-3 py-2 text-og-xs text-og-fg-muted", children: [
1196
+ "and ",
1197
+ (count - samples.length).toLocaleString(),
1198
+ " more"
1199
+ ] }) : null
1200
+ ] })
1201
+ ] }) : null,
1202
+ canOpen && count > 0 ? /* @__PURE__ */ jsxs2(
1203
+ "button",
1204
+ {
1205
+ type: "button",
1206
+ className: cn(linkButton, samples.length > 0 && "mt-1"),
1207
+ "data-review-path": selection.path,
1208
+ onClick: () => onViewDetails(selection.path),
1209
+ children: [
1210
+ count === 1 ? `View the ${noun}` : `View all ${count.toLocaleString()} ${noun}`,
1211
+ /* @__PURE__ */ jsx3(ChevronRightIcon, { className: "size-3.5 shrink-0", "aria-hidden": "true" })
1212
+ ]
1213
+ }
1214
+ ) : null
1215
+ ] }) : null,
1216
+ shown.length > 0 ? /* @__PURE__ */ jsx3("dl", { className: "m-0 min-w-0 space-y-2", children: shown.map((field) => /* @__PURE__ */ jsxs2(
1217
+ "div",
1218
+ {
1219
+ className: "grid min-w-0 gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(0,9rem)_minmax(0,1fr)]",
1220
+ children: [
1221
+ /* @__PURE__ */ jsx3("dt", { className: "m-0 break-words text-og-xs text-og-fg-muted sm:pt-px sm:text-og-sm", children: field.label }),
1222
+ /* @__PURE__ */ jsx3("dd", { className: "m-0 min-w-0 whitespace-pre-wrap break-words text-og-fg [overflow-wrap:anywhere]", children: field.protected ? /* @__PURE__ */ jsx3("span", { className: "text-og-fg-muted", children: "Hidden" }) : field.truncated && canOpen ? /* @__PURE__ */ jsxs2(
1223
+ "button",
1224
+ {
1225
+ type: "button",
1226
+ "data-review-path": field.path,
1227
+ "aria-label": `View ${field.label}: ${field.preview}`,
1228
+ onClick: () => onViewDetails(field.path),
1229
+ className: cn(linkButton, "max-w-full"),
1230
+ children: [
1231
+ /* @__PURE__ */ jsx3("span", { className: "line-clamp-4 min-w-0 break-words [overflow-wrap:anywhere]", children: field.preview }),
1232
+ /* @__PURE__ */ jsx3(ChevronRightIcon, { className: "size-3.5 shrink-0", "aria-hidden": "true" })
1233
+ ]
1234
+ }
1235
+ ) : field.preview })
1236
+ ]
1237
+ },
1238
+ field.path
1239
+ )) }) : null,
1240
+ hiddenFields > 0 ? /* @__PURE__ */ jsxs2("p", { className: "m-0 text-og-xs text-og-fg-muted", children: [
1241
+ hiddenFields === 1 ? "1 more value" : `${hiddenFields} more values`,
1242
+ " in details"
1243
+ ] }) : null
1244
+ ] });
1245
+ }
1246
+ function DeclineButton({
1247
+ busy,
1248
+ submitting,
1249
+ label,
1250
+ onClick
1251
+ }) {
1252
+ return /* @__PURE__ */ jsx3(
1253
+ "button",
1254
+ {
1255
+ type: "button",
1256
+ disabled: busy,
1257
+ onClick,
1258
+ className: "inline-flex min-h-9 items-center justify-center rounded-og-md border border-og-border bg-og-surface-1 px-3 py-1.5 text-og-sm font-medium text-og-fg transition-colors hover:border-og-border-strong hover:bg-og-hover disabled:opacity-60 [@media(pointer:coarse)]:min-h-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1259
+ children: submitting ? "Declining\u2026" : label ?? "Decline"
1260
+ }
1261
+ );
1262
+ }
1017
1263
  function ToolActionReviewCard({
1018
1264
  review,
1019
1265
  onApprove,
@@ -1022,136 +1268,81 @@ function ToolActionReviewCard({
1022
1268
  disabled,
1023
1269
  onViewDetails,
1024
1270
  pendingLabel,
1025
- rejectLabel
1271
+ rejectLabel,
1272
+ bare
1026
1273
  }) {
1027
1274
  const titleId = useId2();
1028
- const actionable = review.status === "pending" && review.availableActions.includes("approve");
1029
- const quiet = review.status === "completed" || review.status === "rejected" || review.status === "cancelled";
1275
+ const canApprove = review.availableActions.includes("approve") && !!onApprove;
1276
+ const canReject = review.availableActions.includes("reject") && !!onReject;
1277
+ const actionable = review.status === "pending" && (canApprove || canReject);
1030
1278
  const busy = Boolean(disabled || submitting);
1031
- const selection = review.selectionCount === void 0 ? void 0 : review.fields.find(
1032
- (field) => field.path === "/messageIds" || field.path === "/messageId" || field.path === "/threadId"
1033
- );
1034
- const fields = selection ? review.fields.filter(
1035
- (field) => ![selection.path, "/addLabelIds", "/removeLabelIds", "/labelIds"].includes(field.path)
1036
- ) : review.fields;
1037
- const extraEffects = review.effects.filter((effect) => effect !== review.approveLabel);
1279
+ const tone = statusTone[review.status];
1280
+ const eyebrow = submitting ? submitting === "approve" ? "Approving\u2026" : "Declining\u2026" : review.status === "pending" ? pendingLabel ?? statusText.pending : statusText[review.status];
1281
+ const detailsLink = review.detailsAvailable && onViewDetails ? /* @__PURE__ */ jsx3(
1282
+ "button",
1283
+ {
1284
+ type: "button",
1285
+ className: "inline-flex min-h-8 items-center rounded-og-sm text-og-sm text-og-fg-muted underline decoration-og-border-strong underline-offset-4 hover:text-og-fg hover:decoration-current [@media(pointer:coarse)]:min-h-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1286
+ "data-review-path": "",
1287
+ onClick: () => onViewDetails(""),
1288
+ children: "Details"
1289
+ }
1290
+ ) : null;
1291
+ const reason = review.reason.trim();
1038
1292
  return /* @__PURE__ */ jsxs2(
1039
- "article",
1293
+ ToolReviewFrame,
1040
1294
  {
1041
- "aria-labelledby": titleId,
1295
+ tone,
1296
+ icon: /* @__PURE__ */ jsx3(StatusIcon, { status: review.status, busy: Boolean(submitting) }),
1297
+ eyebrow,
1298
+ title: review.title,
1299
+ titleId,
1300
+ subtitle: review.accountLabel,
1301
+ bare,
1042
1302
  "aria-busy": Boolean(submitting),
1043
- className: "min-w-0 py-4",
1044
1303
  "data-og-tool-review": "",
1045
1304
  "data-review-status": review.status,
1046
- children: [
1047
- /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-2 text-og-xs text-og-fg-muted", role: "status", children: [
1048
- review.status === "completed" ? /* @__PURE__ */ jsx3(CheckIcon, { className: "size-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx3("span", { className: "size-1.5 shrink-0 rounded-full bg-current", "aria-hidden": "true" }),
1049
- /* @__PURE__ */ jsx3("span", { children: submitting ? submitting === "approve" ? "Approving\u2026" : "Declining\u2026" : review.status === "pending" ? pendingLabel ?? statusText.pending : statusText[review.status] })
1305
+ footer: actionable ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
1306
+ /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-1 basis-48 flex-wrap items-center gap-x-3 gap-y-1", children: [
1307
+ detailsLink,
1308
+ reason ? /* @__PURE__ */ jsx3("span", { className: "min-w-0 text-og-xs leading-relaxed text-og-fg-subtle", children: reason }) : null
1050
1309
  ] }),
1051
- /* @__PURE__ */ jsx3(
1052
- "h3",
1053
- {
1054
- tabIndex: -1,
1055
- id: titleId,
1056
- className: "m-0 mt-1.5 outline-hidden break-words text-og-md font-semibold leading-snug text-og-fg",
1057
- children: review.title
1058
- }
1059
- ),
1060
- review.accountLabel && /* @__PURE__ */ jsx3("p", { className: "m-0 mt-1 break-words text-og-sm text-og-fg-muted", children: review.accountLabel }),
1061
- (statusDetail[review.status] || review.consequence) && /* @__PURE__ */ jsx3("p", { className: "m-0 mt-3 text-og-sm leading-relaxed text-og-fg-muted", children: statusDetail[review.status] ?? review.consequence }),
1062
- !quiet && /* @__PURE__ */ jsxs2(Fragment2, { children: [
1063
- extraEffects.length > 0 && /* @__PURE__ */ jsx3("ul", { className: "m-0 mt-3 list-none space-y-1 p-0 text-og-sm text-og-fg", children: extraEffects.map((effect) => /* @__PURE__ */ jsx3("li", { children: effect }, effect)) }),
1064
- selection && /* @__PURE__ */ jsxs2("div", { className: "mt-4", children: [
1065
- review.samples && review.samples.length > 0 && /* @__PURE__ */ jsxs2(Fragment2, { children: [
1066
- /* @__PURE__ */ jsx3("p", { className: "m-0 mb-1 text-og-xs text-og-fg-muted", children: "Examples from this selection" }),
1067
- /* @__PURE__ */ jsx3("ul", { className: "m-0 list-none divide-y divide-og-border p-0", children: review.samples.map((sample) => /* @__PURE__ */ jsxs2("li", { className: "py-2", children: [
1068
- /* @__PURE__ */ jsx3("p", { className: "m-0 break-words text-og-sm text-og-fg", children: sample.title }),
1069
- sample.subtitle && /* @__PURE__ */ jsx3("p", { className: "m-0 mt-0.5 break-words text-og-xs text-og-fg-muted", children: sample.subtitle })
1070
- ] }, sample.id)) })
1071
- ] }),
1072
- onViewDetails && review.detailsAvailable && /* @__PURE__ */ jsxs2(
1073
- "button",
1074
- {
1075
- type: "button",
1076
- className: "inline-flex min-h-11 items-center gap-1 text-og-sm text-og-fg underline decoration-og-border-strong underline-offset-4 hover:decoration-current",
1077
- "data-review-path": selection.path,
1078
- onClick: () => onViewDetails(selection.path),
1079
- children: [
1080
- "View all ",
1081
- review.selectionCount?.toLocaleString(),
1082
- " ",
1083
- review.selectionKind ?? "messages",
1084
- /* @__PURE__ */ jsx3(ChevronRightIcon, { className: "size-3.5", "aria-hidden": "true" })
1085
- ]
1086
- }
1087
- )
1088
- ] }),
1089
- /* @__PURE__ */ jsx3("dl", { className: "m-0 mt-3 divide-y divide-og-border text-og-sm", children: fields.map((field) => /* @__PURE__ */ jsxs2(
1090
- "div",
1310
+ /* @__PURE__ */ jsxs2("div", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2", children: [
1311
+ canReject ? /* @__PURE__ */ jsx3(
1312
+ DeclineButton,
1313
+ {
1314
+ busy,
1315
+ submitting: submitting === "reject",
1316
+ label: rejectLabel,
1317
+ onClick: onReject
1318
+ }
1319
+ ) : null,
1320
+ canApprove ? /* @__PURE__ */ jsxs2(
1321
+ "button",
1091
1322
  {
1092
- className: "grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,2fr)] gap-x-4 py-2",
1323
+ type: "button",
1324
+ disabled: busy,
1325
+ onClick: onApprove,
1326
+ className: "inline-flex min-h-9 items-center justify-center gap-2 rounded-og-md border border-og-primary-border bg-og-primary px-3.5 py-1.5 text-og-sm font-medium text-og-primary-fg transition-colors hover:bg-og-primary-hover disabled:opacity-60 [@media(pointer:coarse)]:min-h-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1093
1327
  children: [
1094
- /* @__PURE__ */ jsx3("dt", { className: "m-0 break-words text-og-fg-muted", children: field.label }),
1095
- /* @__PURE__ */ jsx3("dd", { className: "m-0 min-w-0 whitespace-pre-wrap break-words text-og-fg [overflow-wrap:anywhere]", children: field.truncated && !field.protected && onViewDetails && review.detailsAvailable ? /* @__PURE__ */ jsxs2(
1096
- "button",
1097
- {
1098
- type: "button",
1099
- "data-review-path": field.path,
1100
- onClick: () => onViewDetails(field.path),
1101
- className: "inline-flex min-h-8 max-w-full items-center gap-1 text-left underline decoration-og-border-strong underline-offset-4 hover:decoration-current [@media(pointer:coarse)]:min-h-11",
1102
- children: [
1103
- /* @__PURE__ */ jsx3("span", { className: "min-w-0 break-words", children: field.preview }),
1104
- /* @__PURE__ */ jsx3(ChevronRightIcon, { className: "size-3.5 shrink-0", "aria-hidden": "true" })
1105
- ]
1106
- }
1107
- ) : field.preview })
1328
+ submitting === "approve" ? /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-3.5 animate-spin", "aria-hidden": "true" }) : null,
1329
+ submitting === "approve" ? "Approving\u2026" : review.approveLabel
1108
1330
  ]
1109
- },
1110
- field.path
1111
- )) }),
1112
- review.moreFields > 0 && /* @__PURE__ */ jsxs2("p", { className: "m-0 mt-2 text-og-xs text-og-fg-muted", children: [
1113
- review.moreFields,
1114
- " more fields in the full details"
1115
- ] })
1116
- ] }),
1117
- review.detailsAvailable && onViewDetails && /* @__PURE__ */ jsx3(
1118
- "button",
1331
+ }
1332
+ ) : null
1333
+ ] })
1334
+ ] }) : void 0,
1335
+ children: [
1336
+ actionable && !canApprove ? /* @__PURE__ */ jsx3("p", { className: "m-0 mb-3 text-og-sm leading-relaxed text-og-fg", children: UNRECOVERABLE_TEXT }) : null,
1337
+ /* @__PURE__ */ jsx3(
1338
+ ReviewFacts,
1119
1339
  {
1120
- type: "button",
1121
- className: "mt-1 min-h-8 text-og-xs text-og-fg-muted underline underline-offset-4 hover:text-og-fg [@media(pointer:coarse)]:min-h-11",
1122
- "data-review-path": "",
1123
- onClick: () => onViewDetails(""),
1124
- children: "View full details"
1340
+ review,
1341
+ onViewDetails,
1342
+ showStatusDetail: review.status !== "pending"
1125
1343
  }
1126
1344
  ),
1127
- actionable && /* @__PURE__ */ jsxs2(Fragment2, { children: [
1128
- /* @__PURE__ */ jsx3("p", { className: "m-0 mt-3 text-og-xs leading-relaxed text-og-fg-muted", children: review.reason }),
1129
- /* @__PURE__ */ jsxs2("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
1130
- /* @__PURE__ */ jsxs2(
1131
- "button",
1132
- {
1133
- type: "button",
1134
- disabled: busy,
1135
- onClick: onApprove,
1136
- className: "inline-flex min-h-9 items-center justify-center gap-2 rounded-og-md border border-og-primary-border bg-og-primary px-4 py-2 text-og-sm font-medium text-og-primary-fg transition-colors hover:bg-og-primary-hover disabled:opacity-60 [@media(pointer:coarse)]:min-h-11",
1137
- children: [
1138
- submitting === "approve" && /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-3.5 animate-spin", "aria-hidden": "true" }),
1139
- submitting === "approve" ? "Approving\u2026" : review.approveLabel
1140
- ]
1141
- }
1142
- ),
1143
- /* @__PURE__ */ jsx3(
1144
- "button",
1145
- {
1146
- type: "button",
1147
- disabled: busy,
1148
- onClick: onReject,
1149
- className: "min-h-9 rounded-og-md px-3 py-2 text-og-sm text-og-fg-muted transition-colors hover:bg-og-fg/5 hover:text-og-fg disabled:opacity-60 [@media(pointer:coarse)]:min-h-11",
1150
- children: submitting === "reject" ? "Declining\u2026" : rejectLabel ?? "Decline"
1151
- }
1152
- )
1153
- ] })
1154
- ] })
1345
+ !actionable && detailsLink ? /* @__PURE__ */ jsx3("div", { className: "mt-2", children: detailsLink }) : null
1155
1346
  ]
1156
1347
  }
1157
1348
  );
@@ -1160,20 +1351,24 @@ function ToolActionReviewDetails({
1160
1351
  review,
1161
1352
  path: initialPath = "",
1162
1353
  load,
1163
- onBack
1354
+ onBack,
1355
+ manageFocus = true
1164
1356
  }) {
1165
1357
  const [path, setPath] = useState2(initialPath);
1358
+ const [trail, setTrail] = useState2([]);
1166
1359
  const [offset, setOffset] = useState2(0);
1167
1360
  const [page, setPage] = useState2(null);
1168
1361
  const [error, setError] = useState2(false);
1169
1362
  const [retry, setRetry] = useState2(0);
1170
1363
  const heading = useRef3(null);
1364
+ const focusedOnce = useRef3(false);
1171
1365
  useEffect3(() => {
1172
- if (page) {
1366
+ if (page && manageFocus && !focusedOnce.current) {
1367
+ focusedOnce.current = true;
1173
1368
  heading.current?.focus({ preventScroll: true });
1174
1369
  heading.current?.scrollIntoView({ block: "start" });
1175
1370
  }
1176
- }, [page]);
1371
+ }, [page, manageFocus]);
1177
1372
  useEffect3(() => {
1178
1373
  let active = true;
1179
1374
  setPage(null);
@@ -1195,110 +1390,128 @@ function ToolActionReviewDetails({
1195
1390
  active = false;
1196
1391
  };
1197
1392
  }, [review, path, offset, load, retry]);
1198
- return /* @__PURE__ */ jsxs2("section", { className: "og-root mx-auto w-full max-w-3xl p-6 text-og-fg", "data-og-review-details": "", children: [
1199
- /* @__PURE__ */ jsxs2(
1200
- "button",
1201
- {
1202
- type: "button",
1203
- onClick: onBack,
1204
- className: "mb-5 inline-flex min-h-11 items-center gap-2 text-og-sm text-og-fg-muted hover:text-og-fg",
1205
- children: [
1206
- /* @__PURE__ */ jsx3(ArrowLeftIcon, { className: "size-4", "aria-hidden": "true" }),
1207
- "Back to review"
1208
- ]
1209
- }
1210
- ),
1211
- /* @__PURE__ */ jsx3(
1212
- "h2",
1213
- {
1214
- ref: heading,
1215
- tabIndex: -1,
1216
- className: "m-0 break-words text-og-lg font-semibold outline-hidden",
1217
- children: review.title
1218
- }
1219
- ),
1220
- review.accountLabel && /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: review.accountLabel }),
1221
- /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: "Exact saved selection and values. Protected credentials stay hidden." }),
1222
- path !== initialPath && /* @__PURE__ */ jsx3(
1223
- "button",
1224
- {
1225
- type: "button",
1226
- className: "min-h-11 text-og-sm underline",
1227
- onClick: () => {
1228
- setPath(initialPath);
1229
- setOffset(0);
1230
- },
1231
- children: "Back to all fields"
1232
- }
1233
- ),
1234
- error ? /* @__PURE__ */ jsxs2("div", { role: "alert", className: "py-6 text-og-sm", children: [
1235
- "Details could not be loaded.",
1236
- " ",
1237
- /* @__PURE__ */ jsx3(
1238
- "button",
1239
- {
1240
- type: "button",
1241
- onClick: () => setRetry((value) => value + 1),
1242
- className: "min-h-11 underline",
1243
- children: "Try again"
1244
- }
1245
- )
1246
- ] }) : !page ? /* @__PURE__ */ jsx3("p", { role: "status", className: "py-6 text-og-sm text-og-fg-muted", children: "Loading details\u2026" }) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
1247
- /* @__PURE__ */ jsx3("dl", { className: "m-0 divide-y divide-og-border", children: page.items.map((item) => /* @__PURE__ */ jsxs2("div", { className: "py-4", children: [
1248
- /* @__PURE__ */ jsx3("dt", { className: "m-0 text-og-xs text-og-fg-muted", children: item.label }),
1249
- /* @__PURE__ */ jsxs2("dd", { className: "m-0 mt-1 whitespace-pre-wrap break-words text-og-sm leading-relaxed [overflow-wrap:anywhere]", children: [
1250
- item.value,
1251
- item.truncated && item.path && /* @__PURE__ */ jsx3(
1393
+ const open = (next, label) => {
1394
+ setTrail((value) => [...value, { path, label }]);
1395
+ setPath(next);
1396
+ setOffset(0);
1397
+ };
1398
+ const up = () => {
1399
+ const previous = trail.at(-1);
1400
+ setTrail((value) => value.slice(0, -1));
1401
+ setPath(previous?.path ?? initialPath);
1402
+ setOffset(0);
1403
+ };
1404
+ return /* @__PURE__ */ jsxs2(
1405
+ "section",
1406
+ {
1407
+ className: "og-root mx-auto w-full max-w-3xl px-4 py-5 text-og-fg sm:px-6",
1408
+ "data-og-review-details": "",
1409
+ children: [
1410
+ /* @__PURE__ */ jsxs2(
1411
+ "button",
1412
+ {
1413
+ type: "button",
1414
+ onClick: onBack,
1415
+ className: "mb-4 inline-flex min-h-11 items-center gap-2 rounded-og-md pr-2 text-og-sm text-og-fg-muted hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1416
+ children: [
1417
+ /* @__PURE__ */ jsx3(ArrowLeftIcon, { className: "size-4", "aria-hidden": "true" }),
1418
+ "Back to review"
1419
+ ]
1420
+ }
1421
+ ),
1422
+ /* @__PURE__ */ jsx3(
1423
+ "h2",
1424
+ {
1425
+ ref: heading,
1426
+ tabIndex: -1,
1427
+ className: "m-0 break-words text-og-lg font-semibold outline-hidden [overflow-wrap:anywhere]",
1428
+ children: review.title
1429
+ }
1430
+ ),
1431
+ review.accountLabel ? /* @__PURE__ */ jsx3("p", { className: "m-0 mt-1 text-og-sm text-og-fg-muted", children: review.accountLabel }) : null,
1432
+ /* @__PURE__ */ jsx3("p", { className: "m-0 mt-2 text-og-xs text-og-fg-subtle", children: "The exact values saved for this action. Passwords and keys stay hidden." }),
1433
+ trail.length > 0 ? /* @__PURE__ */ jsxs2(
1434
+ "button",
1435
+ {
1436
+ type: "button",
1437
+ className: "mt-3 inline-flex min-h-11 items-center gap-1.5 text-og-sm text-og-fg-muted underline underline-offset-4 hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1438
+ onClick: up,
1439
+ children: [
1440
+ /* @__PURE__ */ jsx3(ArrowLeftIcon, { className: "size-3.5", "aria-hidden": "true" }),
1441
+ "Back to ",
1442
+ trail.at(-1)?.label ?? "all values"
1443
+ ]
1444
+ }
1445
+ ) : null,
1446
+ error ? /* @__PURE__ */ jsxs2("div", { role: "alert", className: "mt-4 py-4 text-og-sm", children: [
1447
+ "Couldn't load these details.",
1448
+ " ",
1449
+ /* @__PURE__ */ jsx3(
1252
1450
  "button",
1253
1451
  {
1254
1452
  type: "button",
1255
- "aria-label": `Open complete ${item.label}`,
1256
- className: "mt-2 block min-h-11 text-og-sm underline underline-offset-4",
1257
- onClick: () => {
1258
- setPath(item.path);
1259
- setOffset(0);
1260
- },
1261
- children: "Open complete field"
1453
+ onClick: () => setRetry((value) => value + 1),
1454
+ className: "min-h-11 underline underline-offset-4 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1455
+ children: "Try again"
1262
1456
  }
1263
1457
  )
1264
- ] })
1265
- ] }, `${page.path}:${item.label}`)) }),
1266
- /* @__PURE__ */ jsxs2(
1267
- "nav",
1268
- {
1269
- "aria-label": "Review detail pages",
1270
- className: "mt-6 flex flex-wrap items-center justify-between gap-3 border-t border-og-border pt-4 text-og-sm",
1271
- children: [
1272
- /* @__PURE__ */ jsx3(
1458
+ ] }) : !page ? /* @__PURE__ */ jsx3("p", { role: "status", className: "mt-4 py-4 text-og-sm text-og-fg-muted", children: "Loading details\u2026" }) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
1459
+ /* @__PURE__ */ jsx3("dl", { className: "m-0 mt-4 divide-y divide-og-border border-y border-og-border", children: page.items.map((item) => /* @__PURE__ */ jsxs2("div", { className: "py-3", children: [
1460
+ /* @__PURE__ */ jsx3("dt", { className: "m-0 text-og-xs text-og-fg-muted", children: item.label }),
1461
+ /* @__PURE__ */ jsx3("dd", { className: "m-0 mt-1 whitespace-pre-wrap break-words text-og-sm leading-relaxed [overflow-wrap:anywhere]", children: item.truncated && item.path ? /* @__PURE__ */ jsxs2(
1273
1462
  "button",
1274
1463
  {
1275
1464
  type: "button",
1276
- disabled: offset === 0,
1277
- onClick: () => setOffset(Math.max(0, offset - 25)),
1278
- className: "min-h-11 rounded-og-md border border-og-border px-3 disabled:opacity-40",
1279
- children: "Previous"
1280
- }
1281
- ),
1282
- /* @__PURE__ */ jsx3("span", { className: "text-og-fg-muted", children: page.total === 0 ? "No items" : `${offset + 1}\u2013${offset + page.items.length} of ${page.total.toLocaleString()}` }),
1283
- /* @__PURE__ */ jsx3(
1284
- "button",
1285
- {
1286
- type: "button",
1287
- disabled: page.nextOffset === null,
1288
- onClick: () => setOffset(page.nextOffset ?? offset),
1289
- className: "min-h-11 rounded-og-md border border-og-border px-3 disabled:opacity-40",
1290
- children: "Next"
1465
+ "aria-label": `Open ${item.label}`,
1466
+ className: cn(linkButton, "max-w-full"),
1467
+ onClick: () => open(item.path, item.label),
1468
+ children: [
1469
+ /* @__PURE__ */ jsx3("span", { className: "min-w-0 break-words focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40", children: item.value }),
1470
+ /* @__PURE__ */ jsx3(ChevronRightIcon, { className: "size-3.5 shrink-0", "aria-hidden": "true" })
1471
+ ]
1291
1472
  }
1292
- )
1293
- ]
1294
- }
1295
- )
1296
- ] })
1297
- ] });
1473
+ ) : item.value })
1474
+ ] }, `${page.path}:${item.label}`)) }),
1475
+ page.total > page.items.length || offset > 0 ? /* @__PURE__ */ jsxs2(
1476
+ "nav",
1477
+ {
1478
+ "aria-label": "Detail pages",
1479
+ className: "mt-4 flex flex-wrap items-center justify-between gap-3 text-og-sm",
1480
+ children: [
1481
+ /* @__PURE__ */ jsx3(
1482
+ "button",
1483
+ {
1484
+ type: "button",
1485
+ disabled: offset === 0,
1486
+ onClick: () => setOffset(Math.max(0, offset - 25)),
1487
+ className: "min-h-11 rounded-og-md border border-og-border px-3 hover:bg-og-hover disabled:opacity-40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1488
+ children: "Previous"
1489
+ }
1490
+ ),
1491
+ /* @__PURE__ */ jsx3("span", { className: "text-og-fg-muted tabular-nums", children: page.total === 0 ? "No items" : `${(offset + 1).toLocaleString()}\u2013${(offset + page.items.length).toLocaleString()} of ${page.total.toLocaleString()}` }),
1492
+ /* @__PURE__ */ jsx3(
1493
+ "button",
1494
+ {
1495
+ type: "button",
1496
+ disabled: page.nextOffset === null,
1497
+ onClick: () => setOffset(page.nextOffset ?? offset),
1498
+ className: "min-h-11 rounded-og-md border border-og-border px-3 hover:bg-og-hover disabled:opacity-40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1499
+ children: "Next"
1500
+ }
1501
+ )
1502
+ ]
1503
+ }
1504
+ ) : null
1505
+ ] })
1506
+ ]
1507
+ }
1508
+ );
1298
1509
  }
1299
1510
 
1300
1511
  // src/components/approval-surface.tsx
1301
- import { useEffect as useEffect4, useRef as useRef4, useState as useState3 } from "react";
1512
+ import { useCallback, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4, useState as useState3 } from "react";
1513
+ import { dequal } from "dequal";
1514
+ import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2, ShieldCheckIcon as ShieldCheckIcon2 } from "lucide-react";
1302
1515
  import {
1303
1516
  OpenGeniApiError,
1304
1517
  toolReviewAction,
@@ -1313,10 +1526,14 @@ var defaultApprovalSurfaceMessages = {
1313
1526
  reject: "Decline",
1314
1527
  approving: "Approving\u2026",
1315
1528
  rejecting: "Declining\u2026",
1316
- formatToolName: (name) => name.includes("__") || /^[a-f0-9]{64}$/.test(name) ? toolDisplayName(name) : name.replaceAll("_", " ").replaceAll(".", " \u203A "),
1529
+ formatToolName: (name) => name.includes("__") || /^[a-f0-9]{64}$/.test(name) ? toolDisplayName(name) : humanToolName(name.replaceAll("_", " ").replaceAll(".", " \u203A ")),
1317
1530
  showDetails: "View full details",
1318
1531
  hideDetails: "Back to review"
1319
1532
  };
1533
+ function humanToolName(name) {
1534
+ const phrase = name.replace(/^batch\s+/i, "").trim();
1535
+ return phrase ? phrase.charAt(0).toUpperCase() + phrase.slice(1) : name;
1536
+ }
1320
1537
  function ApprovalSurface({
1321
1538
  approvals,
1322
1539
  onApprove,
@@ -1334,9 +1551,7 @@ function ApprovalSurface({
1334
1551
  }) {
1335
1552
  const messages = { ...defaultApprovalSurfaceMessages, ...overrides };
1336
1553
  const formatError = useErrorMessage();
1337
- const [pending, setPending] = useState3(
1338
- null
1339
- );
1554
+ const [pending, setPending] = useState3(null);
1340
1555
  const pendingRef = useRef4(null);
1341
1556
  const [decisionError, setDecisionError] = useState3(null);
1342
1557
  const [localSelectedId, setLocalSelectedId] = useState3(null);
@@ -1380,31 +1595,32 @@ function ApprovalSurface({
1380
1595
  {
1381
1596
  ref: surface,
1382
1597
  "aria-label": messages.title,
1383
- className: cn("og-root box-border w-full min-w-0 border-t border-og-border", className),
1598
+ className: cn("og-root box-border w-full min-w-0 space-y-2 py-2", className),
1384
1599
  "data-og-approval-surface": "",
1385
1600
  children: [
1386
1601
  approvals.length > 1 && /* @__PURE__ */ jsxs3(
1387
1602
  "nav",
1388
1603
  {
1389
1604
  "aria-label": "Actions to review",
1390
- className: "flex flex-wrap items-center justify-between gap-2 pt-3 text-og-xs text-og-fg-muted",
1605
+ className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-og-xs text-og-fg-muted",
1391
1606
  children: [
1392
- /* @__PURE__ */ jsxs3("span", { children: [
1607
+ /* @__PURE__ */ jsxs3("span", { className: "font-medium text-og-status-waiting", children: [
1393
1608
  approvals.length,
1394
- " actions need review"
1609
+ " actions are waiting for you"
1395
1610
  ] }),
1396
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
1611
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1", children: [
1397
1612
  /* @__PURE__ */ jsx4(
1398
1613
  "button",
1399
1614
  {
1400
1615
  type: "button",
1616
+ "aria-label": "Previous action",
1401
1617
  disabled: selectedIndex === 0,
1402
1618
  onClick: () => setSelectedId(approvals[selectedIndex - 1].id),
1403
- className: "min-h-11 disabled:opacity-40",
1404
- children: "Previous"
1619
+ className: "inline-flex min-h-8 min-w-8 items-center justify-center rounded-og-md hover:bg-og-hover hover:text-og-fg disabled:opacity-40 disabled:hover:bg-transparent [@media(pointer:coarse)]:min-h-11 [@media(pointer:coarse)]:min-w-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1620
+ children: /* @__PURE__ */ jsx4(ChevronLeftIcon, { className: "size-4", "aria-hidden": "true" })
1405
1621
  }
1406
1622
  ),
1407
- /* @__PURE__ */ jsxs3("span", { children: [
1623
+ /* @__PURE__ */ jsxs3("span", { className: "tabular-nums", "aria-live": "polite", children: [
1408
1624
  selectedIndex + 1,
1409
1625
  " of ",
1410
1626
  approvals.length
@@ -1413,17 +1629,18 @@ function ApprovalSurface({
1413
1629
  "button",
1414
1630
  {
1415
1631
  type: "button",
1632
+ "aria-label": "Next action",
1416
1633
  disabled: selectedIndex === approvals.length - 1,
1417
1634
  onClick: () => setSelectedId(approvals[selectedIndex + 1].id),
1418
- className: "min-h-11 disabled:opacity-40",
1419
- children: "Next"
1635
+ className: "inline-flex min-h-8 min-w-8 items-center justify-center rounded-og-md hover:bg-og-hover hover:text-og-fg disabled:opacity-40 disabled:hover:bg-transparent [@media(pointer:coarse)]:min-h-11 [@media(pointer:coarse)]:min-w-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1636
+ children: /* @__PURE__ */ jsx4(ChevronRightIcon2, { className: "size-4", "aria-hidden": "true" })
1420
1637
  }
1421
1638
  )
1422
1639
  ] })
1423
1640
  ]
1424
1641
  }
1425
1642
  ),
1426
- /* @__PURE__ */ jsx4("div", { className: "divide-y divide-og-border", children: [selected].map((approval) => /* @__PURE__ */ jsx4(
1643
+ /* @__PURE__ */ jsx4("div", { children: [selected].map((approval) => /* @__PURE__ */ jsx4(
1427
1644
  ApprovalRequest,
1428
1645
  {
1429
1646
  approval,
@@ -1439,7 +1656,7 @@ function ApprovalSurface({
1439
1656
  },
1440
1657
  approval.id
1441
1658
  )) }),
1442
- errorText && /* @__PURE__ */ jsx4("p", { role: "alert", className: "m-0 pb-3 text-og-sm text-og-status-failed", children: errorText })
1659
+ errorText && /* @__PURE__ */ jsx4("p", { role: "alert", className: "m-0 px-1 text-og-sm text-og-status-failed", children: errorText })
1443
1660
  ]
1444
1661
  }
1445
1662
  );
@@ -1453,71 +1670,165 @@ function ApprovalRequest({
1453
1670
  onViewDetails,
1454
1671
  ...actions
1455
1672
  }) {
1456
- const [loaded, setLoaded] = useState3(null);
1457
- const [failed, setFailed] = useState3(false);
1458
- const [legacy, setLegacy] = useState3(false);
1459
1673
  const [retry, setRetry] = useState3(0);
1674
+ const requestRef = useRef4({ approval, loadReview, retry });
1675
+ if (requestRef.current.loadReview !== loadReview || requestRef.current.retry !== retry || !dequal(requestRef.current.approval, approval)) {
1676
+ requestRef.current = { approval, loadReview, retry };
1677
+ }
1678
+ const request = requestRef.current;
1679
+ const [result, setResult] = useState3(null);
1680
+ const current = result?.request === request ? result : null;
1681
+ const loaded = current?.review;
1682
+ const failed = current?.failed;
1683
+ const legacy = current?.legacy;
1684
+ const denied = current?.denied;
1460
1685
  const [detailPath, setDetailPath] = useState3(null);
1461
1686
  useEffect4(() => {
1462
1687
  let active = true;
1463
- setLoaded(null);
1464
- setFailed(false);
1465
- setLegacy(false);
1466
- if (loadReview)
1467
- void loadReview(approval).then(
1688
+ if (request.loadReview)
1689
+ void request.loadReview(request.approval).then(
1468
1690
  (review2) => {
1469
1691
  if (active) {
1470
- if (review2.id !== approval.id) setFailed(true);
1471
- else setLoaded(review2);
1692
+ setResult(
1693
+ review2.id !== request.approval.id ? { request, failed: true } : { request, review: review2 }
1694
+ );
1472
1695
  }
1473
1696
  },
1474
1697
  (error) => {
1475
1698
  if (active) {
1476
- if (error instanceof OpenGeniApiError && error.status === 404 && approval.arguments !== void 0)
1477
- setLegacy(true);
1478
- else setFailed(true);
1699
+ if (error instanceof OpenGeniApiError && error.status === 404)
1700
+ setResult({ request, legacy: true });
1701
+ else if (error instanceof OpenGeniApiError && (error.status === 401 || error.status === 403))
1702
+ setResult({ request, failed: true, denied: true });
1703
+ else setResult({ request, failed: true });
1479
1704
  }
1480
1705
  }
1481
1706
  );
1482
1707
  return () => {
1483
1708
  active = false;
1484
1709
  };
1485
- }, [approval, retry, loadReview]);
1710
+ }, [request]);
1711
+ const stableApproval = request.approval;
1712
+ const { formatToolName, approve: approveLabel } = messages;
1713
+ const fallback2 = useMemo2(
1714
+ () => ({
1715
+ version: 1,
1716
+ id: stableApproval.id,
1717
+ actionDigest: "",
1718
+ revision: "legacy",
1719
+ status: "pending",
1720
+ ...toolReviewAction(stableApproval.name, stableApproval.arguments, {
1721
+ kind: "generic",
1722
+ title: stableApproval.display?.title ?? formatToolName(stableApproval.display?.toolName ?? stableApproval.name)
1723
+ }),
1724
+ ...stableApproval.display?.accountLabel ? { accountLabel: stableApproval.display.accountLabel } : {},
1725
+ ...toolReviewFields(stableApproval.arguments),
1726
+ reason: "",
1727
+ createdAt: "",
1728
+ updatedAt: "",
1729
+ approveLabel,
1730
+ availableActions: stableApproval.arguments === void 0 ? [] : ["approve", "reject"],
1731
+ detailsAvailable: stableApproval.arguments !== void 0
1732
+ }),
1733
+ [stableApproval, formatToolName, approveLabel]
1734
+ );
1735
+ const loadLegacyDetails = useCallback(
1736
+ async (value, path, offset) => ({
1737
+ version: 1,
1738
+ id: value.id,
1739
+ actionDigest: value.actionDigest,
1740
+ ...toolReviewDetails(stableApproval.arguments, void 0, path, offset)
1741
+ }),
1742
+ [stableApproval]
1743
+ );
1486
1744
  if (loadReview && !loaded && !failed && !legacy)
1487
- return /* @__PURE__ */ jsx4("div", { className: "py-5 text-og-sm text-og-fg-muted", role: "status", children: "Loading action details\u2026" });
1745
+ return /* @__PURE__ */ jsx4(
1746
+ ToolReviewFrame,
1747
+ {
1748
+ tone: "waiting",
1749
+ icon: /* @__PURE__ */ jsx4(ShieldCheckIcon2, { className: "size-4", "aria-hidden": "true" }),
1750
+ eyebrow: messages.title,
1751
+ title: fallback2.title,
1752
+ subtitle: fallback2.accountLabel,
1753
+ "aria-busy": true,
1754
+ "data-og-tool-review-loading": "",
1755
+ children: /* @__PURE__ */ jsxs3("div", { role: "status", className: "space-y-2", children: [
1756
+ /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Loading action details\u2026" }),
1757
+ /* @__PURE__ */ jsx4("div", { className: "h-3 w-3/4 animate-pulse rounded-og-sm bg-og-fg/8", "aria-hidden": "true" }),
1758
+ /* @__PURE__ */ jsx4("div", { className: "h-3 w-1/2 animate-pulse rounded-og-sm bg-og-fg/8", "aria-hidden": "true" })
1759
+ ] })
1760
+ }
1761
+ );
1762
+ if (denied)
1763
+ return /* @__PURE__ */ jsx4(
1764
+ ToolReviewFrame,
1765
+ {
1766
+ tone: "waiting",
1767
+ icon: /* @__PURE__ */ jsx4(ShieldCheckIcon2, { className: "size-4", "aria-hidden": "true" }),
1768
+ eyebrow: messages.title,
1769
+ title: fallback2.title,
1770
+ subtitle: fallback2.accountLabel,
1771
+ children: /* @__PURE__ */ jsx4("p", { role: "alert", className: "m-0 text-og-sm text-og-fg", children: "You don't have access to review this action. Ask someone with access to this chat to decide." })
1772
+ }
1773
+ );
1488
1774
  if (failed)
1489
- return /* @__PURE__ */ jsxs3("div", { className: "py-4 text-og-sm text-og-fg", role: "alert", children: [
1490
- "Action details could not be loaded.",
1491
- " ",
1775
+ return /* @__PURE__ */ jsx4(
1776
+ ToolReviewFrame,
1777
+ {
1778
+ tone: "waiting",
1779
+ icon: /* @__PURE__ */ jsx4(ShieldCheckIcon2, { className: "size-4", "aria-hidden": "true" }),
1780
+ eyebrow: messages.title,
1781
+ title: fallback2.title,
1782
+ subtitle: fallback2.accountLabel,
1783
+ footer: /* @__PURE__ */ jsx4("div", { className: "ml-auto", children: /* @__PURE__ */ jsx4(
1784
+ DeclineButton,
1785
+ {
1786
+ busy: Boolean(actions.disabled || actions.submitting),
1787
+ submitting: actions.submitting === "reject",
1788
+ label: messages.reject,
1789
+ onClick: actions.onReject
1790
+ }
1791
+ ) }),
1792
+ children: /* @__PURE__ */ jsxs3("p", { role: "alert", className: "m-0 text-og-sm text-og-fg", children: [
1793
+ "Couldn't load this action, so it can't be approved yet. You can still decline it.",
1794
+ " ",
1795
+ /* @__PURE__ */ jsx4(
1796
+ "button",
1797
+ {
1798
+ type: "button",
1799
+ className: "min-h-8 font-medium underline underline-offset-4 [@media(pointer:coarse)]:min-h-11 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
1800
+ onClick: () => setRetry((value) => value + 1),
1801
+ children: "Try again"
1802
+ }
1803
+ )
1804
+ ] })
1805
+ }
1806
+ );
1807
+ if (!loaded && stableApproval.arguments === void 0)
1808
+ return /* @__PURE__ */ jsxs3("div", { "data-approval-id": approval.id, "data-review-origin": "pending", children: [
1809
+ custom,
1492
1810
  /* @__PURE__ */ jsx4(
1493
- "button",
1811
+ ToolReviewFrame,
1494
1812
  {
1495
- type: "button",
1496
- className: "min-h-11 underline underline-offset-4",
1497
- onClick: () => setRetry((value) => value + 1),
1498
- children: "Try again"
1813
+ tone: "waiting",
1814
+ icon: /* @__PURE__ */ jsx4(ShieldCheckIcon2, { className: "size-4", "aria-hidden": "true" }),
1815
+ eyebrow: messages.title,
1816
+ title: fallback2.title,
1817
+ subtitle: fallback2.accountLabel,
1818
+ "data-og-tool-review": "",
1819
+ footer: /* @__PURE__ */ jsx4("div", { className: "ml-auto", children: /* @__PURE__ */ jsx4(
1820
+ DeclineButton,
1821
+ {
1822
+ busy: Boolean(actions.disabled || actions.submitting),
1823
+ submitting: actions.submitting === "reject",
1824
+ label: messages.reject,
1825
+ onClick: actions.onReject
1826
+ }
1827
+ ) }),
1828
+ children: /* @__PURE__ */ jsx4("p", { className: "m-0 text-og-sm text-og-fg", children: UNRECOVERABLE_TEXT })
1499
1829
  }
1500
1830
  )
1501
1831
  ] });
1502
- const fallback2 = {
1503
- version: 1,
1504
- id: approval.id,
1505
- actionDigest: "",
1506
- revision: "legacy",
1507
- status: "pending",
1508
- ...toolReviewAction(approval.name, approval.arguments, {
1509
- kind: "generic",
1510
- title: approval.display?.title ?? messages.formatToolName(approval.display?.toolName ?? approval.name)
1511
- }),
1512
- ...approval.display?.accountLabel ? { accountLabel: approval.display.accountLabel } : {},
1513
- ...toolReviewFields(approval.arguments),
1514
- reason: "This action requires your approval.",
1515
- createdAt: "",
1516
- updatedAt: "",
1517
- approveLabel: messages.approve,
1518
- availableActions: approval.arguments === void 0 ? [] : ["approve", "reject"],
1519
- detailsAvailable: approval.arguments !== void 0
1520
- };
1521
1832
  const review = loaded ?? fallback2;
1522
1833
  if (detailPath !== null)
1523
1834
  return /* @__PURE__ */ jsx4(
@@ -1525,12 +1836,7 @@ function ApprovalRequest({
1525
1836
  {
1526
1837
  review,
1527
1838
  path: detailPath,
1528
- load: loaded && loadDetails ? loadDetails : async (value, path, offset) => ({
1529
- version: 1,
1530
- id: value.id,
1531
- actionDigest: value.actionDigest,
1532
- ...toolReviewDetails(approval.arguments, void 0, path, offset)
1533
- }),
1839
+ load: loaded && loadDetails ? loadDetails : loadLegacyDetails,
1534
1840
  onBack: () => {
1535
1841
  const path = detailPath;
1536
1842
  setDetailPath(null);
@@ -1557,8 +1863,7 @@ function ApprovalRequest({
1557
1863
  rejectLabel: messages.reject,
1558
1864
  onViewDetails: loaded && onViewDetails ? (path) => onViewDetails(review, path) : loadDetails || !loaded ? setDetailPath : void 0
1559
1865
  }
1560
- ),
1561
- !loaded && approval.arguments === void 0 && /* @__PURE__ */ jsx4("p", { className: "pb-3 text-og-sm text-og-fg-muted", children: "Open the task with a compatible client to review this action." })
1866
+ )
1562
1867
  ] });
1563
1868
  }
1564
1869
 
@@ -1656,8 +1961,8 @@ function useStartupDetails() {
1656
1961
  }
1657
1962
 
1658
1963
  // src/components/tool-review-history.tsx
1659
- import { createContext as createContext2, useContext as useContext2, useEffect as useEffect5, useMemo as useMemo2, useState as useState5 } from "react";
1660
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1964
+ import { createContext as createContext2, useContext as useContext2, useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
1965
+ import { jsx as jsx6 } from "react/jsx-runtime";
1661
1966
  var History = createContext2(null);
1662
1967
  function ToolReviewHistoryProvider({
1663
1968
  events,
@@ -1665,7 +1970,7 @@ function ToolReviewHistoryProvider({
1665
1970
  onViewDetails,
1666
1971
  children
1667
1972
  }) {
1668
- const value = useMemo2(
1973
+ const value = useMemo3(
1669
1974
  () => ({
1670
1975
  approvalIds: new Set(
1671
1976
  events.flatMap(
@@ -1686,56 +1991,29 @@ function useHasToolReview(approvalId) {
1686
1991
  const history = useContext2(History);
1687
1992
  return Boolean(approvalId && history?.approvalIds.has(approvalId));
1688
1993
  }
1689
- function ToolReviewHistoryReceipt({ approvalId }) {
1994
+ function useRecordedToolReview(approvalId) {
1690
1995
  const history = useContext2(History);
1691
1996
  const [review, setReview] = useState5(null);
1692
- const [failed, setFailed] = useState5(false);
1693
- const [retry, setRetry] = useState5(0);
1694
1997
  const load = history?.load;
1695
1998
  const revision = history?.revision;
1696
1999
  useEffect5(() => {
1697
- if (!load) return;
2000
+ if (!load || !approvalId) return;
1698
2001
  let active = true;
1699
- setFailed(false);
1700
2002
  void load(approvalId).then(
1701
2003
  (value) => {
1702
- if (active) {
1703
- if (value.id === approvalId) setReview(value);
1704
- else setFailed(true);
1705
- }
2004
+ if (active && value.id === approvalId) setReview(value);
1706
2005
  },
1707
- () => {
1708
- if (active) setFailed(true);
1709
- }
2006
+ () => void 0
1710
2007
  );
1711
2008
  return () => {
1712
2009
  active = false;
1713
2010
  };
1714
- }, [approvalId, load, revision, retry]);
1715
- if (!history) return null;
1716
- if (failed)
1717
- return /* @__PURE__ */ jsxs5("p", { className: "text-og-sm text-og-fg-muted", role: "alert", children: [
1718
- "Review details unavailable.",
1719
- " ",
1720
- /* @__PURE__ */ jsx6(
1721
- "button",
1722
- {
1723
- type: "button",
1724
- className: "min-h-11 underline",
1725
- onClick: () => setRetry((value) => value + 1),
1726
- children: "Try again"
1727
- }
1728
- )
1729
- ] });
1730
- if (!review)
1731
- return /* @__PURE__ */ jsx6("p", { role: "status", className: "text-og-sm text-og-fg-muted", children: "Loading reviewed action\u2026" });
1732
- return /* @__PURE__ */ jsx6("div", { "data-approval-id": approvalId, "data-review-origin": "history", children: /* @__PURE__ */ jsx6(
1733
- ToolActionReviewCard,
1734
- {
1735
- review: { ...review, availableActions: [] },
1736
- onViewDetails: (path) => history.onViewDetails(review, path)
1737
- }
1738
- ) });
2011
+ }, [approvalId, load, revision]);
2012
+ const onViewDetails = history?.onViewDetails;
2013
+ return {
2014
+ review: review && review.id === approvalId ? review : null,
2015
+ onViewDetails: review && onViewDetails ? (path) => onViewDetails(review, path) : void 0
2016
+ };
1739
2017
  }
1740
2018
 
1741
2019
  // src/timeline/parsers.ts
@@ -2462,11 +2740,11 @@ function useTimelineComputeLabel() {
2462
2740
 
2463
2741
  // src/timeline/tool-diff.tsx
2464
2742
  import { useState as useState7 } from "react";
2465
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2743
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
2466
2744
  function ToolDiff({ files }) {
2467
2745
  const [layout, setLayout] = useState7("unified");
2468
2746
  const themeType = useThemeType(void 0);
2469
- return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2747
+ return /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
2470
2748
  /* @__PURE__ */ jsx8("div", { className: "mb-1.5 flex justify-end", children: /* @__PURE__ */ jsx8(LayoutToggle, { layout, onChange: setLayout }) }),
2471
2749
  /* @__PURE__ */ jsx8(PierreDiff, { diff: files, layout, themeType })
2472
2750
  ] });
@@ -2496,7 +2774,7 @@ function RawPatch({ diff }) {
2496
2774
  occurrences.set(line, occurrence);
2497
2775
  return { key: `${line}\0${occurrence}`, line };
2498
2776
  });
2499
- return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2777
+ return /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
2500
2778
  /* @__PURE__ */ jsx8("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: "raw patch (could not parse hunks)" }),
2501
2779
  /* @__PURE__ */ jsx8("pre", { className: "max-h-72 overflow-auto border-l-2 border-og-border pl-3 font-og-mono text-og-xs leading-5", children: lines.map(({ key, line }) => /* @__PURE__ */ jsx8(
2502
2780
  "span",
@@ -2513,11 +2791,11 @@ function RawPatch({ diff }) {
2513
2791
  }
2514
2792
 
2515
2793
  // src/timeline/tool-renderers.tsx
2516
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2794
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2517
2795
  var ICON_SIZE = "size-3.5";
2518
2796
  function RunningPreview({ children }) {
2519
2797
  const compact = useContext4(CompactActivityContext);
2520
- return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-1.5", children: [
2798
+ return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-1.5", children: [
2521
2799
  !compact && /* @__PURE__ */ jsx9("span", { className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-status-running" }),
2522
2800
  /* @__PURE__ */ jsx9("span", { className: "min-w-0 truncate", children })
2523
2801
  ] });
@@ -2597,7 +2875,7 @@ function ExecRenderer({ item }) {
2597
2875
  const truncated = execTruncated(text);
2598
2876
  const preview = withComputePreview(computeLabel, truncated ? `\u22EF truncated \xB7 ${peek}` : peek);
2599
2877
  const body = binary ? "(binary output suppressed)" : stripped;
2600
- return /* @__PURE__ */ jsxs7(
2878
+ return /* @__PURE__ */ jsxs6(
2601
2879
  ActivityDisclosure,
2602
2880
  {
2603
2881
  icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
@@ -2618,7 +2896,7 @@ function ExecRenderer({ item }) {
2618
2896
  failed: item.status === "failed" || exitCode != null && exitCode !== 0
2619
2897
  }
2620
2898
  ),
2621
- bgSession != null ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
2899
+ bgSession != null ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
2622
2900
  "\u21B3 session ",
2623
2901
  bgSession,
2624
2902
  " \u2014 a later write_stdin can target this PTY."
@@ -2646,7 +2924,7 @@ function WriteStdinRenderer({ item }) {
2646
2924
  titleMono: true,
2647
2925
  running: true,
2648
2926
  preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "sending\u2026" }),
2649
- children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
2927
+ children: /* @__PURE__ */ jsxs6(BodyNote, { children: [
2650
2928
  "sending input to session ",
2651
2929
  sessionId,
2652
2930
  "\u2026"
@@ -2694,12 +2972,12 @@ function PathPreview({
2694
2972
  add,
2695
2973
  del
2696
2974
  }) {
2697
- return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
2698
- /* @__PURE__ */ jsxs7("span", { className: "truncate", children: [
2975
+ return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
2976
+ /* @__PURE__ */ jsxs6("span", { className: "truncate", children: [
2699
2977
  /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: dirname(path) }),
2700
2978
  /* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(path) })
2701
2979
  ] }),
2702
- add != null || del != null ? /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-og-fg-subtle", children: [
2980
+ add != null || del != null ? /* @__PURE__ */ jsxs6("span", { className: "shrink-0 text-og-fg-subtle", children: [
2703
2981
  add != null ? `+${add}` : "",
2704
2982
  add != null && del != null ? " " : "",
2705
2983
  del != null ? `\u2212${del}` : ""
@@ -2726,7 +3004,7 @@ function ApplyPatchRenderer({ item }) {
2726
3004
  children: ops.map((op, index) => {
2727
3005
  const file2 = safeParseOp(op);
2728
3006
  const key = `${op.type}:${op.path}:${index}`;
2729
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs7("div", { children: [
3007
+ return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs6("div", { children: [
2730
3008
  /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2731
3009
  /* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
2732
3010
  ] }, key);
@@ -2759,12 +3037,12 @@ function ApplyPatchRenderer({ item }) {
2759
3037
  iconTone: "accent",
2760
3038
  title: `Edited ${ops.length} files`,
2761
3039
  cancelled,
2762
- preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
2763
- /* @__PURE__ */ jsxs7("span", { className: "text-og-fg-muted", children: [
3040
+ preview: /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
3041
+ /* @__PURE__ */ jsxs6("span", { className: "text-og-fg-muted", children: [
2764
3042
  ops.length,
2765
3043
  " files"
2766
3044
  ] }),
2767
- /* @__PURE__ */ jsxs7("span", { className: "text-og-fg-subtle", children: [
3045
+ /* @__PURE__ */ jsxs6("span", { className: "text-og-fg-subtle", children: [
2768
3046
  "+",
2769
3047
  add,
2770
3048
  " \u2212",
@@ -2774,7 +3052,7 @@ function ApplyPatchRenderer({ item }) {
2774
3052
  children: ops.map((op, index) => {
2775
3053
  const file2 = parsed[index];
2776
3054
  const key = `${op.type}:${op.path}:${index}`;
2777
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs7("div", { children: [
3055
+ return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs6("div", { children: [
2778
3056
  /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2779
3057
  /* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
2780
3058
  ] }, key);
@@ -2807,7 +3085,7 @@ function ApplyPatchRenderer({ item }) {
2807
3085
  iconTone: "accent",
2808
3086
  title: `${verbForOp(firstOp)} ${basename(firstOp.path)}`,
2809
3087
  cancelled,
2810
- preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
3088
+ preview: /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
2811
3089
  /* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
2812
3090
  /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
2813
3091
  ] }),
@@ -2882,7 +3160,10 @@ function asComputerArgs(args) {
2882
3160
  }
2883
3161
  function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
2884
3162
  const raw = item.raw ?? {};
2885
- const functionAction = !raw.action && item.name.startsWith("computer_") && item.name !== "computer_call" ? { type: item.name.slice("computer_".length), ...asComputerArgs(item.arguments) } : void 0;
3163
+ const functionAction = !raw.action && item.name.startsWith("computer_") && item.name !== "computer_call" ? {
3164
+ type: item.name.slice("computer_".length),
3165
+ ...asComputerArgs(item.arguments)
3166
+ } : void 0;
2886
3167
  const action = raw.action ?? functionAction;
2887
3168
  const actions = raw.actions ?? (action ? [action] : []);
2888
3169
  const verb = computerVerb(action);
@@ -2950,7 +3231,7 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
2950
3231
  cancelled: isCancelled,
2951
3232
  preview: `screenshot ${state}`,
2952
3233
  media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
2953
- children: /* @__PURE__ */ jsxs7(BodyNote, { tone: isFailed ? "error" : void 0, children: [
3234
+ children: /* @__PURE__ */ jsxs6(BodyNote, { tone: isFailed ? "error" : void 0, children: [
2954
3235
  "Screenshot ",
2955
3236
  state,
2956
3237
  ": ",
@@ -2978,7 +3259,7 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
2978
3259
  }
2979
3260
  if (shotUrl) {
2980
3261
  const caption = `${verb}${actions.length > 1 ? ` (+${actions.length - 1} more)` : ""}`;
2981
- return /* @__PURE__ */ jsxs7(
3262
+ return /* @__PURE__ */ jsxs6(
2982
3263
  ActivityDisclosure,
2983
3264
  {
2984
3265
  icon: isShot ? /* @__PURE__ */ jsx9(CameraIcon, { className: ICON_SIZE }) : /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
@@ -2989,7 +3270,7 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
2989
3270
  media: /* @__PURE__ */ jsx9(Thumbnail, { src: shotUrl, caption }),
2990
3271
  children: [
2991
3272
  /* @__PURE__ */ jsx9(ScreenshotFigure, { src: shotUrl, caption }),
2992
- batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3273
+ batched ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
2993
3274
  "batched: ",
2994
3275
  batched
2995
3276
  ] }) : null
@@ -2998,7 +3279,7 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
2998
3279
  );
2999
3280
  }
3000
3281
  if (omittedMedia) {
3001
- return /* @__PURE__ */ jsxs7(
3282
+ return /* @__PURE__ */ jsxs6(
3002
3283
  ActivityDisclosure,
3003
3284
  {
3004
3285
  icon: /* @__PURE__ */ jsx9(CameraOffIcon, { className: ICON_SIZE }),
@@ -3009,12 +3290,12 @@ function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
3009
3290
  preview: "inline image omitted \xB7 not retained",
3010
3291
  media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3011
3292
  children: [
3012
- /* @__PURE__ */ jsxs7(BodyNote, { children: [
3293
+ /* @__PURE__ */ jsxs6(BodyNote, { children: [
3013
3294
  "The inline ",
3014
3295
  omittedMedia.mediaType,
3015
3296
  " output was omitted from the audit timeline and its source bytes were not retained."
3016
3297
  ] }),
3017
- batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3298
+ batched ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3018
3299
  "batched: ",
3019
3300
  batched
3020
3301
  ] }) : null
@@ -3083,7 +3364,7 @@ function BrowserScreenshotRenderer(props) {
3083
3364
  cancelled: isCancelled,
3084
3365
  preview: `screenshot ${state}`,
3085
3366
  media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3086
- children: /* @__PURE__ */ jsxs7(BodyNote, { tone: isFailed ? "error" : void 0, children: [
3367
+ children: /* @__PURE__ */ jsxs6(BodyNote, { tone: isFailed ? "error" : void 0, children: [
3087
3368
  "Screenshot ",
3088
3369
  state,
3089
3370
  ": ",
@@ -3150,7 +3431,7 @@ function LoadedRetainedSessionImageDisclosure({
3150
3431
  lightboxLabel,
3151
3432
  downloadFilename
3152
3433
  };
3153
- return /* @__PURE__ */ jsxs7(
3434
+ return /* @__PURE__ */ jsxs6(
3154
3435
  ActivityDisclosure,
3155
3436
  {
3156
3437
  icon,
@@ -3162,17 +3443,17 @@ function LoadedRetainedSessionImageDisclosure({
3162
3443
  preview: state.kind === "loading" ? `loading retained ${noun}\u2026` : state.kind === "error" ? `${noun} retrieval failed` : state.kind === "unavailable" ? `${noun} ${state.label}` : void 0,
3163
3444
  media: state.kind === "ready" ? /* @__PURE__ */ jsx9(Thumbnail, { ...figure }) : state.kind === "loading" ? /* @__PURE__ */ jsx9(MediaSkeleton, {}) : /* @__PURE__ */ jsx9(MediaEmpty, {}),
3164
3445
  children: [
3165
- state.kind === "ready" ? /* @__PURE__ */ jsx9(ScreenshotFigure, { ...figure }) : state.kind === "loading" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3446
+ state.kind === "ready" ? /* @__PURE__ */ jsx9(ScreenshotFigure, { ...figure }) : state.kind === "loading" ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3166
3447
  "Loading the retained ",
3167
3448
  noun,
3168
3449
  "\u2026"
3169
- ] }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3450
+ ] }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3170
3451
  noun === "screenshot" ? "Screenshot" : "Image",
3171
3452
  " ",
3172
3453
  state.label,
3173
3454
  "."
3174
3455
  ] }) : /* @__PURE__ */ jsx9(ImageRetrievalError, { noun, retry: state.retry }),
3175
- batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3456
+ batched ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3176
3457
  "batched: ",
3177
3458
  batched
3178
3459
  ] }) : null,
@@ -3182,7 +3463,7 @@ function LoadedRetainedSessionImageDisclosure({
3182
3463
  );
3183
3464
  }
3184
3465
  function ImageRetrievalError({ noun = "image", retry }) {
3185
- return /* @__PURE__ */ jsxs7(BodyNote, { tone: "error", children: [
3466
+ return /* @__PURE__ */ jsxs6(BodyNote, { tone: "error", children: [
3186
3467
  noun === "screenshot" ? "Screenshot" : "Image",
3187
3468
  " retrieval failed.",
3188
3469
  " ",
@@ -3237,7 +3518,7 @@ function GeneratedVideoRenderer({ item }) {
3237
3518
  const failed = item.status === "failed";
3238
3519
  const cancelled = item.status === "cancelled";
3239
3520
  const running = item.status === "running";
3240
- return /* @__PURE__ */ jsxs7(
3521
+ return /* @__PURE__ */ jsxs6(
3241
3522
  ActivityDisclosure,
3242
3523
  {
3243
3524
  icon: /* @__PURE__ */ jsx9(VideoIcon, { className: ICON_SIZE }),
@@ -3315,7 +3596,7 @@ function SandboxFilePublishRenderer({ item, loadRetainedArtifact }) {
3315
3596
  if (urlToRevoke) setTimeout(() => URL.revokeObjectURL(urlToRevoke), 0);
3316
3597
  }
3317
3598
  };
3318
- const downloadButton = /* @__PURE__ */ jsxs7(
3599
+ const downloadButton = /* @__PURE__ */ jsxs6(
3319
3600
  "button",
3320
3601
  {
3321
3602
  type: "button",
@@ -3329,7 +3610,7 @@ function SandboxFilePublishRenderer({ item, loadRetainedArtifact }) {
3329
3610
  }
3330
3611
  );
3331
3612
  if (isRetainedImageContentType(receipt.artifact.contentType)) {
3332
- return /* @__PURE__ */ jsxs7(
3613
+ return /* @__PURE__ */ jsxs6(
3333
3614
  RetainedSessionImageDisclosure,
3334
3615
  {
3335
3616
  artifact: receipt.artifact,
@@ -3351,7 +3632,7 @@ function SandboxFilePublishRenderer({ item, loadRetainedArtifact }) {
3351
3632
  }
3352
3633
  );
3353
3634
  }
3354
- return /* @__PURE__ */ jsxs7(
3635
+ return /* @__PURE__ */ jsxs6(
3355
3636
  ActivityDisclosure,
3356
3637
  {
3357
3638
  icon: /* @__PURE__ */ jsx9(DownloadIcon, { className: ICON_SIZE }),
@@ -3460,7 +3741,7 @@ function SiteArtifactRenderer({ item }) {
3460
3741
  iconTone: "accent",
3461
3742
  title: publishingExisting ? `Updated ${receipt.title}` : `Published ${receipt.title}`,
3462
3743
  media: /* @__PURE__ */ jsx9(SiteOpenLink, { receipt }),
3463
- children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
3744
+ children: /* @__PURE__ */ jsxs6(BodyNote, { children: [
3464
3745
  "Version ",
3465
3746
  receipt.revision,
3466
3747
  " is live",
@@ -3480,7 +3761,7 @@ function GeneratedImageDisclosure({
3480
3761
  const dimensions = receipt.artifact.dimensions;
3481
3762
  const title = failed ? "Image generation failed" : "Generated image";
3482
3763
  const caption = prompt || `Generated image \xB7 ${dimensions.width}\xD7${dimensions.height}`;
3483
- return /* @__PURE__ */ jsxs7(
3764
+ return /* @__PURE__ */ jsxs6(
3484
3765
  ActivityDisclosure,
3485
3766
  {
3486
3767
  icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
@@ -3510,12 +3791,12 @@ function GeneratedImageDisclosure({
3510
3791
  expandLabel: "Expand generated image",
3511
3792
  lightboxLabel: "Generated image"
3512
3793
  }
3513
- ) : state.kind === "loading" ? /* @__PURE__ */ jsx9(BodyNote, { children: "Loading the generated image\u2026" }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
3794
+ ) : state.kind === "loading" ? /* @__PURE__ */ jsx9(BodyNote, { children: "Loading the generated image\u2026" }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3514
3795
  "Image ",
3515
3796
  state.label,
3516
3797
  "."
3517
3798
  ] }) : /* @__PURE__ */ jsx9(ImageRetrievalError, { retry: state.retry }),
3518
- /* @__PURE__ */ jsxs7(BodyNote, { children: [
3799
+ /* @__PURE__ */ jsxs6(BodyNote, { children: [
3519
3800
  dimensions.width,
3520
3801
  "\xD7",
3521
3802
  dimensions.height,
@@ -3607,10 +3888,10 @@ function WebSearchRenderer({ item }) {
3607
3888
  preview: `${query}${variants}`,
3608
3889
  failed: item.status === "failed",
3609
3890
  cancelled: item.status === "cancelled",
3610
- children: keyedResults && keyedResults.length ? /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs7("li", { className: "flex gap-2.5", children: [
3891
+ children: keyedResults && keyedResults.length ? /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs6("li", { className: "flex gap-2.5", children: [
3611
3892
  /* @__PURE__ */ jsx9(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
3612
- /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
3613
- /* @__PURE__ */ jsxs7("p", { className: "truncate text-og-base text-og-fg", children: [
3893
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
3894
+ /* @__PURE__ */ jsxs6("p", { className: "truncate text-og-base text-og-fg", children: [
3614
3895
  result.title,
3615
3896
  " ",
3616
3897
  /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
@@ -3665,7 +3946,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
3665
3946
  cancelled: viewCancelled,
3666
3947
  preview: `image ${state}`,
3667
3948
  media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3668
- children: /* @__PURE__ */ jsxs7(BodyNote, { tone: viewFailed ? "error" : void 0, children: [
3949
+ children: /* @__PURE__ */ jsxs6(BodyNote, { tone: viewFailed ? "error" : void 0, children: [
3669
3950
  "Image ",
3670
3951
  state,
3671
3952
  ": ",
@@ -3731,7 +4012,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
3731
4012
  cancelled: viewCancelled,
3732
4013
  preview: "inline image omitted \xB7 not retained",
3733
4014
  media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3734
- children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
4015
+ children: /* @__PURE__ */ jsxs6(BodyNote, { children: [
3735
4016
  "The inline ",
3736
4017
  omittedMedia.mediaType,
3737
4018
  " output was omitted from the audit timeline and its source bytes were not retained."
@@ -3787,7 +4068,7 @@ function SecretSetRenderer({ item }) {
3787
4068
  }
3788
4069
  if (item.status === "failed") {
3789
4070
  const errorText = typeof item.output === "string" ? item.output : null;
3790
- return /* @__PURE__ */ jsxs7(
4071
+ return /* @__PURE__ */ jsxs6(
3791
4072
  ActivityDisclosure,
3792
4073
  {
3793
4074
  icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
@@ -3802,7 +4083,7 @@ function SecretSetRenderer({ item }) {
3802
4083
  }
3803
4084
  );
3804
4085
  }
3805
- return /* @__PURE__ */ jsxs7(
4086
+ return /* @__PURE__ */ jsxs6(
3806
4087
  ActivityDisclosure,
3807
4088
  {
3808
4089
  icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
@@ -3909,7 +4190,7 @@ function ToolSearchRenderer({ item }) {
3909
4190
  const running = item.status === "running";
3910
4191
  const queryPreview = query ? truncatePreview(query, 64) : "";
3911
4192
  if (running) {
3912
- return /* @__PURE__ */ jsxs7(
4193
+ return /* @__PURE__ */ jsxs6(
3913
4194
  ActivityDisclosure,
3914
4195
  {
3915
4196
  icon,
@@ -3918,7 +4199,7 @@ function ToolSearchRenderer({ item }) {
3918
4199
  running: true,
3919
4200
  preview: queryPreview ? /* @__PURE__ */ jsx9(RunningPreview, { children: queryPreview }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Matching capabilities\u2026" }),
3920
4201
  children: [
3921
- query ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
4202
+ query ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3922
4203
  "capability query: ",
3923
4204
  query
3924
4205
  ] }) : null,
@@ -3929,7 +4210,7 @@ function ToolSearchRenderer({ item }) {
3929
4210
  }
3930
4211
  const { text: outText, isError } = unwrapMcpOutput(item.output);
3931
4212
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
3932
- return /* @__PURE__ */ jsxs7(
4213
+ return /* @__PURE__ */ jsxs6(
3933
4214
  ActivityDisclosure,
3934
4215
  {
3935
4216
  icon,
@@ -3938,7 +4219,7 @@ function ToolSearchRenderer({ item }) {
3938
4219
  failed: true,
3939
4220
  preview: truncatePreview(outText, 80) || queryPreview || "Lookup failed",
3940
4221
  children: [
3941
- query ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
4222
+ query ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3942
4223
  "capability query: ",
3943
4224
  query
3944
4225
  ] }) : null,
@@ -3950,7 +4231,7 @@ function ToolSearchRenderer({ item }) {
3950
4231
  }
3951
4232
  const tools = parseDisclosedTools(item.output);
3952
4233
  const preview = toolSearchPreview(tools, item.status === "cancelled");
3953
- return /* @__PURE__ */ jsxs7(
4234
+ return /* @__PURE__ */ jsxs6(
3954
4235
  ActivityDisclosure,
3955
4236
  {
3956
4237
  icon,
@@ -3959,16 +4240,16 @@ function ToolSearchRenderer({ item }) {
3959
4240
  cancelled: item.status === "cancelled",
3960
4241
  preview,
3961
4242
  children: [
3962
- query ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
4243
+ query ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
3963
4244
  "capability query: ",
3964
4245
  query
3965
4246
  ] }) : null,
3966
- tools && tools.length > 0 ? /* @__PURE__ */ jsxs7("ul", { className: "grid gap-1.5", children: [
3967
- tools.slice(0, 12).map((tool) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-baseline gap-2", children: [
4247
+ tools && tools.length > 0 ? /* @__PURE__ */ jsxs6("ul", { className: "grid gap-1.5", children: [
4248
+ tools.slice(0, 12).map((tool) => /* @__PURE__ */ jsxs6("li", { className: "flex min-w-0 items-baseline gap-2", children: [
3968
4249
  tool.source ? /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-og-xs text-og-fg-subtle", children: tool.source }) : null,
3969
4250
  /* @__PURE__ */ jsx9("span", { className: "truncate font-mono text-og-sm text-og-fg", children: tool.leaf })
3970
4251
  ] }, tool.name)),
3971
- tools.length > 12 ? /* @__PURE__ */ jsxs7("li", { className: "text-og-xs text-og-fg-muted", children: [
4252
+ tools.length > 12 ? /* @__PURE__ */ jsxs6("li", { className: "text-og-xs text-og-fg-muted", children: [
3972
4253
  "+",
3973
4254
  tools.length - 12,
3974
4255
  " more"
@@ -4000,7 +4281,7 @@ function DocsSearchRenderer({ item }) {
4000
4281
  }
4001
4282
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4002
4283
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4003
- return /* @__PURE__ */ jsxs7(
4284
+ return /* @__PURE__ */ jsxs6(
4004
4285
  ActivityDisclosure,
4005
4286
  {
4006
4287
  icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
@@ -4017,7 +4298,7 @@ function DocsSearchRenderer({ item }) {
4017
4298
  }
4018
4299
  const hits = parseSearchHits(outText);
4019
4300
  const preview = item.status === "cancelled" ? void 0 : hits ? hits.length === 0 ? "No hits" : `${hits.length} hit${hits.length === 1 ? "" : "s"}` : "Done";
4020
- return /* @__PURE__ */ jsxs7(
4301
+ return /* @__PURE__ */ jsxs6(
4021
4302
  ActivityDisclosure,
4022
4303
  {
4023
4304
  icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
@@ -4026,7 +4307,7 @@ function DocsSearchRenderer({ item }) {
4026
4307
  cancelled: item.status === "cancelled",
4027
4308
  preview,
4028
4309
  children: [
4029
- hits && hits.length > 0 ? /* @__PURE__ */ jsx9("ul", { className: "grid gap-2", children: hits.slice(0, 8).map((hit) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
4310
+ hits && hits.length > 0 ? /* @__PURE__ */ jsx9("ul", { className: "grid gap-2", children: hits.slice(0, 8).map((hit) => /* @__PURE__ */ jsxs6("li", { className: "min-w-0", children: [
4030
4311
  /* @__PURE__ */ jsx9("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
4031
4312
  hit.snippet ? /* @__PURE__ */ jsx9("div", { className: "mt-0.5 line-clamp-2 text-og-xs text-og-fg-muted", children: hit.snippet }) : null
4032
4313
  ] }, `${hit.title}\0${hit.snippet}`)) }) : null,
@@ -4057,7 +4338,7 @@ function SetSessionTitleRenderer({ item }) {
4057
4338
  }
4058
4339
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4059
4340
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4060
- return /* @__PURE__ */ jsxs7(
4341
+ return /* @__PURE__ */ jsxs6(
4061
4342
  ActivityDisclosure,
4062
4343
  {
4063
4344
  icon,
@@ -4082,7 +4363,7 @@ function SetSessionTitleRenderer({ item }) {
4082
4363
  }
4083
4364
  }
4084
4365
  }
4085
- return /* @__PURE__ */ jsxs7(
4366
+ return /* @__PURE__ */ jsxs6(
4086
4367
  ActivityDisclosure,
4087
4368
  {
4088
4369
  icon,
@@ -4133,7 +4414,7 @@ function MemoryProposeRenderer({ item }) {
4133
4414
  }
4134
4415
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4135
4416
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4136
- return /* @__PURE__ */ jsxs7(
4417
+ return /* @__PURE__ */ jsxs6(
4137
4418
  ActivityDisclosure,
4138
4419
  {
4139
4420
  icon: /* @__PURE__ */ jsx9(BrainCircuitIcon2, { className: ICON_SIZE }),
@@ -4148,7 +4429,7 @@ function MemoryProposeRenderer({ item }) {
4148
4429
  }
4149
4430
  );
4150
4431
  }
4151
- return /* @__PURE__ */ jsxs7(
4432
+ return /* @__PURE__ */ jsxs6(
4152
4433
  ActivityDisclosure,
4153
4434
  {
4154
4435
  icon: /* @__PURE__ */ jsx9(BrainCircuitIcon2, { className: ICON_SIZE }),
@@ -4201,7 +4482,7 @@ function AskRenderer({ item }) {
4201
4482
  }
4202
4483
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4203
4484
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4204
- return /* @__PURE__ */ jsxs7(
4485
+ return /* @__PURE__ */ jsxs6(
4205
4486
  ActivityDisclosure,
4206
4487
  {
4207
4488
  icon,
@@ -4216,7 +4497,7 @@ function AskRenderer({ item }) {
4216
4497
  }
4217
4498
  );
4218
4499
  }
4219
- return /* @__PURE__ */ jsxs7(
4500
+ return /* @__PURE__ */ jsxs6(
4220
4501
  ActivityDisclosure,
4221
4502
  {
4222
4503
  icon,
@@ -4278,7 +4559,7 @@ function RunOnRenderer({ item }) {
4278
4559
  }
4279
4560
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4280
4561
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4281
- return /* @__PURE__ */ jsxs7(
4562
+ return /* @__PURE__ */ jsxs6(
4282
4563
  ActivityDisclosure,
4283
4564
  {
4284
4565
  icon,
@@ -4293,7 +4574,7 @@ function RunOnRenderer({ item }) {
4293
4574
  }
4294
4575
  );
4295
4576
  }
4296
- return /* @__PURE__ */ jsxs7(
4577
+ return /* @__PURE__ */ jsxs6(
4297
4578
  ActivityDisclosure,
4298
4579
  {
4299
4580
  icon,
@@ -4310,9 +4591,53 @@ function RunOnRenderer({ item }) {
4310
4591
  }
4311
4592
  function GenericRenderer({ item }) {
4312
4593
  const reviewed = useHasToolReview(item.callId);
4313
- if (reviewed && item.callId) return /* @__PURE__ */ jsx9(ToolReviewHistoryReceipt, { approvalId: item.callId });
4594
+ if (reviewed && item.callId) return /* @__PURE__ */ jsx9(ReviewedGenericRenderer, { item });
4314
4595
  return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
4315
4596
  }
4597
+ var REVIEW_CHIP = {
4598
+ rejected: { tone: "interrupted", text: "declined" },
4599
+ cancelled: { tone: "interrupted", text: "not run" },
4600
+ expired: { tone: "interrupted", text: "expired" },
4601
+ stale: { tone: "interrupted", text: "not run" },
4602
+ revoked: { tone: "interrupted", text: "not run" },
4603
+ blocked: { tone: "interrupted", text: "blocked" },
4604
+ unknown: { tone: "bad", text: "outcome unknown" },
4605
+ partial: { tone: "bad", text: "partly done" },
4606
+ failed: { tone: "bad", text: "failed" }
4607
+ };
4608
+ function ReviewedGenericRenderer({ item }) {
4609
+ const { review, onViewDetails } = useRecordedToolReview(item.callId);
4610
+ if (!review) return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
4611
+ const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
4612
+ const waiting = review.status === "pending";
4613
+ const running = !waiting && (review.status === "executing" || review.status === "approved") && item.status === "running";
4614
+ const { text: outText, isError } = unwrapMcpOutput(item.output);
4615
+ const chip = REVIEW_CHIP[review.status] ?? (isError && !running && !waiting ? { tone: "bad", text: "error" } : void 0);
4616
+ return /* @__PURE__ */ jsxs6(
4617
+ ActivityDisclosure,
4618
+ {
4619
+ icon,
4620
+ iconTone: chip?.tone === "bad" ? "failed" : waiting ? "accent" : "muted",
4621
+ title: review.title,
4622
+ running,
4623
+ chip,
4624
+ preview: waiting ? "Waiting for your approval" : running ? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }) : review.accountLabel ?? void 0,
4625
+ children: [
4626
+ /* @__PURE__ */ jsx9("div", { className: "py-1", "data-approval-id": item.callId, "data-review-origin": "history", children: /* @__PURE__ */ jsx9(
4627
+ ToolActionReviewCard,
4628
+ {
4629
+ bare: true,
4630
+ review: { ...review, availableActions: [] },
4631
+ onViewDetails
4632
+ }
4633
+ ) }),
4634
+ outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText, failed: isError }) : null
4635
+ ]
4636
+ }
4637
+ );
4638
+ }
4639
+ var BLOCKED_OUTPUT = /Connector action was not executed: blocked\b/;
4640
+ var UNCERTAIN_OUTPUT = /Connector action outcome is uncertain\b/;
4316
4641
  function UnreviewedGenericRenderer({ item }) {
4317
4642
  const running = item.status === "running";
4318
4643
  const args = parseToolArgs(item.arguments);
@@ -4333,8 +4658,40 @@ function UnreviewedGenericRenderer({ item }) {
4333
4658
  );
4334
4659
  }
4335
4660
  const { text: outText, isError } = unwrapMcpOutput(item.output);
4661
+ if (isError && BLOCKED_OUTPUT.test(outText)) {
4662
+ return /* @__PURE__ */ jsxs6(
4663
+ ActivityDisclosure,
4664
+ {
4665
+ icon,
4666
+ iconTone: "muted",
4667
+ title: display,
4668
+ chip: { tone: "interrupted", text: "blocked" },
4669
+ preview: "Blocked by your permission settings",
4670
+ children: [
4671
+ /* @__PURE__ */ jsx9("p", { className: "m-0 py-1 text-og-sm text-og-fg-muted", children: "Your permission settings block this action, so it did not run. You can change this in the integration's tool permissions." }),
4672
+ /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
4673
+ ]
4674
+ }
4675
+ );
4676
+ }
4677
+ if (isError && UNCERTAIN_OUTPUT.test(outText)) {
4678
+ return /* @__PURE__ */ jsxs6(
4679
+ ActivityDisclosure,
4680
+ {
4681
+ icon,
4682
+ iconTone: "failed",
4683
+ title: display,
4684
+ chip: { tone: "bad", text: "outcome unknown" },
4685
+ preview: "It may have run",
4686
+ children: [
4687
+ /* @__PURE__ */ jsx9("p", { className: "m-0 py-1 text-og-sm text-og-fg-muted", children: "This action may have run. Check the result in the connected app before trying again." }),
4688
+ /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
4689
+ ]
4690
+ }
4691
+ );
4692
+ }
4336
4693
  if ((isError || item.status === "failed") && item.status !== "cancelled") {
4337
- return /* @__PURE__ */ jsxs7(
4694
+ return /* @__PURE__ */ jsxs6(
4338
4695
  ActivityDisclosure,
4339
4696
  {
4340
4697
  icon,
@@ -4349,7 +4706,7 @@ function UnreviewedGenericRenderer({ item }) {
4349
4706
  }
4350
4707
  );
4351
4708
  }
4352
- return /* @__PURE__ */ jsxs7(
4709
+ return /* @__PURE__ */ jsxs6(
4353
4710
  ActivityDisclosure,
4354
4711
  {
4355
4712
  icon,
@@ -4437,25 +4794,41 @@ var BASE_ENTRIES = [
4437
4794
  { match: "name", name: "apply_patch_call", render: ApplyPatchRenderer },
4438
4795
  { match: "name", name: "apply_patch", render: ApplyPatchRenderer },
4439
4796
  { match: "name", name: "computer_call", render: ComputerCallRenderer },
4440
- { match: "name", name: "browser_screenshot", render: BrowserScreenshotRenderer },
4797
+ {
4798
+ match: "name",
4799
+ name: "browser_screenshot",
4800
+ render: BrowserScreenshotRenderer
4801
+ },
4441
4802
  { match: "name", name: "browser_observe", render: BrowserScreenshotRenderer },
4442
4803
  { match: "name", name: "browser_act", render: BrowserScreenshotRenderer },
4443
4804
  // Function-mode computer tools (codex / chat-wire transports).
4444
4805
  { match: "name", name: "computer_screenshot", render: ComputerCallRenderer },
4445
4806
  { match: "name", name: "computer_click", render: ComputerCallRenderer },
4446
- { match: "name", name: "computer_double_click", render: ComputerCallRenderer },
4807
+ {
4808
+ match: "name",
4809
+ name: "computer_double_click",
4810
+ render: ComputerCallRenderer
4811
+ },
4447
4812
  { match: "name", name: "computer_move", render: ComputerCallRenderer },
4448
4813
  { match: "name", name: "computer_scroll", render: ComputerCallRenderer },
4449
4814
  { match: "name", name: "computer_type", render: ComputerCallRenderer },
4450
4815
  { match: "name", name: "computer_keypress", render: ComputerCallRenderer },
4451
4816
  { match: "name", name: "computer_drag", render: ComputerCallRenderer },
4452
4817
  { match: "name", name: "web_search_call", render: WebSearchRenderer },
4453
- { match: "name", name: "image_generation_call", render: GeneratedImageRenderer },
4818
+ {
4819
+ match: "name",
4820
+ name: "image_generation_call",
4821
+ render: GeneratedImageRenderer
4822
+ },
4454
4823
  { match: "name", name: "generate_image", render: GeneratedImageRenderer },
4455
4824
  { match: "name", name: "generate_video", render: GeneratedVideoRenderer },
4456
4825
  { match: "name", name: "tool_search", render: ToolSearchRenderer },
4457
4826
  { match: "name", name: "view_image", render: ViewImageRenderer },
4458
- { match: "name", name: "sandbox_file_publish", render: SandboxFilePublishRenderer },
4827
+ {
4828
+ match: "name",
4829
+ name: "sandbox_file_publish",
4830
+ render: SandboxFilePublishRenderer
4831
+ },
4459
4832
  {
4460
4833
  match: "name",
4461
4834
  name: "artifacts_create",
@@ -4480,13 +4853,25 @@ var BASE_ENTRIES = [
4480
4853
  render: SiteArtifactRenderer,
4481
4854
  matchPrefixedLeaf: false
4482
4855
  },
4483
- { match: "name", name: "environment_set_variable", render: SecretSetRenderer },
4484
- { match: "name", name: "variable_set_set_variable", render: SecretSetRenderer },
4856
+ {
4857
+ match: "name",
4858
+ name: "environment_set_variable",
4859
+ render: SecretSetRenderer
4860
+ },
4861
+ {
4862
+ match: "name",
4863
+ name: "variable_set_set_variable",
4864
+ render: SecretSetRenderer
4865
+ },
4485
4866
  { match: "name", name: "search_documents", render: DocsSearchRenderer },
4486
4867
  { match: "name", name: "knowledge_search", render: DocsSearchRenderer },
4487
4868
  { match: "name", name: "memory_propose", render: MemoryProposeRenderer },
4488
4869
  { match: "name", name: "set_session_title", render: SetSessionTitleRenderer },
4489
- { match: "name", name: "set_other_session_title", render: SetSessionTitleRenderer }
4870
+ {
4871
+ match: "name",
4872
+ name: "set_other_session_title",
4873
+ render: SetSessionTitleRenderer
4874
+ }
4490
4875
  ];
4491
4876
  var defaultToolRegistry = createToolRegistry(BASE_ENTRIES, GenericRenderer);
4492
4877
  function createDefaultToolRegistry(options = {}) {
@@ -4499,7 +4884,7 @@ import { AnimatePresence, motion, useReducedMotion } from "motion/react";
4499
4884
  // src/timeline/genie-loading.tsx
4500
4885
  import { ThinkingOrb } from "thinking-orbs";
4501
4886
  import { createContext as createContext4, useContext as useContext5, useEffect as useEffect7, useState as useState9 } from "react";
4502
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
4887
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
4503
4888
  var GenieLoadingOptionsContext = createContext4(void 0);
4504
4889
  var PHRASES = [
4505
4890
  "Polishing the lamp\u2026",
@@ -4545,7 +4930,7 @@ function GenieLoading({
4545
4930
  }, [startedAt, phrases]);
4546
4931
  if (options?.render && !notice)
4547
4932
  return options.render({ startedAt, phase, detailsOpen, onShowDetails });
4548
- return /* @__PURE__ */ jsxs8("div", { className: "og-genie-loading", children: [
4933
+ return /* @__PURE__ */ jsxs7("div", { className: "og-genie-loading", children: [
4549
4934
  /* @__PURE__ */ jsx10(
4550
4935
  "div",
4551
4936
  {
@@ -4559,7 +4944,7 @@ function GenieLoading({
4559
4944
  children: /* @__PURE__ */ jsx10(ThinkingOrb, { state: "searching", size: 64, theme, speed: 0.8, ...options?.orb })
4560
4945
  }
4561
4946
  ),
4562
- /* @__PURE__ */ jsxs8("div", { className: "og-genie-copy", children: [
4947
+ /* @__PURE__ */ jsxs7("div", { className: "og-genie-copy", children: [
4563
4948
  /* @__PURE__ */ jsx10("span", { className: "sr-only", role: "status", children: notice ?? (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.")) }),
4564
4949
  /* @__PURE__ */ jsx10(
4565
4950
  "span",
@@ -4571,7 +4956,7 @@ function GenieLoading({
4571
4956
  },
4572
4957
  notice ?? (slow ? "slow" : phrase)
4573
4958
  ),
4574
- showDetails || detailsOpen || notice ? /* @__PURE__ */ jsxs8(
4959
+ showDetails || detailsOpen || notice ? /* @__PURE__ */ jsxs7(
4575
4960
  "button",
4576
4961
  {
4577
4962
  type: "button",
@@ -4590,7 +4975,7 @@ function GenieLoading({
4590
4975
 
4591
4976
  // src/timeline/startup-dispatch-details.tsx
4592
4977
  import { useEffect as useEffect8, useState as useState10 } from "react";
4593
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4978
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
4594
4979
  function StartupDispatchDetails({ wait }) {
4595
4980
  const [now, setNow] = useState10(Date.now);
4596
4981
  useEffect8(() => {
@@ -4598,16 +4983,16 @@ function StartupDispatchDetails({ wait }) {
4598
4983
  return () => clearInterval(timer);
4599
4984
  }, []);
4600
4985
  const next = wait?.nextAttemptAt ? new Date(wait.nextAttemptAt) : null;
4601
- return /* @__PURE__ */ jsxs9("div", { className: "text-og-xs text-og-fg-muted", "data-og-startup-dispatch-details": "", children: [
4986
+ return /* @__PURE__ */ jsxs8("div", { className: "text-og-xs text-og-fg-muted", "data-og-startup-dispatch-details": "", children: [
4602
4987
  /* @__PURE__ */ jsx11("p", { children: "Your messages are saved. No agent turn is running yet." }),
4603
4988
  /* @__PURE__ */ jsx11("p", { children: wait?.state === "pending" && next ? next.getTime() <= now ? "Automatic start retry is due." : `Automatic start retry at ${next.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" })}.` : wait?.state === "acknowledged" ? "The start request was accepted; a worker has not started the turn yet." : "Start confirmation is unavailable." }),
4604
- wait && wait.attempts > 0 ? /* @__PURE__ */ jsxs9("p", { children: [
4989
+ wait && wait.attempts > 0 ? /* @__PURE__ */ jsxs8("p", { children: [
4605
4990
  wait.attempts,
4606
4991
  " dispatch attempt",
4607
4992
  wait.attempts === 1 ? "" : "s",
4608
4993
  "."
4609
4994
  ] }) : null,
4610
- wait?.lastError ? /* @__PURE__ */ jsxs9("p", { className: "max-h-32 overflow-y-auto whitespace-pre-wrap break-words", children: [
4995
+ wait?.lastError ? /* @__PURE__ */ jsxs8("p", { className: "max-h-32 overflow-y-auto whitespace-pre-wrap break-words", children: [
4611
4996
  "Last recorded dispatch error: ",
4612
4997
  wait.lastError
4613
4998
  ] }) : null
@@ -4658,7 +5043,7 @@ function useSeenActivityIds() {
4658
5043
  }
4659
5044
 
4660
5045
  // src/timeline/activity-rail.tsx
4661
- import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
5046
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
4662
5047
  var LazyFleetDecisionRow = lazy2(() => import("./fleet-decision-row-YZ3ZKWMM.js"));
4663
5048
  var LazyPlatformActivityRow = lazy2(() => import("./platform-activity-row-627BFZ46.js"));
4664
5049
  function familyOf(item) {
@@ -4726,7 +5111,7 @@ function ActivityRail({
4726
5111
  }
4727
5112
  }
4728
5113
  });
4729
- return /* @__PURE__ */ jsxs10(
5114
+ return /* @__PURE__ */ jsxs9(
4730
5115
  "div",
4731
5116
  {
4732
5117
  className: cn(
@@ -4809,7 +5194,7 @@ var ActivityNoteTextContext = createContext7(null);
4809
5194
  function ActivityNoteRow({ item }) {
4810
5195
  const renderText = useContext8(ActivityNoteTextContext);
4811
5196
  if (!item.text.trim()) return null;
4812
- return /* @__PURE__ */ jsxs10("div", { className: "flex items-start gap-2 px-1.5 py-1.5", "data-og-activity-note": "", children: [
5197
+ return /* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-2 px-1.5 py-1.5", "data-og-activity-note": "", children: [
4813
5198
  /* @__PURE__ */ jsx13("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
4814
5199
  /* @__PURE__ */ jsx13(MessageSquareTextIcon, { "aria-hidden": true, className: "mt-1 size-3.5 shrink-0 text-og-fg-subtle" }),
4815
5200
  /* @__PURE__ */ jsx13(
@@ -4903,12 +5288,12 @@ function MemoryRow({
4903
5288
  const superseded = corrected && Boolean(item.replacementPreview);
4904
5289
  const targetId = corrected ? item.replacementMemoryId ?? item.memoryId : item.memoryId;
4905
5290
  const deepLink = Boolean(onMemoryClick);
4906
- return /* @__PURE__ */ jsxs10(
5291
+ return /* @__PURE__ */ jsxs9(
4907
5292
  ActivityDisclosure,
4908
5293
  {
4909
5294
  icon: /* @__PURE__ */ jsx13(BrainCircuitIcon3, { className: "size-3.5" }),
4910
5295
  iconTone: "muted",
4911
- title: /* @__PURE__ */ jsxs10("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
5296
+ title: /* @__PURE__ */ jsxs9("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
4912
5297
  /* @__PURE__ */ jsx13("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
4913
5298
  kindLabel ? /* @__PURE__ */ jsx13("span", { className: "shrink-0 rounded-og-xs bg-og-surface-2 px-1.5 py-px text-og-xs font-normal leading-tight text-og-fg-subtle", children: kindLabel }) : null
4914
5299
  ] }),
@@ -4917,14 +5302,14 @@ function MemoryRow({
4917
5302
  superseded ? (
4918
5303
  // The correction as a before → after: the old memory struck through and
4919
5304
  // dimmed, the new text in the ordinary body weight below it.
4920
- /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5", children: [
5305
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1.5", children: [
4921
5306
  /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
4922
5307
  /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.replacementPreview })
4923
5308
  ] })
4924
5309
  ) : corrected && item.action === "updated" ? (
4925
5310
  // Edited in place, no replacement record: the memory is still live, so
4926
5311
  // show its current text — NOT the archived treatment.
4927
- /* @__PURE__ */ jsxs10(Fragment3, { children: [
5312
+ /* @__PURE__ */ jsxs9(Fragment3, { children: [
4928
5313
  /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4929
5314
  /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Updated in place." })
4930
5315
  ] })
@@ -4933,7 +5318,7 @@ function MemoryRow({
4933
5318
  /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Archived." })
4934
5319
  ) : /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4935
5320
  item.deduped ? /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Merged into an existing memory." }) : null,
4936
- deepLink ? /* @__PURE__ */ jsxs10(
5321
+ deepLink ? /* @__PURE__ */ jsxs9(
4937
5322
  "button",
4938
5323
  {
4939
5324
  type: "button",
@@ -4974,10 +5359,10 @@ function WorkerRow({
4974
5359
  }
4975
5360
  const sessionId = item.workerSessionId;
4976
5361
  const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
4977
- const inner = /* @__PURE__ */ jsxs10(Fragment3, { children: [
5362
+ const inner = /* @__PURE__ */ jsxs9(Fragment3, { children: [
4978
5363
  /* @__PURE__ */ jsx13("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
4979
5364
  /* @__PURE__ */ jsx13("span", { className: cn("mt-px shrink-0", failed ? "text-og-status-failed" : "text-og-accent"), children: /* @__PURE__ */ jsx13(BotIcon, { className: "size-3.5" }) }),
4980
- /* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
5365
+ /* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
4981
5366
  /* @__PURE__ */ jsx13(
4982
5367
  "span",
4983
5368
  {
@@ -4989,12 +5374,12 @@ function WorkerRow({
4989
5374
  }
4990
5375
  ),
4991
5376
  item.prompt ? /* @__PURE__ */ jsx13("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null,
4992
- failed && item.failure ? /* @__PURE__ */ jsxs10("div", { className: "mt-1 min-w-0 text-og-sm text-og-status-failed", children: [
5377
+ failed && item.failure ? /* @__PURE__ */ jsxs9("div", { className: "mt-1 min-w-0 text-og-sm text-og-status-failed", children: [
4993
5378
  /* @__PURE__ */ jsx13("p", { className: "font-og-mono text-og-xs", children: item.failure.code }),
4994
5379
  /* @__PURE__ */ jsx13("p", { className: "mt-0.5 break-words", children: item.failure.message })
4995
5380
  ] }) : null
4996
5381
  ] }),
4997
- failed ? /* @__PURE__ */ jsxs10("span", { className: "inline-flex shrink-0 self-center items-center gap-1.5 font-og-mono text-og-xs leading-none text-og-status-failed", children: [
5382
+ failed ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex shrink-0 self-center items-center gap-1.5 font-og-mono text-og-xs leading-none text-og-status-failed", children: [
4998
5383
  /* @__PURE__ */ jsx13("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
4999
5384
  "failed"
5000
5385
  ] }) : cancelled ? /* @__PURE__ */ jsx13("span", { className: "og-cancelled-chip shrink-0 self-center font-og-mono text-og-xs leading-none text-og-fg-subtle", children: "interrupted" }) : deepLink ? /* @__PURE__ */ jsx13(
@@ -5024,14 +5409,14 @@ function WorkerRow({
5024
5409
  }
5025
5410
 
5026
5411
  // src/timeline/turn-summary.tsx
5027
- import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, ShrinkIcon, TriangleAlertIcon } from "lucide-react";
5412
+ import { ChevronRightIcon as ChevronRightIcon3, CircleSlashIcon as CircleSlashIcon2, ShrinkIcon, TriangleAlertIcon } from "lucide-react";
5028
5413
  import {
5029
5414
  Component,
5030
5415
  createContext as createContext9,
5031
5416
  useContext as useContext10,
5032
5417
  useEffect as useEffect9,
5033
5418
  useLayoutEffect as useLayoutEffect2,
5034
- useMemo as useMemo3,
5419
+ useMemo as useMemo4,
5035
5420
  useRef as useRef7,
5036
5421
  useState as useState12
5037
5422
  } from "react";
@@ -5055,7 +5440,7 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
5055
5440
  }
5056
5441
 
5057
5442
  // src/timeline/turn-summary.tsx
5058
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
5443
+ import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
5059
5444
  var TurnSettleChromeContext = createContext9(false);
5060
5445
  function useTurnSettleOpen() {
5061
5446
  return useContext10(TurnSettleChromeContext);
@@ -5220,7 +5605,7 @@ function TurnSummary({
5220
5605
  const [allowEnterAnimation] = useState12(
5221
5606
  () => Boolean(enter && !bare && !initialSettle && !restingOpen)
5222
5607
  );
5223
- const context = useMemo3(
5608
+ const context = useMemo4(
5224
5609
  () => createTurnSummaryContext(
5225
5610
  items,
5226
5611
  outcome,
@@ -5230,12 +5615,12 @@ function TurnSummary({
5230
5615
  ),
5231
5616
  [items, outcome, failureText, durationMs, settling, settlePhase, contextCompactionCount]
5232
5617
  );
5233
- const facetDefinitions = useMemo3(
5618
+ const facetDefinitions = useMemo4(
5234
5619
  () => resolveTurnSummaryFacets(facetConfiguration),
5235
5620
  [facetConfiguration]
5236
5621
  );
5237
5622
  const statusKind = status?.kind;
5238
- const facets = useMemo3(
5623
+ const facets = useMemo4(
5239
5624
  () => facetDefinitions.flatMap((facet) => {
5240
5625
  if (statusKind && (facet.id === "duration" || facet === BUILT_IN_TURN_SUMMARY_FACETS[0] && context.items.every(
5241
5626
  (item) => item.kind === "startup-phase" || item.kind === "agent-message"
@@ -5257,8 +5642,8 @@ function TurnSummary({
5257
5642
  const copyable = Boolean(
5258
5643
  copyText && copyText.trim().length > 0 && !bare && !liveShell && !open && !settlePhase
5259
5644
  );
5260
- return /* @__PURE__ */ jsx14(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs11("div", { className: cn(copyable && "group/copy relative"), children: [
5261
- /* @__PURE__ */ jsxs11(
5645
+ return /* @__PURE__ */ jsx14(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs10("div", { className: cn(copyable && "group/copy relative"), children: [
5646
+ /* @__PURE__ */ jsxs10(
5262
5647
  Collapsible.Root,
5263
5648
  {
5264
5649
  "data-og-work-section": bare ? void 0 : "",
@@ -5266,7 +5651,7 @@ function TurnSummary({
5266
5651
  onOpenChange,
5267
5652
  className: allowEnterAnimation && !liveShell ? "animate-og-enter" : void 0,
5268
5653
  children: [
5269
- /* @__PURE__ */ jsxs11(
5654
+ /* @__PURE__ */ jsxs10(
5270
5655
  Collapsible.Trigger,
5271
5656
  {
5272
5657
  "data-og-work-header": bare ? "nested" : "outer",
@@ -5297,7 +5682,7 @@ function TurnSummary({
5297
5682
  ),
5298
5683
  children: [
5299
5684
  /* @__PURE__ */ jsx14(
5300
- ChevronRightIcon2,
5685
+ ChevronRightIcon3,
5301
5686
  {
5302
5687
  className: cn(
5303
5688
  "size-3.5 shrink-0 text-og-fg-subtle transition-transform ease-og-in-out group-data-[state=open]:rotate-90",
@@ -5313,10 +5698,10 @@ function TurnSummary({
5313
5698
  bare ? "size-3.5" : "size-5",
5314
5699
  outcome === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"
5315
5700
  ),
5316
- children: outcome === "failed" ? /* @__PURE__ */ jsx14(TriangleAlertIcon, { className: "size-3" }) : outcome === "cancelled" ? /* @__PURE__ */ jsx14(CircleSlashIcon, { className: "size-3" }) : /* @__PURE__ */ jsx14("span", { className: "size-1.5 animate-og-pulse rounded-full bg-og-fg-subtle" })
5701
+ children: outcome === "failed" ? /* @__PURE__ */ jsx14(TriangleAlertIcon, { className: "size-3" }) : outcome === "cancelled" ? /* @__PURE__ */ jsx14(CircleSlashIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx14("span", { className: "size-1.5 animate-og-pulse rounded-full bg-og-fg-subtle" })
5317
5702
  }
5318
5703
  ),
5319
- /* @__PURE__ */ jsxs11(
5704
+ /* @__PURE__ */ jsxs10(
5320
5705
  "span",
5321
5706
  {
5322
5707
  className: cn(
@@ -5326,14 +5711,14 @@ function TurnSummary({
5326
5711
  ),
5327
5712
  children: [
5328
5713
  statusLine,
5329
- liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx14(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs11(Fragment4, { children: [
5714
+ liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx14(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs10(Fragment4, { children: [
5330
5715
  index > 0 || statusLine ? " \xB7 " : null,
5331
- /* @__PURE__ */ jsxs11("span", { "aria-label": result.ariaLabel, title: result.title, children: [
5716
+ /* @__PURE__ */ jsxs10("span", { "aria-label": result.ariaLabel, title: result.title, children: [
5332
5717
  result.icon ? /* @__PURE__ */ jsx14("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
5333
5718
  result.content
5334
5719
  ] })
5335
5720
  ] }) }, facet.id)),
5336
- outcome === "failed" && failureText ? /* @__PURE__ */ jsxs11("span", { className: "text-og-status-failed", children: [
5721
+ outcome === "failed" && failureText ? /* @__PURE__ */ jsxs10("span", { className: "text-og-status-failed", children: [
5337
5722
  " \xB7 ",
5338
5723
  failureText
5339
5724
  ] }) : null,
@@ -5387,14 +5772,14 @@ function TurnSummary({
5387
5772
  }
5388
5773
  function turnSummaryStatusLine(status) {
5389
5774
  if (status.kind === "worked") {
5390
- return status.durationMs !== void 0 && Number.isFinite(status.durationMs) && status.durationMs >= 1e3 ? /* @__PURE__ */ jsxs11("span", { "data-og-exchange-status": "worked", children: [
5775
+ return status.durationMs !== void 0 && Number.isFinite(status.durationMs) && status.durationMs >= 1e3 ? /* @__PURE__ */ jsxs10("span", { "data-og-exchange-status": "worked", children: [
5391
5776
  status.label ?? "Worked for",
5392
5777
  " ",
5393
5778
  formatElapsed(status.durationMs)
5394
5779
  ] }) : null;
5395
5780
  }
5396
5781
  const label = status.label ?? (status.kind === "working" ? "Working" : "Waiting");
5397
- return /* @__PURE__ */ jsxs11("span", { "data-og-exchange-status": status.kind, children: [
5782
+ return /* @__PURE__ */ jsxs10("span", { "data-og-exchange-status": status.kind, children: [
5398
5783
  /* @__PURE__ */ jsx14("span", { className: status.kind === "working" ? "og-shimmer-text" : void 0, children: label }),
5399
5784
  status.since ? /* @__PURE__ */ jsx14(LiveElapsed, { since: status.since }) : null
5400
5785
  ] });
@@ -5578,14 +5963,14 @@ function formatDurationFacet(durationMs) {
5578
5963
  // src/components/user-message-body.tsx
5579
5964
  import {
5580
5965
  createContext as createContext10,
5581
- useCallback,
5966
+ useCallback as useCallback2,
5582
5967
  useContext as useContext11,
5583
5968
  useId as useId3,
5584
5969
  useLayoutEffect as useLayoutEffect3,
5585
5970
  useRef as useRef8,
5586
5971
  useState as useState13
5587
5972
  } from "react";
5588
- import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
5973
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
5589
5974
  var FALLBACK_LINE_THRESHOLD = 12;
5590
5975
  var FALLBACK_TEXT_THRESHOLD = 900;
5591
5976
  var FALLBACK_UNBROKEN_THRESHOLD = 260;
@@ -5766,7 +6151,7 @@ function UserMessageBody({
5766
6151
  const contentId = `og-user-message-${useId3().replace(/:/g, "")}`;
5767
6152
  const collapsible = collapsibleRef.current;
5768
6153
  const collapsed = collapsible && !expanded;
5769
- const syncDisclosurePresentation = useCallback((nextCollapsible) => {
6154
+ const syncDisclosurePresentation = useCallback2((nextCollapsible) => {
5770
6155
  collapsibleRef.current = nextCollapsible;
5771
6156
  const nextCollapsed = nextCollapsible && !expandedRef.current;
5772
6157
  const clip = clipRef.current;
@@ -5776,7 +6161,7 @@ function UserMessageBody({
5776
6161
  if (fadeRef.current) fadeRef.current.hidden = !nextCollapsed;
5777
6162
  if (disclosureControlRef.current) disclosureControlRef.current.hidden = !nextCollapsible;
5778
6163
  }, []);
5779
- const restoreManagedInertDescendants = useCallback(() => {
6164
+ const restoreManagedInertDescendants = useCallback2(() => {
5780
6165
  for (const descendant of managedInertDescendantsRef.current) {
5781
6166
  if (descendant.hasAttribute("data-og-user-message-managed-inert")) {
5782
6167
  descendant.removeAttribute("inert");
@@ -5785,7 +6170,7 @@ function UserMessageBody({
5785
6170
  }
5786
6171
  managedInertDescendantsRef.current.clear();
5787
6172
  }, []);
5788
- const syncCollapsedInteractivity = useCallback(() => {
6173
+ const syncCollapsedInteractivity = useCallback2(() => {
5789
6174
  restoreManagedInertDescendants();
5790
6175
  if (!collapsibleRef.current || expandedRef.current) {
5791
6176
  return;
@@ -5812,7 +6197,7 @@ function UserMessageBody({
5812
6197
  managedInertDescendantsRef.current.add(descendant);
5813
6198
  }
5814
6199
  }, [restoreManagedInertDescendants]);
5815
- const readCollapsible = useCallback(() => {
6200
+ const readCollapsible = useCallback2(() => {
5816
6201
  const content = contentRef.current;
5817
6202
  const threshold = thresholdRef.current;
5818
6203
  if (!content || !threshold) {
@@ -5825,7 +6210,7 @@ function UserMessageBody({
5825
6210
  );
5826
6211
  return renderedHeight > 0 && collapseHeight > 0 ? renderedHeight > collapseHeight + 1 : userMessageLikelyNeedsDisclosure(text);
5827
6212
  }, [text]);
5828
- const measure = useCallback(() => {
6213
+ const measure = useCallback2(() => {
5829
6214
  const view = rootRef.current?.ownerDocument.defaultView;
5830
6215
  if (!view) {
5831
6216
  syncDisclosurePresentation(readCollapsible());
@@ -5890,7 +6275,7 @@ function UserMessageBody({
5890
6275
  disclosure?.expandedByMessageId.set(messageId, next);
5891
6276
  setExpanded(next);
5892
6277
  };
5893
- return /* @__PURE__ */ jsxs12(
6278
+ return /* @__PURE__ */ jsxs11(
5894
6279
  "div",
5895
6280
  {
5896
6281
  ref: rootRef,
@@ -5907,7 +6292,7 @@ function UserMessageBody({
5907
6292
  className: "pointer-events-none absolute h-56 w-0 invisible sm:h-72"
5908
6293
  }
5909
6294
  ),
5910
- /* @__PURE__ */ jsxs12(
6295
+ /* @__PURE__ */ jsxs11(
5911
6296
  "div",
5912
6297
  {
5913
6298
  ref: clipRef,
@@ -5956,6 +6341,38 @@ function UserMessageBody({
5956
6341
  );
5957
6342
  }
5958
6343
 
6344
+ // src/timeline/retained-loaders.ts
6345
+ function createWorkspaceRetainedArtifactLoader(client, workspaceId) {
6346
+ return async (artifact, signal) => {
6347
+ if (artifact.kind === "file") {
6348
+ const download2 = await client.downloadRetainedArtifact(workspaceId, artifact, { signal });
6349
+ return download2.bytes;
6350
+ }
6351
+ const download = await client.createRetainedArtifactDownloadUrl(workspaceId, artifact, {
6352
+ signal
6353
+ });
6354
+ return { url: download.url };
6355
+ };
6356
+ }
6357
+ function createSessionRetainedScreenshotLoader(client, workspaceId, sessionId) {
6358
+ return async (artifact, signal) => {
6359
+ const download = await client.downloadRetainedScreenshot(
6360
+ workspaceId,
6361
+ sessionId,
6362
+ artifact.artifactId,
6363
+ { signal }
6364
+ );
6365
+ if (!download.metadata.available || !download.bytes) return null;
6366
+ if (download.metadata.artifactId !== artifact.artifactId || download.metadata.kind !== artifact.kind || download.metadata.contentType !== artifact.contentType || download.metadata.originalBytes !== artifact.originalBytes || download.metadata.sha256 !== artifact.sha256 || download.metadata.dimensions?.width !== artifact.dimensions?.width || download.metadata.dimensions?.height !== artifact.dimensions?.height) {
6367
+ throw new Error("Retained screenshot receipt verification failed");
6368
+ }
6369
+ return download.bytes;
6370
+ };
6371
+ }
6372
+ function createWorkspaceRetainedVideoLoader(client, workspaceId) {
6373
+ return async (artifactId, signal) => await client.createVideoArtifactPlaybackSource(workspaceId, artifactId, { signal });
6374
+ }
6375
+
5959
6376
  // src/components/generated-video-player.tsx
5960
6377
  import { useEffect as useEffect10, useState as useState14 } from "react";
5961
6378
  import { jsx as jsx16 } from "react/jsx-runtime";
@@ -6032,7 +6449,7 @@ function GeneratedVideoPlayer({
6032
6449
  }
6033
6450
 
6034
6451
  // src/components/session-status.tsx
6035
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
6452
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
6036
6453
  var SESSION_STATUS_META = {
6037
6454
  queued: {
6038
6455
  label: "Queued",
@@ -6085,7 +6502,7 @@ var SESSION_STATUS_META = {
6085
6502
  };
6086
6503
  function SessionStatus({ status, label, size = "md", className }) {
6087
6504
  const meta = SESSION_STATUS_META[status];
6088
- return /* @__PURE__ */ jsxs13(
6505
+ return /* @__PURE__ */ jsxs12(
6089
6506
  "span",
6090
6507
  {
6091
6508
  "data-status": status,
@@ -6121,7 +6538,7 @@ function StatusDot({ status, className }) {
6121
6538
  import { AnimatePresence as AnimatePresence2, motion as motion2, useReducedMotion as useReducedMotion2 } from "motion/react";
6122
6539
  import { WrenchIcon as WrenchIcon2 } from "lucide-react";
6123
6540
  import { Suspense as Suspense3, useEffect as useEffect11, useState as useState15 } from "react";
6124
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
6541
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
6125
6542
  function RollingActivity({
6126
6543
  items,
6127
6544
  toolRegistry = defaultToolRegistry,
@@ -6143,11 +6560,11 @@ function RollingActivity({
6143
6560
  0,
6144
6561
  work.findIndex((entry) => entry.id === item.id)
6145
6562
  );
6146
- const fallback2 = /* @__PURE__ */ jsxs14("span", { className: "og-rolling-label", children: [
6563
+ const fallback2 = /* @__PURE__ */ jsxs13("span", { className: "og-rolling-label", children: [
6147
6564
  /* @__PURE__ */ jsx18(WrenchIcon2, { className: "size-3.5" }),
6148
6565
  /* @__PURE__ */ jsx18("span", { children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : "Working" })
6149
6566
  ] });
6150
- return /* @__PURE__ */ jsxs14(
6567
+ return /* @__PURE__ */ jsxs13(
6151
6568
  "span",
6152
6569
  {
6153
6570
  className: "og-rolling-status",
@@ -6225,7 +6642,7 @@ function describeCompactionProviderRejection(rejection) {
6225
6642
  }
6226
6643
 
6227
6644
  // src/components/message-timeline.tsx
6228
- import { dequal } from "dequal/lite";
6645
+ import { dequal as dequal2 } from "dequal/lite";
6229
6646
  import {
6230
6647
  ArrowDownIcon,
6231
6648
  ArrowRightIcon as ArrowRightIcon2,
@@ -6233,7 +6650,7 @@ import {
6233
6650
  BotIcon as BotIcon2,
6234
6651
  CheckCircle2Icon,
6235
6652
  CheckIcon as CheckIcon2,
6236
- ChevronRightIcon as ChevronRightIcon3,
6653
+ ChevronRightIcon as ChevronRightIcon4,
6237
6654
  PauseCircleIcon,
6238
6655
  PauseIcon,
6239
6656
  MessageCircleQuestionIcon as MessageCircleQuestionIcon3,
@@ -6254,11 +6671,11 @@ import {
6254
6671
  createContext as createContext12,
6255
6672
  lazy as lazy3,
6256
6673
  memo,
6257
- useCallback as useCallback3,
6674
+ useCallback as useCallback4,
6258
6675
  useContext as useContext13,
6259
6676
  useEffect as useEffect12,
6260
6677
  useLayoutEffect as useLayoutEffect5,
6261
- useMemo as useMemo6,
6678
+ useMemo as useMemo7,
6262
6679
  useRef as useRef10,
6263
6680
  useState as useState17
6264
6681
  } from "react";
@@ -6343,12 +6760,12 @@ function timelineAnchorCorrection(scroller, anchors) {
6343
6760
  }
6344
6761
 
6345
6762
  // src/components/timeline-reading-progress.ts
6346
- import { useCallback as useCallback2, useLayoutEffect as useLayoutEffect4, useMemo as useMemo4, useRef as useRef9, useState as useState16 } from "react";
6763
+ import { useCallback as useCallback3, useLayoutEffect as useLayoutEffect4, useMemo as useMemo5, useRef as useRef9, useState as useState16 } from "react";
6347
6764
  function useReadingProgress(projected, pinned, scroller) {
6348
6765
  const following = pinned && !timelineHasReader(scroller);
6349
6766
  const previous = useRef9([]);
6350
6767
  const [released, setReleased] = useState16(() => /* @__PURE__ */ new Set());
6351
- const groups = useMemo4(() => {
6768
+ const groups = useMemo5(() => {
6352
6769
  if (following) return projected;
6353
6770
  const key = (group) => group.kind === "item" ? group.item.id : group.id;
6354
6771
  const visible = new Set(previous.current.map(key));
@@ -6389,7 +6806,7 @@ function useReadingProgress(projected, pinned, scroller) {
6389
6806
  previous.current = groups;
6390
6807
  if (following && released.size) setReleased(/* @__PURE__ */ new Set());
6391
6808
  }, [groups, following, released]);
6392
- const release = useCallback2(
6809
+ const release = useCallback3(
6393
6810
  (id) => {
6394
6811
  if (!id || !projected.some(
6395
6812
  (group) => group.kind === "activity" && group.id === id && group.work?.endedAt
@@ -6819,8 +7236,8 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
6819
7236
 
6820
7237
  // src/timeline/allowance-exhausted-row.tsx
6821
7238
  import { GaugeIcon } from "lucide-react";
6822
- import { createContext as createContext11, useContext as useContext12, useMemo as useMemo5 } from "react";
6823
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
7239
+ import { createContext as createContext11, useContext as useContext12, useMemo as useMemo6 } from "react";
7240
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
6824
7241
  var AllowancePresentationContext = createContext11({
6825
7242
  render: void 0,
6826
7243
  labels: allowanceLabels()
@@ -6830,14 +7247,14 @@ function AllowancePresentationProvider({
6830
7247
  labels,
6831
7248
  children
6832
7249
  }) {
6833
- const value = useMemo5(() => ({ render, labels: allowanceLabels(labels) }), [render, labels]);
7250
+ const value = useMemo6(() => ({ render, labels: allowanceLabels(labels) }), [render, labels]);
6834
7251
  return /* @__PURE__ */ jsx20(AllowancePresentationContext.Provider, { value, children });
6835
7252
  }
6836
7253
  function AllowanceExhaustedRow({ refusal }) {
6837
7254
  const { render, labels } = useContext12(AllowancePresentationContext);
6838
7255
  const enter = useEntranceAnimation();
6839
7256
  const workspace = refusal.scope === "workspace";
6840
- const defaultRow = /* @__PURE__ */ jsxs15(
7257
+ const defaultRow = /* @__PURE__ */ jsxs14(
6841
7258
  "div",
6842
7259
  {
6843
7260
  className: cn(
@@ -6848,9 +7265,9 @@ function AllowanceExhaustedRow({ refusal }) {
6848
7265
  "data-og-allowance-exhausted": refusal.scope,
6849
7266
  children: [
6850
7267
  /* @__PURE__ */ jsx20(GaugeIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-og-status-waiting" }),
6851
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
7268
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
6852
7269
  /* @__PURE__ */ jsx20("p", { className: "font-medium", children: workspace ? labels.workspaceLimitReachedTitle : labels.memberLimitReachedTitle }),
6853
- /* @__PURE__ */ jsxs15("p", { className: "mt-0.5 text-og-fg-muted", children: [
7270
+ /* @__PURE__ */ jsxs14("p", { className: "mt-0.5 text-og-fg-muted", children: [
6854
7271
  workspace ? labels.workspaceRemedy : labels.memberRemedy,
6855
7272
  " ",
6856
7273
  /* @__PURE__ */ jsx20(
@@ -6870,7 +7287,7 @@ function AllowanceExhaustedRow({ refusal }) {
6870
7287
  }
6871
7288
 
6872
7289
  // src/components/message-timeline.tsx
6873
- import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
7290
+ import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
6874
7291
  var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-DMLMM2TX.js"));
6875
7292
  var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-markers-GNDHTGBD.js"));
6876
7293
  var PIN_THRESHOLD_PX = 48;
@@ -7035,7 +7452,7 @@ function MessageTimeline({
7035
7452
  className
7036
7453
  }) {
7037
7454
  const formatError = useErrorMessage();
7038
- const resolvedItems = useMemo6(() => {
7455
+ const resolvedItems = useMemo7(() => {
7039
7456
  const projectedItems = items ?? buildTimeline(events ?? []);
7040
7457
  if (!shouldRenderAuthNeeded) {
7041
7458
  return projectedItems;
@@ -7053,7 +7470,7 @@ function MessageTimeline({
7053
7470
  ]) : null;
7054
7471
  const searchTargetRef = useRef10(searchTarget);
7055
7472
  searchTargetRef.current = searchTarget;
7056
- const renderSearchableMessageText = useMemo6(
7473
+ const renderSearchableMessageText = useMemo7(
7057
7474
  () => renderMessageText ? (text, item) => renderMessageText(text, item, {
7058
7475
  searchTarget: searchItem?.id === item.id ? searchTarget ?? null : null
7059
7476
  }) : (text, item) => {
@@ -7089,7 +7506,7 @@ function MessageTimeline({
7089
7506
  newerAttemptRef.current = null;
7090
7507
  };
7091
7508
  }, [newerBoundaryKey]);
7092
- const requestNewer = useCallback3(
7509
+ const requestNewer = useCallback4(
7093
7510
  (explicitRetry = false) => {
7094
7511
  if (newerScopeRef.current !== newerBoundaryKey || !onLoadNewer || loadingNewer || newerAttemptRef.current && (!explicitRetry || newerAttemptRef.current.pending)) {
7095
7512
  return;
@@ -7126,19 +7543,19 @@ function MessageTimeline({
7126
7543
  const readingAnchorRef = useRef10(null);
7127
7544
  const settlementRef = useRef10(null);
7128
7545
  const settlementAnimationRef = useRef10(null);
7129
- const stopSettlement = useCallback3(() => {
7546
+ const stopSettlement = useCallback4(() => {
7130
7547
  settlementAnimationRef.current?.cancel();
7131
7548
  settlementAnimationRef.current = null;
7132
7549
  }, []);
7133
7550
  const olderPageBudgetRef = useRef10(0);
7134
7551
  const [olderDemand, setOlderDemand] = useState17(0);
7135
7552
  const readableTurns = turnSummary?.rolling === true;
7136
- const projectedGroups = useMemo6(
7553
+ const projectedGroups = useMemo7(
7137
7554
  () => groupTimeline(resolvedItems, { readableTurns }),
7138
7555
  [resolvedItems, readableTurns]
7139
7556
  );
7140
7557
  useLayoutEffect5(() => stopSettlement, [projectedGroups, stopSettlement]);
7141
- const annotationSources = useMemo6(() => {
7558
+ const annotationSources = useMemo7(() => {
7142
7559
  const sources = /* @__PURE__ */ new Map();
7143
7560
  for (const item of resolvedItems) {
7144
7561
  if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
@@ -7204,7 +7621,7 @@ function MessageTimeline({
7204
7621
  const liveFoldReserveRef = useRef10(null);
7205
7622
  const writeScrollTopRef = useRef10(() => {
7206
7623
  });
7207
- const reportLiveFold = useCallback3((workId, open) => {
7624
+ const reportLiveFold = useCallback4((workId, open) => {
7208
7625
  const current = openLiveFoldsRef.current;
7209
7626
  if (current.has(workId) === open) return;
7210
7627
  const next = new Set(current);
@@ -7350,7 +7767,7 @@ function MessageTimeline({
7350
7767
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
7351
7768
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
7352
7769
  const groups = useStableTimelineGroupKeys(allGroups, !bulkRender);
7353
- const [liveNoteFolds, liveNoteIdsByWork] = useMemo6(() => {
7770
+ const [liveNoteFolds, liveNoteIdsByWork] = useMemo7(() => {
7354
7771
  const folds = /* @__PURE__ */ new Map();
7355
7772
  const byWork = /* @__PURE__ */ new Map();
7356
7773
  for (const { group } of groups) {
@@ -7363,7 +7780,7 @@ function MessageTimeline({
7363
7780
  useLayoutEffect5(() => {
7364
7781
  liveNoteIdsByWorkRef.current = liveNoteIdsByWork;
7365
7782
  }, [liveNoteIdsByWork]);
7366
- const turnsWithOutput = useMemo6(
7783
+ const turnsWithOutput = useMemo7(
7367
7784
  () => new Set(
7368
7785
  resolvedItems.flatMap(
7369
7786
  (item) => "turnId" in item && item.turnId && (item.kind === "tool-call" || (item.kind === "agent-message" || item.kind === "reasoning") && item.text.trim()) ? [item.turnId] : []
@@ -7371,13 +7788,13 @@ function MessageTimeline({
7371
7788
  ),
7372
7789
  [resolvedItems]
7373
7790
  );
7374
- const applyCanSkipTipCatchup = useCallback3((value) => {
7791
+ const applyCanSkipTipCatchup = useCallback4((value) => {
7375
7792
  if (canSkipTipCatchupRef.current !== value) {
7376
7793
  canSkipTipCatchupRef.current = value;
7377
7794
  setCanSkipTipCatchup(value);
7378
7795
  }
7379
7796
  }, []);
7380
- const applyPinned = useCallback3(
7797
+ const applyPinned = useCallback4(
7381
7798
  (value) => {
7382
7799
  if (pinnedRef.current !== value) {
7383
7800
  pinnedRef.current = value;
@@ -7389,7 +7806,7 @@ function MessageTimeline({
7389
7806
  },
7390
7807
  [applyCanSkipTipCatchup]
7391
7808
  );
7392
- const rearmOlderPrefetchAfterLeavingTop = useCallback3((node) => {
7809
+ const rearmOlderPrefetchAfterLeavingTop = useCallback4((node) => {
7393
7810
  if (node.scrollTop > OLDER_PREFETCH_MARGIN_PX) {
7394
7811
  const state = olderLoadAttemptRef.current?.[1];
7395
7812
  if (state === 2 || state === 3) {
@@ -7402,13 +7819,13 @@ function MessageTimeline({
7402
7819
  const followRef = useRef10(createTipFollowState());
7403
7820
  const followFrameRef = useRef10(null);
7404
7821
  const contentShrinkBaselineRef = useRef10(null);
7405
- const syncScrollBaseline = useCallback3((node) => {
7822
+ const syncScrollBaseline = useCallback4((node) => {
7406
7823
  lastScrollTopRef.current = node.scrollTop;
7407
7824
  lastMaxScrollRef.current = maxScrollOf(node);
7408
7825
  lastScrollHeightRef.current = node.scrollHeight;
7409
7826
  lastClientHeightRef.current = node.clientHeight;
7410
7827
  }, []);
7411
- const writeScrollTop = useCallback3((node, top) => {
7828
+ const writeScrollTop = useCallback4((node, top) => {
7412
7829
  const next = Math.max(0, top);
7413
7830
  const before = node.scrollTop;
7414
7831
  if (before === next) {
@@ -7422,21 +7839,21 @@ function MessageTimeline({
7422
7839
  }
7423
7840
  }, []);
7424
7841
  writeScrollTopRef.current = writeScrollTop;
7425
- const cancelLeaveFallback = useCallback3(() => {
7842
+ const cancelLeaveFallback = useCallback4(() => {
7426
7843
  if (leaveFallbackRafRef.current != null) {
7427
7844
  cancelFrame(leaveFallbackRafRef.current);
7428
7845
  leaveFallbackRafRef.current = null;
7429
7846
  }
7430
7847
  }, []);
7431
- const clearPendingReaderLeave = useCallback3(() => {
7848
+ const clearPendingReaderLeave = useCallback4(() => {
7432
7849
  pendingReaderLeaveRef.current = false;
7433
7850
  cancelLeaveFallback();
7434
7851
  }, [cancelLeaveFallback]);
7435
- const clearReaderIntent = useCallback3(() => {
7852
+ const clearReaderIntent = useCallback4(() => {
7436
7853
  readerIntentArmRef.current = false;
7437
7854
  readerIntentStartRef.current = null;
7438
7855
  }, []);
7439
- const stopFollow = useCallback3(() => {
7856
+ const stopFollow = useCallback4(() => {
7440
7857
  contentShrinkBaselineRef.current = null;
7441
7858
  followRef.current = tipFollowCancel(followRef.current);
7442
7859
  if (followFrameRef.current != null) {
@@ -7444,7 +7861,7 @@ function MessageTimeline({
7444
7861
  followFrameRef.current = null;
7445
7862
  }
7446
7863
  }, []);
7447
- const releasePinFromReader = useCallback3(() => {
7864
+ const releasePinFromReader = useCallback4(() => {
7448
7865
  if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
7449
7866
  return;
7450
7867
  }
@@ -7475,7 +7892,7 @@ function MessageTimeline({
7475
7892
  node.ownerDocument.addEventListener("selectionchange", onSelection);
7476
7893
  return () => node.ownerDocument.removeEventListener("selectionchange", onSelection);
7477
7894
  }, [readableTurns, releasePinFromReader, stopSettlement]);
7478
- const releasePinAfterScrollSettled = useCallback3(
7895
+ const releasePinAfterScrollSettled = useCallback4(
7479
7896
  (node) => {
7480
7897
  if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
7481
7898
  return;
@@ -7495,7 +7912,7 @@ function MessageTimeline({
7495
7912
  },
7496
7913
  [autoFollow, clearPendingReaderLeave, rearmOlderPrefetchAfterLeavingTop, releasePinFromReader]
7497
7914
  );
7498
- const scheduleLeaveFallback = useCallback3(() => {
7915
+ const scheduleLeaveFallback = useCallback4(() => {
7499
7916
  if (supportsScrollEndEvent()) {
7500
7917
  return;
7501
7918
  }
@@ -7563,7 +7980,7 @@ function MessageTimeline({
7563
7980
  }
7564
7981
  requestEarlierFromReader();
7565
7982
  };
7566
- const snapToBottom = useCallback3(
7983
+ const snapToBottom = useCallback4(
7567
7984
  (node) => {
7568
7985
  clearReaderIntent();
7569
7986
  stopFollow();
@@ -7587,7 +8004,7 @@ function MessageTimeline({
7587
8004
  writeScrollTop
7588
8005
  ]
7589
8006
  );
7590
- const beginUserMessageDisclosureChange = useCallback3(
8007
+ const beginUserMessageDisclosureChange = useCallback4(
7591
8008
  (messageBody, disclosureControl) => {
7592
8009
  const node = scrollRef.current;
7593
8010
  if (!node || !node.contains(messageBody)) {
@@ -7625,7 +8042,7 @@ function MessageTimeline({
7625
8042
  },
7626
8043
  [applyPinned, autoFollow, snapToBottom, syncScrollBaseline, writeScrollTop]
7627
8044
  );
7628
- const userMessageDisclosureContext = useMemo6(
8045
+ const userMessageDisclosureContext = useMemo7(
7629
8046
  () => ({
7630
8047
  expandedByMessageId: userMessageDisclosureMemoryRef.current,
7631
8048
  beginChange: beginUserMessageDisclosureChange,
@@ -7640,7 +8057,7 @@ function MessageTimeline({
7640
8057
  userMessageDisclosureLabels?.showLess
7641
8058
  ]
7642
8059
  );
7643
- const timelineGroupEntryContext = useMemo6(
8060
+ const timelineGroupEntryContext = useMemo7(
7644
8061
  () => ({
7645
8062
  userMessageDisclosureContext,
7646
8063
  behavior: {
@@ -7676,7 +8093,7 @@ function MessageTimeline({
7676
8093
  userMessageDisclosureContext
7677
8094
  ]
7678
8095
  );
7679
- const releaseSearchPin = useCallback3(() => {
8096
+ const releaseSearchPin = useCallback4(() => {
7680
8097
  applyPinned(false);
7681
8098
  stopFollow();
7682
8099
  setRevealed(true);
@@ -7688,7 +8105,7 @@ function MessageTimeline({
7688
8105
  releaseSearchPin,
7689
8106
  resolvedItems
7690
8107
  );
7691
- const requestOlderIfUnderfilled = useCallback3(
8108
+ const requestOlderIfUnderfilled = useCallback4(
7692
8109
  (node, retry) => {
7693
8110
  let currentAttempt = olderLoadAttemptRef.current;
7694
8111
  if (retry && (currentAttempt !== retry || retry[0] !== olderBoundaryKey)) {
@@ -7717,7 +8134,7 @@ function MessageTimeline({
7717
8134
  },
7718
8135
  [hasOlder, loadingOlder, olderBoundaryKey, onLoadOlder]
7719
8136
  );
7720
- const scheduleQuestionNav = useCallback3(() => {
8137
+ const scheduleQuestionNav = useCallback4(() => {
7721
8138
  if (!readableTurns || questionNavFrameRef.current != null) {
7722
8139
  return;
7723
8140
  }
@@ -7756,7 +8173,7 @@ function MessageTimeline({
7756
8173
  const driveFollowRef = useRef10(
7757
8174
  requestOlderIfUnderfilled
7758
8175
  );
7759
- const driveFollow = useCallback3(
8176
+ const driveFollow = useCallback4(
7760
8177
  (node, nowMs) => {
7761
8178
  if (!pinnedRef.current || hasNewerRef.current) {
7762
8179
  stopFollow();
@@ -8358,7 +8775,7 @@ function MessageTimeline({
8358
8775
  {
8359
8776
  render: renderAllowanceExhausted,
8360
8777
  labels: allowanceExhaustedLabels,
8361
- children: /* @__PURE__ */ jsx21(LightboxProvider, { children: /* @__PURE__ */ jsx21(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx21(LiveNoteFoldContext.Provider, { value: reportLiveFold, children: /* @__PURE__ */ jsx21(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx21(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx21(EntranceAnimationProvider, { value: false, children: /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx21(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs16(
8778
+ children: /* @__PURE__ */ jsx21(LightboxProvider, { children: /* @__PURE__ */ jsx21(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx21(LiveNoteFoldContext.Provider, { value: reportLiveFold, children: /* @__PURE__ */ jsx21(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx21(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx21(EntranceAnimationProvider, { value: false, children: /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx21(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs15(
8362
8779
  "div",
8363
8780
  {
8364
8781
  className: cn("og-root relative flex min-h-0 flex-col", className),
@@ -8449,11 +8866,11 @@ function MessageTimeline({
8449
8866
  readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
8450
8867
  settlementRef.current = readableTurns && autoFollow && pinnedRef.current && revealedRef.current && !hasNewer && !pendingReaderLeaveRef.current && !disclosureKeepsUnpinnedRef.current && !prefersReducedMotion() && scrollRef.current ? captureTimelineSettlement(scrollRef.current, groups) : null;
8451
8868
  },
8452
- children: /* @__PURE__ */ jsxs16("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
8869
+ children: /* @__PURE__ */ jsxs15("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
8453
8870
  /* @__PURE__ */ jsx21(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
8454
8871
  // Reserved top gutter: controls scroll with history and cannot
8455
8872
  // cover a disclosure. Visibility never changes content height.
8456
- /* @__PURE__ */ jsxs16(
8873
+ /* @__PURE__ */ jsxs15(
8457
8874
  motion3.div,
8458
8875
  {
8459
8876
  initial: { opacity: 0, y: -6 },
@@ -8554,13 +8971,13 @@ function MessageTimeline({
8554
8971
  );
8555
8972
  }),
8556
8973
  groups.length > 0 && trailingState ? /* @__PURE__ */ jsx21("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
8557
- hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs16(
8974
+ hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs15(
8558
8975
  "div",
8559
8976
  {
8560
8977
  "data-og-newer-error": "",
8561
8978
  className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
8562
8979
  children: [
8563
- /* @__PURE__ */ jsxs16("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
8980
+ /* @__PURE__ */ jsxs15("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
8564
8981
  "Couldn\u2019t load later activity. ",
8565
8982
  newerFailure.message
8566
8983
  ] }),
@@ -8611,7 +9028,7 @@ function MessageTimeline({
8611
9028
  "pointer-events-none absolute inset-x-0 z-10 flex justify-center",
8612
9029
  questionNav?.belowHeader ? "top-10 pointer-coarse:top-13" : "top-3"
8613
9030
  ),
8614
- children: /* @__PURE__ */ jsx21(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsxs16(
9031
+ children: /* @__PURE__ */ jsx21(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsxs15(
8615
9032
  motion3.button,
8616
9033
  {
8617
9034
  ...NAV_FADE,
@@ -8635,7 +9052,7 @@ function MessageTimeline({
8635
9052
  {
8636
9053
  "data-og-timeline-nav": "bottom",
8637
9054
  className: "pointer-events-none absolute inset-x-0 bottom-3 z-10 flex flex-col items-center gap-2",
8638
- children: /* @__PURE__ */ jsxs16(AnimatePresence3, { children: [
9055
+ children: /* @__PURE__ */ jsxs15(AnimatePresence3, { children: [
8639
9056
  loadingNewer ? /* @__PURE__ */ jsx21(
8640
9057
  motion3.div,
8641
9058
  {
@@ -8647,7 +9064,7 @@ function MessageTimeline({
8647
9064
  },
8648
9065
  "loading-newer"
8649
9066
  ) : null,
8650
- jumpPillShown ? /* @__PURE__ */ jsxs16(
9067
+ jumpPillShown ? /* @__PURE__ */ jsxs15(
8651
9068
  motion3.button,
8652
9069
  {
8653
9070
  ...NAV_FADE,
@@ -8708,14 +9125,14 @@ function MessageTimeline({
8708
9125
  }
8709
9126
  function timelineGroupsRenderEqual(previous, next) {
8710
9127
  try {
8711
- return dequal(previous, next);
9128
+ return dequal2(previous, next);
8712
9129
  } catch {
8713
9130
  return false;
8714
9131
  }
8715
9132
  }
8716
9133
  function useStableTimelineGroupKeys(allGroups, entranceEnabled) {
8717
9134
  const previousRef = useRef10([]);
8718
- const keyedGroups = useMemo6(() => {
9135
+ const keyedGroups = useMemo7(() => {
8719
9136
  const previousByItemId = /* @__PURE__ */ new Map();
8720
9137
  for (const previous of previousRef.current) {
8721
9138
  for (const itemId of timelineGroupItemIds(previous.group)) {
@@ -8792,7 +9209,7 @@ var TimelineGroupRenderBoundary = class extends Component3 {
8792
9209
  }
8793
9210
  render() {
8794
9211
  if (this.state.failed) {
8795
- return /* @__PURE__ */ jsxs16(
9212
+ return /* @__PURE__ */ jsxs15(
8796
9213
  "div",
8797
9214
  {
8798
9215
  "data-testid": "timeline-group-render-error",
@@ -8800,7 +9217,7 @@ var TimelineGroupRenderBoundary = class extends Component3 {
8800
9217
  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",
8801
9218
  children: [
8802
9219
  /* @__PURE__ */ jsx21(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
8803
- /* @__PURE__ */ jsxs16("div", { children: [
9220
+ /* @__PURE__ */ jsxs15("div", { children: [
8804
9221
  /* @__PURE__ */ jsx21("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
8805
9222
  /* @__PURE__ */ jsx21("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
8806
9223
  ] })
@@ -9449,7 +9866,7 @@ function CompactionRow({ item }) {
9449
9866
  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";
9450
9867
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason, item.providerRejection) : null;
9451
9868
  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;
9452
- return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs16(
9869
+ return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs15(
9453
9870
  "div",
9454
9871
  {
9455
9872
  className: cn(
@@ -9458,9 +9875,9 @@ function CompactionRow({ item }) {
9458
9875
  ),
9459
9876
  role: "status",
9460
9877
  children: [
9461
- /* @__PURE__ */ jsxs16("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
9878
+ /* @__PURE__ */ jsxs15("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
9462
9879
  /* @__PURE__ */ jsx21(ShrinkIcon2, { className: "size-3.5 shrink-0" }),
9463
- /* @__PURE__ */ jsxs16("span", { className: "truncate", children: [
9880
+ /* @__PURE__ */ jsxs15("span", { className: "truncate", children: [
9464
9881
  title,
9465
9882
  trigger ? ` \xB7 ${trigger}` : ""
9466
9883
  ] })
@@ -9491,7 +9908,7 @@ function UserMessageRow({
9491
9908
  }) {
9492
9909
  const enter = useEntranceAnimation();
9493
9910
  const deliveryFailed = item.delivery?.state === "failed";
9494
- return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs16("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
9911
+ return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs15("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
9495
9912
  /* @__PURE__ */ jsx21(
9496
9913
  CopyHoverFrame,
9497
9914
  {
@@ -9499,11 +9916,11 @@ function UserMessageRow({
9499
9916
  ${annotation.note}`).join("\n\n"),
9500
9917
  label: "Copy message",
9501
9918
  className: "w-fit max-w-full min-w-0",
9502
- trailing: /* @__PURE__ */ jsxs16(Fragment6, { children: [
9919
+ trailing: /* @__PURE__ */ jsxs15(Fragment6, { children: [
9503
9920
  renderMessageActions?.(item),
9504
9921
  /* @__PURE__ */ jsx21(MessageFooterTime, { occurredAt: item.occurredAt })
9505
9922
  ] }),
9506
- children: /* @__PURE__ */ jsxs16("div", { className: MESSAGE_BUBBLE_CLASS, children: [
9923
+ children: /* @__PURE__ */ jsxs15("div", { className: MESSAGE_BUBBLE_CLASS, children: [
9507
9924
  item.text ? /* @__PURE__ */ jsx21(
9508
9925
  "div",
9509
9926
  {
@@ -9522,17 +9939,17 @@ ${annotation.note}`).join("\n\n"),
9522
9939
  ] })
9523
9940
  }
9524
9941
  ),
9525
- deliveryFailed ? /* @__PURE__ */ jsxs16(
9942
+ deliveryFailed ? /* @__PURE__ */ jsxs15(
9526
9943
  "div",
9527
9944
  {
9528
9945
  role: "status",
9529
9946
  className: "flex max-w-full flex-col items-start gap-1 px-1 text-og-xs text-og-status-failed",
9530
9947
  children: [
9531
- /* @__PURE__ */ jsxs16("span", { className: "flex min-w-0 items-start gap-1", children: [
9948
+ /* @__PURE__ */ jsxs15("span", { className: "flex min-w-0 items-start gap-1", children: [
9532
9949
  /* @__PURE__ */ jsx21(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
9533
9950
  /* @__PURE__ */ jsx21("span", { className: "min-w-0 break-words", children: item.delivery?.error || "Message not sent" })
9534
9951
  ] }),
9535
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2", children: [
9952
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2", children: [
9536
9953
  item.delivery?.onEdit ? /* @__PURE__ */ jsx21(
9537
9954
  "button",
9538
9955
  {
@@ -9574,26 +9991,26 @@ function HumanInputConversationRow({ item }) {
9574
9991
  );
9575
9992
  const settledLabel = item.response.outcome === "answered" ? "You answered" : item.response.outcome === "skipped" ? "Skipped" : item.response.outcome === "expired" ? "Expired" : "Cancelled";
9576
9993
  const copyText = humanInputConversationCopyText(item, settledLabel);
9577
- return /* @__PURE__ */ jsxs16(
9994
+ return /* @__PURE__ */ jsxs15(
9578
9995
  "div",
9579
9996
  {
9580
9997
  className: cn(enter && "animate-og-enter", "flex w-full flex-col gap-2.5"),
9581
9998
  "data-human-input-history": item.requestId,
9582
9999
  children: [
9583
- /* @__PURE__ */ jsxs16("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: [
10000
+ /* @__PURE__ */ jsxs15("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: [
9584
10001
  /* @__PURE__ */ jsx21("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__ */ jsx21(MessageCircleQuestionIcon3, { "aria-hidden": "true", className: "size-4" }) }),
9585
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
10002
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
9586
10003
  /* @__PURE__ */ jsx21("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
9587
- /* @__PURE__ */ jsx21("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs16("div", { children: [
9588
- question.label ? /* @__PURE__ */ jsxs16("p", { className: "text-og-sm font-semibold text-og-fg", children: [
9589
- multipleQuestions ? /* @__PURE__ */ jsxs16("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
10004
+ /* @__PURE__ */ jsx21("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs15("div", { children: [
10005
+ question.label ? /* @__PURE__ */ jsxs15("p", { className: "text-og-sm font-semibold text-og-fg", children: [
10006
+ multipleQuestions ? /* @__PURE__ */ jsxs15("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
9590
10007
  index + 1,
9591
10008
  "."
9592
10009
  ] }) : null,
9593
10010
  multipleQuestions ? " " : null,
9594
10011
  question.label
9595
10012
  ] }) : null,
9596
- /* @__PURE__ */ jsxs16(
10013
+ /* @__PURE__ */ jsxs15(
9597
10014
  "p",
9598
10015
  {
9599
10016
  className: cn(
@@ -9601,7 +10018,7 @@ function HumanInputConversationRow({ item }) {
9601
10018
  question.label && "mt-0.5 text-og-sm text-og-fg-muted"
9602
10019
  ),
9603
10020
  children: [
9604
- !question.label && multipleQuestions ? /* @__PURE__ */ jsxs16("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
10021
+ !question.label && multipleQuestions ? /* @__PURE__ */ jsxs15("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
9605
10022
  index + 1,
9606
10023
  "."
9607
10024
  ] }) : null,
@@ -9620,11 +10037,11 @@ function HumanInputConversationRow({ item }) {
9620
10037
  label: "Copy answer",
9621
10038
  className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
9622
10039
  trailing: /* @__PURE__ */ jsx21(MessageFooterTime, { occurredAt: item.occurredAt }),
9623
- children: /* @__PURE__ */ jsxs16("div", { className: MESSAGE_BUBBLE_CLASS, children: [
10040
+ children: /* @__PURE__ */ jsxs15("div", { className: MESSAGE_BUBBLE_CLASS, children: [
9624
10041
  /* @__PURE__ */ jsx21("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
9625
- item.response.outcome === "answered" ? /* @__PURE__ */ jsx21("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs16("div", { children: [
9626
- multipleQuestions ? /* @__PURE__ */ jsxs16("p", { className: "text-og-sm font-semibold text-og-fg", children: [
9627
- /* @__PURE__ */ jsxs16("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
10042
+ item.response.outcome === "answered" ? /* @__PURE__ */ jsx21("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs15("div", { children: [
10043
+ multipleQuestions ? /* @__PURE__ */ jsxs15("p", { className: "text-og-sm font-semibold text-og-fg", children: [
10044
+ /* @__PURE__ */ jsxs15("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
9628
10045
  questionNumberById.get(answer.questionId) ?? answerIndex + 1,
9629
10046
  "."
9630
10047
  ] }),
@@ -9668,7 +10085,7 @@ function AgentMessageRow({
9668
10085
  label: "Copy message",
9669
10086
  align: "start",
9670
10087
  className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
9671
- trailing: item.streaming ? null : /* @__PURE__ */ jsxs16(Fragment6, { children: [
10088
+ trailing: item.streaming ? null : /* @__PURE__ */ jsxs15(Fragment6, { children: [
9672
10089
  renderMessageActions?.(item),
9673
10090
  /* @__PURE__ */ jsx21(MessageFooterTime, { occurredAt: item.occurredAt })
9674
10091
  ] }),
@@ -9731,17 +10148,17 @@ function WorkerCompletionRow({
9731
10148
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
9732
10149
  ];
9733
10150
  const hasDetails = details.length > 0;
9734
- return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs16("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
9735
- /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-2.5", children: [
10151
+ return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs15("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
10152
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-2.5", children: [
9736
10153
  /* @__PURE__ */ jsx21("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx21(Icon, { className: "size-4" }) }),
9737
- /* @__PURE__ */ jsx21("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs16("p", { className: "text-og-base leading-5 text-og-fg", children: [
10154
+ /* @__PURE__ */ jsx21("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs15("p", { className: "text-og-base leading-5 text-og-fg", children: [
9738
10155
  /* @__PURE__ */ jsx21("span", { className: "font-medium", children: meta.label }),
9739
- item.goalText ? /* @__PURE__ */ jsxs16("span", { className: "text-og-fg-muted", children: [
10156
+ item.goalText ? /* @__PURE__ */ jsxs15("span", { className: "text-og-fg-muted", children: [
9740
10157
  " \xB7 ",
9741
10158
  truncate(item.goalText, 90)
9742
10159
  ] }) : null
9743
10160
  ] }) }),
9744
- item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs16(
10161
+ item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs15(
9745
10162
  "button",
9746
10163
  {
9747
10164
  type: "button",
@@ -9758,8 +10175,8 @@ function WorkerCompletionRow({
9758
10175
  }
9759
10176
  ) : null
9760
10177
  ] }),
9761
- hasDetails ? /* @__PURE__ */ jsxs16(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
9762
- /* @__PURE__ */ jsx21(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
10178
+ hasDetails ? /* @__PURE__ */ jsxs15(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
10179
+ /* @__PURE__ */ jsx21(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
9763
10180
  "button",
9764
10181
  {
9765
10182
  type: "button",
@@ -9768,12 +10185,12 @@ function WorkerCompletionRow({
9768
10185
  "outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
9769
10186
  ),
9770
10187
  children: [
9771
- /* @__PURE__ */ jsx21(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
10188
+ /* @__PURE__ */ jsx21(ChevronRightIcon4, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
9772
10189
  open ? "Hide details" : "Show details"
9773
10190
  ]
9774
10191
  }
9775
10192
  ) }),
9776
- /* @__PURE__ */ jsx21(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx21("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
10193
+ /* @__PURE__ */ jsx21(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx21("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
9777
10194
  /* @__PURE__ */ jsx21("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
9778
10195
  /* @__PURE__ */ jsx21(
9779
10196
  "p",
@@ -9794,7 +10211,7 @@ function SessionStatusRow({
9794
10211
  }) {
9795
10212
  const enter = useEntranceAnimation();
9796
10213
  const meta = SESSION_STATUS_META[item.status];
9797
- return /* @__PURE__ */ jsxs16(
10214
+ return /* @__PURE__ */ jsxs15(
9798
10215
  "div",
9799
10216
  {
9800
10217
  className: cn(
@@ -9804,7 +10221,7 @@ function SessionStatusRow({
9804
10221
  role: "status",
9805
10222
  children: [
9806
10223
  /* @__PURE__ */ jsx21("span", { className: "h-px flex-1 bg-og-border" }),
9807
- /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1.5", children: [
10224
+ /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1.5", children: [
9808
10225
  item.resolvedAt ? null : /* @__PURE__ */ jsx21(StatusDot, { status: item.status, className: "size-1" }),
9809
10226
  item.resolvedAt ? "work resumed" : meta.label.toLowerCase(),
9810
10227
  " \xB7",
@@ -9849,7 +10266,7 @@ function goalMeta(action) {
9849
10266
  function GoalRow({ item }) {
9850
10267
  const enter = useEntranceAnimation();
9851
10268
  const { label, pill, icon: Icon } = goalMeta(item.action);
9852
- return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs16(
10269
+ return /* @__PURE__ */ jsx21("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs15(
9853
10270
  "span",
9854
10271
  {
9855
10272
  className: cn(
@@ -9858,7 +10275,7 @@ function GoalRow({ item }) {
9858
10275
  ),
9859
10276
  children: [
9860
10277
  /* @__PURE__ */ jsx21(Icon, { className: "size-3.5 shrink-0" }),
9861
- /* @__PURE__ */ jsxs16("span", { className: "truncate", children: [
10278
+ /* @__PURE__ */ jsxs15("span", { className: "truncate", children: [
9862
10279
  label,
9863
10280
  item.text ? `: ${truncate(item.text, 90)}` : ""
9864
10281
  ] })
@@ -9885,15 +10302,15 @@ function MachineInputBatchRow({
9885
10302
  }
9886
10303
  const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
9887
10304
  const showCollapsedSummary = !item.compact && single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
9888
- return /* @__PURE__ */ jsxs16("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
9889
- /* @__PURE__ */ jsxs16(
10305
+ return /* @__PURE__ */ jsxs15("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
10306
+ /* @__PURE__ */ jsxs15(
9890
10307
  "details",
9891
10308
  {
9892
10309
  className: "group w-full max-w-full",
9893
10310
  "data-og-machine-input-batch": "",
9894
10311
  title: `Received ${formatClockTime(item.occurredAt)}`,
9895
10312
  children: [
9896
- /* @__PURE__ */ jsx21("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs16(
10313
+ /* @__PURE__ */ jsx21("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs15(
9897
10314
  "span",
9898
10315
  {
9899
10316
  className: cn(
@@ -9902,7 +10319,7 @@ function MachineInputBatchRow({
9902
10319
  ),
9903
10320
  children: [
9904
10321
  /* @__PURE__ */ jsx21(
9905
- ChevronRightIcon3,
10322
+ ChevronRightIcon4,
9906
10323
  {
9907
10324
  "aria-hidden": true,
9908
10325
  className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
@@ -9912,8 +10329,8 @@ function MachineInputBatchRow({
9912
10329
  ]
9913
10330
  }
9914
10331
  ) }),
9915
- /* @__PURE__ */ jsxs16("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
9916
- /* @__PURE__ */ jsxs16("p", { className: "text-og-xs text-og-fg-subtle", children: [
10332
+ /* @__PURE__ */ jsxs15("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
10333
+ /* @__PURE__ */ jsxs15("p", { className: "text-og-xs text-og-fg-subtle", children: [
9917
10334
  "Received ",
9918
10335
  /* @__PURE__ */ jsx21("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
9919
10336
  ] }),
@@ -9950,11 +10367,11 @@ function MachineInputRow({
9950
10367
  }
9951
10368
  const source = readableMachineInputSource(member.sourceId);
9952
10369
  const summary = cleanMachineInputSummary(member.summary);
9953
- return /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 items-start gap-2.5", children: [
10370
+ return /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-start gap-2.5", children: [
9954
10371
  /* @__PURE__ */ jsx21("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
9955
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
10372
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
9956
10373
  /* @__PURE__ */ jsx21("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
9957
- source && /* @__PURE__ */ jsxs16("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
10374
+ source && /* @__PURE__ */ jsxs15("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
9958
10375
  "from ",
9959
10376
  source
9960
10377
  ] }),
@@ -9977,7 +10394,7 @@ function VideoGenerationResultRow({
9977
10394
  }) {
9978
10395
  const enter = useEntranceAnimation();
9979
10396
  if (result.status !== "ready") {
9980
- return /* @__PURE__ */ jsxs16(
10397
+ return /* @__PURE__ */ jsxs15(
9981
10398
  "div",
9982
10399
  {
9983
10400
  className: cn(
@@ -9985,7 +10402,7 @@ function VideoGenerationResultRow({
9985
10402
  "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"
9986
10403
  ),
9987
10404
  children: [
9988
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
10405
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
9989
10406
  /* @__PURE__ */ jsx21(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
9990
10407
  "Video generation failed"
9991
10408
  ] }),
@@ -9996,7 +10413,7 @@ function VideoGenerationResultRow({
9996
10413
  }
9997
10414
  const { receipt } = result;
9998
10415
  const facts = receipt.video;
9999
- return /* @__PURE__ */ jsxs16(
10416
+ return /* @__PURE__ */ jsxs15(
10000
10417
  "section",
10001
10418
  {
10002
10419
  "aria-label": "Generated video",
@@ -10014,10 +10431,10 @@ function VideoGenerationResultRow({
10014
10431
  className: "rounded-none border-0 shadow-none"
10015
10432
  }
10016
10433
  ) : /* @__PURE__ */ jsx21("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx21(PlayIcon, { "aria-hidden": true, className: "size-6" }) }),
10017
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
10018
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
10434
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
10435
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
10019
10436
  /* @__PURE__ */ jsx21("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
10020
- /* @__PURE__ */ jsxs16("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
10437
+ /* @__PURE__ */ jsxs15("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
10021
10438
  facts.width,
10022
10439
  "\xD7",
10023
10440
  facts.height,
@@ -10039,16 +10456,16 @@ function NoticeRow({ item }) {
10039
10456
  const enter = useEntranceAnimation();
10040
10457
  if (item.allowance) return /* @__PURE__ */ jsx21(AllowanceExhaustedRow, { refusal: item.allowance });
10041
10458
  if (item.recordedOutcome) {
10042
- return /* @__PURE__ */ jsxs16(
10459
+ return /* @__PURE__ */ jsxs15(
10043
10460
  "details",
10044
10461
  {
10045
10462
  className: "group text-og-sm text-og-fg-muted",
10046
10463
  role: "note",
10047
10464
  "data-og-recorded-outcome": "wait",
10048
10465
  children: [
10049
- /* @__PURE__ */ jsxs16("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
10466
+ /* @__PURE__ */ jsxs15("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
10050
10467
  /* @__PURE__ */ jsx21(
10051
- ChevronRightIcon3,
10468
+ ChevronRightIcon4,
10052
10469
  {
10053
10470
  "aria-hidden": true,
10054
10471
  className: "size-3.5 transition-transform group-open:rotate-90"
@@ -10063,7 +10480,7 @@ function NoticeRow({ item }) {
10063
10480
  }
10064
10481
  const resolvedApproval = Boolean(item.resolvedAt && item.text.startsWith("Approval needed"));
10065
10482
  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;
10066
- return /* @__PURE__ */ jsxs16(
10483
+ return /* @__PURE__ */ jsxs15(
10067
10484
  "div",
10068
10485
  {
10069
10486
  className: cn(
@@ -10079,9 +10496,9 @@ function NoticeRow({ item }) {
10079
10496
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
10080
10497
  }
10081
10498
  ),
10082
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
10499
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
10083
10500
  /* @__PURE__ */ jsx21("span", { className: "whitespace-pre-wrap break-words", children: resolvedApproval ? "You responded to this approval." : item.text }),
10084
- item.details ? /* @__PURE__ */ jsxs16("details", { className: "mt-2 text-og-control", children: [
10501
+ item.details ? /* @__PURE__ */ jsxs15("details", { className: "mt-2 text-og-control", children: [
10085
10502
  /* @__PURE__ */ jsx21("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
10086
10503
  /* @__PURE__ */ jsx21("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) })
10087
10504
  ] }) : null
@@ -10105,7 +10522,7 @@ function recordedWaitSummary(item) {
10105
10522
  const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
10106
10523
  const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
10107
10524
  if (waitedMs !== void 0) {
10108
- return /* @__PURE__ */ jsxs16(Fragment6, { children: [
10525
+ return /* @__PURE__ */ jsxs15(Fragment6, { children: [
10109
10526
  "Waited",
10110
10527
  target,
10111
10528
  " \xB7",
@@ -10115,7 +10532,7 @@ function recordedWaitSummary(item) {
10115
10532
  }
10116
10533
  const started = new Date(item.occurredAt);
10117
10534
  const sameDay = started.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
10118
- return /* @__PURE__ */ jsxs16(Fragment6, { children: [
10535
+ return /* @__PURE__ */ jsxs15(Fragment6, { children: [
10119
10536
  item.waitEndedAt ? "Waited" : "Waiting",
10120
10537
  target,
10121
10538
  " \xB7 since",
@@ -10153,9 +10570,9 @@ function AuthNeededRow({
10153
10570
  setBusy(false);
10154
10571
  }
10155
10572
  };
10156
- return /* @__PURE__ */ jsxs16("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
10157
- /* @__PURE__ */ jsxs16("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: [
10158
- /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
10573
+ return /* @__PURE__ */ jsxs15("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
10574
+ /* @__PURE__ */ jsxs15("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: [
10575
+ /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
10159
10576
  /* @__PURE__ */ jsx21(
10160
10577
  AuthProviderLogo,
10161
10578
  {
@@ -10163,20 +10580,20 @@ function AuthNeededRow({
10163
10580
  label: provider
10164
10581
  }
10165
10582
  ),
10166
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
10583
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
10167
10584
  /* @__PURE__ */ jsx21("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
10168
10585
  /* @__PURE__ */ jsx21("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
10169
- recommendation ? /* @__PURE__ */ jsxs16("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
10586
+ recommendation ? /* @__PURE__ */ jsxs15("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
10170
10587
  "Provider: ",
10171
10588
  item.providerDomain
10172
10589
  ] }) : null,
10173
- recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs16("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
10590
+ recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs15("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
10174
10591
  "Needs variables: ",
10175
10592
  recommendation.requiredVariables.join(", ")
10176
10593
  ] }) : null
10177
10594
  ] })
10178
10595
  ] }),
10179
- hostAuthorizationUrl ? /* @__PURE__ */ jsxs16(
10596
+ hostAuthorizationUrl ? /* @__PURE__ */ jsxs15(
10180
10597
  "a",
10181
10598
  {
10182
10599
  href: hostAuthorizationUrl,
@@ -10191,7 +10608,7 @@ function AuthNeededRow({
10191
10608
  actionLabel
10192
10609
  ]
10193
10610
  }
10194
- ) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs16(
10611
+ ) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs15(
10195
10612
  "button",
10196
10613
  {
10197
10614
  type: "button",
@@ -10206,7 +10623,7 @@ function AuthNeededRow({
10206
10623
  busy ? "Opening\u2026" : actionLabel
10207
10624
  ]
10208
10625
  }
10209
- ) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs16(
10626
+ ) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs15(
10210
10627
  "a",
10211
10628
  {
10212
10629
  href: item.authorizationUrl,
@@ -10224,7 +10641,7 @@ function AuthNeededRow({
10224
10641
  ) : null
10225
10642
  ] }),
10226
10643
  !unavailable ? /* @__PURE__ */ jsx21("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,
10227
- failed ? /* @__PURE__ */ jsxs16("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
10644
+ failed ? /* @__PURE__ */ jsxs15("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
10228
10645
  "Couldn't start ",
10229
10646
  missing ? "connecting" : "reconnecting",
10230
10647
  " ",
@@ -10297,7 +10714,7 @@ function authReasonLine(reason) {
10297
10714
  // src/components/queue-surface.tsx
10298
10715
  import { Loader2Icon } from "lucide-react";
10299
10716
  import { lazy as lazy4, Suspense as Suspense5 } from "react";
10300
- import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
10717
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
10301
10718
  var loadQueueSurface = () => import("./queue-surface-implementation-ZHFI5JBP.js");
10302
10719
  var QueueSurface = createQueueSurface(loadQueueSurface);
10303
10720
  function createQueueSurface(loadImplementation) {
@@ -10321,7 +10738,7 @@ function QueueSurfaceFallback() {
10321
10738
  className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
10322
10739
  "data-testid": "queue-surface-loading",
10323
10740
  role: "status",
10324
- children: /* @__PURE__ */ jsx22("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
10741
+ children: /* @__PURE__ */ jsx22("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
10325
10742
  /* @__PURE__ */ jsx22(
10326
10743
  Loader2Icon,
10327
10744
  {
@@ -10336,10 +10753,10 @@ function QueueSurfaceFallback() {
10336
10753
  }
10337
10754
 
10338
10755
  // src/hooks/use-available-models.ts
10339
- import { useCallback as useCallback4 } from "react";
10756
+ import { useCallback as useCallback5 } from "react";
10340
10757
  function useAvailableModels(options = {}) {
10341
10758
  const client = useOpenGeniClient(options);
10342
- const load = useCallback4(
10759
+ const load = useCallback5(
10343
10760
  async (signal) => await client.getClientConfig({ signal }),
10344
10761
  [client]
10345
10762
  );
@@ -10357,7 +10774,7 @@ function useAvailableModels(options = {}) {
10357
10774
  }
10358
10775
  function useWorkspaceModelCatalog(options) {
10359
10776
  const client = useOpenGeniClient(options);
10360
- const load = useCallback4(
10777
+ const load = useCallback5(
10361
10778
  async (signal) => {
10362
10779
  if (!options.workspaceId) {
10363
10780
  return { models: [], defaultModel: null };
@@ -10393,7 +10810,7 @@ import { LayoutGroup, motion as motion4 } from "motion/react";
10393
10810
  import {
10394
10811
  useImperativeHandle
10395
10812
  } from "react";
10396
- import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
10813
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
10397
10814
  function ChatComposer({
10398
10815
  composer,
10399
10816
  responsiveBasis,
@@ -10455,10 +10872,10 @@ function ChatComposer({
10455
10872
  useImperativeHandle(focusRef, () => ({ focusInput: controller.focusInput }), [
10456
10873
  controller.focusInput
10457
10874
  ]);
10458
- return /* @__PURE__ */ jsx23(Fragment7, { children: /* @__PURE__ */ jsxs18(Root, { controller, responsiveBasis, className, children: [
10459
- /* @__PURE__ */ jsxs18(Frame, { children: [
10875
+ return /* @__PURE__ */ jsx23(Fragment7, { children: /* @__PURE__ */ jsxs17(Root, { controller, responsiveBasis, className, children: [
10876
+ /* @__PURE__ */ jsxs17(Frame, { children: [
10460
10877
  /* @__PURE__ */ jsx23(CommandPalette, {}),
10461
- /* @__PURE__ */ jsxs18(Surface, { className: surfaceClassName, children: [
10878
+ /* @__PURE__ */ jsxs17(Surface, { className: surfaceClassName, children: [
10462
10879
  /* @__PURE__ */ jsx23(PausedState, {}),
10463
10880
  /* @__PURE__ */ jsx23(RestoredResources, {}),
10464
10881
  /* @__PURE__ */ jsx23(Attachments, {}),
@@ -10481,8 +10898,8 @@ function ChatComposer({
10481
10898
  {
10482
10899
  "data-og-stack-actions": stackActions ? "" : void 0,
10483
10900
  className: stackActions ? "max-sm:flex-nowrap sm:flex-wrap" : void 0,
10484
- children: /* @__PURE__ */ jsxs18(LayoutGroup, { id: "og-composer-footer", children: [
10485
- hasControls ? /* @__PURE__ */ jsxs18(
10901
+ children: /* @__PURE__ */ jsxs17(LayoutGroup, { id: "og-composer-footer", children: [
10902
+ hasControls ? /* @__PURE__ */ jsxs17(
10486
10903
  Controls,
10487
10904
  {
10488
10905
  className: stackActions ? "min-w-0 max-sm:flex-1 sm:w-auto" : void 0,
@@ -10525,7 +10942,7 @@ function ChatComposer({
10525
10942
  ]
10526
10943
  }
10527
10944
  ) : /* @__PURE__ */ jsx23(Hint, { children: hint }),
10528
- /* @__PURE__ */ jsxs18(
10945
+ /* @__PURE__ */ jsxs17(
10529
10946
  Actions,
10530
10947
  {
10531
10948
  className: stackActions ? "max-sm:shrink-0 sm:w-auto sm:justify-end" : void 0,
@@ -10569,8 +10986,8 @@ import {
10569
10986
  TargetIcon as TargetIcon3
10570
10987
  } from "lucide-react";
10571
10988
  import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
10572
- import { useEffect as useEffect13, useId as useId4, useMemo as useMemo7, useRef as useRef11, useState as useState18 } from "react";
10573
- import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
10989
+ import { useEffect as useEffect13, useId as useId4, useMemo as useMemo8, useRef as useRef11, useState as useState18 } from "react";
10990
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
10574
10991
  var GOAL_LABEL = {
10575
10992
  pursuing: "Pursuing",
10576
10993
  waiting: "Waiting",
@@ -10790,12 +11207,12 @@ function SessionChrome({
10790
11207
  const incoming = queue.pendingInputs;
10791
11208
  const turns = queue.queue;
10792
11209
  const queueMutationFor = queue.mutationFor;
10793
- const queuedTurns = useMemo7(
11210
+ const queuedTurns = useMemo8(
10794
11211
  () => turns.filter((turn) => isAuthoritativeQueuedTurn(turn, queueMutationFor)),
10795
11212
  [queueMutationFor, turns]
10796
11213
  );
10797
- const queuedTurnIds = useMemo7(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
10798
- const optimisticQueued = useMemo7(
11214
+ const queuedTurnIds = useMemo8(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
11215
+ const optimisticQueued = useMemo8(
10799
11216
  () => (composer?.optimisticMessages ?? []).filter(
10800
11217
  (message) => isOptimisticQueuedMessage(message, queuedTurnIds, queue.snapshot)
10801
11218
  ),
@@ -10869,7 +11286,7 @@ function SessionChrome({
10869
11286
  onActiveChange?.(next);
10870
11287
  };
10871
11288
  const hasCommandsPanel = commandsPanel != null;
10872
- const signals = useMemo7(() => {
11289
+ const signals = useMemo8(() => {
10873
11290
  const rows = [];
10874
11291
  if (incoming.length > 0) {
10875
11292
  const detail = incoming[0]?.summary;
@@ -11121,7 +11538,7 @@ function SessionChrome({
11121
11538
  ref: rootRef,
11122
11539
  "data-og-session-chrome": "",
11123
11540
  "data-og-session-chrome-open": open ? "true" : "false",
11124
- children: /* @__PURE__ */ jsxs19(
11541
+ children: /* @__PURE__ */ jsxs18(
11125
11542
  "div",
11126
11543
  {
11127
11544
  className: cn(
@@ -11147,7 +11564,7 @@ function SessionChrome({
11147
11564
  paddingLeft: "var(--og-session-chrome-rail-pad)",
11148
11565
  paddingRight: "var(--og-session-chrome-rail-pad)"
11149
11566
  },
11150
- children: /* @__PURE__ */ jsxs19(
11567
+ children: /* @__PURE__ */ jsxs18(
11151
11568
  "div",
11152
11569
  {
11153
11570
  ref: railRef,
@@ -11178,7 +11595,7 @@ function SessionChrome({
11178
11595
  ),
11179
11596
  signals.filter((signal) => !["incoming", "agents", "commands"].includes(signal.id)).map((signal) => {
11180
11597
  const selected = active === signal.id;
11181
- return /* @__PURE__ */ jsxs19(
11598
+ return /* @__PURE__ */ jsxs18(
11182
11599
  "div",
11183
11600
  {
11184
11601
  role: "group",
@@ -11189,7 +11606,7 @@ function SessionChrome({
11189
11606
  selected && "bg-og-surface-3"
11190
11607
  ),
11191
11608
  children: [
11192
- /* @__PURE__ */ jsxs19(
11609
+ /* @__PURE__ */ jsxs18(
11193
11610
  "button",
11194
11611
  {
11195
11612
  type: "button",
@@ -11231,14 +11648,14 @@ function SessionChrome({
11231
11648
  queueArrivalNonce
11232
11649
  ) : null,
11233
11650
  /* @__PURE__ */ jsx24("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
11234
- /* @__PURE__ */ jsxs19("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
11651
+ /* @__PURE__ */ jsxs18("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
11235
11652
  signal.id === "goal" ? "Goal \xB7 " : null,
11236
11653
  signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : signal.id === "queue" ? queue.error || queue.mutationError ? signal.label : `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
11237
11654
  ] })
11238
11655
  ]
11239
11656
  }
11240
11657
  ),
11241
- signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs19("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
11658
+ signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs18("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
11242
11659
  record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx24(
11243
11660
  IconAction,
11244
11661
  {
@@ -11277,7 +11694,7 @@ function SessionChrome({
11277
11694
  signal.id
11278
11695
  );
11279
11696
  }),
11280
- signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs19(
11697
+ signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs18(
11281
11698
  "button",
11282
11699
  {
11283
11700
  type: "button",
@@ -11301,7 +11718,7 @@ function SessionChrome({
11301
11718
  children: [
11302
11719
  /* @__PURE__ */ jsx24(ActivityIcon, { className: "size-3.5" }),
11303
11720
  /* @__PURE__ */ jsx24("span", { className: "sr-only", children: "Activity" }),
11304
- commandsCount > 0 ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
11721
+ commandsCount > 0 ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
11305
11722
  /* @__PURE__ */ jsx24(
11306
11723
  "span",
11307
11724
  {
@@ -11309,7 +11726,7 @@ function SessionChrome({
11309
11726
  className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-fg-muted motion-reduce:animate-none"
11310
11727
  }
11311
11728
  ),
11312
- /* @__PURE__ */ jsxs19("span", { id: `${panelId}-commands-count`, children: [
11729
+ /* @__PURE__ */ jsxs18("span", { id: `${panelId}-commands-count`, children: [
11313
11730
  commandsCount,
11314
11731
  " command",
11315
11732
  commandsCount === 1 ? "" : "s"
@@ -11319,7 +11736,7 @@ function SessionChrome({
11319
11736
  ]
11320
11737
  }
11321
11738
  ) : null,
11322
- stopping ? /* @__PURE__ */ jsxs19(
11739
+ stopping ? /* @__PURE__ */ jsxs18(
11323
11740
  "span",
11324
11741
  {
11325
11742
  role: "status",
@@ -11351,7 +11768,7 @@ function SessionChrome({
11351
11768
  exit: { height: 0, opacity: 0 },
11352
11769
  transition: { duration: shellDuration, ease },
11353
11770
  style: { overflow: "hidden" },
11354
- children: /* @__PURE__ */ jsx24("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__ */ jsxs19(
11771
+ children: /* @__PURE__ */ jsx24("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__ */ jsxs18(
11355
11772
  "button",
11356
11773
  {
11357
11774
  type: "button",
@@ -11373,7 +11790,7 @@ function SessionChrome({
11373
11790
  },
11374
11791
  "activity-tabs"
11375
11792
  ) : null }),
11376
- goal?.mutationError ? /* @__PURE__ */ jsxs19("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
11793
+ goal?.mutationError ? /* @__PURE__ */ jsxs18("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
11377
11794
  "Goal action not confirmed. ",
11378
11795
  formatError(goal.mutationError)
11379
11796
  ] }) : null,
@@ -11393,7 +11810,7 @@ function SessionChrome({
11393
11810
  transitionDuration: "var(--og-session-chrome-duration)",
11394
11811
  transitionTimingFunction: "var(--_og-session-chrome-ease)"
11395
11812
  },
11396
- children: /* @__PURE__ */ jsx24("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs19(
11813
+ children: /* @__PURE__ */ jsx24("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs18(
11397
11814
  "div",
11398
11815
  {
11399
11816
  className: cn(
@@ -11450,7 +11867,7 @@ function IncomingPanel({
11450
11867
  onDismiss,
11451
11868
  onOpenSession
11452
11869
  }) {
11453
- return /* @__PURE__ */ jsxs19("div", { children: [
11870
+ return /* @__PURE__ */ jsxs18("div", { children: [
11454
11871
  /* @__PURE__ */ jsx24("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
11455
11872
  /* @__PURE__ */ jsx24(
11456
11873
  "ul",
@@ -11458,7 +11875,7 @@ function IncomingPanel({
11458
11875
  className: "flex flex-col gap-0.5",
11459
11876
  "aria-label": "Incoming updates",
11460
11877
  "data-og-session-chrome-panel": "incoming",
11461
- children: inputs.map((input) => /* @__PURE__ */ jsxs19(
11878
+ children: inputs.map((input) => /* @__PURE__ */ jsxs18(
11462
11879
  "li",
11463
11880
  {
11464
11881
  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)]",
@@ -11473,7 +11890,7 @@ function IncomingPanel({
11473
11890
  children: pendingKindLabel(input.kind)
11474
11891
  }
11475
11892
  ),
11476
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
11893
+ /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
11477
11894
  /* @__PURE__ */ jsx24("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
11478
11895
  /* @__PURE__ */ jsx24(
11479
11896
  ChildSessionLink,
@@ -11540,7 +11957,7 @@ function QueuePanel({
11540
11957
  );
11541
11958
  return () => clearTimeout(timer);
11542
11959
  }, [reduceMotion, turnIdsKey]);
11543
- return /* @__PURE__ */ jsxs19(
11960
+ return /* @__PURE__ */ jsxs18(
11544
11961
  "ol",
11545
11962
  {
11546
11963
  className: "flex flex-col gap-0.5",
@@ -11556,14 +11973,14 @@ function QueuePanel({
11556
11973
  const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
11557
11974
  const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
11558
11975
  const confirmingReplace = replaceDraftFor === turn.id;
11559
- return /* @__PURE__ */ jsxs19(
11976
+ return /* @__PURE__ */ jsxs18(
11560
11977
  "li",
11561
11978
  {
11562
11979
  "data-queue-turn-id": turn.id,
11563
11980
  tabIndex: -1,
11564
11981
  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)]",
11565
11982
  children: [
11566
- /* @__PURE__ */ jsxs19("div", { className: "flex items-start gap-1.5", children: [
11983
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-1.5", children: [
11567
11984
  voice ? /* @__PURE__ */ jsx24(
11568
11985
  AudioLinesIcon,
11569
11986
  {
@@ -11578,8 +11995,8 @@ function QueuePanel({
11578
11995
  annotations: turn.annotations ?? []
11579
11996
  }
11580
11997
  ),
11581
- showActions ? /* @__PURE__ */ jsxs19("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: [
11582
- onMove && turns.length > 1 ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
11998
+ showActions ? /* @__PURE__ */ jsxs18("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: [
11999
+ onMove && turns.length > 1 ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
11583
12000
  /* @__PURE__ */ jsx24(
11584
12001
  IconAction,
11585
12002
  {
@@ -11636,10 +12053,10 @@ function QueuePanel({
11636
12053
  ) : null
11637
12054
  ] }) : null
11638
12055
  ] }),
11639
- confirmingReplace ? /* @__PURE__ */ jsxs19("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: [
12056
+ confirmingReplace ? /* @__PURE__ */ jsxs18("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: [
11640
12057
  /* @__PURE__ */ jsx24("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
11641
12058
  /* @__PURE__ */ jsx24("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." }),
11642
- /* @__PURE__ */ jsxs19("div", { className: "mt-2 flex justify-end gap-1.5", children: [
12059
+ /* @__PURE__ */ jsxs18("div", { className: "mt-2 flex justify-end gap-1.5", children: [
11643
12060
  /* @__PURE__ */ jsx24(
11644
12061
  "button",
11645
12062
  {
@@ -11665,7 +12082,7 @@ function QueuePanel({
11665
12082
  turn.id
11666
12083
  );
11667
12084
  }),
11668
- /* @__PURE__ */ jsx24(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs19(
12085
+ /* @__PURE__ */ jsx24(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs18(
11669
12086
  motion5.li,
11670
12087
  {
11671
12088
  "aria-live": "polite",
@@ -11679,12 +12096,12 @@ function QueuePanel({
11679
12096
  ),
11680
12097
  children: [
11681
12098
  /* @__PURE__ */ jsx24("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
11682
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
12099
+ /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
11683
12100
  /* @__PURE__ */ jsx24(CompactQueueItemContent, { text: message.text, annotations: message.annotations }),
11684
12101
  message.state === "failed" && message.error ? /* @__PURE__ */ jsx24("p", { className: "break-words text-og-xs", children: message.error }) : null
11685
12102
  ] }),
11686
12103
  /* @__PURE__ */ jsx24("span", { className: "sr-only", children: message.state === "failed" ? message.outcomeUnknown ? "Not confirmed" : "Message not sent" : message.state === "sending" ? "Placing in queue" : "Queued" }),
11687
- message.state === "failed" ? /* @__PURE__ */ jsxs19("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
12104
+ message.state === "failed" ? /* @__PURE__ */ jsxs18("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
11688
12105
  message.retryable !== false && onRetryOptimistic ? /* @__PURE__ */ jsx24(
11689
12106
  "button",
11690
12107
  {
@@ -11724,7 +12141,7 @@ function QueuePanel({
11724
12141
  },
11725
12142
  message.clientEventId
11726
12143
  )) }),
11727
- loadError ? /* @__PURE__ */ jsxs19(
12144
+ loadError ? /* @__PURE__ */ jsxs18(
11728
12145
  "li",
11729
12146
  {
11730
12147
  role: "alert",
@@ -11744,7 +12161,7 @@ function QueuePanel({
11744
12161
  ]
11745
12162
  }
11746
12163
  ) : null,
11747
- mutationError ? /* @__PURE__ */ jsxs19(
12164
+ mutationError ? /* @__PURE__ */ jsxs18(
11748
12165
  "li",
11749
12166
  {
11750
12167
  role: "alert",
@@ -11773,7 +12190,7 @@ function CompactQueueItemContent({
11773
12190
  annotations
11774
12191
  }) {
11775
12192
  const content = queueItemContent(text, annotations.length);
11776
- return /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
12193
+ return /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
11777
12194
  content === "text" ? /* @__PURE__ */ jsx24("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: text }) : content === "unavailable" ? /* @__PURE__ */ jsx24("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg-muted italic", children: QUEUE_ITEM_CONTENT_UNAVAILABLE }) : null,
11778
12195
  annotations.length > 0 ? /* @__PURE__ */ jsx24(TimelineAnnotationsChip, { annotations, className: "shrink-0", compact: true }) : null
11779
12196
  ] });
@@ -11789,21 +12206,21 @@ function GoalPanel({
11789
12206
  if (!record) return null;
11790
12207
  const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
11791
12208
  const explanation = sessionChromeGoalPillExplanation(state, record);
11792
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
11793
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
12209
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
12210
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
11794
12211
  /* @__PURE__ */ jsx24("span", { children: sessionChromeGoalPillLabel(state, record) }),
11795
- elapsed ? /* @__PURE__ */ jsxs19("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
12212
+ elapsed ? /* @__PURE__ */ jsxs18("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
11796
12213
  "\xB7 Created ",
11797
12214
  elapsed,
11798
12215
  " ago"
11799
12216
  ] }) : null,
11800
- /* @__PURE__ */ jsxs19("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
12217
+ /* @__PURE__ */ jsxs18("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
11801
12218
  "\xB7 v",
11802
12219
  record.version
11803
12220
  ] })
11804
12221
  ] }),
11805
12222
  /* @__PURE__ */ jsx24("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
11806
- record.successCriteria ? /* @__PURE__ */ jsxs19("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
12223
+ record.successCriteria ? /* @__PURE__ */ jsxs18("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
11807
12224
  /* @__PURE__ */ jsx24("span", { className: "font-medium text-og-fg", children: "Done when" }),
11808
12225
  " ",
11809
12226
  record.successCriteria
@@ -11817,19 +12234,19 @@ function GoalPanel({
11817
12234
  }
11818
12235
  ) : null,
11819
12236
  record.continuation?.lastError ? /* @__PURE__ */ jsx24("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: formatError(record.continuation.lastError) }) : null,
11820
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
11821
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
11822
- /* @__PURE__ */ jsxs19("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
12237
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
12238
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
12239
+ /* @__PURE__ */ jsxs18("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
11823
12240
  record.autoContinuations,
11824
12241
  " consecutive unattended continues"
11825
12242
  ] }),
11826
- /* @__PURE__ */ jsxs19("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
12243
+ /* @__PURE__ */ jsxs18("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
11827
12244
  record.noProgressStreak,
11828
12245
  " stalled"
11829
12246
  ] })
11830
12247
  ] }),
11831
- !readOnly ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-0.5", children: [
11832
- canToggle ? /* @__PURE__ */ jsxs19(
12248
+ !readOnly ? /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-0.5", children: [
12249
+ canToggle ? /* @__PURE__ */ jsxs18(
11833
12250
  "button",
11834
12251
  {
11835
12252
  type: "button",
@@ -11842,7 +12259,7 @@ function GoalPanel({
11842
12259
  ]
11843
12260
  }
11844
12261
  ) : null,
11845
- /* @__PURE__ */ jsxs19(
12262
+ /* @__PURE__ */ jsxs18(
11846
12263
  "button",
11847
12264
  {
11848
12265
  type: "button",
@@ -11859,7 +12276,7 @@ function GoalPanel({
11859
12276
  ] })
11860
12277
  ] });
11861
12278
  }
11862
- var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs19("span", { className: "flex flex-col gap-0.5 text-left", children: [
12279
+ var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs18("span", { className: "flex flex-col gap-0.5 text-left", children: [
11863
12280
  /* @__PURE__ */ jsx24("span", { className: "font-medium", children: "Steer" }),
11864
12281
  /* @__PURE__ */ jsx24("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
11865
12282
  ] });
@@ -11875,8 +12292,8 @@ function IconAction({
11875
12292
  danger,
11876
12293
  children
11877
12294
  }) {
11878
- return /* @__PURE__ */ jsxs19(Tooltip, { children: [
11879
- /* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs19(
12295
+ return /* @__PURE__ */ jsxs18(Tooltip, { children: [
12296
+ /* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
11880
12297
  "button",
11881
12298
  {
11882
12299
  type: "button",
@@ -11903,20 +12320,79 @@ function IconAction({
11903
12320
  }
11904
12321
 
11905
12322
  // src/components/session-conversation.tsx
11906
- import { SESSION_SCOPE_HEADER } from "@opengeni/sdk";
12323
+ import {
12324
+ resolveWorkspaceVoiceInputEnabled,
12325
+ SESSION_SCOPE_HEADER
12326
+ } from "@opengeni/sdk";
11907
12327
  import {
11908
12328
  lazy as lazy5,
11909
12329
  Suspense as Suspense6,
11910
- useCallback as useCallback5,
11911
- useEffect as useEffect16,
11912
- useMemo as useMemo9,
12330
+ useCallback as useCallback6,
12331
+ useEffect as useEffect17,
12332
+ useMemo as useMemo10,
11913
12333
  useRef as useRef13,
11914
- useState as useState21
12334
+ useState as useState22
11915
12335
  } from "react";
11916
12336
 
12337
+ // src/hooks/use-client-config-flags.ts
12338
+ import { useEffect as useEffect14, useState as useState19 } from "react";
12339
+ var INITIAL_FLAGS = {
12340
+ loaded: false,
12341
+ uploads: false,
12342
+ modelSelection: false,
12343
+ sandboxFiles: false,
12344
+ defaultReasoningEffort: null,
12345
+ artifacts: true,
12346
+ sessionCreation: true,
12347
+ archive: true,
12348
+ voiceInput: null
12349
+ };
12350
+ var configReads = /* @__PURE__ */ new WeakMap();
12351
+ function readClientConfig(client) {
12352
+ let read = configReads.get(client);
12353
+ if (!read) {
12354
+ read = client.getClientConfig();
12355
+ configReads.set(client, read);
12356
+ read.catch(() => {
12357
+ if (configReads.get(client) === read) configReads.delete(client);
12358
+ });
12359
+ }
12360
+ return read;
12361
+ }
12362
+ function useClientConfigFlags(client) {
12363
+ const [flags, setFlags] = useState19(INITIAL_FLAGS);
12364
+ useEffect14(() => {
12365
+ if (typeof client.getClientConfig !== "function") return;
12366
+ let live = true;
12367
+ readClientConfig(client).then(
12368
+ (config) => {
12369
+ if (live) {
12370
+ setFlags({
12371
+ loaded: true,
12372
+ uploads: config.fileUploads?.enabled === true,
12373
+ // Only an explicit offer shows end users the picker.
12374
+ modelSelection: config.modelSelection === true,
12375
+ sandboxFiles: config.sandboxFiles !== false,
12376
+ defaultReasoningEffort: config.defaultReasoningEffort ?? null,
12377
+ artifacts: config.artifacts !== false,
12378
+ sessionCreation: config.sessionCreation !== false,
12379
+ archive: config.archive !== false,
12380
+ voiceInput: config.voiceInput?.available === true ? config.voiceInput : null
12381
+ });
12382
+ }
12383
+ },
12384
+ () => void 0
12385
+ );
12386
+ return () => {
12387
+ live = false;
12388
+ };
12389
+ }, [client]);
12390
+ return flags;
12391
+ }
12392
+
11917
12393
  // src/components/session-proxy-scope.tsx
11918
12394
  import { OpenGeniBrowserClient } from "@opengeni/sdk/browser";
11919
- import { useEffect as useEffect14, useMemo as useMemo8, useRef as useRef12, useState as useState19 } from "react";
12395
+ import { useEffect as useEffect15, useMemo as useMemo9, useRef as useRef12, useState as useState20 } from "react";
11920
12396
  import { jsx as jsx25 } from "react/jsx-runtime";
11921
12397
  function SessionProxyScope({
11922
12398
  baseUrl,
@@ -11936,7 +12412,7 @@ function SessionProxyScope({
11936
12412
  const fetchRef = useRef12(fetch);
11937
12413
  fetchRef.current = fetch;
11938
12414
  const hasFetch = fetch !== void 0;
11939
- const ownClient = useMemo8(
12415
+ const ownClient = useMemo9(
11940
12416
  () => new OpenGeniBrowserClient({
11941
12417
  baseUrl,
11942
12418
  apiContract: "compatible",
@@ -11949,10 +12425,10 @@ function SessionProxyScope({
11949
12425
  [baseUrl, hasFetch]
11950
12426
  );
11951
12427
  const client = suppliedClient ?? ownClient;
11952
- const [state, setState] = useState19(
12428
+ const [state, setState] = useState20(
11953
12429
  workspaceId ? { status: "ready", workspaceId } : { status: "loading" }
11954
12430
  );
11955
- useEffect14(() => {
12431
+ useEffect15(() => {
11956
12432
  if (workspaceId) {
11957
12433
  setState({ status: "ready", workspaceId });
11958
12434
  return;
@@ -11991,7 +12467,7 @@ function SessionProxyScope({
11991
12467
  }
11992
12468
 
11993
12469
  // src/lib/host-theme.ts
11994
- import { useLayoutEffect as useLayoutEffect6, useEffect as useEffect15, useState as useState20 } from "react";
12470
+ import { useLayoutEffect as useLayoutEffect6, useEffect as useEffect16, useState as useState21 } from "react";
11995
12471
  var HOST_THEME_ROOT_ATTRIBUTE = "data-og-host-theme";
11996
12472
  var HOST_THEME_ATTRIBUTES = [
11997
12473
  "data-theme",
@@ -12219,7 +12695,7 @@ function hostSurfaceStyle(theme, background) {
12219
12695
  }
12220
12696
  return style;
12221
12697
  }
12222
- var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect15 : useLayoutEffect6;
12698
+ var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect16 : useLayoutEffect6;
12223
12699
  function designedTheme(overrides) {
12224
12700
  for (const token of ["--og-color-fg", "--og-color-bg", "--og-color-canvas"]) {
12225
12701
  const value = overrides[token];
@@ -12269,7 +12745,7 @@ function resolveHostThemeState(element, preference, surface) {
12269
12745
  function useHostTheme(ref, options) {
12270
12746
  const preference = options.theme ?? "auto";
12271
12747
  const surface = options.surface ?? "host";
12272
- const [state, setState] = useState20({ theme: preference === "auto" ? void 0 : preference, inherited: false, style: null });
12748
+ const [state, setState] = useState21({ theme: preference === "auto" ? void 0 : preference, inherited: false, style: null });
12273
12749
  useIsomorphicLayoutEffect(() => {
12274
12750
  const element = ref.current;
12275
12751
  if (!element || typeof window === "undefined") return;
@@ -12331,10 +12807,11 @@ function useHostTheme(ref, options) {
12331
12807
  }
12332
12808
 
12333
12809
  // src/components/session-conversation.tsx
12334
- import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
12810
+ import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
12335
12811
  var DEFAULT_CONVERSATION_LABELS = {
12336
12812
  retry: "Retry",
12337
- tryAgain: "Try again"
12813
+ tryAgain: "Try again",
12814
+ sitePreviewUnavailable: "Site preview unavailable"
12338
12815
  };
12339
12816
  function SessionConversation({
12340
12817
  baseUrl,
@@ -12357,7 +12834,7 @@ function SessionConversation({
12357
12834
  );
12358
12835
  }
12359
12836
  function RetryingConversation(props) {
12360
- const [attempt, setAttempt] = useState21(0);
12837
+ const [attempt, setAttempt] = useState22(0);
12361
12838
  return /* @__PURE__ */ jsx26(
12362
12839
  Conversation,
12363
12840
  {
@@ -12372,11 +12849,13 @@ function Conversation({
12372
12849
  renderMessageText,
12373
12850
  resolveLink,
12374
12851
  onOpenArtifact,
12852
+ onOpenSession,
12375
12853
  renderInteractiveBlock,
12376
12854
  toolRegistry,
12377
12855
  renderAllowanceExhausted,
12378
12856
  allowanceExhaustedLabels,
12379
12857
  attachments: attachmentsRequested = true,
12858
+ voiceInput: voiceInputRequested = true,
12380
12859
  modelPicker,
12381
12860
  modelPickerProps,
12382
12861
  userMessageDisclosureLabels,
@@ -12407,7 +12886,7 @@ function Conversation({
12407
12886
  const queue = useTurnQueue(sessionId, options);
12408
12887
  const human = useHumanInputRequests(sessionId, options);
12409
12888
  const control = useSessionControl(sessionId, scope);
12410
- const approvals = useMemo9(() => projectPendingApprovals(feed.events), [feed.events]);
12889
+ const approvals = useMemo10(() => projectPendingApprovals(feed.events), [feed.events]);
12411
12890
  const files = useFileAttachments(scope);
12412
12891
  const uploadsEnabled = attachmentsRequested && config.uploads;
12413
12892
  const status = feed.sessionStatus ?? detail.session?.status;
@@ -12434,10 +12913,18 @@ function Conversation({
12434
12913
  const defaultInteractiveBlock = useDefaultInteractiveBlock(
12435
12914
  context.client,
12436
12915
  context.workspaceId,
12437
- sessionId
12916
+ sessionId,
12917
+ config.artifacts,
12918
+ labelOverrides?.sitePreviewUnavailable ?? DEFAULT_CONVERSATION_LABELS.sitePreviewUnavailable
12919
+ );
12920
+ const retainedLoaders = useRetainedLoaders(context.client, context.workspaceId, sessionId);
12921
+ const transcription = useComposerTranscription(
12922
+ context.client,
12923
+ context.workspaceId,
12924
+ voiceInputRequested && !importedArchive ? config.voiceInput : null
12438
12925
  );
12439
12926
  const inheritedLinks = useOpenGeniLinkResolver();
12440
- const defaultLinks = useMemo9(
12927
+ const defaultLinks = useMemo10(
12441
12928
  () => sessionLinkResolver({
12442
12929
  client: context.client,
12443
12930
  workspaceId: context.workspaceId,
@@ -12449,14 +12936,14 @@ function Conversation({
12449
12936
  const onOpenArtifactRef = useRef13(onOpenArtifact);
12450
12937
  onOpenArtifactRef.current = onOpenArtifact;
12451
12938
  const opensArtifacts = onOpenArtifact !== void 0;
12452
- const viewerLinks = useMemo9(
12939
+ const viewerLinks = useMemo10(
12453
12940
  () => opensArtifacts ? viewerLinkResolver({
12454
12941
  workspaceId: context.workspaceId,
12455
12942
  open: (target) => onOpenArtifactRef.current?.(target)
12456
12943
  }) : null,
12457
12944
  [context.workspaceId, opensArtifacts]
12458
12945
  );
12459
- const links = useMemo9(
12946
+ const links = useMemo10(
12460
12947
  () => chainLinkResolvers(resolveLink, viewerLinks, inheritedLinks, defaultLinks) ?? void 0,
12461
12948
  [resolveLink, viewerLinks, inheritedLinks, defaultLinks]
12462
12949
  );
@@ -12469,7 +12956,7 @@ function Conversation({
12469
12956
  if (feed.error) void feed.jumpToLatest();
12470
12957
  };
12471
12958
  const running = status === "running" || status === "recovering" || status === "waiting_capacity";
12472
- return /* @__PURE__ */ jsxs20(
12959
+ return /* @__PURE__ */ jsxs19(
12473
12960
  "div",
12474
12961
  {
12475
12962
  className: cn(
@@ -12482,7 +12969,7 @@ function Conversation({
12482
12969
  "data-og-host-theme": "",
12483
12970
  "data-og-conversation": "",
12484
12971
  children: [
12485
- error && !loadFailed ? /* @__PURE__ */ jsxs20(
12972
+ error && !loadFailed ? /* @__PURE__ */ jsxs19(
12486
12973
  "div",
12487
12974
  {
12488
12975
  role: "alert",
@@ -12502,7 +12989,7 @@ function Conversation({
12502
12989
  ]
12503
12990
  }
12504
12991
  ) : null,
12505
- loadFailed ? /* @__PURE__ */ jsxs20(
12992
+ loadFailed ? /* @__PURE__ */ jsxs19(
12506
12993
  "div",
12507
12994
  {
12508
12995
  role: "alert",
@@ -12532,6 +13019,8 @@ function Conversation({
12532
13019
  allowanceExhaustedLabels,
12533
13020
  className: "isolate min-h-0 flex-1 overflow-hidden",
12534
13021
  ...toolRegistry ? { toolRegistry } : {},
13022
+ ...retainedLoaders,
13023
+ ...onOpenSession ? { onOpenSession } : {},
12535
13024
  events: feed.events,
12536
13025
  items: conversationTimeline(feed.timeline, queue, composer),
12537
13026
  turnSummary: { rolling: true },
@@ -12551,8 +13040,8 @@ function Conversation({
12551
13040
  questionNavMinViewportHeight: 320
12552
13041
  }
12553
13042
  ),
12554
- importedArchive ? /* @__PURE__ */ jsx26("p", { className: "shrink-0 px-4 py-2 text-center text-sm text-og-muted", role: "status", children: "Archived conversation \xB7 Read only" }) : /* @__PURE__ */ jsxs20(Fragment9, { children: [
12555
- /* @__PURE__ */ jsxs20(
13043
+ importedArchive ? /* @__PURE__ */ jsx26("p", { className: "shrink-0 px-4 py-2 text-center text-sm text-og-muted", role: "status", children: "Archived conversation \xB7 Read only" }) : /* @__PURE__ */ jsxs19(Fragment9, { children: [
13044
+ /* @__PURE__ */ jsxs19(
12556
13045
  "div",
12557
13046
  {
12558
13047
  className: "relative z-20 min-h-0 max-h-[40%] shrink-0 overflow-y-auto empty:hidden",
@@ -12588,13 +13077,20 @@ function Conversation({
12588
13077
  decisionButtons: true
12589
13078
  }
12590
13079
  ),
12591
- terminal ? /* @__PURE__ */ jsx26(SessionChrome, { queue, sessionStatus: status, readOnly: true }) : /* @__PURE__ */ jsx26(
12592
- SessionChrome,
13080
+ /* @__PURE__ */ jsx26(
13081
+ ConversationChrome,
12593
13082
  {
12594
- queue,
12595
- composer,
12596
- sessionStatus: status,
12597
- onComposerFocus: () => region.current?.querySelector("textarea")?.focus()
13083
+ sessionId,
13084
+ client: context.client,
13085
+ workspaceId: context.workspaceId,
13086
+ events: feed.events,
13087
+ chrome: terminal ? { queue, sessionStatus: status, readOnly: true, onOpenSession } : {
13088
+ queue,
13089
+ composer,
13090
+ sessionStatus: status,
13091
+ onOpenSession,
13092
+ onComposerFocus: () => region.current?.querySelector("textarea")?.focus()
13093
+ }
12598
13094
  }
12599
13095
  )
12600
13096
  ]
@@ -12611,6 +13107,7 @@ function Conversation({
12611
13107
  runControl: "stop",
12612
13108
  running,
12613
13109
  ...composerProps,
13110
+ ...transcription && composerProps?.transcription === void 0 ? { transcription } : {},
12614
13111
  composer,
12615
13112
  attachments: uploadsEnabled ? files : void 0,
12616
13113
  disabled: terminal || composerProps?.disabled,
@@ -12647,19 +13144,32 @@ function Conversation({
12647
13144
  }
12648
13145
  );
12649
13146
  }
13147
+ function ConversationChrome(props) {
13148
+ const goals = props.client;
13149
+ const canReachGoals = typeof goals.getGoal === "function" && typeof goals.updateGoal === "function" && typeof goals.deleteGoal === "function";
13150
+ return canReachGoals ? /* @__PURE__ */ jsx26(GoalChrome, { ...props }) : /* @__PURE__ */ jsx26(SessionChrome, { ...props.chrome });
13151
+ }
13152
+ function GoalChrome({ sessionId, client, workspaceId, events, chrome }) {
13153
+ const goal = useGoal(sessionId, {
13154
+ client,
13155
+ workspaceId,
13156
+ events
13157
+ });
13158
+ return /* @__PURE__ */ jsx26(SessionChrome, { ...chrome, goal });
13159
+ }
12650
13160
  var LazyChatInteractiveBlock = lazy5(
12651
13161
  () => import("./chat-interactive-block-UGBTNB3L.js").then((module) => ({
12652
13162
  default: module.ChatInteractiveBlock
12653
13163
  }))
12654
13164
  );
12655
- function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
12656
- const scoped = useMemo9(() => {
13165
+ function sessionScoped(client, sessionId) {
13166
+ const candidate = client;
13167
+ return typeof candidate.withHeaders === "function" ? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId }) : client;
13168
+ }
13169
+ function useDefaultInteractiveBlock(client, workspaceId, sessionId, sitesAvailable, sitePreviewUnavailable) {
13170
+ const scoped = useMemo10(() => {
12657
13171
  let resolved = null;
12658
- const get = () => {
12659
- const candidate = client;
12660
- resolved ??= typeof candidate.withHeaders === "function" ? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId }) : candidate;
12661
- return resolved;
12662
- };
13172
+ const get = () => resolved ??= sessionScoped(client, sessionId);
12663
13173
  return {
12664
13174
  getWorkspaceArtifact: (...args) => get().getWorkspaceArtifact(...args),
12665
13175
  getWorkspaceArtifactHtml: (...args) => get().getWorkspaceArtifactHtml(...args),
@@ -12670,43 +13180,91 @@ function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
12670
13180
  }
12671
13181
  };
12672
13182
  }, [client, sessionId]);
12673
- return useCallback5(
12674
- (block) => /* @__PURE__ */ jsx26(Suspense6, { fallback: /* @__PURE__ */ jsx26("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx26(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
12675
- [scoped, workspaceId]
13183
+ return useCallback6(
13184
+ (block) => block.kind === "site" && !sitesAvailable ? (
13185
+ // The proxy does not serve Sites: say so instead of offering a load
13186
+ // that can only fail.
13187
+ /* @__PURE__ */ jsx26(
13188
+ "div",
13189
+ {
13190
+ className: "rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg-muted",
13191
+ "data-og-site-preview-unavailable": "",
13192
+ children: sitePreviewUnavailable
13193
+ }
13194
+ )
13195
+ ) : /* @__PURE__ */ jsx26(Suspense6, { fallback: /* @__PURE__ */ jsx26("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx26(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
13196
+ [scoped, workspaceId, sitesAvailable, sitePreviewUnavailable]
12676
13197
  );
12677
13198
  }
12678
- function useClientConfigFlags(client) {
12679
- const [flags, setFlags] = useState21({
12680
- uploads: false,
12681
- modelSelection: false,
12682
- sandboxFiles: false,
12683
- defaultReasoningEffort: null
12684
- });
12685
- useEffect16(() => {
13199
+ function useRetainedLoaders(client, workspaceId, sessionId) {
13200
+ return useMemo10(() => {
13201
+ const base = client;
13202
+ let scoped = null;
13203
+ const get = () => scoped ??= sessionScoped(base, sessionId);
13204
+ return {
13205
+ ...typeof base.downloadRetainedArtifact === "function" && typeof base.createRetainedArtifactDownloadUrl === "function" ? {
13206
+ loadRetainedArtifact: (artifact, signal) => createWorkspaceRetainedArtifactLoader(
13207
+ get(),
13208
+ workspaceId
13209
+ )(artifact, signal)
13210
+ } : {},
13211
+ ...typeof base.downloadRetainedScreenshot === "function" ? {
13212
+ loadRetainedScreenshot: (artifact, signal) => createSessionRetainedScreenshotLoader(
13213
+ get(),
13214
+ workspaceId,
13215
+ sessionId
13216
+ )(artifact, signal)
13217
+ } : {},
13218
+ ...typeof base.createVideoArtifactPlaybackSource === "function" ? {
13219
+ loadVideoArtifactPlayback: (artifactId, signal) => createWorkspaceRetainedVideoLoader(
13220
+ get(),
13221
+ workspaceId
13222
+ )(artifactId, signal)
13223
+ } : {}
13224
+ };
13225
+ }, [client, workspaceId, sessionId]);
13226
+ }
13227
+ function useComposerTranscription(client, workspaceId, capability) {
13228
+ const [workspaceEnabled, setWorkspaceEnabled] = useState22(null);
13229
+ const reader = client;
13230
+ const supported = capability !== null && typeof reader.transcribeAudio === "function";
13231
+ useEffect17(() => {
13232
+ if (!supported) return;
12686
13233
  let live = true;
12687
- client.getClientConfig().then(
12688
- (config) => {
13234
+ const key = workspaceId;
13235
+ if (typeof reader.getWorkspace !== "function") {
13236
+ setWorkspaceEnabled({ key, enabled: true });
13237
+ return;
13238
+ }
13239
+ reader.getWorkspace(workspaceId).then(
13240
+ (workspace) => {
12689
13241
  if (live) {
12690
- setFlags({
12691
- uploads: config.fileUploads?.enabled === true,
12692
- // Only an explicit offer shows end users the picker.
12693
- modelSelection: config.modelSelection === true,
12694
- sandboxFiles: config.sandboxFiles !== false,
12695
- defaultReasoningEffort: config.defaultReasoningEffort ?? null
13242
+ setWorkspaceEnabled({
13243
+ key,
13244
+ enabled: resolveWorkspaceVoiceInputEnabled(workspace.settings) ?? true
12696
13245
  });
12697
13246
  }
12698
13247
  },
12699
- () => void 0
13248
+ // The transcription request still enforces the setting.
13249
+ () => live && setWorkspaceEnabled({ key, enabled: true })
12700
13250
  );
12701
13251
  return () => {
12702
13252
  live = false;
12703
13253
  };
12704
- }, [client]);
12705
- return flags;
13254
+ }, [reader, workspaceId, supported]);
13255
+ return useMemo10(
13256
+ () => supported ? {
13257
+ client: reader,
13258
+ workspaceId,
13259
+ capability,
13260
+ workspaceEnabled: workspaceEnabled?.key === workspaceId ? workspaceEnabled.enabled : false
13261
+ } : null,
13262
+ [supported, reader, workspaceId, capability, workspaceEnabled]
13263
+ );
12706
13264
  }
12707
13265
 
12708
13266
  // src/hooks/use-workspace-sessions.ts
12709
- import { useCallback as useCallback6, useEffect as useEffect17, useRef as useRef14 } from "react";
13267
+ import { useCallback as useCallback7, useEffect as useEffect18, useRef as useRef14 } from "react";
12710
13268
  function useWorkspaceSessions(options = {}) {
12711
13269
  const { client, workspaceId } = useOpenGeni(options);
12712
13270
  const projection = options.projection;
@@ -12742,10 +13300,10 @@ function useWorkspaceSessions(options = {}) {
12742
13300
  ].join("\0");
12743
13301
  const previousQueryKey = useRef14(queryKey);
12744
13302
  const queryKeyTransition = previousQueryKey.current !== queryKey;
12745
- useEffect17(() => {
13303
+ useEffect18(() => {
12746
13304
  previousQueryKey.current = queryKey;
12747
13305
  }, [queryKey]);
12748
- const load = useCallback6(
13306
+ const load = useCallback7(
12749
13307
  async (signal) => {
12750
13308
  const readGeneration = beginRead?.() ?? ++nextReadGeneration.current;
12751
13309
  const query = {
@@ -12827,8 +13385,8 @@ function useWorkspaceSessions(options = {}) {
12827
13385
  // src/components/session-list.tsx
12828
13386
  import { deriveSessionDisplayTitle } from "@opengeni/sdk";
12829
13387
  import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
12830
- import { useEffect as useEffect18, useRef as useRef15, useState as useState22 } from "react";
12831
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
13388
+ import { useEffect as useEffect19, useRef as useRef15, useState as useState23 } from "react";
13389
+ import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
12832
13390
  var DEFAULT_LABELS = {
12833
13391
  heading: "Chats",
12834
13392
  newChat: "New chat",
@@ -12857,7 +13415,7 @@ function SessionList({
12857
13415
  const labels = { ...DEFAULT_LABELS, ...labelOverrides };
12858
13416
  const scope = { client, workspaceId };
12859
13417
  const context = useOpenGeni(scope);
12860
- const [limit, setLimit] = useState22(pageSize);
13418
+ const [limit, setLimit] = useState23(pageSize);
12861
13419
  const list = useWorkspaceSessions({
12862
13420
  ...scope,
12863
13421
  parentSessionId: null,
@@ -12867,17 +13425,18 @@ function SessionList({
12867
13425
  });
12868
13426
  const refresh = list.refresh;
12869
13427
  const firstRefreshKey = useRef15(refreshKey);
12870
- useEffect18(() => {
13428
+ useEffect19(() => {
12871
13429
  if (Object.is(refreshKey, firstRefreshKey.current)) return;
12872
13430
  firstRefreshKey.current = refreshKey;
12873
13431
  void refresh();
12874
13432
  }, [refresh, refreshKey]);
12875
- const [editing, setEditing] = useState22(null);
12876
- const [busy, setBusy] = useState22(null);
12877
- const [error, setError] = useState22(null);
13433
+ const [editing, setEditing] = useState23(null);
13434
+ const [busy, setBusy] = useState23(null);
13435
+ const [error, setError] = useState23(null);
12878
13436
  const formatError = useErrorMessage();
12879
13437
  const archiveClient = context.client;
12880
- const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
13438
+ const config = useClientConfigFlags(context.client);
13439
+ const canArchive = archive && config.archive && typeof archiveClient.updateSessionArchive === "function";
12881
13440
  const run = async (id, action) => {
12882
13441
  setBusy(id);
12883
13442
  setError(null);
@@ -12909,16 +13468,16 @@ function SessionList({
12909
13468
  onArchived?.(session.id);
12910
13469
  });
12911
13470
  const sessions = list.sessions;
12912
- return /* @__PURE__ */ jsxs21(
13471
+ return /* @__PURE__ */ jsxs20(
12913
13472
  "nav",
12914
13473
  {
12915
13474
  className: cn("flex min-h-0 min-w-0 flex-col gap-1 text-og-fg", className),
12916
13475
  "aria-label": labels.heading,
12917
13476
  "data-og-session-list": "",
12918
13477
  children: [
12919
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
13478
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
12920
13479
  /* @__PURE__ */ jsx27("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
12921
- onNewChat ? /* @__PURE__ */ jsxs21(
13480
+ onNewChat ? /* @__PURE__ */ jsxs20(
12922
13481
  "button",
12923
13482
  {
12924
13483
  type: "button",
@@ -12933,14 +13492,14 @@ function SessionList({
12933
13492
  ) : null
12934
13493
  ] }),
12935
13494
  error || list.error ? /* @__PURE__ */ jsx27("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: formatError(error ? error.cause : list.error) }) : null,
12936
- /* @__PURE__ */ jsxs21("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
13495
+ /* @__PURE__ */ jsxs20("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
12937
13496
  list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx27("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
12938
13497
  !list.loading && !list.error && sessions.length === 0 ? /* @__PURE__ */ jsx27("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
12939
13498
  sessions.map((session) => {
12940
13499
  const selected = session.id === selectedSessionId;
12941
13500
  const title = deriveSessionDisplayTitle(session);
12942
13501
  if (editing?.id === session.id) {
12943
- return /* @__PURE__ */ jsx27("li", { children: /* @__PURE__ */ jsxs21("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
13502
+ return /* @__PURE__ */ jsx27("li", { children: /* @__PURE__ */ jsxs20("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
12944
13503
  /* @__PURE__ */ jsx27(
12945
13504
  "input",
12946
13505
  {
@@ -12965,8 +13524,8 @@ function SessionList({
12965
13524
  )
12966
13525
  ] }) }, session.id);
12967
13526
  }
12968
- return /* @__PURE__ */ jsxs21("li", { className: "group relative", children: [
12969
- /* @__PURE__ */ jsxs21(
13527
+ return /* @__PURE__ */ jsxs20("li", { className: "group relative", children: [
13528
+ /* @__PURE__ */ jsxs20(
12970
13529
  "button",
12971
13530
  {
12972
13531
  type: "button",
@@ -12984,7 +13543,7 @@ function SessionList({
12984
13543
  ]
12985
13544
  }
12986
13545
  ),
12987
- /* @__PURE__ */ jsxs21("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
13546
+ /* @__PURE__ */ jsxs20("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
12988
13547
  rename ? /* @__PURE__ */ jsx27(
12989
13548
  "button",
12990
13549
  {
@@ -13024,9 +13583,12 @@ function SessionList({
13024
13583
  }
13025
13584
 
13026
13585
  // src/components/open-geni-chat.tsx
13586
+ import {
13587
+ OpenGeniApiError as OpenGeniApiError2
13588
+ } from "@opengeni/sdk";
13027
13589
  import { MenuIcon, XIcon as XIcon2 } from "lucide-react";
13028
- import { useCallback as useCallback7, useRef as useRef16, useState as useState23 } from "react";
13029
- import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
13590
+ import { useCallback as useCallback8, useRef as useRef16, useState as useState24 } from "react";
13591
+ import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
13030
13592
  var DEFAULT_LABELS2 = {
13031
13593
  openChats: "Open chats",
13032
13594
  closeChats: "Close chats",
@@ -13069,13 +13631,15 @@ function Chat({
13069
13631
  const labels = { ...DEFAULT_LABELS2, ...labelOverrides };
13070
13632
  const scope = { client, workspaceId };
13071
13633
  const context = useOpenGeni(scope);
13072
- const [uncontrolled, setUncontrolled] = useState23(defaultSessionId);
13634
+ const [uncontrolled, setUncontrolled] = useState24(defaultSessionId);
13073
13635
  const selected = controlledSessionId !== void 0 ? controlledSessionId : uncontrolled;
13074
- const [drawerOpen, setDrawerOpen] = useState23(false);
13075
- const [listRevision, setListRevision] = useState23(0);
13636
+ const [drawerOpen, setDrawerOpen] = useState24(false);
13637
+ const [listRevision, setListRevision] = useState24(0);
13076
13638
  const root = useRef16(null);
13077
13639
  const hostTheme = useHostTheme(root, { theme, surface });
13078
- const select = useCallback7(
13640
+ const config = useClientConfigFlags(context.client);
13641
+ const canCreate = createSession !== void 0 || config.sessionCreation;
13642
+ const select = useCallback8(
13079
13643
  (next) => {
13080
13644
  if (controlledSessionId === void 0) setUncontrolled(next);
13081
13645
  onSessionChange?.(next);
@@ -13083,17 +13647,24 @@ function Chat({
13083
13647
  },
13084
13648
  [controlledSessionId, onSessionChange]
13085
13649
  );
13086
- const create = useCallback7(
13650
+ const create = useCallback8(
13087
13651
  async (initialMessage, idempotencyKey, options) => {
13088
13652
  if (createSession) return await createSession(initialMessage, idempotencyKey, options);
13089
13653
  const creator = context.client.createSession;
13090
13654
  if (typeof creator !== "function") throw new Error(labels.newChatUnavailable);
13091
- const created = await creator.call(context.client, context.workspaceId, {
13092
- initialMessage,
13093
- idempotencyKey,
13094
- ...options
13095
- });
13096
- return created.id;
13655
+ try {
13656
+ const created = await creator.call(context.client, context.workspaceId, {
13657
+ initialMessage,
13658
+ idempotencyKey,
13659
+ ...options
13660
+ });
13661
+ return created.id;
13662
+ } catch (error) {
13663
+ if (error instanceof OpenGeniApiError2 && error.code === "route_not_allowed") {
13664
+ throw new Error(labels.newChatUnavailable, { cause: error });
13665
+ }
13666
+ throw error;
13667
+ }
13097
13668
  },
13098
13669
  [context.client, context.workspaceId, createSession, labels.newChatUnavailable]
13099
13670
  );
@@ -13105,7 +13676,7 @@ function Chat({
13105
13676
  labels,
13106
13677
  selectedSessionId: selected,
13107
13678
  onSelect: select,
13108
- onNewChat: newChat ? () => select(null) : void 0,
13679
+ onNewChat: newChat && canCreate ? () => select(null) : void 0,
13109
13680
  onArchived: (archivedId) => {
13110
13681
  if (archivedId === selected) select(null);
13111
13682
  },
@@ -13113,7 +13684,7 @@ function Chat({
13113
13684
  className: "h-full"
13114
13685
  }
13115
13686
  );
13116
- return /* @__PURE__ */ jsxs22(
13687
+ return /* @__PURE__ */ jsxs21(
13117
13688
  "div",
13118
13689
  {
13119
13690
  ref: root,
@@ -13134,8 +13705,8 @@ function Chat({
13134
13705
  children: list
13135
13706
  }
13136
13707
  ),
13137
- drawerOpen ? /* @__PURE__ */ jsxs22("div", { className: "og-chat-drawer absolute inset-0 z-30 flex", "data-og-chat-drawer": "", children: [
13138
- /* @__PURE__ */ jsxs22("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-og-lg", children: [
13708
+ drawerOpen ? /* @__PURE__ */ jsxs21("div", { className: "og-chat-drawer absolute inset-0 z-30 flex", "data-og-chat-drawer": "", children: [
13709
+ /* @__PURE__ */ jsxs21("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-og-lg", children: [
13139
13710
  /* @__PURE__ */ jsx28("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx28(
13140
13711
  "button",
13141
13712
  {
@@ -13158,8 +13729,8 @@ function Chat({
13158
13729
  }
13159
13730
  )
13160
13731
  ] }) : null,
13161
- /* @__PURE__ */ jsxs22("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
13162
- /* @__PURE__ */ jsxs22("div", { className: "og-chat-menu flex items-center gap-2 px-2 py-1", children: [
13732
+ /* @__PURE__ */ jsxs21("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
13733
+ /* @__PURE__ */ jsxs21("div", { className: "og-chat-menu flex items-center gap-2 px-2 py-1", children: [
13163
13734
  /* @__PURE__ */ jsx28(
13164
13735
  "button",
13165
13736
  {
@@ -13178,6 +13749,7 @@ function Chat({
13178
13749
  SessionConversation,
13179
13750
  {
13180
13751
  ...conversationProps,
13752
+ onOpenSession: conversationProps?.onOpenSession ?? select,
13181
13753
  ...scope,
13182
13754
  sessionId: selected,
13183
13755
  height: "100%"
@@ -13189,6 +13761,7 @@ function Chat({
13189
13761
  labels,
13190
13762
  placeholderOverride: labelOverrides?.newChatPlaceholder,
13191
13763
  conversationProps,
13764
+ available: canCreate,
13192
13765
  create,
13193
13766
  onCreated: (id) => {
13194
13767
  setListRevision((revision) => revision + 1);
@@ -13208,6 +13781,7 @@ function NewChat({
13208
13781
  labels,
13209
13782
  placeholderOverride,
13210
13783
  conversationProps,
13784
+ available,
13211
13785
  create,
13212
13786
  onCreated
13213
13787
  }) {
@@ -13223,17 +13797,22 @@ function NewChat({
13223
13797
  });
13224
13798
  const files = useFileAttachments(scope);
13225
13799
  const uploadsEnabled = (conversationProps?.attachments ?? true) && config.uploads;
13226
- const [text, setText] = useState23("");
13227
- const [sending, setSending] = useState23(false);
13228
- const [error, setError] = useState23(null);
13229
- const [choice, setChoice] = useState23({});
13800
+ const transcription = useComposerTranscription(
13801
+ context.client,
13802
+ context.workspaceId,
13803
+ (conversationProps?.voiceInput ?? true) && available ? config.voiceInput : null
13804
+ );
13805
+ const [text, setText] = useState24("");
13806
+ const [sending, setSending] = useState24(false);
13807
+ const [error, setError] = useState24(null);
13808
+ const [choice, setChoice] = useState24({});
13230
13809
  const formatError = useErrorMessage();
13231
13810
  const attempt = useRef16(null);
13232
13811
  const resources = uploadsEnabled ? files.readyResources : [];
13233
13812
  const pendingFiles = uploadsEnabled && files.hasUnresolved;
13234
13813
  const submit = async () => {
13235
13814
  const initialMessage = text.trim() || (resources.length > 0 ? FILE_ONLY_MESSAGE_TEXT : "");
13236
- if (!initialMessage || sending || pendingFiles) return false;
13815
+ if (!initialMessage || sending || pendingFiles || !available) return false;
13237
13816
  const options = {
13238
13817
  ...resources.length > 0 ? { resources } : {},
13239
13818
  ...showModelPicker ? choice : {}
@@ -13271,7 +13850,7 @@ function NewChat({
13271
13850
  send: submit,
13272
13851
  steer: submit,
13273
13852
  sending,
13274
- canSend: (text.trim().length > 0 || resources.length > 0) && !sending && !pendingFiles,
13853
+ canSend: available && (text.trim().length > 0 || resources.length > 0) && !sending && !pendingFiles,
13275
13854
  pause: NOOP_ASYNC,
13276
13855
  pausing: false,
13277
13856
  resume: NOOP_ASYNC,
@@ -13298,7 +13877,7 @@ function NewChat({
13298
13877
  error: null,
13299
13878
  clearError: () => setError(null)
13300
13879
  };
13301
- return /* @__PURE__ */ jsxs22(
13880
+ return /* @__PURE__ */ jsxs21(
13302
13881
  "form",
13303
13882
  {
13304
13883
  onSubmit: (event) => {
@@ -13314,8 +13893,10 @@ function NewChat({
13314
13893
  ChatComposer,
13315
13894
  {
13316
13895
  ...composerProps,
13896
+ ...transcription && composerProps?.transcription === void 0 ? { transcription } : {},
13317
13897
  composer,
13318
13898
  attachments: uploadsEnabled ? files : void 0,
13899
+ disabled: !available || composerProps?.disabled,
13319
13900
  runControl: "none",
13320
13901
  running: false,
13321
13902
  placeholder: placeholderOverride ?? composerProps?.placeholder ?? labels.newChatPlaceholder,
@@ -13348,7 +13929,7 @@ function NewChat({
13348
13929
  responsiveBasis: composerProps?.responsiveBasis ?? "container"
13349
13930
  }
13350
13931
  ),
13351
- error ? /* @__PURE__ */ jsx28("p", { role: "alert", className: "text-center text-og-sm text-og-status-failed", children: formatError(
13932
+ !available ? /* @__PURE__ */ jsx28("p", { className: "text-center text-og-sm text-og-fg-muted", "data-og-new-chat-unavailable": "", children: labels.newChatUnavailable }) : error ? /* @__PURE__ */ jsx28("p", { role: "alert", className: "text-center text-og-sm text-og-status-failed", children: formatError(
13352
13933
  error.cause,
13353
13934
  error.cause instanceof Error && error.cause.message === labels.newChatUnavailable ? labels.newChatUnavailable : void 0
13354
13935
  ) }) : null,
@@ -13359,16 +13940,16 @@ function NewChat({
13359
13940
  }
13360
13941
 
13361
13942
  // src/components/session-commands-panel.tsx
13362
- import { ChevronRightIcon as ChevronRightIcon4, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
13363
- import { useState as useState24 } from "react";
13364
- import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
13943
+ import { ChevronRightIcon as ChevronRightIcon5, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
13944
+ import { useState as useState25 } from "react";
13945
+ import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
13365
13946
  function SessionCommandsPanel({
13366
13947
  commands: state,
13367
13948
  readOnly = false
13368
13949
  }) {
13369
13950
  const formatError = useErrorMessage();
13370
- const [pending, setPending] = useState24(null);
13371
- const [error, setError] = useState24(null);
13951
+ const [pending, setPending] = useState25(null);
13952
+ const [error, setError] = useState25(null);
13372
13953
  const active = state.commands.filter(
13373
13954
  (command) => command.state === "running" || command.state === "stopping"
13374
13955
  );
@@ -13383,9 +13964,9 @@ function SessionCommandsPanel({
13383
13964
  setPending(null);
13384
13965
  }
13385
13966
  };
13386
- return /* @__PURE__ */ jsxs23("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
13967
+ return /* @__PURE__ */ jsxs22("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
13387
13968
  state.loading && active.length === 0 ? /* @__PURE__ */ jsx29("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
13388
- state.error ? /* @__PURE__ */ jsxs23("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
13969
+ state.error ? /* @__PURE__ */ jsxs22("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
13389
13970
  /* @__PURE__ */ jsx29("span", { children: "Commands unavailable." }),
13390
13971
  /* @__PURE__ */ jsx29(
13391
13972
  "button",
@@ -13398,16 +13979,16 @@ function SessionCommandsPanel({
13398
13979
  )
13399
13980
  ] }) : null,
13400
13981
  !state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx29("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
13401
- active.length > 0 ? /* @__PURE__ */ jsx29("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs23("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
13402
- /* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
13403
- /* @__PURE__ */ jsxs23("details", { className: "group/command", children: [
13404
- /* @__PURE__ */ jsxs23(
13982
+ active.length > 0 ? /* @__PURE__ */ jsx29("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs22("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
13983
+ /* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1", children: [
13984
+ /* @__PURE__ */ jsxs22("details", { className: "group/command", children: [
13985
+ /* @__PURE__ */ jsxs22(
13405
13986
  "summary",
13406
13987
  {
13407
13988
  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",
13408
13989
  title: "Expand command",
13409
13990
  children: [
13410
- /* @__PURE__ */ jsx29(ChevronRightIcon4, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
13991
+ /* @__PURE__ */ jsx29(ChevronRightIcon5, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
13411
13992
  /* @__PURE__ */ jsx29(
13412
13993
  "span",
13413
13994
  {
@@ -13419,9 +14000,9 @@ function SessionCommandsPanel({
13419
14000
  ]
13420
14001
  }
13421
14002
  ),
13422
- /* @__PURE__ */ jsxs23("div", { className: "mt-2 space-y-1", children: [
14003
+ /* @__PURE__ */ jsxs22("div", { className: "mt-2 space-y-1", children: [
13423
14004
  /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
13424
- /* @__PURE__ */ jsxs23(
14005
+ /* @__PURE__ */ jsxs22(
13425
14006
  "time",
13426
14007
  {
13427
14008
  className: "block text-og-fg-subtle",
@@ -13437,7 +14018,7 @@ function SessionCommandsPanel({
13437
14018
  ] }),
13438
14019
  /* @__PURE__ */ jsx29("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" })
13439
14020
  ] }),
13440
- !readOnly ? /* @__PURE__ */ jsxs23(
14021
+ !readOnly ? /* @__PURE__ */ jsxs22(
13441
14022
  "button",
13442
14023
  {
13443
14024
  type: "button",
@@ -13457,11 +14038,11 @@ function SessionCommandsPanel({
13457
14038
  }
13458
14039
 
13459
14040
  // src/hooks/use-session-background-commands.ts
13460
- import { useCallback as useCallback8, useEffect as useEffect19, useRef as useRef17 } from "react";
14041
+ import { useCallback as useCallback9, useEffect as useEffect20, useRef as useRef17 } from "react";
13461
14042
  function useSessionBackgroundCommands(sessionId, options = {}) {
13462
14043
  const { client, workspaceId } = useOpenGeni(options);
13463
14044
  const enabled = (options.enabled ?? true) && Boolean(sessionId);
13464
- const load = useCallback8(
14045
+ const load = useCallback9(
13465
14046
  async (signal) => {
13466
14047
  if (!sessionId) return { commands: [] };
13467
14048
  if (!client.listSessionBackgroundCommands) {
@@ -13477,13 +14058,13 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
13477
14058
  });
13478
14059
  const refresh = state.refresh;
13479
14060
  const generation = useRef17(0);
13480
- useEffect19(() => {
14061
+ useEffect20(() => {
13481
14062
  generation.current += 1;
13482
14063
  return () => {
13483
14064
  generation.current += 1;
13484
14065
  };
13485
14066
  }, [client, workspaceId, sessionId, enabled]);
13486
- const cancel = useCallback8(
14067
+ const cancel = useCallback9(
13487
14068
  async (commandId) => {
13488
14069
  if (!sessionId) return;
13489
14070
  if (!client.cancelSessionBackgroundCommand) {
@@ -13519,7 +14100,7 @@ function SessionCommands({
13519
14100
  }
13520
14101
 
13521
14102
  // src/timeline/startup-timings.tsx
13522
- import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
14103
+ import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
13523
14104
  var LABELS = {
13524
14105
  queue: "Worker queue",
13525
14106
  sandbox: "Sandbox",
@@ -13547,7 +14128,7 @@ function StartupTimings({ phases }) {
13547
14128
  turnPhases[0].startedAt
13548
14129
  )
13549
14130
  })).sort((a, b) => b.startedAt.localeCompare(a.startedAt));
13550
- return /* @__PURE__ */ jsxs24("div", { className: "space-y-3", children: [
14131
+ return /* @__PURE__ */ jsxs23("div", { className: "space-y-3", children: [
13551
14132
  /* @__PURE__ */ jsx31("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
13552
14133
  turns.map((turn, index) => /* @__PURE__ */ jsx31(
13553
14134
  StartupTurn,
@@ -13566,8 +14147,8 @@ function StartupTurn({
13566
14147
  latest
13567
14148
  }) {
13568
14149
  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";
13569
- return /* @__PURE__ */ jsxs24("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
13570
- /* @__PURE__ */ jsxs24("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
14150
+ return /* @__PURE__ */ jsxs23("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
14151
+ /* @__PURE__ */ jsxs23("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
13571
14152
  /* @__PURE__ */ jsx31("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
13572
14153
  /* @__PURE__ */ jsx31("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
13573
14154
  hour: "2-digit",
@@ -13583,22 +14164,22 @@ function StartupTurn({
13583
14164
  ),
13584
14165
  /* @__PURE__ */ jsx31("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" })
13585
14166
  ] }),
13586
- /* @__PURE__ */ jsxs24("div", { className: "pb-2", children: [
13587
- /* @__PURE__ */ jsxs24("p", { className: "text-og-xs text-og-fg-subtle", children: [
14167
+ /* @__PURE__ */ jsxs23("div", { className: "pb-2", children: [
14168
+ /* @__PURE__ */ jsxs23("p", { className: "text-og-xs text-og-fg-subtle", children: [
13588
14169
  "Started ",
13589
14170
  /* @__PURE__ */ jsx31("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
13590
14171
  ] }),
13591
- /* @__PURE__ */ jsx31("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs24("table", { className: "w-full text-left text-og-xs", children: [
13592
- /* @__PURE__ */ jsxs24("caption", { className: "sr-only", children: [
14172
+ /* @__PURE__ */ jsx31("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs23("table", { className: "w-full text-left text-og-xs", children: [
14173
+ /* @__PURE__ */ jsxs23("caption", { className: "sr-only", children: [
13593
14174
  "Startup phases for ",
13594
14175
  turnId ?? "unassigned events"
13595
14176
  ] }),
13596
- /* @__PURE__ */ jsx31("thead", { children: /* @__PURE__ */ jsxs24("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
14177
+ /* @__PURE__ */ jsx31("thead", { children: /* @__PURE__ */ jsxs23("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
13597
14178
  /* @__PURE__ */ jsx31("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
13598
14179
  /* @__PURE__ */ jsx31("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
13599
14180
  /* @__PURE__ */ jsx31("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
13600
14181
  ] }) }),
13601
- /* @__PURE__ */ jsx31("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs24(
14182
+ /* @__PURE__ */ jsx31("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs23(
13602
14183
  "tr",
13603
14184
  {
13604
14185
  className: "border-b border-og-border/40",
@@ -13661,6 +14242,9 @@ export {
13661
14242
  TurnSummary,
13662
14243
  userMessageLikelyNeedsDisclosure,
13663
14244
  UserMessageBody,
14245
+ createWorkspaceRetainedArtifactLoader,
14246
+ createSessionRetainedScreenshotLoader,
14247
+ createWorkspaceRetainedVideoLoader,
13664
14248
  GeneratedVideoPlayer,
13665
14249
  SESSION_STATUS_META,
13666
14250
  SessionStatus,
@@ -13684,4 +14268,4 @@ export {
13684
14268
  SessionCommands,
13685
14269
  StartupTimings
13686
14270
  };
13687
- //# sourceMappingURL=chunk-PGSX7UCP.js.map
14271
+ //# sourceMappingURL=chunk-LJ2UTJJE.js.map