@opengeni/react 3.7.0-canary.0 → 3.7.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts.js +24 -5
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-E5DDEFQ4.js → browser-viewer-NTD6UIPR.js} +3 -3
- package/dist/{chunk-W2RGYBCV.js → chunk-24M4YBCL.js} +4 -4
- package/dist/{chunk-R55HFTT3.js → chunk-3IY6UZI6.js} +4306 -4020
- package/dist/chunk-3IY6UZI6.js.map +1 -0
- package/dist/chunk-5PQJOCX5.js +902 -0
- package/dist/chunk-5PQJOCX5.js.map +1 -0
- package/dist/{chunk-FJBOU2TH.js → chunk-MOWYEBCQ.js} +1728 -12
- package/dist/chunk-MOWYEBCQ.js.map +1 -0
- package/dist/chunk-PAJU5KKL.js +331 -0
- package/dist/chunk-PAJU5KKL.js.map +1 -0
- package/dist/{chunk-VTOREEXF.js → chunk-PLYRL5ER.js} +24 -2
- package/dist/{chunk-VTOREEXF.js.map → chunk-PLYRL5ER.js.map} +1 -1
- package/dist/{chunk-DOK4KZF2.js → chunk-WZIMM3GX.js} +1536 -539
- package/dist/chunk-WZIMM3GX.js.map +1 -0
- package/dist/{chunk-YVCHAQZY.js → chunk-ZFOFY5ST.js} +27 -349
- package/dist/chunk-ZFOFY5ST.js.map +1 -0
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +3 -2
- package/dist/components/child-session-link.d.ts +5 -0
- package/dist/components/session-chrome.d.ts +43 -6
- package/dist/components/session-commands-panel.d.ts +6 -0
- package/dist/components/session-conversation.d.ts +14 -0
- package/dist/components/timeline-anchor.d.ts +21 -0
- package/dist/composer.js +2 -3
- package/dist/conversation-timeline.d.ts +5 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +716 -914
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/lib/format.d.ts +5 -0
- package/dist/machines.js +3 -2
- package/dist/session-ui.d.ts +3 -0
- package/dist/session-ui.js +14 -4
- package/dist/session.js +19 -19
- package/dist/timeline/types.d.ts +3 -1
- package/package.json +2 -2
- package/src/components/artifacts/published-html-artifact-frame.tsx +27 -4
- package/src/components/child-session-link.tsx +27 -0
- package/src/components/composer.tsx +1 -1
- package/src/components/machine-input-display.ts +8 -2
- package/src/components/message-timeline.tsx +336 -198
- package/src/components/session-chrome.tsx +572 -161
- package/src/components/session-commands-panel.tsx +113 -0
- package/src/components/session-conversation.tsx +141 -0
- package/src/components/timeline-anchor.tsx +91 -0
- package/src/conversation-timeline.ts +83 -0
- package/src/hooks/use-session-background-commands.ts +21 -10
- package/src/hooks/use-session-events.ts +36 -14
- package/src/hooks/use-session.ts +23 -2
- package/src/index.ts +4 -0
- package/src/lib/format.ts +32 -0
- package/src/session-ui.ts +3 -0
- package/src/timeline/projection.ts +6 -12
- package/src/timeline/types.ts +4 -0
- package/styles/compiled.css +513 -410
- package/styles/index.css +23 -0
- package/dist/chunk-7EAFGICR.js +0 -302
- package/dist/chunk-7EAFGICR.js.map +0 -1
- package/dist/chunk-C6WDLHBA.js +0 -2590
- package/dist/chunk-C6WDLHBA.js.map +0 -1
- package/dist/chunk-DOK4KZF2.js.map +0 -1
- package/dist/chunk-FJBOU2TH.js.map +0 -1
- package/dist/chunk-R55HFTT3.js.map +0 -1
- package/dist/chunk-YVCHAQZY.js.map +0 -1
- /package/dist/{browser-viewer-E5DDEFQ4.js.map → browser-viewer-NTD6UIPR.js.map} +0 -0
- /package/dist/{chunk-W2RGYBCV.js.map → chunk-24M4YBCL.js.map} +0 -0
|
@@ -8,21 +8,52 @@ import {
|
|
|
8
8
|
tableElementToTsv
|
|
9
9
|
} from "./chunk-JVYQRRC4.js";
|
|
10
10
|
import {
|
|
11
|
+
Actions,
|
|
12
|
+
AttachButton,
|
|
13
|
+
Attachments,
|
|
14
|
+
CommandPalette2 as CommandPalette,
|
|
15
|
+
ComposerTranscriptionControl,
|
|
16
|
+
Confirmation,
|
|
17
|
+
Controls,
|
|
18
|
+
Footer,
|
|
19
|
+
Frame,
|
|
20
|
+
Help,
|
|
21
|
+
Hint,
|
|
22
|
+
Input,
|
|
11
23
|
LightboxProvider,
|
|
24
|
+
ModelPicker2 as ModelPicker,
|
|
25
|
+
PauseButton,
|
|
26
|
+
PausedState,
|
|
27
|
+
RestoredResources,
|
|
28
|
+
Root,
|
|
29
|
+
SendButton,
|
|
30
|
+
Status,
|
|
31
|
+
Surface,
|
|
12
32
|
Tooltip,
|
|
13
33
|
TooltipContent,
|
|
14
34
|
TooltipProvider,
|
|
15
35
|
TooltipTrigger,
|
|
36
|
+
useChatComposerController,
|
|
16
37
|
useLightboxOptional
|
|
17
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3IY6UZI6.js";
|
|
39
|
+
import {
|
|
40
|
+
ModelPolicyPicker
|
|
41
|
+
} from "./chunk-4JFUT22W.js";
|
|
18
42
|
import {
|
|
19
43
|
buildTimeline,
|
|
20
44
|
groupTimeline,
|
|
21
45
|
invokeOlderHistoryLoaderWithReceiptCapture,
|
|
22
46
|
isActionableHumanInputRequest,
|
|
23
47
|
mcpToolLeaf,
|
|
24
|
-
toolDisplayName
|
|
25
|
-
|
|
48
|
+
toolDisplayName,
|
|
49
|
+
useHumanInputRequests,
|
|
50
|
+
useSession,
|
|
51
|
+
useSessionEvents,
|
|
52
|
+
useTurnQueue
|
|
53
|
+
} from "./chunk-MOWYEBCQ.js";
|
|
54
|
+
import {
|
|
55
|
+
useComposer
|
|
56
|
+
} from "./chunk-IOLVN74D.js";
|
|
26
57
|
import {
|
|
27
58
|
formatBytes,
|
|
28
59
|
formatClockTime,
|
|
@@ -30,7 +61,18 @@ import {
|
|
|
30
61
|
stringifyPayload,
|
|
31
62
|
truncate,
|
|
32
63
|
tryParseJson
|
|
33
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-PLYRL5ER.js";
|
|
65
|
+
import {
|
|
66
|
+
usePolledValue
|
|
67
|
+
} from "./chunk-KZ73RL76.js";
|
|
68
|
+
import {
|
|
69
|
+
useOpenGeni,
|
|
70
|
+
useOpenGeniClient
|
|
71
|
+
} from "./chunk-NEXLLTP4.js";
|
|
72
|
+
import {
|
|
73
|
+
projectPickerRows,
|
|
74
|
+
sortPickerRows
|
|
75
|
+
} from "./chunk-WMGF4Z7X.js";
|
|
34
76
|
import {
|
|
35
77
|
cn
|
|
36
78
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -5711,6 +5753,27 @@ function StatusDot({ status, className }) {
|
|
|
5711
5753
|
);
|
|
5712
5754
|
}
|
|
5713
5755
|
|
|
5756
|
+
// src/components/child-session-link.tsx
|
|
5757
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5758
|
+
function ChildSessionLink({
|
|
5759
|
+
kind,
|
|
5760
|
+
sourceId,
|
|
5761
|
+
onOpenSession
|
|
5762
|
+
}) {
|
|
5763
|
+
if (!onOpenSession || !kind.startsWith("child_") || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(sourceId)) {
|
|
5764
|
+
return null;
|
|
5765
|
+
}
|
|
5766
|
+
return /* @__PURE__ */ jsx16(
|
|
5767
|
+
"button",
|
|
5768
|
+
{
|
|
5769
|
+
type: "button",
|
|
5770
|
+
onClick: () => onOpenSession(sourceId),
|
|
5771
|
+
className: "mt-1 rounded-og-sm text-og-xs font-medium text-og-accent underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent",
|
|
5772
|
+
children: "View session"
|
|
5773
|
+
}
|
|
5774
|
+
);
|
|
5775
|
+
}
|
|
5776
|
+
|
|
5714
5777
|
// src/components/message-timeline.tsx
|
|
5715
5778
|
import { dequal } from "dequal/lite";
|
|
5716
5779
|
import {
|
|
@@ -5735,7 +5798,7 @@ import {
|
|
|
5735
5798
|
import { AnimatePresence, motion } from "motion/react";
|
|
5736
5799
|
import { Collapsible as Collapsible2 } from "radix-ui";
|
|
5737
5800
|
import {
|
|
5738
|
-
Component as
|
|
5801
|
+
Component as Component3,
|
|
5739
5802
|
Suspense as Suspense3,
|
|
5740
5803
|
lazy as lazy3,
|
|
5741
5804
|
memo as memo2,
|
|
@@ -5747,6 +5810,73 @@ import {
|
|
|
5747
5810
|
useState as useState12
|
|
5748
5811
|
} from "react";
|
|
5749
5812
|
|
|
5813
|
+
// src/components/timeline-anchor.tsx
|
|
5814
|
+
import { Component as Component2 } from "react";
|
|
5815
|
+
var TimelineBeforeLayout = class extends Component2 {
|
|
5816
|
+
getSnapshotBeforeUpdate() {
|
|
5817
|
+
this.props.capture();
|
|
5818
|
+
return null;
|
|
5819
|
+
}
|
|
5820
|
+
componentDidUpdate() {
|
|
5821
|
+
}
|
|
5822
|
+
render() {
|
|
5823
|
+
return this.props.children;
|
|
5824
|
+
}
|
|
5825
|
+
};
|
|
5826
|
+
function captureTimelineAnchor(scroller) {
|
|
5827
|
+
const viewport = scroller.getBoundingClientRect();
|
|
5828
|
+
if (viewport.height <= 0) return null;
|
|
5829
|
+
const groups = Array.from(scroller.querySelectorAll("[data-og-group-key]")).filter(
|
|
5830
|
+
(group) => group.getBoundingClientRect().height > 0
|
|
5831
|
+
);
|
|
5832
|
+
const anchors = [];
|
|
5833
|
+
const focused = scroller.ownerDocument.activeElement;
|
|
5834
|
+
if (focused instanceof HTMLElement && scroller.contains(focused) && focused.matches("button[aria-expanded]")) {
|
|
5835
|
+
const box = focused.getBoundingClientRect();
|
|
5836
|
+
if (box.bottom > viewport.top && box.top < viewport.bottom) {
|
|
5837
|
+
anchors.push({ element: focused, key: null, text: null, top: box.top });
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
for (const group of groups) {
|
|
5841
|
+
const rect = group.getBoundingClientRect();
|
|
5842
|
+
if (rect.bottom <= viewport.top || rect.top >= viewport.bottom) continue;
|
|
5843
|
+
for (const element of group.querySelectorAll("p, li, pre, h1, h2, h3, h4")) {
|
|
5844
|
+
const box = element.getBoundingClientRect();
|
|
5845
|
+
const text = element.textContent;
|
|
5846
|
+
if (box.bottom > viewport.top && box.top < viewport.bottom && text && text.length >= 12) {
|
|
5847
|
+
anchors.push({ element, key: null, text, top: box.top });
|
|
5848
|
+
}
|
|
5849
|
+
}
|
|
5850
|
+
}
|
|
5851
|
+
const rows = groups.map((element) => ({
|
|
5852
|
+
element,
|
|
5853
|
+
key: element.getAttribute("data-og-group-key"),
|
|
5854
|
+
text: null,
|
|
5855
|
+
top: element.getBoundingClientRect().top
|
|
5856
|
+
}));
|
|
5857
|
+
anchors.push(...rows.filter((row) => row.top >= viewport.top));
|
|
5858
|
+
anchors.push(...rows.filter((row) => row.top < viewport.top).reverse());
|
|
5859
|
+
return anchors;
|
|
5860
|
+
}
|
|
5861
|
+
function timelineAnchorCorrection(scroller, anchors) {
|
|
5862
|
+
let blocks;
|
|
5863
|
+
const groups = Array.from(scroller.querySelectorAll("[data-og-group-key]"));
|
|
5864
|
+
for (const anchor of anchors) {
|
|
5865
|
+
let element;
|
|
5866
|
+
if (scroller.contains(anchor.element) && (!anchor.text || anchor.element.textContent === anchor.text)) {
|
|
5867
|
+
element = anchor.element;
|
|
5868
|
+
} else if (anchor.key) {
|
|
5869
|
+
element = groups.find((group) => group.getAttribute("data-og-group-key") === anchor.key);
|
|
5870
|
+
} else if (anchor.text) {
|
|
5871
|
+
blocks ??= Array.from(scroller.querySelectorAll("p, li, pre, h1, h2, h3, h4"));
|
|
5872
|
+
const matches = blocks.filter((block) => block.textContent === anchor.text);
|
|
5873
|
+
if (matches.length === 1) element = matches[0];
|
|
5874
|
+
}
|
|
5875
|
+
if (element) return element.getBoundingClientRect().top - anchor.top;
|
|
5876
|
+
}
|
|
5877
|
+
return null;
|
|
5878
|
+
}
|
|
5879
|
+
|
|
5750
5880
|
// src/components/tip-follow.ts
|
|
5751
5881
|
var _t = (ms) => ms * MOTION_INSPECT_SCALE;
|
|
5752
5882
|
var _s = (pxPerSec) => pxPerSec / MOTION_INSPECT_SCALE;
|
|
@@ -6046,9 +6176,11 @@ function tipFollowStep(state, input) {
|
|
|
6046
6176
|
var MACHINE_INPUT_META = {
|
|
6047
6177
|
scheduled_occurrence: "Scheduled update",
|
|
6048
6178
|
goal_continuation: "Goal continued",
|
|
6179
|
+
background_command_result: "Command result received",
|
|
6180
|
+
session_wait_timeout: "Wait ended",
|
|
6049
6181
|
agent_message: "Agent update",
|
|
6050
6182
|
agent_steer_instruction: "Agent direction",
|
|
6051
|
-
child_terminal_result: "Agent
|
|
6183
|
+
child_terminal_result: "Agent result received",
|
|
6052
6184
|
media_generation_result: "Video update",
|
|
6053
6185
|
child_requires_action: "Agent needs input",
|
|
6054
6186
|
child_requires_action_resolved: "Agent unblocked",
|
|
@@ -6066,8 +6198,12 @@ function machineInputBatchLabel(members) {
|
|
|
6066
6198
|
const kind = members[0].kind;
|
|
6067
6199
|
const n = members.length;
|
|
6068
6200
|
switch (kind) {
|
|
6201
|
+
case "background_command_result":
|
|
6202
|
+
return n === 1 ? "Command result received" : `${n} command results received`;
|
|
6203
|
+
case "session_wait_timeout":
|
|
6204
|
+
return n === 1 ? "Wait ended" : `${n} waits ended`;
|
|
6069
6205
|
case "child_terminal_result":
|
|
6070
|
-
return n === 1 ? "Agent
|
|
6206
|
+
return n === 1 ? "Agent result received" : `${n} agent results received`;
|
|
6071
6207
|
case "goal_continuation":
|
|
6072
6208
|
return n === 1 ? "Goal continued" : `${n} goal continuations`;
|
|
6073
6209
|
case "scheduled_occurrence":
|
|
@@ -6119,7 +6255,7 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
|
|
|
6119
6255
|
}
|
|
6120
6256
|
|
|
6121
6257
|
// src/components/message-timeline.tsx
|
|
6122
|
-
import { Fragment as Fragment5, jsx as
|
|
6258
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6123
6259
|
var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-3L7LHGG2.js"));
|
|
6124
6260
|
var PIN_THRESHOLD_PX = 48;
|
|
6125
6261
|
var JUMP_TO_LATEST_CATCHUP_DEBT_PX = 240;
|
|
@@ -6230,8 +6366,13 @@ function MessageTimeline({
|
|
|
6230
6366
|
(item) => item.kind !== "auth-needed" || shouldRenderAuthNeeded(item)
|
|
6231
6367
|
);
|
|
6232
6368
|
}, [items, events, shouldRenderAuthNeeded]);
|
|
6233
|
-
const sourceItems =
|
|
6369
|
+
const sourceItems = events ?? items;
|
|
6234
6370
|
const olderBoundaryKey = sourceItems?.[0]?.id;
|
|
6371
|
+
const previousSourceIdsRef = useRef10(/* @__PURE__ */ new Set());
|
|
6372
|
+
const previousSourceBoundaryRef = useRef10(void 0);
|
|
6373
|
+
const readingAnchorRef = useRef10(null);
|
|
6374
|
+
const olderPageBudgetRef = useRef10(0);
|
|
6375
|
+
const [olderDemand, setOlderDemand] = useState12(0);
|
|
6235
6376
|
const allGroups = useMemo4(() => groupTimeline(resolvedItems), [resolvedItems]);
|
|
6236
6377
|
const annotationSources = useMemo4(() => {
|
|
6237
6378
|
const sources = /* @__PURE__ */ new Map();
|
|
@@ -6360,28 +6501,22 @@ function MessageTimeline({
|
|
|
6360
6501
|
followFrameRef.current = null;
|
|
6361
6502
|
}
|
|
6362
6503
|
}, []);
|
|
6363
|
-
const releasePinFromReader = useCallback2(
|
|
6364
|
-
(
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
olderPrefetchArmedRef.current = true;
|
|
6380
|
-
setOlderPrefetchArmed(true);
|
|
6381
|
-
}
|
|
6382
|
-
},
|
|
6383
|
-
[autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]
|
|
6384
|
-
);
|
|
6504
|
+
const releasePinFromReader = useCallback2(() => {
|
|
6505
|
+
if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
|
|
6506
|
+
return;
|
|
6507
|
+
}
|
|
6508
|
+
clearReaderIntent();
|
|
6509
|
+
clearPendingReaderLeave();
|
|
6510
|
+
stopFollow();
|
|
6511
|
+
applyPinned(false);
|
|
6512
|
+
if (wantPinRef.current) {
|
|
6513
|
+
wantPinRef.current = false;
|
|
6514
|
+
}
|
|
6515
|
+
if (!olderPrefetchArmedRef.current) {
|
|
6516
|
+
olderPrefetchArmedRef.current = true;
|
|
6517
|
+
setOlderPrefetchArmed(true);
|
|
6518
|
+
}
|
|
6519
|
+
}, [autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]);
|
|
6385
6520
|
const releasePinAfterScrollSettled = useCallback2(
|
|
6386
6521
|
(node) => {
|
|
6387
6522
|
if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
|
|
@@ -6397,7 +6532,7 @@ function MessageTimeline({
|
|
|
6397
6532
|
clearPendingReaderLeave();
|
|
6398
6533
|
return;
|
|
6399
6534
|
}
|
|
6400
|
-
releasePinFromReader(
|
|
6535
|
+
releasePinFromReader();
|
|
6401
6536
|
rearmOlderPrefetchAfterLeavingTop(node);
|
|
6402
6537
|
},
|
|
6403
6538
|
[autoFollow, clearPendingReaderLeave, rearmOlderPrefetchAfterLeavingTop, releasePinFromReader]
|
|
@@ -6415,6 +6550,16 @@ function MessageTimeline({
|
|
|
6415
6550
|
}
|
|
6416
6551
|
});
|
|
6417
6552
|
}, [cancelLeaveFallback, releasePinAfterScrollSettled]);
|
|
6553
|
+
const requestEarlierFromReader = () => {
|
|
6554
|
+
releasePinFromReader();
|
|
6555
|
+
wantPinRef.current = false;
|
|
6556
|
+
olderPageBudgetRef.current = 8;
|
|
6557
|
+
if (olderLoadAttemptRef.current?.[1] === 2) {
|
|
6558
|
+
olderLoadAttemptRef.current = null;
|
|
6559
|
+
setOlderDemand((value) => value + 1);
|
|
6560
|
+
}
|
|
6561
|
+
};
|
|
6562
|
+
const touchPositionRef = useRef10(null);
|
|
6418
6563
|
const onWheel = (event) => {
|
|
6419
6564
|
if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) {
|
|
6420
6565
|
return;
|
|
@@ -6423,11 +6568,11 @@ function MessageTimeline({
|
|
|
6423
6568
|
return;
|
|
6424
6569
|
}
|
|
6425
6570
|
disclosureKeepsUnpinnedRef.current = false;
|
|
6571
|
+
programmaticScrollRef.current = 0;
|
|
6426
6572
|
if (event.deltaY >= 0) {
|
|
6427
6573
|
return;
|
|
6428
6574
|
}
|
|
6429
|
-
|
|
6430
|
-
releasePinFromReader(node);
|
|
6575
|
+
requestEarlierFromReader();
|
|
6431
6576
|
};
|
|
6432
6577
|
const onPointerDown = (event) => {
|
|
6433
6578
|
if (event.button && event.pointerType === "mouse") {
|
|
@@ -6448,8 +6593,8 @@ function MessageTimeline({
|
|
|
6448
6593
|
if (event.key !== "ArrowUp" && event.key !== "PageUp" && event.key !== "Home") {
|
|
6449
6594
|
return;
|
|
6450
6595
|
}
|
|
6451
|
-
|
|
6452
|
-
|
|
6596
|
+
programmaticScrollRef.current = 0;
|
|
6597
|
+
requestEarlierFromReader();
|
|
6453
6598
|
};
|
|
6454
6599
|
const snapToBottom = useCallback2(
|
|
6455
6600
|
(node) => {
|
|
@@ -6697,10 +6842,21 @@ function MessageTimeline({
|
|
|
6697
6842
|
const previousMaxScroll = lastMaxScrollRef.current;
|
|
6698
6843
|
const wasAtLiveTailBeforeCommit = previousMaxScroll <= 1 || previousMaxScroll - previousScrollTop < Math.min(PIN_THRESHOLD_PX, previousMaxScroll);
|
|
6699
6844
|
const firstItemChanged = !!previousFirstItemId && firstItemId !== previousFirstItemId;
|
|
6700
|
-
const
|
|
6845
|
+
const sourceChanged = olderBoundaryKey !== previousSourceBoundaryRef.current;
|
|
6846
|
+
const retainedSource = sourceItems?.some((item) => previousSourceIdsRef.current.has(item.id)) ?? false;
|
|
6847
|
+
const prepended = sourceChanged && retainedSource;
|
|
6848
|
+
previousSourceBoundaryRef.current = olderBoundaryKey;
|
|
6849
|
+
previousSourceIdsRef.current = new Set(sourceItems?.map((item) => item.id));
|
|
6850
|
+
const readingAnchor = readingAnchorRef.current;
|
|
6851
|
+
readingAnchorRef.current = null;
|
|
6701
6852
|
const attempt = olderLoadAttemptRef.current;
|
|
6702
|
-
const committedZeroOverlapOlderReplacement = !!(attempt?.[2]?.committed &&
|
|
6853
|
+
const committedZeroOverlapOlderReplacement = !!(attempt?.[2]?.committed && sourceChanged && !retainedSource);
|
|
6703
6854
|
const restorePrependAnchor = () => {
|
|
6855
|
+
const correction = readingAnchor && timelineAnchorCorrection(node, readingAnchor);
|
|
6856
|
+
if (correction != null) {
|
|
6857
|
+
if (Math.abs(correction) > 1) writeScrollTop(node, node.scrollTop + correction);
|
|
6858
|
+
return;
|
|
6859
|
+
}
|
|
6704
6860
|
let delta = null;
|
|
6705
6861
|
if (previousFirstItemId && previousItemContentTop != null) {
|
|
6706
6862
|
const itemEl = node.querySelector(
|
|
@@ -6806,6 +6962,11 @@ function MessageTimeline({
|
|
|
6806
6962
|
return;
|
|
6807
6963
|
}
|
|
6808
6964
|
olderLoadAttemptRef.current = [olderBoundaryKey, 2];
|
|
6965
|
+
if (attempt[2]?.committed && !pinnedRef.current && hasOlder && node.scrollTop <= OLDER_PREFETCH_MARGIN_PX && olderPageBudgetRef.current > 0) {
|
|
6966
|
+
olderPageBudgetRef.current -= 1;
|
|
6967
|
+
olderLoadAttemptRef.current = null;
|
|
6968
|
+
setOlderDemand((value) => value + 1);
|
|
6969
|
+
}
|
|
6809
6970
|
rearmOlderPrefetchAfterLeavingTop(node);
|
|
6810
6971
|
requestOlderIfUnderfilled(node);
|
|
6811
6972
|
});
|
|
@@ -6935,6 +7096,7 @@ function MessageTimeline({
|
|
|
6935
7096
|
loadingOlder,
|
|
6936
7097
|
olderBoundaryKey,
|
|
6937
7098
|
olderPrefetchArmed,
|
|
7099
|
+
olderDemand,
|
|
6938
7100
|
onLoadOlder,
|
|
6939
7101
|
requestOlderIfUnderfilled
|
|
6940
7102
|
]);
|
|
@@ -7072,7 +7234,7 @@ function MessageTimeline({
|
|
|
7072
7234
|
}
|
|
7073
7235
|
if (readerArmed && cumulativeReaderUp > TIP_FOLLOW_READER_UP_EPS_PX && !nearBottomPinned) {
|
|
7074
7236
|
clearReaderIntent();
|
|
7075
|
-
|
|
7237
|
+
requestEarlierFromReader();
|
|
7076
7238
|
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7077
7239
|
return;
|
|
7078
7240
|
}
|
|
@@ -7087,10 +7249,13 @@ function MessageTimeline({
|
|
|
7087
7249
|
return;
|
|
7088
7250
|
}
|
|
7089
7251
|
syncScrollBaseline(node);
|
|
7252
|
+
if (programmatic) {
|
|
7253
|
+
return;
|
|
7254
|
+
}
|
|
7090
7255
|
const nearBottom = isNearBottom(node);
|
|
7091
7256
|
const inserted = Math.max(0, nextMaxScroll - previousMaxScroll);
|
|
7092
7257
|
const towardTip = nextTop - previousTop - inserted;
|
|
7093
|
-
const nextPinned = !hasNewer && nearBottom && towardTip
|
|
7258
|
+
const nextPinned = !hasNewer && nearBottom && towardTip > 0.5 && inserted <= 1;
|
|
7094
7259
|
if (!nextPinned) {
|
|
7095
7260
|
stopFollow();
|
|
7096
7261
|
}
|
|
@@ -7127,8 +7292,8 @@ function MessageTimeline({
|
|
|
7127
7292
|
}
|
|
7128
7293
|
releasePinAfterScrollSettled(node);
|
|
7129
7294
|
};
|
|
7130
|
-
return /* @__PURE__ */
|
|
7131
|
-
onAnnotate ? /* @__PURE__ */
|
|
7295
|
+
return /* @__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__ */ jsxs11("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
|
|
7296
|
+
onAnnotate ? /* @__PURE__ */ jsx17(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx17(
|
|
7132
7297
|
TimelineAnnotationSelection,
|
|
7133
7298
|
{
|
|
7134
7299
|
rootRef: scrollRef,
|
|
@@ -7136,7 +7301,7 @@ function MessageTimeline({
|
|
|
7136
7301
|
onAnnotate
|
|
7137
7302
|
}
|
|
7138
7303
|
) }) : null,
|
|
7139
|
-
/* @__PURE__ */
|
|
7304
|
+
/* @__PURE__ */ jsx17(
|
|
7140
7305
|
"div",
|
|
7141
7306
|
{
|
|
7142
7307
|
ref: scrollRef,
|
|
@@ -7146,119 +7311,164 @@ function MessageTimeline({
|
|
|
7146
7311
|
onScroll,
|
|
7147
7312
|
onScrollEnd,
|
|
7148
7313
|
onWheel,
|
|
7314
|
+
onTouchStart: (event) => {
|
|
7315
|
+
const touch = event.touches.length === 1 ? event.touches[0] : void 0;
|
|
7316
|
+
touchPositionRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
|
|
7317
|
+
},
|
|
7318
|
+
onTouchMove: (event) => {
|
|
7319
|
+
const touch = event.touches[0];
|
|
7320
|
+
const previous = touchPositionRef.current;
|
|
7321
|
+
if (!touch || !previous || event.touches.length !== 1) {
|
|
7322
|
+
touchPositionRef.current = null;
|
|
7323
|
+
return;
|
|
7324
|
+
}
|
|
7325
|
+
const deltaX = previous.x - touch.clientX;
|
|
7326
|
+
const deltaY = previous.y - touch.clientY;
|
|
7327
|
+
if (Math.max(Math.abs(deltaX), Math.abs(deltaY)) < 4) return;
|
|
7328
|
+
touchPositionRef.current = { x: touch.clientX, y: touch.clientY };
|
|
7329
|
+
onWheel({
|
|
7330
|
+
deltaX,
|
|
7331
|
+
deltaY,
|
|
7332
|
+
target: event.target,
|
|
7333
|
+
currentTarget: event.currentTarget
|
|
7334
|
+
});
|
|
7335
|
+
},
|
|
7336
|
+
onTouchEnd: () => {
|
|
7337
|
+
touchPositionRef.current = null;
|
|
7338
|
+
},
|
|
7339
|
+
onTouchCancel: () => {
|
|
7340
|
+
touchPositionRef.current = null;
|
|
7341
|
+
},
|
|
7342
|
+
onClickCapture: (event) => {
|
|
7343
|
+
const target = event.target instanceof Element ? event.target.closest("button[aria-expanded]") : null;
|
|
7344
|
+
if (target) {
|
|
7345
|
+
releasePinFromReader();
|
|
7346
|
+
disclosureKeepsUnpinnedRef.current = true;
|
|
7347
|
+
}
|
|
7348
|
+
},
|
|
7149
7349
|
onPointerDown,
|
|
7150
7350
|
onKeyDown,
|
|
7151
7351
|
style: groups.length > 0 && !revealed ? { visibility: "hidden" } : void 0,
|
|
7152
7352
|
className: cn(
|
|
7153
7353
|
// tabIndex=-1 is programmatic only — never paint a focus ring on
|
|
7154
7354
|
// the whole scroller (click + Shift used to flash a blue outline).
|
|
7155
|
-
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4
|
|
7355
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-16 pb-6 sm:px-6 outline-hidden",
|
|
7156
7356
|
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
7157
7357
|
),
|
|
7158
|
-
children: /* @__PURE__ */
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
{
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7358
|
+
children: /* @__PURE__ */ jsx17(
|
|
7359
|
+
TimelineBeforeLayout,
|
|
7360
|
+
{
|
|
7361
|
+
capture: () => {
|
|
7362
|
+
readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
|
|
7363
|
+
},
|
|
7364
|
+
children: /* @__PURE__ */ jsxs11("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
7365
|
+
/* @__PURE__ */ jsx17(AnimatePresence, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
|
|
7366
|
+
// Reserved top gutter: controls scroll with history and cannot
|
|
7367
|
+
// cover a disclosure. Visibility never changes content height.
|
|
7368
|
+
/* @__PURE__ */ jsxs11(
|
|
7369
|
+
motion.div,
|
|
7370
|
+
{
|
|
7371
|
+
initial: { opacity: 0, y: -6 },
|
|
7372
|
+
animate: { opacity: 1, y: 0 },
|
|
7373
|
+
exit: { opacity: 0, y: -6 },
|
|
7374
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
7375
|
+
"data-og-loading-older": "",
|
|
7376
|
+
"aria-live": "polite",
|
|
7377
|
+
className: "pointer-events-none absolute inset-x-0 -top-11 z-10 flex justify-center",
|
|
7378
|
+
children: [
|
|
7379
|
+
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,
|
|
7380
|
+
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx17(
|
|
7381
|
+
"button",
|
|
7382
|
+
{
|
|
7383
|
+
type: "button",
|
|
7384
|
+
"data-og-retry": underfillRetryReady || void 0,
|
|
7385
|
+
"data-og-jump-to-start": !underfillRetryReady || void 0,
|
|
7386
|
+
onClick: () => {
|
|
7387
|
+
const node = scrollRef.current;
|
|
7388
|
+
if (underfillRetryReady) {
|
|
7389
|
+
if (node && underfillRetryReadyRef.current) {
|
|
7390
|
+
requestOlderIfUnderfilled(node, underfillSettledAttempt);
|
|
7391
|
+
}
|
|
7392
|
+
return;
|
|
7393
|
+
}
|
|
7394
|
+
applyPinned(false);
|
|
7395
|
+
pendingJumpToStartRef.current = true;
|
|
7396
|
+
const seq = ++jumpToStartSeqRef.current;
|
|
7397
|
+
void Promise.resolve(onJumpToStart()).then(
|
|
7398
|
+
() => {
|
|
7399
|
+
const scroller = scrollRef.current ?? node;
|
|
7400
|
+
if (scroller) {
|
|
7401
|
+
scroller.scrollTop = 0;
|
|
7402
|
+
}
|
|
7403
|
+
requestFrame(() => {
|
|
7404
|
+
if (jumpToStartSeqRef.current === seq) {
|
|
7405
|
+
pendingJumpToStartRef.current = false;
|
|
7406
|
+
}
|
|
7407
|
+
});
|
|
7408
|
+
},
|
|
7409
|
+
() => {
|
|
7410
|
+
if (jumpToStartSeqRef.current === seq) {
|
|
7411
|
+
pendingJumpToStartRef.current = false;
|
|
7412
|
+
}
|
|
7413
|
+
}
|
|
7414
|
+
);
|
|
7415
|
+
},
|
|
7416
|
+
className: "pointer-events-auto rounded-full border border-og-border px-3 py-1.5 text-og-control",
|
|
7417
|
+
children: underfillRetryReady ? "Retry earlier activity" : "Jump to start"
|
|
7418
|
+
}
|
|
7419
|
+
) : null
|
|
7420
|
+
]
|
|
7421
|
+
}
|
|
7422
|
+
)
|
|
7423
|
+
) : null }),
|
|
7424
|
+
!groups.length ? emptyState ?? /* @__PURE__ */ jsx17("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
7425
|
+
hasOlder && olderPrefetchArmed ? (
|
|
7426
|
+
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
7427
|
+
// must never shift content (that shift was itself a wobble).
|
|
7428
|
+
// End at the scroll origin above the pt-16 gutter so the
|
|
7429
|
+
// observer and scrollTop cooldown share the same 400px band.
|
|
7430
|
+
/* @__PURE__ */ jsx17(
|
|
7431
|
+
"div",
|
|
7432
|
+
{
|
|
7433
|
+
ref: topSentinelRef,
|
|
7434
|
+
"data-og-top-sentinel": "",
|
|
7435
|
+
"data-og-timeline-chrome": "",
|
|
7436
|
+
"aria-hidden": "true",
|
|
7437
|
+
className: "pointer-events-none absolute inset-x-0 -top-16 h-px -translate-y-full"
|
|
7438
|
+
}
|
|
7439
|
+
)
|
|
7440
|
+
) : null,
|
|
7441
|
+
groups.map(({ group, key, entranceEnabled }, index) => {
|
|
7442
|
+
return /* @__PURE__ */ jsx17(
|
|
7443
|
+
TimelineGroupEntry,
|
|
7444
|
+
{
|
|
7445
|
+
groupKey: key,
|
|
7446
|
+
group,
|
|
7447
|
+
nextGroup: groups[index + 1]?.group,
|
|
7448
|
+
entranceEnabled,
|
|
7449
|
+
liveEntranceEnabled: group.kind === "activity" ? !bulkRender : void 0,
|
|
7450
|
+
context: timelineGroupEntryContext
|
|
7451
|
+
},
|
|
7452
|
+
key
|
|
7453
|
+
);
|
|
7454
|
+
}),
|
|
7455
|
+
groups.length > 0 && trailingState ? /* @__PURE__ */ jsx17("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
|
|
7456
|
+
hasNewer ? /* @__PURE__ */ jsx17(
|
|
7457
|
+
"div",
|
|
7458
|
+
{
|
|
7459
|
+
ref: bottomSentinelRef,
|
|
7460
|
+
"data-og-bottom-sentinel": "",
|
|
7461
|
+
"data-og-timeline-chrome": "",
|
|
7462
|
+
"aria-hidden": "true",
|
|
7463
|
+
className: "h-px w-full"
|
|
7464
|
+
}
|
|
7465
|
+
) : null
|
|
7466
|
+
] })
|
|
7467
|
+
}
|
|
7468
|
+
)
|
|
7200
7469
|
}
|
|
7201
7470
|
),
|
|
7202
|
-
/* @__PURE__ */
|
|
7203
|
-
// Floating over the scroller (not a timeline row) so showing and
|
|
7204
|
-
// hiding it never reflows history under the reader.
|
|
7205
|
-
/* @__PURE__ */ jsxs11(
|
|
7206
|
-
motion.div,
|
|
7207
|
-
{
|
|
7208
|
-
initial: { opacity: 0, y: -6 },
|
|
7209
|
-
animate: { opacity: 1, y: 0 },
|
|
7210
|
-
exit: { opacity: 0, y: -6 },
|
|
7211
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
7212
|
-
"data-og-loading-older": "",
|
|
7213
|
-
"aria-live": "polite",
|
|
7214
|
-
className: "absolute inset-x-0 top-3 z-10 flex justify-center",
|
|
7215
|
-
children: [
|
|
7216
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx16("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx16("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
7217
|
-
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx16(
|
|
7218
|
-
"button",
|
|
7219
|
-
{
|
|
7220
|
-
type: "button",
|
|
7221
|
-
"data-og-retry": underfillRetryReady || void 0,
|
|
7222
|
-
"data-og-jump-to-start": !underfillRetryReady || void 0,
|
|
7223
|
-
onClick: () => {
|
|
7224
|
-
const node = scrollRef.current;
|
|
7225
|
-
if (underfillRetryReady) {
|
|
7226
|
-
if (node && underfillRetryReadyRef.current) {
|
|
7227
|
-
requestOlderIfUnderfilled(node, underfillSettledAttempt);
|
|
7228
|
-
}
|
|
7229
|
-
return;
|
|
7230
|
-
}
|
|
7231
|
-
applyPinned(false);
|
|
7232
|
-
pendingJumpToStartRef.current = true;
|
|
7233
|
-
const seq = ++jumpToStartSeqRef.current;
|
|
7234
|
-
void Promise.resolve(onJumpToStart()).then(
|
|
7235
|
-
() => {
|
|
7236
|
-
const scroller = scrollRef.current ?? node;
|
|
7237
|
-
if (scroller) {
|
|
7238
|
-
scroller.scrollTop = 0;
|
|
7239
|
-
}
|
|
7240
|
-
requestFrame(() => {
|
|
7241
|
-
if (jumpToStartSeqRef.current === seq) {
|
|
7242
|
-
pendingJumpToStartRef.current = false;
|
|
7243
|
-
}
|
|
7244
|
-
});
|
|
7245
|
-
},
|
|
7246
|
-
() => {
|
|
7247
|
-
if (jumpToStartSeqRef.current === seq) {
|
|
7248
|
-
pendingJumpToStartRef.current = false;
|
|
7249
|
-
}
|
|
7250
|
-
}
|
|
7251
|
-
);
|
|
7252
|
-
},
|
|
7253
|
-
className: "rounded-full border border-og-border px-3 py-1.5 text-og-control",
|
|
7254
|
-
children: underfillRetryReady ? "Retry earlier activity" : "Jump to start"
|
|
7255
|
-
}
|
|
7256
|
-
) : null
|
|
7257
|
-
]
|
|
7258
|
-
}
|
|
7259
|
-
)
|
|
7260
|
-
) : null }),
|
|
7261
|
-
/* @__PURE__ */ jsx16(AnimatePresence, { children: loadingNewer ? /* @__PURE__ */ jsx16(
|
|
7471
|
+
/* @__PURE__ */ jsx17(AnimatePresence, { children: loadingNewer ? /* @__PURE__ */ jsx17(
|
|
7262
7472
|
motion.div,
|
|
7263
7473
|
{
|
|
7264
7474
|
initial: { opacity: 0, y: 6 },
|
|
@@ -7268,10 +7478,10 @@ function MessageTimeline({
|
|
|
7268
7478
|
"data-og-loading-newer": "",
|
|
7269
7479
|
"aria-live": "polite",
|
|
7270
7480
|
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
7271
|
-
children: /* @__PURE__ */
|
|
7481
|
+
children: /* @__PURE__ */ jsx17("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx17("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
7272
7482
|
}
|
|
7273
7483
|
) : null }),
|
|
7274
|
-
/* @__PURE__ */
|
|
7484
|
+
/* @__PURE__ */ jsx17(AnimatePresence, { children: (!pinned && autoFollow || hasNewer || canSkipTipCatchup) && autoFollow ? /* @__PURE__ */ jsxs11(
|
|
7275
7485
|
motion.button,
|
|
7276
7486
|
{
|
|
7277
7487
|
type: "button",
|
|
@@ -7317,7 +7527,7 @@ function MessageTimeline({
|
|
|
7317
7527
|
"hover:border-og-border-strong"
|
|
7318
7528
|
),
|
|
7319
7529
|
children: [
|
|
7320
|
-
/* @__PURE__ */
|
|
7530
|
+
/* @__PURE__ */ jsx17(ArrowDownIcon, { className: "size-3.5" }),
|
|
7321
7531
|
"Jump to latest"
|
|
7322
7532
|
]
|
|
7323
7533
|
}
|
|
@@ -7387,7 +7597,7 @@ function cancelFrame(id) {
|
|
|
7387
7597
|
function timelineRenderResetKeysChanged(previous, next) {
|
|
7388
7598
|
return previous.length !== next.length || previous.some((key, index) => !Object.is(key, next[index]));
|
|
7389
7599
|
}
|
|
7390
|
-
var TimelineGroupRenderBoundary = class extends
|
|
7600
|
+
var TimelineGroupRenderBoundary = class extends Component3 {
|
|
7391
7601
|
state = {
|
|
7392
7602
|
failed: false,
|
|
7393
7603
|
resetKeys: this.props.resetKeys
|
|
@@ -7410,10 +7620,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
|
|
|
7410
7620
|
role: "status",
|
|
7411
7621
|
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",
|
|
7412
7622
|
children: [
|
|
7413
|
-
/* @__PURE__ */
|
|
7623
|
+
/* @__PURE__ */ jsx17(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
7414
7624
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
7415
|
-
/* @__PURE__ */
|
|
7416
|
-
/* @__PURE__ */
|
|
7625
|
+
/* @__PURE__ */ jsx17("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
|
|
7626
|
+
/* @__PURE__ */ jsx17("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
|
|
7417
7627
|
] })
|
|
7418
7628
|
]
|
|
7419
7629
|
}
|
|
@@ -7432,7 +7642,7 @@ var TimelineGroupEntry = memo2(function TimelineGroupEntry2({
|
|
|
7432
7642
|
}) {
|
|
7433
7643
|
const { behavior, userMessageDisclosureContext } = context;
|
|
7434
7644
|
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;
|
|
7435
|
-
return /* @__PURE__ */
|
|
7645
|
+
return /* @__PURE__ */ jsx17("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": groupKey, children: /* @__PURE__ */ jsx17(EntranceAnimationProvider, { value: entranceEnabled, liveValue: liveEntranceEnabled, children: /* @__PURE__ */ jsx17(TimelineGroupRenderBoundary, { resetKeys: [group, behavior], children: /* @__PURE__ */ jsx17(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx17(
|
|
7436
7646
|
TimelineGroupView,
|
|
7437
7647
|
{
|
|
7438
7648
|
...behavior,
|
|
@@ -7481,7 +7691,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7481
7691
|
if (insideTurn) {
|
|
7482
7692
|
const useNestedChip = nestClusterChips && activityShouldFold && !containsGeneratedImage;
|
|
7483
7693
|
if (!useNestedChip) {
|
|
7484
|
-
return /* @__PURE__ */
|
|
7694
|
+
return /* @__PURE__ */ jsx17(
|
|
7485
7695
|
ActivityRail,
|
|
7486
7696
|
{
|
|
7487
7697
|
items: group.items,
|
|
@@ -7494,7 +7704,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7494
7704
|
}
|
|
7495
7705
|
);
|
|
7496
7706
|
}
|
|
7497
|
-
return /* @__PURE__ */
|
|
7707
|
+
return /* @__PURE__ */ jsx17(
|
|
7498
7708
|
TurnSummary,
|
|
7499
7709
|
{
|
|
7500
7710
|
items: group.items,
|
|
@@ -7505,7 +7715,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7505
7715
|
foldKey: group.id,
|
|
7506
7716
|
facets: turnSummary?.facets,
|
|
7507
7717
|
contextCompactionCount,
|
|
7508
|
-
children: /* @__PURE__ */
|
|
7718
|
+
children: /* @__PURE__ */ jsx17(
|
|
7509
7719
|
ActivityRail,
|
|
7510
7720
|
{
|
|
7511
7721
|
items: group.items,
|
|
@@ -7521,7 +7731,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7521
7731
|
settleChrome ? "settle" : "rest"
|
|
7522
7732
|
);
|
|
7523
7733
|
}
|
|
7524
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ jsx17(
|
|
7525
7735
|
TurnSummary,
|
|
7526
7736
|
{
|
|
7527
7737
|
items: group.items,
|
|
@@ -7532,7 +7742,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7532
7742
|
facets: turnSummary?.facets,
|
|
7533
7743
|
settleFold,
|
|
7534
7744
|
contextCompactionCount,
|
|
7535
|
-
children: /* @__PURE__ */
|
|
7745
|
+
children: /* @__PURE__ */ jsx17(FoldBody, { children: /* @__PURE__ */ jsx17(TurnRailFrame, { children: /* @__PURE__ */ jsx17(
|
|
7536
7746
|
ActivityRail,
|
|
7537
7747
|
{
|
|
7538
7748
|
items: group.items,
|
|
@@ -7552,7 +7762,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7552
7762
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
7553
7763
|
const body = group.groups.map((child) => {
|
|
7554
7764
|
const key = timelineGroupKey(child);
|
|
7555
|
-
return /* @__PURE__ */
|
|
7765
|
+
return /* @__PURE__ */ jsx17(
|
|
7556
7766
|
TimelineGroupRenderBoundary,
|
|
7557
7767
|
{
|
|
7558
7768
|
resetKeys: [
|
|
@@ -7568,7 +7778,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7568
7778
|
loadVideoArtifactPlayback,
|
|
7569
7779
|
turnSummary
|
|
7570
7780
|
],
|
|
7571
|
-
children: /* @__PURE__ */
|
|
7781
|
+
children: /* @__PURE__ */ jsx17(
|
|
7572
7782
|
TimelineGroupView2,
|
|
7573
7783
|
{
|
|
7574
7784
|
group: child,
|
|
@@ -7590,7 +7800,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7590
7800
|
key
|
|
7591
7801
|
);
|
|
7592
7802
|
});
|
|
7593
|
-
return /* @__PURE__ */
|
|
7803
|
+
return /* @__PURE__ */ jsx17(
|
|
7594
7804
|
TurnSummary,
|
|
7595
7805
|
{
|
|
7596
7806
|
items: activityItems,
|
|
@@ -7604,16 +7814,16 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7604
7814
|
settleFold,
|
|
7605
7815
|
copyText: insideTurn ? void 0 : turnCopyText,
|
|
7606
7816
|
contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
|
|
7607
|
-
children: /* @__PURE__ */
|
|
7817
|
+
children: /* @__PURE__ */ jsx17(FoldBody, { children: insideTurn ? (
|
|
7608
7818
|
// A nested turn is already on an ancestor rail — its body just stacks
|
|
7609
7819
|
// flush (the bare-node body already indents it), so no second rule.
|
|
7610
|
-
/* @__PURE__ */
|
|
7611
|
-
) : /* @__PURE__ */
|
|
7820
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4", children: body })
|
|
7821
|
+
) : /* @__PURE__ */ jsx17(TurnRailFrame, { children: body }) })
|
|
7612
7822
|
}
|
|
7613
7823
|
);
|
|
7614
7824
|
}
|
|
7615
7825
|
case "item":
|
|
7616
|
-
return /* @__PURE__ */
|
|
7826
|
+
return /* @__PURE__ */ jsx17(
|
|
7617
7827
|
TimelineRow,
|
|
7618
7828
|
{
|
|
7619
7829
|
item: group.item,
|
|
@@ -7627,10 +7837,10 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7627
7837
|
}
|
|
7628
7838
|
});
|
|
7629
7839
|
function FoldBody({ children }) {
|
|
7630
|
-
return /* @__PURE__ */
|
|
7840
|
+
return /* @__PURE__ */ jsx17(Fragment5, { children });
|
|
7631
7841
|
}
|
|
7632
7842
|
function TurnRailFrame({ children }) {
|
|
7633
|
-
return /* @__PURE__ */
|
|
7843
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
|
|
7634
7844
|
}
|
|
7635
7845
|
function useLiveSettleFold(folded) {
|
|
7636
7846
|
const previousFoldedRef = useRef10(folded);
|
|
@@ -7805,25 +8015,32 @@ function TimelineRow({
|
|
|
7805
8015
|
}) {
|
|
7806
8016
|
switch (item.kind) {
|
|
7807
8017
|
case "user-message":
|
|
7808
|
-
return /* @__PURE__ */
|
|
8018
|
+
return /* @__PURE__ */ jsx17(UserMessageRow, { item, renderMessageText });
|
|
7809
8019
|
case "human-input":
|
|
7810
|
-
return /* @__PURE__ */
|
|
8020
|
+
return /* @__PURE__ */ jsx17(HumanInputConversationRow, { item });
|
|
7811
8021
|
case "agent-message":
|
|
7812
|
-
return /* @__PURE__ */
|
|
8022
|
+
return /* @__PURE__ */ jsx17(AgentMessageRow, { item, renderMessageText });
|
|
7813
8023
|
case "worker-completion":
|
|
7814
|
-
return /* @__PURE__ */
|
|
8024
|
+
return /* @__PURE__ */ jsx17(WorkerCompletionRow, { item, onOpenSession });
|
|
7815
8025
|
case "session-status":
|
|
7816
|
-
return /* @__PURE__ */
|
|
8026
|
+
return /* @__PURE__ */ jsx17(SessionStatusRow, { item });
|
|
7817
8027
|
case "goal":
|
|
7818
|
-
return /* @__PURE__ */
|
|
8028
|
+
return /* @__PURE__ */ jsx17(GoalRow, { item });
|
|
7819
8029
|
case "machine-input-batch":
|
|
7820
|
-
return /* @__PURE__ */
|
|
8030
|
+
return /* @__PURE__ */ jsx17(
|
|
8031
|
+
MachineInputBatchRow,
|
|
8032
|
+
{
|
|
8033
|
+
item,
|
|
8034
|
+
onOpenSession,
|
|
8035
|
+
loadVideoArtifactPlayback
|
|
8036
|
+
}
|
|
8037
|
+
);
|
|
7821
8038
|
case "notice":
|
|
7822
|
-
return /* @__PURE__ */
|
|
8039
|
+
return /* @__PURE__ */ jsx17(NoticeRow, { item });
|
|
7823
8040
|
case "context-compaction":
|
|
7824
|
-
return /* @__PURE__ */
|
|
8041
|
+
return /* @__PURE__ */ jsx17(CompactionRow, { item });
|
|
7825
8042
|
case "auth-needed":
|
|
7826
|
-
return /* @__PURE__ */
|
|
8043
|
+
return /* @__PURE__ */ jsx17(
|
|
7827
8044
|
AuthNeededRow,
|
|
7828
8045
|
{
|
|
7829
8046
|
item,
|
|
@@ -7848,8 +8065,8 @@ function CompactionRow({ item }) {
|
|
|
7848
8065
|
const after = item.estimatedTokensAfter != null ? Math.round(item.estimatedTokensAfter).toLocaleString("en-US") : null;
|
|
7849
8066
|
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";
|
|
7850
8067
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
|
|
7851
|
-
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 :
|
|
7852
|
-
return /* @__PURE__ */
|
|
8068
|
+
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;
|
|
8069
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs11(
|
|
7853
8070
|
"div",
|
|
7854
8071
|
{
|
|
7855
8072
|
className: cn(
|
|
@@ -7859,13 +8076,13 @@ function CompactionRow({ item }) {
|
|
|
7859
8076
|
role: "status",
|
|
7860
8077
|
children: [
|
|
7861
8078
|
/* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
7862
|
-
/* @__PURE__ */
|
|
8079
|
+
/* @__PURE__ */ jsx17(ShrinkIcon, { className: "size-3.5 shrink-0" }),
|
|
7863
8080
|
/* @__PURE__ */ jsxs11("span", { className: "truncate", children: [
|
|
7864
8081
|
title,
|
|
7865
8082
|
trigger ? ` \xB7 ${trigger}` : ""
|
|
7866
8083
|
] })
|
|
7867
8084
|
] }),
|
|
7868
|
-
subtitle ? /* @__PURE__ */
|
|
8085
|
+
subtitle ? /* @__PURE__ */ jsx17("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
|
|
7869
8086
|
]
|
|
7870
8087
|
}
|
|
7871
8088
|
) });
|
|
@@ -7885,7 +8102,7 @@ function compactionSkipSubtitle(reason) {
|
|
|
7885
8102
|
}
|
|
7886
8103
|
}
|
|
7887
8104
|
function MessageFooterTime({ occurredAt }) {
|
|
7888
|
-
return /* @__PURE__ */
|
|
8105
|
+
return /* @__PURE__ */ jsx17(
|
|
7889
8106
|
"time",
|
|
7890
8107
|
{
|
|
7891
8108
|
dateTime: occurredAt,
|
|
@@ -7904,18 +8121,18 @@ function UserMessageRow({
|
|
|
7904
8121
|
}) {
|
|
7905
8122
|
const enter = useEntranceAnimation();
|
|
7906
8123
|
const deliveryFailed = item.delivery?.state === "failed";
|
|
7907
|
-
return /* @__PURE__ */
|
|
7908
|
-
/* @__PURE__ */
|
|
8124
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs11("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
|
|
8125
|
+
/* @__PURE__ */ jsx17(
|
|
7909
8126
|
CopyHoverFrame,
|
|
7910
8127
|
{
|
|
7911
8128
|
copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
|
|
7912
8129
|
${annotation.note}`).join("\n\n"),
|
|
7913
8130
|
label: "Copy message",
|
|
7914
8131
|
className: "w-fit max-w-full min-w-0",
|
|
7915
|
-
trailing: /* @__PURE__ */
|
|
8132
|
+
trailing: /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
7916
8133
|
children: /* @__PURE__ */ jsxs11("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
7917
|
-
item.text ? /* @__PURE__ */
|
|
7918
|
-
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
8134
|
+
item.text ? /* @__PURE__ */ jsx17("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx17(Markdown, { children: item.text }) }) }) : null,
|
|
8135
|
+
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx17(
|
|
7919
8136
|
TimelineAnnotationsChip,
|
|
7920
8137
|
{
|
|
7921
8138
|
annotations: item.annotations ?? [],
|
|
@@ -7932,10 +8149,10 @@ ${annotation.note}`).join("\n\n"),
|
|
|
7932
8149
|
className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-status-failed",
|
|
7933
8150
|
children: [
|
|
7934
8151
|
/* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1", title: item.delivery?.error, children: [
|
|
7935
|
-
/* @__PURE__ */
|
|
7936
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ jsx17(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
8153
|
+
/* @__PURE__ */ jsx17("span", { children: "Message not sent" })
|
|
7937
8154
|
] }),
|
|
7938
|
-
item.delivery?.onRetry ? /* @__PURE__ */
|
|
8155
|
+
item.delivery?.onRetry ? /* @__PURE__ */ jsx17(
|
|
7939
8156
|
"button",
|
|
7940
8157
|
{
|
|
7941
8158
|
type: "button",
|
|
@@ -7944,7 +8161,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
7944
8161
|
children: "Retry"
|
|
7945
8162
|
}
|
|
7946
8163
|
) : null,
|
|
7947
|
-
item.delivery?.onRemove ? /* @__PURE__ */
|
|
8164
|
+
item.delivery?.onRemove ? /* @__PURE__ */ jsx17(
|
|
7948
8165
|
"button",
|
|
7949
8166
|
{
|
|
7950
8167
|
type: "button",
|
|
@@ -7973,10 +8190,10 @@ function HumanInputConversationRow({ item }) {
|
|
|
7973
8190
|
"data-human-input-history": item.requestId,
|
|
7974
8191
|
children: [
|
|
7975
8192
|
/* @__PURE__ */ jsxs11("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: [
|
|
7976
|
-
/* @__PURE__ */
|
|
8193
|
+
/* @__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" }) }),
|
|
7977
8194
|
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
7978
|
-
/* @__PURE__ */
|
|
7979
|
-
/* @__PURE__ */
|
|
8195
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
|
|
8196
|
+
/* @__PURE__ */ jsx17("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs11("div", { children: [
|
|
7980
8197
|
question.label ? /* @__PURE__ */ jsxs11("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
7981
8198
|
multipleQuestions ? /* @__PURE__ */ jsxs11("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
7982
8199
|
index + 1,
|
|
@@ -8002,19 +8219,19 @@ function HumanInputConversationRow({ item }) {
|
|
|
8002
8219
|
]
|
|
8003
8220
|
}
|
|
8004
8221
|
)
|
|
8005
|
-
] }, question.id)) : /* @__PURE__ */
|
|
8222
|
+
] }, question.id)) : /* @__PURE__ */ jsx17("p", { className: "text-og-sm text-og-fg-muted", children: "The agent requested structured input." }) })
|
|
8006
8223
|
] })
|
|
8007
8224
|
] }),
|
|
8008
|
-
/* @__PURE__ */
|
|
8225
|
+
/* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(
|
|
8009
8226
|
CopyHoverFrame,
|
|
8010
8227
|
{
|
|
8011
8228
|
copyText,
|
|
8012
8229
|
label: "Copy answer",
|
|
8013
8230
|
className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
|
|
8014
|
-
trailing: /* @__PURE__ */
|
|
8231
|
+
trailing: /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8015
8232
|
children: /* @__PURE__ */ jsxs11("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
8016
|
-
/* @__PURE__ */
|
|
8017
|
-
item.response.outcome === "answered" ? /* @__PURE__ */
|
|
8233
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
|
|
8234
|
+
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__ */ jsxs11("div", { children: [
|
|
8018
8235
|
multipleQuestions ? /* @__PURE__ */ jsxs11("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
8019
8236
|
/* @__PURE__ */ jsxs11("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
8020
8237
|
questionNumberById.get(answer.questionId) ?? answerIndex + 1,
|
|
@@ -8023,8 +8240,8 @@ function HumanInputConversationRow({ item }) {
|
|
|
8023
8240
|
" ",
|
|
8024
8241
|
answer.label
|
|
8025
8242
|
] }) : null,
|
|
8026
|
-
/* @__PURE__ */
|
|
8027
|
-
] }, answer.questionId)) : /* @__PURE__ */
|
|
8243
|
+
/* @__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" }) })
|
|
8244
|
+
] }, answer.questionId)) : /* @__PURE__ */ jsx17("p", { children: "Answered" }) }) : null
|
|
8028
8245
|
] })
|
|
8029
8246
|
}
|
|
8030
8247
|
) })
|
|
@@ -8051,15 +8268,15 @@ function AgentMessageRow({
|
|
|
8051
8268
|
renderMessageText
|
|
8052
8269
|
}) {
|
|
8053
8270
|
const enter = useEntranceAnimation();
|
|
8054
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
8055
|
-
return /* @__PURE__ */
|
|
8271
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx17(Markdown, { streaming: item.streaming, children: item.text });
|
|
8272
|
+
return /* @__PURE__ */ jsx17("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: /* @__PURE__ */ jsx17(
|
|
8056
8273
|
CopyHoverFrame,
|
|
8057
8274
|
{
|
|
8058
8275
|
copyText: item.text,
|
|
8059
8276
|
label: "Copy message",
|
|
8060
8277
|
align: "start",
|
|
8061
8278
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
8062
|
-
trailing: item.streaming ? null : /* @__PURE__ */
|
|
8279
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsx17(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8063
8280
|
children: body
|
|
8064
8281
|
}
|
|
8065
8282
|
) });
|
|
@@ -8111,11 +8328,11 @@ function WorkerCompletionRow({
|
|
|
8111
8328
|
...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
|
|
8112
8329
|
];
|
|
8113
8330
|
const hasDetails = details.length > 0;
|
|
8114
|
-
return /* @__PURE__ */
|
|
8331
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs11("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
|
|
8115
8332
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-2.5", children: [
|
|
8116
|
-
/* @__PURE__ */
|
|
8117
|
-
/* @__PURE__ */
|
|
8118
|
-
/* @__PURE__ */
|
|
8333
|
+
/* @__PURE__ */ jsx17("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx17(Icon, { className: "size-4" }) }),
|
|
8334
|
+
/* @__PURE__ */ jsx17("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs11("p", { className: "text-og-base leading-5 text-og-fg", children: [
|
|
8335
|
+
/* @__PURE__ */ jsx17("span", { className: "font-medium", children: meta.label }),
|
|
8119
8336
|
item.goalText ? /* @__PURE__ */ jsxs11("span", { className: "text-og-fg-muted", children: [
|
|
8120
8337
|
" \xB7 ",
|
|
8121
8338
|
truncate(item.goalText, 90)
|
|
@@ -8133,13 +8350,13 @@ function WorkerCompletionRow({
|
|
|
8133
8350
|
),
|
|
8134
8351
|
children: [
|
|
8135
8352
|
"View session",
|
|
8136
|
-
/* @__PURE__ */
|
|
8353
|
+
/* @__PURE__ */ jsx17(ArrowRightIcon2, { className: "size-3.5" })
|
|
8137
8354
|
]
|
|
8138
8355
|
}
|
|
8139
8356
|
) : null
|
|
8140
8357
|
] }),
|
|
8141
8358
|
hasDetails ? /* @__PURE__ */ jsxs11(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
|
|
8142
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ jsx17(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
|
|
8143
8360
|
"button",
|
|
8144
8361
|
{
|
|
8145
8362
|
type: "button",
|
|
@@ -8148,14 +8365,14 @@ function WorkerCompletionRow({
|
|
|
8148
8365
|
"outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
8149
8366
|
),
|
|
8150
8367
|
children: [
|
|
8151
|
-
/* @__PURE__ */
|
|
8368
|
+
/* @__PURE__ */ jsx17(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
|
|
8152
8369
|
open ? "Hide details" : "Show details"
|
|
8153
8370
|
]
|
|
8154
8371
|
}
|
|
8155
8372
|
) }),
|
|
8156
|
-
/* @__PURE__ */
|
|
8157
|
-
/* @__PURE__ */
|
|
8158
|
-
/* @__PURE__ */
|
|
8373
|
+
/* @__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__ */ jsxs11("div", { className: "min-w-0", children: [
|
|
8374
|
+
/* @__PURE__ */ jsx17("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
|
|
8375
|
+
/* @__PURE__ */ jsx17(
|
|
8159
8376
|
"p",
|
|
8160
8377
|
{
|
|
8161
8378
|
className: cn(
|
|
@@ -8181,49 +8398,52 @@ function SessionStatusRow({ item }) {
|
|
|
8181
8398
|
),
|
|
8182
8399
|
role: "status",
|
|
8183
8400
|
children: [
|
|
8184
|
-
/* @__PURE__ */
|
|
8401
|
+
/* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" }),
|
|
8185
8402
|
/* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
8186
|
-
/* @__PURE__ */
|
|
8403
|
+
/* @__PURE__ */ jsx17(StatusDot, { status: item.status, className: "size-1" }),
|
|
8187
8404
|
meta.label.toLowerCase(),
|
|
8188
8405
|
" \xB7 ",
|
|
8189
8406
|
formatRelativeTime(item.occurredAt)
|
|
8190
8407
|
] }),
|
|
8191
|
-
/* @__PURE__ */
|
|
8408
|
+
/* @__PURE__ */ jsx17("span", { className: "h-px flex-1 bg-og-border" })
|
|
8192
8409
|
]
|
|
8193
8410
|
}
|
|
8194
8411
|
);
|
|
8195
8412
|
}
|
|
8196
8413
|
var NEUTRAL_PILL = "border-og-border bg-og-surface-1 text-og-fg-muted";
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
}
|
|
8414
|
+
function goalMeta(action) {
|
|
8415
|
+
const metadata = {
|
|
8416
|
+
set: {
|
|
8417
|
+
label: "Goal set",
|
|
8418
|
+
pill: "border-og-accent/30 bg-og-accent/10 text-og-accent",
|
|
8419
|
+
icon: TargetIcon2
|
|
8420
|
+
},
|
|
8421
|
+
updated: { label: "Goal updated", pill: NEUTRAL_PILL, icon: PencilLineIcon },
|
|
8422
|
+
completed: {
|
|
8423
|
+
label: "Goal completed",
|
|
8424
|
+
pill: "border-og-status-idle/30 bg-og-status-idle/10 text-og-status-idle",
|
|
8425
|
+
icon: CheckIcon2
|
|
8426
|
+
},
|
|
8427
|
+
paused: {
|
|
8428
|
+
label: "Goal paused",
|
|
8429
|
+
pill: WAITING_PILL_CLASS,
|
|
8430
|
+
icon: PauseIcon
|
|
8431
|
+
},
|
|
8432
|
+
resumed: { label: "Goal resumed", pill: NEUTRAL_PILL, icon: PlayIcon },
|
|
8433
|
+
cleared: { label: "Goal cleared", pill: NEUTRAL_PILL, icon: Trash2Icon },
|
|
8434
|
+
held: {
|
|
8435
|
+
label: "Goal held",
|
|
8436
|
+
pill: WAITING_PILL_CLASS,
|
|
8437
|
+
icon: PauseCircleIcon
|
|
8438
|
+
},
|
|
8439
|
+
continuation: { label: "Continuing toward the goal", pill: NEUTRAL_PILL, icon: ArrowRightIcon2 }
|
|
8440
|
+
};
|
|
8441
|
+
return metadata[action];
|
|
8442
|
+
}
|
|
8223
8443
|
function GoalRow({ item }) {
|
|
8224
8444
|
const enter = useEntranceAnimation();
|
|
8225
|
-
const { label, pill, icon: Icon } =
|
|
8226
|
-
return /* @__PURE__ */
|
|
8445
|
+
const { label, pill, icon: Icon } = goalMeta(item.action);
|
|
8446
|
+
return /* @__PURE__ */ jsx17("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs11(
|
|
8227
8447
|
"span",
|
|
8228
8448
|
{
|
|
8229
8449
|
className: cn(
|
|
@@ -8231,7 +8451,7 @@ function GoalRow({ item }) {
|
|
|
8231
8451
|
pill
|
|
8232
8452
|
),
|
|
8233
8453
|
children: [
|
|
8234
|
-
/* @__PURE__ */
|
|
8454
|
+
/* @__PURE__ */ jsx17(Icon, { className: "size-3.5 shrink-0" }),
|
|
8235
8455
|
/* @__PURE__ */ jsxs11("span", { className: "truncate", children: [
|
|
8236
8456
|
label,
|
|
8237
8457
|
item.text ? `: ${truncate(item.text, 90)}` : ""
|
|
@@ -8242,13 +8462,14 @@ function GoalRow({ item }) {
|
|
|
8242
8462
|
}
|
|
8243
8463
|
function MachineInputBatchRow({
|
|
8244
8464
|
item,
|
|
8465
|
+
onOpenSession,
|
|
8245
8466
|
loadVideoArtifactPlayback
|
|
8246
8467
|
}) {
|
|
8247
8468
|
const enter = useEntranceAnimation();
|
|
8248
8469
|
const label = machineInputBatchLabel(item.members);
|
|
8249
8470
|
const single = item.members.length === 1 ? item.members[0] : null;
|
|
8250
8471
|
if (single?.kind === "media_generation_result" && single.result) {
|
|
8251
|
-
return /* @__PURE__ */
|
|
8472
|
+
return /* @__PURE__ */ jsx17(
|
|
8252
8473
|
VideoGenerationResultRow,
|
|
8253
8474
|
{
|
|
8254
8475
|
result: single.result,
|
|
@@ -8259,44 +8480,60 @@ function MachineInputBatchRow({
|
|
|
8259
8480
|
const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
|
|
8260
8481
|
const showCollapsedSummary = single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
|
|
8261
8482
|
return /* @__PURE__ */ jsxs11("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
|
|
8262
|
-
/* @__PURE__ */ jsxs11(
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8483
|
+
/* @__PURE__ */ jsxs11(
|
|
8484
|
+
"details",
|
|
8485
|
+
{
|
|
8486
|
+
className: "group w-full max-w-full",
|
|
8487
|
+
"data-og-machine-input-batch": "",
|
|
8488
|
+
title: `Received ${formatClockTime(item.occurredAt)}`,
|
|
8489
|
+
children: [
|
|
8490
|
+
/* @__PURE__ */ jsx17("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs11(
|
|
8491
|
+
"span",
|
|
8492
|
+
{
|
|
8493
|
+
className: cn(
|
|
8494
|
+
"inline-flex max-w-full items-center gap-1.5 rounded-full border px-3 py-1 text-og-sm",
|
|
8495
|
+
NEUTRAL_PILL
|
|
8496
|
+
),
|
|
8497
|
+
children: [
|
|
8498
|
+
/* @__PURE__ */ jsx17(
|
|
8499
|
+
ChevronRightIcon3,
|
|
8500
|
+
{
|
|
8501
|
+
"aria-hidden": true,
|
|
8502
|
+
className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
|
|
8503
|
+
}
|
|
8504
|
+
),
|
|
8505
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: label })
|
|
8506
|
+
]
|
|
8507
|
+
}
|
|
8508
|
+
) }),
|
|
8509
|
+
/* @__PURE__ */ jsxs11("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
|
|
8510
|
+
/* @__PURE__ */ jsxs11("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
8511
|
+
"Received ",
|
|
8512
|
+
/* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
|
|
8513
|
+
] }),
|
|
8514
|
+
item.members.map((member) => /* @__PURE__ */ jsx17(
|
|
8515
|
+
MachineInputRow,
|
|
8273
8516
|
{
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
member,
|
|
8286
|
-
loadVideoArtifactPlayback
|
|
8287
|
-
},
|
|
8288
|
-
member.id
|
|
8289
|
-
)) })
|
|
8290
|
-
] }),
|
|
8291
|
-
showCollapsedSummary ? /* @__PURE__ */ jsx16("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
|
|
8517
|
+
member,
|
|
8518
|
+
onOpenSession,
|
|
8519
|
+
loadVideoArtifactPlayback
|
|
8520
|
+
},
|
|
8521
|
+
member.id
|
|
8522
|
+
))
|
|
8523
|
+
] })
|
|
8524
|
+
]
|
|
8525
|
+
}
|
|
8526
|
+
),
|
|
8527
|
+
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
|
|
8292
8528
|
] });
|
|
8293
8529
|
}
|
|
8294
8530
|
function MachineInputRow({
|
|
8295
8531
|
member,
|
|
8532
|
+
onOpenSession,
|
|
8296
8533
|
loadVideoArtifactPlayback
|
|
8297
8534
|
}) {
|
|
8298
8535
|
if (member.kind === "media_generation_result" && member.result) {
|
|
8299
|
-
return /* @__PURE__ */
|
|
8536
|
+
return /* @__PURE__ */ jsx17(
|
|
8300
8537
|
VideoGenerationResultRow,
|
|
8301
8538
|
{
|
|
8302
8539
|
result: member.result,
|
|
@@ -8308,14 +8545,22 @@ function MachineInputRow({
|
|
|
8308
8545
|
const source = readableMachineInputSource(member.sourceId);
|
|
8309
8546
|
const summary = cleanMachineInputSummary(member.summary);
|
|
8310
8547
|
return /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
8311
|
-
/* @__PURE__ */
|
|
8548
|
+
/* @__PURE__ */ jsx17("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
|
|
8312
8549
|
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
8313
|
-
/* @__PURE__ */
|
|
8550
|
+
/* @__PURE__ */ jsx17("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
|
|
8314
8551
|
source && /* @__PURE__ */ jsxs11("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
|
|
8315
8552
|
"from ",
|
|
8316
8553
|
source
|
|
8317
8554
|
] }),
|
|
8318
|
-
summary ? /* @__PURE__ */
|
|
8555
|
+
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,
|
|
8556
|
+
/* @__PURE__ */ jsx17(
|
|
8557
|
+
ChildSessionLink,
|
|
8558
|
+
{
|
|
8559
|
+
kind: member.kind,
|
|
8560
|
+
sourceId: member.sourceId,
|
|
8561
|
+
onOpenSession
|
|
8562
|
+
}
|
|
8563
|
+
)
|
|
8319
8564
|
] })
|
|
8320
8565
|
] });
|
|
8321
8566
|
}
|
|
@@ -8335,10 +8580,10 @@ function VideoGenerationResultRow({
|
|
|
8335
8580
|
),
|
|
8336
8581
|
children: [
|
|
8337
8582
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
|
|
8338
|
-
/* @__PURE__ */
|
|
8583
|
+
/* @__PURE__ */ jsx17(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
|
|
8339
8584
|
"Video generation failed"
|
|
8340
8585
|
] }),
|
|
8341
|
-
/* @__PURE__ */
|
|
8586
|
+
/* @__PURE__ */ jsx17("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
|
|
8342
8587
|
]
|
|
8343
8588
|
}
|
|
8344
8589
|
);
|
|
@@ -8355,17 +8600,17 @@ function VideoGenerationResultRow({
|
|
|
8355
8600
|
compact && "max-w-lg"
|
|
8356
8601
|
),
|
|
8357
8602
|
children: [
|
|
8358
|
-
loadVideoArtifactPlayback ? /* @__PURE__ */
|
|
8603
|
+
loadVideoArtifactPlayback ? /* @__PURE__ */ jsx17(
|
|
8359
8604
|
GeneratedVideoPlayer,
|
|
8360
8605
|
{
|
|
8361
8606
|
receipt,
|
|
8362
8607
|
loadPlaybackSource: loadVideoArtifactPlayback,
|
|
8363
8608
|
className: "rounded-none border-0 shadow-none"
|
|
8364
8609
|
}
|
|
8365
|
-
) : /* @__PURE__ */
|
|
8610
|
+
) : /* @__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" }) }),
|
|
8366
8611
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
|
|
8367
8612
|
/* @__PURE__ */ jsxs11("div", { className: "min-w-0", children: [
|
|
8368
|
-
/* @__PURE__ */
|
|
8613
|
+
/* @__PURE__ */ jsx17("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
|
|
8369
8614
|
/* @__PURE__ */ jsxs11("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
|
|
8370
8615
|
facts.width,
|
|
8371
8616
|
"\xD7",
|
|
@@ -8375,7 +8620,7 @@ function VideoGenerationResultRow({
|
|
|
8375
8620
|
facts.hasAudio ? " \xB7 Audio" : ""
|
|
8376
8621
|
] })
|
|
8377
8622
|
] }),
|
|
8378
|
-
/* @__PURE__ */
|
|
8623
|
+
/* @__PURE__ */ jsx17(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
|
|
8379
8624
|
] })
|
|
8380
8625
|
]
|
|
8381
8626
|
}
|
|
@@ -8386,7 +8631,7 @@ function formatVideoDuration(seconds) {
|
|
|
8386
8631
|
}
|
|
8387
8632
|
function NoticeRow({ item }) {
|
|
8388
8633
|
const enter = useEntranceAnimation();
|
|
8389
|
-
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? WAITING_PILL_CLASS :
|
|
8634
|
+
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? WAITING_PILL_CLASS : NEUTRAL_PILL;
|
|
8390
8635
|
return /* @__PURE__ */ jsxs11(
|
|
8391
8636
|
"div",
|
|
8392
8637
|
{
|
|
@@ -8395,22 +8640,31 @@ function NoticeRow({ item }) {
|
|
|
8395
8640
|
"flex items-start gap-2.5 rounded-og-md border px-3.5 py-2.5 text-og-menu",
|
|
8396
8641
|
tone
|
|
8397
8642
|
),
|
|
8398
|
-
role: "status",
|
|
8643
|
+
role: item.recordedOutcome ? "note" : "status",
|
|
8644
|
+
"data-og-recorded-outcome": item.recordedOutcome ? "wait" : void 0,
|
|
8399
8645
|
children: [
|
|
8400
|
-
/* @__PURE__ */
|
|
8646
|
+
/* @__PURE__ */ jsx17(
|
|
8401
8647
|
TriangleAlertIcon2,
|
|
8402
8648
|
{
|
|
8403
8649
|
className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
|
|
8404
8650
|
}
|
|
8405
8651
|
),
|
|
8406
8652
|
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
8407
|
-
/* @__PURE__ */
|
|
8653
|
+
item.recordedOutcome ? /* @__PURE__ */ jsxs11("p", { className: "mb-1 text-og-control font-medium", children: [
|
|
8654
|
+
"Wait recorded",
|
|
8655
|
+
" ",
|
|
8656
|
+
/* @__PURE__ */ jsx17("time", { dateTime: item.occurredAt, children: new Date(item.occurredAt).toLocaleString(void 0, {
|
|
8657
|
+
dateStyle: "medium",
|
|
8658
|
+
timeStyle: "short"
|
|
8659
|
+
}) })
|
|
8660
|
+
] }) : null,
|
|
8661
|
+
/* @__PURE__ */ jsx17("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
|
|
8408
8662
|
item.details ? /* @__PURE__ */ jsxs11("details", { className: "mt-2 text-og-control", children: [
|
|
8409
|
-
/* @__PURE__ */
|
|
8410
|
-
/* @__PURE__ */
|
|
8663
|
+
/* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
8664
|
+
/* @__PURE__ */ jsx17("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
|
|
8411
8665
|
] }) : null
|
|
8412
8666
|
] }),
|
|
8413
|
-
item.action ? /* @__PURE__ */
|
|
8667
|
+
item.action ? /* @__PURE__ */ jsx17(
|
|
8414
8668
|
"a",
|
|
8415
8669
|
{
|
|
8416
8670
|
className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
|
|
@@ -8457,7 +8711,7 @@ function AuthNeededRow({
|
|
|
8457
8711
|
return /* @__PURE__ */ jsxs11("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
|
|
8458
8712
|
/* @__PURE__ */ jsxs11("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: [
|
|
8459
8713
|
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
8460
|
-
/* @__PURE__ */
|
|
8714
|
+
/* @__PURE__ */ jsx17(
|
|
8461
8715
|
AuthProviderLogo,
|
|
8462
8716
|
{
|
|
8463
8717
|
src: resolveProviderLogo?.(item.providerDomain) ?? null,
|
|
@@ -8465,8 +8719,8 @@ function AuthNeededRow({
|
|
|
8465
8719
|
}
|
|
8466
8720
|
),
|
|
8467
8721
|
/* @__PURE__ */ jsxs11("div", { className: "min-w-0", children: [
|
|
8468
|
-
/* @__PURE__ */
|
|
8469
|
-
/* @__PURE__ */
|
|
8722
|
+
/* @__PURE__ */ jsx17("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
|
|
8723
|
+
/* @__PURE__ */ jsx17("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
|
|
8470
8724
|
recommendation ? /* @__PURE__ */ jsxs11("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
8471
8725
|
"Provider: ",
|
|
8472
8726
|
item.providerDomain
|
|
@@ -8488,7 +8742,7 @@ function AuthNeededRow({
|
|
|
8488
8742
|
"transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
|
|
8489
8743
|
),
|
|
8490
8744
|
children: [
|
|
8491
|
-
/* @__PURE__ */
|
|
8745
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
8492
8746
|
actionLabel
|
|
8493
8747
|
]
|
|
8494
8748
|
}
|
|
@@ -8503,7 +8757,7 @@ function AuthNeededRow({
|
|
|
8503
8757
|
"transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
|
|
8504
8758
|
),
|
|
8505
8759
|
children: [
|
|
8506
|
-
/* @__PURE__ */
|
|
8760
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
|
|
8507
8761
|
busy ? "Opening\u2026" : actionLabel
|
|
8508
8762
|
]
|
|
8509
8763
|
}
|
|
@@ -8518,13 +8772,13 @@ function AuthNeededRow({
|
|
|
8518
8772
|
"transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
|
|
8519
8773
|
),
|
|
8520
8774
|
children: [
|
|
8521
|
-
/* @__PURE__ */
|
|
8775
|
+
/* @__PURE__ */ jsx17(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
8522
8776
|
actionLabel
|
|
8523
8777
|
]
|
|
8524
8778
|
}
|
|
8525
8779
|
) : null
|
|
8526
8780
|
] }),
|
|
8527
|
-
!unavailable ? /* @__PURE__ */
|
|
8781
|
+
!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,
|
|
8528
8782
|
failed ? /* @__PURE__ */ jsxs11("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
|
|
8529
8783
|
"Couldn't start ",
|
|
8530
8784
|
missing ? "connecting" : "reconnecting",
|
|
@@ -8538,12 +8792,12 @@ function AuthProviderLogo({ src, label }) {
|
|
|
8538
8792
|
const [failed, setFailed] = useState12(false);
|
|
8539
8793
|
useEffect10(() => setFailed(false), [src]);
|
|
8540
8794
|
const showImage = src && !failed;
|
|
8541
|
-
return /* @__PURE__ */
|
|
8795
|
+
return /* @__PURE__ */ jsx17(
|
|
8542
8796
|
"span",
|
|
8543
8797
|
{
|
|
8544
8798
|
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",
|
|
8545
8799
|
"aria-hidden": true,
|
|
8546
|
-
children: showImage ? /* @__PURE__ */
|
|
8800
|
+
children: showImage ? /* @__PURE__ */ jsx17(
|
|
8547
8801
|
"img",
|
|
8548
8802
|
{
|
|
8549
8803
|
src,
|
|
@@ -8553,7 +8807,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
8553
8807
|
className: "size-full object-contain p-1.5",
|
|
8554
8808
|
onError: () => setFailed(true)
|
|
8555
8809
|
}
|
|
8556
|
-
) : /* @__PURE__ */
|
|
8810
|
+
) : /* @__PURE__ */ jsx17("span", { children: monogram(label) })
|
|
8557
8811
|
}
|
|
8558
8812
|
);
|
|
8559
8813
|
}
|
|
@@ -8598,7 +8852,7 @@ function authReasonLine(reason) {
|
|
|
8598
8852
|
// src/components/queue-surface.tsx
|
|
8599
8853
|
import { Loader2Icon } from "lucide-react";
|
|
8600
8854
|
import { lazy as lazy4, Suspense as Suspense4 } from "react";
|
|
8601
|
-
import { jsx as
|
|
8855
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
8602
8856
|
var loadQueueSurface = () => import("./queue-surface-implementation-XL2A6PBM.js");
|
|
8603
8857
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
8604
8858
|
function createQueueSurface(loadImplementation) {
|
|
@@ -8609,21 +8863,21 @@ function createQueueSurface(loadImplementation) {
|
|
|
8609
8863
|
const { queue } = props;
|
|
8610
8864
|
if (queue.queue.length + queue.pendingInputs.length === 0) {
|
|
8611
8865
|
if (!queue.stoppingPreviousAttempt && !queue.error && !queue.mutationError) return null;
|
|
8612
|
-
return /* @__PURE__ */
|
|
8866
|
+
return /* @__PURE__ */ jsx18(EmptyQueueStateSurface, { queue });
|
|
8613
8867
|
}
|
|
8614
|
-
return /* @__PURE__ */
|
|
8868
|
+
return /* @__PURE__ */ jsx18(Suspense4, { fallback: /* @__PURE__ */ jsx18(QueueSurfaceFallback, {}), children: /* @__PURE__ */ jsx18(LazyQueueSurface, { ...props }) });
|
|
8615
8869
|
};
|
|
8616
8870
|
}
|
|
8617
8871
|
function QueueSurfaceFallback() {
|
|
8618
|
-
return /* @__PURE__ */
|
|
8872
|
+
return /* @__PURE__ */ jsx18(
|
|
8619
8873
|
"div",
|
|
8620
8874
|
{
|
|
8621
8875
|
"aria-live": "polite",
|
|
8622
8876
|
className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
|
|
8623
8877
|
"data-testid": "queue-surface-loading",
|
|
8624
8878
|
role: "status",
|
|
8625
|
-
children: /* @__PURE__ */
|
|
8626
|
-
/* @__PURE__ */
|
|
8879
|
+
children: /* @__PURE__ */ jsx18("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
|
|
8880
|
+
/* @__PURE__ */ jsx18(
|
|
8627
8881
|
Loader2Icon,
|
|
8628
8882
|
{
|
|
8629
8883
|
"aria-hidden": "true",
|
|
@@ -8636,8 +8890,377 @@ function QueueSurfaceFallback() {
|
|
|
8636
8890
|
);
|
|
8637
8891
|
}
|
|
8638
8892
|
|
|
8893
|
+
// src/hooks/use-available-models.ts
|
|
8894
|
+
import { useCallback as useCallback3 } from "react";
|
|
8895
|
+
function useAvailableModels(options = {}) {
|
|
8896
|
+
const client = useOpenGeniClient(options);
|
|
8897
|
+
const load = useCallback3(
|
|
8898
|
+
async (signal) => await client.getClientConfig({ signal }),
|
|
8899
|
+
[client]
|
|
8900
|
+
);
|
|
8901
|
+
const state = usePolledValue(load, {
|
|
8902
|
+
pollIntervalMs: options.pollIntervalMs,
|
|
8903
|
+
enabled: options.enabled
|
|
8904
|
+
});
|
|
8905
|
+
return {
|
|
8906
|
+
models: state.data?.models ?? [],
|
|
8907
|
+
defaultModel: state.data?.defaultModel ?? null,
|
|
8908
|
+
loading: state.loading,
|
|
8909
|
+
error: state.error,
|
|
8910
|
+
refresh: state.refresh
|
|
8911
|
+
};
|
|
8912
|
+
}
|
|
8913
|
+
function useWorkspaceModelCatalog(options) {
|
|
8914
|
+
const client = useOpenGeniClient(options);
|
|
8915
|
+
const load = useCallback3(
|
|
8916
|
+
async (signal) => {
|
|
8917
|
+
if (!options.workspaceId) {
|
|
8918
|
+
return { models: [], defaultModel: null };
|
|
8919
|
+
}
|
|
8920
|
+
const [catalog, config] = await Promise.all([
|
|
8921
|
+
client.getWorkspaceModelCatalog(options.workspaceId, { signal }),
|
|
8922
|
+
client.getClientConfig({ signal })
|
|
8923
|
+
]);
|
|
8924
|
+
return {
|
|
8925
|
+
models: catalog.models,
|
|
8926
|
+
defaultModel: config.defaultModel
|
|
8927
|
+
};
|
|
8928
|
+
},
|
|
8929
|
+
[client, options.workspaceId]
|
|
8930
|
+
);
|
|
8931
|
+
const state = usePolledValue(load, {
|
|
8932
|
+
pollIntervalMs: options.pollIntervalMs,
|
|
8933
|
+
enabled: options.enabled !== false && Boolean(options.workspaceId)
|
|
8934
|
+
});
|
|
8935
|
+
const rows = sortPickerRows(projectPickerRows(state.data?.models ?? []));
|
|
8936
|
+
return {
|
|
8937
|
+
models: state.data?.models ?? [],
|
|
8938
|
+
rows,
|
|
8939
|
+
defaultModel: state.data?.defaultModel ?? null,
|
|
8940
|
+
loading: state.loading,
|
|
8941
|
+
error: state.error,
|
|
8942
|
+
refresh: state.refresh
|
|
8943
|
+
};
|
|
8944
|
+
}
|
|
8945
|
+
|
|
8946
|
+
// src/components/chat-composer.tsx
|
|
8947
|
+
import { LayoutGroup, motion as motion2 } from "motion/react";
|
|
8948
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8949
|
+
function ChatComposer({
|
|
8950
|
+
composer,
|
|
8951
|
+
responsiveBasis,
|
|
8952
|
+
effectiveControl,
|
|
8953
|
+
queuedAheadCount,
|
|
8954
|
+
canControlWorkspace,
|
|
8955
|
+
controlLinks,
|
|
8956
|
+
placeholder,
|
|
8957
|
+
disabled,
|
|
8958
|
+
autoFocus,
|
|
8959
|
+
hint,
|
|
8960
|
+
controlsLeading,
|
|
8961
|
+
controlsStart,
|
|
8962
|
+
actionsStart,
|
|
8963
|
+
attachButtonClassName,
|
|
8964
|
+
transcription,
|
|
8965
|
+
transcriptionClassName,
|
|
8966
|
+
transcriptionSuppressed = false,
|
|
8967
|
+
header,
|
|
8968
|
+
onPaste,
|
|
8969
|
+
attachments,
|
|
8970
|
+
models,
|
|
8971
|
+
selectedModel,
|
|
8972
|
+
onSelectModel,
|
|
8973
|
+
className,
|
|
8974
|
+
commands,
|
|
8975
|
+
commandContext,
|
|
8976
|
+
onClearView,
|
|
8977
|
+
messages
|
|
8978
|
+
}) {
|
|
8979
|
+
const controller = useChatComposerController({
|
|
8980
|
+
delivery: composer,
|
|
8981
|
+
draft: composer,
|
|
8982
|
+
control: composer,
|
|
8983
|
+
effectiveControl,
|
|
8984
|
+
queuedAheadCount,
|
|
8985
|
+
canControlWorkspace,
|
|
8986
|
+
controlLinks,
|
|
8987
|
+
disabled,
|
|
8988
|
+
attachments,
|
|
8989
|
+
commands,
|
|
8990
|
+
commandContext,
|
|
8991
|
+
onClearView,
|
|
8992
|
+
onPaste,
|
|
8993
|
+
messages
|
|
8994
|
+
});
|
|
8995
|
+
const hasControls = Boolean(
|
|
8996
|
+
attachments || models || controlsLeading || controlsStart || transcription
|
|
8997
|
+
);
|
|
8998
|
+
const stackActions = hasControls && Boolean(actionsStart);
|
|
8999
|
+
return /* @__PURE__ */ jsx19(Fragment6, { children: /* @__PURE__ */ jsxs13(Root, { controller, responsiveBasis, className, children: [
|
|
9000
|
+
/* @__PURE__ */ jsxs13(Frame, { children: [
|
|
9001
|
+
/* @__PURE__ */ jsx19(CommandPalette, {}),
|
|
9002
|
+
/* @__PURE__ */ jsxs13(Surface, { children: [
|
|
9003
|
+
/* @__PURE__ */ jsx19(PausedState, {}),
|
|
9004
|
+
/* @__PURE__ */ jsx19(RestoredResources, {}),
|
|
9005
|
+
/* @__PURE__ */ jsx19(Attachments, {}),
|
|
9006
|
+
header,
|
|
9007
|
+
composer.annotations && composer.annotations.length > 0 ? /* @__PURE__ */ jsx19("div", { className: "px-3 pt-2 sm:px-4", children: /* @__PURE__ */ jsx19(
|
|
9008
|
+
TimelineAnnotationsChip,
|
|
9009
|
+
{
|
|
9010
|
+
annotations: composer.annotations,
|
|
9011
|
+
editable: true,
|
|
9012
|
+
focusAnnotationId: composer.annotationReviewTargetId,
|
|
9013
|
+
onFocusConsumed: composer.clearAnnotationReviewTarget,
|
|
9014
|
+
onUpdate: composer.updateAnnotation,
|
|
9015
|
+
onRemove: composer.removeAnnotation
|
|
9016
|
+
}
|
|
9017
|
+
) }) : null,
|
|
9018
|
+
/* @__PURE__ */ jsx19(Input, { placeholder, autoFocus }),
|
|
9019
|
+
controller.confirmState ? /* @__PURE__ */ jsx19(Confirmation, {}) : /* @__PURE__ */ jsx19(
|
|
9020
|
+
Footer,
|
|
9021
|
+
{
|
|
9022
|
+
"data-og-stack-actions": stackActions ? "" : void 0,
|
|
9023
|
+
className: stackActions ? "max-sm:flex-nowrap sm:flex-wrap" : void 0,
|
|
9024
|
+
children: /* @__PURE__ */ jsxs13(LayoutGroup, { id: "og-composer-footer", children: [
|
|
9025
|
+
hasControls ? /* @__PURE__ */ jsxs13(
|
|
9026
|
+
Controls,
|
|
9027
|
+
{
|
|
9028
|
+
className: stackActions ? "min-w-0 max-sm:flex-1 sm:w-auto" : void 0,
|
|
9029
|
+
children: [
|
|
9030
|
+
controlsLeading,
|
|
9031
|
+
/* @__PURE__ */ jsx19(AttachButton, { className: attachButtonClassName }),
|
|
9032
|
+
transcription ? /* @__PURE__ */ jsx19(
|
|
9033
|
+
ComposerTranscriptionControl,
|
|
9034
|
+
{
|
|
9035
|
+
...transcription,
|
|
9036
|
+
suppressed: transcriptionSuppressed,
|
|
9037
|
+
className: [transcription.className, transcriptionClassName].filter(Boolean).join(" ")
|
|
9038
|
+
}
|
|
9039
|
+
) : null,
|
|
9040
|
+
models ? /* @__PURE__ */ jsx19(
|
|
9041
|
+
motion2.span,
|
|
9042
|
+
{
|
|
9043
|
+
layout: true,
|
|
9044
|
+
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
9045
|
+
className: "inline-flex min-w-0",
|
|
9046
|
+
children: /* @__PURE__ */ jsx19(
|
|
9047
|
+
ModelPicker,
|
|
9048
|
+
{
|
|
9049
|
+
models,
|
|
9050
|
+
value: selectedModel,
|
|
9051
|
+
onChange: onSelectModel
|
|
9052
|
+
}
|
|
9053
|
+
)
|
|
9054
|
+
}
|
|
9055
|
+
) : null,
|
|
9056
|
+
controlsStart ? /* @__PURE__ */ jsx19(
|
|
9057
|
+
motion2.span,
|
|
9058
|
+
{
|
|
9059
|
+
layout: true,
|
|
9060
|
+
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
9061
|
+
className: "inline-flex min-w-0 flex-1 items-center gap-1.5",
|
|
9062
|
+
children: controlsStart
|
|
9063
|
+
}
|
|
9064
|
+
) : null
|
|
9065
|
+
]
|
|
9066
|
+
}
|
|
9067
|
+
) : /* @__PURE__ */ jsx19(Hint, { children: hint }),
|
|
9068
|
+
/* @__PURE__ */ jsxs13(
|
|
9069
|
+
Actions,
|
|
9070
|
+
{
|
|
9071
|
+
className: stackActions ? "max-sm:shrink-0 sm:w-auto sm:justify-end" : void 0,
|
|
9072
|
+
children: [
|
|
9073
|
+
actionsStart,
|
|
9074
|
+
/* @__PURE__ */ jsx19(PauseButton, {}),
|
|
9075
|
+
/* @__PURE__ */ jsx19(SendButton, {})
|
|
9076
|
+
]
|
|
9077
|
+
}
|
|
9078
|
+
)
|
|
9079
|
+
] })
|
|
9080
|
+
}
|
|
9081
|
+
)
|
|
9082
|
+
] })
|
|
9083
|
+
] }),
|
|
9084
|
+
/* @__PURE__ */ jsx19(Help, {}),
|
|
9085
|
+
/* @__PURE__ */ jsx19(Status, {})
|
|
9086
|
+
] }) });
|
|
9087
|
+
}
|
|
9088
|
+
|
|
9089
|
+
// src/components/session-conversation.tsx
|
|
9090
|
+
import { useRef as useRef11 } from "react";
|
|
9091
|
+
|
|
9092
|
+
// src/conversation-timeline.ts
|
|
9093
|
+
function conversationTimeline(items, queue, composer) {
|
|
9094
|
+
const queued = new Set(
|
|
9095
|
+
queue.queue.filter((turn) => turn.metadata.delivery !== "steer").map((turn) => turn.triggerEventId)
|
|
9096
|
+
);
|
|
9097
|
+
const pending = composer.optimisticMessages ?? [];
|
|
9098
|
+
const pendingQueue = new Set(
|
|
9099
|
+
pending.filter(
|
|
9100
|
+
(message) => message.destination === "queue" && !(message.turnId && message.appliedQueueVersion != null && queue.snapshot && queue.snapshot.version >= message.appliedQueueVersion && !queue.queue.some((turn) => turn.id === message.turnId))
|
|
9101
|
+
).map((message) => `user-message:${message.clientEventId}`)
|
|
9102
|
+
);
|
|
9103
|
+
const visible = items.filter(
|
|
9104
|
+
(item) => item.kind !== "user-message" || !queued.has(item.id) && !pendingQueue.has(item.reconciliationKey ?? "")
|
|
9105
|
+
);
|
|
9106
|
+
const keys = new Set(
|
|
9107
|
+
visible.flatMap((item) => item.kind === "user-message" ? [item.reconciliationKey] : [])
|
|
9108
|
+
);
|
|
9109
|
+
const optimistic = pending.filter(
|
|
9110
|
+
(message) => !keys.has(`user-message:${message.clientEventId}`) && !queue.queue.some((turn) => turn.id === message.turnId)
|
|
9111
|
+
).map((message) => ({
|
|
9112
|
+
kind: "user-message",
|
|
9113
|
+
id: `optimistic:${message.clientEventId}`,
|
|
9114
|
+
reconciliationKey: `user-message:${message.clientEventId}`,
|
|
9115
|
+
text: message.text,
|
|
9116
|
+
annotations: message.annotations.map((annotation, ordinal) => ({ ...annotation, ordinal })),
|
|
9117
|
+
resources: message.resources,
|
|
9118
|
+
tools: [],
|
|
9119
|
+
occurredAt: message.occurredAt,
|
|
9120
|
+
delivery: {
|
|
9121
|
+
state: message.state,
|
|
9122
|
+
...message.error ? { error: message.error } : {},
|
|
9123
|
+
...message.state === "failed" ? {
|
|
9124
|
+
onRetry: () => composer.retryOptimisticMessage?.(message.clientEventId),
|
|
9125
|
+
onRemove: () => composer.removeOptimisticMessage?.(message.clientEventId)
|
|
9126
|
+
} : {}
|
|
9127
|
+
}
|
|
9128
|
+
}));
|
|
9129
|
+
const ids = new Set(visible.map((item) => item.id));
|
|
9130
|
+
const steers = (queue.acceptedSteers ?? []).filter((steer) => !ids.has(steer.triggerEventId)).map((steer) => ({
|
|
9131
|
+
kind: "user-message",
|
|
9132
|
+
id: steer.triggerEventId,
|
|
9133
|
+
text: steer.text,
|
|
9134
|
+
annotations: steer.annotations,
|
|
9135
|
+
resources: steer.resources,
|
|
9136
|
+
tools: steer.tools,
|
|
9137
|
+
occurredAt: steer.occurredAt,
|
|
9138
|
+
delivery: { state: steer.state }
|
|
9139
|
+
}));
|
|
9140
|
+
return [...visible, ...optimistic, ...steers];
|
|
9141
|
+
}
|
|
9142
|
+
|
|
9143
|
+
// src/components/session-conversation.tsx
|
|
9144
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9145
|
+
function SessionConversation(props) {
|
|
9146
|
+
return /* @__PURE__ */ jsx20(Conversation, { ...props }, `${props.workspaceId ?? ""}:${props.sessionId}`);
|
|
9147
|
+
}
|
|
9148
|
+
function Conversation({
|
|
9149
|
+
sessionId,
|
|
9150
|
+
client,
|
|
9151
|
+
workspaceId,
|
|
9152
|
+
className,
|
|
9153
|
+
height = "100%",
|
|
9154
|
+
composerProps
|
|
9155
|
+
}) {
|
|
9156
|
+
const scope = { client, workspaceId };
|
|
9157
|
+
const context = useOpenGeni(scope);
|
|
9158
|
+
const catalog = useWorkspaceModelCatalog({
|
|
9159
|
+
client: context.client,
|
|
9160
|
+
workspaceId: context.workspaceId
|
|
9161
|
+
});
|
|
9162
|
+
const feed = useSessionEvents(sessionId, scope);
|
|
9163
|
+
const options = { ...scope, events: feed.events };
|
|
9164
|
+
const detail = useSession(sessionId, options);
|
|
9165
|
+
const queue = useTurnQueue(sessionId, options);
|
|
9166
|
+
const human = useHumanInputRequests(sessionId, options);
|
|
9167
|
+
const status = feed.sessionStatus ?? detail.session?.status;
|
|
9168
|
+
const terminal = status === "cancelled";
|
|
9169
|
+
const composer = useComposer(sessionId, {
|
|
9170
|
+
...options,
|
|
9171
|
+
effectiveControl: queue.effectiveControl ?? detail.session?.effectiveControl,
|
|
9172
|
+
sendDestination: () => queue.queue.length > 0 || status === "running" ? "queue" : "chat"
|
|
9173
|
+
});
|
|
9174
|
+
const region = useRef11(null);
|
|
9175
|
+
const error = detail.error ?? feed.error ?? human.error;
|
|
9176
|
+
return /* @__PURE__ */ jsxs14(
|
|
9177
|
+
"div",
|
|
9178
|
+
{
|
|
9179
|
+
className: cn("og-root flex min-h-0 min-w-0 flex-col gap-2 overflow-hidden", className),
|
|
9180
|
+
ref: region,
|
|
9181
|
+
style: { height },
|
|
9182
|
+
"data-og-conversation": "",
|
|
9183
|
+
children: [
|
|
9184
|
+
error && /* @__PURE__ */ jsx20("p", { role: "alert", children: error.message }),
|
|
9185
|
+
/* @__PURE__ */ jsx20(
|
|
9186
|
+
MessageTimeline,
|
|
9187
|
+
{
|
|
9188
|
+
className: "min-h-0 flex-1",
|
|
9189
|
+
items: conversationTimeline(feed.timeline, queue, composer),
|
|
9190
|
+
status,
|
|
9191
|
+
hasOlder: feed.hasOlder,
|
|
9192
|
+
loadingOlder: feed.loadingOlder,
|
|
9193
|
+
onLoadOlder: feed.loadOlder,
|
|
9194
|
+
hasNewer: feed.hasNewer,
|
|
9195
|
+
loadingNewer: feed.loadingNewer,
|
|
9196
|
+
onLoadNewer: () => {
|
|
9197
|
+
void feed.loadNewer();
|
|
9198
|
+
},
|
|
9199
|
+
onJumpToStart: async () => {
|
|
9200
|
+
await feed.loadOldest();
|
|
9201
|
+
},
|
|
9202
|
+
loadingOldest: feed.loadingOldest,
|
|
9203
|
+
onJumpToLatest: feed.jumpToLatest,
|
|
9204
|
+
onAnnotate: composer.addAnnotation
|
|
9205
|
+
}
|
|
9206
|
+
),
|
|
9207
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-h-0 max-h-[40%] shrink-0 overflow-y-auto", "data-og-conversation-inputs": "", children: [
|
|
9208
|
+
/* @__PURE__ */ jsx20(
|
|
9209
|
+
HumanInputSurface,
|
|
9210
|
+
{
|
|
9211
|
+
requests: human.requests,
|
|
9212
|
+
onSubmit: async (id, response) => {
|
|
9213
|
+
await human.respond(id, response);
|
|
9214
|
+
},
|
|
9215
|
+
respondingRequestId: human.respondingRequestId,
|
|
9216
|
+
error: human.mutationError?.message,
|
|
9217
|
+
autoFocus: false
|
|
9218
|
+
}
|
|
9219
|
+
),
|
|
9220
|
+
terminal ? /* @__PURE__ */ jsx20(QueueSurface, { queue, readOnly: true }) : /* @__PURE__ */ jsx20(
|
|
9221
|
+
QueueSurface,
|
|
9222
|
+
{
|
|
9223
|
+
queue,
|
|
9224
|
+
composer,
|
|
9225
|
+
onRequestComposerFocus: () => region.current?.querySelector("textarea")?.focus()
|
|
9226
|
+
}
|
|
9227
|
+
)
|
|
9228
|
+
] }),
|
|
9229
|
+
/* @__PURE__ */ jsx20("div", { className: "shrink-0", "data-og-conversation-composer": "", children: /* @__PURE__ */ jsx20(
|
|
9230
|
+
ChatComposer,
|
|
9231
|
+
{
|
|
9232
|
+
...composerProps,
|
|
9233
|
+
composer,
|
|
9234
|
+
disabled: terminal || composerProps?.disabled,
|
|
9235
|
+
controlsStart: composerProps?.controlsStart ?? (composer.policy && /* @__PURE__ */ jsx20(
|
|
9236
|
+
ModelPolicyPicker,
|
|
9237
|
+
{
|
|
9238
|
+
rows: catalog.rows,
|
|
9239
|
+
model: composer.policy.model,
|
|
9240
|
+
effort: composer.policy.reasoningEffort,
|
|
9241
|
+
latencyMode: composer.policy.latencyMode,
|
|
9242
|
+
loading: catalog.loading,
|
|
9243
|
+
error: catalog.error?.message,
|
|
9244
|
+
disabled: terminal,
|
|
9245
|
+
sessionKey: sessionId,
|
|
9246
|
+
onModelChange: (model) => composer.setModel?.(model),
|
|
9247
|
+
onEffortChange: (effort) => composer.setReasoningEffort?.(effort),
|
|
9248
|
+
onLatencyModeChange: (mode) => composer.setLatencyMode?.(mode)
|
|
9249
|
+
}
|
|
9250
|
+
)),
|
|
9251
|
+
responsiveBasis: composerProps?.responsiveBasis ?? "container",
|
|
9252
|
+
effectiveControl: composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl,
|
|
9253
|
+
queuedAheadCount: queue.queue.length
|
|
9254
|
+
}
|
|
9255
|
+
) })
|
|
9256
|
+
]
|
|
9257
|
+
}
|
|
9258
|
+
);
|
|
9259
|
+
}
|
|
9260
|
+
|
|
8639
9261
|
// src/components/session-chrome.tsx
|
|
8640
9262
|
import {
|
|
9263
|
+
ActivityIcon,
|
|
8641
9264
|
AudioLinesIcon,
|
|
8642
9265
|
ArrowDownIcon as ArrowDownIcon2,
|
|
8643
9266
|
ArrowUpIcon,
|
|
@@ -8650,18 +9273,21 @@ import {
|
|
|
8650
9273
|
PencilIcon,
|
|
8651
9274
|
PlayIcon as PlayIcon2,
|
|
8652
9275
|
Trash2Icon as Trash2Icon2,
|
|
9276
|
+
TerminalIcon as TerminalIcon2,
|
|
8653
9277
|
TriangleAlertIcon as TriangleAlertIcon3,
|
|
8654
9278
|
XIcon,
|
|
8655
|
-
|
|
9279
|
+
CornerDownRightIcon,
|
|
9280
|
+
TargetIcon as TargetIcon3
|
|
8656
9281
|
} from "lucide-react";
|
|
8657
|
-
import { AnimatePresence as AnimatePresence2, motion as
|
|
8658
|
-
import { useEffect as useEffect11, useId as useId3, useMemo as useMemo5, useRef as
|
|
8659
|
-
import { Fragment as
|
|
9282
|
+
import { AnimatePresence as AnimatePresence2, motion as motion3, useReducedMotion } from "motion/react";
|
|
9283
|
+
import { useEffect as useEffect11, useId as useId3, useMemo as useMemo5, useRef as useRef12, useState as useState13 } from "react";
|
|
9284
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8660
9285
|
var GOAL_LABEL = {
|
|
8661
9286
|
pursuing: "Pursuing",
|
|
8662
9287
|
waiting: "Waiting",
|
|
8663
|
-
scheduled: "
|
|
9288
|
+
scheduled: "Waiting",
|
|
8664
9289
|
blocked: "Blocked",
|
|
9290
|
+
session_failed: "Blocked by session failure",
|
|
8665
9291
|
held: "Held",
|
|
8666
9292
|
paused: "Paused",
|
|
8667
9293
|
invariant_broken: "Needs attention",
|
|
@@ -8688,11 +9314,14 @@ function sessionChromeGoalPillLabel(state, record) {
|
|
|
8688
9314
|
}
|
|
8689
9315
|
function sessionChromeGoalPillExplanation(state, record) {
|
|
8690
9316
|
const continuation = record?.continuation ?? null;
|
|
9317
|
+
if (state === "session_failed") {
|
|
9318
|
+
return "Resolve the session failure, then use Continue or send a message to continue this active goal.";
|
|
9319
|
+
}
|
|
8691
9320
|
if (state === "paused") {
|
|
8692
9321
|
return record?.pausedReason ? GOAL_PAUSED_REASON_EXPLANATION[record.pausedReason] ?? null : null;
|
|
8693
9322
|
}
|
|
8694
|
-
if (state === "scheduled"
|
|
8695
|
-
return continuation
|
|
9323
|
+
if (state === "scheduled") {
|
|
9324
|
+
return continuation?.nextAttemptAt ? `Continues at ${formatClockTime(continuation.nextAttemptAt)}.` : "Waiting to continue automatically.";
|
|
8696
9325
|
}
|
|
8697
9326
|
if (state === "held" && continuation?.reason === "held_for_input") {
|
|
8698
9327
|
const reason = continuation.holdReason?.trim();
|
|
@@ -8715,18 +9344,41 @@ function queuedTurnPresentation(turn) {
|
|
|
8715
9344
|
function isSteeringTurn(turn) {
|
|
8716
9345
|
return turn.metadata.delivery === "steer";
|
|
8717
9346
|
}
|
|
9347
|
+
function isAuthoritativeQueuedTurn(turn, mutationFor) {
|
|
9348
|
+
return !isSteeringTurn(turn) && mutationFor(turn.id) !== "steer";
|
|
9349
|
+
}
|
|
9350
|
+
function countAuthoritativeQueuedTurns(turns, mutationFor) {
|
|
9351
|
+
return turns.filter((turn) => isAuthoritativeQueuedTurn(turn, mutationFor)).length;
|
|
9352
|
+
}
|
|
9353
|
+
function isOptimisticQueuedMessage(message, queuedTurnIds, snapshot) {
|
|
9354
|
+
return message.delivery === "send" && message.destination === "queue" && (!message.turnId || !queuedTurnIds.has(message.turnId)) && !(message.turnId && message.appliedQueueVersion !== null && message.appliedQueueVersion !== void 0 && snapshot && snapshot.version >= message.appliedQueueVersion);
|
|
9355
|
+
}
|
|
9356
|
+
function countOptimisticQueuedMessages(messages, queuedTurnIds, snapshot) {
|
|
9357
|
+
return (messages ?? []).filter(
|
|
9358
|
+
(message) => isOptimisticQueuedMessage(message, queuedTurnIds, snapshot)
|
|
9359
|
+
).length;
|
|
9360
|
+
}
|
|
9361
|
+
function sessionChromeInitialActive(input) {
|
|
9362
|
+
if (input.defaultActive != null) return input.defaultActive;
|
|
9363
|
+
return input.authoritativeQueuedCount >= 1 ? "queue" : null;
|
|
9364
|
+
}
|
|
9365
|
+
function sessionChromeShouldOfferQueue(input) {
|
|
9366
|
+
return !input.controlled && input.active === null && !input.activityOpen && input.authoritativeQueuedCount >= 1 && !input.suppressed;
|
|
9367
|
+
}
|
|
8718
9368
|
function objectValue(value) {
|
|
8719
9369
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
8720
9370
|
}
|
|
8721
|
-
function sessionChromeGoalPillState(goalStatus, continuation) {
|
|
9371
|
+
function sessionChromeGoalPillState(goalStatus, continuation, sessionStatus) {
|
|
8722
9372
|
if (goalStatus === "completed") return "completed";
|
|
8723
9373
|
if (goalStatus === "paused") return "paused";
|
|
9374
|
+
if (sessionStatus === "failed") return "session_failed";
|
|
8724
9375
|
if (!continuation) return "invariant_broken";
|
|
8725
9376
|
if (continuation.state === "running") {
|
|
8726
9377
|
return continuation.reason === "goal_turn_running" ? "pursuing" : continuation.reason === "human_turn_running" ? "waiting" : "invariant_broken";
|
|
8727
9378
|
}
|
|
8728
9379
|
if (continuation.state === "scheduled") return "scheduled";
|
|
8729
9380
|
if (continuation.state === "blocked") {
|
|
9381
|
+
if (continuation.reason === "human_turn_running") return "waiting";
|
|
8730
9382
|
return continuation.reason === "workstream_paused" || continuation.reason === "held_for_input" ? "held" : "blocked";
|
|
8731
9383
|
}
|
|
8732
9384
|
return "invariant_broken";
|
|
@@ -8776,6 +9428,12 @@ function pendingKindLabel(kind) {
|
|
|
8776
9428
|
return "Goal wake";
|
|
8777
9429
|
case "agent_message":
|
|
8778
9430
|
return "Update";
|
|
9431
|
+
case "background_command_result":
|
|
9432
|
+
return "Command result";
|
|
9433
|
+
case "session_wait_timeout":
|
|
9434
|
+
return "Wait ended";
|
|
9435
|
+
case "media_generation_result":
|
|
9436
|
+
return "Video result";
|
|
8779
9437
|
default:
|
|
8780
9438
|
return "Incoming";
|
|
8781
9439
|
}
|
|
@@ -8793,18 +9451,26 @@ function toneClass(tone, selected) {
|
|
|
8793
9451
|
}
|
|
8794
9452
|
}
|
|
8795
9453
|
function SessionChrome({
|
|
9454
|
+
compact = false,
|
|
9455
|
+
sessionStatus,
|
|
8796
9456
|
queue,
|
|
8797
9457
|
composer,
|
|
8798
9458
|
goal,
|
|
8799
9459
|
agentsPanel,
|
|
9460
|
+
commandsPanel,
|
|
9461
|
+
commandsCount = 0,
|
|
8800
9462
|
agentsSignal,
|
|
8801
9463
|
onDismissIncoming,
|
|
9464
|
+
onOpenSession,
|
|
8802
9465
|
readOnly = false,
|
|
8803
9466
|
className,
|
|
8804
9467
|
active: activeControlled,
|
|
8805
9468
|
defaultActive = null,
|
|
8806
9469
|
onActiveChange
|
|
8807
9470
|
}) {
|
|
9471
|
+
const [activityRequested, setActivityOpen] = useState13(
|
|
9472
|
+
Boolean(compact && defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
|
|
9473
|
+
);
|
|
8808
9474
|
const reactId = useId3();
|
|
8809
9475
|
const panelId = `og-session-chrome-panel-${reactId}`;
|
|
8810
9476
|
const reduceMotion = useReducedMotion();
|
|
@@ -8813,26 +9479,52 @@ function SessionChrome({
|
|
|
8813
9479
|
const turns = queue.queue;
|
|
8814
9480
|
const queueMutationFor = queue.mutationFor;
|
|
8815
9481
|
const queuedTurns = useMemo5(
|
|
8816
|
-
() => turns.filter((turn) =>
|
|
9482
|
+
() => turns.filter((turn) => isAuthoritativeQueuedTurn(turn, queueMutationFor)),
|
|
8817
9483
|
[queueMutationFor, turns]
|
|
8818
9484
|
);
|
|
8819
9485
|
const queuedTurnIds = useMemo5(() => new Set(queuedTurns.map((turn) => turn.id)), [queuedTurns]);
|
|
8820
9486
|
const optimisticQueued = useMemo5(
|
|
8821
9487
|
() => (composer?.optimisticMessages ?? []).filter(
|
|
8822
|
-
(message) =>
|
|
9488
|
+
(message) => isOptimisticQueuedMessage(message, queuedTurnIds, queue.snapshot)
|
|
8823
9489
|
),
|
|
8824
9490
|
[composer?.optimisticMessages, queue.snapshot, queuedTurnIds]
|
|
8825
9491
|
);
|
|
8826
9492
|
const stoppingKind = composer?.stoppingAttempt ?? (queue.stoppingPreviousAttempt ? queue.effectiveControl?.state === "paused" ? "current" : "previous" : null);
|
|
8827
9493
|
const stopping = stoppingKind !== null;
|
|
8828
9494
|
const canMutateQueue = !readOnly && composer !== void 0;
|
|
8829
|
-
const
|
|
8830
|
-
const
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
9495
|
+
const elapsed = useLiveElapsed(record?.createdAt, Boolean(record));
|
|
9496
|
+
const goalState = record ? sessionChromeGoalPillState(record.status, record.continuation, sessionStatus) : null;
|
|
9497
|
+
const initialAuthoritativeQueuedCount = countAuthoritativeQueuedTurns(
|
|
9498
|
+
queue.queue,
|
|
9499
|
+
queue.mutationFor
|
|
9500
|
+
);
|
|
9501
|
+
const [activeUncontrolled, setActiveUncontrolled] = useState13(
|
|
9502
|
+
() => sessionChromeInitialActive({
|
|
9503
|
+
defaultActive,
|
|
9504
|
+
authoritativeQueuedCount: initialAuthoritativeQueuedCount
|
|
9505
|
+
})
|
|
8834
9506
|
);
|
|
8835
|
-
const
|
|
9507
|
+
const active = activeControlled !== void 0 ? activeControlled : activeUncontrolled;
|
|
9508
|
+
const activityOpen = activityRequested || Boolean(compact && active && ["incoming", "agents", "commands"].includes(active));
|
|
9509
|
+
const activityVisibleRef = useRef12(activityOpen);
|
|
9510
|
+
activityVisibleRef.current = activityOpen;
|
|
9511
|
+
const queueOfferAdmissionSuppressedRef = useRef12(
|
|
9512
|
+
defaultActive == null && initialAuthoritativeQueuedCount === 0 && countOptimisticQueuedMessages(composer?.optimisticMessages, queuedTurnIds, queue.snapshot) > 0
|
|
9513
|
+
);
|
|
9514
|
+
const queueOfferDismissedSessionIdsRef = useRef12(/* @__PURE__ */ new Set());
|
|
9515
|
+
const occupancySessionId = queuedTurns[0]?.sessionId ?? null;
|
|
9516
|
+
const setActive = (next) => {
|
|
9517
|
+
if (active === "queue" && next === null) {
|
|
9518
|
+
if (occupancySessionId) {
|
|
9519
|
+
queueOfferDismissedSessionIdsRef.current.add(occupancySessionId);
|
|
9520
|
+
} else {
|
|
9521
|
+
queueOfferAdmissionSuppressedRef.current = true;
|
|
9522
|
+
}
|
|
9523
|
+
}
|
|
9524
|
+
if (activeControlled === void 0) setActiveUncontrolled(next);
|
|
9525
|
+
onActiveChange?.(next);
|
|
9526
|
+
};
|
|
9527
|
+
const hasCommandsPanel = commandsPanel != null;
|
|
8836
9528
|
const signals = useMemo5(() => {
|
|
8837
9529
|
const rows = [];
|
|
8838
9530
|
if (incoming.length > 0) {
|
|
@@ -8844,7 +9536,7 @@ function SessionChrome({
|
|
|
8844
9536
|
tone: incoming.some(
|
|
8845
9537
|
(item) => item.classification === "action_required" || item.classification === "failure"
|
|
8846
9538
|
) ? "waiting" : "neutral",
|
|
8847
|
-
icon: /* @__PURE__ */
|
|
9539
|
+
icon: /* @__PURE__ */ jsx21(InboxIcon, { className: "size-3" })
|
|
8848
9540
|
});
|
|
8849
9541
|
}
|
|
8850
9542
|
const queuedCount = queuedTurns.length + optimisticQueued.length;
|
|
@@ -8861,11 +9553,11 @@ function SessionChrome({
|
|
|
8861
9553
|
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"}`,
|
|
8862
9554
|
...detail ? { detail } : {},
|
|
8863
9555
|
tone: queueProblem ? "waiting" : "neutral",
|
|
8864
|
-
icon: queueProblem ? /* @__PURE__ */
|
|
9556
|
+
icon: queueProblem ? /* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3" }) : voiceOnly ? /* @__PURE__ */ jsx21(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx21(ListOrderedIcon, { className: "size-3" })
|
|
8865
9557
|
});
|
|
8866
9558
|
}
|
|
8867
9559
|
if (record && goalState) {
|
|
8868
|
-
const waiting = goalState === "waiting" || goalState === "blocked" || goalState === "held" || goalState === "paused";
|
|
9560
|
+
const waiting = goalState === "waiting" || goalState === "blocked" || goalState === "session_failed" || goalState === "held" || goalState === "paused";
|
|
8869
9561
|
const explanation = sessionChromeGoalPillExplanation(goalState, record);
|
|
8870
9562
|
rows.push({
|
|
8871
9563
|
id: "goal",
|
|
@@ -8873,7 +9565,7 @@ function SessionChrome({
|
|
|
8873
9565
|
detail: elapsed ? `${elapsed} \xB7 ${record.text}` : record.text,
|
|
8874
9566
|
...explanation ? { title: explanation } : {},
|
|
8875
9567
|
tone: waiting ? "waiting" : goalState === "pursuing" || goalState === "scheduled" ? "accent" : "neutral",
|
|
8876
|
-
icon:
|
|
9568
|
+
icon: /* @__PURE__ */ jsx21(TargetIcon3, { className: "size-3" })
|
|
8877
9569
|
});
|
|
8878
9570
|
}
|
|
8879
9571
|
if (agentsSignal && agentsSignal.count > 0) {
|
|
@@ -8883,11 +9575,22 @@ function SessionChrome({
|
|
|
8883
9575
|
label: `${agentsSignal.count} agent${agentsSignal.count === 1 ? "" : "s"}`,
|
|
8884
9576
|
...detail ? { detail } : {},
|
|
8885
9577
|
tone: agentsSignal.tone ?? "neutral",
|
|
8886
|
-
icon: /* @__PURE__ */
|
|
9578
|
+
icon: /* @__PURE__ */ jsx21(BotIcon3, { className: "size-3" })
|
|
9579
|
+
});
|
|
9580
|
+
}
|
|
9581
|
+
if (commandsCount > 0 || active === "commands" && hasCommandsPanel) {
|
|
9582
|
+
rows.push({
|
|
9583
|
+
id: "commands",
|
|
9584
|
+
label: commandsCount > 0 ? `${commandsCount} command${commandsCount === 1 ? "" : "s"}` : "Commands",
|
|
9585
|
+
tone: commandsCount > 0 ? "running" : "neutral",
|
|
9586
|
+
icon: /* @__PURE__ */ jsx21(TerminalIcon2, { className: "size-3" })
|
|
8887
9587
|
});
|
|
8888
9588
|
}
|
|
8889
9589
|
return rows;
|
|
8890
9590
|
}, [
|
|
9591
|
+
commandsCount,
|
|
9592
|
+
hasCommandsPanel,
|
|
9593
|
+
active,
|
|
8891
9594
|
agentsSignal,
|
|
8892
9595
|
elapsed,
|
|
8893
9596
|
goalState,
|
|
@@ -8898,16 +9601,8 @@ function SessionChrome({
|
|
|
8898
9601
|
queuedTurns,
|
|
8899
9602
|
record
|
|
8900
9603
|
]);
|
|
8901
|
-
const [activeUncontrolled, setActiveUncontrolled] = useState13(
|
|
8902
|
-
defaultActive
|
|
8903
|
-
);
|
|
8904
|
-
const active = activeControlled !== void 0 ? activeControlled : activeUncontrolled;
|
|
8905
|
-
const setActive = (next) => {
|
|
8906
|
-
if (activeControlled === void 0) setActiveUncontrolled(next);
|
|
8907
|
-
onActiveChange?.(next);
|
|
8908
|
-
};
|
|
8909
9604
|
const optimisticQueueKeys = optimisticQueued.map((message) => message.clientEventId).join(",");
|
|
8910
|
-
const previousOptimisticQueueKeys =
|
|
9605
|
+
const previousOptimisticQueueKeys = useRef12(optimisticQueueKeys);
|
|
8911
9606
|
const [queueArrivalNonce, setQueueArrivalNonce] = useState13(0);
|
|
8912
9607
|
useEffect11(() => {
|
|
8913
9608
|
const previous = new Set(previousOptimisticQueueKeys.current.split(",").filter(Boolean));
|
|
@@ -8915,12 +9610,47 @@ function SessionChrome({
|
|
|
8915
9610
|
previousOptimisticQueueKeys.current = optimisticQueueKeys;
|
|
8916
9611
|
if (!arrived) return;
|
|
8917
9612
|
setQueueArrivalNonce((current) => current + 1);
|
|
8918
|
-
|
|
9613
|
+
if (activeControlled === void 0 && active === null) {
|
|
9614
|
+
queueOfferAdmissionSuppressedRef.current = true;
|
|
9615
|
+
}
|
|
9616
|
+
}, [active, activeControlled, optimisticQueueKeys, optimisticQueued]);
|
|
9617
|
+
const queueOccupied = queuedTurns.length > 0 || optimisticQueued.length > 0;
|
|
9618
|
+
useEffect11(() => {
|
|
9619
|
+
if (queueOccupied) return;
|
|
9620
|
+
queueOfferAdmissionSuppressedRef.current = false;
|
|
9621
|
+
queueOfferDismissedSessionIdsRef.current.clear();
|
|
9622
|
+
}, [queueOccupied]);
|
|
9623
|
+
const queueOfferSuppressed = queueOfferAdmissionSuppressedRef.current || occupancySessionId != null && queueOfferDismissedSessionIdsRef.current.has(occupancySessionId);
|
|
9624
|
+
useEffect11(() => {
|
|
9625
|
+
if (!sessionChromeShouldOfferQueue({
|
|
9626
|
+
controlled: activeControlled !== void 0,
|
|
9627
|
+
active,
|
|
9628
|
+
activityOpen,
|
|
9629
|
+
authoritativeQueuedCount: queuedTurns.length,
|
|
9630
|
+
suppressed: queueOfferSuppressed
|
|
9631
|
+
})) {
|
|
9632
|
+
return;
|
|
9633
|
+
}
|
|
9634
|
+
if (activeControlled === void 0) setActiveUncontrolled("queue");
|
|
9635
|
+
onActiveChange?.("queue");
|
|
9636
|
+
}, [
|
|
9637
|
+
active,
|
|
9638
|
+
activeControlled,
|
|
9639
|
+
activityOpen,
|
|
9640
|
+
occupancySessionId,
|
|
9641
|
+
onActiveChange,
|
|
9642
|
+
queueOfferSuppressed,
|
|
9643
|
+
queuedTurns.length
|
|
9644
|
+
]);
|
|
8919
9645
|
const [replaceDraftFor, setReplaceDraftFor] = useState13(null);
|
|
8920
|
-
const chipRefs =
|
|
8921
|
-
const railRef =
|
|
9646
|
+
const chipRefs = useRef12({});
|
|
9647
|
+
const railRef = useRef12(null);
|
|
8922
9648
|
const [pill, setPill] = useState13({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
|
|
8923
9649
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
9650
|
+
useEffect11(() => {
|
|
9651
|
+
if (compact && !signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)))
|
|
9652
|
+
setActivityOpen(false);
|
|
9653
|
+
}, [compact, signals]);
|
|
8924
9654
|
useEffect11(() => {
|
|
8925
9655
|
if (active && !signalIds.split(",").includes(active)) {
|
|
8926
9656
|
if (activeControlled === void 0) setActiveUncontrolled(null);
|
|
@@ -8941,7 +9671,10 @@ function SessionChrome({
|
|
|
8941
9671
|
return;
|
|
8942
9672
|
}
|
|
8943
9673
|
const chip = chipRefs.current[active];
|
|
8944
|
-
if (!chip)
|
|
9674
|
+
if (!chip) {
|
|
9675
|
+
setPill((prev) => ({ ...prev, opacity: 0 }));
|
|
9676
|
+
return;
|
|
9677
|
+
}
|
|
8945
9678
|
const railBox = rail.getBoundingClientRect();
|
|
8946
9679
|
const chipBox = chip.getBoundingClientRect();
|
|
8947
9680
|
setPill({
|
|
@@ -8970,7 +9703,14 @@ function SessionChrome({
|
|
|
8970
9703
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
8971
9704
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
8972
9705
|
const ease = [0.22, 1, 0.36, 1];
|
|
8973
|
-
const panelBody = active === "incoming" ? /* @__PURE__ */
|
|
9706
|
+
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx21(
|
|
9707
|
+
IncomingPanel,
|
|
9708
|
+
{
|
|
9709
|
+
inputs: incoming,
|
|
9710
|
+
onDismiss: onDismissIncoming,
|
|
9711
|
+
onOpenSession
|
|
9712
|
+
}
|
|
9713
|
+
) : active === "queue" ? /* @__PURE__ */ jsx21(
|
|
8974
9714
|
QueuePanel,
|
|
8975
9715
|
{
|
|
8976
9716
|
turns: queuedTurns,
|
|
@@ -9021,15 +9761,15 @@ function SessionChrome({
|
|
|
9021
9761
|
void queue.moveTurn(turnId, beforeTurnId);
|
|
9022
9762
|
} : void 0
|
|
9023
9763
|
}
|
|
9024
|
-
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */
|
|
9025
|
-
return /* @__PURE__ */
|
|
9764
|
+
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx21(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "commands" ? /* @__PURE__ */ jsx21("div", { "data-og-session-chrome-panel": "commands", children: commandsPanel }) : active === "agents" ? /* @__PURE__ */ jsx21("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx21("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
|
|
9765
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx21(
|
|
9026
9766
|
"div",
|
|
9027
9767
|
{
|
|
9028
9768
|
className: cn("og-session-chrome og-root w-full", className),
|
|
9029
9769
|
"data-testid": "session-chrome",
|
|
9030
9770
|
"data-og-session-chrome": "",
|
|
9031
9771
|
"data-og-session-chrome-open": open ? "true" : "false",
|
|
9032
|
-
children: /* @__PURE__ */
|
|
9772
|
+
children: /* @__PURE__ */ jsxs15(
|
|
9033
9773
|
"div",
|
|
9034
9774
|
{
|
|
9035
9775
|
className: cn(
|
|
@@ -9038,14 +9778,14 @@ function SessionChrome({
|
|
|
9038
9778
|
),
|
|
9039
9779
|
style: {
|
|
9040
9780
|
borderRadius: "var(--_og-session-chrome-radius)",
|
|
9041
|
-
background: open ? "var(--_og-session-chrome-surface-open)" : "var(--_og-session-chrome-surface)",
|
|
9042
|
-
borderColor: open ? "var(--_og-session-chrome-border-open)" : "var(--_og-session-chrome-border)",
|
|
9043
|
-
boxShadow: open ? "var(--og-session-chrome-shadow-open)" : "var(--og-session-chrome-shadow)",
|
|
9781
|
+
background: compact ? "transparent" : open ? "var(--_og-session-chrome-surface-open)" : "var(--_og-session-chrome-surface)",
|
|
9782
|
+
borderColor: compact ? "transparent" : open ? "var(--_og-session-chrome-border-open)" : "var(--_og-session-chrome-border)",
|
|
9783
|
+
boxShadow: compact ? "none" : open ? "var(--og-session-chrome-shadow-open)" : "var(--og-session-chrome-shadow)",
|
|
9044
9784
|
transitionDuration: "var(--og-session-chrome-duration)",
|
|
9045
9785
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
9046
9786
|
},
|
|
9047
9787
|
children: [
|
|
9048
|
-
/* @__PURE__ */
|
|
9788
|
+
/* @__PURE__ */ jsx21(
|
|
9049
9789
|
"div",
|
|
9050
9790
|
{
|
|
9051
9791
|
className: "relative",
|
|
@@ -9055,17 +9795,17 @@ function SessionChrome({
|
|
|
9055
9795
|
paddingLeft: "var(--og-session-chrome-rail-pad)",
|
|
9056
9796
|
paddingRight: "var(--og-session-chrome-rail-pad)"
|
|
9057
9797
|
},
|
|
9058
|
-
children: /* @__PURE__ */
|
|
9798
|
+
children: /* @__PURE__ */ jsxs15(
|
|
9059
9799
|
"div",
|
|
9060
9800
|
{
|
|
9061
9801
|
ref: railRef,
|
|
9062
|
-
className: "relative flex flex-
|
|
9802
|
+
className: cn("relative flex items-center", compact ? "flex-nowrap" : "flex-wrap"),
|
|
9063
9803
|
style: {
|
|
9064
|
-
gap: "var(--og-session-chrome-chip-gap)"
|
|
9804
|
+
gap: compact ? "10px" : "var(--og-session-chrome-chip-gap)"
|
|
9065
9805
|
},
|
|
9066
9806
|
children: [
|
|
9067
|
-
/* @__PURE__ */
|
|
9068
|
-
|
|
9807
|
+
/* @__PURE__ */ jsx21(
|
|
9808
|
+
motion3.div,
|
|
9069
9809
|
{
|
|
9070
9810
|
"aria-hidden": true,
|
|
9071
9811
|
className: "pointer-events-none absolute left-0 top-0 rounded-og-md",
|
|
@@ -9084,67 +9824,158 @@ function SessionChrome({
|
|
|
9084
9824
|
transition: { duration: shellDuration, ease }
|
|
9085
9825
|
}
|
|
9086
9826
|
),
|
|
9087
|
-
signals.
|
|
9827
|
+
signals.filter(
|
|
9828
|
+
(signal) => !compact || !["incoming", "agents", "commands"].includes(signal.id)
|
|
9829
|
+
).map((signal) => {
|
|
9088
9830
|
const selected = active === signal.id;
|
|
9089
|
-
return /* @__PURE__ */
|
|
9090
|
-
"
|
|
9831
|
+
return /* @__PURE__ */ jsxs15(
|
|
9832
|
+
"div",
|
|
9091
9833
|
{
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
chipRefs.current[signal.id] = node;
|
|
9095
|
-
},
|
|
9096
|
-
"aria-expanded": selected,
|
|
9097
|
-
"aria-controls": panelId,
|
|
9098
|
-
"aria-label": selected ? `Close ${signal.label}` : void 0,
|
|
9099
|
-
"data-testid": `session-chrome-${signal.id}`,
|
|
9100
|
-
"data-og-session-chrome-signal": signal.id,
|
|
9101
|
-
title: signal.title,
|
|
9102
|
-
onClick: () => setActive(selected ? null : signal.id),
|
|
9834
|
+
role: "group",
|
|
9835
|
+
"aria-label": signal.id === "queue" ? "Queued messages and actions" : signal.id === "goal" ? "Goal and actions" : signal.label,
|
|
9103
9836
|
className: cn(
|
|
9104
|
-
"group relative z-[1] inline-flex min-
|
|
9105
|
-
|
|
9106
|
-
"
|
|
9107
|
-
"transition-colors duration-150 motion-reduce:transition-none",
|
|
9108
|
-
"hover:text-og-fg focus-visible:bg-og-surface-3/50",
|
|
9109
|
-
selected ? "text-og-fg" : "text-og-fg-muted"
|
|
9837
|
+
"group/signal relative z-[1] inline-flex min-w-0 max-w-full items-center rounded-og-md",
|
|
9838
|
+
compact && "bg-og-surface-2/60 px-0.5",
|
|
9839
|
+
compact && selected && "bg-og-surface-3"
|
|
9110
9840
|
),
|
|
9111
|
-
style: {
|
|
9112
|
-
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
9113
|
-
},
|
|
9114
9841
|
children: [
|
|
9115
|
-
|
|
9116
|
-
|
|
9842
|
+
/* @__PURE__ */ jsxs15(
|
|
9843
|
+
"button",
|
|
9117
9844
|
{
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9845
|
+
type: "button",
|
|
9846
|
+
ref: (node) => {
|
|
9847
|
+
chipRefs.current[signal.id] = node;
|
|
9848
|
+
},
|
|
9849
|
+
"aria-expanded": selected,
|
|
9850
|
+
"aria-controls": panelId,
|
|
9851
|
+
"aria-label": compact && signal.id === "goal" ? `Goal \xB7 ${goalState === "pursuing" ? "Running" : signal.label}` : selected ? `Close ${signal.label}` : void 0,
|
|
9852
|
+
"data-testid": `session-chrome-${signal.id}`,
|
|
9853
|
+
"data-og-session-chrome-signal": signal.id,
|
|
9854
|
+
title: signal.title ?? (compact ? signal.label : void 0),
|
|
9855
|
+
onClick: () => {
|
|
9856
|
+
if (compact) setActivityOpen(false);
|
|
9857
|
+
setActive(selected ? null : signal.id);
|
|
9858
|
+
},
|
|
9859
|
+
className: cn(
|
|
9860
|
+
"group relative z-[1] inline-flex min-w-0 min-h-[var(--og-session-chrome-chip-min-height)] max-w-full items-center gap-1 rounded-og-md py-1 text-left text-og-xs outline-hidden",
|
|
9861
|
+
// Coarse pointers keep a 44px target (session-pins acceptance).
|
|
9862
|
+
"pointer-coarse:min-h-11",
|
|
9863
|
+
"transition-colors duration-150 motion-reduce:transition-none",
|
|
9864
|
+
"hover:text-og-fg focus-visible:bg-og-surface-3/50",
|
|
9865
|
+
selected ? "text-og-fg" : "text-og-fg-muted"
|
|
9866
|
+
),
|
|
9867
|
+
style: {
|
|
9868
|
+
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
9869
|
+
},
|
|
9870
|
+
children: [
|
|
9871
|
+
signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */ jsx21(
|
|
9872
|
+
motion3.span,
|
|
9873
|
+
{
|
|
9874
|
+
"aria-hidden": "true",
|
|
9875
|
+
"data-testid": "session-chrome-queue-arrival",
|
|
9876
|
+
className: "pointer-events-none absolute inset-0 rounded-og-md bg-og-accent-soft",
|
|
9877
|
+
initial: { opacity: 0 },
|
|
9878
|
+
animate: { opacity: [0, 0.38, 0] },
|
|
9879
|
+
transition: { duration: 0.72, times: [0, 0.18, 1], ease }
|
|
9880
|
+
},
|
|
9881
|
+
queueArrivalNonce
|
|
9882
|
+
) : null,
|
|
9883
|
+
/* @__PURE__ */ jsx21("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
9884
|
+
/* @__PURE__ */ jsxs15(
|
|
9885
|
+
"span",
|
|
9886
|
+
{
|
|
9887
|
+
className: cn(
|
|
9888
|
+
"font-medium text-og-fg",
|
|
9889
|
+
compact ? "min-w-0 truncate" : "shrink-0"
|
|
9890
|
+
),
|
|
9891
|
+
children: [
|
|
9892
|
+
compact && signal.id === "goal" ? "Goal \xB7 " : null,
|
|
9893
|
+
compact && signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : compact && signal.id === "queue" ? `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
|
|
9894
|
+
]
|
|
9895
|
+
}
|
|
9896
|
+
),
|
|
9897
|
+
signal.detail && !compact ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
9898
|
+
/* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "shrink-0 text-og-fg-subtle/60", children: "\xB7" }),
|
|
9899
|
+
/* @__PURE__ */ jsx21("span", { className: "min-w-0 max-w-[8.5rem] truncate text-og-fg sm:max-w-[12rem]", children: signal.detail })
|
|
9900
|
+
] }) : null,
|
|
9901
|
+
selected && !compact ? /* @__PURE__ */ jsx21(
|
|
9902
|
+
"span",
|
|
9903
|
+
{
|
|
9904
|
+
"data-testid": "session-chrome-close",
|
|
9905
|
+
className: "ml-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-og-sm text-og-fg-subtle transition-colors group-hover:text-og-fg pointer-coarse:size-5",
|
|
9906
|
+
"aria-hidden": true,
|
|
9907
|
+
children: /* @__PURE__ */ jsx21(XIcon, { className: "size-3" })
|
|
9908
|
+
}
|
|
9909
|
+
) : null
|
|
9910
|
+
]
|
|
9911
|
+
}
|
|
9912
|
+
),
|
|
9913
|
+
signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs15("div", { className: cn("flex shrink-0 items-center pr-1", compact && "pl-0.5"), children: [
|
|
9914
|
+
record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx21(
|
|
9915
|
+
IconAction,
|
|
9916
|
+
{
|
|
9917
|
+
label: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
9918
|
+
tip: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
9919
|
+
disabled: goal.updating,
|
|
9920
|
+
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
9921
|
+
children: goal.updating ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx21(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx21(PauseIcon2, { className: "size-3" })
|
|
9922
|
+
}
|
|
9923
|
+
) : null,
|
|
9924
|
+
/* @__PURE__ */ jsx21(
|
|
9925
|
+
IconAction,
|
|
9926
|
+
{
|
|
9927
|
+
label: "Clear goal",
|
|
9928
|
+
tip: "Clear goal",
|
|
9929
|
+
danger: true,
|
|
9930
|
+
disabled: goal.updating,
|
|
9931
|
+
onClick: () => void goal.deleteGoal(),
|
|
9932
|
+
children: /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
|
|
9933
|
+
}
|
|
9934
|
+
)
|
|
9935
|
+
] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */ jsx21("div", { className: cn("flex shrink-0 items-center pr-1", compact && "pl-0.5"), children: /* @__PURE__ */ jsx21(
|
|
9936
|
+
IconAction,
|
|
9135
9937
|
{
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9938
|
+
label: "Steer first queued message",
|
|
9939
|
+
text: "Steer",
|
|
9940
|
+
tip: QUEUE_STEER_TIP,
|
|
9941
|
+
disabled: queue.mutating || Boolean(queue.mutationFor(queuedTurns[0].id)),
|
|
9942
|
+
onClick: () => void queue.steerTurn(queuedTurns[0].id),
|
|
9943
|
+
children: /* @__PURE__ */ jsx21(CornerDownRightIcon, { className: "size-3" })
|
|
9140
9944
|
}
|
|
9141
|
-
) : null
|
|
9945
|
+
) }) : null
|
|
9142
9946
|
]
|
|
9143
9947
|
},
|
|
9144
9948
|
signal.id
|
|
9145
9949
|
);
|
|
9146
9950
|
}),
|
|
9147
|
-
|
|
9951
|
+
compact && signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs15(
|
|
9952
|
+
"button",
|
|
9953
|
+
{
|
|
9954
|
+
type: "button",
|
|
9955
|
+
"aria-label": "Session activity",
|
|
9956
|
+
title: activityOpen ? "Close activity" : "Inbox, agents and commands",
|
|
9957
|
+
"aria-controls": panelId,
|
|
9958
|
+
"aria-expanded": activityOpen,
|
|
9959
|
+
onClick: () => {
|
|
9960
|
+
setActivityOpen(!activityOpen);
|
|
9961
|
+
setActive(
|
|
9962
|
+
activityOpen ? null : signals.find(
|
|
9963
|
+
(signal) => ["incoming", "agents", "commands"].includes(signal.id)
|
|
9964
|
+
)?.id ?? null
|
|
9965
|
+
);
|
|
9966
|
+
},
|
|
9967
|
+
className: cn(
|
|
9968
|
+
"ml-auto inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 rounded-og-md px-2 text-og-xs transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
9969
|
+
activityOpen ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg"
|
|
9970
|
+
),
|
|
9971
|
+
children: [
|
|
9972
|
+
/* @__PURE__ */ jsx21(ActivityIcon, { className: "size-3.5" }),
|
|
9973
|
+
/* @__PURE__ */ jsx21("span", { className: "sr-only", children: "Activity" }),
|
|
9974
|
+
incoming.length > 0 ? /* @__PURE__ */ jsx21("span", { className: "size-1.5 rounded-full bg-og-accent" }) : null
|
|
9975
|
+
]
|
|
9976
|
+
}
|
|
9977
|
+
) : null,
|
|
9978
|
+
stopping ? /* @__PURE__ */ jsxs15(
|
|
9148
9979
|
"span",
|
|
9149
9980
|
{
|
|
9150
9981
|
role: "status",
|
|
@@ -9152,7 +9983,7 @@ function SessionChrome({
|
|
|
9152
9983
|
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",
|
|
9153
9984
|
"data-testid": "session-chrome-stopping",
|
|
9154
9985
|
children: [
|
|
9155
|
-
/* @__PURE__ */
|
|
9986
|
+
/* @__PURE__ */ jsx21(
|
|
9156
9987
|
Loader2Icon2,
|
|
9157
9988
|
{
|
|
9158
9989
|
"aria-hidden": "true",
|
|
@@ -9168,7 +9999,41 @@ function SessionChrome({
|
|
|
9168
9999
|
)
|
|
9169
10000
|
}
|
|
9170
10001
|
),
|
|
9171
|
-
/* @__PURE__ */
|
|
10002
|
+
/* @__PURE__ */ jsx21(AnimatePresence2, { initial: false, children: compact && activityOpen ? /* @__PURE__ */ jsx21(
|
|
10003
|
+
motion3.div,
|
|
10004
|
+
{
|
|
10005
|
+
initial: { height: 0, opacity: 0 },
|
|
10006
|
+
animate: { height: "auto", opacity: 1 },
|
|
10007
|
+
exit: { height: 0, opacity: 0 },
|
|
10008
|
+
transition: { duration: shellDuration, ease },
|
|
10009
|
+
style: { overflow: "hidden" },
|
|
10010
|
+
children: /* @__PURE__ */ jsx21("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(
|
|
10011
|
+
"button",
|
|
10012
|
+
{
|
|
10013
|
+
type: "button",
|
|
10014
|
+
"aria-expanded": active === signal.id,
|
|
10015
|
+
onClick: () => {
|
|
10016
|
+
if (activityVisibleRef.current) setActive(signal.id);
|
|
10017
|
+
},
|
|
10018
|
+
className: cn(
|
|
10019
|
+
"inline-flex min-h-9 items-center gap-1.5 rounded-og-md px-2 text-og-xs pointer-coarse:min-h-11",
|
|
10020
|
+
active === signal.id ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:text-og-fg"
|
|
10021
|
+
),
|
|
10022
|
+
children: [
|
|
10023
|
+
signal.icon,
|
|
10024
|
+
signal.id === "incoming" ? `${incoming.length} incoming` : signal.label
|
|
10025
|
+
]
|
|
10026
|
+
},
|
|
10027
|
+
signal.id
|
|
10028
|
+
)) })
|
|
10029
|
+
},
|
|
10030
|
+
"activity-tabs"
|
|
10031
|
+
) : null }),
|
|
10032
|
+
goal?.mutationError ? /* @__PURE__ */ jsxs15("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
|
|
10033
|
+
"Goal action not confirmed. ",
|
|
10034
|
+
goal.mutationError.message
|
|
10035
|
+
] }) : null,
|
|
10036
|
+
/* @__PURE__ */ jsx21(
|
|
9172
10037
|
"div",
|
|
9173
10038
|
{
|
|
9174
10039
|
id: panelId,
|
|
@@ -9184,33 +10049,48 @@ function SessionChrome({
|
|
|
9184
10049
|
transitionDuration: "var(--og-session-chrome-duration)",
|
|
9185
10050
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
9186
10051
|
},
|
|
9187
|
-
children: /* @__PURE__ */
|
|
10052
|
+
children: /* @__PURE__ */ jsx21("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs15(
|
|
9188
10053
|
"div",
|
|
9189
10054
|
{
|
|
9190
|
-
className:
|
|
10055
|
+
className: cn(
|
|
10056
|
+
"relative overflow-y-auto overscroll-contain",
|
|
10057
|
+
compact ? activityOpen ? "rounded-b-og-lg bg-og-surface-2/50" : "mt-1 rounded-og-lg bg-og-surface-2/50" : "border-t border-og-border/50"
|
|
10058
|
+
),
|
|
9191
10059
|
style: {
|
|
9192
10060
|
maxHeight: "var(--og-session-chrome-panel-max-height)",
|
|
9193
10061
|
paddingInline: "var(--og-session-chrome-panel-pad-x)",
|
|
9194
10062
|
paddingBlock: "var(--og-session-chrome-panel-pad-y)"
|
|
9195
10063
|
},
|
|
9196
|
-
children:
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
opacity:
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
10064
|
+
children: [
|
|
10065
|
+
/* @__PURE__ */ jsx21(AnimatePresence2, { initial: false, children: active && active !== "commands" && panelBody ? /* @__PURE__ */ jsx21(
|
|
10066
|
+
motion3.div,
|
|
10067
|
+
{
|
|
10068
|
+
"data-og-session-chrome-panel-frame": active,
|
|
10069
|
+
initial: reduceMotion ? false : { opacity: 0 },
|
|
10070
|
+
animate: { opacity: 1, position: "relative" },
|
|
10071
|
+
exit: reduceMotion ? { opacity: 1, position: "relative" } : {
|
|
10072
|
+
opacity: 0,
|
|
10073
|
+
position: "absolute",
|
|
10074
|
+
top: 0,
|
|
10075
|
+
left: 0,
|
|
10076
|
+
right: 0
|
|
10077
|
+
},
|
|
10078
|
+
transition: { duration: crossfadeDuration, ease },
|
|
10079
|
+
children: panelBody
|
|
9208
10080
|
},
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
10081
|
+
active
|
|
10082
|
+
) : null }),
|
|
10083
|
+
active === "commands" ? /* @__PURE__ */ jsx21(
|
|
10084
|
+
motion3.div,
|
|
10085
|
+
{
|
|
10086
|
+
initial: reduceMotion ? false : { opacity: 0 },
|
|
10087
|
+
animate: { opacity: 1 },
|
|
10088
|
+
transition: { duration: crossfadeDuration, ease },
|
|
10089
|
+
children: panelBody
|
|
10090
|
+
},
|
|
10091
|
+
"commands"
|
|
10092
|
+
) : null
|
|
10093
|
+
]
|
|
9214
10094
|
}
|
|
9215
10095
|
) })
|
|
9216
10096
|
}
|
|
@@ -9223,46 +10103,60 @@ function SessionChrome({
|
|
|
9223
10103
|
}
|
|
9224
10104
|
function IncomingPanel({
|
|
9225
10105
|
inputs,
|
|
9226
|
-
onDismiss
|
|
10106
|
+
onDismiss,
|
|
10107
|
+
onOpenSession
|
|
9227
10108
|
}) {
|
|
9228
|
-
return /* @__PURE__ */
|
|
9229
|
-
"
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
"
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
10109
|
+
return /* @__PURE__ */ jsxs15("div", { children: [
|
|
10110
|
+
/* @__PURE__ */ jsx21("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
|
|
10111
|
+
/* @__PURE__ */ jsx21(
|
|
10112
|
+
"ul",
|
|
10113
|
+
{
|
|
10114
|
+
className: "flex flex-col gap-0.5",
|
|
10115
|
+
"aria-label": "Incoming updates",
|
|
10116
|
+
"data-og-session-chrome-panel": "incoming",
|
|
10117
|
+
children: inputs.map((input) => /* @__PURE__ */ jsxs15(
|
|
10118
|
+
"li",
|
|
10119
|
+
{
|
|
10120
|
+
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)]",
|
|
10121
|
+
children: [
|
|
10122
|
+
/* @__PURE__ */ jsx21(
|
|
10123
|
+
"span",
|
|
10124
|
+
{
|
|
10125
|
+
className: cn(
|
|
10126
|
+
"mt-px shrink-0 rounded px-1 py-px text-[10px] font-medium leading-4",
|
|
10127
|
+
input.classification === "action_required" || input.classification === "failure" ? "bg-og-status-waiting/12 text-og-status-waiting" : "bg-og-surface-3/80 text-og-fg-muted"
|
|
10128
|
+
),
|
|
10129
|
+
children: pendingKindLabel(input.kind)
|
|
10130
|
+
}
|
|
10131
|
+
),
|
|
10132
|
+
/* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
|
|
10133
|
+
/* @__PURE__ */ jsx21("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
|
|
10134
|
+
/* @__PURE__ */ jsx21(
|
|
10135
|
+
ChildSessionLink,
|
|
10136
|
+
{
|
|
10137
|
+
kind: input.kind,
|
|
10138
|
+
sourceId: input.sourceId,
|
|
10139
|
+
onOpenSession
|
|
10140
|
+
}
|
|
10141
|
+
)
|
|
10142
|
+
] }),
|
|
10143
|
+
onDismiss ? /* @__PURE__ */ jsx21("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__ */ jsx21(
|
|
10144
|
+
IconAction,
|
|
10145
|
+
{
|
|
10146
|
+
label: `Dismiss incoming ${pendingKindLabel(input.kind)}`,
|
|
10147
|
+
tip: "Dismiss",
|
|
10148
|
+
onClick: () => onDismiss(input.id),
|
|
10149
|
+
danger: true,
|
|
10150
|
+
children: /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
|
|
10151
|
+
}
|
|
10152
|
+
) }) : null
|
|
10153
|
+
]
|
|
10154
|
+
},
|
|
10155
|
+
input.id
|
|
10156
|
+
))
|
|
10157
|
+
}
|
|
10158
|
+
)
|
|
10159
|
+
] });
|
|
9266
10160
|
}
|
|
9267
10161
|
function QueuePanel({
|
|
9268
10162
|
turns,
|
|
@@ -9301,7 +10195,7 @@ function QueuePanel({
|
|
|
9301
10195
|
);
|
|
9302
10196
|
return () => clearTimeout(timer);
|
|
9303
10197
|
}, [reduceMotion, turnIdsKey]);
|
|
9304
|
-
return /* @__PURE__ */
|
|
10198
|
+
return /* @__PURE__ */ jsxs15(
|
|
9305
10199
|
"ol",
|
|
9306
10200
|
{
|
|
9307
10201
|
className: "flex flex-col gap-0.5",
|
|
@@ -9317,65 +10211,66 @@ function QueuePanel({
|
|
|
9317
10211
|
const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
|
|
9318
10212
|
const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
|
|
9319
10213
|
const confirmingReplace = replaceDraftFor === turn.id;
|
|
9320
|
-
return /* @__PURE__ */
|
|
10214
|
+
return /* @__PURE__ */ jsxs15(
|
|
9321
10215
|
"li",
|
|
9322
10216
|
{
|
|
9323
10217
|
"data-queue-turn-id": turn.id,
|
|
9324
10218
|
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)]",
|
|
9325
10219
|
children: [
|
|
9326
|
-
/* @__PURE__ */
|
|
9327
|
-
voice ? /* @__PURE__ */
|
|
10220
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-1.5", children: [
|
|
10221
|
+
voice ? /* @__PURE__ */ jsx21(
|
|
9328
10222
|
AudioLinesIcon,
|
|
9329
10223
|
{
|
|
9330
10224
|
"aria-hidden": "true",
|
|
9331
10225
|
className: "mt-0.5 size-3 shrink-0 text-og-accent"
|
|
9332
10226
|
}
|
|
9333
|
-
) : /* @__PURE__ */
|
|
9334
|
-
/* @__PURE__ */
|
|
9335
|
-
showActions ? /* @__PURE__ */
|
|
9336
|
-
onMove && turns.length > 1 ? /* @__PURE__ */
|
|
9337
|
-
/* @__PURE__ */
|
|
10227
|
+
) : /* @__PURE__ */ jsx21("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
|
|
10228
|
+
/* @__PURE__ */ jsx21("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: presentation.text }),
|
|
10229
|
+
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: [
|
|
10230
|
+
onMove && turns.length > 1 ? /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10231
|
+
/* @__PURE__ */ jsx21(
|
|
9338
10232
|
IconAction,
|
|
9339
10233
|
{
|
|
9340
10234
|
label: `Move queued prompt ${index + 1} up`,
|
|
9341
10235
|
tip: "Move up",
|
|
9342
10236
|
disabled: settling || pending !== null || index === 0,
|
|
9343
10237
|
onClick: () => onMove(turn.id, beforeUp),
|
|
9344
|
-
children: /* @__PURE__ */
|
|
10238
|
+
children: /* @__PURE__ */ jsx21(ArrowUpIcon, { className: "size-3" })
|
|
9345
10239
|
}
|
|
9346
10240
|
),
|
|
9347
|
-
/* @__PURE__ */
|
|
10241
|
+
/* @__PURE__ */ jsx21(
|
|
9348
10242
|
IconAction,
|
|
9349
10243
|
{
|
|
9350
10244
|
label: `Move queued prompt ${index + 1} down`,
|
|
9351
10245
|
tip: "Move down",
|
|
9352
10246
|
disabled: settling || pending !== null || index >= turns.length - 1,
|
|
9353
10247
|
onClick: () => onMove(turn.id, beforeDown),
|
|
9354
|
-
children: /* @__PURE__ */
|
|
10248
|
+
children: /* @__PURE__ */ jsx21(ArrowDownIcon2, { className: "size-3" })
|
|
9355
10249
|
}
|
|
9356
10250
|
)
|
|
9357
10251
|
] }) : null,
|
|
9358
|
-
onSteer ? /* @__PURE__ */
|
|
10252
|
+
onSteer ? /* @__PURE__ */ jsx21(
|
|
9359
10253
|
IconAction,
|
|
9360
10254
|
{
|
|
9361
10255
|
label: `Steer queued prompt ${index + 1}`,
|
|
10256
|
+
text: "Steer",
|
|
9362
10257
|
tip: QUEUE_STEER_TIP,
|
|
9363
10258
|
disabled: settling || pending !== null,
|
|
9364
10259
|
onClick: () => onSteer(turn.id),
|
|
9365
|
-
children: pending === "steer" ? /* @__PURE__ */
|
|
10260
|
+
children: pending === "steer" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(CornerDownRightIcon, { className: "size-3" })
|
|
9366
10261
|
}
|
|
9367
10262
|
) : null,
|
|
9368
|
-
onEdit ? /* @__PURE__ */
|
|
10263
|
+
onEdit ? /* @__PURE__ */ jsx21(
|
|
9369
10264
|
IconAction,
|
|
9370
10265
|
{
|
|
9371
10266
|
label: `Edit queued prompt ${index + 1}`,
|
|
9372
10267
|
tip: QUEUE_EDIT_TIP,
|
|
9373
10268
|
disabled: settling || pending !== null,
|
|
9374
10269
|
onClick: () => onEdit(turn),
|
|
9375
|
-
children: pending === "edit" ? /* @__PURE__ */
|
|
10270
|
+
children: pending === "edit" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(PencilIcon, { className: "size-3" })
|
|
9376
10271
|
}
|
|
9377
10272
|
) : null,
|
|
9378
|
-
onRemove ? /* @__PURE__ */
|
|
10273
|
+
onRemove ? /* @__PURE__ */ jsx21(
|
|
9379
10274
|
IconAction,
|
|
9380
10275
|
{
|
|
9381
10276
|
label: `Remove queued prompt ${index + 1}`,
|
|
@@ -9383,16 +10278,16 @@ function QueuePanel({
|
|
|
9383
10278
|
disabled: settling || pending !== null,
|
|
9384
10279
|
onClick: () => onRemove(turn.id),
|
|
9385
10280
|
danger: true,
|
|
9386
|
-
children: pending === "delete" ? /* @__PURE__ */
|
|
10281
|
+
children: pending === "delete" ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" })
|
|
9387
10282
|
}
|
|
9388
10283
|
) : null
|
|
9389
10284
|
] }) : null
|
|
9390
10285
|
] }),
|
|
9391
|
-
confirmingReplace ? /* @__PURE__ */
|
|
9392
|
-
/* @__PURE__ */
|
|
9393
|
-
/* @__PURE__ */
|
|
9394
|
-
/* @__PURE__ */
|
|
9395
|
-
/* @__PURE__ */
|
|
10286
|
+
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: [
|
|
10287
|
+
/* @__PURE__ */ jsx21("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
|
|
10288
|
+
/* @__PURE__ */ jsx21("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." }),
|
|
10289
|
+
/* @__PURE__ */ jsxs15("div", { className: "mt-2 flex justify-end gap-1.5", children: [
|
|
10290
|
+
/* @__PURE__ */ jsx21(
|
|
9396
10291
|
"button",
|
|
9397
10292
|
{
|
|
9398
10293
|
type: "button",
|
|
@@ -9401,7 +10296,7 @@ function QueuePanel({
|
|
|
9401
10296
|
children: "Keep current draft"
|
|
9402
10297
|
}
|
|
9403
10298
|
),
|
|
9404
|
-
/* @__PURE__ */
|
|
10299
|
+
/* @__PURE__ */ jsx21(
|
|
9405
10300
|
"button",
|
|
9406
10301
|
{
|
|
9407
10302
|
type: "button",
|
|
@@ -9417,8 +10312,8 @@ function QueuePanel({
|
|
|
9417
10312
|
turn.id
|
|
9418
10313
|
);
|
|
9419
10314
|
}),
|
|
9420
|
-
/* @__PURE__ */
|
|
9421
|
-
|
|
10315
|
+
/* @__PURE__ */ jsx21(AnimatePresence2, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs15(
|
|
10316
|
+
motion3.li,
|
|
9422
10317
|
{
|
|
9423
10318
|
"aria-live": "polite",
|
|
9424
10319
|
"data-optimistic-queue-message": message.clientEventId,
|
|
@@ -9430,11 +10325,11 @@ function QueuePanel({
|
|
|
9430
10325
|
message.state === "failed" ? "bg-og-danger/8 text-og-danger" : "bg-og-accent-soft/45"
|
|
9431
10326
|
),
|
|
9432
10327
|
children: [
|
|
9433
|
-
/* @__PURE__ */
|
|
9434
|
-
/* @__PURE__ */
|
|
9435
|
-
/* @__PURE__ */
|
|
9436
|
-
message.state === "failed" ? /* @__PURE__ */
|
|
9437
|
-
onRetryOptimistic ? /* @__PURE__ */
|
|
10328
|
+
/* @__PURE__ */ jsx21("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
|
|
10329
|
+
/* @__PURE__ */ jsx21("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: message.text }),
|
|
10330
|
+
/* @__PURE__ */ jsx21("span", { className: "sr-only", children: message.state === "failed" ? "Not confirmed" : message.state === "sending" ? "Placing in queue" : "Queued" }),
|
|
10331
|
+
message.state === "failed" ? /* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
|
|
10332
|
+
onRetryOptimistic ? /* @__PURE__ */ jsx21(
|
|
9438
10333
|
"button",
|
|
9439
10334
|
{
|
|
9440
10335
|
type: "button",
|
|
@@ -9443,36 +10338,36 @@ function QueuePanel({
|
|
|
9443
10338
|
children: "Retry"
|
|
9444
10339
|
}
|
|
9445
10340
|
) : null,
|
|
9446
|
-
onRemoveOptimistic ? /* @__PURE__ */
|
|
10341
|
+
onRemoveOptimistic ? /* @__PURE__ */ jsx21(
|
|
9447
10342
|
"button",
|
|
9448
10343
|
{
|
|
9449
10344
|
type: "button",
|
|
9450
10345
|
"aria-label": "Dismiss unconfirmed queued prompt",
|
|
9451
10346
|
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",
|
|
9452
10347
|
onClick: () => onRemoveOptimistic(message.clientEventId),
|
|
9453
|
-
children: /* @__PURE__ */
|
|
10348
|
+
children: /* @__PURE__ */ jsx21(XIcon, { className: "size-3" })
|
|
9454
10349
|
}
|
|
9455
10350
|
) : null
|
|
9456
|
-
] }) : message.state === "sending" ? /* @__PURE__ */
|
|
10351
|
+
] }) : message.state === "sending" ? /* @__PURE__ */ jsx21(
|
|
9457
10352
|
Loader2Icon2,
|
|
9458
10353
|
{
|
|
9459
10354
|
"aria-hidden": "true",
|
|
9460
10355
|
className: "size-3 shrink-0 animate-og-spin text-og-accent motion-reduce:animate-none"
|
|
9461
10356
|
}
|
|
9462
|
-
) : /* @__PURE__ */
|
|
10357
|
+
) : /* @__PURE__ */ jsx21(CheckIcon3, { "aria-hidden": "true", className: "size-3 shrink-0 text-og-accent" })
|
|
9463
10358
|
]
|
|
9464
10359
|
},
|
|
9465
10360
|
message.clientEventId
|
|
9466
10361
|
)) }),
|
|
9467
|
-
loadError ? /* @__PURE__ */
|
|
10362
|
+
loadError ? /* @__PURE__ */ jsxs15(
|
|
9468
10363
|
"li",
|
|
9469
10364
|
{
|
|
9470
10365
|
role: "alert",
|
|
9471
10366
|
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",
|
|
9472
10367
|
children: [
|
|
9473
|
-
/* @__PURE__ */
|
|
9474
|
-
/* @__PURE__ */
|
|
9475
|
-
/* @__PURE__ */
|
|
10368
|
+
/* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
10369
|
+
/* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1", children: "Queue unavailable." }),
|
|
10370
|
+
/* @__PURE__ */ jsx21(
|
|
9476
10371
|
"button",
|
|
9477
10372
|
{
|
|
9478
10373
|
type: "button",
|
|
@@ -9484,15 +10379,15 @@ function QueuePanel({
|
|
|
9484
10379
|
]
|
|
9485
10380
|
}
|
|
9486
10381
|
) : null,
|
|
9487
|
-
mutationError ? /* @__PURE__ */
|
|
10382
|
+
mutationError ? /* @__PURE__ */ jsxs15(
|
|
9488
10383
|
"li",
|
|
9489
10384
|
{
|
|
9490
10385
|
role: "alert",
|
|
9491
10386
|
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",
|
|
9492
10387
|
children: [
|
|
9493
|
-
/* @__PURE__ */
|
|
9494
|
-
/* @__PURE__ */
|
|
9495
|
-
/* @__PURE__ */
|
|
10388
|
+
/* @__PURE__ */ jsx21(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
10389
|
+
/* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1", children: "Not confirmed. Check the queue before retrying." }),
|
|
10390
|
+
/* @__PURE__ */ jsx21(
|
|
9496
10391
|
"button",
|
|
9497
10392
|
{
|
|
9498
10393
|
type: "button",
|
|
@@ -9518,25 +10413,26 @@ function GoalPanel({
|
|
|
9518
10413
|
if (!record) return null;
|
|
9519
10414
|
const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
|
|
9520
10415
|
const explanation = sessionChromeGoalPillExplanation(state, record);
|
|
9521
|
-
return /* @__PURE__ */
|
|
9522
|
-
/* @__PURE__ */
|
|
9523
|
-
/* @__PURE__ */
|
|
9524
|
-
elapsed ? /* @__PURE__ */
|
|
9525
|
-
"\xB7 ",
|
|
9526
|
-
elapsed
|
|
10416
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
|
|
10417
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
|
|
10418
|
+
/* @__PURE__ */ jsx21("span", { children: sessionChromeGoalPillLabel(state, record) }),
|
|
10419
|
+
elapsed ? /* @__PURE__ */ jsxs15("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
|
|
10420
|
+
"\xB7 Created ",
|
|
10421
|
+
elapsed,
|
|
10422
|
+
" ago"
|
|
9527
10423
|
] }) : null,
|
|
9528
|
-
/* @__PURE__ */
|
|
10424
|
+
/* @__PURE__ */ jsxs15("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
|
|
9529
10425
|
"\xB7 v",
|
|
9530
10426
|
record.version
|
|
9531
10427
|
] })
|
|
9532
10428
|
] }),
|
|
9533
|
-
/* @__PURE__ */
|
|
9534
|
-
record.successCriteria ? /* @__PURE__ */
|
|
9535
|
-
/* @__PURE__ */
|
|
10429
|
+
/* @__PURE__ */ jsx21("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
|
|
10430
|
+
record.successCriteria ? /* @__PURE__ */ jsxs15("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
|
|
10431
|
+
/* @__PURE__ */ jsx21("span", { className: "font-medium text-og-fg", children: "Done when" }),
|
|
9536
10432
|
" ",
|
|
9537
10433
|
record.successCriteria
|
|
9538
10434
|
] }) : null,
|
|
9539
|
-
explanation ? /* @__PURE__ */
|
|
10435
|
+
explanation ? /* @__PURE__ */ jsx21(
|
|
9540
10436
|
"p",
|
|
9541
10437
|
{
|
|
9542
10438
|
"data-og-session-chrome-goal-explanation": true,
|
|
@@ -9544,20 +10440,20 @@ function GoalPanel({
|
|
|
9544
10440
|
children: explanation
|
|
9545
10441
|
}
|
|
9546
10442
|
) : null,
|
|
9547
|
-
record.continuation?.lastError ? /* @__PURE__ */
|
|
9548
|
-
/* @__PURE__ */
|
|
9549
|
-
/* @__PURE__ */
|
|
9550
|
-
/* @__PURE__ */
|
|
10443
|
+
record.continuation?.lastError ? /* @__PURE__ */ jsx21("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,
|
|
10444
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
|
|
10445
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
|
|
10446
|
+
/* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
9551
10447
|
record.autoContinuations,
|
|
9552
10448
|
" consecutive unattended continues"
|
|
9553
10449
|
] }),
|
|
9554
|
-
/* @__PURE__ */
|
|
10450
|
+
/* @__PURE__ */ jsxs15("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
9555
10451
|
record.noProgressStreak,
|
|
9556
10452
|
" stalled"
|
|
9557
10453
|
] })
|
|
9558
10454
|
] }),
|
|
9559
|
-
!readOnly ? /* @__PURE__ */
|
|
9560
|
-
canToggle ? /* @__PURE__ */
|
|
10455
|
+
!readOnly ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-0.5", children: [
|
|
10456
|
+
canToggle ? /* @__PURE__ */ jsxs15(
|
|
9561
10457
|
"button",
|
|
9562
10458
|
{
|
|
9563
10459
|
type: "button",
|
|
@@ -9565,12 +10461,12 @@ function GoalPanel({
|
|
|
9565
10461
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
9566
10462
|
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",
|
|
9567
10463
|
children: [
|
|
9568
|
-
goal.updating ? /* @__PURE__ */
|
|
10464
|
+
goal.updating ? /* @__PURE__ */ jsx21(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx21(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx21(PauseIcon2, { className: "size-3" }),
|
|
9569
10465
|
record.status === "paused" ? "Resume" : "Pause"
|
|
9570
10466
|
]
|
|
9571
10467
|
}
|
|
9572
10468
|
) : null,
|
|
9573
|
-
/* @__PURE__ */
|
|
10469
|
+
/* @__PURE__ */ jsxs15(
|
|
9574
10470
|
"button",
|
|
9575
10471
|
{
|
|
9576
10472
|
type: "button",
|
|
@@ -9578,7 +10474,7 @@ function GoalPanel({
|
|
|
9578
10474
|
onClick: () => void goal.deleteGoal(),
|
|
9579
10475
|
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",
|
|
9580
10476
|
children: [
|
|
9581
|
-
/* @__PURE__ */
|
|
10477
|
+
/* @__PURE__ */ jsx21(Trash2Icon2, { className: "size-3" }),
|
|
9582
10478
|
"Clear"
|
|
9583
10479
|
]
|
|
9584
10480
|
}
|
|
@@ -9587,13 +10483,14 @@ function GoalPanel({
|
|
|
9587
10483
|
] })
|
|
9588
10484
|
] });
|
|
9589
10485
|
}
|
|
9590
|
-
var QUEUE_STEER_TIP = /* @__PURE__ */
|
|
9591
|
-
/* @__PURE__ */
|
|
9592
|
-
/* @__PURE__ */
|
|
10486
|
+
var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs15("span", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
10487
|
+
/* @__PURE__ */ jsx21("span", { className: "font-medium", children: "Steer" }),
|
|
10488
|
+
/* @__PURE__ */ jsx21("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
|
|
9593
10489
|
] });
|
|
9594
10490
|
var QUEUE_EDIT_TIP = "Edit in composer";
|
|
9595
10491
|
var QUEUE_DELETE_TIP = "Delete this queued prompt";
|
|
9596
10492
|
function IconAction({
|
|
10493
|
+
text,
|
|
9597
10494
|
label,
|
|
9598
10495
|
tip,
|
|
9599
10496
|
onClick,
|
|
@@ -9601,8 +10498,8 @@ function IconAction({
|
|
|
9601
10498
|
danger,
|
|
9602
10499
|
children
|
|
9603
10500
|
}) {
|
|
9604
|
-
return /* @__PURE__ */
|
|
9605
|
-
/* @__PURE__ */
|
|
10501
|
+
return /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
10502
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
9606
10503
|
"button",
|
|
9607
10504
|
{
|
|
9608
10505
|
type: "button",
|
|
@@ -9610,15 +10507,110 @@ function IconAction({
|
|
|
9610
10507
|
disabled,
|
|
9611
10508
|
onClick,
|
|
9612
10509
|
className: cn(
|
|
9613
|
-
"inline-flex size-6 items-center justify-center rounded-og-sm
|
|
10510
|
+
"inline-flex size-6 items-center justify-center rounded-og-sm outline-hidden transition-colors",
|
|
9614
10511
|
"hover:bg-og-surface-2 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
9615
10512
|
"disabled:pointer-events-none disabled:opacity-40 pointer-coarse:size-9",
|
|
10513
|
+
text ? "text-og-fg" : "text-og-fg-subtle",
|
|
10514
|
+
text && "w-auto gap-1 px-1.5 text-og-xs pointer-coarse:w-auto",
|
|
9616
10515
|
danger && "hover:text-og-danger"
|
|
9617
10516
|
),
|
|
9618
|
-
children
|
|
10517
|
+
children: [
|
|
10518
|
+
children,
|
|
10519
|
+
text
|
|
10520
|
+
]
|
|
9619
10521
|
}
|
|
9620
10522
|
) }),
|
|
9621
|
-
/* @__PURE__ */
|
|
10523
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "top", children: tip })
|
|
10524
|
+
] });
|
|
10525
|
+
}
|
|
10526
|
+
|
|
10527
|
+
// src/components/session-commands-panel.tsx
|
|
10528
|
+
import { ChevronRightIcon as ChevronRightIcon4, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
|
|
10529
|
+
import { useState as useState14 } from "react";
|
|
10530
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10531
|
+
function SessionCommandsPanel({
|
|
10532
|
+
commands: state,
|
|
10533
|
+
readOnly = false
|
|
10534
|
+
}) {
|
|
10535
|
+
const [pending, setPending] = useState14(null);
|
|
10536
|
+
const [error, setError] = useState14(null);
|
|
10537
|
+
const active = state.commands.filter(
|
|
10538
|
+
(command) => command.state === "running" || command.state === "stopping"
|
|
10539
|
+
);
|
|
10540
|
+
const stop = async (id) => {
|
|
10541
|
+
setPending(id);
|
|
10542
|
+
setError(null);
|
|
10543
|
+
try {
|
|
10544
|
+
await state.cancel(id);
|
|
10545
|
+
} catch (cause) {
|
|
10546
|
+
setError(cause instanceof Error ? cause.message : "Stop was not confirmed. Try again.");
|
|
10547
|
+
} finally {
|
|
10548
|
+
setPending(null);
|
|
10549
|
+
}
|
|
10550
|
+
};
|
|
10551
|
+
return /* @__PURE__ */ jsxs16("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
|
|
10552
|
+
state.loading && active.length === 0 ? /* @__PURE__ */ jsx22("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
|
|
10553
|
+
state.error ? /* @__PURE__ */ jsxs16("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
|
|
10554
|
+
/* @__PURE__ */ jsx22("span", { children: "Commands unavailable." }),
|
|
10555
|
+
/* @__PURE__ */ jsx22(
|
|
10556
|
+
"button",
|
|
10557
|
+
{
|
|
10558
|
+
type: "button",
|
|
10559
|
+
className: "underline outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
10560
|
+
onClick: () => void state.refresh(),
|
|
10561
|
+
children: "Retry"
|
|
10562
|
+
}
|
|
10563
|
+
)
|
|
10564
|
+
] }) : null,
|
|
10565
|
+
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx22("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
|
|
10566
|
+
active.length > 0 ? /* @__PURE__ */ jsx22("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs16("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
|
|
10567
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
|
|
10568
|
+
/* @__PURE__ */ jsxs16("details", { className: "group/command", children: [
|
|
10569
|
+
/* @__PURE__ */ jsxs16(
|
|
10570
|
+
"summary",
|
|
10571
|
+
{
|
|
10572
|
+
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",
|
|
10573
|
+
title: "Expand command",
|
|
10574
|
+
children: [
|
|
10575
|
+
/* @__PURE__ */ jsx22(ChevronRightIcon4, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
|
|
10576
|
+
/* @__PURE__ */ jsx22("span", { className: "truncate", children: command.commandPreview || "Background command" })
|
|
10577
|
+
]
|
|
10578
|
+
}
|
|
10579
|
+
),
|
|
10580
|
+
/* @__PURE__ */ jsxs16("div", { className: "mt-2 space-y-1", children: [
|
|
10581
|
+
/* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandPreview || "Background command" }),
|
|
10582
|
+
/* @__PURE__ */ jsxs16(
|
|
10583
|
+
"time",
|
|
10584
|
+
{
|
|
10585
|
+
className: "block text-og-fg-subtle",
|
|
10586
|
+
dateTime: command.startedAt,
|
|
10587
|
+
title: new Date(command.startedAt).toLocaleString(),
|
|
10588
|
+
children: [
|
|
10589
|
+
"Started ",
|
|
10590
|
+
formatClockTime(command.startedAt)
|
|
10591
|
+
]
|
|
10592
|
+
}
|
|
10593
|
+
)
|
|
10594
|
+
] })
|
|
10595
|
+
] }),
|
|
10596
|
+
/* @__PURE__ */ jsx22("p", { className: "mt-1 text-og-fg-subtle", children: command.state === "stopping" ? "Stopping\u2026" : "Running" })
|
|
10597
|
+
] }),
|
|
10598
|
+
!readOnly ? /* @__PURE__ */ jsxs16(
|
|
10599
|
+
"button",
|
|
10600
|
+
{
|
|
10601
|
+
type: "button",
|
|
10602
|
+
"aria-label": `Stop ${command.commandPreview || "background command"}`,
|
|
10603
|
+
disabled: pending !== null || command.state === "stopping",
|
|
10604
|
+
onClick: () => void stop(command.id),
|
|
10605
|
+
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",
|
|
10606
|
+
children: [
|
|
10607
|
+
pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx22(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx22(SquareIcon, { className: "size-3" }),
|
|
10608
|
+
"Stop"
|
|
10609
|
+
]
|
|
10610
|
+
}
|
|
10611
|
+
) : null
|
|
10612
|
+
] }, command.id)) }) : null,
|
|
10613
|
+
error ? /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-og-danger", children: error }) : null
|
|
9622
10614
|
] });
|
|
9623
10615
|
}
|
|
9624
10616
|
|
|
@@ -9676,9 +10668,14 @@ export {
|
|
|
9676
10668
|
MessageTimeline,
|
|
9677
10669
|
TimelineRow,
|
|
9678
10670
|
QueueSurface,
|
|
10671
|
+
useAvailableModels,
|
|
10672
|
+
useWorkspaceModelCatalog,
|
|
10673
|
+
ChatComposer,
|
|
10674
|
+
SessionConversation,
|
|
9679
10675
|
sessionChromeGoalPillLabel,
|
|
9680
10676
|
sessionChromeGoalPillExplanation,
|
|
9681
10677
|
sessionChromeGoalPillState,
|
|
9682
|
-
SessionChrome
|
|
10678
|
+
SessionChrome,
|
|
10679
|
+
SessionCommandsPanel
|
|
9683
10680
|
};
|
|
9684
|
-
//# sourceMappingURL=chunk-
|
|
10681
|
+
//# sourceMappingURL=chunk-WZIMM3GX.js.map
|