@opengeni/react 7.4.0-canary.36844267522001 → 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 +0 -10
- 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-AJO7LMVE.js → browser-viewer-2E6R2Y4W.js} +2 -2
- 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-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-XVYRQ4PK.js → chunk-L4OSXQ6H.js} +116 -277
- package/dist/chunk-L4OSXQ6H.js.map +1 -0
- package/dist/{chunk-7B44WVGH.js → chunk-S5JQ4R22.js} +12 -31
- package/dist/chunk-S5JQ4R22.js.map +1 -0
- package/dist/{chunk-A4UJB2MM.js → chunk-SEEVCT36.js} +2 -2
- package/dist/chunk-UGMKPUEM.js +299 -0
- package/dist/chunk-UGMKPUEM.js.map +1 -0
- package/dist/{chunk-OQVBTOBJ.js → chunk-USXVQACU.js} +3 -3
- package/dist/{chunk-ASCSKOWU.js → chunk-V2ABIVYJ.js} +3 -50
- package/dist/chunk-V2ABIVYJ.js.map +1 -0
- package/dist/{chunk-UQUR5WG5.js → chunk-X4HIN6TV.js} +157 -66
- package/dist/chunk-X4HIN6TV.js.map +1 -0
- package/dist/{chunk-QLG6W33X.js → chunk-XEJEOAOV.js} +35 -46
- package/dist/chunk-XEJEOAOV.js.map +1 -0
- package/dist/components/artifacts/editable-artifact-ui.d.ts +1 -2
- package/dist/components/artifacts/index.d.ts +0 -7
- package/dist/components/message-timeline.d.ts +1 -7
- package/dist/components/open-geni-links.d.ts +0 -16
- package/dist/components/session-conversation.d.ts +1 -13
- package/dist/{computer-viewer-NB6O6BTV.js → computer-viewer-WMJE6OA3.js} +2 -2
- package/dist/connect.js +1 -2
- package/dist/connect.js.map +1 -1
- package/dist/hooks/latest-question.d.ts +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +12 -22
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/{latest-question-3HGQUI2E.js → latest-question-QB4EUCW5.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/session-ui.d.ts +2 -3
- package/dist/session-ui.js +9 -18
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +2 -2
- package/dist/sites.js +289 -4
- package/dist/sites.js.map +1 -1
- package/package.json +3 -3
- 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-viewer.tsx +20 -59
- 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 +7 -59
- package/src/components/open-geni-links.tsx +0 -24
- package/src/components/session-conversation.tsx +20 -120
- package/src/index.ts +0 -7
- package/src/session-ui.ts +0 -7
- package/src/timeline/projection.ts +4 -54
- package/styles/compiled.css +0 -220
- 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-7B44WVGH.js.map +0 -1
- package/dist/chunk-ASCSKOWU.js.map +0 -1
- package/dist/chunk-QLG6W33X.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-UQUR5WG5.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/chunk-XVYRQ4PK.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/computer-viewer-NB6O6BTV.js.map +0 -1
- package/dist/markdown-table-layout-QXSLK4BY.js.map +0 -1
- package/dist/timeline-pill-geometry-2G6EK47V.js +0 -73
- package/dist/timeline-pill-geometry-2G6EK47V.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/dist/{browser-viewer-AJO7LMVE.js.map → browser-viewer-2E6R2Y4W.js.map} +0 -0
- /package/dist/{chunk-A4UJB2MM.js.map → chunk-SEEVCT36.js.map} +0 -0
- /package/dist/{chunk-OQVBTOBJ.js.map → chunk-USXVQACU.js.map} +0 -0
- /package/dist/{chat-interactive-block-VAGABN7J.js.map → computer-viewer-WMJE6OA3.js.map} +0 -0
- /package/dist/{latest-question-3HGQUI2E.js.map → latest-question-QB4EUCW5.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
|
|
@@ -92,27 +92,24 @@ import {
|
|
|
92
92
|
Markdown,
|
|
93
93
|
MediaEmpty,
|
|
94
94
|
MediaSkeleton,
|
|
95
|
+
OpenGeniLinkProvider,
|
|
95
96
|
PayloadBlock,
|
|
96
97
|
ScreenshotFigure,
|
|
97
98
|
TermBlock,
|
|
98
99
|
Thumbnail,
|
|
99
100
|
TimelineSearchRevealContext,
|
|
100
101
|
ToolCallTruncationProvider,
|
|
102
|
+
chainLinkResolvers,
|
|
101
103
|
isTimelineSearchTarget,
|
|
104
|
+
sessionLinkResolver,
|
|
102
105
|
useForcedDefaultOpen,
|
|
106
|
+
useOpenGeniLinkResolver,
|
|
103
107
|
useTimelineSearchNavigation,
|
|
104
108
|
useTimelineSearchReveal
|
|
105
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-X4HIN6TV.js";
|
|
106
110
|
import {
|
|
107
111
|
prefersReducedMotion
|
|
108
112
|
} from "./chunk-GIMRELBW.js";
|
|
109
|
-
import {
|
|
110
|
-
OpenGeniLinkProvider,
|
|
111
|
-
chainLinkResolvers,
|
|
112
|
-
sessionLinkResolver,
|
|
113
|
-
useOpenGeniLinkResolver,
|
|
114
|
-
viewerLinkResolver
|
|
115
|
-
} from "./chunk-XCHWDJ22.js";
|
|
116
113
|
import {
|
|
117
114
|
LightboxProvider,
|
|
118
115
|
Tooltip,
|
|
@@ -5567,11 +5564,11 @@ import {
|
|
|
5567
5564
|
lazy as lazy3,
|
|
5568
5565
|
memo,
|
|
5569
5566
|
useCallback as useCallback3,
|
|
5570
|
-
useEffect as
|
|
5567
|
+
useEffect as useEffect9,
|
|
5571
5568
|
useLayoutEffect as useLayoutEffect4,
|
|
5572
5569
|
useMemo as useMemo4,
|
|
5573
5570
|
useRef as useRef9,
|
|
5574
|
-
useState as
|
|
5571
|
+
useState as useState14
|
|
5575
5572
|
} from "react";
|
|
5576
5573
|
|
|
5577
5574
|
// src/components/timeline-anchor.tsx
|
|
@@ -5713,63 +5710,6 @@ function useReadingProgress(projected, pinned, scroller) {
|
|
|
5713
5710
|
return { groups, release };
|
|
5714
5711
|
}
|
|
5715
5712
|
|
|
5716
|
-
// src/components/timeline-pill-placement.ts
|
|
5717
|
-
import { useEffect as useEffect9, useState as useState14 } from "react";
|
|
5718
|
-
var RECHECK_MS = 1e3;
|
|
5719
|
-
function useTimelinePillPlacement({
|
|
5720
|
-
pillRef,
|
|
5721
|
-
scrollerRef,
|
|
5722
|
-
active,
|
|
5723
|
-
preference
|
|
5724
|
-
}) {
|
|
5725
|
-
const [placement, setPlacement] = useState14(preference[0]);
|
|
5726
|
-
const key = preference.join(",");
|
|
5727
|
-
useEffect9(() => {
|
|
5728
|
-
if (!active) {
|
|
5729
|
-
setPlacement(preference[0]);
|
|
5730
|
-
return;
|
|
5731
|
-
}
|
|
5732
|
-
const scroller = scrollerRef.current;
|
|
5733
|
-
if (!scroller) return;
|
|
5734
|
-
let frame = 0;
|
|
5735
|
-
let current = preference[0];
|
|
5736
|
-
let choose = null;
|
|
5737
|
-
let disposed = false;
|
|
5738
|
-
void import("./timeline-pill-geometry-2G6EK47V.js").then((geometry) => {
|
|
5739
|
-
if (disposed) return;
|
|
5740
|
-
choose = geometry.choosePlacement;
|
|
5741
|
-
schedule();
|
|
5742
|
-
});
|
|
5743
|
-
const evaluate = () => {
|
|
5744
|
-
frame = 0;
|
|
5745
|
-
const pill = pillRef.current;
|
|
5746
|
-
const frameElement = pill?.offsetParent;
|
|
5747
|
-
if (!choose || !pill || !(frameElement instanceof HTMLElement)) return;
|
|
5748
|
-
const next = choose(pill, frameElement, scroller, preference, current);
|
|
5749
|
-
if (next !== current) {
|
|
5750
|
-
current = next;
|
|
5751
|
-
setPlacement(next);
|
|
5752
|
-
}
|
|
5753
|
-
};
|
|
5754
|
-
const schedule = () => {
|
|
5755
|
-
if (frame === 0) frame = requestAnimationFrame(evaluate);
|
|
5756
|
-
};
|
|
5757
|
-
schedule();
|
|
5758
|
-
const view = scroller.ownerDocument.defaultView;
|
|
5759
|
-
scroller.addEventListener("scroll", schedule, { passive: true });
|
|
5760
|
-
view?.addEventListener("resize", schedule);
|
|
5761
|
-
const timer = setInterval(schedule, RECHECK_MS);
|
|
5762
|
-
return () => {
|
|
5763
|
-
disposed = true;
|
|
5764
|
-
if (frame !== 0) cancelAnimationFrame(frame);
|
|
5765
|
-
scroller.removeEventListener("scroll", schedule);
|
|
5766
|
-
view?.removeEventListener("resize", schedule);
|
|
5767
|
-
clearInterval(timer);
|
|
5768
|
-
};
|
|
5769
|
-
}, [active, key, pillRef, scrollerRef]);
|
|
5770
|
-
return active ? placement : preference[0];
|
|
5771
|
-
}
|
|
5772
|
-
|
|
5773
5713
|
// src/components/timeline-settlement.ts
|
|
5774
5714
|
function captureTimelineSettlement(scroller, groups) {
|
|
5775
5715
|
if (timelineHasReader(scroller)) return null;
|
|
@@ -6192,18 +6132,6 @@ var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-marker
|
|
|
6192
6132
|
var PIN_THRESHOLD_PX = 48;
|
|
6193
6133
|
var JUMP_TO_LATEST_CATCHUP_DEBT_PX = 240;
|
|
6194
6134
|
var QUESTION_NAV_MARGIN_PX = 12;
|
|
6195
|
-
var JUMP_PILL_PLACEMENTS = ["center", "end", "start"];
|
|
6196
|
-
var QUESTION_PILL_PLACEMENTS = ["end", "center", "start"];
|
|
6197
|
-
var JUMP_PILL_PLACEMENT_CLASS = {
|
|
6198
|
-
center: "inset-x-0 mx-auto",
|
|
6199
|
-
end: "right-4 sm:right-6",
|
|
6200
|
-
start: "left-4 sm:left-6"
|
|
6201
|
-
};
|
|
6202
|
-
var QUESTION_PILL_PLACEMENT_CLASS = {
|
|
6203
|
-
center: "justify-center",
|
|
6204
|
-
end: "justify-end",
|
|
6205
|
-
start: "justify-start"
|
|
6206
|
-
};
|
|
6207
6135
|
var OLDER_PREFETCH_MARGIN_PX = 400;
|
|
6208
6136
|
var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
|
|
6209
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";
|
|
@@ -6300,7 +6228,6 @@ function cssEscapeAttribute(value) {
|
|
|
6300
6228
|
}
|
|
6301
6229
|
function MessageTimeline({
|
|
6302
6230
|
resolveLink,
|
|
6303
|
-
renderInteractiveBlock,
|
|
6304
6231
|
userMessageDisclosureLabels,
|
|
6305
6232
|
searchTarget,
|
|
6306
6233
|
events,
|
|
@@ -6366,13 +6293,12 @@ function MessageTimeline({
|
|
|
6366
6293
|
{
|
|
6367
6294
|
searchTarget: searchItem?.id === item.id ? searchTarget : null,
|
|
6368
6295
|
streaming: item.kind === "agent-message" && item.streaming,
|
|
6369
|
-
renderInteractiveBlock: item.kind === "agent-message" ? renderInteractiveBlock : void 0,
|
|
6370
6296
|
children: text
|
|
6371
6297
|
}
|
|
6372
6298
|
);
|
|
6373
6299
|
return item.kind === "user-message" ? /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text, children: body }) : body;
|
|
6374
6300
|
},
|
|
6375
|
-
[
|
|
6301
|
+
[renderMessageText, searchItem?.id, searchTarget]
|
|
6376
6302
|
);
|
|
6377
6303
|
const sourceItems = events ?? items;
|
|
6378
6304
|
const olderBoundaryKey = sourceItems?.[0]?.id;
|
|
@@ -6381,9 +6307,9 @@ function MessageTimeline({
|
|
|
6381
6307
|
newerScopeRef.current = newerBoundaryKey;
|
|
6382
6308
|
const newerAttemptRef = useRef9(null);
|
|
6383
6309
|
const newerRetryButtonRef = useRef9(null);
|
|
6384
|
-
const [newerRetryPending, setNewerRetryPending] =
|
|
6385
|
-
const [newerFailure, setNewerFailure] =
|
|
6386
|
-
|
|
6310
|
+
const [newerRetryPending, setNewerRetryPending] = useState14(false);
|
|
6311
|
+
const [newerFailure, setNewerFailure] = useState14(null);
|
|
6312
|
+
useEffect9(() => {
|
|
6387
6313
|
newerScopeRef.current = newerBoundaryKey;
|
|
6388
6314
|
newerAttemptRef.current = null;
|
|
6389
6315
|
setNewerFailure(null);
|
|
@@ -6435,7 +6361,7 @@ function MessageTimeline({
|
|
|
6435
6361
|
settlementAnimationRef.current = null;
|
|
6436
6362
|
}, []);
|
|
6437
6363
|
const olderPageBudgetRef = useRef9(0);
|
|
6438
|
-
const [olderDemand, setOlderDemand] =
|
|
6364
|
+
const [olderDemand, setOlderDemand] = useState14(0);
|
|
6439
6365
|
const readableTurns = turnSummary?.rolling === true;
|
|
6440
6366
|
const projectedGroups = useMemo4(
|
|
6441
6367
|
() => groupTimeline(resolvedItems, { readableTurns }),
|
|
@@ -6455,46 +6381,31 @@ function MessageTimeline({
|
|
|
6455
6381
|
const topSentinelRef = useRef9(null);
|
|
6456
6382
|
const bottomSentinelRef = useRef9(null);
|
|
6457
6383
|
const previousBulkFirstKeyRef = useRef9(void 0);
|
|
6458
|
-
const [pinned, setPinned] =
|
|
6384
|
+
const [pinned, setPinned] = useState14(true);
|
|
6459
6385
|
const { groups: allGroups, release: releaseProgress } = useReadingProgress(
|
|
6460
6386
|
projectedGroups,
|
|
6461
6387
|
autoFollow && pinned && !hasNewer,
|
|
6462
6388
|
scrollRef.current
|
|
6463
6389
|
);
|
|
6464
|
-
const [canSkipTipCatchup, setCanSkipTipCatchup] =
|
|
6390
|
+
const [canSkipTipCatchup, setCanSkipTipCatchup] = useState14(false);
|
|
6465
6391
|
const canSkipTipCatchupRef = useRef9(false);
|
|
6466
|
-
const [bulkActive, setBulkActive] =
|
|
6392
|
+
const [bulkActive, setBulkActive] = useState14(true);
|
|
6467
6393
|
const olderPrefetchArmedRef = useRef9(false);
|
|
6468
|
-
const [olderPrefetchArmed, setOlderPrefetchArmed] =
|
|
6394
|
+
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
|
|
6469
6395
|
const olderLoadAttemptRef = useRef9(null);
|
|
6470
|
-
const [underfillSettledAttempt, setUnderfillSettledAttempt] =
|
|
6396
|
+
const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState14(
|
|
6471
6397
|
null
|
|
6472
6398
|
);
|
|
6473
6399
|
const underfillRetryReadyRef = useRef9(false);
|
|
6474
6400
|
const resizeFollowRafRef = useRef9(null);
|
|
6475
6401
|
const questionNavFrameRef = useRef9(null);
|
|
6476
|
-
const [questionNav, setQuestionNav] =
|
|
6477
|
-
const
|
|
6478
|
-
const
|
|
6479
|
-
const
|
|
6480
|
-
const jumpPillPlacement = useTimelinePillPlacement({
|
|
6481
|
-
pillRef: jumpPillRef,
|
|
6482
|
-
scrollerRef: scrollRef,
|
|
6483
|
-
active: jumpPillShown,
|
|
6484
|
-
preference: JUMP_PILL_PLACEMENTS
|
|
6485
|
-
});
|
|
6486
|
-
const questionPillPlacement = useTimelinePillPlacement({
|
|
6487
|
-
pillRef: questionPillRef,
|
|
6488
|
-
scrollerRef: scrollRef,
|
|
6489
|
-
active: questionNav !== null,
|
|
6490
|
-
preference: QUESTION_PILL_PLACEMENTS
|
|
6491
|
-
});
|
|
6492
|
-
const [questionTarget, setQuestionTarget] = useState15(null);
|
|
6493
|
-
const [questionPending, setQuestionPending] = useState15(false);
|
|
6494
|
-
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);
|
|
6495
6406
|
const questionRequestRef = useRef9(0);
|
|
6496
6407
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
6497
|
-
const [revealed, setRevealed] =
|
|
6408
|
+
const [revealed, setRevealed] = useState14(resolvedItems[0]?.id === "c");
|
|
6498
6409
|
const pinnedRef = useRef9(true);
|
|
6499
6410
|
const hasNewerRef = useRef9(hasNewer);
|
|
6500
6411
|
hasNewerRef.current = hasNewer;
|
|
@@ -6619,7 +6530,7 @@ function MessageTimeline({
|
|
|
6619
6530
|
setOlderPrefetchArmed(true);
|
|
6620
6531
|
}
|
|
6621
6532
|
}, [autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]);
|
|
6622
|
-
|
|
6533
|
+
useEffect9(() => {
|
|
6623
6534
|
if (!readableTurns) return;
|
|
6624
6535
|
const node = scrollRef.current;
|
|
6625
6536
|
if (!node) return;
|
|
@@ -6881,7 +6792,7 @@ function MessageTimeline({
|
|
|
6881
6792
|
setQuestionNav((current) => sameQuestionNav(current, next) ? current : next);
|
|
6882
6793
|
});
|
|
6883
6794
|
}, [readableTurns, hasNewer, onJumpToLatestQuestion]);
|
|
6884
|
-
|
|
6795
|
+
useEffect9(
|
|
6885
6796
|
() => () => {
|
|
6886
6797
|
if (questionNavFrameRef.current != null) {
|
|
6887
6798
|
cancelFrame(questionNavFrameRef.current);
|
|
@@ -7029,8 +6940,8 @@ function MessageTimeline({
|
|
|
7029
6940
|
[applyCanSkipTipCatchup, cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
7030
6941
|
);
|
|
7031
6942
|
driveFollowRef.current = driveFollow;
|
|
7032
|
-
|
|
7033
|
-
|
|
6943
|
+
useEffect9(() => stopFollow, [stopFollow]);
|
|
6944
|
+
useEffect9(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
|
|
7034
6945
|
useLayoutEffect4(() => {
|
|
7035
6946
|
const node = scrollRef.current;
|
|
7036
6947
|
if (!node) {
|
|
@@ -7255,7 +7166,7 @@ function MessageTimeline({
|
|
|
7255
7166
|
seenActivityIdsRef.current.clear();
|
|
7256
7167
|
applyPinned(true);
|
|
7257
7168
|
}, [allGroups.length, revealed, applyPinned, clearReaderIntent]);
|
|
7258
|
-
|
|
7169
|
+
useEffect9(() => {
|
|
7259
7170
|
const node = scrollRef.current;
|
|
7260
7171
|
if (node) {
|
|
7261
7172
|
requestOlderIfUnderfilled(node);
|
|
@@ -7270,7 +7181,7 @@ function MessageTimeline({
|
|
|
7270
7181
|
const frame = requestFrame(() => setBulkActive(false));
|
|
7271
7182
|
return () => cancelFrame(frame);
|
|
7272
7183
|
}, [bulkRender, firstGroupKey]);
|
|
7273
|
-
|
|
7184
|
+
useEffect9(() => {
|
|
7274
7185
|
const root = scrollRef.current;
|
|
7275
7186
|
const target = topSentinelRef.current;
|
|
7276
7187
|
if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
|
|
@@ -7321,7 +7232,7 @@ function MessageTimeline({
|
|
|
7321
7232
|
onLoadOlder,
|
|
7322
7233
|
requestOlderIfUnderfilled
|
|
7323
7234
|
]);
|
|
7324
|
-
|
|
7235
|
+
useEffect9(() => {
|
|
7325
7236
|
const root = scrollRef.current;
|
|
7326
7237
|
const target = bottomSentinelRef.current;
|
|
7327
7238
|
if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
|
|
@@ -7338,7 +7249,7 @@ function MessageTimeline({
|
|
|
7338
7249
|
observer.observe(target);
|
|
7339
7250
|
return () => observer.disconnect();
|
|
7340
7251
|
}, [hasNewer, loadingNewer, onLoadNewer, requestNewer, firstGroupKey]);
|
|
7341
|
-
|
|
7252
|
+
useEffect9(() => {
|
|
7342
7253
|
const node = scrollRef.current;
|
|
7343
7254
|
const inner = node?.firstElementChild;
|
|
7344
7255
|
if (!node || !inner || typeof ResizeObserver === "undefined") {
|
|
@@ -7375,7 +7286,7 @@ function MessageTimeline({
|
|
|
7375
7286
|
}
|
|
7376
7287
|
};
|
|
7377
7288
|
}, [autoFollow, driveFollow, requestOlderIfUnderfilled, snapToBottom]);
|
|
7378
|
-
|
|
7289
|
+
useEffect9(() => {
|
|
7379
7290
|
if (searchTargetRef.current) return;
|
|
7380
7291
|
if (hasNewer) {
|
|
7381
7292
|
stopFollow();
|
|
@@ -7769,39 +7680,26 @@ function MessageTimeline({
|
|
|
7769
7680
|
exit: { opacity: 0, y: -6 },
|
|
7770
7681
|
transition: { duration: 0.15, ease: "easeOut" },
|
|
7771
7682
|
"data-og-question-nav": "",
|
|
7772
|
-
"
|
|
7773
|
-
className:
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
"
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
"aria-busy": questionPending,
|
|
7793
|
-
title: questionError ?? void 0,
|
|
7794
|
-
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",
|
|
7795
|
-
children: [
|
|
7796
|
-
/* @__PURE__ */ jsx17(ArrowUpIcon, { "aria-hidden": true, className: "size-3.5" }),
|
|
7797
|
-
"Latest question"
|
|
7798
|
-
]
|
|
7799
|
-
}
|
|
7800
|
-
),
|
|
7801
|
-
questionError && /* @__PURE__ */ jsx17("span", { role: "status", className: "px-2 text-og-xs", children: questionError })
|
|
7802
|
-
]
|
|
7803
|
-
}
|
|
7804
|
-
)
|
|
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
|
+
] })
|
|
7805
7703
|
},
|
|
7806
7704
|
"question-nav"
|
|
7807
7705
|
) : null }),
|
|
@@ -7818,14 +7716,11 @@ function MessageTimeline({
|
|
|
7818
7716
|
children: /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
7819
7717
|
}
|
|
7820
7718
|
) : null }),
|
|
7821
|
-
/* @__PURE__ */ jsx17(AnimatePresence3, { children:
|
|
7719
|
+
/* @__PURE__ */ jsx17(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer || canSkipTipCatchup) && autoFollow ? /* @__PURE__ */ jsxs12(
|
|
7822
7720
|
motion3.button,
|
|
7823
7721
|
{
|
|
7824
|
-
ref: jumpPillRef,
|
|
7825
7722
|
type: "button",
|
|
7826
7723
|
"data-og-jump-to-latest": "",
|
|
7827
|
-
"data-og-pill-placement": jumpPillPlacement,
|
|
7828
|
-
layout: "position",
|
|
7829
7724
|
initial: { opacity: 0, y: 8 },
|
|
7830
7725
|
animate: { opacity: 1, y: 0 },
|
|
7831
7726
|
exit: { opacity: 0, y: 8 },
|
|
@@ -7865,8 +7760,7 @@ function MessageTimeline({
|
|
|
7865
7760
|
}
|
|
7866
7761
|
},
|
|
7867
7762
|
className: cn(
|
|
7868
|
-
"absolute bottom-4 w-fit",
|
|
7869
|
-
JUMP_PILL_PLACEMENT_CLASS[jumpPillPlacement],
|
|
7763
|
+
"absolute inset-x-0 bottom-4 mx-auto w-fit",
|
|
7870
7764
|
"inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
|
|
7871
7765
|
"text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
7872
7766
|
"hover:border-og-border-strong"
|
|
@@ -8872,7 +8766,7 @@ function WorkerCompletionRow({
|
|
|
8872
8766
|
onOpenSession
|
|
8873
8767
|
}) {
|
|
8874
8768
|
const enter = useEntranceAnimation();
|
|
8875
|
-
const [open, setOpen] =
|
|
8769
|
+
const [open, setOpen] = useState14(false);
|
|
8876
8770
|
const meta = workerCompletionMeta(item);
|
|
8877
8771
|
const Icon = meta.icon;
|
|
8878
8772
|
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && !!item.pausedReason?.trim();
|
|
@@ -9278,8 +9172,8 @@ function AuthNeededRow({
|
|
|
9278
9172
|
resolveProviderLogo
|
|
9279
9173
|
}) {
|
|
9280
9174
|
const enter = useEntranceAnimation();
|
|
9281
|
-
const [busy, setBusy] =
|
|
9282
|
-
const [failed, setFailed] =
|
|
9175
|
+
const [busy, setBusy] = useState14(false);
|
|
9176
|
+
const [failed, setFailed] = useState14(false);
|
|
9283
9177
|
const recommendation = item.capability ?? null;
|
|
9284
9178
|
const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
|
|
9285
9179
|
const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
@@ -9383,8 +9277,8 @@ function AuthNeededRow({
|
|
|
9383
9277
|
] });
|
|
9384
9278
|
}
|
|
9385
9279
|
function AuthProviderLogo({ src, label }) {
|
|
9386
|
-
const [failed, setFailed] =
|
|
9387
|
-
|
|
9280
|
+
const [failed, setFailed] = useState14(false);
|
|
9281
|
+
useEffect9(() => setFailed(false), [src]);
|
|
9388
9282
|
const showImage = src && !failed;
|
|
9389
9283
|
return /* @__PURE__ */ jsx17(
|
|
9390
9284
|
"span",
|
|
@@ -9713,7 +9607,7 @@ import {
|
|
|
9713
9607
|
TargetIcon as TargetIcon3
|
|
9714
9608
|
} from "lucide-react";
|
|
9715
9609
|
import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
9716
|
-
import { useEffect as
|
|
9610
|
+
import { useEffect as useEffect10, useId as useId4, useMemo as useMemo5, useRef as useRef10, useState as useState15 } from "react";
|
|
9717
9611
|
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9718
9612
|
var GOAL_LABEL = {
|
|
9719
9613
|
pursuing: "Pursuing",
|
|
@@ -9829,8 +9723,8 @@ function formatCoarseElapsed(ms) {
|
|
|
9829
9723
|
}
|
|
9830
9724
|
function useLiveElapsed(startIso, live, endIso) {
|
|
9831
9725
|
const start = startIso ? Date.parse(startIso) : Number.NaN;
|
|
9832
|
-
const [now, setNow] =
|
|
9833
|
-
|
|
9726
|
+
const [now, setNow] = useState15(() => Date.now());
|
|
9727
|
+
useEffect10(() => {
|
|
9834
9728
|
if (!live) return;
|
|
9835
9729
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
9836
9730
|
return () => clearInterval(id);
|
|
@@ -9902,7 +9796,7 @@ function SessionChrome({
|
|
|
9902
9796
|
defaultActive = null,
|
|
9903
9797
|
onActiveChange
|
|
9904
9798
|
}) {
|
|
9905
|
-
const [activityRequested, setActivityOpen] =
|
|
9799
|
+
const [activityRequested, setActivityOpen] = useState15(
|
|
9906
9800
|
Boolean(defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
|
|
9907
9801
|
);
|
|
9908
9802
|
const reactId = useId4();
|
|
@@ -9932,7 +9826,7 @@ function SessionChrome({
|
|
|
9932
9826
|
queue.queue,
|
|
9933
9827
|
queue.mutationFor
|
|
9934
9828
|
);
|
|
9935
|
-
const [activeUncontrolled, setActiveUncontrolled] =
|
|
9829
|
+
const [activeUncontrolled, setActiveUncontrolled] = useState15(
|
|
9936
9830
|
() => sessionChromeInitialActive({
|
|
9937
9831
|
defaultActive,
|
|
9938
9832
|
authoritativeQueuedCount: initialAuthoritativeQueuedCount
|
|
@@ -9943,13 +9837,13 @@ function SessionChrome({
|
|
|
9943
9837
|
const openedQueueTargetRef = useRef10(null);
|
|
9944
9838
|
const focusedQueueTargetRef = useRef10(null);
|
|
9945
9839
|
const queueTargetKey = queueFocusTarget ? `${queueFocusTarget.turnId}:${queueFocusTarget.requestId}` : null;
|
|
9946
|
-
|
|
9840
|
+
useEffect10(() => {
|
|
9947
9841
|
if (!queueTargetKey || openedQueueTargetRef.current === queueTargetKey) return;
|
|
9948
9842
|
openedQueueTargetRef.current = queueTargetKey;
|
|
9949
9843
|
if (activeControlled === void 0) setActiveUncontrolled("queue");
|
|
9950
9844
|
onActiveChange?.("queue");
|
|
9951
9845
|
}, [queueTargetKey, activeControlled, onActiveChange]);
|
|
9952
|
-
|
|
9846
|
+
useEffect10(() => {
|
|
9953
9847
|
if (!queueFocusTarget || active !== "queue" || focusedQueueTargetRef.current === queueTargetKey)
|
|
9954
9848
|
return;
|
|
9955
9849
|
const root = rootRef.current;
|
|
@@ -10069,8 +9963,8 @@ function SessionChrome({
|
|
|
10069
9963
|
]);
|
|
10070
9964
|
const optimisticQueueKeys = optimisticQueued.map((message) => message.clientEventId).join(",");
|
|
10071
9965
|
const previousOptimisticQueueKeys = useRef10(optimisticQueueKeys);
|
|
10072
|
-
const [queueArrivalNonce, setQueueArrivalNonce] =
|
|
10073
|
-
|
|
9966
|
+
const [queueArrivalNonce, setQueueArrivalNonce] = useState15(0);
|
|
9967
|
+
useEffect10(() => {
|
|
10074
9968
|
const previous = new Set(previousOptimisticQueueKeys.current.split(",").filter(Boolean));
|
|
10075
9969
|
const arrived = optimisticQueued.some((message) => !previous.has(message.clientEventId));
|
|
10076
9970
|
previousOptimisticQueueKeys.current = optimisticQueueKeys;
|
|
@@ -10081,13 +9975,13 @@ function SessionChrome({
|
|
|
10081
9975
|
}
|
|
10082
9976
|
}, [active, activeControlled, optimisticQueueKeys, optimisticQueued]);
|
|
10083
9977
|
const queueOccupied = queuedTurns.length > 0 || optimisticQueued.length > 0;
|
|
10084
|
-
|
|
9978
|
+
useEffect10(() => {
|
|
10085
9979
|
if (queueOccupied) return;
|
|
10086
9980
|
queueOfferAdmissionSuppressedRef.current = false;
|
|
10087
9981
|
queueOfferDismissedSessionIdsRef.current.clear();
|
|
10088
9982
|
}, [queueOccupied]);
|
|
10089
9983
|
const queueOfferSuppressed = queueOfferAdmissionSuppressedRef.current || occupancySessionId != null && queueOfferDismissedSessionIdsRef.current.has(occupancySessionId);
|
|
10090
|
-
|
|
9984
|
+
useEffect10(() => {
|
|
10091
9985
|
if (!sessionChromeShouldOfferQueue({
|
|
10092
9986
|
controlled: activeControlled !== void 0,
|
|
10093
9987
|
active,
|
|
@@ -10108,28 +10002,28 @@ function SessionChrome({
|
|
|
10108
10002
|
queueOfferSuppressed,
|
|
10109
10003
|
queuedTurns.length
|
|
10110
10004
|
]);
|
|
10111
|
-
const [replaceDraftFor, setReplaceDraftFor] =
|
|
10005
|
+
const [replaceDraftFor, setReplaceDraftFor] = useState15(null);
|
|
10112
10006
|
const chipRefs = useRef10({});
|
|
10113
10007
|
const railRef = useRef10(null);
|
|
10114
|
-
const [pill, setPill] =
|
|
10008
|
+
const [pill, setPill] = useState15({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
|
|
10115
10009
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
10116
|
-
|
|
10010
|
+
useEffect10(() => {
|
|
10117
10011
|
if (!signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)))
|
|
10118
10012
|
setActivityOpen(false);
|
|
10119
10013
|
}, [signals]);
|
|
10120
|
-
|
|
10014
|
+
useEffect10(() => {
|
|
10121
10015
|
if (active && !signalIds.split(",").includes(active)) {
|
|
10122
10016
|
if (activeControlled === void 0) setActiveUncontrolled(null);
|
|
10123
10017
|
onActiveChange?.(null);
|
|
10124
10018
|
}
|
|
10125
10019
|
}, [active, activeControlled, onActiveChange, signalIds]);
|
|
10126
|
-
|
|
10020
|
+
useEffect10(() => {
|
|
10127
10021
|
if (active !== "queue" || !replaceDraftFor) return;
|
|
10128
10022
|
if (!queuedTurns.some((turn) => turn.id === replaceDraftFor)) {
|
|
10129
10023
|
setReplaceDraftFor(null);
|
|
10130
10024
|
}
|
|
10131
10025
|
}, [active, queuedTurns, replaceDraftFor]);
|
|
10132
|
-
|
|
10026
|
+
useEffect10(() => {
|
|
10133
10027
|
const rail = railRef.current;
|
|
10134
10028
|
const measure = () => {
|
|
10135
10029
|
if (!rail || !active) {
|
|
@@ -10644,10 +10538,10 @@ function QueuePanel({
|
|
|
10644
10538
|
}) {
|
|
10645
10539
|
const reduceMotion = useReducedMotion4();
|
|
10646
10540
|
const turnIdsKey = turns.map((turn) => turn.id).join(",");
|
|
10647
|
-
const [interactiveTurnIds, setInteractiveTurnIds] =
|
|
10541
|
+
const [interactiveTurnIds, setInteractiveTurnIds] = useState15(
|
|
10648
10542
|
() => /* @__PURE__ */ new Set()
|
|
10649
10543
|
);
|
|
10650
|
-
|
|
10544
|
+
useEffect10(() => {
|
|
10651
10545
|
const visibleTurnIds = new Set(turnIdsKey ? turnIdsKey.split(",") : []);
|
|
10652
10546
|
setInteractiveTurnIds((current) => {
|
|
10653
10547
|
const retained = new Set([...current].filter((turnId) => visibleTurnIds.has(turnId)));
|
|
@@ -11010,16 +10904,7 @@ function IconAction({
|
|
|
11010
10904
|
}
|
|
11011
10905
|
|
|
11012
10906
|
// src/components/session-conversation.tsx
|
|
11013
|
-
import {
|
|
11014
|
-
import {
|
|
11015
|
-
lazy as lazy5,
|
|
11016
|
-
Suspense as Suspense6,
|
|
11017
|
-
useCallback as useCallback5,
|
|
11018
|
-
useEffect as useEffect12,
|
|
11019
|
-
useMemo as useMemo6,
|
|
11020
|
-
useRef as useRef11,
|
|
11021
|
-
useState as useState17
|
|
11022
|
-
} from "react";
|
|
10907
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useRef as useRef11, useState as useState16 } from "react";
|
|
11023
10908
|
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
11024
10909
|
function SessionConversation(props) {
|
|
11025
10910
|
return /* @__PURE__ */ jsx21(Conversation, { ...props }, `${props.workspaceId ?? ""}:${props.sessionId}`);
|
|
@@ -11028,8 +10913,6 @@ function Conversation({
|
|
|
11028
10913
|
sessionId,
|
|
11029
10914
|
renderMessageText,
|
|
11030
10915
|
resolveLink,
|
|
11031
|
-
onOpenArtifact,
|
|
11032
|
-
renderInteractiveBlock,
|
|
11033
10916
|
toolRegistry,
|
|
11034
10917
|
attachments: attachmentsRequested = true,
|
|
11035
10918
|
modelPicker,
|
|
@@ -11056,7 +10939,7 @@ function Conversation({
|
|
|
11056
10939
|
const options = { ...scope, events: feed.events };
|
|
11057
10940
|
const detail = useSession(sessionId, options);
|
|
11058
10941
|
const queue = useTurnQueue(sessionId, options);
|
|
11059
|
-
const [queueFocusTarget, setQueueFocusTarget] =
|
|
10942
|
+
const [queueFocusTarget, setQueueFocusTarget] = useState16();
|
|
11060
10943
|
const human = useHumanInputRequests(sessionId, options);
|
|
11061
10944
|
const control = useSessionControl(sessionId, scope);
|
|
11062
10945
|
const approvals = useMemo6(() => projectPendingApprovals(feed.events), [feed.events]);
|
|
@@ -11081,11 +10964,6 @@ function Conversation({
|
|
|
11081
10964
|
} : {}
|
|
11082
10965
|
});
|
|
11083
10966
|
const region = useRef11(null);
|
|
11084
|
-
const defaultInteractiveBlock = useDefaultInteractiveBlock(
|
|
11085
|
-
context.client,
|
|
11086
|
-
context.workspaceId,
|
|
11087
|
-
sessionId
|
|
11088
|
-
);
|
|
11089
10967
|
const inheritedLinks = useOpenGeniLinkResolver();
|
|
11090
10968
|
const defaultLinks = useMemo6(
|
|
11091
10969
|
() => sessionLinkResolver({
|
|
@@ -11096,19 +10974,9 @@ function Conversation({
|
|
|
11096
10974
|
}),
|
|
11097
10975
|
[context.client, context.workspaceId, sessionId, config.sandboxFiles]
|
|
11098
10976
|
);
|
|
11099
|
-
const onOpenArtifactRef = useRef11(onOpenArtifact);
|
|
11100
|
-
onOpenArtifactRef.current = onOpenArtifact;
|
|
11101
|
-
const opensArtifacts = onOpenArtifact !== void 0;
|
|
11102
|
-
const viewerLinks = useMemo6(
|
|
11103
|
-
() => opensArtifacts ? viewerLinkResolver({
|
|
11104
|
-
workspaceId: context.workspaceId,
|
|
11105
|
-
open: (target) => onOpenArtifactRef.current?.(target)
|
|
11106
|
-
}) : null,
|
|
11107
|
-
[context.workspaceId, opensArtifacts]
|
|
11108
|
-
);
|
|
11109
10977
|
const links = useMemo6(
|
|
11110
|
-
() => chainLinkResolvers(resolveLink,
|
|
11111
|
-
[resolveLink,
|
|
10978
|
+
() => chainLinkResolvers(resolveLink, inheritedLinks, defaultLinks) ?? void 0,
|
|
10979
|
+
[resolveLink, inheritedLinks, defaultLinks]
|
|
11112
10980
|
);
|
|
11113
10981
|
const error = detail.error ?? feed.error ?? human.error;
|
|
11114
10982
|
return /* @__PURE__ */ jsxs16(
|
|
@@ -11128,7 +10996,6 @@ function Conversation({
|
|
|
11128
10996
|
{
|
|
11129
10997
|
renderMessageText,
|
|
11130
10998
|
resolveLink: links,
|
|
11131
|
-
renderInteractiveBlock: renderInteractiveBlock === false ? void 0 : renderInteractiveBlock ?? defaultInteractiveBlock,
|
|
11132
10999
|
userMessageDisclosureLabels,
|
|
11133
11000
|
className: "min-h-0 flex-1",
|
|
11134
11001
|
...toolRegistry ? { toolRegistry } : {},
|
|
@@ -11147,7 +11014,7 @@ function Conversation({
|
|
|
11147
11014
|
},
|
|
11148
11015
|
loadingOldest: feed.loadingOldest,
|
|
11149
11016
|
onJumpToLatest: feed.jumpToLatest,
|
|
11150
|
-
onJumpToLatestQuestion:
|
|
11017
|
+
onJumpToLatestQuestion: () => feed.jumpToLatestQuestion({
|
|
11151
11018
|
onQueuedQuestion: async (turn, navigation) => {
|
|
11152
11019
|
await queue.refresh();
|
|
11153
11020
|
if (!navigation.isCurrent() || scopeRef.current.client !== context.client || scopeRef.current.workspaceId !== context.workspaceId)
|
|
@@ -11157,7 +11024,7 @@ function Conversation({
|
|
|
11157
11024
|
requestId: (previous?.requestId ?? 0) + 1
|
|
11158
11025
|
}));
|
|
11159
11026
|
}
|
|
11160
|
-
})
|
|
11027
|
+
}),
|
|
11161
11028
|
onAnnotate: composer.addAnnotation
|
|
11162
11029
|
}
|
|
11163
11030
|
),
|
|
@@ -11241,37 +11108,9 @@ function Conversation({
|
|
|
11241
11108
|
}
|
|
11242
11109
|
);
|
|
11243
11110
|
}
|
|
11244
|
-
var LazyChatInteractiveBlock = lazy5(
|
|
11245
|
-
() => import("./chat-interactive-block-VAGABN7J.js").then((module) => ({
|
|
11246
|
-
default: module.ChatInteractiveBlock
|
|
11247
|
-
}))
|
|
11248
|
-
);
|
|
11249
|
-
function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
|
|
11250
|
-
const scoped = useMemo6(() => {
|
|
11251
|
-
let resolved = null;
|
|
11252
|
-
const get = () => {
|
|
11253
|
-
const candidate = client;
|
|
11254
|
-
resolved ??= typeof candidate.withHeaders === "function" ? candidate.withHeaders({ [SESSION_SCOPE_HEADER]: sessionId }) : candidate;
|
|
11255
|
-
return resolved;
|
|
11256
|
-
};
|
|
11257
|
-
return {
|
|
11258
|
-
getWorkspaceArtifact: (...args) => get().getWorkspaceArtifact(...args),
|
|
11259
|
-
getWorkspaceArtifactHtml: (...args) => get().getWorkspaceArtifactHtml(...args),
|
|
11260
|
-
getWorkspaceArtifactContent: (...args) => {
|
|
11261
|
-
const target = get();
|
|
11262
|
-
if (!target.getWorkspaceArtifactContent) throw new Error("Site version unavailable");
|
|
11263
|
-
return target.getWorkspaceArtifactContent(...args);
|
|
11264
|
-
}
|
|
11265
|
-
};
|
|
11266
|
-
}, [client, sessionId]);
|
|
11267
|
-
return useCallback5(
|
|
11268
|
-
(block) => /* @__PURE__ */ jsx21(Suspense6, { fallback: /* @__PURE__ */ jsx21("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx21(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
|
|
11269
|
-
[scoped, workspaceId]
|
|
11270
|
-
);
|
|
11271
|
-
}
|
|
11272
11111
|
function useClientConfigFlags(client) {
|
|
11273
|
-
const [flags, setFlags] =
|
|
11274
|
-
|
|
11112
|
+
const [flags, setFlags] = useState16({ uploads: false, modelSelection: true, sandboxFiles: false });
|
|
11113
|
+
useEffect11(() => {
|
|
11275
11114
|
let live = true;
|
|
11276
11115
|
client.getClientConfig().then(
|
|
11277
11116
|
(config) => {
|
|
@@ -11293,7 +11132,7 @@ function useClientConfigFlags(client) {
|
|
|
11293
11132
|
}
|
|
11294
11133
|
|
|
11295
11134
|
// src/hooks/use-workspace-sessions.ts
|
|
11296
|
-
import { useCallback as
|
|
11135
|
+
import { useCallback as useCallback5, useEffect as useEffect12, useRef as useRef12 } from "react";
|
|
11297
11136
|
function useWorkspaceSessions(options = {}) {
|
|
11298
11137
|
const { client, workspaceId } = useOpenGeni(options);
|
|
11299
11138
|
const limit = options.limit;
|
|
@@ -11321,10 +11160,10 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11321
11160
|
].join("\0");
|
|
11322
11161
|
const previousQueryKey = useRef12(queryKey);
|
|
11323
11162
|
const queryKeyTransition = previousQueryKey.current !== queryKey;
|
|
11324
|
-
|
|
11163
|
+
useEffect12(() => {
|
|
11325
11164
|
previousQueryKey.current = queryKey;
|
|
11326
11165
|
}, [queryKey]);
|
|
11327
|
-
const load =
|
|
11166
|
+
const load = useCallback5(
|
|
11328
11167
|
async (signal) => {
|
|
11329
11168
|
const readGeneration = beginRead?.() ?? ++nextReadGeneration.current;
|
|
11330
11169
|
const page2 = await client.listSessionPage(workspaceId, {
|
|
@@ -11390,7 +11229,7 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11390
11229
|
// src/components/session-list.tsx
|
|
11391
11230
|
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
11392
11231
|
import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
|
|
11393
|
-
import { useEffect as
|
|
11232
|
+
import { useEffect as useEffect13, useRef as useRef13, useState as useState17 } from "react";
|
|
11394
11233
|
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11395
11234
|
var DEFAULT_LABELS = {
|
|
11396
11235
|
heading: "Chats",
|
|
@@ -11420,7 +11259,7 @@ function SessionList({
|
|
|
11420
11259
|
const labels = { ...DEFAULT_LABELS, ...labelOverrides };
|
|
11421
11260
|
const scope = { client, workspaceId };
|
|
11422
11261
|
const context = useOpenGeni(scope);
|
|
11423
|
-
const [limit, setLimit] =
|
|
11262
|
+
const [limit, setLimit] = useState17(pageSize);
|
|
11424
11263
|
const list = useWorkspaceSessions({
|
|
11425
11264
|
...scope,
|
|
11426
11265
|
parentSessionId: null,
|
|
@@ -11430,14 +11269,14 @@ function SessionList({
|
|
|
11430
11269
|
});
|
|
11431
11270
|
const refresh = list.refresh;
|
|
11432
11271
|
const firstRefreshKey = useRef13(refreshKey);
|
|
11433
|
-
|
|
11272
|
+
useEffect13(() => {
|
|
11434
11273
|
if (Object.is(refreshKey, firstRefreshKey.current)) return;
|
|
11435
11274
|
firstRefreshKey.current = refreshKey;
|
|
11436
11275
|
void refresh();
|
|
11437
11276
|
}, [refresh, refreshKey]);
|
|
11438
|
-
const [editing, setEditing] =
|
|
11439
|
-
const [busy, setBusy] =
|
|
11440
|
-
const [error, setError] =
|
|
11277
|
+
const [editing, setEditing] = useState17(null);
|
|
11278
|
+
const [busy, setBusy] = useState17(null);
|
|
11279
|
+
const [error, setError] = useState17(null);
|
|
11441
11280
|
const archiveClient = context.client;
|
|
11442
11281
|
const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
|
|
11443
11282
|
const run = async (id, action) => {
|
|
@@ -11587,7 +11426,7 @@ function SessionList({
|
|
|
11587
11426
|
|
|
11588
11427
|
// src/components/open-geni-chat.tsx
|
|
11589
11428
|
import { MenuIcon, SendIcon, XIcon as XIcon3 } from "lucide-react";
|
|
11590
|
-
import { useCallback as
|
|
11429
|
+
import { useCallback as useCallback6, useRef as useRef14, useState as useState18 } from "react";
|
|
11591
11430
|
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11592
11431
|
var DEFAULT_LABELS2 = {
|
|
11593
11432
|
openChats: "Open chats",
|
|
@@ -11613,11 +11452,11 @@ function OpenGeniChat({
|
|
|
11613
11452
|
const labels = { ...DEFAULT_LABELS2, ...labelOverrides };
|
|
11614
11453
|
const scope = { client, workspaceId };
|
|
11615
11454
|
const context = useOpenGeni(scope);
|
|
11616
|
-
const [uncontrolled, setUncontrolled] =
|
|
11455
|
+
const [uncontrolled, setUncontrolled] = useState18(defaultSessionId);
|
|
11617
11456
|
const selected = controlledSessionId !== void 0 ? controlledSessionId : uncontrolled;
|
|
11618
|
-
const [drawerOpen, setDrawerOpen] =
|
|
11619
|
-
const [listRevision, setListRevision] =
|
|
11620
|
-
const select =
|
|
11457
|
+
const [drawerOpen, setDrawerOpen] = useState18(false);
|
|
11458
|
+
const [listRevision, setListRevision] = useState18(0);
|
|
11459
|
+
const select = useCallback6(
|
|
11621
11460
|
(next) => {
|
|
11622
11461
|
if (controlledSessionId === void 0) setUncontrolled(next);
|
|
11623
11462
|
onSessionChange?.(next);
|
|
@@ -11625,7 +11464,7 @@ function OpenGeniChat({
|
|
|
11625
11464
|
},
|
|
11626
11465
|
[controlledSessionId, onSessionChange]
|
|
11627
11466
|
);
|
|
11628
|
-
const create =
|
|
11467
|
+
const create = useCallback6(
|
|
11629
11468
|
async (initialMessage, idempotencyKey) => {
|
|
11630
11469
|
if (createSession) return await createSession(initialMessage, idempotencyKey);
|
|
11631
11470
|
const creator = context.client.createSession;
|
|
@@ -11738,9 +11577,9 @@ function NewChat({
|
|
|
11738
11577
|
create,
|
|
11739
11578
|
onCreated
|
|
11740
11579
|
}) {
|
|
11741
|
-
const [text, setText] =
|
|
11742
|
-
const [sending, setSending] =
|
|
11743
|
-
const [error, setError] =
|
|
11580
|
+
const [text, setText] = useState18("");
|
|
11581
|
+
const [sending, setSending] = useState18(false);
|
|
11582
|
+
const [error, setError] = useState18(null);
|
|
11744
11583
|
const idempotencyKey = useRef14(crypto.randomUUID());
|
|
11745
11584
|
const submit = async (event) => {
|
|
11746
11585
|
event.preventDefault();
|
|
@@ -11804,14 +11643,14 @@ function NewChat({
|
|
|
11804
11643
|
|
|
11805
11644
|
// src/components/session-commands-panel.tsx
|
|
11806
11645
|
import { ChevronRightIcon as ChevronRightIcon3, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
|
|
11807
|
-
import { useState as
|
|
11646
|
+
import { useState as useState19 } from "react";
|
|
11808
11647
|
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11809
11648
|
function SessionCommandsPanel({
|
|
11810
11649
|
commands: state,
|
|
11811
11650
|
readOnly = false
|
|
11812
11651
|
}) {
|
|
11813
|
-
const [pending, setPending] =
|
|
11814
|
-
const [error, setError] =
|
|
11652
|
+
const [pending, setPending] = useState19(null);
|
|
11653
|
+
const [error, setError] = useState19(null);
|
|
11815
11654
|
const active = state.commands.filter(
|
|
11816
11655
|
(command) => command.state === "running" || command.state === "stopping"
|
|
11817
11656
|
);
|
|
@@ -11900,11 +11739,11 @@ function SessionCommandsPanel({
|
|
|
11900
11739
|
}
|
|
11901
11740
|
|
|
11902
11741
|
// src/hooks/use-session-background-commands.ts
|
|
11903
|
-
import { useCallback as
|
|
11742
|
+
import { useCallback as useCallback7, useEffect as useEffect14, useRef as useRef15 } from "react";
|
|
11904
11743
|
function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
11905
11744
|
const { client, workspaceId } = useOpenGeni(options);
|
|
11906
11745
|
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
11907
|
-
const load =
|
|
11746
|
+
const load = useCallback7(
|
|
11908
11747
|
async (signal) => {
|
|
11909
11748
|
if (!sessionId) return { commands: [] };
|
|
11910
11749
|
if (!client.listSessionBackgroundCommands) {
|
|
@@ -11920,13 +11759,13 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
11920
11759
|
});
|
|
11921
11760
|
const refresh = state.refresh;
|
|
11922
11761
|
const generation = useRef15(0);
|
|
11923
|
-
|
|
11762
|
+
useEffect14(() => {
|
|
11924
11763
|
generation.current += 1;
|
|
11925
11764
|
return () => {
|
|
11926
11765
|
generation.current += 1;
|
|
11927
11766
|
};
|
|
11928
11767
|
}, [client, workspaceId, sessionId, enabled]);
|
|
11929
|
-
const cancel =
|
|
11768
|
+
const cancel = useCallback7(
|
|
11930
11769
|
async (commandId) => {
|
|
11931
11770
|
if (!sessionId) return;
|
|
11932
11771
|
if (!client.cancelSessionBackgroundCommand) {
|
|
@@ -12124,4 +11963,4 @@ export {
|
|
|
12124
11963
|
SessionCommands,
|
|
12125
11964
|
StartupTimings
|
|
12126
11965
|
};
|
|
12127
|
-
//# sourceMappingURL=chunk-
|
|
11966
|
+
//# sourceMappingURL=chunk-L4OSXQ6H.js.map
|