@opengeni/react 0.36.1 → 0.40.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 (85) hide show
  1. package/README.md +92 -2
  2. package/dist/{chunk-J2RVJ6JX.js → chunk-4IJCL7YO.js} +13 -2
  3. package/dist/chunk-4IJCL7YO.js.map +1 -0
  4. package/dist/{chunk-7CJOAW3V.js → chunk-EB67J347.js} +1 -135
  5. package/dist/chunk-EB67J347.js.map +1 -0
  6. package/dist/chunk-EKZH6IDG.js +141 -0
  7. package/dist/chunk-EKZH6IDG.js.map +1 -0
  8. package/dist/{chunk-OKKMZDQF.js → chunk-JALF5FI3.js} +9 -7
  9. package/dist/{chunk-OKKMZDQF.js.map → chunk-JALF5FI3.js.map} +1 -1
  10. package/dist/{chunk-Z5FV355Z.js → chunk-KR2SK5GJ.js} +1382 -724
  11. package/dist/chunk-KR2SK5GJ.js.map +1 -0
  12. package/dist/{chunk-N4XEBE23.js → chunk-OMCFRWHL.js} +22 -13
  13. package/dist/{chunk-N4XEBE23.js.map → chunk-OMCFRWHL.js.map} +1 -1
  14. package/dist/{chunk-FT2TXNGZ.js → chunk-Q2NCKWTK.js} +183 -18
  15. package/dist/chunk-Q2NCKWTK.js.map +1 -0
  16. package/dist/{chunk-22RM4GMO.js → chunk-SJKT4TKW.js} +26 -2
  17. package/dist/chunk-SJKT4TKW.js.map +1 -0
  18. package/dist/{chunk-ALA3UGWB.js → chunk-SXIQK54Z.js} +8 -6
  19. package/dist/{chunk-ALA3UGWB.js.map → chunk-SXIQK54Z.js.map} +1 -1
  20. package/dist/chunk-WZT5G5OR.js +433 -0
  21. package/dist/chunk-WZT5G5OR.js.map +1 -0
  22. package/dist/client.d.ts +2 -0
  23. package/dist/components/chat-composer.d.ts +7 -1
  24. package/dist/components/human-input-form.d.ts +16 -6
  25. package/dist/components/human-input-surface.d.ts +19 -0
  26. package/dist/components/machine-input-display.d.ts +12 -0
  27. package/dist/components/message-timeline.d.ts +6 -1
  28. package/dist/components/model-policy-picker.d.ts +78 -0
  29. package/dist/components/session-chrome.d.ts +2 -1
  30. package/dist/components/tip-follow.d.ts +30 -0
  31. package/dist/composer.d.ts +2 -0
  32. package/dist/composer.js +22 -5
  33. package/dist/hooks/use-composer.d.ts +10 -1
  34. package/dist/index.d.ts +7 -1
  35. package/dist/index.js +2261 -2230
  36. package/dist/index.js.map +1 -1
  37. package/dist/machines.js +4 -3
  38. package/dist/model-policy.d.ts +12 -4
  39. package/dist/model-policy.js +5 -1
  40. package/dist/realtime/dropdown-menu.d.ts +16 -0
  41. package/dist/realtime/realtime-control.d.ts +126 -0
  42. package/dist/realtime.d.ts +11 -0
  43. package/dist/realtime.js +1023 -0
  44. package/dist/realtime.js.map +1 -0
  45. package/dist/session-context.d.ts +7 -1
  46. package/dist/session-ui.d.ts +2 -0
  47. package/dist/session-ui.js +6 -4
  48. package/dist/session.js +5 -4
  49. package/dist/timeline/compute-label.d.ts +2 -0
  50. package/dist/timeline/index.d.ts +1 -0
  51. package/dist/timeline/types.d.ts +5 -0
  52. package/package.json +7 -2
  53. package/src/client.ts +13 -0
  54. package/src/components/chat-composer.tsx +19 -5
  55. package/src/components/composer-transcription-control.tsx +2 -2
  56. package/src/components/composer.tsx +14 -5
  57. package/src/components/human-input-form.tsx +506 -186
  58. package/src/components/human-input-surface.tsx +80 -0
  59. package/src/components/machine-input-display.ts +83 -0
  60. package/src/components/message-timeline.tsx +348 -308
  61. package/src/components/model-policy-picker.tsx +587 -0
  62. package/src/components/sandbox-files.tsx +1 -1
  63. package/src/components/session-chrome.tsx +141 -15
  64. package/src/components/tip-follow.ts +127 -6
  65. package/src/composer.ts +13 -0
  66. package/src/hooks/use-composer.ts +229 -29
  67. package/src/index.ts +19 -0
  68. package/src/model-policy.ts +51 -7
  69. package/src/realtime/dropdown-menu.tsx +123 -0
  70. package/src/realtime/realtime-control.tsx +1178 -0
  71. package/src/realtime.ts +27 -0
  72. package/src/session-context.ts +16 -0
  73. package/src/session-ui.ts +2 -0
  74. package/src/timeline/compute-label.tsx +18 -0
  75. package/src/timeline/index.ts +3 -0
  76. package/src/timeline/projection.ts +21 -1
  77. package/src/timeline/tool-renderers.tsx +232 -43
  78. package/src/timeline/types.ts +5 -0
  79. package/styles/index.css +61 -0
  80. package/styles/tokens.css +2 -0
  81. package/dist/chunk-22RM4GMO.js.map +0 -1
  82. package/dist/chunk-7CJOAW3V.js.map +0 -1
  83. package/dist/chunk-FT2TXNGZ.js.map +0 -1
  84. package/dist/chunk-J2RVJ6JX.js.map +0 -1
  85. package/dist/chunk-Z5FV355Z.js.map +0 -1
@@ -1,18 +1,19 @@
1
+ import {
2
+ EmptyQueueStateSurface,
3
+ requestQueueDraftEdit
4
+ } from "./chunk-YDNWMKXO.js";
1
5
  import {
2
6
  buildTimeline,
3
7
  groupTimeline,
4
8
  mcpToolLeaf,
5
9
  toolDisplayName
6
- } from "./chunk-J2RVJ6JX.js";
10
+ } from "./chunk-4IJCL7YO.js";
7
11
  import {
8
12
  Tooltip,
9
13
  TooltipContent,
10
14
  TooltipProvider,
11
15
  TooltipTrigger
12
16
  } from "./chunk-ATSTR5P3.js";
13
- import {
14
- cn
15
- } from "./chunk-TK7G6XLT.js";
16
17
  import {
17
18
  formatClockTime,
18
19
  formatRelativeTime,
@@ -21,9 +22,8 @@ import {
21
22
  tryParseJson
22
23
  } from "./chunk-LAKLF4PA.js";
23
24
  import {
24
- EmptyQueueStateSurface,
25
- requestQueueDraftEdit
26
- } from "./chunk-YDNWMKXO.js";
25
+ cn
26
+ } from "./chunk-TK7G6XLT.js";
27
27
 
28
28
  // src/components/queue-surface.tsx
29
29
  import { Loader2Icon } from "lucide-react";
