@opengeni/react 0.37.0 → 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 (71) hide show
  1. package/README.md +88 -2
  2. package/dist/{chunk-7CJOAW3V.js → chunk-EB67J347.js} +1 -135
  3. package/dist/chunk-EB67J347.js.map +1 -0
  4. package/dist/chunk-EKZH6IDG.js +141 -0
  5. package/dist/chunk-EKZH6IDG.js.map +1 -0
  6. package/dist/{chunk-FSPDND3P.js → chunk-JALF5FI3.js} +8 -6
  7. package/dist/{chunk-FSPDND3P.js.map → chunk-JALF5FI3.js.map} +1 -1
  8. package/dist/{chunk-UCZPNXV3.js → chunk-KR2SK5GJ.js} +1292 -711
  9. package/dist/chunk-KR2SK5GJ.js.map +1 -0
  10. package/dist/{chunk-IP22SLO6.js → chunk-OMCFRWHL.js} +28 -441
  11. package/dist/chunk-OMCFRWHL.js.map +1 -0
  12. package/dist/{chunk-HJ4OQVGW.js → chunk-Q2NCKWTK.js} +10 -5
  13. package/dist/chunk-Q2NCKWTK.js.map +1 -0
  14. package/dist/{chunk-ALA3UGWB.js → chunk-SXIQK54Z.js} +8 -6
  15. package/dist/{chunk-ALA3UGWB.js.map → chunk-SXIQK54Z.js.map} +1 -1
  16. package/dist/chunk-WZT5G5OR.js +433 -0
  17. package/dist/chunk-WZT5G5OR.js.map +1 -0
  18. package/dist/client.d.ts +2 -0
  19. package/dist/components/chat-composer.d.ts +5 -1
  20. package/dist/components/human-input-form.d.ts +16 -6
  21. package/dist/components/human-input-surface.d.ts +19 -0
  22. package/dist/components/machine-input-display.d.ts +12 -0
  23. package/dist/components/message-timeline.d.ts +6 -1
  24. package/dist/components/session-chrome.d.ts +1 -0
  25. package/dist/components/tip-follow.d.ts +30 -0
  26. package/dist/composer.js +14 -11
  27. package/dist/hooks/use-composer.d.ts +1 -1
  28. package/dist/index.d.ts +4 -0
  29. package/dist/index.js +2246 -2236
  30. package/dist/index.js.map +1 -1
  31. package/dist/machines.js +4 -3
  32. package/dist/realtime/dropdown-menu.d.ts +16 -0
  33. package/dist/realtime/realtime-control.d.ts +126 -0
  34. package/dist/realtime.d.ts +11 -0
  35. package/dist/realtime.js +1023 -0
  36. package/dist/realtime.js.map +1 -0
  37. package/dist/session-context.d.ts +7 -1
  38. package/dist/session-ui.d.ts +2 -0
  39. package/dist/session-ui.js +5 -3
  40. package/dist/session.js +4 -3
  41. package/dist/timeline/compute-label.d.ts +2 -0
  42. package/dist/timeline/index.d.ts +1 -0
  43. package/package.json +7 -2
  44. package/src/client.ts +13 -0
  45. package/src/components/chat-composer.tsx +11 -2
  46. package/src/components/composer-transcription-control.tsx +2 -2
  47. package/src/components/composer.tsx +14 -5
  48. package/src/components/human-input-form.tsx +506 -186
  49. package/src/components/human-input-surface.tsx +80 -0
  50. package/src/components/machine-input-display.ts +83 -0
  51. package/src/components/message-timeline.tsx +348 -308
  52. package/src/components/model-policy-picker.tsx +8 -3
  53. package/src/components/sandbox-files.tsx +1 -1
  54. package/src/components/session-chrome.tsx +3 -1
  55. package/src/components/tip-follow.ts +127 -6
  56. package/src/hooks/use-composer.ts +16 -13
  57. package/src/index.ts +4 -0
  58. package/src/realtime/dropdown-menu.tsx +123 -0
  59. package/src/realtime/realtime-control.tsx +1178 -0
  60. package/src/realtime.ts +27 -0
  61. package/src/session-context.ts +16 -0
  62. package/src/session-ui.ts +2 -0
  63. package/src/timeline/compute-label.tsx +18 -0
  64. package/src/timeline/index.ts +3 -0
  65. package/src/timeline/tool-renderers.tsx +232 -43
  66. package/styles/index.css +61 -0
  67. package/styles/tokens.css +2 -0
  68. package/dist/chunk-7CJOAW3V.js.map +0 -1
  69. package/dist/chunk-HJ4OQVGW.js.map +0 -1
  70. package/dist/chunk-IP22SLO6.js.map +0 -1
  71. package/dist/chunk-UCZPNXV3.js.map +0 -1
@@ -1,3 +1,7 @@
1
+ import {
2
+ EmptyQueueStateSurface,
3
+ requestQueueDraftEdit
4
+ } from "./chunk-YDNWMKXO.js";
1
5
  import {
2
6
  buildTimeline,
3
7
  groupTimeline,
@@ -10,9 +14,6 @@ import {
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";
@@ -528,8 +528,9 @@ function SessionChrome({
528
528
  "div",
529
529
  {
530
530
  ref: panelBodyRef,
531
- className: "relative border-t border-og-border/50",
531
+ className: "relative overflow-y-auto overscroll-contain border-t border-og-border/50",
532
532
  style: {
533
+ maxHeight: "var(--og-session-chrome-panel-max-height)",
533
534
  paddingInline: "var(--og-session-chrome-panel-pad-x)",
534
535
  paddingBlock: "var(--og-session-chrome-panel-pad-y)"
535
536
  },
@@ -857,23 +858,34 @@ function IconAction({
857
858
  }
858
859
 
859
860
  // src/components/human-input-form.tsx
861
+ import { ChevronDownIcon, ChevronUpIcon, MessageCircleQuestionIcon } from "lucide-react";
860
862
  import { useEffect as useEffect2, useId as useId2, useRef as useRef2, useState as useState2 } from "react";
861
- 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";
862
864
  var defaultHumanInputFormMessages = {
863
- title: "Your input is needed",
864
- 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: "",
865
868
  submit: "Continue",
866
869
  skip: "Skip",
867
870
  submitting: "Submitting\u2026",
868
871
  other: "Other",
869
- deadlineLabel: "Respond before",
872
+ deadlineLabel: "Expires",
870
873
  formatDeadline,
871
874
  required: "This question is required.",
872
- minLength: (count) => `Enter at least ${count} characters.`,
873
- maxLength: (count) => `Enter no more than ${count} characters.`,
874
875
  otherRequired: "Enter a value for Other.",
875
876
  minSelections: (count) => `Choose at least ${count} option${count === 1 ? "" : "s"}.`,
876
- 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
+ }
877
889
  };
878
890
  function HumanInputForm({
879
891
  request,
@@ -882,24 +894,31 @@ function HumanInputForm({
882
894
  error,
883
895
  title,
884
896
  description,
897
+ progressLabel,
885
898
  submitLabel,
886
899
  skipLabel,
887
900
  messages: messageOverrides,
888
901
  autoFocus = true,
902
+ defaultCollapsed = false,
889
903
  className
890
904
  }) {
891
905
  const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
892
- const resolvedTitle = title === void 0 ? messages.title : title;
893
- 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;
894
909
  const resolvedSubmitLabel = submitLabel ?? messages.submit;
895
910
  const resolvedSkipLabel = skipLabel ?? messages.skip;
896
911
  const formId = useId2();
912
+ const titleId = useId2();
913
+ const scrollRef = useRef2(null);
897
914
  const [drafts, setDrafts] = useState2(
898
915
  () => initialDrafts(request.questions)
899
916
  );
900
917
  const [validationErrors, setValidationErrors] = useState2({});
901
918
  const [submissionError, setSubmissionError] = useState2(null);
902
919
  const [submittingInternally, setSubmittingInternally] = useState2(false);
920
+ const [overflowBelow, setOverflowBelow] = useState2(false);
921
+ const [collapsed, setCollapsed] = useState2(defaultCollapsed);
903
922
  const submissionInFlight = useRef2(false);
904
923
  const submissionGeneration = useRef2(0);
905
924
  const busy = submitting || submittingInternally;
@@ -910,7 +929,33 @@ function HumanInputForm({
910
929
  setValidationErrors({});
911
930
  setSubmissionError(null);
912
931
  setSubmittingInternally(false);
913
- }, [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]);
914
959
  const update = (questionId, apply) => {
915
960
  setDrafts((current) => ({
916
961
  ...current,
@@ -942,155 +987,206 @@ function HumanInputForm({
942
987
  }
943
988
  }
944
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
+ };
945
1002
  const submit = async (event) => {
946
1003
  event.preventDefault();
947
1004
  const result = answersFromDrafts(request.questions, drafts, messages);
948
1005
  if (Object.keys(result.errors).length > 0) {
949
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
+ }
950
1011
  return;
951
1012
  }
952
1013
  await submitResponse({ outcome: "answered", answers: result.answers });
953
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
+ }
954
1057
  return /* @__PURE__ */ jsxs3(
955
1058
  "form",
956
1059
  {
957
1060
  "data-human-input-request": request.id,
958
1061
  onSubmit: (event) => void submit(event),
1062
+ "aria-labelledby": titleId,
959
1063
  className: cn(
960
- "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)]",
961
1069
  className
962
1070
  ),
963
1071
  children: [
964
- /* @__PURE__ */ jsxs3("header", { children: [
965
- /* @__PURE__ */ jsx3("h2", { className: "text-og-md font-semibold text-og-fg", children: resolvedTitle }),
966
- resolvedDescription ? /* @__PURE__ */ jsx3("div", { className: "mt-1 text-og-sm text-og-fg-muted", children: resolvedDescription }) : null,
967
- request.expiresAt ? /* @__PURE__ */ jsxs3("p", { className: "mt-1 text-og-xs text-og-fg-subtle", children: [
968
- messages.deadlineLabel,
969
- " ",
970
- /* @__PURE__ */ jsx3("time", { dateTime: request.expiresAt, children: messages.formatDeadline(request.expiresAt) })
971
- ] }) : null
972
- ] }),
973
- /* @__PURE__ */ jsx3("fieldset", { disabled: busy, className: "contents", children: request.questions.map((question, index) => {
974
- const draft = drafts[question.id] ?? emptyDraft();
975
- const fieldId = `${formId}-${index}`;
976
- const errorId = `${fieldId}-error`;
977
- const helpId = `${fieldId}-help`;
978
- const describedBy = [question.helpText ? helpId : null, validationErrors[question.id] ? errorId : null].filter(Boolean).join(" ") || void 0;
979
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
980
- /* @__PURE__ */ jsxs3(
981
- "label",
982
- {
983
- htmlFor: question.kind === "text" ? fieldId : void 0,
984
- className: "text-og-base font-medium text-og-fg",
985
- children: [
986
- question.label ?? question.prompt,
987
- question.required ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "ml-1 text-og-status-failed", children: "*" }) : null
988
- ]
989
- }
990
- ),
991
- question.label ? /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: question.prompt }) : null,
992
- question.helpText ? /* @__PURE__ */ jsx3("p", { id: helpId, className: "text-og-xs text-og-fg-subtle", children: question.helpText }) : null,
993
- question.kind === "text" ? /* @__PURE__ */ jsx3(
994
- "textarea",
995
- {
996
- id: fieldId,
997
- value: draft.values[0] ?? "",
998
- onChange: (event) => update(question.id, (current) => ({
999
- ...current,
1000
- values: event.target.value ? [event.target.value] : []
1001
- })),
1002
- "aria-invalid": Boolean(validationErrors[question.id]),
1003
- "aria-describedby": describedBy,
1004
- autoFocus: autoFocus && index === 0,
1005
- rows: 3,
1006
- 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"
1007
- }
1008
- ) : /* @__PURE__ */ jsxs3(
1009
- "div",
1010
- {
1011
- role: question.kind === "single_select" ? "radiogroup" : "group",
1012
- "aria-describedby": describedBy,
1013
- className: "flex flex-col gap-2",
1014
- children: [
1015
- question.options.map((option, optionIndex) => {
1016
- const checked = draft.values.includes(option.id);
1017
- return /* @__PURE__ */ jsxs3(
1018
- "label",
1019
- {
1020
- className: "flex cursor-pointer items-start gap-2 rounded-og-md border border-og-border px-3 py-2 hover:bg-og-surface-2",
1021
- children: [
1022
- /* @__PURE__ */ jsx3(
1023
- "input",
1024
- {
1025
- type: question.kind === "single_select" ? "radio" : "checkbox",
1026
- name: question.kind === "single_select" ? fieldId : void 0,
1027
- autoFocus: autoFocus && index === 0 && optionIndex === 0,
1028
- checked,
1029
- onChange: (event) => update(question.id, (current) => ({
1030
- ...current,
1031
- values: question.kind === "single_select" ? event.target.checked ? [option.id] : [] : event.target.checked ? [...current.values, option.id] : current.values.filter((value) => value !== option.id),
1032
- ...question.kind === "single_select" && event.target.checked ? { otherSelected: false } : {}
1033
- })),
1034
- className: "mt-0.5 accent-og-accent"
1035
- }
1036
- ),
1037
- /* @__PURE__ */ jsxs3("span", { className: "min-w-0", children: [
1038
- /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: option.label }),
1039
- option.description ? /* @__PURE__ */ jsx3("span", { className: "block text-og-xs text-og-fg-muted", children: option.description }) : null
1040
- ] })
1041
- ]
1042
- },
1043
- option.id
1044
- );
1045
- }),
1046
- question.allowOther ? /* @__PURE__ */ jsxs3("label", { className: "flex items-start gap-2 rounded-og-md border border-og-border px-3 py-2", children: [
1047
- /* @__PURE__ */ jsx3(
1048
- "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,
1049
1142
  {
1050
- type: question.kind === "single_select" ? "radio" : "checkbox",
1051
- name: question.kind === "single_select" ? fieldId : void 0,
1052
- checked: draft.otherSelected,
1053
- autoFocus: autoFocus && index === 0 && question.options.length === 0,
1054
- onChange: (event) => update(question.id, (current) => ({
1055
- ...current,
1056
- otherSelected: event.target.checked,
1057
- ...question.kind === "single_select" && event.target.checked ? { values: [] } : {}
1058
- })),
1059
- 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)
1060
1154
  }
1061
- ),
1062
- /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
1063
- /* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: messages.other }),
1064
- /* @__PURE__ */ jsx3(
1065
- "input",
1066
- {
1067
- type: "text",
1068
- value: draft.other,
1069
- disabled: !draft.otherSelected || busy,
1070
- onChange: (event) => update(question.id, (current) => ({
1071
- ...current,
1072
- other: event.target.value
1073
- })),
1074
- 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"
1075
- }
1076
- )
1077
- ] })
1078
- ] }) : null
1079
- ]
1080
- }
1081
- ),
1082
- validationErrors[question.id] ? /* @__PURE__ */ jsx3("p", { id: errorId, role: "alert", className: "text-og-xs text-og-status-failed", children: validationErrors[question.id] }) : null
1083
- ] }, question.id);
1084
- }) }),
1085
- error ?? submissionError ? /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-og-sm text-og-status-failed", children: error ?? submissionError }) : null,
1086
- /* @__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: [
1087
1183
  request.allowSkip ? /* @__PURE__ */ jsx3(
1088
1184
  "button",
1089
1185
  {
1090
1186
  type: "button",
1091
1187
  disabled: busy,
1092
1188
  onClick: () => void submitResponse({ outcome: "skipped" }),
1093
- 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",
1094
1190
  children: resolvedSkipLabel
1095
1191
  }
1096
1192
  ) : null,
@@ -1099,7 +1195,7 @@ function HumanInputForm({
1099
1195
  {
1100
1196
  type: "submit",
1101
1197
  disabled: busy,
1102
- 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",
1103
1199
  children: busy ? messages.submitting : resolvedSubmitLabel
1104
1200
  }
1105
1201
  )
@@ -1108,6 +1204,156 @@ function HumanInputForm({
1108
1204
  }
1109
1205
  );
1110
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
+ }
1111
1357
  function answersFromDrafts(questions, drafts, messageOverrides = {}) {
1112
1358
  const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
1113
1359
  const answers = [];
@@ -1117,25 +1363,15 @@ function answersFromDrafts(questions, drafts, messageOverrides = {}) {
1117
1363
  const values = question.kind === "text" ? draft.values.filter(Boolean) : draft.values;
1118
1364
  const other = draft.otherSelected ? draft.other.trim() : "";
1119
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
+ }
1120
1370
  if (question.required && supplied === 0) {
1121
1371
  errors[question.id] = messages.required;
1122
1372
  continue;
1123
1373
  }
1124
- if (question.kind === "text") {
1125
- const value = values[0] ?? "";
1126
- if (value && question.validation?.minLength != null && value.length < question.validation.minLength) {
1127
- errors[question.id] = messages.minLength(question.validation.minLength);
1128
- continue;
1129
- }
1130
- if (question.validation?.maxLength != null && value.length > question.validation.maxLength) {
1131
- errors[question.id] = messages.maxLength(question.validation.maxLength);
1132
- continue;
1133
- }
1134
- } else {
1135
- if (draft.otherSelected && !other) {
1136
- errors[question.id] = messages.otherRequired;
1137
- continue;
1138
- }
1374
+ if (question.kind !== "text") {
1139
1375
  const min = question.validation?.minSelections;
1140
1376
  const max = question.kind === "single_select" ? 1 : question.validation?.maxSelections;
1141
1377
  if (min != null && supplied < min) {
@@ -1165,7 +1401,60 @@ function emptyDraft() {
1165
1401
  }
1166
1402
  function formatDeadline(value) {
1167
1403
  const date = new Date(value);
1168
- 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 }) });
1169
1458
  }
1170
1459
 
1171
1460
  // src/timeline/registry.ts
