@opengeni/react 7.4.0-canary.36855269964001 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -48
- package/dist/artifacts-document.js +2 -3
- package/dist/artifacts-presentation.js +2 -3
- package/dist/artifacts-spreadsheet.js +2 -2
- package/dist/artifacts.d.ts +0 -1
- package/dist/artifacts.js +1402 -505
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-R6KK5VKR.js → browser-viewer-2E6R2Y4W.js} +4 -4
- package/dist/{chunk-WUISZ3WU.js → chunk-3E2AITTZ.js} +28 -32
- package/dist/{chunk-WUISZ3WU.js.map → chunk-3E2AITTZ.js.map} +1 -1
- package/dist/{chunk-PWUILT2U.js → chunk-5AZSK6MV.js} +2 -2
- package/dist/{chunk-Y2PRMYLC.js → chunk-DUEBTL3N.js} +3 -4
- package/dist/{chunk-Y2PRMYLC.js.map → chunk-DUEBTL3N.js.map} +1 -1
- package/dist/{chunk-7UAMYXJY.js → chunk-KNDIXZN6.js} +18 -25
- package/dist/{chunk-7UAMYXJY.js.map → chunk-KNDIXZN6.js.map} +1 -1
- package/dist/{chunk-P4G6K2E2.js → chunk-L4OSXQ6H.js} +884 -1119
- package/dist/chunk-L4OSXQ6H.js.map +1 -0
- package/dist/{chunk-LLIH7Q4B.js → chunk-S5JQ4R22.js} +19 -47
- package/dist/chunk-S5JQ4R22.js.map +1 -0
- package/dist/{chunk-A4UJB2MM.js → chunk-SEEVCT36.js} +2 -2
- package/dist/{chunk-UXJCQ5GH.js → chunk-UDD6DLLT.js} +1 -6
- package/dist/chunk-UDD6DLLT.js.map +1 -0
- package/dist/chunk-UGMKPUEM.js +299 -0
- package/dist/chunk-UGMKPUEM.js.map +1 -0
- package/dist/{chunk-ZCZHKJKZ.js → chunk-USXVQACU.js} +3 -3
- package/dist/{chunk-VABBF52G.js → chunk-V2ABIVYJ.js} +6 -70
- package/dist/chunk-V2ABIVYJ.js.map +1 -0
- package/dist/{chunk-TVO6GXR6.js → chunk-X4HIN6TV.js} +162 -71
- package/dist/chunk-X4HIN6TV.js.map +1 -0
- package/dist/{chunk-IIDEIBMC.js → chunk-XEJEOAOV.js} +38 -49
- package/dist/chunk-XEJEOAOV.js.map +1 -0
- package/dist/{chunk-ZKLCPBWN.js → chunk-Y3QTZN2F.js} +5 -5
- package/dist/{chunk-73BUNGLF.js → chunk-YZ3YYMOM.js} +1 -1
- package/dist/components/artifacts/editable-artifact-ui.d.ts +1 -2
- package/dist/components/artifacts/index.d.ts +0 -7
- package/dist/components/browser-select-control.d.ts +1 -3
- package/dist/components/message-timeline.d.ts +1 -18
- package/dist/components/open-geni-links.d.ts +0 -16
- package/dist/components/session-conversation.d.ts +1 -20
- package/dist/composer.js +3 -3
- package/dist/{computer-viewer-DJHPSP2J.js → computer-viewer-WMJE6OA3.js} +3 -3
- package/dist/connect.js +6 -7
- package/dist/connect.js.map +1 -1
- package/dist/hooks/latest-question.d.ts +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.js +28 -39
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +4 -4
- package/dist/{latest-question-KGCDK3XX.js → latest-question-QB4EUCW5.js} +3 -3
- package/dist/lib/format.d.ts +0 -3
- package/dist/machines.js +2 -2
- package/dist/{markdown-table-layout-QXSLK4BY.js → markdown-table-layout-PFUEZ2U4.js} +5 -37
- package/dist/markdown-table-layout-PFUEZ2U4.js.map +1 -0
- package/dist/{sandbox-files-4PMXDSDV.js → sandbox-files-PXPIZAFG.js} +2 -2
- package/dist/session-ui.d.ts +2 -5
- package/dist/session-ui.js +13 -23
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +3 -3
- package/dist/sites.js +289 -4
- package/dist/sites.js.map +1 -1
- package/dist/timeline/types.d.ts +1 -7
- package/dist/{timeline-annotation-selection-DMLMM2TX.js → timeline-annotation-selection-ODLVF4OI.js} +1 -6
- package/dist/timeline-annotation-selection-ODLVF4OI.js.map +1 -0
- package/package.json +3 -7
- package/src/artifacts.ts +0 -37
- package/src/components/artifacts/editable-artifact-ui.tsx +1 -3
- package/src/components/artifacts/editable-artifact-workbench.tsx +2 -5
- package/src/components/artifacts/editable-document.tsx +36 -34
- package/src/components/artifacts/editable-presentation.tsx +16 -21
- package/src/components/artifacts/index.ts +0 -41
- package/src/components/browser-select-control.tsx +1 -4
- package/src/components/browser-viewer.tsx +22 -81
- package/src/components/computer-viewer.tsx +23 -51
- package/src/components/markdown-table-layout.ts +5 -49
- package/src/components/markdown.tsx +2 -5
- package/src/components/message-timeline.tsx +434 -515
- package/src/components/open-geni-links.tsx +0 -24
- package/src/components/session-conversation.tsx +20 -131
- package/src/components/timeline-annotation-selection.tsx +0 -7
- package/src/hooks/use-available-models.ts +1 -1
- package/src/index.ts +0 -9
- package/src/lib/format.ts +0 -13
- package/src/session-ui.ts +0 -9
- package/src/timeline/projection.ts +4 -78
- package/src/timeline/types.ts +0 -7
- package/styles/compiled.css +0 -325
- package/dist/chat-interactive-block-VAGABN7J.js +0 -11
- package/dist/chunk-5CVXZA3Y.js +0 -292
- package/dist/chunk-5CVXZA3Y.js.map +0 -1
- package/dist/chunk-B3V6TG77.js +0 -41
- package/dist/chunk-B3V6TG77.js.map +0 -1
- package/dist/chunk-IIDEIBMC.js.map +0 -1
- package/dist/chunk-LLIH7Q4B.js.map +0 -1
- package/dist/chunk-P4G6K2E2.js.map +0 -1
- package/dist/chunk-RAIQYITC.js +0 -1772
- package/dist/chunk-RAIQYITC.js.map +0 -1
- package/dist/chunk-SCOTPE2I.js +0 -589
- package/dist/chunk-SCOTPE2I.js.map +0 -1
- package/dist/chunk-TVO6GXR6.js.map +0 -1
- package/dist/chunk-UXJCQ5GH.js.map +0 -1
- package/dist/chunk-VABBF52G.js.map +0 -1
- package/dist/chunk-WEHMPOXK.js +0 -39
- package/dist/chunk-WEHMPOXK.js.map +0 -1
- package/dist/chunk-XCHWDJ22.js +0 -107
- package/dist/chunk-XCHWDJ22.js.map +0 -1
- package/dist/components/artifacts/artifact-chrome.d.ts +0 -120
- package/dist/components/artifacts/artifact-sandbox.d.ts +0 -27
- package/dist/components/artifacts/chat-interactive-block.d.ts +0 -29
- package/dist/components/artifacts/deferred-chat-media.d.ts +0 -15
- package/dist/components/artifacts/editable-artifact-view.d.ts +0 -46
- package/dist/components/artifacts/latest-task-runner.d.ts +0 -15
- package/dist/components/artifacts/session-artifact-viewer.d.ts +0 -39
- package/dist/components/artifacts/site-view.d.ts +0 -23
- package/dist/components/timeline-pill-geometry.d.ts +0 -6
- package/dist/components/timeline-pill-placement.d.ts +0 -18
- package/dist/components/usage-limit-notice.d.ts +0 -49
- package/dist/components/usage-member-list.d.ts +0 -91
- package/dist/components/usage-meter.d.ts +0 -73
- package/dist/hooks/use-usage.d.ts +0 -40
- package/dist/markdown-table-layout-QXSLK4BY.js.map +0 -1
- package/dist/sandbox-files-4PMXDSDV.js.map +0 -1
- package/dist/timeline/allowance-exhausted-row.d.ts +0 -24
- package/dist/timeline-annotation-selection-DMLMM2TX.js.map +0 -1
- package/dist/timeline-pill-geometry-2G6EK47V.js +0 -73
- package/dist/timeline-pill-geometry-2G6EK47V.js.map +0 -1
- package/dist/usage/allowance-copy.d.ts +0 -25
- package/dist/usage/summary.d.ts +0 -35
- package/dist/usage.d.ts +0 -13
- package/dist/usage.js +0 -1073
- package/dist/usage.js.map +0 -1
- package/src/components/artifacts/artifact-chrome.tsx +0 -413
- package/src/components/artifacts/artifact-sandbox.tsx +0 -185
- package/src/components/artifacts/chat-interactive-block.tsx +0 -260
- package/src/components/artifacts/deferred-chat-media.tsx +0 -67
- package/src/components/artifacts/editable-artifact-view.tsx +0 -187
- package/src/components/artifacts/latest-task-runner.ts +0 -49
- package/src/components/artifacts/session-artifact-viewer.tsx +0 -376
- package/src/components/artifacts/site-view.tsx +0 -116
- package/src/components/timeline-pill-geometry.ts +0 -112
- package/src/components/timeline-pill-placement.ts +0 -81
- package/src/components/usage-limit-notice.tsx +0 -179
- package/src/components/usage-member-list.tsx +0 -792
- package/src/components/usage-meter.tsx +0 -382
- package/src/hooks/use-usage.ts +0 -100
- package/src/timeline/allowance-exhausted-row.tsx +0 -86
- package/src/usage/allowance-copy.ts +0 -64
- package/src/usage/summary.ts +0 -93
- package/src/usage.ts +0 -50
- /package/dist/{browser-viewer-R6KK5VKR.js.map → browser-viewer-2E6R2Y4W.js.map} +0 -0
- /package/dist/{chunk-PWUILT2U.js.map → chunk-5AZSK6MV.js.map} +0 -0
- /package/dist/{chunk-A4UJB2MM.js.map → chunk-SEEVCT36.js.map} +0 -0
- /package/dist/{chunk-ZCZHKJKZ.js.map → chunk-USXVQACU.js.map} +0 -0
- /package/dist/{chunk-ZKLCPBWN.js.map → chunk-Y3QTZN2F.js.map} +0 -0
- /package/dist/{chunk-73BUNGLF.js.map → chunk-YZ3YYMOM.js.map} +0 -0
- /package/dist/{chat-interactive-block-VAGABN7J.js.map → computer-viewer-WMJE6OA3.js.map} +0 -0
- /package/dist/{latest-question-KGCDK3XX.js.map → latest-question-QB4EUCW5.js.map} +0 -0
- /package/dist/{computer-viewer-DJHPSP2J.js.map → sandbox-files-PXPIZAFG.js.map} +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useThemeType
|
|
3
|
-
} from "./chunk-UK4TINKT.js";
|
|
4
1
|
import {
|
|
5
2
|
EmptyQueueStateSurface,
|
|
6
3
|
QUEUE_ITEM_CONTENT_UNAVAILABLE,
|
|
@@ -9,6 +6,9 @@ import {
|
|
|
9
6
|
queueItemContent,
|
|
10
7
|
requestQueueDraftEdit
|
|
11
8
|
} from "./chunk-YCGBREUV.js";
|
|
9
|
+
import {
|
|
10
|
+
useThemeType
|
|
11
|
+
} from "./chunk-UK4TINKT.js";
|
|
12
12
|
import {
|
|
13
13
|
TimelineAnnotationSourceRootContext
|
|
14
14
|
} from "./chunk-5QHL6BLH.js";
|
|
@@ -33,11 +33,11 @@ import {
|
|
|
33
33
|
useSessionControl,
|
|
34
34
|
useSessionEvents,
|
|
35
35
|
useTurnQueue
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-USXVQACU.js";
|
|
37
37
|
import {
|
|
38
38
|
buildTimeline,
|
|
39
39
|
groupTimeline
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-V2ABIVYJ.js";
|
|
41
41
|
import {
|
|
42
42
|
mcpToolLeaf,
|
|
43
43
|
toolDisplayName
|
|
@@ -64,22 +64,17 @@ import {
|
|
|
64
64
|
Status,
|
|
65
65
|
Surface,
|
|
66
66
|
useChatComposerController
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-Y3QTZN2F.js";
|
|
68
68
|
import {
|
|
69
69
|
ModelPolicyPicker
|
|
70
70
|
} from "./chunk-UINDK6C3.js";
|
|
71
|
-
import {
|
|
72
|
-
projectPickerRows,
|
|
73
|
-
sortPickerRows
|
|
74
|
-
} from "./chunk-CHPKSLPN.js";
|
|
75
71
|
import {
|
|
76
72
|
useComposer
|
|
77
73
|
} from "./chunk-KVERXCFY.js";
|
|
78
74
|
import {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} from "./chunk-B3V6TG77.js";
|
|
75
|
+
projectPickerRows,
|
|
76
|
+
sortPickerRows
|
|
77
|
+
} from "./chunk-CHPKSLPN.js";
|
|
83
78
|
import {
|
|
84
79
|
usePolledValue
|
|
85
80
|
} from "./chunk-KZ73RL76.js";
|
|
@@ -97,27 +92,24 @@ import {
|
|
|
97
92
|
Markdown,
|
|
98
93
|
MediaEmpty,
|
|
99
94
|
MediaSkeleton,
|
|
95
|
+
OpenGeniLinkProvider,
|
|
100
96
|
PayloadBlock,
|
|
101
97
|
ScreenshotFigure,
|
|
102
98
|
TermBlock,
|
|
103
99
|
Thumbnail,
|
|
104
100
|
TimelineSearchRevealContext,
|
|
105
101
|
ToolCallTruncationProvider,
|
|
102
|
+
chainLinkResolvers,
|
|
106
103
|
isTimelineSearchTarget,
|
|
104
|
+
sessionLinkResolver,
|
|
107
105
|
useForcedDefaultOpen,
|
|
106
|
+
useOpenGeniLinkResolver,
|
|
108
107
|
useTimelineSearchNavigation,
|
|
109
108
|
useTimelineSearchReveal
|
|
110
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-X4HIN6TV.js";
|
|
111
110
|
import {
|
|
112
111
|
prefersReducedMotion
|
|
113
112
|
} from "./chunk-GIMRELBW.js";
|
|
114
|
-
import {
|
|
115
|
-
OpenGeniLinkProvider,
|
|
116
|
-
chainLinkResolvers,
|
|
117
|
-
sessionLinkResolver,
|
|
118
|
-
useOpenGeniLinkResolver,
|
|
119
|
-
viewerLinkResolver
|
|
120
|
-
} from "./chunk-XCHWDJ22.js";
|
|
121
113
|
import {
|
|
122
114
|
LightboxProvider,
|
|
123
115
|
Tooltip,
|
|
@@ -132,7 +124,7 @@ import {
|
|
|
132
124
|
stringifyPayload,
|
|
133
125
|
truncate,
|
|
134
126
|
tryParseJson
|
|
135
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-UDD6DLLT.js";
|
|
136
128
|
import {
|
|
137
129
|
cn
|
|
138
130
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -5572,11 +5564,11 @@ import {
|
|
|
5572
5564
|
lazy as lazy3,
|
|
5573
5565
|
memo,
|
|
5574
5566
|
useCallback as useCallback3,
|
|
5575
|
-
useEffect as
|
|
5567
|
+
useEffect as useEffect9,
|
|
5576
5568
|
useLayoutEffect as useLayoutEffect4,
|
|
5577
|
-
useMemo as
|
|
5569
|
+
useMemo as useMemo4,
|
|
5578
5570
|
useRef as useRef9,
|
|
5579
|
-
useState as
|
|
5571
|
+
useState as useState14
|
|
5580
5572
|
} from "react";
|
|
5581
5573
|
|
|
5582
5574
|
// src/components/timeline-anchor.tsx
|
|
@@ -5718,63 +5710,6 @@ function useReadingProgress(projected, pinned, scroller) {
|
|
|
5718
5710
|
return { groups, release };
|
|
5719
5711
|
}
|
|
5720
5712
|
|
|
5721
|
-
// src/components/timeline-pill-placement.ts
|
|
5722
|
-
import { useEffect as useEffect9, useState as useState14 } from "react";
|
|
5723
|
-
var RECHECK_MS = 1e3;
|
|
5724
|
-
function useTimelinePillPlacement({
|
|
5725
|
-
pillRef,
|
|
5726
|
-
scrollerRef,
|
|
5727
|
-
active,
|
|
5728
|
-
preference
|
|
5729
|
-
}) {
|
|
5730
|
-
const [placement, setPlacement] = useState14(preference[0]);
|
|
5731
|
-
const key = preference.join(",");
|
|
5732
|
-
useEffect9(() => {
|
|
5733
|
-
if (!active) {
|
|
5734
|
-
setPlacement(preference[0]);
|
|
5735
|
-
return;
|
|
5736
|
-
}
|
|
5737
|
-
const scroller = scrollerRef.current;
|
|
5738
|
-
if (!scroller) return;
|
|
5739
|
-
let frame = 0;
|
|
5740
|
-
let current = preference[0];
|
|
5741
|
-
let choose = null;
|
|
5742
|
-
let disposed = false;
|
|
5743
|
-
void import("./timeline-pill-geometry-2G6EK47V.js").then((geometry) => {
|
|
5744
|
-
if (disposed) return;
|
|
5745
|
-
choose = geometry.choosePlacement;
|
|
5746
|
-
schedule();
|
|
5747
|
-
});
|
|
5748
|
-
const evaluate = () => {
|
|
5749
|
-
frame = 0;
|
|
5750
|
-
const pill = pillRef.current;
|
|
5751
|
-
const frameElement = pill?.offsetParent;
|
|
5752
|
-
if (!choose || !pill || !(frameElement instanceof HTMLElement)) return;
|
|
5753
|
-
const next = choose(pill, frameElement, scroller, preference, current);
|
|
5754
|
-
if (next !== current) {
|
|
5755
|
-
current = next;
|
|
5756
|
-
setPlacement(next);
|
|
5757
|
-
}
|
|
5758
|
-
};
|
|
5759
|
-
const schedule = () => {
|
|
5760
|
-
if (frame === 0) frame = requestAnimationFrame(evaluate);
|
|
5761
|
-
};
|
|
5762
|
-
schedule();
|
|
5763
|
-
const view = scroller.ownerDocument.defaultView;
|
|
5764
|
-
scroller.addEventListener("scroll", schedule, { passive: true });
|
|
5765
|
-
view?.addEventListener("resize", schedule);
|
|
5766
|
-
const timer = setInterval(schedule, RECHECK_MS);
|
|
5767
|
-
return () => {
|
|
5768
|
-
disposed = true;
|
|
5769
|
-
if (frame !== 0) cancelAnimationFrame(frame);
|
|
5770
|
-
scroller.removeEventListener("scroll", schedule);
|
|
5771
|
-
view?.removeEventListener("resize", schedule);
|
|
5772
|
-
clearInterval(timer);
|
|
5773
|
-
};
|
|
5774
|
-
}, [active, key, pillRef, scrollerRef]);
|
|
5775
|
-
return active ? placement : preference[0];
|
|
5776
|
-
}
|
|
5777
|
-
|
|
5778
5713
|
// src/components/timeline-settlement.ts
|
|
5779
5714
|
function captureTimelineSettlement(scroller, groups) {
|
|
5780
5715
|
if (timelineHasReader(scroller)) return null;
|
|
@@ -6190,77 +6125,13 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
|
|
|
6190
6125
|
return true;
|
|
6191
6126
|
}
|
|
6192
6127
|
|
|
6193
|
-
// src/timeline/allowance-exhausted-row.tsx
|
|
6194
|
-
import { GaugeIcon } from "lucide-react";
|
|
6195
|
-
import { createContext as createContext10, useContext as useContext11, useMemo as useMemo4 } from "react";
|
|
6196
|
-
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6197
|
-
var AllowancePresentationContext = createContext10({
|
|
6198
|
-
render: void 0,
|
|
6199
|
-
labels: allowanceLabels()
|
|
6200
|
-
});
|
|
6201
|
-
function AllowancePresentationProvider({
|
|
6202
|
-
render,
|
|
6203
|
-
labels,
|
|
6204
|
-
children
|
|
6205
|
-
}) {
|
|
6206
|
-
const value = useMemo4(() => ({ render, labels: allowanceLabels(labels) }), [render, labels]);
|
|
6207
|
-
return /* @__PURE__ */ jsx17(AllowancePresentationContext.Provider, { value, children });
|
|
6208
|
-
}
|
|
6209
|
-
function AllowanceExhaustedRow({ refusal }) {
|
|
6210
|
-
const { render, labels } = useContext11(AllowancePresentationContext);
|
|
6211
|
-
const enter = useEntranceAnimation();
|
|
6212
|
-
const workspace = refusal.scope === "workspace";
|
|
6213
|
-
const defaultRow = /* @__PURE__ */ jsxs12(
|
|
6214
|
-
"div",
|
|
6215
|
-
{
|
|
6216
|
-
className: cn(
|
|
6217
|
-
enter && "animate-og-enter",
|
|
6218
|
-
"flex items-start gap-2.5 rounded-og-md border border-og-status-waiting/35 bg-og-status-waiting/8 px-3.5 py-2.5 text-og-menu text-og-fg"
|
|
6219
|
-
),
|
|
6220
|
-
role: "status",
|
|
6221
|
-
"data-og-allowance-exhausted": refusal.scope,
|
|
6222
|
-
children: [
|
|
6223
|
-
/* @__PURE__ */ jsx17(GaugeIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-og-status-waiting" }),
|
|
6224
|
-
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
|
|
6225
|
-
/* @__PURE__ */ jsx17("p", { className: "font-medium", children: workspace ? labels.workspaceLimitReachedTitle : labels.memberLimitReachedTitle }),
|
|
6226
|
-
/* @__PURE__ */ jsxs12("p", { className: "mt-0.5 text-og-fg-muted", children: [
|
|
6227
|
-
workspace ? labels.workspaceRemedy : labels.memberRemedy,
|
|
6228
|
-
" ",
|
|
6229
|
-
/* @__PURE__ */ jsx17(
|
|
6230
|
-
"span",
|
|
6231
|
-
{
|
|
6232
|
-
title: refusal.resetsAt ? formatAllowanceInstant(refusal.resetsAt) : void 0,
|
|
6233
|
-
className: "whitespace-nowrap",
|
|
6234
|
-
children: allowanceResetSentence(labels, refusal.resetsAt)
|
|
6235
|
-
}
|
|
6236
|
-
)
|
|
6237
|
-
] })
|
|
6238
|
-
] })
|
|
6239
|
-
]
|
|
6240
|
-
}
|
|
6241
|
-
);
|
|
6242
|
-
return /* @__PURE__ */ jsx17(Fragment5, { children: render?.(refusal, { labels, defaultRow }) ?? defaultRow });
|
|
6243
|
-
}
|
|
6244
|
-
|
|
6245
6128
|
// src/components/message-timeline.tsx
|
|
6246
|
-
import { Fragment as
|
|
6247
|
-
var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-
|
|
6129
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6130
|
+
var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-ODLVF4OI.js"));
|
|
6248
6131
|
var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-markers-GNDHTGBD.js"));
|
|
6249
6132
|
var PIN_THRESHOLD_PX = 48;
|
|
6250
6133
|
var JUMP_TO_LATEST_CATCHUP_DEBT_PX = 240;
|
|
6251
6134
|
var QUESTION_NAV_MARGIN_PX = 12;
|
|
6252
|
-
var JUMP_PILL_PLACEMENTS = ["center", "end", "start"];
|
|
6253
|
-
var QUESTION_PILL_PLACEMENTS = ["end", "center", "start"];
|
|
6254
|
-
var JUMP_PILL_PLACEMENT_CLASS = {
|
|
6255
|
-
center: "inset-x-0 mx-auto",
|
|
6256
|
-
end: "right-4 sm:right-6",
|
|
6257
|
-
start: "left-4 sm:left-6"
|
|
6258
|
-
};
|
|
6259
|
-
var QUESTION_PILL_PLACEMENT_CLASS = {
|
|
6260
|
-
center: "justify-center",
|
|
6261
|
-
end: "justify-end",
|
|
6262
|
-
start: "justify-start"
|
|
6263
|
-
};
|
|
6264
6135
|
var OLDER_PREFETCH_MARGIN_PX = 400;
|
|
6265
6136
|
var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
|
|
6266
6137
|
var PRIMARY_ACTION_CLASS = "inline-flex w-full shrink-0 items-center justify-center gap-1.5 rounded-og-md border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-1.5 text-og-menu font-medium sm:w-auto";
|
|
@@ -6357,7 +6228,6 @@ function cssEscapeAttribute(value) {
|
|
|
6357
6228
|
}
|
|
6358
6229
|
function MessageTimeline({
|
|
6359
6230
|
resolveLink,
|
|
6360
|
-
renderInteractiveBlock,
|
|
6361
6231
|
userMessageDisclosureLabels,
|
|
6362
6232
|
searchTarget,
|
|
6363
6233
|
events,
|
|
@@ -6369,8 +6239,6 @@ function MessageTimeline({
|
|
|
6369
6239
|
onMemoryClick,
|
|
6370
6240
|
onReconnect,
|
|
6371
6241
|
renderAuthNeeded,
|
|
6372
|
-
renderAllowanceExhausted,
|
|
6373
|
-
allowanceExhaustedLabels,
|
|
6374
6242
|
shouldRenderAuthNeeded,
|
|
6375
6243
|
resolveProviderLogo,
|
|
6376
6244
|
toolRegistry = defaultToolRegistry,
|
|
@@ -6398,7 +6266,7 @@ function MessageTimeline({
|
|
|
6398
6266
|
emptyState,
|
|
6399
6267
|
className
|
|
6400
6268
|
}) {
|
|
6401
|
-
const resolvedItems =
|
|
6269
|
+
const resolvedItems = useMemo4(() => {
|
|
6402
6270
|
const projectedItems = items ?? buildTimeline(events ?? []);
|
|
6403
6271
|
if (!shouldRenderAuthNeeded) {
|
|
6404
6272
|
return projectedItems;
|
|
@@ -6416,22 +6284,21 @@ function MessageTimeline({
|
|
|
6416
6284
|
]) : null;
|
|
6417
6285
|
const searchTargetRef = useRef9(searchTarget);
|
|
6418
6286
|
searchTargetRef.current = searchTarget;
|
|
6419
|
-
const renderSearchableMessageText =
|
|
6287
|
+
const renderSearchableMessageText = useMemo4(
|
|
6420
6288
|
() => renderMessageText ? (text, item) => renderMessageText(text, item, {
|
|
6421
6289
|
searchTarget: searchItem?.id === item.id ? searchTarget ?? null : null
|
|
6422
6290
|
}) : (text, item) => {
|
|
6423
|
-
const body = /* @__PURE__ */
|
|
6291
|
+
const body = /* @__PURE__ */ jsx17(
|
|
6424
6292
|
Markdown,
|
|
6425
6293
|
{
|
|
6426
6294
|
searchTarget: searchItem?.id === item.id ? searchTarget : null,
|
|
6427
6295
|
streaming: item.kind === "agent-message" && item.streaming,
|
|
6428
|
-
renderInteractiveBlock: item.kind === "agent-message" ? renderInteractiveBlock : void 0,
|
|
6429
6296
|
children: text
|
|
6430
6297
|
}
|
|
6431
6298
|
);
|
|
6432
|
-
return item.kind === "user-message" ? /* @__PURE__ */
|
|
6299
|
+
return item.kind === "user-message" ? /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text, children: body }) : body;
|
|
6433
6300
|
},
|
|
6434
|
-
[
|
|
6301
|
+
[renderMessageText, searchItem?.id, searchTarget]
|
|
6435
6302
|
);
|
|
6436
6303
|
const sourceItems = events ?? items;
|
|
6437
6304
|
const olderBoundaryKey = sourceItems?.[0]?.id;
|
|
@@ -6440,9 +6307,9 @@ function MessageTimeline({
|
|
|
6440
6307
|
newerScopeRef.current = newerBoundaryKey;
|
|
6441
6308
|
const newerAttemptRef = useRef9(null);
|
|
6442
6309
|
const newerRetryButtonRef = useRef9(null);
|
|
6443
|
-
const [newerRetryPending, setNewerRetryPending] =
|
|
6444
|
-
const [newerFailure, setNewerFailure] =
|
|
6445
|
-
|
|
6310
|
+
const [newerRetryPending, setNewerRetryPending] = useState14(false);
|
|
6311
|
+
const [newerFailure, setNewerFailure] = useState14(null);
|
|
6312
|
+
useEffect9(() => {
|
|
6446
6313
|
newerScopeRef.current = newerBoundaryKey;
|
|
6447
6314
|
newerAttemptRef.current = null;
|
|
6448
6315
|
setNewerFailure(null);
|
|
@@ -6494,14 +6361,14 @@ function MessageTimeline({
|
|
|
6494
6361
|
settlementAnimationRef.current = null;
|
|
6495
6362
|
}, []);
|
|
6496
6363
|
const olderPageBudgetRef = useRef9(0);
|
|
6497
|
-
const [olderDemand, setOlderDemand] =
|
|
6364
|
+
const [olderDemand, setOlderDemand] = useState14(0);
|
|
6498
6365
|
const readableTurns = turnSummary?.rolling === true;
|
|
6499
|
-
const projectedGroups =
|
|
6366
|
+
const projectedGroups = useMemo4(
|
|
6500
6367
|
() => groupTimeline(resolvedItems, { readableTurns }),
|
|
6501
6368
|
[resolvedItems, readableTurns]
|
|
6502
6369
|
);
|
|
6503
6370
|
useLayoutEffect4(() => stopSettlement, [projectedGroups, stopSettlement]);
|
|
6504
|
-
const annotationSources =
|
|
6371
|
+
const annotationSources = useMemo4(() => {
|
|
6505
6372
|
const sources = /* @__PURE__ */ new Map();
|
|
6506
6373
|
for (const item of resolvedItems) {
|
|
6507
6374
|
if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
|
|
@@ -6514,46 +6381,31 @@ function MessageTimeline({
|
|
|
6514
6381
|
const topSentinelRef = useRef9(null);
|
|
6515
6382
|
const bottomSentinelRef = useRef9(null);
|
|
6516
6383
|
const previousBulkFirstKeyRef = useRef9(void 0);
|
|
6517
|
-
const [pinned, setPinned] =
|
|
6384
|
+
const [pinned, setPinned] = useState14(true);
|
|
6518
6385
|
const { groups: allGroups, release: releaseProgress } = useReadingProgress(
|
|
6519
6386
|
projectedGroups,
|
|
6520
6387
|
autoFollow && pinned && !hasNewer,
|
|
6521
6388
|
scrollRef.current
|
|
6522
6389
|
);
|
|
6523
|
-
const [canSkipTipCatchup, setCanSkipTipCatchup] =
|
|
6390
|
+
const [canSkipTipCatchup, setCanSkipTipCatchup] = useState14(false);
|
|
6524
6391
|
const canSkipTipCatchupRef = useRef9(false);
|
|
6525
|
-
const [bulkActive, setBulkActive] =
|
|
6392
|
+
const [bulkActive, setBulkActive] = useState14(true);
|
|
6526
6393
|
const olderPrefetchArmedRef = useRef9(false);
|
|
6527
|
-
const [olderPrefetchArmed, setOlderPrefetchArmed] =
|
|
6394
|
+
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
|
|
6528
6395
|
const olderLoadAttemptRef = useRef9(null);
|
|
6529
|
-
const [underfillSettledAttempt, setUnderfillSettledAttempt] =
|
|
6396
|
+
const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState14(
|
|
6530
6397
|
null
|
|
6531
6398
|
);
|
|
6532
6399
|
const underfillRetryReadyRef = useRef9(false);
|
|
6533
6400
|
const resizeFollowRafRef = useRef9(null);
|
|
6534
6401
|
const questionNavFrameRef = useRef9(null);
|
|
6535
|
-
const [questionNav, setQuestionNav] =
|
|
6536
|
-
const
|
|
6537
|
-
const
|
|
6538
|
-
const
|
|
6539
|
-
const jumpPillPlacement = useTimelinePillPlacement({
|
|
6540
|
-
pillRef: jumpPillRef,
|
|
6541
|
-
scrollerRef: scrollRef,
|
|
6542
|
-
active: jumpPillShown,
|
|
6543
|
-
preference: JUMP_PILL_PLACEMENTS
|
|
6544
|
-
});
|
|
6545
|
-
const questionPillPlacement = useTimelinePillPlacement({
|
|
6546
|
-
pillRef: questionPillRef,
|
|
6547
|
-
scrollerRef: scrollRef,
|
|
6548
|
-
active: questionNav !== null,
|
|
6549
|
-
preference: QUESTION_PILL_PLACEMENTS
|
|
6550
|
-
});
|
|
6551
|
-
const [questionTarget, setQuestionTarget] = useState15(null);
|
|
6552
|
-
const [questionPending, setQuestionPending] = useState15(false);
|
|
6553
|
-
const [questionError, setQuestionError] = useState15(null);
|
|
6402
|
+
const [questionNav, setQuestionNav] = useState14(null);
|
|
6403
|
+
const [questionTarget, setQuestionTarget] = useState14(null);
|
|
6404
|
+
const [questionPending, setQuestionPending] = useState14(false);
|
|
6405
|
+
const [questionError, setQuestionError] = useState14(null);
|
|
6554
6406
|
const questionRequestRef = useRef9(0);
|
|
6555
6407
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
6556
|
-
const [revealed, setRevealed] =
|
|
6408
|
+
const [revealed, setRevealed] = useState14(resolvedItems[0]?.id === "c");
|
|
6557
6409
|
const pinnedRef = useRef9(true);
|
|
6558
6410
|
const hasNewerRef = useRef9(hasNewer);
|
|
6559
6411
|
hasNewerRef.current = hasNewer;
|
|
@@ -6583,7 +6435,7 @@ function MessageTimeline({
|
|
|
6583
6435
|
const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
|
|
6584
6436
|
const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
|
|
6585
6437
|
const groups = useStableTimelineGroupKeys(allGroups, !bulkRender);
|
|
6586
|
-
const turnsWithOutput =
|
|
6438
|
+
const turnsWithOutput = useMemo4(
|
|
6587
6439
|
() => new Set(
|
|
6588
6440
|
resolvedItems.flatMap(
|
|
6589
6441
|
(item) => "turnId" in item && item.turnId && (item.kind === "tool-call" || (item.kind === "agent-message" || item.kind === "reasoning") && item.text.trim()) ? [item.turnId] : []
|
|
@@ -6678,7 +6530,7 @@ function MessageTimeline({
|
|
|
6678
6530
|
setOlderPrefetchArmed(true);
|
|
6679
6531
|
}
|
|
6680
6532
|
}, [autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]);
|
|
6681
|
-
|
|
6533
|
+
useEffect9(() => {
|
|
6682
6534
|
if (!readableTurns) return;
|
|
6683
6535
|
const node = scrollRef.current;
|
|
6684
6536
|
if (!node) return;
|
|
@@ -6837,7 +6689,7 @@ function MessageTimeline({
|
|
|
6837
6689
|
},
|
|
6838
6690
|
[applyPinned, autoFollow, snapToBottom, syncScrollBaseline, writeScrollTop]
|
|
6839
6691
|
);
|
|
6840
|
-
const userMessageDisclosureContext =
|
|
6692
|
+
const userMessageDisclosureContext = useMemo4(
|
|
6841
6693
|
() => ({
|
|
6842
6694
|
expandedByMessageId: userMessageDisclosureMemoryRef.current,
|
|
6843
6695
|
beginChange: beginUserMessageDisclosureChange,
|
|
@@ -6852,7 +6704,7 @@ function MessageTimeline({
|
|
|
6852
6704
|
userMessageDisclosureLabels?.showLess
|
|
6853
6705
|
]
|
|
6854
6706
|
);
|
|
6855
|
-
const timelineGroupEntryContext =
|
|
6707
|
+
const timelineGroupEntryContext = useMemo4(
|
|
6856
6708
|
() => ({
|
|
6857
6709
|
userMessageDisclosureContext,
|
|
6858
6710
|
behavior: {
|
|
@@ -6940,7 +6792,7 @@ function MessageTimeline({
|
|
|
6940
6792
|
setQuestionNav((current) => sameQuestionNav(current, next) ? current : next);
|
|
6941
6793
|
});
|
|
6942
6794
|
}, [readableTurns, hasNewer, onJumpToLatestQuestion]);
|
|
6943
|
-
|
|
6795
|
+
useEffect9(
|
|
6944
6796
|
() => () => {
|
|
6945
6797
|
if (questionNavFrameRef.current != null) {
|
|
6946
6798
|
cancelFrame(questionNavFrameRef.current);
|
|
@@ -7088,8 +6940,8 @@ function MessageTimeline({
|
|
|
7088
6940
|
[applyCanSkipTipCatchup, cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
7089
6941
|
);
|
|
7090
6942
|
driveFollowRef.current = driveFollow;
|
|
7091
|
-
|
|
7092
|
-
|
|
6943
|
+
useEffect9(() => stopFollow, [stopFollow]);
|
|
6944
|
+
useEffect9(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
|
|
7093
6945
|
useLayoutEffect4(() => {
|
|
7094
6946
|
const node = scrollRef.current;
|
|
7095
6947
|
if (!node) {
|
|
@@ -7314,7 +7166,7 @@ function MessageTimeline({
|
|
|
7314
7166
|
seenActivityIdsRef.current.clear();
|
|
7315
7167
|
applyPinned(true);
|
|
7316
7168
|
}, [allGroups.length, revealed, applyPinned, clearReaderIntent]);
|
|
7317
|
-
|
|
7169
|
+
useEffect9(() => {
|
|
7318
7170
|
const node = scrollRef.current;
|
|
7319
7171
|
if (node) {
|
|
7320
7172
|
requestOlderIfUnderfilled(node);
|
|
@@ -7329,7 +7181,7 @@ function MessageTimeline({
|
|
|
7329
7181
|
const frame = requestFrame(() => setBulkActive(false));
|
|
7330
7182
|
return () => cancelFrame(frame);
|
|
7331
7183
|
}, [bulkRender, firstGroupKey]);
|
|
7332
|
-
|
|
7184
|
+
useEffect9(() => {
|
|
7333
7185
|
const root = scrollRef.current;
|
|
7334
7186
|
const target = topSentinelRef.current;
|
|
7335
7187
|
if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
|
|
@@ -7380,7 +7232,7 @@ function MessageTimeline({
|
|
|
7380
7232
|
onLoadOlder,
|
|
7381
7233
|
requestOlderIfUnderfilled
|
|
7382
7234
|
]);
|
|
7383
|
-
|
|
7235
|
+
useEffect9(() => {
|
|
7384
7236
|
const root = scrollRef.current;
|
|
7385
7237
|
const target = bottomSentinelRef.current;
|
|
7386
7238
|
if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
|
|
@@ -7397,7 +7249,7 @@ function MessageTimeline({
|
|
|
7397
7249
|
observer.observe(target);
|
|
7398
7250
|
return () => observer.disconnect();
|
|
7399
7251
|
}, [hasNewer, loadingNewer, onLoadNewer, requestNewer, firstGroupKey]);
|
|
7400
|
-
|
|
7252
|
+
useEffect9(() => {
|
|
7401
7253
|
const node = scrollRef.current;
|
|
7402
7254
|
const inner = node?.firstElementChild;
|
|
7403
7255
|
if (!node || !inner || typeof ResizeObserver === "undefined") {
|
|
@@ -7434,7 +7286,7 @@ function MessageTimeline({
|
|
|
7434
7286
|
}
|
|
7435
7287
|
};
|
|
7436
7288
|
}, [autoFollow, driveFollow, requestOlderIfUnderfilled, snapToBottom]);
|
|
7437
|
-
|
|
7289
|
+
useEffect9(() => {
|
|
7438
7290
|
if (searchTargetRef.current) return;
|
|
7439
7291
|
if (hasNewer) {
|
|
7440
7292
|
stopFollow();
|
|
@@ -7574,382 +7426,355 @@ function MessageTimeline({
|
|
|
7574
7426
|
}
|
|
7575
7427
|
releasePinAfterScrollSettled(node);
|
|
7576
7428
|
};
|
|
7577
|
-
const timeline = /* @__PURE__ */
|
|
7578
|
-
|
|
7429
|
+
const timeline = /* @__PURE__ */ jsx17(LightboxProvider, { children: /* @__PURE__ */ jsx17(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx17(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx17(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx17(EntranceAnimationProvider, { value: false, children: /* @__PURE__ */ jsx17(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx17(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs12(
|
|
7430
|
+
"div",
|
|
7579
7431
|
{
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
children:
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
onAnnotate
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7432
|
+
className: cn("og-root relative flex min-h-0 flex-col", className),
|
|
7433
|
+
style: { "--og-work-header-top": "-4rem" },
|
|
7434
|
+
children: [
|
|
7435
|
+
onAnnotate ? /* @__PURE__ */ jsx17(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
7436
|
+
TimelineAnnotationSelection,
|
|
7437
|
+
{
|
|
7438
|
+
rootRef: scrollRef,
|
|
7439
|
+
sources: annotationSources,
|
|
7440
|
+
onAnnotate
|
|
7441
|
+
}
|
|
7442
|
+
) }) : null,
|
|
7443
|
+
/* @__PURE__ */ jsx17(
|
|
7444
|
+
"div",
|
|
7445
|
+
{
|
|
7446
|
+
ref: scrollRef,
|
|
7447
|
+
"data-og-timeline-scroller": "",
|
|
7448
|
+
"data-og-bottom-follow": autoFollow && pinned && !hasNewer ? "true" : "false",
|
|
7449
|
+
tabIndex: -1,
|
|
7450
|
+
onScroll,
|
|
7451
|
+
onScrollEnd,
|
|
7452
|
+
onWheel,
|
|
7453
|
+
onTouchStart: (event) => {
|
|
7454
|
+
stopSettlement();
|
|
7455
|
+
const touch = event.touches.length === 1 ? event.touches[0] : void 0;
|
|
7456
|
+
touchPositionRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
|
|
7457
|
+
},
|
|
7458
|
+
onTouchMove: (event) => {
|
|
7459
|
+
const touch = event.touches[0];
|
|
7460
|
+
const previous = touchPositionRef.current;
|
|
7461
|
+
if (!touch || !previous || event.touches.length !== 1) {
|
|
7462
|
+
touchPositionRef.current = null;
|
|
7463
|
+
return;
|
|
7594
7464
|
}
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7465
|
+
const deltaX = previous.x - touch.clientX;
|
|
7466
|
+
const deltaY = previous.y - touch.clientY;
|
|
7467
|
+
if (Math.max(Math.abs(deltaX), Math.abs(deltaY)) < 4) return;
|
|
7468
|
+
touchPositionRef.current = { x: touch.clientX, y: touch.clientY };
|
|
7469
|
+
onWheel({
|
|
7470
|
+
deltaX,
|
|
7471
|
+
deltaY,
|
|
7472
|
+
target: event.target,
|
|
7473
|
+
currentTarget: event.currentTarget
|
|
7474
|
+
});
|
|
7475
|
+
},
|
|
7476
|
+
onTouchEnd: () => {
|
|
7477
|
+
touchPositionRef.current = null;
|
|
7478
|
+
},
|
|
7479
|
+
onTouchCancel: () => {
|
|
7480
|
+
touchPositionRef.current = null;
|
|
7481
|
+
},
|
|
7482
|
+
onClickCapture: (event) => {
|
|
7483
|
+
const target = event.target instanceof Element ? event.target.closest("button[aria-expanded]") : null;
|
|
7484
|
+
if (target) {
|
|
7485
|
+
if (target.hasAttribute("data-og-work-header")) {
|
|
7486
|
+
releaseProgress(
|
|
7487
|
+
target.closest("[data-og-group-key]")?.getAttribute("data-og-group-key") ?? null
|
|
7488
|
+
);
|
|
7489
|
+
}
|
|
7490
|
+
releasePinFromReader();
|
|
7491
|
+
disclosureKeepsUnpinnedRef.current = true;
|
|
7492
|
+
}
|
|
7493
|
+
},
|
|
7494
|
+
onFocusCapture: (event) => {
|
|
7495
|
+
if (readableTurns && event.target !== event.currentTarget) {
|
|
7496
|
+
stopSettlement();
|
|
7497
|
+
releasePinFromReader();
|
|
7498
|
+
disclosureKeepsUnpinnedRef.current = true;
|
|
7499
|
+
}
|
|
7500
|
+
},
|
|
7501
|
+
onPointerDown,
|
|
7502
|
+
onKeyDown,
|
|
7503
|
+
style: groups.length > 0 && !revealed ? { visibility: "hidden" } : void 0,
|
|
7504
|
+
className: cn(
|
|
7505
|
+
// tabIndex=-1 is programmatic only — never paint a focus ring on
|
|
7506
|
+
// the whole scroller (click + Shift used to flash a blue outline).
|
|
7507
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-16 pb-6 sm:px-6 outline-hidden",
|
|
7508
|
+
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
7509
|
+
),
|
|
7510
|
+
children: /* @__PURE__ */ jsx17(
|
|
7511
|
+
TimelineBeforeLayout,
|
|
7598
7512
|
{
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
"data-og-bottom-follow": autoFollow && pinned && !hasNewer ? "true" : "false",
|
|
7602
|
-
tabIndex: -1,
|
|
7603
|
-
onScroll,
|
|
7604
|
-
onScrollEnd,
|
|
7605
|
-
onWheel,
|
|
7606
|
-
onTouchStart: (event) => {
|
|
7607
|
-
stopSettlement();
|
|
7608
|
-
const touch = event.touches.length === 1 ? event.touches[0] : void 0;
|
|
7609
|
-
touchPositionRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
|
|
7610
|
-
},
|
|
7611
|
-
onTouchMove: (event) => {
|
|
7612
|
-
const touch = event.touches[0];
|
|
7613
|
-
const previous = touchPositionRef.current;
|
|
7614
|
-
if (!touch || !previous || event.touches.length !== 1) {
|
|
7615
|
-
touchPositionRef.current = null;
|
|
7616
|
-
return;
|
|
7617
|
-
}
|
|
7618
|
-
const deltaX = previous.x - touch.clientX;
|
|
7619
|
-
const deltaY = previous.y - touch.clientY;
|
|
7620
|
-
if (Math.max(Math.abs(deltaX), Math.abs(deltaY)) < 4) return;
|
|
7621
|
-
touchPositionRef.current = { x: touch.clientX, y: touch.clientY };
|
|
7622
|
-
onWheel({
|
|
7623
|
-
deltaX,
|
|
7624
|
-
deltaY,
|
|
7625
|
-
target: event.target,
|
|
7626
|
-
currentTarget: event.currentTarget
|
|
7627
|
-
});
|
|
7628
|
-
},
|
|
7629
|
-
onTouchEnd: () => {
|
|
7630
|
-
touchPositionRef.current = null;
|
|
7631
|
-
},
|
|
7632
|
-
onTouchCancel: () => {
|
|
7633
|
-
touchPositionRef.current = null;
|
|
7634
|
-
},
|
|
7635
|
-
onClickCapture: (event) => {
|
|
7636
|
-
const target = event.target instanceof Element ? event.target.closest("button[aria-expanded]") : null;
|
|
7637
|
-
if (target) {
|
|
7638
|
-
if (target.hasAttribute("data-og-work-header")) {
|
|
7639
|
-
releaseProgress(
|
|
7640
|
-
target.closest("[data-og-group-key]")?.getAttribute("data-og-group-key") ?? null
|
|
7641
|
-
);
|
|
7642
|
-
}
|
|
7513
|
+
capture: () => {
|
|
7514
|
+
if (readableTurns && timelineHasReader(scrollRef.current)) {
|
|
7643
7515
|
releasePinFromReader();
|
|
7644
|
-
disclosureKeepsUnpinnedRef.current = true;
|
|
7645
7516
|
}
|
|
7517
|
+
readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
|
|
7518
|
+
settlementRef.current = readableTurns && autoFollow && pinnedRef.current && revealedRef.current && !hasNewer && !pendingReaderLeaveRef.current && !disclosureKeepsUnpinnedRef.current && !prefersReducedMotion() && scrollRef.current ? captureTimelineSettlement(scrollRef.current, groups) : null;
|
|
7646
7519
|
},
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
questionNav ? "max-w-[calc(50%-0.5rem)] justify-start" : "justify-center"
|
|
7691
|
-
),
|
|
7692
|
-
children: [
|
|
7693
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
7694
|
-
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx18(
|
|
7695
|
-
"button",
|
|
7696
|
-
{
|
|
7697
|
-
type: "button",
|
|
7698
|
-
"data-og-retry": underfillRetryReady || void 0,
|
|
7699
|
-
"data-og-jump-to-start": !underfillRetryReady || void 0,
|
|
7700
|
-
onClick: () => {
|
|
7701
|
-
const node = scrollRef.current;
|
|
7702
|
-
if (underfillRetryReady) {
|
|
7703
|
-
if (node && underfillRetryReadyRef.current) {
|
|
7704
|
-
requestOlderIfUnderfilled(
|
|
7705
|
-
node,
|
|
7706
|
-
underfillSettledAttempt
|
|
7707
|
-
);
|
|
7708
|
-
}
|
|
7709
|
-
return;
|
|
7520
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
7521
|
+
/* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
|
|
7522
|
+
// Reserved top gutter: controls scroll with history and cannot
|
|
7523
|
+
// cover a disclosure. Visibility never changes content height.
|
|
7524
|
+
/* @__PURE__ */ jsxs12(
|
|
7525
|
+
motion3.div,
|
|
7526
|
+
{
|
|
7527
|
+
initial: { opacity: 0, y: -6 },
|
|
7528
|
+
animate: { opacity: 1, y: 0 },
|
|
7529
|
+
exit: { opacity: 0, y: -6 },
|
|
7530
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
7531
|
+
"data-og-loading-older": "",
|
|
7532
|
+
"aria-live": "polite",
|
|
7533
|
+
className: cn(
|
|
7534
|
+
"pointer-events-none absolute inset-x-0 -top-11 z-10 flex",
|
|
7535
|
+
// The scrolling history control and fixed question
|
|
7536
|
+
// action must never share the same pointer region.
|
|
7537
|
+
questionNav ? "max-w-[calc(50%-0.5rem)] justify-start" : "justify-center"
|
|
7538
|
+
),
|
|
7539
|
+
children: [
|
|
7540
|
+
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
7541
|
+
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx17(
|
|
7542
|
+
"button",
|
|
7543
|
+
{
|
|
7544
|
+
type: "button",
|
|
7545
|
+
"data-og-retry": underfillRetryReady || void 0,
|
|
7546
|
+
"data-og-jump-to-start": !underfillRetryReady || void 0,
|
|
7547
|
+
onClick: () => {
|
|
7548
|
+
const node = scrollRef.current;
|
|
7549
|
+
if (underfillRetryReady) {
|
|
7550
|
+
if (node && underfillRetryReadyRef.current) {
|
|
7551
|
+
requestOlderIfUnderfilled(node, underfillSettledAttempt);
|
|
7552
|
+
}
|
|
7553
|
+
return;
|
|
7554
|
+
}
|
|
7555
|
+
applyPinned(false);
|
|
7556
|
+
pendingJumpToStartRef.current = true;
|
|
7557
|
+
const seq = ++jumpToStartSeqRef.current;
|
|
7558
|
+
void Promise.resolve(onJumpToStart()).then(
|
|
7559
|
+
() => {
|
|
7560
|
+
const scroller = scrollRef.current ?? node;
|
|
7561
|
+
if (scroller) {
|
|
7562
|
+
scroller.scrollTop = 0;
|
|
7710
7563
|
}
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
void Promise.resolve(onJumpToStart()).then(
|
|
7715
|
-
() => {
|
|
7716
|
-
const scroller = scrollRef.current ?? node;
|
|
7717
|
-
if (scroller) {
|
|
7718
|
-
scroller.scrollTop = 0;
|
|
7719
|
-
}
|
|
7720
|
-
requestFrame(() => {
|
|
7721
|
-
if (jumpToStartSeqRef.current === seq) {
|
|
7722
|
-
pendingJumpToStartRef.current = false;
|
|
7723
|
-
}
|
|
7724
|
-
});
|
|
7725
|
-
},
|
|
7726
|
-
() => {
|
|
7727
|
-
if (jumpToStartSeqRef.current === seq) {
|
|
7728
|
-
pendingJumpToStartRef.current = false;
|
|
7729
|
-
}
|
|
7564
|
+
requestFrame(() => {
|
|
7565
|
+
if (jumpToStartSeqRef.current === seq) {
|
|
7566
|
+
pendingJumpToStartRef.current = false;
|
|
7730
7567
|
}
|
|
7731
|
-
);
|
|
7568
|
+
});
|
|
7732
7569
|
},
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7570
|
+
() => {
|
|
7571
|
+
if (jumpToStartSeqRef.current === seq) {
|
|
7572
|
+
pendingJumpToStartRef.current = false;
|
|
7573
|
+
}
|
|
7574
|
+
}
|
|
7575
|
+
);
|
|
7576
|
+
},
|
|
7577
|
+
className: "pointer-events-auto rounded-full border border-og-border px-3 py-1.5 text-og-control",
|
|
7578
|
+
children: underfillRetryReady ? underfillSettledAttempt?.[2]?.tailPreserved ? "Load earlier activity" : "Retry earlier activity" : "Jump to start"
|
|
7579
|
+
}
|
|
7580
|
+
) : null
|
|
7581
|
+
]
|
|
7582
|
+
}
|
|
7583
|
+
)
|
|
7584
|
+
) : null }),
|
|
7585
|
+
!groups.length ? emptyState ?? /* @__PURE__ */ jsx17("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
7586
|
+
hasOlder && olderPrefetchArmed ? (
|
|
7587
|
+
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
7588
|
+
// must never shift content (that shift was itself a wobble).
|
|
7589
|
+
// End at the scroll origin above the pt-16 gutter so the
|
|
7590
|
+
// observer and scrollTop cooldown share the same 400px band.
|
|
7591
|
+
/* @__PURE__ */ jsx17(
|
|
7592
|
+
"div",
|
|
7593
|
+
{
|
|
7594
|
+
ref: topSentinelRef,
|
|
7595
|
+
"data-og-top-sentinel": "",
|
|
7596
|
+
"data-og-timeline-chrome": "",
|
|
7597
|
+
"aria-hidden": "true",
|
|
7598
|
+
className: "pointer-events-none absolute inset-x-0 -top-16 h-px -translate-y-full"
|
|
7599
|
+
}
|
|
7600
|
+
)
|
|
7601
|
+
) : null,
|
|
7602
|
+
groups.map(({ group, key, entranceEnabled }, index) => {
|
|
7603
|
+
return /* @__PURE__ */ jsx17(
|
|
7604
|
+
TimelineSearchRevealContext.Provider,
|
|
7605
|
+
{
|
|
7606
|
+
value: searchItem && timelineGroupItemIds(group).includes(searchItem.id) ? searchRevealKey : null,
|
|
7607
|
+
children: /* @__PURE__ */ jsx17(
|
|
7608
|
+
TimelineGroupEntry,
|
|
7609
|
+
{
|
|
7610
|
+
groupKey: key,
|
|
7611
|
+
group,
|
|
7612
|
+
nextGroup: groups[index + 1]?.group,
|
|
7613
|
+
startupDismissed: group.kind === "activity" && group.items.some(
|
|
7614
|
+
(item) => item.turnId && turnsWithOutput.has(item.turnId)
|
|
7615
|
+
),
|
|
7616
|
+
entranceEnabled,
|
|
7617
|
+
liveEntranceEnabled: group.kind === "activity" ? !bulkRender : void 0,
|
|
7618
|
+
context: timelineGroupEntryContext
|
|
7738
7619
|
}
|
|
7739
7620
|
)
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7621
|
+
},
|
|
7622
|
+
key
|
|
7623
|
+
);
|
|
7624
|
+
}),
|
|
7625
|
+
groups.length > 0 && trailingState ? /* @__PURE__ */ jsx17("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
|
|
7626
|
+
hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs12(
|
|
7627
|
+
"div",
|
|
7628
|
+
{
|
|
7629
|
+
"data-og-newer-error": "",
|
|
7630
|
+
className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
|
|
7631
|
+
children: [
|
|
7632
|
+
/* @__PURE__ */ jsxs12("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
|
|
7633
|
+
"Couldn\u2019t load later activity. ",
|
|
7634
|
+
newerFailure.message
|
|
7635
|
+
] }),
|
|
7636
|
+
/* @__PURE__ */ jsx17(
|
|
7637
|
+
"button",
|
|
7749
7638
|
{
|
|
7750
|
-
ref:
|
|
7751
|
-
|
|
7752
|
-
"data-og-
|
|
7753
|
-
"
|
|
7754
|
-
|
|
7639
|
+
ref: newerRetryButtonRef,
|
|
7640
|
+
type: "button",
|
|
7641
|
+
"data-og-retry-newer": "",
|
|
7642
|
+
className: "min-h-11 rounded-og-md border border-og-border px-3 py-2 text-og-fg hover:bg-og-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent",
|
|
7643
|
+
"aria-disabled": loadingNewer || newerRetryPending,
|
|
7644
|
+
"aria-busy": newerRetryPending,
|
|
7645
|
+
onClick: () => requestNewer(true),
|
|
7646
|
+
children: newerRetryPending ? "Retrying later activity\u2026" : "Retry later activity"
|
|
7755
7647
|
}
|
|
7756
7648
|
)
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
),
|
|
7772
|
-
entranceEnabled,
|
|
7773
|
-
liveEntranceEnabled: group.kind === "activity" ? !bulkRender : void 0,
|
|
7774
|
-
context: timelineGroupEntryContext
|
|
7775
|
-
}
|
|
7776
|
-
)
|
|
7777
|
-
},
|
|
7778
|
-
key
|
|
7779
|
-
);
|
|
7780
|
-
}),
|
|
7781
|
-
groups.length > 0 && trailingState ? /* @__PURE__ */ jsx18("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
|
|
7782
|
-
hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs13(
|
|
7783
|
-
"div",
|
|
7784
|
-
{
|
|
7785
|
-
"data-og-newer-error": "",
|
|
7786
|
-
className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
|
|
7787
|
-
children: [
|
|
7788
|
-
/* @__PURE__ */ jsxs13("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
|
|
7789
|
-
"Couldn\u2019t load later activity. ",
|
|
7790
|
-
newerFailure.message
|
|
7791
|
-
] }),
|
|
7792
|
-
/* @__PURE__ */ jsx18(
|
|
7793
|
-
"button",
|
|
7794
|
-
{
|
|
7795
|
-
ref: newerRetryButtonRef,
|
|
7796
|
-
type: "button",
|
|
7797
|
-
"data-og-retry-newer": "",
|
|
7798
|
-
className: "min-h-11 rounded-og-md border border-og-border px-3 py-2 text-og-fg hover:bg-og-surface-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent",
|
|
7799
|
-
"aria-disabled": loadingNewer || newerRetryPending,
|
|
7800
|
-
"aria-busy": newerRetryPending,
|
|
7801
|
-
onClick: () => requestNewer(true),
|
|
7802
|
-
children: newerRetryPending ? "Retrying later activity\u2026" : "Retry later activity"
|
|
7803
|
-
}
|
|
7804
|
-
)
|
|
7805
|
-
]
|
|
7806
|
-
}
|
|
7807
|
-
) : null,
|
|
7808
|
-
hasNewer ? /* @__PURE__ */ jsx18(
|
|
7809
|
-
"div",
|
|
7810
|
-
{
|
|
7811
|
-
ref: bottomSentinelRef,
|
|
7812
|
-
"data-og-bottom-sentinel": "",
|
|
7813
|
-
"data-og-timeline-chrome": "",
|
|
7814
|
-
"aria-hidden": "true",
|
|
7815
|
-
className: "h-px w-full"
|
|
7816
|
-
}
|
|
7817
|
-
) : null
|
|
7818
|
-
] })
|
|
7819
|
-
}
|
|
7820
|
-
)
|
|
7821
|
-
}
|
|
7822
|
-
),
|
|
7823
|
-
draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
7824
|
-
TimelineAnnotationMarkers,
|
|
7825
|
-
{
|
|
7826
|
-
rootRef: scrollRef,
|
|
7827
|
-
annotations: draftAnnotations,
|
|
7828
|
-
onSelect: onDraftAnnotationSelect
|
|
7829
|
-
}
|
|
7830
|
-
) }) : null,
|
|
7831
|
-
/* @__PURE__ */ jsx18(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsx18(
|
|
7832
|
-
motion3.div,
|
|
7833
|
-
{
|
|
7834
|
-
initial: { opacity: 0, y: -6 },
|
|
7835
|
-
animate: { opacity: 1, y: 0 },
|
|
7836
|
-
exit: { opacity: 0, y: -6 },
|
|
7837
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
7838
|
-
"data-og-question-nav": "",
|
|
7839
|
-
"data-og-pill-placement": questionPillPlacement,
|
|
7840
|
-
className: cn(
|
|
7841
|
-
"pointer-events-none absolute inset-x-0 top-11 z-10 flex px-4 sm:px-6 pointer-coarse:top-14",
|
|
7842
|
-
QUESTION_PILL_PLACEMENT_CLASS[questionPillPlacement]
|
|
7843
|
-
),
|
|
7844
|
-
children: /* @__PURE__ */ jsxs13(
|
|
7845
|
-
motion3.div,
|
|
7846
|
-
{
|
|
7847
|
-
ref: questionPillRef,
|
|
7848
|
-
layout: "position",
|
|
7849
|
-
transition: { duration: 0.18, ease: "easeOut" },
|
|
7850
|
-
className: "pointer-events-auto inline-flex max-w-[calc(50%-0.5rem)] items-center rounded-full border border-og-border bg-og-surface-3/90 text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
7851
|
-
children: [
|
|
7852
|
-
/* @__PURE__ */ jsxs13(
|
|
7853
|
-
"button",
|
|
7854
|
-
{
|
|
7855
|
-
type: "button",
|
|
7856
|
-
"data-og-jump-to-question": "",
|
|
7857
|
-
onClick: () => void jumpToLatestQuestion(),
|
|
7858
|
-
disabled: questionPending,
|
|
7859
|
-
"aria-busy": questionPending,
|
|
7860
|
-
title: questionError ?? void 0,
|
|
7861
|
-
className: "inline-flex min-w-0 items-center gap-1.5 px-3 py-1.5 hover:text-og-fg pointer-coarse:min-h-11",
|
|
7862
|
-
children: [
|
|
7863
|
-
/* @__PURE__ */ jsx18(ArrowUpIcon, { "aria-hidden": true, className: "size-3.5" }),
|
|
7864
|
-
"Latest question"
|
|
7865
|
-
]
|
|
7866
|
-
}
|
|
7867
|
-
),
|
|
7868
|
-
questionError && /* @__PURE__ */ jsx18("span", { role: "status", className: "px-2 text-og-xs", children: questionError })
|
|
7869
|
-
]
|
|
7870
|
-
}
|
|
7871
|
-
)
|
|
7872
|
-
},
|
|
7873
|
-
"question-nav"
|
|
7874
|
-
) : null }),
|
|
7875
|
-
/* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx18(
|
|
7876
|
-
motion3.div,
|
|
7877
|
-
{
|
|
7878
|
-
initial: { opacity: 0, y: 6 },
|
|
7879
|
-
animate: { opacity: 1, y: 0 },
|
|
7880
|
-
exit: { opacity: 0, y: 6 },
|
|
7881
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
7882
|
-
"data-og-loading-newer": "",
|
|
7883
|
-
"aria-live": "polite",
|
|
7884
|
-
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
7885
|
-
children: /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
7649
|
+
]
|
|
7650
|
+
}
|
|
7651
|
+
) : null,
|
|
7652
|
+
hasNewer ? /* @__PURE__ */ jsx17(
|
|
7653
|
+
"div",
|
|
7654
|
+
{
|
|
7655
|
+
ref: bottomSentinelRef,
|
|
7656
|
+
"data-og-bottom-sentinel": "",
|
|
7657
|
+
"data-og-timeline-chrome": "",
|
|
7658
|
+
"aria-hidden": "true",
|
|
7659
|
+
className: "h-px w-full"
|
|
7660
|
+
}
|
|
7661
|
+
) : null
|
|
7662
|
+
] })
|
|
7886
7663
|
}
|
|
7887
|
-
)
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7664
|
+
)
|
|
7665
|
+
}
|
|
7666
|
+
),
|
|
7667
|
+
draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */ jsx17(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
7668
|
+
TimelineAnnotationMarkers,
|
|
7669
|
+
{
|
|
7670
|
+
rootRef: scrollRef,
|
|
7671
|
+
annotations: draftAnnotations,
|
|
7672
|
+
onSelect: onDraftAnnotationSelect
|
|
7673
|
+
}
|
|
7674
|
+
) }) : null,
|
|
7675
|
+
/* @__PURE__ */ jsx17(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsx17(
|
|
7676
|
+
motion3.div,
|
|
7677
|
+
{
|
|
7678
|
+
initial: { opacity: 0, y: -6 },
|
|
7679
|
+
animate: { opacity: 1, y: 0 },
|
|
7680
|
+
exit: { opacity: 0, y: -6 },
|
|
7681
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
7682
|
+
"data-og-question-nav": "",
|
|
7683
|
+
className: "pointer-events-none absolute inset-x-0 top-11 z-10 flex justify-end px-4 sm:px-6 pointer-coarse:top-14",
|
|
7684
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "pointer-events-auto inline-flex max-w-[calc(50%-0.5rem)] items-center rounded-full border border-og-border bg-og-surface-3/90 text-og-control font-medium text-og-fg shadow-og-md backdrop-blur", children: [
|
|
7685
|
+
/* @__PURE__ */ jsxs12(
|
|
7686
|
+
"button",
|
|
7687
|
+
{
|
|
7688
|
+
type: "button",
|
|
7689
|
+
"data-og-jump-to-question": "",
|
|
7690
|
+
onClick: () => void jumpToLatestQuestion(),
|
|
7691
|
+
disabled: questionPending,
|
|
7692
|
+
"aria-busy": questionPending,
|
|
7693
|
+
title: questionError ?? void 0,
|
|
7694
|
+
className: "inline-flex min-w-0 items-center gap-1.5 px-3 py-1.5 hover:text-og-fg pointer-coarse:min-h-11",
|
|
7695
|
+
children: [
|
|
7696
|
+
/* @__PURE__ */ jsx17(ArrowUpIcon, { "aria-hidden": true, className: "size-3.5" }),
|
|
7697
|
+
"Latest question"
|
|
7698
|
+
]
|
|
7699
|
+
}
|
|
7700
|
+
),
|
|
7701
|
+
questionError && /* @__PURE__ */ jsx17("span", { role: "status", className: "px-2 text-og-xs", children: questionError })
|
|
7702
|
+
] })
|
|
7703
|
+
},
|
|
7704
|
+
"question-nav"
|
|
7705
|
+
) : null }),
|
|
7706
|
+
/* @__PURE__ */ jsx17(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx17(
|
|
7707
|
+
motion3.div,
|
|
7708
|
+
{
|
|
7709
|
+
initial: { opacity: 0, y: 6 },
|
|
7710
|
+
animate: { opacity: 1, y: 0 },
|
|
7711
|
+
exit: { opacity: 0, y: 6 },
|
|
7712
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
7713
|
+
"data-og-loading-newer": "",
|
|
7714
|
+
"aria-live": "polite",
|
|
7715
|
+
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
7716
|
+
children: /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
7717
|
+
}
|
|
7718
|
+
) : null }),
|
|
7719
|
+
/* @__PURE__ */ jsx17(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer || canSkipTipCatchup) && autoFollow ? /* @__PURE__ */ jsxs12(
|
|
7720
|
+
motion3.button,
|
|
7721
|
+
{
|
|
7722
|
+
type: "button",
|
|
7723
|
+
"data-og-jump-to-latest": "",
|
|
7724
|
+
initial: { opacity: 0, y: 8 },
|
|
7725
|
+
animate: { opacity: 1, y: 0 },
|
|
7726
|
+
exit: { opacity: 0, y: 8 },
|
|
7727
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
7728
|
+
onClick: () => {
|
|
7729
|
+
const viewport = scrollRef.current;
|
|
7730
|
+
const selection = viewport?.ownerDocument.getSelection();
|
|
7731
|
+
if (selection && !selection.isCollapsed && (viewport?.contains(selection.anchorNode) || viewport?.contains(selection.focusNode)))
|
|
7732
|
+
selection.removeAllRanges();
|
|
7733
|
+
disclosureKeepsUnpinnedRef.current = false;
|
|
7734
|
+
if (hasNewer) {
|
|
7735
|
+
wantPinRef.current = true;
|
|
7736
|
+
const node2 = scrollRef.current;
|
|
7737
|
+
if (onJumpToLatest) {
|
|
7738
|
+
void Promise.resolve(onJumpToLatest()).then(
|
|
7739
|
+
() => {
|
|
7740
|
+
const current = scrollRef.current;
|
|
7741
|
+
if (current && wantPinRef.current && !hasNewerRef.current) {
|
|
7742
|
+
wantPinRef.current = false;
|
|
7743
|
+
applyPinned(true);
|
|
7744
|
+
snapToBottom(current);
|
|
7745
|
+
}
|
|
7746
|
+
},
|
|
7747
|
+
() => {
|
|
7748
|
+
wantPinRef.current = false;
|
|
7925
7749
|
}
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
snapToBottom(node);
|
|
7932
|
-
}
|
|
7933
|
-
},
|
|
7934
|
-
className: cn(
|
|
7935
|
-
"absolute bottom-4 w-fit",
|
|
7936
|
-
JUMP_PILL_PLACEMENT_CLASS[jumpPillPlacement],
|
|
7937
|
-
"inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
|
|
7938
|
-
"text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
7939
|
-
"hover:border-og-border-strong"
|
|
7940
|
-
),
|
|
7941
|
-
children: [
|
|
7942
|
-
/* @__PURE__ */ jsx18(ArrowDownIcon, { className: "size-3.5" }),
|
|
7943
|
-
"Jump to latest"
|
|
7944
|
-
]
|
|
7750
|
+
);
|
|
7751
|
+
} else if (node2) {
|
|
7752
|
+
snapToBottom(node2);
|
|
7753
|
+
}
|
|
7754
|
+
return;
|
|
7945
7755
|
}
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7756
|
+
const node = scrollRef.current;
|
|
7757
|
+
if (node) {
|
|
7758
|
+
applyPinned(true);
|
|
7759
|
+
snapToBottom(node);
|
|
7760
|
+
}
|
|
7761
|
+
},
|
|
7762
|
+
className: cn(
|
|
7763
|
+
"absolute inset-x-0 bottom-4 mx-auto w-fit",
|
|
7764
|
+
"inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
|
|
7765
|
+
"text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
7766
|
+
"hover:border-og-border-strong"
|
|
7767
|
+
),
|
|
7768
|
+
children: [
|
|
7769
|
+
/* @__PURE__ */ jsx17(ArrowDownIcon, { className: "size-3.5" }),
|
|
7770
|
+
"Jump to latest"
|
|
7771
|
+
]
|
|
7772
|
+
}
|
|
7773
|
+
) : null })
|
|
7774
|
+
]
|
|
7950
7775
|
}
|
|
7951
|
-
);
|
|
7952
|
-
return /* @__PURE__ */
|
|
7776
|
+
) }) }) }) }) }) }) });
|
|
7777
|
+
return /* @__PURE__ */ jsx17(OpenGeniLinkProvider, { resolveLink, children: timeline });
|
|
7953
7778
|
}
|
|
7954
7779
|
function timelineGroupsRenderEqual(previous, next) {
|
|
7955
7780
|
try {
|
|
@@ -7960,7 +7785,7 @@ function timelineGroupsRenderEqual(previous, next) {
|
|
|
7960
7785
|
}
|
|
7961
7786
|
function useStableTimelineGroupKeys(allGroups, entranceEnabled) {
|
|
7962
7787
|
const previousRef = useRef9([]);
|
|
7963
|
-
const keyedGroups =
|
|
7788
|
+
const keyedGroups = useMemo4(() => {
|
|
7964
7789
|
const previousByItemId = /* @__PURE__ */ new Map();
|
|
7965
7790
|
for (const previous of previousRef.current) {
|
|
7966
7791
|
for (const itemId of timelineGroupItemIds(previous.group)) {
|
|
@@ -8035,17 +7860,17 @@ var TimelineGroupRenderBoundary = class extends Component3 {
|
|
|
8035
7860
|
}
|
|
8036
7861
|
render() {
|
|
8037
7862
|
if (this.state.failed) {
|
|
8038
|
-
return /* @__PURE__ */
|
|
7863
|
+
return /* @__PURE__ */ jsxs12(
|
|
8039
7864
|
"div",
|
|
8040
7865
|
{
|
|
8041
7866
|
"data-testid": "timeline-group-render-error",
|
|
8042
7867
|
role: "status",
|
|
8043
7868
|
className: "flex items-start gap-2 rounded-lg border border-og-border bg-og-surface-muted px-3 py-2 text-og-menu text-og-fg-muted",
|
|
8044
7869
|
children: [
|
|
8045
|
-
/* @__PURE__ */
|
|
8046
|
-
/* @__PURE__ */
|
|
8047
|
-
/* @__PURE__ */
|
|
8048
|
-
/* @__PURE__ */
|
|
7870
|
+
/* @__PURE__ */ jsx17(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
7871
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
7872
|
+
/* @__PURE__ */ jsx17("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
|
|
7873
|
+
/* @__PURE__ */ jsx17("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
|
|
8049
7874
|
] })
|
|
8050
7875
|
]
|
|
8051
7876
|
}
|
|
@@ -8066,7 +7891,7 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
|
|
|
8066
7891
|
const reducedMotion = useReducedMotion3();
|
|
8067
7892
|
const { behavior, userMessageDisclosureContext } = context;
|
|
8068
7893
|
const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && nextGroup?.kind === "item" && nextGroup.item.kind === "context-compaction" && nextGroup.item.phase === "compacted" ? 1 : 0;
|
|
8069
|
-
const content = /* @__PURE__ */
|
|
7894
|
+
const content = /* @__PURE__ */ jsx17(ActivityNoteTextContext.Provider, { value: behavior.renderMessageText ?? null, children: /* @__PURE__ */ jsx17(
|
|
8070
7895
|
TimelineGroupView,
|
|
8071
7896
|
{
|
|
8072
7897
|
...behavior,
|
|
@@ -8077,14 +7902,14 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
|
|
|
8077
7902
|
contextCompactionCount: contextCompactionCount > 0 ? contextCompactionCount : void 0
|
|
8078
7903
|
}
|
|
8079
7904
|
) });
|
|
8080
|
-
return /* @__PURE__ */
|
|
7905
|
+
return /* @__PURE__ */ jsx17(GenieLoadingOptionsContext.Provider, { value: behavior.genieLoading, children: /* @__PURE__ */ jsx17(
|
|
8081
7906
|
"div",
|
|
8082
7907
|
{
|
|
8083
7908
|
"data-og-timeline-group-anchor": "",
|
|
8084
7909
|
"data-og-group-key": groupKey,
|
|
8085
7910
|
"data-og-prompt": group.kind === "item" && group.item.kind === "user-message" ? "" : void 0,
|
|
8086
7911
|
tabIndex: group.kind === "item" && group.item.kind === "user-message" ? -1 : void 0,
|
|
8087
|
-
children: /* @__PURE__ */
|
|
7912
|
+
children: /* @__PURE__ */ jsx17(EntranceAnimationProvider, { value: entranceEnabled, liveValue: liveEntranceEnabled, children: /* @__PURE__ */ jsx17(TimelineGroupRenderBoundary, { resetKeys: [group, behavior], children: /* @__PURE__ */ jsx17(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: group.kind === "item" ? /* @__PURE__ */ jsx17("div", { children: content }) : /* @__PURE__ */ jsx17(AnimatePresence3, { initial: false, children: /* @__PURE__ */ jsx17(
|
|
8088
7913
|
motion3.div,
|
|
8089
7914
|
{
|
|
8090
7915
|
initial: false,
|
|
@@ -8150,7 +7975,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8150
7975
|
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
8151
7976
|
) && !phases.some((item) => item.status === "failed" || item.status === "cancelled");
|
|
8152
7977
|
if (preparing) {
|
|
8153
|
-
return /* @__PURE__ */
|
|
7978
|
+
return /* @__PURE__ */ jsx17(
|
|
8154
7979
|
ActivityRail,
|
|
8155
7980
|
{
|
|
8156
7981
|
items: group.items,
|
|
@@ -8168,7 +7993,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8168
7993
|
const status = end ? { kind: "worked", durationMs: durationBetween(group.work.startedAt, end) } : group.work.waiting ? { kind: "waiting", ...group.work.waiting } : {
|
|
8169
7994
|
kind: "working",
|
|
8170
7995
|
since: group.work.startedAt,
|
|
8171
|
-
preview: containsPresentedImage ? void 0 : /* @__PURE__ */
|
|
7996
|
+
preview: containsPresentedImage ? void 0 : /* @__PURE__ */ jsx17(
|
|
8172
7997
|
RollingActivity,
|
|
8173
7998
|
{
|
|
8174
7999
|
items: group.items,
|
|
@@ -8177,7 +8002,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8177
8002
|
}
|
|
8178
8003
|
)
|
|
8179
8004
|
};
|
|
8180
|
-
return /* @__PURE__ */
|
|
8005
|
+
return /* @__PURE__ */ jsx17(
|
|
8181
8006
|
TurnSummary,
|
|
8182
8007
|
{
|
|
8183
8008
|
items: group.items,
|
|
@@ -8188,7 +8013,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8188
8013
|
defaultOpen: containsPresentedImage || group.outcome === "failed" || phases.some((item) => item.status === "failed" || item.status === "cancelled") ? true : void 0,
|
|
8189
8014
|
facets: turnSummary?.facets,
|
|
8190
8015
|
contextCompactionCount: compactedLandmarkCount(group.work.details),
|
|
8191
|
-
children: /* @__PURE__ */
|
|
8016
|
+
children: /* @__PURE__ */ jsx17(TurnRailFrame, { compact: true, children: renderFoldedGroups(
|
|
8192
8017
|
group.work.details,
|
|
8193
8018
|
{
|
|
8194
8019
|
renderMessageActions,
|
|
@@ -8213,7 +8038,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8213
8038
|
if (!startupDetails && !insideTurn && !group.outcome && group.items.every(
|
|
8214
8039
|
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
8215
8040
|
)) {
|
|
8216
|
-
return /* @__PURE__ */
|
|
8041
|
+
return /* @__PURE__ */ jsx17(
|
|
8217
8042
|
ActivityRail,
|
|
8218
8043
|
{
|
|
8219
8044
|
items: group.items,
|
|
@@ -8228,7 +8053,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8228
8053
|
);
|
|
8229
8054
|
}
|
|
8230
8055
|
if (turnSummary?.rolling && insideTurn && !startupDetails && !hasRememberedImageFold && group.items.filter((item) => item.kind !== "startup-phase").length === 1) {
|
|
8231
|
-
return /* @__PURE__ */
|
|
8056
|
+
return /* @__PURE__ */ jsx17(
|
|
8232
8057
|
ActivityRail,
|
|
8233
8058
|
{
|
|
8234
8059
|
items: group.items,
|
|
@@ -8247,7 +8072,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8247
8072
|
const singleThought = !startupDetails && visibleActivity.length === 1 && visibleActivity[0]?.kind === "reasoning";
|
|
8248
8073
|
const useNestedChip = nestClusterChips && (activityShouldFold || hasRememberedImageFold) && !singleThought;
|
|
8249
8074
|
if (!useNestedChip) {
|
|
8250
|
-
return /* @__PURE__ */
|
|
8075
|
+
return /* @__PURE__ */ jsx17(
|
|
8251
8076
|
ActivityRail,
|
|
8252
8077
|
{
|
|
8253
8078
|
items: group.items,
|
|
@@ -8261,7 +8086,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8261
8086
|
}
|
|
8262
8087
|
);
|
|
8263
8088
|
}
|
|
8264
|
-
return /* @__PURE__ */
|
|
8089
|
+
return /* @__PURE__ */ jsx17(
|
|
8265
8090
|
TurnSummary,
|
|
8266
8091
|
{
|
|
8267
8092
|
items: group.items,
|
|
@@ -8272,7 +8097,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8272
8097
|
foldKey: group.id,
|
|
8273
8098
|
facets: turnSummary?.facets,
|
|
8274
8099
|
contextCompactionCount,
|
|
8275
|
-
children: /* @__PURE__ */
|
|
8100
|
+
children: /* @__PURE__ */ jsx17(
|
|
8276
8101
|
ActivityRail,
|
|
8277
8102
|
{
|
|
8278
8103
|
items: group.items,
|
|
@@ -8288,14 +8113,14 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8288
8113
|
settleChrome ? "settle" : "rest"
|
|
8289
8114
|
);
|
|
8290
8115
|
}
|
|
8291
|
-
return /* @__PURE__ */
|
|
8116
|
+
return /* @__PURE__ */ jsx17(
|
|
8292
8117
|
TurnSummary,
|
|
8293
8118
|
{
|
|
8294
8119
|
items: group.items,
|
|
8295
8120
|
outcome: group.outcome,
|
|
8296
8121
|
failureText: group.failureText,
|
|
8297
8122
|
defaultOpen: group.outcome === "failed" || containsPresentedImage || !turnSummary?.rolling && !activityShouldFold ? true : void 0,
|
|
8298
|
-
liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */
|
|
8123
|
+
liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */ jsx17(
|
|
8299
8124
|
RollingActivity,
|
|
8300
8125
|
{
|
|
8301
8126
|
items: group.items,
|
|
@@ -8307,7 +8132,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8307
8132
|
facets: turnSummary?.facets,
|
|
8308
8133
|
settleFold,
|
|
8309
8134
|
contextCompactionCount,
|
|
8310
|
-
children: /* @__PURE__ */
|
|
8135
|
+
children: /* @__PURE__ */ jsx17(FoldBody, { children: /* @__PURE__ */ jsx17(TurnRailFrame, { children: /* @__PURE__ */ jsx17(
|
|
8311
8136
|
ActivityRail,
|
|
8312
8137
|
{
|
|
8313
8138
|
items: group.items,
|
|
@@ -8329,7 +8154,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8329
8154
|
(item) => item.kind === "startup-phase" && item.status === "complete"
|
|
8330
8155
|
)
|
|
8331
8156
|
))
|
|
8332
|
-
return /* @__PURE__ */
|
|
8157
|
+
return /* @__PURE__ */ jsx17(ActivityRail, { items: activityItems, startupActive: false, bare: true });
|
|
8333
8158
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
8334
8159
|
const body = renderFoldedGroups(group.groups, {
|
|
8335
8160
|
renderMessageActions,
|
|
@@ -8346,7 +8171,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8346
8171
|
turnSummary
|
|
8347
8172
|
});
|
|
8348
8173
|
const durationMs = durationBetween(group.startedAt, group.endedAt);
|
|
8349
|
-
return /* @__PURE__ */
|
|
8174
|
+
return /* @__PURE__ */ jsx17(
|
|
8350
8175
|
TurnSummary,
|
|
8351
8176
|
{
|
|
8352
8177
|
items: activityItems,
|
|
@@ -8360,16 +8185,16 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8360
8185
|
settleFold,
|
|
8361
8186
|
copyText: insideTurn ? void 0 : turnCopyText,
|
|
8362
8187
|
contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
|
|
8363
|
-
children: /* @__PURE__ */
|
|
8188
|
+
children: /* @__PURE__ */ jsx17(FoldBody, { children: insideTurn ? (
|
|
8364
8189
|
// A nested turn is already on an ancestor rail — its body just stacks
|
|
8365
8190
|
// flush (the bare-node body already indents it), so no second rule.
|
|
8366
|
-
/* @__PURE__ */
|
|
8367
|
-
) : /* @__PURE__ */
|
|
8191
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4", children: body })
|
|
8192
|
+
) : /* @__PURE__ */ jsx17(TurnRailFrame, { children: body }) })
|
|
8368
8193
|
}
|
|
8369
8194
|
);
|
|
8370
8195
|
}
|
|
8371
8196
|
case "item":
|
|
8372
|
-
return /* @__PURE__ */
|
|
8197
|
+
return /* @__PURE__ */ jsx17(
|
|
8373
8198
|
TimelineRow,
|
|
8374
8199
|
{
|
|
8375
8200
|
item: group.item,
|
|
@@ -8386,7 +8211,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8386
8211
|
});
|
|
8387
8212
|
function renderFoldedGroups(groups, behavior, readableWork = false) {
|
|
8388
8213
|
const nestClusters = foldableActivityClusterCount(groups) >= 2;
|
|
8389
|
-
return groups.map((child, index) => /* @__PURE__ */
|
|
8214
|
+
return groups.map((child, index) => /* @__PURE__ */ jsx17(
|
|
8390
8215
|
TimelineGroupRenderBoundary,
|
|
8391
8216
|
{
|
|
8392
8217
|
resetKeys: [
|
|
@@ -8404,13 +8229,13 @@ function renderFoldedGroups(groups, behavior, readableWork = false) {
|
|
|
8404
8229
|
behavior.loadVideoArtifactPlayback,
|
|
8405
8230
|
behavior.turnSummary
|
|
8406
8231
|
],
|
|
8407
|
-
children: readableWork ? /* @__PURE__ */
|
|
8232
|
+
children: readableWork ? /* @__PURE__ */ jsx17(
|
|
8408
8233
|
"div",
|
|
8409
8234
|
{
|
|
8410
8235
|
className: index > 0 && (child.kind !== "activity" || groups[index - 1]?.kind !== "activity") ? "mt-3" : void 0,
|
|
8411
|
-
children: /* @__PURE__ */
|
|
8236
|
+
children: /* @__PURE__ */ jsx17(TimelineGroupView, { ...behavior, group: child, insideTurn: true, startupDismissed: true })
|
|
8412
8237
|
}
|
|
8413
|
-
) : /* @__PURE__ */
|
|
8238
|
+
) : /* @__PURE__ */ jsx17(TimelineGroupView, { ...behavior, group: child, insideTurn: true, nestClusterChips: nestClusters })
|
|
8414
8239
|
},
|
|
8415
8240
|
timelineGroupKey(child)
|
|
8416
8241
|
));
|
|
@@ -8421,10 +8246,10 @@ function compactedLandmarkCount(groups) {
|
|
|
8421
8246
|
).length;
|
|
8422
8247
|
}
|
|
8423
8248
|
function FoldBody({ children }) {
|
|
8424
|
-
return /* @__PURE__ */
|
|
8249
|
+
return /* @__PURE__ */ jsx17(Fragment5, { children });
|
|
8425
8250
|
}
|
|
8426
8251
|
function TurnRailFrame({ children, compact = false }) {
|
|
8427
|
-
return /* @__PURE__ */
|
|
8252
|
+
return /* @__PURE__ */ jsx17(
|
|
8428
8253
|
"div",
|
|
8429
8254
|
{
|
|
8430
8255
|
className: cn(
|
|
@@ -8615,7 +8440,7 @@ function TimelineRow({
|
|
|
8615
8440
|
}) {
|
|
8616
8441
|
switch (item.kind) {
|
|
8617
8442
|
case "user-message":
|
|
8618
|
-
return /* @__PURE__ */
|
|
8443
|
+
return /* @__PURE__ */ jsx17(
|
|
8619
8444
|
UserMessageRow,
|
|
8620
8445
|
{
|
|
8621
8446
|
item,
|
|
@@ -8624,9 +8449,9 @@ function TimelineRow({
|
|
|
8624
8449
|
}
|
|
8625
8450
|
);
|
|
8626
8451
|
case "human-input":
|
|
8627
|
-
return /* @__PURE__ */
|
|
8452
|
+
return /* @__PURE__ */ jsx17(HumanInputConversationRow, { item });
|
|
8628
8453
|
case "agent-message":
|
|
8629
|
-
return /* @__PURE__ */
|
|
8454
|
+
return /* @__PURE__ */ jsx17(
|
|
8630
8455
|
AgentMessageRow,
|
|
8631
8456
|
{
|
|
8632
8457
|
item,
|
|
@@ -8635,13 +8460,13 @@ function TimelineRow({
|
|
|
8635
8460
|
}
|
|
8636
8461
|
);
|
|
8637
8462
|
case "worker-completion":
|
|
8638
|
-
return /* @__PURE__ */
|
|
8463
|
+
return /* @__PURE__ */ jsx17(WorkerCompletionRow, { item, onOpenSession });
|
|
8639
8464
|
case "session-status":
|
|
8640
|
-
return /* @__PURE__ */
|
|
8465
|
+
return /* @__PURE__ */ jsx17(SessionStatusRow, { item });
|
|
8641
8466
|
case "goal":
|
|
8642
|
-
return /* @__PURE__ */
|
|
8467
|
+
return /* @__PURE__ */ jsx17(GoalRow, { item });
|
|
8643
8468
|
case "machine-input-batch":
|
|
8644
|
-
return /* @__PURE__ */
|
|
8469
|
+
return /* @__PURE__ */ jsx17(
|
|
8645
8470
|
MachineInputBatchRow,
|
|
8646
8471
|
{
|
|
8647
8472
|
item,
|
|
@@ -8650,11 +8475,11 @@ function TimelineRow({
|
|
|
8650
8475
|
}
|
|
8651
8476
|
);
|
|
8652
8477
|
case "notice":
|
|
8653
|
-
return /* @__PURE__ */
|
|
8478
|
+
return /* @__PURE__ */ jsx17(NoticeRow, { item });
|
|
8654
8479
|
case "context-compaction":
|
|
8655
|
-
return /* @__PURE__ */
|
|
8480
|
+
return /* @__PURE__ */ jsx17(CompactionRow, { item });
|
|
8656
8481
|
case "auth-needed":
|
|
8657
|
-
return renderAuthNeeded?.(item) ?? /* @__PURE__ */
|
|
8482
|
+
return renderAuthNeeded?.(item) ?? /* @__PURE__ */ jsx17(
|
|
8658
8483
|
AuthNeededRow,
|
|
8659
8484
|
{
|
|
8660
8485
|
item,
|
|
@@ -8680,7 +8505,7 @@ function CompactionRow({ item }) {
|
|
|
8680
8505
|
const title = item.phase === "started" ? "Compacting conversation history\u2026" : item.phase === "compacted" ? before && after ? `Conversation history compacted \xB7 ~${before} \u2192 ~${after} estimated history tokens` : "Conversation history compacted" : "Couldn\u2019t compact conversation history";
|
|
8681
8506
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason, item.providerRejection) : null;
|
|
8682
8507
|
const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ? WAITING_PILL_CLASS : NEUTRAL_PILL;
|
|
8683
|
-
return /* @__PURE__ */
|
|
8508
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs12(
|
|
8684
8509
|
"div",
|
|
8685
8510
|
{
|
|
8686
8511
|
className: cn(
|
|
@@ -8689,20 +8514,20 @@ function CompactionRow({ item }) {
|
|
|
8689
8514
|
),
|
|
8690
8515
|
role: "status",
|
|
8691
8516
|
children: [
|
|
8692
|
-
/* @__PURE__ */
|
|
8693
|
-
/* @__PURE__ */
|
|
8694
|
-
/* @__PURE__ */
|
|
8517
|
+
/* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
8518
|
+
/* @__PURE__ */ jsx17(ShrinkIcon2, { className: "size-3.5 shrink-0" }),
|
|
8519
|
+
/* @__PURE__ */ jsxs12("span", { className: "truncate", children: [
|
|
8695
8520
|
title,
|
|
8696
8521
|
trigger ? ` \xB7 ${trigger}` : ""
|
|
8697
8522
|
] })
|
|
8698
8523
|
] }),
|
|
8699
|
-
subtitle ? /* @__PURE__ */
|
|
8524
|
+
subtitle ? /* @__PURE__ */ jsx17("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
|
|
8700
8525
|
]
|
|
8701
8526
|
}
|
|
8702
8527
|
) });
|
|
8703
8528
|
}
|
|
8704
8529
|
function MessageFooterTime({ occurredAt }) {
|
|
8705
|
-
return /* @__PURE__ */
|
|
8530
|
+
return /* @__PURE__ */ jsx17(
|
|
8706
8531
|
"time",
|
|
8707
8532
|
{
|
|
8708
8533
|
dateTime: occurredAt,
|
|
@@ -8722,28 +8547,28 @@ function UserMessageRow({
|
|
|
8722
8547
|
}) {
|
|
8723
8548
|
const enter = useEntranceAnimation();
|
|
8724
8549
|
const deliveryFailed = item.delivery?.state === "failed";
|
|
8725
|
-
return /* @__PURE__ */
|
|
8726
|
-
/* @__PURE__ */
|
|
8550
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs12("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
|
|
8551
|
+
/* @__PURE__ */ jsx17(
|
|
8727
8552
|
CopyHoverFrame,
|
|
8728
8553
|
{
|
|
8729
8554
|
copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
|
|
8730
8555
|
${annotation.note}`).join("\n\n"),
|
|
8731
8556
|
label: "Copy message",
|
|
8732
8557
|
className: "w-fit max-w-full min-w-0",
|
|
8733
|
-
trailing: /* @__PURE__ */
|
|
8558
|
+
trailing: /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
8734
8559
|
renderMessageActions?.(item),
|
|
8735
|
-
/* @__PURE__ */
|
|
8560
|
+
/* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
8736
8561
|
] }),
|
|
8737
|
-
children: /* @__PURE__ */
|
|
8738
|
-
item.text ? /* @__PURE__ */
|
|
8562
|
+
children: /* @__PURE__ */ jsxs12("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
8563
|
+
item.text ? /* @__PURE__ */ jsx17(
|
|
8739
8564
|
"div",
|
|
8740
8565
|
{
|
|
8741
8566
|
"data-og-search-item": item.id,
|
|
8742
8567
|
"data-og-annotation-source-key": item.annotationSource?.eventId,
|
|
8743
|
-
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
8568
|
+
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx17(Markdown, { children: item.text }) })
|
|
8744
8569
|
}
|
|
8745
8570
|
) : null,
|
|
8746
|
-
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
8571
|
+
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx17(
|
|
8747
8572
|
TimelineAnnotationCards,
|
|
8748
8573
|
{
|
|
8749
8574
|
annotations: item.annotations ?? [],
|
|
@@ -8753,17 +8578,17 @@ ${annotation.note}`).join("\n\n"),
|
|
|
8753
8578
|
] })
|
|
8754
8579
|
}
|
|
8755
8580
|
),
|
|
8756
|
-
deliveryFailed ? /* @__PURE__ */
|
|
8581
|
+
deliveryFailed ? /* @__PURE__ */ jsxs12(
|
|
8757
8582
|
"div",
|
|
8758
8583
|
{
|
|
8759
8584
|
role: "status",
|
|
8760
8585
|
className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-status-failed",
|
|
8761
8586
|
children: [
|
|
8762
|
-
/* @__PURE__ */
|
|
8763
|
-
/* @__PURE__ */
|
|
8764
|
-
/* @__PURE__ */
|
|
8587
|
+
/* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1", title: item.delivery?.error, children: [
|
|
8588
|
+
/* @__PURE__ */ jsx17(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
8589
|
+
/* @__PURE__ */ jsx17("span", { children: "Message not sent" })
|
|
8765
8590
|
] }),
|
|
8766
|
-
item.delivery?.onRetry ? /* @__PURE__ */
|
|
8591
|
+
item.delivery?.onRetry ? /* @__PURE__ */ jsx17(
|
|
8767
8592
|
"button",
|
|
8768
8593
|
{
|
|
8769
8594
|
type: "button",
|
|
@@ -8772,7 +8597,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
8772
8597
|
children: "Retry"
|
|
8773
8598
|
}
|
|
8774
8599
|
) : null,
|
|
8775
|
-
item.delivery?.onRemove ? /* @__PURE__ */
|
|
8600
|
+
item.delivery?.onRemove ? /* @__PURE__ */ jsx17(
|
|
8776
8601
|
"button",
|
|
8777
8602
|
{
|
|
8778
8603
|
type: "button",
|
|
@@ -8794,26 +8619,26 @@ function HumanInputConversationRow({ item }) {
|
|
|
8794
8619
|
);
|
|
8795
8620
|
const settledLabel = item.response.outcome === "answered" ? "You answered" : item.response.outcome === "skipped" ? "Skipped" : item.response.outcome === "expired" ? "Expired" : "Cancelled";
|
|
8796
8621
|
const copyText = humanInputConversationCopyText(item, settledLabel);
|
|
8797
|
-
return /* @__PURE__ */
|
|
8622
|
+
return /* @__PURE__ */ jsxs12(
|
|
8798
8623
|
"div",
|
|
8799
8624
|
{
|
|
8800
8625
|
className: cn(enter && "animate-og-enter", "flex w-full flex-col gap-2.5"),
|
|
8801
8626
|
"data-human-input-history": item.requestId,
|
|
8802
8627
|
children: [
|
|
8803
|
-
/* @__PURE__ */
|
|
8804
|
-
/* @__PURE__ */
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
/* @__PURE__ */
|
|
8807
|
-
/* @__PURE__ */
|
|
8808
|
-
question.label ? /* @__PURE__ */
|
|
8809
|
-
multipleQuestions ? /* @__PURE__ */
|
|
8628
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex max-w-[90%] items-start gap-3 rounded-og-lg rounded-bl-og-xs border border-og-border bg-og-surface-1 px-3.5 py-3 sm:max-w-[82%]", children: [
|
|
8629
|
+
/* @__PURE__ */ jsx17("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/10 text-og-status-waiting", children: /* @__PURE__ */ jsx17(MessageCircleQuestionIcon3, { "aria-hidden": "true", className: "size-4" }) }),
|
|
8630
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
|
|
8631
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
|
|
8632
|
+
/* @__PURE__ */ jsx17("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs12("div", { children: [
|
|
8633
|
+
question.label ? /* @__PURE__ */ jsxs12("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
8634
|
+
multipleQuestions ? /* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
8810
8635
|
index + 1,
|
|
8811
8636
|
"."
|
|
8812
8637
|
] }) : null,
|
|
8813
8638
|
multipleQuestions ? " " : null,
|
|
8814
8639
|
question.label
|
|
8815
8640
|
] }) : null,
|
|
8816
|
-
/* @__PURE__ */
|
|
8641
|
+
/* @__PURE__ */ jsxs12(
|
|
8817
8642
|
"p",
|
|
8818
8643
|
{
|
|
8819
8644
|
className: cn(
|
|
@@ -8821,7 +8646,7 @@ function HumanInputConversationRow({ item }) {
|
|
|
8821
8646
|
question.label && "mt-0.5 text-og-sm text-og-fg-muted"
|
|
8822
8647
|
),
|
|
8823
8648
|
children: [
|
|
8824
|
-
!question.label && multipleQuestions ? /* @__PURE__ */
|
|
8649
|
+
!question.label && multipleQuestions ? /* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
8825
8650
|
index + 1,
|
|
8826
8651
|
"."
|
|
8827
8652
|
] }) : null,
|
|
@@ -8830,29 +8655,29 @@ function HumanInputConversationRow({ item }) {
|
|
|
8830
8655
|
]
|
|
8831
8656
|
}
|
|
8832
8657
|
)
|
|
8833
|
-
] }, question.id)) : /* @__PURE__ */
|
|
8658
|
+
] }, question.id)) : /* @__PURE__ */ jsx17("p", { className: "text-og-sm text-og-fg-muted", children: "The agent requested structured input." }) })
|
|
8834
8659
|
] })
|
|
8835
8660
|
] }),
|
|
8836
|
-
/* @__PURE__ */
|
|
8661
|
+
/* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(
|
|
8837
8662
|
CopyHoverFrame,
|
|
8838
8663
|
{
|
|
8839
8664
|
copyText,
|
|
8840
8665
|
label: "Copy answer",
|
|
8841
8666
|
className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
|
|
8842
|
-
trailing: /* @__PURE__ */
|
|
8843
|
-
children: /* @__PURE__ */
|
|
8844
|
-
/* @__PURE__ */
|
|
8845
|
-
item.response.outcome === "answered" ? /* @__PURE__ */
|
|
8846
|
-
multipleQuestions ? /* @__PURE__ */
|
|
8847
|
-
/* @__PURE__ */
|
|
8667
|
+
trailing: /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8668
|
+
children: /* @__PURE__ */ jsxs12("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
8669
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
|
|
8670
|
+
item.response.outcome === "answered" ? /* @__PURE__ */ jsx17("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs12("div", { children: [
|
|
8671
|
+
multipleQuestions ? /* @__PURE__ */ jsxs12("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
8672
|
+
/* @__PURE__ */ jsxs12("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
8848
8673
|
questionNumberById.get(answer.questionId) ?? answerIndex + 1,
|
|
8849
8674
|
"."
|
|
8850
8675
|
] }),
|
|
8851
8676
|
" ",
|
|
8852
8677
|
answer.label
|
|
8853
8678
|
] }) : null,
|
|
8854
|
-
/* @__PURE__ */
|
|
8855
|
-
] }, answer.questionId)) : /* @__PURE__ */
|
|
8679
|
+
/* @__PURE__ */ jsx17("div", { className: cn("text-og-md text-og-fg", multipleQuestions && "mt-0.5"), children: answer.values.length > 1 ? /* @__PURE__ */ jsx17("ul", { className: "list-disc space-y-0.5 pl-5", children: answer.values.map((value) => /* @__PURE__ */ jsx17("li", { children: value }, `${answer.questionId}-${value}`)) }) : /* @__PURE__ */ jsx17("p", { children: answer.values[0] || "Answered" }) })
|
|
8680
|
+
] }, answer.questionId)) : /* @__PURE__ */ jsx17("p", { children: "Answered" }) }) : null
|
|
8856
8681
|
] })
|
|
8857
8682
|
}
|
|
8858
8683
|
) })
|
|
@@ -8880,19 +8705,19 @@ function AgentMessageRow({
|
|
|
8880
8705
|
renderMessageText
|
|
8881
8706
|
}) {
|
|
8882
8707
|
const enter = useEntranceAnimation();
|
|
8883
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
8884
|
-
return /* @__PURE__ */
|
|
8708
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(Markdown, { streaming: item.streaming, children: item.text });
|
|
8709
|
+
return /* @__PURE__ */ jsx17(
|
|
8885
8710
|
CopyHoverFrame,
|
|
8886
8711
|
{
|
|
8887
8712
|
copyText: item.text,
|
|
8888
8713
|
label: "Copy message",
|
|
8889
8714
|
align: "start",
|
|
8890
8715
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
8891
|
-
trailing: item.streaming ? null : /* @__PURE__ */
|
|
8716
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
8892
8717
|
renderMessageActions?.(item),
|
|
8893
|
-
/* @__PURE__ */
|
|
8718
|
+
/* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
8894
8719
|
] }),
|
|
8895
|
-
children: /* @__PURE__ */
|
|
8720
|
+
children: /* @__PURE__ */ jsx17(
|
|
8896
8721
|
"div",
|
|
8897
8722
|
{
|
|
8898
8723
|
"data-og-wide-table-message": "",
|
|
@@ -8941,7 +8766,7 @@ function WorkerCompletionRow({
|
|
|
8941
8766
|
onOpenSession
|
|
8942
8767
|
}) {
|
|
8943
8768
|
const enter = useEntranceAnimation();
|
|
8944
|
-
const [open, setOpen] =
|
|
8769
|
+
const [open, setOpen] = useState14(false);
|
|
8945
8770
|
const meta = workerCompletionMeta(item);
|
|
8946
8771
|
const Icon = meta.icon;
|
|
8947
8772
|
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && !!item.pausedReason?.trim();
|
|
@@ -8951,17 +8776,17 @@ function WorkerCompletionRow({
|
|
|
8951
8776
|
...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
|
|
8952
8777
|
];
|
|
8953
8778
|
const hasDetails = details.length > 0;
|
|
8954
|
-
return /* @__PURE__ */
|
|
8955
|
-
/* @__PURE__ */
|
|
8956
|
-
/* @__PURE__ */
|
|
8957
|
-
/* @__PURE__ */
|
|
8958
|
-
/* @__PURE__ */
|
|
8959
|
-
item.goalText ? /* @__PURE__ */
|
|
8779
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs12("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
|
|
8780
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-2.5", children: [
|
|
8781
|
+
/* @__PURE__ */ jsx17("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx17(Icon, { className: "size-4" }) }),
|
|
8782
|
+
/* @__PURE__ */ jsx17("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs12("p", { className: "text-og-base leading-5 text-og-fg", children: [
|
|
8783
|
+
/* @__PURE__ */ jsx17("span", { className: "font-medium", children: meta.label }),
|
|
8784
|
+
item.goalText ? /* @__PURE__ */ jsxs12("span", { className: "text-og-fg-muted", children: [
|
|
8960
8785
|
" \xB7 ",
|
|
8961
8786
|
truncate(item.goalText, 90)
|
|
8962
8787
|
] }) : null
|
|
8963
8788
|
] }) }),
|
|
8964
|
-
item.childSessionId && onOpenSession ? /* @__PURE__ */
|
|
8789
|
+
item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs12(
|
|
8965
8790
|
"button",
|
|
8966
8791
|
{
|
|
8967
8792
|
type: "button",
|
|
@@ -8973,13 +8798,13 @@ function WorkerCompletionRow({
|
|
|
8973
8798
|
),
|
|
8974
8799
|
children: [
|
|
8975
8800
|
"View session",
|
|
8976
|
-
/* @__PURE__ */
|
|
8801
|
+
/* @__PURE__ */ jsx17(ArrowRightIcon2, { className: "size-3.5" })
|
|
8977
8802
|
]
|
|
8978
8803
|
}
|
|
8979
8804
|
) : null
|
|
8980
8805
|
] }),
|
|
8981
|
-
hasDetails ? /* @__PURE__ */
|
|
8982
|
-
/* @__PURE__ */
|
|
8806
|
+
hasDetails ? /* @__PURE__ */ jsxs12(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
|
|
8807
|
+
/* @__PURE__ */ jsx17(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
8983
8808
|
"button",
|
|
8984
8809
|
{
|
|
8985
8810
|
type: "button",
|
|
@@ -8988,14 +8813,14 @@ function WorkerCompletionRow({
|
|
|
8988
8813
|
"outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
8989
8814
|
),
|
|
8990
8815
|
children: [
|
|
8991
|
-
/* @__PURE__ */
|
|
8816
|
+
/* @__PURE__ */ jsx17(ChevronRightIcon2, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
|
|
8992
8817
|
open ? "Hide details" : "Show details"
|
|
8993
8818
|
]
|
|
8994
8819
|
}
|
|
8995
8820
|
) }),
|
|
8996
|
-
/* @__PURE__ */
|
|
8997
|
-
/* @__PURE__ */
|
|
8998
|
-
/* @__PURE__ */
|
|
8821
|
+
/* @__PURE__ */ jsx17(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx17("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
|
|
8822
|
+
/* @__PURE__ */ jsx17("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
|
|
8823
|
+
/* @__PURE__ */ jsx17(
|
|
8999
8824
|
"p",
|
|
9000
8825
|
{
|
|
9001
8826
|
className: cn(
|
|
@@ -9014,7 +8839,7 @@ function SessionStatusRow({
|
|
|
9014
8839
|
}) {
|
|
9015
8840
|
const enter = useEntranceAnimation();
|
|
9016
8841
|
const meta = SESSION_STATUS_META[item.status];
|
|
9017
|
-
return /* @__PURE__ */
|
|
8842
|
+
return /* @__PURE__ */ jsxs12(
|
|
9018
8843
|
"div",
|
|
9019
8844
|
{
|
|
9020
8845
|
className: cn(
|
|
@@ -9023,15 +8848,15 @@ function SessionStatusRow({
|
|
|
9023
8848
|
),
|
|
9024
8849
|
role: "status",
|
|
9025
8850
|
children: [
|
|
9026
|
-
/* @__PURE__ */
|
|
9027
|
-
/* @__PURE__ */
|
|
9028
|
-
item.resolvedAt ? null : /* @__PURE__ */
|
|
8851
|
+
/* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" }),
|
|
8852
|
+
/* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
8853
|
+
item.resolvedAt ? null : /* @__PURE__ */ jsx17(StatusDot, { status: item.status, className: "size-1" }),
|
|
9029
8854
|
item.resolvedAt ? "work resumed" : meta.label.toLowerCase(),
|
|
9030
8855
|
" \xB7",
|
|
9031
8856
|
" ",
|
|
9032
8857
|
formatRelativeTime(item.resolvedAt ?? item.occurredAt)
|
|
9033
8858
|
] }),
|
|
9034
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" })
|
|
9035
8860
|
]
|
|
9036
8861
|
}
|
|
9037
8862
|
);
|
|
@@ -9069,7 +8894,7 @@ function goalMeta(action) {
|
|
|
9069
8894
|
function GoalRow({ item }) {
|
|
9070
8895
|
const enter = useEntranceAnimation();
|
|
9071
8896
|
const { label, pill, icon: Icon } = goalMeta(item.action);
|
|
9072
|
-
return /* @__PURE__ */
|
|
8897
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs12(
|
|
9073
8898
|
"span",
|
|
9074
8899
|
{
|
|
9075
8900
|
className: cn(
|
|
@@ -9077,8 +8902,8 @@ function GoalRow({ item }) {
|
|
|
9077
8902
|
pill
|
|
9078
8903
|
),
|
|
9079
8904
|
children: [
|
|
9080
|
-
/* @__PURE__ */
|
|
9081
|
-
/* @__PURE__ */
|
|
8905
|
+
/* @__PURE__ */ jsx17(Icon, { className: "size-3.5 shrink-0" }),
|
|
8906
|
+
/* @__PURE__ */ jsxs12("span", { className: "truncate", children: [
|
|
9082
8907
|
label,
|
|
9083
8908
|
item.text ? `: ${truncate(item.text, 90)}` : ""
|
|
9084
8909
|
] })
|
|
@@ -9095,7 +8920,7 @@ function MachineInputBatchRow({
|
|
|
9095
8920
|
const label = machineInputBatchLabel(item.members);
|
|
9096
8921
|
const single = item.members.length === 1 ? item.members[0] : null;
|
|
9097
8922
|
if (single?.kind === "media_generation_result" && single.result) {
|
|
9098
|
-
return /* @__PURE__ */
|
|
8923
|
+
return /* @__PURE__ */ jsx17(
|
|
9099
8924
|
VideoGenerationResultRow,
|
|
9100
8925
|
{
|
|
9101
8926
|
result: single.result,
|
|
@@ -9105,15 +8930,15 @@ function MachineInputBatchRow({
|
|
|
9105
8930
|
}
|
|
9106
8931
|
const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
|
|
9107
8932
|
const showCollapsedSummary = !item.compact && single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
|
|
9108
|
-
return /* @__PURE__ */
|
|
9109
|
-
/* @__PURE__ */
|
|
8933
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
|
|
8934
|
+
/* @__PURE__ */ jsxs12(
|
|
9110
8935
|
"details",
|
|
9111
8936
|
{
|
|
9112
8937
|
className: "group w-full max-w-full",
|
|
9113
8938
|
"data-og-machine-input-batch": "",
|
|
9114
8939
|
title: `Received ${formatClockTime(item.occurredAt)}`,
|
|
9115
8940
|
children: [
|
|
9116
|
-
/* @__PURE__ */
|
|
8941
|
+
/* @__PURE__ */ jsx17("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs12(
|
|
9117
8942
|
"span",
|
|
9118
8943
|
{
|
|
9119
8944
|
className: cn(
|
|
@@ -9121,23 +8946,23 @@ function MachineInputBatchRow({
|
|
|
9121
8946
|
NEUTRAL_PILL
|
|
9122
8947
|
),
|
|
9123
8948
|
children: [
|
|
9124
|
-
/* @__PURE__ */
|
|
8949
|
+
/* @__PURE__ */ jsx17(
|
|
9125
8950
|
ChevronRightIcon2,
|
|
9126
8951
|
{
|
|
9127
8952
|
"aria-hidden": true,
|
|
9128
8953
|
className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
|
|
9129
8954
|
}
|
|
9130
8955
|
),
|
|
9131
|
-
/* @__PURE__ */
|
|
8956
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: label })
|
|
9132
8957
|
]
|
|
9133
8958
|
}
|
|
9134
8959
|
) }),
|
|
9135
|
-
/* @__PURE__ */
|
|
9136
|
-
/* @__PURE__ */
|
|
8960
|
+
/* @__PURE__ */ jsxs12("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
|
|
8961
|
+
/* @__PURE__ */ jsxs12("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
9137
8962
|
"Received ",
|
|
9138
|
-
/* @__PURE__ */
|
|
8963
|
+
/* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
|
|
9139
8964
|
] }),
|
|
9140
|
-
item.members.map((member) => /* @__PURE__ */
|
|
8965
|
+
item.members.map((member) => /* @__PURE__ */ jsx17(
|
|
9141
8966
|
MachineInputRow,
|
|
9142
8967
|
{
|
|
9143
8968
|
member,
|
|
@@ -9150,7 +8975,7 @@ function MachineInputBatchRow({
|
|
|
9150
8975
|
]
|
|
9151
8976
|
}
|
|
9152
8977
|
),
|
|
9153
|
-
showCollapsedSummary ? /* @__PURE__ */
|
|
8978
|
+
showCollapsedSummary ? /* @__PURE__ */ jsx17("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
|
|
9154
8979
|
] });
|
|
9155
8980
|
}
|
|
9156
8981
|
function MachineInputRow({
|
|
@@ -9159,7 +8984,7 @@ function MachineInputRow({
|
|
|
9159
8984
|
loadVideoArtifactPlayback
|
|
9160
8985
|
}) {
|
|
9161
8986
|
if (member.kind === "media_generation_result" && member.result) {
|
|
9162
|
-
return /* @__PURE__ */
|
|
8987
|
+
return /* @__PURE__ */ jsx17(
|
|
9163
8988
|
VideoGenerationResultRow,
|
|
9164
8989
|
{
|
|
9165
8990
|
result: member.result,
|
|
@@ -9170,16 +8995,16 @@ function MachineInputRow({
|
|
|
9170
8995
|
}
|
|
9171
8996
|
const source = readableMachineInputSource(member.sourceId);
|
|
9172
8997
|
const summary = cleanMachineInputSummary(member.summary);
|
|
9173
|
-
return /* @__PURE__ */
|
|
9174
|
-
/* @__PURE__ */
|
|
9175
|
-
/* @__PURE__ */
|
|
9176
|
-
/* @__PURE__ */
|
|
9177
|
-
source && /* @__PURE__ */
|
|
8998
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
8999
|
+
/* @__PURE__ */ jsx17("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
|
|
9000
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
|
|
9001
|
+
/* @__PURE__ */ jsx17("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
|
|
9002
|
+
source && /* @__PURE__ */ jsxs12("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
|
|
9178
9003
|
"from ",
|
|
9179
9004
|
source
|
|
9180
9005
|
] }),
|
|
9181
|
-
summary ? /* @__PURE__ */
|
|
9182
|
-
/* @__PURE__ */
|
|
9006
|
+
summary ? /* @__PURE__ */ jsx17("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-og-menu leading-5 text-og-fg", children: truncate(summary, 320) }) : null,
|
|
9007
|
+
/* @__PURE__ */ jsx17(
|
|
9183
9008
|
ChildSessionLink,
|
|
9184
9009
|
{
|
|
9185
9010
|
kind: member.kind,
|
|
@@ -9197,7 +9022,7 @@ function VideoGenerationResultRow({
|
|
|
9197
9022
|
}) {
|
|
9198
9023
|
const enter = useEntranceAnimation();
|
|
9199
9024
|
if (result.status !== "ready") {
|
|
9200
|
-
return /* @__PURE__ */
|
|
9025
|
+
return /* @__PURE__ */ jsxs12(
|
|
9201
9026
|
"div",
|
|
9202
9027
|
{
|
|
9203
9028
|
className: cn(
|
|
@@ -9205,18 +9030,18 @@ function VideoGenerationResultRow({
|
|
|
9205
9030
|
"mx-auto w-full max-w-lg rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3.5 py-3"
|
|
9206
9031
|
),
|
|
9207
9032
|
children: [
|
|
9208
|
-
/* @__PURE__ */
|
|
9209
|
-
/* @__PURE__ */
|
|
9033
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
|
|
9034
|
+
/* @__PURE__ */ jsx17(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
|
|
9210
9035
|
"Video generation failed"
|
|
9211
9036
|
] }),
|
|
9212
|
-
/* @__PURE__ */
|
|
9037
|
+
/* @__PURE__ */ jsx17("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
|
|
9213
9038
|
]
|
|
9214
9039
|
}
|
|
9215
9040
|
);
|
|
9216
9041
|
}
|
|
9217
9042
|
const { receipt } = result;
|
|
9218
9043
|
const facts = receipt.video;
|
|
9219
|
-
return /* @__PURE__ */
|
|
9044
|
+
return /* @__PURE__ */ jsxs12(
|
|
9220
9045
|
"section",
|
|
9221
9046
|
{
|
|
9222
9047
|
"aria-label": "Generated video",
|
|
@@ -9226,18 +9051,18 @@ function VideoGenerationResultRow({
|
|
|
9226
9051
|
compact && "max-w-lg"
|
|
9227
9052
|
),
|
|
9228
9053
|
children: [
|
|
9229
|
-
loadVideoArtifactPlayback ? /* @__PURE__ */
|
|
9054
|
+
loadVideoArtifactPlayback ? /* @__PURE__ */ jsx17(
|
|
9230
9055
|
GeneratedVideoPlayer,
|
|
9231
9056
|
{
|
|
9232
9057
|
receipt,
|
|
9233
9058
|
loadPlaybackSource: loadVideoArtifactPlayback,
|
|
9234
9059
|
className: "rounded-none border-0 shadow-none"
|
|
9235
9060
|
}
|
|
9236
|
-
) : /* @__PURE__ */
|
|
9237
|
-
/* @__PURE__ */
|
|
9238
|
-
/* @__PURE__ */
|
|
9239
|
-
/* @__PURE__ */
|
|
9240
|
-
/* @__PURE__ */
|
|
9061
|
+
) : /* @__PURE__ */ jsx17("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx17(PlayIcon, { "aria-hidden": true, className: "size-6" }) }),
|
|
9062
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
|
|
9063
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
|
|
9064
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
|
|
9065
|
+
/* @__PURE__ */ jsxs12("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
|
|
9241
9066
|
facts.width,
|
|
9242
9067
|
"\xD7",
|
|
9243
9068
|
facts.height,
|
|
@@ -9246,7 +9071,7 @@ function VideoGenerationResultRow({
|
|
|
9246
9071
|
facts.hasAudio ? " \xB7 Audio" : ""
|
|
9247
9072
|
] })
|
|
9248
9073
|
] }),
|
|
9249
|
-
/* @__PURE__ */
|
|
9074
|
+
/* @__PURE__ */ jsx17(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
|
|
9250
9075
|
] })
|
|
9251
9076
|
]
|
|
9252
9077
|
}
|
|
@@ -9257,32 +9082,31 @@ function formatVideoDuration(seconds) {
|
|
|
9257
9082
|
}
|
|
9258
9083
|
function NoticeRow({ item }) {
|
|
9259
9084
|
const enter = useEntranceAnimation();
|
|
9260
|
-
if (item.allowance) return /* @__PURE__ */ jsx18(AllowanceExhaustedRow, { refusal: item.allowance });
|
|
9261
9085
|
if (item.recordedOutcome) {
|
|
9262
|
-
return /* @__PURE__ */
|
|
9086
|
+
return /* @__PURE__ */ jsxs12(
|
|
9263
9087
|
"details",
|
|
9264
9088
|
{
|
|
9265
9089
|
className: "group text-og-sm text-og-fg-muted",
|
|
9266
9090
|
role: "note",
|
|
9267
9091
|
"data-og-recorded-outcome": "wait",
|
|
9268
9092
|
children: [
|
|
9269
|
-
/* @__PURE__ */
|
|
9270
|
-
/* @__PURE__ */
|
|
9093
|
+
/* @__PURE__ */ jsxs12("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
|
|
9094
|
+
/* @__PURE__ */ jsx17(
|
|
9271
9095
|
ChevronRightIcon2,
|
|
9272
9096
|
{
|
|
9273
9097
|
"aria-hidden": true,
|
|
9274
9098
|
className: "size-3.5 transition-transform group-open:rotate-90"
|
|
9275
9099
|
}
|
|
9276
9100
|
),
|
|
9277
|
-
/* @__PURE__ */
|
|
9101
|
+
/* @__PURE__ */ jsx17("span", { title: new Date(item.occurredAt).toLocaleString(), children: recordedWaitSummary(item) })
|
|
9278
9102
|
] }),
|
|
9279
|
-
/* @__PURE__ */
|
|
9103
|
+
/* @__PURE__ */ jsx17("p", { className: "mt-1 whitespace-pre-wrap break-words pl-5 text-og-fg-muted", children: item.text })
|
|
9280
9104
|
]
|
|
9281
9105
|
}
|
|
9282
9106
|
);
|
|
9283
9107
|
}
|
|
9284
9108
|
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" && !item.resolvedAt ? WAITING_PILL_CLASS : NEUTRAL_PILL;
|
|
9285
|
-
return /* @__PURE__ */
|
|
9109
|
+
return /* @__PURE__ */ jsxs12(
|
|
9286
9110
|
"div",
|
|
9287
9111
|
{
|
|
9288
9112
|
className: cn(
|
|
@@ -9292,20 +9116,20 @@ function NoticeRow({ item }) {
|
|
|
9292
9116
|
),
|
|
9293
9117
|
role: "status",
|
|
9294
9118
|
children: [
|
|
9295
|
-
/* @__PURE__ */
|
|
9119
|
+
/* @__PURE__ */ jsx17(
|
|
9296
9120
|
TriangleAlertIcon2,
|
|
9297
9121
|
{
|
|
9298
9122
|
className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
|
|
9299
9123
|
}
|
|
9300
9124
|
),
|
|
9301
|
-
/* @__PURE__ */
|
|
9302
|
-
/* @__PURE__ */
|
|
9303
|
-
item.details ? /* @__PURE__ */
|
|
9304
|
-
/* @__PURE__ */
|
|
9305
|
-
/* @__PURE__ */
|
|
9125
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 flex-1", children: [
|
|
9126
|
+
/* @__PURE__ */ jsx17("span", { className: "whitespace-pre-wrap break-words", children: item.resolvedAt && item.text.startsWith("Approval needed") ? "Approval was needed." : item.text }),
|
|
9127
|
+
item.details ? /* @__PURE__ */ jsxs12("details", { className: "mt-2 text-og-control", children: [
|
|
9128
|
+
/* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
9129
|
+
/* @__PURE__ */ jsx17("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-og-fg/5 p-2 font-mono", children: JSON.stringify(item.details.value, null, 2) })
|
|
9306
9130
|
] }) : null
|
|
9307
9131
|
] }),
|
|
9308
|
-
item.action ? /* @__PURE__ */
|
|
9132
|
+
item.action ? /* @__PURE__ */ jsx17(
|
|
9309
9133
|
"a",
|
|
9310
9134
|
{
|
|
9311
9135
|
className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
|
|
@@ -9324,22 +9148,22 @@ function recordedWaitSummary(item) {
|
|
|
9324
9148
|
const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
|
|
9325
9149
|
const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
|
|
9326
9150
|
if (waitedMs !== void 0) {
|
|
9327
|
-
return /* @__PURE__ */
|
|
9151
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
9328
9152
|
"Waited",
|
|
9329
9153
|
target,
|
|
9330
9154
|
" \xB7",
|
|
9331
9155
|
" ",
|
|
9332
|
-
/* @__PURE__ */
|
|
9156
|
+
/* @__PURE__ */ jsx17("time", { dateTime: `PT${Math.floor(waitedMs / 1e3)}S`, children: formatElapsed(waitedMs) })
|
|
9333
9157
|
] });
|
|
9334
9158
|
}
|
|
9335
9159
|
const started = new Date(item.occurredAt);
|
|
9336
9160
|
const sameDay = started.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
9337
|
-
return /* @__PURE__ */
|
|
9161
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
9338
9162
|
item.waitEndedAt ? "Waited" : "Waiting",
|
|
9339
9163
|
target,
|
|
9340
9164
|
" \xB7 since",
|
|
9341
9165
|
" ",
|
|
9342
|
-
/* @__PURE__ */
|
|
9166
|
+
/* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: sameDay ? formatClockTime(item.occurredAt) : started.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }) })
|
|
9343
9167
|
] });
|
|
9344
9168
|
}
|
|
9345
9169
|
function AuthNeededRow({
|
|
@@ -9348,8 +9172,8 @@ function AuthNeededRow({
|
|
|
9348
9172
|
resolveProviderLogo
|
|
9349
9173
|
}) {
|
|
9350
9174
|
const enter = useEntranceAnimation();
|
|
9351
|
-
const [busy, setBusy] =
|
|
9352
|
-
const [failed, setFailed] =
|
|
9175
|
+
const [busy, setBusy] = useState14(false);
|
|
9176
|
+
const [failed, setFailed] = useState14(false);
|
|
9353
9177
|
const recommendation = item.capability ?? null;
|
|
9354
9178
|
const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
|
|
9355
9179
|
const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
@@ -9372,30 +9196,30 @@ function AuthNeededRow({
|
|
|
9372
9196
|
setBusy(false);
|
|
9373
9197
|
}
|
|
9374
9198
|
};
|
|
9375
|
-
return /* @__PURE__ */
|
|
9376
|
-
/* @__PURE__ */
|
|
9377
|
-
/* @__PURE__ */
|
|
9378
|
-
/* @__PURE__ */
|
|
9199
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
|
|
9200
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3 rounded-og-lg border border-og-border bg-og-surface-1 px-3.5 py-3 sm:flex-row sm:items-center", children: [
|
|
9201
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
9202
|
+
/* @__PURE__ */ jsx17(
|
|
9379
9203
|
AuthProviderLogo,
|
|
9380
9204
|
{
|
|
9381
9205
|
src: resolveProviderLogo?.(item.providerDomain) ?? null,
|
|
9382
9206
|
label: provider
|
|
9383
9207
|
}
|
|
9384
9208
|
),
|
|
9385
|
-
/* @__PURE__ */
|
|
9386
|
-
/* @__PURE__ */
|
|
9387
|
-
/* @__PURE__ */
|
|
9388
|
-
recommendation ? /* @__PURE__ */
|
|
9209
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
|
|
9210
|
+
/* @__PURE__ */ jsx17("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
|
|
9211
|
+
/* @__PURE__ */ jsx17("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
|
|
9212
|
+
recommendation ? /* @__PURE__ */ jsxs12("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
9389
9213
|
"Provider: ",
|
|
9390
9214
|
item.providerDomain
|
|
9391
9215
|
] }) : null,
|
|
9392
|
-
recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */
|
|
9216
|
+
recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs12("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
9393
9217
|
"Needs variables: ",
|
|
9394
9218
|
recommendation.requiredVariables.join(", ")
|
|
9395
9219
|
] }) : null
|
|
9396
9220
|
] })
|
|
9397
9221
|
] }),
|
|
9398
|
-
hostAuthorizationUrl ? /* @__PURE__ */
|
|
9222
|
+
hostAuthorizationUrl ? /* @__PURE__ */ jsxs12(
|
|
9399
9223
|
"a",
|
|
9400
9224
|
{
|
|
9401
9225
|
href: hostAuthorizationUrl,
|
|
@@ -9406,11 +9230,11 @@ function AuthNeededRow({
|
|
|
9406
9230
|
"transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
|
|
9407
9231
|
),
|
|
9408
9232
|
children: [
|
|
9409
|
-
/* @__PURE__ */
|
|
9233
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
9410
9234
|
actionLabel
|
|
9411
9235
|
]
|
|
9412
9236
|
}
|
|
9413
|
-
) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */
|
|
9237
|
+
) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs12(
|
|
9414
9238
|
"button",
|
|
9415
9239
|
{
|
|
9416
9240
|
type: "button",
|
|
@@ -9421,11 +9245,11 @@ function AuthNeededRow({
|
|
|
9421
9245
|
"transition-colors hover:bg-og-primary-hover disabled:opacity-50 pointer-coarse:min-h-9"
|
|
9422
9246
|
),
|
|
9423
9247
|
children: [
|
|
9424
|
-
/* @__PURE__ */
|
|
9248
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
|
|
9425
9249
|
busy ? "Opening\u2026" : actionLabel
|
|
9426
9250
|
]
|
|
9427
9251
|
}
|
|
9428
|
-
) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */
|
|
9252
|
+
) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs12(
|
|
9429
9253
|
"a",
|
|
9430
9254
|
{
|
|
9431
9255
|
href: item.authorizationUrl,
|
|
@@ -9436,14 +9260,14 @@ function AuthNeededRow({
|
|
|
9436
9260
|
"transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
|
|
9437
9261
|
),
|
|
9438
9262
|
children: [
|
|
9439
|
-
/* @__PURE__ */
|
|
9263
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
9440
9264
|
actionLabel
|
|
9441
9265
|
]
|
|
9442
9266
|
}
|
|
9443
9267
|
) : null
|
|
9444
9268
|
] }),
|
|
9445
|
-
!unavailable ? /* @__PURE__ */
|
|
9446
|
-
failed ? /* @__PURE__ */
|
|
9269
|
+
!unavailable ? /* @__PURE__ */ jsx17("p", { className: "px-1 text-og-xs text-og-fg-subtle", children: recommendation ? "No access has been granted. Review and confirm the provider before continuing." : `This tool call wasn't replayed. After ${missing ? "connecting" : "reconnecting"}, send a new message to try again.` }) : null,
|
|
9270
|
+
failed ? /* @__PURE__ */ jsxs12("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
|
|
9447
9271
|
"Couldn't start ",
|
|
9448
9272
|
missing ? "connecting" : "reconnecting",
|
|
9449
9273
|
" ",
|
|
@@ -9453,15 +9277,15 @@ function AuthNeededRow({
|
|
|
9453
9277
|
] });
|
|
9454
9278
|
}
|
|
9455
9279
|
function AuthProviderLogo({ src, label }) {
|
|
9456
|
-
const [failed, setFailed] =
|
|
9457
|
-
|
|
9280
|
+
const [failed, setFailed] = useState14(false);
|
|
9281
|
+
useEffect9(() => setFailed(false), [src]);
|
|
9458
9282
|
const showImage = src && !failed;
|
|
9459
|
-
return /* @__PURE__ */
|
|
9283
|
+
return /* @__PURE__ */ jsx17(
|
|
9460
9284
|
"span",
|
|
9461
9285
|
{
|
|
9462
9286
|
className: "relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-og-md border border-og-border bg-og-surface-2 text-og-menu font-semibold text-og-fg-muted",
|
|
9463
9287
|
"aria-hidden": true,
|
|
9464
|
-
children: showImage ? /* @__PURE__ */
|
|
9288
|
+
children: showImage ? /* @__PURE__ */ jsx17(
|
|
9465
9289
|
"img",
|
|
9466
9290
|
{
|
|
9467
9291
|
src,
|
|
@@ -9471,7 +9295,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
9471
9295
|
className: "size-full object-contain p-1.5",
|
|
9472
9296
|
onError: () => setFailed(true)
|
|
9473
9297
|
}
|
|
9474
|
-
) : /* @__PURE__ */
|
|
9298
|
+
) : /* @__PURE__ */ jsx17("span", { children: monogram(label) })
|
|
9475
9299
|
}
|
|
9476
9300
|
);
|
|
9477
9301
|
}
|
|
@@ -9516,7 +9340,7 @@ function authReasonLine(reason) {
|
|
|
9516
9340
|
// src/components/queue-surface.tsx
|
|
9517
9341
|
import { Loader2Icon } from "lucide-react";
|
|
9518
9342
|
import { lazy as lazy4, Suspense as Suspense5 } from "react";
|
|
9519
|
-
import { jsx as
|
|
9343
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
9520
9344
|
var loadQueueSurface = () => import("./queue-surface-implementation-IM2HD3SK.js");
|
|
9521
9345
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
9522
9346
|
function createQueueSurface(loadImplementation) {
|
|
@@ -9527,21 +9351,21 @@ function createQueueSurface(loadImplementation) {
|
|
|
9527
9351
|
const { queue } = props;
|
|
9528
9352
|
if (queue.queue.length + queue.pendingInputs.length === 0) {
|
|
9529
9353
|
if (!queue.stoppingPreviousAttempt && !queue.error && !queue.mutationError) return null;
|
|
9530
|
-
return /* @__PURE__ */
|
|
9354
|
+
return /* @__PURE__ */ jsx18(EmptyQueueStateSurface, { queue });
|
|
9531
9355
|
}
|
|
9532
|
-
return /* @__PURE__ */
|
|
9356
|
+
return /* @__PURE__ */ jsx18(Suspense5, { fallback: /* @__PURE__ */ jsx18(QueueSurfaceFallback, {}), children: /* @__PURE__ */ jsx18(LazyQueueSurface, { ...props }) });
|
|
9533
9357
|
};
|
|
9534
9358
|
}
|
|
9535
9359
|
function QueueSurfaceFallback() {
|
|
9536
|
-
return /* @__PURE__ */
|
|
9360
|
+
return /* @__PURE__ */ jsx18(
|
|
9537
9361
|
"div",
|
|
9538
9362
|
{
|
|
9539
9363
|
"aria-live": "polite",
|
|
9540
9364
|
className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
|
|
9541
9365
|
"data-testid": "queue-surface-loading",
|
|
9542
9366
|
role: "status",
|
|
9543
|
-
children: /* @__PURE__ */
|
|
9544
|
-
/* @__PURE__ */
|
|
9367
|
+
children: /* @__PURE__ */ jsx18("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
|
|
9368
|
+
/* @__PURE__ */ jsx18(
|
|
9545
9369
|
Loader2Icon,
|
|
9546
9370
|
{
|
|
9547
9371
|
"aria-hidden": "true",
|
|
@@ -9583,7 +9407,7 @@ function useWorkspaceModelCatalog(options) {
|
|
|
9583
9407
|
}
|
|
9584
9408
|
const [catalog, config] = await Promise.all([
|
|
9585
9409
|
client.getWorkspaceModelCatalog(options.workspaceId, { signal }),
|
|
9586
|
-
client.getClientConfig({ signal
|
|
9410
|
+
client.getClientConfig({ signal })
|
|
9587
9411
|
]);
|
|
9588
9412
|
return {
|
|
9589
9413
|
models: catalog.models,
|
|
@@ -9612,7 +9436,7 @@ import { LayoutGroup, motion as motion4 } from "motion/react";
|
|
|
9612
9436
|
import {
|
|
9613
9437
|
useImperativeHandle
|
|
9614
9438
|
} from "react";
|
|
9615
|
-
import { Fragment as
|
|
9439
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9616
9440
|
function ChatComposer({
|
|
9617
9441
|
composer,
|
|
9618
9442
|
responsiveBasis,
|
|
@@ -9670,15 +9494,15 @@ function ChatComposer({
|
|
|
9670
9494
|
useImperativeHandle(focusRef, () => ({ focusInput: controller.focusInput }), [
|
|
9671
9495
|
controller.focusInput
|
|
9672
9496
|
]);
|
|
9673
|
-
return /* @__PURE__ */
|
|
9674
|
-
/* @__PURE__ */
|
|
9675
|
-
/* @__PURE__ */
|
|
9676
|
-
/* @__PURE__ */
|
|
9677
|
-
/* @__PURE__ */
|
|
9678
|
-
/* @__PURE__ */
|
|
9679
|
-
/* @__PURE__ */
|
|
9497
|
+
return /* @__PURE__ */ jsx19(Fragment6, { children: /* @__PURE__ */ jsxs14(Root, { controller, responsiveBasis, className, children: [
|
|
9498
|
+
/* @__PURE__ */ jsxs14(Frame, { children: [
|
|
9499
|
+
/* @__PURE__ */ jsx19(CommandPalette, {}),
|
|
9500
|
+
/* @__PURE__ */ jsxs14(Surface, { className: surfaceClassName, children: [
|
|
9501
|
+
/* @__PURE__ */ jsx19(PausedState, {}),
|
|
9502
|
+
/* @__PURE__ */ jsx19(RestoredResources, {}),
|
|
9503
|
+
/* @__PURE__ */ jsx19(Attachments, {}),
|
|
9680
9504
|
header,
|
|
9681
|
-
composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */
|
|
9505
|
+
composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */ jsx19("div", { className: "px-3.5 pt-2 md:px-4", children: /* @__PURE__ */ jsx19(
|
|
9682
9506
|
TimelineAnnotationsChip,
|
|
9683
9507
|
{
|
|
9684
9508
|
annotations: composer.annotations,
|
|
@@ -9690,21 +9514,21 @@ function ChatComposer({
|
|
|
9690
9514
|
onCommit: controller.focusInput
|
|
9691
9515
|
}
|
|
9692
9516
|
) }) : null,
|
|
9693
|
-
/* @__PURE__ */
|
|
9694
|
-
controller.confirmState ? /* @__PURE__ */
|
|
9517
|
+
/* @__PURE__ */ jsx19(Input, { ...inputProps, placeholder, autoFocus }),
|
|
9518
|
+
controller.confirmState ? /* @__PURE__ */ jsx19(Confirmation, {}) : footer !== void 0 ? footer : /* @__PURE__ */ jsx19(
|
|
9695
9519
|
Footer,
|
|
9696
9520
|
{
|
|
9697
9521
|
"data-og-stack-actions": stackActions ? "" : void 0,
|
|
9698
9522
|
className: stackActions ? "max-sm:flex-nowrap sm:flex-wrap" : void 0,
|
|
9699
|
-
children: /* @__PURE__ */
|
|
9700
|
-
hasControls ? /* @__PURE__ */
|
|
9523
|
+
children: /* @__PURE__ */ jsxs14(LayoutGroup, { id: "og-composer-footer", children: [
|
|
9524
|
+
hasControls ? /* @__PURE__ */ jsxs14(
|
|
9701
9525
|
Controls,
|
|
9702
9526
|
{
|
|
9703
9527
|
className: stackActions ? "min-w-0 max-sm:flex-1 sm:w-auto" : void 0,
|
|
9704
9528
|
children: [
|
|
9705
9529
|
controlsLeading,
|
|
9706
|
-
/* @__PURE__ */
|
|
9707
|
-
transcription ? /* @__PURE__ */
|
|
9530
|
+
/* @__PURE__ */ jsx19(AttachButton, { className: attachButtonClassName }),
|
|
9531
|
+
transcription ? /* @__PURE__ */ jsx19(
|
|
9708
9532
|
ComposerTranscriptionControl,
|
|
9709
9533
|
{
|
|
9710
9534
|
...transcription,
|
|
@@ -9712,13 +9536,13 @@ function ChatComposer({
|
|
|
9712
9536
|
className: [transcription.className, transcriptionClassName].filter(Boolean).join(" ")
|
|
9713
9537
|
}
|
|
9714
9538
|
) : null,
|
|
9715
|
-
models ? /* @__PURE__ */
|
|
9539
|
+
models ? /* @__PURE__ */ jsx19(
|
|
9716
9540
|
motion4.span,
|
|
9717
9541
|
{
|
|
9718
9542
|
layout: true,
|
|
9719
9543
|
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
9720
9544
|
className: "inline-flex min-w-0",
|
|
9721
|
-
children: /* @__PURE__ */
|
|
9545
|
+
children: /* @__PURE__ */ jsx19(
|
|
9722
9546
|
ModelPicker,
|
|
9723
9547
|
{
|
|
9724
9548
|
models,
|
|
@@ -9728,7 +9552,7 @@ function ChatComposer({
|
|
|
9728
9552
|
)
|
|
9729
9553
|
}
|
|
9730
9554
|
) : null,
|
|
9731
|
-
controlsStart ? /* @__PURE__ */
|
|
9555
|
+
controlsStart ? /* @__PURE__ */ jsx19(
|
|
9732
9556
|
motion4.span,
|
|
9733
9557
|
{
|
|
9734
9558
|
layout: true,
|
|
@@ -9739,15 +9563,15 @@ function ChatComposer({
|
|
|
9739
9563
|
) : null
|
|
9740
9564
|
]
|
|
9741
9565
|
}
|
|
9742
|
-
) : /* @__PURE__ */
|
|
9743
|
-
/* @__PURE__ */
|
|
9566
|
+
) : /* @__PURE__ */ jsx19(Hint, { children: hint }),
|
|
9567
|
+
/* @__PURE__ */ jsxs14(
|
|
9744
9568
|
Actions,
|
|
9745
9569
|
{
|
|
9746
9570
|
className: stackActions ? "max-sm:shrink-0 sm:w-auto sm:justify-end" : void 0,
|
|
9747
9571
|
children: [
|
|
9748
9572
|
actionsStart,
|
|
9749
|
-
/* @__PURE__ */
|
|
9750
|
-
/* @__PURE__ */
|
|
9573
|
+
/* @__PURE__ */ jsx19(PauseButton, {}),
|
|
9574
|
+
/* @__PURE__ */ jsx19(SendButton, {})
|
|
9751
9575
|
]
|
|
9752
9576
|
}
|
|
9753
9577
|
)
|
|
@@ -9756,8 +9580,8 @@ function ChatComposer({
|
|
|
9756
9580
|
)
|
|
9757
9581
|
] })
|
|
9758
9582
|
] }),
|
|
9759
|
-
/* @__PURE__ */
|
|
9760
|
-
/* @__PURE__ */
|
|
9583
|
+
/* @__PURE__ */ jsx19(Help, {}),
|
|
9584
|
+
/* @__PURE__ */ jsx19(Status, {})
|
|
9761
9585
|
] }) });
|
|
9762
9586
|
}
|
|
9763
9587
|
|
|
@@ -9783,8 +9607,8 @@ import {
|
|
|
9783
9607
|
TargetIcon as TargetIcon3
|
|
9784
9608
|
} from "lucide-react";
|
|
9785
9609
|
import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
9786
|
-
import { useEffect as
|
|
9787
|
-
import { Fragment as
|
|
9610
|
+
import { useEffect as useEffect10, useId as useId4, useMemo as useMemo5, useRef as useRef10, useState as useState15 } from "react";
|
|
9611
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9788
9612
|
var GOAL_LABEL = {
|
|
9789
9613
|
pursuing: "Pursuing",
|
|
9790
9614
|
waiting: "Waiting",
|
|
@@ -9899,8 +9723,8 @@ function formatCoarseElapsed(ms) {
|
|
|
9899
9723
|
}
|
|
9900
9724
|
function useLiveElapsed(startIso, live, endIso) {
|
|
9901
9725
|
const start = startIso ? Date.parse(startIso) : Number.NaN;
|
|
9902
|
-
const [now, setNow] =
|
|
9903
|
-
|
|
9726
|
+
const [now, setNow] = useState15(() => Date.now());
|
|
9727
|
+
useEffect10(() => {
|
|
9904
9728
|
if (!live) return;
|
|
9905
9729
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
9906
9730
|
return () => clearInterval(id);
|
|
@@ -9972,7 +9796,7 @@ function SessionChrome({
|
|
|
9972
9796
|
defaultActive = null,
|
|
9973
9797
|
onActiveChange
|
|
9974
9798
|
}) {
|
|
9975
|
-
const [activityRequested, setActivityOpen] =
|
|
9799
|
+
const [activityRequested, setActivityOpen] = useState15(
|
|
9976
9800
|
Boolean(defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
|
|
9977
9801
|
);
|
|
9978
9802
|
const reactId = useId4();
|
|
@@ -9982,12 +9806,12 @@ function SessionChrome({
|
|
|
9982
9806
|
const incoming = queue.pendingInputs;
|
|
9983
9807
|
const turns = queue.queue;
|
|
9984
9808
|
const queueMutationFor = queue.mutationFor;
|
|
9985
|
-
const queuedTurns =
|
|
9809
|
+
const queuedTurns = useMemo5(
|
|
9986
9810
|
() => turns.filter((turn) => isAuthoritativeQueuedTurn(turn, queueMutationFor)),
|
|
9987
9811
|
[queueMutationFor, turns]
|
|
9988
9812
|
);
|
|
9989
|
-
const queuedTurnIds =
|
|
9990
|
-
const optimisticQueued =
|
|
9813
|
+
const queuedTurnIds = useMemo5(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
|
|
9814
|
+
const optimisticQueued = useMemo5(
|
|
9991
9815
|
() => (composer?.optimisticMessages ?? []).filter(
|
|
9992
9816
|
(message) => isOptimisticQueuedMessage(message, queuedTurnIds, queue.snapshot)
|
|
9993
9817
|
),
|
|
@@ -10002,7 +9826,7 @@ function SessionChrome({
|
|
|
10002
9826
|
queue.queue,
|
|
10003
9827
|
queue.mutationFor
|
|
10004
9828
|
);
|
|
10005
|
-
const [activeUncontrolled, setActiveUncontrolled] =
|
|
9829
|
+
const [activeUncontrolled, setActiveUncontrolled] = useState15(
|
|
10006
9830
|
() => sessionChromeInitialActive({
|
|
10007
9831
|
defaultActive,
|
|
10008
9832
|
authoritativeQueuedCount: initialAuthoritativeQueuedCount
|
|
@@ -10013,13 +9837,13 @@ function SessionChrome({
|
|
|
10013
9837
|
const openedQueueTargetRef = useRef10(null);
|
|
10014
9838
|
const focusedQueueTargetRef = useRef10(null);
|
|
10015
9839
|
const queueTargetKey = queueFocusTarget ? `${queueFocusTarget.turnId}:${queueFocusTarget.requestId}` : null;
|
|
10016
|
-
|
|
9840
|
+
useEffect10(() => {
|
|
10017
9841
|
if (!queueTargetKey || openedQueueTargetRef.current === queueTargetKey) return;
|
|
10018
9842
|
openedQueueTargetRef.current = queueTargetKey;
|
|
10019
9843
|
if (activeControlled === void 0) setActiveUncontrolled("queue");
|
|
10020
9844
|
onActiveChange?.("queue");
|
|
10021
9845
|
}, [queueTargetKey, activeControlled, onActiveChange]);
|
|
10022
|
-
|
|
9846
|
+
useEffect10(() => {
|
|
10023
9847
|
if (!queueFocusTarget || active !== "queue" || focusedQueueTargetRef.current === queueTargetKey)
|
|
10024
9848
|
return;
|
|
10025
9849
|
const root = rootRef.current;
|
|
@@ -10061,7 +9885,7 @@ function SessionChrome({
|
|
|
10061
9885
|
onActiveChange?.(next);
|
|
10062
9886
|
};
|
|
10063
9887
|
const hasCommandsPanel = commandsPanel != null;
|
|
10064
|
-
const signals =
|
|
9888
|
+
const signals = useMemo5(() => {
|
|
10065
9889
|
const rows = [];
|
|
10066
9890
|
if (incoming.length > 0) {
|
|
10067
9891
|
const detail = incoming[0]?.summary;
|
|
@@ -10072,7 +9896,7 @@ function SessionChrome({
|
|
|
10072
9896
|
tone: incoming.some(
|
|
10073
9897
|
(item) => item.classification === "action_required" || item.classification === "failure"
|
|
10074
9898
|
) ? "waiting" : "neutral",
|
|
10075
|
-
icon: /* @__PURE__ */
|
|
9899
|
+
icon: /* @__PURE__ */ jsx20(InboxIcon, { className: "size-3" })
|
|
10076
9900
|
});
|
|
10077
9901
|
}
|
|
10078
9902
|
const queuedCount = queuedTurns.length + optimisticQueued.length;
|
|
@@ -10089,7 +9913,7 @@ function SessionChrome({
|
|
|
10089
9913
|
label: queueProblem ? queuedCount > 0 ? `${queuedCount} queued \xB7 needs attention` : "Queue needs attention" : allVoiceRequests ? queuedCount === 1 ? "Voice request queued" : `${queuedCount} voice requests queued` : onlyVoiceHandoff ? "Voice handoff queued" : `${queuedCount} queued prompt${queuedCount === 1 ? "" : "s"}`,
|
|
10090
9914
|
...detail ? { detail } : {},
|
|
10091
9915
|
tone: queueProblem ? "waiting" : "neutral",
|
|
10092
|
-
icon: queueProblem ? /* @__PURE__ */
|
|
9916
|
+
icon: queueProblem ? /* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3" }) : voiceOnly ? /* @__PURE__ */ jsx20(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx20(ListOrderedIcon, { className: "size-3" })
|
|
10093
9917
|
});
|
|
10094
9918
|
}
|
|
10095
9919
|
if (record && goalState) {
|
|
@@ -10101,7 +9925,7 @@ function SessionChrome({
|
|
|
10101
9925
|
detail: elapsed ? `${elapsed} \xB7 ${record.text}` : record.text,
|
|
10102
9926
|
...explanation ? { title: explanation } : {},
|
|
10103
9927
|
tone: waiting ? "waiting" : goalState === "pursuing" || goalState === "scheduled" ? "accent" : "neutral",
|
|
10104
|
-
icon: /* @__PURE__ */
|
|
9928
|
+
icon: /* @__PURE__ */ jsx20(TargetIcon3, { className: "size-3" })
|
|
10105
9929
|
});
|
|
10106
9930
|
}
|
|
10107
9931
|
if (agentsSignal && agentsSignal.count > 0) {
|
|
@@ -10111,7 +9935,7 @@ function SessionChrome({
|
|
|
10111
9935
|
label: `${agentsSignal.count} agent${agentsSignal.count === 1 ? "" : "s"}`,
|
|
10112
9936
|
...detail ? { detail } : {},
|
|
10113
9937
|
tone: agentsSignal.tone ?? "neutral",
|
|
10114
|
-
icon: /* @__PURE__ */
|
|
9938
|
+
icon: /* @__PURE__ */ jsx20(BotIcon3, { className: "size-3" })
|
|
10115
9939
|
});
|
|
10116
9940
|
}
|
|
10117
9941
|
if (commandsCount > 0 || active === "commands" && hasCommandsPanel) {
|
|
@@ -10119,7 +9943,7 @@ function SessionChrome({
|
|
|
10119
9943
|
id: "commands",
|
|
10120
9944
|
label: commandsCount > 0 ? `${commandsCount} command${commandsCount === 1 ? "" : "s"}` : "Commands",
|
|
10121
9945
|
tone: commandsCount > 0 ? "running" : "neutral",
|
|
10122
|
-
icon: /* @__PURE__ */
|
|
9946
|
+
icon: /* @__PURE__ */ jsx20(TerminalIcon2, { className: "size-3" })
|
|
10123
9947
|
});
|
|
10124
9948
|
}
|
|
10125
9949
|
return rows;
|
|
@@ -10139,8 +9963,8 @@ function SessionChrome({
|
|
|
10139
9963
|
]);
|
|
10140
9964
|
const optimisticQueueKeys = optimisticQueued.map((message) => message.clientEventId).join(",");
|
|
10141
9965
|
const previousOptimisticQueueKeys = useRef10(optimisticQueueKeys);
|
|
10142
|
-
const [queueArrivalNonce, setQueueArrivalNonce] =
|
|
10143
|
-
|
|
9966
|
+
const [queueArrivalNonce, setQueueArrivalNonce] = useState15(0);
|
|
9967
|
+
useEffect10(() => {
|
|
10144
9968
|
const previous = new Set(previousOptimisticQueueKeys.current.split(",").filter(Boolean));
|
|
10145
9969
|
const arrived = optimisticQueued.some((message) => !previous.has(message.clientEventId));
|
|
10146
9970
|
previousOptimisticQueueKeys.current = optimisticQueueKeys;
|
|
@@ -10151,13 +9975,13 @@ function SessionChrome({
|
|
|
10151
9975
|
}
|
|
10152
9976
|
}, [active, activeControlled, optimisticQueueKeys, optimisticQueued]);
|
|
10153
9977
|
const queueOccupied = queuedTurns.length > 0 || optimisticQueued.length > 0;
|
|
10154
|
-
|
|
9978
|
+
useEffect10(() => {
|
|
10155
9979
|
if (queueOccupied) return;
|
|
10156
9980
|
queueOfferAdmissionSuppressedRef.current = false;
|
|
10157
9981
|
queueOfferDismissedSessionIdsRef.current.clear();
|
|
10158
9982
|
}, [queueOccupied]);
|
|
10159
9983
|
const queueOfferSuppressed = queueOfferAdmissionSuppressedRef.current || occupancySessionId != null && queueOfferDismissedSessionIdsRef.current.has(occupancySessionId);
|
|
10160
|
-
|
|
9984
|
+
useEffect10(() => {
|
|
10161
9985
|
if (!sessionChromeShouldOfferQueue({
|
|
10162
9986
|
controlled: activeControlled !== void 0,
|
|
10163
9987
|
active,
|
|
@@ -10178,28 +10002,28 @@ function SessionChrome({
|
|
|
10178
10002
|
queueOfferSuppressed,
|
|
10179
10003
|
queuedTurns.length
|
|
10180
10004
|
]);
|
|
10181
|
-
const [replaceDraftFor, setReplaceDraftFor] =
|
|
10005
|
+
const [replaceDraftFor, setReplaceDraftFor] = useState15(null);
|
|
10182
10006
|
const chipRefs = useRef10({});
|
|
10183
10007
|
const railRef = useRef10(null);
|
|
10184
|
-
const [pill, setPill] =
|
|
10008
|
+
const [pill, setPill] = useState15({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
|
|
10185
10009
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
10186
|
-
|
|
10010
|
+
useEffect10(() => {
|
|
10187
10011
|
if (!signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)))
|
|
10188
10012
|
setActivityOpen(false);
|
|
10189
10013
|
}, [signals]);
|
|
10190
|
-
|
|
10014
|
+
useEffect10(() => {
|
|
10191
10015
|
if (active && !signalIds.split(",").includes(active)) {
|
|
10192
10016
|
if (activeControlled === void 0) setActiveUncontrolled(null);
|
|
10193
10017
|
onActiveChange?.(null);
|
|
10194
10018
|
}
|
|
10195
10019
|
}, [active, activeControlled, onActiveChange, signalIds]);
|
|
10196
|
-
|
|
10020
|
+
useEffect10(() => {
|
|
10197
10021
|
if (active !== "queue" || !replaceDraftFor) return;
|
|
10198
10022
|
if (!queuedTurns.some((turn) => turn.id === replaceDraftFor)) {
|
|
10199
10023
|
setReplaceDraftFor(null);
|
|
10200
10024
|
}
|
|
10201
10025
|
}, [active, queuedTurns, replaceDraftFor]);
|
|
10202
|
-
|
|
10026
|
+
useEffect10(() => {
|
|
10203
10027
|
const rail = railRef.current;
|
|
10204
10028
|
const measure = () => {
|
|
10205
10029
|
if (!rail || !active) {
|
|
@@ -10239,14 +10063,14 @@ function SessionChrome({
|
|
|
10239
10063
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
10240
10064
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
10241
10065
|
const ease = [0.22, 1, 0.36, 1];
|
|
10242
|
-
const panelBody = active === "incoming" ? /* @__PURE__ */
|
|
10066
|
+
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx20(
|
|
10243
10067
|
IncomingPanel,
|
|
10244
10068
|
{
|
|
10245
10069
|
inputs: incoming,
|
|
10246
10070
|
onDismiss: onDismissIncoming,
|
|
10247
10071
|
onOpenSession
|
|
10248
10072
|
}
|
|
10249
|
-
) : active === "queue" ? /* @__PURE__ */
|
|
10073
|
+
) : active === "queue" ? /* @__PURE__ */ jsx20(
|
|
10250
10074
|
QueuePanel,
|
|
10251
10075
|
{
|
|
10252
10076
|
turns: queuedTurns,
|
|
@@ -10303,8 +10127,8 @@ function SessionChrome({
|
|
|
10303
10127
|
void queue.moveTurn(turnId, beforeTurnId);
|
|
10304
10128
|
} : void 0
|
|
10305
10129
|
}
|
|
10306
|
-
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */
|
|
10307
|
-
return /* @__PURE__ */
|
|
10130
|
+
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx20(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "commands" ? /* @__PURE__ */ jsx20("div", { "data-og-session-chrome-panel": "commands", children: commandsPanel }) : active === "agents" ? /* @__PURE__ */ jsx20("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx20("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
|
|
10131
|
+
return /* @__PURE__ */ jsx20(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx20(
|
|
10308
10132
|
"div",
|
|
10309
10133
|
{
|
|
10310
10134
|
className: cn("og-session-chrome og-root w-full", className),
|
|
@@ -10312,7 +10136,7 @@ function SessionChrome({
|
|
|
10312
10136
|
ref: rootRef,
|
|
10313
10137
|
"data-og-session-chrome": "",
|
|
10314
10138
|
"data-og-session-chrome-open": open ? "true" : "false",
|
|
10315
|
-
children: /* @__PURE__ */
|
|
10139
|
+
children: /* @__PURE__ */ jsxs15(
|
|
10316
10140
|
"div",
|
|
10317
10141
|
{
|
|
10318
10142
|
className: cn(
|
|
@@ -10328,7 +10152,7 @@ function SessionChrome({
|
|
|
10328
10152
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
10329
10153
|
},
|
|
10330
10154
|
children: [
|
|
10331
|
-
/* @__PURE__ */
|
|
10155
|
+
/* @__PURE__ */ jsx20(
|
|
10332
10156
|
"div",
|
|
10333
10157
|
{
|
|
10334
10158
|
className: "relative",
|
|
@@ -10338,7 +10162,7 @@ function SessionChrome({
|
|
|
10338
10162
|
paddingLeft: "var(--og-session-chrome-rail-pad)",
|
|
10339
10163
|
paddingRight: "var(--og-session-chrome-rail-pad)"
|
|
10340
10164
|
},
|
|
10341
|
-
children: /* @__PURE__ */
|
|
10165
|
+
children: /* @__PURE__ */ jsxs15(
|
|
10342
10166
|
"div",
|
|
10343
10167
|
{
|
|
10344
10168
|
ref: railRef,
|
|
@@ -10347,7 +10171,7 @@ function SessionChrome({
|
|
|
10347
10171
|
gap: "10px"
|
|
10348
10172
|
},
|
|
10349
10173
|
children: [
|
|
10350
|
-
/* @__PURE__ */
|
|
10174
|
+
/* @__PURE__ */ jsx20(
|
|
10351
10175
|
motion5.div,
|
|
10352
10176
|
{
|
|
10353
10177
|
"aria-hidden": true,
|
|
@@ -10369,7 +10193,7 @@ function SessionChrome({
|
|
|
10369
10193
|
),
|
|
10370
10194
|
signals.filter((signal) => !["incoming", "agents", "commands"].includes(signal.id)).map((signal) => {
|
|
10371
10195
|
const selected = active === signal.id;
|
|
10372
|
-
return /* @__PURE__ */
|
|
10196
|
+
return /* @__PURE__ */ jsxs15(
|
|
10373
10197
|
"div",
|
|
10374
10198
|
{
|
|
10375
10199
|
role: "group",
|
|
@@ -10380,7 +10204,7 @@ function SessionChrome({
|
|
|
10380
10204
|
selected && "bg-og-surface-3"
|
|
10381
10205
|
),
|
|
10382
10206
|
children: [
|
|
10383
|
-
/* @__PURE__ */
|
|
10207
|
+
/* @__PURE__ */ jsxs15(
|
|
10384
10208
|
"button",
|
|
10385
10209
|
{
|
|
10386
10210
|
type: "button",
|
|
@@ -10409,7 +10233,7 @@ function SessionChrome({
|
|
|
10409
10233
|
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
10410
10234
|
},
|
|
10411
10235
|
children: [
|
|
10412
|
-
signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */
|
|
10236
|
+
signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */ jsx20(
|
|
10413
10237
|
motion5.span,
|
|
10414
10238
|
{
|
|
10415
10239
|
"aria-hidden": "true",
|
|
@@ -10421,26 +10245,26 @@ function SessionChrome({
|
|
|
10421
10245
|
},
|
|
10422
10246
|
queueArrivalNonce
|
|
10423
10247
|
) : null,
|
|
10424
|
-
/* @__PURE__ */
|
|
10425
|
-
/* @__PURE__ */
|
|
10248
|
+
/* @__PURE__ */ jsx20("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
10249
|
+
/* @__PURE__ */ jsxs15("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
|
|
10426
10250
|
signal.id === "goal" ? "Goal \xB7 " : null,
|
|
10427
10251
|
signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : signal.id === "queue" ? queue.error || queue.mutationError ? signal.label : `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
|
|
10428
10252
|
] })
|
|
10429
10253
|
]
|
|
10430
10254
|
}
|
|
10431
10255
|
),
|
|
10432
|
-
signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */
|
|
10433
|
-
record.status === "active" || record.status === "paused" ? /* @__PURE__ */
|
|
10256
|
+
signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
|
|
10257
|
+
record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx20(
|
|
10434
10258
|
IconAction,
|
|
10435
10259
|
{
|
|
10436
10260
|
label: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
10437
10261
|
tip: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
10438
10262
|
disabled: goal.updating,
|
|
10439
10263
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
10440
|
-
children: goal.updating ? /* @__PURE__ */
|
|
10264
|
+
children: goal.updating ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx20(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx20(PauseIcon2, { className: "size-3" })
|
|
10441
10265
|
}
|
|
10442
10266
|
) : null,
|
|
10443
|
-
/* @__PURE__ */
|
|
10267
|
+
/* @__PURE__ */ jsx20(
|
|
10444
10268
|
IconAction,
|
|
10445
10269
|
{
|
|
10446
10270
|
label: "Clear goal",
|
|
@@ -10448,10 +10272,10 @@ function SessionChrome({
|
|
|
10448
10272
|
danger: true,
|
|
10449
10273
|
disabled: goal.updating,
|
|
10450
10274
|
onClick: () => void goal.deleteGoal(),
|
|
10451
|
-
children: /* @__PURE__ */
|
|
10275
|
+
children: /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
|
|
10452
10276
|
}
|
|
10453
10277
|
)
|
|
10454
|
-
] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */
|
|
10278
|
+
] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */ jsx20("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: /* @__PURE__ */ jsx20(
|
|
10455
10279
|
IconAction,
|
|
10456
10280
|
{
|
|
10457
10281
|
label: "Steer first queued message",
|
|
@@ -10460,7 +10284,7 @@ function SessionChrome({
|
|
|
10460
10284
|
tip: QUEUE_STEER_TIP,
|
|
10461
10285
|
disabled: queue.mutating || Boolean(queue.mutationFor(queuedTurns[0].id)),
|
|
10462
10286
|
onClick: () => void queue.steerTurn(queuedTurns[0].id),
|
|
10463
|
-
children: /* @__PURE__ */
|
|
10287
|
+
children: /* @__PURE__ */ jsx20(CornerDownRightIcon, { className: "size-3" })
|
|
10464
10288
|
}
|
|
10465
10289
|
) }) : null
|
|
10466
10290
|
]
|
|
@@ -10468,7 +10292,7 @@ function SessionChrome({
|
|
|
10468
10292
|
signal.id
|
|
10469
10293
|
);
|
|
10470
10294
|
}),
|
|
10471
|
-
signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */
|
|
10295
|
+
signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs15(
|
|
10472
10296
|
"button",
|
|
10473
10297
|
{
|
|
10474
10298
|
type: "button",
|
|
@@ -10490,27 +10314,27 @@ function SessionChrome({
|
|
|
10490
10314
|
activityOpen ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg"
|
|
10491
10315
|
),
|
|
10492
10316
|
children: [
|
|
10493
|
-
/* @__PURE__ */
|
|
10494
|
-
/* @__PURE__ */
|
|
10495
|
-
commandsCount > 0 ? /* @__PURE__ */
|
|
10496
|
-
/* @__PURE__ */
|
|
10317
|
+
/* @__PURE__ */ jsx20(ActivityIcon, { className: "size-3.5" }),
|
|
10318
|
+
/* @__PURE__ */ jsx20("span", { className: "sr-only", children: "Activity" }),
|
|
10319
|
+
commandsCount > 0 ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10320
|
+
/* @__PURE__ */ jsx20(
|
|
10497
10321
|
"span",
|
|
10498
10322
|
{
|
|
10499
10323
|
"aria-hidden": "true",
|
|
10500
10324
|
className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-fg-muted motion-reduce:animate-none"
|
|
10501
10325
|
}
|
|
10502
10326
|
),
|
|
10503
|
-
/* @__PURE__ */
|
|
10327
|
+
/* @__PURE__ */ jsxs15("span", { id: `${panelId}-commands-count`, children: [
|
|
10504
10328
|
commandsCount,
|
|
10505
10329
|
" command",
|
|
10506
10330
|
commandsCount === 1 ? "" : "s"
|
|
10507
10331
|
] })
|
|
10508
10332
|
] }) : null,
|
|
10509
|
-
incoming.length > 0 ? /* @__PURE__ */
|
|
10333
|
+
incoming.length > 0 ? /* @__PURE__ */ jsx20("span", { className: "size-1.5 rounded-full bg-og-accent" }) : null
|
|
10510
10334
|
]
|
|
10511
10335
|
}
|
|
10512
10336
|
) : null,
|
|
10513
|
-
stopping ? /* @__PURE__ */
|
|
10337
|
+
stopping ? /* @__PURE__ */ jsxs15(
|
|
10514
10338
|
"span",
|
|
10515
10339
|
{
|
|
10516
10340
|
role: "status",
|
|
@@ -10518,7 +10342,7 @@ function SessionChrome({
|
|
|
10518
10342
|
className: "inline-flex min-h-[var(--og-session-chrome-chip-min-height)] items-center gap-1.5 px-1.5 text-og-xs text-og-fg-muted",
|
|
10519
10343
|
"data-testid": "session-chrome-stopping",
|
|
10520
10344
|
children: [
|
|
10521
|
-
/* @__PURE__ */
|
|
10345
|
+
/* @__PURE__ */ jsx20(
|
|
10522
10346
|
Loader2Icon2,
|
|
10523
10347
|
{
|
|
10524
10348
|
"aria-hidden": "true",
|
|
@@ -10534,7 +10358,7 @@ function SessionChrome({
|
|
|
10534
10358
|
)
|
|
10535
10359
|
}
|
|
10536
10360
|
),
|
|
10537
|
-
/* @__PURE__ */
|
|
10361
|
+
/* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: activityOpen ? /* @__PURE__ */ jsx20(
|
|
10538
10362
|
motion5.div,
|
|
10539
10363
|
{
|
|
10540
10364
|
initial: { height: 0, opacity: 0 },
|
|
@@ -10542,7 +10366,7 @@ function SessionChrome({
|
|
|
10542
10366
|
exit: { height: 0, opacity: 0 },
|
|
10543
10367
|
transition: { duration: shellDuration, ease },
|
|
10544
10368
|
style: { overflow: "hidden" },
|
|
10545
|
-
children: /* @__PURE__ */
|
|
10369
|
+
children: /* @__PURE__ */ jsx20("div", { className: "mt-1 flex items-center gap-1 rounded-t-og-lg bg-og-surface-2/50 px-2 py-1", children: signals.filter((signal) => ["incoming", "agents", "commands"].includes(signal.id)).map((signal) => /* @__PURE__ */ jsxs15(
|
|
10546
10370
|
"button",
|
|
10547
10371
|
{
|
|
10548
10372
|
type: "button",
|
|
@@ -10564,11 +10388,11 @@ function SessionChrome({
|
|
|
10564
10388
|
},
|
|
10565
10389
|
"activity-tabs"
|
|
10566
10390
|
) : null }),
|
|
10567
|
-
goal?.mutationError ? /* @__PURE__ */
|
|
10391
|
+
goal?.mutationError ? /* @__PURE__ */ jsxs15("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
|
|
10568
10392
|
"Goal action not confirmed. ",
|
|
10569
10393
|
goal.mutationError.message
|
|
10570
10394
|
] }) : null,
|
|
10571
|
-
/* @__PURE__ */
|
|
10395
|
+
/* @__PURE__ */ jsx20(
|
|
10572
10396
|
"div",
|
|
10573
10397
|
{
|
|
10574
10398
|
id: panelId,
|
|
@@ -10584,7 +10408,7 @@ function SessionChrome({
|
|
|
10584
10408
|
transitionDuration: "var(--og-session-chrome-duration)",
|
|
10585
10409
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
10586
10410
|
},
|
|
10587
|
-
children: /* @__PURE__ */
|
|
10411
|
+
children: /* @__PURE__ */ jsx20("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs15(
|
|
10588
10412
|
"div",
|
|
10589
10413
|
{
|
|
10590
10414
|
className: cn(
|
|
@@ -10597,7 +10421,7 @@ function SessionChrome({
|
|
|
10597
10421
|
paddingBlock: "var(--og-session-chrome-panel-pad-y)"
|
|
10598
10422
|
},
|
|
10599
10423
|
children: [
|
|
10600
|
-
/* @__PURE__ */
|
|
10424
|
+
/* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: active && active !== "commands" && panelBody ? /* @__PURE__ */ jsx20(
|
|
10601
10425
|
motion5.div,
|
|
10602
10426
|
{
|
|
10603
10427
|
"data-og-session-chrome-panel-frame": active,
|
|
@@ -10615,7 +10439,7 @@ function SessionChrome({
|
|
|
10615
10439
|
},
|
|
10616
10440
|
active
|
|
10617
10441
|
) : null }),
|
|
10618
|
-
active === "commands" ? /* @__PURE__ */
|
|
10442
|
+
active === "commands" ? /* @__PURE__ */ jsx20(
|
|
10619
10443
|
motion5.div,
|
|
10620
10444
|
{
|
|
10621
10445
|
initial: reduceMotion ? false : { opacity: 0 },
|
|
@@ -10641,20 +10465,20 @@ function IncomingPanel({
|
|
|
10641
10465
|
onDismiss,
|
|
10642
10466
|
onOpenSession
|
|
10643
10467
|
}) {
|
|
10644
|
-
return /* @__PURE__ */
|
|
10645
|
-
/* @__PURE__ */
|
|
10646
|
-
/* @__PURE__ */
|
|
10468
|
+
return /* @__PURE__ */ jsxs15("div", { children: [
|
|
10469
|
+
/* @__PURE__ */ jsx20("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
|
|
10470
|
+
/* @__PURE__ */ jsx20(
|
|
10647
10471
|
"ul",
|
|
10648
10472
|
{
|
|
10649
10473
|
className: "flex flex-col gap-0.5",
|
|
10650
10474
|
"aria-label": "Incoming updates",
|
|
10651
10475
|
"data-og-session-chrome-panel": "incoming",
|
|
10652
|
-
children: inputs.map((input) => /* @__PURE__ */
|
|
10476
|
+
children: inputs.map((input) => /* @__PURE__ */ jsxs15(
|
|
10653
10477
|
"li",
|
|
10654
10478
|
{
|
|
10655
10479
|
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)]",
|
|
10656
10480
|
children: [
|
|
10657
|
-
/* @__PURE__ */
|
|
10481
|
+
/* @__PURE__ */ jsx20(
|
|
10658
10482
|
"span",
|
|
10659
10483
|
{
|
|
10660
10484
|
className: cn(
|
|
@@ -10664,9 +10488,9 @@ function IncomingPanel({
|
|
|
10664
10488
|
children: pendingKindLabel(input.kind)
|
|
10665
10489
|
}
|
|
10666
10490
|
),
|
|
10667
|
-
/* @__PURE__ */
|
|
10668
|
-
/* @__PURE__ */
|
|
10669
|
-
/* @__PURE__ */
|
|
10491
|
+
/* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
|
|
10492
|
+
/* @__PURE__ */ jsx20("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
|
|
10493
|
+
/* @__PURE__ */ jsx20(
|
|
10670
10494
|
ChildSessionLink,
|
|
10671
10495
|
{
|
|
10672
10496
|
kind: input.kind,
|
|
@@ -10675,14 +10499,14 @@ function IncomingPanel({
|
|
|
10675
10499
|
}
|
|
10676
10500
|
)
|
|
10677
10501
|
] }),
|
|
10678
|
-
onDismiss ? /* @__PURE__ */
|
|
10502
|
+
onDismiss ? /* @__PURE__ */ jsx20("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: /* @__PURE__ */ jsx20(
|
|
10679
10503
|
IconAction,
|
|
10680
10504
|
{
|
|
10681
10505
|
label: `Dismiss incoming ${pendingKindLabel(input.kind)}`,
|
|
10682
10506
|
tip: "Dismiss",
|
|
10683
10507
|
onClick: () => onDismiss(input.id),
|
|
10684
10508
|
danger: true,
|
|
10685
|
-
children: /* @__PURE__ */
|
|
10509
|
+
children: /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
|
|
10686
10510
|
}
|
|
10687
10511
|
) }) : null
|
|
10688
10512
|
]
|
|
@@ -10714,10 +10538,10 @@ function QueuePanel({
|
|
|
10714
10538
|
}) {
|
|
10715
10539
|
const reduceMotion = useReducedMotion4();
|
|
10716
10540
|
const turnIdsKey = turns.map((turn) => turn.id).join(",");
|
|
10717
|
-
const [interactiveTurnIds, setInteractiveTurnIds] =
|
|
10541
|
+
const [interactiveTurnIds, setInteractiveTurnIds] = useState15(
|
|
10718
10542
|
() => /* @__PURE__ */ new Set()
|
|
10719
10543
|
);
|
|
10720
|
-
|
|
10544
|
+
useEffect10(() => {
|
|
10721
10545
|
const visibleTurnIds = new Set(turnIdsKey ? turnIdsKey.split(",") : []);
|
|
10722
10546
|
setInteractiveTurnIds((current) => {
|
|
10723
10547
|
const retained = new Set([...current].filter((turnId) => visibleTurnIds.has(turnId)));
|
|
@@ -10730,7 +10554,7 @@ function QueuePanel({
|
|
|
10730
10554
|
);
|
|
10731
10555
|
return () => clearTimeout(timer);
|
|
10732
10556
|
}, [reduceMotion, turnIdsKey]);
|
|
10733
|
-
return /* @__PURE__ */
|
|
10557
|
+
return /* @__PURE__ */ jsxs15(
|
|
10734
10558
|
"ol",
|
|
10735
10559
|
{
|
|
10736
10560
|
className: "flex flex-col gap-0.5",
|
|
@@ -10746,52 +10570,52 @@ function QueuePanel({
|
|
|
10746
10570
|
const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
|
|
10747
10571
|
const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
|
|
10748
10572
|
const confirmingReplace = replaceDraftFor === turn.id;
|
|
10749
|
-
return /* @__PURE__ */
|
|
10573
|
+
return /* @__PURE__ */ jsxs15(
|
|
10750
10574
|
"li",
|
|
10751
10575
|
{
|
|
10752
10576
|
"data-queue-turn-id": turn.id,
|
|
10753
10577
|
tabIndex: -1,
|
|
10754
10578
|
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)]",
|
|
10755
10579
|
children: [
|
|
10756
|
-
/* @__PURE__ */
|
|
10757
|
-
voice ? /* @__PURE__ */
|
|
10580
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-1.5", children: [
|
|
10581
|
+
voice ? /* @__PURE__ */ jsx20(
|
|
10758
10582
|
AudioLinesIcon,
|
|
10759
10583
|
{
|
|
10760
10584
|
"aria-hidden": "true",
|
|
10761
10585
|
className: "mt-0.5 size-3 shrink-0 text-og-accent"
|
|
10762
10586
|
}
|
|
10763
|
-
) : /* @__PURE__ */
|
|
10764
|
-
/* @__PURE__ */
|
|
10587
|
+
) : /* @__PURE__ */ jsx20("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
|
|
10588
|
+
/* @__PURE__ */ jsx20(
|
|
10765
10589
|
CompactQueueItemContent,
|
|
10766
10590
|
{
|
|
10767
10591
|
text: presentation.text,
|
|
10768
10592
|
annotations: turn.annotations ?? []
|
|
10769
10593
|
}
|
|
10770
10594
|
),
|
|
10771
|
-
showActions ? /* @__PURE__ */
|
|
10772
|
-
onMove && turns.length > 1 ? /* @__PURE__ */
|
|
10773
|
-
/* @__PURE__ */
|
|
10595
|
+
showActions ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: [
|
|
10596
|
+
onMove && turns.length > 1 ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10597
|
+
/* @__PURE__ */ jsx20(
|
|
10774
10598
|
IconAction,
|
|
10775
10599
|
{
|
|
10776
10600
|
label: `Move queued prompt ${index + 1} up`,
|
|
10777
10601
|
tip: "Move up",
|
|
10778
10602
|
disabled: settling || pending !== null || index === 0,
|
|
10779
10603
|
onClick: () => onMove(turn.id, beforeUp),
|
|
10780
|
-
children: /* @__PURE__ */
|
|
10604
|
+
children: /* @__PURE__ */ jsx20(ArrowUpIcon2, { className: "size-3" })
|
|
10781
10605
|
}
|
|
10782
10606
|
),
|
|
10783
|
-
/* @__PURE__ */
|
|
10607
|
+
/* @__PURE__ */ jsx20(
|
|
10784
10608
|
IconAction,
|
|
10785
10609
|
{
|
|
10786
10610
|
label: `Move queued prompt ${index + 1} down`,
|
|
10787
10611
|
tip: "Move down",
|
|
10788
10612
|
disabled: settling || pending !== null || index >= turns.length - 1,
|
|
10789
10613
|
onClick: () => onMove(turn.id, beforeDown),
|
|
10790
|
-
children: /* @__PURE__ */
|
|
10614
|
+
children: /* @__PURE__ */ jsx20(ArrowDownIcon2, { className: "size-3" })
|
|
10791
10615
|
}
|
|
10792
10616
|
)
|
|
10793
10617
|
] }) : null,
|
|
10794
|
-
onSteer ? /* @__PURE__ */
|
|
10618
|
+
onSteer ? /* @__PURE__ */ jsx20(
|
|
10795
10619
|
IconAction,
|
|
10796
10620
|
{
|
|
10797
10621
|
label: `Steer queued prompt ${index + 1}`,
|
|
@@ -10800,20 +10624,20 @@ function QueuePanel({
|
|
|
10800
10624
|
tip: QUEUE_STEER_TIP,
|
|
10801
10625
|
disabled: settling || pending !== null,
|
|
10802
10626
|
onClick: () => onSteer(turn.id),
|
|
10803
|
-
children: pending === "steer" ? /* @__PURE__ */
|
|
10627
|
+
children: pending === "steer" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(CornerDownRightIcon, { className: "size-3" })
|
|
10804
10628
|
}
|
|
10805
10629
|
) : null,
|
|
10806
|
-
onEdit ? /* @__PURE__ */
|
|
10630
|
+
onEdit ? /* @__PURE__ */ jsx20(
|
|
10807
10631
|
IconAction,
|
|
10808
10632
|
{
|
|
10809
10633
|
label: `Edit queued prompt ${index + 1}`,
|
|
10810
10634
|
tip: QUEUE_EDIT_TIP,
|
|
10811
10635
|
disabled: settling || pending !== null,
|
|
10812
10636
|
onClick: () => onEdit(turn),
|
|
10813
|
-
children: pending === "edit" ? /* @__PURE__ */
|
|
10637
|
+
children: pending === "edit" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(PencilIcon, { className: "size-3" })
|
|
10814
10638
|
}
|
|
10815
10639
|
) : null,
|
|
10816
|
-
onRemove ? /* @__PURE__ */
|
|
10640
|
+
onRemove ? /* @__PURE__ */ jsx20(
|
|
10817
10641
|
IconAction,
|
|
10818
10642
|
{
|
|
10819
10643
|
label: `Remove queued prompt ${index + 1}`,
|
|
@@ -10821,16 +10645,16 @@ function QueuePanel({
|
|
|
10821
10645
|
disabled: settling || pending !== null,
|
|
10822
10646
|
onClick: () => onRemove(turn.id),
|
|
10823
10647
|
danger: true,
|
|
10824
|
-
children: pending === "delete" ? /* @__PURE__ */
|
|
10648
|
+
children: pending === "delete" ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" })
|
|
10825
10649
|
}
|
|
10826
10650
|
) : null
|
|
10827
10651
|
] }) : null
|
|
10828
10652
|
] }),
|
|
10829
|
-
confirmingReplace ? /* @__PURE__ */
|
|
10830
|
-
/* @__PURE__ */
|
|
10831
|
-
/* @__PURE__ */
|
|
10832
|
-
/* @__PURE__ */
|
|
10833
|
-
/* @__PURE__ */
|
|
10653
|
+
confirmingReplace ? /* @__PURE__ */ jsxs15("div", { className: "rounded-og-sm border border-og-status-waiting/30 bg-og-status-waiting/10 p-2 text-og-xs text-og-fg", children: [
|
|
10654
|
+
/* @__PURE__ */ jsx20("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
|
|
10655
|
+
/* @__PURE__ */ jsx20("p", { className: "mt-0.5 text-og-fg-muted", children: "The current draft will be permanently discarded; this queued prompt is preserved until you confirm." }),
|
|
10656
|
+
/* @__PURE__ */ jsxs15("div", { className: "mt-2 flex justify-end gap-1.5", children: [
|
|
10657
|
+
/* @__PURE__ */ jsx20(
|
|
10834
10658
|
"button",
|
|
10835
10659
|
{
|
|
10836
10660
|
type: "button",
|
|
@@ -10839,7 +10663,7 @@ function QueuePanel({
|
|
|
10839
10663
|
children: "Keep current draft"
|
|
10840
10664
|
}
|
|
10841
10665
|
),
|
|
10842
|
-
/* @__PURE__ */
|
|
10666
|
+
/* @__PURE__ */ jsx20(
|
|
10843
10667
|
"button",
|
|
10844
10668
|
{
|
|
10845
10669
|
type: "button",
|
|
@@ -10855,7 +10679,7 @@ function QueuePanel({
|
|
|
10855
10679
|
turn.id
|
|
10856
10680
|
);
|
|
10857
10681
|
}),
|
|
10858
|
-
/* @__PURE__ */
|
|
10682
|
+
/* @__PURE__ */ jsx20(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs15(
|
|
10859
10683
|
motion5.li,
|
|
10860
10684
|
{
|
|
10861
10685
|
"aria-live": "polite",
|
|
@@ -10868,11 +10692,11 @@ function QueuePanel({
|
|
|
10868
10692
|
message.state === "failed" ? "bg-og-danger/8 text-og-danger" : "bg-og-accent-soft/45"
|
|
10869
10693
|
),
|
|
10870
10694
|
children: [
|
|
10871
|
-
/* @__PURE__ */
|
|
10872
|
-
/* @__PURE__ */
|
|
10873
|
-
/* @__PURE__ */
|
|
10874
|
-
message.state === "failed" ? /* @__PURE__ */
|
|
10875
|
-
onRetryOptimistic ? /* @__PURE__ */
|
|
10695
|
+
/* @__PURE__ */ jsx20("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
|
|
10696
|
+
/* @__PURE__ */ jsx20(CompactQueueItemContent, { text: message.text, annotations: message.annotations }),
|
|
10697
|
+
/* @__PURE__ */ jsx20("span", { className: "sr-only", children: message.state === "failed" ? "Not confirmed" : message.state === "sending" ? "Placing in queue" : "Queued" }),
|
|
10698
|
+
message.state === "failed" ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
|
|
10699
|
+
onRetryOptimistic ? /* @__PURE__ */ jsx20(
|
|
10876
10700
|
"button",
|
|
10877
10701
|
{
|
|
10878
10702
|
type: "button",
|
|
@@ -10881,36 +10705,36 @@ function QueuePanel({
|
|
|
10881
10705
|
children: "Retry"
|
|
10882
10706
|
}
|
|
10883
10707
|
) : null,
|
|
10884
|
-
onRemoveOptimistic ? /* @__PURE__ */
|
|
10708
|
+
onRemoveOptimistic ? /* @__PURE__ */ jsx20(
|
|
10885
10709
|
"button",
|
|
10886
10710
|
{
|
|
10887
10711
|
type: "button",
|
|
10888
10712
|
"aria-label": "Dismiss unconfirmed queued prompt",
|
|
10889
10713
|
className: "rounded-og-sm p-1 text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
10890
10714
|
onClick: () => onRemoveOptimistic(message.clientEventId),
|
|
10891
|
-
children: /* @__PURE__ */
|
|
10715
|
+
children: /* @__PURE__ */ jsx20(XIcon2, { className: "size-3" })
|
|
10892
10716
|
}
|
|
10893
10717
|
) : null
|
|
10894
|
-
] }) : message.state === "sending" ? /* @__PURE__ */
|
|
10718
|
+
] }) : message.state === "sending" ? /* @__PURE__ */ jsx20(
|
|
10895
10719
|
Loader2Icon2,
|
|
10896
10720
|
{
|
|
10897
10721
|
"aria-hidden": "true",
|
|
10898
10722
|
className: "size-3 shrink-0 animate-og-spin text-og-accent motion-reduce:animate-none"
|
|
10899
10723
|
}
|
|
10900
|
-
) : /* @__PURE__ */
|
|
10724
|
+
) : /* @__PURE__ */ jsx20(CheckIcon3, { "aria-hidden": "true", className: "size-3 shrink-0 text-og-accent" })
|
|
10901
10725
|
]
|
|
10902
10726
|
},
|
|
10903
10727
|
message.clientEventId
|
|
10904
10728
|
)) }),
|
|
10905
|
-
loadError ? /* @__PURE__ */
|
|
10729
|
+
loadError ? /* @__PURE__ */ jsxs15(
|
|
10906
10730
|
"li",
|
|
10907
10731
|
{
|
|
10908
10732
|
role: "alert",
|
|
10909
10733
|
className: "flex items-center gap-1.5 rounded-og-sm bg-og-danger/8 px-1.5 py-1 text-og-xs text-og-danger",
|
|
10910
10734
|
children: [
|
|
10911
|
-
/* @__PURE__ */
|
|
10912
|
-
/* @__PURE__ */
|
|
10913
|
-
/* @__PURE__ */
|
|
10735
|
+
/* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
10736
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1", children: "Queue unavailable." }),
|
|
10737
|
+
/* @__PURE__ */ jsx20(
|
|
10914
10738
|
"button",
|
|
10915
10739
|
{
|
|
10916
10740
|
type: "button",
|
|
@@ -10922,15 +10746,15 @@ function QueuePanel({
|
|
|
10922
10746
|
]
|
|
10923
10747
|
}
|
|
10924
10748
|
) : null,
|
|
10925
|
-
mutationError ? /* @__PURE__ */
|
|
10749
|
+
mutationError ? /* @__PURE__ */ jsxs15(
|
|
10926
10750
|
"li",
|
|
10927
10751
|
{
|
|
10928
10752
|
role: "alert",
|
|
10929
10753
|
className: "flex items-center gap-1.5 rounded-og-sm bg-og-danger/8 px-1.5 py-1 text-og-xs text-og-danger",
|
|
10930
10754
|
children: [
|
|
10931
|
-
/* @__PURE__ */
|
|
10932
|
-
/* @__PURE__ */
|
|
10933
|
-
/* @__PURE__ */
|
|
10755
|
+
/* @__PURE__ */ jsx20(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
10756
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1", children: "Not confirmed. Check the queue before retrying." }),
|
|
10757
|
+
/* @__PURE__ */ jsx20(
|
|
10934
10758
|
"button",
|
|
10935
10759
|
{
|
|
10936
10760
|
type: "button",
|
|
@@ -10951,9 +10775,9 @@ function CompactQueueItemContent({
|
|
|
10951
10775
|
annotations
|
|
10952
10776
|
}) {
|
|
10953
10777
|
const content = queueItemContent(text, annotations.length);
|
|
10954
|
-
return /* @__PURE__ */
|
|
10955
|
-
content === "text" ? /* @__PURE__ */
|
|
10956
|
-
annotations.length > 0 ? /* @__PURE__ */
|
|
10778
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
10779
|
+
content === "text" ? /* @__PURE__ */ jsx20("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: text }) : content === "unavailable" ? /* @__PURE__ */ jsx20("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg-muted italic", children: QUEUE_ITEM_CONTENT_UNAVAILABLE }) : null,
|
|
10780
|
+
annotations.length > 0 ? /* @__PURE__ */ jsx20(TimelineAnnotationsChip, { annotations, className: "shrink-0", compact: true }) : null
|
|
10957
10781
|
] });
|
|
10958
10782
|
}
|
|
10959
10783
|
function GoalPanel({
|
|
@@ -10966,26 +10790,26 @@ function GoalPanel({
|
|
|
10966
10790
|
if (!record) return null;
|
|
10967
10791
|
const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
|
|
10968
10792
|
const explanation = sessionChromeGoalPillExplanation(state, record);
|
|
10969
|
-
return /* @__PURE__ */
|
|
10970
|
-
/* @__PURE__ */
|
|
10971
|
-
/* @__PURE__ */
|
|
10972
|
-
elapsed ? /* @__PURE__ */
|
|
10793
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
|
|
10794
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
|
|
10795
|
+
/* @__PURE__ */ jsx20("span", { children: sessionChromeGoalPillLabel(state, record) }),
|
|
10796
|
+
elapsed ? /* @__PURE__ */ jsxs15("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
|
|
10973
10797
|
"\xB7 Created ",
|
|
10974
10798
|
elapsed,
|
|
10975
10799
|
" ago"
|
|
10976
10800
|
] }) : null,
|
|
10977
|
-
/* @__PURE__ */
|
|
10801
|
+
/* @__PURE__ */ jsxs15("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
|
|
10978
10802
|
"\xB7 v",
|
|
10979
10803
|
record.version
|
|
10980
10804
|
] })
|
|
10981
10805
|
] }),
|
|
10982
|
-
/* @__PURE__ */
|
|
10983
|
-
record.successCriteria ? /* @__PURE__ */
|
|
10984
|
-
/* @__PURE__ */
|
|
10806
|
+
/* @__PURE__ */ jsx20("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
|
|
10807
|
+
record.successCriteria ? /* @__PURE__ */ jsxs15("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
|
|
10808
|
+
/* @__PURE__ */ jsx20("span", { className: "font-medium text-og-fg", children: "Done when" }),
|
|
10985
10809
|
" ",
|
|
10986
10810
|
record.successCriteria
|
|
10987
10811
|
] }) : null,
|
|
10988
|
-
explanation ? /* @__PURE__ */
|
|
10812
|
+
explanation ? /* @__PURE__ */ jsx20(
|
|
10989
10813
|
"p",
|
|
10990
10814
|
{
|
|
10991
10815
|
"data-og-session-chrome-goal-explanation": true,
|
|
@@ -10993,20 +10817,20 @@ function GoalPanel({
|
|
|
10993
10817
|
children: explanation
|
|
10994
10818
|
}
|
|
10995
10819
|
) : null,
|
|
10996
|
-
record.continuation?.lastError ? /* @__PURE__ */
|
|
10997
|
-
/* @__PURE__ */
|
|
10998
|
-
/* @__PURE__ */
|
|
10999
|
-
/* @__PURE__ */
|
|
10820
|
+
record.continuation?.lastError ? /* @__PURE__ */ jsx20("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children: record.continuation.lastError }) : null,
|
|
10821
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
|
|
10822
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
|
|
10823
|
+
/* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
11000
10824
|
record.autoContinuations,
|
|
11001
10825
|
" consecutive unattended continues"
|
|
11002
10826
|
] }),
|
|
11003
|
-
/* @__PURE__ */
|
|
10827
|
+
/* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
11004
10828
|
record.noProgressStreak,
|
|
11005
10829
|
" stalled"
|
|
11006
10830
|
] })
|
|
11007
10831
|
] }),
|
|
11008
|
-
!readOnly ? /* @__PURE__ */
|
|
11009
|
-
canToggle ? /* @__PURE__ */
|
|
10832
|
+
!readOnly ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-0.5", children: [
|
|
10833
|
+
canToggle ? /* @__PURE__ */ jsxs15(
|
|
11010
10834
|
"button",
|
|
11011
10835
|
{
|
|
11012
10836
|
type: "button",
|
|
@@ -11014,12 +10838,12 @@ function GoalPanel({
|
|
|
11014
10838
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
11015
10839
|
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
11016
10840
|
children: [
|
|
11017
|
-
goal.updating ? /* @__PURE__ */
|
|
10841
|
+
goal.updating ? /* @__PURE__ */ jsx20(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx20(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx20(PauseIcon2, { className: "size-3" }),
|
|
11018
10842
|
record.status === "paused" ? "Resume" : "Pause"
|
|
11019
10843
|
]
|
|
11020
10844
|
}
|
|
11021
10845
|
) : null,
|
|
11022
|
-
/* @__PURE__ */
|
|
10846
|
+
/* @__PURE__ */ jsxs15(
|
|
11023
10847
|
"button",
|
|
11024
10848
|
{
|
|
11025
10849
|
type: "button",
|
|
@@ -11027,7 +10851,7 @@ function GoalPanel({
|
|
|
11027
10851
|
onClick: () => void goal.deleteGoal(),
|
|
11028
10852
|
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-subtle outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-danger focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
11029
10853
|
children: [
|
|
11030
|
-
/* @__PURE__ */
|
|
10854
|
+
/* @__PURE__ */ jsx20(Trash2Icon2, { className: "size-3" }),
|
|
11031
10855
|
"Clear"
|
|
11032
10856
|
]
|
|
11033
10857
|
}
|
|
@@ -11036,9 +10860,9 @@ function GoalPanel({
|
|
|
11036
10860
|
] })
|
|
11037
10861
|
] });
|
|
11038
10862
|
}
|
|
11039
|
-
var QUEUE_STEER_TIP = /* @__PURE__ */
|
|
11040
|
-
/* @__PURE__ */
|
|
11041
|
-
/* @__PURE__ */
|
|
10863
|
+
var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs15("span", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
10864
|
+
/* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Steer" }),
|
|
10865
|
+
/* @__PURE__ */ jsx20("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
|
|
11042
10866
|
] });
|
|
11043
10867
|
var QUEUE_EDIT_TIP = "Edit in composer";
|
|
11044
10868
|
var QUEUE_DELETE_TIP = "Delete this queued prompt";
|
|
@@ -11052,8 +10876,8 @@ function IconAction({
|
|
|
11052
10876
|
danger,
|
|
11053
10877
|
children
|
|
11054
10878
|
}) {
|
|
11055
|
-
return /* @__PURE__ */
|
|
11056
|
-
/* @__PURE__ */
|
|
10879
|
+
return /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
10880
|
+
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
11057
10881
|
"button",
|
|
11058
10882
|
{
|
|
11059
10883
|
type: "button",
|
|
@@ -11075,34 +10899,21 @@ function IconAction({
|
|
|
11075
10899
|
]
|
|
11076
10900
|
}
|
|
11077
10901
|
) }),
|
|
11078
|
-
/* @__PURE__ */
|
|
10902
|
+
/* @__PURE__ */ jsx20(TooltipContent, { side: "top", children: tip })
|
|
11079
10903
|
] });
|
|
11080
10904
|
}
|
|
11081
10905
|
|
|
11082
10906
|
// src/components/session-conversation.tsx
|
|
11083
|
-
import {
|
|
11084
|
-
import {
|
|
11085
|
-
lazy as lazy5,
|
|
11086
|
-
Suspense as Suspense6,
|
|
11087
|
-
useCallback as useCallback5,
|
|
11088
|
-
useEffect as useEffect12,
|
|
11089
|
-
useMemo as useMemo7,
|
|
11090
|
-
useRef as useRef11,
|
|
11091
|
-
useState as useState17
|
|
11092
|
-
} from "react";
|
|
11093
|
-
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10907
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useRef as useRef11, useState as useState16 } from "react";
|
|
10908
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
11094
10909
|
function SessionConversation(props) {
|
|
11095
|
-
return /* @__PURE__ */
|
|
10910
|
+
return /* @__PURE__ */ jsx21(Conversation, { ...props }, `${props.workspaceId ?? ""}:${props.sessionId}`);
|
|
11096
10911
|
}
|
|
11097
10912
|
function Conversation({
|
|
11098
10913
|
sessionId,
|
|
11099
10914
|
renderMessageText,
|
|
11100
10915
|
resolveLink,
|
|
11101
|
-
onOpenArtifact,
|
|
11102
|
-
renderInteractiveBlock,
|
|
11103
10916
|
toolRegistry,
|
|
11104
|
-
renderAllowanceExhausted,
|
|
11105
|
-
allowanceExhaustedLabels,
|
|
11106
10917
|
attachments: attachmentsRequested = true,
|
|
11107
10918
|
modelPicker,
|
|
11108
10919
|
userMessageDisclosureLabels,
|
|
@@ -11128,10 +10939,10 @@ function Conversation({
|
|
|
11128
10939
|
const options = { ...scope, events: feed.events };
|
|
11129
10940
|
const detail = useSession(sessionId, options);
|
|
11130
10941
|
const queue = useTurnQueue(sessionId, options);
|
|
11131
|
-
const [queueFocusTarget, setQueueFocusTarget] =
|
|
10942
|
+
const [queueFocusTarget, setQueueFocusTarget] = useState16();
|
|
11132
10943
|
const human = useHumanInputRequests(sessionId, options);
|
|
11133
10944
|
const control = useSessionControl(sessionId, scope);
|
|
11134
|
-
const approvals =
|
|
10945
|
+
const approvals = useMemo6(() => projectPendingApprovals(feed.events), [feed.events]);
|
|
11135
10946
|
const files = useFileAttachments(scope);
|
|
11136
10947
|
const uploadsEnabled = attachmentsRequested && config.uploads;
|
|
11137
10948
|
const status = feed.sessionStatus ?? detail.session?.status;
|
|
@@ -11153,13 +10964,8 @@ function Conversation({
|
|
|
11153
10964
|
} : {}
|
|
11154
10965
|
});
|
|
11155
10966
|
const region = useRef11(null);
|
|
11156
|
-
const defaultInteractiveBlock = useDefaultInteractiveBlock(
|
|
11157
|
-
context.client,
|
|
11158
|
-
context.workspaceId,
|
|
11159
|
-
sessionId
|
|
11160
|
-
);
|
|
11161
10967
|
const inheritedLinks = useOpenGeniLinkResolver();
|
|
11162
|
-
const defaultLinks =
|
|
10968
|
+
const defaultLinks = useMemo6(
|
|
11163
10969
|
() => sessionLinkResolver({
|
|
11164
10970
|
client: context.client,
|
|
11165
10971
|
workspaceId: context.workspaceId,
|
|
@@ -11168,22 +10974,12 @@ function Conversation({
|
|
|
11168
10974
|
}),
|
|
11169
10975
|
[context.client, context.workspaceId, sessionId, config.sandboxFiles]
|
|
11170
10976
|
);
|
|
11171
|
-
const
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
const viewerLinks = useMemo7(
|
|
11175
|
-
() => opensArtifacts ? viewerLinkResolver({
|
|
11176
|
-
workspaceId: context.workspaceId,
|
|
11177
|
-
open: (target) => onOpenArtifactRef.current?.(target)
|
|
11178
|
-
}) : null,
|
|
11179
|
-
[context.workspaceId, opensArtifacts]
|
|
11180
|
-
);
|
|
11181
|
-
const links = useMemo7(
|
|
11182
|
-
() => chainLinkResolvers(resolveLink, viewerLinks, inheritedLinks, defaultLinks) ?? void 0,
|
|
11183
|
-
[resolveLink, viewerLinks, inheritedLinks, defaultLinks]
|
|
10977
|
+
const links = useMemo6(
|
|
10978
|
+
() => chainLinkResolvers(resolveLink, inheritedLinks, defaultLinks) ?? void 0,
|
|
10979
|
+
[resolveLink, inheritedLinks, defaultLinks]
|
|
11184
10980
|
);
|
|
11185
10981
|
const error = detail.error ?? feed.error ?? human.error;
|
|
11186
|
-
return /* @__PURE__ */
|
|
10982
|
+
return /* @__PURE__ */ jsxs16(
|
|
11187
10983
|
"div",
|
|
11188
10984
|
{
|
|
11189
10985
|
className: cn(
|
|
@@ -11194,16 +10990,13 @@ function Conversation({
|
|
|
11194
10990
|
style: { height },
|
|
11195
10991
|
"data-og-conversation": "",
|
|
11196
10992
|
children: [
|
|
11197
|
-
error && /* @__PURE__ */
|
|
11198
|
-
/* @__PURE__ */
|
|
10993
|
+
error && /* @__PURE__ */ jsx21("p", { role: "alert", children: error.message }),
|
|
10994
|
+
/* @__PURE__ */ jsx21(
|
|
11199
10995
|
MessageTimeline,
|
|
11200
10996
|
{
|
|
11201
10997
|
renderMessageText,
|
|
11202
10998
|
resolveLink: links,
|
|
11203
|
-
renderInteractiveBlock: renderInteractiveBlock === false ? void 0 : renderInteractiveBlock ?? defaultInteractiveBlock,
|
|
11204
10999
|
userMessageDisclosureLabels,
|
|
11205
|
-
renderAllowanceExhausted,
|
|
11206
|
-
allowanceExhaustedLabels,
|
|
11207
11000
|
className: "min-h-0 flex-1",
|
|
11208
11001
|
...toolRegistry ? { toolRegistry } : {},
|
|
11209
11002
|
events: feed.events,
|
|
@@ -11221,7 +11014,7 @@ function Conversation({
|
|
|
11221
11014
|
},
|
|
11222
11015
|
loadingOldest: feed.loadingOldest,
|
|
11223
11016
|
onJumpToLatest: feed.jumpToLatest,
|
|
11224
|
-
onJumpToLatestQuestion:
|
|
11017
|
+
onJumpToLatestQuestion: () => feed.jumpToLatestQuestion({
|
|
11225
11018
|
onQueuedQuestion: async (turn, navigation) => {
|
|
11226
11019
|
await queue.refresh();
|
|
11227
11020
|
if (!navigation.isCurrent() || scopeRef.current.client !== context.client || scopeRef.current.workspaceId !== context.workspaceId)
|
|
@@ -11231,12 +11024,12 @@ function Conversation({
|
|
|
11231
11024
|
requestId: (previous?.requestId ?? 0) + 1
|
|
11232
11025
|
}));
|
|
11233
11026
|
}
|
|
11234
|
-
})
|
|
11027
|
+
}),
|
|
11235
11028
|
onAnnotate: composer.addAnnotation
|
|
11236
11029
|
}
|
|
11237
11030
|
),
|
|
11238
|
-
/* @__PURE__ */
|
|
11239
|
-
approvals.length > 0 && !terminal ? /* @__PURE__ */
|
|
11031
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-h-0 max-h-[40%] shrink-0 overflow-y-auto", "data-og-conversation-inputs": "", children: [
|
|
11032
|
+
approvals.length > 0 && !terminal ? /* @__PURE__ */ jsx21(
|
|
11240
11033
|
ApprovalSurface,
|
|
11241
11034
|
{
|
|
11242
11035
|
className: "mx-auto max-w-3xl",
|
|
@@ -11251,7 +11044,7 @@ function Conversation({
|
|
|
11251
11044
|
error: control.error
|
|
11252
11045
|
}
|
|
11253
11046
|
) : null,
|
|
11254
|
-
/* @__PURE__ */
|
|
11047
|
+
/* @__PURE__ */ jsx21(
|
|
11255
11048
|
HumanInputSurface,
|
|
11256
11049
|
{
|
|
11257
11050
|
loadSkillReview,
|
|
@@ -11264,7 +11057,7 @@ function Conversation({
|
|
|
11264
11057
|
autoFocus: false
|
|
11265
11058
|
}
|
|
11266
11059
|
),
|
|
11267
|
-
terminal ? /* @__PURE__ */
|
|
11060
|
+
terminal ? /* @__PURE__ */ jsx21(
|
|
11268
11061
|
SessionChrome,
|
|
11269
11062
|
{
|
|
11270
11063
|
queue,
|
|
@@ -11272,7 +11065,7 @@ function Conversation({
|
|
|
11272
11065
|
sessionStatus: status,
|
|
11273
11066
|
readOnly: true
|
|
11274
11067
|
}
|
|
11275
|
-
) : /* @__PURE__ */
|
|
11068
|
+
) : /* @__PURE__ */ jsx21(
|
|
11276
11069
|
SessionChrome,
|
|
11277
11070
|
{
|
|
11278
11071
|
queue,
|
|
@@ -11283,14 +11076,14 @@ function Conversation({
|
|
|
11283
11076
|
}
|
|
11284
11077
|
)
|
|
11285
11078
|
] }),
|
|
11286
|
-
/* @__PURE__ */
|
|
11079
|
+
/* @__PURE__ */ jsx21("div", { className: "shrink-0", "data-og-conversation-composer": "", children: /* @__PURE__ */ jsx21(
|
|
11287
11080
|
ChatComposer,
|
|
11288
11081
|
{
|
|
11289
11082
|
...composerProps,
|
|
11290
11083
|
composer,
|
|
11291
11084
|
attachments: uploadsEnabled ? files : void 0,
|
|
11292
11085
|
disabled: terminal || composerProps?.disabled,
|
|
11293
|
-
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */
|
|
11086
|
+
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */ jsx21(
|
|
11294
11087
|
ModelPolicyPicker,
|
|
11295
11088
|
{
|
|
11296
11089
|
rows: catalog.rows,
|
|
@@ -11315,37 +11108,9 @@ function Conversation({
|
|
|
11315
11108
|
}
|
|
11316
11109
|
);
|
|
11317
11110
|
}
|
|
11318
|
-
var LazyChatInteractiveBlock = lazy5(
|
|
11319
|
-
() => import("./chat-interactive-block-VAGABN7J.js").then((module) => ({
|
|
11320
|
-
default: module.ChatInteractiveBlock
|
|
11321
|
-
}))
|
|
11322
|
-
);
|
|
11323
|
-
function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
|
|
11324
|
-
const scoped = useMemo7(() => {
|
|
11325
|
-
let resolved = null;
|
|
11326
|
-
const get = () => {
|
|
11327
|
-
const candidate = client;
|
|
11328
|
-
resolved ??= typeof candidate.withHeaders === "function" ? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId }) : candidate;
|
|
11329
|
-
return resolved;
|
|
11330
|
-
};
|
|
11331
|
-
return {
|
|
11332
|
-
getWorkspaceArtifact: (...args) => get().getWorkspaceArtifact(...args),
|
|
11333
|
-
getWorkspaceArtifactHtml: (...args) => get().getWorkspaceArtifactHtml(...args),
|
|
11334
|
-
getWorkspaceArtifactContent: (...args) => {
|
|
11335
|
-
const target = get();
|
|
11336
|
-
if (!target.getWorkspaceArtifactContent) throw new Error("Site version unavailable");
|
|
11337
|
-
return target.getWorkspaceArtifactContent(...args);
|
|
11338
|
-
}
|
|
11339
|
-
};
|
|
11340
|
-
}, [client, sessionId]);
|
|
11341
|
-
return useCallback5(
|
|
11342
|
-
(block) => /* @__PURE__ */ jsx22(Suspense6, { fallback: /* @__PURE__ */ jsx22("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx22(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
|
|
11343
|
-
[scoped, workspaceId]
|
|
11344
|
-
);
|
|
11345
|
-
}
|
|
11346
11111
|
function useClientConfigFlags(client) {
|
|
11347
|
-
const [flags, setFlags] =
|
|
11348
|
-
|
|
11112
|
+
const [flags, setFlags] = useState16({ uploads: false, modelSelection: true, sandboxFiles: false });
|
|
11113
|
+
useEffect11(() => {
|
|
11349
11114
|
let live = true;
|
|
11350
11115
|
client.getClientConfig().then(
|
|
11351
11116
|
(config) => {
|
|
@@ -11367,7 +11132,7 @@ function useClientConfigFlags(client) {
|
|
|
11367
11132
|
}
|
|
11368
11133
|
|
|
11369
11134
|
// src/hooks/use-workspace-sessions.ts
|
|
11370
|
-
import { useCallback as
|
|
11135
|
+
import { useCallback as useCallback5, useEffect as useEffect12, useRef as useRef12 } from "react";
|
|
11371
11136
|
function useWorkspaceSessions(options = {}) {
|
|
11372
11137
|
const { client, workspaceId } = useOpenGeni(options);
|
|
11373
11138
|
const limit = options.limit;
|
|
@@ -11395,10 +11160,10 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11395
11160
|
].join("\0");
|
|
11396
11161
|
const previousQueryKey = useRef12(queryKey);
|
|
11397
11162
|
const queryKeyTransition = previousQueryKey.current !== queryKey;
|
|
11398
|
-
|
|
11163
|
+
useEffect12(() => {
|
|
11399
11164
|
previousQueryKey.current = queryKey;
|
|
11400
11165
|
}, [queryKey]);
|
|
11401
|
-
const load =
|
|
11166
|
+
const load = useCallback5(
|
|
11402
11167
|
async (signal) => {
|
|
11403
11168
|
const readGeneration = beginRead?.() ?? ++nextReadGeneration.current;
|
|
11404
11169
|
const page2 = await client.listSessionPage(workspaceId, {
|
|
@@ -11464,8 +11229,8 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11464
11229
|
// src/components/session-list.tsx
|
|
11465
11230
|
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
11466
11231
|
import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
|
|
11467
|
-
import { useEffect as
|
|
11468
|
-
import { jsx as
|
|
11232
|
+
import { useEffect as useEffect13, useRef as useRef13, useState as useState17 } from "react";
|
|
11233
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11469
11234
|
var DEFAULT_LABELS = {
|
|
11470
11235
|
heading: "Chats",
|
|
11471
11236
|
newChat: "New chat",
|
|
@@ -11494,7 +11259,7 @@ function SessionList({
|
|
|
11494
11259
|
const labels = { ...DEFAULT_LABELS, ...labelOverrides };
|
|
11495
11260
|
const scope = { client, workspaceId };
|
|
11496
11261
|
const context = useOpenGeni(scope);
|
|
11497
|
-
const [limit, setLimit] =
|
|
11262
|
+
const [limit, setLimit] = useState17(pageSize);
|
|
11498
11263
|
const list = useWorkspaceSessions({
|
|
11499
11264
|
...scope,
|
|
11500
11265
|
parentSessionId: null,
|
|
@@ -11504,14 +11269,14 @@ function SessionList({
|
|
|
11504
11269
|
});
|
|
11505
11270
|
const refresh = list.refresh;
|
|
11506
11271
|
const firstRefreshKey = useRef13(refreshKey);
|
|
11507
|
-
|
|
11272
|
+
useEffect13(() => {
|
|
11508
11273
|
if (Object.is(refreshKey, firstRefreshKey.current)) return;
|
|
11509
11274
|
firstRefreshKey.current = refreshKey;
|
|
11510
11275
|
void refresh();
|
|
11511
11276
|
}, [refresh, refreshKey]);
|
|
11512
|
-
const [editing, setEditing] =
|
|
11513
|
-
const [busy, setBusy] =
|
|
11514
|
-
const [error, setError] =
|
|
11277
|
+
const [editing, setEditing] = useState17(null);
|
|
11278
|
+
const [busy, setBusy] = useState17(null);
|
|
11279
|
+
const [error, setError] = useState17(null);
|
|
11515
11280
|
const archiveClient = context.client;
|
|
11516
11281
|
const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
|
|
11517
11282
|
const run = async (id, action) => {
|
|
@@ -11545,16 +11310,16 @@ function SessionList({
|
|
|
11545
11310
|
onArchived?.(session.id);
|
|
11546
11311
|
});
|
|
11547
11312
|
const sessions = list.sessions;
|
|
11548
|
-
return /* @__PURE__ */
|
|
11313
|
+
return /* @__PURE__ */ jsxs17(
|
|
11549
11314
|
"nav",
|
|
11550
11315
|
{
|
|
11551
11316
|
className: cn("flex min-h-0 min-w-0 flex-col gap-1 text-og-fg", className),
|
|
11552
11317
|
"aria-label": labels.heading,
|
|
11553
11318
|
"data-og-session-list": "",
|
|
11554
11319
|
children: [
|
|
11555
|
-
/* @__PURE__ */
|
|
11556
|
-
/* @__PURE__ */
|
|
11557
|
-
onNewChat ? /* @__PURE__ */
|
|
11320
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
|
|
11321
|
+
/* @__PURE__ */ jsx22("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
|
|
11322
|
+
onNewChat ? /* @__PURE__ */ jsxs17(
|
|
11558
11323
|
"button",
|
|
11559
11324
|
{
|
|
11560
11325
|
type: "button",
|
|
@@ -11562,22 +11327,22 @@ function SessionList({
|
|
|
11562
11327
|
className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-og-control text-og-fg hover:bg-og-surface-2",
|
|
11563
11328
|
"data-og-new-chat": "",
|
|
11564
11329
|
children: [
|
|
11565
|
-
/* @__PURE__ */
|
|
11330
|
+
/* @__PURE__ */ jsx22(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
11566
11331
|
labels.newChat
|
|
11567
11332
|
]
|
|
11568
11333
|
}
|
|
11569
11334
|
) : null
|
|
11570
11335
|
] }),
|
|
11571
|
-
error ? /* @__PURE__ */
|
|
11572
|
-
/* @__PURE__ */
|
|
11573
|
-
list.loading && sessions.length === 0 ? /* @__PURE__ */
|
|
11574
|
-
!list.loading && sessions.length === 0 ? /* @__PURE__ */
|
|
11336
|
+
error ? /* @__PURE__ */ jsx22("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: error }) : null,
|
|
11337
|
+
/* @__PURE__ */ jsxs17("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
|
|
11338
|
+
list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx22("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
|
|
11339
|
+
!list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx22("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
|
|
11575
11340
|
sessions.map((session) => {
|
|
11576
11341
|
const selected = session.id === selectedSessionId;
|
|
11577
11342
|
const title = deriveSessionDisplayTitle(session);
|
|
11578
11343
|
if (editing?.id === session.id) {
|
|
11579
|
-
return /* @__PURE__ */
|
|
11580
|
-
/* @__PURE__ */
|
|
11344
|
+
return /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsxs17("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
|
|
11345
|
+
/* @__PURE__ */ jsx22(
|
|
11581
11346
|
"input",
|
|
11582
11347
|
{
|
|
11583
11348
|
"aria-label": labels.rename,
|
|
@@ -11591,7 +11356,7 @@ function SessionList({
|
|
|
11591
11356
|
className: "min-w-0 flex-1 rounded-md border border-og-border bg-og-bg px-2 py-1 text-og-sm text-og-fg"
|
|
11592
11357
|
}
|
|
11593
11358
|
),
|
|
11594
|
-
/* @__PURE__ */
|
|
11359
|
+
/* @__PURE__ */ jsx22(
|
|
11595
11360
|
"button",
|
|
11596
11361
|
{
|
|
11597
11362
|
type: "submit",
|
|
@@ -11601,8 +11366,8 @@ function SessionList({
|
|
|
11601
11366
|
)
|
|
11602
11367
|
] }) }, session.id);
|
|
11603
11368
|
}
|
|
11604
|
-
return /* @__PURE__ */
|
|
11605
|
-
/* @__PURE__ */
|
|
11369
|
+
return /* @__PURE__ */ jsxs17("li", { className: "group relative", children: [
|
|
11370
|
+
/* @__PURE__ */ jsxs17(
|
|
11606
11371
|
"button",
|
|
11607
11372
|
{
|
|
11608
11373
|
type: "button",
|
|
@@ -11615,36 +11380,36 @@ function SessionList({
|
|
|
11615
11380
|
),
|
|
11616
11381
|
"data-og-session-row": "",
|
|
11617
11382
|
children: [
|
|
11618
|
-
/* @__PURE__ */
|
|
11619
|
-
/* @__PURE__ */
|
|
11383
|
+
/* @__PURE__ */ jsx22("span", { className: "w-full truncate pr-12 text-og-sm text-og-fg", children: title }),
|
|
11384
|
+
/* @__PURE__ */ jsx22("span", { className: "text-og-xs text-og-fg-subtle", children: formatRelativeTime(session.updatedAt) })
|
|
11620
11385
|
]
|
|
11621
11386
|
}
|
|
11622
11387
|
),
|
|
11623
|
-
/* @__PURE__ */
|
|
11624
|
-
rename ? /* @__PURE__ */
|
|
11388
|
+
/* @__PURE__ */ jsxs17("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
|
|
11389
|
+
rename ? /* @__PURE__ */ jsx22(
|
|
11625
11390
|
"button",
|
|
11626
11391
|
{
|
|
11627
11392
|
type: "button",
|
|
11628
11393
|
"aria-label": `${labels.rename}: ${title}`,
|
|
11629
11394
|
onClick: () => setEditing({ id: session.id, title: session.title ?? title }),
|
|
11630
11395
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
11631
|
-
children: /* @__PURE__ */
|
|
11396
|
+
children: /* @__PURE__ */ jsx22(PencilIcon2, { className: "size-3.5", "aria-hidden": true })
|
|
11632
11397
|
}
|
|
11633
11398
|
) : null,
|
|
11634
|
-
canArchive ? /* @__PURE__ */
|
|
11399
|
+
canArchive ? /* @__PURE__ */ jsx22(
|
|
11635
11400
|
"button",
|
|
11636
11401
|
{
|
|
11637
11402
|
type: "button",
|
|
11638
11403
|
"aria-label": `${labels.archive}: ${title}`,
|
|
11639
11404
|
onClick: () => archiveSession(session),
|
|
11640
11405
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
11641
|
-
children: /* @__PURE__ */
|
|
11406
|
+
children: /* @__PURE__ */ jsx22(ArchiveIcon, { className: "size-3.5", "aria-hidden": true })
|
|
11642
11407
|
}
|
|
11643
11408
|
) : null
|
|
11644
11409
|
] })
|
|
11645
11410
|
] }, session.id);
|
|
11646
11411
|
}),
|
|
11647
|
-
list.nextCursor ? /* @__PURE__ */
|
|
11412
|
+
list.nextCursor ? /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsx22(
|
|
11648
11413
|
"button",
|
|
11649
11414
|
{
|
|
11650
11415
|
type: "button",
|
|
@@ -11661,8 +11426,8 @@ function SessionList({
|
|
|
11661
11426
|
|
|
11662
11427
|
// src/components/open-geni-chat.tsx
|
|
11663
11428
|
import { MenuIcon, SendIcon, XIcon as XIcon3 } from "lucide-react";
|
|
11664
|
-
import { useCallback as
|
|
11665
|
-
import { jsx as
|
|
11429
|
+
import { useCallback as useCallback6, useRef as useRef14, useState as useState18 } from "react";
|
|
11430
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11666
11431
|
var DEFAULT_LABELS2 = {
|
|
11667
11432
|
openChats: "Open chats",
|
|
11668
11433
|
closeChats: "Close chats",
|
|
@@ -11687,11 +11452,11 @@ function OpenGeniChat({
|
|
|
11687
11452
|
const labels = { ...DEFAULT_LABELS2, ...labelOverrides };
|
|
11688
11453
|
const scope = { client, workspaceId };
|
|
11689
11454
|
const context = useOpenGeni(scope);
|
|
11690
|
-
const [uncontrolled, setUncontrolled] =
|
|
11455
|
+
const [uncontrolled, setUncontrolled] = useState18(defaultSessionId);
|
|
11691
11456
|
const selected = controlledSessionId !== void 0 ? controlledSessionId : uncontrolled;
|
|
11692
|
-
const [drawerOpen, setDrawerOpen] =
|
|
11693
|
-
const [listRevision, setListRevision] =
|
|
11694
|
-
const select =
|
|
11457
|
+
const [drawerOpen, setDrawerOpen] = useState18(false);
|
|
11458
|
+
const [listRevision, setListRevision] = useState18(0);
|
|
11459
|
+
const select = useCallback6(
|
|
11695
11460
|
(next) => {
|
|
11696
11461
|
if (controlledSessionId === void 0) setUncontrolled(next);
|
|
11697
11462
|
onSessionChange?.(next);
|
|
@@ -11699,7 +11464,7 @@ function OpenGeniChat({
|
|
|
11699
11464
|
},
|
|
11700
11465
|
[controlledSessionId, onSessionChange]
|
|
11701
11466
|
);
|
|
11702
|
-
const create =
|
|
11467
|
+
const create = useCallback6(
|
|
11703
11468
|
async (initialMessage, idempotencyKey) => {
|
|
11704
11469
|
if (createSession) return await createSession(initialMessage, idempotencyKey);
|
|
11705
11470
|
const creator = context.client.createSession;
|
|
@@ -11712,7 +11477,7 @@ function OpenGeniChat({
|
|
|
11712
11477
|
},
|
|
11713
11478
|
[context.client, context.workspaceId, createSession, labels.newChatUnavailable]
|
|
11714
11479
|
);
|
|
11715
|
-
const list = /* @__PURE__ */
|
|
11480
|
+
const list = /* @__PURE__ */ jsx23(
|
|
11716
11481
|
SessionList,
|
|
11717
11482
|
{
|
|
11718
11483
|
...scope,
|
|
@@ -11728,14 +11493,14 @@ function OpenGeniChat({
|
|
|
11728
11493
|
className: "h-full"
|
|
11729
11494
|
}
|
|
11730
11495
|
);
|
|
11731
|
-
return /* @__PURE__ */
|
|
11496
|
+
return /* @__PURE__ */ jsxs18(
|
|
11732
11497
|
"div",
|
|
11733
11498
|
{
|
|
11734
11499
|
className: cn("og-root og-chat relative flex min-h-0 min-w-0 bg-og-bg text-og-fg", className),
|
|
11735
11500
|
style: { height },
|
|
11736
11501
|
"data-og-chat": "",
|
|
11737
11502
|
children: [
|
|
11738
|
-
/* @__PURE__ */
|
|
11503
|
+
/* @__PURE__ */ jsx23(
|
|
11739
11504
|
"aside",
|
|
11740
11505
|
{
|
|
11741
11506
|
className: "og-chat-sidebar min-h-0 w-64 shrink-0 flex-col border-r border-og-border",
|
|
@@ -11743,21 +11508,21 @@ function OpenGeniChat({
|
|
|
11743
11508
|
children: list
|
|
11744
11509
|
}
|
|
11745
11510
|
),
|
|
11746
|
-
drawerOpen ? /* @__PURE__ */
|
|
11747
|
-
/* @__PURE__ */
|
|
11748
|
-
/* @__PURE__ */
|
|
11511
|
+
drawerOpen ? /* @__PURE__ */ jsxs18("div", { className: "og-chat-drawer absolute inset-0 z-20 flex", "data-og-chat-drawer": "", children: [
|
|
11512
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-xl", children: [
|
|
11513
|
+
/* @__PURE__ */ jsx23("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx23(
|
|
11749
11514
|
"button",
|
|
11750
11515
|
{
|
|
11751
11516
|
type: "button",
|
|
11752
11517
|
"aria-label": labels.closeChats,
|
|
11753
11518
|
onClick: () => setDrawerOpen(false),
|
|
11754
11519
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
11755
|
-
children: /* @__PURE__ */
|
|
11520
|
+
children: /* @__PURE__ */ jsx23(XIcon3, { className: "size-4", "aria-hidden": true })
|
|
11756
11521
|
}
|
|
11757
11522
|
) }),
|
|
11758
|
-
/* @__PURE__ */
|
|
11523
|
+
/* @__PURE__ */ jsx23("div", { className: "min-h-0 flex-1", children: list })
|
|
11759
11524
|
] }),
|
|
11760
|
-
/* @__PURE__ */
|
|
11525
|
+
/* @__PURE__ */ jsx23(
|
|
11761
11526
|
"button",
|
|
11762
11527
|
{
|
|
11763
11528
|
type: "button",
|
|
@@ -11767,9 +11532,9 @@ function OpenGeniChat({
|
|
|
11767
11532
|
}
|
|
11768
11533
|
)
|
|
11769
11534
|
] }) : null,
|
|
11770
|
-
/* @__PURE__ */
|
|
11771
|
-
/* @__PURE__ */
|
|
11772
|
-
/* @__PURE__ */
|
|
11535
|
+
/* @__PURE__ */ jsxs18("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
11536
|
+
/* @__PURE__ */ jsxs18("div", { className: "og-chat-menu flex items-center gap-2 border-b border-og-border px-2 py-1", children: [
|
|
11537
|
+
/* @__PURE__ */ jsx23(
|
|
11773
11538
|
"button",
|
|
11774
11539
|
{
|
|
11775
11540
|
type: "button",
|
|
@@ -11778,12 +11543,12 @@ function OpenGeniChat({
|
|
|
11778
11543
|
onClick: () => setDrawerOpen(true),
|
|
11779
11544
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
11780
11545
|
"data-og-chat-menu": "",
|
|
11781
|
-
children: /* @__PURE__ */
|
|
11546
|
+
children: /* @__PURE__ */ jsx23(MenuIcon, { className: "size-4", "aria-hidden": true })
|
|
11782
11547
|
}
|
|
11783
11548
|
),
|
|
11784
|
-
/* @__PURE__ */
|
|
11549
|
+
/* @__PURE__ */ jsx23("span", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading })
|
|
11785
11550
|
] }),
|
|
11786
|
-
/* @__PURE__ */
|
|
11551
|
+
/* @__PURE__ */ jsx23("div", { className: "min-h-0 flex-1 px-3 pb-3 pt-1", children: selected ? /* @__PURE__ */ jsx23(
|
|
11787
11552
|
SessionConversation,
|
|
11788
11553
|
{
|
|
11789
11554
|
...conversationProps,
|
|
@@ -11791,7 +11556,7 @@ function OpenGeniChat({
|
|
|
11791
11556
|
sessionId: selected,
|
|
11792
11557
|
height: "100%"
|
|
11793
11558
|
}
|
|
11794
|
-
) : /* @__PURE__ */
|
|
11559
|
+
) : /* @__PURE__ */ jsx23(
|
|
11795
11560
|
NewChat,
|
|
11796
11561
|
{
|
|
11797
11562
|
labels,
|
|
@@ -11812,9 +11577,9 @@ function NewChat({
|
|
|
11812
11577
|
create,
|
|
11813
11578
|
onCreated
|
|
11814
11579
|
}) {
|
|
11815
|
-
const [text, setText] =
|
|
11816
|
-
const [sending, setSending] =
|
|
11817
|
-
const [error, setError] =
|
|
11580
|
+
const [text, setText] = useState18("");
|
|
11581
|
+
const [sending, setSending] = useState18(false);
|
|
11582
|
+
const [error, setError] = useState18(null);
|
|
11818
11583
|
const idempotencyKey = useRef14(crypto.randomUUID());
|
|
11819
11584
|
const submit = async (event) => {
|
|
11820
11585
|
event.preventDefault();
|
|
@@ -11833,16 +11598,16 @@ function NewChat({
|
|
|
11833
11598
|
setSending(false);
|
|
11834
11599
|
}
|
|
11835
11600
|
};
|
|
11836
|
-
return /* @__PURE__ */
|
|
11601
|
+
return /* @__PURE__ */ jsxs18(
|
|
11837
11602
|
"form",
|
|
11838
11603
|
{
|
|
11839
11604
|
onSubmit: (event) => void submit(event),
|
|
11840
11605
|
className: "flex h-full flex-col justify-end gap-2 p-3",
|
|
11841
11606
|
"data-og-new-chat-composer": "",
|
|
11842
11607
|
children: [
|
|
11843
|
-
error ? /* @__PURE__ */
|
|
11844
|
-
/* @__PURE__ */
|
|
11845
|
-
/* @__PURE__ */
|
|
11608
|
+
error ? /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null,
|
|
11609
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-end gap-2 rounded-lg border border-og-border bg-og-surface-1 p-2", children: [
|
|
11610
|
+
/* @__PURE__ */ jsx23(
|
|
11846
11611
|
"textarea",
|
|
11847
11612
|
{
|
|
11848
11613
|
value: text,
|
|
@@ -11860,14 +11625,14 @@ function NewChat({
|
|
|
11860
11625
|
className: "min-h-10 flex-1 resize-none bg-transparent text-og-base text-og-fg outline-hidden placeholder:text-og-fg-subtle"
|
|
11861
11626
|
}
|
|
11862
11627
|
),
|
|
11863
|
-
/* @__PURE__ */
|
|
11628
|
+
/* @__PURE__ */ jsx23(
|
|
11864
11629
|
"button",
|
|
11865
11630
|
{
|
|
11866
11631
|
type: "submit",
|
|
11867
11632
|
"aria-label": labels.send,
|
|
11868
11633
|
disabled: sending || !text.trim(),
|
|
11869
11634
|
className: "rounded-md bg-og-accent p-2 text-og-accent-fg disabled:opacity-50",
|
|
11870
|
-
children: /* @__PURE__ */
|
|
11635
|
+
children: /* @__PURE__ */ jsx23(SendIcon, { className: "size-4", "aria-hidden": true })
|
|
11871
11636
|
}
|
|
11872
11637
|
)
|
|
11873
11638
|
] })
|
|
@@ -11878,14 +11643,14 @@ function NewChat({
|
|
|
11878
11643
|
|
|
11879
11644
|
// src/components/session-commands-panel.tsx
|
|
11880
11645
|
import { ChevronRightIcon as ChevronRightIcon3, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
|
|
11881
|
-
import { useState as
|
|
11882
|
-
import { jsx as
|
|
11646
|
+
import { useState as useState19 } from "react";
|
|
11647
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11883
11648
|
function SessionCommandsPanel({
|
|
11884
11649
|
commands: state,
|
|
11885
11650
|
readOnly = false
|
|
11886
11651
|
}) {
|
|
11887
|
-
const [pending, setPending] =
|
|
11888
|
-
const [error, setError] =
|
|
11652
|
+
const [pending, setPending] = useState19(null);
|
|
11653
|
+
const [error, setError] = useState19(null);
|
|
11889
11654
|
const active = state.commands.filter(
|
|
11890
11655
|
(command) => command.state === "running" || command.state === "stopping"
|
|
11891
11656
|
);
|
|
@@ -11900,11 +11665,11 @@ function SessionCommandsPanel({
|
|
|
11900
11665
|
setPending(null);
|
|
11901
11666
|
}
|
|
11902
11667
|
};
|
|
11903
|
-
return /* @__PURE__ */
|
|
11904
|
-
state.loading && active.length === 0 ? /* @__PURE__ */
|
|
11905
|
-
state.error ? /* @__PURE__ */
|
|
11906
|
-
/* @__PURE__ */
|
|
11907
|
-
/* @__PURE__ */
|
|
11668
|
+
return /* @__PURE__ */ jsxs19("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
|
|
11669
|
+
state.loading && active.length === 0 ? /* @__PURE__ */ jsx24("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
|
|
11670
|
+
state.error ? /* @__PURE__ */ jsxs19("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
|
|
11671
|
+
/* @__PURE__ */ jsx24("span", { children: "Commands unavailable." }),
|
|
11672
|
+
/* @__PURE__ */ jsx24(
|
|
11908
11673
|
"button",
|
|
11909
11674
|
{
|
|
11910
11675
|
type: "button",
|
|
@@ -11914,18 +11679,18 @@ function SessionCommandsPanel({
|
|
|
11914
11679
|
}
|
|
11915
11680
|
)
|
|
11916
11681
|
] }) : null,
|
|
11917
|
-
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */
|
|
11918
|
-
active.length > 0 ? /* @__PURE__ */
|
|
11919
|
-
/* @__PURE__ */
|
|
11920
|
-
/* @__PURE__ */
|
|
11921
|
-
/* @__PURE__ */
|
|
11682
|
+
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx24("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
|
|
11683
|
+
active.length > 0 ? /* @__PURE__ */ jsx24("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs19("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
|
|
11684
|
+
/* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
|
|
11685
|
+
/* @__PURE__ */ jsxs19("details", { className: "group/command", children: [
|
|
11686
|
+
/* @__PURE__ */ jsxs19(
|
|
11922
11687
|
"summary",
|
|
11923
11688
|
{
|
|
11924
11689
|
className: "flex cursor-pointer list-none items-center gap-1.5 rounded-og-sm font-mono text-og-fg outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
11925
11690
|
title: "Expand command",
|
|
11926
11691
|
children: [
|
|
11927
|
-
/* @__PURE__ */
|
|
11928
|
-
/* @__PURE__ */
|
|
11692
|
+
/* @__PURE__ */ jsx24(ChevronRightIcon3, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
|
|
11693
|
+
/* @__PURE__ */ jsx24(
|
|
11929
11694
|
"span",
|
|
11930
11695
|
{
|
|
11931
11696
|
className: "min-w-0 truncate",
|
|
@@ -11936,9 +11701,9 @@ function SessionCommandsPanel({
|
|
|
11936
11701
|
]
|
|
11937
11702
|
}
|
|
11938
11703
|
),
|
|
11939
|
-
/* @__PURE__ */
|
|
11940
|
-
/* @__PURE__ */
|
|
11941
|
-
/* @__PURE__ */
|
|
11704
|
+
/* @__PURE__ */ jsxs19("div", { className: "mt-2 space-y-1", children: [
|
|
11705
|
+
/* @__PURE__ */ jsx24("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
|
|
11706
|
+
/* @__PURE__ */ jsxs19(
|
|
11942
11707
|
"time",
|
|
11943
11708
|
{
|
|
11944
11709
|
className: "block text-og-fg-subtle",
|
|
@@ -11952,9 +11717,9 @@ function SessionCommandsPanel({
|
|
|
11952
11717
|
)
|
|
11953
11718
|
] })
|
|
11954
11719
|
] }),
|
|
11955
|
-
/* @__PURE__ */
|
|
11720
|
+
/* @__PURE__ */ jsx24("p", { className: "mt-1 text-og-fg-subtle", children: command.observationStatus === "unavailable" ? command.state === "stopping" ? "Stop requested \xB7 status unavailable" : "Command status unavailable" : command.state === "stopping" ? "Stopping\u2026" : "Running" })
|
|
11956
11721
|
] }),
|
|
11957
|
-
!readOnly ? /* @__PURE__ */
|
|
11722
|
+
!readOnly ? /* @__PURE__ */ jsxs19(
|
|
11958
11723
|
"button",
|
|
11959
11724
|
{
|
|
11960
11725
|
type: "button",
|
|
@@ -11963,22 +11728,22 @@ function SessionCommandsPanel({
|
|
|
11963
11728
|
onClick: () => void stop(command.id),
|
|
11964
11729
|
className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm px-2 text-og-fg-muted outline-hidden hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50 pointer-coarse:min-h-11",
|
|
11965
11730
|
children: [
|
|
11966
|
-
pending === command.id || command.state === "stopping" ? /* @__PURE__ */
|
|
11731
|
+
pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx24(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx24(SquareIcon, { className: "size-3" }),
|
|
11967
11732
|
"Stop"
|
|
11968
11733
|
]
|
|
11969
11734
|
}
|
|
11970
11735
|
) : null
|
|
11971
11736
|
] }, command.id)) }) : null,
|
|
11972
|
-
error ? /* @__PURE__ */
|
|
11737
|
+
error ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-og-danger", children: error }) : null
|
|
11973
11738
|
] });
|
|
11974
11739
|
}
|
|
11975
11740
|
|
|
11976
11741
|
// src/hooks/use-session-background-commands.ts
|
|
11977
|
-
import { useCallback as
|
|
11742
|
+
import { useCallback as useCallback7, useEffect as useEffect14, useRef as useRef15 } from "react";
|
|
11978
11743
|
function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
11979
11744
|
const { client, workspaceId } = useOpenGeni(options);
|
|
11980
11745
|
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
11981
|
-
const load =
|
|
11746
|
+
const load = useCallback7(
|
|
11982
11747
|
async (signal) => {
|
|
11983
11748
|
if (!sessionId) return { commands: [] };
|
|
11984
11749
|
if (!client.listSessionBackgroundCommands) {
|
|
@@ -11994,13 +11759,13 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
11994
11759
|
});
|
|
11995
11760
|
const refresh = state.refresh;
|
|
11996
11761
|
const generation = useRef15(0);
|
|
11997
|
-
|
|
11762
|
+
useEffect14(() => {
|
|
11998
11763
|
generation.current += 1;
|
|
11999
11764
|
return () => {
|
|
12000
11765
|
generation.current += 1;
|
|
12001
11766
|
};
|
|
12002
11767
|
}, [client, workspaceId, sessionId, enabled]);
|
|
12003
|
-
const cancel =
|
|
11768
|
+
const cancel = useCallback7(
|
|
12004
11769
|
async (commandId) => {
|
|
12005
11770
|
if (!sessionId) return;
|
|
12006
11771
|
if (!client.cancelSessionBackgroundCommand) {
|
|
@@ -12022,7 +11787,7 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
12022
11787
|
}
|
|
12023
11788
|
|
|
12024
11789
|
// src/components/session-commands.tsx
|
|
12025
|
-
import { jsx as
|
|
11790
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
12026
11791
|
function SessionCommands({
|
|
12027
11792
|
sessionId,
|
|
12028
11793
|
readOnly = false,
|
|
@@ -12032,11 +11797,11 @@ function SessionCommands({
|
|
|
12032
11797
|
pollIntervalMs: 3e3,
|
|
12033
11798
|
...options
|
|
12034
11799
|
});
|
|
12035
|
-
return /* @__PURE__ */
|
|
11800
|
+
return /* @__PURE__ */ jsx25(SessionCommandsPanel, { commands, readOnly });
|
|
12036
11801
|
}
|
|
12037
11802
|
|
|
12038
11803
|
// src/timeline/startup-timings.tsx
|
|
12039
|
-
import { jsx as
|
|
11804
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12040
11805
|
var LABELS = {
|
|
12041
11806
|
queue: "Worker queue",
|
|
12042
11807
|
sandbox: "Sandbox",
|
|
@@ -12049,7 +11814,7 @@ var LABELS = {
|
|
|
12049
11814
|
};
|
|
12050
11815
|
function StartupTimings({ phases }) {
|
|
12051
11816
|
if (!phases.length)
|
|
12052
|
-
return /* @__PURE__ */
|
|
11817
|
+
return /* @__PURE__ */ jsx26("p", { className: "text-og-sm text-og-fg-subtle", children: "No startup timings recorded yet." });
|
|
12053
11818
|
const byTurn = /* @__PURE__ */ new Map();
|
|
12054
11819
|
for (const phase of phases) {
|
|
12055
11820
|
const group = byTurn.get(phase.turnId) ?? [];
|
|
@@ -12064,9 +11829,9 @@ function StartupTimings({ phases }) {
|
|
|
12064
11829
|
turnPhases[0].startedAt
|
|
12065
11830
|
)
|
|
12066
11831
|
})).sort((a, b) => b.startedAt.localeCompare(a.startedAt));
|
|
12067
|
-
return /* @__PURE__ */
|
|
12068
|
-
/* @__PURE__ */
|
|
12069
|
-
turns.map((turn, index) => /* @__PURE__ */
|
|
11832
|
+
return /* @__PURE__ */ jsxs20("div", { className: "space-y-3", children: [
|
|
11833
|
+
/* @__PURE__ */ jsx26("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
|
|
11834
|
+
turns.map((turn, index) => /* @__PURE__ */ jsx26(
|
|
12070
11835
|
StartupTurn,
|
|
12071
11836
|
{
|
|
12072
11837
|
...turn,
|
|
@@ -12083,53 +11848,53 @@ function StartupTurn({
|
|
|
12083
11848
|
latest
|
|
12084
11849
|
}) {
|
|
12085
11850
|
const status = phases.some((phase) => phase.status === "failed") ? "Failed" : phases.some((phase) => phase.status === "running") ? "In progress" : phases.some((phase) => phase.status === "cancelled") ? "Interrupted" : "Ready";
|
|
12086
|
-
return /* @__PURE__ */
|
|
12087
|
-
/* @__PURE__ */
|
|
12088
|
-
/* @__PURE__ */
|
|
12089
|
-
/* @__PURE__ */
|
|
11851
|
+
return /* @__PURE__ */ jsxs20("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
|
|
11852
|
+
/* @__PURE__ */ jsxs20("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
|
|
11853
|
+
/* @__PURE__ */ jsx26("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
|
|
11854
|
+
/* @__PURE__ */ jsx26("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
|
|
12090
11855
|
hour: "2-digit",
|
|
12091
11856
|
minute: "2-digit",
|
|
12092
11857
|
second: "2-digit"
|
|
12093
11858
|
}) }),
|
|
12094
|
-
/* @__PURE__ */
|
|
11859
|
+
/* @__PURE__ */ jsx26(
|
|
12095
11860
|
"span",
|
|
12096
11861
|
{
|
|
12097
11862
|
className: status === "Failed" ? "ml-2 text-og-xs text-og-status-failed" : "ml-2 text-og-xs text-og-fg-subtle",
|
|
12098
11863
|
children: status
|
|
12099
11864
|
}
|
|
12100
11865
|
),
|
|
12101
|
-
/* @__PURE__ */
|
|
11866
|
+
/* @__PURE__ */ jsx26("span", { className: "mt-1 block break-all pl-4 font-og-mono text-og-xs text-og-fg-subtle", children: turnId ?? "No turn ID recorded" })
|
|
12102
11867
|
] }),
|
|
12103
|
-
/* @__PURE__ */
|
|
12104
|
-
/* @__PURE__ */
|
|
11868
|
+
/* @__PURE__ */ jsxs20("div", { className: "pb-2", children: [
|
|
11869
|
+
/* @__PURE__ */ jsxs20("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
12105
11870
|
"Started ",
|
|
12106
|
-
/* @__PURE__ */
|
|
11871
|
+
/* @__PURE__ */ jsx26("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
|
|
12107
11872
|
] }),
|
|
12108
|
-
/* @__PURE__ */
|
|
12109
|
-
/* @__PURE__ */
|
|
11873
|
+
/* @__PURE__ */ jsx26("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs20("table", { className: "w-full text-left text-og-xs", children: [
|
|
11874
|
+
/* @__PURE__ */ jsxs20("caption", { className: "sr-only", children: [
|
|
12110
11875
|
"Startup phases for ",
|
|
12111
11876
|
turnId ?? "unassigned events"
|
|
12112
11877
|
] }),
|
|
12113
|
-
/* @__PURE__ */
|
|
12114
|
-
/* @__PURE__ */
|
|
12115
|
-
/* @__PURE__ */
|
|
12116
|
-
/* @__PURE__ */
|
|
11878
|
+
/* @__PURE__ */ jsx26("thead", { children: /* @__PURE__ */ jsxs20("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
|
|
11879
|
+
/* @__PURE__ */ jsx26("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
|
|
11880
|
+
/* @__PURE__ */ jsx26("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
|
|
11881
|
+
/* @__PURE__ */ jsx26("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
|
|
12117
11882
|
] }) }),
|
|
12118
|
-
/* @__PURE__ */
|
|
11883
|
+
/* @__PURE__ */ jsx26("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs20(
|
|
12119
11884
|
"tr",
|
|
12120
11885
|
{
|
|
12121
11886
|
className: "border-b border-og-border/40",
|
|
12122
11887
|
title: `Turn: ${phase.turnId ?? "unknown"} \xB7 Started: ${phase.startedAt}`,
|
|
12123
11888
|
children: [
|
|
12124
|
-
/* @__PURE__ */
|
|
12125
|
-
/* @__PURE__ */
|
|
11889
|
+
/* @__PURE__ */ jsx26("th", { scope: "row", className: "py-2.5 font-normal text-og-fg-muted", children: LABELS[phase.phase] }),
|
|
11890
|
+
/* @__PURE__ */ jsx26(
|
|
12126
11891
|
"td",
|
|
12127
11892
|
{
|
|
12128
11893
|
className: `px-3 py-2.5 ${phase.status === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"}`,
|
|
12129
11894
|
children: phase.status === "running" ? "In progress" : phase.status
|
|
12130
11895
|
}
|
|
12131
11896
|
),
|
|
12132
|
-
/* @__PURE__ */
|
|
11897
|
+
/* @__PURE__ */ jsx26("td", { className: "py-2.5 text-right font-og-mono tabular-nums text-og-fg-muted", children: phase.durationMs === null ? "\u2014" : phase.durationMs < 1e3 ? `${Math.round(phase.durationMs)} ms` : `${(phase.durationMs / 1e3).toFixed(1)} s` })
|
|
12133
11898
|
]
|
|
12134
11899
|
},
|
|
12135
11900
|
phase.id
|
|
@@ -12198,4 +11963,4 @@ export {
|
|
|
12198
11963
|
SessionCommands,
|
|
12199
11964
|
StartupTimings
|
|
12200
11965
|
};
|
|
12201
|
-
//# sourceMappingURL=chunk-
|
|
11966
|
+
//# sourceMappingURL=chunk-L4OSXQ6H.js.map
|