@opengeni/react 0.34.1 → 0.34.3
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.
- package/dist/{chunk-A2WITZTI.js → chunk-4NMH6UJ3.js} +2 -2
- package/dist/{chunk-GZ4KR67U.js → chunk-ALA3UGWB.js} +2 -2
- package/dist/chunk-ATSTR5P3.js +138 -0
- package/dist/chunk-ATSTR5P3.js.map +1 -0
- package/dist/{chunk-KZRUYCL4.js → chunk-FT2TXNGZ.js} +5 -2
- package/dist/chunk-FT2TXNGZ.js.map +1 -0
- package/dist/{chunk-4QOQ2DSR.js → chunk-LAKLF4PA.js} +14 -1
- package/dist/chunk-LAKLF4PA.js.map +1 -0
- package/dist/{chunk-TCCE5ZU5.js → chunk-MEGI4FS6.js} +38 -9
- package/dist/chunk-MEGI4FS6.js.map +1 -0
- package/dist/{chunk-MS3FBZ6A.js → chunk-PVW56EVR.js} +105 -62
- package/dist/chunk-PVW56EVR.js.map +1 -0
- package/dist/{chunk-L7R5RK6A.js → chunk-QRYJCWGD.js} +1199 -897
- package/dist/chunk-QRYJCWGD.js.map +1 -0
- package/dist/components/chat-composer.d.ts +2 -1
- package/dist/components/composer.d.ts +8 -2
- package/dist/components/copy-button.d.ts +4 -2
- package/dist/components/tip-follow.d.ts +3 -0
- package/dist/composer.d.ts +2 -1
- package/dist/composer.js +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +106 -101
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts +2 -0
- package/dist/machines.js +2 -2
- package/dist/session-ui.js +4 -3
- package/dist/session.js +4 -4
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/parsers.d.ts +5 -0
- package/dist/timeline/projection.d.ts +1 -12
- package/dist/timeline/tool-display-name.d.ts +17 -6
- package/dist/workstream-control-event.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/chat-composer.tsx +1 -1
- package/src/components/composer-transcription-control.tsx +70 -57
- package/src/components/composer.tsx +197 -126
- package/src/components/copy-button.tsx +27 -8
- package/src/components/message-timeline.tsx +236 -39
- package/src/components/tip-follow.ts +15 -0
- package/src/composer.ts +1 -1
- package/src/hooks/use-composer.ts +7 -1
- package/src/hooks/use-workspace-capture.ts +6 -0
- package/src/index.ts +2 -1
- package/src/lib/format.ts +14 -0
- package/src/timeline/index.ts +2 -0
- package/src/timeline/parsers.ts +18 -1
- package/src/timeline/projection.ts +50 -20
- package/src/timeline/registry.ts +15 -2
- package/src/timeline/shared.tsx +30 -28
- package/src/timeline/tool-display-name.ts +30 -11
- package/src/timeline/tool-renderers.tsx +347 -16
- package/src/timeline/turn-summary.tsx +5 -2
- package/src/workstream-control-event.ts +6 -0
- package/dist/chunk-4QOQ2DSR.js.map +0 -1
- package/dist/chunk-KZRUYCL4.js.map +0 -1
- package/dist/chunk-L7R5RK6A.js.map +0 -1
- package/dist/chunk-MS3FBZ6A.js.map +0 -1
- package/dist/chunk-TCCE5ZU5.js.map +0 -1
- /package/dist/{chunk-A2WITZTI.js.map → chunk-4NMH6UJ3.js.map} +0 -0
- /package/dist/{chunk-GZ4KR67U.js.map → chunk-ALA3UGWB.js.map} +0 -0
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildTimeline,
|
|
3
|
-
groupTimeline
|
|
4
|
-
|
|
3
|
+
groupTimeline,
|
|
4
|
+
mcpToolLeaf,
|
|
5
|
+
toolDisplayName
|
|
6
|
+
} from "./chunk-MEGI4FS6.js";
|
|
7
|
+
import {
|
|
8
|
+
Tooltip,
|
|
9
|
+
TooltipContent,
|
|
10
|
+
TooltipProvider,
|
|
11
|
+
TooltipTrigger
|
|
12
|
+
} from "./chunk-ATSTR5P3.js";
|
|
5
13
|
import {
|
|
6
14
|
cn
|
|
7
15
|
} from "./chunk-TK7G6XLT.js";
|
|
8
16
|
import {
|
|
17
|
+
formatClockTime,
|
|
9
18
|
formatRelativeTime,
|
|
10
19
|
stringifyPayload,
|
|
11
20
|
truncate,
|
|
12
21
|
tryParseJson
|
|
13
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LAKLF4PA.js";
|
|
14
23
|
import {
|
|
15
24
|
EmptyQueueStateSurface,
|
|
16
25
|
requestQueueDraftEdit
|
|
@@ -57,132 +66,6 @@ function QueueSurfaceFallback() {
|
|
|
57
66
|
);
|
|
58
67
|
}
|
|
59
68
|
|
|
60
|
-
// src/components/tooltip.tsx
|
|
61
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
62
|
-
import {
|
|
63
|
-
createContext,
|
|
64
|
-
useContext,
|
|
65
|
-
useRef
|
|
66
|
-
} from "react";
|
|
67
|
-
|
|
68
|
-
// src/lib/use-portal-token-style.ts
|
|
69
|
-
import { useEffect, useState } from "react";
|
|
70
|
-
function usePortalTokenStyle(sourceRef) {
|
|
71
|
-
const [style, setStyle] = useState({});
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
const source = sourceRef.current;
|
|
74
|
-
if (!source || typeof MutationObserver === "undefined") return;
|
|
75
|
-
let signature = "";
|
|
76
|
-
const sync = () => {
|
|
77
|
-
const computed = getComputedStyle(source);
|
|
78
|
-
const next = { colorScheme: computed.colorScheme };
|
|
79
|
-
for (let index = 0; index < computed.length; index += 1) {
|
|
80
|
-
const property = computed.item(index);
|
|
81
|
-
if (!property.startsWith("--og-")) continue;
|
|
82
|
-
next[property] = computed.getPropertyValue(property);
|
|
83
|
-
}
|
|
84
|
-
const nextSignature = JSON.stringify(next);
|
|
85
|
-
if (nextSignature !== signature) {
|
|
86
|
-
signature = nextSignature;
|
|
87
|
-
setStyle(next);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const observers = [];
|
|
91
|
-
let ancestor = source;
|
|
92
|
-
while (ancestor) {
|
|
93
|
-
const observer = new MutationObserver(sync);
|
|
94
|
-
observer.observe(ancestor, {
|
|
95
|
-
attributes: true,
|
|
96
|
-
attributeFilter: ["class", "data-og-theme", "style"]
|
|
97
|
-
});
|
|
98
|
-
observers.push(observer);
|
|
99
|
-
ancestor = ancestor.parentElement;
|
|
100
|
-
}
|
|
101
|
-
const colorScheme = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
102
|
-
colorScheme?.addEventListener?.("change", sync);
|
|
103
|
-
sync();
|
|
104
|
-
return () => {
|
|
105
|
-
for (const observer of observers) observer.disconnect();
|
|
106
|
-
colorScheme?.removeEventListener?.("change", sync);
|
|
107
|
-
};
|
|
108
|
-
}, [sourceRef]);
|
|
109
|
-
return style;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// src/components/tooltip.tsx
|
|
113
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
114
|
-
var TooltipSourceContext = createContext(null);
|
|
115
|
-
function TooltipProvider({
|
|
116
|
-
delayDuration = 300,
|
|
117
|
-
...props
|
|
118
|
-
}) {
|
|
119
|
-
return /* @__PURE__ */ jsx2(TooltipPrimitive.Provider, { delayDuration, ...props });
|
|
120
|
-
}
|
|
121
|
-
function Tooltip({ children, ...props }) {
|
|
122
|
-
const sourceRef = useRef(null);
|
|
123
|
-
return /* @__PURE__ */ jsx2(TooltipSourceContext.Provider, { value: sourceRef, children: /* @__PURE__ */ jsx2(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children }) });
|
|
124
|
-
}
|
|
125
|
-
function TooltipTrigger({
|
|
126
|
-
asChild = true,
|
|
127
|
-
...props
|
|
128
|
-
}) {
|
|
129
|
-
const sourceRef = useContext(TooltipSourceContext);
|
|
130
|
-
return /* @__PURE__ */ jsx2(
|
|
131
|
-
TooltipPrimitive.Trigger,
|
|
132
|
-
{
|
|
133
|
-
"data-slot": "tooltip-trigger",
|
|
134
|
-
asChild,
|
|
135
|
-
ref: (node) => {
|
|
136
|
-
if (sourceRef) sourceRef.current = node;
|
|
137
|
-
},
|
|
138
|
-
...props
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
var tooltipSurfaceStyle = {
|
|
143
|
-
backgroundColor: "var(--og-color-fg)",
|
|
144
|
-
color: "var(--og-color-bg)"
|
|
145
|
-
};
|
|
146
|
-
function TooltipContent({
|
|
147
|
-
className,
|
|
148
|
-
sideOffset = 6,
|
|
149
|
-
children,
|
|
150
|
-
style,
|
|
151
|
-
...props
|
|
152
|
-
}) {
|
|
153
|
-
const sourceRef = useContext(TooltipSourceContext);
|
|
154
|
-
const fallbackRef = useRef(null);
|
|
155
|
-
const portalStyle = usePortalTokenStyle(sourceRef ?? fallbackRef);
|
|
156
|
-
return /* @__PURE__ */ jsx2(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
157
|
-
TooltipPrimitive.Content,
|
|
158
|
-
{
|
|
159
|
-
"data-slot": "tooltip-content",
|
|
160
|
-
sideOffset,
|
|
161
|
-
className: cn(
|
|
162
|
-
"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]",
|
|
163
|
-
"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md",
|
|
164
|
-
"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity",
|
|
165
|
-
className
|
|
166
|
-
),
|
|
167
|
-
style: { ...portalStyle, ...tooltipSurfaceStyle, ...style },
|
|
168
|
-
...props,
|
|
169
|
-
children: [
|
|
170
|
-
children,
|
|
171
|
-
/* @__PURE__ */ jsx2(
|
|
172
|
-
TooltipPrimitive.Arrow,
|
|
173
|
-
{
|
|
174
|
-
className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
175
|
-
style: {
|
|
176
|
-
backgroundColor: "var(--og-color-fg)",
|
|
177
|
-
fill: "var(--og-color-fg)"
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
) });
|
|
184
|
-
}
|
|
185
|
-
|
|
186
69
|
// src/components/session-chrome.tsx
|
|
187
70
|
import {
|
|
188
71
|
ArrowDownIcon,
|
|
@@ -201,14 +84,14 @@ import {
|
|
|
201
84
|
} from "lucide-react";
|
|
202
85
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
203
86
|
import {
|
|
204
|
-
useEffect
|
|
87
|
+
useEffect,
|
|
205
88
|
useId,
|
|
206
89
|
useLayoutEffect,
|
|
207
90
|
useMemo,
|
|
208
|
-
useRef
|
|
209
|
-
useState
|
|
91
|
+
useRef,
|
|
92
|
+
useState
|
|
210
93
|
} from "react";
|
|
211
|
-
import { Fragment, jsx as
|
|
94
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
212
95
|
var GOAL_LABEL = {
|
|
213
96
|
pursuing: "Pursuing",
|
|
214
97
|
scheduled: "Scheduled",
|
|
@@ -244,8 +127,8 @@ function formatCoarseElapsed(ms) {
|
|
|
244
127
|
}
|
|
245
128
|
function useLiveElapsed(startIso, live, endIso) {
|
|
246
129
|
const start = startIso ? Date.parse(startIso) : Number.NaN;
|
|
247
|
-
const [now, setNow] =
|
|
248
|
-
|
|
130
|
+
const [now, setNow] = useState(() => Date.now());
|
|
131
|
+
useEffect(() => {
|
|
249
132
|
if (!live) return;
|
|
250
133
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
251
134
|
return () => clearInterval(id);
|
|
@@ -320,7 +203,7 @@ function SessionChrome({
|
|
|
320
203
|
tone: incoming.some(
|
|
321
204
|
(item) => item.classification === "action_required" || item.classification === "failure"
|
|
322
205
|
) ? "waiting" : "neutral",
|
|
323
|
-
icon: /* @__PURE__ */
|
|
206
|
+
icon: /* @__PURE__ */ jsx2(InboxIcon, { className: "size-3" })
|
|
324
207
|
});
|
|
325
208
|
}
|
|
326
209
|
if (turns.length > 0) {
|
|
@@ -330,7 +213,7 @@ function SessionChrome({
|
|
|
330
213
|
label: `${turns.length} queued prompt${turns.length === 1 ? "" : "s"}`,
|
|
331
214
|
...detail ? { detail } : {},
|
|
332
215
|
tone: "neutral",
|
|
333
|
-
icon: /* @__PURE__ */
|
|
216
|
+
icon: /* @__PURE__ */ jsx2(ListOrderedIcon, { className: "size-3" })
|
|
334
217
|
});
|
|
335
218
|
}
|
|
336
219
|
if (record && goalState) {
|
|
@@ -340,7 +223,7 @@ function SessionChrome({
|
|
|
340
223
|
label: GOAL_LABEL[goalState],
|
|
341
224
|
detail: elapsed ? `${elapsed} \xB7 ${record.text}` : record.text,
|
|
342
225
|
tone: waiting ? "waiting" : goalState === "pursuing" || goalState === "scheduled" ? "accent" : "neutral",
|
|
343
|
-
icon: goalState === "blocked" || goalState === "invariant_broken" ? /* @__PURE__ */
|
|
226
|
+
icon: goalState === "blocked" || goalState === "invariant_broken" ? /* @__PURE__ */ jsx2(TriangleAlertIcon, { className: "size-3" }) : goalState === "paused" || goalState === "held" ? /* @__PURE__ */ jsx2(PauseIcon, { className: "size-3" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
|
|
344
227
|
});
|
|
345
228
|
}
|
|
346
229
|
if (agentsSignal && agentsSignal.count > 0) {
|
|
@@ -350,12 +233,12 @@ function SessionChrome({
|
|
|
350
233
|
label: `${agentsSignal.count} agent${agentsSignal.count === 1 ? "" : "s"}`,
|
|
351
234
|
...detail ? { detail } : {},
|
|
352
235
|
tone: agentsSignal.tone ?? "neutral",
|
|
353
|
-
icon: /* @__PURE__ */
|
|
236
|
+
icon: /* @__PURE__ */ jsx2(BotIcon, { className: "size-3" })
|
|
354
237
|
});
|
|
355
238
|
}
|
|
356
239
|
return rows;
|
|
357
240
|
}, [agentsSignal, elapsed, goalState, incoming, record, turns]);
|
|
358
|
-
const [activeUncontrolled, setActiveUncontrolled] =
|
|
241
|
+
const [activeUncontrolled, setActiveUncontrolled] = useState(
|
|
359
242
|
defaultActive
|
|
360
243
|
);
|
|
361
244
|
const active = activeControlled !== void 0 ? activeControlled : activeUncontrolled;
|
|
@@ -363,26 +246,26 @@ function SessionChrome({
|
|
|
363
246
|
if (activeControlled === void 0) setActiveUncontrolled(next);
|
|
364
247
|
onActiveChange?.(next);
|
|
365
248
|
};
|
|
366
|
-
const [replaceDraftFor, setReplaceDraftFor] =
|
|
367
|
-
const chipRefs =
|
|
368
|
-
const railRef =
|
|
369
|
-
const panelBodyRef =
|
|
370
|
-
const [pill, setPill] =
|
|
371
|
-
const [panelHeight, setPanelHeight] =
|
|
249
|
+
const [replaceDraftFor, setReplaceDraftFor] = useState(null);
|
|
250
|
+
const chipRefs = useRef({});
|
|
251
|
+
const railRef = useRef(null);
|
|
252
|
+
const panelBodyRef = useRef(null);
|
|
253
|
+
const [pill, setPill] = useState({ left: 0, width: 0, opacity: 0 });
|
|
254
|
+
const [panelHeight, setPanelHeight] = useState(0);
|
|
372
255
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
373
|
-
|
|
256
|
+
useEffect(() => {
|
|
374
257
|
if (active && !signalIds.split(",").includes(active)) {
|
|
375
258
|
if (activeControlled === void 0) setActiveUncontrolled(null);
|
|
376
259
|
onActiveChange?.(null);
|
|
377
260
|
}
|
|
378
261
|
}, [active, activeControlled, onActiveChange, signalIds]);
|
|
379
|
-
|
|
262
|
+
useEffect(() => {
|
|
380
263
|
if (active !== "queue" || !replaceDraftFor) return;
|
|
381
264
|
if (!turns.some((turn) => turn.id === replaceDraftFor)) {
|
|
382
265
|
setReplaceDraftFor(null);
|
|
383
266
|
}
|
|
384
267
|
}, [active, replaceDraftFor, turns]);
|
|
385
|
-
|
|
268
|
+
useEffect(() => {
|
|
386
269
|
const rail = railRef.current;
|
|
387
270
|
const measure = () => {
|
|
388
271
|
if (!rail || !active) {
|
|
@@ -419,7 +302,7 @@ function SessionChrome({
|
|
|
419
302
|
if (!node) return;
|
|
420
303
|
setPanelHeight(node.offsetHeight);
|
|
421
304
|
}, [open, active, incoming, turns, record, goalState, agentsPanel, agentsSignal]);
|
|
422
|
-
|
|
305
|
+
useEffect(() => {
|
|
423
306
|
if (!open) return;
|
|
424
307
|
const node = panelBodyRef.current;
|
|
425
308
|
if (!node || typeof ResizeObserver === "undefined") return;
|
|
@@ -433,7 +316,7 @@ function SessionChrome({
|
|
|
433
316
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
434
317
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
435
318
|
const ease = [0.22, 1, 0.36, 1];
|
|
436
|
-
const panelBody = active === "incoming" ? /* @__PURE__ */
|
|
319
|
+
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "queue" ? /* @__PURE__ */ jsx2(
|
|
437
320
|
QueuePanel,
|
|
438
321
|
{
|
|
439
322
|
turns,
|
|
@@ -471,15 +354,15 @@ function SessionChrome({
|
|
|
471
354
|
void queue.moveTurn(turnId, beforeTurnId);
|
|
472
355
|
} : void 0
|
|
473
356
|
}
|
|
474
|
-
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */
|
|
475
|
-
return /* @__PURE__ */
|
|
357
|
+
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx2(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "agents" ? /* @__PURE__ */ jsx2("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx2("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
|
|
358
|
+
return /* @__PURE__ */ jsx2(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx2(
|
|
476
359
|
"div",
|
|
477
360
|
{
|
|
478
361
|
className: cn("og-session-chrome og-root w-full", className),
|
|
479
362
|
"data-testid": "session-chrome",
|
|
480
363
|
"data-og-session-chrome": "",
|
|
481
364
|
"data-og-session-chrome-open": open ? "true" : "false",
|
|
482
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ jsxs2(
|
|
483
366
|
"div",
|
|
484
367
|
{
|
|
485
368
|
className: cn(
|
|
@@ -495,7 +378,7 @@ function SessionChrome({
|
|
|
495
378
|
transitionTimingFunction: "var(--og-session-chrome-ease)"
|
|
496
379
|
},
|
|
497
380
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ jsxs2(
|
|
499
382
|
"div",
|
|
500
383
|
{
|
|
501
384
|
ref: railRef,
|
|
@@ -505,7 +388,7 @@ function SessionChrome({
|
|
|
505
388
|
padding: "var(--og-session-chrome-rail-pad)"
|
|
506
389
|
},
|
|
507
390
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ jsx2(
|
|
509
392
|
motion.div,
|
|
510
393
|
{
|
|
511
394
|
"aria-hidden": true,
|
|
@@ -526,7 +409,7 @@ function SessionChrome({
|
|
|
526
409
|
),
|
|
527
410
|
signals.map((signal) => {
|
|
528
411
|
const selected = active === signal.id;
|
|
529
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ jsxs2(
|
|
530
413
|
"button",
|
|
531
414
|
{
|
|
532
415
|
type: "button",
|
|
@@ -549,18 +432,18 @@ function SessionChrome({
|
|
|
549
432
|
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
550
433
|
},
|
|
551
434
|
children: [
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
signal.detail ? /* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ jsx2("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
436
|
+
/* @__PURE__ */ jsx2("span", { className: "shrink-0 font-medium text-og-fg", children: signal.label }),
|
|
437
|
+
signal.detail ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
438
|
+
/* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "shrink-0 text-og-fg-subtle/60", children: "\xB7" }),
|
|
439
|
+
/* @__PURE__ */ jsx2("span", { className: "min-w-0 max-w-[8.5rem] truncate text-og-fg sm:max-w-[12rem]", children: signal.detail })
|
|
557
440
|
] }) : null
|
|
558
441
|
]
|
|
559
442
|
},
|
|
560
443
|
signal.id
|
|
561
444
|
);
|
|
562
445
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ jsx2(AnimatePresence, { initial: false, children: open ? /* @__PURE__ */ jsx2(
|
|
564
447
|
motion.button,
|
|
565
448
|
{
|
|
566
449
|
type: "button",
|
|
@@ -571,14 +454,14 @@ function SessionChrome({
|
|
|
571
454
|
exit: reduceMotion ? { opacity: 1 } : { opacity: 0 },
|
|
572
455
|
transition: { duration: crossfadeDuration, ease },
|
|
573
456
|
className: "relative z-[1] ml-auto inline-flex size-7 shrink-0 items-center justify-center rounded-og-md text-og-fg-subtle outline-none transition-colors hover:bg-og-surface-3/60 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 pointer-coarse:size-11",
|
|
574
|
-
children: /* @__PURE__ */
|
|
457
|
+
children: /* @__PURE__ */ jsx2(XIcon, { className: "size-3" })
|
|
575
458
|
},
|
|
576
459
|
"close"
|
|
577
460
|
) : null })
|
|
578
461
|
]
|
|
579
462
|
}
|
|
580
463
|
),
|
|
581
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ jsx2(
|
|
582
465
|
motion.div,
|
|
583
466
|
{
|
|
584
467
|
id: panelId,
|
|
@@ -590,7 +473,7 @@ function SessionChrome({
|
|
|
590
473
|
},
|
|
591
474
|
transition: { duration: shellDuration, ease },
|
|
592
475
|
className: "overflow-hidden",
|
|
593
|
-
children: /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ jsx2(
|
|
594
477
|
"div",
|
|
595
478
|
{
|
|
596
479
|
ref: panelBodyRef,
|
|
@@ -599,7 +482,7 @@ function SessionChrome({
|
|
|
599
482
|
paddingInline: "var(--og-session-chrome-panel-pad-x)",
|
|
600
483
|
paddingBlock: "var(--og-session-chrome-panel-pad-y)"
|
|
601
484
|
},
|
|
602
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ jsx2(AnimatePresence, { initial: false, children: active && panelBody ? /* @__PURE__ */ jsx2(
|
|
603
486
|
motion.div,
|
|
604
487
|
{
|
|
605
488
|
"data-og-session-chrome-panel-frame": active,
|
|
@@ -631,18 +514,18 @@ function IncomingPanel({
|
|
|
631
514
|
inputs,
|
|
632
515
|
onDismiss
|
|
633
516
|
}) {
|
|
634
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ jsx2(
|
|
635
518
|
"ul",
|
|
636
519
|
{
|
|
637
520
|
className: "flex flex-col gap-0.5",
|
|
638
521
|
"aria-label": "Incoming updates",
|
|
639
522
|
"data-og-session-chrome-panel": "incoming",
|
|
640
|
-
children: inputs.map((input) => /* @__PURE__ */
|
|
523
|
+
children: inputs.map((input) => /* @__PURE__ */ jsxs2(
|
|
641
524
|
"li",
|
|
642
525
|
{
|
|
643
526
|
className: "group flex items-start gap-1.5 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--og-session-chrome-row-hover)]",
|
|
644
527
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ jsx2(
|
|
646
529
|
"span",
|
|
647
530
|
{
|
|
648
531
|
className: cn(
|
|
@@ -652,15 +535,15 @@ function IncomingPanel({
|
|
|
652
535
|
children: pendingKindLabel(input.kind)
|
|
653
536
|
}
|
|
654
537
|
),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
onDismiss ? /* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ jsx2("p", { className: "min-w-0 flex-1 text-og-xs leading-4 text-og-fg", children: input.summary }),
|
|
539
|
+
onDismiss ? /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: /* @__PURE__ */ jsx2(
|
|
657
540
|
IconAction,
|
|
658
541
|
{
|
|
659
542
|
label: `Dismiss incoming ${pendingKindLabel(input.kind)}`,
|
|
660
543
|
tip: "Dismiss",
|
|
661
544
|
onClick: () => onDismiss(input.id),
|
|
662
545
|
danger: true,
|
|
663
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ jsx2(Trash2Icon, { className: "size-3" })
|
|
664
547
|
}
|
|
665
548
|
) }) : null
|
|
666
549
|
]
|
|
@@ -682,7 +565,7 @@ function QueuePanel({
|
|
|
682
565
|
onRemove,
|
|
683
566
|
onMove
|
|
684
567
|
}) {
|
|
685
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ jsx2(
|
|
686
569
|
"ol",
|
|
687
570
|
{
|
|
688
571
|
className: "flex flex-col gap-0.5",
|
|
@@ -694,59 +577,59 @@ function QueuePanel({
|
|
|
694
577
|
const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
|
|
695
578
|
const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
|
|
696
579
|
const confirmingReplace = replaceDraftFor === turn.id;
|
|
697
|
-
return /* @__PURE__ */
|
|
580
|
+
return /* @__PURE__ */ jsxs2(
|
|
698
581
|
"li",
|
|
699
582
|
{
|
|
700
583
|
"data-queue-turn-id": turn.id,
|
|
701
584
|
className: "group flex flex-col gap-1 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--og-session-chrome-row-hover)]",
|
|
702
585
|
children: [
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
showActions ? /* @__PURE__ */
|
|
707
|
-
onMove && turns.length > 1 ? /* @__PURE__ */
|
|
708
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-1.5", children: [
|
|
587
|
+
/* @__PURE__ */ jsx2("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
|
|
588
|
+
/* @__PURE__ */ jsx2("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: turn.prompt }),
|
|
589
|
+
showActions ? /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: [
|
|
590
|
+
onMove && turns.length > 1 ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
591
|
+
/* @__PURE__ */ jsx2(
|
|
709
592
|
IconAction,
|
|
710
593
|
{
|
|
711
594
|
label: `Move queued prompt ${index + 1} up`,
|
|
712
595
|
tip: "Move up",
|
|
713
596
|
disabled: pending !== null || index === 0,
|
|
714
597
|
onClick: () => onMove(turn.id, beforeUp),
|
|
715
|
-
children: /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ jsx2(ArrowUpIcon, { className: "size-3" })
|
|
716
599
|
}
|
|
717
600
|
),
|
|
718
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ jsx2(
|
|
719
602
|
IconAction,
|
|
720
603
|
{
|
|
721
604
|
label: `Move queued prompt ${index + 1} down`,
|
|
722
605
|
tip: "Move down",
|
|
723
606
|
disabled: pending !== null || index >= turns.length - 1,
|
|
724
607
|
onClick: () => onMove(turn.id, beforeDown),
|
|
725
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ jsx2(ArrowDownIcon, { className: "size-3" })
|
|
726
609
|
}
|
|
727
610
|
)
|
|
728
611
|
] }) : null,
|
|
729
|
-
onSteer ? /* @__PURE__ */
|
|
612
|
+
onSteer ? /* @__PURE__ */ jsx2(
|
|
730
613
|
IconAction,
|
|
731
614
|
{
|
|
732
615
|
label: `Steer queued prompt ${index + 1}`,
|
|
733
616
|
tip: QUEUE_STEER_TIP,
|
|
734
617
|
disabled: pending !== null,
|
|
735
618
|
onClick: () => onSteer(turn.id),
|
|
736
|
-
children: pending === "steer" ? /* @__PURE__ */
|
|
619
|
+
children: pending === "steer" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
|
|
737
620
|
}
|
|
738
621
|
) : null,
|
|
739
|
-
onEdit ? /* @__PURE__ */
|
|
622
|
+
onEdit ? /* @__PURE__ */ jsx2(
|
|
740
623
|
IconAction,
|
|
741
624
|
{
|
|
742
625
|
label: `Edit queued prompt ${index + 1}`,
|
|
743
626
|
tip: QUEUE_EDIT_TIP,
|
|
744
627
|
disabled: pending !== null,
|
|
745
628
|
onClick: () => onEdit(turn),
|
|
746
|
-
children: pending === "edit" ? /* @__PURE__ */
|
|
629
|
+
children: pending === "edit" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(PencilIcon, { className: "size-3" })
|
|
747
630
|
}
|
|
748
631
|
) : null,
|
|
749
|
-
onRemove ? /* @__PURE__ */
|
|
632
|
+
onRemove ? /* @__PURE__ */ jsx2(
|
|
750
633
|
IconAction,
|
|
751
634
|
{
|
|
752
635
|
label: `Remove queued prompt ${index + 1}`,
|
|
@@ -754,16 +637,16 @@ function QueuePanel({
|
|
|
754
637
|
disabled: pending !== null,
|
|
755
638
|
onClick: () => onRemove(turn.id),
|
|
756
639
|
danger: true,
|
|
757
|
-
children: pending === "delete" ? /* @__PURE__ */
|
|
640
|
+
children: pending === "delete" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(Trash2Icon, { className: "size-3" })
|
|
758
641
|
}
|
|
759
642
|
) : null
|
|
760
643
|
] }) : null
|
|
761
644
|
] }),
|
|
762
|
-
confirmingReplace ? /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
645
|
+
confirmingReplace ? /* @__PURE__ */ jsxs2("div", { className: "rounded-og-sm border border-og-status-waiting/30 bg-og-status-waiting/10 p-2 text-og-xs text-og-fg", children: [
|
|
646
|
+
/* @__PURE__ */ jsx2("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
|
|
647
|
+
/* @__PURE__ */ jsx2("p", { className: "mt-0.5 text-og-fg-muted", children: "The current draft will be permanently discarded; this queued prompt is preserved until you confirm." }),
|
|
648
|
+
/* @__PURE__ */ jsxs2("div", { className: "mt-2 flex justify-end gap-1.5", children: [
|
|
649
|
+
/* @__PURE__ */ jsx2(
|
|
767
650
|
"button",
|
|
768
651
|
{
|
|
769
652
|
type: "button",
|
|
@@ -772,7 +655,7 @@ function QueuePanel({
|
|
|
772
655
|
children: "Keep current draft"
|
|
773
656
|
}
|
|
774
657
|
),
|
|
775
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ jsx2(
|
|
776
659
|
"button",
|
|
777
660
|
{
|
|
778
661
|
type: "button",
|
|
@@ -800,38 +683,38 @@ function GoalPanel({
|
|
|
800
683
|
const record = goal.goal;
|
|
801
684
|
if (!record) return null;
|
|
802
685
|
const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
|
|
803
|
-
return /* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
elapsed ? /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ jsxs2("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
|
|
687
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
|
|
688
|
+
/* @__PURE__ */ jsx2("span", { children: GOAL_LABEL[state] }),
|
|
689
|
+
elapsed ? /* @__PURE__ */ jsxs2("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
|
|
807
690
|
"\xB7 ",
|
|
808
691
|
elapsed
|
|
809
692
|
] }) : null,
|
|
810
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ jsxs2("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
|
|
811
694
|
"\xB7 v",
|
|
812
695
|
record.version
|
|
813
696
|
] })
|
|
814
697
|
] }),
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
record.successCriteria ? /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ jsx2("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
|
|
699
|
+
record.successCriteria ? /* @__PURE__ */ jsxs2("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
|
|
700
|
+
/* @__PURE__ */ jsx2("span", { className: "font-medium text-og-fg", children: "Done when" }),
|
|
818
701
|
" ",
|
|
819
702
|
record.successCriteria
|
|
820
703
|
] }) : null,
|
|
821
|
-
record.continuation?.lastError ? /* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
704
|
+
record.continuation?.lastError ? /* @__PURE__ */ jsx2("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children: record.continuation.lastError }) : null,
|
|
705
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
|
|
706
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
|
|
707
|
+
/* @__PURE__ */ jsxs2("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
825
708
|
record.autoContinuations,
|
|
826
709
|
" auto-continues"
|
|
827
710
|
] }),
|
|
828
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ jsxs2("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
829
712
|
record.noProgressStreak,
|
|
830
713
|
" stalled"
|
|
831
714
|
] })
|
|
832
715
|
] }),
|
|
833
|
-
!readOnly ? /* @__PURE__ */
|
|
834
|
-
canToggle ? /* @__PURE__ */
|
|
716
|
+
!readOnly ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-0.5", children: [
|
|
717
|
+
canToggle ? /* @__PURE__ */ jsxs2(
|
|
835
718
|
"button",
|
|
836
719
|
{
|
|
837
720
|
type: "button",
|
|
@@ -839,12 +722,12 @@ function GoalPanel({
|
|
|
839
722
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
840
723
|
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-none transition-colors hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
841
724
|
children: [
|
|
842
|
-
goal.updating ? /* @__PURE__ */
|
|
725
|
+
goal.updating ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx2(PlayIcon, { className: "size-3" }) : /* @__PURE__ */ jsx2(PauseIcon, { className: "size-3" }),
|
|
843
726
|
record.status === "paused" ? "Resume" : "Pause"
|
|
844
727
|
]
|
|
845
728
|
}
|
|
846
729
|
) : null,
|
|
847
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsxs2(
|
|
848
731
|
"button",
|
|
849
732
|
{
|
|
850
733
|
type: "button",
|
|
@@ -852,7 +735,7 @@ function GoalPanel({
|
|
|
852
735
|
onClick: () => void goal.deleteGoal(),
|
|
853
736
|
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-subtle outline-none transition-colors hover:bg-og-surface-3/70 hover:text-og-danger focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
854
737
|
children: [
|
|
855
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx2(Trash2Icon, { className: "size-3" }),
|
|
856
739
|
"Clear"
|
|
857
740
|
]
|
|
858
741
|
}
|
|
@@ -861,9 +744,9 @@ function GoalPanel({
|
|
|
861
744
|
] })
|
|
862
745
|
] });
|
|
863
746
|
}
|
|
864
|
-
var QUEUE_STEER_TIP = /* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
747
|
+
var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs2("span", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
748
|
+
/* @__PURE__ */ jsx2("span", { className: "font-medium", children: "Steer" }),
|
|
749
|
+
/* @__PURE__ */ jsx2("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
|
|
867
750
|
] });
|
|
868
751
|
var QUEUE_EDIT_TIP = "Edit in composer";
|
|
869
752
|
var QUEUE_DELETE_TIP = "Delete this queued prompt";
|
|
@@ -875,8 +758,8 @@ function IconAction({
|
|
|
875
758
|
danger,
|
|
876
759
|
children
|
|
877
760
|
}) {
|
|
878
|
-
return /* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
762
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
880
763
|
"button",
|
|
881
764
|
{
|
|
882
765
|
type: "button",
|
|
@@ -892,13 +775,13 @@ function IconAction({
|
|
|
892
775
|
children
|
|
893
776
|
}
|
|
894
777
|
) }),
|
|
895
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ jsx2(TooltipContent, { side: "top", children: tip })
|
|
896
779
|
] });
|
|
897
780
|
}
|
|
898
781
|
|
|
899
782
|
// src/components/human-input-form.tsx
|
|
900
|
-
import { useEffect as
|
|
901
|
-
import { jsx as
|
|
783
|
+
import { useEffect as useEffect2, useId as useId2, useRef as useRef2, useState as useState2 } from "react";
|
|
784
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
902
785
|
var defaultHumanInputFormMessages = {
|
|
903
786
|
title: "Your input is needed",
|
|
904
787
|
description: "The agent is paused until you answer these questions.",
|
|
@@ -934,16 +817,16 @@ function HumanInputForm({
|
|
|
934
817
|
const resolvedSubmitLabel = submitLabel ?? messages.submit;
|
|
935
818
|
const resolvedSkipLabel = skipLabel ?? messages.skip;
|
|
936
819
|
const formId = useId2();
|
|
937
|
-
const [drafts, setDrafts] =
|
|
820
|
+
const [drafts, setDrafts] = useState2(
|
|
938
821
|
() => initialDrafts(request.questions)
|
|
939
822
|
);
|
|
940
|
-
const [validationErrors, setValidationErrors] =
|
|
941
|
-
const [submissionError, setSubmissionError] =
|
|
942
|
-
const [submittingInternally, setSubmittingInternally] =
|
|
943
|
-
const submissionInFlight =
|
|
944
|
-
const submissionGeneration =
|
|
823
|
+
const [validationErrors, setValidationErrors] = useState2({});
|
|
824
|
+
const [submissionError, setSubmissionError] = useState2(null);
|
|
825
|
+
const [submittingInternally, setSubmittingInternally] = useState2(false);
|
|
826
|
+
const submissionInFlight = useRef2(false);
|
|
827
|
+
const submissionGeneration = useRef2(0);
|
|
945
828
|
const busy = submitting || submittingInternally;
|
|
946
|
-
|
|
829
|
+
useEffect2(() => {
|
|
947
830
|
submissionGeneration.current += 1;
|
|
948
831
|
submissionInFlight.current = false;
|
|
949
832
|
setDrafts(initialDrafts(request.questions));
|
|
@@ -991,7 +874,7 @@ function HumanInputForm({
|
|
|
991
874
|
}
|
|
992
875
|
await submitResponse({ outcome: "answered", answers: result.answers });
|
|
993
876
|
};
|
|
994
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsxs3(
|
|
995
878
|
"form",
|
|
996
879
|
{
|
|
997
880
|
"data-human-input-request": request.id,
|
|
@@ -1001,36 +884,36 @@ function HumanInputForm({
|
|
|
1001
884
|
className
|
|
1002
885
|
),
|
|
1003
886
|
children: [
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1006
|
-
resolvedDescription ? /* @__PURE__ */
|
|
1007
|
-
request.expiresAt ? /* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ jsxs3("header", { children: [
|
|
888
|
+
/* @__PURE__ */ jsx3("h2", { className: "text-og-md font-semibold text-og-fg", children: resolvedTitle }),
|
|
889
|
+
resolvedDescription ? /* @__PURE__ */ jsx3("div", { className: "mt-1 text-og-sm text-og-fg-muted", children: resolvedDescription }) : null,
|
|
890
|
+
request.expiresAt ? /* @__PURE__ */ jsxs3("p", { className: "mt-1 text-og-xs text-og-fg-subtle", children: [
|
|
1008
891
|
messages.deadlineLabel,
|
|
1009
892
|
" ",
|
|
1010
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ jsx3("time", { dateTime: request.expiresAt, children: messages.formatDeadline(request.expiresAt) })
|
|
1011
894
|
] }) : null
|
|
1012
895
|
] }),
|
|
1013
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ jsx3("fieldset", { disabled: busy, className: "contents", children: request.questions.map((question, index) => {
|
|
1014
897
|
const draft = drafts[question.id] ?? emptyDraft();
|
|
1015
898
|
const fieldId = `${formId}-${index}`;
|
|
1016
899
|
const errorId = `${fieldId}-error`;
|
|
1017
900
|
const helpId = `${fieldId}-help`;
|
|
1018
901
|
const describedBy = [question.helpText ? helpId : null, validationErrors[question.id] ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
|
|
903
|
+
/* @__PURE__ */ jsxs3(
|
|
1021
904
|
"label",
|
|
1022
905
|
{
|
|
1023
906
|
htmlFor: question.kind === "text" ? fieldId : void 0,
|
|
1024
907
|
className: "text-og-base font-medium text-og-fg",
|
|
1025
908
|
children: [
|
|
1026
909
|
question.label ?? question.prompt,
|
|
1027
|
-
question.required ? /* @__PURE__ */
|
|
910
|
+
question.required ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "ml-1 text-og-status-failed", children: "*" }) : null
|
|
1028
911
|
]
|
|
1029
912
|
}
|
|
1030
913
|
),
|
|
1031
|
-
question.label ? /* @__PURE__ */
|
|
1032
|
-
question.helpText ? /* @__PURE__ */
|
|
1033
|
-
question.kind === "text" ? /* @__PURE__ */
|
|
914
|
+
question.label ? /* @__PURE__ */ jsx3("p", { className: "text-og-sm text-og-fg-muted", children: question.prompt }) : null,
|
|
915
|
+
question.helpText ? /* @__PURE__ */ jsx3("p", { id: helpId, className: "text-og-xs text-og-fg-subtle", children: question.helpText }) : null,
|
|
916
|
+
question.kind === "text" ? /* @__PURE__ */ jsx3(
|
|
1034
917
|
"textarea",
|
|
1035
918
|
{
|
|
1036
919
|
id: fieldId,
|
|
@@ -1045,7 +928,7 @@ function HumanInputForm({
|
|
|
1045
928
|
rows: 3,
|
|
1046
929
|
className: "min-h-20 w-full resize-y rounded-og-md border border-og-border bg-og-surface-2 px-3 py-2 text-og-base text-og-fg outline-none placeholder:text-og-fg-subtle focus:border-og-accent"
|
|
1047
930
|
}
|
|
1048
|
-
) : /* @__PURE__ */
|
|
931
|
+
) : /* @__PURE__ */ jsxs3(
|
|
1049
932
|
"div",
|
|
1050
933
|
{
|
|
1051
934
|
role: question.kind === "single_select" ? "radiogroup" : "group",
|
|
@@ -1054,12 +937,12 @@ function HumanInputForm({
|
|
|
1054
937
|
children: [
|
|
1055
938
|
question.options.map((option, optionIndex) => {
|
|
1056
939
|
const checked = draft.values.includes(option.id);
|
|
1057
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ jsxs3(
|
|
1058
941
|
"label",
|
|
1059
942
|
{
|
|
1060
943
|
className: "flex cursor-pointer items-start gap-2 rounded-og-md border border-og-border px-3 py-2 hover:bg-og-surface-2",
|
|
1061
944
|
children: [
|
|
1062
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ jsx3(
|
|
1063
946
|
"input",
|
|
1064
947
|
{
|
|
1065
948
|
type: question.kind === "single_select" ? "radio" : "checkbox",
|
|
@@ -1074,17 +957,17 @@ function HumanInputForm({
|
|
|
1074
957
|
className: "mt-0.5 accent-og-accent"
|
|
1075
958
|
}
|
|
1076
959
|
),
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
option.description ? /* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsxs3("span", { className: "min-w-0", children: [
|
|
961
|
+
/* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: option.label }),
|
|
962
|
+
option.description ? /* @__PURE__ */ jsx3("span", { className: "block text-og-xs text-og-fg-muted", children: option.description }) : null
|
|
1080
963
|
] })
|
|
1081
964
|
]
|
|
1082
965
|
},
|
|
1083
966
|
option.id
|
|
1084
967
|
);
|
|
1085
968
|
}),
|
|
1086
|
-
question.allowOther ? /* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
969
|
+
question.allowOther ? /* @__PURE__ */ jsxs3("label", { className: "flex items-start gap-2 rounded-og-md border border-og-border px-3 py-2", children: [
|
|
970
|
+
/* @__PURE__ */ jsx3(
|
|
1088
971
|
"input",
|
|
1089
972
|
{
|
|
1090
973
|
type: question.kind === "single_select" ? "radio" : "checkbox",
|
|
@@ -1099,9 +982,9 @@ function HumanInputForm({
|
|
|
1099
982
|
className: "mt-2 accent-og-accent"
|
|
1100
983
|
}
|
|
1101
984
|
),
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
|
|
986
|
+
/* @__PURE__ */ jsx3("span", { className: "block text-og-sm font-medium text-og-fg", children: messages.other }),
|
|
987
|
+
/* @__PURE__ */ jsx3(
|
|
1105
988
|
"input",
|
|
1106
989
|
{
|
|
1107
990
|
type: "text",
|
|
@@ -1119,12 +1002,12 @@ function HumanInputForm({
|
|
|
1119
1002
|
]
|
|
1120
1003
|
}
|
|
1121
1004
|
),
|
|
1122
|
-
validationErrors[question.id] ? /* @__PURE__ */
|
|
1005
|
+
validationErrors[question.id] ? /* @__PURE__ */ jsx3("p", { id: errorId, role: "alert", className: "text-og-xs text-og-status-failed", children: validationErrors[question.id] }) : null
|
|
1123
1006
|
] }, question.id);
|
|
1124
1007
|
}) }),
|
|
1125
|
-
error ?? submissionError ? /* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
request.allowSkip ? /* @__PURE__ */
|
|
1008
|
+
error ?? submissionError ? /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-og-sm text-og-status-failed", children: error ?? submissionError }) : null,
|
|
1009
|
+
/* @__PURE__ */ jsxs3("footer", { className: "flex items-center justify-end gap-2", children: [
|
|
1010
|
+
request.allowSkip ? /* @__PURE__ */ jsx3(
|
|
1128
1011
|
"button",
|
|
1129
1012
|
{
|
|
1130
1013
|
type: "button",
|
|
@@ -1134,7 +1017,7 @@ function HumanInputForm({
|
|
|
1134
1017
|
children: resolvedSkipLabel
|
|
1135
1018
|
}
|
|
1136
1019
|
) : null,
|
|
1137
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ jsx3(
|
|
1138
1021
|
"button",
|
|
1139
1022
|
{
|
|
1140
1023
|
type: "submit",
|
|
@@ -1238,7 +1121,18 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
|
|
|
1238
1121
|
return byType;
|
|
1239
1122
|
}
|
|
1240
1123
|
}
|
|
1241
|
-
|
|
1124
|
+
const exact = byName.get(item.name);
|
|
1125
|
+
if (exact) {
|
|
1126
|
+
return exact;
|
|
1127
|
+
}
|
|
1128
|
+
const leaf = mcpToolLeaf(item.name);
|
|
1129
|
+
if (leaf !== item.name) {
|
|
1130
|
+
const byLeaf = byName.get(leaf);
|
|
1131
|
+
if (byLeaf) {
|
|
1132
|
+
return byLeaf;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
return fallback;
|
|
1242
1136
|
};
|
|
1243
1137
|
return { resolve, fallback };
|
|
1244
1138
|
}
|
|
@@ -1383,9 +1277,21 @@ function applyPatchOps(raw) {
|
|
|
1383
1277
|
}
|
|
1384
1278
|
return r.operation ? [r.operation] : [];
|
|
1385
1279
|
}
|
|
1280
|
+
function applyPatchOpsFromToolItem(item) {
|
|
1281
|
+
const fromRaw = applyPatchOps(item.raw);
|
|
1282
|
+
if (fromRaw.length > 0) {
|
|
1283
|
+
return fromRaw;
|
|
1284
|
+
}
|
|
1285
|
+
const args = parseToolArgs(item.arguments);
|
|
1286
|
+
return applyPatchOps(args);
|
|
1287
|
+
}
|
|
1386
1288
|
function isApplyPatch(item) {
|
|
1387
1289
|
const type = item.raw && typeof item.raw === "object" ? item.raw.type : void 0;
|
|
1388
|
-
|
|
1290
|
+
if (type === "apply_patch_call") {
|
|
1291
|
+
return true;
|
|
1292
|
+
}
|
|
1293
|
+
const name = item.name;
|
|
1294
|
+
return name === "apply_patch_call" || name === "apply_patch" || name.endsWith("__apply_patch");
|
|
1389
1295
|
}
|
|
1390
1296
|
var SECRET_KEY = /^(value|secret|token|password|api[_-]?key|signing[_-]?key)$/i;
|
|
1391
1297
|
function redactSecrets(value) {
|
|
@@ -1526,51 +1432,51 @@ function bytesToBase64(data) {
|
|
|
1526
1432
|
}
|
|
1527
1433
|
|
|
1528
1434
|
// src/timeline/disclosure-context.tsx
|
|
1529
|
-
import { createContext
|
|
1530
|
-
import { jsx as
|
|
1531
|
-
var DisclosureDefaultsContext =
|
|
1435
|
+
import { createContext, useContext } from "react";
|
|
1436
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1437
|
+
var DisclosureDefaultsContext = createContext(void 0);
|
|
1532
1438
|
function DisclosureDefaultsProvider({
|
|
1533
1439
|
defaultOpen,
|
|
1534
1440
|
children
|
|
1535
1441
|
}) {
|
|
1536
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ jsx4(DisclosureDefaultsContext.Provider, { value: defaultOpen, children });
|
|
1537
1443
|
}
|
|
1538
1444
|
function useForcedDefaultOpen() {
|
|
1539
|
-
return
|
|
1445
|
+
return useContext(DisclosureDefaultsContext);
|
|
1540
1446
|
}
|
|
1541
1447
|
|
|
1542
1448
|
// src/timeline/screenshot-lightbox.tsx
|
|
1543
1449
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
1544
1450
|
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
1545
|
-
import { createContext as
|
|
1451
|
+
import { createContext as createContext2, useCallback, useContext as useContext2, useMemo as useMemo2, useState as useState3 } from "react";
|
|
1546
1452
|
import { Dialog } from "radix-ui";
|
|
1547
|
-
import { Fragment as Fragment2, jsx as
|
|
1548
|
-
var LightboxContext =
|
|
1453
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1454
|
+
var LightboxContext = createContext2(null);
|
|
1549
1455
|
function useLightbox() {
|
|
1550
|
-
return
|
|
1456
|
+
return useContext2(LightboxContext) ?? NOOP;
|
|
1551
1457
|
}
|
|
1552
1458
|
function useLightboxOptional() {
|
|
1553
|
-
return
|
|
1459
|
+
return useContext2(LightboxContext);
|
|
1554
1460
|
}
|
|
1555
1461
|
var NOOP = { open: () => {
|
|
1556
1462
|
} };
|
|
1557
1463
|
function LightboxProvider({ children }) {
|
|
1558
|
-
const ancestor =
|
|
1464
|
+
const ancestor = useContext2(LightboxContext);
|
|
1559
1465
|
if (ancestor) {
|
|
1560
|
-
return /* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
1561
1467
|
}
|
|
1562
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ jsx5(LightboxRoot, { children });
|
|
1563
1469
|
}
|
|
1564
1470
|
function LightboxRoot({ children }) {
|
|
1565
|
-
const [state, setState] =
|
|
1471
|
+
const [state, setState] = useState3(null);
|
|
1566
1472
|
const open = useCallback((src, caption) => {
|
|
1567
1473
|
setState(caption ? { src, caption } : { src });
|
|
1568
1474
|
}, []);
|
|
1569
1475
|
const controller = useMemo2(() => ({ open }), [open]);
|
|
1570
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ jsxs4(LightboxContext.Provider, { value: controller, children: [
|
|
1571
1477
|
children,
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ jsx5(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && setState(null), children: /* @__PURE__ */ jsx5(AnimatePresence2, { children: state !== null ? /* @__PURE__ */ jsxs4(Dialog.Portal, { forceMount: true, children: [
|
|
1479
|
+
/* @__PURE__ */ jsx5(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx5(
|
|
1574
1480
|
motion2.div,
|
|
1575
1481
|
{
|
|
1576
1482
|
initial: { opacity: 0 },
|
|
@@ -1580,14 +1486,14 @@ function LightboxRoot({ children }) {
|
|
|
1580
1486
|
className: "og-root fixed inset-0 z-50 bg-black/90 backdrop-blur-md"
|
|
1581
1487
|
}
|
|
1582
1488
|
) }),
|
|
1583
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsx5(
|
|
1584
1490
|
Dialog.Content,
|
|
1585
1491
|
{
|
|
1586
1492
|
asChild: true,
|
|
1587
1493
|
forceMount: true,
|
|
1588
1494
|
"aria-label": "Screenshot",
|
|
1589
1495
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
1590
|
-
children: /* @__PURE__ */
|
|
1496
|
+
children: /* @__PURE__ */ jsxs4(
|
|
1591
1497
|
motion2.div,
|
|
1592
1498
|
{
|
|
1593
1499
|
initial: { opacity: 0, scale: 0.98 },
|
|
@@ -1601,10 +1507,10 @@ function LightboxRoot({ children }) {
|
|
|
1601
1507
|
},
|
|
1602
1508
|
className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
|
|
1603
1509
|
children: [
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ jsx5(Dialog.Title, { className: "sr-only", children: "Screenshot" }),
|
|
1511
|
+
/* @__PURE__ */ jsxs4("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
|
|
1512
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
|
|
1513
|
+
/* @__PURE__ */ jsx5(
|
|
1608
1514
|
"img",
|
|
1609
1515
|
{
|
|
1610
1516
|
src: state.src,
|
|
@@ -1612,7 +1518,7 @@ function LightboxRoot({ children }) {
|
|
|
1612
1518
|
className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
|
|
1613
1519
|
}
|
|
1614
1520
|
),
|
|
1615
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx5(
|
|
1616
1522
|
Dialog.Close,
|
|
1617
1523
|
{
|
|
1618
1524
|
className: cn(
|
|
@@ -1621,11 +1527,11 @@ function LightboxRoot({ children }) {
|
|
|
1621
1527
|
"transition-colors hover:border-white/30 hover:text-white"
|
|
1622
1528
|
),
|
|
1623
1529
|
"aria-label": "Close",
|
|
1624
|
-
children: /* @__PURE__ */
|
|
1530
|
+
children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-4" })
|
|
1625
1531
|
}
|
|
1626
1532
|
)
|
|
1627
1533
|
] }),
|
|
1628
|
-
state.caption ? /* @__PURE__ */
|
|
1534
|
+
state.caption ? /* @__PURE__ */ jsx5("figcaption", { className: "max-w-2xl text-center font-og-mono text-og-xs text-white/55", children: state.caption }) : /* @__PURE__ */ jsx5("figcaption", { className: "font-og-mono text-og-xs uppercase tracking-[0.1em] text-white/35", children: "Esc or click outside to close" })
|
|
1629
1535
|
] })
|
|
1630
1536
|
]
|
|
1631
1537
|
}
|
|
@@ -1638,9 +1544,8 @@ function LightboxRoot({ children }) {
|
|
|
1638
1544
|
|
|
1639
1545
|
// src/timeline/shared.tsx
|
|
1640
1546
|
import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
|
|
1641
|
-
import { useState as
|
|
1642
|
-
import {
|
|
1643
|
-
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1547
|
+
import { useState as useState4 } from "react";
|
|
1548
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1644
1549
|
var ICON_TONE = {
|
|
1645
1550
|
accent: "text-og-accent",
|
|
1646
1551
|
failed: "text-og-status-failed",
|
|
@@ -1664,7 +1569,7 @@ function ActivityDisclosure({
|
|
|
1664
1569
|
const iconTone = failed && iconToneProp === "muted" ? "failed" : iconToneProp;
|
|
1665
1570
|
const chip = chipProp ?? (failed ? { tone: "bad", text: "failed" } : cancelled ? { tone: "interrupted", text: "interrupted" } : void 0);
|
|
1666
1571
|
const forcedDefaultOpen = useForcedDefaultOpen();
|
|
1667
|
-
const [open, setOpen] =
|
|
1572
|
+
const [open, setOpen] = useState4(forcedDefaultOpen ?? false);
|
|
1668
1573
|
const hasBody = expandable && children != null;
|
|
1669
1574
|
const previewVisible = preview != null && !open;
|
|
1670
1575
|
const rowClass = cn(
|
|
@@ -1674,10 +1579,10 @@ function ActivityDisclosure({
|
|
|
1674
1579
|
// hit area clears the 40px minimum without loosening the dense desktop rail.
|
|
1675
1580
|
"pointer-coarse:py-2.5"
|
|
1676
1581
|
);
|
|
1677
|
-
const inner = /* @__PURE__ */
|
|
1678
|
-
hasBody ? /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1582
|
+
const inner = /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
1583
|
+
hasBody ? /* @__PURE__ */ jsx6(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--og-duration-disclose)] ease-og-in-out group-data-[state=open]/disclosure:rotate-90" }) : /* @__PURE__ */ jsx6("span", { className: "size-3.5 shrink-0" }),
|
|
1584
|
+
/* @__PURE__ */ jsx6("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
|
|
1585
|
+
/* @__PURE__ */ jsx6(
|
|
1681
1586
|
"span",
|
|
1682
1587
|
{
|
|
1683
1588
|
className: cn(
|
|
@@ -1688,19 +1593,22 @@ function ActivityDisclosure({
|
|
|
1688
1593
|
children: title
|
|
1689
1594
|
}
|
|
1690
1595
|
),
|
|
1691
|
-
previewVisible && !media ? /* @__PURE__ */
|
|
1692
|
-
media ? /* @__PURE__ */
|
|
1596
|
+
previewVisible && !media ? /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx6("span", { className: "flex-1" }),
|
|
1597
|
+
media ? /* @__PURE__ */ jsx6("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx6("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx6(Chip, { chip }) }) : null
|
|
1693
1598
|
] });
|
|
1694
1599
|
const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
|
|
1695
1600
|
if (!hasBody) {
|
|
1696
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ jsx6("div", { className: cn(rowClass, "cursor-default"), "data-status": dataStatus, children: inner });
|
|
1697
1602
|
}
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
1604
|
+
/* @__PURE__ */ jsx6(
|
|
1700
1605
|
"div",
|
|
1701
1606
|
{
|
|
1702
1607
|
role: "button",
|
|
1703
1608
|
tabIndex: 0,
|
|
1609
|
+
"aria-expanded": open,
|
|
1610
|
+
"data-state": open ? "open" : "closed",
|
|
1611
|
+
onClick: () => setOpen((prev) => !prev),
|
|
1704
1612
|
onKeyDown: (event) => {
|
|
1705
1613
|
if (event.key === "Enter" || event.key === " ") {
|
|
1706
1614
|
event.preventDefault();
|
|
@@ -1715,23 +1623,23 @@ function ActivityDisclosure({
|
|
|
1715
1623
|
),
|
|
1716
1624
|
children: inner
|
|
1717
1625
|
}
|
|
1718
|
-
)
|
|
1719
|
-
|
|
1626
|
+
),
|
|
1627
|
+
open ? /* @__PURE__ */ jsx6("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children }) : null
|
|
1720
1628
|
] });
|
|
1721
1629
|
}
|
|
1722
1630
|
function Chip({ chip }) {
|
|
1723
1631
|
const base = "inline-flex items-center font-og-mono text-og-xs leading-none";
|
|
1724
1632
|
const withText = chip.text ? "gap-1.5" : "gap-0";
|
|
1725
1633
|
if (chip.tone === "bad") {
|
|
1726
|
-
return /* @__PURE__ */
|
|
1727
|
-
/* @__PURE__ */
|
|
1634
|
+
return /* @__PURE__ */ jsxs5("span", { className: cn(base, withText, "text-og-status-failed"), children: [
|
|
1635
|
+
/* @__PURE__ */ jsx6("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
|
|
1728
1636
|
chip.text
|
|
1729
1637
|
] });
|
|
1730
1638
|
}
|
|
1731
1639
|
if (chip.tone === "interrupted") {
|
|
1732
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ jsx6("span", { className: cn(base, "text-og-fg-subtle og-cancelled-chip"), children: chip.text });
|
|
1733
1641
|
}
|
|
1734
|
-
return /* @__PURE__ */
|
|
1642
|
+
return /* @__PURE__ */ jsx6("span", { className: cn(base, "text-og-fg-subtle"), children: chip.text });
|
|
1735
1643
|
}
|
|
1736
1644
|
function TermBlock({
|
|
1737
1645
|
command,
|
|
@@ -1741,14 +1649,14 @@ function TermBlock({
|
|
|
1741
1649
|
tailLines = 12,
|
|
1742
1650
|
failed
|
|
1743
1651
|
}) {
|
|
1744
|
-
const [full, setFull] =
|
|
1652
|
+
const [full, setFull] = useState4(false);
|
|
1745
1653
|
const empty = output.trim() === "";
|
|
1746
1654
|
const lines = output.split("\n");
|
|
1747
1655
|
const big = lines.length > tailLines + 4;
|
|
1748
1656
|
const shown = full || !big ? output : lines.slice(-tailLines).join("\n");
|
|
1749
1657
|
const showMore = big && !full;
|
|
1750
1658
|
const showHeader = command != null || workdir != null;
|
|
1751
|
-
return /* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ jsxs5(
|
|
1752
1660
|
"div",
|
|
1753
1661
|
{
|
|
1754
1662
|
className: cn(
|
|
@@ -1756,16 +1664,16 @@ function TermBlock({
|
|
|
1756
1664
|
failed ? "border-og-status-failed/50" : live ? "border-og-status-running/50" : "border-og-border"
|
|
1757
1665
|
),
|
|
1758
1666
|
children: [
|
|
1759
|
-
showHeader ? /* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
command != null ? /* @__PURE__ */
|
|
1762
|
-
workdir ? /* @__PURE__ */
|
|
1667
|
+
showHeader ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pb-1", children: [
|
|
1668
|
+
/* @__PURE__ */ jsx6("span", { className: "select-none text-og-status-idle", children: "$" }),
|
|
1669
|
+
command != null ? /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate font-og-mono text-og-sm text-og-fg-muted", children: command }) : /* @__PURE__ */ jsx6("span", { className: "flex-1" }),
|
|
1670
|
+
workdir ? /* @__PURE__ */ jsx6("span", { className: "shrink-0 font-og-mono text-og-xs text-og-fg-subtle", children: workdir }) : null
|
|
1763
1671
|
] }) : null,
|
|
1764
|
-
empty ? /* @__PURE__ */
|
|
1672
|
+
empty ? /* @__PURE__ */ jsx6("p", { className: "font-og-mono text-og-xs italic text-og-fg-subtle", children: "(no output)" }) : /* @__PURE__ */ jsxs5("pre", { className: "max-h-72 overflow-auto whitespace-pre-wrap break-all font-og-mono text-og-xs leading-5 text-og-fg-muted", children: [
|
|
1765
1673
|
shown,
|
|
1766
|
-
live ? /* @__PURE__ */
|
|
1674
|
+
live ? /* @__PURE__ */ jsx6("span", { className: "ml-px inline-block h-[1em] w-[2px] translate-y-[2px] animate-og-blink bg-og-accent align-middle" }) : null
|
|
1767
1675
|
] }),
|
|
1768
|
-
showMore ? /* @__PURE__ */
|
|
1676
|
+
showMore ? /* @__PURE__ */ jsxs5(
|
|
1769
1677
|
"button",
|
|
1770
1678
|
{
|
|
1771
1679
|
type: "button",
|
|
@@ -1791,7 +1699,7 @@ function PayloadBlock({
|
|
|
1791
1699
|
if (!text || text.trim() === "") {
|
|
1792
1700
|
return null;
|
|
1793
1701
|
}
|
|
1794
|
-
return /* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ jsxs5(
|
|
1795
1703
|
"div",
|
|
1796
1704
|
{
|
|
1797
1705
|
className: cn(
|
|
@@ -1799,8 +1707,8 @@ function PayloadBlock({
|
|
|
1799
1707
|
failed ? "border-og-status-failed/50" : "border-og-border"
|
|
1800
1708
|
),
|
|
1801
1709
|
children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
-
/* @__PURE__ */
|
|
1710
|
+
/* @__PURE__ */ jsx6("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: label }),
|
|
1711
|
+
/* @__PURE__ */ jsx6(
|
|
1804
1712
|
"pre",
|
|
1805
1713
|
{
|
|
1806
1714
|
className: cn(
|
|
@@ -1819,13 +1727,13 @@ function BodyNote({
|
|
|
1819
1727
|
tone
|
|
1820
1728
|
}) {
|
|
1821
1729
|
if (tone === "error") {
|
|
1822
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ jsx6("div", { className: "border-l-2 border-og-status-failed/50 pl-3 font-og-mono text-og-xs leading-5 text-og-status-failed", children });
|
|
1823
1731
|
}
|
|
1824
|
-
return /* @__PURE__ */
|
|
1732
|
+
return /* @__PURE__ */ jsx6("p", { className: "px-0.5 text-og-sm italic leading-5 text-og-fg-subtle", children });
|
|
1825
1733
|
}
|
|
1826
1734
|
var MEDIA_BOX = "h-7 w-[52px] shrink-0 rounded-og-xs border border-og-border";
|
|
1827
1735
|
function MediaSkeleton() {
|
|
1828
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ jsxs5(
|
|
1829
1737
|
"span",
|
|
1830
1738
|
{
|
|
1831
1739
|
className: cn(
|
|
@@ -1833,14 +1741,14 @@ function MediaSkeleton() {
|
|
|
1833
1741
|
"relative inline-flex items-center justify-center overflow-hidden bg-og-surface-2"
|
|
1834
1742
|
),
|
|
1835
1743
|
children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ jsx6("span", { className: "absolute inset-0 animate-og-pulse bg-og-surface-3/50" }),
|
|
1745
|
+
/* @__PURE__ */ jsx6(CameraIcon, { className: "relative size-3.5 text-og-fg-subtle" })
|
|
1838
1746
|
]
|
|
1839
1747
|
}
|
|
1840
1748
|
);
|
|
1841
1749
|
}
|
|
1842
1750
|
function MediaEmpty() {
|
|
1843
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ jsx6("span", { className: cn(MEDIA_BOX, "inline-flex items-center justify-center bg-og-bg"), children: /* @__PURE__ */ jsx6(CameraOffIcon, { className: "size-3.5 text-og-fg-subtle" }) });
|
|
1844
1752
|
}
|
|
1845
1753
|
function Thumbnail({
|
|
1846
1754
|
src,
|
|
@@ -1848,11 +1756,11 @@ function Thumbnail({
|
|
|
1848
1756
|
alt = "screenshot"
|
|
1849
1757
|
}) {
|
|
1850
1758
|
const lightbox = useLightboxOptional();
|
|
1851
|
-
const [failed, setFailed] =
|
|
1759
|
+
const [failed, setFailed] = useState4(false);
|
|
1852
1760
|
if (failed) {
|
|
1853
|
-
return /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ jsx6(MediaEmpty, {});
|
|
1854
1762
|
}
|
|
1855
|
-
const img = /* @__PURE__ */
|
|
1763
|
+
const img = /* @__PURE__ */ jsx6(
|
|
1856
1764
|
"img",
|
|
1857
1765
|
{
|
|
1858
1766
|
src,
|
|
@@ -1862,9 +1770,9 @@ function Thumbnail({
|
|
|
1862
1770
|
}
|
|
1863
1771
|
);
|
|
1864
1772
|
if (!lightbox) {
|
|
1865
|
-
return /* @__PURE__ */
|
|
1773
|
+
return /* @__PURE__ */ jsx6("span", { className: cn(MEDIA_BOX, "inline-flex overflow-hidden bg-og-bg"), children: img });
|
|
1866
1774
|
}
|
|
1867
|
-
return /* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ jsx6(
|
|
1868
1776
|
"button",
|
|
1869
1777
|
{
|
|
1870
1778
|
type: "button",
|
|
@@ -1893,9 +1801,9 @@ function ScreenshotFigure({
|
|
|
1893
1801
|
alt = "screenshot"
|
|
1894
1802
|
}) {
|
|
1895
1803
|
const lightbox = useLightboxOptional();
|
|
1896
|
-
const [failed, setFailed] =
|
|
1804
|
+
const [failed, setFailed] = useState4(false);
|
|
1897
1805
|
const surface = "block w-full overflow-hidden rounded-og-md border border-og-border bg-og-bg";
|
|
1898
|
-
const img = /* @__PURE__ */
|
|
1806
|
+
const img = /* @__PURE__ */ jsx6(
|
|
1899
1807
|
"img",
|
|
1900
1808
|
{
|
|
1901
1809
|
src,
|
|
@@ -1904,8 +1812,8 @@ function ScreenshotFigure({
|
|
|
1904
1812
|
className: "max-h-80 w-full object-contain"
|
|
1905
1813
|
}
|
|
1906
1814
|
);
|
|
1907
|
-
return /* @__PURE__ */
|
|
1908
|
-
failed ? /* @__PURE__ */
|
|
1815
|
+
return /* @__PURE__ */ jsxs5("figure", { className: "m-0 min-w-0", children: [
|
|
1816
|
+
failed ? /* @__PURE__ */ jsx6("div", { className: "rounded-og-md border border-og-border bg-og-bg px-3 py-6 text-center font-og-mono text-og-xs text-og-fg-subtle", children: "image unavailable" }) : lightbox ? /* @__PURE__ */ jsx6(
|
|
1909
1817
|
"button",
|
|
1910
1818
|
{
|
|
1911
1819
|
type: "button",
|
|
@@ -1914,8 +1822,8 @@ function ScreenshotFigure({
|
|
|
1914
1822
|
"aria-label": "Expand screenshot",
|
|
1915
1823
|
children: img
|
|
1916
1824
|
}
|
|
1917
|
-
) : /* @__PURE__ */
|
|
1918
|
-
caption ? /* @__PURE__ */
|
|
1825
|
+
) : /* @__PURE__ */ jsx6("div", { className: surface, children: img }),
|
|
1826
|
+
caption ? /* @__PURE__ */ jsx6("figcaption", { className: "mt-1.5 font-og-mono text-og-xs text-og-fg-subtle", children: caption }) : null
|
|
1919
1827
|
] });
|
|
1920
1828
|
}
|
|
1921
1829
|
|
|
@@ -1952,10 +1860,10 @@ function gitFileDiffToPatch(file) {
|
|
|
1952
1860
|
import {
|
|
1953
1861
|
lazy as lazy2,
|
|
1954
1862
|
Suspense as Suspense2,
|
|
1955
|
-
useEffect as
|
|
1956
|
-
useState as
|
|
1863
|
+
useEffect as useEffect3,
|
|
1864
|
+
useState as useState5
|
|
1957
1865
|
} from "react";
|
|
1958
|
-
import { jsx as
|
|
1866
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1959
1867
|
var LazyPatchDiff = lazy2(async () => {
|
|
1960
1868
|
const mod = await import("@pierre/diffs/react");
|
|
1961
1869
|
return { default: mod.PatchDiff };
|
|
@@ -1972,9 +1880,9 @@ function PierreDiff({
|
|
|
1972
1880
|
overflow = "wrap",
|
|
1973
1881
|
className
|
|
1974
1882
|
}) {
|
|
1975
|
-
const [failed, setFailed] =
|
|
1976
|
-
const [forcedColors, setForcedColors] =
|
|
1977
|
-
|
|
1883
|
+
const [failed, setFailed] = useState5(false);
|
|
1884
|
+
const [forcedColors, setForcedColors] = useState5(false);
|
|
1885
|
+
useEffect3(() => {
|
|
1978
1886
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
1979
1887
|
const query2 = window.matchMedia("(forced-colors: active)");
|
|
1980
1888
|
const update = () => setForcedColors(query2.matches);
|
|
@@ -1982,7 +1890,7 @@ function PierreDiff({
|
|
|
1982
1890
|
query2.addEventListener?.("change", update);
|
|
1983
1891
|
return () => query2.removeEventListener?.("change", update);
|
|
1984
1892
|
}, []);
|
|
1985
|
-
|
|
1893
|
+
useEffect3(() => {
|
|
1986
1894
|
if (plain) return;
|
|
1987
1895
|
let cancelled = false;
|
|
1988
1896
|
void import("@pierre/diffs/react").catch(() => {
|
|
@@ -1993,12 +1901,12 @@ function PierreDiff({
|
|
|
1993
1901
|
};
|
|
1994
1902
|
}, [plain]);
|
|
1995
1903
|
if (plain || failed || forcedColors) {
|
|
1996
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx7(
|
|
1997
1905
|
"div",
|
|
1998
1906
|
{
|
|
1999
1907
|
className,
|
|
2000
1908
|
"data-opengeni-plain-diff": forcedColors ? "forced-colors" : "fallback",
|
|
2001
|
-
children: fallback ?? /* @__PURE__ */
|
|
1909
|
+
children: fallback ?? /* @__PURE__ */ jsx7(PlainPatch, { diff })
|
|
2002
1910
|
}
|
|
2003
1911
|
);
|
|
2004
1912
|
}
|
|
@@ -2032,7 +1940,7 @@ function PierreDiff({
|
|
|
2032
1940
|
"--diffs-font-size": "var(--og-code-font-size)",
|
|
2033
1941
|
"--diffs-line-height": "var(--og-code-line-height)"
|
|
2034
1942
|
};
|
|
2035
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ jsx7("div", { className: cn("min-w-0", className), "data-opengeni-pierre-diff": true, style: pierreVars, children: /* @__PURE__ */ jsx7(Suspense2, { fallback: loading ?? /* @__PURE__ */ jsx7(DiffSkeleton, {}), children: diff.map((file) => /* @__PURE__ */ jsx7("div", { className: "mb-2", children: /* @__PURE__ */ jsx7(
|
|
2036
1944
|
LazyPatchDiff,
|
|
2037
1945
|
{
|
|
2038
1946
|
patch: gitFileDiffToPatch(file),
|
|
@@ -2042,20 +1950,20 @@ function PierreDiff({
|
|
|
2042
1950
|
) }, file.path)) }) });
|
|
2043
1951
|
}
|
|
2044
1952
|
function DiffSkeleton() {
|
|
2045
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ jsx7("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "Loading diff\u2026" });
|
|
2046
1954
|
}
|
|
2047
1955
|
function PlainPatch({ diff }) {
|
|
2048
1956
|
if (diff.length === 0) {
|
|
2049
|
-
return /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ jsx7("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "No changes" });
|
|
2050
1958
|
}
|
|
2051
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ jsx7("div", { className: "min-w-0", children: diff.map((file) => /* @__PURE__ */ jsx7(
|
|
2052
1960
|
"pre",
|
|
2053
1961
|
{
|
|
2054
1962
|
"aria-label": `Diff for ${file.path}`,
|
|
2055
1963
|
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",
|
|
2056
1964
|
role: "region",
|
|
2057
1965
|
tabIndex: 0,
|
|
2058
|
-
children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */
|
|
1966
|
+
children: gitFileDiffToPatch(file).split("\n").map((line, index) => /* @__PURE__ */ jsx7(
|
|
2059
1967
|
"span",
|
|
2060
1968
|
{
|
|
2061
1969
|
className: cn(
|
|
@@ -2073,29 +1981,41 @@ function PlainPatch({ diff }) {
|
|
|
2073
1981
|
|
|
2074
1982
|
// src/timeline/tool-renderers.tsx
|
|
2075
1983
|
import {
|
|
1984
|
+
BoxIcon,
|
|
1985
|
+
BrainCircuitIcon,
|
|
1986
|
+
CalendarClockIcon,
|
|
2076
1987
|
CameraIcon as CameraIcon2,
|
|
2077
1988
|
CameraOffIcon as CameraOffIcon2,
|
|
2078
1989
|
FileDiffIcon,
|
|
1990
|
+
FileSearchIcon,
|
|
1991
|
+
FolderGitIcon,
|
|
2079
1992
|
GlobeIcon,
|
|
2080
1993
|
ImageIcon,
|
|
2081
1994
|
KeyboardIcon,
|
|
2082
1995
|
KeyRoundIcon,
|
|
2083
1996
|
LockIcon,
|
|
1997
|
+
MessagesSquareIcon,
|
|
1998
|
+
MessageSquareIcon,
|
|
2084
1999
|
MousePointer2Icon,
|
|
2000
|
+
PanelsTopLeftIcon,
|
|
2085
2001
|
PlugIcon,
|
|
2086
2002
|
SearchIcon,
|
|
2003
|
+
ServerCogIcon,
|
|
2004
|
+
ServerIcon,
|
|
2005
|
+
Share2Icon,
|
|
2006
|
+
TargetIcon,
|
|
2087
2007
|
TerminalIcon,
|
|
2088
2008
|
WrenchIcon
|
|
2089
2009
|
} from "lucide-react";
|
|
2090
2010
|
|
|
2091
2011
|
// src/timeline/tool-diff.tsx
|
|
2092
|
-
import { useState as
|
|
2012
|
+
import { useState as useState7 } from "react";
|
|
2093
2013
|
|
|
2094
2014
|
// src/lib/use-theme-type.ts
|
|
2095
|
-
import { useEffect as
|
|
2015
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
2096
2016
|
function useThemeType(forced) {
|
|
2097
|
-
const [detected, setDetected] =
|
|
2098
|
-
|
|
2017
|
+
const [detected, setDetected] = useState6("dark");
|
|
2018
|
+
useEffect4(() => {
|
|
2099
2019
|
if (forced || typeof document === "undefined") return;
|
|
2100
2020
|
const read = () => {
|
|
2101
2021
|
const el = document.querySelector("[data-og-theme]");
|
|
@@ -2115,20 +2035,20 @@ function useThemeType(forced) {
|
|
|
2115
2035
|
}
|
|
2116
2036
|
|
|
2117
2037
|
// src/timeline/tool-diff.tsx
|
|
2118
|
-
import { jsx as
|
|
2038
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2119
2039
|
function ToolDiff({ files }) {
|
|
2120
|
-
const [layout, setLayout] =
|
|
2040
|
+
const [layout, setLayout] = useState7("unified");
|
|
2121
2041
|
const themeType = useThemeType(void 0);
|
|
2122
|
-
return /* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
2043
|
+
/* @__PURE__ */ jsx8("div", { className: "mb-1.5 flex justify-end", children: /* @__PURE__ */ jsx8(LayoutToggle, { layout, onChange: setLayout }) }),
|
|
2044
|
+
/* @__PURE__ */ jsx8(PierreDiff, { diff: files, layout, themeType })
|
|
2125
2045
|
] });
|
|
2126
2046
|
}
|
|
2127
2047
|
function LayoutToggle({
|
|
2128
2048
|
layout,
|
|
2129
2049
|
onChange
|
|
2130
2050
|
}) {
|
|
2131
|
-
return /* @__PURE__ */
|
|
2051
|
+
return /* @__PURE__ */ jsx8("div", { className: "inline-flex items-center gap-px rounded-og-xs border border-og-border p-px", children: ["unified", "split"].map((value) => /* @__PURE__ */ jsx8(
|
|
2132
2052
|
"button",
|
|
2133
2053
|
{
|
|
2134
2054
|
type: "button",
|
|
@@ -2149,9 +2069,9 @@ function RawPatch({ diff }) {
|
|
|
2149
2069
|
occurrences.set(line, occurrence);
|
|
2150
2070
|
return { key: `${line}\0${occurrence}`, line };
|
|
2151
2071
|
});
|
|
2152
|
-
return /* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
2073
|
+
/* @__PURE__ */ jsx8("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: "raw patch (could not parse hunks)" }),
|
|
2074
|
+
/* @__PURE__ */ jsx8("pre", { className: "max-h-72 overflow-auto border-l-2 border-og-border pl-3 font-og-mono text-og-xs leading-5", children: lines.map(({ key, line }) => /* @__PURE__ */ jsx8(
|
|
2155
2075
|
"span",
|
|
2156
2076
|
{
|
|
2157
2077
|
className: cn(
|
|
@@ -2165,20 +2085,13 @@ function RawPatch({ diff }) {
|
|
|
2165
2085
|
] });
|
|
2166
2086
|
}
|
|
2167
2087
|
|
|
2168
|
-
// src/timeline/tool-display-name.ts
|
|
2169
|
-
function toolDisplayName(name) {
|
|
2170
|
-
const boundary = name.indexOf("__");
|
|
2171
|
-
const toolPart = boundary >= 0 ? name.slice(boundary + 2) : name;
|
|
2172
|
-
return toolPart.replace(/[_-]+/g, " ").trim();
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
2088
|
// src/timeline/tool-renderers.tsx
|
|
2176
|
-
import { jsx as
|
|
2089
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2177
2090
|
var ICON_SIZE = "size-3.5";
|
|
2178
2091
|
function RunningPreview({ children }) {
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
2093
|
+
/* @__PURE__ */ jsx9("span", { className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-status-running" }),
|
|
2094
|
+
/* @__PURE__ */ jsx9("span", { className: "min-w-0 truncate", children })
|
|
2182
2095
|
] });
|
|
2183
2096
|
}
|
|
2184
2097
|
function ExecRenderer({ item }) {
|
|
@@ -2189,45 +2102,45 @@ function ExecRenderer({ item }) {
|
|
|
2189
2102
|
const out = item.output;
|
|
2190
2103
|
const title = `$ ${cmd}`;
|
|
2191
2104
|
if (item.status === "failed" && out === void 0) {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2105
|
+
return /* @__PURE__ */ jsx9(
|
|
2193
2106
|
ActivityDisclosure,
|
|
2194
2107
|
{
|
|
2195
|
-
icon: /* @__PURE__ */
|
|
2108
|
+
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2196
2109
|
iconTone: "failed",
|
|
2197
2110
|
title,
|
|
2198
2111
|
titleMono: true,
|
|
2199
2112
|
chip: { tone: "bad", text: "failed" },
|
|
2200
2113
|
preview: "output lost \u2014 NUL byte could not be stored",
|
|
2201
|
-
children: /* @__PURE__ */
|
|
2114
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "output contained a NUL byte and could not be stored; the turn failed on this tool's output insert \u2014 no output event ever arrived." })
|
|
2202
2115
|
}
|
|
2203
2116
|
);
|
|
2204
2117
|
}
|
|
2205
2118
|
if (item.status === "failed" && (out == null || out === "")) {
|
|
2206
|
-
return /* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ jsx9(
|
|
2207
2120
|
ActivityDisclosure,
|
|
2208
2121
|
{
|
|
2209
|
-
icon: /* @__PURE__ */
|
|
2122
|
+
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2210
2123
|
iconTone: "failed",
|
|
2211
2124
|
title,
|
|
2212
2125
|
titleMono: true,
|
|
2213
2126
|
chip: { tone: "bad", text: "failed" },
|
|
2214
2127
|
preview: "tool call failed",
|
|
2215
|
-
children: /* @__PURE__ */
|
|
2128
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "the tool call failed with no output." })
|
|
2216
2129
|
}
|
|
2217
2130
|
);
|
|
2218
2131
|
}
|
|
2219
2132
|
if (running) {
|
|
2220
2133
|
const streamed = typeof out === "string" ? stripExecBanner(out) : "";
|
|
2221
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ jsx9(
|
|
2222
2135
|
ActivityDisclosure,
|
|
2223
2136
|
{
|
|
2224
|
-
icon: /* @__PURE__ */
|
|
2137
|
+
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2225
2138
|
iconTone: "running",
|
|
2226
2139
|
title,
|
|
2227
2140
|
titleMono: true,
|
|
2228
2141
|
running: true,
|
|
2229
|
-
preview: /* @__PURE__ */
|
|
2230
|
-
children: /* @__PURE__ */
|
|
2142
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: streamed ? `${streamed.split("\n").length} lines` : "running\u2026" }),
|
|
2143
|
+
children: /* @__PURE__ */ jsx9(TermBlock, { command: null, workdir, output: streamed, live: true })
|
|
2231
2144
|
}
|
|
2232
2145
|
);
|
|
2233
2146
|
}
|
|
@@ -2247,10 +2160,10 @@ function ExecRenderer({ item }) {
|
|
|
2247
2160
|
const preview = binary ? "binary output" : tailPeek(stripped) || "(no output)";
|
|
2248
2161
|
const truncated = execTruncated(text);
|
|
2249
2162
|
const body = binary ? "(binary output suppressed)" : stripped;
|
|
2250
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ jsxs7(
|
|
2251
2164
|
ActivityDisclosure,
|
|
2252
2165
|
{
|
|
2253
|
-
icon: /* @__PURE__ */
|
|
2166
|
+
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2254
2167
|
iconTone,
|
|
2255
2168
|
title,
|
|
2256
2169
|
titleMono: true,
|
|
@@ -2259,7 +2172,7 @@ function ExecRenderer({ item }) {
|
|
|
2259
2172
|
cancelled: item.status === "cancelled",
|
|
2260
2173
|
preview: truncated ? `\u22EF truncated \xB7 ${preview}` : preview,
|
|
2261
2174
|
children: [
|
|
2262
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ jsx9(
|
|
2263
2176
|
TermBlock,
|
|
2264
2177
|
{
|
|
2265
2178
|
command: null,
|
|
@@ -2268,7 +2181,7 @@ function ExecRenderer({ item }) {
|
|
|
2268
2181
|
failed: item.status === "failed" || exitCode != null && exitCode !== 0
|
|
2269
2182
|
}
|
|
2270
2183
|
),
|
|
2271
|
-
bgSession != null ? /* @__PURE__ */
|
|
2184
|
+
bgSession != null ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2272
2185
|
"\u21B3 session ",
|
|
2273
2186
|
bgSession,
|
|
2274
2187
|
" \u2014 a later write_stdin can target this PTY."
|
|
@@ -2287,16 +2200,16 @@ function WriteStdinRenderer({ item }) {
|
|
|
2287
2200
|
const exitCode = sandboxCommandExitCode(text);
|
|
2288
2201
|
const stripped = stripExecBanner(text);
|
|
2289
2202
|
if (running) {
|
|
2290
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx9(
|
|
2291
2204
|
ActivityDisclosure,
|
|
2292
2205
|
{
|
|
2293
|
-
icon: /* @__PURE__ */
|
|
2206
|
+
icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
|
|
2294
2207
|
iconTone: "running",
|
|
2295
2208
|
title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
|
|
2296
2209
|
titleMono: true,
|
|
2297
2210
|
running: true,
|
|
2298
|
-
preview: /* @__PURE__ */
|
|
2299
|
-
children: /* @__PURE__ */
|
|
2211
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "sending\u2026" }),
|
|
2212
|
+
children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2300
2213
|
"sending input to session ",
|
|
2301
2214
|
sessionId,
|
|
2302
2215
|
"\u2026"
|
|
@@ -2310,10 +2223,10 @@ function WriteStdinRenderer({ item }) {
|
|
|
2310
2223
|
} else if (exitCode != null && exitCode !== 0) {
|
|
2311
2224
|
chip = { tone: "bad", text: `exit ${exitCode}` };
|
|
2312
2225
|
}
|
|
2313
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx9(
|
|
2314
2227
|
ActivityDisclosure,
|
|
2315
2228
|
{
|
|
2316
|
-
icon: /* @__PURE__ */
|
|
2229
|
+
icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
|
|
2317
2230
|
iconTone: lost ? "failed" : "muted",
|
|
2318
2231
|
title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
|
|
2319
2232
|
titleMono: true,
|
|
@@ -2321,7 +2234,7 @@ function WriteStdinRenderer({ item }) {
|
|
|
2321
2234
|
failed: item.status === "failed",
|
|
2322
2235
|
cancelled: item.status === "cancelled",
|
|
2323
2236
|
preview: lost ? `session ${sessionId} PTY vanished` : tailPeek(stripped) || "sent",
|
|
2324
|
-
children: lost ? /* @__PURE__ */
|
|
2237
|
+
children: lost ? /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: stripped || text }) : /* @__PURE__ */ jsx9(TermBlock, { command: `write_stdin \u2192 session ${sessionId}`, output: stripped })
|
|
2325
2238
|
}
|
|
2326
2239
|
);
|
|
2327
2240
|
}
|
|
@@ -2344,12 +2257,12 @@ function PathPreview({
|
|
|
2344
2257
|
add,
|
|
2345
2258
|
del
|
|
2346
2259
|
}) {
|
|
2347
|
-
return /* @__PURE__ */
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
|
|
2261
|
+
/* @__PURE__ */ jsxs7("span", { className: "truncate", children: [
|
|
2262
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: dirname(path) }),
|
|
2263
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(path) })
|
|
2351
2264
|
] }),
|
|
2352
|
-
add != null || del != null ? /* @__PURE__ */
|
|
2265
|
+
add != null || del != null ? /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-og-fg-subtle", children: [
|
|
2353
2266
|
add != null ? `+${add}` : "",
|
|
2354
2267
|
add != null && del != null ? " " : "",
|
|
2355
2268
|
del != null ? `\u2212${del}` : ""
|
|
@@ -2357,7 +2270,7 @@ function PathPreview({
|
|
|
2357
2270
|
] });
|
|
2358
2271
|
}
|
|
2359
2272
|
function ApplyPatchRenderer({ item }) {
|
|
2360
|
-
const ops =
|
|
2273
|
+
const ops = applyPatchOpsFromToolItem(item);
|
|
2361
2274
|
const failed = item.status === "failed";
|
|
2362
2275
|
const cancelled = item.status === "cancelled";
|
|
2363
2276
|
const running = item.status === "running";
|
|
@@ -2365,34 +2278,34 @@ function ApplyPatchRenderer({ item }) {
|
|
|
2365
2278
|
if (running) {
|
|
2366
2279
|
const fileCount = ops.length;
|
|
2367
2280
|
const titleVerb = firstOp ? `Applying ${basename(firstOp.path)}` : "Applying patch";
|
|
2368
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ jsx9(
|
|
2369
2282
|
ActivityDisclosure,
|
|
2370
2283
|
{
|
|
2371
|
-
icon: /* @__PURE__ */
|
|
2284
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2372
2285
|
iconTone: "running",
|
|
2373
2286
|
title: fileCount > 1 ? `Applying ${fileCount} files` : titleVerb,
|
|
2374
2287
|
running: true,
|
|
2375
|
-
preview: /* @__PURE__ */
|
|
2288
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: fileCount > 1 ? `${fileCount} files` : firstOp ? firstOp.path : "applying\u2026" }),
|
|
2376
2289
|
children: ops.map((op) => {
|
|
2377
2290
|
const file2 = safeParseOp(op);
|
|
2378
|
-
return file2 ? /* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2380
|
-
/* @__PURE__ */
|
|
2291
|
+
return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
|
|
2292
|
+
/* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
|
|
2293
|
+
/* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
|
|
2381
2294
|
] }, op.path);
|
|
2382
2295
|
})
|
|
2383
2296
|
}
|
|
2384
2297
|
);
|
|
2385
2298
|
}
|
|
2386
2299
|
if (failed) {
|
|
2387
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ jsx9(
|
|
2388
2301
|
ActivityDisclosure,
|
|
2389
2302
|
{
|
|
2390
|
-
icon: /* @__PURE__ */
|
|
2303
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2391
2304
|
iconTone: "failed",
|
|
2392
2305
|
title: firstOp ? `${verbForOp(firstOp)} ${basename(firstOp.path)}` : "apply_patch",
|
|
2393
2306
|
chip: { tone: "bad", text: "failed" },
|
|
2394
2307
|
preview: typeof item.output === "string" ? item.output : "patch failed",
|
|
2395
|
-
children: /* @__PURE__ */
|
|
2308
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: item.output, failed: true })
|
|
2396
2309
|
}
|
|
2397
2310
|
);
|
|
2398
2311
|
}
|
|
@@ -2401,19 +2314,19 @@ function ApplyPatchRenderer({ item }) {
|
|
|
2401
2314
|
const goodFiles = parsed.filter((f) => f !== null);
|
|
2402
2315
|
const add = goodFiles.reduce((n, f) => n + f.additions, 0);
|
|
2403
2316
|
const del = goodFiles.reduce((n, f) => n + f.deletions, 0);
|
|
2404
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ jsx9(
|
|
2405
2318
|
ActivityDisclosure,
|
|
2406
2319
|
{
|
|
2407
|
-
icon: /* @__PURE__ */
|
|
2320
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2408
2321
|
iconTone: "accent",
|
|
2409
2322
|
title: `Edited ${ops.length} files`,
|
|
2410
2323
|
cancelled,
|
|
2411
|
-
preview: /* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2324
|
+
preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
|
|
2325
|
+
/* @__PURE__ */ jsxs7("span", { className: "text-og-fg-muted", children: [
|
|
2413
2326
|
ops.length,
|
|
2414
2327
|
" files"
|
|
2415
2328
|
] }),
|
|
2416
|
-
/* @__PURE__ */
|
|
2329
|
+
/* @__PURE__ */ jsxs7("span", { className: "text-og-fg-subtle", children: [
|
|
2417
2330
|
"+",
|
|
2418
2331
|
add,
|
|
2419
2332
|
" \u2212",
|
|
@@ -2422,56 +2335,56 @@ function ApplyPatchRenderer({ item }) {
|
|
|
2422
2335
|
] }),
|
|
2423
2336
|
children: ops.map((op, index) => {
|
|
2424
2337
|
const file2 = parsed[index];
|
|
2425
|
-
return file2 ? /* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
/* @__PURE__ */
|
|
2338
|
+
return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, op.path) : /* @__PURE__ */ jsxs7("div", { children: [
|
|
2339
|
+
/* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
|
|
2340
|
+
/* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
|
|
2428
2341
|
] }, op.path);
|
|
2429
2342
|
})
|
|
2430
2343
|
}
|
|
2431
2344
|
);
|
|
2432
2345
|
}
|
|
2433
2346
|
if (!firstOp) {
|
|
2434
|
-
return /* @__PURE__ */
|
|
2347
|
+
return /* @__PURE__ */ jsx9(GenericRenderer, { item });
|
|
2435
2348
|
}
|
|
2436
2349
|
if (firstOp.type === "delete_file") {
|
|
2437
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx9(
|
|
2438
2351
|
ActivityDisclosure,
|
|
2439
2352
|
{
|
|
2440
|
-
icon: /* @__PURE__ */
|
|
2353
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2441
2354
|
iconTone: "failed",
|
|
2442
2355
|
title: `Deleted ${basename(firstOp.path)}`,
|
|
2443
2356
|
cancelled,
|
|
2444
|
-
preview: /* @__PURE__ */
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2357
|
+
preview: /* @__PURE__ */ jsx9(PathPreview, { path: firstOp.path }),
|
|
2358
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: "File deleted \u2014 no diff to show." })
|
|
2446
2359
|
}
|
|
2447
2360
|
);
|
|
2448
2361
|
}
|
|
2449
2362
|
const file = safeParseOp(firstOp);
|
|
2450
2363
|
if (!file) {
|
|
2451
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx9(
|
|
2452
2365
|
ActivityDisclosure,
|
|
2453
2366
|
{
|
|
2454
|
-
icon: /* @__PURE__ */
|
|
2367
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2455
2368
|
iconTone: "accent",
|
|
2456
2369
|
title: `${verbForOp(firstOp)} ${basename(firstOp.path)}`,
|
|
2457
2370
|
cancelled,
|
|
2458
|
-
preview: /* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2371
|
+
preview: /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
|
|
2372
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
|
|
2373
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
|
|
2461
2374
|
] }),
|
|
2462
|
-
children: /* @__PURE__ */
|
|
2375
|
+
children: /* @__PURE__ */ jsx9(RawPatch, { diff: firstOp.diff ?? "" })
|
|
2463
2376
|
}
|
|
2464
2377
|
);
|
|
2465
2378
|
}
|
|
2466
|
-
return /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ jsx9(
|
|
2467
2380
|
ActivityDisclosure,
|
|
2468
2381
|
{
|
|
2469
|
-
icon: /* @__PURE__ */
|
|
2382
|
+
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
2470
2383
|
iconTone: "accent",
|
|
2471
2384
|
title: `${verbForOp(firstOp)} ${basename(file.path)}`,
|
|
2472
2385
|
cancelled,
|
|
2473
|
-
preview: /* @__PURE__ */
|
|
2474
|
-
children: /* @__PURE__ */
|
|
2386
|
+
preview: /* @__PURE__ */ jsx9(PathPreview, { path: file.path, add: file.additions, del: file.deletions }),
|
|
2387
|
+
children: /* @__PURE__ */ jsx9(ToolDiff, { files: [file] })
|
|
2475
2388
|
}
|
|
2476
2389
|
);
|
|
2477
2390
|
}
|
|
@@ -2545,40 +2458,40 @@ function ComputerCallRenderer({ item }) {
|
|
|
2545
2458
|
const countSuffix = actions.length > 1 ? ` \xB7${actions.length}` : "";
|
|
2546
2459
|
const isShot = action?.type === "screenshot";
|
|
2547
2460
|
if (running) {
|
|
2548
|
-
return /* @__PURE__ */
|
|
2461
|
+
return /* @__PURE__ */ jsx9(
|
|
2549
2462
|
ActivityDisclosure,
|
|
2550
2463
|
{
|
|
2551
|
-
icon: isShot ? /* @__PURE__ */
|
|
2464
|
+
icon: isShot ? /* @__PURE__ */ jsx9(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
|
|
2552
2465
|
iconTone: "running",
|
|
2553
2466
|
title: verb,
|
|
2554
2467
|
running: true,
|
|
2555
|
-
media: /* @__PURE__ */
|
|
2556
|
-
children: /* @__PURE__ */
|
|
2468
|
+
media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
|
|
2469
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: "capturing frame\u2026" })
|
|
2557
2470
|
}
|
|
2558
2471
|
);
|
|
2559
2472
|
}
|
|
2560
2473
|
if (readOnly) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ jsx9(
|
|
2562
2475
|
ActivityDisclosure,
|
|
2563
2476
|
{
|
|
2564
|
-
icon: /* @__PURE__ */
|
|
2477
|
+
icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
|
|
2565
2478
|
iconTone: "failed",
|
|
2566
2479
|
title: verb,
|
|
2567
2480
|
chip: { tone: "bad", text: "read-only" },
|
|
2568
2481
|
preview: "write actions disabled",
|
|
2569
|
-
children: /* @__PURE__ */
|
|
2482
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "computer-use is read-only \u2014 write actions are disabled." })
|
|
2570
2483
|
}
|
|
2571
2484
|
);
|
|
2572
2485
|
}
|
|
2573
2486
|
if (rejected) {
|
|
2574
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsx9(
|
|
2575
2488
|
ActivityDisclosure,
|
|
2576
2489
|
{
|
|
2577
|
-
icon: /* @__PURE__ */
|
|
2490
|
+
icon: /* @__PURE__ */ jsx9(LockIcon, { className: ICON_SIZE }),
|
|
2578
2491
|
iconTone: "muted",
|
|
2579
2492
|
title: verb,
|
|
2580
2493
|
preview: "approval rejected \u2014 this action did not run",
|
|
2581
|
-
children: /* @__PURE__ */
|
|
2494
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: "approval rejected \u2014 this action did not run." })
|
|
2582
2495
|
}
|
|
2583
2496
|
);
|
|
2584
2497
|
}
|
|
@@ -2586,18 +2499,18 @@ function ComputerCallRenderer({ item }) {
|
|
|
2586
2499
|
const isCancelled = item.status === "cancelled";
|
|
2587
2500
|
if (shotUrl) {
|
|
2588
2501
|
const caption = `${verb}${actions.length > 1 ? ` (+${actions.length - 1} more)` : ""}`;
|
|
2589
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ jsxs7(
|
|
2590
2503
|
ActivityDisclosure,
|
|
2591
2504
|
{
|
|
2592
|
-
icon: isShot ? /* @__PURE__ */
|
|
2505
|
+
icon: isShot ? /* @__PURE__ */ jsx9(CameraIcon2, { className: ICON_SIZE }) : /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
|
|
2593
2506
|
iconTone: isFailed ? "failed" : "accent",
|
|
2594
2507
|
title: `${verb}${countSuffix}`,
|
|
2595
2508
|
failed: isFailed,
|
|
2596
2509
|
cancelled: isCancelled,
|
|
2597
|
-
media: /* @__PURE__ */
|
|
2510
|
+
media: /* @__PURE__ */ jsx9(Thumbnail, { src: shotUrl, caption }),
|
|
2598
2511
|
children: [
|
|
2599
|
-
/* @__PURE__ */
|
|
2600
|
-
batched ? /* @__PURE__ */
|
|
2512
|
+
/* @__PURE__ */ jsx9(ScreenshotFigure, { src: shotUrl, caption }),
|
|
2513
|
+
batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2601
2514
|
"batched: ",
|
|
2602
2515
|
batched
|
|
2603
2516
|
] }) : null
|
|
@@ -2606,23 +2519,23 @@ function ComputerCallRenderer({ item }) {
|
|
|
2606
2519
|
);
|
|
2607
2520
|
}
|
|
2608
2521
|
if (omittedMedia) {
|
|
2609
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ jsxs7(
|
|
2610
2523
|
ActivityDisclosure,
|
|
2611
2524
|
{
|
|
2612
|
-
icon: /* @__PURE__ */
|
|
2525
|
+
icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
|
|
2613
2526
|
iconTone: isFailed ? "failed" : "muted",
|
|
2614
2527
|
title: `${verb}${countSuffix} \xB7 image omitted \xB7 not retained`,
|
|
2615
2528
|
failed: isFailed,
|
|
2616
2529
|
cancelled: isCancelled,
|
|
2617
2530
|
preview: "inline image omitted \xB7 not retained",
|
|
2618
|
-
media: /* @__PURE__ */
|
|
2531
|
+
media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
|
|
2619
2532
|
children: [
|
|
2620
|
-
/* @__PURE__ */
|
|
2533
|
+
/* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2621
2534
|
"The inline ",
|
|
2622
2535
|
omittedMedia.mediaType,
|
|
2623
2536
|
" output was omitted from the audit timeline and its source bytes were not retained."
|
|
2624
2537
|
] }),
|
|
2625
|
-
batched ? /* @__PURE__ */
|
|
2538
|
+
batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2626
2539
|
"batched: ",
|
|
2627
2540
|
batched
|
|
2628
2541
|
] }) : null
|
|
@@ -2631,30 +2544,30 @@ function ComputerCallRenderer({ item }) {
|
|
|
2631
2544
|
);
|
|
2632
2545
|
}
|
|
2633
2546
|
if (empty) {
|
|
2634
|
-
return /* @__PURE__ */
|
|
2547
|
+
return /* @__PURE__ */ jsx9(
|
|
2635
2548
|
ActivityDisclosure,
|
|
2636
2549
|
{
|
|
2637
|
-
icon: /* @__PURE__ */
|
|
2550
|
+
icon: /* @__PURE__ */ jsx9(CameraOffIcon2, { className: ICON_SIZE }),
|
|
2638
2551
|
iconTone: isFailed ? "failed" : "muted",
|
|
2639
2552
|
title: verb,
|
|
2640
2553
|
failed: isFailed,
|
|
2641
2554
|
cancelled: isCancelled,
|
|
2642
|
-
media: /* @__PURE__ */
|
|
2643
|
-
children: /* @__PURE__ */
|
|
2555
|
+
media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
|
|
2556
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: isFailed ? "computer_call failed \u2014 no image returned." : isCancelled ? "computer_call interrupted \u2014 no image returned." : "(no image) \u2014 the session returned an empty screenshot." })
|
|
2644
2557
|
}
|
|
2645
2558
|
);
|
|
2646
2559
|
}
|
|
2647
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ jsx9(
|
|
2648
2561
|
ActivityDisclosure,
|
|
2649
2562
|
{
|
|
2650
|
-
icon: /* @__PURE__ */
|
|
2563
|
+
icon: /* @__PURE__ */ jsx9(MousePointer2Icon, { className: ICON_SIZE }),
|
|
2651
2564
|
iconTone: isFailed ? "failed" : "accent",
|
|
2652
2565
|
title: verb,
|
|
2653
2566
|
failed: isFailed,
|
|
2654
2567
|
cancelled: isCancelled,
|
|
2655
2568
|
preview: batched ?? void 0,
|
|
2656
2569
|
expandable: batched != null,
|
|
2657
|
-
children: batched ? /* @__PURE__ */
|
|
2570
|
+
children: batched ? /* @__PURE__ */ jsx9(BodyNote, { children: batched }) : null
|
|
2658
2571
|
}
|
|
2659
2572
|
);
|
|
2660
2573
|
}
|
|
@@ -2714,38 +2627,38 @@ function WebSearchRenderer({ item }) {
|
|
|
2714
2627
|
return { key: `${contentKey}\0${occurrence}`, result };
|
|
2715
2628
|
});
|
|
2716
2629
|
if (running) {
|
|
2717
|
-
return /* @__PURE__ */
|
|
2630
|
+
return /* @__PURE__ */ jsx9(
|
|
2718
2631
|
ActivityDisclosure,
|
|
2719
2632
|
{
|
|
2720
|
-
icon: /* @__PURE__ */
|
|
2633
|
+
icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
|
|
2721
2634
|
iconTone: "running",
|
|
2722
2635
|
title: runningTitle,
|
|
2723
2636
|
running: true,
|
|
2724
|
-
preview: /* @__PURE__ */
|
|
2725
|
-
children: /* @__PURE__ */
|
|
2637
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: `${query2}${variants}` }),
|
|
2638
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: "searching\u2026 results fold into the model context (no output event)." })
|
|
2726
2639
|
}
|
|
2727
2640
|
);
|
|
2728
2641
|
}
|
|
2729
|
-
return /* @__PURE__ */
|
|
2642
|
+
return /* @__PURE__ */ jsx9(
|
|
2730
2643
|
ActivityDisclosure,
|
|
2731
2644
|
{
|
|
2732
|
-
icon: /* @__PURE__ */
|
|
2645
|
+
icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
|
|
2733
2646
|
iconTone: "muted",
|
|
2734
2647
|
title: completedTitle,
|
|
2735
2648
|
preview: `${query2}${variants}`,
|
|
2736
2649
|
failed: item.status === "failed",
|
|
2737
2650
|
cancelled: item.status === "cancelled",
|
|
2738
|
-
children: keyedResults && keyedResults.length ? /* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2741
|
-
/* @__PURE__ */
|
|
2651
|
+
children: keyedResults && keyedResults.length ? /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs7("li", { className: "flex gap-2.5", children: [
|
|
2652
|
+
/* @__PURE__ */ jsx9(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
|
|
2653
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
|
|
2654
|
+
/* @__PURE__ */ jsxs7("p", { className: "truncate text-og-base text-og-fg", children: [
|
|
2742
2655
|
result.title,
|
|
2743
2656
|
" ",
|
|
2744
|
-
/* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
|
|
2745
2658
|
] }),
|
|
2746
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ jsx9("p", { className: "text-og-sm leading-5 text-og-fg-muted", children: result.snippet })
|
|
2747
2660
|
] })
|
|
2748
|
-
] }, key)) }) : /* @__PURE__ */
|
|
2661
|
+
] }, key)) }) : /* @__PURE__ */ jsx9(BodyNote, { children: "results folded into model context \u2014 no list available." })
|
|
2749
2662
|
}
|
|
2750
2663
|
);
|
|
2751
2664
|
}
|
|
@@ -2763,16 +2676,16 @@ function ViewImageRenderer({ item }) {
|
|
|
2763
2676
|
const text = typeof out === "string" ? out : "";
|
|
2764
2677
|
const omittedMedia = mediaPreviewFact(out);
|
|
2765
2678
|
if (item.status === "running") {
|
|
2766
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ jsx9(
|
|
2767
2680
|
ActivityDisclosure,
|
|
2768
2681
|
{
|
|
2769
|
-
icon: /* @__PURE__ */
|
|
2682
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2770
2683
|
iconTone: "running",
|
|
2771
2684
|
title: `View ${basename(path)}`,
|
|
2772
2685
|
running: true,
|
|
2773
|
-
preview: /* @__PURE__ */
|
|
2774
|
-
media: /* @__PURE__ */
|
|
2775
|
-
children: /* @__PURE__ */
|
|
2686
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "reading\u2026" }),
|
|
2687
|
+
media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
|
|
2688
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: "reading image\u2026" })
|
|
2776
2689
|
}
|
|
2777
2690
|
);
|
|
2778
2691
|
}
|
|
@@ -2781,44 +2694,44 @@ function ViewImageRenderer({ item }) {
|
|
|
2781
2694
|
const errMatch = VIEW_IMAGE_ERRORS.find((p) => text.includes(p));
|
|
2782
2695
|
if (errMatch) {
|
|
2783
2696
|
const tooBig = text.includes("exceeded the allowed size");
|
|
2784
|
-
return /* @__PURE__ */
|
|
2697
|
+
return /* @__PURE__ */ jsx9(
|
|
2785
2698
|
ActivityDisclosure,
|
|
2786
2699
|
{
|
|
2787
|
-
icon: /* @__PURE__ */
|
|
2700
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2788
2701
|
iconTone: "failed",
|
|
2789
2702
|
title: `View ${basename(path)}`,
|
|
2790
2703
|
chip: { tone: "bad", text: tooBig ? "too large" : "error" },
|
|
2791
2704
|
preview: text,
|
|
2792
|
-
children: /* @__PURE__ */
|
|
2705
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: text })
|
|
2793
2706
|
}
|
|
2794
2707
|
);
|
|
2795
2708
|
}
|
|
2796
2709
|
if (text.startsWith("OpenAI file reference:")) {
|
|
2797
|
-
return /* @__PURE__ */
|
|
2710
|
+
return /* @__PURE__ */ jsx9(
|
|
2798
2711
|
ActivityDisclosure,
|
|
2799
2712
|
{
|
|
2800
|
-
icon: /* @__PURE__ */
|
|
2713
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2801
2714
|
iconTone: viewFailed ? "failed" : "muted",
|
|
2802
2715
|
title: `Viewed ${basename(path)}`,
|
|
2803
2716
|
failed: viewFailed,
|
|
2804
2717
|
cancelled: viewCancelled,
|
|
2805
2718
|
preview: path,
|
|
2806
|
-
children: /* @__PURE__ */
|
|
2719
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: text })
|
|
2807
2720
|
}
|
|
2808
2721
|
);
|
|
2809
2722
|
}
|
|
2810
2723
|
if (omittedMedia) {
|
|
2811
|
-
return /* @__PURE__ */
|
|
2724
|
+
return /* @__PURE__ */ jsx9(
|
|
2812
2725
|
ActivityDisclosure,
|
|
2813
2726
|
{
|
|
2814
|
-
icon: /* @__PURE__ */
|
|
2727
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2815
2728
|
iconTone: viewFailed ? "failed" : "muted",
|
|
2816
2729
|
title: `Viewed ${basename(path)} \xB7 image omitted \xB7 not retained`,
|
|
2817
2730
|
failed: viewFailed,
|
|
2818
2731
|
cancelled: viewCancelled,
|
|
2819
2732
|
preview: "inline image omitted \xB7 not retained",
|
|
2820
|
-
media: /* @__PURE__ */
|
|
2821
|
-
children: /* @__PURE__ */
|
|
2733
|
+
media: /* @__PURE__ */ jsx9(MediaEmpty, {}),
|
|
2734
|
+
children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
2822
2735
|
"The inline ",
|
|
2823
2736
|
omittedMedia.mediaType,
|
|
2824
2737
|
" output was omitted from the audit timeline and its source bytes were not retained."
|
|
@@ -2827,79 +2740,262 @@ function ViewImageRenderer({ item }) {
|
|
|
2827
2740
|
);
|
|
2828
2741
|
}
|
|
2829
2742
|
if (text.includes("No image data")) {
|
|
2830
|
-
return /* @__PURE__ */
|
|
2743
|
+
return /* @__PURE__ */ jsx9(
|
|
2831
2744
|
ActivityDisclosure,
|
|
2832
2745
|
{
|
|
2833
|
-
icon: /* @__PURE__ */
|
|
2746
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2834
2747
|
iconTone: viewFailed ? "failed" : "muted",
|
|
2835
2748
|
title: `Viewed ${basename(path)}`,
|
|
2836
2749
|
failed: viewFailed,
|
|
2837
2750
|
cancelled: viewCancelled,
|
|
2838
2751
|
preview: "(no image)",
|
|
2839
|
-
children: /* @__PURE__ */
|
|
2752
|
+
children: /* @__PURE__ */ jsx9(BodyNote, { children: viewFailed ? "view_image failed \u2014 no image data returned." : viewCancelled ? "view_image interrupted." : "(no image) \u2014 the sandbox session returned no image data." })
|
|
2840
2753
|
}
|
|
2841
2754
|
);
|
|
2842
2755
|
}
|
|
2843
2756
|
if (text.startsWith("data:")) {
|
|
2844
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ jsx9(
|
|
2845
2758
|
ActivityDisclosure,
|
|
2846
2759
|
{
|
|
2847
|
-
icon: /* @__PURE__ */
|
|
2760
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
2848
2761
|
iconTone: viewFailed ? "failed" : "accent",
|
|
2849
2762
|
title: `Viewed ${basename(path)}`,
|
|
2850
2763
|
failed: viewFailed,
|
|
2851
2764
|
cancelled: viewCancelled,
|
|
2852
|
-
media: /* @__PURE__ */
|
|
2853
|
-
children: /* @__PURE__ */
|
|
2765
|
+
media: /* @__PURE__ */ jsx9(Thumbnail, { src: text, caption: path, alt: path }),
|
|
2766
|
+
children: /* @__PURE__ */ jsx9(ScreenshotFigure, { src: text, caption: path, alt: path })
|
|
2854
2767
|
}
|
|
2855
2768
|
);
|
|
2856
2769
|
}
|
|
2857
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsx9(GenericRenderer, { item });
|
|
2858
2771
|
}
|
|
2859
2772
|
function SecretSetRenderer({ item }) {
|
|
2860
2773
|
const args = parseToolArgs(item.arguments);
|
|
2861
2774
|
const name = typeof args.name === "string" ? args.name : "variable";
|
|
2862
2775
|
if (item.status === "running") {
|
|
2863
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsx9(
|
|
2864
2777
|
ActivityDisclosure,
|
|
2865
2778
|
{
|
|
2866
|
-
icon: /* @__PURE__ */
|
|
2779
|
+
icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
|
|
2867
2780
|
iconTone: "running",
|
|
2868
2781
|
title: `Set ${name}`,
|
|
2869
2782
|
running: true,
|
|
2870
|
-
preview: /* @__PURE__ */
|
|
2871
|
-
children: /* @__PURE__ */
|
|
2783
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "setting\u2026" }),
|
|
2784
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
|
|
2872
2785
|
}
|
|
2873
2786
|
);
|
|
2874
2787
|
}
|
|
2875
2788
|
if (item.status === "failed") {
|
|
2876
2789
|
const errorText = typeof item.output === "string" ? item.output : null;
|
|
2877
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ jsxs7(
|
|
2878
2791
|
ActivityDisclosure,
|
|
2879
2792
|
{
|
|
2880
|
-
icon: /* @__PURE__ */
|
|
2793
|
+
icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
|
|
2881
2794
|
iconTone: "failed",
|
|
2882
2795
|
title: `Set ${name}`,
|
|
2883
2796
|
failed: true,
|
|
2884
2797
|
preview: errorText ?? "variable write failed",
|
|
2885
2798
|
children: [
|
|
2886
|
-
/* @__PURE__ */
|
|
2887
|
-
errorText ? /* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2800
|
+
errorText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: errorText, failed: true }) : /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "the tool call failed with no output." })
|
|
2888
2801
|
]
|
|
2889
2802
|
}
|
|
2890
2803
|
);
|
|
2891
2804
|
}
|
|
2892
|
-
return /* @__PURE__ */
|
|
2805
|
+
return /* @__PURE__ */ jsxs7(
|
|
2893
2806
|
ActivityDisclosure,
|
|
2894
2807
|
{
|
|
2895
|
-
icon: /* @__PURE__ */
|
|
2808
|
+
icon: /* @__PURE__ */ jsx9(KeyRoundIcon, { className: ICON_SIZE }),
|
|
2896
2809
|
iconTone: "muted",
|
|
2897
2810
|
title: `Set ${name}`,
|
|
2898
2811
|
cancelled: item.status === "cancelled",
|
|
2899
2812
|
preview: "value write-only \xB7 never returned",
|
|
2900
2813
|
children: [
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2815
|
+
/* @__PURE__ */ jsx9(BodyNote, { children: "the value is a secret \u2014 redacted in every view; the API never returns it." })
|
|
2816
|
+
]
|
|
2817
|
+
}
|
|
2818
|
+
);
|
|
2819
|
+
}
|
|
2820
|
+
function DocsSearchRenderer({ item }) {
|
|
2821
|
+
const args = parseToolArgs(item.arguments);
|
|
2822
|
+
const query2 = typeof args.query === "string" ? args.query.trim() : "";
|
|
2823
|
+
const title = query2 ? `Search \u201C${truncatePreview(query2, 48)}\u201D` : toolDisplayName(item.name);
|
|
2824
|
+
const running = item.status === "running";
|
|
2825
|
+
if (running) {
|
|
2826
|
+
return /* @__PURE__ */ jsx9(
|
|
2827
|
+
ActivityDisclosure,
|
|
2828
|
+
{
|
|
2829
|
+
icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
|
|
2830
|
+
iconTone: "running",
|
|
2831
|
+
title,
|
|
2832
|
+
running: true,
|
|
2833
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Searching\u2026" }),
|
|
2834
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
|
|
2835
|
+
}
|
|
2836
|
+
);
|
|
2837
|
+
}
|
|
2838
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
2839
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
2840
|
+
return /* @__PURE__ */ jsxs7(
|
|
2841
|
+
ActivityDisclosure,
|
|
2842
|
+
{
|
|
2843
|
+
icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
|
|
2844
|
+
iconTone: "failed",
|
|
2845
|
+
title,
|
|
2846
|
+
failed: true,
|
|
2847
|
+
preview: truncatePreview(outText, 80) || "Search failed",
|
|
2848
|
+
children: [
|
|
2849
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2850
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
2851
|
+
]
|
|
2852
|
+
}
|
|
2853
|
+
);
|
|
2854
|
+
}
|
|
2855
|
+
const hits = parseSearchHits(outText);
|
|
2856
|
+
const preview = item.status === "cancelled" ? void 0 : hits ? hits.length === 0 ? "No hits" : `${hits.length} hit${hits.length === 1 ? "" : "s"}` : "Done";
|
|
2857
|
+
return /* @__PURE__ */ jsxs7(
|
|
2858
|
+
ActivityDisclosure,
|
|
2859
|
+
{
|
|
2860
|
+
icon: /* @__PURE__ */ jsx9(FileSearchIcon, { className: ICON_SIZE }),
|
|
2861
|
+
iconTone: "muted",
|
|
2862
|
+
title,
|
|
2863
|
+
cancelled: item.status === "cancelled",
|
|
2864
|
+
preview,
|
|
2865
|
+
children: [
|
|
2866
|
+
hits && hits.length > 0 ? /* @__PURE__ */ jsx9("ul", { className: "grid gap-2", children: hits.slice(0, 8).map((hit) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
|
|
2867
|
+
/* @__PURE__ */ jsx9("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
|
|
2868
|
+
hit.snippet ? /* @__PURE__ */ jsx9("div", { className: "mt-0.5 line-clamp-2 text-og-xs text-og-fg-muted", children: hit.snippet }) : null
|
|
2869
|
+
] }, `${hit.title}\0${hit.snippet}`)) }) : null,
|
|
2870
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2871
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
|
|
2872
|
+
]
|
|
2873
|
+
}
|
|
2874
|
+
);
|
|
2875
|
+
}
|
|
2876
|
+
function SetSessionTitleRenderer({ item }) {
|
|
2877
|
+
const args = parseToolArgs(item.arguments);
|
|
2878
|
+
const titleArg = typeof args.title === "string" ? args.title.trim() : "";
|
|
2879
|
+
const display = toolDisplayName(item.name);
|
|
2880
|
+
const previewTitle = titleArg ? truncatePreview(titleArg, 72) : "";
|
|
2881
|
+
const icon = /* @__PURE__ */ jsx9(MessagesSquareIcon, { className: ICON_SIZE });
|
|
2882
|
+
if (item.status === "running") {
|
|
2883
|
+
return /* @__PURE__ */ jsx9(
|
|
2884
|
+
ActivityDisclosure,
|
|
2885
|
+
{
|
|
2886
|
+
icon,
|
|
2887
|
+
iconTone: "running",
|
|
2888
|
+
title: display,
|
|
2889
|
+
running: true,
|
|
2890
|
+
preview: previewTitle ? /* @__PURE__ */ jsx9(RunningPreview, { children: previewTitle }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Setting title\u2026" }),
|
|
2891
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
|
|
2892
|
+
}
|
|
2893
|
+
);
|
|
2894
|
+
}
|
|
2895
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
2896
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
2897
|
+
return /* @__PURE__ */ jsxs7(
|
|
2898
|
+
ActivityDisclosure,
|
|
2899
|
+
{
|
|
2900
|
+
icon,
|
|
2901
|
+
iconTone: "failed",
|
|
2902
|
+
title: display,
|
|
2903
|
+
failed: true,
|
|
2904
|
+
preview: truncatePreview(outText, 80) || "Rename failed",
|
|
2905
|
+
children: [
|
|
2906
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2907
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
2908
|
+
]
|
|
2909
|
+
}
|
|
2910
|
+
);
|
|
2911
|
+
}
|
|
2912
|
+
let settledTitle = previewTitle;
|
|
2913
|
+
if (!settledTitle) {
|
|
2914
|
+
const parsed = tryParseJson(outText);
|
|
2915
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
2916
|
+
const fromResult = parsed.title;
|
|
2917
|
+
if (typeof fromResult === "string" && fromResult.trim()) {
|
|
2918
|
+
settledTitle = truncatePreview(fromResult.trim(), 72);
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
return /* @__PURE__ */ jsxs7(
|
|
2923
|
+
ActivityDisclosure,
|
|
2924
|
+
{
|
|
2925
|
+
icon,
|
|
2926
|
+
iconTone: "muted",
|
|
2927
|
+
title: display,
|
|
2928
|
+
cancelled: item.status === "cancelled",
|
|
2929
|
+
preview: item.status === "cancelled" ? void 0 : settledTitle || void 0,
|
|
2930
|
+
children: [
|
|
2931
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) }),
|
|
2932
|
+
outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText }) : null
|
|
2933
|
+
]
|
|
2934
|
+
}
|
|
2935
|
+
);
|
|
2936
|
+
}
|
|
2937
|
+
function parseSearchHits(outText) {
|
|
2938
|
+
const parsed = tryParseJson(outText);
|
|
2939
|
+
if (parsed == null) {
|
|
2940
|
+
return null;
|
|
2941
|
+
}
|
|
2942
|
+
const list = Array.isArray(parsed) ? parsed : parsed && typeof parsed === "object" && Array.isArray(parsed.results) ? parsed.results : parsed && typeof parsed === "object" && Array.isArray(parsed.hits) ? parsed.hits : null;
|
|
2943
|
+
if (!list) {
|
|
2944
|
+
return null;
|
|
2945
|
+
}
|
|
2946
|
+
return list.map((row) => {
|
|
2947
|
+
const r = row && typeof row === "object" ? row : {};
|
|
2948
|
+
const title = typeof r.title === "string" && r.title || typeof r.name === "string" && r.name || typeof r.documentTitle === "string" && r.documentTitle || typeof r.path === "string" && r.path || typeof r.id === "string" && r.id || "Result";
|
|
2949
|
+
const snippet = typeof r.snippet === "string" && r.snippet || typeof r.text === "string" && r.text || typeof r.content === "string" && r.content || "";
|
|
2950
|
+
return { title, snippet: truncatePreview(snippet, 160) };
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
function MemoryProposeRenderer({ item }) {
|
|
2954
|
+
const args = parseToolArgs(item.arguments);
|
|
2955
|
+
const text = typeof args.text === "string" ? args.text.trim() : "";
|
|
2956
|
+
const title = "Propose memory";
|
|
2957
|
+
const running = item.status === "running";
|
|
2958
|
+
if (running) {
|
|
2959
|
+
return /* @__PURE__ */ jsx9(
|
|
2960
|
+
ActivityDisclosure,
|
|
2961
|
+
{
|
|
2962
|
+
icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
|
|
2963
|
+
iconTone: "running",
|
|
2964
|
+
title,
|
|
2965
|
+
running: true,
|
|
2966
|
+
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "Proposing\u2026" }),
|
|
2967
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: redactSecrets(args) })
|
|
2968
|
+
}
|
|
2969
|
+
);
|
|
2970
|
+
}
|
|
2971
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
2972
|
+
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
2973
|
+
return /* @__PURE__ */ jsxs7(
|
|
2974
|
+
ActivityDisclosure,
|
|
2975
|
+
{
|
|
2976
|
+
icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
|
|
2977
|
+
iconTone: "failed",
|
|
2978
|
+
title,
|
|
2979
|
+
failed: true,
|
|
2980
|
+
preview: truncatePreview(outText, 80) || "Propose failed",
|
|
2981
|
+
children: [
|
|
2982
|
+
text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
|
|
2983
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
2984
|
+
]
|
|
2985
|
+
}
|
|
2986
|
+
);
|
|
2987
|
+
}
|
|
2988
|
+
return /* @__PURE__ */ jsxs7(
|
|
2989
|
+
ActivityDisclosure,
|
|
2990
|
+
{
|
|
2991
|
+
icon: /* @__PURE__ */ jsx9(BrainCircuitIcon, { className: ICON_SIZE }),
|
|
2992
|
+
iconTone: "muted",
|
|
2993
|
+
title,
|
|
2994
|
+
cancelled: item.status === "cancelled",
|
|
2995
|
+
preview: text ? truncatePreview(text, 90) : "Done",
|
|
2996
|
+
children: [
|
|
2997
|
+
text ? /* @__PURE__ */ jsx9(BodyNote, { children: text }) : null,
|
|
2998
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
|
|
2903
2999
|
]
|
|
2904
3000
|
}
|
|
2905
3001
|
);
|
|
@@ -2908,54 +3004,76 @@ function GenericRenderer({ item }) {
|
|
|
2908
3004
|
const running = item.status === "running";
|
|
2909
3005
|
const args = redactSecrets(parseToolArgs(item.arguments));
|
|
2910
3006
|
const display = toolDisplayName(item.name);
|
|
3007
|
+
const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
|
|
3008
|
+
const goalPreview = goalToolPreview(item.name, args);
|
|
2911
3009
|
if (running) {
|
|
2912
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsx9(
|
|
2913
3011
|
ActivityDisclosure,
|
|
2914
3012
|
{
|
|
2915
|
-
icon
|
|
3013
|
+
icon,
|
|
2916
3014
|
iconTone: "running",
|
|
2917
3015
|
title: display,
|
|
2918
3016
|
running: true,
|
|
2919
|
-
preview: /* @__PURE__ */
|
|
2920
|
-
children: /* @__PURE__ */
|
|
3017
|
+
preview: goalPreview ?? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }),
|
|
3018
|
+
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
2921
3019
|
}
|
|
2922
3020
|
);
|
|
2923
3021
|
}
|
|
2924
3022
|
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
2925
3023
|
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
2926
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ jsxs7(
|
|
2927
3025
|
ActivityDisclosure,
|
|
2928
3026
|
{
|
|
2929
|
-
icon
|
|
3027
|
+
icon,
|
|
2930
3028
|
iconTone: "failed",
|
|
2931
3029
|
title: display,
|
|
2932
3030
|
chip: { tone: "bad", text: "error" },
|
|
2933
|
-
preview: outText
|
|
3031
|
+
preview: truncatePreview(outText, 80) || "Error",
|
|
2934
3032
|
children: [
|
|
2935
|
-
/* @__PURE__ */
|
|
2936
|
-
/* @__PURE__ */
|
|
3033
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
3034
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
2937
3035
|
]
|
|
2938
3036
|
}
|
|
2939
3037
|
);
|
|
2940
3038
|
}
|
|
2941
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsxs7(
|
|
2942
3040
|
ActivityDisclosure,
|
|
2943
3041
|
{
|
|
2944
|
-
icon
|
|
3042
|
+
icon,
|
|
2945
3043
|
iconTone: "muted",
|
|
2946
3044
|
title: display,
|
|
2947
3045
|
cancelled: item.status === "cancelled",
|
|
2948
|
-
preview:
|
|
3046
|
+
preview: item.status === "cancelled" ? void 0 : goalPreview ?? "Done",
|
|
2949
3047
|
children: [
|
|
2950
|
-
/* @__PURE__ */
|
|
2951
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
3049
|
+
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText })
|
|
2952
3050
|
]
|
|
2953
3051
|
}
|
|
2954
3052
|
);
|
|
2955
3053
|
}
|
|
2956
|
-
function
|
|
2957
|
-
const
|
|
2958
|
-
|
|
3054
|
+
function goalToolPreview(name, args) {
|
|
3055
|
+
const leaf = mcpToolLeaf(name);
|
|
3056
|
+
if (leaf !== "goal_set" && leaf !== "goal_update" && leaf !== "goal_complete" && leaf !== "goal_pause") {
|
|
3057
|
+
return null;
|
|
3058
|
+
}
|
|
3059
|
+
const record = args && typeof args === "object" ? args : null;
|
|
3060
|
+
if (!record) {
|
|
3061
|
+
return null;
|
|
3062
|
+
}
|
|
3063
|
+
const text = typeof record.text === "string" ? record.text : typeof record.evidence === "string" ? record.evidence : typeof record.rationale === "string" ? record.rationale : typeof record.progressNote === "string" ? record.progressNote : null;
|
|
3064
|
+
return text ? truncatePreview(text, 90) : null;
|
|
3065
|
+
}
|
|
3066
|
+
function truncatePreview(text, max) {
|
|
3067
|
+
const cleaned = text.replace(/\s+/g, " ").trim();
|
|
3068
|
+
if (!cleaned) {
|
|
3069
|
+
return "";
|
|
3070
|
+
}
|
|
3071
|
+
return cleaned.length > max ? `${cleaned.slice(0, max - 1)}\u2026` : cleaned;
|
|
3072
|
+
}
|
|
3073
|
+
function GenericToolIcon({ name }) {
|
|
3074
|
+
const leaf = mcpToolLeaf(name);
|
|
3075
|
+
const Icon = leaf.startsWith("goal_") ? TargetIcon : leaf.startsWith("memory_") || leaf === "preference_registry_summary" || leaf === "preference_registry_get" ? BrainCircuitIcon : leaf.startsWith("session_") || leaf === "sessions_list" || leaf === "set_session_title" || leaf === "set_other_session_title" ? MessagesSquareIcon : leaf.startsWith("sandbox") || leaf === "sandboxes_list" || leaf === "run_on" ? ServerIcon : leaf.startsWith("rig_") ? ServerCogIcon : leaf.startsWith("scheduled_") ? CalendarClockIcon : leaf.startsWith("artifacts_") ? PanelsTopLeftIcon : leaf.startsWith("social_") ? Share2Icon : leaf.startsWith("slack_") ? MessageSquareIcon : leaf.startsWith("github_") ? FolderGitIcon : leaf.startsWith("variable_") ? BoxIcon : leaf.startsWith("environment_") ? KeyRoundIcon : leaf.includes("document") || leaf.includes("knowledge") || leaf === "list_document_bases" ? FileSearchIcon : leaf === "tool_search" || leaf === "load_skill" ? PlugIcon : WrenchIcon;
|
|
3076
|
+
return /* @__PURE__ */ jsx9(Icon, { className: ICON_SIZE });
|
|
2959
3077
|
}
|
|
2960
3078
|
var BASE_ENTRIES = [
|
|
2961
3079
|
// Provider-native items carry `raw.type` on the wire — this is their source of
|
|
@@ -2963,13 +3081,11 @@ var BASE_ENTRIES = [
|
|
|
2963
3081
|
{ match: "rawType", type: "apply_patch_call", render: ApplyPatchRenderer },
|
|
2964
3082
|
{ match: "rawType", type: "computer_call", render: ComputerCallRenderer },
|
|
2965
3083
|
{ match: "rawType", type: "hosted_tool_call", render: WebSearchRenderer },
|
|
2966
|
-
// First-party sandbox + MCP tools resolve by name
|
|
2967
|
-
// `computer_call` are intentionally repeated by name as a fallback only for
|
|
2968
|
-
// first-party replays that omit `raw` (the rawType entries above win whenever
|
|
2969
|
-
// `raw.type` is present, which is the live-wire case).
|
|
3084
|
+
// First-party sandbox + MCP tools resolve by name (exact or MCP leaf).
|
|
2970
3085
|
{ match: "name", name: "exec_command", render: ExecRenderer },
|
|
2971
3086
|
{ match: "name", name: "write_stdin", render: WriteStdinRenderer },
|
|
2972
3087
|
{ match: "name", name: "apply_patch_call", render: ApplyPatchRenderer },
|
|
3088
|
+
{ match: "name", name: "apply_patch", render: ApplyPatchRenderer },
|
|
2973
3089
|
{ match: "name", name: "computer_call", render: ComputerCallRenderer },
|
|
2974
3090
|
// Function-mode computer tools (codex / chat-wire transports).
|
|
2975
3091
|
{ match: "name", name: "computer_screenshot", render: ComputerCallRenderer },
|
|
@@ -2982,7 +3098,13 @@ var BASE_ENTRIES = [
|
|
|
2982
3098
|
{ match: "name", name: "computer_drag", render: ComputerCallRenderer },
|
|
2983
3099
|
{ match: "name", name: "web_search_call", render: WebSearchRenderer },
|
|
2984
3100
|
{ match: "name", name: "view_image", render: ViewImageRenderer },
|
|
2985
|
-
{ match: "name", name: "environment_set_variable", render: SecretSetRenderer }
|
|
3101
|
+
{ match: "name", name: "environment_set_variable", render: SecretSetRenderer },
|
|
3102
|
+
{ match: "name", name: "variable_set_set_variable", render: SecretSetRenderer },
|
|
3103
|
+
{ match: "name", name: "search_documents", render: DocsSearchRenderer },
|
|
3104
|
+
{ match: "name", name: "knowledge_search", render: DocsSearchRenderer },
|
|
3105
|
+
{ match: "name", name: "memory_propose", render: MemoryProposeRenderer },
|
|
3106
|
+
{ match: "name", name: "set_session_title", render: SetSessionTitleRenderer },
|
|
3107
|
+
{ match: "name", name: "set_other_session_title", render: SetSessionTitleRenderer }
|
|
2986
3108
|
];
|
|
2987
3109
|
var defaultToolRegistry = createToolRegistry(BASE_ENTRIES, GenericRenderer);
|
|
2988
3110
|
function createDefaultToolRegistry(options = {}) {
|
|
@@ -3039,8 +3161,8 @@ function tableElementToTsv(table) {
|
|
|
3039
3161
|
|
|
3040
3162
|
// src/components/copy-button.tsx
|
|
3041
3163
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
3042
|
-
import { useEffect as
|
|
3043
|
-
import { jsx as
|
|
3164
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState8 } from "react";
|
|
3165
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3044
3166
|
var COPIED_MS = 1600;
|
|
3045
3167
|
function CopyButton({
|
|
3046
3168
|
text,
|
|
@@ -3048,9 +3170,10 @@ function CopyButton({
|
|
|
3048
3170
|
className,
|
|
3049
3171
|
reveal = "group-hover"
|
|
3050
3172
|
}) {
|
|
3051
|
-
const [copied, setCopied] =
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3173
|
+
const [copied, setCopied] = useState8(false);
|
|
3174
|
+
const [tipOpen, setTipOpen] = useState8(false);
|
|
3175
|
+
const timerRef = useRef3(null);
|
|
3176
|
+
useEffect5(() => {
|
|
3054
3177
|
return () => {
|
|
3055
3178
|
if (timerRef.current !== null) {
|
|
3056
3179
|
clearTimeout(timerRef.current);
|
|
@@ -3066,59 +3189,79 @@ function CopyButton({
|
|
|
3066
3189
|
return;
|
|
3067
3190
|
}
|
|
3068
3191
|
setCopied(true);
|
|
3192
|
+
setTipOpen(true);
|
|
3193
|
+
if (event.detail > 0) {
|
|
3194
|
+
event.currentTarget.blur();
|
|
3195
|
+
}
|
|
3069
3196
|
if (timerRef.current !== null) {
|
|
3070
3197
|
clearTimeout(timerRef.current);
|
|
3071
3198
|
}
|
|
3072
3199
|
timerRef.current = setTimeout(() => {
|
|
3073
3200
|
timerRef.current = null;
|
|
3074
3201
|
setCopied(false);
|
|
3202
|
+
setTipOpen(false);
|
|
3075
3203
|
}, COPIED_MS);
|
|
3076
3204
|
};
|
|
3077
3205
|
const tip = copied ? "Copied" : label;
|
|
3078
|
-
return /* @__PURE__ */
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
"
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3206
|
+
return /* @__PURE__ */ jsxs8(
|
|
3207
|
+
Tooltip,
|
|
3208
|
+
{
|
|
3209
|
+
open: copied ? true : tipOpen,
|
|
3210
|
+
onOpenChange: (next) => {
|
|
3211
|
+
if (!copied) {
|
|
3212
|
+
setTipOpen(next);
|
|
3213
|
+
}
|
|
3214
|
+
},
|
|
3215
|
+
children: [
|
|
3216
|
+
/* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(
|
|
3217
|
+
"button",
|
|
3218
|
+
{
|
|
3219
|
+
type: "button",
|
|
3220
|
+
"data-og-copy": "",
|
|
3221
|
+
"data-state": copied ? "copied" : "idle",
|
|
3222
|
+
"aria-label": tip,
|
|
3223
|
+
onClick,
|
|
3224
|
+
className: cn(
|
|
3225
|
+
"inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
|
|
3226
|
+
"text-og-fg-subtle transition-[opacity,color,background-color] duration-150",
|
|
3227
|
+
"hover:bg-og-surface-2/80 hover:text-og-fg",
|
|
3228
|
+
"focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
3229
|
+
reveal === "group-hover" && "opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 pointer-coarse:opacity-70",
|
|
3230
|
+
copied && "opacity-100 text-og-accent",
|
|
3231
|
+
className
|
|
3232
|
+
),
|
|
3233
|
+
children: copied ? /* @__PURE__ */ jsx10(CheckIcon, { className: "size-3.5", "aria-hidden": true }) : /* @__PURE__ */ jsx10(CopyIcon, { className: "size-3.5", "aria-hidden": true })
|
|
3234
|
+
}
|
|
3235
|
+
) }),
|
|
3236
|
+
/* @__PURE__ */ jsx10(TooltipContent, { side: "top", children: tip })
|
|
3237
|
+
]
|
|
3238
|
+
}
|
|
3239
|
+
);
|
|
3101
3240
|
}
|
|
3102
3241
|
function CopyHoverFrame({
|
|
3103
3242
|
children,
|
|
3104
3243
|
className,
|
|
3105
3244
|
copyText,
|
|
3106
3245
|
label,
|
|
3107
|
-
align = "end"
|
|
3246
|
+
align = "end",
|
|
3247
|
+
trailing
|
|
3108
3248
|
}) {
|
|
3109
3249
|
if (copyText.trim().length === 0) {
|
|
3110
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ jsx10("div", { className, children });
|
|
3111
3251
|
}
|
|
3112
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("group/copy", className), children: [
|
|
3113
3253
|
children,
|
|
3114
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsxs8(
|
|
3115
3255
|
"div",
|
|
3116
3256
|
{
|
|
3117
3257
|
className: cn(
|
|
3118
|
-
"
|
|
3119
|
-
align === "end" ? "
|
|
3258
|
+
"mt-1 flex h-7 items-center gap-1.5",
|
|
3259
|
+
align === "end" ? "justify-end" : "justify-start"
|
|
3120
3260
|
),
|
|
3121
|
-
children:
|
|
3261
|
+
children: [
|
|
3262
|
+
/* @__PURE__ */ jsx10(CopyButton, { text: copyText, label, reveal: "group-hover" }),
|
|
3263
|
+
trailing
|
|
3264
|
+
]
|
|
3122
3265
|
}
|
|
3123
3266
|
)
|
|
3124
3267
|
] });
|
|
@@ -3129,10 +3272,10 @@ import {
|
|
|
3129
3272
|
Children,
|
|
3130
3273
|
isValidElement,
|
|
3131
3274
|
memo,
|
|
3132
|
-
useEffect as
|
|
3275
|
+
useEffect as useEffect6,
|
|
3133
3276
|
useReducer,
|
|
3134
|
-
useRef as
|
|
3135
|
-
useState as
|
|
3277
|
+
useRef as useRef4,
|
|
3278
|
+
useState as useState9
|
|
3136
3279
|
} from "react";
|
|
3137
3280
|
import ReactMarkdown from "react-markdown";
|
|
3138
3281
|
import remarkGfm from "remark-gfm";
|
|
@@ -3417,9 +3560,9 @@ function rehypeStreamReveal(options) {
|
|
|
3417
3560
|
}
|
|
3418
3561
|
|
|
3419
3562
|
// src/components/markdown.tsx
|
|
3420
|
-
import { jsx as
|
|
3563
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3421
3564
|
var components = {
|
|
3422
|
-
h1: ({ children, ...props }) => /* @__PURE__ */
|
|
3565
|
+
h1: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3423
3566
|
"h1",
|
|
3424
3567
|
{
|
|
3425
3568
|
className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
|
|
@@ -3427,8 +3570,8 @@ var components = {
|
|
|
3427
3570
|
children
|
|
3428
3571
|
}
|
|
3429
3572
|
),
|
|
3430
|
-
h2: ({ children, ...props }) => /* @__PURE__ */
|
|
3431
|
-
h3: ({ children, ...props }) => /* @__PURE__ */
|
|
3573
|
+
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 }),
|
|
3574
|
+
h3: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3432
3575
|
"h3",
|
|
3433
3576
|
{
|
|
3434
3577
|
className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
|
|
@@ -3436,7 +3579,7 @@ var components = {
|
|
|
3436
3579
|
children
|
|
3437
3580
|
}
|
|
3438
3581
|
),
|
|
3439
|
-
h4: ({ children, ...props }) => /* @__PURE__ */
|
|
3582
|
+
h4: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3440
3583
|
"h4",
|
|
3441
3584
|
{
|
|
3442
3585
|
className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg-muted first:mt-0",
|
|
@@ -3444,10 +3587,10 @@ var components = {
|
|
|
3444
3587
|
children
|
|
3445
3588
|
}
|
|
3446
3589
|
),
|
|
3447
|
-
p: ({ children, ...props }) => /* @__PURE__ */
|
|
3448
|
-
strong: ({ children, ...props }) => /* @__PURE__ */
|
|
3449
|
-
em: ({ children, ...props }) => /* @__PURE__ */
|
|
3450
|
-
a: ({ children, ...props }) => /* @__PURE__ */
|
|
3590
|
+
p: ({ children, ...props }) => /* @__PURE__ */ jsx11("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
|
|
3591
|
+
strong: ({ children, ...props }) => /* @__PURE__ */ jsx11("strong", { className: "font-semibold text-og-fg", ...props, children }),
|
|
3592
|
+
em: ({ children, ...props }) => /* @__PURE__ */ jsx11("em", { className: "italic", ...props, children }),
|
|
3593
|
+
a: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3451
3594
|
"a",
|
|
3452
3595
|
{
|
|
3453
3596
|
className: "break-words font-medium text-og-accent underline-offset-2 hover:underline",
|
|
@@ -3457,7 +3600,7 @@ var components = {
|
|
|
3457
3600
|
children
|
|
3458
3601
|
}
|
|
3459
3602
|
),
|
|
3460
|
-
ul: ({ children, ...props }) => /* @__PURE__ */
|
|
3603
|
+
ul: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3461
3604
|
"ul",
|
|
3462
3605
|
{
|
|
3463
3606
|
className: "my-2.5 ml-5 flex list-disc flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
@@ -3465,7 +3608,7 @@ var components = {
|
|
|
3465
3608
|
children
|
|
3466
3609
|
}
|
|
3467
3610
|
),
|
|
3468
|
-
ol: ({ children, ...props }) => /* @__PURE__ */
|
|
3611
|
+
ol: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3469
3612
|
"ol",
|
|
3470
3613
|
{
|
|
3471
3614
|
className: "my-2.5 ml-5 flex list-decimal flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
@@ -3476,7 +3619,7 @@ var components = {
|
|
|
3476
3619
|
// GFM task-list items carry a leading checkbox <input>; `list-none` + a
|
|
3477
3620
|
// negative margin pull the checkbox back to the bullet column so it aligns
|
|
3478
3621
|
// with the text.
|
|
3479
|
-
li: ({ children, ...props }) => /* @__PURE__ */
|
|
3622
|
+
li: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3480
3623
|
"li",
|
|
3481
3624
|
{
|
|
3482
3625
|
className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
|
|
@@ -3484,7 +3627,7 @@ var components = {
|
|
|
3484
3627
|
children
|
|
3485
3628
|
}
|
|
3486
3629
|
),
|
|
3487
|
-
input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */
|
|
3630
|
+
input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx11(
|
|
3488
3631
|
"input",
|
|
3489
3632
|
{
|
|
3490
3633
|
...props,
|
|
@@ -3492,8 +3635,8 @@ var components = {
|
|
|
3492
3635
|
disabled: true,
|
|
3493
3636
|
className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
|
|
3494
3637
|
}
|
|
3495
|
-
) : /* @__PURE__ */
|
|
3496
|
-
blockquote: ({ children, ...props }) => /* @__PURE__ */
|
|
3638
|
+
) : /* @__PURE__ */ jsx11("input", { type, ...props }),
|
|
3639
|
+
blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3497
3640
|
"blockquote",
|
|
3498
3641
|
{
|
|
3499
3642
|
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",
|
|
@@ -3501,11 +3644,11 @@ var components = {
|
|
|
3501
3644
|
children
|
|
3502
3645
|
}
|
|
3503
3646
|
),
|
|
3504
|
-
hr: (props) => /* @__PURE__ */
|
|
3647
|
+
hr: (props) => /* @__PURE__ */ jsx11("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
|
|
3505
3648
|
// Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
|
|
3506
3649
|
// `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
|
|
3507
3650
|
// the `pre` renderer), so a `code` reaching here is treated as inline.
|
|
3508
|
-
code: ({ children, className: _className, ...props }) => /* @__PURE__ */
|
|
3651
|
+
code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx11(
|
|
3509
3652
|
"code",
|
|
3510
3653
|
{
|
|
3511
3654
|
className: "rounded-og-xs bg-og-surface-1 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
|
|
@@ -3514,11 +3657,11 @@ var components = {
|
|
|
3514
3657
|
}
|
|
3515
3658
|
),
|
|
3516
3659
|
// Fenced code — quiet mono block (no card / no nested vertical scroll).
|
|
3517
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
3660
|
+
pre: ({ children }) => /* @__PURE__ */ jsx11(MarkdownCodeBlock, { children }),
|
|
3518
3661
|
// Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
|
|
3519
|
-
table: ({ children, ...props }) => /* @__PURE__ */
|
|
3520
|
-
thead: ({ children, ...props }) => /* @__PURE__ */
|
|
3521
|
-
th: ({ children, ...props }) => /* @__PURE__ */
|
|
3662
|
+
table: ({ children, ...props }) => /* @__PURE__ */ jsx11(MarkdownTable, { ...props, children }),
|
|
3663
|
+
thead: ({ children, ...props }) => /* @__PURE__ */ jsx11("thead", { ...props, children }),
|
|
3664
|
+
th: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3522
3665
|
"th",
|
|
3523
3666
|
{
|
|
3524
3667
|
className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
|
|
@@ -3526,7 +3669,7 @@ var components = {
|
|
|
3526
3669
|
children
|
|
3527
3670
|
}
|
|
3528
3671
|
),
|
|
3529
|
-
td: ({ children, ...props }) => /* @__PURE__ */
|
|
3672
|
+
td: ({ children, ...props }) => /* @__PURE__ */ jsx11(
|
|
3530
3673
|
"td",
|
|
3531
3674
|
{
|
|
3532
3675
|
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",
|
|
@@ -3534,7 +3677,7 @@ var components = {
|
|
|
3534
3677
|
children
|
|
3535
3678
|
}
|
|
3536
3679
|
),
|
|
3537
|
-
img: ({ alt, ...props }) => /* @__PURE__ */
|
|
3680
|
+
img: ({ alt, ...props }) => /* @__PURE__ */ jsx11(
|
|
3538
3681
|
"img",
|
|
3539
3682
|
{
|
|
3540
3683
|
alt: alt ?? "",
|
|
@@ -3576,18 +3719,18 @@ function fenceLanguage(children) {
|
|
|
3576
3719
|
function MarkdownCodeBlock({ children }) {
|
|
3577
3720
|
const code = nodeText(children).replace(/\n$/, "");
|
|
3578
3721
|
const language = fenceLanguage(children);
|
|
3579
|
-
return /* @__PURE__ */
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
language ? /* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 first:mt-0", children: [
|
|
3723
|
+
/* @__PURE__ */ jsxs9("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
|
|
3724
|
+
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,
|
|
3725
|
+
/* @__PURE__ */ jsx11("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx11(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
|
|
3583
3726
|
] }),
|
|
3584
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsx11("pre", { className: "overflow-x-auto overflow-y-hidden rounded-og-md bg-og-surface-1/70 px-3 py-2.5 font-og-mono text-og-sm leading-5 text-og-fg-muted [scrollbar-gutter:stable] [&>code]:block [&>code]:border-0 [&>code]:bg-transparent [&>code]:p-0 [&>code]:leading-5 [&>code]:text-inherit", children })
|
|
3585
3728
|
] });
|
|
3586
3729
|
}
|
|
3587
3730
|
function MarkdownTable({ children, className, ...props }) {
|
|
3588
|
-
const tableRef =
|
|
3589
|
-
return /* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3731
|
+
const tableRef = useRef4(null);
|
|
3732
|
+
return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
|
|
3733
|
+
/* @__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(
|
|
3591
3734
|
CopyButton,
|
|
3592
3735
|
{
|
|
3593
3736
|
text: () => tableElementToTsv(tableRef.current),
|
|
@@ -3595,7 +3738,7 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
3595
3738
|
reveal: "group-hover"
|
|
3596
3739
|
}
|
|
3597
3740
|
) }) }),
|
|
3598
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ jsx11("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx11(
|
|
3599
3742
|
"table",
|
|
3600
3743
|
{
|
|
3601
3744
|
ref: tableRef,
|
|
@@ -3607,11 +3750,11 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
3607
3750
|
] });
|
|
3608
3751
|
}
|
|
3609
3752
|
function MarkdownImpl({ children, className, streaming = false }) {
|
|
3610
|
-
const revealRef =
|
|
3611
|
-
const bodyRef =
|
|
3753
|
+
const revealRef = useRef4(null);
|
|
3754
|
+
const bodyRef = useRef4(null);
|
|
3612
3755
|
const [, bump] = useReducer((n) => n + 1, 0);
|
|
3613
|
-
const [settling, setSettling] =
|
|
3614
|
-
const hadRevealRef =
|
|
3756
|
+
const [settling, setSettling] = useState9(false);
|
|
3757
|
+
const hadRevealRef = useRef4(false);
|
|
3615
3758
|
const now = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
3616
3759
|
const crystallize = (mutate) => {
|
|
3617
3760
|
mutate();
|
|
@@ -3631,7 +3774,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
3631
3774
|
}
|
|
3632
3775
|
const revealActive = reveal !== null && (streaming || reveal.hasActive(now));
|
|
3633
3776
|
const rehypePlugins = revealActive && reveal !== null ? [[rehypeStreamReveal, { reveal, now }]] : void 0;
|
|
3634
|
-
|
|
3777
|
+
useEffect6(() => {
|
|
3635
3778
|
if (streaming || revealRef.current === null) {
|
|
3636
3779
|
return;
|
|
3637
3780
|
}
|
|
@@ -3657,8 +3800,8 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
3657
3800
|
}
|
|
3658
3801
|
};
|
|
3659
3802
|
}, [streaming]);
|
|
3660
|
-
const wasStreamingRef =
|
|
3661
|
-
|
|
3803
|
+
const wasStreamingRef = useRef4(streaming);
|
|
3804
|
+
useEffect6(() => {
|
|
3662
3805
|
const ended = wasStreamingRef.current && !streaming;
|
|
3663
3806
|
wasStreamingRef.current = streaming;
|
|
3664
3807
|
if (!ended || revealRef.current !== null || prefersReducedMotion()) {
|
|
@@ -3669,7 +3812,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
3669
3812
|
return () => clearTimeout(timer);
|
|
3670
3813
|
}, [streaming]);
|
|
3671
3814
|
const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
|
|
3672
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx11(
|
|
3673
3816
|
"div",
|
|
3674
3817
|
{
|
|
3675
3818
|
ref: bodyRef,
|
|
@@ -3678,7 +3821,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
3678
3821
|
settling && "og-markdown-settle",
|
|
3679
3822
|
className
|
|
3680
3823
|
),
|
|
3681
|
-
children: /* @__PURE__ */
|
|
3824
|
+
children: /* @__PURE__ */ jsx11(
|
|
3682
3825
|
ReactMarkdown,
|
|
3683
3826
|
{
|
|
3684
3827
|
remarkPlugins: [remarkGfm],
|
|
@@ -3696,36 +3839,36 @@ var Markdown = memo(MarkdownImpl);
|
|
|
3696
3839
|
import {
|
|
3697
3840
|
ArrowRightIcon,
|
|
3698
3841
|
BotIcon as BotIcon2,
|
|
3699
|
-
BrainCircuitIcon,
|
|
3842
|
+
BrainCircuitIcon as BrainCircuitIcon2,
|
|
3700
3843
|
BrainIcon,
|
|
3701
3844
|
SquareTerminalIcon
|
|
3702
3845
|
} from "lucide-react";
|
|
3703
|
-
import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as
|
|
3846
|
+
import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
|
|
3704
3847
|
import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
|
|
3705
3848
|
|
|
3706
3849
|
// src/timeline/entrance.tsx
|
|
3707
|
-
import { createContext as
|
|
3708
|
-
var EntranceAnimationContext =
|
|
3850
|
+
import { createContext as createContext3, useContext as useContext3, useRef as useRef5 } from "react";
|
|
3851
|
+
var EntranceAnimationContext = createContext3(true);
|
|
3709
3852
|
var EntranceAnimationProvider = EntranceAnimationContext.Provider;
|
|
3710
3853
|
function useEntranceAnimationLive() {
|
|
3711
|
-
return
|
|
3854
|
+
return useContext3(EntranceAnimationContext);
|
|
3712
3855
|
}
|
|
3713
3856
|
function useEntranceAnimation() {
|
|
3714
|
-
const enabled =
|
|
3715
|
-
const captured =
|
|
3857
|
+
const enabled = useContext3(EntranceAnimationContext);
|
|
3858
|
+
const captured = useRef5(enabled);
|
|
3716
3859
|
return captured.current;
|
|
3717
3860
|
}
|
|
3718
3861
|
|
|
3719
3862
|
// src/timeline/seen-activity-ids.ts
|
|
3720
|
-
import { createContext as
|
|
3721
|
-
var SeenActivityIdsContext =
|
|
3863
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
3864
|
+
var SeenActivityIdsContext = createContext4(null);
|
|
3722
3865
|
var SeenActivityIdsProvider = SeenActivityIdsContext.Provider;
|
|
3723
3866
|
function useSeenActivityIds() {
|
|
3724
|
-
return
|
|
3867
|
+
return useContext4(SeenActivityIdsContext);
|
|
3725
3868
|
}
|
|
3726
3869
|
|
|
3727
3870
|
// src/timeline/activity-rail.tsx
|
|
3728
|
-
import { Fragment as Fragment4, jsx as
|
|
3871
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3729
3872
|
var LazyFleetDecisionRow = lazy3(() => import("./fleet-decision-row-GGCAT4E4.js"));
|
|
3730
3873
|
function familyOf(item) {
|
|
3731
3874
|
if (item.kind === "tool-call") {
|
|
@@ -3745,7 +3888,7 @@ function ActivityRail({
|
|
|
3745
3888
|
const enterLive = useEntranceAnimationLive();
|
|
3746
3889
|
const seenIds = useSeenActivityIds();
|
|
3747
3890
|
const enter = seenIds ? enterLive : enterMounted;
|
|
3748
|
-
const previousIdsRef =
|
|
3891
|
+
const previousIdsRef = useRef6(null);
|
|
3749
3892
|
const enteringIds = /* @__PURE__ */ new Set();
|
|
3750
3893
|
if (enter) {
|
|
3751
3894
|
for (const item of items) {
|
|
@@ -3766,7 +3909,7 @@ function ActivityRail({
|
|
|
3766
3909
|
}
|
|
3767
3910
|
}
|
|
3768
3911
|
});
|
|
3769
|
-
return /* @__PURE__ */
|
|
3912
|
+
return /* @__PURE__ */ jsx12(
|
|
3770
3913
|
"div",
|
|
3771
3914
|
{
|
|
3772
3915
|
className: cn(
|
|
@@ -3783,7 +3926,7 @@ function ActivityRail({
|
|
|
3783
3926
|
children: items.map((item, index) => {
|
|
3784
3927
|
const newFamily = index > 0 && familyOf(item) !== familyOf(items[index - 1]);
|
|
3785
3928
|
const row = renderActivity(item, toolRegistry, onOpenSession, onMemoryClick);
|
|
3786
|
-
return /* @__PURE__ */
|
|
3929
|
+
return /* @__PURE__ */ jsx12(
|
|
3787
3930
|
"div",
|
|
3788
3931
|
{
|
|
3789
3932
|
"data-og-timeline-row-anchor": "",
|
|
@@ -3802,19 +3945,19 @@ function assertNever(item) {
|
|
|
3802
3945
|
function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
|
|
3803
3946
|
switch (item.kind) {
|
|
3804
3947
|
case "reasoning":
|
|
3805
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsx12(ReasoningRow, { item });
|
|
3806
3949
|
case "tool-call": {
|
|
3807
3950
|
const Renderer = toolRegistry.resolve(item);
|
|
3808
|
-
return /* @__PURE__ */
|
|
3951
|
+
return /* @__PURE__ */ jsx12(Renderer, { item });
|
|
3809
3952
|
}
|
|
3810
3953
|
case "worker":
|
|
3811
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ jsx12(WorkerRow, { item, onOpenSession });
|
|
3812
3955
|
case "sandbox":
|
|
3813
|
-
return /* @__PURE__ */
|
|
3956
|
+
return /* @__PURE__ */ jsx12(SandboxRow, { item });
|
|
3814
3957
|
case "memory":
|
|
3815
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ jsx12(MemoryRow, { item, onMemoryClick });
|
|
3816
3959
|
case "fleet-decision":
|
|
3817
|
-
return /* @__PURE__ */
|
|
3960
|
+
return /* @__PURE__ */ jsx12(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx12(
|
|
3818
3961
|
LazyFleetDecisionRow,
|
|
3819
3962
|
{
|
|
3820
3963
|
item,
|
|
@@ -3829,15 +3972,15 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
|
|
|
3829
3972
|
}
|
|
3830
3973
|
}
|
|
3831
3974
|
function ReasoningRow({ item }) {
|
|
3832
|
-
return /* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ jsx12(
|
|
3833
3976
|
ActivityDisclosure,
|
|
3834
3977
|
{
|
|
3835
|
-
icon: /* @__PURE__ */
|
|
3978
|
+
icon: /* @__PURE__ */ jsx12(BrainIcon, { className: "size-3.5" }),
|
|
3836
3979
|
iconTone: "muted",
|
|
3837
|
-
title: item.streaming ? "Thinking" : /* @__PURE__ */
|
|
3980
|
+
title: item.streaming ? "Thinking" : /* @__PURE__ */ jsx12("span", { className: "font-normal italic text-og-fg-subtle", children: "Thought" }),
|
|
3838
3981
|
running: item.streaming,
|
|
3839
3982
|
preview: truncate(item.text, 110),
|
|
3840
|
-
children: /* @__PURE__ */
|
|
3983
|
+
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 }) })
|
|
3841
3984
|
}
|
|
3842
3985
|
);
|
|
3843
3986
|
}
|
|
@@ -3857,37 +4000,37 @@ function MemoryRow({
|
|
|
3857
4000
|
const superseded = corrected && Boolean(item.replacementPreview);
|
|
3858
4001
|
const targetId = corrected ? item.replacementMemoryId ?? item.memoryId : item.memoryId;
|
|
3859
4002
|
const deepLink = Boolean(onMemoryClick);
|
|
3860
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ jsxs10(
|
|
3861
4004
|
ActivityDisclosure,
|
|
3862
4005
|
{
|
|
3863
|
-
icon: /* @__PURE__ */
|
|
4006
|
+
icon: /* @__PURE__ */ jsx12(BrainCircuitIcon2, { className: "size-3.5" }),
|
|
3864
4007
|
iconTone: "muted",
|
|
3865
|
-
title: /* @__PURE__ */
|
|
3866
|
-
/* @__PURE__ */
|
|
3867
|
-
kindLabel ? /* @__PURE__ */
|
|
4008
|
+
title: /* @__PURE__ */ jsxs10("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
|
|
4009
|
+
/* @__PURE__ */ jsx12("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
|
|
4010
|
+
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
|
|
3868
4011
|
] }),
|
|
3869
4012
|
preview: superseded ? item.replacementPreview : item.preview,
|
|
3870
4013
|
children: [
|
|
3871
4014
|
superseded ? (
|
|
3872
4015
|
// The correction as a before → after: the old memory struck through and
|
|
3873
4016
|
// dimmed, the new text in the ordinary body weight below it.
|
|
3874
|
-
/* @__PURE__ */
|
|
3875
|
-
/* @__PURE__ */
|
|
3876
|
-
/* @__PURE__ */
|
|
4017
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5", children: [
|
|
4018
|
+
/* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
|
|
4019
|
+
/* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.replacementPreview })
|
|
3877
4020
|
] })
|
|
3878
4021
|
) : corrected && item.action === "updated" ? (
|
|
3879
4022
|
// Edited in place, no replacement record: the memory is still live, so
|
|
3880
4023
|
// show its current text — NOT the archived treatment.
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
4025
|
+
/* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
|
|
4026
|
+
/* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Updated in place." })
|
|
3884
4027
|
] })
|
|
3885
4028
|
) : corrected ? (
|
|
3886
4029
|
// A correction with no replacement (and not an in-place update) archived the record.
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
-
) : /* @__PURE__ */
|
|
3889
|
-
item.deduped ? /* @__PURE__ */
|
|
3890
|
-
deepLink ? /* @__PURE__ */
|
|
4030
|
+
/* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Archived." })
|
|
4031
|
+
) : /* @__PURE__ */ jsx12("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
|
|
4032
|
+
item.deduped ? /* @__PURE__ */ jsx12(BodyNote, { tone: "muted", children: "Merged into an existing memory." }) : null,
|
|
4033
|
+
deepLink ? /* @__PURE__ */ jsxs10(
|
|
3891
4034
|
"button",
|
|
3892
4035
|
{
|
|
3893
4036
|
type: "button",
|
|
@@ -3898,7 +4041,7 @@ function MemoryRow({
|
|
|
3898
4041
|
),
|
|
3899
4042
|
children: [
|
|
3900
4043
|
"View in memory",
|
|
3901
|
-
/* @__PURE__ */
|
|
4044
|
+
/* @__PURE__ */ jsx12(ArrowRightIcon, { className: "size-3.5 transition-transform duration-150 group-hover/memlink:translate-x-0.5" })
|
|
3902
4045
|
]
|
|
3903
4046
|
}
|
|
3904
4047
|
) : null
|
|
@@ -3918,10 +4061,10 @@ function sandboxRowTitle(item) {
|
|
|
3918
4061
|
return toolDisplayName(item.name);
|
|
3919
4062
|
}
|
|
3920
4063
|
function SandboxRow({ item }) {
|
|
3921
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsxs10(
|
|
3922
4065
|
ActivityDisclosure,
|
|
3923
4066
|
{
|
|
3924
|
-
icon: /* @__PURE__ */
|
|
4067
|
+
icon: /* @__PURE__ */ jsx12(SquareTerminalIcon, { className: "size-3.5" }),
|
|
3925
4068
|
iconTone: item.status === "failed" ? "failed" : item.status === "running" ? "running" : "muted",
|
|
3926
4069
|
title: sandboxRowTitle(item),
|
|
3927
4070
|
running: item.status === "running",
|
|
@@ -3929,8 +4072,8 @@ function SandboxRow({ item }) {
|
|
|
3929
4072
|
cancelled: item.status === "cancelled",
|
|
3930
4073
|
preview: item.command ?? void 0,
|
|
3931
4074
|
children: [
|
|
3932
|
-
item.command ? /* @__PURE__ */
|
|
3933
|
-
item.output ? /* @__PURE__ */
|
|
4075
|
+
item.command ? /* @__PURE__ */ jsx12(PayloadBlock, { label: "Command", value: item.command }) : null,
|
|
4076
|
+
item.output ? /* @__PURE__ */ jsx12(PayloadBlock, { label: "Output", value: item.output }) : null
|
|
3934
4077
|
]
|
|
3935
4078
|
}
|
|
3936
4079
|
);
|
|
@@ -3945,11 +4088,11 @@ function WorkerRow({
|
|
|
3945
4088
|
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";
|
|
3946
4089
|
const sessionId = item.workerSessionId;
|
|
3947
4090
|
const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
|
|
3948
|
-
const inner = /* @__PURE__ */
|
|
3949
|
-
/* @__PURE__ */
|
|
3950
|
-
/* @__PURE__ */
|
|
3951
|
-
/* @__PURE__ */
|
|
3952
|
-
/* @__PURE__ */
|
|
4091
|
+
const inner = /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
4092
|
+
/* @__PURE__ */ jsx12("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
4093
|
+
/* @__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" }) }),
|
|
4094
|
+
/* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
|
|
4095
|
+
/* @__PURE__ */ jsx12(
|
|
3953
4096
|
"span",
|
|
3954
4097
|
{
|
|
3955
4098
|
className: cn(
|
|
@@ -3959,12 +4102,12 @@ function WorkerRow({
|
|
|
3959
4102
|
children: title
|
|
3960
4103
|
}
|
|
3961
4104
|
),
|
|
3962
|
-
item.prompt ? /* @__PURE__ */
|
|
4105
|
+
item.prompt ? /* @__PURE__ */ jsx12("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null
|
|
3963
4106
|
] }),
|
|
3964
|
-
failed ? /* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
4107
|
+
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: [
|
|
4108
|
+
/* @__PURE__ */ jsx12("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
|
|
3966
4109
|
"failed"
|
|
3967
|
-
] }) : cancelled ? /* @__PURE__ */
|
|
4110
|
+
] }) : 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(
|
|
3968
4111
|
ArrowRightIcon,
|
|
3969
4112
|
{
|
|
3970
4113
|
"aria-hidden": true,
|
|
@@ -3973,7 +4116,7 @@ function WorkerRow({
|
|
|
3973
4116
|
) : null
|
|
3974
4117
|
] });
|
|
3975
4118
|
if (deepLink && sessionId && onOpenSession) {
|
|
3976
|
-
return /* @__PURE__ */
|
|
4119
|
+
return /* @__PURE__ */ jsx12(
|
|
3977
4120
|
"button",
|
|
3978
4121
|
{
|
|
3979
4122
|
type: "button",
|
|
@@ -3987,28 +4130,28 @@ function WorkerRow({
|
|
|
3987
4130
|
}
|
|
3988
4131
|
);
|
|
3989
4132
|
}
|
|
3990
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsx12("div", { className: "flex items-start gap-2 px-1.5 py-1.5", children: inner });
|
|
3991
4134
|
}
|
|
3992
4135
|
|
|
3993
4136
|
// src/timeline/turn-summary.tsx
|
|
3994
4137
|
import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
|
|
3995
4138
|
import {
|
|
3996
4139
|
Component,
|
|
3997
|
-
createContext as
|
|
3998
|
-
useContext as
|
|
3999
|
-
useEffect as
|
|
4140
|
+
createContext as createContext6,
|
|
4141
|
+
useContext as useContext6,
|
|
4142
|
+
useEffect as useEffect7,
|
|
4000
4143
|
useMemo as useMemo3,
|
|
4001
|
-
useRef as
|
|
4002
|
-
useState as
|
|
4144
|
+
useRef as useRef7,
|
|
4145
|
+
useState as useState10
|
|
4003
4146
|
} from "react";
|
|
4004
|
-
import { Collapsible
|
|
4147
|
+
import { Collapsible } from "radix-ui";
|
|
4005
4148
|
|
|
4006
4149
|
// src/timeline/fold-memory.ts
|
|
4007
|
-
import { createContext as
|
|
4008
|
-
var FoldMemoryContext =
|
|
4150
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
4151
|
+
var FoldMemoryContext = createContext5(null);
|
|
4009
4152
|
var FoldMemoryProvider = FoldMemoryContext.Provider;
|
|
4010
4153
|
function useFoldMemory() {
|
|
4011
|
-
return
|
|
4154
|
+
return useContext5(FoldMemoryContext);
|
|
4012
4155
|
}
|
|
4013
4156
|
function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
4014
4157
|
if (memory.has(targetKey) || sourceKeys.length !== 1) {
|
|
@@ -4021,10 +4164,10 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
|
4021
4164
|
}
|
|
4022
4165
|
|
|
4023
4166
|
// src/timeline/turn-summary.tsx
|
|
4024
|
-
import { Fragment as Fragment5, jsx as
|
|
4025
|
-
var TurnSettleChromeContext =
|
|
4167
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4168
|
+
var TurnSettleChromeContext = createContext6(false);
|
|
4026
4169
|
function useTurnSettleOpen() {
|
|
4027
|
-
return
|
|
4170
|
+
return useContext6(TurnSettleChromeContext);
|
|
4028
4171
|
}
|
|
4029
4172
|
var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
|
|
4030
4173
|
"steps",
|
|
@@ -4057,16 +4200,16 @@ function TurnSummary({
|
|
|
4057
4200
|
const remembered = foldKey !== void 0 ? foldMemory?.get(foldKey) : void 0;
|
|
4058
4201
|
const restingOpen = remembered === "closed" ? false : remembered === "open" ? true : defaultOpen ?? forcedDefaultOpen ?? false;
|
|
4059
4202
|
const initialSettle = Boolean(settleFold) && !restingOpen && remembered === void 0;
|
|
4060
|
-
const [settling, setSettling] =
|
|
4061
|
-
const [open, setOpen] =
|
|
4062
|
-
const [settlePhase, setSettlePhase] =
|
|
4063
|
-
const [nestSuppressLatch, setNestSuppressLatch] =
|
|
4064
|
-
const [expandReady, setExpandReady] =
|
|
4065
|
-
const settleTimerRef =
|
|
4066
|
-
const settleCloseDoneRef =
|
|
4067
|
-
const nestLatchClearRef =
|
|
4068
|
-
const settleFoldSeenRef =
|
|
4069
|
-
const settleArmedRef =
|
|
4203
|
+
const [settling, setSettling] = useState10(initialSettle);
|
|
4204
|
+
const [open, setOpen] = useState10(initialSettle ? true : restingOpen);
|
|
4205
|
+
const [settlePhase, setSettlePhase] = useState10(initialSettle);
|
|
4206
|
+
const [nestSuppressLatch, setNestSuppressLatch] = useState10(initialSettle);
|
|
4207
|
+
const [expandReady, setExpandReady] = useState10(!initialSettle);
|
|
4208
|
+
const settleTimerRef = useRef7(null);
|
|
4209
|
+
const settleCloseDoneRef = useRef7(null);
|
|
4210
|
+
const nestLatchClearRef = useRef7(null);
|
|
4211
|
+
const settleFoldSeenRef = useRef7(Boolean(settleFold));
|
|
4212
|
+
const settleArmedRef = useRef7(false);
|
|
4070
4213
|
const clearNestLatchTimer = () => {
|
|
4071
4214
|
if (nestLatchClearRef.current !== null) {
|
|
4072
4215
|
clearTimeout(nestLatchClearRef.current);
|
|
@@ -4114,8 +4257,8 @@ function TurnSummary({
|
|
|
4114
4257
|
}, SETTLE_COLLAPSE_MS);
|
|
4115
4258
|
}, SETTLE_FOLD_BEAT_MS);
|
|
4116
4259
|
};
|
|
4117
|
-
const mountSettleRef =
|
|
4118
|
-
|
|
4260
|
+
const mountSettleRef = useRef7(initialSettle);
|
|
4261
|
+
useEffect7(() => {
|
|
4119
4262
|
if (mountSettleRef.current) {
|
|
4120
4263
|
armSettleCollapse();
|
|
4121
4264
|
}
|
|
@@ -4124,7 +4267,7 @@ function TurnSummary({
|
|
|
4124
4267
|
settleArmedRef.current = false;
|
|
4125
4268
|
};
|
|
4126
4269
|
}, []);
|
|
4127
|
-
|
|
4270
|
+
useEffect7(() => {
|
|
4128
4271
|
const was = settleFoldSeenRef.current;
|
|
4129
4272
|
settleFoldSeenRef.current = Boolean(settleFold);
|
|
4130
4273
|
if (!was && settleFold) {
|
|
@@ -4159,7 +4302,7 @@ function TurnSummary({
|
|
|
4159
4302
|
}
|
|
4160
4303
|
};
|
|
4161
4304
|
const enter = useEntranceAnimation();
|
|
4162
|
-
const [allowEnterAnimation] =
|
|
4305
|
+
const [allowEnterAnimation] = useState10(
|
|
4163
4306
|
() => Boolean(enter && !bare && !initialSettle && !restingOpen)
|
|
4164
4307
|
);
|
|
4165
4308
|
const context = useMemo3(
|
|
@@ -4192,16 +4335,16 @@ function TurnSummary({
|
|
|
4192
4335
|
const copyable = Boolean(
|
|
4193
4336
|
copyText && copyText.trim().length > 0 && !bare && !liveShell && !open && !settlePhase
|
|
4194
4337
|
);
|
|
4195
|
-
return /* @__PURE__ */
|
|
4196
|
-
/* @__PURE__ */
|
|
4197
|
-
|
|
4338
|
+
return /* @__PURE__ */ jsx13(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs11("div", { className: cn(copyable && "group/copy relative"), children: [
|
|
4339
|
+
/* @__PURE__ */ jsxs11(
|
|
4340
|
+
Collapsible.Root,
|
|
4198
4341
|
{
|
|
4199
4342
|
open,
|
|
4200
4343
|
onOpenChange,
|
|
4201
4344
|
className: allowEnterAnimation && !liveShell ? "animate-og-enter" : void 0,
|
|
4202
4345
|
children: [
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
|
|
4346
|
+
/* @__PURE__ */ jsxs11(
|
|
4347
|
+
Collapsible.Trigger,
|
|
4205
4348
|
{
|
|
4206
4349
|
className: cn(
|
|
4207
4350
|
settling && "animate-og-settle-chip",
|
|
@@ -4220,10 +4363,10 @@ function TurnSummary({
|
|
|
4220
4363
|
// faint red hover wash so attention still lands there; every other
|
|
4221
4364
|
// outcome gets the neutral surface hover.
|
|
4222
4365
|
outcome === "failed" ? "hover:bg-og-status-failed/[0.06] hover:text-og-fg" : "hover:bg-og-surface-1 hover:text-og-fg",
|
|
4223
|
-
liveShell && "
|
|
4366
|
+
liveShell && "text-og-fg-subtle"
|
|
4224
4367
|
),
|
|
4225
4368
|
children: [
|
|
4226
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ jsx13(
|
|
4227
4370
|
ChevronRightIcon2,
|
|
4228
4371
|
{
|
|
4229
4372
|
className: cn(
|
|
@@ -4232,7 +4375,7 @@ function TurnSummary({
|
|
|
4232
4375
|
)
|
|
4233
4376
|
}
|
|
4234
4377
|
),
|
|
4235
|
-
outcome === "complete" ? null : /* @__PURE__ */
|
|
4378
|
+
outcome === "complete" ? null : /* @__PURE__ */ jsx13(
|
|
4236
4379
|
"span",
|
|
4237
4380
|
{
|
|
4238
4381
|
className: cn(
|
|
@@ -4240,30 +4383,30 @@ function TurnSummary({
|
|
|
4240
4383
|
bare ? "size-3.5" : "size-5",
|
|
4241
4384
|
outcome === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"
|
|
4242
4385
|
),
|
|
4243
|
-
children: outcome === "failed" ? /* @__PURE__ */
|
|
4386
|
+
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" })
|
|
4244
4387
|
}
|
|
4245
4388
|
),
|
|
4246
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ jsxs11(
|
|
4247
4390
|
"span",
|
|
4248
4391
|
{
|
|
4249
4392
|
className: cn("min-w-0 flex-1 truncate", bare ? "text-og-sm" : "text-og-fg-muted"),
|
|
4250
4393
|
children: [
|
|
4251
|
-
facets.map(({ facet, result }, index) => /* @__PURE__ */
|
|
4394
|
+
facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx13(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
4252
4395
|
index > 0 ? " \xB7 " : null,
|
|
4253
|
-
/* @__PURE__ */
|
|
4254
|
-
result.icon ? /* @__PURE__ */
|
|
4396
|
+
/* @__PURE__ */ jsxs11("span", { "aria-label": result.ariaLabel, title: result.title, children: [
|
|
4397
|
+
result.icon ? /* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
|
|
4255
4398
|
result.content
|
|
4256
4399
|
] })
|
|
4257
4400
|
] }) }, facet.id)),
|
|
4258
|
-
outcome === "failed" && failureText ? /* @__PURE__ */
|
|
4401
|
+
outcome === "failed" && failureText ? /* @__PURE__ */ jsxs11("span", { className: "text-og-status-failed", children: [
|
|
4259
4402
|
" \xB7 ",
|
|
4260
4403
|
failureText
|
|
4261
4404
|
] }) : null,
|
|
4262
|
-
outcome === "cancelled" ? /* @__PURE__ */
|
|
4405
|
+
outcome === "cancelled" ? /* @__PURE__ */ jsx13("span", { className: "text-og-fg-subtle", children: " \xB7 interrupted" }) : null
|
|
4263
4406
|
]
|
|
4264
4407
|
}
|
|
4265
4408
|
),
|
|
4266
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ jsx13(
|
|
4267
4410
|
"span",
|
|
4268
4411
|
{
|
|
4269
4412
|
"aria-hidden": true,
|
|
@@ -4280,8 +4423,8 @@ function TurnSummary({
|
|
|
4280
4423
|
]
|
|
4281
4424
|
}
|
|
4282
4425
|
),
|
|
4283
|
-
/* @__PURE__ */
|
|
4284
|
-
|
|
4426
|
+
/* @__PURE__ */ jsx13(
|
|
4427
|
+
Collapsible.Content,
|
|
4285
4428
|
{
|
|
4286
4429
|
...nestSuppressLatch ? { forceMount: true } : {},
|
|
4287
4430
|
"data-og-fold-content": "",
|
|
@@ -4291,13 +4434,13 @@ function TurnSummary({
|
|
|
4291
4434
|
// Auto-close: slow settle. Manual close (settlePhase cleared): fast.
|
|
4292
4435
|
settlePhase ? "data-[state=closed]:animate-og-settle-collapse" : "data-[state=closed]:animate-og-collapse"
|
|
4293
4436
|
),
|
|
4294
|
-
children: /* @__PURE__ */
|
|
4437
|
+
children: /* @__PURE__ */ jsx13("div", { className: bare ? "pt-1 pl-5" : "pt-2", children })
|
|
4295
4438
|
}
|
|
4296
4439
|
)
|
|
4297
4440
|
]
|
|
4298
4441
|
}
|
|
4299
4442
|
),
|
|
4300
|
-
copyable ? /* @__PURE__ */
|
|
4443
|
+
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
|
|
4301
4444
|
] }) });
|
|
4302
4445
|
}
|
|
4303
4446
|
function createTurnSummaryContext(items, outcome, failureText, durationMs, contextCompactionCount) {
|
|
@@ -4450,7 +4593,7 @@ function formatDurationFacet(durationMs) {
|
|
|
4450
4593
|
}
|
|
4451
4594
|
|
|
4452
4595
|
// src/components/session-status.tsx
|
|
4453
|
-
import { jsx as
|
|
4596
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4454
4597
|
var SESSION_STATUS_META = {
|
|
4455
4598
|
queued: {
|
|
4456
4599
|
label: "Queued",
|
|
@@ -4503,7 +4646,7 @@ var SESSION_STATUS_META = {
|
|
|
4503
4646
|
};
|
|
4504
4647
|
function SessionStatus({ status, label, size = "md", className }) {
|
|
4505
4648
|
const meta = SESSION_STATUS_META[status];
|
|
4506
|
-
return /* @__PURE__ */
|
|
4649
|
+
return /* @__PURE__ */ jsxs12(
|
|
4507
4650
|
"span",
|
|
4508
4651
|
{
|
|
4509
4652
|
"data-status": status,
|
|
@@ -4514,7 +4657,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
4514
4657
|
className
|
|
4515
4658
|
),
|
|
4516
4659
|
children: [
|
|
4517
|
-
/* @__PURE__ */
|
|
4660
|
+
/* @__PURE__ */ jsx14(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
|
|
4518
4661
|
label ?? meta.label
|
|
4519
4662
|
]
|
|
4520
4663
|
}
|
|
@@ -4522,7 +4665,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
4522
4665
|
}
|
|
4523
4666
|
function StatusDot({ status, className }) {
|
|
4524
4667
|
const meta = SESSION_STATUS_META[status];
|
|
4525
|
-
return /* @__PURE__ */
|
|
4668
|
+
return /* @__PURE__ */ jsx14(
|
|
4526
4669
|
"span",
|
|
4527
4670
|
{
|
|
4528
4671
|
className: cn(
|
|
@@ -4530,7 +4673,7 @@ function StatusDot({ status, className }) {
|
|
|
4530
4673
|
meta.dotClassName,
|
|
4531
4674
|
className
|
|
4532
4675
|
),
|
|
4533
|
-
children: meta.pulse ? /* @__PURE__ */
|
|
4676
|
+
children: meta.pulse ? /* @__PURE__ */ jsx14("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
|
|
4534
4677
|
}
|
|
4535
4678
|
);
|
|
4536
4679
|
}
|
|
@@ -4550,21 +4693,21 @@ import {
|
|
|
4550
4693
|
PlayIcon as PlayIcon2,
|
|
4551
4694
|
RefreshCwIcon,
|
|
4552
4695
|
ShrinkIcon,
|
|
4553
|
-
TargetIcon,
|
|
4696
|
+
TargetIcon as TargetIcon2,
|
|
4554
4697
|
Trash2Icon as Trash2Icon2,
|
|
4555
4698
|
TriangleAlertIcon as TriangleAlertIcon3,
|
|
4556
4699
|
XCircleIcon
|
|
4557
4700
|
} from "lucide-react";
|
|
4558
4701
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
|
|
4559
|
-
import { Collapsible as
|
|
4702
|
+
import { Collapsible as Collapsible2 } from "radix-ui";
|
|
4560
4703
|
import {
|
|
4561
4704
|
memo as memo2,
|
|
4562
4705
|
useCallback as useCallback2,
|
|
4563
|
-
useEffect as
|
|
4706
|
+
useEffect as useEffect8,
|
|
4564
4707
|
useLayoutEffect as useLayoutEffect3,
|
|
4565
4708
|
useMemo as useMemo4,
|
|
4566
|
-
useRef as
|
|
4567
|
-
useState as
|
|
4709
|
+
useRef as useRef8,
|
|
4710
|
+
useState as useState11
|
|
4568
4711
|
} from "react";
|
|
4569
4712
|
|
|
4570
4713
|
// src/components/tip-follow.ts
|
|
@@ -4587,6 +4730,13 @@ var TIP_FOLLOW_VELOCITY_REF_PX_S = _s(420);
|
|
|
4587
4730
|
var TIP_FOLLOW_VELOCITY_ARM_DEBT_PX = 72;
|
|
4588
4731
|
var TIP_FOLLOW_VELOCITY_DECAY_MS = _t(180);
|
|
4589
4732
|
var TIP_FOLLOW_READER_UP_EPS_PX = 2;
|
|
4733
|
+
var scrollEndSupportOverride = null;
|
|
4734
|
+
function supportsScrollEndEvent() {
|
|
4735
|
+
if (scrollEndSupportOverride !== null) {
|
|
4736
|
+
return scrollEndSupportOverride;
|
|
4737
|
+
}
|
|
4738
|
+
return typeof HTMLElement !== "undefined" && "onscrollend" in HTMLElement.prototype;
|
|
4739
|
+
}
|
|
4590
4740
|
function readerScrollUpPx(prevTop, nextTop, prevMaxScroll, nextMaxScroll) {
|
|
4591
4741
|
const topDelta = prevTop - nextTop;
|
|
4592
4742
|
const clampBudget = Math.max(0, prevMaxScroll - nextMaxScroll);
|
|
@@ -4761,7 +4911,7 @@ function tipFollowStep(state, input) {
|
|
|
4761
4911
|
}
|
|
4762
4912
|
|
|
4763
4913
|
// src/components/message-timeline.tsx
|
|
4764
|
-
import { Fragment as Fragment6, jsx as
|
|
4914
|
+
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4765
4915
|
var PIN_THRESHOLD_PX = 48;
|
|
4766
4916
|
var OLDER_PREFETCH_MARGIN_PX = 400;
|
|
4767
4917
|
var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
|
|
@@ -4827,35 +4977,38 @@ function MessageTimeline({
|
|
|
4827
4977
|
const resolvedItems = useMemo4(() => items ?? buildTimeline(events ?? []), [items, events]);
|
|
4828
4978
|
const allGroups = useMemo4(() => groupTimeline(resolvedItems), [resolvedItems]);
|
|
4829
4979
|
const groups = useStableTimelineGroupKeys(allGroups);
|
|
4830
|
-
const scrollRef =
|
|
4831
|
-
const topSentinelRef =
|
|
4832
|
-
const bottomSentinelRef =
|
|
4833
|
-
const previousBulkFirstKeyRef =
|
|
4834
|
-
const [pinned, setPinned] =
|
|
4835
|
-
const [bulkActive, setBulkActive] =
|
|
4836
|
-
const olderPrefetchArmedRef =
|
|
4837
|
-
const [olderPrefetchArmed, setOlderPrefetchArmed] =
|
|
4838
|
-
const olderLoadGateRef =
|
|
4839
|
-
const resizeFollowRafRef =
|
|
4980
|
+
const scrollRef = useRef8(null);
|
|
4981
|
+
const topSentinelRef = useRef8(null);
|
|
4982
|
+
const bottomSentinelRef = useRef8(null);
|
|
4983
|
+
const previousBulkFirstKeyRef = useRef8(void 0);
|
|
4984
|
+
const [pinned, setPinned] = useState11(true);
|
|
4985
|
+
const [bulkActive, setBulkActive] = useState11(true);
|
|
4986
|
+
const olderPrefetchArmedRef = useRef8(false);
|
|
4987
|
+
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState11(false);
|
|
4988
|
+
const olderLoadGateRef = useRef8("armed");
|
|
4989
|
+
const resizeFollowRafRef = useRef8(null);
|
|
4840
4990
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
4841
|
-
const [revealed, setRevealed] =
|
|
4842
|
-
const pinnedRef =
|
|
4843
|
-
const hasNewerRef =
|
|
4991
|
+
const [revealed, setRevealed] = useState11(false);
|
|
4992
|
+
const pinnedRef = useRef8(true);
|
|
4993
|
+
const hasNewerRef = useRef8(hasNewer);
|
|
4844
4994
|
hasNewerRef.current = hasNewer;
|
|
4845
|
-
const wantPinRef =
|
|
4846
|
-
const pendingJumpToStartRef =
|
|
4847
|
-
const jumpToStartSeqRef =
|
|
4848
|
-
const previousFirstItemIdRef =
|
|
4849
|
-
const previousScrollHeightRef =
|
|
4850
|
-
const lastScrollTopRef =
|
|
4851
|
-
const lastMaxScrollRef =
|
|
4852
|
-
const lastScrollHeightRef =
|
|
4853
|
-
const lastClientHeightRef =
|
|
4854
|
-
const readerIntentArmRef =
|
|
4855
|
-
const
|
|
4856
|
-
const
|
|
4857
|
-
const
|
|
4858
|
-
const
|
|
4995
|
+
const wantPinRef = useRef8(false);
|
|
4996
|
+
const pendingJumpToStartRef = useRef8(false);
|
|
4997
|
+
const jumpToStartSeqRef = useRef8(0);
|
|
4998
|
+
const previousFirstItemIdRef = useRef8(null);
|
|
4999
|
+
const previousScrollHeightRef = useRef8(0);
|
|
5000
|
+
const lastScrollTopRef = useRef8(0);
|
|
5001
|
+
const lastMaxScrollRef = useRef8(0);
|
|
5002
|
+
const lastScrollHeightRef = useRef8(0);
|
|
5003
|
+
const lastClientHeightRef = useRef8(0);
|
|
5004
|
+
const readerIntentArmRef = useRef8(false);
|
|
5005
|
+
const programmaticScrollRef = useRef8(0);
|
|
5006
|
+
const pendingReaderLeaveRef = useRef8(false);
|
|
5007
|
+
const leaveFallbackRafRef = useRef8(null);
|
|
5008
|
+
const foldMemoryRef = useRef8(/* @__PURE__ */ new Map());
|
|
5009
|
+
const seenActivityIdsRef = useRef8(/* @__PURE__ */ new Set());
|
|
5010
|
+
const groupKeyByItemIdRef = useRef8(/* @__PURE__ */ new Map());
|
|
5011
|
+
const groupOffsetByKeyRef = useRef8(/* @__PURE__ */ new Map());
|
|
4859
5012
|
const firstItemId = resolvedItems[0]?.id ?? null;
|
|
4860
5013
|
const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
|
|
4861
5014
|
const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
|
|
@@ -4865,16 +5018,34 @@ function MessageTimeline({
|
|
|
4865
5018
|
setPinned(value);
|
|
4866
5019
|
}
|
|
4867
5020
|
}, []);
|
|
4868
|
-
const revealedRef =
|
|
5021
|
+
const revealedRef = useRef8(revealed);
|
|
4869
5022
|
revealedRef.current = revealed;
|
|
4870
|
-
const followRef =
|
|
4871
|
-
const followFrameRef =
|
|
5023
|
+
const followRef = useRef8(createTipFollowState());
|
|
5024
|
+
const followFrameRef = useRef8(null);
|
|
4872
5025
|
const syncScrollBaseline = useCallback2((node) => {
|
|
4873
5026
|
lastScrollTopRef.current = node.scrollTop;
|
|
4874
5027
|
lastMaxScrollRef.current = maxScrollOf(node);
|
|
4875
5028
|
lastScrollHeightRef.current = node.scrollHeight;
|
|
4876
5029
|
lastClientHeightRef.current = node.clientHeight;
|
|
4877
5030
|
}, []);
|
|
5031
|
+
const writeScrollTop = useCallback2((node, top) => {
|
|
5032
|
+
const next = Math.max(0, top);
|
|
5033
|
+
if (node.scrollTop === next) {
|
|
5034
|
+
return;
|
|
5035
|
+
}
|
|
5036
|
+
programmaticScrollRef.current += 1;
|
|
5037
|
+
node.scrollTop = next;
|
|
5038
|
+
}, []);
|
|
5039
|
+
const cancelLeaveFallback = useCallback2(() => {
|
|
5040
|
+
if (leaveFallbackRafRef.current !== null) {
|
|
5041
|
+
cancelFrame(leaveFallbackRafRef.current);
|
|
5042
|
+
leaveFallbackRafRef.current = null;
|
|
5043
|
+
}
|
|
5044
|
+
}, []);
|
|
5045
|
+
const clearPendingReaderLeave = useCallback2(() => {
|
|
5046
|
+
pendingReaderLeaveRef.current = false;
|
|
5047
|
+
cancelLeaveFallback();
|
|
5048
|
+
}, [cancelLeaveFallback]);
|
|
4878
5049
|
const stopFollow = useCallback2(() => {
|
|
4879
5050
|
followRef.current = tipFollowCancel(followRef.current);
|
|
4880
5051
|
if (followFrameRef.current !== null) {
|
|
@@ -4891,6 +5062,7 @@ function MessageTimeline({
|
|
|
4891
5062
|
return;
|
|
4892
5063
|
}
|
|
4893
5064
|
readerIntentArmRef.current = false;
|
|
5065
|
+
clearPendingReaderLeave();
|
|
4894
5066
|
stopFollow();
|
|
4895
5067
|
applyPinned(false);
|
|
4896
5068
|
if (wantPinRef.current) {
|
|
@@ -4901,8 +5073,43 @@ function MessageTimeline({
|
|
|
4901
5073
|
setOlderPrefetchArmed(true);
|
|
4902
5074
|
}
|
|
4903
5075
|
},
|
|
4904
|
-
[autoFollow, applyPinned, stopFollow]
|
|
5076
|
+
[autoFollow, applyPinned, clearPendingReaderLeave, stopFollow]
|
|
4905
5077
|
);
|
|
5078
|
+
const releasePinAfterScrollSettled = useCallback2(
|
|
5079
|
+
(node) => {
|
|
5080
|
+
if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
|
|
5081
|
+
return;
|
|
5082
|
+
}
|
|
5083
|
+
if (programmaticScrollRef.current > 0) {
|
|
5084
|
+
return;
|
|
5085
|
+
}
|
|
5086
|
+
if (followRef.current.running || followFrameRef.current !== null) {
|
|
5087
|
+
return;
|
|
5088
|
+
}
|
|
5089
|
+
if (isNearBottom(node) || maxScrollOf(node) <= 1) {
|
|
5090
|
+
clearPendingReaderLeave();
|
|
5091
|
+
return;
|
|
5092
|
+
}
|
|
5093
|
+
releasePinFromReader(node);
|
|
5094
|
+
if (olderLoadGateRef.current === "cooling" && node.scrollTop > OLDER_PREFETCH_MARGIN_PX) {
|
|
5095
|
+
olderLoadGateRef.current = "armed";
|
|
5096
|
+
}
|
|
5097
|
+
},
|
|
5098
|
+
[autoFollow, clearPendingReaderLeave, releasePinFromReader]
|
|
5099
|
+
);
|
|
5100
|
+
const scheduleLeaveFallback = useCallback2(() => {
|
|
5101
|
+
if (supportsScrollEndEvent()) {
|
|
5102
|
+
return;
|
|
5103
|
+
}
|
|
5104
|
+
cancelLeaveFallback();
|
|
5105
|
+
leaveFallbackRafRef.current = requestFrame(() => {
|
|
5106
|
+
leaveFallbackRafRef.current = null;
|
|
5107
|
+
const current = scrollRef.current;
|
|
5108
|
+
if (current) {
|
|
5109
|
+
releasePinAfterScrollSettled(current);
|
|
5110
|
+
}
|
|
5111
|
+
});
|
|
5112
|
+
}, [cancelLeaveFallback, releasePinAfterScrollSettled]);
|
|
4906
5113
|
const onWheel = (event) => {
|
|
4907
5114
|
if (event.deltaY >= 0) {
|
|
4908
5115
|
return;
|
|
@@ -4935,22 +5142,28 @@ function MessageTimeline({
|
|
|
4935
5142
|
const snapToBottom = useCallback2(
|
|
4936
5143
|
(node) => {
|
|
4937
5144
|
stopFollow();
|
|
4938
|
-
|
|
5145
|
+
cancelLeaveFallback();
|
|
5146
|
+
writeScrollTop(node, Math.max(0, node.scrollHeight - node.clientHeight));
|
|
4939
5147
|
syncScrollBaseline(node);
|
|
4940
5148
|
followRef.current = {
|
|
4941
5149
|
...followRef.current,
|
|
4942
5150
|
lastHeight: node.scrollHeight
|
|
4943
5151
|
};
|
|
4944
5152
|
},
|
|
4945
|
-
[stopFollow, syncScrollBaseline]
|
|
5153
|
+
[cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
4946
5154
|
);
|
|
4947
|
-
const driveFollowRef =
|
|
5155
|
+
const driveFollowRef = useRef8(() => void 0);
|
|
4948
5156
|
const driveFollow = useCallback2(
|
|
4949
5157
|
(node, nowMs) => {
|
|
4950
5158
|
if (!pinnedRef.current || hasNewerRef.current) {
|
|
4951
5159
|
stopFollow();
|
|
4952
5160
|
return;
|
|
4953
5161
|
}
|
|
5162
|
+
if (pendingReaderLeaveRef.current) {
|
|
5163
|
+
stopFollow();
|
|
5164
|
+
return;
|
|
5165
|
+
}
|
|
5166
|
+
cancelLeaveFallback();
|
|
4954
5167
|
const now = typeof nowMs === "number" ? nowMs : typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
4955
5168
|
const previousHeight = followRef.current.lastHeight;
|
|
4956
5169
|
if (previousHeight > 0 && node.scrollHeight < previousHeight - TIP_FOLLOW_SHRINK_EPS_PX) {
|
|
@@ -4960,9 +5173,7 @@ function MessageTimeline({
|
|
|
4960
5173
|
node.scrollHeight,
|
|
4961
5174
|
node.clientHeight
|
|
4962
5175
|
);
|
|
4963
|
-
|
|
4964
|
-
node.scrollTop = nextTop;
|
|
4965
|
-
}
|
|
5176
|
+
writeScrollTop(node, nextTop);
|
|
4966
5177
|
syncScrollBaseline(node);
|
|
4967
5178
|
followRef.current = {
|
|
4968
5179
|
...followRef.current,
|
|
@@ -4997,11 +5208,10 @@ function MessageTimeline({
|
|
|
4997
5208
|
revealed: revealedRef.current
|
|
4998
5209
|
});
|
|
4999
5210
|
followRef.current = result.state;
|
|
5000
|
-
|
|
5001
|
-
node.scrollTop = result.scrollTop;
|
|
5002
|
-
}
|
|
5211
|
+
writeScrollTop(node, result.scrollTop);
|
|
5003
5212
|
syncScrollBaseline(node);
|
|
5004
5213
|
if (result.state.running) {
|
|
5214
|
+
cancelLeaveFallback();
|
|
5005
5215
|
if (followFrameRef.current === null) {
|
|
5006
5216
|
followFrameRef.current = requestFrame((frameNow) => {
|
|
5007
5217
|
followFrameRef.current = null;
|
|
@@ -5016,10 +5226,11 @@ function MessageTimeline({
|
|
|
5016
5226
|
followFrameRef.current = null;
|
|
5017
5227
|
}
|
|
5018
5228
|
},
|
|
5019
|
-
[stopFollow, syncScrollBaseline]
|
|
5229
|
+
[cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
5020
5230
|
);
|
|
5021
5231
|
driveFollowRef.current = driveFollow;
|
|
5022
|
-
|
|
5232
|
+
useEffect8(() => stopFollow, [stopFollow]);
|
|
5233
|
+
useEffect8(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
|
|
5023
5234
|
useLayoutEffect3(() => {
|
|
5024
5235
|
const node = scrollRef.current;
|
|
5025
5236
|
if (!node) {
|
|
@@ -5034,7 +5245,7 @@ function MessageTimeline({
|
|
|
5034
5245
|
if (pendingJumpToStartRef.current && firstItemChanged) {
|
|
5035
5246
|
pendingJumpToStartRef.current = false;
|
|
5036
5247
|
stopFollow();
|
|
5037
|
-
node
|
|
5248
|
+
writeScrollTop(node, 0);
|
|
5038
5249
|
} else if (wantPinRef.current && !hasNewer) {
|
|
5039
5250
|
wantPinRef.current = false;
|
|
5040
5251
|
if (autoFollow) {
|
|
@@ -5042,7 +5253,16 @@ function MessageTimeline({
|
|
|
5042
5253
|
snapToBottom(node);
|
|
5043
5254
|
}
|
|
5044
5255
|
} else if (autoFollow && pinnedRef.current && !hasNewer) {
|
|
5045
|
-
|
|
5256
|
+
if (!revealedRef.current) {
|
|
5257
|
+
snapToBottom(node);
|
|
5258
|
+
} else if (pendingReaderLeaveRef.current) {
|
|
5259
|
+
if (node.scrollHeight <= lastScrollHeightRef.current) {
|
|
5260
|
+
clearPendingReaderLeave();
|
|
5261
|
+
driveFollow(node);
|
|
5262
|
+
}
|
|
5263
|
+
} else {
|
|
5264
|
+
driveFollow(node);
|
|
5265
|
+
}
|
|
5046
5266
|
} else if (prepended) {
|
|
5047
5267
|
const anchorKey = previousFirstItemId !== null ? previousGroupKeyByItemId.get(previousFirstItemId) : void 0;
|
|
5048
5268
|
const previousAnchorTop = anchorKey !== void 0 ? previousGroupOffsetByKey.get(anchorKey) : void 0;
|
|
@@ -5063,7 +5283,7 @@ function MessageTimeline({
|
|
|
5063
5283
|
if (delta !== null) {
|
|
5064
5284
|
const expected = previousScrollTop + delta;
|
|
5065
5285
|
if (Math.abs(node.scrollTop - expected) > 2) {
|
|
5066
|
-
node
|
|
5286
|
+
writeScrollTop(node, expected);
|
|
5067
5287
|
}
|
|
5068
5288
|
}
|
|
5069
5289
|
}
|
|
@@ -5091,10 +5311,41 @@ function MessageTimeline({
|
|
|
5091
5311
|
}
|
|
5092
5312
|
groupOffsetByKeyRef.current = nextOffsetByKey;
|
|
5093
5313
|
}
|
|
5094
|
-
if (!revealed && groups.length > 0) {
|
|
5095
|
-
setRevealed(true);
|
|
5096
|
-
}
|
|
5097
5314
|
});
|
|
5315
|
+
useLayoutEffect3(() => {
|
|
5316
|
+
if (revealed || allGroups.length === 0) {
|
|
5317
|
+
return;
|
|
5318
|
+
}
|
|
5319
|
+
let cancelled = false;
|
|
5320
|
+
let frame2 = 0;
|
|
5321
|
+
const park = () => {
|
|
5322
|
+
const node = scrollRef.current;
|
|
5323
|
+
if (node && autoFollow && pinnedRef.current && !hasNewerRef.current) {
|
|
5324
|
+
snapToBottom(node);
|
|
5325
|
+
}
|
|
5326
|
+
};
|
|
5327
|
+
park();
|
|
5328
|
+
const frame1 = requestFrame(() => {
|
|
5329
|
+
if (cancelled) {
|
|
5330
|
+
return;
|
|
5331
|
+
}
|
|
5332
|
+
park();
|
|
5333
|
+
frame2 = requestFrame(() => {
|
|
5334
|
+
if (cancelled) {
|
|
5335
|
+
return;
|
|
5336
|
+
}
|
|
5337
|
+
park();
|
|
5338
|
+
setRevealed(true);
|
|
5339
|
+
});
|
|
5340
|
+
});
|
|
5341
|
+
return () => {
|
|
5342
|
+
cancelled = true;
|
|
5343
|
+
cancelFrame(frame1);
|
|
5344
|
+
if (frame2 !== 0) {
|
|
5345
|
+
cancelFrame(frame2);
|
|
5346
|
+
}
|
|
5347
|
+
};
|
|
5348
|
+
}, [revealed, allGroups.length, autoFollow, snapToBottom]);
|
|
5098
5349
|
useLayoutEffect3(() => {
|
|
5099
5350
|
if (allGroups.length > 0) {
|
|
5100
5351
|
return;
|
|
@@ -5130,7 +5381,7 @@ function MessageTimeline({
|
|
|
5130
5381
|
const frame = requestFrame(() => setBulkActive(false));
|
|
5131
5382
|
return () => cancelFrame(frame);
|
|
5132
5383
|
}, [bulkRender, firstGroupKey]);
|
|
5133
|
-
|
|
5384
|
+
useEffect8(() => {
|
|
5134
5385
|
const root = scrollRef.current;
|
|
5135
5386
|
const target = topSentinelRef.current;
|
|
5136
5387
|
if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
|
|
@@ -5154,7 +5405,7 @@ function MessageTimeline({
|
|
|
5154
5405
|
observer.observe(target);
|
|
5155
5406
|
return () => observer.disconnect();
|
|
5156
5407
|
}, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
|
|
5157
|
-
|
|
5408
|
+
useEffect8(() => {
|
|
5158
5409
|
const root = scrollRef.current;
|
|
5159
5410
|
const target = bottomSentinelRef.current;
|
|
5160
5411
|
if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
|
|
@@ -5171,7 +5422,7 @@ function MessageTimeline({
|
|
|
5171
5422
|
observer.observe(target);
|
|
5172
5423
|
return () => observer.disconnect();
|
|
5173
5424
|
}, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
|
|
5174
|
-
|
|
5425
|
+
useEffect8(() => {
|
|
5175
5426
|
const node = scrollRef.current;
|
|
5176
5427
|
const inner = node?.firstElementChild;
|
|
5177
5428
|
if (!node || !inner || typeof ResizeObserver === "undefined") {
|
|
@@ -5187,9 +5438,14 @@ function MessageTimeline({
|
|
|
5187
5438
|
if (!current) {
|
|
5188
5439
|
return;
|
|
5189
5440
|
}
|
|
5190
|
-
if (autoFollow
|
|
5191
|
-
|
|
5441
|
+
if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
|
|
5442
|
+
return;
|
|
5443
|
+
}
|
|
5444
|
+
if (!revealedRef.current) {
|
|
5445
|
+
snapToBottom(current);
|
|
5446
|
+
return;
|
|
5192
5447
|
}
|
|
5448
|
+
driveFollow(current);
|
|
5193
5449
|
});
|
|
5194
5450
|
});
|
|
5195
5451
|
observer.observe(inner);
|
|
@@ -5201,8 +5457,8 @@ function MessageTimeline({
|
|
|
5201
5457
|
resizeFollowRafRef.current = null;
|
|
5202
5458
|
}
|
|
5203
5459
|
};
|
|
5204
|
-
}, [autoFollow, driveFollow]);
|
|
5205
|
-
|
|
5460
|
+
}, [autoFollow, driveFollow, snapToBottom]);
|
|
5461
|
+
useEffect8(() => {
|
|
5206
5462
|
if (hasNewer) {
|
|
5207
5463
|
stopFollow();
|
|
5208
5464
|
applyPinned(false);
|
|
@@ -5238,14 +5494,30 @@ function MessageTimeline({
|
|
|
5238
5494
|
const maxFell = nextMaxScroll < previousMaxScroll - 1;
|
|
5239
5495
|
const readerArmed = readerIntentArmRef.current;
|
|
5240
5496
|
const heightShrunk = followRef.current.lastHeight > 0 && nextHeight < followRef.current.lastHeight - TIP_FOLLOW_SHRINK_EPS_PX;
|
|
5497
|
+
const programmatic = programmaticScrollRef.current > 0;
|
|
5498
|
+
if (programmatic) {
|
|
5499
|
+
programmaticScrollRef.current = 0;
|
|
5500
|
+
}
|
|
5241
5501
|
if (autoFollow && pinnedRef.current && !hasNewer) {
|
|
5242
5502
|
if (heightShrunk || maxFell) {
|
|
5243
5503
|
readerIntentArmRef.current = false;
|
|
5504
|
+
clearPendingReaderLeave();
|
|
5244
5505
|
driveFollow(node);
|
|
5245
5506
|
return;
|
|
5246
5507
|
}
|
|
5508
|
+
if (programmatic) {
|
|
5509
|
+
syncScrollBaseline(node);
|
|
5510
|
+
followRef.current = {
|
|
5511
|
+
...followRef.current,
|
|
5512
|
+
lastHeight: nextHeight
|
|
5513
|
+
};
|
|
5514
|
+
return;
|
|
5515
|
+
}
|
|
5247
5516
|
syncScrollBaseline(node);
|
|
5248
5517
|
const nearBottomPinned = isNearBottom(node);
|
|
5518
|
+
if (nearBottomPinned) {
|
|
5519
|
+
clearPendingReaderLeave();
|
|
5520
|
+
}
|
|
5249
5521
|
if (readerArmed && readerUp > TIP_FOLLOW_READER_UP_EPS_PX && !nearBottomPinned) {
|
|
5250
5522
|
readerIntentArmRef.current = false;
|
|
5251
5523
|
releasePinFromReader(node);
|
|
@@ -5254,8 +5526,13 @@ function MessageTimeline({
|
|
|
5254
5526
|
}
|
|
5255
5527
|
return;
|
|
5256
5528
|
}
|
|
5257
|
-
if (!nearBottomPinned
|
|
5258
|
-
|
|
5529
|
+
if (!nearBottomPinned && readerUp <= TIP_FOLLOW_READER_UP_EPS_PX) {
|
|
5530
|
+
if (!pendingReaderLeaveRef.current) {
|
|
5531
|
+
driveFollow(node);
|
|
5532
|
+
}
|
|
5533
|
+
} else if (!nearBottomPinned && readerUp > TIP_FOLLOW_READER_UP_EPS_PX) {
|
|
5534
|
+
pendingReaderLeaveRef.current = true;
|
|
5535
|
+
scheduleLeaveFallback();
|
|
5259
5536
|
} else {
|
|
5260
5537
|
followRef.current = {
|
|
5261
5538
|
...followRef.current,
|
|
@@ -5285,13 +5562,27 @@ function MessageTimeline({
|
|
|
5285
5562
|
olderLoadGateRef.current = "armed";
|
|
5286
5563
|
}
|
|
5287
5564
|
};
|
|
5288
|
-
|
|
5289
|
-
|
|
5565
|
+
const onScrollEnd = () => {
|
|
5566
|
+
const node = scrollRef.current;
|
|
5567
|
+
if (!node) {
|
|
5568
|
+
return;
|
|
5569
|
+
}
|
|
5570
|
+
cancelLeaveFallback();
|
|
5571
|
+
if (programmaticScrollRef.current > 0) {
|
|
5572
|
+
programmaticScrollRef.current = 0;
|
|
5573
|
+
syncScrollBaseline(node);
|
|
5574
|
+
return;
|
|
5575
|
+
}
|
|
5576
|
+
releasePinAfterScrollSettled(node);
|
|
5577
|
+
};
|
|
5578
|
+
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: [
|
|
5579
|
+
/* @__PURE__ */ jsx15(
|
|
5290
5580
|
"div",
|
|
5291
5581
|
{
|
|
5292
5582
|
ref: scrollRef,
|
|
5293
5583
|
tabIndex: -1,
|
|
5294
5584
|
onScroll,
|
|
5585
|
+
onScrollEnd,
|
|
5295
5586
|
onWheel,
|
|
5296
5587
|
onPointerDown,
|
|
5297
5588
|
onKeyDown,
|
|
@@ -5302,12 +5593,12 @@ function MessageTimeline({
|
|
|
5302
5593
|
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-6 outline-none",
|
|
5303
5594
|
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
5304
5595
|
),
|
|
5305
|
-
children: /* @__PURE__ */
|
|
5306
|
-
groups.length === 0 ? emptyState ?? /* @__PURE__ */
|
|
5596
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
5597
|
+
groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx15("p", { className: "py-10 text-center text-sm text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
5307
5598
|
hasOlder && olderPrefetchArmed ? (
|
|
5308
5599
|
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
5309
5600
|
// must never shift content (that shift was itself a wobble).
|
|
5310
|
-
/* @__PURE__ */
|
|
5601
|
+
/* @__PURE__ */ jsx15(
|
|
5311
5602
|
"div",
|
|
5312
5603
|
{
|
|
5313
5604
|
ref: topSentinelRef,
|
|
@@ -5321,7 +5612,7 @@ function MessageTimeline({
|
|
|
5321
5612
|
groups.map(({ group, key }, index) => {
|
|
5322
5613
|
const next = groups[index + 1]?.group;
|
|
5323
5614
|
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;
|
|
5324
|
-
return /* @__PURE__ */
|
|
5615
|
+
return /* @__PURE__ */ jsx15("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx15(
|
|
5325
5616
|
TimelineGroupView,
|
|
5326
5617
|
{
|
|
5327
5618
|
group,
|
|
@@ -5338,7 +5629,7 @@ function MessageTimeline({
|
|
|
5338
5629
|
}
|
|
5339
5630
|
) }, key);
|
|
5340
5631
|
}),
|
|
5341
|
-
hasNewer ? /* @__PURE__ */
|
|
5632
|
+
hasNewer ? /* @__PURE__ */ jsx15(
|
|
5342
5633
|
"div",
|
|
5343
5634
|
{
|
|
5344
5635
|
ref: bottomSentinelRef,
|
|
@@ -5351,10 +5642,10 @@ function MessageTimeline({
|
|
|
5351
5642
|
] })
|
|
5352
5643
|
}
|
|
5353
5644
|
),
|
|
5354
|
-
/* @__PURE__ */
|
|
5645
|
+
/* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
|
|
5355
5646
|
// Floating over the scroller (not a timeline row) so showing and
|
|
5356
5647
|
// hiding it never reflows history under the reader.
|
|
5357
|
-
/* @__PURE__ */
|
|
5648
|
+
/* @__PURE__ */ jsxs13(
|
|
5358
5649
|
motion3.div,
|
|
5359
5650
|
{
|
|
5360
5651
|
initial: { opacity: 0, y: -6 },
|
|
@@ -5365,8 +5656,8 @@ function MessageTimeline({
|
|
|
5365
5656
|
"aria-live": "polite",
|
|
5366
5657
|
className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
|
|
5367
5658
|
children: [
|
|
5368
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */
|
|
5369
|
-
hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */
|
|
5659
|
+
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,
|
|
5660
|
+
hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs13(
|
|
5370
5661
|
"button",
|
|
5371
5662
|
{
|
|
5372
5663
|
type: "button",
|
|
@@ -5402,7 +5693,7 @@ function MessageTimeline({
|
|
|
5402
5693
|
"hover:border-og-border-strong disabled:opacity-60"
|
|
5403
5694
|
),
|
|
5404
5695
|
children: [
|
|
5405
|
-
/* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsx15(ArrowUpToLineIcon, { className: "size-3.5" }),
|
|
5406
5697
|
"Jump to start"
|
|
5407
5698
|
]
|
|
5408
5699
|
}
|
|
@@ -5411,7 +5702,7 @@ function MessageTimeline({
|
|
|
5411
5702
|
}
|
|
5412
5703
|
)
|
|
5413
5704
|
) : null }),
|
|
5414
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsx15(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx15(
|
|
5415
5706
|
motion3.div,
|
|
5416
5707
|
{
|
|
5417
5708
|
initial: { opacity: 0, y: 6 },
|
|
@@ -5421,10 +5712,10 @@ function MessageTimeline({
|
|
|
5421
5712
|
"data-og-loading-newer": "",
|
|
5422
5713
|
"aria-live": "polite",
|
|
5423
5714
|
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
5424
|
-
children: /* @__PURE__ */
|
|
5715
|
+
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" }) })
|
|
5425
5716
|
}
|
|
5426
5717
|
) : null }),
|
|
5427
|
-
/* @__PURE__ */
|
|
5718
|
+
/* @__PURE__ */ jsx15(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs13(
|
|
5428
5719
|
motion3.button,
|
|
5429
5720
|
{
|
|
5430
5721
|
type: "button",
|
|
@@ -5468,7 +5759,7 @@ function MessageTimeline({
|
|
|
5468
5759
|
"hover:border-og-border-strong"
|
|
5469
5760
|
),
|
|
5470
5761
|
children: [
|
|
5471
|
-
/* @__PURE__ */
|
|
5762
|
+
/* @__PURE__ */ jsx15(ArrowDownIcon2, { className: "size-3.5" }),
|
|
5472
5763
|
"Jump to latest"
|
|
5473
5764
|
]
|
|
5474
5765
|
}
|
|
@@ -5476,7 +5767,7 @@ function MessageTimeline({
|
|
|
5476
5767
|
] }) }) }) }) }) });
|
|
5477
5768
|
}
|
|
5478
5769
|
function useStableTimelineGroupKeys(allGroups) {
|
|
5479
|
-
const previousRef =
|
|
5770
|
+
const previousRef = useRef8([]);
|
|
5480
5771
|
const keyedGroups = useMemo4(() => {
|
|
5481
5772
|
const previousByItemId = /* @__PURE__ */ new Map();
|
|
5482
5773
|
for (const previous of previousRef.current) {
|
|
@@ -5558,7 +5849,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5558
5849
|
if (insideTurn) {
|
|
5559
5850
|
const useNestedChip = nestClusterChips && activityShouldFold;
|
|
5560
5851
|
if (!useNestedChip) {
|
|
5561
|
-
return /* @__PURE__ */
|
|
5852
|
+
return /* @__PURE__ */ jsx15(
|
|
5562
5853
|
ActivityRail,
|
|
5563
5854
|
{
|
|
5564
5855
|
items: group.items,
|
|
@@ -5569,7 +5860,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5569
5860
|
}
|
|
5570
5861
|
);
|
|
5571
5862
|
}
|
|
5572
|
-
return /* @__PURE__ */
|
|
5863
|
+
return /* @__PURE__ */ jsx15(
|
|
5573
5864
|
TurnSummary,
|
|
5574
5865
|
{
|
|
5575
5866
|
items: group.items,
|
|
@@ -5580,7 +5871,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5580
5871
|
foldKey: group.id,
|
|
5581
5872
|
facets: turnSummary?.facets,
|
|
5582
5873
|
contextCompactionCount,
|
|
5583
|
-
children: /* @__PURE__ */
|
|
5874
|
+
children: /* @__PURE__ */ jsx15(
|
|
5584
5875
|
ActivityRail,
|
|
5585
5876
|
{
|
|
5586
5877
|
items: group.items,
|
|
@@ -5594,7 +5885,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5594
5885
|
settleChrome ? "settle" : "rest"
|
|
5595
5886
|
);
|
|
5596
5887
|
}
|
|
5597
|
-
return /* @__PURE__ */
|
|
5888
|
+
return /* @__PURE__ */ jsx15(
|
|
5598
5889
|
TurnSummary,
|
|
5599
5890
|
{
|
|
5600
5891
|
items: group.items,
|
|
@@ -5605,7 +5896,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5605
5896
|
facets: turnSummary?.facets,
|
|
5606
5897
|
settleFold,
|
|
5607
5898
|
contextCompactionCount,
|
|
5608
|
-
children: /* @__PURE__ */
|
|
5899
|
+
children: /* @__PURE__ */ jsx15(FoldBody, { children: /* @__PURE__ */ jsx15(TurnRailFrame, { children: /* @__PURE__ */ jsx15(
|
|
5609
5900
|
ActivityRail,
|
|
5610
5901
|
{
|
|
5611
5902
|
items: group.items,
|
|
@@ -5621,7 +5912,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5621
5912
|
const activityItems = flattenActivityItems(group.groups);
|
|
5622
5913
|
const nestClusters = foldableActivityClusterCount(group.groups) >= 2;
|
|
5623
5914
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
5624
|
-
const body = group.groups.map((child) => /* @__PURE__ */
|
|
5915
|
+
const body = group.groups.map((child) => /* @__PURE__ */ jsx15(
|
|
5625
5916
|
TimelineGroupView2,
|
|
5626
5917
|
{
|
|
5627
5918
|
group: child,
|
|
@@ -5637,7 +5928,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5637
5928
|
},
|
|
5638
5929
|
timelineGroupKey(child)
|
|
5639
5930
|
));
|
|
5640
|
-
return /* @__PURE__ */
|
|
5931
|
+
return /* @__PURE__ */ jsx15(
|
|
5641
5932
|
TurnSummary,
|
|
5642
5933
|
{
|
|
5643
5934
|
items: activityItems,
|
|
@@ -5651,16 +5942,16 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5651
5942
|
settleFold,
|
|
5652
5943
|
copyText: insideTurn ? void 0 : turnCopyText,
|
|
5653
5944
|
contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
|
|
5654
|
-
children: /* @__PURE__ */
|
|
5945
|
+
children: /* @__PURE__ */ jsx15(FoldBody, { children: insideTurn ? (
|
|
5655
5946
|
// A nested turn is already on an ancestor rail — its body just stacks
|
|
5656
5947
|
// flush (the bare-node body already indents it), so no second rule.
|
|
5657
|
-
/* @__PURE__ */
|
|
5658
|
-
) : /* @__PURE__ */
|
|
5948
|
+
/* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-4", children: body })
|
|
5949
|
+
) : /* @__PURE__ */ jsx15(TurnRailFrame, { children: body }) })
|
|
5659
5950
|
}
|
|
5660
5951
|
);
|
|
5661
5952
|
}
|
|
5662
5953
|
case "item":
|
|
5663
|
-
return /* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ jsx15(
|
|
5664
5955
|
TimelineRow,
|
|
5665
5956
|
{
|
|
5666
5957
|
item: group.item,
|
|
@@ -5673,14 +5964,14 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5673
5964
|
}
|
|
5674
5965
|
});
|
|
5675
5966
|
function FoldBody({ children }) {
|
|
5676
|
-
return /* @__PURE__ */
|
|
5967
|
+
return /* @__PURE__ */ jsx15(Fragment6, { children });
|
|
5677
5968
|
}
|
|
5678
5969
|
function TurnRailFrame({ children }) {
|
|
5679
|
-
return /* @__PURE__ */
|
|
5970
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
|
|
5680
5971
|
}
|
|
5681
5972
|
function useLiveSettleFold(folded) {
|
|
5682
|
-
const previousFoldedRef =
|
|
5683
|
-
const latchedRef =
|
|
5973
|
+
const previousFoldedRef = useRef8(folded);
|
|
5974
|
+
const latchedRef = useRef8(false);
|
|
5684
5975
|
if (!previousFoldedRef.current && folded) {
|
|
5685
5976
|
latchedRef.current = true;
|
|
5686
5977
|
}
|
|
@@ -5828,23 +6119,23 @@ function TimelineRow({
|
|
|
5828
6119
|
}) {
|
|
5829
6120
|
switch (item.kind) {
|
|
5830
6121
|
case "user-message":
|
|
5831
|
-
return /* @__PURE__ */
|
|
6122
|
+
return /* @__PURE__ */ jsx15(UserMessageRow, { item, renderMessageText });
|
|
5832
6123
|
case "agent-message":
|
|
5833
|
-
return /* @__PURE__ */
|
|
6124
|
+
return /* @__PURE__ */ jsx15(AgentMessageRow, { item, renderMessageText });
|
|
5834
6125
|
case "worker-completion":
|
|
5835
|
-
return /* @__PURE__ */
|
|
6126
|
+
return /* @__PURE__ */ jsx15(WorkerCompletionRow, { item, onOpenSession });
|
|
5836
6127
|
case "session-status":
|
|
5837
|
-
return /* @__PURE__ */
|
|
6128
|
+
return /* @__PURE__ */ jsx15(SessionStatusRow, { item });
|
|
5838
6129
|
case "goal":
|
|
5839
|
-
return /* @__PURE__ */
|
|
6130
|
+
return /* @__PURE__ */ jsx15(GoalRow, { item });
|
|
5840
6131
|
case "machine-input-batch":
|
|
5841
|
-
return /* @__PURE__ */
|
|
6132
|
+
return /* @__PURE__ */ jsx15(MachineInputBatchRow, { item });
|
|
5842
6133
|
case "notice":
|
|
5843
|
-
return /* @__PURE__ */
|
|
6134
|
+
return /* @__PURE__ */ jsx15(NoticeRow, { item });
|
|
5844
6135
|
case "context-compaction":
|
|
5845
|
-
return /* @__PURE__ */
|
|
6136
|
+
return /* @__PURE__ */ jsx15(CompactionRow, { item });
|
|
5846
6137
|
case "auth-needed":
|
|
5847
|
-
return /* @__PURE__ */
|
|
6138
|
+
return /* @__PURE__ */ jsx15(
|
|
5848
6139
|
AuthNeededRow,
|
|
5849
6140
|
{
|
|
5850
6141
|
item,
|
|
@@ -5870,7 +6161,7 @@ function CompactionRow({ item }) {
|
|
|
5870
6161
|
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";
|
|
5871
6162
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
|
|
5872
6163
|
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";
|
|
5873
|
-
return /* @__PURE__ */
|
|
6164
|
+
return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
|
|
5874
6165
|
"div",
|
|
5875
6166
|
{
|
|
5876
6167
|
className: cn(
|
|
@@ -5879,14 +6170,14 @@ function CompactionRow({ item }) {
|
|
|
5879
6170
|
),
|
|
5880
6171
|
role: "status",
|
|
5881
6172
|
children: [
|
|
5882
|
-
/* @__PURE__ */
|
|
5883
|
-
/* @__PURE__ */
|
|
5884
|
-
/* @__PURE__ */
|
|
6173
|
+
/* @__PURE__ */ jsxs13("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
6174
|
+
/* @__PURE__ */ jsx15(ShrinkIcon, { className: "size-3.5 shrink-0" }),
|
|
6175
|
+
/* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
|
|
5885
6176
|
title,
|
|
5886
6177
|
trigger ? ` \xB7 ${trigger}` : ""
|
|
5887
6178
|
] })
|
|
5888
6179
|
] }),
|
|
5889
|
-
subtitle ? /* @__PURE__ */
|
|
6180
|
+
subtitle ? /* @__PURE__ */ jsx15("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
|
|
5890
6181
|
]
|
|
5891
6182
|
}
|
|
5892
6183
|
) });
|
|
@@ -5905,18 +6196,33 @@ function compactionSkipSubtitle(reason) {
|
|
|
5905
6196
|
return "Compaction was not needed. Chat history is unchanged.";
|
|
5906
6197
|
}
|
|
5907
6198
|
}
|
|
6199
|
+
function MessageFooterTime({ occurredAt }) {
|
|
6200
|
+
return /* @__PURE__ */ jsx15(
|
|
6201
|
+
"time",
|
|
6202
|
+
{
|
|
6203
|
+
dateTime: occurredAt,
|
|
6204
|
+
className: cn(
|
|
6205
|
+
"shrink-0 tabular-nums text-og-xs text-og-fg-subtle",
|
|
6206
|
+
"opacity-0 transition-opacity duration-150",
|
|
6207
|
+
"group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 pointer-coarse:opacity-70"
|
|
6208
|
+
),
|
|
6209
|
+
children: formatClockTime(occurredAt)
|
|
6210
|
+
}
|
|
6211
|
+
);
|
|
6212
|
+
}
|
|
5908
6213
|
function UserMessageRow({
|
|
5909
6214
|
item,
|
|
5910
6215
|
renderMessageText
|
|
5911
6216
|
}) {
|
|
5912
6217
|
const enter = useEntranceAnimation();
|
|
5913
|
-
return /* @__PURE__ */
|
|
6218
|
+
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(
|
|
5914
6219
|
CopyHoverFrame,
|
|
5915
6220
|
{
|
|
5916
6221
|
copyText: item.text,
|
|
5917
6222
|
label: "Copy message",
|
|
5918
6223
|
className: "w-fit max-w-full min-w-0",
|
|
5919
|
-
|
|
6224
|
+
trailing: /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
6225
|
+
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 }) })
|
|
5920
6226
|
}
|
|
5921
6227
|
) }) });
|
|
5922
6228
|
}
|
|
@@ -5925,14 +6231,15 @@ function AgentMessageRow({
|
|
|
5925
6231
|
renderMessageText
|
|
5926
6232
|
}) {
|
|
5927
6233
|
const enter = useEntranceAnimation();
|
|
5928
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
5929
|
-
return /* @__PURE__ */
|
|
6234
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx15(Markdown, { streaming: item.streaming, children: item.text });
|
|
6235
|
+
return /* @__PURE__ */ jsx15(
|
|
5930
6236
|
CopyHoverFrame,
|
|
5931
6237
|
{
|
|
5932
6238
|
copyText: item.text,
|
|
5933
6239
|
label: "Copy message",
|
|
5934
|
-
align: "
|
|
6240
|
+
align: "start",
|
|
5935
6241
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
6242
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsx15(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
5936
6243
|
children: body
|
|
5937
6244
|
}
|
|
5938
6245
|
);
|
|
@@ -5974,7 +6281,7 @@ function WorkerCompletionRow({
|
|
|
5974
6281
|
onOpenSession
|
|
5975
6282
|
}) {
|
|
5976
6283
|
const enter = useEntranceAnimation();
|
|
5977
|
-
const [open, setOpen] =
|
|
6284
|
+
const [open, setOpen] = useState11(false);
|
|
5978
6285
|
const meta = workerCompletionMeta(item);
|
|
5979
6286
|
const Icon = meta.icon;
|
|
5980
6287
|
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && Boolean(item.pausedReason?.trim());
|
|
@@ -5984,17 +6291,17 @@ function WorkerCompletionRow({
|
|
|
5984
6291
|
...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
|
|
5985
6292
|
];
|
|
5986
6293
|
const hasDetails = details.length > 0;
|
|
5987
|
-
return /* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
/* @__PURE__ */
|
|
5990
|
-
/* @__PURE__ */
|
|
5991
|
-
/* @__PURE__ */
|
|
5992
|
-
item.goalText ? /* @__PURE__ */
|
|
6294
|
+
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: [
|
|
6295
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2.5", children: [
|
|
6296
|
+
/* @__PURE__ */ jsx15("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx15(Icon, { className: "size-4" }) }),
|
|
6297
|
+
/* @__PURE__ */ jsx15("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("p", { className: "text-og-base leading-5 text-og-fg", children: [
|
|
6298
|
+
/* @__PURE__ */ jsx15("span", { className: "font-medium", children: meta.label }),
|
|
6299
|
+
item.goalText ? /* @__PURE__ */ jsxs13("span", { className: "text-og-fg-muted", children: [
|
|
5993
6300
|
" \xB7 ",
|
|
5994
6301
|
truncate(item.goalText, 90)
|
|
5995
6302
|
] }) : null
|
|
5996
6303
|
] }) }),
|
|
5997
|
-
item.childSessionId && onOpenSession ? /* @__PURE__ */
|
|
6304
|
+
item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs13(
|
|
5998
6305
|
"button",
|
|
5999
6306
|
{
|
|
6000
6307
|
type: "button",
|
|
@@ -6006,13 +6313,13 @@ function WorkerCompletionRow({
|
|
|
6006
6313
|
),
|
|
6007
6314
|
children: [
|
|
6008
6315
|
"View session",
|
|
6009
|
-
/* @__PURE__ */
|
|
6316
|
+
/* @__PURE__ */ jsx15(ArrowRightIcon2, { className: "size-3.5" })
|
|
6010
6317
|
]
|
|
6011
6318
|
}
|
|
6012
6319
|
) : null
|
|
6013
6320
|
] }),
|
|
6014
|
-
hasDetails ? /* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6321
|
+
hasDetails ? /* @__PURE__ */ jsxs13(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
|
|
6322
|
+
/* @__PURE__ */ jsx15(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs13(
|
|
6016
6323
|
"button",
|
|
6017
6324
|
{
|
|
6018
6325
|
type: "button",
|
|
@@ -6021,14 +6328,14 @@ function WorkerCompletionRow({
|
|
|
6021
6328
|
"outline-none transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
6022
6329
|
),
|
|
6023
6330
|
children: [
|
|
6024
|
-
/* @__PURE__ */
|
|
6331
|
+
/* @__PURE__ */ jsx15(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
|
|
6025
6332
|
open ? "Hide details" : "Show details"
|
|
6026
6333
|
]
|
|
6027
6334
|
}
|
|
6028
6335
|
) }),
|
|
6029
|
-
/* @__PURE__ */
|
|
6030
|
-
/* @__PURE__ */
|
|
6031
|
-
/* @__PURE__ */
|
|
6336
|
+
/* @__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: [
|
|
6337
|
+
/* @__PURE__ */ jsx15("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
|
|
6338
|
+
/* @__PURE__ */ jsx15(
|
|
6032
6339
|
"p",
|
|
6033
6340
|
{
|
|
6034
6341
|
className: cn(
|
|
@@ -6045,7 +6352,7 @@ function WorkerCompletionRow({
|
|
|
6045
6352
|
function SessionStatusRow({ item }) {
|
|
6046
6353
|
const enter = useEntranceAnimation();
|
|
6047
6354
|
const meta = SESSION_STATUS_META[item.status];
|
|
6048
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ jsxs13(
|
|
6049
6356
|
"div",
|
|
6050
6357
|
{
|
|
6051
6358
|
className: cn(
|
|
@@ -6054,14 +6361,14 @@ function SessionStatusRow({ item }) {
|
|
|
6054
6361
|
),
|
|
6055
6362
|
role: "status",
|
|
6056
6363
|
children: [
|
|
6057
|
-
/* @__PURE__ */
|
|
6058
|
-
/* @__PURE__ */
|
|
6059
|
-
/* @__PURE__ */
|
|
6364
|
+
/* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" }),
|
|
6365
|
+
/* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
6366
|
+
/* @__PURE__ */ jsx15(StatusDot, { status: item.status, className: "size-1" }),
|
|
6060
6367
|
meta.label.toLowerCase(),
|
|
6061
6368
|
" \xB7 ",
|
|
6062
6369
|
formatRelativeTime(item.occurredAt)
|
|
6063
6370
|
] }),
|
|
6064
|
-
/* @__PURE__ */
|
|
6371
|
+
/* @__PURE__ */ jsx15("span", { className: "h-px flex-1 bg-og-border" })
|
|
6065
6372
|
]
|
|
6066
6373
|
}
|
|
6067
6374
|
);
|
|
@@ -6071,7 +6378,7 @@ var GOAL_META = {
|
|
|
6071
6378
|
set: {
|
|
6072
6379
|
label: "Goal set",
|
|
6073
6380
|
pill: "border-og-accent/30 bg-og-accent/10 text-og-accent",
|
|
6074
|
-
icon:
|
|
6381
|
+
icon: TargetIcon2
|
|
6075
6382
|
},
|
|
6076
6383
|
updated: { label: "Goal updated", pill: NEUTRAL_PILL, icon: PencilLineIcon },
|
|
6077
6384
|
completed: {
|
|
@@ -6091,7 +6398,7 @@ var GOAL_META = {
|
|
|
6091
6398
|
function GoalRow({ item }) {
|
|
6092
6399
|
const enter = useEntranceAnimation();
|
|
6093
6400
|
const { label, pill, icon: Icon } = GOAL_META[item.action];
|
|
6094
|
-
return /* @__PURE__ */
|
|
6401
|
+
return /* @__PURE__ */ jsx15("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs13(
|
|
6095
6402
|
"span",
|
|
6096
6403
|
{
|
|
6097
6404
|
className: cn(
|
|
@@ -6099,8 +6406,8 @@ function GoalRow({ item }) {
|
|
|
6099
6406
|
pill
|
|
6100
6407
|
),
|
|
6101
6408
|
children: [
|
|
6102
|
-
/* @__PURE__ */
|
|
6103
|
-
/* @__PURE__ */
|
|
6409
|
+
/* @__PURE__ */ jsx15(Icon, { className: "size-3.5 shrink-0" }),
|
|
6410
|
+
/* @__PURE__ */ jsxs13("span", { className: "truncate", children: [
|
|
6104
6411
|
label,
|
|
6105
6412
|
item.text ? `: ${truncate(item.text, 90)}` : ""
|
|
6106
6413
|
] })
|
|
@@ -6118,7 +6425,7 @@ var MACHINE_INPUT_META = {
|
|
|
6118
6425
|
function MachineInputBatchRow({ item }) {
|
|
6119
6426
|
const enter = useEntranceAnimation();
|
|
6120
6427
|
const visible = item.members.slice(0, 3);
|
|
6121
|
-
return /* @__PURE__ */
|
|
6428
|
+
return /* @__PURE__ */ jsxs13(
|
|
6122
6429
|
"div",
|
|
6123
6430
|
{
|
|
6124
6431
|
className: cn(
|
|
@@ -6126,18 +6433,18 @@ function MachineInputBatchRow({ item }) {
|
|
|
6126
6433
|
"rounded-og-md border border-og-border/70 bg-og-surface-1/55 px-3 py-2.5"
|
|
6127
6434
|
),
|
|
6128
6435
|
children: [
|
|
6129
|
-
item.members.length > 1 && /* @__PURE__ */
|
|
6436
|
+
item.members.length > 1 && /* @__PURE__ */ jsxs13("div", { className: "mb-2 text-xs font-medium text-og-fg-subtle", children: [
|
|
6130
6437
|
item.members.length,
|
|
6131
6438
|
" updates joined this turn"
|
|
6132
6439
|
] }),
|
|
6133
|
-
/* @__PURE__ */
|
|
6134
|
-
item.members.length > visible.length && /* @__PURE__ */
|
|
6135
|
-
/* @__PURE__ */
|
|
6440
|
+
/* @__PURE__ */ jsx15("div", { className: "space-y-2", children: visible.map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) }),
|
|
6441
|
+
item.members.length > visible.length && /* @__PURE__ */ jsxs13("details", { className: "mt-2 pl-8 text-xs text-og-fg-muted", children: [
|
|
6442
|
+
/* @__PURE__ */ jsxs13("summary", { className: "cursor-pointer select-none hover:text-og-fg", children: [
|
|
6136
6443
|
"Show ",
|
|
6137
6444
|
item.members.length - visible.length,
|
|
6138
6445
|
" more"
|
|
6139
6446
|
] }),
|
|
6140
|
-
/* @__PURE__ */
|
|
6447
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-2 space-y-2", children: item.members.slice(visible.length).map((member) => /* @__PURE__ */ jsx15(MachineInputRow, { member }, member.id)) })
|
|
6141
6448
|
] })
|
|
6142
6449
|
]
|
|
6143
6450
|
}
|
|
@@ -6145,15 +6452,15 @@ function MachineInputBatchRow({ item }) {
|
|
|
6145
6452
|
}
|
|
6146
6453
|
function MachineInputRow({ member }) {
|
|
6147
6454
|
const source = readableMachineInputSource(member.sourceId);
|
|
6148
|
-
return /* @__PURE__ */
|
|
6149
|
-
/* @__PURE__ */
|
|
6150
|
-
/* @__PURE__ */
|
|
6151
|
-
/* @__PURE__ */
|
|
6152
|
-
source && /* @__PURE__ */
|
|
6455
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
6456
|
+
/* @__PURE__ */ jsx15("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
|
|
6457
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
6458
|
+
/* @__PURE__ */ jsx15("span", { className: "text-xs font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
|
|
6459
|
+
source && /* @__PURE__ */ jsxs13("span", { className: "ml-1.5 text-xs text-og-fg-subtle", children: [
|
|
6153
6460
|
"from ",
|
|
6154
6461
|
source
|
|
6155
6462
|
] }),
|
|
6156
|
-
member.summary && /* @__PURE__ */
|
|
6463
|
+
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) })
|
|
6157
6464
|
] })
|
|
6158
6465
|
] });
|
|
6159
6466
|
}
|
|
@@ -6169,7 +6476,7 @@ function cleanMachineInputSummary(summary) {
|
|
|
6169
6476
|
function NoticeRow({ item }) {
|
|
6170
6477
|
const enter = useEntranceAnimation();
|
|
6171
6478
|
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";
|
|
6172
|
-
return /* @__PURE__ */
|
|
6479
|
+
return /* @__PURE__ */ jsxs13(
|
|
6173
6480
|
"div",
|
|
6174
6481
|
{
|
|
6175
6482
|
className: cn(
|
|
@@ -6179,20 +6486,20 @@ function NoticeRow({ item }) {
|
|
|
6179
6486
|
),
|
|
6180
6487
|
role: "status",
|
|
6181
6488
|
children: [
|
|
6182
|
-
/* @__PURE__ */
|
|
6489
|
+
/* @__PURE__ */ jsx15(
|
|
6183
6490
|
TriangleAlertIcon3,
|
|
6184
6491
|
{
|
|
6185
6492
|
className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
|
|
6186
6493
|
}
|
|
6187
6494
|
),
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
/* @__PURE__ */
|
|
6190
|
-
item.details ? /* @__PURE__ */
|
|
6191
|
-
/* @__PURE__ */
|
|
6192
|
-
/* @__PURE__ */
|
|
6495
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
6496
|
+
/* @__PURE__ */ jsx15("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
|
|
6497
|
+
item.details ? /* @__PURE__ */ jsxs13("details", { className: "mt-2 text-xs", children: [
|
|
6498
|
+
/* @__PURE__ */ jsx15("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
6499
|
+
/* @__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) })
|
|
6193
6500
|
] }) : null
|
|
6194
6501
|
] }),
|
|
6195
|
-
item.action ? /* @__PURE__ */
|
|
6502
|
+
item.action ? /* @__PURE__ */ jsx15(
|
|
6196
6503
|
"a",
|
|
6197
6504
|
{
|
|
6198
6505
|
className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-xs font-medium hover:bg-current/10",
|
|
@@ -6212,8 +6519,8 @@ function AuthNeededRow({
|
|
|
6212
6519
|
resolveProviderLogo
|
|
6213
6520
|
}) {
|
|
6214
6521
|
const enter = useEntranceAnimation();
|
|
6215
|
-
const [busy, setBusy] =
|
|
6216
|
-
const [failed, setFailed] =
|
|
6522
|
+
const [busy, setBusy] = useState11(false);
|
|
6523
|
+
const [failed, setFailed] = useState11(false);
|
|
6217
6524
|
const provider = providerLabel(item.providerDomain);
|
|
6218
6525
|
const unavailable = item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
6219
6526
|
const missing = item.reason === "missing_connection";
|
|
@@ -6232,22 +6539,22 @@ function AuthNeededRow({
|
|
|
6232
6539
|
setBusy(false);
|
|
6233
6540
|
}
|
|
6234
6541
|
};
|
|
6235
|
-
return /* @__PURE__ */
|
|
6236
|
-
/* @__PURE__ */
|
|
6237
|
-
/* @__PURE__ */
|
|
6238
|
-
/* @__PURE__ */
|
|
6542
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
|
|
6543
|
+
/* @__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: [
|
|
6544
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
6545
|
+
/* @__PURE__ */ jsx15(
|
|
6239
6546
|
AuthProviderLogo,
|
|
6240
6547
|
{
|
|
6241
6548
|
src: resolveProviderLogo?.(item.providerDomain) ?? null,
|
|
6242
6549
|
label: provider
|
|
6243
6550
|
}
|
|
6244
6551
|
),
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6552
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
|
|
6553
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-og-md font-medium text-og-fg", children: unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}` }),
|
|
6554
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-og-sm text-og-fg-subtle", children: authReasonLine(item.reason) })
|
|
6248
6555
|
] })
|
|
6249
6556
|
] }),
|
|
6250
|
-
!unavailable && onReconnect ? /* @__PURE__ */
|
|
6557
|
+
!unavailable && onReconnect ? /* @__PURE__ */ jsxs13(
|
|
6251
6558
|
"button",
|
|
6252
6559
|
{
|
|
6253
6560
|
type: "button",
|
|
@@ -6258,11 +6565,11 @@ function AuthNeededRow({
|
|
|
6258
6565
|
"transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
|
|
6259
6566
|
),
|
|
6260
6567
|
children: [
|
|
6261
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx15(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
|
|
6262
6569
|
busy ? "Opening\u2026" : actionLabel
|
|
6263
6570
|
]
|
|
6264
6571
|
}
|
|
6265
|
-
) : !unavailable && item.authorizationUrl ? /* @__PURE__ */
|
|
6572
|
+
) : !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs13(
|
|
6266
6573
|
"a",
|
|
6267
6574
|
{
|
|
6268
6575
|
href: item.authorizationUrl,
|
|
@@ -6273,18 +6580,18 @@ function AuthNeededRow({
|
|
|
6273
6580
|
"transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
|
|
6274
6581
|
),
|
|
6275
6582
|
children: [
|
|
6276
|
-
/* @__PURE__ */
|
|
6583
|
+
/* @__PURE__ */ jsx15(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
6277
6584
|
actionLabel
|
|
6278
6585
|
]
|
|
6279
6586
|
}
|
|
6280
6587
|
) : null
|
|
6281
6588
|
] }),
|
|
6282
|
-
!unavailable ? /* @__PURE__ */
|
|
6589
|
+
!unavailable ? /* @__PURE__ */ jsxs13("p", { className: "px-1 text-og-xs text-og-fg-subtle", children: [
|
|
6283
6590
|
"This tool call wasn't replayed. After ",
|
|
6284
6591
|
missing ? "connecting" : "reconnecting",
|
|
6285
6592
|
", send a new message to try again."
|
|
6286
6593
|
] }) : null,
|
|
6287
|
-
failed ? /* @__PURE__ */
|
|
6594
|
+
failed ? /* @__PURE__ */ jsxs13("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
|
|
6288
6595
|
"Couldn't start ",
|
|
6289
6596
|
missing ? "connecting" : "reconnecting",
|
|
6290
6597
|
" ",
|
|
@@ -6294,15 +6601,15 @@ function AuthNeededRow({
|
|
|
6294
6601
|
] });
|
|
6295
6602
|
}
|
|
6296
6603
|
function AuthProviderLogo({ src, label }) {
|
|
6297
|
-
const [failed, setFailed] =
|
|
6298
|
-
|
|
6604
|
+
const [failed, setFailed] = useState11(false);
|
|
6605
|
+
useEffect8(() => setFailed(false), [src]);
|
|
6299
6606
|
const showImage = src && !failed;
|
|
6300
|
-
return /* @__PURE__ */
|
|
6607
|
+
return /* @__PURE__ */ jsx15(
|
|
6301
6608
|
"span",
|
|
6302
6609
|
{
|
|
6303
6610
|
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",
|
|
6304
6611
|
"aria-hidden": true,
|
|
6305
|
-
children: showImage ? /* @__PURE__ */
|
|
6612
|
+
children: showImage ? /* @__PURE__ */ jsx15(
|
|
6306
6613
|
"img",
|
|
6307
6614
|
{
|
|
6308
6615
|
src,
|
|
@@ -6312,7 +6619,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
6312
6619
|
className: "size-full object-contain p-1.5",
|
|
6313
6620
|
onError: () => setFailed(true)
|
|
6314
6621
|
}
|
|
6315
|
-
) : /* @__PURE__ */
|
|
6622
|
+
) : /* @__PURE__ */ jsx15("span", { children: monogram(label) })
|
|
6316
6623
|
}
|
|
6317
6624
|
);
|
|
6318
6625
|
}
|
|
@@ -6354,11 +6661,6 @@ function authReasonLine(reason) {
|
|
|
6354
6661
|
|
|
6355
6662
|
export {
|
|
6356
6663
|
QueueSurface,
|
|
6357
|
-
usePortalTokenStyle,
|
|
6358
|
-
TooltipProvider,
|
|
6359
|
-
Tooltip,
|
|
6360
|
-
TooltipTrigger,
|
|
6361
|
-
TooltipContent,
|
|
6362
6664
|
sessionChromeGoalPillState,
|
|
6363
6665
|
SessionChrome,
|
|
6364
6666
|
defaultHumanInputFormMessages,
|
|
@@ -6411,4 +6713,4 @@ export {
|
|
|
6411
6713
|
MessageTimeline,
|
|
6412
6714
|
TimelineRow
|
|
6413
6715
|
};
|
|
6414
|
-
//# sourceMappingURL=chunk-
|
|
6716
|
+
//# sourceMappingURL=chunk-QRYJCWGD.js.map
|