@@ -1510,13 +1799,13 @@ function bytesToBase64(data) {
1510
1799
 
1511
1800
  // src/timeline/disclosure-context.tsx
1512
1801
  import { createContext, useContext } from "react";
1513
- import { jsx as jsx4 } from "react/jsx-runtime";
1802
+ import { jsx as jsx5 } from "react/jsx-runtime";
1514
1803
  var DisclosureDefaultsContext = createContext(void 0);
1515
1804
  function DisclosureDefaultsProvider({
1516
1805
  defaultOpen,
1517
1806
  children
1518
1807
  }) {
1519
- return /* @__PURE__ */ jsx4(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
1808
+ return /* @__PURE__ */ jsx5(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
1520
1809
  }
1521
1810
  function useForcedDefaultOpen() {
1522
1811
  return useContext(DisclosureDefaultsContext);
@@ -1525,9 +1814,9 @@ function useForcedDefaultOpen() {
1525
1814
  // src/timeline/screenshot-lightbox.tsx
1526
1815
  import { XIcon as XIcon2 } from "lucide-react";
1527
1816
  import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
1528
- 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";
1529
1818
  import { Dialog } from "radix-ui";
1530
- 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";
1531
1820
  var LightboxContext = createContext2(null);
1532
1821
  function useLightbox() {
1533
1822
  return useContext2(LightboxContext) ?? NOOP;
@@ -1540,20 +1829,20 @@ var NOOP = { open: () => {
1540
1829
  function LightboxProvider({ children }) {
1541
1830
  const ancestor = useContext2(LightboxContext);
1542
1831
  if (ancestor) {
1543
- return /* @__PURE__ */ jsx5(Fragment2, { children });
1832
+ return /* @__PURE__ */ jsx6(Fragment3, { children });
1544
1833
  }
1545
- return /* @__PURE__ */ jsx5(LightboxRoot, { children });
1834
+ return /* @__PURE__ */ jsx6(LightboxRoot, { children });
1546
1835
  }
1547
1836
  function LightboxRoot({ children }) {
1548
1837
  const [state, setState] = useState3(null);
1549
1838
  const open = useCallback((src, caption) => {
1550
1839
  setState(caption ? { src, caption } : { src });
1551
1840
  }, []);
1552
- const controller = useMemo2(() => ({ open }), [open]);
1841
+ const controller = useMemo3(() => ({ open }), [open]);
1553
1842
  return /* @__PURE__ */ jsxs4(LightboxContext.Provider, { value: controller, children: [
1554
1843
  children,
1555
- /* @__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: [
1556
- /* @__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(
1557
1846
  motion2.div,
1558
1847
  {
1559
1848
  initial: { opacity: 0 },
@@ -1563,7 +1852,7 @@ function LightboxRoot({ children }) {
1563
1852
  className: "og-root fixed inset-0 z-50 bg-black/90 backdrop-blur-md"
1564
1853
  }
1565
1854
  ) }),
1566
- /* @__PURE__ */ jsx5(
1855
+ /* @__PURE__ */ jsx6(
1567
1856
  Dialog.Content,
1568
1857
  {
1569
1858
  asChild: true,
@@ -1584,10 +1873,10 @@ function LightboxRoot({ children }) {
1584
1873
  },
1585
1874
  className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
1586
1875
  children: [
1587
- /* @__PURE__ */ jsx5(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
1876
+ /* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
1588
1877
  /* @__PURE__ */ jsxs4("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
1589
1878
  /* @__PURE__ */ jsxs4("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
1590
- /* @__PURE__ */ jsx5(
1879
+ /* @__PURE__ */ jsx6(
1591
1880
  "img",
1592
1881
  {
1593
1882
  src: state.src,
@@ -1595,7 +1884,7 @@ function LightboxRoot({ children }) {
1595
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"
1596
1885
  }
1597
1886
  ),
1598
- /* @__PURE__ */ jsx5(
1887
+ /* @__PURE__ */ jsx6(
1599
1888
  Dialog.Close,
1600
1889
  {
1601
1890
  className: cn(
@@ -1604,11 +1893,11 @@ function LightboxRoot({ children }) {
1604
1893
  "transition-colors hover:border-white/30 hover:text-white"
1605
1894
  ),
1606
1895
  "aria-label": "Close",
1607
- children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-4" })
1896
+ children: /* @__PURE__ */ jsx6(XIcon2, { className: "size-4" })
1608
1897
  }
1609
1898
  )
1610
1899
  ] }),
1611
- 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" })
1612
1901
  ] })
1613
1902
  ]
1614
1903
  }
@@ -1622,7 +1911,7 @@ function LightboxRoot({ children }) {
1622
1911
  // src/timeline/shared.tsx
1623
1912
  import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
1624
1913
  import { useState as useState4 } from "react";
1625
- 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";
1626
1915
  var ICON_TONE = {
1627
1916
  accent: "text-og-accent",
1628
1917
  failed: "text-og-status-failed",
@@ -1656,10 +1945,10 @@ function ActivityDisclosure({
1656
1945
  // hit area clears the 40px minimum without loosening the dense desktop rail.
1657
1946
  "pointer-coarse:py-2.5"
1658
1947
  );
1659
- const inner = /* @__PURE__ */ jsxs5(Fragment3, { children: [
1660
- 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" }),
1661
- /* @__PURE__ */ jsx6("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
1662
- /* @__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(
1663
1952
  "span",
1664
1953
  {
1665
1954
  className: cn(
@@ -1670,15 +1959,15 @@ function ActivityDisclosure({
1670
1959
  children: title
1671
1960
  }
1672
1961
  ),
1673
- 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" }),
1674
- 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
1675
1964
  ] });
1676
1965
  const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
1677
1966
  if (!hasBody) {
1678
- 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 });
1679
1968
  }
1680
1969
  return /* @__PURE__ */ jsxs5("div", { children: [
1681
- /* @__PURE__ */ jsx6(
1970
+ /* @__PURE__ */ jsx7(
1682
1971
  "div",
1683
1972
  {
1684
1973
  role: "button",
@@ -1701,7 +1990,7 @@ function ActivityDisclosure({
1701
1990
  children: inner
1702
1991
  }
1703
1992
  ),
1704
- 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
1705
1994
  ] });
1706
1995
  }
1707
1996
  function Chip({ chip }) {
@@ -1709,14 +1998,14 @@ function Chip({ chip }) {
1709
1998
  const withText = chip.text ? "gap-1.5" : "gap-0";
1710
1999
  if (chip.tone === "bad") {
1711
2000
  return /* @__PURE__ */ jsxs5("span", { className: cn(base, withText, "text-og-status-failed"), children: [
1712
- /* @__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" }),
1713
2002
  chip.text
1714
2003
  ] });
1715
2004
  }
1716
2005
  if (chip.tone === "interrupted") {
1717
- 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 });
1718
2007
  }
1719
- 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 });
1720
2009
  }
1721
2010
  function TermBlock({
1722
2011
  command,
@@ -1742,13 +2031,13 @@ function TermBlock({
1742
2031
  ),
1743
2032
  children: [
1744
2033
  showHeader ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pb-1", children: [
1745
- /* @__PURE__ */ jsx6("span", { className: "select-none text-og-status-idle", children: "$" }),
1746
- 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" }),
1747
- 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
1748
2037
  ] }) : null,
1749
- 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: [
1750
2039
  shown,
1751
- 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
1752
2041
  ] }),
1753
2042
  showMore ? /* @__PURE__ */ jsxs5(
1754
2043
  "button",
@@ -1784,8 +2073,8 @@ function PayloadBlock({
1784
2073
  failed ? "border-og-status-failed/50" : "border-og-border"
1785
2074
  ),
1786
2075
  children: [
1787
- /* @__PURE__ */ jsx6("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: label }),
1788
- /* @__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(
1789
2078
  "pre",
1790
2079
  {
1791
2080
  className: cn(
@@ -1804,9 +2093,9 @@ function BodyNote({
1804
2093
  tone
1805
2094
  }) {
1806
2095
  if (tone === "error") {
1807
- 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 });
1808
2097
  }
1809
- 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 });
1810
2099
  }
1811
2100
  var MEDIA_BOX = "h-7 w-[52px] shrink-0 rounded-og-xs border border-og-border";
1812
2101
  function MediaSkeleton() {
@@ -1818,14 +2107,14 @@ function MediaSkeleton() {
1818
2107
  "relative inline-flex items-center justify-center overflow-hidden bg-og-surface-2"
1819
2108
  ),
1820
2109
  children: [
1821
- /* @__PURE__ */ jsx6("span", { className: "absolute inset-0 animate-og-pulse bg-og-surface-3/50" }),
1822
- /* @__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" })
1823
2112
  ]
1824
2113
  }
1825
2114
  );
1826
2115
  }
1827
2116
  function MediaEmpty() {
1828
- 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" }) });
1829
2118
  }
1830
2119
  function Thumbnail({
1831
2120
  src,
@@ -1835,9 +2124,9 @@ function Thumbnail({
1835
2124
  const lightbox = useLightboxOptional();
1836
2125
  const [failed, setFailed] = useState4(false);
1837
2126
  if (failed) {
1838
- return /* @__PURE__ */ jsx6(MediaEmpty, {});
2127
+ return /* @__PURE__ */ jsx7(MediaEmpty, {});
1839
2128
  }
1840
- const img = /* @__PURE__ */ jsx6(
2129
+ const img = /* @__PURE__ */ jsx7(
1841
2130
  "img",
1842
2131
  {
1843
2132
  src,
@@ -1847,9 +2136,9 @@ function Thumbnail({
1847
2136
  }
1848
2137
  );
1849
2138
  if (!lightbox) {
1850
- 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 });
1851
2140
  }
1852
- return /* @__PURE__ */ jsx6(
2141
+ return /* @__PURE__ */ jsx7(
1853
2142
  "button",
1854
2143
  {
1855
2144
  type: "button",
@@ -1880,7 +2169,7 @@ function ScreenshotFigure({
1880
2169
  const lightbox = useLightboxOptional();
1881
2170
  const [failed, setFailed] = useState4(false);
1882
2171
  const surface = "block w-full overflow-hidden rounded-og-md border border-og-border bg-og-bg";
1883
- const img = /* @__PURE__ */ jsx6(
2172
+ const img = /* @__PURE__ */ jsx7(
1884
2173
  "img",
1885
2174
  {
1886
2175
  src,
@@ -1890,7 +2179,7 @@ function ScreenshotFigure({
1890
2179
  }
1891
2180
  );
1892
2181
  return /* @__PURE__ */ jsxs5("figure", { className: "m-0 min-w-0", children: [
1893
- 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(
1894
2183
  "button",
1895
2184
  {
1896
2185
  type: "button",
@@ -1899,8 +2188,8 @@ function ScreenshotFigure({
1899
2188
  "aria-label": "Expand screenshot",
1900
2189
  children: img
1901
2190
  }
1902
- ) : /* @__PURE__ */ jsx6("div", { className: surface, children: img }),
1903
- 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
1904
2193
  ] });
1905
2194
  }
1906
2195
 
@@ -1937,10 +2226,10 @@ function gitFileDiffToPatch(file) {
1937
2226
  import {
1938
2227
  lazy as lazy2,
1939
2228
  Suspense as Suspense2,
1940
- useEffect as useEffect3,
2229
+ useEffect as useEffect4,
1941
2230
  useState as useState5
1942
2231
  } from "react";
1943
- import { jsx as jsx7 } from "react/jsx-runtime";
2232
+ import { jsx as jsx8 } from "react/jsx-runtime";
1944
2233
  var LazyPatchDiff = lazy2(async () => {
1945
2234
  const mod = await import("@pierre/diffs/react");
1946
2235
  return { default: mod.PatchDiff };
@@ -1959,7 +2248,7 @@ function PierreDiff({
1959
2248
  }) {
1960
2249
  const [failed, setFailed] = useState5(false);
1961
2250
  const [forcedColors, setForcedColors] = useState5(false);
1962
- useEffect3(() => {
2251
+ useEffect4(() => {
1963
2252
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
1964
2253
  const query2 = window.matchMedia("(forced-colors: active)");
1965
2254
  const update = () => setForcedColors(query2.matches);
@@ -1967,7 +2256,7 @@ function PierreDiff({
1967
2256
  query2.addEventListener?.("change", update);
1968
2257
  return () => query2.removeEventListener?.("change", update);
1969
2258
  }, []);
1970
- useEffect3(() => {
2259
+ useEffect4(() => {
1971
2260
  if (plain) return;
1972
2261
  let cancelled = false;
1973
2262
  void import("@pierre/diffs/react").catch(() => {
@@ -1978,12 +2267,12 @@ function PierreDiff({
1978
2267
  };
1979
2268
  }, [plain]);
1980
2269
  if (plain || failed || forcedColors) {
1981
- return /* @__PURE__ */ jsx7(
2270
+ return /* @__PURE__ */ jsx8(
1982
2271
  "div",
1983
2272
  {
1984
2273
  className,
1985
2274
  "data-opengeni-plain-diff": forcedColors ? "forced-colors" : "fallback",
1986
- children: fallback ?? /* @__PURE__ */ jsx7(PlainPatch, { diff })
2275
+ children: fallback ?? /* @__PURE__ */ jsx8(PlainPatch, { diff })
1987
2276
  }
1988
2277
  );
1989
2278
  }
@@ -2017,7 +2306,7 @@ function PierreDiff({
2017
2306
  "--diffs-font-size": "var(--og-code-font-size)",
2018
2307
  "--diffs-line-height": "var(--og-code-line-height)"
2019
2308
  };
2020
- 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(
2021
2310
  LazyPatchDiff,
2022
2311
  {
2023
2312
  patch: gitFileDiffToPatch(file),
@@ -2027,20 +2316,20 @@ function PierreDiff({
2027
2316
  ) }, file.path)) }) });
2028
2317
  }
2029
2318
  function DiffSkeleton() {
2030
- 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" });
2031
2320
  }
2032
2321
  function PlainPatch({ diff }) {
2033
2322
  if (diff.length === 0) {
2034
- 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" });
2035
2324
  }
2036
- 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(
2037
2326
  "pre",
2038
2327
  {
2039
2328
  "aria-label": `Diff for ${file.path}`,
2040
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",
2041
2330
  role: "region",
2042
2331
  tabIndex: 0,
2043
- children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */ jsx7(
2332
+ children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */ jsx8(
2044
2333
  "span",
2045
2334
  {
2046
2335
  className: cn(
@@ -2071,6 +2360,7 @@ import {
2071
2360
  KeyboardIcon,
2072
2361
  KeyRoundIcon,
2073
2362
  LockIcon,
2363
+ MessageCircleQuestionIcon as MessageCircleQuestionIcon2,
2074
2364
  MessagesSquareIcon,
2075
2365
  MessageSquareIcon,
2076
2366
  MousePointer2Icon,
@@ -2085,14 +2375,22 @@ import {
2085
2375
  WrenchIcon
2086
2376
  } from "lucide-react";
2087
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
+
2088
2386
  // src/timeline/tool-diff.tsx
2089
2387
  import { useState as useState7 } from "react";
2090
2388
 
2091
2389
  // src/lib/use-theme-type.ts
2092
- import { useEffect as useEffect4, useState as useState6 } from "react";
2390
+ import { useEffect as useEffect5, useState as useState6 } from "react";
2093
2391
  function useThemeType(forced) {
2094
2392
  const [detected, setDetected] = useState6("dark");
2095
- useEffect4(() => {
2393
+ useEffect5(() => {
2096
2394
  if (forced || typeof document === "undefined") return;
2097
2395
  const read = () => {
2098
2396
  const el = document.querySelector("[data-og-theme]");
@@ -2112,20 +2410,20 @@ function useThemeType(forced) {
2112
2410
  }
2113
2411
 
2114
2412
  // src/timeline/tool-diff.tsx
2115
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2413
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2116
2414
  function ToolDiff({ files }) {
2117
2415
  const [layout, setLayout] = useState7("unified");
2118
2416
  const themeType = useThemeType(void 0);
2119
2417
  return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2120
- /* @__PURE__ */ jsx8("div", { className: "mb-1.5 flex justify-end", children: /* @__PURE__ */ jsx8(LayoutToggle, { layout, onChange: setLayout }) }),
2121
- /* @__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 })
2122
2420
  ] });
2123
2421
  }
2124
2422
  function LayoutToggle({
2125
2423
  layout,
2126
2424
  onChange
2127
2425
  }) {
2128
- 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(
2129
2427
  "button",
2130
2428
  {
2131
2429
  type: "button",
@@ -2147,8 +2445,8 @@ function RawPatch({ diff }) {
2147
2445
  return { key: `${line}\0${occurrence}`, line };
2148
2446
  });
2149
2447
  return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2150
- /* @__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)" }),
2151
- /* @__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(
2152
2450
  "span",
2153
2451
  {
2154
2452
  className: cn(
@@ -2163,14 +2461,20 @@ function RawPatch({ diff }) {
2163
2461
  }
2164
2462
 
2165
2463
  // src/timeline/tool-renderers.tsx
2166
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2464
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
2167
2465
  var ICON_SIZE = "size-3.5";
2168
2466
  function RunningPreview({ children }) {
2169
2467
  return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-1.5", children: [
2170
- /* @__PURE__ */ jsx9("span", { className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-status-running" }),
2171
- /* @__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 })
2172
2470
  ] });
2173
2471
  }
2472
+ function withComputePreview(label, preview) {
2473
+ if (!label) {
2474
+ return preview;
2475
+ }
2476
+ return `on ${label} \xB7 ${preview}`;
2477
+ }
2174
2478
  function ExecRenderer({ item }) {
2175
2479
  const args = parseToolArgs(item.arguments);
2176
2480
  const cmd = typeof args.cmd === "string" ? args.cmd : "";
@@ -2178,46 +2482,48 @@ function ExecRenderer({ item }) {
2178
2482
  const running = item.status === "running";
2179
2483
  const out = item.output;
2180
2484
  const title = `$ ${cmd}`;
2485
+ const computeLabel = useTimelineComputeLabel();
2181
2486
  if (item.status === "failed" && out === void 0) {
2182
- return /* @__PURE__ */ jsx9(
2487
+ return /* @__PURE__ */ jsx10(
2183
2488
  ActivityDisclosure,
2184
2489
  {
2185
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2490
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2186
2491
  iconTone: "failed",
2187
2492
  title,
2188
2493
  titleMono: true,
2189
2494
  chip: { tone: "bad", text: "failed" },
2190
- preview: "output lost \u2014 NUL byte could not be stored",
2191
- 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." })
2192
2497
  }
2193
2498
  );
2194
2499
  }
2195
2500
  if (item.status === "failed" && (out == null || out === "")) {
2196
- return /* @__PURE__ */ jsx9(
2501
+ return /* @__PURE__ */ jsx10(
2197
2502
  ActivityDisclosure,
2198
2503
  {
2199
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2504
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2200
2505
  iconTone: "failed",
2201
2506
  title,
2202
2507
  titleMono: true,
2203
2508
  chip: { tone: "bad", text: "failed" },
2204
- preview: "tool call failed",
2205
- 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." })
2206
2511
  }
2207
2512
  );
2208
2513
  }
2209
2514
  if (running) {
2210
2515
  const streamed = typeof out === "string" ? stripExecBanner(out) : "";
2211
- return /* @__PURE__ */ jsx9(
2516
+ const runningPreview = streamed ? `${streamed.split("\n").length} lines` : "running\u2026";
2517
+ return /* @__PURE__ */ jsx10(
2212
2518
  ActivityDisclosure,
2213
2519
  {
2214
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2520
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2215
2521
  iconTone: "running",
2216
2522
  title,
2217
2523
  titleMono: true,
2218
2524
  running: true,
2219
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: streamed ? `${streamed.split("\n").length} lines` : "running\u2026" }),
2220
- 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 })
2221
2527
  }
2222
2528
  );
2223
2529
  }
@@ -2234,22 +2540,23 @@ function ExecRenderer({ item }) {
2234
2540
  chip = { tone: "bad", text: `exit ${exitCode}` };
2235
2541
  iconTone = "failed";
2236
2542
  }
2237
- const preview = binary ? "binary output" : tailPeek(stripped) || "(no output)";
2543
+ const peek = binary ? "binary output" : tailPeek(stripped) || "(no output)";
2238
2544
  const truncated = execTruncated(text);
2545
+ const preview = withComputePreview(computeLabel, truncated ? `\u22EF truncated \xB7 ${peek}` : peek);
2239
2546
  const body = binary ? "(binary output suppressed)" : stripped;
2240
2547
  return /* @__PURE__ */ jsxs7(
2241
2548
  ActivityDisclosure,
2242
2549
  {
2243
- icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
2550
+ icon: /* @__PURE__ */ jsx10(TerminalIcon, { className: ICON_SIZE }),
2244
2551
  iconTone,
2245
2552
  title,
2246
2553
  titleMono: true,
2247
2554
  ...chip ? { chip } : {},
2248
2555
  failed: item.status === "failed",
2249
2556
  cancelled: item.status === "cancelled",
2250
- preview: truncated ? `\u22EF truncated \xB7 ${preview}` : preview,
2557
+ preview,
2251
2558
  children: [
2252
- /* @__PURE__ */ jsx9(
2559
+ /* @__PURE__ */ jsx10(
2253
2560
  TermBlock,
2254
2561
  {
2255
2562
  command: null,
@@ -2277,15 +2584,15 @@ function WriteStdinRenderer({ item }) {
2277
2584
  const exitCode = sandboxCommandExitCode(text);
2278
2585
  const stripped = stripExecBanner(text);
2279
2586
  if (running) {
2280
- return /* @__PURE__ */ jsx9(
2587
+ return /* @__PURE__ */ jsx10(
2281
2588
  ActivityDisclosure,
2282
2589
  {
2283
- icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
2590
+ icon: /* @__PURE__ */ jsx10(KeyboardIcon, { className: ICON_SIZE }),
2284
2591
  iconTone: "running",
2285
2592
  title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
2286
2593
  titleMono: true,
2287
2594
  running: true,
2288
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "sending\u2026" }),
2595
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "sending\u2026" }),
2289
2596
  children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
2290
2597
  "sending input to session ",
2291
2598
  sessionId,
@@ -2300,10 +2607,10 @@ function WriteStdinRenderer({ item }) {
2300
2607
  } else if (exitCode != null && exitCode !== 0) {
2301
2608
  chip = { tone: "bad", text: `exit ${exitCode}` };
2302
2609
  }
2303
- return /* @__PURE__ */ jsx9(
2610
+ return /* @__PURE__ */ jsx10(
2304
2611
  ActivityDisclosure,
2305
2612
  {
2306
- icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
2613
+ icon: /* @__PURE__ */ jsx10(KeyboardIcon, { className: ICON_SIZE }),
2307
2614
  iconTone: lost ? "failed" : "muted",
2308
2615
  title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
2309
2616
  titleMono: true,
@@ -2311,7 +2618,7 @@ function WriteStdinRenderer({ item }) {
2311
2618
  failed: item.status === "failed",
2312
2619
  cancelled: item.status === "cancelled",
2313
2620
  preview: lost ? `session ${sessionId} PTY vanished` : tailPeek(stripped) || "sent",
2314
- 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 })
2315
2622
  }
2316
2623
  );
2317
2624
  }
@@ -2336,8 +2643,8 @@ function PathPreview({
2336
2643
  }) {
2337
2644
  return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
2338
2645
  /* @__PURE__ */ jsxs7("span", { className: "truncate", children: [
2339
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: dirname(path) }),
2340
- /* @__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) })
2341
2648
  ] }),
2342
2649
  add != null || del != null ? /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-og-fg-subtle", children: [
2343
2650
  add != null ? `+${add}` : "",
@@ -2355,34 +2662,34 @@ function ApplyPatchRenderer({ item }) {
2355
2662
  if (running) {
2356
2663
  const fileCount = ops.length;
2357
2664
  const titleVerb = firstOp ? `Applying ${basename(firstOp.path)}` : "Applying patch";
2358
- return /* @__PURE__ */ jsx9(
2665
+ return /* @__PURE__ */ jsx10(
2359
2666
  ActivityDisclosure,
2360
2667
  {
2361
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2668
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2362
2669
  iconTone: "running",
2363
2670
  title: fileCount > 1 ? `Applying ${fileCount} files` : titleVerb,
2364
2671
  running: true,
2365
- 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" }),
2366
2673
  children: ops.map((op) => {
2367
2674
  const file2 = safeParseOp(op);
2368
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2369
- /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2370
- /* @__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 ?? "" })
2371
2678
  ] }, op.path);
2372
2679
  })
2373
2680
  }
2374
2681
  );
2375
2682
  }
2376
2683
  if (failed) {
2377
- return /* @__PURE__ */ jsx9(
2684
+ return /* @__PURE__ */ jsx10(
2378
2685
  ActivityDisclosure,
2379
2686
  {
2380
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2687
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2381
2688
  iconTone: "failed",
2382
2689
  title: firstOp ? `${verbForOp(firstOp)} ${basename(firstOp.path)}` : "apply_patch",
2383
2690
  chip: { tone: "bad", text: "failed" },
2384
2691
  preview: typeof item.output === "string" ? item.output : "patch failed",
2385
- children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: item.output, failed: true })
2692
+ children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: item.output, failed: true })
2386
2693
  }
2387
2694
  );
2388
2695
  }
@@ -2391,10 +2698,10 @@ function ApplyPatchRenderer({ item }) {
2391
2698
  const goodFiles = parsed.filter((f) => f !== null);
2392
2699
  const add = goodFiles.reduce((n, f) => n + f.additions, 0);
2393
2700
  const del = goodFiles.reduce((n, f) => n + f.deletions, 0);
2394
- return /* @__PURE__ */ jsx9(
2701
+ return /* @__PURE__ */ jsx10(
2395
2702
  ActivityDisclosure,
2396
2703
  {
2397
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2704
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2398
2705
  iconTone: "accent",
2399
2706
  title: `Edited ${ops.length} files`,
2400
2707
  cancelled,
@@ -2412,56 +2719,56 @@ function ApplyPatchRenderer({ item }) {
2412
2719
  ] }),
2413
2720
  children: ops.map((op, index) => {
2414
2721
  const file2 = parsed[index];
2415
- return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
2416
- /* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
2417
- /* @__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 ?? "" })
2418
2725
  ] }, op.path);
2419
2726
  })
2420
2727
  }
2421
2728
  );
2422
2729
  }
2423
2730
  if (!firstOp) {
2424
- return /* @__PURE__ */ jsx9(GenericRenderer, { item });
2731
+ return /* @__PURE__ */ jsx10(GenericRenderer, { item });
2425
2732
  }
2426
2733
  if (firstOp.type === "delete_file") {
2427
- return /* @__PURE__ */ jsx9(
2734
+ return /* @__PURE__ */ jsx10(
2428
2735
  ActivityDisclosure,
2429
2736
  {
2430
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2737
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2431
2738
  iconTone: "failed",
2432
2739
  title: `Deleted ${basename(firstOp.path)}`,
2433
2740
  cancelled,
2434
- preview: /* @__PURE__ */ jsx9(PathPreview, { path: firstOp.path }),
2435
- 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." })
2436
2743
  }
2437
2744
  );
2438
2745
  }
2439
2746
  const file = safeParseOp(firstOp);
2440
2747
  if (!file) {
2441
- return /* @__PURE__ */ jsx9(
2748
+ return /* @__PURE__ */ jsx10(
2442
2749
  ActivityDisclosure,
2443
2750
  {
2444
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2751
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2445
2752
  iconTone: "accent",
2446
2753
  title: `${verbForOp(firstOp)} ${basename(firstOp.path)}`,
2447
2754
  cancelled,
2448
2755
  preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
2449
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
2450
- /* @__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" })
2451
2758
  ] }),
2452
- children: /* @__PURE__ */ jsx9(RawPatch, { diff: firstOp.diff ?? "" })
2759
+ children: /* @__PURE__ */ jsx10(RawPatch, { diff: firstOp.diff ?? "" })
2453
2760
  }
2454
2761
  );
2455
2762
  }
2456
- return /* @__PURE__ */ jsx9(
2763
+ return /* @__PURE__ */ jsx10(
2457
2764
  ActivityDisclosure,
2458
2765
  {
2459
- icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
2766
+ icon: /* @__PURE__ */ jsx10(FileDiffIcon, { className: ICON_SIZE }),
2460
2767
  iconTone: "accent",
2461
2768
  title: `${verbForOp(firstOp)} ${basename(file.path)}`,
2462
2769
  cancelled,
2463
- preview: /* @__PURE__ */ jsx9(PathPreview, { path: file.path, add: file.additions, del: file.deletions }),
2464
- 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] })
2465
2772
  }
2466
2773
  );
2467
2774
  }
@@ -2535,40 +2842,40 @@ function ComputerCallRenderer({ item }) {
2535
2842
  const countSuffix = actions.length > 1 ? ` \xB7${actions.length}` : "";
2536
2843
  const isShot = action?.type === "screenshot";
2537
2844
  if (running) {
2538
- return /* @__PURE__ */ jsx9(
2845
+ return /* @__PURE__ */ jsx10(
2539
2846
  ActivityDisclosure,
2540
2847
  {
2541
- 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 }),
2542
2849
  iconTone: "running",
2543
2850
  title: verb,
2544
2851
  running: true,
2545
- media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
2546
- children: /* @__PURE__ */ jsx9(BodyNote, { children: "capturing frame\u2026" })
2852
+ media: /* @__PURE__ */ jsx10(MediaSkeleton, {}),
2853
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: "capturing frame\u2026" })
2547
2854
  }
2548
2855
  );
2549
2856
  }
2550
2857
  if (readOnly) {
2551
- return /* @__PURE__ */ jsx9(
2858
+ return /* @__PURE__ */ jsx10(
2552
2859
  ActivityDisclosure,
2553
2860
  {
2554
- icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2861
+ icon: /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2555
2862
  iconTone: "failed",
2556
2863
  title: verb,
2557
2864
  chip: { tone: "bad", text: "read-only" },
2558
2865
  preview: "write actions disabled",
2559
- 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." })
2560
2867
  }
2561
2868
  );
2562
2869
  }
2563
2870
  if (rejected) {
2564
- return /* @__PURE__ */ jsx9(
2871
+ return /* @__PURE__ */ jsx10(
2565
2872
  ActivityDisclosure,
2566
2873
  {
2567
- icon: /* @__PURE__ */ jsx9(LockIcon, { className: ICON_SIZE }),
2874
+ icon: /* @__PURE__ */ jsx10(LockIcon, { className: ICON_SIZE }),
2568
2875
  iconTone: "muted",
2569
2876
  title: verb,
2570
2877
  preview: "approval rejected \u2014 this action did not run",
2571
- 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." })
2572
2879
  }
2573
2880
  );
2574
2881
  }
@@ -2579,14 +2886,14 @@ function ComputerCallRenderer({ item }) {
2579
2886
  return /* @__PURE__ */ jsxs7(
2580
2887
  ActivityDisclosure,
2581
2888
  {
2582
- 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 }),
2583
2890
  iconTone: isFailed ? "failed" : "accent",
2584
2891
  title: `${verb}${countSuffix}`,
2585
2892
  failed: isFailed,
2586
2893
  cancelled: isCancelled,
2587
- media: /* @__PURE__ */ jsx9(Thumbnail, { src: shotUrl, caption }),
2894
+ media: /* @__PURE__ */ jsx10(Thumbnail, { src: shotUrl, caption }),
2588
2895
  children: [
2589
- /* @__PURE__ */ jsx9(ScreenshotFigure, { src: shotUrl, caption }),
2896
+ /* @__PURE__ */ jsx10(ScreenshotFigure, { src: shotUrl, caption }),
2590
2897
  batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
2591
2898
  "batched: ",
2592
2899
  batched
@@ -2599,13 +2906,13 @@ function ComputerCallRenderer({ item }) {
2599
2906
  return /* @__PURE__ */ jsxs7(
2600
2907
  ActivityDisclosure,
2601
2908
  {
2602
- icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
2909
+ icon: /* @__PURE__ */ jsx10(CameraOffIcon2, { className: ICON_SIZE }),
2603
2910
  iconTone: isFailed ? "failed" : "muted",
2604
2911
  title: `${verb}${countSuffix} \xB7 image omitted \xB7 not retained`,
2605
2912
  failed: isFailed,
2606
2913
  cancelled: isCancelled,
2607
2914
  preview: "inline image omitted \xB7 not retained",
2608
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
2915
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
2609
2916
  children: [
2610
2917
  /* @__PURE__ */ jsxs7(BodyNote, { children: [
2611
2918
  "The inline ",
@@ -2621,30 +2928,30 @@ function ComputerCallRenderer({ item }) {
2621
2928
  );
2622
2929
  }
2623
2930
  if (empty) {
2624
- return /* @__PURE__ */ jsx9(
2931
+ return /* @__PURE__ */ jsx10(
2625
2932
  ActivityDisclosure,
2626
2933
  {
2627
- icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
2934
+ icon: /* @__PURE__ */ jsx10(CameraOffIcon2, { className: ICON_SIZE }),
2628
2935
  iconTone: isFailed ? "failed" : "muted",
2629
2936
  title: verb,
2630
2937
  failed: isFailed,
2631
2938
  cancelled: isCancelled,
2632
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
2633
- 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." })
2634
2941
  }
2635
2942
  );
2636
2943
  }
2637
- return /* @__PURE__ */ jsx9(
2944
+ return /* @__PURE__ */ jsx10(
2638
2945
  ActivityDisclosure,
2639
2946
  {
2640
- icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
2947
+ icon: /* @__PURE__ */ jsx10(MousePointer2Icon, { className: ICON_SIZE }),
2641
2948
  iconTone: isFailed ? "failed" : "accent",
2642
2949
  title: verb,
2643
2950
  failed: isFailed,
2644
2951
  cancelled: isCancelled,
2645
2952
  preview: batched ?? void 0,
2646
2953
  expandable: batched != null,
2647
- children: batched ? /* @__PURE__ */ jsx9(BodyNote, { children: batched }) : null
2954
+ children: batched ? /* @__PURE__ */ jsx10(BodyNote, { children: batched }) : null
2648
2955
  }
2649
2956
  );
2650
2957
  }
@@ -2704,38 +3011,38 @@ function WebSearchRenderer({ item }) {
2704
3011
  return { key: `${contentKey}\0${occurrence}`, result };
2705
3012
  });
2706
3013
  if (running) {
2707
- return /* @__PURE__ */ jsx9(
3014
+ return /* @__PURE__ */ jsx10(
2708
3015
  ActivityDisclosure,
2709
3016
  {
2710
- icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
3017
+ icon: /* @__PURE__ */ jsx10(SearchIcon, { className: ICON_SIZE }),
2711
3018
  iconTone: "running",
2712
3019
  title: runningTitle,
2713
3020
  running: true,
2714
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: `${query2}${variants}` }),
2715
- 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)." })
2716
3023
  }
2717
3024
  );
2718
3025
  }
2719
- return /* @__PURE__ */ jsx9(
3026
+ return /* @__PURE__ */ jsx10(
2720
3027
  ActivityDisclosure,
2721
3028
  {
2722
- icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
3029
+ icon: /* @__PURE__ */ jsx10(SearchIcon, { className: ICON_SIZE }),
2723
3030
  iconTone: "muted",
2724
3031
  title: completedTitle,
2725
3032
  preview: `${query2}${variants}`,
2726
3033
  failed: item.status === "failed",
2727
3034
  cancelled: item.status === "cancelled",
2728
- 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: [
2729
- /* @__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" }),
2730
3037
  /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2731
3038
  /* @__PURE__ */ jsxs7("p", { className: "truncate text-og-base text-og-fg", children: [
2732
3039
  result.title,
2733
3040
  " ",
2734
- /* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
3041
+ /* @__PURE__ */ jsx10("span", { className: "text-og-fg-subtle", children: result.domain })
2735
3042
  ] }),
2736
- /* @__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 })
2737
3044
  ] })
2738
- ] }, 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." })
2739
3046
  }
2740
3047
  );
2741
3048
  }
@@ -2753,16 +3060,16 @@ function ViewImageRenderer({ item }) {
2753
3060
  const text = typeof out === "string" ? out : "";
2754
3061
  const omittedMedia = mediaPreviewFact(out);
2755
3062
  if (item.status === "running") {
2756
- return /* @__PURE__ */ jsx9(
3063
+ return /* @__PURE__ */ jsx10(
2757
3064
  ActivityDisclosure,
2758
3065
  {
2759
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3066
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2760
3067
  iconTone: "running",
2761
3068
  title: `View ${basename(path)}`,
2762
3069
  running: true,
2763
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "reading\u2026" }),
2764
- media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
2765
- 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" })
2766
3073
  }
2767
3074
  );
2768
3075
  }
@@ -2771,43 +3078,43 @@ function ViewImageRenderer({ item }) {
2771
3078
  const errMatch = VIEW_IMAGE_ERRORS.find((p) => text.includes(p));
2772
3079
  if (errMatch) {
2773
3080
  const tooBig = text.includes("exceeded the allowed size");
2774
- return /* @__PURE__ */ jsx9(
3081
+ return /* @__PURE__ */ jsx10(
2775
3082
  ActivityDisclosure,
2776
3083
  {
2777
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3084
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2778
3085
  iconTone: "failed",
2779
3086
  title: `View ${basename(path)}`,
2780
3087
  chip: { tone: "bad", text: tooBig ? "too large" : "error" },
2781
3088
  preview: text,
2782
- children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: text })
3089
+ children: /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: text })
2783
3090
  }
2784
3091
  );
2785
3092
  }
2786
3093
  if (text.startsWith("OpenAI file reference:")) {
2787
- return /* @__PURE__ */ jsx9(
3094
+ return /* @__PURE__ */ jsx10(
2788
3095
  ActivityDisclosure,
2789
3096
  {
2790
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3097
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2791
3098
  iconTone: viewFailed ? "failed" : "muted",
2792
3099
  title: `Viewed ${basename(path)}`,
2793
3100
  failed: viewFailed,
2794
3101
  cancelled: viewCancelled,
2795
3102
  preview: path,
2796
- children: /* @__PURE__ */ jsx9(BodyNote, { children: text })
3103
+ children: /* @__PURE__ */ jsx10(BodyNote, { children: text })
2797
3104
  }
2798
3105
  );
2799
3106
  }
2800
3107
  if (omittedMedia) {
2801
- return /* @__PURE__ */ jsx9(
3108
+ return /* @__PURE__ */ jsx10(
2802
3109
  ActivityDisclosure,
2803
3110
  {
2804
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3111
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2805
3112
  iconTone: viewFailed ? "failed" : "muted",
2806
3113
  title: `Viewed ${basename(path)} \xB7 image omitted \xB7 not retained`,
2807
3114
  failed: viewFailed,
2808
3115
  cancelled: viewCancelled,
2809
3116
  preview: "inline image omitted \xB7 not retained",
2810
- media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
3117
+ media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
2811
3118
  children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
2812
3119
  "The inline ",
2813
3120
  omittedMedia.mediaType,
@@ -2817,48 +3124,48 @@ function ViewImageRenderer({ item }) {
2817
3124
  );
2818
3125
  }
2819
3126
  if (text.includes("No image data")) {
2820
- return /* @__PURE__ */ jsx9(
3127
+ return /* @__PURE__ */ jsx10(
2821
3128
  ActivityDisclosure,
2822
3129
  {
2823
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3130
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2824
3131
  iconTone: viewFailed ? "failed" : "muted",
2825
3132
  title: `Viewed ${basename(path)}`,
2826
3133
  failed: viewFailed,
2827
3134
  cancelled: viewCancelled,
2828
3135
  preview: "(no image)",
2829
- 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." })
2830
3137
  }
2831
3138
  );
2832
3139
  }
2833
3140
  if (text.startsWith("data:")) {
2834
- return /* @__PURE__ */ jsx9(
3141
+ return /* @__PURE__ */ jsx10(
2835
3142
  ActivityDisclosure,
2836
3143
  {
2837
- icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
3144
+ icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
2838
3145
  iconTone: viewFailed ? "failed" : "accent",
2839
3146
  title: `Viewed ${basename(path)}`,
2840
3147
  failed: viewFailed,
2841
3148
  cancelled: viewCancelled,
2842
- media: /* @__PURE__ */ jsx9(Thumbnail, { src: text, caption: path, alt: path }),
2843
- 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 })
2844
3151
  }
2845
3152
  );
2846
3153
  }
2847
- return /* @__PURE__ */ jsx9(GenericRenderer, { item });
3154
+ return /* @__PURE__ */ jsx10(GenericRenderer, { item });
2848
3155
  }
2849
3156
  function SecretSetRenderer({ item }) {
2850
3157
  const args = parseToolArgs(item.arguments);
2851
3158
  const name = typeof args.name === "string" ? args.name : "variable";
2852
3159
  if (item.status === "running") {
2853
- return /* @__PURE__ */ jsx9(
3160
+ return /* @__PURE__ */ jsx10(
2854
3161
  ActivityDisclosure,
2855
3162
  {
2856
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3163
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2857
3164
  iconTone: "running",
2858
3165
  title: `Set ${name}`,
2859
3166
  running: true,
2860
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "setting\u2026" }),
2861
- 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) })
2862
3169
  }
2863
3170
  );
2864
3171
  }
@@ -2867,14 +3174,14 @@ function SecretSetRenderer({ item }) {
2867
3174
  return /* @__PURE__ */ jsxs7(
2868
3175
  ActivityDisclosure,
2869
3176
  {
2870
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3177
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2871
3178
  iconTone: "failed",
2872
3179
  title: `Set ${name}`,
2873
3180
  failed: true,
2874
3181
  preview: errorText ?? "variable write failed",
2875
3182
  children: [
2876
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2877
- 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." })
2878
3185
  ]
2879
3186
  }
2880
3187
  );
@@ -2882,14 +3189,14 @@ function SecretSetRenderer({ item }) {
2882
3189
  return /* @__PURE__ */ jsxs7(
2883
3190
  ActivityDisclosure,
2884
3191
  {
2885
- icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
3192
+ icon: /* @__PURE__ */ jsx10(KeyRoundIcon, { className: ICON_SIZE }),
2886
3193
  iconTone: "muted",
2887
3194
  title: `Set ${name}`,
2888
3195
  cancelled: item.status === "cancelled",
2889
3196
  preview: "value write-only \xB7 never returned",
2890
3197
  children: [
2891
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2892
- /* @__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." })
2893
3200
  ]
2894
3201
  }
2895
3202
  );
@@ -2900,15 +3207,15 @@ function DocsSearchRenderer({ item }) {
2900
3207
  const title = query2 ? `Search \u201C${truncatePreview(query2, 48)}\u201D` : toolDisplayName(item.name);
2901
3208
  const running = item.status === "running";
2902
3209
  if (running) {
2903
- return /* @__PURE__ */ jsx9(
3210
+ return /* @__PURE__ */ jsx10(
2904
3211
  ActivityDisclosure,
2905
3212
  {
2906
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3213
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2907
3214
  iconTone: "running",
2908
3215
  title,
2909
3216
  running: true,
2910
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Searching\u2026" }),
2911
- 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) })
2912
3219
  }
2913
3220
  );
2914
3221
  }
@@ -2917,14 +3224,14 @@ function DocsSearchRenderer({ item }) {
2917
3224
  return /* @__PURE__ */ jsxs7(
2918
3225
  ActivityDisclosure,
2919
3226
  {
2920
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3227
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2921
3228
  iconTone: "failed",
2922
3229
  title,
2923
3230
  failed: true,
2924
3231
  preview: truncatePreview(outText, 80) || "Search failed",
2925
3232
  children: [
2926
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2927
- /* @__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 })
2928
3235
  ]
2929
3236
  }
2930
3237
  );
@@ -2934,18 +3241,18 @@ function DocsSearchRenderer({ item }) {
2934
3241
  return /* @__PURE__ */ jsxs7(
2935
3242
  ActivityDisclosure,
2936
3243
  {
2937
- icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
3244
+ icon: /* @__PURE__ */ jsx10(FileSearchIcon, { className: ICON_SIZE }),
2938
3245
  iconTone: "muted",
2939
3246
  title,
2940
3247
  cancelled: item.status === "cancelled",
2941
3248
  preview,
2942
3249
  children: [
2943
- 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: [
2944
- /* @__PURE__ */ jsx9("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
2945
- 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
2946
3253
  ] }, `${hit.title}\0${hit.snippet}`)) }) : null,
2947
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2948
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
3254
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3255
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
2949
3256
  ]
2950
3257
  }
2951
3258
  );
@@ -2955,17 +3262,17 @@ function SetSessionTitleRenderer({ item }) {
2955
3262
  const titleArg = typeof args.title === "string" ? args.title.trim() : "";
2956
3263
  const display = toolDisplayName(item.name);
2957
3264
  const previewTitle = titleArg ? truncatePreview(titleArg, 72) : "";
2958
- const icon = /* @__PURE__ */ jsx9(MessagesSquareIcon, { className: ICON_SIZE });
3265
+ const icon = /* @__PURE__ */ jsx10(MessagesSquareIcon, { className: ICON_SIZE });
2959
3266
  if (item.status === "running") {
2960
- return /* @__PURE__ */ jsx9(
3267
+ return /* @__PURE__ */ jsx10(
2961
3268
  ActivityDisclosure,
2962
3269
  {
2963
3270
  icon,
2964
3271
  iconTone: "running",
2965
3272
  title: display,
2966
3273
  running: true,
2967
- preview: previewTitle ? /* @__PURE__ */ jsx9(RunningPreview, { children: previewTitle }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Setting title\u2026" }),
2968
- 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) })
2969
3276
  }
2970
3277
  );
2971
3278
  }
@@ -2980,8 +3287,8 @@ function SetSessionTitleRenderer({ item }) {
2980
3287
  failed: true,
2981
3288
  preview: truncatePreview(outText, 80) || "Rename failed",
2982
3289
  children: [
2983
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
2984
- /* @__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 })
2985
3292
  ]
2986
3293
  }
2987
3294
  );
@@ -3005,8 +3312,8 @@ function SetSessionTitleRenderer({ item }) {
3005
3312
  cancelled: item.status === "cancelled",
3006
3313
  preview: item.status === "cancelled" ? void 0 : settledTitle || void 0,
3007
3314
  children: [
3008
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
3009
- 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
3010
3317
  ]
3011
3318
  }
3012
3319
  );
@@ -3033,15 +3340,15 @@ function MemoryProposeRenderer({ item }) {
3033
3340
  const title = "Propose memory";
3034
3341
  const running = item.status === "running";
3035
3342
  if (running) {
3036
- return /* @__PURE__ */ jsx9(
3343
+ return /* @__PURE__ */ jsx10(
3037
3344
  ActivityDisclosure,
3038
3345
  {
3039
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3346
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
3040
3347
  iconTone: "running",
3041
3348
  title,
3042
3349
  running: true,
3043
- preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Proposing\u2026" }),
3044
- 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) })
3045
3352
  }
3046
3353
  );
3047
3354
  }
@@ -3050,14 +3357,14 @@ function MemoryProposeRenderer({ item }) {
3050
3357
  return /* @__PURE__ */ jsxs7(
3051
3358
  ActivityDisclosure,
3052
3359
  {
3053
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3360
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
3054
3361
  iconTone: "failed",
3055
3362
  title,
3056
3363
  failed: true,
3057
3364
  preview: truncatePreview(outText, 80) || "Propose failed",
3058
3365
  children: [
3059
- text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
3060
- /* @__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 })
3061
3368
  ]
3062
3369
  }
3063
3370
  );
@@ -3065,14 +3372,159 @@ function MemoryProposeRenderer({ item }) {
3065
3372
  return /* @__PURE__ */ jsxs7(
3066
3373
  ActivityDisclosure,
3067
3374
  {
3068
- icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
3375
+ icon: /* @__PURE__ */ jsx10(BrainCircuitIcon, { className: ICON_SIZE }),
3069
3376
  iconTone: "muted",
3070
3377
  title,
3071
3378
  cancelled: item.status === "cancelled",
3072
3379
  preview: text ? truncatePreview(text, 90) : "Done",
3073
3380
  children: [
3074
- text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
3075
- /* @__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
3076
3528
  ]
3077
3529
  }
3078
3530
  );
@@ -3081,18 +3533,18 @@ function GenericRenderer({ item }) {
3081
3533
  const running = item.status === "running";
3082
3534
  const args = redactSecrets(parseToolArgs(item.arguments));
3083
3535
  const display = toolDisplayName(item.name);
3084
- const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
3536
+ const icon = /* @__PURE__ */ jsx10(GenericToolIcon, { name: item.name });
3085
3537
  const goalPreview = goalToolPreview(item.name, args);
3086
3538
  if (running) {
3087
- return /* @__PURE__ */ jsx9(
3539
+ return /* @__PURE__ */ jsx10(
3088
3540
  ActivityDisclosure,
3089
3541
  {
3090
3542
  icon,
3091
3543
  iconTone: "running",
3092
3544
  title: display,
3093
3545
  running: true,
3094
- preview: goalPreview ?? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }),
3095
- 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 })
3096
3548
  }
3097
3549
  );
3098
3550
  }
@@ -3107,8 +3559,8 @@ function GenericRenderer({ item }) {
3107
3559
  chip: { tone: "bad", text: "error" },
3108
3560
  preview: truncatePreview(outText, 80) || "Error",
3109
3561
  children: [
3110
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
3111
- /* @__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 })
3112
3564
  ]
3113
3565
  }
3114
3566
  );
@@ -3122,8 +3574,8 @@ function GenericRenderer({ item }) {
3122
3574
  cancelled: item.status === "cancelled",
3123
3575
  preview: item.status === "cancelled" ? void 0 : goalPreview ?? "Done",
3124
3576
  children: [
3125
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
3126
- /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
3577
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
3578
+ /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
3127
3579
  ]
3128
3580
  }
3129
3581
  );
@@ -3149,8 +3601,8 @@ function truncatePreview(text, max) {
3149
3601
  }
3150
3602
  function GenericToolIcon({ name }) {
3151
3603
  const leaf = mcpToolLeaf(name);
3152
- 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;
3153
- 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 });
3154
3606
  }
3155
3607
  var BASE_ENTRIES = [
3156
3608
  // Provider-native items carry `raw.type` on the wire — this is their source of
@@ -3160,6 +3612,8 @@ var BASE_ENTRIES = [
3160
3612
  { match: "rawType", type: "hosted_tool_call", render: WebSearchRenderer },
3161
3613
  // First-party sandbox + MCP tools resolve by name (exact or MCP leaf).
3162
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 },
3163
3617
  { match: "name", name: "write_stdin", render: WriteStdinRenderer },
3164
3618
  { match: "name", name: "apply_patch_call", render: ApplyPatchRenderer },
3165
3619
  { match: "name", name: "apply_patch", render: ApplyPatchRenderer },
@@ -3238,8 +3692,8 @@ function tableElementToTsv(table) {
3238
3692
 
3239
3693
  // src/components/copy-button.tsx
3240
3694
  import { CheckIcon, CopyIcon } from "lucide-react";
3241
- import { useEffect as useEffect5, useRef as useRef3, useState as useState8 } from "react";
3242
- 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";
3243
3697
  var COPIED_MS = 1600;
3244
3698
  function CopyButton({
3245
3699
  text,
@@ -3249,8 +3703,8 @@ function CopyButton({
3249
3703
  }) {
3250
3704
  const [copied, setCopied] = useState8(false);
3251
3705
  const [tipOpen, setTipOpen] = useState8(false);
3252
- const timerRef = useRef3(null);
3253
- useEffect5(() => {
3706
+ const timerRef = useRef4(null);
3707
+ useEffect6(() => {
3254
3708
  return () => {
3255
3709
  if (timerRef.current !== null) {
3256
3710
  clearTimeout(timerRef.current);
@@ -3292,7 +3746,7 @@ function CopyButton({
3292
3746
  }
3293
3747
  },
3294
3748
  children: [
3295
- /* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(
3749
+ /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
3296
3750
  "button",
3297
3751
  {
3298
3752
  type: "button",
@@ -3309,10 +3763,10 @@ function CopyButton({
3309
3763
  copied && "opacity-100 text-og-accent",
3310
3764
  className
3311
3765
  ),
3312
- 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 })
3313
3767
  }
3314
3768
  ) }),
3315
- /* @__PURE__ */ jsx10(TooltipContent, { side: "top", children: tip })
3769
+ /* @__PURE__ */ jsx11(TooltipContent, { side: "top", children: tip })
3316
3770
  ]
3317
3771
  }
3318
3772
  );
@@ -3326,7 +3780,7 @@ function CopyHoverFrame({
3326
3780
  trailing
3327
3781
  }) {
3328
3782
  if (copyText.trim().length === 0) {
3329
- return /* @__PURE__ */ jsx10("div", { className, children });
3783
+ return /* @__PURE__ */ jsx11("div", { className, children });
3330
3784
  }
3331
3785
  return /* @__PURE__ */ jsxs8("div", { className: cn("group/copy", className), children: [
3332
3786
  children,
@@ -3338,7 +3792,7 @@ function CopyHoverFrame({
3338
3792
  align === "end" ? "justify-end" : "justify-start"
3339
3793
  ),
3340
3794
  children: [
3341
- /* @__PURE__ */ jsx10(CopyButton, { text: copyText, label, reveal: "group-hover" }),
3795
+ /* @__PURE__ */ jsx11(CopyButton, { text: copyText, label, reveal: "group-hover" }),
3342
3796
  trailing
3343
3797
  ]
3344
3798
  }
@@ -3351,9 +3805,9 @@ import {
3351
3805
  Children,
3352
3806
  isValidElement,
3353
3807
  memo,
3354
- useEffect as useEffect6,
3808
+ useEffect as useEffect7,
3355
3809
  useReducer,
3356
- useRef as useRef4,
3810
+ useRef as useRef5,
3357
3811
  useState as useState9
3358
3812
  } from "react";
3359
3813
  import ReactMarkdown from "react-markdown";
@@ -3639,9 +4093,9 @@ function rehypeStreamReveal(options) {
3639
4093
  }
3640
4094
 
3641
4095
  // src/components/markdown.tsx
3642
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4096
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
3643
4097
  var components = {
3644
- h1: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4098
+ h1: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3645
4099
  "h1",
3646
4100
  {
3647
4101
  className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
@@ -3649,8 +4103,8 @@ var components = {
3649
4103
  children
3650
4104
  }
3651
4105
  ),
3652
- 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 }),
3653
- 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(
3654
4108
  "h3",
3655
4109
  {
3656
4110
  className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
@@ -3658,7 +4112,7 @@ var components = {
3658
4112
  children
3659
4113
  }
3660
4114
  ),
3661
- h4: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4115
+ h4: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3662
4116
  "h4",
3663
4117
  {
3664
4118
  className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg-muted first:mt-0",
@@ -3666,10 +4120,10 @@ var components = {
3666
4120
  children
3667
4121
  }
3668
4122
  ),
3669
- p: ({ children, ...props }) => /* @__PURE__ */ jsx11("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
3670
- strong: ({ children, ...props }) => /* @__PURE__ */ jsx11("strong", { className: "font-semibold text-og-fg", ...props, children }),
3671
- em: ({ children, ...props }) => /* @__PURE__ */ jsx11("em", { className: "italic", ...props, children }),
3672
- 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(
3673
4127
  "a",
3674
4128
  {
3675
4129
  className: "break-words font-medium text-og-accent underline-offset-2 hover:underline",
@@ -3679,7 +4133,7 @@ var components = {
3679
4133
  children
3680
4134
  }
3681
4135
  ),
3682
- ul: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4136
+ ul: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3683
4137
  "ul",
3684
4138
  {
3685
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",
@@ -3687,7 +4141,7 @@ var components = {
3687
4141
  children
3688
4142
  }
3689
4143
  ),
3690
- ol: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4144
+ ol: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3691
4145
  "ol",
3692
4146
  {
3693
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",
@@ -3698,7 +4152,7 @@ var components = {
3698
4152
  // GFM task-list items carry a leading checkbox <input>; `list-none` + a
3699
4153
  // negative margin pull the checkbox back to the bullet column so it aligns
3700
4154
  // with the text.
3701
- li: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4155
+ li: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3702
4156
  "li",
3703
4157
  {
3704
4158
  className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
@@ -3706,7 +4160,7 @@ var components = {
3706
4160
  children
3707
4161
  }
3708
4162
  ),
3709
- input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx11(
4163
+ input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx12(
3710
4164
  "input",
3711
4165
  {
3712
4166
  ...props,
@@ -3714,8 +4168,8 @@ var components = {
3714
4168
  disabled: true,
3715
4169
  className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
3716
4170
  }
3717
- ) : /* @__PURE__ */ jsx11("input", { type, ...props }),
3718
- blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4171
+ ) : /* @__PURE__ */ jsx12("input", { type, ...props }),
4172
+ blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3719
4173
  "blockquote",
3720
4174
  {
3721
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",
@@ -3723,11 +4177,11 @@ var components = {
3723
4177
  children
3724
4178
  }
3725
4179
  ),
3726
- 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 }),
3727
4181
  // Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
3728
4182
  // `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
3729
4183
  // the `pre` renderer), so a `code` reaching here is treated as inline.
3730
- code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx11(
4184
+ code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx12(
3731
4185
  "code",
3732
4186
  {
3733
4187
  className: "rounded-og-xs bg-og-surface-1 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
@@ -3736,11 +4190,11 @@ var components = {
3736
4190
  }
3737
4191
  ),
3738
4192
  // Fenced code — quiet mono block (no card / no nested vertical scroll).
3739
- pre: ({ children }) => /* @__PURE__ */ jsx11(MarkdownCodeBlock, { children }),
4193
+ pre: ({ children }) => /* @__PURE__ */ jsx12(MarkdownCodeBlock, { children }),
3740
4194
  // Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
3741
- table: ({ children, ...props }) => /* @__PURE__ */ jsx11(MarkdownTable, { ...props, children }),
3742
- thead: ({ children, ...props }) => /* @__PURE__ */ jsx11("thead", { ...props, children }),
3743
- 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(
3744
4198
  "th",
3745
4199
  {
3746
4200
  className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
@@ -3748,7 +4202,7 @@ var components = {
3748
4202
  children
3749
4203
  }
3750
4204
  ),
3751
- td: ({ children, ...props }) => /* @__PURE__ */ jsx11(
4205
+ td: ({ children, ...props }) => /* @__PURE__ */ jsx12(
3752
4206
  "td",
3753
4207
  {
3754
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",
@@ -3756,7 +4210,7 @@ var components = {
3756
4210
  children
3757
4211
  }
3758
4212
  ),
3759
- img: ({ alt, ...props }) => /* @__PURE__ */ jsx11(
4213
+ img: ({ alt, ...props }) => /* @__PURE__ */ jsx12(
3760
4214
  "img",
3761
4215
  {
3762
4216
  alt: alt ?? "",
@@ -3800,10 +4254,10 @@ function MarkdownCodeBlock({ children }) {
3800
4254
  const language = fenceLanguage(children);
3801
4255
  return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 first:mt-0", children: [
3802
4256
  /* @__PURE__ */ jsxs9("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
3803
- 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,
3804
- /* @__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" }) })
3805
4259
  ] }),
3806
- /* @__PURE__ */ jsx11(
4260
+ /* @__PURE__ */ jsx12(
3807
4261
  "pre",
3808
4262
  {
3809
4263
  tabIndex: 0,
@@ -3814,9 +4268,9 @@ function MarkdownCodeBlock({ children }) {
3814
4268
  ] });
3815
4269
  }
3816
4270
  function MarkdownTable({ children, className, ...props }) {
3817
- const tableRef = useRef4(null);
4271
+ const tableRef = useRef5(null);
3818
4272
  return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
3819
- /* @__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(
3820
4274
  CopyButton,
3821
4275
  {
3822
4276
  text: () => tableElementToTsv(tableRef.current),
@@ -3824,7 +4278,7 @@ function MarkdownTable({ children, className, ...props }) {
3824
4278
  reveal: "group-hover"
3825
4279
  }
3826
4280
  ) }) }),
3827
- /* @__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(
3828
4282
  "table",
3829
4283
  {
3830
4284
  ref: tableRef,
@@ -3836,11 +4290,11 @@ function MarkdownTable({ children, className, ...props }) {
3836
4290
  ] });
3837
4291
  }
3838
4292
  function MarkdownImpl({ children, className, streaming = false }) {
3839
- const revealRef = useRef4(null);
3840
- const bodyRef = useRef4(null);
4293
+ const revealRef = useRef5(null);
4294
+ const bodyRef = useRef5(null);
3841
4295
  const [, bump] = useReducer((n) => n + 1, 0);
3842
4296
  const [settling, setSettling] = useState9(false);
3843
- const hadRevealRef = useRef4(false);
4297
+ const hadRevealRef = useRef5(false);
3844
4298
  const now = typeof performance !== "undefined" ? performance.now() : Date.now();
3845
4299
  const crystallize = (mutate) => {
3846
4300
  mutate();
@@ -3860,7 +4314,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3860
4314
  }
3861
4315
  const revealActive = reveal !== null && (streaming || reveal.hasActive(now));
3862
4316
  const rehypePlugins = revealActive && reveal !== null ? [[rehypeStreamReveal, { reveal, now }]] : void 0;
3863
- useEffect6(() => {
4317
+ useEffect7(() => {
3864
4318
  if (streaming || revealRef.current === null) {
3865
4319
  return;
3866
4320
  }
@@ -3886,8 +4340,8 @@ function MarkdownImpl({ children, className, streaming = false }) {
3886
4340
  }
3887
4341
  };
3888
4342
  }, [streaming]);
3889
- const wasStreamingRef = useRef4(streaming);
3890
- useEffect6(() => {
4343
+ const wasStreamingRef = useRef5(streaming);
4344
+ useEffect7(() => {
3891
4345
  const ended = wasStreamingRef.current && !streaming;
3892
4346
  wasStreamingRef.current = streaming;
3893
4347
  if (!ended || revealRef.current !== null || prefersReducedMotion()) {
@@ -3898,7 +4352,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3898
4352
  return () => clearTimeout(timer);
3899
4353
  }, [streaming]);
3900
4354
  const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
3901
- return /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx11(
4355
+ return /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx12(
3902
4356
  "div",
3903
4357
  {
3904
4358
  ref: bodyRef,
@@ -3907,7 +4361,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
3907
4361
  settling && "og-markdown-settle",
3908
4362
  className
3909
4363
  ),
3910
- children: /* @__PURE__ */ jsx11(
4364
+ children: /* @__PURE__ */ jsx12(
3911
4365
  ReactMarkdown,
3912
4366
  {
3913
4367
  remarkPlugins: [remarkGfm],
@@ -3929,32 +4383,32 @@ import {
3929
4383
  BrainIcon,
3930
4384
  SquareTerminalIcon
3931
4385
  } from "lucide-react";
3932
- 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";
3933
4387
  import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
3934
4388
 
3935
4389
  // src/timeline/entrance.tsx
3936
- import { createContext as createContext3, useContext as useContext3, useRef as useRef5 } from "react";
3937
- var EntranceAnimationContext = createContext3(true);
4390
+ import { createContext as createContext4, useContext as useContext4, useRef as useRef6 } from "react";
4391
+ var EntranceAnimationContext = createContext4(true);
3938
4392
  var EntranceAnimationProvider = EntranceAnimationContext.Provider;
3939
4393
  function useEntranceAnimationLive() {
3940
- return useContext3(EntranceAnimationContext);
4394
+ return useContext4(EntranceAnimationContext);
3941
4395
  }
3942
4396
  function useEntranceAnimation() {
3943
- const enabled = useContext3(EntranceAnimationContext);
3944
- const captured = useRef5(enabled);
4397
+ const enabled = useContext4(EntranceAnimationContext);
4398
+ const captured = useRef6(enabled);
3945
4399
  return captured.current;
3946
4400
  }
3947
4401
 
3948
4402
  // src/timeline/seen-activity-ids.ts
3949
- import { createContext as createContext4, useContext as useContext4 } from "react";
3950
- var SeenActivityIdsContext = createContext4(null);
4403
+ import { createContext as createContext5, useContext as useContext5 } from "react";
4404
+ var SeenActivityIdsContext = createContext5(null);
3951
4405
  var SeenActivityIdsProvider = SeenActivityIdsContext.Provider;
3952
4406
  function useSeenActivityIds() {
3953
- return useContext4(SeenActivityIdsContext);
4407
+ return useContext5(SeenActivityIdsContext);
3954
4408
  }
3955
4409
 
3956
4410
  // src/timeline/activity-rail.tsx
3957
- 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";
3958
4412
  var LazyFleetDecisionRow = lazy3(() => import("./fleet-decision-row-GGCAT4E4.js"));
3959
4413
  function familyOf(item) {
3960
4414
  if (item.kind === "tool-call") {
@@ -3974,7 +4428,7 @@ function ActivityRail({
3974
4428
  const enterLive = useEntranceAnimationLive();
3975
4429
  const seenIds = useSeenActivityIds();
3976
4430
  const enter = seenIds ? enterLive : enterMounted;
3977
- const previousIdsRef = useRef6(null);
4431
+ const previousIdsRef = useRef7(null);
3978
4432
  const enteringIds = /* @__PURE__ */ new Set();
3979
4433
  if (enter) {
3980
4434
  for (const item of items) {
@@ -3995,7 +4449,7 @@ function ActivityRail({
3995
4449
  }
3996
4450
  }
3997
4451
  });
3998
- return /* @__PURE__ */ jsx12(
4452
+ return /* @__PURE__ */ jsx13(
3999
4453
  "div",
4000
4454
  {
4001
4455
  className: cn(
@@ -4012,7 +4466,7 @@ function ActivityRail({
4012
4466
  children: items.map((item, index) => {
4013
4467
  const newFamily = index > 0 && familyOf(item) !== familyOf(items[index - 1]);
4014
4468
  const row = renderActivity(item, toolRegistry, onOpenSession, onMemoryClick);
4015
- return /* @__PURE__ */ jsx12(
4469
+ return /* @__PURE__ */ jsx13(
4016
4470
  "div",
4017
4471
  {
4018
4472
  "data-og-timeline-row-anchor": "",
@@ -4031,19 +4485,19 @@ function assertNever(item) {
4031
4485
  function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
4032
4486
  switch (item.kind) {
4033
4487
  case "reasoning":
4034
- return /* @__PURE__ */ jsx12(ReasoningRow, { item });
4488
+ return /* @__PURE__ */ jsx13(ReasoningRow, { item });
4035
4489
  case "tool-call": {
4036
4490
  const Renderer = toolRegistry.resolve(item);
4037
- return /* @__PURE__ */ jsx12(Renderer, { item });
4491
+ return /* @__PURE__ */ jsx13(Renderer, { item });
4038
4492
  }
4039
4493
  case "worker":
4040
- return /* @__PURE__ */ jsx12(WorkerRow, { item, onOpenSession });
4494
+ return /* @__PURE__ */ jsx13(WorkerRow, { item, onOpenSession });
4041
4495
  case "sandbox":
4042
- return /* @__PURE__ */ jsx12(SandboxRow, { item });
4496
+ return /* @__PURE__ */ jsx13(SandboxRow, { item });
4043
4497
  case "memory":
4044
- return /* @__PURE__ */ jsx12(MemoryRow, { item, onMemoryClick });
4498
+ return /* @__PURE__ */ jsx13(MemoryRow, { item, onMemoryClick });
4045
4499
  case "fleet-decision":
4046
- return /* @__PURE__ */ jsx12(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx12(
4500
+ return /* @__PURE__ */ jsx13(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx13(
4047
4501
  LazyFleetDecisionRow,
4048
4502
  {
4049
4503
  item,
@@ -4058,15 +4512,15 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
4058
4512
  }
4059
4513
  }
4060
4514
  function ReasoningRow({ item }) {
4061
- return /* @__PURE__ */ jsx12(
4515
+ return /* @__PURE__ */ jsx13(
4062
4516
  ActivityDisclosure,
4063
4517
  {
4064
- icon: /* @__PURE__ */ jsx12(BrainIcon, { className: "size-3.5" }),
4518
+ icon: /* @__PURE__ */ jsx13(BrainIcon, { className: "size-3.5" }),
4065
4519
  iconTone: "muted",
4066
- 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" }),
4067
4521
  running: item.streaming,
4068
4522
  preview: truncate(item.text, 110),
4069
- 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 }) })
4070
4524
  }
4071
4525
  );
4072
4526
  }
@@ -4089,11 +4543,11 @@ function MemoryRow({
4089
4543
  return /* @__PURE__ */ jsxs10(
4090
4544
  ActivityDisclosure,
4091
4545
  {
4092
- icon: /* @__PURE__ */ jsx12(BrainCircuitIcon2, { className: "size-3.5" }),
4546
+ icon: /* @__PURE__ */ jsx13(BrainCircuitIcon2, { className: "size-3.5" }),
4093
4547
  iconTone: "muted",
4094
4548
  title: /* @__PURE__ */ jsxs10("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
4095
- /* @__PURE__ */ jsx12("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
4096
- 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
4097
4551
  ] }),
4098
4552
  preview: superseded ? item.replacementPreview : item.preview,
4099
4553
  children: [
@@ -4101,21 +4555,21 @@ function MemoryRow({
4101
4555
  // The correction as a before → after: the old memory struck through and
4102
4556
  // dimmed, the new text in the ordinary body weight below it.
4103
4557
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5", children: [
4104
- /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
4105
- /* @__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 })
4106
4560
  ] })
4107
4561
  ) : corrected && item.action === "updated" ? (
4108
4562
  // Edited in place, no replacement record: the memory is still live, so
4109
4563
  // show its current text — NOT the archived treatment.
4110
- /* @__PURE__ */ jsxs10(Fragment4, { children: [
4111
- /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4112
- /* @__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." })
4113
4567
  ] })
4114
4568
  ) : corrected ? (
4115
4569
  // A correction with no replacement (and not an in-place update) archived the record.
4116
- /* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Archived." })
4117
- ) : /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
4118
- 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,
4119
4573
  deepLink ? /* @__PURE__ */ jsxs10(
4120
4574
  "button",
4121
4575
  {
@@ -4127,7 +4581,7 @@ function MemoryRow({
4127
4581
  ),
4128
4582
  children: [
4129
4583
  "View in memory",
4130
- /* @__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" })
4131
4585
  ]
4132
4586
  }
4133
4587
  ) : null
@@ -4150,7 +4604,7 @@ function SandboxRow({ item }) {
4150
4604
  return /* @__PURE__ */ jsxs10(
4151
4605
  ActivityDisclosure,
4152
4606
  {
4153
- icon: /* @__PURE__ */ jsx12(SquareTerminalIcon, { className: "size-3.5" }),
4607
+ icon: /* @__PURE__ */ jsx13(SquareTerminalIcon, { className: "size-3.5" }),
4154
4608
  iconTone: item.status === "failed" ? "failed" : item.status === "running" ? "running" : "muted",
4155
4609
  title: sandboxRowTitle(item),
4156
4610
  running: item.status === "running",
@@ -4158,8 +4612,8 @@ function SandboxRow({ item }) {
4158
4612
  cancelled: item.status === "cancelled",
4159
4613
  preview: item.command ?? void 0,
4160
4614
  children: [
4161
- item.command ? /* @__PURE__ */ jsx12(PayloadBlock, { label: "Command", value: item.command }) : null,
4162
- 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
4163
4617
  ]
4164
4618
  }
4165
4619
  );
@@ -4174,11 +4628,11 @@ function WorkerRow({
4174
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";
4175
4629
  const sessionId = item.workerSessionId;
4176
4630
  const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
4177
- const inner = /* @__PURE__ */ jsxs10(Fragment4, { children: [
4178
- /* @__PURE__ */ jsx12("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
4179
- /* @__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" }) }),
4180
4634
  /* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
4181
- /* @__PURE__ */ jsx12(
4635
+ /* @__PURE__ */ jsx13(
4182
4636
  "span",
4183
4637
  {
4184
4638
  className: cn(
@@ -4188,12 +4642,12 @@ function WorkerRow({
4188
4642
  children: title
4189
4643
  }
4190
4644
  ),
4191
- 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
4192
4646
  ] }),
4193
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: [
4194
- /* @__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" }),
4195
4649
  "failed"
4196
- ] }) : 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(
4197
4651
  ArrowRightIcon,
4198
4652
  {
4199
4653
  "aria-hidden": true,
@@ -4202,7 +4656,7 @@ function WorkerRow({
4202
4656
  ) : null
4203
4657
  ] });
4204
4658
  if (deepLink && sessionId && onOpenSession) {
4205
- return /* @__PURE__ */ jsx12(
4659
+ return /* @__PURE__ */ jsx13(
4206
4660
  "button",
4207
4661
  {
4208
4662
  type: "button",
@@ -4216,28 +4670,28 @@ function WorkerRow({
4216
4670
  }
4217
4671
  );
4218
4672
  }
4219
- 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 });
4220
4674
  }
4221
4675
 
4222
4676
  // src/timeline/turn-summary.tsx
4223
4677
  import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
4224
4678
  import {
4225
4679
  Component,
4226
- createContext as createContext6,
4227
- useContext as useContext6,
4228
- useEffect as useEffect7,
4229
- useMemo as useMemo3,
4230
- useRef as useRef7,
4680
+ createContext as createContext7,
4681
+ useContext as useContext7,
4682
+ useEffect as useEffect8,
4683
+ useMemo as useMemo4,
4684
+ useRef as useRef8,
4231
4685
  useState as useState10
4232
4686
  } from "react";
4233
4687
  import { Collapsible } from "radix-ui";
4234
4688
 
4235
4689
  // src/timeline/fold-memory.ts
4236
- import { createContext as createContext5, useContext as useContext5 } from "react";
4237
- var FoldMemoryContext = createContext5(null);
4690
+ import { createContext as createContext6, useContext as useContext6 } from "react";
4691
+ var FoldMemoryContext = createContext6(null);
4238
4692
  var FoldMemoryProvider = FoldMemoryContext.Provider;
4239
4693
  function useFoldMemory() {
4240
- return useContext5(FoldMemoryContext);
4694
+ return useContext6(FoldMemoryContext);
4241
4695
  }
4242
4696
  function inheritFoldRestingState(memory, targetKey, sourceKeys) {
4243
4697
  if (memory.has(targetKey) || sourceKeys.length !== 1) {
@@ -4250,10 +4704,10 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
4250
4704
  }
4251
4705
 
4252
4706
  // src/timeline/turn-summary.tsx
4253
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4254
- var TurnSettleChromeContext = createContext6(false);
4707
+ import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
4708
+ var TurnSettleChromeContext = createContext7(false);
4255
4709
  function useTurnSettleOpen() {
4256
- return useContext6(TurnSettleChromeContext);
4710
+ return useContext7(TurnSettleChromeContext);
4257
4711
  }
4258
4712
  var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
4259
4713
  "steps",
@@ -4291,11 +4745,11 @@ function TurnSummary({
4291
4745
  const [settlePhase, setSettlePhase] = useState10(initialSettle);
4292
4746
  const [nestSuppressLatch, setNestSuppressLatch] = useState10(initialSettle);
4293
4747
  const [expandReady, setExpandReady] = useState10(!initialSettle);
4294
- const settleTimerRef = useRef7(null);
4295
- const settleCloseDoneRef = useRef7(null);
4296
- const nestLatchClearRef = useRef7(null);
4297
- const settleFoldSeenRef = useRef7(Boolean(settleFold));
4298
- 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);
4299
4753
  const clearNestLatchTimer = () => {
4300
4754
  if (nestLatchClearRef.current !== null) {
4301
4755
  clearTimeout(nestLatchClearRef.current);
@@ -4343,8 +4797,8 @@ function TurnSummary({
4343
4797
  }, SETTLE_COLLAPSE_MS);
4344
4798
  }, SETTLE_FOLD_BEAT_MS);
4345
4799
  };
4346
- const mountSettleRef = useRef7(initialSettle);
4347
- useEffect7(() => {
4800
+ const mountSettleRef = useRef8(initialSettle);
4801
+ useEffect8(() => {
4348
4802
  if (mountSettleRef.current) {
4349
4803
  armSettleCollapse();
4350
4804
  }
@@ -4353,7 +4807,7 @@ function TurnSummary({
4353
4807
  settleArmedRef.current = false;
4354
4808
  };
4355
4809
  }, []);
4356
- useEffect7(() => {
4810
+ useEffect8(() => {
4357
4811
  const was = settleFoldSeenRef.current;
4358
4812
  settleFoldSeenRef.current = Boolean(settleFold);
4359
4813
  if (!was && settleFold) {
@@ -4391,7 +4845,7 @@ function TurnSummary({
4391
4845
  const [allowEnterAnimation] = useState10(
4392
4846
  () => Boolean(enter && !bare && !initialSettle && !restingOpen)
4393
4847
  );
4394
- const context = useMemo3(
4848
+ const context = useMemo4(
4395
4849
  () => createTurnSummaryContext(
4396
4850
  items,
4397
4851
  outcome,
@@ -4401,11 +4855,11 @@ function TurnSummary({
4401
4855
  ),
4402
4856
  [items, outcome, failureText, durationMs, settling, settlePhase, contextCompactionCount]
4403
4857
  );
4404
- const facetDefinitions = useMemo3(
4858
+ const facetDefinitions = useMemo4(
4405
4859
  () => resolveTurnSummaryFacets(facetConfiguration),
4406
4860
  [facetConfiguration]
4407
4861
  );
4408
- const facets = useMemo3(
4862
+ const facets = useMemo4(
4409
4863
  () => facetDefinitions.flatMap((facet) => {
4410
4864
  try {
4411
4865
  const result = facet.summarize(context);
@@ -4421,7 +4875,7 @@ function TurnSummary({
4421
4875
  const copyable = Boolean(
4422
4876
  copyText && copyText.trim().length > 0 && !bare && !liveShell && !open && !settlePhase
4423
4877
  );
4424
- 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: [
4425
4879
  /* @__PURE__ */ jsxs11(
4426
4880
  Collapsible.Root,
4427
4881
  {
@@ -4452,7 +4906,7 @@ function TurnSummary({
4452
4906
  liveShell && "text-og-fg-subtle"
4453
4907
  ),
4454
4908
  children: [
4455
- /* @__PURE__ */ jsx13(
4909
+ /* @__PURE__ */ jsx14(
4456
4910
  ChevronRightIcon2,
4457
4911
  {
4458
4912
  className: cn(
@@ -4461,7 +4915,7 @@ function TurnSummary({
4461
4915
  )
4462
4916
  }
4463
4917
  ),
4464
- outcome === "complete" ? null : /* @__PURE__ */ jsx13(
4918
+ outcome === "complete" ? null : /* @__PURE__ */ jsx14(
4465
4919
  "span",
4466
4920
  {
4467
4921
  className: cn(
@@ -4469,7 +4923,7 @@ function TurnSummary({
4469
4923
  bare ? "size-3.5" : "size-5",
4470
4924
  outcome === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"
4471
4925
  ),
4472
- 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" })
4473
4927
  }
4474
4928
  ),
4475
4929
  /* @__PURE__ */ jsxs11(
@@ -4477,10 +4931,10 @@ function TurnSummary({
4477
4931
  {
4478
4932
  className: cn("min-w-0 flex-1 truncate", bare ? "text-og-sm" : "text-og-fg-muted"),
4479
4933
  children: [
4480
- 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: [
4481
4935
  index > 0 ? " \xB7 " : null,
4482
4936
  /* @__PURE__ */ jsxs11("span", { "aria-label": result.ariaLabel, title: result.title, children: [
4483
- 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,
4484
4938
  result.content
4485
4939
  ] })
4486
4940
  ] }) }, facet.id)),
@@ -4488,11 +4942,11 @@ function TurnSummary({
4488
4942
  " \xB7 ",
4489
4943
  failureText
4490
4944
  ] }) : null,
4491
- 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
4492
4946
  ]
4493
4947
  }
4494
4948
  ),
4495
- /* @__PURE__ */ jsx13(
4949
+ /* @__PURE__ */ jsx14(
4496
4950
  "span",
4497
4951
  {
4498
4952
  "aria-hidden": true,
@@ -4509,7 +4963,7 @@ function TurnSummary({
4509
4963
  ]
4510
4964
  }
4511
4965
  ),
4512
- /* @__PURE__ */ jsx13(
4966
+ /* @__PURE__ */ jsx14(
4513
4967
  Collapsible.Content,
4514
4968
  {
4515
4969
  ...nestSuppressLatch ? { forceMount: true } : {},
@@ -4520,13 +4974,13 @@ function TurnSummary({
4520
4974
  // Auto-close: slow settle. Manual close (settlePhase cleared): fast.
4521
4975
  settlePhase ? "data-[state=closed]:animate-og-settle-collapse" : "data-[state=closed]:animate-og-collapse"
4522
4976
  ),
4523
- 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 })
4524
4978
  }
4525
4979
  )
4526
4980
  ]
4527
4981
  }
4528
4982
  ),
4529
- 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
4530
4984
  ] }) });
4531
4985
  }
4532
4986
  function createTurnSummaryContext(items, outcome, failureText, durationMs, contextCompactionCount) {
@@ -4679,7 +5133,7 @@ function formatDurationFacet(durationMs) {
4679
5133
  }
4680
5134
 
4681
5135
  // src/components/session-status.tsx
4682
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
5136
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
4683
5137
  var SESSION_STATUS_META = {
4684
5138
  queued: {
4685
5139
  label: "Queued",
@@ -4743,7 +5197,7 @@ function SessionStatus({ status, label, size = "md", className }) {
4743
5197
  className
4744
5198
  ),
4745
5199
  children: [
4746
- /* @__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" }),
4747
5201
  label ?? meta.label
4748
5202
  ]
4749
5203
  }
@@ -4751,7 +5205,7 @@ function SessionStatus({ status, label, size = "md", className }) {
4751
5205
  }
4752
5206
  function StatusDot({ status, className }) {
4753
5207
  const meta = SESSION_STATUS_META[status];
4754
- return /* @__PURE__ */ jsx14(
5208
+ return /* @__PURE__ */ jsx15(
4755
5209
  "span",
4756
5210
  {
4757
5211
  className: cn(
@@ -4759,7 +5213,7 @@ function StatusDot({ status, className }) {
4759
5213
  meta.dotClassName,
4760
5214
  className
4761
5215
  ),
4762
- 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
4763
5217
  }
4764
5218
  );
4765
5219
  }
@@ -4790,10 +5244,10 @@ import {
4790
5244
  Component as Component2,
4791
5245
  memo as memo2,
4792
5246
  useCallback as useCallback2,
4793
- useEffect as useEffect8,
5247
+ useEffect as useEffect9,
4794
5248
  useLayoutEffect as useLayoutEffect3,
4795
- useMemo as useMemo4,
4796
- useRef as useRef8,
5249
+ useMemo as useMemo5,
5250
+ useRef as useRef9,
4797
5251
  useState as useState11
4798
5252
  } from "react";
4799
5253
 
@@ -4817,6 +5271,7 @@ var TIP_FOLLOW_VELOCITY_REF_PX_S = _s(420);
4817
5271
  var TIP_FOLLOW_VELOCITY_ARM_DEBT_PX = 72;
4818
5272
  var TIP_FOLLOW_VELOCITY_DECAY_MS = _t(180);
4819
5273
  var TIP_FOLLOW_READER_UP_EPS_PX = 2;
5274
+ var TIP_FOLLOW_QUANTIZE_WINDOW_PX = 1;
4820
5275
  var scrollEndSupportOverride = null;
4821
5276
  function supportsScrollEndEvent() {
4822
5277
  if (scrollEndSupportOverride !== null) {
@@ -4835,9 +5290,11 @@ function createTipFollowState() {
4835
5290
  hotUntil: 0,
4836
5291
  lastTs: 0,
4837
5292
  lastHeight: 0,
5293
+ lastClientHeight: 0,
4838
5294
  lastGrowthAt: 0,
4839
5295
  growthVelocity: 0,
4840
- scrollVelocity: 0
5296
+ scrollVelocity: 0,
5297
+ cameraTop: null
4841
5298
  };
4842
5299
  }
4843
5300
  function tipFollowCancel(state) {
@@ -4845,7 +5302,8 @@ function tipFollowCancel(state) {
4845
5302
  ...state,
4846
5303
  running: false,
4847
5304
  lastTs: 0,
4848
- scrollVelocity: 0
5305
+ scrollVelocity: 0,
5306
+ cameraTop: null
4849
5307
  };
4850
5308
  }
4851
5309
  function tipFollowNoteGrowth(state, height, now) {
@@ -4870,6 +5328,34 @@ function tipFollowNoteGrowth(state, height, now) {
4870
5328
  hotUntil: now + TIP_FOLLOW_HOT_IDLE_MS
4871
5329
  };
4872
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
+ }
4873
5359
  function tipFollowTauMs(debtPx, growthVelocityPxPerSec = 0, settling = false, hot = false) {
4874
5360
  if (settling) {
4875
5361
  return TIP_FOLLOW_SETTLE_TAU_MS;
@@ -4920,14 +5406,40 @@ function tipFollowCompensateShrink(scrollTop, previousHeight, nextHeight, client
4920
5406
  const maxScroll = Math.max(0, nextHeight - clientHeight);
4921
5407
  return Math.max(0, Math.min(maxScroll, scrollTop - delta));
4922
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
+ }
4923
5420
  function tipFollowStep(state, input) {
4924
5421
  const { scrollTop, scrollHeight, clientHeight, now, pinned, reducedMotion, revealed } = input;
4925
5422
  const previousHeight = state.lastHeight;
5423
+ const previousClient = state.lastClientHeight;
4926
5424
  const frameGrowth = previousHeight > 0 && scrollHeight > previousHeight ? scrollHeight - previousHeight : 0;
4927
- 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;
4928
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
+ }
4929
5441
  const target = targetScrollTop(scrollHeight, clientHeight);
4930
- const debt = target - scrollTop;
5442
+ const debt = target - cameraTop;
4931
5443
  const hot = now < noted.hotUntil;
4932
5444
  const settling = !hot && Math.abs(debt) < TIP_FOLLOW_CATCHUP_DEBT_PX;
4933
5445
  if (!pinned) {
@@ -4958,7 +5470,7 @@ function tipFollowStep(state, input) {
4958
5470
  }
4959
5471
  if (Math.abs(debt) <= 0.75) {
4960
5472
  return {
4961
- scrollTop: Math.abs(debt) > 0 ? target : scrollTop,
5473
+ scrollTop: Math.abs(debt) > 0 ? target : cameraTop,
4962
5474
  state: {
4963
5475
  ...tipFollowCancel(noted),
4964
5476
  growthVelocity: hot ? noted.growthVelocity : 0
@@ -4972,12 +5484,18 @@ function tipFollowStep(state, input) {
4972
5484
  const accelTauSec = Math.max(tauSec * TIP_FOLLOW_ACCEL_TAU_FRAC, 0.02);
4973
5485
  const velAlpha = 1 - Math.exp(-dtSec / accelTauSec);
4974
5486
  let scrollVelocity = (noted.scrollVelocity ?? 0) + (desiredVel - (noted.scrollVelocity ?? 0)) * velAlpha;
4975
- 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
+ );
4976
5494
  const maxVel = maxStep / dtSec;
4977
5495
  if (Math.abs(scrollVelocity) > maxVel) {
4978
5496
  scrollVelocity = Math.sign(scrollVelocity) * maxVel;
4979
5497
  }
4980
- let next = scrollTop + scrollVelocity * dtSec;
5498
+ let next = cameraTop + scrollVelocity * dtSec;
4981
5499
  if (debt > 0 && next >= target - 0.35) {
4982
5500
  next = target;
4983
5501
  scrollVelocity = 0;
@@ -4986,19 +5504,80 @@ function tipFollowStep(state, input) {
4986
5504
  scrollVelocity = 0;
4987
5505
  }
4988
5506
  next = Math.max(0, next);
5507
+ const running = Math.abs(target - next) > 0.35 || Math.abs(scrollVelocity) > 1;
4989
5508
  return {
4990
5509
  scrollTop: next,
4991
5510
  state: {
4992
5511
  ...noted,
4993
5512
  scrollVelocity,
4994
- running: Math.abs(target - next) > 0.35 || Math.abs(scrollVelocity) > 1,
4995
- 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
4996
5517
  }
4997
5518
  };
4998
5519
  }
4999
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
+
5000
5579
  // src/components/message-timeline.tsx
5001
- 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";
5002
5581
  var PIN_THRESHOLD_PX = 48;
5003
5582
  var OLDER_PREFETCH_MARGIN_PX = 400;
5004
5583
  var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
@@ -5047,6 +5626,7 @@ function MessageTimeline({
5047
5626
  onReconnect,
5048
5627
  resolveProviderLogo,
5049
5628
  toolRegistry = defaultToolRegistry,
5629
+ computeLabel = null,
5050
5630
  turnSummary,
5051
5631
  autoFollow = true,
5052
5632
  hasOlder = false,
@@ -5061,41 +5641,41 @@ function MessageTimeline({
5061
5641
  emptyState,
5062
5642
  className
5063
5643
  }) {
5064
- const resolvedItems = useMemo4(() => items ?? buildTimeline(events ?? []), [items, events]);
5065
- const allGroups = useMemo4(() => groupTimeline(resolvedItems), [resolvedItems]);
5644
+ const resolvedItems = useMemo5(() => items ?? buildTimeline(events ?? []), [items, events]);
5645
+ const allGroups = useMemo5(() => groupTimeline(resolvedItems), [resolvedItems]);
5066
5646
  const groups = useStableTimelineGroupKeys(allGroups);
5067
- const scrollRef = useRef8(null);
5068
- const topSentinelRef = useRef8(null);
5069
- const bottomSentinelRef = useRef8(null);
5070
- 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);
5071
5651
  const [pinned, setPinned] = useState11(true);
5072
5652
  const [bulkActive, setBulkActive] = useState11(true);
5073
- const olderPrefetchArmedRef = useRef8(false);
5653
+ const olderPrefetchArmedRef = useRef9(false);
5074
5654
  const [olderPrefetchArmed, setOlderPrefetchArmed] = useState11(false);
5075
- const olderLoadGateRef = useRef8("armed");
5076
- const resizeFollowRafRef = useRef8(null);
5655
+ const olderLoadGateRef = useRef9("armed");
5656
+ const resizeFollowRafRef = useRef9(null);
5077
5657
  const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
5078
5658
  const [revealed, setRevealed] = useState11(false);
5079
- const pinnedRef = useRef8(true);
5080
- const hasNewerRef = useRef8(hasNewer);
5659
+ const pinnedRef = useRef9(true);
5660
+ const hasNewerRef = useRef9(hasNewer);
5081
5661
  hasNewerRef.current = hasNewer;
5082
- const wantPinRef = useRef8(false);
5083
- const pendingJumpToStartRef = useRef8(false);
5084
- const jumpToStartSeqRef = useRef8(0);
5085
- const previousFirstItemIdRef = useRef8(null);
5086
- const previousScrollHeightRef = useRef8(0);
5087
- const lastScrollTopRef = useRef8(0);
5088
- const lastMaxScrollRef = useRef8(0);
5089
- const lastScrollHeightRef = useRef8(0);
5090
- const lastClientHeightRef = useRef8(0);
5091
- const readerIntentArmRef = useRef8(false);
5092
- const programmaticScrollRef = useRef8(0);
5093
- const pendingReaderLeaveRef = useRef8(false);
5094
- const leaveFallbackRafRef = useRef8(null);
5095
- const foldMemoryRef = useRef8(/* @__PURE__ */ new Map());
5096
- const seenActivityIdsRef = useRef8(/* @__PURE__ */ new Set());
5097
- const groupKeyByItemIdRef = useRef8(/* @__PURE__ */ new Map());
5098
- 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());
5099
5679
  const firstItemId = resolvedItems[0]?.id ?? null;
5100
5680
  const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
5101
5681
  const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
@@ -5105,10 +5685,10 @@ function MessageTimeline({
5105
5685
  setPinned(value);
5106
5686
  }
5107
5687
  }, []);
5108
- const revealedRef = useRef8(revealed);
5688
+ const revealedRef = useRef9(revealed);
5109
5689
  revealedRef.current = revealed;
5110
- const followRef = useRef8(createTipFollowState());
5111
- const followFrameRef = useRef8(null);
5690
+ const followRef = useRef9(createTipFollowState());
5691
+ const followFrameRef = useRef9(null);
5112
5692
  const syncScrollBaseline = useCallback2((node) => {
5113
5693
  lastScrollTopRef.current = node.scrollTop;
5114
5694
  lastMaxScrollRef.current = maxScrollOf(node);
@@ -5117,11 +5697,15 @@ function MessageTimeline({
5117
5697
  }, []);
5118
5698
  const writeScrollTop = useCallback2((node, top) => {
5119
5699
  const next = Math.max(0, top);
5120
- if (node.scrollTop === next) {
5700
+ const before = node.scrollTop;
5701
+ if (before === next) {
5121
5702
  return;
5122
5703
  }
5123
5704
  programmaticScrollRef.current += 1;
5124
5705
  node.scrollTop = next;
5706
+ if (node.scrollTop === before) {
5707
+ programmaticScrollRef.current -= 1;
5708
+ }
5125
5709
  }, []);
5126
5710
  const cancelLeaveFallback = useCallback2(() => {
5127
5711
  if (leaveFallbackRafRef.current !== null) {
@@ -5234,12 +5818,14 @@ function MessageTimeline({
5234
5818
  syncScrollBaseline(node);
5235
5819
  followRef.current = {
5236
5820
  ...followRef.current,
5237
- lastHeight: node.scrollHeight
5821
+ lastHeight: node.scrollHeight,
5822
+ lastClientHeight: node.clientHeight,
5823
+ cameraTop: null
5238
5824
  };
5239
5825
  },
5240
5826
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
5241
5827
  );
5242
- const driveFollowRef = useRef8(() => void 0);
5828
+ const driveFollowRef = useRef9(() => void 0);
5243
5829
  const driveFollow = useCallback2(
5244
5830
  (node, nowMs) => {
5245
5831
  if (!pinnedRef.current || hasNewerRef.current) {
@@ -5254,19 +5840,31 @@ function MessageTimeline({
5254
5840
  const now = typeof nowMs === "number" ? nowMs : typeof performance !== "undefined" ? performance.now() : Date.now();
5255
5841
  const previousHeight = followRef.current.lastHeight;
5256
5842
  if (previousHeight > 0 && node.scrollHeight < previousHeight - TIP_FOLLOW_SHRINK_EPS_PX) {
5257
- const nextTop = tipFollowCompensateShrink(
5843
+ let nextTop = tipFollowCompensateShrink(
5258
5844
  lastScrollTopRef.current,
5259
5845
  previousHeight,
5260
5846
  node.scrollHeight,
5261
5847
  node.clientHeight
5262
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
+ }
5263
5858
  writeScrollTop(node, nextTop);
5264
5859
  syncScrollBaseline(node);
5265
5860
  followRef.current = {
5266
5861
  ...followRef.current,
5267
5862
  lastHeight: node.scrollHeight,
5863
+ lastClientHeight: node.clientHeight,
5268
5864
  running: true,
5269
- lastTs: now
5865
+ lastTs: now,
5866
+ // A direct glue write re-based the camera — drop any stale fraction.
5867
+ cameraTop: null
5270
5868
  };
5271
5869
  if (followFrameRef.current === null) {
5272
5870
  followFrameRef.current = requestFrame((frameNow) => {
@@ -5316,8 +5914,8 @@ function MessageTimeline({
5316
5914
  [cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
5317
5915
  );
5318
5916
  driveFollowRef.current = driveFollow;
5319
- useEffect8(() => stopFollow, [stopFollow]);
5320
- useEffect8(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
5917
+ useEffect9(() => stopFollow, [stopFollow]);
5918
+ useEffect9(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
5321
5919
  useLayoutEffect3(() => {
5322
5920
  const node = scrollRef.current;
5323
5921
  if (!node) {
@@ -5468,7 +6066,7 @@ function MessageTimeline({
5468
6066
  const frame = requestFrame(() => setBulkActive(false));
5469
6067
  return () => cancelFrame(frame);
5470
6068
  }, [bulkRender, firstGroupKey]);
5471
- useEffect8(() => {
6069
+ useEffect9(() => {
5472
6070
  const root = scrollRef.current;
5473
6071
  const target = topSentinelRef.current;
5474
6072
  if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
@@ -5492,7 +6090,7 @@ function MessageTimeline({
5492
6090
  observer.observe(target);
5493
6091
  return () => observer.disconnect();
5494
6092
  }, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
5495
- useEffect8(() => {
6093
+ useEffect9(() => {
5496
6094
  const root = scrollRef.current;
5497
6095
  const target = bottomSentinelRef.current;
5498
6096
  if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
@@ -5509,7 +6107,7 @@ function MessageTimeline({
5509
6107
  observer.observe(target);
5510
6108
  return () => observer.disconnect();
5511
6109
  }, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
5512
- useEffect8(() => {
6110
+ useEffect9(() => {
5513
6111
  const node = scrollRef.current;
5514
6112
  const inner = node?.firstElementChild;
5515
6113
  if (!node || !inner || typeof ResizeObserver === "undefined") {
@@ -5545,7 +6143,7 @@ function MessageTimeline({
5545
6143
  }
5546
6144
  };
5547
6145
  }, [autoFollow, driveFollow, snapToBottom]);
5548
- useEffect8(() => {
6146
+ useEffect9(() => {
5549
6147
  if (hasNewer) {
5550
6148
  stopFollow();
5551
6149
  applyPinned(false);
@@ -5586,7 +6184,9 @@ function MessageTimeline({
5586
6184
  programmaticScrollRef.current = 0;
5587
6185
  }
5588
6186
  if (autoFollow && pinnedRef.current && !hasNewer) {
5589
- 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) {
5590
6190
  readerIntentArmRef.current = false;
5591
6191
  clearPendingReaderLeave();
5592
6192
  driveFollow(node);
@@ -5594,10 +6194,6 @@ function MessageTimeline({
5594
6194
  }
5595
6195
  if (programmatic) {
5596
6196
  syncScrollBaseline(node);
5597
- followRef.current = {
5598
- ...followRef.current,
5599
- lastHeight: nextHeight
5600
- };
5601
6197
  return;
5602
6198
  }
5603
6199
  syncScrollBaseline(node);
@@ -5620,11 +6216,6 @@ function MessageTimeline({
5620
6216
  } else if (!nearBottomPinned && readerUp > TIP_FOLLOW_READER_UP_EPS_PX) {
5621
6217
  pendingReaderLeaveRef.current = true;
5622
6218
  scheduleLeaveFallback();
5623
- } else {
5624
- followRef.current = {
5625
- ...followRef.current,
5626
- lastHeight: nextHeight
5627
- };
5628
6219
  }
5629
6220
  return;
5630
6221
  }
@@ -5662,8 +6253,8 @@ function MessageTimeline({
5662
6253
  }
5663
6254
  releasePinAfterScrollSettled(node);
5664
6255
  };
5665
- 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: [
5666
- /* @__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(
5667
6258
  "div",
5668
6259
  {
5669
6260
  ref: scrollRef,
@@ -5681,11 +6272,11 @@ function MessageTimeline({
5681
6272
  autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
5682
6273
  ),
5683
6274
  children: /* @__PURE__ */ jsxs13("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
5684
- 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,
5685
6276
  hasOlder && olderPrefetchArmed ? (
5686
6277
  // Overlaid, not a layout row: mounting/unmounting the sentinel
5687
6278
  // must never shift content (that shift was itself a wobble).
5688
- /* @__PURE__ */ jsx15(
6279
+ /* @__PURE__ */ jsx16(
5689
6280
  "div",
5690
6281
  {
5691
6282
  ref: topSentinelRef,
@@ -5699,7 +6290,7 @@ function MessageTimeline({
5699
6290
  groups.map(({ group, key }, index) => {
5700
6291
  const next = groups[index + 1]?.group;
5701
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;
5702
- 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(
5703
6294
  TimelineGroupRenderBoundary,
5704
6295
  {
5705
6296
  resetKeys: [
@@ -5712,7 +6303,7 @@ function MessageTimeline({
5712
6303
  toolRegistry,
5713
6304
  turnSummary
5714
6305
  ],
5715
- children: /* @__PURE__ */ jsx15(
6306
+ children: /* @__PURE__ */ jsx16(
5716
6307
  TimelineGroupView,
5717
6308
  {
5718
6309
  group,
@@ -5731,7 +6322,7 @@ function MessageTimeline({
5731
6322
  }
5732
6323
  ) }, key);
5733
6324
  }),
5734
- hasNewer ? /* @__PURE__ */ jsx15(
6325
+ hasNewer ? /* @__PURE__ */ jsx16(
5735
6326
  "div",
5736
6327
  {
5737
6328
  ref: bottomSentinelRef,
@@ -5744,7 +6335,7 @@ function MessageTimeline({
5744
6335
  ] })
5745
6336
  }
5746
6337
  ),
5747
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
6338
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
5748
6339
  // Floating over the scroller (not a timeline row) so showing and
5749
6340
  // hiding it never reflows history under the reader.
5750
6341
  /* @__PURE__ */ jsxs13(
@@ -5758,7 +6349,7 @@ function MessageTimeline({
5758
6349
  "aria-live": "polite",
5759
6350
  className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
5760
6351
  children: [
5761
- 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,
5762
6353
  hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs13(
5763
6354
  "button",
5764
6355
  {
@@ -5795,7 +6386,7 @@ function MessageTimeline({
5795
6386
  "hover:border-og-border-strong disabled:opacity-60"
5796
6387
  ),
5797
6388
  children: [
5798
- /* @__PURE__ */ jsx15(ArrowUpToLineIcon, { className: "size-3.5" }),
6389
+ /* @__PURE__ */ jsx16(ArrowUpToLineIcon, { className: "size-3.5" }),
5799
6390
  "Jump to start"
5800
6391
  ]
5801
6392
  }
@@ -5804,7 +6395,7 @@ function MessageTimeline({
5804
6395
  }
5805
6396
  )
5806
6397
  ) : null }),
5807
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx15(
6398
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx16(
5808
6399
  motion3.div,
5809
6400
  {
5810
6401
  initial: { opacity: 0, y: 6 },
@@ -5814,10 +6405,10 @@ function MessageTimeline({
5814
6405
  "data-og-loading-newer": "",
5815
6406
  "aria-live": "polite",
5816
6407
  className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
5817
- 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" }) })
5818
6409
  }
5819
6410
  ) : null }),
5820
- /* @__PURE__ */ jsx15(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs13(
6411
+ /* @__PURE__ */ jsx16(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs13(
5821
6412
  motion3.button,
5822
6413
  {
5823
6414
  type: "button",
@@ -5861,16 +6452,16 @@ function MessageTimeline({
5861
6452
  "hover:border-og-border-strong"
5862
6453
  ),
5863
6454
  children: [
5864
- /* @__PURE__ */ jsx15(ArrowDownIcon2, { className: "size-3.5" }),
6455
+ /* @__PURE__ */ jsx16(ArrowDownIcon2, { className: "size-3.5" }),
5865
6456
  "Jump to latest"
5866
6457
  ]
5867
6458
  }
5868
6459
  ) : null })
5869
- ] }) }) }) }) }) });
6460
+ ] }) }) }) }) }) }) });
5870
6461
  }
5871
6462
  function useStableTimelineGroupKeys(allGroups) {
5872
- const previousRef = useRef8([]);
5873
- const keyedGroups = useMemo4(() => {
6463
+ const previousRef = useRef9([]);
6464
+ const keyedGroups = useMemo5(() => {
5874
6465
  const previousByItemId = /* @__PURE__ */ new Map();
5875
6466
  for (const previous of previousRef.current) {
5876
6467
  for (const itemId of timelineGroupItemIds(previous.group)) {
@@ -5943,10 +6534,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
5943
6534
  role: "status",
5944
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",
5945
6536
  children: [
5946
- /* @__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" }),
5947
6538
  /* @__PURE__ */ jsxs13("div", { children: [
5948
- /* @__PURE__ */ jsx15("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
5949
- /* @__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." })
5950
6541
  ] })
5951
6542
  ]
5952
6543
  }
@@ -5989,7 +6580,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
5989
6580
  if (insideTurn) {
5990
6581
  const useNestedChip = nestClusterChips && activityShouldFold;
5991
6582
  if (!useNestedChip) {
5992
- return /* @__PURE__ */ jsx15(
6583
+ return /* @__PURE__ */ jsx16(
5993
6584
  ActivityRail,
5994
6585
  {
5995
6586
  items: group.items,
@@ -6000,7 +6591,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6000
6591
  }
6001
6592
  );
6002
6593
  }
6003
- return /* @__PURE__ */ jsx15(
6594
+ return /* @__PURE__ */ jsx16(
6004
6595
  TurnSummary,
6005
6596
  {
6006
6597
  items: group.items,
@@ -6011,7 +6602,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6011
6602
  foldKey: group.id,
6012
6603
  facets: turnSummary?.facets,
6013
6604
  contextCompactionCount,
6014
- children: /* @__PURE__ */ jsx15(
6605
+ children: /* @__PURE__ */ jsx16(
6015
6606
  ActivityRail,
6016
6607
  {
6017
6608
  items: group.items,
@@ -6025,7 +6616,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6025
6616
  settleChrome ? "settle" : "rest"
6026
6617
  );
6027
6618
  }
6028
- return /* @__PURE__ */ jsx15(
6619
+ return /* @__PURE__ */ jsx16(
6029
6620
  TurnSummary,
6030
6621
  {
6031
6622
  items: group.items,
@@ -6036,7 +6627,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6036
6627
  facets: turnSummary?.facets,
6037
6628
  settleFold,
6038
6629
  contextCompactionCount,
6039
- children: /* @__PURE__ */ jsx15(FoldBody, { children: /* @__PURE__ */ jsx15(TurnRailFrame, { children: /* @__PURE__ */ jsx15(
6630
+ children: /* @__PURE__ */ jsx16(FoldBody, { children: /* @__PURE__ */ jsx16(TurnRailFrame, { children: /* @__PURE__ */ jsx16(
6040
6631
  ActivityRail,
6041
6632
  {
6042
6633
  items: group.items,
@@ -6054,7 +6645,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6054
6645
  const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
6055
6646
  const body = group.groups.map((child) => {
6056
6647
  const key = timelineGroupKey(child);
6057
- return /* @__PURE__ */ jsx15(
6648
+ return /* @__PURE__ */ jsx16(
6058
6649
  TimelineGroupRenderBoundary,
6059
6650
  {
6060
6651
  resetKeys: [
@@ -6067,7 +6658,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6067
6658
  toolRegistry,
6068
6659
  turnSummary
6069
6660
  ],
6070
- children: /* @__PURE__ */ jsx15(
6661
+ children: /* @__PURE__ */ jsx16(
6071
6662
  TimelineGroupView2,
6072
6663
  {
6073
6664
  group: child,
@@ -6086,7 +6677,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6086
6677
  key
6087
6678
  );
6088
6679
  });
6089
- return /* @__PURE__ */ jsx15(
6680
+ return /* @__PURE__ */ jsx16(
6090
6681
  TurnSummary,
6091
6682
  {
6092
6683
  items: activityItems,
@@ -6100,16 +6691,16 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6100
6691
  settleFold,
6101
6692
  copyText: insideTurn ? void 0 : turnCopyText,
6102
6693
  contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
6103
- children: /* @__PURE__ */ jsx15(FoldBody, { children: insideTurn ? (
6694
+ children: /* @__PURE__ */ jsx16(FoldBody, { children: insideTurn ? (
6104
6695
  // A nested turn is already on an ancestor rail — its body just stacks
6105
6696
  // flush (the bare-node body already indents it), so no second rule.
6106
- /* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-4", children: body })
6107
- ) : /* @__PURE__ */ jsx15(TurnRailFrame, { children: body }) })
6697
+ /* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-4", children: body })
6698
+ ) : /* @__PURE__ */ jsx16(TurnRailFrame, { children: body }) })
6108
6699
  }
6109
6700
  );
6110
6701
  }
6111
6702
  case "item":
6112
- return /* @__PURE__ */ jsx15(
6703
+ return /* @__PURE__ */ jsx16(
6113
6704
  TimelineRow,
6114
6705
  {
6115
6706
  item: group.item,
@@ -6122,14 +6713,14 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
6122
6713
  }
6123
6714
  });
6124
6715
  function FoldBody({ children }) {
6125
- return /* @__PURE__ */ jsx15(Fragment6, { children });
6716
+ return /* @__PURE__ */ jsx16(Fragment7, { children });
6126
6717
  }
6127
6718
  function TurnRailFrame({ children }) {
6128
- 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 });
6129
6720
  }
6130
6721
  function useLiveSettleFold(folded) {
6131
- const previousFoldedRef = useRef8(folded);
6132
- const latchedRef = useRef8(false);
6722
+ const previousFoldedRef = useRef9(folded);
6723
+ const latchedRef = useRef9(false);
6133
6724
  if (!previousFoldedRef.current && folded) {
6134
6725
  latchedRef.current = true;
6135
6726
  }
@@ -6287,23 +6878,23 @@ function TimelineRow({
6287
6878
  }) {
6288
6879
  switch (item.kind) {
6289
6880
  case "user-message":
6290
- return /* @__PURE__ */ jsx15(UserMessageRow, { item, renderMessageText });
6881
+ return /* @__PURE__ */ jsx16(UserMessageRow, { item, renderMessageText });
6291
6882
  case "agent-message":
6292
- return /* @__PURE__ */ jsx15(AgentMessageRow, { item, renderMessageText });
6883
+ return /* @__PURE__ */ jsx16(AgentMessageRow, { item, renderMessageText });
6293
6884
  case "worker-completion":
6294
- return /* @__PURE__ */ jsx15(WorkerCompletionRow, { item, onOpenSession });
6885
+ return /* @__PURE__ */ jsx16(WorkerCompletionRow, { item, onOpenSession });
6295
6886
  case "session-status":
6296
- return /* @__PURE__ */ jsx15(SessionStatusRow, { item });
6887
+ return /* @__PURE__ */ jsx16(SessionStatusRow, { item });
6297
6888
  case "goal":
6298
- return /* @__PURE__ */ jsx15(GoalRow, { item });
6889
+ return /* @__PURE__ */ jsx16(GoalRow, { item });
6299
6890
  case "machine-input-batch":
6300
- return /* @__PURE__ */ jsx15(MachineInputBatchRow, { item });
6891
+ return /* @__PURE__ */ jsx16(MachineInputBatchRow, { item });
6301
6892
  case "notice":
6302
- return /* @__PURE__ */ jsx15(NoticeRow, { item });
6893
+ return /* @__PURE__ */ jsx16(NoticeRow, { item });
6303
6894
  case "context-compaction":
6304
- return /* @__PURE__ */ jsx15(CompactionRow, { item });
6895
+ return /* @__PURE__ */ jsx16(CompactionRow, { item });
6305
6896
  case "auth-needed":
6306
- return /* @__PURE__ */ jsx15(
6897
+ return /* @__PURE__ */ jsx16(
6307
6898
  AuthNeededRow,
6308
6899
  {
6309
6900
  item,
@@ -6329,7 +6920,7 @@ function CompactionRow({ item }) {
6329
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";
6330
6921
  const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
6331
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";
6332
- 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(
6333
6924
  "div",
6334
6925
  {
6335
6926
  className: cn(
@@ -6339,13 +6930,13 @@ function CompactionRow({ item }) {
6339
6930
  role: "status",
6340
6931
  children: [
6341
6932
  /* @__PURE__ */ jsxs13("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
6342
- /* @__PURE__ */ jsx15(ShrinkIcon, { className: "size-3.5 shrink-0" }),
6933
+ /* @__PURE__ */ jsx16(ShrinkIcon, { className: "size-3.5 shrink-0" }),
6343
6934
  /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
6344
6935
  title,
6345
6936
  trigger ? ` \xB7 ${trigger}` : ""
6346
6937
  ] })
6347
6938
  ] }),
6348
- 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
6349
6940
  ]
6350
6941
  }
6351
6942
  ) });
@@ -6365,7 +6956,7 @@ function compactionSkipSubtitle(reason) {
6365
6956
  }
6366
6957
  }
6367
6958
  function MessageFooterTime({ occurredAt }) {
6368
- return /* @__PURE__ */ jsx15(
6959
+ return /* @__PURE__ */ jsx16(
6369
6960
  "time",
6370
6961
  {
6371
6962
  dateTime: occurredAt,
@@ -6383,14 +6974,14 @@ function UserMessageRow({
6383
6974
  renderMessageText
6384
6975
  }) {
6385
6976
  const enter = useEntranceAnimation();
6386
- 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(
6387
6978
  CopyHoverFrame,
6388
6979
  {
6389
6980
  copyText: item.text,
6390
6981
  label: "Copy message",
6391
6982
  className: "w-fit max-w-full min-w-0",
6392
- trailing: /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
6393
- 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 }) })
6394
6985
  }
6395
6986
  ) }) });
6396
6987
  }
@@ -6399,15 +6990,15 @@ function AgentMessageRow({
6399
6990
  renderMessageText
6400
6991
  }) {
6401
6992
  const enter = useEntranceAnimation();
6402
- const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx15(Markdown, { streaming: item.streaming, children: item.text });
6403
- return /* @__PURE__ */ jsx15(
6993
+ const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx16(Markdown, { streaming: item.streaming, children: item.text });
6994
+ return /* @__PURE__ */ jsx16(
6404
6995
  CopyHoverFrame,
6405
6996
  {
6406
6997
  copyText: item.text,
6407
6998
  label: "Copy message",
6408
6999
  align: "start",
6409
7000
  className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
6410
- trailing: item.streaming ? null : /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
7001
+ trailing: item.streaming ? null : /* @__PURE__ */ jsx16(MessageFooterTime, { occurredAt: item.occurredAt }),
6411
7002
  children: body
6412
7003
  }
6413
7004
  );
@@ -6459,11 +7050,11 @@ function WorkerCompletionRow({
6459
7050
  ...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
6460
7051
  ];
6461
7052
  const hasDetails = details.length > 0;
6462
- 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: [
6463
7054
  /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2.5", children: [
6464
- /* @__PURE__ */ jsx15("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx15(Icon, { className: "size-4" }) }),
6465
- /* @__PURE__ */ jsx15("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("p", { className: "text-og-base leading-5 text-og-fg", children: [
6466
- /* @__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 }),
6467
7058
  item.goalText ? /* @__PURE__ */ jsxs13("span", { className: "text-og-fg-muted", children: [
6468
7059
  " \xB7 ",
6469
7060
  truncate(item.goalText, 90)
@@ -6481,13 +7072,13 @@ function WorkerCompletionRow({
6481
7072
  ),
6482
7073
  children: [
6483
7074
  "View session",
6484
- /* @__PURE__ */ jsx15(ArrowRightIcon2, { className: "size-3.5" })
7075
+ /* @__PURE__ */ jsx16(ArrowRightIcon2, { className: "size-3.5" })
6485
7076
  ]
6486
7077
  }
6487
7078
  ) : null
6488
7079
  ] }),
6489
7080
  hasDetails ? /* @__PURE__ */ jsxs13(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
6490
- /* @__PURE__ */ jsx15(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
7081
+ /* @__PURE__ */ jsx16(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
6491
7082
  "button",
6492
7083
  {
6493
7084
  type: "button",
@@ -6496,14 +7087,14 @@ function WorkerCompletionRow({
6496
7087
  "outline-none transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
6497
7088
  ),
6498
7089
  children: [
6499
- /* @__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" }),
6500
7091
  open ? "Hide details" : "Show details"
6501
7092
  ]
6502
7093
  }
6503
7094
  ) }),
6504
- /* @__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: [
6505
- /* @__PURE__ */ jsx15("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
6506
- /* @__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(
6507
7098
  "p",
6508
7099
  {
6509
7100
  className: cn(
@@ -6529,14 +7120,14 @@ function SessionStatusRow({ item }) {
6529
7120
  ),
6530
7121
  role: "status",
6531
7122
  children: [
6532
- /* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" }),
7123
+ /* @__PURE__ */ jsx16("span", { className: "h-px flex-1 bg-og-border" }),
6533
7124
  /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1.5", children: [
6534
- /* @__PURE__ */ jsx15(StatusDot, { status: item.status, className: "size-1" }),
7125
+ /* @__PURE__ */ jsx16(StatusDot, { status: item.status, className: "size-1" }),
6535
7126
  meta.label.toLowerCase(),
6536
7127
  " \xB7 ",
6537
7128
  formatRelativeTime(item.occurredAt)
6538
7129
  ] }),
6539
- /* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" })
7130
+ /* @__PURE__ */ jsx16("span", { className: "h-px flex-1 bg-og-border" })
6540
7131
  ]
6541
7132
  }
6542
7133
  );
@@ -6566,7 +7157,7 @@ var GOAL_META = {
6566
7157
  function GoalRow({ item }) {
6567
7158
  const enter = useEntranceAnimation();
6568
7159
  const { label, pill, icon: Icon } = GOAL_META[item.action];
6569
- 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(
6570
7161
  "span",
6571
7162
  {
6572
7163
  className: cn(
@@ -6574,7 +7165,7 @@ function GoalRow({ item }) {
6574
7165
  pill
6575
7166
  ),
6576
7167
  children: [
6577
- /* @__PURE__ */ jsx15(Icon, { className: "size-3.5 shrink-0" }),
7168
+ /* @__PURE__ */ jsx16(Icon, { className: "size-3.5 shrink-0" }),
6578
7169
  /* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
6579
7170
  label,
6580
7171
  item.text ? `: ${truncate(item.text, 90)}` : ""
@@ -6583,64 +7174,53 @@ function GoalRow({ item }) {
6583
7174
  }
6584
7175
  ) });
6585
7176
  }
6586
- var MACHINE_INPUT_META = {
6587
- scheduled_occurrence: "Scheduled update",
6588
- goal_continuation: "Goal continued",
6589
- agent_message: "Agent update",
6590
- agent_steer_instruction: "Agent direction",
6591
- child_terminal_result: "Agent finished"
6592
- };
6593
7177
  function MachineInputBatchRow({ item }) {
6594
7178
  const enter = useEntranceAnimation();
6595
- const visible = item.members.slice(0, 3);
6596
- return /* @__PURE__ */ jsxs13(
6597
- "div",
6598
- {
6599
- className: cn(
6600
- enter && "animate-og-enter",
6601
- "rounded-og-md border border-og-border/70 bg-og-surface-1/55 px-3 py-2.5"
6602
- ),
6603
- children: [
6604
- item.members.length > 1 && /* @__PURE__ */ jsxs13("div", { className: "mb-2 text-xs font-medium text-og-fg-subtle", children: [
6605
- item.members.length,
6606
- " updates joined this turn"
6607
- ] }),
6608
- /* @__PURE__ */ jsx15("div", { className: "space-y-2", children: visible.map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) }),
6609
- item.members.length > visible.length && /* @__PURE__ */ jsxs13("details", { className: "mt-2 pl-8 text-xs text-og-fg-muted", children: [
6610
- /* @__PURE__ */ jsxs13("summary", { className: "cursor-pointer select-none hover:text-og-fg", children: [
6611
- "Show ",
6612
- item.members.length - visible.length,
6613
- " more"
6614
- ] }),
6615
- /* @__PURE__ */ jsx15("div", { className: "mt-2 space-y-2", children: item.members.slice(visible.length).map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) })
6616
- ] })
6617
- ]
6618
- }
6619
- );
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
+ ] });
6620
7208
  }
6621
7209
  function MachineInputRow({ member }) {
6622
7210
  const source = readableMachineInputSource(member.sourceId);
7211
+ const summary = cleanMachineInputSummary(member.summary);
6623
7212
  return /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-start gap-2.5", children: [
6624
- /* @__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 }),
6625
7214
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
6626
- /* @__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] }),
6627
7216
  source && /* @__PURE__ */ jsxs13("span", { className: "ml-1.5 text-xs text-og-fg-subtle", children: [
6628
7217
  "from ",
6629
7218
  source
6630
7219
  ] }),
6631
- 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
6632
7221
  ] })
6633
7222
  ] });
6634
7223
  }
6635
- function readableMachineInputSource(sourceId) {
6636
- const value = sourceId.trim();
6637
- if (!value || /^[0-9a-f]{8}-[0-9a-f-]{27,}$/i.test(value)) return null;
6638
- if (/^(goal|schedule|system):/i.test(value)) return null;
6639
- return value.replaceAll("_", " ");
6640
- }
6641
- function cleanMachineInputSummary(summary) {
6642
- return summary.replace(/^\[[A-Z][A-Z _-]*(?:\s+\d+\/\d+)?\]\s*/, "").trim();
6643
- }
6644
7224
  function NoticeRow({ item }) {
6645
7225
  const enter = useEntranceAnimation();
6646
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";
@@ -6654,20 +7234,20 @@ function NoticeRow({ item }) {
6654
7234
  ),
6655
7235
  role: "status",
6656
7236
  children: [
6657
- /* @__PURE__ */ jsx15(
7237
+ /* @__PURE__ */ jsx16(
6658
7238
  TriangleAlertIcon3,
6659
7239
  {
6660
7240
  className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
6661
7241
  }
6662
7242
  ),
6663
7243
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
6664
- /* @__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 }),
6665
7245
  item.details ? /* @__PURE__ */ jsxs13("details", { className: "mt-2 text-xs", children: [
6666
- /* @__PURE__ */ jsx15("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
6667
- /* @__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) })
6668
7248
  ] }) : null
6669
7249
  ] }),
6670
- item.action ? /* @__PURE__ */ jsx15(
7250
+ item.action ? /* @__PURE__ */ jsx16(
6671
7251
  "a",
6672
7252
  {
6673
7253
  className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-xs font-medium hover:bg-current/10",
@@ -6710,7 +7290,7 @@ function AuthNeededRow({
6710
7290
  return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
6711
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: [
6712
7292
  /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
6713
- /* @__PURE__ */ jsx15(
7293
+ /* @__PURE__ */ jsx16(
6714
7294
  AuthProviderLogo,
6715
7295
  {
6716
7296
  src: resolveProviderLogo?.(item.providerDomain) ?? null,
@@ -6718,8 +7298,8 @@ function AuthNeededRow({
6718
7298
  }
6719
7299
  ),
6720
7300
  /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
6721
- /* @__PURE__ */ jsx15("p", { className: "truncate text-og-md font-medium text-og-fg", children: unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}` }),
6722
- /* @__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) })
6723
7303
  ] })
6724
7304
  ] }),
6725
7305
  !unavailable && onReconnect ? /* @__PURE__ */ jsxs13(
@@ -6733,7 +7313,7 @@ function AuthNeededRow({
6733
7313
  "transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
6734
7314
  ),
6735
7315
  children: [
6736
- /* @__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 }),
6737
7317
  busy ? "Opening\u2026" : actionLabel
6738
7318
  ]
6739
7319
  }
@@ -6748,7 +7328,7 @@ function AuthNeededRow({
6748
7328
  "transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
6749
7329
  ),
6750
7330
  children: [
6751
- /* @__PURE__ */ jsx15(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
7331
+ /* @__PURE__ */ jsx16(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
6752
7332
  actionLabel
6753
7333
  ]
6754
7334
  }
@@ -6770,14 +7350,14 @@ function AuthNeededRow({
6770
7350
  }
6771
7351
  function AuthProviderLogo({ src, label }) {
6772
7352
  const [failed, setFailed] = useState11(false);
6773
- useEffect8(() => setFailed(false), [src]);
7353
+ useEffect9(() => setFailed(false), [src]);
6774
7354
  const showImage = src && !failed;
6775
- return /* @__PURE__ */ jsx15(
7355
+ return /* @__PURE__ */ jsx16(
6776
7356
  "span",
6777
7357
  {
6778
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",
6779
7359
  "aria-hidden": true,
6780
- children: showImage ? /* @__PURE__ */ jsx15(
7360
+ children: showImage ? /* @__PURE__ */ jsx16(
6781
7361
  "img",
6782
7362
  {
6783
7363
  src,
@@ -6787,7 +7367,7 @@ function AuthProviderLogo({ src, label }) {
6787
7367
  className: "size-full object-contain p-1.5",
6788
7368
  onError: () => setFailed(true)
6789
7369
  }
6790
- ) : /* @__PURE__ */ jsx15("span", { children: monogram(label) })
7370
+ ) : /* @__PURE__ */ jsx16("span", { children: monogram(label) })
6791
7371
  }
6792
7372
  );
6793
7373
  }
@@ -6836,6 +7416,7 @@ export {
6836
7416
  defaultHumanInputFormMessages,
6837
7417
  HumanInputForm,
6838
7418
  answersFromDrafts,
7419
+ HumanInputSurface,
6839
7420
  rawTypeOf,
6840
7421
  createToolRegistry,
6841
7422
  sandboxCommandExitCode,
@@ -6883,4 +7464,4 @@ export {
6883
7464
  MessageTimeline,
6884
7465
  TimelineRow
6885
7466
  };
6886
- //# sourceMappingURL=chunk-UCZPNXV3.js.map
7467
+ //# sourceMappingURL=chunk-KR2SK5GJ.js.map