@@ -68,6 +68,7 @@ function QueueSurfaceFallback() {
68
68
 
69
69
  // src/components/session-chrome.tsx
70
70
  import {
71
+ AudioLinesIcon,
71
72
  ArrowDownIcon,
72
73
  ArrowUpIcon,
73
74
  BotIcon,
@@ -101,6 +102,23 @@ var GOAL_LABEL = {
101
102
  invariant_broken: "Needs attention",
102
103
  completed: "Done"
103
104
  };
105
+ function queuedTurnPresentation(turn) {
106
+ const realtimeDelegation = objectValue(turn.metadata.realtimeDelegation);
107
+ const inputTranscript = realtimeDelegation?.inputTranscript;
108
+ if (typeof inputTranscript === "string" && inputTranscript.trim()) {
109
+ return { kind: "realtime_voice", text: inputTranscript.trim() };
110
+ }
111
+ if (objectValue(turn.metadata.realtimeTailFlush)) {
112
+ return { kind: "realtime_voice_handoff", text: "Remaining voice context" };
113
+ }
114
+ return { kind: "prompt", text: turn.prompt };
115
+ }
116
+ function isSteeringTurn(turn) {
117
+ return turn.metadata.delivery === "steer";
118
+ }
119
+ function objectValue(value) {
120
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
121
+ }
104
122
  function sessionChromeGoalPillState(goalStatus, continuation) {
105
123
  if (goalStatus === "completed") return "completed";
106
124
  if (goalStatus === "paused") return "paused";
@@ -184,6 +202,25 @@ function SessionChrome({
184
202
  const record = goal?.goal ?? null;
185
203
  const incoming = queue.pendingInputs;
186
204
  const turns = queue.queue;
205
+ const composerSteering = composer?.steering ?? null;
206
+ const { steering, queuedTurns } = useMemo(() => {
207
+ const pendingQueueSteer = turns.find((turn) => queue.pendingByTurn[turn.id] === "steer") ?? null;
208
+ const durableQueueSteer = !pendingQueueSteer && turns[0] && isSteeringTurn(turns[0]) ? turns[0] : null;
209
+ const currentSteering = composerSteering?.phase === "submitting" ? composerSteering : pendingQueueSteer ? {
210
+ phase: "submitting",
211
+ text: queuedTurnPresentation(pendingQueueSteer).text,
212
+ turnId: pendingQueueSteer.id
213
+ } : durableQueueSteer ? {
214
+ phase: "accepted",
215
+ text: queuedTurnPresentation(durableQueueSteer).text,
216
+ turnId: durableQueueSteer.id
217
+ } : composerSteering;
218
+ const currentTurnId = currentSteering?.turnId ?? null;
219
+ return {
220
+ steering: currentSteering,
221
+ queuedTurns: currentTurnId ? turns.filter((turn) => turn.id !== currentTurnId) : turns
222
+ };
223
+ }, [composerSteering, queue.pendingByTurn, turns]);
187
224
  const canMutateQueue = !readOnly && composer !== void 0;
188
225
  const liveGoal = record?.status === "active" && record.continuation?.state === "running" && record.continuation.reason === "goal_turn_running";
189
226
  const elapsed = useLiveElapsed(
@@ -206,14 +243,28 @@ function SessionChrome({
206
243
  icon: /* @__PURE__ */ jsx2(InboxIcon, { className: "size-3" })
207
244
  });
208
245
  }
209
- if (turns.length > 0) {
210
- const detail = turns[0]?.prompt;
246
+ if (steering) {
247
+ rows.push({
248
+ id: "steering",
249
+ label: "Changing direction\u2026",
250
+ detail: steering.text,
251
+ tone: "accent",
252
+ icon: steering.phase === "submitting" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
253
+ });
254
+ }
255
+ if (queuedTurns.length > 0) {
256
+ const presentations = queuedTurns.map(queuedTurnPresentation);
257
+ const first = presentations[0];
258
+ const allVoiceRequests = presentations.every(({ kind }) => kind === "realtime_voice");
259
+ const onlyVoiceHandoff = presentations.length === 1 && first?.kind === "realtime_voice_handoff";
260
+ const voiceOnly = allVoiceRequests || onlyVoiceHandoff;
261
+ const detail = first?.text;
211
262
  rows.push({
212
263
  id: "queue",
213
- label: `${turns.length} queued prompt${turns.length === 1 ? "" : "s"}`,
264
+ label: allVoiceRequests ? queuedTurns.length === 1 ? "Voice request queued" : `${queuedTurns.length} voice requests queued` : onlyVoiceHandoff ? "Voice handoff queued" : `${queuedTurns.length} queued prompt${queuedTurns.length === 1 ? "" : "s"}`,
214
265
  ...detail ? { detail } : {},
215
266
  tone: "neutral",
216
- icon: /* @__PURE__ */ jsx2(ListOrderedIcon, { className: "size-3" })
267
+ icon: voiceOnly ? /* @__PURE__ */ jsx2(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx2(ListOrderedIcon, { className: "size-3" })
217
268
  });
218
269
  }
219
270
  if (record && goalState) {
@@ -237,7 +288,7 @@ function SessionChrome({
237
288
  });
238
289
  }
239
290
  return rows;
240
- }, [agentsSignal, elapsed, goalState, incoming, record, turns]);
291
+ }, [agentsSignal, elapsed, goalState, incoming, queuedTurns, record, steering]);
241
292
  const [activeUncontrolled, setActiveUncontrolled] = useState(
242
293
  defaultActive
243
294
  );
@@ -261,10 +312,10 @@ function SessionChrome({
261
312
  }, [active, activeControlled, onActiveChange, signalIds]);
262
313
  useEffect(() => {
263
314
  if (active !== "queue" || !replaceDraftFor) return;
264
- if (!turns.some((turn) => turn.id === replaceDraftFor)) {
315
+ if (!queuedTurns.some((turn) => turn.id === replaceDraftFor)) {
265
316
  setReplaceDraftFor(null);
266
317
  }
267
- }, [active, replaceDraftFor, turns]);
318
+ }, [active, queuedTurns, replaceDraftFor]);
268
319
  useEffect(() => {
269
320
  const rail = railRef.current;
270
321
  const measure = () => {
@@ -301,7 +352,7 @@ function SessionChrome({
301
352
  const node = panelBodyRef.current;
302
353
  if (!node) return;
303
354
  setPanelHeight(node.offsetHeight);
304
- }, [open, active, incoming, turns, record, goalState, agentsPanel, agentsSignal]);
355
+ }, [open, active, incoming, queuedTurns, record, goalState, agentsPanel, agentsSignal, steering]);
305
356
  useEffect(() => {
306
357
  if (!open) return;
307
358
  const node = panelBodyRef.current;
@@ -316,10 +367,10 @@ function SessionChrome({
316
367
  const shellDuration = reduceMotion ? 0 : 0.22;
317
368
  const crossfadeDuration = reduceMotion ? 0 : 0.18;
318
369
  const ease = [0.22, 1, 0.36, 1];
319
- const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "queue" ? /* @__PURE__ */ jsx2(
370
+ const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "steering" && steering ? /* @__PURE__ */ jsx2(SteeringPanel, { phase: steering.phase, text: steering.text }) : active === "queue" ? /* @__PURE__ */ jsx2(
320
371
  QueuePanel,
321
372
  {
322
- turns,
373
+ turns: queuedTurns,
323
374
  readOnly: !canMutateQueue,
324
375
  mutationFor: queue.mutationFor,
325
376
  replaceDraftFor,
@@ -477,8 +528,9 @@ function SessionChrome({
477
528
  "div",
478
529
  {
479
530
  ref: panelBodyRef,
480
- className: "relative border-t border-og-border/50",
531
+ className: "relative overflow-y-auto overscroll-contain border-t border-og-border/50",
481
532
  style: {
533
+ maxHeight: "var(--og-session-chrome-panel-max-height)",
482
534
  paddingInline: "var(--og-session-chrome-panel-pad-x)",
483
535
  paddingBlock: "var(--og-session-chrome-panel-pad-y)"
484
536
  },
@@ -553,6 +605,24 @@ function IncomingPanel({
553
605
  }
554
606
  );
555
607
  }
608
+ function SteeringPanel({ phase, text }) {
609
+ return /* @__PURE__ */ jsxs2(
610
+ "div",
611
+ {
612
+ className: "flex items-start gap-2 rounded-og-sm px-1.5 py-1",
613
+ role: "status",
614
+ "aria-live": "polite",
615
+ "data-og-session-chrome-panel": "steering",
616
+ children: [
617
+ /* @__PURE__ */ jsx2("span", { className: "mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-og-accent-soft text-og-accent", children: phase === "submitting" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3", "aria-hidden": "true" }) }),
618
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
619
+ /* @__PURE__ */ jsx2("p", { className: "truncate text-og-xs font-medium leading-4 text-og-fg", children: text }),
620
+ /* @__PURE__ */ jsx2("p", { className: "mt-0.5 text-[10px] leading-4 text-og-fg-muted", children: phase === "submitting" ? "Sending your latest direction\u2026" : "Direction accepted. The agent will continue from it." })
621
+ ] })
622
+ ]
623
+ }
624
+ );
625
+ }
556
626
  function QueuePanel({
557
627
  turns,
558
628
  readOnly,
@@ -572,6 +642,8 @@ function QueuePanel({
572
642
  "aria-label": "Queued prompts",
573
643
  "data-og-session-chrome-panel": "queue",
574
644
  children: turns.map((turn, index) => {
645
+ const presentation = queuedTurnPresentation(turn);
646
+ const voice = presentation.kind !== "prompt";
575
647
  const pending = mutationFor(turn.id);
576
648
  const beforeUp = index > 0 ? turns[index - 1]?.id ?? null : null;
577
649
  const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
@@ -584,8 +656,14 @@ function QueuePanel({
584
656
  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)]",
585
657
  children: [
586
658
  /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-1.5", children: [
587
- /* @__PURE__ */ jsx2("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
588
- /* @__PURE__ */ jsx2("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: turn.prompt }),
659
+ voice ? /* @__PURE__ */ jsx2(
660
+ AudioLinesIcon,
661
+ {
662
+ "aria-hidden": "true",
663
+ className: "mt-0.5 size-3 shrink-0 text-og-accent"
664
+ }
665
+ ) : /* @__PURE__ */ jsx2("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
666
+ /* @__PURE__ */ jsx2("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: presentation.text }),
589
667
  showActions ? /* @__PURE__ */ jsxs2("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: [
590
668
  onMove && turns.length > 1 ? /* @__PURE__ */ jsxs2(Fragment, { children: [
591
669
  /* @__PURE__ */ jsx2(
@@ -780,23 +858,34 @@ function IconAction({
780
858
  }
781
859
 
782
860
  // src/components/human-input-form.tsx
861
+ import { ChevronDownIcon, ChevronUpIcon, MessageCircleQuestionIcon } from "lucide-react";
783
862
  import { useEffect as useEffect2, useId as useId2, useRef as useRef2, useState as useState2 } from "react";
784
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
863
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
785
864
  var defaultHumanInputFormMessages = {
786
- title: "Your input is needed",
787
- description: "The agent is paused until you answer these questions.",
865
+ title: "Input required",
866
+ /** Multi-question chrome has no default subtitle; hosts may still override. */
867
+ description: "",
788
868
  submit: "Continue",
789
869
  skip: "Skip",
790
870
  submitting: "Submitting\u2026",
791
871
  other: "Other",
792
- deadlineLabel: "Respond before",
872
+ deadlineLabel: "Expires",
793
873
  formatDeadline,
794
874
  required: "This question is required.",
795
- minLength: (count) => `Enter at least ${count} characters.`,
796
- maxLength: (count) => `Enter no more than ${count} characters.`,
797
875
  otherRequired: "Enter a value for Other.",
798
876
  minSelections: (count) => `Choose at least ${count} option${count === 1 ? "" : "s"}.`,
799
- maxSelections: (count) => `Choose no more than ${count} option${count === 1 ? "" : "s"}.`
877
+ maxSelections: (count) => `Choose no more than ${count} option${count === 1 ? "" : "s"}.`,
878
+ optional: "Optional",
879
+ moreBelow: "More below",
880
+ questionCount: (count) => `${count} questions`,
881
+ collapse: "Collapse",
882
+ expand: "Expand",
883
+ selectionHint: (min, max) => {
884
+ if (min != null && max != null) return `Choose ${min}\u2013${max}.`;
885
+ if (min != null) return `Choose at least ${min}.`;
886
+ if (max != null) return `Choose up to ${max}.`;
887
+ return null;
888
+ }
800
889
  };
801
890
  function HumanInputForm({
802
891
  request,
@@ -805,24 +894,31 @@ function HumanInputForm({
805
894
  error,
806
895
  title,
807
896
  description,
897
+ progressLabel,
808
898
  submitLabel,
809
899
  skipLabel,
810
900
  messages: messageOverrides,
811
901
  autoFocus = true,
902
+ defaultCollapsed = false,
812
903
  className
813
904
  }) {
814
905
  const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
815
- const resolvedTitle = title === void 0 ? messages.title : title;
816
- const resolvedDescription = description === void 0 ? messages.description : description;
906
+ const singleQuestion = request.questions.length === 1 ? request.questions[0] : null;
907
+ const resolvedTitle = title === void 0 ? singleQuestion ? singleQuestion.label ?? singleQuestion.prompt : messages.title : title;
908
+ const resolvedDescription = description === void 0 ? singleQuestion ? singleQuestion.label ? singleQuestion.prompt : singleQuestion.helpText ?? null : messages.description || null : description;
817
909
  const resolvedSubmitLabel = submitLabel ?? messages.submit;
818
910
  const resolvedSkipLabel = skipLabel ?? messages.skip;
819
911
  const formId = useId2();
912
+ const titleId = useId2();
913
+ const scrollRef = useRef2(null);
820
914
  const [drafts, setDrafts] = useState2(
821
915
  () => initialDrafts(request.questions)
822
916
  );
823
917
  const [validationErrors, setValidationErrors] = useState2({});
824
918
  const [submissionError, setSubmissionError] = useState2(null);
825
919
  const [submittingInternally, setSubmittingInternally] = useState2(false);
920
+ const [overflowBelow, setOverflowBelow] = useState2(false);
921
+ const [collapsed, setCollapsed] = useState2(defaultCollapsed);
826
922
  const submissionInFlight = useRef2(false);
827
923
  const submissionGeneration = useRef2(0);
828
924
  const busy = submitting || submittingInternally;
@@ -833,7 +929,33 @@ function HumanInputForm({
833
929
  setValidationErrors({});
834
930
  setSubmissionError(null);
835
931
  setSubmittingInternally(false);
836
- }, [request.id, request.questions]);
932
+ setCollapsed(defaultCollapsed);
933
+ }, [request.id, request.questions, defaultCollapsed]);
934
+ useEffect2(() => {
935
+ if (collapsed) {
936
+ setOverflowBelow(false);
937
+ return;
938
+ }
939
+ const node = scrollRef.current;
940
+ if (!node) return;
941
+ const sync = () => {
942
+ const { scrollTop, scrollHeight, clientHeight } = node;
943
+ setOverflowBelow(
944
+ scrollHeight > clientHeight + 2 && scrollTop + clientHeight < scrollHeight - 4
945
+ );
946
+ };
947
+ const frame = requestAnimationFrame(sync);
948
+ node.addEventListener("scroll", sync, { passive: true });
949
+ const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(sync) : null;
950
+ observer?.observe(node);
951
+ const content = node.firstElementChild;
952
+ if (content) observer?.observe(content);
953
+ return () => {
954
+ cancelAnimationFrame(frame);
955
+ node.removeEventListener("scroll", sync);
956
+ observer?.disconnect();
957
+ };
958
+ }, [request.id, request.questions, collapsed]);
837
959
  const update = (questionId, apply) => {
838
960
  setDrafts((current) => ({
839
961
  ...current,
@@ -865,155 +987,206 @@ function HumanInputForm({
865
987
  }
866
988
  }
867
989
  };
990
+ const focusQuestion = (questionId) => {
991
+ const root = scrollRef.current;
992
+ if (!root) return;
993
+ const block = Array.from(
994
+ root.querySelectorAll("[data-human-input-question]")
995
+ ).find((node) => node.getAttribute("data-human-input-question") === questionId);
996
+ block?.scrollIntoView({ block: "nearest", behavior: "smooth" });
997
+ const focusable = block?.querySelector(
998
+ "input:not([type='hidden']):not([disabled]), textarea:not([disabled])"
999
+ );
1000
+ focusable?.focus({ preventScroll: true });
1001
+ };
868
1002
  const submit = async (event) => {
869
1003
  event.preventDefault();
870
1004
  const result = answersFromDrafts(request.questions, drafts, messages);
871
1005
  if (Object.keys(result.errors).length > 0) {
872
1006
  setValidationErrors(result.errors);
1007
+ const firstInvalid = request.questions.find((question) => question.id in result.errors);
1008
+ if (firstInvalid) {
1009
+ requestAnimationFrame(() => focusQuestion(firstInvalid.id));
1010
+ }
873
1011
  return;
874
1012
  }
875
1013
  await submitResponse({ outcome: "answered", answers: result.answers });
876
1014
  };
1015
+ const metaBits = [
1016
+ progressLabel,
1017
+ !singleQuestion ? messages.questionCount(request.questions.length) : null,
1018
+ request.expiresAt ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
1019
+ messages.deadlineLabel,
1020
+ " ",
1021
+ /* @__PURE__ */ jsx3("time", { dateTime: request.expiresAt, title: new Date(request.expiresAt).toLocaleString(), children: messages.formatDeadline(request.expiresAt) })
1022
+ ] }) : null
1023
+ ].filter(Boolean);
1024
+ if (collapsed) {
1025
+ return /* @__PURE__ */ jsxs3(
1026
+ "div",
1027
+ {
1028
+ "data-human-input-request": request.id,
1029
+ "data-human-input-collapsed": "",
1030
+ "aria-labelledby": titleId,
1031
+ className: cn(
1032
+ "og-root flex w-full items-center gap-3 rounded-og-lg border border-og-status-waiting/35 bg-og-status-waiting/5 px-3 py-2.5 shadow-og-sm",
1033
+ className
1034
+ ),
1035
+ children: [
1036
+ /* @__PURE__ */ jsx3("span", { className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/12 text-og-status-waiting", children: /* @__PURE__ */ jsx3(MessageCircleQuestionIcon, { "aria-hidden": "true", className: "size-4" }) }),
1037
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
1038
+ /* @__PURE__ */ jsx3("h2", { id: titleId, className: "truncate text-og-sm font-semibold text-og-fg", children: resolvedTitle }),
1039
+ metaBits.length > 0 ? /* @__PURE__ */ jsx3("p", { className: "mt-0.5 truncate text-og-xs text-og-fg-subtle", children: metaBits.join(" \xB7 ") }) : null
1040
+ ] }),
1041
+ /* @__PURE__ */ jsxs3(
1042
+ "button",
1043
+ {
1044
+ type: "button",
1045
+ onClick: () => setCollapsed(false),
1046
+ className: "inline-flex min-h-8 shrink-0 items-center gap-1 rounded-og-md border border-og-border px-2.5 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:bg-og-surface-1 hover:text-og-fg",
1047
+ children: [
1048
+ messages.expand,
1049
+ /* @__PURE__ */ jsx3(ChevronDownIcon, { "aria-hidden": "true", className: "size-3.5" })
1050
+ ]
1051
+ }
1052
+ )
1053
+ ]
1054
+ }
1055
+ );
1056
+ }
877
1057
  return /* @__PURE__ */ jsxs3(
878
1058
  "form",
879
1059
  {
880
1060
  "data-human-input-request": request.id,
881
1061
  onSubmit: (event) => void submit(event),
1062
+ "aria-labelledby": titleId,
882
1063
  className: cn(
883
- "og-root flex w-full flex-col gap-5 rounded-og-lg border border-og-border bg-og-surface-1 p-5 shadow-og-sm",
1064
+ // Multi-question: pin height at the cap so the flex body gets a real
1065
+ // box and overflow-y engages. max-height alone + percentage/`h-full`
1066
+ // children often sizes to content and clips with no scroll.
1067
+ "og-root flex min-h-0 w-full flex-col overflow-hidden rounded-og-lg border border-og-status-waiting/35 bg-og-status-waiting/5 shadow-og-sm",
1068
+ singleQuestion ? "max-h-[min(28rem,50dvh)]" : "h-[min(28rem,50dvh)] max-h-[min(28rem,50dvh)]",
884
1069
  className
885
1070
  ),
886
1071
  children: [
887
- /* @__PURE__ */ jsxs3("header", { children: [
888
- /* @__PURE__ */ jsx3("h2", { className: "text-og-md font-semibold text-og-fg", children: resolvedTitle }),
889
- resolvedDescription ? /* @__PURE__ */ jsx3("div", { className: "mt-1 text-og-sm text-og-fg-muted", children: resolvedDescription }) : null,
890
- request.expiresAt ? /* @__PURE__ */ jsxs3("p", { className: "mt-1 text-og-xs text-og-fg-subtle", children: [
891
- messages.deadlineLabel,
892
- " ",
893
- /* @__PURE__ */ jsx3("time", { dateTime: request.expiresAt, children: messages.formatDeadline(request.expiresAt) })
894
- ] }) : null
895
- ] }),
896
- /* @__PURE__ */ jsx3("fieldset", { disabled: busy, className: "contents", children: request.questions.map((question, index) => {
897
- const draft = drafts[question.id] ?? emptyDraft();
898
- const fieldId = `${formId}-${index}`;
899
- const errorId = `${fieldId}-error`;
900
- const helpId = `${fieldId}-help`;
901
- const describedBy = [question.helpText ? helpId : null, validationErrors[question.id] ? errorId : null].filter(Boolean).join(" ") || void 0;
902
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
903
- /* @__PURE__ */ jsxs3(
904
- "label",
905
- {
906
- htmlFor: question.kind === "text" ? fieldId : void 0,
907
- className: "text-og-base font-medium text-og-fg",
908
- children: [
909
- question.label ?? question.prompt,
910
- question.required ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "ml-1 text-og-status-failed", children: "*" }) : null
911
- ]
912
- }
913
- ),
914
- question.label ? /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: question.prompt }) : null,
915
- question.helpText ? /* @__PURE__ */ jsx3("p", { id: helpId, className: "text-og-xs text-og-fg-subtle", children: question.helpText }) : null,
916
- question.kind === "text" ? /* @__PURE__ */ jsx3(
917
- "textarea",
918
- {
919
- id: fieldId,
920
- value: draft.values[0] ?? "",
921
- onChange: (event) => update(question.id, (current) => ({
922
- ...current,
923
- values: event.target.value ? [event.target.value] : []
924
- })),
925
- "aria-invalid": Boolean(validationErrors[question.id]),
926
- "aria-describedby": describedBy,
927
- autoFocus: autoFocus && index === 0,
928
- rows: 3,
929
- className: "min-h-20 w-full resize-y rounded-og-md border border-og-border bg-og-surface-2 px-3 py-2 text-og-base text-og-fg outline-none placeholder:text-og-fg-subtle focus:border-og-accent"
930
- }
931
- ) : /* @__PURE__ */ jsxs3(
932
- "div",
933
- {
934
- role: question.kind === "single_select" ? "radiogroup" : "group",
935
- "aria-describedby": describedBy,
936
- className: "flex flex-col gap-2",
937
- children: [
938
- question.options.map((option, optionIndex) => {
939
- const checked = draft.values.includes(option.id);
940
- return /* @__PURE__ */ jsxs3(
941
- "label",
942
- {
943
- className: "flex cursor-pointer items-start gap-2 rounded-og-md border border-og-border px-3 py-2 hover:bg-og-surface-2",
944
- children: [
945
- /* @__PURE__ */ jsx3(
946
- "input",
947
- {
948
- type: question.kind === "single_select" ? "radio" : "checkbox",
949
- name: question.kind === "single_select" ? fieldId : void 0,
950
- autoFocus: autoFocus && index === 0 && optionIndex === 0,
951
- checked,
952
- onChange: (event) => update(question.id, (current) => ({
953
- ...current,
954
- values: question.kind === "single_select" ? event.target.checked ? [option.id] : [] : event.target.checked ? [...current.values, option.id] : current.values.filter((value) => value !== option.id),
955
- ...question.kind === "single_select" && event.target.checked ? { otherSelected: false } : {}
956
- })),
957
- className: "mt-0.5 accent-og-accent"
958
- }
959
- ),
960
- /* @__PURE__ */ jsxs3("span", { className: "min-w-0", children: [
961
- /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: option.label }),
962
- option.description ? /* @__PURE__ */ jsx3("span", { className: "block text-og-xs text-og-fg-muted", children: option.description }) : null
963
- ] })
964
- ]
965
- },
966
- option.id
967
- );
968
- }),
969
- question.allowOther ? /* @__PURE__ */ jsxs3("label", { className: "flex items-start gap-2 rounded-og-md border border-og-border px-3 py-2", children: [
970
- /* @__PURE__ */ jsx3(
971
- "input",
1072
+ /* @__PURE__ */ jsx3("header", { className: "shrink-0 border-b border-og-status-waiting/20 px-4 py-3", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3", children: [
1073
+ /* @__PURE__ */ jsx3("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/12 text-og-status-waiting", children: /* @__PURE__ */ jsx3(MessageCircleQuestionIcon, { "aria-hidden": "true", className: "size-4" }) }),
1074
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
1075
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
1076
+ /* @__PURE__ */ jsxs3("h2", { id: titleId, className: "text-og-md font-semibold text-og-fg", children: [
1077
+ resolvedTitle,
1078
+ singleQuestion?.required && !request.allowSkip ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "ml-1 text-og-status-failed", children: "*" }) : null
1079
+ ] }),
1080
+ progressLabel ? /* @__PURE__ */ jsx3("span", { className: "text-og-xs font-medium text-og-status-waiting", children: progressLabel }) : null,
1081
+ !singleQuestion ? /* @__PURE__ */ jsx3("span", { className: "text-og-xs font-medium text-og-fg-subtle", children: messages.questionCount(request.questions.length) }) : null
1082
+ ] }),
1083
+ resolvedDescription ? /* @__PURE__ */ jsx3("div", { className: "mt-0.5 text-og-sm text-og-fg-muted", children: resolvedDescription }) : null,
1084
+ request.expiresAt ? /* @__PURE__ */ jsxs3("p", { className: "mt-1 text-og-xs text-og-fg-subtle", children: [
1085
+ messages.deadlineLabel,
1086
+ " ",
1087
+ /* @__PURE__ */ jsx3(
1088
+ "time",
1089
+ {
1090
+ dateTime: request.expiresAt,
1091
+ title: new Date(request.expiresAt).toLocaleString(),
1092
+ children: messages.formatDeadline(request.expiresAt)
1093
+ }
1094
+ )
1095
+ ] }) : null,
1096
+ request.allowSkip && singleQuestion ? /* @__PURE__ */ jsx3("p", { className: "mt-1 text-og-xs text-og-fg-subtle", children: "Or skip and let the agent decide." }) : null
1097
+ ] }),
1098
+ /* @__PURE__ */ jsx3(
1099
+ "button",
1100
+ {
1101
+ type: "button",
1102
+ onClick: () => setCollapsed(true),
1103
+ "aria-label": messages.collapse,
1104
+ title: messages.collapse,
1105
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md text-og-fg-muted transition-colors hover:bg-og-surface-1 hover:text-og-fg",
1106
+ children: /* @__PURE__ */ jsx3(ChevronUpIcon, { "aria-hidden": "true", className: "size-4" })
1107
+ }
1108
+ )
1109
+ ] }) }),
1110
+ /* @__PURE__ */ jsxs3("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [
1111
+ /* @__PURE__ */ jsx3(
1112
+ "div",
1113
+ {
1114
+ ref: scrollRef,
1115
+ className: "min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]",
1116
+ children: /* @__PURE__ */ jsx3("fieldset", { disabled: busy, className: "min-w-0 space-y-4 px-4 py-3", children: request.questions.map((question, index) => {
1117
+ if (singleQuestion) {
1118
+ return /* @__PURE__ */ jsx3("div", { "data-human-input-question": question.id, children: /* @__PURE__ */ jsx3(
1119
+ QuestionControls,
1120
+ {
1121
+ question,
1122
+ draft: drafts[question.id] ?? emptyDraft(),
1123
+ fieldId: `${formId}-${index}`,
1124
+ error: validationErrors[question.id],
1125
+ messages,
1126
+ autoFocus,
1127
+ firstOption: true,
1128
+ showPromptChrome: false,
1129
+ allowSkip: request.allowSkip,
1130
+ busy,
1131
+ onUpdate: (apply) => update(question.id, apply)
1132
+ }
1133
+ ) }, question.id);
1134
+ }
1135
+ return /* @__PURE__ */ jsx3(
1136
+ "div",
1137
+ {
1138
+ "data-human-input-question": question.id,
1139
+ className: "flex flex-col gap-1.5",
1140
+ children: /* @__PURE__ */ jsx3(
1141
+ QuestionControls,
972
1142
  {
973
- type: question.kind === "single_select" ? "radio" : "checkbox",
974
- name: question.kind === "single_select" ? fieldId : void 0,
975
- checked: draft.otherSelected,
976
- autoFocus: autoFocus && index === 0 && question.options.length === 0,
977
- onChange: (event) => update(question.id, (current) => ({
978
- ...current,
979
- otherSelected: event.target.checked,
980
- ...question.kind === "single_select" && event.target.checked ? { values: [] } : {}
981
- })),
982
- className: "mt-2 accent-og-accent"
1143
+ question,
1144
+ draft: drafts[question.id] ?? emptyDraft(),
1145
+ fieldId: `${formId}-${index}`,
1146
+ error: validationErrors[question.id],
1147
+ messages,
1148
+ autoFocus: autoFocus && index === 0,
1149
+ firstOption: index === 0,
1150
+ showPromptChrome: true,
1151
+ allowSkip: request.allowSkip,
1152
+ busy,
1153
+ onUpdate: (apply) => update(question.id, apply)
983
1154
  }
984
- ),
985
- /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
986
- /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: messages.other }),
987
- /* @__PURE__ */ jsx3(
988
- "input",
989
- {
990
- type: "text",
991
- value: draft.other,
992
- disabled: !draft.otherSelected || busy,
993
- onChange: (event) => update(question.id, (current) => ({
994
- ...current,
995
- other: event.target.value
996
- })),
997
- className: "mt-1 w-full rounded-og-sm border border-og-border bg-og-surface-2 px-2 py-1.5 text-og-sm text-og-fg outline-none focus:border-og-accent disabled:opacity-50"
998
- }
999
- )
1000
- ] })
1001
- ] }) : null
1002
- ]
1003
- }
1004
- ),
1005
- validationErrors[question.id] ? /* @__PURE__ */ jsx3("p", { id: errorId, role: "alert", className: "text-og-xs text-og-status-failed", children: validationErrors[question.id] }) : null
1006
- ] }, question.id);
1007
- }) }),
1008
- error ?? submissionError ? /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-og-sm text-og-status-failed", children: error ?? submissionError }) : null,
1009
- /* @__PURE__ */ jsxs3("footer", { className: "flex items-center justify-end gap-2", children: [
1155
+ )
1156
+ },
1157
+ question.id
1158
+ );
1159
+ }) })
1160
+ }
1161
+ ),
1162
+ overflowBelow ? /* @__PURE__ */ jsxs3(
1163
+ "div",
1164
+ {
1165
+ className: "pointer-events-none absolute inset-x-0 bottom-0 z-[1] flex flex-col items-center",
1166
+ "aria-hidden": "true",
1167
+ children: [
1168
+ /* @__PURE__ */ jsx3("div", { className: "h-10 w-full bg-gradient-to-t from-og-surface-1 via-og-surface-1/85 to-transparent" }),
1169
+ /* @__PURE__ */ jsx3("span", { className: "-mt-5 mb-1 rounded-og-full bg-og-surface-1 px-2.5 py-0.5 text-og-xs font-medium text-og-fg-muted shadow-og-sm ring-1 ring-og-border/60", children: messages.moreBelow })
1170
+ ]
1171
+ }
1172
+ ) : null
1173
+ ] }),
1174
+ error ?? submissionError ? /* @__PURE__ */ jsx3(
1175
+ "p",
1176
+ {
1177
+ role: "alert",
1178
+ className: "relative z-10 shrink-0 px-4 pb-1 text-og-sm text-og-status-failed",
1179
+ children: error ?? submissionError
1180
+ }
1181
+ ) : null,
1182
+ /* @__PURE__ */ jsxs3("footer", { className: "relative z-10 flex shrink-0 items-center justify-end gap-2 border-t border-og-status-waiting/20 bg-og-surface-1/95 px-4 py-3 backdrop-blur-[2px]", children: [
1010
1183
  request.allowSkip ? /* @__PURE__ */ jsx3(
1011
1184
  "button",
1012
1185
  {
1013
1186
  type: "button",
1014
1187
  disabled: busy,
1015
1188
  onClick: () => void submitResponse({ outcome: "skipped" }),
1016
- className: "rounded-og-md border border-og-border px-3 py-2 text-og-sm font-medium text-og-fg-muted hover:bg-og-surface-2 disabled:opacity-50",
1189
+ className: "inline-flex min-h-9 items-center rounded-og-md border border-og-border px-3 py-1.5 text-og-sm font-medium text-og-fg-muted transition-colors hover:bg-og-surface-1 hover:text-og-fg disabled:opacity-50",
1017
1190
  children: resolvedSkipLabel
1018
1191
  }
1019
1192
  ) : null,
@@ -1022,7 +1195,7 @@ function HumanInputForm({
1022
1195
  {
1023
1196
  type: "submit",
1024
1197
  disabled: busy,
1025
- className: "rounded-og-md bg-og-accent px-3 py-2 text-og-sm font-medium text-og-accent-fg hover:bg-og-accent-strong disabled:opacity-50",
1198
+ className: "inline-flex min-h-9 items-center rounded-og-md bg-og-accent px-3 py-1.5 text-og-sm font-medium text-og-accent-fg transition-colors hover:bg-og-accent-strong disabled:opacity-50",
1026
1199
  children: busy ? messages.submitting : resolvedSubmitLabel
1027
1200
  }
1028
1201
  )
@@ -1031,6 +1204,156 @@ function HumanInputForm({
1031
1204
  }
1032
1205
  );
1033
1206
  }
1207
+ function QuestionControls({
1208
+ question,
1209
+ draft,
1210
+ fieldId,
1211
+ error,
1212
+ messages,
1213
+ autoFocus,
1214
+ firstOption,
1215
+ showPromptChrome,
1216
+ allowSkip,
1217
+ busy,
1218
+ onUpdate
1219
+ }) {
1220
+ const errorId = `${fieldId}-error`;
1221
+ const helpId = `${fieldId}-help`;
1222
+ const hint = question.kind === "multi_select" ? messages.selectionHint(
1223
+ question.validation?.minSelections,
1224
+ question.validation?.maxSelections
1225
+ ) : null;
1226
+ const describedBy = [
1227
+ question.helpText && showPromptChrome ? helpId : null,
1228
+ hint ? `${fieldId}-hint` : null,
1229
+ error ? errorId : null
1230
+ ].filter(Boolean).join(" ") || void 0;
1231
+ return /* @__PURE__ */ jsxs3(Fragment2, { children: [
1232
+ showPromptChrome ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
1233
+ /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap items-baseline gap-x-2", children: /* @__PURE__ */ jsxs3(
1234
+ "label",
1235
+ {
1236
+ htmlFor: question.kind === "text" ? fieldId : void 0,
1237
+ className: "text-og-sm font-medium text-og-fg",
1238
+ children: [
1239
+ question.label ?? question.prompt,
1240
+ question.required && !allowSkip ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "ml-1 text-og-status-failed", children: "*" }) : !question.required ? /* @__PURE__ */ jsx3("span", { className: "ml-1.5 text-og-xs font-normal text-og-fg-subtle", children: messages.optional }) : null
1241
+ ]
1242
+ }
1243
+ ) }),
1244
+ question.label ? /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: question.prompt }) : null,
1245
+ question.helpText ? /* @__PURE__ */ jsx3("p", { id: helpId, className: "text-og-xs text-og-fg-subtle", children: question.helpText }) : null,
1246
+ hint ? /* @__PURE__ */ jsx3("p", { id: `${fieldId}-hint`, className: "text-og-xs text-og-fg-subtle", children: hint }) : null
1247
+ ] }) : /* @__PURE__ */ jsxs3(Fragment2, { children: [
1248
+ !question.required && allowSkip === false ? /* @__PURE__ */ jsx3("p", { className: "text-og-xs text-og-fg-subtle", children: messages.optional }) : null,
1249
+ question.helpText && question.label ? /* @__PURE__ */ jsx3("p", { id: helpId, className: "mb-1.5 text-og-xs text-og-fg-subtle", children: question.helpText }) : null,
1250
+ hint ? /* @__PURE__ */ jsx3("p", { id: `${fieldId}-hint`, className: "mb-1.5 text-og-xs text-og-fg-subtle", children: hint }) : null
1251
+ ] }),
1252
+ question.kind === "text" ? /* @__PURE__ */ jsx3(
1253
+ "textarea",
1254
+ {
1255
+ id: fieldId,
1256
+ value: draft.values[0] ?? "",
1257
+ onChange: (event) => onUpdate((current) => ({
1258
+ ...current,
1259
+ values: event.target.value ? [event.target.value] : []
1260
+ })),
1261
+ "aria-invalid": Boolean(error),
1262
+ "aria-describedby": describedBy,
1263
+ autoFocus,
1264
+ rows: 2,
1265
+ className: "min-h-14 w-full resize-y rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg outline-none placeholder:text-og-fg-subtle focus:border-og-accent"
1266
+ }
1267
+ ) : /* @__PURE__ */ jsxs3(
1268
+ "div",
1269
+ {
1270
+ role: question.kind === "single_select" ? "radiogroup" : "group",
1271
+ "aria-describedby": describedBy,
1272
+ className: "flex flex-col gap-0.5",
1273
+ children: [
1274
+ question.options.map((option, optionIndex) => {
1275
+ const checked = draft.values.includes(option.id);
1276
+ return /* @__PURE__ */ jsxs3(
1277
+ "label",
1278
+ {
1279
+ className: cn(
1280
+ "flex cursor-pointer items-start gap-2.5 rounded-og-md px-2.5 py-2 transition-colors",
1281
+ checked ? "bg-og-status-waiting/12 text-og-fg" : "text-og-fg hover:bg-og-surface-1/80"
1282
+ ),
1283
+ children: [
1284
+ /* @__PURE__ */ jsx3(
1285
+ "input",
1286
+ {
1287
+ type: question.kind === "single_select" ? "radio" : "checkbox",
1288
+ name: question.kind === "single_select" ? fieldId : void 0,
1289
+ autoFocus: autoFocus && firstOption && optionIndex === 0,
1290
+ checked,
1291
+ onChange: (event) => onUpdate((current) => ({
1292
+ ...current,
1293
+ values: question.kind === "single_select" ? event.target.checked ? [option.id] : [] : event.target.checked ? [...current.values, option.id] : current.values.filter((value) => value !== option.id),
1294
+ ...question.kind === "single_select" && event.target.checked ? { otherSelected: false } : {}
1295
+ })),
1296
+ className: "mt-0.5 accent-og-accent"
1297
+ }
1298
+ ),
1299
+ /* @__PURE__ */ jsxs3("span", { className: "min-w-0", children: [
1300
+ /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium", children: option.label }),
1301
+ option.description ? /* @__PURE__ */ jsx3("span", { className: "mt-0.5 block text-og-xs text-og-fg-muted", children: option.description }) : null
1302
+ ] })
1303
+ ]
1304
+ },
1305
+ option.id
1306
+ );
1307
+ }),
1308
+ question.allowOther ? /* @__PURE__ */ jsxs3(
1309
+ "label",
1310
+ {
1311
+ className: cn(
1312
+ "flex items-start gap-2.5 rounded-og-md px-2.5 py-2 transition-colors",
1313
+ draft.otherSelected ? "bg-og-status-waiting/12 text-og-fg" : "text-og-fg hover:bg-og-surface-1/80"
1314
+ ),
1315
+ children: [
1316
+ /* @__PURE__ */ jsx3(
1317
+ "input",
1318
+ {
1319
+ type: question.kind === "single_select" ? "radio" : "checkbox",
1320
+ name: question.kind === "single_select" ? fieldId : void 0,
1321
+ checked: draft.otherSelected,
1322
+ autoFocus: autoFocus && firstOption && question.options.length === 0,
1323
+ onChange: (event) => onUpdate((current) => ({
1324
+ ...current,
1325
+ otherSelected: event.target.checked,
1326
+ ...question.kind === "single_select" && event.target.checked ? { values: [] } : {}
1327
+ })),
1328
+ className: "mt-2 accent-og-accent"
1329
+ }
1330
+ ),
1331
+ /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
1332
+ /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium", children: messages.other }),
1333
+ /* @__PURE__ */ jsx3(
1334
+ "input",
1335
+ {
1336
+ type: "text",
1337
+ value: draft.other,
1338
+ disabled: !draft.otherSelected || busy,
1339
+ placeholder: "Type a value\u2026",
1340
+ onChange: (event) => onUpdate((current) => ({
1341
+ ...current,
1342
+ other: event.target.value
1343
+ })),
1344
+ className: "mt-1.5 w-full rounded-og-sm border border-og-border bg-og-surface-1 px-2 py-1.5 text-og-sm text-og-fg outline-none focus:border-og-accent disabled:opacity-50"
1345
+ }
1346
+ )
1347
+ ] })
1348
+ ]
1349
+ }
1350
+ ) : null
1351
+ ]
1352
+ }
1353
+ ),
1354
+ error ? /* @__PURE__ */ jsx3("p", { id: errorId, role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null
1355
+ ] });
1356
+ }
1034
1357
  function answersFromDrafts(questions, drafts, messageOverrides = {}) {
1035
1358
  const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
1036
1359
  const answers = [];
@@ -1040,25 +1363,15 @@ function answersFromDrafts(questions, drafts, messageOverrides = {}) {
1040
1363
  const values = question.kind === "text" ? draft.values.filter(Boolean) : draft.values;
1041
1364
  const other = draft.otherSelected ? draft.other.trim() : "";
1042
1365
  const supplied = values.length + (other ? 1 : 0);
1366
+ if (question.kind !== "text" && draft.otherSelected && !other) {
1367
+ errors[question.id] = messages.otherRequired;
1368
+ continue;
1369
+ }
1043
1370
  if (question.required && supplied === 0) {
1044
1371
  errors[question.id] = messages.required;
1045
1372
  continue;
1046
1373
  }
1047
- if (question.kind === "text") {
1048
- const value = values[0] ?? "";
1049
- if (value && question.validation?.minLength != null && value.length < question.validation.minLength) {
1050
- errors[question.id] = messages.minLength(question.validation.minLength);
1051
- continue;
1052
- }
1053
- if (question.validation?.maxLength != null && value.length > question.validation.maxLength) {
1054
- errors[question.id] = messages.maxLength(question.validation.maxLength);
1055
- continue;
1056
- }
1057
- } else {
1058
- if (draft.otherSelected && !other) {
1059
- errors[question.id] = messages.otherRequired;
1060
- continue;
1061
- }
1374
+ if (question.kind !== "text") {
1062
1375
  const min = question.validation?.minSelections;
1063
1376
  const max = question.kind === "single_select" ? 1 : question.validation?.maxSelections;
1064
1377
  if (min != null && supplied < min) {
@@ -1088,7 +1401,60 @@ function emptyDraft() {
1088
1401
  }
1089
1402
  function formatDeadline(value) {
1090
1403
  const date = new Date(value);
1091
- return Number.isNaN(date.getTime()) ? value : date.toLocaleString();
1404
+ if (Number.isNaN(date.getTime())) return value;
1405
+ const ms = date.getTime() - Date.now();
1406
+ if (ms <= 0) return "deadline passed";
1407
+ const minutes = Math.round(ms / 6e4);
1408
+ if (minutes < 1) return "in under a minute";
1409
+ if (minutes < 60) return `in ${minutes}m`;
1410
+ const hours = Math.round(minutes / 60);
1411
+ if (hours < 48) return `in ${hours}h`;
1412
+ return date.toLocaleString();
1413
+ }
1414
+
1415
+ // src/components/human-input-surface.tsx
1416
+ import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef3 } from "react";
1417
+ import { jsx as jsx4 } from "react/jsx-runtime";
1418
+ function HumanInputSurface({
1419
+ requests,
1420
+ onSubmit,
1421
+ respondingRequestId = null,
1422
+ error,
1423
+ messages,
1424
+ className,
1425
+ autoFocus = true
1426
+ }) {
1427
+ const batchTotalRef = useRef3(0);
1428
+ const ordered = useMemo2(() => {
1429
+ return [...requests].sort((a, b) => {
1430
+ const aAt = a.createdAt ? Date.parse(a.createdAt) : 0;
1431
+ const bAt = b.createdAt ? Date.parse(b.createdAt) : 0;
1432
+ if (aAt !== bAt) return aAt - bAt;
1433
+ return a.id.localeCompare(b.id);
1434
+ });
1435
+ }, [requests]);
1436
+ useEffect3(() => {
1437
+ if (ordered.length === 0) {
1438
+ batchTotalRef.current = 0;
1439
+ return;
1440
+ }
1441
+ batchTotalRef.current = batchTotalRef.current === 0 ? ordered.length : Math.max(batchTotalRef.current, ordered.length);
1442
+ }, [ordered]);
1443
+ if (ordered.length === 0) return null;
1444
+ const active = ordered[0];
1445
+ const batchTotal = Math.max(batchTotalRef.current, ordered.length);
1446
+ const position = batchTotal - ordered.length + 1;
1447
+ const progressLabel = batchTotal > 1 ? `${position} of ${batchTotal}` : null;
1448
+ const formProps = {
1449
+ request: active,
1450
+ submitting: respondingRequestId !== null,
1451
+ error: error ?? null,
1452
+ progressLabel,
1453
+ autoFocus,
1454
+ ...messages ? { messages } : {},
1455
+ onSubmit: (response) => onSubmit(active.id, response)
1456
+ };
1457
+ return /* @__PURE__ */ jsx4("div", { className: cn("w-full", className), "data-human-input-surface": "", children: /* @__PURE__ */ jsx4(HumanInputForm, { ...formProps }) });
1092
1458
  }
1093
1459
 
1094
1460
  // src/timeline/registry.ts
@@ -1433,13 +1799,13 @@ function bytesToBase64(data) {
1433
1799
 
1434
1800
  // src/timeline/disclosure-context.tsx
1435
1801
  import { createContext, useContext } from "react";
1436
- import { jsx as jsx4 } from "react/jsx-runtime";
1802
+ import { jsx as jsx5 } from "react/jsx-runtime";
1437
1803
  var DisclosureDefaultsContext = createContext(void 0);
1438
1804
  function DisclosureDefaultsProvider({
1439
1805
  defaultOpen,
1440
1806
  children
1441
1807
  }) {
1442
- return /* @__PURE__ */ jsx4(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
1808
+ return /* @__PURE__ */ jsx5(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
1443
1809
  }
1444
1810
  function useForcedDefaultOpen() {
1445
1811
  return useContext(DisclosureDefaultsContext);
@@ -1448,9 +1814,9 @@ function useForcedDefaultOpen() {
1448
1814
  // src/timeline/screenshot-lightbox.tsx
1449
1815
  import { XIcon as XIcon2 } from "lucide-react";
1450
1816
  import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
1451
- import { createContext as createContext2, useCallback, useContext as useContext2, useMemo as useMemo2, useState as useState3 } from "react";
1817
+ import { createContext as createContext2, useCallback, useContext as useContext2, useMemo as useMemo3, useState as useState3 } from "react";
1452
1818
  import { Dialog } from "radix-ui";
1453
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1819
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1454
1820
  var LightboxContext = createContext2(null);
1455
1821
  function useLightbox() {
1456
1822
  return useContext2(LightboxContext) ?? NOOP;
@@ -1463,20 +1829,20 @@ var NOOP = { open: () => {
1463
1829
  function LightboxProvider({ children }) {
1464
1830
  const ancestor = useContext2(LightboxContext);
1465
1831
  if (ancestor) {
1466
- return /* @__PURE__ */ jsx5(Fragment2, { children });
1832
+ return /* @__PURE__ */ jsx6(Fragment3, { children });
1467
1833
  }
1468
- return /* @__PURE__ */ jsx5(LightboxRoot, { children });
1834
+ return /* @__PURE__ */ jsx6(LightboxRoot, { children });
1469
1835
  }
1470
1836
  function LightboxRoot({ children }) {
1471
1837
  const [state, setState] = useState3(null);
1472
1838
  const open = useCallback((src, caption) => {
1473
1839
  setState(caption ? { src, caption } : { src });
1474
1840
  }, []);
1475
- const controller = useMemo2(() => ({ open }), [open]);
1841
+ const controller = useMemo3(() => ({ open }), [open]);
1476
1842
  return /* @__PURE__ */ jsxs4(LightboxContext.Provider, { value: controller, children: [
1477
1843
  children,
1478
- /* @__PURE__ */ jsx5(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && setState(null), children: /* @__PURE__ */ jsx5(AnimatePresence2, { children: state !== null ? /* @__PURE__ */ jsxs4(Dialog.Portal, { forceMount: true, children: [
1479
- /* @__PURE__ */ jsx5(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx5(
1844
+ /* @__PURE__ */ jsx6(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && setState(null), children: /* @__PURE__ */ jsx6(AnimatePresence2, { children: state !== null ? /* @__PURE__ */ jsxs4(Dialog.Portal, { forceMount: true, children: [
1845
+ /* @__PURE__ */ jsx6(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx6(
1480
1846
  motion2.div,
1481
1847
  {
1482
1848
  initial: { opacity: 0 },
@@ -1486,7 +1852,7 @@ function LightboxRoot({ children }) {
1486
1852
  className: "og-root fixed inset-0 z-50 bg-black/90 backdrop-blur-md"
1487
1853
  }
1488
1854
  ) }),
1489
- /* @__PURE__ */ jsx5(
1855
+ /* @__PURE__ */ jsx6(
1490
1856
  Dialog.Content,
1491
1857
  {
1492
1858
  asChild: true,
@@ -1507,10 +1873,10 @@ function LightboxRoot({ children }) {
1507
1873
  },
1508
1874
  className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
1509
1875
  children: [
1510
- /* @__PURE__ */ jsx5(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
1876
+ /* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
1511
1877
  /* @__PURE__ */ jsxs4("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
1512
1878
  /* @__PURE__ */ jsxs4("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
1513
- /* @__PURE__ */ jsx5(
1879
+ /* @__PURE__ */ jsx6(
1514
1880
  "img",
1515
1881
  {
1516
1882
  src: state.src,
@@ -1518,7 +1884,7 @@ function LightboxRoot({ children }) {
1518
1884
  className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
1519
1885
  }
1520
1886
  ),
1521
- /* @__PURE__ */ jsx5(
1887
+ /* @__PURE__ */ jsx6(
1522
1888
  Dialog.Close,
1523
1889
  {
1524
1890
  className: cn(
@@ -1527,11 +1893,11 @@ function LightboxRoot({ children }) {
1527
1893
  "transition-colors hover:border-white/30 hover:text-white"
1528
1894
  ),
1529
1895
  "aria-label": "Close",
1530
- children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-4" })
1896
+ children: /* @__PURE__ */ jsx6(XIcon2, { className: "size-4" })
1531
1897
  }
1532
1898
  )
1533
1899
  ] }),
1534
- state.caption ? /* @__PURE__ */ jsx5("figcaption", { className: "max-w-2xl text-center font-og-mono text-og-xs text-white/55", children: state.caption }) : /* @__PURE__ */ jsx5("figcaption", { className: "font-og-mono text-og-xs uppercase tracking-[0.1em] text-white/35", children: "Esc or click outside to close" })
1900
+ state.caption ? /* @__PURE__ */ jsx6("figcaption", { className: "max-w-2xl text-center font-og-mono text-og-xs text-white/55", children: state.caption }) : /* @__PURE__ */ jsx6("figcaption", { className: "font-og-mono text-og-xs uppercase tracking-[0.1em] text-white/35", children: "Esc or click outside to close" })
1535
1901
  ] })
1536
1902
  ]
1537
1903
  }
@@ -1545,7 +1911,7 @@ function LightboxRoot({ children }) {
1545
1911
  // src/timeline/shared.tsx
1546
1912
  import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
1547
1913
  import { useState as useState4 } from "react";
1548
- import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1914
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1549
1915
  var ICON_TONE = {
1550
1916
  accent: "text-og-accent",
1551
1917
  failed: "text-og-status-failed",
@@ -1579,10 +1945,10 @@ function ActivityDisclosure({
1579
1945
  // hit area clears the 40px minimum without loosening the dense desktop rail.
1580
1946
  "pointer-coarse:py-2.5"
1581
1947
  );
1582
- const inner = /* @__PURE__ */ jsxs5(Fragment3, { children: [
1583
- hasBody ? /* @__PURE__ */ jsx6(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--og-duration-disclose)] ease-og-in-out group-data-[state=open]/disclosure:rotate-90" }) : /* @__PURE__ */ jsx6("span", { className: "size-3.5 shrink-0" }),
1584
- /* @__PURE__ */ jsx6("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
1585
- /* @__PURE__ */ jsx6(
1948
+ const inner = /* @__PURE__ */ jsxs5(Fragment4, { children: [
1949
+ hasBody ? /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--og-duration-disclose)] ease-og-in-out group-data-[state=open]/disclosure:rotate-90" }) : /* @__PURE__ */ jsx7("span", { className: "size-3.5 shrink-0" }),
1950
+ /* @__PURE__ */ jsx7("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
1951
+ /* @__PURE__ */ jsx7(
1586
1952
  "span",
1587
1953
  {
1588
1954
  className: cn(
@@ -1593,15 +1959,15 @@ function ActivityDisclosure({
1593
1959
  children: title
1594
1960
  }
1595
1961
  ),
1596
- previewVisible && !media ? /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx6("span", { className: "flex-1" }),
1597
- media ? /* @__PURE__ */ jsx6("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx6("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx6(Chip, { chip }) }) : null
1962
+ previewVisible && !media ? /* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx7("span", { className: "flex-1" }),
1963
+ media ? /* @__PURE__ */ jsx7("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx7(Chip, { chip }) }) : null
1598
1964
  ] });
1599
1965
  const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
1600
1966
  if (!hasBody) {
1601
- return /* @__PURE__ */ jsx6("div", { className: cn(rowClass, "cursor-default"), "data-status": dataStatus, children: inner });
1967
+ return /* @__PURE__ */ jsx7("div", { className: cn(rowClass, "cursor-default"), "data-status": dataStatus, children: inner });
1602
1968
  }
1603
1969
  return /* @__PURE__ */ jsxs5("div", { children: [
1604
- /* @__PURE__ */ jsx6(
1970
+ /* @__PURE__ */ jsx7(
1605
1971
  "div",
1606
1972
  {
1607
1973
  role: "button",
@@ -1624,7 +1990,7 @@ function ActivityDisclosure({
1624
1990
  children: inner
1625
1991
  }
1626
1992
  ),
1627
- open ? /* @__PURE__ */ jsx6("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children }) : null
1993
+ open ? /* @__PURE__ */ jsx7("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children }) : null
1628
1994
  ] });
1629
1995
  }
1630
1996
  function Chip({ chip }) {
@@ -1632,14 +1998,14 @@ function Chip({ chip }) {
1632
1998
  const withText = chip.text ? "gap-1.5" : "gap-0";
1633
1999
  if (chip.tone === "bad") {
1634
2000
  return /* @__PURE__ */ jsxs5("span", { className: cn(base, withText, "text-og-status-failed"), children: [
1635
- /* @__PURE__ */ jsx6("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
2001
+ /* @__PURE__ */ jsx7("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
1636
2002
  chip.text
1637
2003
  ] });
1638
2004
  }
1639
2005
  if (chip.tone === "interrupted") {
1640
- return /* @__PURE__ */ jsx6("span", { className: cn(base, "text-og-fg-subtle og-cancelled-chip"), children: chip.text });
2006
+ return /* @__PURE__ */ jsx7("span", { className: cn(base, "text-og-fg-subtle og-cancelled-chip"), children: chip.text });
1641
2007
  }
1642
- return /* @__PURE__ */ jsx6("span", { className: cn(base, "text-og-fg-subtle"), children: chip.text });
2008
+ return /* @__PURE__ */ jsx7("span", { className: cn(base, "text-og-fg-subtle"), children: chip.text });
1643
2009
  }
1644
2010
  function TermBlock({
1645
2011
  command,
@@ -1665,13 +2031,13 @@ function TermBlock({
1665
2031
  ),
1666
2032
  children: [
1667
2033
  showHeader ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pb-1", children: [
1668
- /* @__PURE__ */ jsx6("span", { className: "select-none text-og-status-idle", children: "$" }),
1669
- command != null ? /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate font-og-mono text-og-sm text-og-fg-muted", children: command }) : /* @__PURE__ */ jsx6("span", { className: "flex-1" }),
1670
- workdir ? /* @__PURE__ */ jsx6("span", { className: "shrink-0 font-og-mono text-og-xs text-og-fg-subtle", children: workdir }) : null
2034
+ /* @__PURE__ */ jsx7("span", { className: "select-none text-og-status-idle", children: "$" }),
2035
+ command != null ? /* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1 truncate font-og-mono text-og-sm text-og-fg-muted", children: command }) : /* @__PURE__ */ jsx7("span", { className: "flex-1" }),
2036
+ workdir ? /* @__PURE__ */ jsx7("span", { className: "shrink-0 font-og-mono text-og-xs text-og-fg-subtle", children: workdir }) : null
1671
2037
  ] }) : null,
1672
- empty ? /* @__PURE__ */ jsx6("p", { className: "font-og-mono text-og-xs italic text-og-fg-subtle", children: "(no output)" }) : /* @__PURE__ */ jsxs5("pre", { className: "max-h-72 overflow-auto whitespace-pre-wrap break-all font-og-mono text-og-xs leading-5 text-og-fg-muted", children: [
2038
+ empty ? /* @__PURE__ */ jsx7("p", { className: "font-og-mono text-og-xs italic text-og-fg-subtle", children: "(no output)" }) : /* @__PURE__ */ jsxs5("pre", { className: "max-h-72 overflow-auto whitespace-pre-wrap break-all font-og-mono text-og-xs leading-5 text-og-fg-muted", children: [
1673
2039
  shown,
1674
- live ? /* @__PURE__ */ jsx6("span", { className: "ml-px inline-block h-[1em] w-[2px] translate-y-[2px] animate-og-blink bg-og-accent align-middle" }) : null
2040
+ live ? /* @__PURE__ */ jsx7("span", { className: "ml-px inline-block h-[1em] w-[2px] translate-y-[2px] animate-og-blink bg-og-accent align-middle" }) : null
1675
2041
  ] }),
1676
2042
  showMore ? /* @__PURE__ */ jsxs5(
1677
2043
  "button",
@@ -1707,8 +2073,8 @@ function PayloadBlock({
1707
2073
  failed ? "border-og-status-failed/50" : "border-og-border"
1708
2074
  ),
1709
2075
  children: [
1710
- /* @__PURE__ */ jsx6("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: label }),
1711
- /* @__PURE__ */ jsx6(
2076
+ /* @__PURE__ */ jsx7("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: label }),
2077
+ /* @__PURE__ */ jsx7(
1712
2078
  "pre",
1713
2079
  {
1714
2080
  className: cn(
@@ -1727,9 +2093,9 @@ function BodyNote({
1727
2093
  tone
1728
2094
  }) {
1729
2095
  if (tone === "error") {
1730
- return /* @__PURE__ */ jsx6("div", { className: "border-l-2 border-og-status-failed/50 pl-3 font-og-mono text-og-xs leading-5 text-og-status-failed", children });
2096
+ return /* @__PURE__ */ jsx7("div", { className: "border-l-2 border-og-status-failed/50 pl-3 font-og-mono text-og-xs leading-5 text-og-status-failed", children });
1731
2097
  }
1732
- return /* @__PURE__ */ jsx6("p", { className: "px-0.5 text-og-sm italic leading-5 text-og-fg-subtle", children });
2098
+ return /* @__PURE__ */ jsx7("p", { className: "px-0.5 text-og-sm italic leading-5 text-og-fg-subtle", children });
1733
2099
  }
1734
2100
  var MEDIA_BOX = "h-7 w-[52px] shrink-0 rounded-og-xs border border-og-border";
1735
2101
  function MediaSkeleton() {
@@ -1741,14 +2107,14 @@ function MediaSkeleton() {
1741
2107
  "relative inline-flex items-center justify-center overflow-hidden bg-og-surface-2"
1742
2108
  ),
1743
2109
  children: [
1744
- /* @__PURE__ */ jsx6("span", { className: "absolute inset-0 animate-og-pulse bg-og-surface-3/50" }),
1745
- /* @__PURE__ */ jsx6(CameraIcon, { className: "relative size-3.5 text-og-fg-subtle" })
2110
+ /* @__PURE__ */ jsx7("span", { className: "absolute inset-0 animate-og-pulse bg-og-surface-3/50" }),
2111
+ /* @__PURE__ */ jsx7(CameraIcon, { className: "relative size-3.5 text-og-fg-subtle" })
1746
2112
  ]
1747
2113
  }
1748
2114
  );
1749
2115
  }
1750
2116
  function MediaEmpty() {
1751
- return /* @__PURE__ */ jsx6("span", { className: cn(MEDIA_BOX, "inline-flex items-center justify-center bg-og-bg"), children: /* @__PURE__ */ jsx6(CameraOffIcon, { className: "size-3.5 text-og-fg-subtle" }) });
2117
+ return /* @__PURE__ */ jsx7("span", { className: cn(MEDIA_BOX, "inline-flex items-center justify-center bg-og-bg"), children: /* @__PURE__ */ jsx7(CameraOffIcon, { className: "size-3.5 text-og-fg-subtle" }) });
1752
2118
  }
1753
2119
  function Thumbnail({
1754
2120
  src,
@@ -1758,9 +2124,9 @@ function Thumbnail({
1758
2124
  const lightbox = useLightboxOptional();
1759
2125
  const [failed, setFailed] = useState4(false);
1760
2126
  if (failed) {
1761
- return /* @__PURE__ */ jsx6(MediaEmpty, {});
2127
+ return /* @__PURE__ */ jsx7(MediaEmpty, {});
1762
2128
  }
1763
- const img = /* @__PURE__ */ jsx6(
2129
+ const img = /* @__PURE__ */ jsx7(
1764
2130
  "img",
1765
2131
  {
1766
2132
  src,
@@ -1770,9 +2136,9 @@ function Thumbnail({
1770
2136
  }
1771
2137
  );
1772
2138
  if (!lightbox) {
1773
- return /* @__PURE__ */ jsx6("span", { className: cn(MEDIA_BOX, "inline-flex overflow-hidden bg-og-bg"), children: img });
2139
+ return /* @__PURE__ */ jsx7("span", { className: cn(MEDIA_BOX, "inline-flex overflow-hidden bg-og-bg"), children: img });
1774
2140
  }
1775
- return /* @__PURE__ */ jsx6(
2141
+ return /* @__PURE__ */ jsx7(
1776
2142
  "button",
1777
2143
  {
1778
2144
  type: "button",
@@ -1803,7 +2169,7 @@ function ScreenshotFigure({
1803
2169
  const lightbox = useLightboxOptional();
1804
2170
  const [failed, setFailed] = useState4(false);
1805
2171
  const surface = "block w-full overflow-hidden rounded-og-md border border-og-border bg-og-bg";
1806
- const img = /* @__PURE__ */ jsx6(
2172
+ const img = /* @__PURE__ */ jsx7(
1807
2173
  "img",
1808
2174
  {
1809
2175
  src,
@@ -1813,7 +2179,7 @@ function ScreenshotFigure({
1813
2179
  }
1814
2180
  );
1815
2181
  return /* @__PURE__ */ jsxs5("figure", { className: "m-0 min-w-0", children: [
1816
- failed ? /* @__PURE__ */ jsx6("div", { className: "rounded-og-md border border-og-border bg-og-bg px-3 py-6 text-center font-og-mono text-og-xs text-og-fg-subtle", children: "image unavailable" }) : lightbox ? /* @__PURE__ */ jsx6(
2182
+ failed ? /* @__PURE__ */ jsx7("div", { className: "rounded-og-md border border-og-border bg-og-bg px-3 py-6 text-center font-og-mono text-og-xs text-og-fg-subtle", children: "image unavailable" }) : lightbox ? /* @__PURE__ */ jsx7(
1817
2183
  "button",
1818
2184
  {
1819
2185
  type: "button",
@@ -1822,8 +2188,8 @@ function ScreenshotFigure({
1822
2188
  "aria-label": "Expand screenshot",
1823
2189
  children: img
1824
2190
  }
1825
- ) : /* @__PURE__ */ jsx6("div", { className: surface, children: img }),
1826
- caption ? /* @__PURE__ */ jsx6("figcaption", { className: "mt-1.5 font-og-mono text-og-xs text-og-fg-subtle", children: caption }) : null
2191
+ ) : /* @__PURE__ */ jsx7("div", { className: surface, children: img }),
2192
+ caption ? /* @__PURE__ */ jsx7("figcaption", { className: "mt-1.5 font-og-mono text-og-xs text-og-fg-subtle", children: caption }) : null
1827
2193
  ] });
1828
2194
  }
1829
2195
 
@@ -1860,10 +2226,10 @@ function gitFileDiffToPatch(file) {
1860
2226
  import {
1861
2227
  lazy as lazy2,
1862
2228
  Suspense as Suspense2,
1863
- useEffect as useEffect3,
2229
+ useEffect as useEffect4,
1864
2230
  useState as useState5
1865
2231
  } from "react";
1866
- import { jsx as jsx7 } from "react/jsx-runtime";
2232
+ import { jsx as jsx8 } from "react/jsx-runtime";
1867
2233
  var LazyPatchDiff = lazy2(async () => {
1868
2234
  const mod = await import("@pierre/diffs/react");
1869
2235
  return { default: mod.PatchDiff };
@@ -1882,7 +2248,7 @@ function PierreDiff({
1882
2248
  }) {
1883
2249
  const [failed, setFailed] = useState5(false);
1884
2250
  const [forcedColors, setForcedColors] = useState5(false);
1885
- useEffect3(() => {
2251
+ useEffect4(() => {
1886
2252
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
1887
2253
  const query2 = window.matchMedia("(forced-colors: active)");
1888
2254
  const update = () => setForcedColors(query2.matches);
@@ -1890,7 +2256,7 @@ function PierreDiff({
1890
2256
  query2.addEventListener?.("change", update);
1891
2257
  return () => query2.removeEventListener?.("change", update);
1892
2258
  }, []);
1893
- useEffect3(() => {
2259
+ useEffect4(() => {
1894
2260
  if (plain) return;
1895
2261
  let cancelled = false;
1896
2262
  void import("@pierre/diffs/react").catch(() => {
@@ -1901,12 +2267,12 @@ function PierreDiff({
1901
2267
  };
1902
2268
  }, [plain]);
1903
2269
  if (plain || failed || forcedColors) {
1904
- return /* @__PURE__ */ jsx7(
2270
+ return /* @__PURE__ */ jsx8(
1905
2271
  "div",
1906
2272
  {
1907
2273
  className,
1908
2274
  "data-opengeni-plain-diff": forcedColors ? "forced-colors" : "fallback",
1909
- children: fallback ?? /* @__PURE__ */ jsx7(PlainPatch, { diff })
2275
+ children: fallback ?? /* @__PURE__ */ jsx8(PlainPatch, { diff })
1910
2276
  }
1911
2277
  );
1912
2278
  }
@@ -1940,7 +2306,7 @@ function PierreDiff({
1940
2306
  "--diffs-font-size": "var(--og-code-font-size)",
1941
2307
  "--diffs-line-height": "var(--og-code-line-height)"
1942
2308
  };
1943
- return /* @__PURE__ */ jsx7("div", { className: cn("min-w-0", className), "data-opengeni-pierre-diff": true, style: pierreVars, children: /* @__PURE__ */ jsx7(Suspense2, { fallback: loading ?? /* @__PURE__ */ jsx7(DiffSkeleton, {}), children: diff.map((file) => /* @__PURE__ */ jsx7("div", { className: "mb-2", children: /* @__PURE__ */ jsx7(
2309
+ return /* @__PURE__ */ jsx8("div", { className: cn("min-w-0", className), "data-opengeni-pierre-diff": true, style: pierreVars, children: /* @__PURE__ */ jsx8(Suspense2, { fallback: loading ?? /* @__PURE__ */ jsx8(DiffSkeleton, {}), children: diff.map((file) => /* @__PURE__ */ jsx8("div", { className: "mb-2", children: /* @__PURE__ */ jsx8(
1944
2310
  LazyPatchDiff,
1945
2311
  {
1946
2312
  patch: gitFileDiffToPatch(file),
@@ -1950,20 +2316,20 @@ function PierreDiff({
1950
2316
  ) }, file.path)) }) });
1951
2317
  }
1952
2318
  function DiffSkeleton() {
1953
- return /* @__PURE__ */ jsx7("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "Loading diff\u2026" });
2319
+ return /* @__PURE__ */ jsx8("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "Loading diff\u2026" });
1954
2320
  }
1955
2321
  function PlainPatch({ diff }) {
1956
2322
  if (diff.length === 0) {
1957
- return /* @__PURE__ */ jsx7("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "No changes" });
2323
+ return /* @__PURE__ */ jsx8("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "No changes" });
1958
2324
  }
1959
- return /* @__PURE__ */ jsx7("div", { className: "min-w-0", children: diff.map((file) => /* @__PURE__ */ jsx7(
2325
+ return /* @__PURE__ */ jsx8("div", { className: "min-w-0", children: diff.map((file) => /* @__PURE__ */ jsx8(
1960
2326
  "pre",
1961
2327
  {
1962
2328
  "aria-label": `Diff for ${file.path}`,
1963
2329
  className: "mb-2 overflow-auto whitespace-pre rounded-og-sm border border-og-border bg-og-bg/60 p-2.5 font-og-mono text-og-xs leading-5",
1964
2330
  role: "region",
1965
2331
  tabIndex: 0,
1966
- children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */ jsx7(
2332
+ children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */ jsx8(
1967
2333
  "span",
1968
2334
  {
1969
2335
  className: cn(
@@ -1994,6 +2360,7 @@ import {
1994
2360
  KeyboardIcon,
1995
2361
  KeyRoundIcon,
1996
2362
  LockIcon,
2363
+ MessageCircleQuestionIcon as MessageCircleQuestionIcon2,
1997
2364
  MessagesSquareIcon,
1998
2365
  MessageSquareIcon,
1999
2366
  MousePointer2Icon,
@@ -2008,14 +2375,22 @@ import {
2008
2375
  WrenchIcon
2009
2376
  } from "lucide-react";
2010
2377
 
2378
+ // src/timeline/compute-label.tsx
2379
+ import { createContext as createContext3, useContext as useContext3 } from "react";
2380
+ var TimelineComputeLabelContext = createContext3(null);
2381
+ var TimelineComputeLabelProvider = TimelineComputeLabelContext.Provider;
2382
+ function useTimelineComputeLabel() {
2383
+ return useContext3(TimelineComputeLabelContext);
2384
+ }
2385
+
2011
2386
  // src/timeline/tool-diff.tsx
2012
2387
  import { useState as useState7 } from "react";
2013
2388
 
2014
2389
  // src/lib/use-theme-type.ts
2015
- import { useEffect as useEffect4, useState as useState6 } from "react";
2390
+ import { useEffect as useEffect5, useState as useState6 } from "react";
2016
2391
  function useThemeType(forced) {
2017
2392
  const [detected, setDetected] = useState6("dark");
2018
- useEffect4(() => {
2393
+ useEffect5(() => {
2019
2394
  if (forced || typeof document === "undefined") return;
2020
2395
  const read = () => {
2021
2396
  const el = document.querySelector("[data-og-theme]");
@@ -2035,20 +2410,20 @@ function useThemeType(forced) {
2035
2410
  }
2036
2411
 
2037
2412
  // src/timeline/tool-diff.tsx
2038
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2413
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2039
2414
  function ToolDiff({ files }) {
2040
2415
  const [layout, setLayout] = useState7("unified");
2041
2416
  const themeType = useThemeType(void 0);
2042
2417
  return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2043
- /* @__PURE__ */ jsx8("div", { className: "mb-1.5 flex justify-end", children: /* @__PURE__ */ jsx8(LayoutToggle, { layout, onChange: setLayout }) }),
2044
- /* @__PURE__ */ jsx8(PierreDiff, { diff: files, layout, themeType })
2418
+ /* @__PURE__ */ jsx9("div", { className: "mb-1.5 flex justify-end", children: /* @__PURE__ */ jsx9(LayoutToggle, { layout, onChange: setLayout }) }),
2419
+ /* @__PURE__ */ jsx9(PierreDiff, { diff: files, layout, themeType })
2045
2420
  ] });
2046
2421
  }
2047
2422
  function LayoutToggle({
2048
2423
  layout,
2049
2424
  onChange
2050
2425
  }) {
2051
- return /* @__PURE__ */ jsx8("div", { className: "inline-flex items-center gap-px rounded-og-xs border border-og-border p-px", children: ["unified", "split"].map((value) => /* @__PURE__ */ jsx8(
2426
+ return /* @__PURE__ */ jsx9("div", { className: "inline-flex items-center gap-px rounded-og-xs border border-og-border p-px", children: ["unified", "split"].map((value) => /* @__PURE__ */ jsx9(
2052
2427
  "button",
2053
2428
  {
2054
2429
  type: "button",
@@ -2070,8 +2445,8 @@ function RawPatch({ diff }) {
2070
2445
  return { key: `${line}\0${occurrence}`, line };
2071
2446
  });
2072
2447
  return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2073
- /* @__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)" }),
2074
- /* @__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(
2448
+ /* @__PURE__ */ jsx9("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: "raw patch (could not parse hunks)" }),
2449
+ /* @__PURE__ */ jsx9("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__ */ jsx9(
2075
2450
  "span",
2076
2451
  {
2077
2452
  className: cn(
@@ -2086,14 +2461,20 @@ function RawPatch({ diff }) {
2086
2461
  }
2087
2462
 
2088
2463
  // src/timeline/tool-renderers.tsx
2089
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2464
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
2090
2465
  var ICON_SIZE = "size-3.5";
2091
2466
  function RunningPreview({ children }) {
2092
2467
  return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-1.5", children: [
2093
- /* @__PURE__ */ jsx9("span", { className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-status-running" }),
2094
- /* @__PURE__ */ jsx9("span", { className: "min-w-0 truncate", children })
2468
+ /* @__PURE__ */ jsx10("span", { className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-status-running" }),
2469
+ /* @__PURE__ */ jsx10("span", { className: "min-w-0 truncate", children })
2095
2470
  ] });
2096
2471
  }
2472
+ function withComputePreview(label, preview) {
2473
+ if (!label) {
2474
+ return preview;
2475
+ }
2476
+ return `on ${label} \xB7 ${preview}`;
2477
+ }
2097
2478
  function ExecRenderer({ item }) {
2098
2479
  const args = parseToolArgs(item.arguments);
2099
2480
  const cmd = typeof args.cmd === "string" ? args.cmd : "";
@@ -2101,46 +2482,48 @@ function ExecRenderer({ item }) {
2101
2482
  const running = item.status === "running";
2102
2483
  const out = item.output;
2103
2484
  const title = `$ ${cmd}`;
2485
+ const computeLabel = useTimelineComputeLabel();
2104
2486
  if (item.status === "failed" && out === void 0) {
2105
- return /* @__PURE__ */ jsx9(
2487
+ return /* @__PURE__ */ jsx10(
2106
2488
  ActivityDisclosure,
2107
2489
  {
2108
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2490
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2109
2491
  iconTone: "failed",
2110
2492
  title,
2111
2493
  titleMono: true,
2112
2494
  chip: { tone: "bad", text: "failed" },
2113
- preview: "output lost \u2014 NUL byte could not be stored",
2114
- children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "output contained a NUL byte and could not be stored; the turn failed on this tool's output insert \u2014 no output event ever arrived." })
2495
+ preview: withComputePreview(computeLabel, "output lost \u2014 NUL byte could not be stored"),
2496
+ children: /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "output contained a NUL byte and could not be stored; the turn failed on this tool's output insert \u2014 no output event ever arrived." })
2115
2497
  }
2116
2498
  );
2117
2499
  }
2118
2500
  if (item.status === "failed" && (out == null || out === "")) {
2119
- return /* @__PURE__ */ jsx9(
2501
+ return /* @__PURE__ */ jsx10(
2120
2502
  ActivityDisclosure,
2121
2503
  {
2122
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2504
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2123
2505
  iconTone: "failed",
2124
2506
  title,
2125
2507
  titleMono: true,
2126
2508
  chip: { tone: "bad", text: "failed" },
2127
- preview: "tool call failed",
2128
- children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "the tool call failed with no output." })
2509
+ preview: withComputePreview(computeLabel, "tool call failed"),
2510
+ children: /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "the tool call failed with no output." })
2129
2511
  }
2130
2512
  );
2131
2513
  }
2132
2514
  if (running) {
2133
2515
  const streamed = typeof out === "string" ? stripExecBanner(out) : "";
2134
- return /* @__PURE__ */ jsx9(
2516
+ const runningPreview = streamed ? `${streamed.split("\n").length} lines` : "running\u2026";
2517
+ return /* @__PURE__ */ jsx10(
2135
2518
  ActivityDisclosure,
2136
2519
  {
2137
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2520
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2138
2521
  iconTone: "running",
2139
2522
  title,
2140
2523
  titleMono: true,
2141
2524
  running: true,
2142
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: streamed ? `${streamed.split("\n").length} lines` : "running\u2026" }),
2143
- children: /* @__PURE__ */ jsx9(TermBlock, { command: null, workdir, output: streamed, live: true })
2525
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: withComputePreview(computeLabel, runningPreview) }),
2526
+ children: /* @__PURE__ */ jsx10(TermBlock, { command: null, workdir, output: streamed, live: true })
2144
2527
  }
2145
2528
  );
2146
2529
  }
@@ -2157,22 +2540,23 @@ function ExecRenderer({ item }) {
2157
2540
  chip = { tone: "bad", text: `exit ${exitCode}` };
2158
2541
  iconTone = "failed";
2159
2542
  }
2160
- const preview = binary ? "binary output" : tailPeek(stripped) || "(no output)";
2543
+ const peek = binary ? "binary output" : tailPeek(stripped) || "(no output)";
2161
2544
  const truncated = execTruncated(text);
2545
+ const preview = withComputePreview(computeLabel, truncated ? `\u22EF truncated \xB7 ${peek}` : peek);
2162
2546
  const body = binary ? "(binary output suppressed)" : stripped;
2163
2547
  return /* @__PURE__ */ jsxs7(
2164
2548
  ActivityDisclosure,
2165
2549
  {
2166
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2550
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2167
2551
  iconTone,
2168
2552
  title,
2169
2553
  titleMono: true,
2170
2554
  ...chip ? { chip } : {},
2171
2555
  failed: item.status === "failed",
2172
2556
  cancelled: item.status === "cancelled",
2173
- preview: truncated ? `\u22EF truncated \xB7 ${preview}` : preview,
2557
+ preview,
2174
2558
  children: [
2175
- /* @__PURE__ */ jsx9(
2559
+ /* @__PURE__ */ jsx10(
2176
2560
  TermBlock,
2177
2561
  {
2178
2562
  command: null,
@@ -2200,15 +2584,15 @@ function WriteStdinRenderer({ item }) {
2200
2584
  const exitCode = sandboxCommandExitCode(text);
2201
2585
  const stripped = stripExecBanner(text);
2202
2586
  if (running) {
2203
- return /* @__PURE__ */ jsx9(
2587
+ return /* @__PURE__ */ jsx10(
2204
2588
  ActivityDisclosure,
2205
2589
  {
2206
- icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
2590
+ icon: /* @__PURE__ */ jsx10(KeyboardIcon, { className: ICON_SIZE }),
2207
2591
  iconTone: "running",
2208
2592
  title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
2209
2593
  titleMono: true,
2210
2594
  running: true,
2211
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "sending\u2026" }),
2595
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "sending\u2026" }),
2212
2596
  children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
2213
2597
  "sending input to session ",
2214
2598
  sessionId,
@@ -2223,10 +2607,10 @@ function WriteStdinRenderer({ item }) {
2223
2607
  } else if (exitCode != null && exitCode !== 0) {
2224
2608
  chip = { tone: "bad", text: `exit ${exitCode}` };
2225
2609
  }
2226
- return /* @__PURE__ */ jsx9(
2610
+ return /* @__PURE__ */ jsx10(
2227
2611
  ActivityDisclosure,
2228
2612
  {
2229
- icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
2613
+ icon: /* @__PURE__ */ jsx10(KeyboardIcon, { className: ICON_SIZE }),
2230
2614
  iconTone: lost ? "failed" : "muted",
2231
2615
  title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
2232
2616
  titleMono: true,
@@ -2234,7 +2618,7 @@ function WriteStdinRenderer({ item }) {
2234
2618
  failed: item.status === "failed",
2235
2619
  cancelled: item.status === "cancelled",
2236
2620
  preview: lost ? `session ${sessionId} PTY vanished` : tailPeek(stripped) || "sent",
2237
- children: lost ? /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: stripped || text }) : /* @__PURE__ */ jsx9(TermBlock, { command: `write_stdin \u2192 session ${sessionId}`, output: stripped })
2621
+ children: lost ? /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: stripped || text }) : /* @__PURE__ */ jsx10(TermBlock, { command: `write_stdin \u2192 session ${sessionId}`, output: stripped })
2238
2622
  }
2239
2623
  );
2240
2624
  }
@@ -2259,8 +2643,8 @@ function PathPreview({
2259
2643
  }) {
2260
2644
  return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
2261
2645
  /* @__PURE__ */ jsxs7("span", { className: "truncate", children: [
2262
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: dirname(path) }),
2263
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(path) })
2646
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-subtle", children: dirname(path) }),
2647
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-muted", children: basename(path) })
2264
2648
  ] }),
2265
2649
  add != null || del != null ? /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-og-fg-subtle", children: [
2266
2650
  add != null ? `+${add}` : "",
@@ -2278,34 +2662,34 @@ function ApplyPatchRenderer({ item }) {
2278
2662
  if (running) {
2279
2663
  const fileCount = ops.length;
2280
2664
  const titleVerb = firstOp ? `Applying ${basename(firstOp.path)}` : "Applying patch";
2281
- return /* @__PURE__ */ jsx9(
2665
+ return /* @__PURE__ */ jsx10(
2282
2666
  ActivityDisclosure,
2283
2667
  {
2284
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2668
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2285
2669
  iconTone: "running",
2286
2670
  title: fileCount > 1 ? `Applying ${fileCount} files` : titleVerb,
2287
2671
  running: true,
2288
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: fileCount > 1 ? `${fileCount} files` : firstOp ? firstOp.path : "applying\u2026" }),
2672
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: fileCount > 1 ? `${fileCount} files` : firstOp ? firstOp.path : "applying\u2026" }),
2289
2673
  children: ops.map((op) => {
2290
2674
  const file2 = safeParseOp(op);
2291
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2292
- /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2293
- /* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
2675
+ return file2 ? /* @__PURE__ */ jsx10(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2676
+ /* @__PURE__ */ jsx10("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2677
+ /* @__PURE__ */ jsx10(RawPatch, { diff: op.diff ?? "" })
2294
2678
  ] }, op.path);
2295
2679
  })
2296
2680
  }
2297
2681
  );
2298
2682
  }
2299
2683
  if (failed) {
2300
- return /* @__PURE__ */ jsx9(
2684
+ return /* @__PURE__ */ jsx10(
2301
2685
  ActivityDisclosure,
2302
2686
  {
2303
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2687
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2304
2688
  iconTone: "failed",
2305
2689
  title: firstOp ? `${verbForOp(firstOp)} ${basename(firstOp.path)}` : "apply_patch",
2306
2690
  chip: { tone: "bad", text: "failed" },
2307
2691
  preview: typeof item.output === "string" ? item.output : "patch failed",
2308
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: item.output, failed: true })
2692
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: item.output, failed: true })
2309
2693
  }
2310
2694
  );
2311
2695
  }
@@ -2314,10 +2698,10 @@ function ApplyPatchRenderer({ item }) {
2314
2698
  const goodFiles = parsed.filter((f) => f !== null);
2315
2699
  const add = goodFiles.reduce((n, f) => n + f.additions, 0);
2316
2700
  const del = goodFiles.reduce((n, f) => n + f.deletions, 0);
2317
- return /* @__PURE__ */ jsx9(
2701
+ return /* @__PURE__ */ jsx10(
2318
2702
  ActivityDisclosure,
2319
2703
  {
2320
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2704
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2321
2705
  iconTone: "accent",
2322
2706
  title: `Edited ${ops.length} files`,
2323
2707
  cancelled,
@@ -2335,56 +2719,56 @@ function ApplyPatchRenderer({ item }) {
2335
2719
  ] }),
2336
2720
  children: ops.map((op, index) => {
2337
2721
  const file2 = parsed[index];
2338
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2339
- /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2340
- /* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
2722
+ return file2 ? /* @__PURE__ */ jsx10(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2723
+ /* @__PURE__ */ jsx10("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2724
+ /* @__PURE__ */ jsx10(RawPatch, { diff: op.diff ?? "" })
2341
2725
  ] }, op.path);
2342
2726
  })
2343
2727
  }
2344
2728
  );
2345
2729
  }
2346
2730
  if (!firstOp) {
2347
- return /* @__PURE__ */ jsx9(GenericRenderer, { item });
2731
+ return /* @__PURE__ */ jsx10(GenericRenderer, { item });
2348
2732
  }
2349
2733
  if (firstOp.type === "delete_file") {
2350
- return /* @__PURE__ */ jsx9(
2734
+ return /* @__PURE__ */ jsx10(
2351
2735
  ActivityDisclosure,
2352
2736
  {
2353
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2737
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2354
2738
  iconTone: "failed",
2355
2739
  title: `Deleted ${basename(firstOp.path)}`,
2356
2740
  cancelled,
2357
- preview: /* @__PURE__ */ jsx9(PathPreview, { path: firstOp.path }),
2358
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "File deleted \u2014 no diff to show." })
2741
+ preview: /* @__PURE__ */ jsx10(PathPreview, { path: firstOp.path }),
2742
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "File deleted \u2014 no diff to show." })
2359
2743
  }
2360
2744
  );
2361
2745
  }
2362
2746
  const file = safeParseOp(firstOp);
2363
2747
  if (!file) {
2364
- return /* @__PURE__ */ jsx9(
2748
+ return /* @__PURE__ */ jsx10(
2365
2749
  ActivityDisclosure,
2366
2750
  {
2367
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2751
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2368
2752
  iconTone: "accent",
2369
2753
  title: `${verbForOp(firstOp)} ${basename(firstOp.path)}`,
2370
2754
  cancelled,
2371
2755
  preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
2372
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
2373
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
2756
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
2757
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
2374
2758
  ] }),
2375
- children: /* @__PURE__ */ jsx9(RawPatch, { diff: firstOp.diff ?? "" })
2759
+ children: /* @__PURE__ */ jsx10(RawPatch, { diff: firstOp.diff ?? "" })
2376
2760
  }
2377
2761
  );
2378
2762
  }
2379
- return /* @__PURE__ */ jsx9(
2763
+ return /* @__PURE__ */ jsx10(
2380
2764
  ActivityDisclosure,
2381
2765
  {
2382
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2766
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2383
2767
  iconTone: "accent",
2384
2768
  title: `${verbForOp(firstOp)} ${basename(file.path)}`,
2385
2769
  cancelled,
2386
- preview: /* @__PURE__ */ jsx9(PathPreview, { path: file.path, add: file.additions, del: file.deletions }),
2387
- children: /* @__PURE__ */ jsx9(ToolDiff, { files: [file] })
2770
+ preview: /* @__PURE__ */ jsx10(PathPreview, { path: file.path, add: file.additions, del: file.deletions }),
2771
+ children: /* @__PURE__ */ jsx10(ToolDiff, { files: [file] })
2388
2772
  }
2389
2773
  );
2390
2774
  }
@@ -2458,40 +2842,40 @@ function ComputerCallRenderer({ item }) {
2458
2842
  const countSuffix = actions.length > 1 ? ` \xB7${actions.length}` : "";
2459
2843
  const isShot = action?.type === "screenshot";
2460
2844
  if (running) {
2461
- return /* @__PURE__ */ jsx9(
2845
+ return /* @__PURE__ */ jsx10(
2462
2846
  ActivityDisclosure,
2463
2847
  {
2464
- icon: isShot ? /* @__PURE__ */ jsx9(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2848
+ icon: isShot ? /* @__PURE__ */ jsx10(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2465
2849
  iconTone: "running",
2466
2850
  title: verb,
2467
2851
  running: true,
2468
- media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
2469
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "capturing frame\u2026" })
2852
+ media: /* @__PURE__ */ jsx10(MediaSkeleton, {}),
2853
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "capturing frame\u2026" })
2470
2854
  }
2471
2855
  );
2472
2856
  }
2473
2857
  if (readOnly) {
2474
- return /* @__PURE__ */ jsx9(
2858
+ return /* @__PURE__ */ jsx10(
2475
2859
  ActivityDisclosure,
2476
2860
  {
2477
- icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2861
+ icon: /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2478
2862
  iconTone: "failed",
2479
2863
  title: verb,
2480
2864
  chip: { tone: "bad", text: "read-only" },
2481
2865
  preview: "write actions disabled",
2482
- children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "computer-use is read-only \u2014 write actions are disabled." })
2866
+ children: /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "computer-use is read-only \u2014 write actions are disabled." })
2483
2867
  }
2484
2868
  );
2485
2869
  }
2486
2870
  if (rejected) {
2487
- return /* @__PURE__ */ jsx9(
2871
+ return /* @__PURE__ */ jsx10(
2488
2872
  ActivityDisclosure,
2489
2873
  {
2490
- icon: /* @__PURE__ */ jsx9(LockIcon, { className: ICON_SIZE }),
2874
+ icon: /* @__PURE__ */ jsx10(LockIcon, { className: ICON_SIZE }),
2491
2875
  iconTone: "muted",
2492
2876
  title: verb,
2493
2877
  preview: "approval rejected \u2014 this action did not run",
2494
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "approval rejected \u2014 this action did not run." })
2878
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "approval rejected \u2014 this action did not run." })
2495
2879
  }
2496
2880
  );
2497
2881
  }
@@ -2502,14 +2886,14 @@ function ComputerCallRenderer({ item }) {
2502
2886
  return /* @__PURE__ */ jsxs7(
2503
2887
  ActivityDisclosure,
2504
2888
  {
2505
- icon: isShot ? /* @__PURE__ */ jsx9(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2889
+ icon: isShot ? /* @__PURE__ */ jsx10(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2506
2890
  iconTone: isFailed ? "failed" : "accent",
2507
2891
  title: `${verb}${countSuffix}`,
2508
2892
  failed: isFailed,
2509
2893
  cancelled: isCancelled,
2510
- media: /* @__PURE__ */ jsx9(Thumbnail, { src: shotUrl, caption }),
2894
+ media: /* @__PURE__ */ jsx10(Thumbnail, { src: shotUrl, caption }),
2511
2895
  children: [
2512
- /* @__PURE__ */ jsx9(ScreenshotFigure, { src: shotUrl, caption }),
2896
+ /* @__PURE__ */ jsx10(ScreenshotFigure, { src: shotUrl, caption }),
2513
2897
  batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
2514
2898
  "batched: ",
2515
2899
  batched
@@ -2522,13 +2906,13 @@ function ComputerCallRenderer({ item }) {
2522
2906
  return /* @__PURE__ */ jsxs7(
2523
2907
  ActivityDisclosure,
2524
2908
  {
2525
- icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
2909
+ icon: /* @__PURE__ */ jsx10(CameraOffIcon2, { className: ICON_SIZE }),
2526
2910
  iconTone: isFailed ? "failed" : "muted",
2527
2911
  title: `${verb}${countSuffix} \xB7 image omitted \xB7 not retained`,
2528
2912
  failed: isFailed,
2529
2913
  cancelled: isCancelled,
2530
2914
  preview: "inline image omitted \xB7 not retained",
2531
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
2915
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
2532
2916
  children: [
2533
2917
  /* @__PURE__ */ jsxs7(BodyNote, { children: [
2534
2918
  "The inline ",
@@ -2544,30 +2928,30 @@ function ComputerCallRenderer({ item }) {
2544
2928
  );
2545
2929
  }
2546
2930
  if (empty) {
2547
- return /* @__PURE__ */ jsx9(
2931
+ return /* @__PURE__ */ jsx10(
2548
2932
  ActivityDisclosure,
2549
2933
  {
2550
- icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
2934
+ icon: /* @__PURE__ */ jsx10(CameraOffIcon2, { className: ICON_SIZE }),
2551
2935
  iconTone: isFailed ? "failed" : "muted",
2552
2936
  title: verb,
2553
2937
  failed: isFailed,
2554
2938
  cancelled: isCancelled,
2555
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
2556
- children: /* @__PURE__ */ jsx9(BodyNote, { children: isFailed ? "computer_call failed \u2014 no image returned." : isCancelled ? "computer_call interrupted \u2014 no image returned." : "(no image) \u2014 the session returned an empty screenshot." })
2939
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
2940
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: isFailed ? "computer_call failed \u2014 no image returned." : isCancelled ? "computer_call interrupted \u2014 no image returned." : "(no image) \u2014 the session returned an empty screenshot." })
2557
2941
  }
2558
2942
  );
2559
2943
  }
2560
- return /* @__PURE__ */ jsx9(
2944
+ return /* @__PURE__ */ jsx10(
2561
2945
  ActivityDisclosure,
2562
2946
  {
2563
- icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2947
+ icon: /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2564
2948
  iconTone: isFailed ? "failed" : "accent",
2565
2949
  title: verb,
2566
2950
  failed: isFailed,
2567
2951
  cancelled: isCancelled,
2568
2952
  preview: batched ?? void 0,
2569
2953
  expandable: batched != null,
2570
- children: batched ? /* @__PURE__ */ jsx9(BodyNote, { children: batched }) : null
2954
+ children: batched ? /* @__PURE__ */ jsx10(BodyNote, { children: batched }) : null
2571
2955
  }
2572
2956
  );
2573
2957
  }
@@ -2627,38 +3011,38 @@ function WebSearchRenderer({ item }) {
2627
3011
  return { key: `${contentKey}\0${occurrence}`, result };
2628
3012
  });
2629
3013
  if (running) {
2630
- return /* @__PURE__ */ jsx9(
3014
+ return /* @__PURE__ */ jsx10(
2631
3015
  ActivityDisclosure,
2632
3016
  {
2633
- icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
3017
+ icon: /* @__PURE__ */ jsx10(SearchIcon, { className: ICON_SIZE }),
2634
3018
  iconTone: "running",
2635
3019
  title: runningTitle,
2636
3020
  running: true,
2637
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: `${query2}${variants}` }),
2638
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "searching\u2026 results fold into the model context (no output event)." })
3021
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: `${query2}${variants}` }),
3022
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "searching\u2026 results fold into the model context (no output event)." })
2639
3023
  }
2640
3024
  );
2641
3025
  }
2642
- return /* @__PURE__ */ jsx9(
3026
+ return /* @__PURE__ */ jsx10(
2643
3027
  ActivityDisclosure,
2644
3028
  {
2645
- icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
3029
+ icon: /* @__PURE__ */ jsx10(SearchIcon, { className: ICON_SIZE }),
2646
3030
  iconTone: "muted",
2647
3031
  title: completedTitle,
2648
3032
  preview: `${query2}${variants}`,
2649
3033
  failed: item.status === "failed",
2650
3034
  cancelled: item.status === "cancelled",
2651
- 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: [
2652
- /* @__PURE__ */ jsx9(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
3035
+ children: keyedResults && keyedResults.length ? /* @__PURE__ */ jsx10("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs7("li", { className: "flex gap-2.5", children: [
3036
+ /* @__PURE__ */ jsx10(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
2653
3037
  /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2654
3038
  /* @__PURE__ */ jsxs7("p", { className: "truncate text-og-base text-og-fg", children: [
2655
3039
  result.title,
2656
3040
  " ",
2657
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
3041
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-subtle", children: result.domain })
2658
3042
  ] }),
2659
- /* @__PURE__ */ jsx9("p", { className: "text-og-sm leading-5 text-og-fg-muted", children: result.snippet })
3043
+ /* @__PURE__ */ jsx10("p", { className: "text-og-sm leading-5 text-og-fg-muted", children: result.snippet })
2660
3044
  ] })
2661
- ] }, key)) }) : /* @__PURE__ */ jsx9(BodyNote, { children: "results folded into model context \u2014 no list available." })
3045
+ ] }, key)) }) : /* @__PURE__ */ jsx10(BodyNote, { children: "results folded into model context \u2014 no list available." })
2662
3046
  }
2663
3047
  );
2664
3048
  }
@@ -2676,16 +3060,16 @@ function ViewImageRenderer({ item }) {
2676
3060
  const text = typeof out === "string" ? out : "";
2677
3061
  const omittedMedia = mediaPreviewFact(out);
2678
3062
  if (item.status === "running") {
2679
- return /* @__PURE__ */ jsx9(
3063
+ return /* @__PURE__ */ jsx10(
2680
3064
  ActivityDisclosure,
2681
3065
  {
2682
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3066
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2683
3067
  iconTone: "running",
2684
3068
  title: `View ${basename(path)}`,
2685
3069
  running: true,
2686
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "reading\u2026" }),
2687
- media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
2688
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "reading image\u2026" })
3070
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "reading\u2026" }),
3071
+ media: /* @__PURE__ */ jsx10(MediaSkeleton, {}),
3072
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "reading image\u2026" })
2689
3073
  }
2690
3074
  );
2691
3075
  }
@@ -2694,43 +3078,43 @@ function ViewImageRenderer({ item }) {
2694
3078
  const errMatch = VIEW_IMAGE_ERRORS.find((p) => text.includes(p));
2695
3079
  if (errMatch) {
2696
3080
  const tooBig = text.includes("exceeded the allowed size");
2697
- return /* @__PURE__ */ jsx9(
3081
+ return /* @__PURE__ */ jsx10(
2698
3082
  ActivityDisclosure,
2699
3083
  {
2700
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3084
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2701
3085
  iconTone: "failed",
2702
3086
  title: `View ${basename(path)}`,
2703
3087
  chip: { tone: "bad", text: tooBig ? "too large" : "error" },
2704
3088
  preview: text,
2705
- children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: text })
3089
+ children: /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: text })
2706
3090
  }
2707
3091
  );
2708
3092
  }
2709
3093
  if (text.startsWith("OpenAI file reference:")) {
2710
- return /* @__PURE__ */ jsx9(
3094
+ return /* @__PURE__ */ jsx10(
2711
3095
  ActivityDisclosure,
2712
3096
  {
2713
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3097
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2714
3098
  iconTone: viewFailed ? "failed" : "muted",
2715
3099
  title: `Viewed ${basename(path)}`,
2716
3100
  failed: viewFailed,
2717
3101
  cancelled: viewCancelled,
2718
3102
  preview: path,
2719
- children: /* @__PURE__ */ jsx9(BodyNote, { children: text })
3103
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: text })
2720
3104
  }
2721
3105
  );
2722
3106
  }
2723
3107
  if (omittedMedia) {
2724
- return /* @__PURE__ */ jsx9(
3108
+ return /* @__PURE__ */ jsx10(
2725
3109
  ActivityDisclosure,
2726
3110
  {
2727
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3111
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2728
3112
  iconTone: viewFailed ? "failed" : "muted",
2729
3113
  title: `Viewed ${basename(path)} \xB7 image omitted \xB7 not retained`,
2730
3114
  failed: viewFailed,
2731
3115
  cancelled: viewCancelled,
2732
3116
  preview: "inline image omitted \xB7 not retained",
2733
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3117
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
2734
3118
  children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
2735
3119
  "The inline ",
2736
3120
  omittedMedia.mediaType,
@@ -2740,48 +3124,48 @@ function ViewImageRenderer({ item }) {
2740
3124
  );
2741
3125
  }
2742
3126
  if (text.includes("No image data")) {
2743
- return /* @__PURE__ */ jsx9(
3127
+ return /* @__PURE__ */ jsx10(
2744
3128
  ActivityDisclosure,
2745
3129
  {
2746
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3130
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2747
3131
  iconTone: viewFailed ? "failed" : "muted",
2748
3132
  title: `Viewed ${basename(path)}`,
2749
3133
  failed: viewFailed,
2750
3134
  cancelled: viewCancelled,
2751
3135
  preview: "(no image)",
2752
- children: /* @__PURE__ */ jsx9(BodyNote, { children: viewFailed ? "view_image failed \u2014 no image data returned." : viewCancelled ? "view_image interrupted." : "(no image) \u2014 the sandbox session returned no image data." })
3136
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: viewFailed ? "view_image failed \u2014 no image data returned." : viewCancelled ? "view_image interrupted." : "(no image) \u2014 the sandbox session returned no image data." })
2753
3137
  }
2754
3138
  );
2755
3139
  }
2756
3140
  if (text.startsWith("data:")) {
2757
- return /* @__PURE__ */ jsx9(
3141
+ return /* @__PURE__ */ jsx10(
2758
3142
  ActivityDisclosure,
2759
3143
  {
2760
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3144
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2761
3145
  iconTone: viewFailed ? "failed" : "accent",
2762
3146
  title: `Viewed ${basename(path)}`,
2763
3147
  failed: viewFailed,
2764
3148
  cancelled: viewCancelled,
2765
- media: /* @__PURE__ */ jsx9(Thumbnail, { src: text, caption: path, alt: path }),
2766
- children: /* @__PURE__ */ jsx9(ScreenshotFigure, { src: text, caption: path, alt: path })
3149
+ media: /* @__PURE__ */ jsx10(Thumbnail, { src: text, caption: path, alt: path }),
3150
+ children: /* @__PURE__ */ jsx10(ScreenshotFigure, { src: text, caption: path, alt: path })
2767
3151
  }
2768
3152
  );
2769
3153
  }
2770
- return /* @__PURE__ */ jsx9(GenericRenderer, { item });
3154
+ return /* @__PURE__ */ jsx10(GenericRenderer, { item });
2771
3155
  }
2772
3156
  function SecretSetRenderer({ item }) {
2773
3157
  const args = parseToolArgs(item.arguments);
2774
3158
  const name = typeof args.name === "string" ? args.name : "variable";
2775
3159
  if (item.status === "running") {
2776
- return /* @__PURE__ */ jsx9(
3160
+ return /* @__PURE__ */ jsx10(
2777
3161
  ActivityDisclosure,
2778
3162
  {
2779
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3163
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2780
3164
  iconTone: "running",
2781
3165
  title: `Set ${name}`,
2782
3166
  running: true,
2783
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "setting\u2026" }),
2784
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
3167
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "setting\u2026" }),
3168
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
2785
3169
  }
2786
3170
  );
2787
3171
  }
@@ -2790,14 +3174,14 @@ function SecretSetRenderer({ item }) {
2790
3174
  return /* @__PURE__ */ jsxs7(
2791
3175
  ActivityDisclosure,
2792
3176
  {
2793
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3177
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2794
3178
  iconTone: "failed",
2795
3179
  title: `Set ${name}`,
2796
3180
  failed: true,
2797
3181
  preview: errorText ?? "variable write failed",
2798
3182
  children: [
2799
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2800
- errorText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: errorText, failed: true }) : /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "the tool call failed with no output." })
3183
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3184
+ errorText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: errorText, failed: true }) : /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "the tool call failed with no output." })
2801
3185
  ]
2802
3186
  }
2803
3187
  );
@@ -2805,14 +3189,14 @@ function SecretSetRenderer({ item }) {
2805
3189
  return /* @__PURE__ */ jsxs7(
2806
3190
  ActivityDisclosure,
2807
3191
  {
2808
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3192
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2809
3193
  iconTone: "muted",
2810
3194
  title: `Set ${name}`,
2811
3195
  cancelled: item.status === "cancelled",
2812
3196
  preview: "value write-only \xB7 never returned",
2813
3197
  children: [
2814
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2815
- /* @__PURE__ */ jsx9(BodyNote, { children: "the value is a secret \u2014 redacted in every view; the API never returns it." })
3198
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3199
+ /* @__PURE__ */ jsx10(BodyNote, { children: "the value is a secret \u2014 redacted in every view; the API never returns it." })
2816
3200
  ]
2817
3201
  }
2818
3202
  );
@@ -2823,15 +3207,15 @@ function DocsSearchRenderer({ item }) {
2823
3207
  const title = query2 ? `Search \u201C${truncatePreview(query2, 48)}\u201D` : toolDisplayName(item.name);
2824
3208
  const running = item.status === "running";
2825
3209
  if (running) {
2826
- return /* @__PURE__ */ jsx9(
3210
+ return /* @__PURE__ */ jsx10(
2827
3211
  ActivityDisclosure,
2828
3212
  {
2829
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3213
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2830
3214
  iconTone: "running",
2831
3215
  title,
2832
3216
  running: true,
2833
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Searching\u2026" }),
2834
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
3217
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "Searching\u2026" }),
3218
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
2835
3219
  }
2836
3220
  );
2837
3221
  }
@@ -2840,14 +3224,14 @@ function DocsSearchRenderer({ item }) {
2840
3224
  return /* @__PURE__ */ jsxs7(
2841
3225
  ActivityDisclosure,
2842
3226
  {
2843
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3227
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2844
3228
  iconTone: "failed",
2845
3229
  title,
2846
3230
  failed: true,
2847
3231
  preview: truncatePreview(outText, 80) || "Search failed",
2848
3232
  children: [
2849
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2850
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
3233
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3234
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
2851
3235
  ]
2852
3236
  }
2853
3237
  );
@@ -2857,18 +3241,18 @@ function DocsSearchRenderer({ item }) {
2857
3241
  return /* @__PURE__ */ jsxs7(
2858
3242
  ActivityDisclosure,
2859
3243
  {
2860
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3244
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2861
3245
  iconTone: "muted",
2862
3246
  title,
2863
3247
  cancelled: item.status === "cancelled",
2864
3248
  preview,
2865
3249
  children: [
2866
- 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: [
2867
- /* @__PURE__ */ jsx9("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
2868
- hit.snippet ? /* @__PURE__ */ jsx9("div", { className: "mt-0.5 line-clamp-2 text-og-xs text-og-fg-muted", children: hit.snippet }) : null
3250
+ hits && hits.length > 0 ? /* @__PURE__ */ jsx10("ul", { className: "grid gap-2", children: hits.slice(0, 8).map((hit) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
3251
+ /* @__PURE__ */ jsx10("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
3252
+ hit.snippet ? /* @__PURE__ */ jsx10("div", { className: "mt-0.5 line-clamp-2 text-og-xs text-og-fg-muted", children: hit.snippet }) : null
2869
3253
  ] }, `${hit.title}\0${hit.snippet}`)) }) : null,
2870
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2871
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
3254
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3255
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
2872
3256
  ]
2873
3257
  }
2874
3258
  );
@@ -2878,17 +3262,17 @@ function SetSessionTitleRenderer({ item }) {
2878
3262
  const titleArg = typeof args.title === "string" ? args.title.trim() : "";
2879
3263
  const display = toolDisplayName(item.name);
2880
3264
  const previewTitle = titleArg ? truncatePreview(titleArg, 72) : "";
2881
- const icon = /* @__PURE__ */ jsx9(MessagesSquareIcon, { className: ICON_SIZE });
3265
+ const icon = /* @__PURE__ */ jsx10(MessagesSquareIcon, { className: ICON_SIZE });
2882
3266
  if (item.status === "running") {
2883
- return /* @__PURE__ */ jsx9(
3267
+ return /* @__PURE__ */ jsx10(
2884
3268
  ActivityDisclosure,
2885
3269
  {
2886
3270
  icon,
2887
3271
  iconTone: "running",
2888
3272
  title: display,
2889
3273
  running: true,
2890
- preview: previewTitle ? /* @__PURE__ */ jsx9(RunningPreview, { children: previewTitle }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Setting title\u2026" }),
2891
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
3274
+ preview: previewTitle ? /* @__PURE__ */ jsx10(RunningPreview, { children: previewTitle }) : /* @__PURE__ */ jsx10(RunningPreview, { children: "Setting title\u2026" }),
3275
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
2892
3276
  }
2893
3277
  );
2894
3278
  }
@@ -2903,8 +3287,8 @@ function SetSessionTitleRenderer({ item }) {
2903
3287
  failed: true,
2904
3288
  preview: truncatePreview(outText, 80) || "Rename failed",
2905
3289
  children: [
2906
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2907
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
3290
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3291
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
2908
3292
  ]
2909
3293
  }
2910
3294
  );
@@ -2928,8 +3312,8 @@ function SetSessionTitleRenderer({ item }) {
2928
3312
  cancelled: item.status === "cancelled",
2929
3313
  preview: item.status === "cancelled" ? void 0 : settledTitle || void 0,
2930
3314
  children: [
2931
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2932
- outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText }) : null
3315
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3316
+ outText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText }) : null
2933
3317
  ]
2934
3318
  }
2935
3319
  );
@@ -2956,15 +3340,15 @@ function MemoryProposeRenderer({ item }) {
2956
3340
  const title = "Propose memory";
2957
3341
  const running = item.status === "running";
2958
3342
  if (running) {
2959
- return /* @__PURE__ */ jsx9(
3343
+ return /* @__PURE__ */ jsx10(
2960
3344
  ActivityDisclosure,
2961
3345
  {
2962
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3346
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
2963
3347
  iconTone: "running",
2964
3348
  title,
2965
3349
  running: true,
2966
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Proposing\u2026" }),
2967
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
3350
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "Proposing\u2026" }),
3351
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
2968
3352
  }
2969
3353
  );
2970
3354
  }
@@ -2973,14 +3357,14 @@ function MemoryProposeRenderer({ item }) {
2973
3357
  return /* @__PURE__ */ jsxs7(
2974
3358
  ActivityDisclosure,
2975
3359
  {
2976
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3360
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
2977
3361
  iconTone: "failed",
2978
3362
  title,
2979
3363
  failed: true,
2980
3364
  preview: truncatePreview(outText, 80) || "Propose failed",
2981
3365
  children: [
2982
- text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
2983
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
3366
+ text ? /* @__PURE__ */ jsx10(BodyNote, { children: text }) : null,
3367
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
2984
3368
  ]
2985
3369
  }
2986
3370
  );
@@ -2988,14 +3372,159 @@ function MemoryProposeRenderer({ item }) {
2988
3372
  return /* @__PURE__ */ jsxs7(
2989
3373
  ActivityDisclosure,
2990
3374
  {
2991
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3375
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
2992
3376
  iconTone: "muted",
2993
3377
  title,
2994
3378
  cancelled: item.status === "cancelled",
2995
3379
  preview: text ? truncatePreview(text, 90) : "Done",
2996
3380
  children: [
2997
- text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
2998
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
3381
+ text ? /* @__PURE__ */ jsx10(BodyNote, { children: text }) : null,
3382
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
3383
+ ]
3384
+ }
3385
+ );
3386
+ }
3387
+ function askToolPreview(args) {
3388
+ const record = args && typeof args === "object" ? args : null;
3389
+ const questions = Array.isArray(record?.questions) ? record.questions : null;
3390
+ if (!questions || questions.length === 0) {
3391
+ return null;
3392
+ }
3393
+ const first = questions[0];
3394
+ if (!first || typeof first !== "object") {
3395
+ return null;
3396
+ }
3397
+ const q = first;
3398
+ const text = typeof q.label === "string" && q.label.trim() ? q.label.trim() : typeof q.prompt === "string" && q.prompt.trim() ? q.prompt.trim() : null;
3399
+ if (!text) {
3400
+ return null;
3401
+ }
3402
+ const preview = truncatePreview(text, 90);
3403
+ return questions.length > 1 ? `${preview} \xB7 ${questions.length} questions` : preview;
3404
+ }
3405
+ function AskRenderer({ item }) {
3406
+ const args = redactSecrets(parseToolArgs(item.arguments));
3407
+ const preview = askToolPreview(args);
3408
+ const icon = /* @__PURE__ */ jsx10(MessageCircleQuestionIcon2, { className: ICON_SIZE });
3409
+ const title = "Ask";
3410
+ if (item.status === "running") {
3411
+ return /* @__PURE__ */ jsx10(
3412
+ ActivityDisclosure,
3413
+ {
3414
+ icon,
3415
+ iconTone: "running",
3416
+ title,
3417
+ running: true,
3418
+ preview: preview ? /* @__PURE__ */ jsx10(RunningPreview, { children: preview }) : /* @__PURE__ */ jsx10(RunningPreview, { children: "Waiting\u2026" }),
3419
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
3420
+ }
3421
+ );
3422
+ }
3423
+ const { text: outText, isError } = unwrapMcpOutput(item.output);
3424
+ if ((isError || item.status === "failed") && item.status !== "cancelled") {
3425
+ return /* @__PURE__ */ jsxs7(
3426
+ ActivityDisclosure,
3427
+ {
3428
+ icon,
3429
+ iconTone: "failed",
3430
+ title,
3431
+ chip: { tone: "bad", text: "error" },
3432
+ preview: truncatePreview(outText, 80) || preview || "Error",
3433
+ children: [
3434
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3435
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
3436
+ ]
3437
+ }
3438
+ );
3439
+ }
3440
+ return /* @__PURE__ */ jsxs7(
3441
+ ActivityDisclosure,
3442
+ {
3443
+ icon,
3444
+ iconTone: "muted",
3445
+ title,
3446
+ cancelled: item.status === "cancelled",
3447
+ preview: item.status === "cancelled" ? void 0 : preview ?? void 0,
3448
+ children: [
3449
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3450
+ outText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText }) : null
3451
+ ]
3452
+ }
3453
+ );
3454
+ }
3455
+ function runOnTargetName(output) {
3456
+ const { text } = unwrapMcpOutput(output);
3457
+ const parsed = tryParseJson(text);
3458
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
3459
+ const name = parsed.targetName;
3460
+ if (typeof name === "string" && name.trim()) {
3461
+ return name.trim();
3462
+ }
3463
+ }
3464
+ return null;
3465
+ }
3466
+ function runOnOpPreview(args) {
3467
+ const op = args.op;
3468
+ if (!op || typeof op !== "object" || Array.isArray(op)) {
3469
+ return null;
3470
+ }
3471
+ const record = op;
3472
+ if (record.kind === "exec" && typeof record.cmd === "string" && record.cmd.trim()) {
3473
+ return `$ ${record.cmd.trim()}`;
3474
+ }
3475
+ if ((record.kind === "read" || record.kind === "write") && typeof record.path === "string" && record.path.trim()) {
3476
+ return truncatePreview(record.path.trim(), 72);
3477
+ }
3478
+ return null;
3479
+ }
3480
+ function RunOnRenderer({ item }) {
3481
+ const parsedArgs = parseToolArgs(item.arguments);
3482
+ const args = redactSecrets(parsedArgs);
3483
+ const targetName = runOnTargetName(item.output);
3484
+ const title = targetName ? `Run on ${targetName}` : "Run on";
3485
+ const opPreview = runOnOpPreview(parsedArgs);
3486
+ const icon = /* @__PURE__ */ jsx10(ServerIcon, { className: ICON_SIZE });
3487
+ if (item.status === "running") {
3488
+ return /* @__PURE__ */ jsx10(
3489
+ ActivityDisclosure,
3490
+ {
3491
+ icon,
3492
+ iconTone: "running",
3493
+ title,
3494
+ running: true,
3495
+ preview: opPreview ? /* @__PURE__ */ jsx10(RunningPreview, { children: opPreview }) : /* @__PURE__ */ jsx10(RunningPreview, { children: "Running\u2026" }),
3496
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
3497
+ }
3498
+ );
3499
+ }
3500
+ const { text: outText, isError } = unwrapMcpOutput(item.output);
3501
+ if ((isError || item.status === "failed") && item.status !== "cancelled") {
3502
+ return /* @__PURE__ */ jsxs7(
3503
+ ActivityDisclosure,
3504
+ {
3505
+ icon,
3506
+ iconTone: "failed",
3507
+ title,
3508
+ chip: { tone: "bad", text: "error" },
3509
+ preview: truncatePreview(outText, 80) || opPreview || "Error",
3510
+ children: [
3511
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3512
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
3513
+ ]
3514
+ }
3515
+ );
3516
+ }
3517
+ return /* @__PURE__ */ jsxs7(
3518
+ ActivityDisclosure,
3519
+ {
3520
+ icon,
3521
+ iconTone: "muted",
3522
+ title,
3523
+ cancelled: item.status === "cancelled",
3524
+ preview: item.status === "cancelled" ? void 0 : opPreview ?? void 0,
3525
+ children: [
3526
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3527
+ outText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText }) : null
2999
3528
  ]
3000
3529
  }
3001
3530
  );
@@ -3004,18 +3533,18 @@ function GenericRenderer({ item }) {
3004
3533
  const running = item.status === "running";
3005
3534
  const args = redactSecrets(parseToolArgs(item.arguments));
3006
3535
  const display = toolDisplayName(item.name);
3007
- const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
3536
+ const icon = /* @__PURE__ */ jsx10(GenericToolIcon, { name: item.name });
3008
3537
  const goalPreview = goalToolPreview(item.name, args);
3009
3538
  if (running) {
3010
- return /* @__PURE__ */ jsx9(
3539
+ return /* @__PURE__ */ jsx10(
3011
3540
  ActivityDisclosure,
3012
3541
  {
3013
3542
  icon,
3014
3543
  iconTone: "running",
3015
3544
  title: display,
3016
3545
  running: true,
3017
- preview: goalPreview ?? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }),
3018
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
3546
+ preview: goalPreview ?? /* @__PURE__ */ jsx10(RunningPreview, { children: "Running\u2026" }),
3547
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
3019
3548
  }
3020
3549
  );
3021
3550
  }
@@ -3030,8 +3559,8 @@ function GenericRenderer({ item }) {
3030
3559
  chip: { tone: "bad", text: "error" },
3031
3560
  preview: truncatePreview(outText, 80) || "Error",
3032
3561
  children: [
3033
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
3034
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
3562
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3563
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
3035
3564
  ]
3036
3565
  }
3037
3566
  );
@@ -3045,8 +3574,8 @@ function GenericRenderer({ item }) {
3045
3574
  cancelled: item.status === "cancelled",
3046
3575
  preview: item.status === "cancelled" ? void 0 : goalPreview ?? "Done",
3047
3576
  children: [
3048
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
3049
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
3577
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3578
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
3050
3579
  ]
3051
3580
  }
3052
3581
  );
@@ -3072,8 +3601,8 @@ function truncatePreview(text, max) {
3072
3601
  }
3073
3602
  function GenericToolIcon({ name }) {
3074
3603
  const leaf = mcpToolLeaf(name);
3075
- const Icon = leaf.startsWith("goal_") ? TargetIcon : leaf.startsWith("memory_") || leaf === "preference_registry_summary" || leaf === "preference_registry_get" ? BrainCircuitIcon : leaf.startsWith("session_") || leaf === "sessions_list" || leaf === "set_session_title" || leaf === "set_other_session_title" ? MessagesSquareIcon : leaf.startsWith("sandbox") || leaf === "sandboxes_list" || leaf === "run_on" ? ServerIcon : leaf.startsWith("rig_") ? ServerCogIcon : leaf.startsWith("scheduled_") ? CalendarClockIcon : leaf.startsWith("artifacts_") ? PanelsTopLeftIcon : leaf.startsWith("social_") ? Share2Icon : leaf.startsWith("slack_") ? MessageSquareIcon : leaf.startsWith("github_") ? FolderGitIcon : leaf.startsWith("variable_") ? BoxIcon : leaf.startsWith("environment_") ? KeyRoundIcon : leaf.includes("document") || leaf.includes("knowledge") || leaf === "list_document_bases" ? FileSearchIcon : leaf === "tool_search" || leaf === "load_skill" ? PlugIcon : WrenchIcon;
3076
- return /* @__PURE__ */ jsx9(Icon, { className: ICON_SIZE });
3604
+ const Icon = leaf === "request_human_input" ? MessageCircleQuestionIcon2 : leaf.startsWith("goal_") ? TargetIcon : leaf.startsWith("memory_") || leaf === "preference_registry_summary" || leaf === "preference_registry_get" ? BrainCircuitIcon : leaf.startsWith("session_") || leaf === "sessions_list" || leaf === "set_session_title" || leaf === "set_other_session_title" ? MessagesSquareIcon : leaf.startsWith("sandbox") || leaf === "sandboxes_list" || leaf === "run_on" ? ServerIcon : leaf.startsWith("rig_") ? ServerCogIcon : leaf.startsWith("scheduled_") ? CalendarClockIcon : leaf.startsWith("artifacts_") ? PanelsTopLeftIcon : leaf.startsWith("social_") ? Share2Icon : leaf.startsWith("slack_") ? MessageSquareIcon : leaf.startsWith("github_") ? FolderGitIcon : leaf.startsWith("variable_") ? BoxIcon : leaf.startsWith("environment_") ? KeyRoundIcon : leaf.includes("document") || leaf.includes("knowledge") || leaf === "list_document_bases" ? FileSearchIcon : leaf === "tool_search" || leaf === "load_skill" ? PlugIcon : WrenchIcon;
3605
+ return /* @__PURE__ */ jsx10(Icon, { className: ICON_SIZE });
3077
3606
  }
3078
3607
  var BASE_ENTRIES = [
3079
3608
  // Provider-native items carry `raw.type` on the wire — this is their source of
@@ -3083,6 +3612,8 @@ var BASE_ENTRIES = [
3083
3612
  { match: "rawType", type: "hosted_tool_call", render: WebSearchRenderer },
3084
3613
  // First-party sandbox + MCP tools resolve by name (exact or MCP leaf).
3085
3614
  { match: "name", name: "exec_command", render: ExecRenderer },
3615
+ { match: "name", name: "request_human_input", render: AskRenderer },
3616
+ { match: "name", name: "run_on", render: RunOnRenderer },
3086
3617
  { match: "name", name: "write_stdin", render: WriteStdinRenderer },
3087
3618
  { match: "name", name: "apply_patch_call", render: ApplyPatchRenderer },
3088
3619
  { match: "name", name: "apply_patch", render: ApplyPatchRenderer },
@@ -3161,8 +3692,8 @@ function tableElementToTsv(table) {
3161
3692
 
3162
3693
  // src/components/copy-button.tsx
3163
3694
  import { CheckIcon, CopyIcon } from "lucide-react";
3164
- import { useEffect as useEffect5, useRef as useRef3, useState as useState8 } from "react";
3165
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
3695
+ import { useEffect as useEffect6, useRef as useRef4, useState as useState8 } from "react";
3696
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
3166
3697
  var COPIED_MS = 1600;
3167
3698
  function CopyButton({
3168
3699
  text,
@@ -3172,8 +3703,8 @@ function CopyButton({
3172
3703
  }) {
3173
3704
  const [copied, setCopied] = useState8(false);
3174
3705
  const [tipOpen, setTipOpen] = useState8(false);
3175
- const timerRef = useRef3(null);
3176
- useEffect5(() => {
3706
+ const timerRef = useRef4(null);
3707
+ useEffect6(() => {
3177
3708
  return () => {
3178
3709
  if (timerRef.current !== null) {
3179
3710
  clearTimeout(timerRef.current);
@@ -3215,7 +3746,7 @@ function CopyButton({
3215
3746
  }
3216
3747
  },
3217
3748
  children: [
3218
- /* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(
3749
+ /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
3219
3750
  "button",
3220
3751
  {
3221
3752
  type: "button",
@@ -3232,10 +3763,10 @@ function CopyButton({
3232
3763
  copied && "opacity-100 text-og-accent",
3233
3764
  className
3234
3765
  ),
3235
- children: copied ? /* @__PURE__ */ jsx10(CheckIcon, { className: "size-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx10(CopyIcon, { className: "size-3.5", "aria-hidden": true })
3766
+ children: copied ? /* @__PURE__ */ jsx11(CheckIcon, { className: "size-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx11(CopyIcon, { className: "size-3.5", "aria-hidden": true })
3236
3767
  }
3237
3768
  ) }),
3238
- /* @__PURE__ */ jsx10(TooltipContent, { side: "top", children: tip })
3769
+ /* @__PURE__ */ jsx11(TooltipContent, { side: "top", children: tip })
3239
3770
  ]
3240
3771
  }
3241
3772
  );
@@ -3249,7 +3780,7 @@ function CopyHoverFrame({
3249
3780
  trailing
3250
3781
  }) {
3251
3782
  if (copyText.trim().length === 0) {
3252
- return /* @__PURE__ */ jsx10("div", { className, children });
3783
+ return /* @__PURE__ */ jsx11("div", { className, children });
3253
3784
  }
3254
3785
  return /* @__PURE__ */ jsxs8("div", { className: cn("group/copy", className), children: [
3255
3786
  children,
@@ -3261,7 +3792,7 @@ function CopyHoverFrame({
3261
3792
  align === "end" ? "justify-end" : "justify-start"
3262
3793
  ),
3263
3794
  children: [
3264
- /* @__PURE__ */ jsx10(CopyButton, { text: copyText, label, reveal: "group-hover" }),
3795
+ /* @__PURE__ */ jsx11(CopyButton, { text: copyText, label, reveal: "group-hover" }),
3265
3796
  trailing
3266
3797
  ]
3267
3798
  }
@@ -3274,9 +3805,9 @@ import {
3274
3805
  Children,
3275
3806
  isValidElement,
3276
3807
  memo,
3277
- useEffect as useEffect6,
3808
+ useEffect as useEffect7,
3278
3809
  useReducer,
3279
- useRef as useRef4,
3810
+ useRef as useRef5,
3280
3811
  useState as useState9
3281
3812
  } from "react";
3282
3813
  import ReactMarkdown from "react-markdown";
@@ -3562,9 +4093,9 @@ function rehypeStreamReveal(options) {
3562
4093
  }
3563
4094
 
3564
4095
  // src/components/markdown.tsx
3565
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4096
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
3566
4097
  var components = {
3567
- h1: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4098
+ h1: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3568
4099
  "h1",
3569
4100
  {
3570
4101
  className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
@@ -3572,8 +4103,8 @@ var components = {
3572
4103
  children
3573
4104
  }
3574
4105
  ),
3575
- h2: ({ children, ...props }) => /* @__PURE__ */ jsx11("h2", { className: "mt-5 mb-2 text-lg font-semibold tracking-tight text-og-fg first:mt-0", ...props, children }),
3576
- h3: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4106
+ h2: ({ children, ...props }) => /* @__PURE__ */ jsx12("h2", { className: "mt-5 mb-2 text-lg font-semibold tracking-tight text-og-fg first:mt-0", ...props, children }),
4107
+ h3: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3577
4108
  "h3",
3578
4109
  {
3579
4110
  className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
@@ -3581,7 +4112,7 @@ var components = {
3581
4112
  children
3582
4113
  }
3583
4114
  ),
3584
- h4: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4115
+ h4: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3585
4116
  "h4",
3586
4117
  {
3587
4118
  className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg-muted first:mt-0",
@@ -3589,10 +4120,10 @@ var components = {
3589
4120
  children
3590
4121
  }
3591
4122
  ),
3592
- p: ({ children, ...props }) => /* @__PURE__ */ jsx11("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
3593
- strong: ({ children, ...props }) => /* @__PURE__ */ jsx11("strong", { className: "font-semibold text-og-fg", ...props, children }),
3594
- em: ({ children, ...props }) => /* @__PURE__ */ jsx11("em", { className: "italic", ...props, children }),
3595
- a: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4123
+ p: ({ children, ...props }) => /* @__PURE__ */ jsx12("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
4124
+ strong: ({ children, ...props }) => /* @__PURE__ */ jsx12("strong", { className: "font-semibold text-og-fg", ...props, children }),
4125
+ em: ({ children, ...props }) => /* @__PURE__ */ jsx12("em", { className: "italic", ...props, children }),
4126
+ a: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3596
4127
  "a",
3597
4128
  {
3598
4129
  className: "break-words font-medium text-og-accent underline-offset-2 hover:underline",
@@ -3602,7 +4133,7 @@ var components = {
3602
4133
  children
3603
4134
  }
3604
4135
  ),
3605
- ul: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4136
+ ul: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3606
4137
  "ul",
3607
4138
  {
3608
4139
  className: "my-2.5 ml-5 flex list-disc flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
@@ -3610,7 +4141,7 @@ var components = {
3610
4141
  children
3611
4142
  }
3612
4143
  ),
3613
- ol: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4144
+ ol: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3614
4145
  "ol",
3615
4146
  {
3616
4147
  className: "my-2.5 ml-5 flex list-decimal flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
@@ -3621,7 +4152,7 @@ var components = {
3621
4152
  // GFM task-list items carry a leading checkbox <input>; `list-none` + a
3622
4153
  // negative margin pull the checkbox back to the bullet column so it aligns
3623
4154
  // with the text.
3624
- li: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4155
+ li: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3625
4156
  "li",
3626
4157
  {
3627
4158
  className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
@@ -3629,7 +4160,7 @@ var components = {
3629
4160
  children
3630
4161
  }
3631
4162
  ),
3632
- input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx11(
4163
+ input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx12(
3633
4164
  "input",
3634
4165
  {
3635
4166
  ...props,
@@ -3637,8 +4168,8 @@ var components = {
3637
4168
  disabled: true,
3638
4169
  className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
3639
4170
  }
3640
- ) : /* @__PURE__ */ jsx11("input", { type, ...props }),
3641
- blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4171
+ ) : /* @__PURE__ */ jsx12("input", { type, ...props }),
4172
+ blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3642
4173
  "blockquote",
3643
4174
  {
3644
4175
  className: "my-3 border-l-2 border-og-border-strong pl-3.5 text-og-fg-muted [&>p]:my-1.5 first:mt-0 last:mb-0",
@@ -3646,11 +4177,11 @@ var components = {
3646
4177
  children
3647
4178
  }
3648
4179
  ),
3649
- hr: (props) => /* @__PURE__ */ jsx11("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
4180
+ hr: (props) => /* @__PURE__ */ jsx12("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
3650
4181
  // Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
3651
4182
  // `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
3652
4183
  // the `pre` renderer), so a `code` reaching here is treated as inline.
3653
- code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx11(
4184
+ code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx12(
3654
4185
  "code",
3655
4186
  {
3656
4187
  className: "rounded-og-xs bg-og-surface-1 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
@@ -3659,11 +4190,11 @@ var components = {
3659
4190
  }
3660
4191
  ),
3661
4192
  // Fenced code — quiet mono block (no card / no nested vertical scroll).
3662
- pre: ({ children }) => /* @__PURE__ */ jsx11(MarkdownCodeBlock, { children }),
4193
+ pre: ({ children }) => /* @__PURE__ */ jsx12(MarkdownCodeBlock, { children }),
3663
4194
  // Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
3664
- table: ({ children, ...props }) => /* @__PURE__ */ jsx11(MarkdownTable, { ...props, children }),
3665
- thead: ({ children, ...props }) => /* @__PURE__ */ jsx11("thead", { ...props, children }),
3666
- th: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4195
+ table: ({ children, ...props }) => /* @__PURE__ */ jsx12(MarkdownTable, { ...props, children }),
4196
+ thead: ({ children, ...props }) => /* @__PURE__ */ jsx12("thead", { ...props, children }),
4197
+ th: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3667
4198
  "th",
3668
4199
  {
3669
4200
  className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
@@ -3671,7 +4202,7 @@ var components = {
3671
4202
  children
3672
4203
  }
3673
4204
  ),
3674
- td: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4205
+ td: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3675
4206
  "td",
3676
4207
  {
3677
4208
  className: "border-b border-og-border/70 px-0 py-1.5 pr-4 align-top text-og-fg-muted [tr:last-child>&]:border-b-0",
@@ -3679,7 +4210,7 @@ var components = {
3679
4210
  children
3680
4211
  }
3681
4212
  ),
3682
- img: ({ alt, ...props }) => /* @__PURE__ */ jsx11(
4213
+ img: ({ alt, ...props }) => /* @__PURE__ */ jsx12(
3683
4214
  "img",
3684
4215
  {
3685
4216
  alt: alt ?? "",
@@ -3723,10 +4254,10 @@ function MarkdownCodeBlock({ children }) {
3723
4254
  const language = fenceLanguage(children);
3724
4255
  return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 first:mt-0", children: [
3725
4256
  /* @__PURE__ */ jsxs9("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
3726
- language ? /* @__PURE__ */ jsx11("span", { className: "rounded px-1 py-0.5 font-og-mono text-[10px] uppercase tracking-wide text-og-fg-subtle/80 opacity-0 transition-opacity group-hover/copy:opacity-100 pointer-coarse:opacity-70", children: language }) : null,
3727
- /* @__PURE__ */ jsx11("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx11(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
4257
+ language ? /* @__PURE__ */ jsx12("span", { className: "rounded px-1 py-0.5 font-og-mono text-[10px] uppercase tracking-wide text-og-fg-subtle/80 opacity-0 transition-opacity group-hover/copy:opacity-100 pointer-coarse:opacity-70", children: language }) : null,
4258
+ /* @__PURE__ */ jsx12("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx12(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
3728
4259
  ] }),
3729
- /* @__PURE__ */ jsx11(
4260
+ /* @__PURE__ */ jsx12(
3730
4261
  "pre",
3731
4262
  {
3732
4263
  tabIndex: 0,
@@ -3737,9 +4268,9 @@ function MarkdownCodeBlock({ children }) {
3737
4268
  ] });
3738
4269
  }
3739
4270
  function MarkdownTable({ children, className, ...props }) {
3740
- const tableRef = useRef4(null);
4271
+ const tableRef = useRef5(null);
3741
4272
  return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
3742
- /* @__PURE__ */ jsx11("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx11("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx11(
4273
+ /* @__PURE__ */ jsx12("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx12("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx12(
3743
4274
  CopyButton,
3744
4275
  {
3745
4276
  text: () => tableElementToTsv(tableRef.current),
@@ -3747,7 +4278,7 @@ function MarkdownTable({ children, className, ...props }) {
3747
4278
  reveal: "group-hover"
3748
4279
  }
3749
4280
  ) }) }),
3750
- /* @__PURE__ */ jsx11("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx11(
4281
+ /* @__PURE__ */ jsx12("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx12(
3751
4282
  "table",
3752
4283
  {
3753
4284
  ref: tableRef,
@@ -3759,11 +4290,11 @@ function MarkdownTable({ children, className, ...props }) {
3759
4290
  ] });
3760
4291
  }
3761
4292
  function MarkdownImpl({ children, className, streaming = false }) {
3762
- const revealRef = useRef4(null);
3763
- const bodyRef = useRef4(null);
4293
+ const revealRef = useRef5(null);
4294
+ const bodyRef = useRef5(null);
3764
4295
  const [, bump] = useReducer((n) => n + 1, 0);
3765
4296
  const [settling, setSettling] = useState9(false);
3766
- const hadRevealRef = useRef4(false);
4297
+ const hadRevealRef = useRef5(false);
3767
4298
  const now = typeof performance !== "undefined" ? performance.now() : Date.now();
3768
4299
  const crystallize = (mutate) => {
3769
4300
  mutate();
@@ -3783,7 +4314,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3783
4314
  }
3784
4315
  const revealActive = reveal !== null && (streaming || reveal.hasActive(now));
3785
4316
  const rehypePlugins = revealActive && reveal !== null ? [[rehypeStreamReveal, { reveal, now }]] : void 0;
3786
- useEffect6(() => {
4317
+ useEffect7(() => {
3787
4318
  if (streaming || revealRef.current === null) {
3788
4319
  return;
3789
4320
  }
@@ -3809,8 +4340,8 @@ function MarkdownImpl({ children, className, streaming = false }) {
3809
4340
  }
3810
4341
  };
3811
4342
  }, [streaming]);
3812
- const wasStreamingRef = useRef4(streaming);
3813
- useEffect6(() => {
4343
+ const wasStreamingRef = useRef5(streaming);
4344
+ useEffect7(() => {
3814
4345
  const ended = wasStreamingRef.current && !streaming;
3815
4346
  wasStreamingRef.current = streaming;
3816
4347
  if (!ended || revealRef.current !== null || prefersReducedMotion()) {
@@ -3821,7 +4352,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3821
4352
  return () => clearTimeout(timer);
3822
4353
  }, [streaming]);
3823
4354
  const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
3824
- return /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx11(
4355
+ return /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx12(
3825
4356
  "div",
3826
4357
  {
3827
4358
  ref: bodyRef,
@@ -3830,7 +4361,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3830
4361
  settling && "og-markdown-settle",
3831
4362
  className
3832
4363
  ),
3833
- children: /* @__PURE__ */ jsx11(
4364
+ children: /* @__PURE__ */ jsx12(
3834
4365
  ReactMarkdown,
3835
4366
  {
3836
4367
  remarkPlugins: [remarkGfm],
@@ -3852,32 +4383,32 @@ import {
3852
4383
  BrainIcon,
3853
4384
  SquareTerminalIcon
3854
4385
  } from "lucide-react";
3855
- import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
4386
+ import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef7 } from "react";
3856
4387
  import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
3857
4388
 
3858
4389
  // src/timeline/entrance.tsx
3859
- import { createContext as createContext3, useContext as useContext3, useRef as useRef5 } from "react";
3860
- var EntranceAnimationContext = createContext3(true);
4390
+ import { createContext as createContext4, useContext as useContext4, useRef as useRef6 } from "react";
4391
+ var EntranceAnimationContext = createContext4(true);
3861
4392
  var EntranceAnimationProvider = EntranceAnimationContext.Provider;
3862
4393
  function useEntranceAnimationLive() {
3863
- return useContext3(EntranceAnimationContext);
4394
+ return useContext4(EntranceAnimationContext);
3864
4395
  }
3865
4396
  function useEntranceAnimation() {
3866
- const enabled = useContext3(EntranceAnimationContext);
3867
- const captured = useRef5(enabled);
4397
+ const enabled = useContext4(EntranceAnimationContext);
4398
+ const captured = useRef6(enabled);
3868
4399
  return captured.current;
3869
4400
  }
3870
4401
 
3871
4402
  // src/timeline/seen-activity-ids.ts
3872
- import { createContext as createContext4, useContext as useContext4 } from "react";
3873
- var SeenActivityIdsContext = createContext4(null);
4403
+ import { createContext as createContext5, useContext as useContext5 } from "react";
4404
+ var SeenActivityIdsContext = createContext5(null);
3874
4405
  var SeenActivityIdsProvider = SeenActivityIdsContext.Provider;
3875
4406
  function useSeenActivityIds() {
3876
- return useContext4(SeenActivityIdsContext);
4407
+ return useContext5(SeenActivityIdsContext);
3877
4408
  }
3878
4409
 
3879
4410
  // src/timeline/activity-rail.tsx
3880
- import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
4411
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
3881
4412
  var LazyFleetDecisionRow = lazy3(() => import("./fleet-decision-row-GGCAT4E4.js"));
3882
4413
  function familyOf(item) {
3883
4414
  if (item.kind === "tool-call") {
@@ -3897,7 +4428,7 @@ function ActivityRail({
3897
4428
  const enterLive = useEntranceAnimationLive();
3898
4429
  const seenIds = useSeenActivityIds();
3899
4430
  const enter = seenIds ? enterLive : enterMounted;
3900
- const previousIdsRef = useRef6(null);
4431
+ const previousIdsRef = useRef7(null);
3901
4432
  const enteringIds = /* @__PURE__ */ new Set();
3902
4433
  if (enter) {
3903
4434
  for (const item of items) {
@@ -3918,7 +4449,7 @@ function ActivityRail({
3918
4449
  }
3919
4450
  }
3920
4451
  });
3921
- return /* @__PURE__ */ jsx12(
4452
+ return /* @__PURE__ */ jsx13(
3922
4453
  "div",
3923
4454
  {
3924
4455
  className: cn(
@@ -3935,7 +4466,7 @@ function ActivityRail({
3935
4466
  children: items.map((item, index) => {
3936
4467
  const newFamily = index > 0 && familyOf(item) !== familyOf(items[index - 1]);
3937
4468
  const row = renderActivity(item, toolRegistry, onOpenSession, onMemoryClick);
3938
- return /* @__PURE__ */ jsx12(
4469
+ return /* @__PURE__ */ jsx13(
3939
4470
  "div",
3940
4471
  {
3941
4472
  "data-og-timeline-row-anchor": "",
@@ -3954,19 +4485,19 @@ function assertNever(item) {
3954
4485
  function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
3955
4486
  switch (item.kind) {
3956
4487
  case "reasoning":
3957
- return /* @__PURE__ */ jsx12(ReasoningRow, { item });
4488
+ return /* @__PURE__ */ jsx13(ReasoningRow, { item });
3958
4489
  case "tool-call": {
3959
4490
  const Renderer = toolRegistry.resolve(item);
3960
- return /* @__PURE__ */ jsx12(Renderer, { item });
4491
+ return /* @__PURE__ */ jsx13(Renderer, { item });
3961
4492
  }
3962
4493
  case "worker":
3963
- return /* @__PURE__ */ jsx12(WorkerRow, { item, onOpenSession });
4494
+ return /* @__PURE__ */ jsx13(WorkerRow, { item, onOpenSession });
3964
4495
  case "sandbox":
3965
- return /* @__PURE__ */ jsx12(SandboxRow, { item });
4496
+ return /* @__PURE__ */ jsx13(SandboxRow, { item });
3966
4497
  case "memory":
3967
- return /* @__PURE__ */ jsx12(MemoryRow, { item, onMemoryClick });
4498
+ return /* @__PURE__ */ jsx13(MemoryRow, { item, onMemoryClick });
3968
4499
  case "fleet-decision":
3969
- return /* @__PURE__ */ jsx12(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx12(
4500
+ return /* @__PURE__ */ jsx13(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx13(
3970
4501
  LazyFleetDecisionRow,
3971
4502
  {
3972
4503
  item,
@@ -3981,15 +4512,15 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
3981
4512
  }
3982
4513
  }
3983
4514
  function ReasoningRow({ item }) {
3984
- return /* @__PURE__ */ jsx12(
4515
+ return /* @__PURE__ */ jsx13(
3985
4516
  ActivityDisclosure,
3986
4517
  {
3987
- icon: /* @__PURE__ */ jsx12(BrainIcon, { className: "size-3.5" }),
4518
+ icon: /* @__PURE__ */ jsx13(BrainIcon, { className: "size-3.5" }),
3988
4519
  iconTone: "muted",
3989
- title: item.streaming ? "Thinking" : /* @__PURE__ */ jsx12("span", { className: "font-normal italic text-og-fg-subtle", children: "Thought" }),
4520
+ title: item.streaming ? "Thinking" : /* @__PURE__ */ jsx13("span", { className: "font-normal italic text-og-fg-subtle", children: "Thought" }),
3990
4521
  running: item.streaming,
3991
4522
  preview: truncate(item.text, 110),
3992
- children: /* @__PURE__ */ jsx12("div", { className: "text-og-base leading-6 text-og-fg-muted [&_strong]:text-og-fg-muted", children: /* @__PURE__ */ jsx12(Markdown, { streaming: item.streaming, children: item.text }) })
4523
+ children: /* @__PURE__ */ jsx13("div", { className: "text-og-base leading-6 text-og-fg-muted [&_strong]:text-og-fg-muted", children: /* @__PURE__ */ jsx13(Markdown, { streaming: item.streaming, children: item.text }) })
3993
4524
  }
3994
4525
  );
3995
4526
  }
@@ -4012,11 +4543,11 @@ function MemoryRow({
4012
4543
  return /* @__PURE__ */ jsxs10(
4013
4544
  ActivityDisclosure,
4014
4545
  {
4015
- icon: /* @__PURE__ */ jsx12(BrainCircuitIcon2, { className: "size-3.5" }),
4546
+ icon: /* @__PURE__ */ jsx13(BrainCircuitIcon2, { className: "size-3.5" }),
4016
4547
  iconTone: "muted",
4017
4548
  title: /* @__PURE__ */ jsxs10("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
4018
- /* @__PURE__ */ jsx12("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
4019
- kindLabel ? /* @__PURE__ */ jsx12("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
4549
+ /* @__PURE__ */ jsx13("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
4550
+ 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
4020
4551
  ] }),
4021
4552
  preview: superseded ? item.replacementPreview : item.preview,
4022
4553
  children: [
@@ -4024,21 +4555,21 @@ function MemoryRow({
4024
4555
  // The correction as a before → after: the old memory struck through and
4025
4556
  // dimmed, the new text in the ordinary body weight below it.
4026
4557
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5", children: [
4027
- /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
4028
- /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.replacementPreview })
4558
+ /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
4559
+ /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.replacementPreview })
4029
4560
  ] })
4030
4561
  ) : corrected && item.action === "updated" ? (
4031
4562
  // Edited in place, no replacement record: the memory is still live, so
4032
4563
  // show its current text — NOT the archived treatment.
4033
- /* @__PURE__ */ jsxs10(Fragment4, { children: [
4034
- /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4035
- /* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Updated in place." })
4564
+ /* @__PURE__ */ jsxs10(Fragment5, { children: [
4565
+ /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4566
+ /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Updated in place." })
4036
4567
  ] })
4037
4568
  ) : corrected ? (
4038
4569
  // A correction with no replacement (and not an in-place update) archived the record.
4039
- /* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Archived." })
4040
- ) : /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4041
- item.deduped ? /* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Merged into an existing memory." }) : null,
4570
+ /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Archived." })
4571
+ ) : /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4572
+ item.deduped ? /* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Merged into an existing memory." }) : null,
4042
4573
  deepLink ? /* @__PURE__ */ jsxs10(
4043
4574
  "button",
4044
4575
  {
@@ -4050,7 +4581,7 @@ function MemoryRow({
4050
4581
  ),
4051
4582
  children: [
4052
4583
  "View in memory",
4053
- /* @__PURE__ */ jsx12(ArrowRightIcon, { className: "size-3.5 transition-transform duration-150 group-hover/memlink:translate-x-0.5" })
4584
+ /* @__PURE__ */ jsx13(ArrowRightIcon, { className: "size-3.5 transition-transform duration-150 group-hover/memlink:translate-x-0.5" })
4054
4585
  ]
4055
4586
  }
4056
4587
  ) : null
@@ -4073,7 +4604,7 @@ function SandboxRow({ item }) {
4073
4604
  return /* @__PURE__ */ jsxs10(
4074
4605
  ActivityDisclosure,
4075
4606
  {
4076
- icon: /* @__PURE__ */ jsx12(SquareTerminalIcon, { className: "size-3.5" }),
4607
+ icon: /* @__PURE__ */ jsx13(SquareTerminalIcon, { className: "size-3.5" }),
4077
4608
  iconTone: item.status === "failed" ? "failed" : item.status === "running" ? "running" : "muted",
4078
4609
  title: sandboxRowTitle(item),
4079
4610
  running: item.status === "running",
@@ -4081,8 +4612,8 @@ function SandboxRow({ item }) {
4081
4612
  cancelled: item.status === "cancelled",
4082
4613
  preview: item.command ?? void 0,
4083
4614
  children: [
4084
- item.command ? /* @__PURE__ */ jsx12(PayloadBlock, { label: "Command", value: item.command }) : null,
4085
- item.output ? /* @__PURE__ */ jsx12(PayloadBlock, { label: "Output", value: item.output }) : null
4615
+ item.command ? /* @__PURE__ */ jsx13(PayloadBlock, { label: "Command", value: item.command }) : null,
4616
+ item.output ? /* @__PURE__ */ jsx13(PayloadBlock, { label: "Output", value: item.output }) : null
4086
4617
  ]
4087
4618
  }
4088
4619
  );
@@ -4097,11 +4628,11 @@ function WorkerRow({
4097
4628
  const title = item.action === "spawn" ? running ? "Spawning worker" : failed ? "Worker spawn failed" : cancelled ? "Worker interrupted" : "Worker spawned" : running ? "Messaging worker" : failed ? "Worker message failed" : cancelled ? "Worker interrupted" : "Worker messaged";
4098
4629
  const sessionId = item.workerSessionId;
4099
4630
  const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
4100
- const inner = /* @__PURE__ */ jsxs10(Fragment4, { children: [
4101
- /* @__PURE__ */ jsx12("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
4102
- /* @__PURE__ */ jsx12("span", { className: cn("mt-px shrink-0", failed ? "text-og-status-failed" : "text-og-accent"), children: /* @__PURE__ */ jsx12(BotIcon2, { className: "size-3.5" }) }),
4631
+ const inner = /* @__PURE__ */ jsxs10(Fragment5, { children: [
4632
+ /* @__PURE__ */ jsx13("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
4633
+ /* @__PURE__ */ jsx13("span", { className: cn("mt-px shrink-0", failed ? "text-og-status-failed" : "text-og-accent"), children: /* @__PURE__ */ jsx13(BotIcon2, { className: "size-3.5" }) }),
4103
4634
  /* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
4104
- /* @__PURE__ */ jsx12(
4635
+ /* @__PURE__ */ jsx13(
4105
4636
  "span",
4106
4637
  {
4107
4638
  className: cn(
@@ -4111,12 +4642,12 @@ function WorkerRow({
4111
4642
  children: title
4112
4643
  }
4113
4644
  ),
4114
- item.prompt ? /* @__PURE__ */ jsx12("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null
4645
+ item.prompt ? /* @__PURE__ */ jsx13("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null
4115
4646
  ] }),
4116
4647
  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: [
4117
- /* @__PURE__ */ jsx12("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
4648
+ /* @__PURE__ */ jsx13("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
4118
4649
  "failed"
4119
- ] }) : cancelled ? /* @__PURE__ */ jsx12("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__ */ jsx12(
4650
+ ] }) : 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(
4120
4651
  ArrowRightIcon,
4121
4652
  {
4122
4653
  "aria-hidden": true,
@@ -4125,7 +4656,7 @@ function WorkerRow({
4125
4656
  ) : null
4126
4657
  ] });
4127
4658
  if (deepLink && sessionId && onOpenSession) {
4128
- return /* @__PURE__ */ jsx12(
4659
+ return /* @__PURE__ */ jsx13(
4129
4660
  "button",
4130
4661
  {
4131
4662
  type: "button",
@@ -4139,28 +4670,28 @@ function WorkerRow({
4139
4670
  }
4140
4671
  );
4141
4672
  }
4142
- return /* @__PURE__ */ jsx12("div", { className: "flex items-start gap-2 px-1.5 py-1.5", children: inner });
4673
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-start gap-2 px-1.5 py-1.5", children: inner });
4143
4674
  }
4144
4675
 
4145
4676
  // src/timeline/turn-summary.tsx
4146
4677
  import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
4147
4678
  import {
4148
4679
  Component,
4149
- createContext as createContext6,
4150
- useContext as useContext6,
4151
- useEffect as useEffect7,
4152
- useMemo as useMemo3,
4153
- useRef as useRef7,
4680
+ createContext as createContext7,
4681
+ useContext as useContext7,
4682
+ useEffect as useEffect8,
4683
+ useMemo as useMemo4,
4684
+ useRef as useRef8,
4154
4685
  useState as useState10
4155
4686
  } from "react";
4156
4687
  import { Collapsible } from "radix-ui";
4157
4688
 
4158
4689
  // src/timeline/fold-memory.ts
4159
- import { createContext as createContext5, useContext as useContext5 } from "react";
4160
- var FoldMemoryContext = createContext5(null);
4690
+ import { createContext as createContext6, useContext as useContext6 } from "react";
4691
+ var FoldMemoryContext = createContext6(null);
4161
4692
  var FoldMemoryProvider = FoldMemoryContext.Provider;
4162
4693
  function useFoldMemory() {
4163
- return useContext5(FoldMemoryContext);
4694
+ return useContext6(FoldMemoryContext);
4164
4695
  }
4165
4696
  function inheritFoldRestingState(memory, targetKey, sourceKeys) {
4166
4697
  if (memory.has(targetKey) || sourceKeys.length !== 1) {
@@ -4173,10 +4704,10 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
4173
4704
  }
4174
4705
 
4175
4706
  // src/timeline/turn-summary.tsx
4176
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4177
- var TurnSettleChromeContext = createContext6(false);
4707
+ import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
4708
+ var TurnSettleChromeContext = createContext7(false);
4178
4709
  function useTurnSettleOpen() {
4179
- return useContext6(TurnSettleChromeContext);
4710
+ return useContext7(TurnSettleChromeContext);
4180
4711
  }
4181
4712
  var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
4182
4713
  "steps",
@@ -4214,11 +4745,11 @@ function TurnSummary({
4214
4745
  const [settlePhase, setSettlePhase] = useState10(initialSettle);
4215
4746
  const [nestSuppressLatch, setNestSuppressLatch] = useState10(initialSettle);
4216
4747
  const [expandReady, setExpandReady] = useState10(!initialSettle);
4217
- const settleTimerRef = useRef7(null);
4218
- const settleCloseDoneRef = useRef7(null);
4219
- const nestLatchClearRef = useRef7(null);
4220
- const settleFoldSeenRef = useRef7(Boolean(settleFold));
4221
- const settleArmedRef = useRef7(false);
4748
+ const settleTimerRef = useRef8(null);
4749
+ const settleCloseDoneRef = useRef8(null);
4750
+ const nestLatchClearRef = useRef8(null);
4751
+ const settleFoldSeenRef = useRef8(Boolean(settleFold));
4752
+ const settleArmedRef = useRef8(false);
4222
4753
  const clearNestLatchTimer = () => {
4223
4754
  if (nestLatchClearRef.current !== null) {
4224
4755
  clearTimeout(nestLatchClearRef.current);
@@ -4266,8 +4797,8 @@ function TurnSummary({
4266
4797
  }, SETTLE_COLLAPSE_MS);
4267
4798
  }, SETTLE_FOLD_BEAT_MS);
4268
4799
  };
4269
- const mountSettleRef = useRef7(initialSettle);
4270
- useEffect7(() => {
4800
+ const mountSettleRef = useRef8(initialSettle);
4801
+ useEffect8(() => {
4271
4802
  if (mountSettleRef.current) {
4272
4803
  armSettleCollapse();
4273
4804
  }
@@ -4276,7 +4807,7 @@ function TurnSummary({
4276
4807
  settleArmedRef.current = false;
4277
4808
  };
4278
4809
  }, []);
4279
- useEffect7(() => {
4810
+ useEffect8(() => {
4280
4811
  const was = settleFoldSeenRef.current;
4281
4812
  settleFoldSeenRef.current = Boolean(settleFold);
4282
4813
  if (!was && settleFold) {
@@ -4314,7 +4845,7 @@ function TurnSummary({
4314
4845
  const [allowEnterAnimation] = useState10(
4315
4846
  () => Boolean(enter && !bare && !initialSettle && !restingOpen)
4316
4847
  );
4317
- const context = useMemo3(
4848
+ const context = useMemo4(
4318
4849
  () => createTurnSummaryContext(
4319
4850
  items,
4320
4851
  outcome,
@@ -4324,11 +4855,11 @@ function TurnSummary({
4324
4855
  ),
4325
4856
  [items, outcome, failureText, durationMs, settling, settlePhase, contextCompactionCount]
4326
4857
  );
4327
- const facetDefinitions = useMemo3(
4858
+ const facetDefinitions = useMemo4(
4328
4859
  () => resolveTurnSummaryFacets(facetConfiguration),
4329
4860
  [facetConfiguration]
4330
4861
  );
4331
- const facets = useMemo3(
4862
+ const facets = useMemo4(
4332
4863
  () => facetDefinitions.flatMap((facet) => {
4333
4864
  try {
4334
4865
  const result = facet.summarize(context);
@@ -4344,7 +4875,7 @@ function TurnSummary({
4344
4875
  const copyable = Boolean(
4345
4876
  copyText && copyText.trim().length > 0 && !bare && !liveShell && !open && !settlePhase
4346
4877
  );
4347
- return /* @__PURE__ */ jsx13(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs11("div", { className: cn(copyable && "group/copy relative"), children: [
4878
+ return /* @__PURE__ */ jsx14(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs11("div", { className: cn(copyable && "group/copy relative"), children: [
4348
4879
  /* @__PURE__ */ jsxs11(
4349
4880
  Collapsible.Root,
4350
4881
  {
@@ -4375,7 +4906,7 @@ function TurnSummary({
4375
4906
  liveShell && "text-og-fg-subtle"
4376
4907
  ),
4377
4908
  children: [
4378
- /* @__PURE__ */ jsx13(
4909
+ /* @__PURE__ */ jsx14(
4379
4910
  ChevronRightIcon2,
4380
4911
  {
4381
4912
  className: cn(
@@ -4384,7 +4915,7 @@ function TurnSummary({
4384
4915
  )
4385
4916
  }
4386
4917
  ),
4387
- outcome === "complete" ? null : /* @__PURE__ */ jsx13(
4918
+ outcome === "complete" ? null : /* @__PURE__ */ jsx14(
4388
4919
  "span",
4389
4920
  {
4390
4921
  className: cn(
@@ -4392,7 +4923,7 @@ function TurnSummary({
4392
4923
  bare ? "size-3.5" : "size-5",
4393
4924
  outcome === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"
4394
4925
  ),
4395
- children: outcome === "failed" ? /* @__PURE__ */ jsx13(TriangleAlertIcon2, { className: "size-3" }) : outcome === "cancelled" ? /* @__PURE__ */ jsx13(CircleSlashIcon, { className: "size-3" }) : /* @__PURE__ */ jsx13("span", { className: "size-1.5 animate-og-pulse rounded-full bg-og-fg-subtle" })
4926
+ children: outcome === "failed" ? /* @__PURE__ */ jsx14(TriangleAlertIcon2, { 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" })
4396
4927
  }
4397
4928
  ),
4398
4929
  /* @__PURE__ */ jsxs11(
@@ -4400,10 +4931,10 @@ function TurnSummary({
4400
4931
  {
4401
4932
  className: cn("min-w-0 flex-1 truncate", bare ? "text-og-sm" : "text-og-fg-muted"),
4402
4933
  children: [
4403
- facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx13(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs11(Fragment5, { children: [
4934
+ facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx14(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs11(Fragment6, { children: [
4404
4935
  index > 0 ? " \xB7 " : null,
4405
4936
  /* @__PURE__ */ jsxs11("span", { "aria-label": result.ariaLabel, title: result.title, children: [
4406
- result.icon ? /* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
4937
+ result.icon ? /* @__PURE__ */ jsx14("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
4407
4938
  result.content
4408
4939
  ] })
4409
4940
  ] }) }, facet.id)),
@@ -4411,11 +4942,11 @@ function TurnSummary({
4411
4942
  " \xB7 ",
4412
4943
  failureText
4413
4944
  ] }) : null,
4414
- outcome === "cancelled" ? /* @__PURE__ */ jsx13("span", { className: "text-og-fg-subtle", children: " \xB7 interrupted" }) : null
4945
+ outcome === "cancelled" ? /* @__PURE__ */ jsx14("span", { className: "text-og-fg-subtle", children: " \xB7 interrupted" }) : null
4415
4946
  ]
4416
4947
  }
4417
4948
  ),
4418
- /* @__PURE__ */ jsx13(
4949
+ /* @__PURE__ */ jsx14(
4419
4950
  "span",
4420
4951
  {
4421
4952
  "aria-hidden": true,
@@ -4432,7 +4963,7 @@ function TurnSummary({
4432
4963
  ]
4433
4964
  }
4434
4965
  ),
4435
- /* @__PURE__ */ jsx13(
4966
+ /* @__PURE__ */ jsx14(
4436
4967
  Collapsible.Content,
4437
4968
  {
4438
4969
  ...nestSuppressLatch ? { forceMount: true } : {},
@@ -4443,13 +4974,13 @@ function TurnSummary({
4443
4974
  // Auto-close: slow settle. Manual close (settlePhase cleared): fast.
4444
4975
  settlePhase ? "data-[state=closed]:animate-og-settle-collapse" : "data-[state=closed]:animate-og-collapse"
4445
4976
  ),
4446
- children: /* @__PURE__ */ jsx13("div", { className: bare ? "pt-1 pl-5" : "pt-2", children })
4977
+ children: /* @__PURE__ */ jsx14("div", { className: bare ? "pt-1 pl-5" : "pt-2", children })
4447
4978
  }
4448
4979
  )
4449
4980
  ]
4450
4981
  }
4451
4982
  ),
4452
- copyable ? /* @__PURE__ */ jsx13("div", { className: "pointer-events-none absolute top-1.5 right-0 z-10", children: /* @__PURE__ */ jsx13("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx13(CopyButton, { text: copyText, label: "Copy turn", reveal: "group-hover" }) }) }) : null
4983
+ copyable ? /* @__PURE__ */ jsx14("div", { className: "pointer-events-none absolute top-1.5 right-0 z-10", children: /* @__PURE__ */ jsx14("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx14(CopyButton, { text: copyText, label: "Copy turn", reveal: "group-hover" }) }) }) : null
4453
4984
  ] }) });
4454
4985
  }
4455
4986
  function createTurnSummaryContext(items, outcome, failureText, durationMs, contextCompactionCount) {
@@ -4602,7 +5133,7 @@ function formatDurationFacet(durationMs) {
4602
5133
  }
4603
5134
 
4604
5135
  // src/components/session-status.tsx
4605
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
5136
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
4606
5137
  var SESSION_STATUS_META = {
4607
5138
  queued: {
4608
5139
  label: "Queued",
@@ -4666,7 +5197,7 @@ function SessionStatus({ status, label, size = "md", className }) {
4666
5197
  className
4667
5198
  ),
4668
5199
  children: [
4669
- /* @__PURE__ */ jsx14(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
5200
+ /* @__PURE__ */ jsx15(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
4670
5201
  label ?? meta.label
4671
5202
  ]
4672
5203
  }
@@ -4674,7 +5205,7 @@ function SessionStatus({ status, label, size = "md", className }) {
4674
5205
  }
4675
5206
  function StatusDot({ status, className }) {
4676
5207
  const meta = SESSION_STATUS_META[status];
4677
- return /* @__PURE__ */ jsx14(
5208
+ return /* @__PURE__ */ jsx15(
4678
5209
  "span",
4679
5210
  {
4680
5211
  className: cn(
@@ -4682,7 +5213,7 @@ function StatusDot({ status, className }) {
4682
5213
  meta.dotClassName,
4683
5214
  className
4684
5215
  ),
4685
- children: meta.pulse ? /* @__PURE__ */ jsx14("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
5216
+ children: meta.pulse ? /* @__PURE__ */ jsx15("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
4686
5217
  }
4687
5218
  );
4688
5219
  }
@@ -4713,10 +5244,10 @@ import {
4713
5244
  Component as Component2,
4714
5245
  memo as memo2,
4715
5246
  useCallback as useCallback2,
4716
- useEffect as useEffect8,
5247
+ useEffect as useEffect9,
4717
5248
  useLayoutEffect as useLayoutEffect3,
4718
- useMemo as useMemo4,
4719
- useRef as useRef8,
5249
+ useMemo as useMemo5,
5250
+ useRef as useRef9,
4720
5251
  useState as useState11
4721
5252
  } from "react";
4722
5253
 
@@ -4740,6 +5271,7 @@ var TIP_FOLLOW_VELOCITY_REF_PX_S = _s(420);
4740
5271
  var TIP_FOLLOW_VELOCITY_ARM_DEBT_PX = 72;
4741
5272
  var TIP_FOLLOW_VELOCITY_DECAY_MS = _t(180);
4742
5273
  var TIP_FOLLOW_READER_UP_EPS_PX = 2;
5274
+ var TIP_FOLLOW_QUANTIZE_WINDOW_PX = 1;
4743
5275
  var scrollEndSupportOverride = null;
4744
5276
  function supportsScrollEndEvent() {
4745
5277
  if (scrollEndSupportOverride !== null) {
@@ -4758,9 +5290,11 @@ function createTipFollowState() {
4758
5290
  hotUntil: 0,
4759
5291
  lastTs: 0,
4760
5292
  lastHeight: 0,
5293
+ lastClientHeight: 0,
4761
5294
  lastGrowthAt: 0,
4762
5295
  growthVelocity: 0,
4763
- scrollVelocity: 0
5296
+ scrollVelocity: 0,
5297
+ cameraTop: null
4764
5298
  };
4765
5299
  }
4766
5300
  function tipFollowCancel(state) {
@@ -4768,7 +5302,8 @@ function tipFollowCancel(state) {
4768
5302
  ...state,
4769
5303
  running: false,
4770
5304
  lastTs: 0,
4771
- scrollVelocity: 0
5305
+ scrollVelocity: 0,
5306
+ cameraTop: null
4772
5307
  };
4773
5308
  }
4774
5309
  function tipFollowNoteGrowth(state, height, now) {
@@ -4793,6 +5328,34 @@ function tipFollowNoteGrowth(state, height, now) {
4793
5328
  hotUntil: now + TIP_FOLLOW_HOT_IDLE_MS
4794
5329
  };
4795
5330
  }
5331
+ function tipFollowNoteViewportShrink(state, clientHeight, now) {
5332
+ const previous = state.lastClientHeight;
5333
+ if (previous <= 0) {
5334
+ return { ...state, lastClientHeight: clientHeight };
5335
+ }
5336
+ const shrink = previous - clientHeight;
5337
+ if (shrink <= 0) {
5338
+ return { ...state, lastClientHeight: clientHeight };
5339
+ }
5340
+ if (shrink <= TIP_FOLLOW_SHRINK_EPS_PX) {
5341
+ return state;
5342
+ }
5343
+ const dt = state.lastGrowthAt > 0 ? now - state.lastGrowthAt : 0;
5344
+ let growthVelocity = state.growthVelocity;
5345
+ if (dt > 0) {
5346
+ const instant = shrink / dt * 1e3;
5347
+ growthVelocity = growthVelocity * 0.65 + instant * 0.35;
5348
+ } else {
5349
+ growthVelocity = Math.max(growthVelocity, shrink * (1e3 / TIP_FOLLOW_HOT_IDLE_MS));
5350
+ }
5351
+ return {
5352
+ ...state,
5353
+ lastClientHeight: clientHeight,
5354
+ lastGrowthAt: now,
5355
+ growthVelocity,
5356
+ hotUntil: now + TIP_FOLLOW_HOT_IDLE_MS
5357
+ };
5358
+ }
4796
5359
  function tipFollowTauMs(debtPx, growthVelocityPxPerSec = 0, settling = false, hot = false) {
4797
5360
  if (settling) {
4798
5361
  return TIP_FOLLOW_SETTLE_TAU_MS;
@@ -4843,14 +5406,40 @@ function tipFollowCompensateShrink(scrollTop, previousHeight, nextHeight, client
4843
5406
  const maxScroll = Math.max(0, nextHeight - clientHeight);
4844
5407
  return Math.max(0, Math.min(maxScroll, scrollTop - delta));
4845
5408
  }
5409
+ function tipFollowCompensateViewportShrink(scrollTop, previousClientHeight, nextClientHeight, scrollHeight, epsPx = TIP_FOLLOW_SHRINK_EPS_PX) {
5410
+ if (previousClientHeight <= 0) {
5411
+ return scrollTop;
5412
+ }
5413
+ const shrink = previousClientHeight - nextClientHeight;
5414
+ if (shrink <= epsPx) {
5415
+ return scrollTop;
5416
+ }
5417
+ const maxScroll = Math.max(0, scrollHeight - nextClientHeight);
5418
+ return Math.max(0, Math.min(maxScroll, scrollTop + shrink));
5419
+ }
4846
5420
  function tipFollowStep(state, input) {
4847
5421
  const { scrollTop, scrollHeight, clientHeight, now, pinned, reducedMotion, revealed } = input;
4848
5422
  const previousHeight = state.lastHeight;
5423
+ const previousClient = state.lastClientHeight;
4849
5424
  const frameGrowth = previousHeight > 0 && scrollHeight > previousHeight ? scrollHeight - previousHeight : 0;
4850
- const grew = frameGrowth > 0;
5425
+ const frameViewportShrink = previousClient > 0 && clientHeight < previousClient - TIP_FOLLOW_SHRINK_EPS_PX ? previousClient - clientHeight : 0;
5426
+ const grew = frameGrowth > 0 || frameViewportShrink > 0;
4851
5427
  let noted = tipFollowNoteGrowth(state, scrollHeight, now);
5428
+ noted = tipFollowNoteViewportShrink(noted, clientHeight, now);
5429
+ let cameraTop = scrollTop;
5430
+ if (state.cameraTop !== null && Math.abs(state.cameraTop - scrollTop) <= TIP_FOLLOW_QUANTIZE_WINDOW_PX) {
5431
+ cameraTop = state.cameraTop;
5432
+ }
5433
+ if (pinned && frameViewportShrink > 0) {
5434
+ cameraTop = tipFollowCompensateViewportShrink(
5435
+ cameraTop,
5436
+ previousClient,
5437
+ clientHeight,
5438
+ scrollHeight
5439
+ );
5440
+ }
4852
5441
  const target = targetScrollTop(scrollHeight, clientHeight);
4853
- const debt = target - scrollTop;
5442
+ const debt = target - cameraTop;
4854
5443
  const hot = now < noted.hotUntil;
4855
5444
  const settling = !hot && Math.abs(debt) < TIP_FOLLOW_CATCHUP_DEBT_PX;
4856
5445
  if (!pinned) {
@@ -4881,7 +5470,7 @@ function tipFollowStep(state, input) {
4881
5470
  }
4882
5471
  if (Math.abs(debt) <= 0.75) {
4883
5472
  return {
4884
- scrollTop: Math.abs(debt) > 0 ? target : scrollTop,
5473
+ scrollTop: Math.abs(debt) > 0 ? target : cameraTop,
4885
5474
  state: {
4886
5475
  ...tipFollowCancel(noted),
4887
5476
  growthVelocity: hot ? noted.growthVelocity : 0
@@ -4895,12 +5484,18 @@ function tipFollowStep(state, input) {
4895
5484
  const accelTauSec = Math.max(tauSec * TIP_FOLLOW_ACCEL_TAU_FRAC, 0.02);
4896
5485
  const velAlpha = 1 - Math.exp(-dtSec / accelTauSec);
4897
5486
  let scrollVelocity = (noted.scrollVelocity ?? 0) + (desiredVel - (noted.scrollVelocity ?? 0)) * velAlpha;
4898
- const maxStep = tipFollowMaxStepPx(debt, noted.growthVelocity, dt, frameGrowth, hot);
5487
+ const maxStep = tipFollowMaxStepPx(
5488
+ debt,
5489
+ noted.growthVelocity,
5490
+ dt,
5491
+ frameGrowth + frameViewportShrink,
5492
+ hot
5493
+ );
4899
5494
  const maxVel = maxStep / dtSec;
4900
5495
  if (Math.abs(scrollVelocity) > maxVel) {
4901
5496
  scrollVelocity = Math.sign(scrollVelocity) * maxVel;
4902
5497
  }
4903
- let next = scrollTop + scrollVelocity * dtSec;
5498
+ let next = cameraTop + scrollVelocity * dtSec;
4904
5499
  if (debt > 0 && next >= target - 0.35) {
4905
5500
  next = target;
4906
5501
  scrollVelocity = 0;
@@ -4909,19 +5504,80 @@ function tipFollowStep(state, input) {
4909
5504
  scrollVelocity = 0;
4910
5505
  }
4911
5506
  next = Math.max(0, next);
5507
+ const running = Math.abs(target - next) > 0.35 || Math.abs(scrollVelocity) > 1;
4912
5508
  return {
4913
5509
  scrollTop: next,
4914
5510
  state: {
4915
5511
  ...noted,
4916
5512
  scrollVelocity,
4917
- running: Math.abs(target - next) > 0.35 || Math.abs(scrollVelocity) > 1,
4918
- lastTs: now
5513
+ running,
5514
+ lastTs: now,
5515
+ // Carry the fraction the DOM will floor away; drop it once landed.
5516
+ cameraTop: running ? next : null
4919
5517
  }
4920
5518
  };
4921
5519
  }
4922
5520
 
5521
+ // src/components/machine-input-display.ts
5522
+ var MACHINE_INPUT_META = {
5523
+ scheduled_occurrence: "Scheduled update",
5524
+ goal_continuation: "Goal continued",
5525
+ agent_message: "Agent update",
5526
+ agent_steer_instruction: "Agent direction",
5527
+ child_terminal_result: "Agent finished"
5528
+ };
5529
+ function machineInputBatchLabel(members) {
5530
+ if (members.length === 0) return "Updates";
5531
+ const counts = /* @__PURE__ */ new Map();
5532
+ for (const member of members) {
5533
+ counts.set(member.kind, (counts.get(member.kind) ?? 0) + 1);
5534
+ }
5535
+ if (counts.size === 1) {
5536
+ const kind = members[0].kind;
5537
+ const n = members.length;
5538
+ switch (kind) {
5539
+ case "child_terminal_result":
5540
+ return n === 1 ? "Agent finished" : `${n} agents finished`;
5541
+ case "goal_continuation":
5542
+ return n === 1 ? "Goal continued" : `${n} goal continuations`;
5543
+ case "scheduled_occurrence":
5544
+ return n === 1 ? "Scheduled update" : `${n} scheduled updates`;
5545
+ case "agent_message":
5546
+ return n === 1 ? "Agent update" : `${n} agent updates`;
5547
+ case "agent_steer_instruction":
5548
+ return n === 1 ? "Agent direction" : `${n} agent directions`;
5549
+ }
5550
+ }
5551
+ const parts = [...counts.entries()].map(([kind, count]) => {
5552
+ const label = MACHINE_INPUT_META[kind];
5553
+ return count === 1 ? label : `${count}\xD7 ${label}`;
5554
+ });
5555
+ const preview = parts.slice(0, 2).join(", ");
5556
+ const suffix = parts.length > 2 ? ", \u2026" : "";
5557
+ return `${members.length} updates \xB7 ${preview}${suffix}`;
5558
+ }
5559
+ function cleanMachineInputSummary(summary) {
5560
+ return summary.replace(/^\[[A-Z][A-Z _-]*(?:\s+\d+\/\d+)?\]\s*/, "").replace(/\bWorker session id:\s*[0-9a-f]{8}-[0-9a-f-]{27,}\b/gi, "").replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, "").replace(/\(\s*\)/g, "").replace(/\s*[·|]\s*$/g, "").replace(/\s{2,}/g, " ").replace(/\s+([.,;:])/g, "$1").trim();
5561
+ }
5562
+ function readableMachineInputSource(sourceId) {
5563
+ const value = sourceId.trim();
5564
+ if (!value || /^[0-9a-f]{8}-[0-9a-f-]{27,}$/i.test(value)) return null;
5565
+ if (/^(goal|schedule|system):/i.test(value)) return null;
5566
+ return value.replaceAll("_", " ");
5567
+ }
5568
+ function machineInputSummaryIsUseful(kind, cleanedSummary) {
5569
+ if (!cleanedSummary) return false;
5570
+ const label = MACHINE_INPUT_META[kind].toLowerCase();
5571
+ const text = cleanedSummary.toLowerCase();
5572
+ if (text === label || text === `${label}.`) return false;
5573
+ if (kind === "child_terminal_result" && /^a worker session you spawned has finished/i.test(cleanedSummary)) {
5574
+ return false;
5575
+ }
5576
+ return true;
5577
+ }
5578
+
4923
5579
  // src/components/message-timeline.tsx
4924
- import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
5580
+ import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
4925
5581
  var PIN_THRESHOLD_PX = 48;
4926
5582
  var OLDER_PREFETCH_MARGIN_PX = 400;
4927
5583
  var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
@@ -4970,6 +5626,7 @@ function MessageTimeline({
4970
5626
  onReconnect,
4971
5627
  resolveProviderLogo,
4972
5628
  toolRegistry = defaultToolRegistry,
5629
+ computeLabel = null,
4973
5630
  turnSummary,
4974
5631
  autoFollow = true,
4975
5632
  hasOlder = false,
@@ -4984,41 +5641,41 @@ function MessageTimeline({
4984
5641
  emptyState,
4985
5642
  className
4986
5643
  }) {
4987
- const resolvedItems = useMemo4(() => items ?? buildTimeline(events ?? []), [items, events]);
4988
- const allGroups = useMemo4(() => groupTimeline(resolvedItems), [resolvedItems]);
5644
+ const resolvedItems = useMemo5(() => items ?? buildTimeline(events ?? []), [items, events]);
5645
+ const allGroups = useMemo5(() => groupTimeline(resolvedItems), [resolvedItems]);
4989
5646
  const groups = useStableTimelineGroupKeys(allGroups);
4990
- const scrollRef = useRef8(null);
4991
- const topSentinelRef = useRef8(null);
4992
- const bottomSentinelRef = useRef8(null);
4993
- const previousBulkFirstKeyRef = useRef8(void 0);
5647
+ const scrollRef = useRef9(null);
5648
+ const topSentinelRef = useRef9(null);
5649
+ const bottomSentinelRef = useRef9(null);
5650
+ const previousBulkFirstKeyRef = useRef9(void 0);
4994
5651
  const [pinned, setPinned] = useState11(true);
4995
5652
  const [bulkActive, setBulkActive] = useState11(true);
4996
- const olderPrefetchArmedRef = useRef8(false);
5653
+ const olderPrefetchArmedRef = useRef9(false);
4997
5654
  const [olderPrefetchArmed, setOlderPrefetchArmed] = useState11(false);
4998
- const olderLoadGateRef = useRef8("armed");
4999
- const resizeFollowRafRef = useRef8(null);
5655
+ const olderLoadGateRef = useRef9("armed");
5656
+ const resizeFollowRafRef = useRef9(null);
5000
5657
  const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
5001
5658
  const [revealed, setRevealed] = useState11(false);
5002
- const pinnedRef = useRef8(true);
5003
- const hasNewerRef = useRef8(hasNewer);
5659
+ const pinnedRef = useRef9(true);
5660
+ const hasNewerRef = useRef9(hasNewer);
5004
5661
  hasNewerRef.current = hasNewer;
5005
- const wantPinRef = useRef8(false);
5006
- const pendingJumpToStartRef = useRef8(false);
5007
- const jumpToStartSeqRef = useRef8(0);
5008
- const previousFirstItemIdRef = useRef8(null);
5009
- const previousScrollHeightRef = useRef8(0);
5010
- const lastScrollTopRef = useRef8(0);
5011
- const lastMaxScrollRef = useRef8(0);
5012
- const lastScrollHeightRef = useRef8(0);
5013
- const lastClientHeightRef = useRef8(0);
5014
- const readerIntentArmRef = useRef8(false);
5015
- const programmaticScrollRef = useRef8(0);
5016
- const pendingReaderLeaveRef = useRef8(false);
5017
- const leaveFallbackRafRef = useRef8(null);
5018
- const foldMemoryRef = useRef8(/* @__PURE__ */ new Map());
5019
- const seenActivityIdsRef = useRef8(/* @__PURE__ */ new Set());
5020
- const groupKeyByItemIdRef = useRef8(/* @__PURE__ */ new Map());
5021
- const groupOffsetByKeyRef = useRef8(/* @__PURE__ */ new Map());
5662
+ const wantPinRef = useRef9(false);
5663
+ const pendingJumpToStartRef = useRef9(false);
5664
+ const jumpToStartSeqRef = useRef9(0);
5665
+ const previousFirstItemIdRef = useRef9(null);
5666
+ const previousScrollHeightRef = useRef9(0);
5667
+ const lastScrollTopRef = useRef9(0);
5668
+ const lastMaxScrollRef = useRef9(0);
5669
+ const lastScrollHeightRef = useRef9(0);
5670
+ const lastClientHeightRef = useRef9(0);
5671
+ const readerIntentArmRef = useRef9(false);
5672
+ const programmaticScrollRef = useRef9(0);
5673
+ const pendingReaderLeaveRef = useRef9(false);
5674
+ const leaveFallbackRafRef = useRef9(null);
5675
+ const foldMemoryRef = useRef9(/* @__PURE__ */ new Map());
5676
+ const seenActivityIdsRef = useRef9(/* @__PURE__ */ new Set());
5677
+ const groupKeyByItemIdRef = useRef9(/* @__PURE__ */ new Map());
5678
+ const groupOffsetByKeyRef = useRef9(/* @__PURE__ */ new Map());
5022
5679
  const firstItemId = resolvedItems[0]?.id ?? null;
5023
5680
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
5024
5681
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
@@ -5028,10 +5685,10 @@ function MessageTimeline({
5028
5685
  setPinned(value);
5029
5686
  }
5030
5687
  }, []);
5031
- const revealedRef = useRef8(revealed);
5688
+ const revealedRef = useRef9(revealed);
5032
5689
  revealedRef.current = revealed;
5033
- const followRef = useRef8(createTipFollowState());
5034
- const followFrameRef = useRef8(null);
5690
+ const followRef = useRef9(createTipFollowState());
5691
+ const followFrameRef = useRef9(null);
5035
5692
  const syncScrollBaseline = useCallback2((node) => {
5036
5693
  lastScrollTopRef.current = node.scrollTop;
5037
5694
  lastMaxScrollRef.current = maxScrollOf(node);
@@ -5040,11 +5697,15 @@ function MessageTimeline({
5040
5697
  }, []);
5041
5698
  const writeScrollTop = useCallback2((node, top) => {
5042
5699
  const next = Math.max(0, top);
5043
- if (node.scrollTop === next) {
5700
+ const before = node.scrollTop;
5701
+ if (before === next) {
5044
5702
  return;
5045
5703
  }
5046
5704
  programmaticScrollRef.current += 1;
5047
5705
  node.scrollTop = next;
5706
+ if (node.scrollTop === before) {
5707
+ programmaticScrollRef.current -= 1;
5708
+ }
5048
5709
  }, []);
5049
5710
  const cancelLeaveFallback = useCallback2(() => {
5050
5711
  if (leaveFallbackRafRef.current !== null) {
@@ -5157,12 +5818,14 @@ function MessageTimeline({
5157
5818
  syncScrollBaseline(node);
5158
5819
  followRef.current = {
5159
5820
  ...followRef.current,
5160
- lastHeight: node.scrollHeight
5821
+ lastHeight: node.scrollHeight,
5822
+ lastClientHeight: node.clientHeight,
5823
+ cameraTop: null
5161
5824
  };
5162
5825
  },
5163
5826
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
5164
5827
  );
5165
- const driveFollowRef = useRef8(() => void 0);
5828
+ const driveFollowRef = useRef9(() => void 0);
5166
5829
  const driveFollow = useCallback2(
5167
5830
  (node, nowMs) => {
5168
5831
  if (!pinnedRef.current || hasNewerRef.current) {
@@ -5177,19 +5840,31 @@ function MessageTimeline({
5177
5840
  const now = typeof nowMs === "number" ? nowMs : typeof performance !== "undefined" ? performance.now() : Date.now();
5178
5841
  const previousHeight = followRef.current.lastHeight;
5179
5842
  if (previousHeight > 0 && node.scrollHeight < previousHeight - TIP_FOLLOW_SHRINK_EPS_PX) {
5180
- const nextTop = tipFollowCompensateShrink(
5843
+ let nextTop = tipFollowCompensateShrink(
5181
5844
  lastScrollTopRef.current,
5182
5845
  previousHeight,
5183
5846
  node.scrollHeight,
5184
5847
  node.clientHeight
5185
5848
  );
5849
+ const previousClient = followRef.current.lastClientHeight;
5850
+ if (previousClient > 0 && node.clientHeight < previousClient - TIP_FOLLOW_SHRINK_EPS_PX) {
5851
+ nextTop = tipFollowCompensateViewportShrink(
5852
+ nextTop,
5853
+ previousClient,
5854
+ node.clientHeight,
5855
+ node.scrollHeight
5856
+ );
5857
+ }
5186
5858
  writeScrollTop(node, nextTop);
5187
5859
  syncScrollBaseline(node);
5188
5860
  followRef.current = {
5189
5861
  ...followRef.current,
5190
5862
  lastHeight: node.scrollHeight,
5863
+ lastClientHeight: node.clientHeight,
5191
5864
  running: true,
5192
- lastTs: now
5865
+ lastTs: now,
5866
+ // A direct glue write re-based the camera — drop any stale fraction.
5867
+ cameraTop: null
5193
5868
  };
5194
5869
  if (followFrameRef.current === null) {
5195
5870
  followFrameRef.current = requestFrame((frameNow) => {
@@ -5239,8 +5914,8 @@ function MessageTimeline({
5239
5914
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
5240
5915
  );
5241
5916
  driveFollowRef.current = driveFollow;
5242
- useEffect8(() => stopFollow, [stopFollow]);
5243
- useEffect8(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
5917
+ useEffect9(() => stopFollow, [stopFollow]);
5918
+ useEffect9(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
5244
5919
  useLayoutEffect3(() => {
5245
5920
  const node = scrollRef.current;
5246
5921
  if (!node) {
@@ -5391,7 +6066,7 @@ function MessageTimeline({
5391
6066
  const frame = requestFrame(() => setBulkActive(false));
5392
6067
  return () => cancelFrame(frame);
5393
6068
  }, [bulkRender, firstGroupKey]);
5394
- useEffect8(() => {
6069
+ useEffect9(() => {
5395
6070
  const root = scrollRef.current;
5396
6071
  const target = topSentinelRef.current;
5397
6072
  if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
@@ -5415,7 +6090,7 @@ function MessageTimeline({
5415
6090
  observer.observe(target);
5416
6091
  return () => observer.disconnect();
5417
6092
  }, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
5418
- useEffect8(() => {
6093
+ useEffect9(() => {
5419
6094
  const root = scrollRef.current;
5420
6095
  const target = bottomSentinelRef.current;
5421
6096
  if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
@@ -5432,7 +6107,7 @@ function MessageTimeline({
5432
6107
  observer.observe(target);
5433
6108
  return () => observer.disconnect();
5434
6109
  }, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
5435
- useEffect8(() => {
6110
+ useEffect9(() => {
5436
6111
  const node = scrollRef.current;
5437
6112
  const inner = node?.firstElementChild;
5438
6113
  if (!node || !inner || typeof ResizeObserver === "undefined") {
@@ -5468,7 +6143,7 @@ function MessageTimeline({
5468
6143
  }
5469
6144
  };
5470
6145
  }, [autoFollow, driveFollow, snapToBottom]);
5471
- useEffect8(() => {
6146
+ useEffect9(() => {
5472
6147
  if (hasNewer) {
5473
6148
  stopFollow();
5474
6149
  applyPinned(false);
@@ -5509,7 +6184,9 @@ function MessageTimeline({
5509
6184
  programmaticScrollRef.current = 0;
5510
6185
  }
5511
6186
  if (autoFollow && pinnedRef.current && !hasNewer) {
5512
- if (heightShrunk || maxFell) {
6187
+ const previousClient = followRef.current.lastClientHeight;
6188
+ const viewportShrunk = previousClient > 0 && node.clientHeight < previousClient - TIP_FOLLOW_SHRINK_EPS_PX;
6189
+ if (heightShrunk || maxFell || viewportShrunk) {
5513
6190
  readerIntentArmRef.current = false;
5514
6191
  clearPendingReaderLeave();
5515
6192
  driveFollow(node);
@@ -5517,10 +6194,6 @@ function MessageTimeline({
5517
6194
  }
5518
6195
  if (programmatic) {
5519
6196
  syncScrollBaseline(node);
5520
- followRef.current = {
5521
- ...followRef.current,
5522
- lastHeight: nextHeight
5523
- };
5524
6197
  return;
5525
6198
  }
5526
6199
  syncScrollBaseline(node);
@@ -5543,11 +6216,6 @@ function MessageTimeline({
5543
6216
  } else if (!nearBottomPinned && readerUp > TIP_FOLLOW_READER_UP_EPS_PX) {
5544
6217
  pendingReaderLeaveRef.current = true;
5545
6218
  scheduleLeaveFallback();
5546
- } else {
5547
- followRef.current = {
5548
- ...followRef.current,
5549
- lastHeight: nextHeight
5550
- };
5551
6219
  }
5552
6220
  return;
5553
6221
  }
@@ -5585,8 +6253,8 @@ function MessageTimeline({
5585
6253
  }
5586
6254
  releasePinAfterScrollSettled(node);
5587
6255
  };
5588
- return /* @__PURE__ */ jsx15(LightboxProvider, { children: /* @__PURE__ */ jsx15(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx15(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx15(EntranceAnimationProvider, { value: !bulkRender, children: /* @__PURE__ */ jsx15(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsxs13("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
5589
- /* @__PURE__ */ jsx15(
6256
+ return /* @__PURE__ */ jsx16(LightboxProvider, { children: /* @__PURE__ */ jsx16(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx16(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx16(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx16(EntranceAnimationProvider, { value: !bulkRender, children: /* @__PURE__ */ jsx16(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsxs13("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
6257
+ /* @__PURE__ */ jsx16(
5590
6258
  "div",
5591
6259
  {
5592
6260
  ref: scrollRef,
@@ -5604,11 +6272,11 @@ function MessageTimeline({
5604
6272
  autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
5605
6273
  ),
5606
6274
  children: /* @__PURE__ */ jsxs13("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
5607
- groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx15("p", { className: "py-10 text-center text-sm text-og-fg-subtle", children: "No activity yet." }) : null,
6275
+ groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx16("p", { className: "py-10 text-center text-sm text-og-fg-subtle", children: "No activity yet." }) : null,
5608
6276
  hasOlder && olderPrefetchArmed ? (
5609
6277
  // Overlaid, not a layout row: mounting/unmounting the sentinel
5610
6278
  // must never shift content (that shift was itself a wobble).
5611
- /* @__PURE__ */ jsx15(
6279
+ /* @__PURE__ */ jsx16(
5612
6280
  "div",
5613
6281
  {
5614
6282
  ref: topSentinelRef,
@@ -5622,7 +6290,7 @@ function MessageTimeline({
5622
6290
  groups.map(({ group, key }, index) => {
5623
6291
  const next = groups[index + 1]?.group;
5624
6292
  const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && next?.kind === "item" && next.item.kind === "context-compaction" && next.item.phase === "compacted" ? 1 : 0;
5625
- return /* @__PURE__ */ jsx15("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx15(
6293
+ return /* @__PURE__ */ jsx16("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx16(
5626
6294
  TimelineGroupRenderBoundary,
5627
6295
  {
5628
6296
  resetKeys: [
@@ -5635,7 +6303,7 @@ function MessageTimeline({
5635
6303
  toolRegistry,
5636
6304
  turnSummary
5637
6305
  ],
5638
- children: /* @__PURE__ */ jsx15(
6306
+ children: /* @__PURE__ */ jsx16(
5639
6307
  TimelineGroupView,
5640
6308
  {
5641
6309
  group,
@@ -5654,7 +6322,7 @@ function MessageTimeline({
5654
6322
  }
5655
6323
  ) }, key);
5656
6324
  }),
5657
- hasNewer ? /* @__PURE__ */ jsx15(
6325
+ hasNewer ? /* @__PURE__ */ jsx16(
5658
6326
  "div",
5659
6327
  {
5660
6328
  ref: bottomSentinelRef,
@@ -5667,7 +6335,7 @@ function MessageTimeline({
5667
6335
  ] })
5668
6336
  }
5669
6337
  ),
5670
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
6338
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
5671
6339
  // Floating over the scroller (not a timeline row) so showing and
5672
6340
  // hiding it never reflows history under the reader.
5673
6341
  /* @__PURE__ */ jsxs13(
@@ -5681,7 +6349,7 @@ function MessageTimeline({
5681
6349
  "aria-live": "polite",
5682
6350
  className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
5683
6351
  children: [
5684
- loadingOlder || loadingOldest ? /* @__PURE__ */ jsx15("span", { className: "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-xs font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx15("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
6352
+ loadingOlder || loadingOldest ? /* @__PURE__ */ jsx16("span", { className: "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-xs font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx16("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
5685
6353
  hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs13(
5686
6354
  "button",
5687
6355
  {
@@ -5718,7 +6386,7 @@ function MessageTimeline({
5718
6386
  "hover:border-og-border-strong disabled:opacity-60"
5719
6387
  ),
5720
6388
  children: [
5721
- /* @__PURE__ */ jsx15(ArrowUpToLineIcon, { className: "size-3.5" }),
6389
+ /* @__PURE__ */ jsx16(ArrowUpToLineIcon, { className: "size-3.5" }),
5722
6390
  "Jump to start"
5723
6391
  ]
5724
6392
  }
@@ -5727,7 +6395,7 @@ function MessageTimeline({
5727
6395
  }
5728
6396
  )
5729
6397
  ) : null }),
5730
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx15(
6398
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx16(
5731
6399
  motion3.div,
5732
6400
  {
5733
6401
  initial: { opacity: 0, y: 6 },
@@ -5737,10 +6405,10 @@ function MessageTimeline({
5737
6405
  "data-og-loading-newer": "",
5738
6406
  "aria-live": "polite",
5739
6407
  className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
5740
- children: /* @__PURE__ */ jsx15("span", { className: "inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-xs font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx15("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
6408
+ children: /* @__PURE__ */ jsx16("span", { className: "inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-xs font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx16("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
5741
6409
  }
5742
6410
  ) : null }),
5743
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs13(
6411
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs13(
5744
6412
  motion3.button,
5745
6413
  {
5746
6414
  type: "button",
@@ -5784,16 +6452,16 @@ function MessageTimeline({
5784
6452
  "hover:border-og-border-strong"
5785
6453
  ),
5786
6454
  children: [
5787
- /* @__PURE__ */ jsx15(ArrowDownIcon2, { className: "size-3.5" }),
6455
+ /* @__PURE__ */ jsx16(ArrowDownIcon2, { className: "size-3.5" }),
5788
6456
  "Jump to latest"
5789
6457
  ]
5790
6458
  }
5791
6459
  ) : null })
5792
- ] }) }) }) }) }) });
6460
+ ] }) }) }) }) }) }) });
5793
6461
  }
5794
6462
  function useStableTimelineGroupKeys(allGroups) {
5795
- const previousRef = useRef8([]);
5796
- const keyedGroups = useMemo4(() => {
6463
+ const previousRef = useRef9([]);
6464
+ const keyedGroups = useMemo5(() => {
5797
6465
  const previousByItemId = /* @__PURE__ */ new Map();
5798
6466
  for (const previous of previousRef.current) {
5799
6467
  for (const itemId of timelineGroupItemIds(previous.group)) {
@@ -5866,10 +6534,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
5866
6534
  role: "status",
5867
6535
  className: "flex items-start gap-2 rounded-lg border border-og-border bg-og-surface-muted px-3 py-2 text-sm text-og-fg-muted",
5868
6536
  children: [
5869
- /* @__PURE__ */ jsx15(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
6537
+ /* @__PURE__ */ jsx16(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
5870
6538
  /* @__PURE__ */ jsxs13("div", { children: [
5871
- /* @__PURE__ */ jsx15("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
5872
- /* @__PURE__ */ jsx15("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
6539
+ /* @__PURE__ */ jsx16("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
6540
+ /* @__PURE__ */ jsx16("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
5873
6541
  ] })
5874
6542
  ]
5875
6543
  }
@@ -5912,7 +6580,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5912
6580
  if (insideTurn) {
5913
6581
  const useNestedChip = nestClusterChips && activityShouldFold;
5914
6582
  if (!useNestedChip) {
5915
- return /* @__PURE__ */ jsx15(
6583
+ return /* @__PURE__ */ jsx16(
5916
6584
  ActivityRail,
5917
6585
  {
5918
6586
  items: group.items,
@@ -5923,7 +6591,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5923
6591
  }
5924
6592
  );
5925
6593
  }
5926
- return /* @__PURE__ */ jsx15(
6594
+ return /* @__PURE__ */ jsx16(
5927
6595
  TurnSummary,
5928
6596
  {
5929
6597
  items: group.items,
@@ -5934,7 +6602,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5934
6602
  foldKey: group.id,
5935
6603
  facets: turnSummary?.facets,
5936
6604
  contextCompactionCount,
5937
- children: /* @__PURE__ */ jsx15(
6605
+ children: /* @__PURE__ */ jsx16(
5938
6606
  ActivityRail,
5939
6607
  {
5940
6608
  items: group.items,
@@ -5948,7 +6616,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5948
6616
  settleChrome ? "settle" : "rest"
5949
6617
  );
5950
6618
  }
5951
- return /* @__PURE__ */ jsx15(
6619
+ return /* @__PURE__ */ jsx16(
5952
6620
  TurnSummary,
5953
6621
  {
5954
6622
  items: group.items,
@@ -5959,7 +6627,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5959
6627
  facets: turnSummary?.facets,
5960
6628
  settleFold,
5961
6629
  contextCompactionCount,
5962
- children: /* @__PURE__ */ jsx15(FoldBody, { children: /* @__PURE__ */ jsx15(TurnRailFrame, { children: /* @__PURE__ */ jsx15(
6630
+ children: /* @__PURE__ */ jsx16(FoldBody, { children: /* @__PURE__ */ jsx16(TurnRailFrame, { children: /* @__PURE__ */ jsx16(
5963
6631
  ActivityRail,
5964
6632
  {
5965
6633
  items: group.items,
@@ -5977,7 +6645,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5977
6645
  const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
5978
6646
  const body = group.groups.map((child) => {
5979
6647
  const key = timelineGroupKey(child);
5980
- return /* @__PURE__ */ jsx15(
6648
+ return /* @__PURE__ */ jsx16(
5981
6649
  TimelineGroupRenderBoundary,
5982
6650
  {
5983
6651
  resetKeys: [
@@ -5990,7 +6658,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5990
6658
  toolRegistry,
5991
6659
  turnSummary
5992
6660
  ],
5993
- children: /* @__PURE__ */ jsx15(
6661
+ children: /* @__PURE__ */ jsx16(
5994
6662
  TimelineGroupView2,
5995
6663
  {
5996
6664
  group: child,
@@ -6009,7 +6677,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6009
6677
  key
6010
6678
  );
6011
6679
  });
6012
- return /* @__PURE__ */ jsx15(
6680
+ return /* @__PURE__ */ jsx16(
6013
6681
  TurnSummary,
6014
6682
  {
6015
6683
  items: activityItems,
@@ -6023,16 +6691,16 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6023
6691
  settleFold,
6024
6692
  copyText: insideTurn ? void 0 : turnCopyText,
6025
6693
  contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
6026
- children: /* @__PURE__ */ jsx15(FoldBody, { children: insideTurn ? (
6694
+ children: /* @__PURE__ */ jsx16(FoldBody, { children: insideTurn ? (
6027
6695
  // A nested turn is already on an ancestor rail — its body just stacks
6028
6696
  // flush (the bare-node body already indents it), so no second rule.
6029
- /* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-4", children: body })
6030
- ) : /* @__PURE__ */ jsx15(TurnRailFrame, { children: body }) })
6697
+ /* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-4", children: body })
6698
+ ) : /* @__PURE__ */ jsx16(TurnRailFrame, { children: body }) })
6031
6699
  }
6032
6700
  );
6033
6701
  }
6034
6702
  case "item":
6035
- return /* @__PURE__ */ jsx15(
6703
+ return /* @__PURE__ */ jsx16(
6036
6704
  TimelineRow,
6037
6705
  {
6038
6706
  item: group.item,
@@ -6045,14 +6713,14 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6045
6713
  }
6046
6714
  });
6047
6715
  function FoldBody({ children }) {
6048
- return /* @__PURE__ */ jsx15(Fragment6, { children });
6716
+ return /* @__PURE__ */ jsx16(Fragment7, { children });
6049
6717
  }
6050
6718
  function TurnRailFrame({ children }) {
6051
- return /* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
6719
+ return /* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
6052
6720
  }
6053
6721
  function useLiveSettleFold(folded) {
6054
- const previousFoldedRef = useRef8(folded);
6055
- const latchedRef = useRef8(false);
6722
+ const previousFoldedRef = useRef9(folded);
6723
+ const latchedRef = useRef9(false);
6056
6724
  if (!previousFoldedRef.current && folded) {
6057
6725
  latchedRef.current = true;
6058
6726
  }
@@ -6210,23 +6878,23 @@ function TimelineRow({
6210
6878
  }) {
6211
6879
  switch (item.kind) {
6212
6880
  case "user-message":
6213
- return /* @__PURE__ */ jsx15(UserMessageRow, { item, renderMessageText });
6881
+ return /* @__PURE__ */ jsx16(UserMessageRow, { item, renderMessageText });
6214
6882
  case "agent-message":
6215
- return /* @__PURE__ */ jsx15(AgentMessageRow, { item, renderMessageText });
6883
+ return /* @__PURE__ */ jsx16(AgentMessageRow, { item, renderMessageText });
6216
6884
  case "worker-completion":
6217
- return /* @__PURE__ */ jsx15(WorkerCompletionRow, { item, onOpenSession });
6885
+ return /* @__PURE__ */ jsx16(WorkerCompletionRow, { item, onOpenSession });
6218
6886
  case "session-status":
6219
- return /* @__PURE__ */ jsx15(SessionStatusRow, { item });
6887
+ return /* @__PURE__ */ jsx16(SessionStatusRow, { item });
6220
6888
  case "goal":
6221
- return /* @__PURE__ */ jsx15(GoalRow, { item });
6889
+ return /* @__PURE__ */ jsx16(GoalRow, { item });
6222
6890
  case "machine-input-batch":
6223
- return /* @__PURE__ */ jsx15(MachineInputBatchRow, { item });
6891
+ return /* @__PURE__ */ jsx16(MachineInputBatchRow, { item });
6224
6892
  case "notice":
6225
- return /* @__PURE__ */ jsx15(NoticeRow, { item });
6893
+ return /* @__PURE__ */ jsx16(NoticeRow, { item });
6226
6894
  case "context-compaction":
6227
- return /* @__PURE__ */ jsx15(CompactionRow, { item });
6895
+ return /* @__PURE__ */ jsx16(CompactionRow, { item });
6228
6896
  case "auth-needed":
6229
- return /* @__PURE__ */ jsx15(
6897
+ return /* @__PURE__ */ jsx16(
6230
6898
  AuthNeededRow,
6231
6899
  {
6232
6900
  item,
@@ -6252,7 +6920,7 @@ function CompactionRow({ item }) {
6252
6920
  const title = item.phase === "started" ? "Compacting conversation memory\u2026" : item.phase === "compacted" ? before && after ? `Conversation memory compacted \xB7 ~${before} \u2192 ~${after} tokens` : "Conversation memory compacted" : "Couldn\u2019t compact conversation memory";
6253
6921
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
6254
6922
  const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
6255
- return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
6923
+ return /* @__PURE__ */ jsx16("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
6256
6924
  "div",
6257
6925
  {
6258
6926
  className: cn(
@@ -6262,13 +6930,13 @@ function CompactionRow({ item }) {
6262
6930
  role: "status",
6263
6931
  children: [
6264
6932
  /* @__PURE__ */ jsxs13("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
6265
- /* @__PURE__ */ jsx15(ShrinkIcon, { className: "size-3.5 shrink-0" }),
6933
+ /* @__PURE__ */ jsx16(ShrinkIcon, { className: "size-3.5 shrink-0" }),
6266
6934
  /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
6267
6935
  title,
6268
6936
  trigger ? ` \xB7 ${trigger}` : ""
6269
6937
  ] })
6270
6938
  ] }),
6271
- subtitle ? /* @__PURE__ */ jsx15("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
6939
+ subtitle ? /* @__PURE__ */ jsx16("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
6272
6940
  ]
6273
6941
  }
6274
6942
  ) });
@@ -6288,7 +6956,7 @@ function compactionSkipSubtitle(reason) {
6288
6956
  }
6289
6957
  }
6290
6958
  function MessageFooterTime({ occurredAt }) {
6291
- return /* @__PURE__ */ jsx15(
6959
+ return /* @__PURE__ */ jsx16(
6292
6960
  "time",
6293
6961
  {
6294
6962
  dateTime: occurredAt,
@@ -6306,14 +6974,14 @@ function UserMessageRow({
6306
6974
  renderMessageText
6307
6975
  }) {
6308
6976
  const enter = useEntranceAnimation();
6309
- return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsx15("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: /* @__PURE__ */ jsx15(
6977
+ return /* @__PURE__ */ jsx16("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsx16("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: /* @__PURE__ */ jsx16(
6310
6978
  CopyHoverFrame,
6311
6979
  {
6312
6980
  copyText: item.text,
6313
6981
  label: "Copy message",
6314
6982
  className: "w-fit max-w-full min-w-0",
6315
- trailing: /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
6316
- children: /* @__PURE__ */ jsx15("div", { className: "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg", children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx15(Markdown, { children: item.text }) })
6983
+ trailing: /* @__PURE__ */ jsx16(MessageFooterTime, { occurredAt: item.occurredAt }),
6984
+ children: /* @__PURE__ */ jsx16("div", { className: "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg", children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx16(Markdown, { children: item.text }) })
6317
6985
  }
6318
6986
  ) }) });
6319
6987
  }
@@ -6322,15 +6990,15 @@ function AgentMessageRow({
6322
6990
  renderMessageText
6323
6991
  }) {
6324
6992
  const enter = useEntranceAnimation();
6325
- const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx15(Markdown, { streaming: item.streaming, children: item.text });
6326
- return /* @__PURE__ */ jsx15(
6993
+ const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx16(Markdown, { streaming: item.streaming, children: item.text });
6994
+ return /* @__PURE__ */ jsx16(
6327
6995
  CopyHoverFrame,
6328
6996
  {
6329
6997
  copyText: item.text,
6330
6998
  label: "Copy message",
6331
6999
  align: "start",
6332
7000
  className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
6333
- trailing: item.streaming ? null : /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
7001
+ trailing: item.streaming ? null : /* @__PURE__ */ jsx16(MessageFooterTime, { occurredAt: item.occurredAt }),
6334
7002
  children: body
6335
7003
  }
6336
7004
  );
@@ -6382,11 +7050,11 @@ function WorkerCompletionRow({
6382
7050
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
6383
7051
  ];
6384
7052
  const hasDetails = details.length > 0;
6385
- return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs13("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
7053
+ return /* @__PURE__ */ jsx16("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs13("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
6386
7054
  /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2.5", children: [
6387
- /* @__PURE__ */ jsx15("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx15(Icon, { className: "size-4" }) }),
6388
- /* @__PURE__ */ jsx15("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("p", { className: "text-og-base leading-5 text-og-fg", children: [
6389
- /* @__PURE__ */ jsx15("span", { className: "font-medium", children: meta.label }),
7055
+ /* @__PURE__ */ jsx16("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx16(Icon, { className: "size-4" }) }),
7056
+ /* @__PURE__ */ jsx16("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("p", { className: "text-og-base leading-5 text-og-fg", children: [
7057
+ /* @__PURE__ */ jsx16("span", { className: "font-medium", children: meta.label }),
6390
7058
  item.goalText ? /* @__PURE__ */ jsxs13("span", { className: "text-og-fg-muted", children: [
6391
7059
  " \xB7 ",
6392
7060
  truncate(item.goalText, 90)
@@ -6404,13 +7072,13 @@ function WorkerCompletionRow({
6404
7072
  ),
6405
7073
  children: [
6406
7074
  "View session",
6407
- /* @__PURE__ */ jsx15(ArrowRightIcon2, { className: "size-3.5" })
7075
+ /* @__PURE__ */ jsx16(ArrowRightIcon2, { className: "size-3.5" })
6408
7076
  ]
6409
7077
  }
6410
7078
  ) : null
6411
7079
  ] }),
6412
7080
  hasDetails ? /* @__PURE__ */ jsxs13(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
6413
- /* @__PURE__ */ jsx15(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
7081
+ /* @__PURE__ */ jsx16(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
6414
7082
  "button",
6415
7083
  {
6416
7084
  type: "button",
@@ -6419,14 +7087,14 @@ function WorkerCompletionRow({
6419
7087
  "outline-none transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
6420
7088
  ),
6421
7089
  children: [
6422
- /* @__PURE__ */ jsx15(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
7090
+ /* @__PURE__ */ jsx16(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
6423
7091
  open ? "Hide details" : "Show details"
6424
7092
  ]
6425
7093
  }
6426
7094
  ) }),
6427
- /* @__PURE__ */ jsx15(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx15("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
6428
- /* @__PURE__ */ jsx15("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
6429
- /* @__PURE__ */ jsx15(
7095
+ /* @__PURE__ */ jsx16(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx16("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
7096
+ /* @__PURE__ */ jsx16("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
7097
+ /* @__PURE__ */ jsx16(
6430
7098
  "p",
6431
7099
  {
6432
7100
  className: cn(
@@ -6452,14 +7120,14 @@ function SessionStatusRow({ item }) {
6452
7120
  ),
6453
7121
  role: "status",
6454
7122
  children: [
6455
- /* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" }),
7123
+ /* @__PURE__ */ jsx16("span", { className: "h-px flex-1 bg-og-border" }),
6456
7124
  /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1.5", children: [
6457
- /* @__PURE__ */ jsx15(StatusDot, { status: item.status, className: "size-1" }),
7125
+ /* @__PURE__ */ jsx16(StatusDot, { status: item.status, className: "size-1" }),
6458
7126
  meta.label.toLowerCase(),
6459
7127
  " \xB7 ",
6460
7128
  formatRelativeTime(item.occurredAt)
6461
7129
  ] }),
6462
- /* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" })
7130
+ /* @__PURE__ */ jsx16("span", { className: "h-px flex-1 bg-og-border" })
6463
7131
  ]
6464
7132
  }
6465
7133
  );
@@ -6489,7 +7157,7 @@ var GOAL_META = {
6489
7157
  function GoalRow({ item }) {
6490
7158
  const enter = useEntranceAnimation();
6491
7159
  const { label, pill, icon: Icon } = GOAL_META[item.action];
6492
- return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
7160
+ return /* @__PURE__ */ jsx16("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
6493
7161
  "span",
6494
7162
  {
6495
7163
  className: cn(
@@ -6497,7 +7165,7 @@ function GoalRow({ item }) {
6497
7165
  pill
6498
7166
  ),
6499
7167
  children: [
6500
- /* @__PURE__ */ jsx15(Icon, { className: "size-3.5 shrink-0" }),
7168
+ /* @__PURE__ */ jsx16(Icon, { className: "size-3.5 shrink-0" }),
6501
7169
  /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
6502
7170
  label,
6503
7171
  item.text ? `: ${truncate(item.text, 90)}` : ""
@@ -6506,64 +7174,53 @@ function GoalRow({ item }) {
6506
7174
  }
6507
7175
  ) });
6508
7176
  }
6509
- var MACHINE_INPUT_META = {
6510
- scheduled_occurrence: "Scheduled update",
6511
- goal_continuation: "Goal continued",
6512
- agent_message: "Agent update",
6513
- agent_steer_instruction: "Agent direction",
6514
- child_terminal_result: "Agent finished"
6515
- };
6516
7177
  function MachineInputBatchRow({ item }) {
6517
7178
  const enter = useEntranceAnimation();
6518
- const visible = item.members.slice(0, 3);
6519
- return /* @__PURE__ */ jsxs13(
6520
- "div",
6521
- {
6522
- className: cn(
6523
- enter && "animate-og-enter",
6524
- "rounded-og-md border border-og-border/70 bg-og-surface-1/55 px-3 py-2.5"
6525
- ),
6526
- children: [
6527
- item.members.length > 1 && /* @__PURE__ */ jsxs13("div", { className: "mb-2 text-xs font-medium text-og-fg-subtle", children: [
6528
- item.members.length,
6529
- " updates joined this turn"
6530
- ] }),
6531
- /* @__PURE__ */ jsx15("div", { className: "space-y-2", children: visible.map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) }),
6532
- item.members.length > visible.length && /* @__PURE__ */ jsxs13("details", { className: "mt-2 pl-8 text-xs text-og-fg-muted", children: [
6533
- /* @__PURE__ */ jsxs13("summary", { className: "cursor-pointer select-none hover:text-og-fg", children: [
6534
- "Show ",
6535
- item.members.length - visible.length,
6536
- " more"
6537
- ] }),
6538
- /* @__PURE__ */ jsx15("div", { className: "mt-2 space-y-2", children: item.members.slice(visible.length).map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) })
6539
- ] })
6540
- ]
6541
- }
6542
- );
7179
+ const label = machineInputBatchLabel(item.members);
7180
+ const single = item.members.length === 1 ? item.members[0] : null;
7181
+ const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
7182
+ const showCollapsedSummary = single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
7183
+ return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
7184
+ /* @__PURE__ */ jsxs13("details", { className: "group w-full max-w-full", "data-og-machine-input-batch": "", children: [
7185
+ /* @__PURE__ */ jsx16("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs13(
7186
+ "span",
7187
+ {
7188
+ className: cn(
7189
+ "inline-flex max-w-full items-center gap-1.5 rounded-full border px-3 py-1 text-og-sm",
7190
+ NEUTRAL_PILL
7191
+ ),
7192
+ children: [
7193
+ /* @__PURE__ */ jsx16(
7194
+ ChevronRightIcon3,
7195
+ {
7196
+ "aria-hidden": true,
7197
+ className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
7198
+ }
7199
+ ),
7200
+ /* @__PURE__ */ jsx16("span", { className: "truncate", children: label })
7201
+ ]
7202
+ }
7203
+ ) }),
7204
+ /* @__PURE__ */ jsx16("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: item.members.map((member) => /* @__PURE__ */ jsx16(MachineInputRow, { member }, member.id)) })
7205
+ ] }),
7206
+ showCollapsedSummary ? /* @__PURE__ */ jsx16("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
7207
+ ] });
6543
7208
  }
6544
7209
  function MachineInputRow({ member }) {
6545
7210
  const source = readableMachineInputSource(member.sourceId);
7211
+ const summary = cleanMachineInputSummary(member.summary);
6546
7212
  return /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-start gap-2.5", children: [
6547
- /* @__PURE__ */ jsx15("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
7213
+ /* @__PURE__ */ jsx16("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
6548
7214
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
6549
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
7215
+ /* @__PURE__ */ jsx16("span", { className: "text-xs font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
6550
7216
  source && /* @__PURE__ */ jsxs13("span", { className: "ml-1.5 text-xs text-og-fg-subtle", children: [
6551
7217
  "from ",
6552
7218
  source
6553
7219
  ] }),
6554
- member.summary && /* @__PURE__ */ jsx15("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-5 text-og-fg", children: truncate(cleanMachineInputSummary(member.summary), 320) })
7220
+ summary ? /* @__PURE__ */ jsx16("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-5 text-og-fg", children: truncate(summary, 320) }) : null
6555
7221
  ] })
6556
7222
  ] });
6557
7223
  }
6558
- function readableMachineInputSource(sourceId) {
6559
- const value = sourceId.trim();
6560
- if (!value || /^[0-9a-f]{8}-[0-9a-f-]{27,}$/i.test(value)) return null;
6561
- if (/^(goal|schedule|system):/i.test(value)) return null;
6562
- return value.replaceAll("_", " ");
6563
- }
6564
- function cleanMachineInputSummary(summary) {
6565
- return summary.replace(/^\[[A-Z][A-Z _-]*(?:\s+\d+\/\d+)?\]\s*/, "").trim();
6566
- }
6567
7224
  function NoticeRow({ item }) {
6568
7225
  const enter = useEntranceAnimation();
6569
7226
  const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
@@ -6577,20 +7234,20 @@ function NoticeRow({ item }) {
6577
7234
  ),
6578
7235
  role: "status",
6579
7236
  children: [
6580
- /* @__PURE__ */ jsx15(
7237
+ /* @__PURE__ */ jsx16(
6581
7238
  TriangleAlertIcon3,
6582
7239
  {
6583
7240
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
6584
7241
  }
6585
7242
  ),
6586
7243
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
6587
- /* @__PURE__ */ jsx15("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
7244
+ /* @__PURE__ */ jsx16("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
6588
7245
  item.details ? /* @__PURE__ */ jsxs13("details", { className: "mt-2 text-xs", children: [
6589
- /* @__PURE__ */ jsx15("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
6590
- /* @__PURE__ */ jsx15("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
7246
+ /* @__PURE__ */ jsx16("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
7247
+ /* @__PURE__ */ jsx16("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
6591
7248
  ] }) : null
6592
7249
  ] }),
6593
- item.action ? /* @__PURE__ */ jsx15(
7250
+ item.action ? /* @__PURE__ */ jsx16(
6594
7251
  "a",
6595
7252
  {
6596
7253
  className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-xs font-medium hover:bg-current/10",
@@ -6633,7 +7290,7 @@ function AuthNeededRow({
6633
7290
  return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
6634
7291
  /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3 rounded-og-lg border border-og-border bg-og-surface-1 px-3.5 py-3 sm:flex-row sm:items-center", children: [
6635
7292
  /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
6636
- /* @__PURE__ */ jsx15(
7293
+ /* @__PURE__ */ jsx16(
6637
7294
  AuthProviderLogo,
6638
7295
  {
6639
7296
  src: resolveProviderLogo?.(item.providerDomain) ?? null,
@@ -6641,8 +7298,8 @@ function AuthNeededRow({
6641
7298
  }
6642
7299
  ),
6643
7300
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
6644
- /* @__PURE__ */ jsx15("p", { className: "truncate text-og-md font-medium text-og-fg", children: unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}` }),
6645
- /* @__PURE__ */ jsx15("p", { className: "truncate text-og-sm text-og-fg-subtle", children: authReasonLine(item.reason) })
7301
+ /* @__PURE__ */ jsx16("p", { className: "truncate text-og-md font-medium text-og-fg", children: unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}` }),
7302
+ /* @__PURE__ */ jsx16("p", { className: "truncate text-og-sm text-og-fg-subtle", children: authReasonLine(item.reason) })
6646
7303
  ] })
6647
7304
  ] }),
6648
7305
  !unavailable && onReconnect ? /* @__PURE__ */ jsxs13(
@@ -6656,7 +7313,7 @@ function AuthNeededRow({
6656
7313
  "transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
6657
7314
  ),
6658
7315
  children: [
6659
- /* @__PURE__ */ jsx15(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
7316
+ /* @__PURE__ */ jsx16(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
6660
7317
  busy ? "Opening\u2026" : actionLabel
6661
7318
  ]
6662
7319
  }
@@ -6671,7 +7328,7 @@ function AuthNeededRow({
6671
7328
  "transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
6672
7329
  ),
6673
7330
  children: [
6674
- /* @__PURE__ */ jsx15(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
7331
+ /* @__PURE__ */ jsx16(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
6675
7332
  actionLabel
6676
7333
  ]
6677
7334
  }
@@ -6693,14 +7350,14 @@ function AuthNeededRow({
6693
7350
  }
6694
7351
  function AuthProviderLogo({ src, label }) {
6695
7352
  const [failed, setFailed] = useState11(false);
6696
- useEffect8(() => setFailed(false), [src]);
7353
+ useEffect9(() => setFailed(false), [src]);
6697
7354
  const showImage = src && !failed;
6698
- return /* @__PURE__ */ jsx15(
7355
+ return /* @__PURE__ */ jsx16(
6699
7356
  "span",
6700
7357
  {
6701
7358
  className: "relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-og-md border border-og-border bg-og-surface-2 text-sm font-semibold text-og-fg-muted",
6702
7359
  "aria-hidden": true,
6703
- children: showImage ? /* @__PURE__ */ jsx15(
7360
+ children: showImage ? /* @__PURE__ */ jsx16(
6704
7361
  "img",
6705
7362
  {
6706
7363
  src,
@@ -6710,7 +7367,7 @@ function AuthProviderLogo({ src, label }) {
6710
7367
  className: "size-full object-contain p-1.5",
6711
7368
  onError: () => setFailed(true)
6712
7369
  }
6713
- ) : /* @__PURE__ */ jsx15("span", { children: monogram(label) })
7370
+ ) : /* @__PURE__ */ jsx16("span", { children: monogram(label) })
6714
7371
  }
6715
7372
  );
6716
7373
  }
@@ -6759,6 +7416,7 @@ export {
6759
7416
  defaultHumanInputFormMessages,
6760
7417
  HumanInputForm,
6761
7418
  answersFromDrafts,
7419
+ HumanInputSurface,
6762
7420
  rawTypeOf,
6763
7421
  createToolRegistry,
6764
7422
  sandboxCommandExitCode,
@@ -6806,4 +7464,4 @@ export {
6806
7464
  MessageTimeline,
6807
7465
  TimelineRow
6808
7466
  };
6809
- //# sourceMappingURL=chunk-Z5FV355Z.js.map
7467
+ //# sourceMappingURL=chunk-KR2SK5GJ.js.map