@opengeni/react 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VV5E43LD.js → chunk-4OTO7KBK.js} +792 -733
- package/dist/chunk-4OTO7KBK.js.map +1 -0
- package/dist/{chunk-RLUSC2WA.js → chunk-5F4WR7X7.js} +2 -1
- package/dist/chunk-5F4WR7X7.js.map +1 -0
- package/dist/{chunk-EN3YTHKR.js → chunk-CY7WK5FD.js} +2 -2
- package/dist/{chunk-26ZNDDLZ.js → chunk-LNIRAOA3.js} +27 -8
- package/dist/chunk-LNIRAOA3.js.map +1 -0
- package/dist/{chunk-DO544OSV.js → chunk-RC6BZ44Q.js} +4 -3
- package/dist/chunk-RC6BZ44Q.js.map +1 -0
- package/dist/{chunk-WGXVEJO5.js → chunk-SGKD2OCN.js} +5 -5
- package/dist/chunk-SGKD2OCN.js.map +1 -0
- package/dist/{chunk-JIQYUGVL.js → chunk-X34BSY2R.js} +3 -3
- package/dist/components/model-mark.d.ts +3 -3
- package/dist/components/session-chrome.d.ts +1 -0
- package/dist/composer.js +4 -4
- package/dist/index.js +7 -7
- package/dist/{latest-question-HTRIS4KJ.js → latest-question-YTOBHCWR.js} +2 -2
- package/dist/{model-policy-picker-menu-M54ISBMN.js → model-policy-picker-menu-DXHUL73H.js} +4 -4
- package/dist/model-policy.d.ts +1 -0
- package/dist/model-policy.js +1 -1
- package/dist/realtime.js +2 -2
- package/dist/session-ui.js +6 -6
- package/dist/session.js +2 -2
- package/dist/timeline/genie-loading.d.ts +3 -1
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/types.d.ts +5 -1
- package/package.json +3 -3
- package/src/components/model-mark.tsx +16 -5
- package/src/components/model-policy-picker-menu.tsx +2 -2
- package/src/components/model-policy-picker.tsx +11 -3
- package/src/components/session-chrome.tsx +21 -3
- package/src/components/session-conversation.tsx +3 -0
- package/src/model-policy.ts +9 -0
- package/src/timeline/activity-rail.tsx +14 -4
- package/src/timeline/genie-loading.tsx +27 -16
- package/src/timeline/projection.ts +7 -3
- package/src/timeline/startup-dispatch-details.tsx +36 -0
- package/src/timeline/types.ts +5 -0
- package/dist/chunk-26ZNDDLZ.js.map +0 -1
- package/dist/chunk-DO544OSV.js.map +0 -1
- package/dist/chunk-RLUSC2WA.js.map +0 -1
- package/dist/chunk-VV5E43LD.js.map +0 -1
- package/dist/chunk-WGXVEJO5.js.map +0 -1
- /package/dist/{chunk-EN3YTHKR.js.map → chunk-CY7WK5FD.js.map} +0 -0
- /package/dist/{chunk-JIQYUGVL.js.map → chunk-X34BSY2R.js.map} +0 -0
- /package/dist/{latest-question-HTRIS4KJ.js.map → latest-question-YTOBHCWR.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-M54ISBMN.js.map → model-policy-picker-menu-DXHUL73H.js.map} +0 -0
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
useSessionControl,
|
|
29
29
|
useSessionEvents,
|
|
30
30
|
useTurnQueue
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-X34BSY2R.js";
|
|
32
32
|
import {
|
|
33
33
|
buildTimeline,
|
|
34
34
|
groupTimeline
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-RC6BZ44Q.js";
|
|
36
36
|
import {
|
|
37
37
|
mcpToolLeaf,
|
|
38
38
|
toolDisplayName
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
StopButton,
|
|
100
100
|
Surface,
|
|
101
101
|
useChatComposerController
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-CY7WK5FD.js";
|
|
103
103
|
import {
|
|
104
104
|
useComposer
|
|
105
105
|
} from "./chunk-RSI7XYXL.js";
|
|
@@ -112,11 +112,11 @@ import {
|
|
|
112
112
|
} from "./chunk-BRM6FVZA.js";
|
|
113
113
|
import {
|
|
114
114
|
ModelPolicyPicker
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-LNIRAOA3.js";
|
|
116
116
|
import {
|
|
117
117
|
projectPickerRows,
|
|
118
118
|
sortPickerRows
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-5F4WR7X7.js";
|
|
120
120
|
import {
|
|
121
121
|
formatBytes,
|
|
122
122
|
formatClockTime,
|
|
@@ -4072,7 +4072,8 @@ function GenieLoading({
|
|
|
4072
4072
|
startedAt,
|
|
4073
4073
|
phase = "preparing",
|
|
4074
4074
|
onShowDetails,
|
|
4075
|
-
detailsOpen = false
|
|
4075
|
+
detailsOpen = false,
|
|
4076
|
+
notice
|
|
4076
4077
|
}) {
|
|
4077
4078
|
const options = useContext4(GenieLoadingOptionsContext);
|
|
4078
4079
|
const waiting = phase === "waiting";
|
|
@@ -4083,15 +4084,16 @@ function GenieLoading({
|
|
|
4083
4084
|
const [slow, setSlow] = useState7(false);
|
|
4084
4085
|
useEffect5(() => {
|
|
4085
4086
|
const update = () => {
|
|
4086
|
-
setShowDetails(Date.now() - Date.parse(startedAt) >=
|
|
4087
|
-
setSlow(Date.now() - Date.parse(startedAt) >=
|
|
4087
|
+
setShowDetails(Date.now() - Date.parse(startedAt) >= 3e4);
|
|
4088
|
+
setSlow(Date.now() - Date.parse(startedAt) >= 6e4);
|
|
4088
4089
|
if (!document.hidden) setPhrase(Math.floor(Math.random() * phrases.length));
|
|
4089
4090
|
};
|
|
4090
4091
|
update();
|
|
4091
4092
|
const timer = window.setInterval(update, 5e3);
|
|
4092
4093
|
return () => window.clearInterval(timer);
|
|
4093
4094
|
}, [startedAt, phrases]);
|
|
4094
|
-
if (options?.render
|
|
4095
|
+
if (options?.render && !notice)
|
|
4096
|
+
return options.render({ startedAt, phase, detailsOpen, onShowDetails });
|
|
4095
4097
|
return /* @__PURE__ */ jsxs6("div", { className: "og-genie-loading", children: [
|
|
4096
4098
|
/* @__PURE__ */ jsx8(
|
|
4097
4099
|
"div",
|
|
@@ -4107,9 +4109,18 @@ function GenieLoading({
|
|
|
4107
4109
|
}
|
|
4108
4110
|
),
|
|
4109
4111
|
/* @__PURE__ */ jsxs6("div", { className: "og-genie-copy", children: [
|
|
4110
|
-
/* @__PURE__ */ jsx8("span", { className: "sr-only", role: "status", children: slow ? options?.messages?.slowStatus ?? (waiting ? "Waiting for a response. Taking longer than usual." : "Preparing your task. Taking longer than usual.") : options?.messages?.status ?? (waiting ? "Waiting for a response." : "Preparing your task.") }),
|
|
4111
|
-
/* @__PURE__ */ jsx8(
|
|
4112
|
-
|
|
4112
|
+
/* @__PURE__ */ jsx8("span", { className: "sr-only", role: "status", children: notice ?? (slow ? options?.messages?.slowStatus ?? (waiting ? "Waiting for a response. Taking longer than usual." : "Preparing your task. Taking longer than usual.") : options?.messages?.status ?? (waiting ? "Waiting for a response." : "Preparing your task.")) }),
|
|
4113
|
+
/* @__PURE__ */ jsx8(
|
|
4114
|
+
"span",
|
|
4115
|
+
{
|
|
4116
|
+
className: "og-genie-phrase",
|
|
4117
|
+
style: notice ? { animation: "none" } : void 0,
|
|
4118
|
+
"aria-hidden": "true",
|
|
4119
|
+
children: notice ?? (slow ? options?.messages?.slowText ?? (waiting ? "Still waiting for a response\u2026" : "A little longer than usual\u2026") : phrases[phrase % phrases.length])
|
|
4120
|
+
},
|
|
4121
|
+
notice ?? (slow ? "slow" : phrase)
|
|
4122
|
+
),
|
|
4123
|
+
showDetails || detailsOpen || notice ? /* @__PURE__ */ jsxs6(
|
|
4113
4124
|
"button",
|
|
4114
4125
|
{
|
|
4115
4126
|
type: "button",
|
|
@@ -4126,6 +4137,32 @@ function GenieLoading({
|
|
|
4126
4137
|
] });
|
|
4127
4138
|
}
|
|
4128
4139
|
|
|
4140
|
+
// src/timeline/startup-dispatch-details.tsx
|
|
4141
|
+
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
4142
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4143
|
+
function StartupDispatchDetails({ wait }) {
|
|
4144
|
+
const [now, setNow] = useState8(Date.now);
|
|
4145
|
+
useEffect6(() => {
|
|
4146
|
+
const timer = setInterval(() => setNow(Date.now()), 15e3);
|
|
4147
|
+
return () => clearInterval(timer);
|
|
4148
|
+
}, []);
|
|
4149
|
+
const next = wait?.nextAttemptAt ? new Date(wait.nextAttemptAt) : null;
|
|
4150
|
+
return /* @__PURE__ */ jsxs7("div", { className: "text-og-xs text-og-fg-muted", "data-og-startup-dispatch-details": "", children: [
|
|
4151
|
+
/* @__PURE__ */ jsx9("p", { children: "Your messages are saved. No agent turn is running yet." }),
|
|
4152
|
+
/* @__PURE__ */ jsx9("p", { children: wait?.state === "pending" && next ? next.getTime() <= now ? "Automatic start retry is due." : `Automatic start retry at ${next.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" })}.` : wait?.state === "acknowledged" ? "The start request was accepted; a worker has not started the turn yet." : "Start confirmation is unavailable." }),
|
|
4153
|
+
wait && wait.attempts > 0 ? /* @__PURE__ */ jsxs7("p", { children: [
|
|
4154
|
+
wait.attempts,
|
|
4155
|
+
" dispatch attempt",
|
|
4156
|
+
wait.attempts === 1 ? "" : "s",
|
|
4157
|
+
"."
|
|
4158
|
+
] }) : null,
|
|
4159
|
+
wait?.lastError ? /* @__PURE__ */ jsxs7("p", { className: "max-h-32 overflow-y-auto whitespace-pre-wrap break-words", children: [
|
|
4160
|
+
"Last recorded dispatch error: ",
|
|
4161
|
+
wait.lastError
|
|
4162
|
+
] }) : null
|
|
4163
|
+
] });
|
|
4164
|
+
}
|
|
4165
|
+
|
|
4129
4166
|
// src/timeline/activity-rail.tsx
|
|
4130
4167
|
import { ArrowRightIcon, BotIcon, BrainCircuitIcon as BrainCircuitIcon3, MessageSquareTextIcon } from "lucide-react";
|
|
4131
4168
|
import {
|
|
@@ -4135,13 +4172,13 @@ import {
|
|
|
4135
4172
|
useContext as useContext7,
|
|
4136
4173
|
useLayoutEffect,
|
|
4137
4174
|
useRef as useRef5,
|
|
4138
|
-
useState as
|
|
4175
|
+
useState as useState9
|
|
4139
4176
|
} from "react";
|
|
4140
4177
|
import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
|
|
4141
4178
|
|
|
4142
4179
|
// src/timeline/entrance.tsx
|
|
4143
4180
|
import { createContext as createContext4, useContext as useContext5, useRef as useRef4 } from "react";
|
|
4144
|
-
import { jsx as
|
|
4181
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
4145
4182
|
var EntranceAnimationContext = createContext4(true);
|
|
4146
4183
|
var EntranceAnimationLiveContext = createContext4(true);
|
|
4147
4184
|
function EntranceAnimationProvider({
|
|
@@ -4150,7 +4187,7 @@ function EntranceAnimationProvider({
|
|
|
4150
4187
|
children
|
|
4151
4188
|
}) {
|
|
4152
4189
|
const mountedValue = useRef4(value).current;
|
|
4153
|
-
return /* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsx10(EntranceAnimationContext.Provider, { value: mountedValue, children: /* @__PURE__ */ jsx10(EntranceAnimationLiveContext.Provider, { value: liveValue, children }) });
|
|
4154
4191
|
}
|
|
4155
4192
|
function useEntranceAnimationLive() {
|
|
4156
4193
|
return useContext5(EntranceAnimationLiveContext);
|
|
@@ -4170,7 +4207,7 @@ function useSeenActivityIds() {
|
|
|
4170
4207
|
}
|
|
4171
4208
|
|
|
4172
4209
|
// src/timeline/activity-rail.tsx
|
|
4173
|
-
import { Fragment as Fragment3, jsx as
|
|
4210
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4174
4211
|
var LazyFleetDecisionRow = lazy2(() => import("./fleet-decision-row-YZ3ZKWMM.js"));
|
|
4175
4212
|
var LazyPlatformActivityRow = lazy2(() => import("./platform-activity-row-627BFZ46.js"));
|
|
4176
4213
|
function familyOf(item) {
|
|
@@ -4192,8 +4229,9 @@ function ActivityRail({
|
|
|
4192
4229
|
}) {
|
|
4193
4230
|
const debug = useStartupDetails();
|
|
4194
4231
|
const reducedMotion = useReducedMotion();
|
|
4195
|
-
const [detailsOpen, setDetailsOpen] =
|
|
4232
|
+
const [detailsOpen, setDetailsOpen] = useState9(false);
|
|
4196
4233
|
const phases = items.filter((item) => item.kind === "startup-phase");
|
|
4234
|
+
const dispatch = phases.find((item) => item.dispatchWait !== void 0);
|
|
4197
4235
|
const hasWork = items.some(
|
|
4198
4236
|
(item) => item.kind !== "startup-phase" && (item.kind !== "reasoning" || item.text.trim().length > 0)
|
|
4199
4237
|
);
|
|
@@ -4208,10 +4246,10 @@ function ActivityRail({
|
|
|
4208
4246
|
const visibleItems = debug || detailsOpen ? items : items.filter(
|
|
4209
4247
|
(item) => item.kind === "startup-phase" ? item.status === "failed" || item.status === "cancelled" : item.kind !== "reasoning" || item.text.trim().length > 0
|
|
4210
4248
|
);
|
|
4211
|
-
const startedAt = phases.reduce(
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
);
|
|
4249
|
+
const startedAt = phases.reduce((first, item) => {
|
|
4250
|
+
const start = item.loadingStartedAt ?? item.startedAt;
|
|
4251
|
+
return start < first ? start : first;
|
|
4252
|
+
}, phases[0]?.startedAt ?? "");
|
|
4215
4253
|
const enterMounted = useEntranceAnimation();
|
|
4216
4254
|
const enterLive = useEntranceAnimationLive();
|
|
4217
4255
|
const seenIds = useSeenActivityIds();
|
|
@@ -4237,7 +4275,7 @@ function ActivityRail({
|
|
|
4237
4275
|
}
|
|
4238
4276
|
}
|
|
4239
4277
|
});
|
|
4240
|
-
return /* @__PURE__ */
|
|
4278
|
+
return /* @__PURE__ */ jsxs8(
|
|
4241
4279
|
"div",
|
|
4242
4280
|
{
|
|
4243
4281
|
className: cn(
|
|
@@ -4252,7 +4290,7 @@ function ActivityRail({
|
|
|
4252
4290
|
className
|
|
4253
4291
|
),
|
|
4254
4292
|
children: [
|
|
4255
|
-
/* @__PURE__ */
|
|
4293
|
+
/* @__PURE__ */ jsx11(AnimatePresence, { initial: false, children: loading && !debug ? /* @__PURE__ */ jsx11(
|
|
4256
4294
|
motion.div,
|
|
4257
4295
|
{
|
|
4258
4296
|
initial: { opacity: 0 },
|
|
@@ -4267,10 +4305,11 @@ function ActivityRail({
|
|
|
4267
4305
|
opacity: { duration: reducedMotion ? 0 : 0.16 }
|
|
4268
4306
|
},
|
|
4269
4307
|
style: { overflow: "hidden" },
|
|
4270
|
-
children: /* @__PURE__ */
|
|
4308
|
+
children: /* @__PURE__ */ jsx11(
|
|
4271
4309
|
GenieLoading,
|
|
4272
4310
|
{
|
|
4273
4311
|
startedAt,
|
|
4312
|
+
notice: dispatch?.dispatchWait?.lastError ? "Unable to start yet. Your messages are saved." : void 0,
|
|
4274
4313
|
phase: responsePending ? "waiting" : "preparing",
|
|
4275
4314
|
detailsOpen,
|
|
4276
4315
|
onShowDetails: () => setDetailsOpen((open) => !open)
|
|
@@ -4279,7 +4318,7 @@ function ActivityRail({
|
|
|
4279
4318
|
},
|
|
4280
4319
|
"startup"
|
|
4281
4320
|
) : null }),
|
|
4282
|
-
detailsOpen && !debug && !loading ? /* @__PURE__ */
|
|
4321
|
+
detailsOpen && !debug && !loading ? /* @__PURE__ */ jsx11(
|
|
4283
4322
|
"button",
|
|
4284
4323
|
{
|
|
4285
4324
|
type: "button",
|
|
@@ -4288,6 +4327,7 @@ function ActivityRail({
|
|
|
4288
4327
|
children: "Hide startup details"
|
|
4289
4328
|
}
|
|
4290
4329
|
) : null,
|
|
4330
|
+
dispatch && (detailsOpen || debug) ? /* @__PURE__ */ jsx11(StartupDispatchDetails, { wait: dispatch.dispatchWait ?? null }) : null,
|
|
4291
4331
|
visibleItems.map((item, index) => {
|
|
4292
4332
|
const newFamily = index > 0 && familyOf(item) !== familyOf(visibleItems[index - 1]);
|
|
4293
4333
|
const row = renderActivity(
|
|
@@ -4298,7 +4338,7 @@ function ActivityRail({
|
|
|
4298
4338
|
loadRetainedScreenshot,
|
|
4299
4339
|
loadRetainedArtifact
|
|
4300
4340
|
);
|
|
4301
|
-
return /* @__PURE__ */
|
|
4341
|
+
return /* @__PURE__ */ jsx11(
|
|
4302
4342
|
"div",
|
|
4303
4343
|
{
|
|
4304
4344
|
"data-og-timeline-row-anchor": "",
|
|
@@ -4318,16 +4358,16 @@ var ActivityNoteTextContext = createContext6(null);
|
|
|
4318
4358
|
function ActivityNoteRow({ item }) {
|
|
4319
4359
|
const renderText = useContext7(ActivityNoteTextContext);
|
|
4320
4360
|
if (!item.text.trim()) return null;
|
|
4321
|
-
return /* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4323
|
-
/* @__PURE__ */
|
|
4324
|
-
/* @__PURE__ */
|
|
4361
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-2 px-1.5 py-1.5", "data-og-activity-note": "", children: [
|
|
4362
|
+
/* @__PURE__ */ jsx11("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
4363
|
+
/* @__PURE__ */ jsx11(MessageSquareTextIcon, { "aria-hidden": true, className: "mt-1 size-3.5 shrink-0 text-og-fg-subtle" }),
|
|
4364
|
+
/* @__PURE__ */ jsx11(
|
|
4325
4365
|
"div",
|
|
4326
4366
|
{
|
|
4327
4367
|
className: "min-w-0 flex-1 text-og-sm text-og-fg-muted",
|
|
4328
4368
|
"data-og-search-item": item.id,
|
|
4329
4369
|
"data-og-annotation-source-key": item.annotationSource?.eventId,
|
|
4330
|
-
children: renderText ? renderText(item.text, item) : /* @__PURE__ */
|
|
4370
|
+
children: renderText ? renderText(item.text, item) : /* @__PURE__ */ jsx11(Markdown, { streaming: item.streaming, children: item.text })
|
|
4331
4371
|
}
|
|
4332
4372
|
)
|
|
4333
4373
|
] });
|
|
@@ -4340,7 +4380,7 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRe
|
|
|
4340
4380
|
case "reasoning":
|
|
4341
4381
|
case "sandbox":
|
|
4342
4382
|
case "startup-phase":
|
|
4343
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ jsx11(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx11(
|
|
4344
4384
|
LazyPlatformActivityRow,
|
|
4345
4385
|
{
|
|
4346
4386
|
item,
|
|
@@ -4355,7 +4395,7 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRe
|
|
|
4355
4395
|
) });
|
|
4356
4396
|
case "tool-call": {
|
|
4357
4397
|
const Renderer = toolRegistry.resolve(item);
|
|
4358
|
-
return /* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ jsx11(ToolCallTruncationProvider, { value: item.truncation ?? null, children: /* @__PURE__ */ jsx11(
|
|
4359
4399
|
Renderer,
|
|
4360
4400
|
{
|
|
4361
4401
|
item,
|
|
@@ -4365,9 +4405,9 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRe
|
|
|
4365
4405
|
) });
|
|
4366
4406
|
}
|
|
4367
4407
|
case "worker":
|
|
4368
|
-
return /* @__PURE__ */
|
|
4408
|
+
return /* @__PURE__ */ jsx11(WorkerRow, { item, onOpenSession });
|
|
4369
4409
|
case "knowledge":
|
|
4370
|
-
return /* @__PURE__ */
|
|
4410
|
+
return /* @__PURE__ */ jsx11(
|
|
4371
4411
|
KnowledgeReceiptRow,
|
|
4372
4412
|
{
|
|
4373
4413
|
outcome: item.outcome,
|
|
@@ -4378,11 +4418,11 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRe
|
|
|
4378
4418
|
}
|
|
4379
4419
|
);
|
|
4380
4420
|
case "memory":
|
|
4381
|
-
return /* @__PURE__ */
|
|
4421
|
+
return /* @__PURE__ */ jsx11(MemoryRow, { item, onMemoryClick });
|
|
4382
4422
|
case "agent-message":
|
|
4383
|
-
return /* @__PURE__ */
|
|
4423
|
+
return /* @__PURE__ */ jsx11(ActivityNoteRow, { item });
|
|
4384
4424
|
case "fleet-decision":
|
|
4385
|
-
return /* @__PURE__ */
|
|
4425
|
+
return /* @__PURE__ */ jsx11(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx11(
|
|
4386
4426
|
LazyFleetDecisionRow,
|
|
4387
4427
|
{
|
|
4388
4428
|
item,
|
|
@@ -4412,37 +4452,37 @@ function MemoryRow({
|
|
|
4412
4452
|
const superseded = corrected && Boolean(item.replacementPreview);
|
|
4413
4453
|
const targetId = corrected ? item.replacementMemoryId ?? item.memoryId : item.memoryId;
|
|
4414
4454
|
const deepLink = Boolean(onMemoryClick);
|
|
4415
|
-
return /* @__PURE__ */
|
|
4455
|
+
return /* @__PURE__ */ jsxs8(
|
|
4416
4456
|
ActivityDisclosure,
|
|
4417
4457
|
{
|
|
4418
|
-
icon: /* @__PURE__ */
|
|
4458
|
+
icon: /* @__PURE__ */ jsx11(BrainCircuitIcon3, { className: "size-3.5" }),
|
|
4419
4459
|
iconTone: "muted",
|
|
4420
|
-
title: /* @__PURE__ */
|
|
4421
|
-
/* @__PURE__ */
|
|
4422
|
-
kindLabel ? /* @__PURE__ */
|
|
4460
|
+
title: /* @__PURE__ */ jsxs8("span", { className: "inline-flex min-w-0 items-center gap-2", children: [
|
|
4461
|
+
/* @__PURE__ */ jsx11("span", { className: "shrink-0", children: corrected ? "Updated memory" : "Saved to memory" }),
|
|
4462
|
+
kindLabel ? /* @__PURE__ */ jsx11("span", { className: "shrink-0 rounded-og-xs bg-og-surface-2 px-1.5 py-px text-og-xs font-normal leading-tight text-og-fg-subtle", children: kindLabel }) : null
|
|
4423
4463
|
] }),
|
|
4424
4464
|
preview: superseded ? item.replacementPreview : item.preview,
|
|
4425
4465
|
children: [
|
|
4426
4466
|
superseded ? (
|
|
4427
4467
|
// The correction as a before → after: the old memory struck through and
|
|
4428
4468
|
// dimmed, the new text in the ordinary body weight below it.
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4431
|
-
/* @__PURE__ */
|
|
4469
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", children: [
|
|
4470
|
+
/* @__PURE__ */ jsx11("p", { className: "whitespace-pre-wrap text-og-sm leading-6 text-og-fg-subtle line-through", children: item.preview }),
|
|
4471
|
+
/* @__PURE__ */ jsx11("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.replacementPreview })
|
|
4432
4472
|
] })
|
|
4433
4473
|
) : corrected && item.action === "updated" ? (
|
|
4434
4474
|
// Edited in place, no replacement record: the memory is still live, so
|
|
4435
4475
|
// show its current text — NOT the archived treatment.
|
|
4436
|
-
/* @__PURE__ */
|
|
4437
|
-
/* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4476
|
+
/* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
4477
|
+
/* @__PURE__ */ jsx11("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
|
|
4478
|
+
/* @__PURE__ */ jsx11(BodyNote, { tone: "muted", children: "Updated in place." })
|
|
4439
4479
|
] })
|
|
4440
4480
|
) : corrected ? (
|
|
4441
4481
|
// A correction with no replacement (and not an in-place update) archived the record.
|
|
4442
|
-
/* @__PURE__ */
|
|
4443
|
-
) : /* @__PURE__ */
|
|
4444
|
-
item.deduped ? /* @__PURE__ */
|
|
4445
|
-
deepLink ? /* @__PURE__ */
|
|
4482
|
+
/* @__PURE__ */ jsx11(BodyNote, { tone: "muted", children: "Archived." })
|
|
4483
|
+
) : /* @__PURE__ */ jsx11("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
|
|
4484
|
+
item.deduped ? /* @__PURE__ */ jsx11(BodyNote, { tone: "muted", children: "Merged into an existing memory." }) : null,
|
|
4485
|
+
deepLink ? /* @__PURE__ */ jsxs8(
|
|
4446
4486
|
"button",
|
|
4447
4487
|
{
|
|
4448
4488
|
type: "button",
|
|
@@ -4453,7 +4493,7 @@ function MemoryRow({
|
|
|
4453
4493
|
),
|
|
4454
4494
|
children: [
|
|
4455
4495
|
"View in memory",
|
|
4456
|
-
/* @__PURE__ */
|
|
4496
|
+
/* @__PURE__ */ jsx11(ArrowRightIcon, { className: "size-3.5 transition-transform duration-150 group-hover/memlink:translate-x-0.5" })
|
|
4457
4497
|
]
|
|
4458
4498
|
}
|
|
4459
4499
|
) : null
|
|
@@ -4471,10 +4511,10 @@ function WorkerRow({
|
|
|
4471
4511
|
const cancelled = item.status === "cancelled";
|
|
4472
4512
|
const title = item.action === "spawn" ? running ? "Spawning worker" : failed ? "Worker spawn failed" : cancelled ? "Worker interrupted" : "Worker spawned" : running ? "Messaging worker" : failed ? "Worker message failed" : cancelled ? "Worker interrupted" : "Worker messaged";
|
|
4473
4513
|
if (compact) {
|
|
4474
|
-
return /* @__PURE__ */
|
|
4514
|
+
return /* @__PURE__ */ jsx11(
|
|
4475
4515
|
ActivityDisclosure,
|
|
4476
4516
|
{
|
|
4477
|
-
icon: /* @__PURE__ */
|
|
4517
|
+
icon: /* @__PURE__ */ jsx11(BotIcon, { className: "size-3.5" }),
|
|
4478
4518
|
title,
|
|
4479
4519
|
preview: item.prompt,
|
|
4480
4520
|
running
|
|
@@ -4483,11 +4523,11 @@ function WorkerRow({
|
|
|
4483
4523
|
}
|
|
4484
4524
|
const sessionId = item.workerSessionId;
|
|
4485
4525
|
const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
|
|
4486
|
-
const inner = /* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
4490
|
-
/* @__PURE__ */
|
|
4526
|
+
const inner = /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
4527
|
+
/* @__PURE__ */ jsx11("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
4528
|
+
/* @__PURE__ */ jsx11("span", { className: cn("mt-px shrink-0", failed ? "text-og-status-failed" : "text-og-accent"), children: /* @__PURE__ */ jsx11(BotIcon, { className: "size-3.5" }) }),
|
|
4529
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
|
|
4530
|
+
/* @__PURE__ */ jsx11(
|
|
4491
4531
|
"span",
|
|
4492
4532
|
{
|
|
4493
4533
|
className: cn(
|
|
@@ -4497,16 +4537,16 @@ function WorkerRow({
|
|
|
4497
4537
|
children: title
|
|
4498
4538
|
}
|
|
4499
4539
|
),
|
|
4500
|
-
item.prompt ? /* @__PURE__ */
|
|
4501
|
-
failed && item.failure ? /* @__PURE__ */
|
|
4502
|
-
/* @__PURE__ */
|
|
4503
|
-
/* @__PURE__ */
|
|
4540
|
+
item.prompt ? /* @__PURE__ */ jsx11("p", { className: "mt-0.5 truncate text-og-sm text-og-fg-muted", children: truncate(item.prompt, 140) }) : null,
|
|
4541
|
+
failed && item.failure ? /* @__PURE__ */ jsxs8("div", { className: "mt-1 min-w-0 text-og-sm text-og-status-failed", children: [
|
|
4542
|
+
/* @__PURE__ */ jsx11("p", { className: "font-og-mono text-og-xs", children: item.failure.code }),
|
|
4543
|
+
/* @__PURE__ */ jsx11("p", { className: "mt-0.5 break-words", children: item.failure.message })
|
|
4504
4544
|
] }) : null
|
|
4505
4545
|
] }),
|
|
4506
|
-
failed ? /* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4546
|
+
failed ? /* @__PURE__ */ jsxs8("span", { className: "inline-flex shrink-0 self-center items-center gap-1.5 font-og-mono text-og-xs leading-none text-og-status-failed", children: [
|
|
4547
|
+
/* @__PURE__ */ jsx11("span", { className: "size-1.5 rounded-full bg-og-status-failed" }),
|
|
4508
4548
|
"failed"
|
|
4509
|
-
] }) : cancelled ? /* @__PURE__ */
|
|
4549
|
+
] }) : cancelled ? /* @__PURE__ */ jsx11("span", { className: "og-cancelled-chip shrink-0 self-center font-og-mono text-og-xs leading-none text-og-fg-subtle", children: "interrupted" }) : deepLink ? /* @__PURE__ */ jsx11(
|
|
4510
4550
|
ArrowRightIcon,
|
|
4511
4551
|
{
|
|
4512
4552
|
"aria-hidden": true,
|
|
@@ -4515,7 +4555,7 @@ function WorkerRow({
|
|
|
4515
4555
|
) : null
|
|
4516
4556
|
] });
|
|
4517
4557
|
if (deepLink && sessionId && onOpenSession) {
|
|
4518
|
-
return /* @__PURE__ */
|
|
4558
|
+
return /* @__PURE__ */ jsx11(
|
|
4519
4559
|
"button",
|
|
4520
4560
|
{
|
|
4521
4561
|
type: "button",
|
|
@@ -4529,7 +4569,7 @@ function WorkerRow({
|
|
|
4529
4569
|
}
|
|
4530
4570
|
);
|
|
4531
4571
|
}
|
|
4532
|
-
return /* @__PURE__ */
|
|
4572
|
+
return /* @__PURE__ */ jsx11("div", { className: "flex items-start gap-2 px-1.5 py-1.5", children: inner });
|
|
4533
4573
|
}
|
|
4534
4574
|
|
|
4535
4575
|
// src/timeline/turn-summary.tsx
|
|
@@ -4538,11 +4578,11 @@ import {
|
|
|
4538
4578
|
Component,
|
|
4539
4579
|
createContext as createContext8,
|
|
4540
4580
|
useContext as useContext9,
|
|
4541
|
-
useEffect as
|
|
4581
|
+
useEffect as useEffect7,
|
|
4542
4582
|
useLayoutEffect as useLayoutEffect2,
|
|
4543
4583
|
useMemo as useMemo2,
|
|
4544
4584
|
useRef as useRef6,
|
|
4545
|
-
useState as
|
|
4585
|
+
useState as useState10
|
|
4546
4586
|
} from "react";
|
|
4547
4587
|
import { Collapsible } from "radix-ui";
|
|
4548
4588
|
|
|
@@ -4564,7 +4604,7 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
|
4564
4604
|
}
|
|
4565
4605
|
|
|
4566
4606
|
// src/timeline/turn-summary.tsx
|
|
4567
|
-
import { Fragment as Fragment4, jsx as
|
|
4607
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4568
4608
|
var TurnSettleChromeContext = createContext8(false);
|
|
4569
4609
|
function useTurnSettleOpen() {
|
|
4570
4610
|
return useContext9(TurnSettleChromeContext);
|
|
@@ -4604,20 +4644,20 @@ function TurnSummary({
|
|
|
4604
4644
|
const remembered = foldKey !== void 0 ? foldMemory?.get(foldKey) : void 0;
|
|
4605
4645
|
const restingOpen = remembered === "closed" ? false : remembered === "open" ? true : defaultOpen ?? forcedDefaultOpen ?? false;
|
|
4606
4646
|
const initialSettle = Boolean(settleFold) && !restingOpen && remembered === void 0;
|
|
4607
|
-
const [settling, setSettling] =
|
|
4608
|
-
const [open, setOpen] =
|
|
4647
|
+
const [settling, setSettling] = useState10(initialSettle);
|
|
4648
|
+
const [open, setOpen] = useState10(initialSettle ? true : restingOpen);
|
|
4609
4649
|
const reportOpen = useRef6(onOpenStateChange);
|
|
4610
4650
|
reportOpen.current = onOpenStateChange;
|
|
4611
4651
|
useLayoutEffect2(() => {
|
|
4612
4652
|
reportOpen.current?.(open);
|
|
4613
4653
|
}, [open]);
|
|
4614
4654
|
const readerOwnsOpen = useRef6(remembered !== void 0);
|
|
4615
|
-
|
|
4655
|
+
useEffect7(() => {
|
|
4616
4656
|
if (status && defaultOpen && remembered === void 0 && !readerOwnsOpen.current) setOpen(true);
|
|
4617
4657
|
}, [status, defaultOpen, remembered]);
|
|
4618
|
-
const [settlePhase, setSettlePhase] =
|
|
4619
|
-
const [nestSuppressLatch, setNestSuppressLatch] =
|
|
4620
|
-
const [expandReady, setExpandReady] =
|
|
4658
|
+
const [settlePhase, setSettlePhase] = useState10(initialSettle);
|
|
4659
|
+
const [nestSuppressLatch, setNestSuppressLatch] = useState10(initialSettle);
|
|
4660
|
+
const [expandReady, setExpandReady] = useState10(!initialSettle);
|
|
4621
4661
|
const settleTimerRef = useRef6(null);
|
|
4622
4662
|
const settleCloseDoneRef = useRef6(null);
|
|
4623
4663
|
const nestLatchClearRef = useRef6(null);
|
|
@@ -4671,7 +4711,7 @@ function TurnSummary({
|
|
|
4671
4711
|
}, SETTLE_FOLD_BEAT_MS);
|
|
4672
4712
|
};
|
|
4673
4713
|
const mountSettleRef = useRef6(initialSettle);
|
|
4674
|
-
|
|
4714
|
+
useEffect7(() => {
|
|
4675
4715
|
if (mountSettleRef.current) {
|
|
4676
4716
|
armSettleCollapse();
|
|
4677
4717
|
}
|
|
@@ -4680,7 +4720,7 @@ function TurnSummary({
|
|
|
4680
4720
|
settleArmedRef.current = false;
|
|
4681
4721
|
};
|
|
4682
4722
|
}, []);
|
|
4683
|
-
|
|
4723
|
+
useEffect7(() => {
|
|
4684
4724
|
const was = settleFoldSeenRef.current;
|
|
4685
4725
|
settleFoldSeenRef.current = Boolean(settleFold);
|
|
4686
4726
|
if (!was && settleFold) {
|
|
@@ -4690,7 +4730,7 @@ function TurnSummary({
|
|
|
4690
4730
|
armSettleCollapse();
|
|
4691
4731
|
}
|
|
4692
4732
|
}, [settleFold]);
|
|
4693
|
-
|
|
4733
|
+
useEffect7(() => {
|
|
4694
4734
|
if (!searchReveal) return;
|
|
4695
4735
|
clearSettleTimers();
|
|
4696
4736
|
settleArmedRef.current = false;
|
|
@@ -4726,7 +4766,7 @@ function TurnSummary({
|
|
|
4726
4766
|
}
|
|
4727
4767
|
};
|
|
4728
4768
|
const enter = useEntranceAnimation();
|
|
4729
|
-
const [allowEnterAnimation] =
|
|
4769
|
+
const [allowEnterAnimation] = useState10(
|
|
4730
4770
|
() => Boolean(enter && !bare && !initialSettle && !restingOpen)
|
|
4731
4771
|
);
|
|
4732
4772
|
const context = useMemo2(
|
|
@@ -4766,8 +4806,8 @@ function TurnSummary({
|
|
|
4766
4806
|
const copyable = Boolean(
|
|
4767
4807
|
copyText && copyText.trim().length > 0 && !bare && !liveShell && !open && !settlePhase
|
|
4768
4808
|
);
|
|
4769
|
-
return /* @__PURE__ */
|
|
4770
|
-
/* @__PURE__ */
|
|
4809
|
+
return /* @__PURE__ */ jsx12(TurnSettleChromeContext.Provider, { value: settleChrome, children: /* @__PURE__ */ jsxs9("div", { className: cn(copyable && "group/copy relative"), children: [
|
|
4810
|
+
/* @__PURE__ */ jsxs9(
|
|
4771
4811
|
Collapsible.Root,
|
|
4772
4812
|
{
|
|
4773
4813
|
"data-og-work-section": bare ? void 0 : "",
|
|
@@ -4775,7 +4815,7 @@ function TurnSummary({
|
|
|
4775
4815
|
onOpenChange,
|
|
4776
4816
|
className: allowEnterAnimation && !liveShell ? "animate-og-enter" : void 0,
|
|
4777
4817
|
children: [
|
|
4778
|
-
/* @__PURE__ */
|
|
4818
|
+
/* @__PURE__ */ jsxs9(
|
|
4779
4819
|
Collapsible.Trigger,
|
|
4780
4820
|
{
|
|
4781
4821
|
"data-og-work-header": bare ? "nested" : "outer",
|
|
@@ -4805,7 +4845,7 @@ function TurnSummary({
|
|
|
4805
4845
|
status && copyable && "max-sm:pr-10"
|
|
4806
4846
|
),
|
|
4807
4847
|
children: [
|
|
4808
|
-
/* @__PURE__ */
|
|
4848
|
+
/* @__PURE__ */ jsx12(
|
|
4809
4849
|
ChevronRightIcon,
|
|
4810
4850
|
{
|
|
4811
4851
|
className: cn(
|
|
@@ -4814,7 +4854,7 @@ function TurnSummary({
|
|
|
4814
4854
|
)
|
|
4815
4855
|
}
|
|
4816
4856
|
),
|
|
4817
|
-
status || outcome === "complete" || !outcome && (liveHeader || context.settled) ? null : /* @__PURE__ */
|
|
4857
|
+
status || outcome === "complete" || !outcome && (liveHeader || context.settled) ? null : /* @__PURE__ */ jsx12(
|
|
4818
4858
|
"span",
|
|
4819
4859
|
{
|
|
4820
4860
|
className: cn(
|
|
@@ -4822,10 +4862,10 @@ function TurnSummary({
|
|
|
4822
4862
|
bare ? "size-3.5" : "size-5",
|
|
4823
4863
|
outcome === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"
|
|
4824
4864
|
),
|
|
4825
|
-
children: outcome === "failed" ? /* @__PURE__ */
|
|
4865
|
+
children: outcome === "failed" ? /* @__PURE__ */ jsx12(TriangleAlertIcon, { className: "size-3" }) : outcome === "cancelled" ? /* @__PURE__ */ jsx12(CircleSlashIcon, { className: "size-3" }) : /* @__PURE__ */ jsx12("span", { className: "size-1.5 animate-og-pulse rounded-full bg-og-fg-subtle" })
|
|
4826
4866
|
}
|
|
4827
4867
|
),
|
|
4828
|
-
/* @__PURE__ */
|
|
4868
|
+
/* @__PURE__ */ jsxs9(
|
|
4829
4869
|
"span",
|
|
4830
4870
|
{
|
|
4831
4871
|
className: cn(
|
|
@@ -4835,23 +4875,23 @@ function TurnSummary({
|
|
|
4835
4875
|
),
|
|
4836
4876
|
children: [
|
|
4837
4877
|
statusLine,
|
|
4838
|
-
liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */
|
|
4878
|
+
liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx12(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
4839
4879
|
index > 0 || statusLine ? " \xB7 " : null,
|
|
4840
|
-
/* @__PURE__ */
|
|
4841
|
-
result.icon ? /* @__PURE__ */
|
|
4880
|
+
/* @__PURE__ */ jsxs9("span", { "aria-label": result.ariaLabel, title: result.title, children: [
|
|
4881
|
+
result.icon ? /* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
|
|
4842
4882
|
result.content
|
|
4843
4883
|
] })
|
|
4844
4884
|
] }) }, facet.id)),
|
|
4845
|
-
outcome === "failed" && failureText ? /* @__PURE__ */
|
|
4885
|
+
outcome === "failed" && failureText ? /* @__PURE__ */ jsxs9("span", { className: "text-og-status-failed", children: [
|
|
4846
4886
|
" \xB7 ",
|
|
4847
4887
|
failureText
|
|
4848
4888
|
] }) : null,
|
|
4849
|
-
outcome === "cancelled" ? /* @__PURE__ */
|
|
4889
|
+
outcome === "cancelled" ? /* @__PURE__ */ jsx12("span", { className: "text-og-fg-subtle", children: " \xB7 interrupted" }) : null
|
|
4850
4890
|
]
|
|
4851
4891
|
}
|
|
4852
4892
|
),
|
|
4853
|
-
status?.kind === "worked" ? /* @__PURE__ */
|
|
4854
|
-
status && status.kind !== "worked" && (contextCompactionCount ?? 0) > 0 ? /* @__PURE__ */
|
|
4893
|
+
status?.kind === "worked" ? /* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "ml-1 h-px min-w-0 flex-1 bg-og-border" }) : null,
|
|
4894
|
+
status && status.kind !== "worked" && (contextCompactionCount ?? 0) > 0 ? /* @__PURE__ */ jsx12(
|
|
4855
4895
|
ShrinkIcon,
|
|
4856
4896
|
{
|
|
4857
4897
|
className: "size-3.5 shrink-0",
|
|
@@ -4864,17 +4904,17 @@ function TurnSummary({
|
|
|
4864
4904
|
status && !open && status.preview ? (
|
|
4865
4905
|
// Readable progress under the status line; the line above stays
|
|
4866
4906
|
// the one disclosure control, so a click here is a mouse shortcut.
|
|
4867
|
-
/* @__PURE__ */
|
|
4907
|
+
/* @__PURE__ */ jsx12(
|
|
4868
4908
|
"div",
|
|
4869
4909
|
{
|
|
4870
4910
|
"data-og-exchange-preview": "",
|
|
4871
4911
|
className: "flex min-w-0 cursor-pointer flex-col gap-0.5 pb-1 pl-6",
|
|
4872
4912
|
onClick: () => onOpenChange(true),
|
|
4873
|
-
children: status.preview ? /* @__PURE__ */
|
|
4913
|
+
children: status.preview ? /* @__PURE__ */ jsx12("div", { className: "min-w-0", children: status.preview }) : null
|
|
4874
4914
|
}
|
|
4875
4915
|
)
|
|
4876
4916
|
) : null,
|
|
4877
|
-
/* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ jsx12(
|
|
4878
4918
|
Collapsible.Content,
|
|
4879
4919
|
{
|
|
4880
4920
|
...nestSuppressLatch ? { forceMount: true } : {},
|
|
@@ -4885,38 +4925,38 @@ function TurnSummary({
|
|
|
4885
4925
|
// Auto-close: slow settle. Manual close (settlePhase cleared): fast.
|
|
4886
4926
|
settlePhase ? "data-[state=closed]:animate-og-settle-collapse" : "data-[state=closed]:animate-og-collapse"
|
|
4887
4927
|
),
|
|
4888
|
-
children: /* @__PURE__ */
|
|
4928
|
+
children: /* @__PURE__ */ jsx12("div", { className: bare ? "pt-1 pl-5" : "pt-2", children })
|
|
4889
4929
|
}
|
|
4890
4930
|
)
|
|
4891
4931
|
]
|
|
4892
4932
|
}
|
|
4893
4933
|
),
|
|
4894
|
-
copyable ? /* @__PURE__ */
|
|
4934
|
+
copyable ? /* @__PURE__ */ jsx12("div", { className: "pointer-events-none absolute top-1.5 right-0 z-10", children: /* @__PURE__ */ jsx12("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx12(CopyButton, { text: copyText, label: "Copy turn", reveal: "group-hover" }) }) }) : null
|
|
4895
4935
|
] }) });
|
|
4896
4936
|
}
|
|
4897
4937
|
function turnSummaryStatusLine(status) {
|
|
4898
4938
|
if (status.kind === "worked") {
|
|
4899
|
-
return status.durationMs !== void 0 && Number.isFinite(status.durationMs) && status.durationMs >= 1e3 ? /* @__PURE__ */
|
|
4939
|
+
return status.durationMs !== void 0 && Number.isFinite(status.durationMs) && status.durationMs >= 1e3 ? /* @__PURE__ */ jsxs9("span", { "data-og-exchange-status": "worked", children: [
|
|
4900
4940
|
status.label ?? "Worked for",
|
|
4901
4941
|
" ",
|
|
4902
4942
|
formatElapsed(status.durationMs)
|
|
4903
4943
|
] }) : null;
|
|
4904
4944
|
}
|
|
4905
4945
|
const label = status.label ?? (status.kind === "working" ? "Working" : "Waiting");
|
|
4906
|
-
return /* @__PURE__ */
|
|
4907
|
-
/* @__PURE__ */
|
|
4908
|
-
status.since ? /* @__PURE__ */
|
|
4946
|
+
return /* @__PURE__ */ jsxs9("span", { "data-og-exchange-status": status.kind, children: [
|
|
4947
|
+
/* @__PURE__ */ jsx12("span", { className: status.kind === "working" ? "og-shimmer-text" : void 0, children: label }),
|
|
4948
|
+
status.since ? /* @__PURE__ */ jsx12(LiveElapsed, { since: status.since }) : null
|
|
4909
4949
|
] });
|
|
4910
4950
|
}
|
|
4911
4951
|
function LiveElapsed({ since }) {
|
|
4912
4952
|
const startedAt = Date.parse(since);
|
|
4913
|
-
const [now, setNow] =
|
|
4914
|
-
|
|
4953
|
+
const [now, setNow] = useState10(() => Date.now());
|
|
4954
|
+
useEffect7(() => {
|
|
4915
4955
|
const timer = setInterval(() => setNow(Date.now()), 1e3);
|
|
4916
4956
|
return () => clearInterval(timer);
|
|
4917
4957
|
}, []);
|
|
4918
4958
|
if (!Number.isFinite(startedAt)) return null;
|
|
4919
|
-
return /* @__PURE__ */
|
|
4959
|
+
return /* @__PURE__ */ jsx12("span", { className: "tabular-nums", children: ` \xB7 ${formatElapsed(Math.max(0, now - startedAt))}` });
|
|
4920
4960
|
}
|
|
4921
4961
|
function formatElapsed(durationMs) {
|
|
4922
4962
|
const totalSeconds = Math.max(0, Math.floor(durationMs / 1e3));
|
|
@@ -5092,9 +5132,9 @@ import {
|
|
|
5092
5132
|
useId as useId3,
|
|
5093
5133
|
useLayoutEffect as useLayoutEffect3,
|
|
5094
5134
|
useRef as useRef7,
|
|
5095
|
-
useState as
|
|
5135
|
+
useState as useState11
|
|
5096
5136
|
} from "react";
|
|
5097
|
-
import { jsx as
|
|
5137
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5098
5138
|
var FALLBACK_LINE_THRESHOLD = 12;
|
|
5099
5139
|
var FALLBACK_TEXT_THRESHOLD = 900;
|
|
5100
5140
|
var FALLBACK_UNBROKEN_THRESHOLD = 260;
|
|
@@ -5237,7 +5277,7 @@ function UserMessageDisclosureProvider({
|
|
|
5237
5277
|
value,
|
|
5238
5278
|
children
|
|
5239
5279
|
}) {
|
|
5240
|
-
return /* @__PURE__ */
|
|
5280
|
+
return /* @__PURE__ */ jsx13(UserMessageDisclosureContext.Provider, { value, children });
|
|
5241
5281
|
}
|
|
5242
5282
|
function userMessageLikelyNeedsDisclosure(text) {
|
|
5243
5283
|
const lines = text.split(/\r?\n/);
|
|
@@ -5251,7 +5291,7 @@ function UserMessageBody({
|
|
|
5251
5291
|
disclosureLabels
|
|
5252
5292
|
}) {
|
|
5253
5293
|
const disclosure = useContext10(UserMessageDisclosureContext);
|
|
5254
|
-
const [expanded, setExpanded] =
|
|
5294
|
+
const [expanded, setExpanded] = useState11(
|
|
5255
5295
|
() => disclosure?.expandedByMessageId.get(messageId) ?? false
|
|
5256
5296
|
);
|
|
5257
5297
|
const searchReveal = useTimelineSearchReveal();
|
|
@@ -5399,7 +5439,7 @@ function UserMessageBody({
|
|
|
5399
5439
|
disclosure?.expandedByMessageId.set(messageId, next);
|
|
5400
5440
|
setExpanded(next);
|
|
5401
5441
|
};
|
|
5402
|
-
return /* @__PURE__ */
|
|
5442
|
+
return /* @__PURE__ */ jsxs10(
|
|
5403
5443
|
"div",
|
|
5404
5444
|
{
|
|
5405
5445
|
ref: rootRef,
|
|
@@ -5408,7 +5448,7 @@ function UserMessageBody({
|
|
|
5408
5448
|
"data-og-expanded": expanded ? "true" : "false",
|
|
5409
5449
|
className: cn("relative min-w-0", className),
|
|
5410
5450
|
children: [
|
|
5411
|
-
/* @__PURE__ */
|
|
5451
|
+
/* @__PURE__ */ jsx13(
|
|
5412
5452
|
"span",
|
|
5413
5453
|
{
|
|
5414
5454
|
ref: thresholdRef,
|
|
@@ -5416,7 +5456,7 @@ function UserMessageBody({
|
|
|
5416
5456
|
className: "pointer-events-none absolute h-56 w-0 invisible sm:h-72"
|
|
5417
5457
|
}
|
|
5418
5458
|
),
|
|
5419
|
-
/* @__PURE__ */
|
|
5459
|
+
/* @__PURE__ */ jsxs10(
|
|
5420
5460
|
"div",
|
|
5421
5461
|
{
|
|
5422
5462
|
ref: clipRef,
|
|
@@ -5424,7 +5464,7 @@ function UserMessageBody({
|
|
|
5424
5464
|
"data-og-user-message-clip": "",
|
|
5425
5465
|
className: cn("relative min-w-0", collapsed && "max-h-56 overflow-hidden sm:max-h-72"),
|
|
5426
5466
|
children: [
|
|
5427
|
-
/* @__PURE__ */
|
|
5467
|
+
/* @__PURE__ */ jsx13(
|
|
5428
5468
|
"div",
|
|
5429
5469
|
{
|
|
5430
5470
|
ref: contentRef,
|
|
@@ -5433,7 +5473,7 @@ function UserMessageBody({
|
|
|
5433
5473
|
children
|
|
5434
5474
|
}
|
|
5435
5475
|
),
|
|
5436
|
-
/* @__PURE__ */
|
|
5476
|
+
/* @__PURE__ */ jsx13(
|
|
5437
5477
|
"span",
|
|
5438
5478
|
{
|
|
5439
5479
|
ref: fadeRef,
|
|
@@ -5446,7 +5486,7 @@ function UserMessageBody({
|
|
|
5446
5486
|
]
|
|
5447
5487
|
}
|
|
5448
5488
|
),
|
|
5449
|
-
/* @__PURE__ */
|
|
5489
|
+
/* @__PURE__ */ jsx13(
|
|
5450
5490
|
"button",
|
|
5451
5491
|
{
|
|
5452
5492
|
ref: disclosureControlRef,
|
|
@@ -5466,8 +5506,8 @@ function UserMessageBody({
|
|
|
5466
5506
|
}
|
|
5467
5507
|
|
|
5468
5508
|
// src/components/generated-video-player.tsx
|
|
5469
|
-
import { useEffect as
|
|
5470
|
-
import { jsx as
|
|
5509
|
+
import { useEffect as useEffect8, useState as useState12 } from "react";
|
|
5510
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5471
5511
|
function GeneratedVideoPlayer({
|
|
5472
5512
|
receipt,
|
|
5473
5513
|
loadPlaybackSource,
|
|
@@ -5475,9 +5515,9 @@ function GeneratedVideoPlayer({
|
|
|
5475
5515
|
label = "Generated video"
|
|
5476
5516
|
}) {
|
|
5477
5517
|
const formatError = useErrorMessage();
|
|
5478
|
-
const [retry, setRetry] =
|
|
5479
|
-
const [state, setState] =
|
|
5480
|
-
|
|
5518
|
+
const [retry, setRetry] = useState12(0);
|
|
5519
|
+
const [state, setState] = useState12({ kind: "loading" });
|
|
5520
|
+
useEffect8(() => {
|
|
5481
5521
|
const controller = new AbortController();
|
|
5482
5522
|
setState({ kind: "loading" });
|
|
5483
5523
|
void loadPlaybackSource(receipt.artifact.artifactId, controller.signal).then(
|
|
@@ -5495,7 +5535,7 @@ function GeneratedVideoPlayer({
|
|
|
5495
5535
|
return () => controller.abort();
|
|
5496
5536
|
}, [loadPlaybackSource, receipt.artifact.artifactId, retry, formatError]);
|
|
5497
5537
|
if (state.kind === "loading") {
|
|
5498
|
-
return /* @__PURE__ */
|
|
5538
|
+
return /* @__PURE__ */ jsx14(
|
|
5499
5539
|
"div",
|
|
5500
5540
|
{
|
|
5501
5541
|
"aria-label": `Loading ${label.toLowerCase()}`,
|
|
@@ -5507,7 +5547,7 @@ function GeneratedVideoPlayer({
|
|
|
5507
5547
|
);
|
|
5508
5548
|
}
|
|
5509
5549
|
if (state.kind === "error") {
|
|
5510
|
-
return /* @__PURE__ */
|
|
5550
|
+
return /* @__PURE__ */ jsx14(
|
|
5511
5551
|
"div",
|
|
5512
5552
|
{
|
|
5513
5553
|
role: "status",
|
|
@@ -5519,7 +5559,7 @@ function GeneratedVideoPlayer({
|
|
|
5519
5559
|
}
|
|
5520
5560
|
);
|
|
5521
5561
|
}
|
|
5522
|
-
return /* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ jsx14(
|
|
5523
5563
|
"video",
|
|
5524
5564
|
{
|
|
5525
5565
|
"aria-label": label,
|
|
@@ -5541,7 +5581,7 @@ function GeneratedVideoPlayer({
|
|
|
5541
5581
|
}
|
|
5542
5582
|
|
|
5543
5583
|
// src/components/session-status.tsx
|
|
5544
|
-
import { jsx as
|
|
5584
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5545
5585
|
var SESSION_STATUS_META = {
|
|
5546
5586
|
queued: {
|
|
5547
5587
|
label: "Queued",
|
|
@@ -5594,7 +5634,7 @@ var SESSION_STATUS_META = {
|
|
|
5594
5634
|
};
|
|
5595
5635
|
function SessionStatus({ status, label, size = "md", className }) {
|
|
5596
5636
|
const meta = SESSION_STATUS_META[status];
|
|
5597
|
-
return /* @__PURE__ */
|
|
5637
|
+
return /* @__PURE__ */ jsxs11(
|
|
5598
5638
|
"span",
|
|
5599
5639
|
{
|
|
5600
5640
|
"data-status": status,
|
|
@@ -5605,7 +5645,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
5605
5645
|
className
|
|
5606
5646
|
),
|
|
5607
5647
|
children: [
|
|
5608
|
-
/* @__PURE__ */
|
|
5648
|
+
/* @__PURE__ */ jsx15(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
|
|
5609
5649
|
label ?? meta.label
|
|
5610
5650
|
]
|
|
5611
5651
|
}
|
|
@@ -5613,7 +5653,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
5613
5653
|
}
|
|
5614
5654
|
function StatusDot({ status, className }) {
|
|
5615
5655
|
const meta = SESSION_STATUS_META[status];
|
|
5616
|
-
return /* @__PURE__ */
|
|
5656
|
+
return /* @__PURE__ */ jsx15(
|
|
5617
5657
|
"span",
|
|
5618
5658
|
{
|
|
5619
5659
|
className: cn(
|
|
@@ -5621,7 +5661,7 @@ function StatusDot({ status, className }) {
|
|
|
5621
5661
|
meta.dotClassName,
|
|
5622
5662
|
className
|
|
5623
5663
|
),
|
|
5624
|
-
children: meta.pulse ? /* @__PURE__ */
|
|
5664
|
+
children: meta.pulse ? /* @__PURE__ */ jsx15("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
|
|
5625
5665
|
}
|
|
5626
5666
|
);
|
|
5627
5667
|
}
|
|
@@ -5629,8 +5669,8 @@ function StatusDot({ status, className }) {
|
|
|
5629
5669
|
// src/timeline/rolling-activity.tsx
|
|
5630
5670
|
import { AnimatePresence as AnimatePresence2, motion as motion2, useReducedMotion as useReducedMotion2 } from "motion/react";
|
|
5631
5671
|
import { WrenchIcon as WrenchIcon2 } from "lucide-react";
|
|
5632
|
-
import { Suspense as Suspense3, useEffect as
|
|
5633
|
-
import { jsx as
|
|
5672
|
+
import { Suspense as Suspense3, useEffect as useEffect9, useState as useState13 } from "react";
|
|
5673
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5634
5674
|
function RollingActivity({
|
|
5635
5675
|
items,
|
|
5636
5676
|
toolRegistry = defaultToolRegistry,
|
|
@@ -5638,8 +5678,8 @@ function RollingActivity({
|
|
|
5638
5678
|
showCount = true
|
|
5639
5679
|
}) {
|
|
5640
5680
|
const reduced = useReducedMotion2();
|
|
5641
|
-
const [mounted, setMounted] =
|
|
5642
|
-
|
|
5681
|
+
const [mounted, setMounted] = useState13(false);
|
|
5682
|
+
useEffect9(() => setMounted(true), []);
|
|
5643
5683
|
const work = items.filter(
|
|
5644
5684
|
(item2) => item2.kind !== "startup-phase" && item2.kind !== "agent-message"
|
|
5645
5685
|
);
|
|
@@ -5652,18 +5692,18 @@ function RollingActivity({
|
|
|
5652
5692
|
0,
|
|
5653
5693
|
work.findIndex((entry) => entry.id === item.id)
|
|
5654
5694
|
);
|
|
5655
|
-
const fallback2 = /* @__PURE__ */
|
|
5656
|
-
/* @__PURE__ */
|
|
5657
|
-
/* @__PURE__ */
|
|
5695
|
+
const fallback2 = /* @__PURE__ */ jsxs12("span", { className: "og-rolling-label", children: [
|
|
5696
|
+
/* @__PURE__ */ jsx16(WrenchIcon2, { className: "size-3.5" }),
|
|
5697
|
+
/* @__PURE__ */ jsx16("span", { children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : "Working" })
|
|
5658
5698
|
] });
|
|
5659
|
-
return /* @__PURE__ */
|
|
5699
|
+
return /* @__PURE__ */ jsxs12(
|
|
5660
5700
|
"span",
|
|
5661
5701
|
{
|
|
5662
5702
|
className: "og-rolling-status",
|
|
5663
5703
|
"data-running": active.some((entry) => entry.id === item.id) ? "true" : void 0,
|
|
5664
5704
|
children: [
|
|
5665
|
-
/* @__PURE__ */
|
|
5666
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsx16("span", { className: "sr-only", children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : item.kind === "reasoning" ? "Thinking" : "Working" }),
|
|
5706
|
+
/* @__PURE__ */ jsx16("span", { className: "og-rolling-window", "aria-hidden": "true", children: /* @__PURE__ */ jsx16(AnimatePresence2, { initial: false, mode: "sync", children: /* @__PURE__ */ jsx16(
|
|
5667
5707
|
motion2.span,
|
|
5668
5708
|
{
|
|
5669
5709
|
className: "og-rolling-face",
|
|
@@ -5677,18 +5717,18 @@ function RollingActivity({
|
|
|
5677
5717
|
y: reduced ? 0 : -24
|
|
5678
5718
|
},
|
|
5679
5719
|
transition: { duration: reduced ? 0 : 0.4, ease: [0.22, 1, 0.36, 1] },
|
|
5680
|
-
children: /* @__PURE__ */
|
|
5720
|
+
children: /* @__PURE__ */ jsx16(CompactActivityContext.Provider, { value: true, children: /* @__PURE__ */ jsx16(Suspense3, { fallback: fallback2, children: renderActivity(item, toolRegistry, void 0, void 0, void 0, void 0) }) })
|
|
5681
5721
|
},
|
|
5682
5722
|
item.id
|
|
5683
5723
|
) }) }),
|
|
5684
|
-
showCount && earlierCount > 0 ? /* @__PURE__ */
|
|
5724
|
+
showCount && earlierCount > 0 ? /* @__PURE__ */ jsx16("span", { className: "og-rolling-count", children: `+${earlierCount} earlier` }) : null
|
|
5685
5725
|
]
|
|
5686
5726
|
}
|
|
5687
5727
|
);
|
|
5688
5728
|
}
|
|
5689
5729
|
|
|
5690
5730
|
// src/components/child-session-link.tsx
|
|
5691
|
-
import { jsx as
|
|
5731
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5692
5732
|
function ChildSessionLink({
|
|
5693
5733
|
kind,
|
|
5694
5734
|
sourceId,
|
|
@@ -5697,7 +5737,7 @@ function ChildSessionLink({
|
|
|
5697
5737
|
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)) {
|
|
5698
5738
|
return null;
|
|
5699
5739
|
}
|
|
5700
|
-
return /* @__PURE__ */
|
|
5740
|
+
return /* @__PURE__ */ jsx17(
|
|
5701
5741
|
"button",
|
|
5702
5742
|
{
|
|
5703
5743
|
type: "button",
|
|
@@ -5765,11 +5805,11 @@ import {
|
|
|
5765
5805
|
memo,
|
|
5766
5806
|
useCallback as useCallback3,
|
|
5767
5807
|
useContext as useContext12,
|
|
5768
|
-
useEffect as
|
|
5808
|
+
useEffect as useEffect10,
|
|
5769
5809
|
useLayoutEffect as useLayoutEffect5,
|
|
5770
5810
|
useMemo as useMemo5,
|
|
5771
5811
|
useRef as useRef9,
|
|
5772
|
-
useState as
|
|
5812
|
+
useState as useState15
|
|
5773
5813
|
} from "react";
|
|
5774
5814
|
|
|
5775
5815
|
// src/components/timeline-anchor.tsx
|
|
@@ -5852,11 +5892,11 @@ function timelineAnchorCorrection(scroller, anchors) {
|
|
|
5852
5892
|
}
|
|
5853
5893
|
|
|
5854
5894
|
// src/components/timeline-reading-progress.ts
|
|
5855
|
-
import { useCallback as useCallback2, useLayoutEffect as useLayoutEffect4, useMemo as useMemo3, useRef as useRef8, useState as
|
|
5895
|
+
import { useCallback as useCallback2, useLayoutEffect as useLayoutEffect4, useMemo as useMemo3, useRef as useRef8, useState as useState14 } from "react";
|
|
5856
5896
|
function useReadingProgress(projected, pinned, scroller) {
|
|
5857
5897
|
const following = pinned && !timelineHasReader(scroller);
|
|
5858
5898
|
const previous = useRef8([]);
|
|
5859
|
-
const [released, setReleased] =
|
|
5899
|
+
const [released, setReleased] = useState14(() => /* @__PURE__ */ new Set());
|
|
5860
5900
|
const groups = useMemo3(() => {
|
|
5861
5901
|
if (following) return projected;
|
|
5862
5902
|
const key = (group) => group.kind === "item" ? group.item.id : group.id;
|
|
@@ -6329,7 +6369,7 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
|
|
|
6329
6369
|
// src/timeline/allowance-exhausted-row.tsx
|
|
6330
6370
|
import { GaugeIcon } from "lucide-react";
|
|
6331
6371
|
import { createContext as createContext10, useContext as useContext11, useMemo as useMemo4 } from "react";
|
|
6332
|
-
import { Fragment as Fragment5, jsx as
|
|
6372
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6333
6373
|
var AllowancePresentationContext = createContext10({
|
|
6334
6374
|
render: void 0,
|
|
6335
6375
|
labels: allowanceLabels()
|
|
@@ -6340,13 +6380,13 @@ function AllowancePresentationProvider({
|
|
|
6340
6380
|
children
|
|
6341
6381
|
}) {
|
|
6342
6382
|
const value = useMemo4(() => ({ render, labels: allowanceLabels(labels) }), [render, labels]);
|
|
6343
|
-
return /* @__PURE__ */
|
|
6383
|
+
return /* @__PURE__ */ jsx18(AllowancePresentationContext.Provider, { value, children });
|
|
6344
6384
|
}
|
|
6345
6385
|
function AllowanceExhaustedRow({ refusal }) {
|
|
6346
6386
|
const { render, labels } = useContext11(AllowancePresentationContext);
|
|
6347
6387
|
const enter = useEntranceAnimation();
|
|
6348
6388
|
const workspace = refusal.scope === "workspace";
|
|
6349
|
-
const defaultRow = /* @__PURE__ */
|
|
6389
|
+
const defaultRow = /* @__PURE__ */ jsxs13(
|
|
6350
6390
|
"div",
|
|
6351
6391
|
{
|
|
6352
6392
|
className: cn(
|
|
@@ -6356,13 +6396,13 @@ function AllowanceExhaustedRow({ refusal }) {
|
|
|
6356
6396
|
role: "status",
|
|
6357
6397
|
"data-og-allowance-exhausted": refusal.scope,
|
|
6358
6398
|
children: [
|
|
6359
|
-
/* @__PURE__ */
|
|
6360
|
-
/* @__PURE__ */
|
|
6361
|
-
/* @__PURE__ */
|
|
6362
|
-
/* @__PURE__ */
|
|
6399
|
+
/* @__PURE__ */ jsx18(GaugeIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-og-status-waiting" }),
|
|
6400
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
6401
|
+
/* @__PURE__ */ jsx18("p", { className: "font-medium", children: workspace ? labels.workspaceLimitReachedTitle : labels.memberLimitReachedTitle }),
|
|
6402
|
+
/* @__PURE__ */ jsxs13("p", { className: "mt-0.5 text-og-fg-muted", children: [
|
|
6363
6403
|
workspace ? labels.workspaceRemedy : labels.memberRemedy,
|
|
6364
6404
|
" ",
|
|
6365
|
-
/* @__PURE__ */
|
|
6405
|
+
/* @__PURE__ */ jsx18(
|
|
6366
6406
|
"span",
|
|
6367
6407
|
{
|
|
6368
6408
|
title: refusal.resetsAt ? formatAllowanceInstant(refusal.resetsAt) : void 0,
|
|
@@ -6375,11 +6415,11 @@ function AllowanceExhaustedRow({ refusal }) {
|
|
|
6375
6415
|
]
|
|
6376
6416
|
}
|
|
6377
6417
|
);
|
|
6378
|
-
return /* @__PURE__ */
|
|
6418
|
+
return /* @__PURE__ */ jsx18(Fragment5, { children: render?.(refusal, { labels, defaultRow }) ?? defaultRow });
|
|
6379
6419
|
}
|
|
6380
6420
|
|
|
6381
6421
|
// src/components/message-timeline.tsx
|
|
6382
|
-
import { Fragment as Fragment6, jsx as
|
|
6422
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6383
6423
|
var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-DMLMM2TX.js"));
|
|
6384
6424
|
var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-markers-GNDHTGBD.js"));
|
|
6385
6425
|
var PIN_THRESHOLD_PX = 48;
|
|
@@ -6566,7 +6606,7 @@ function MessageTimeline({
|
|
|
6566
6606
|
() => renderMessageText ? (text, item) => renderMessageText(text, item, {
|
|
6567
6607
|
searchTarget: searchItem?.id === item.id ? searchTarget ?? null : null
|
|
6568
6608
|
}) : (text, item) => {
|
|
6569
|
-
const body = /* @__PURE__ */
|
|
6609
|
+
const body = /* @__PURE__ */ jsx19(
|
|
6570
6610
|
Markdown,
|
|
6571
6611
|
{
|
|
6572
6612
|
searchTarget: searchItem?.id === item.id ? searchTarget : null,
|
|
@@ -6575,7 +6615,7 @@ function MessageTimeline({
|
|
|
6575
6615
|
children: text
|
|
6576
6616
|
}
|
|
6577
6617
|
);
|
|
6578
|
-
return item.kind === "user-message" ? /* @__PURE__ */
|
|
6618
|
+
return item.kind === "user-message" ? /* @__PURE__ */ jsx19(UserMessageBody, { messageId: item.id, text, children: body }) : body;
|
|
6579
6619
|
},
|
|
6580
6620
|
[renderInteractiveBlock, renderMessageText, searchItem?.id, searchTarget]
|
|
6581
6621
|
);
|
|
@@ -6586,9 +6626,9 @@ function MessageTimeline({
|
|
|
6586
6626
|
newerScopeRef.current = newerBoundaryKey;
|
|
6587
6627
|
const newerAttemptRef = useRef9(null);
|
|
6588
6628
|
const newerRetryButtonRef = useRef9(null);
|
|
6589
|
-
const [newerRetryPending, setNewerRetryPending] =
|
|
6590
|
-
const [newerFailure, setNewerFailure] =
|
|
6591
|
-
|
|
6629
|
+
const [newerRetryPending, setNewerRetryPending] = useState15(false);
|
|
6630
|
+
const [newerFailure, setNewerFailure] = useState15(null);
|
|
6631
|
+
useEffect10(() => {
|
|
6592
6632
|
newerScopeRef.current = newerBoundaryKey;
|
|
6593
6633
|
newerAttemptRef.current = null;
|
|
6594
6634
|
setNewerFailure(null);
|
|
@@ -6640,7 +6680,7 @@ function MessageTimeline({
|
|
|
6640
6680
|
settlementAnimationRef.current = null;
|
|
6641
6681
|
}, []);
|
|
6642
6682
|
const olderPageBudgetRef = useRef9(0);
|
|
6643
|
-
const [olderDemand, setOlderDemand] =
|
|
6683
|
+
const [olderDemand, setOlderDemand] = useState15(0);
|
|
6644
6684
|
const readableTurns = turnSummary?.rolling === true;
|
|
6645
6685
|
const projectedGroups = useMemo5(
|
|
6646
6686
|
() => groupTimeline(resolvedItems, { readableTurns }),
|
|
@@ -6660,33 +6700,33 @@ function MessageTimeline({
|
|
|
6660
6700
|
const topSentinelRef = useRef9(null);
|
|
6661
6701
|
const bottomSentinelRef = useRef9(null);
|
|
6662
6702
|
const previousBulkFirstKeyRef = useRef9(void 0);
|
|
6663
|
-
const [pinned, setPinned] =
|
|
6703
|
+
const [pinned, setPinned] = useState15(true);
|
|
6664
6704
|
const { groups: allGroups, release: releaseProgress } = useReadingProgress(
|
|
6665
6705
|
projectedGroups,
|
|
6666
6706
|
autoFollow && pinned && !hasNewer,
|
|
6667
6707
|
scrollRef.current
|
|
6668
6708
|
);
|
|
6669
|
-
const [canSkipTipCatchup, setCanSkipTipCatchup] =
|
|
6709
|
+
const [canSkipTipCatchup, setCanSkipTipCatchup] = useState15(false);
|
|
6670
6710
|
const canSkipTipCatchupRef = useRef9(false);
|
|
6671
|
-
const [bulkActive, setBulkActive] =
|
|
6711
|
+
const [bulkActive, setBulkActive] = useState15(true);
|
|
6672
6712
|
const olderPrefetchArmedRef = useRef9(false);
|
|
6673
|
-
const [olderPrefetchArmed, setOlderPrefetchArmed] =
|
|
6713
|
+
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState15(false);
|
|
6674
6714
|
const olderLoadAttemptRef = useRef9(null);
|
|
6675
|
-
const [underfillSettledAttempt, setUnderfillSettledAttempt] =
|
|
6715
|
+
const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState15(
|
|
6676
6716
|
null
|
|
6677
6717
|
);
|
|
6678
6718
|
const underfillRetryReadyRef = useRef9(false);
|
|
6679
6719
|
const resizeFollowRafRef = useRef9(null);
|
|
6680
6720
|
const questionNavFrameRef = useRef9(null);
|
|
6681
|
-
const [questionNav, setQuestionNav] =
|
|
6721
|
+
const [questionNav, setQuestionNav] = useState15(null);
|
|
6682
6722
|
const questionNavMinViewportRef = useRef9(questionNavMinViewportHeight);
|
|
6683
6723
|
questionNavMinViewportRef.current = questionNavMinViewportHeight;
|
|
6684
6724
|
const scheduleQuestionNavRef = useRef9(() => {
|
|
6685
6725
|
});
|
|
6686
|
-
const [awayFromTip, setAwayFromTip] =
|
|
6726
|
+
const [awayFromTip, setAwayFromTip] = useState15(false);
|
|
6687
6727
|
const jumpPillShown = autoFollow && (!pinned && awayFromTip || hasNewer || canSkipTipCatchup);
|
|
6688
6728
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
6689
|
-
const [revealed, setRevealed] =
|
|
6729
|
+
const [revealed, setRevealed] = useState15(resolvedItems[0]?.id === "c");
|
|
6690
6730
|
const pinnedRef = useRef9(true);
|
|
6691
6731
|
const hasNewerRef = useRef9(hasNewer);
|
|
6692
6732
|
hasNewerRef.current = hasNewer;
|
|
@@ -6706,7 +6746,7 @@ function MessageTimeline({
|
|
|
6706
6746
|
const pendingReaderLeaveRef = useRef9(false);
|
|
6707
6747
|
const leaveFallbackRafRef = useRef9(null);
|
|
6708
6748
|
const foldMemoryRef = useRef9(/* @__PURE__ */ new Map());
|
|
6709
|
-
const [openLiveFolds, setOpenLiveFolds] =
|
|
6749
|
+
const [openLiveFolds, setOpenLiveFolds] = useState15(() => /* @__PURE__ */ new Set());
|
|
6710
6750
|
const openLiveFoldsRef = useRef9(openLiveFolds);
|
|
6711
6751
|
const liveNoteIdsByWorkRef = useRef9(/* @__PURE__ */ new Map());
|
|
6712
6752
|
const liveFoldMotionRef = useRef9(null);
|
|
@@ -6843,7 +6883,7 @@ function MessageTimeline({
|
|
|
6843
6883
|
fold.frame = requestFrame(step);
|
|
6844
6884
|
setOpenLiveFolds(next);
|
|
6845
6885
|
}, []);
|
|
6846
|
-
|
|
6886
|
+
useEffect10(
|
|
6847
6887
|
() => () => {
|
|
6848
6888
|
liveFoldMotionRef.current?.finish();
|
|
6849
6889
|
},
|
|
@@ -6969,7 +7009,7 @@ function MessageTimeline({
|
|
|
6969
7009
|
setOlderPrefetchArmed(true);
|
|
6970
7010
|
}
|
|
6971
7011
|
}, [autoFollow, applyPinned, clearPendingReaderLeave, clearReaderIntent, stopFollow]);
|
|
6972
|
-
|
|
7012
|
+
useEffect10(() => {
|
|
6973
7013
|
if (!readableTurns) return;
|
|
6974
7014
|
const node = scrollRef.current;
|
|
6975
7015
|
if (!node) return;
|
|
@@ -7239,7 +7279,7 @@ function MessageTimeline({
|
|
|
7239
7279
|
});
|
|
7240
7280
|
}, [readableTurns]);
|
|
7241
7281
|
scheduleQuestionNavRef.current = scheduleQuestionNav;
|
|
7242
|
-
|
|
7282
|
+
useEffect10(
|
|
7243
7283
|
() => () => {
|
|
7244
7284
|
if (questionNavFrameRef.current != null) {
|
|
7245
7285
|
cancelFrame(questionNavFrameRef.current);
|
|
@@ -7365,8 +7405,8 @@ function MessageTimeline({
|
|
|
7365
7405
|
[applyCanSkipTipCatchup, cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
7366
7406
|
);
|
|
7367
7407
|
driveFollowRef.current = driveFollow;
|
|
7368
|
-
|
|
7369
|
-
|
|
7408
|
+
useEffect10(() => stopFollow, [stopFollow]);
|
|
7409
|
+
useEffect10(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
|
|
7370
7410
|
useLayoutEffect5(() => {
|
|
7371
7411
|
const node = scrollRef.current;
|
|
7372
7412
|
if (!node) {
|
|
@@ -7585,7 +7625,7 @@ function MessageTimeline({
|
|
|
7585
7625
|
seenActivityIdsRef.current.clear();
|
|
7586
7626
|
applyPinned(true);
|
|
7587
7627
|
}, [allGroups.length, revealed, applyPinned, clearReaderIntent]);
|
|
7588
|
-
|
|
7628
|
+
useEffect10(() => {
|
|
7589
7629
|
const node = scrollRef.current;
|
|
7590
7630
|
if (node) {
|
|
7591
7631
|
requestOlderIfUnderfilled(node);
|
|
@@ -7600,7 +7640,7 @@ function MessageTimeline({
|
|
|
7600
7640
|
const frame = requestFrame(() => setBulkActive(false));
|
|
7601
7641
|
return () => cancelFrame(frame);
|
|
7602
7642
|
}, [bulkRender, firstGroupKey]);
|
|
7603
|
-
|
|
7643
|
+
useEffect10(() => {
|
|
7604
7644
|
const root = scrollRef.current;
|
|
7605
7645
|
const target = topSentinelRef.current;
|
|
7606
7646
|
if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
|
|
@@ -7651,7 +7691,7 @@ function MessageTimeline({
|
|
|
7651
7691
|
onLoadOlder,
|
|
7652
7692
|
requestOlderIfUnderfilled
|
|
7653
7693
|
]);
|
|
7654
|
-
|
|
7694
|
+
useEffect10(() => {
|
|
7655
7695
|
const root = scrollRef.current;
|
|
7656
7696
|
const target = bottomSentinelRef.current;
|
|
7657
7697
|
if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
|
|
@@ -7668,7 +7708,7 @@ function MessageTimeline({
|
|
|
7668
7708
|
observer.observe(target);
|
|
7669
7709
|
return () => observer.disconnect();
|
|
7670
7710
|
}, [hasNewer, loadingNewer, onLoadNewer, requestNewer, firstGroupKey]);
|
|
7671
|
-
|
|
7711
|
+
useEffect10(() => {
|
|
7672
7712
|
const node = scrollRef.current;
|
|
7673
7713
|
const inner = node?.firstElementChild;
|
|
7674
7714
|
if (!node || !inner || typeof ResizeObserver === "undefined") {
|
|
@@ -7706,7 +7746,7 @@ function MessageTimeline({
|
|
|
7706
7746
|
}
|
|
7707
7747
|
};
|
|
7708
7748
|
}, [autoFollow, driveFollow, requestOlderIfUnderfilled, snapToBottom]);
|
|
7709
|
-
|
|
7749
|
+
useEffect10(() => {
|
|
7710
7750
|
if (searchTargetRef.current) return;
|
|
7711
7751
|
if (hasNewer) {
|
|
7712
7752
|
stopFollow();
|
|
@@ -7862,18 +7902,18 @@ function MessageTimeline({
|
|
|
7862
7902
|
}
|
|
7863
7903
|
releasePinAfterScrollSettled(node);
|
|
7864
7904
|
};
|
|
7865
|
-
const timeline = /* @__PURE__ */
|
|
7905
|
+
const timeline = /* @__PURE__ */ jsx19(
|
|
7866
7906
|
AllowancePresentationProvider,
|
|
7867
7907
|
{
|
|
7868
7908
|
render: renderAllowanceExhausted,
|
|
7869
7909
|
labels: allowanceExhaustedLabels,
|
|
7870
|
-
children: /* @__PURE__ */
|
|
7910
|
+
children: /* @__PURE__ */ jsx19(LightboxProvider, { children: /* @__PURE__ */ jsx19(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx19(LiveNoteFoldContext.Provider, { value: reportLiveFold, children: /* @__PURE__ */ jsx19(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx19(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx19(EntranceAnimationProvider, { value: false, children: /* @__PURE__ */ jsx19(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx19(TimelineAnnotationSourceRootContext.Provider, { value: scrollRef, children: /* @__PURE__ */ jsxs14(
|
|
7871
7911
|
"div",
|
|
7872
7912
|
{
|
|
7873
7913
|
className: cn("og-root relative flex min-h-0 flex-col", className),
|
|
7874
7914
|
style: { "--og-work-header-top": "-4rem" },
|
|
7875
7915
|
children: [
|
|
7876
|
-
onAnnotate ? /* @__PURE__ */
|
|
7916
|
+
onAnnotate ? /* @__PURE__ */ jsx19(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
7877
7917
|
TimelineAnnotationSelection,
|
|
7878
7918
|
{
|
|
7879
7919
|
rootRef: scrollRef,
|
|
@@ -7881,7 +7921,7 @@ function MessageTimeline({
|
|
|
7881
7921
|
onAnnotate
|
|
7882
7922
|
}
|
|
7883
7923
|
) }) : null,
|
|
7884
|
-
/* @__PURE__ */
|
|
7924
|
+
/* @__PURE__ */ jsx19(
|
|
7885
7925
|
"div",
|
|
7886
7926
|
{
|
|
7887
7927
|
ref: scrollRef,
|
|
@@ -7948,7 +7988,7 @@ function MessageTimeline({
|
|
|
7948
7988
|
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-16 pb-6 sm:px-6 outline-hidden",
|
|
7949
7989
|
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
7950
7990
|
),
|
|
7951
|
-
children: /* @__PURE__ */
|
|
7991
|
+
children: /* @__PURE__ */ jsx19(
|
|
7952
7992
|
TimelineBeforeLayout,
|
|
7953
7993
|
{
|
|
7954
7994
|
capture: () => {
|
|
@@ -7958,11 +7998,11 @@ function MessageTimeline({
|
|
|
7958
7998
|
readingAnchorRef.current = !pinnedRef.current && scrollRef.current ? captureTimelineAnchor(scrollRef.current) : null;
|
|
7959
7999
|
settlementRef.current = readableTurns && autoFollow && pinnedRef.current && revealedRef.current && !hasNewer && !pendingReaderLeaveRef.current && !disclosureKeepsUnpinnedRef.current && !prefersReducedMotion() && scrollRef.current ? captureTimelineSettlement(scrollRef.current, groups) : null;
|
|
7960
8000
|
},
|
|
7961
|
-
children: /* @__PURE__ */
|
|
7962
|
-
/* @__PURE__ */
|
|
8001
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
8002
|
+
/* @__PURE__ */ jsx19(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
|
|
7963
8003
|
// Reserved top gutter: controls scroll with history and cannot
|
|
7964
8004
|
// cover a disclosure. Visibility never changes content height.
|
|
7965
|
-
/* @__PURE__ */
|
|
8005
|
+
/* @__PURE__ */ jsxs14(
|
|
7966
8006
|
motion3.div,
|
|
7967
8007
|
{
|
|
7968
8008
|
initial: { opacity: 0, y: -6 },
|
|
@@ -7973,8 +8013,8 @@ function MessageTimeline({
|
|
|
7973
8013
|
"aria-live": "polite",
|
|
7974
8014
|
className: "pointer-events-none absolute inset-x-0 -top-11 z-10 flex justify-center",
|
|
7975
8015
|
children: [
|
|
7976
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */
|
|
7977
|
-
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */
|
|
8016
|
+
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx19("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx19("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
8017
|
+
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx19(
|
|
7978
8018
|
"button",
|
|
7979
8019
|
{
|
|
7980
8020
|
type: "button",
|
|
@@ -8021,13 +8061,13 @@ function MessageTimeline({
|
|
|
8021
8061
|
}
|
|
8022
8062
|
)
|
|
8023
8063
|
) : null }),
|
|
8024
|
-
!groups.length ? emptyState ?? /* @__PURE__ */
|
|
8064
|
+
!groups.length ? emptyState ?? /* @__PURE__ */ jsx19("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
8025
8065
|
hasOlder && olderPrefetchArmed ? (
|
|
8026
8066
|
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
8027
8067
|
// must never shift content (that shift was itself a wobble).
|
|
8028
8068
|
// End at the scroll origin above the pt-16 gutter so the
|
|
8029
8069
|
// observer and scrollTop cooldown share the same 400px band.
|
|
8030
|
-
/* @__PURE__ */
|
|
8070
|
+
/* @__PURE__ */ jsx19(
|
|
8031
8071
|
"div",
|
|
8032
8072
|
{
|
|
8033
8073
|
ref: topSentinelRef,
|
|
@@ -8039,11 +8079,11 @@ function MessageTimeline({
|
|
|
8039
8079
|
)
|
|
8040
8080
|
) : null,
|
|
8041
8081
|
groups.map(({ group, key, entranceEnabled }, index) => {
|
|
8042
|
-
return /* @__PURE__ */
|
|
8082
|
+
return /* @__PURE__ */ jsx19(
|
|
8043
8083
|
TimelineSearchRevealContext.Provider,
|
|
8044
8084
|
{
|
|
8045
8085
|
value: searchItem && timelineGroupItemIds(group).includes(searchItem.id) ? searchRevealKey : null,
|
|
8046
|
-
children: /* @__PURE__ */
|
|
8086
|
+
children: /* @__PURE__ */ jsx19(
|
|
8047
8087
|
TimelineGroupEntry,
|
|
8048
8088
|
{
|
|
8049
8089
|
groupKey: key,
|
|
@@ -8062,18 +8102,18 @@ function MessageTimeline({
|
|
|
8062
8102
|
key
|
|
8063
8103
|
);
|
|
8064
8104
|
}),
|
|
8065
|
-
groups.length > 0 && trailingState ? /* @__PURE__ */
|
|
8066
|
-
hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */
|
|
8105
|
+
groups.length > 0 && trailingState ? /* @__PURE__ */ jsx19("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
|
|
8106
|
+
hasNewer && newerFailure?.key === newerBoundaryKey ? /* @__PURE__ */ jsxs14(
|
|
8067
8107
|
"div",
|
|
8068
8108
|
{
|
|
8069
8109
|
"data-og-newer-error": "",
|
|
8070
8110
|
className: "flex flex-col items-center gap-2 px-4 py-3 text-center text-og-menu text-og-fg-muted",
|
|
8071
8111
|
children: [
|
|
8072
|
-
/* @__PURE__ */
|
|
8112
|
+
/* @__PURE__ */ jsxs14("p", { role: "status", className: "max-w-prose [overflow-wrap:anywhere]", children: [
|
|
8073
8113
|
"Couldn\u2019t load later activity. ",
|
|
8074
8114
|
newerFailure.message
|
|
8075
8115
|
] }),
|
|
8076
|
-
/* @__PURE__ */
|
|
8116
|
+
/* @__PURE__ */ jsx19(
|
|
8077
8117
|
"button",
|
|
8078
8118
|
{
|
|
8079
8119
|
ref: newerRetryButtonRef,
|
|
@@ -8089,7 +8129,7 @@ function MessageTimeline({
|
|
|
8089
8129
|
]
|
|
8090
8130
|
}
|
|
8091
8131
|
) : null,
|
|
8092
|
-
hasNewer ? /* @__PURE__ */
|
|
8132
|
+
hasNewer ? /* @__PURE__ */ jsx19(
|
|
8093
8133
|
"div",
|
|
8094
8134
|
{
|
|
8095
8135
|
ref: bottomSentinelRef,
|
|
@@ -8104,7 +8144,7 @@ function MessageTimeline({
|
|
|
8104
8144
|
)
|
|
8105
8145
|
}
|
|
8106
8146
|
),
|
|
8107
|
-
draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */
|
|
8147
|
+
draftAnnotations && draftAnnotations.length > 0 ? /* @__PURE__ */ jsx19(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx19(
|
|
8108
8148
|
TimelineAnnotationMarkers,
|
|
8109
8149
|
{
|
|
8110
8150
|
rootRef: scrollRef,
|
|
@@ -8112,7 +8152,7 @@ function MessageTimeline({
|
|
|
8112
8152
|
onSelect: onDraftAnnotationSelect
|
|
8113
8153
|
}
|
|
8114
8154
|
) }) : null,
|
|
8115
|
-
/* @__PURE__ */
|
|
8155
|
+
/* @__PURE__ */ jsx19(
|
|
8116
8156
|
"div",
|
|
8117
8157
|
{
|
|
8118
8158
|
"data-og-timeline-nav": "top",
|
|
@@ -8120,7 +8160,7 @@ function MessageTimeline({
|
|
|
8120
8160
|
"pointer-events-none absolute inset-x-0 z-10 flex justify-center",
|
|
8121
8161
|
questionNav?.belowHeader ? "top-10 pointer-coarse:top-13" : "top-3"
|
|
8122
8162
|
),
|
|
8123
|
-
children: /* @__PURE__ */
|
|
8163
|
+
children: /* @__PURE__ */ jsx19(AnimatePresence3, { children: questionNav ? /* @__PURE__ */ jsxs14(
|
|
8124
8164
|
motion3.button,
|
|
8125
8165
|
{
|
|
8126
8166
|
...NAV_FADE,
|
|
@@ -8131,32 +8171,32 @@ function MessageTimeline({
|
|
|
8131
8171
|
onClick: () => jumpToQuestion(questionNav.key),
|
|
8132
8172
|
className: NAV_BUTTON_CLASS,
|
|
8133
8173
|
children: [
|
|
8134
|
-
/* @__PURE__ */
|
|
8135
|
-
/* @__PURE__ */
|
|
8174
|
+
/* @__PURE__ */ jsx19(ArrowUpIcon, { "aria-hidden": true, className: "size-4" }),
|
|
8175
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Back to your message" })
|
|
8136
8176
|
]
|
|
8137
8177
|
},
|
|
8138
8178
|
"question-nav"
|
|
8139
8179
|
) : null })
|
|
8140
8180
|
}
|
|
8141
8181
|
),
|
|
8142
|
-
/* @__PURE__ */
|
|
8182
|
+
/* @__PURE__ */ jsx19(
|
|
8143
8183
|
"div",
|
|
8144
8184
|
{
|
|
8145
8185
|
"data-og-timeline-nav": "bottom",
|
|
8146
8186
|
className: "pointer-events-none absolute inset-x-0 bottom-3 z-10 flex flex-col items-center gap-2",
|
|
8147
|
-
children: /* @__PURE__ */
|
|
8148
|
-
loadingNewer ? /* @__PURE__ */
|
|
8187
|
+
children: /* @__PURE__ */ jsxs14(AnimatePresence3, { children: [
|
|
8188
|
+
loadingNewer ? /* @__PURE__ */ jsx19(
|
|
8149
8189
|
motion3.div,
|
|
8150
8190
|
{
|
|
8151
8191
|
...NAV_FADE,
|
|
8152
8192
|
"data-og-loading-newer": "",
|
|
8153
8193
|
"aria-live": "polite",
|
|
8154
8194
|
className: "flex max-w-full justify-center",
|
|
8155
|
-
children: /* @__PURE__ */
|
|
8195
|
+
children: /* @__PURE__ */ jsx19("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx19("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
8156
8196
|
},
|
|
8157
8197
|
"loading-newer"
|
|
8158
8198
|
) : null,
|
|
8159
|
-
jumpPillShown ? /* @__PURE__ */
|
|
8199
|
+
jumpPillShown ? /* @__PURE__ */ jsxs14(
|
|
8160
8200
|
motion3.button,
|
|
8161
8201
|
{
|
|
8162
8202
|
...NAV_FADE,
|
|
@@ -8199,8 +8239,8 @@ function MessageTimeline({
|
|
|
8199
8239
|
},
|
|
8200
8240
|
className: NAV_BUTTON_CLASS,
|
|
8201
8241
|
children: [
|
|
8202
|
-
/* @__PURE__ */
|
|
8203
|
-
/* @__PURE__ */
|
|
8242
|
+
/* @__PURE__ */ jsx19(ArrowDownIcon, { "aria-hidden": true, className: "size-4" }),
|
|
8243
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Jump to latest" })
|
|
8204
8244
|
]
|
|
8205
8245
|
},
|
|
8206
8246
|
"jump-to-latest"
|
|
@@ -8213,7 +8253,7 @@ function MessageTimeline({
|
|
|
8213
8253
|
) }) }) }) }) }) }) }) })
|
|
8214
8254
|
}
|
|
8215
8255
|
);
|
|
8216
|
-
return /* @__PURE__ */
|
|
8256
|
+
return /* @__PURE__ */ jsx19(OpenGeniLinkProvider, { resolveLink, children: timeline });
|
|
8217
8257
|
}
|
|
8218
8258
|
function timelineGroupsRenderEqual(previous, next) {
|
|
8219
8259
|
try {
|
|
@@ -8301,17 +8341,17 @@ var TimelineGroupRenderBoundary = class extends Component3 {
|
|
|
8301
8341
|
}
|
|
8302
8342
|
render() {
|
|
8303
8343
|
if (this.state.failed) {
|
|
8304
|
-
return /* @__PURE__ */
|
|
8344
|
+
return /* @__PURE__ */ jsxs14(
|
|
8305
8345
|
"div",
|
|
8306
8346
|
{
|
|
8307
8347
|
"data-testid": "timeline-group-render-error",
|
|
8308
8348
|
role: "status",
|
|
8309
8349
|
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",
|
|
8310
8350
|
children: [
|
|
8311
|
-
/* @__PURE__ */
|
|
8312
|
-
/* @__PURE__ */
|
|
8313
|
-
/* @__PURE__ */
|
|
8314
|
-
/* @__PURE__ */
|
|
8351
|
+
/* @__PURE__ */ jsx19(TriangleAlertIcon2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
8352
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
8353
|
+
/* @__PURE__ */ jsx19("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
|
|
8354
|
+
/* @__PURE__ */ jsx19("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
|
|
8315
8355
|
] })
|
|
8316
8356
|
]
|
|
8317
8357
|
}
|
|
@@ -8333,7 +8373,7 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
|
|
|
8333
8373
|
const reducedMotion = useReducedMotion3();
|
|
8334
8374
|
const { behavior, userMessageDisclosureContext } = context;
|
|
8335
8375
|
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;
|
|
8336
|
-
const content = /* @__PURE__ */
|
|
8376
|
+
const content = /* @__PURE__ */ jsx19(ActivityNoteTextContext.Provider, { value: behavior.renderMessageText ?? null, children: /* @__PURE__ */ jsx19(
|
|
8337
8377
|
TimelineGroupView,
|
|
8338
8378
|
{
|
|
8339
8379
|
...behavior,
|
|
@@ -8344,7 +8384,7 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
|
|
|
8344
8384
|
contextCompactionCount: contextCompactionCount > 0 ? contextCompactionCount : void 0
|
|
8345
8385
|
}
|
|
8346
8386
|
) });
|
|
8347
|
-
return /* @__PURE__ */
|
|
8387
|
+
return /* @__PURE__ */ jsx19(GenieLoadingOptionsContext.Provider, { value: behavior.genieLoading, children: /* @__PURE__ */ jsx19(
|
|
8348
8388
|
"div",
|
|
8349
8389
|
{
|
|
8350
8390
|
"data-og-timeline-group-anchor": "",
|
|
@@ -8356,7 +8396,7 @@ var TimelineGroupEntry = memo(function TimelineGroupEntry2({
|
|
|
8356
8396
|
"aria-hidden": noteFolded || void 0,
|
|
8357
8397
|
inert: noteFolded || void 0,
|
|
8358
8398
|
className: noteFolded ? "-mt-5 h-0 overflow-hidden opacity-0 [overflow-anchor:none]" : void 0,
|
|
8359
|
-
children: /* @__PURE__ */
|
|
8399
|
+
children: /* @__PURE__ */ jsx19(EntranceAnimationProvider, { value: entranceEnabled, liveValue: liveEntranceEnabled, children: /* @__PURE__ */ jsx19(TimelineGroupRenderBoundary, { resetKeys: [group, behavior], children: /* @__PURE__ */ jsx19(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: group.kind === "item" ? /* @__PURE__ */ jsx19("div", { children: content }) : /* @__PURE__ */ jsx19(AnimatePresence3, { initial: false, children: /* @__PURE__ */ jsx19(
|
|
8360
8400
|
motion3.div,
|
|
8361
8401
|
{
|
|
8362
8402
|
initial: false,
|
|
@@ -8423,7 +8463,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8423
8463
|
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
8424
8464
|
) && !phases.some((item) => item.status === "failed" || item.status === "cancelled");
|
|
8425
8465
|
if (preparing) {
|
|
8426
|
-
return /* @__PURE__ */
|
|
8466
|
+
return /* @__PURE__ */ jsx19(
|
|
8427
8467
|
ActivityRail,
|
|
8428
8468
|
{
|
|
8429
8469
|
items: group.items,
|
|
@@ -8441,7 +8481,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8441
8481
|
const status = end ? { kind: "worked", durationMs: durationBetween(group.work.startedAt, end) } : group.work.waiting ? { kind: "waiting", ...group.work.waiting } : {
|
|
8442
8482
|
kind: "working",
|
|
8443
8483
|
since: group.work.startedAt,
|
|
8444
|
-
preview: containsPresentedImage ? void 0 : /* @__PURE__ */
|
|
8484
|
+
preview: containsPresentedImage ? void 0 : /* @__PURE__ */ jsx19(
|
|
8445
8485
|
RollingActivity,
|
|
8446
8486
|
{
|
|
8447
8487
|
items: group.items,
|
|
@@ -8453,7 +8493,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8453
8493
|
return (
|
|
8454
8494
|
// Marks this work row for the live-note fold (list keys can be carried
|
|
8455
8495
|
// over from an earlier row, so they are not the work id).
|
|
8456
|
-
/* @__PURE__ */
|
|
8496
|
+
/* @__PURE__ */ jsx19("div", { className: "contents", "data-og-work-id": group.id, children: /* @__PURE__ */ jsx19(
|
|
8457
8497
|
TurnSummary,
|
|
8458
8498
|
{
|
|
8459
8499
|
items: group.items,
|
|
@@ -8465,7 +8505,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8465
8505
|
facets: turnSummary?.facets,
|
|
8466
8506
|
contextCompactionCount: compactedLandmarkCount(group.work.details),
|
|
8467
8507
|
onOpenStateChange: group.work.liveNoteIds?.length && reportLiveFold ? (open) => reportLiveFold(group.id, open) : void 0,
|
|
8468
|
-
children: /* @__PURE__ */
|
|
8508
|
+
children: /* @__PURE__ */ jsx19(TurnRailFrame, { compact: true, children: renderFoldedGroups(
|
|
8469
8509
|
group.work.details,
|
|
8470
8510
|
{
|
|
8471
8511
|
renderMessageActions,
|
|
@@ -8491,7 +8531,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8491
8531
|
if (!startupDetails && !insideTurn && !group.outcome && group.items.every(
|
|
8492
8532
|
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
8493
8533
|
)) {
|
|
8494
|
-
return /* @__PURE__ */
|
|
8534
|
+
return /* @__PURE__ */ jsx19(
|
|
8495
8535
|
ActivityRail,
|
|
8496
8536
|
{
|
|
8497
8537
|
items: group.items,
|
|
@@ -8506,7 +8546,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8506
8546
|
);
|
|
8507
8547
|
}
|
|
8508
8548
|
if (turnSummary?.rolling && insideTurn && !startupDetails && !hasRememberedImageFold && group.items.filter((item) => item.kind !== "startup-phase").length === 1) {
|
|
8509
|
-
return /* @__PURE__ */
|
|
8549
|
+
return /* @__PURE__ */ jsx19(
|
|
8510
8550
|
ActivityRail,
|
|
8511
8551
|
{
|
|
8512
8552
|
items: group.items,
|
|
@@ -8525,7 +8565,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8525
8565
|
const singleThought = !startupDetails && visibleActivity.length === 1 && visibleActivity[0]?.kind === "reasoning";
|
|
8526
8566
|
const useNestedChip = nestClusterChips && (activityShouldFold || hasRememberedImageFold) && !singleThought;
|
|
8527
8567
|
if (!useNestedChip) {
|
|
8528
|
-
return /* @__PURE__ */
|
|
8568
|
+
return /* @__PURE__ */ jsx19(
|
|
8529
8569
|
ActivityRail,
|
|
8530
8570
|
{
|
|
8531
8571
|
items: group.items,
|
|
@@ -8539,7 +8579,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8539
8579
|
}
|
|
8540
8580
|
);
|
|
8541
8581
|
}
|
|
8542
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsx19(
|
|
8543
8583
|
TurnSummary,
|
|
8544
8584
|
{
|
|
8545
8585
|
items: group.items,
|
|
@@ -8550,7 +8590,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8550
8590
|
foldKey: group.id,
|
|
8551
8591
|
facets: turnSummary?.facets,
|
|
8552
8592
|
contextCompactionCount,
|
|
8553
|
-
children: /* @__PURE__ */
|
|
8593
|
+
children: /* @__PURE__ */ jsx19(
|
|
8554
8594
|
ActivityRail,
|
|
8555
8595
|
{
|
|
8556
8596
|
items: group.items,
|
|
@@ -8566,14 +8606,14 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8566
8606
|
settleChrome ? "settle" : "rest"
|
|
8567
8607
|
);
|
|
8568
8608
|
}
|
|
8569
|
-
return /* @__PURE__ */
|
|
8609
|
+
return /* @__PURE__ */ jsx19(
|
|
8570
8610
|
TurnSummary,
|
|
8571
8611
|
{
|
|
8572
8612
|
items: group.items,
|
|
8573
8613
|
outcome: group.outcome,
|
|
8574
8614
|
failureText: group.failureText,
|
|
8575
8615
|
defaultOpen: group.outcome === "failed" || containsPresentedImage || !turnSummary?.rolling && !activityShouldFold ? true : void 0,
|
|
8576
|
-
liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */
|
|
8616
|
+
liveHeader: turnSummary?.rolling && !containsPresentedImage && !group.outcome && !foldLiveCluster ? /* @__PURE__ */ jsx19(
|
|
8577
8617
|
RollingActivity,
|
|
8578
8618
|
{
|
|
8579
8619
|
items: group.items,
|
|
@@ -8585,7 +8625,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8585
8625
|
facets: turnSummary?.facets,
|
|
8586
8626
|
settleFold,
|
|
8587
8627
|
contextCompactionCount,
|
|
8588
|
-
children: /* @__PURE__ */
|
|
8628
|
+
children: /* @__PURE__ */ jsx19(FoldBody, { children: /* @__PURE__ */ jsx19(TurnRailFrame, { children: /* @__PURE__ */ jsx19(
|
|
8589
8629
|
ActivityRail,
|
|
8590
8630
|
{
|
|
8591
8631
|
items: group.items,
|
|
@@ -8607,7 +8647,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8607
8647
|
(item) => item.kind === "startup-phase" && item.status === "complete"
|
|
8608
8648
|
)
|
|
8609
8649
|
))
|
|
8610
|
-
return /* @__PURE__ */
|
|
8650
|
+
return /* @__PURE__ */ jsx19(ActivityRail, { items: activityItems, startupActive: false, bare: true });
|
|
8611
8651
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
8612
8652
|
const body = renderFoldedGroups(group.groups, {
|
|
8613
8653
|
renderMessageActions,
|
|
@@ -8624,7 +8664,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8624
8664
|
turnSummary
|
|
8625
8665
|
});
|
|
8626
8666
|
const durationMs = durationBetween(group.startedAt, group.endedAt);
|
|
8627
|
-
return /* @__PURE__ */
|
|
8667
|
+
return /* @__PURE__ */ jsx19(
|
|
8628
8668
|
TurnSummary,
|
|
8629
8669
|
{
|
|
8630
8670
|
items: activityItems,
|
|
@@ -8638,16 +8678,16 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8638
8678
|
settleFold,
|
|
8639
8679
|
copyText: insideTurn ? void 0 : turnCopyText,
|
|
8640
8680
|
contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
|
|
8641
|
-
children: /* @__PURE__ */
|
|
8681
|
+
children: /* @__PURE__ */ jsx19(FoldBody, { children: insideTurn ? (
|
|
8642
8682
|
// A nested turn is already on an ancestor rail — its body just stacks
|
|
8643
8683
|
// flush (the bare-node body already indents it), so no second rule.
|
|
8644
|
-
/* @__PURE__ */
|
|
8645
|
-
) : /* @__PURE__ */
|
|
8684
|
+
/* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-4", children: body })
|
|
8685
|
+
) : /* @__PURE__ */ jsx19(TurnRailFrame, { children: body }) })
|
|
8646
8686
|
}
|
|
8647
8687
|
);
|
|
8648
8688
|
}
|
|
8649
8689
|
case "item":
|
|
8650
|
-
return /* @__PURE__ */
|
|
8690
|
+
return /* @__PURE__ */ jsx19(
|
|
8651
8691
|
TimelineRow,
|
|
8652
8692
|
{
|
|
8653
8693
|
item: group.item,
|
|
@@ -8664,7 +8704,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
8664
8704
|
});
|
|
8665
8705
|
function renderFoldedGroups(groups, behavior, readableWork = false) {
|
|
8666
8706
|
const nestClusters = foldableActivityClusterCount(groups) >= 2;
|
|
8667
|
-
return groups.map((child, index) => /* @__PURE__ */
|
|
8707
|
+
return groups.map((child, index) => /* @__PURE__ */ jsx19(
|
|
8668
8708
|
TimelineGroupRenderBoundary,
|
|
8669
8709
|
{
|
|
8670
8710
|
resetKeys: [
|
|
@@ -8682,13 +8722,13 @@ function renderFoldedGroups(groups, behavior, readableWork = false) {
|
|
|
8682
8722
|
behavior.loadVideoArtifactPlayback,
|
|
8683
8723
|
behavior.turnSummary
|
|
8684
8724
|
],
|
|
8685
|
-
children: readableWork ? /* @__PURE__ */
|
|
8725
|
+
children: readableWork ? /* @__PURE__ */ jsx19(
|
|
8686
8726
|
"div",
|
|
8687
8727
|
{
|
|
8688
8728
|
className: index > 0 && (child.kind !== "activity" || groups[index - 1]?.kind !== "activity") ? "mt-3" : void 0,
|
|
8689
|
-
children: /* @__PURE__ */
|
|
8729
|
+
children: /* @__PURE__ */ jsx19(TimelineGroupView, { ...behavior, group: child, insideTurn: true, startupDismissed: true })
|
|
8690
8730
|
}
|
|
8691
|
-
) : /* @__PURE__ */
|
|
8731
|
+
) : /* @__PURE__ */ jsx19(TimelineGroupView, { ...behavior, group: child, insideTurn: true, nestClusterChips: nestClusters })
|
|
8692
8732
|
},
|
|
8693
8733
|
timelineGroupKey(child)
|
|
8694
8734
|
));
|
|
@@ -8699,10 +8739,10 @@ function compactedLandmarkCount(groups) {
|
|
|
8699
8739
|
).length;
|
|
8700
8740
|
}
|
|
8701
8741
|
function FoldBody({ children }) {
|
|
8702
|
-
return /* @__PURE__ */
|
|
8742
|
+
return /* @__PURE__ */ jsx19(Fragment6, { children });
|
|
8703
8743
|
}
|
|
8704
8744
|
function TurnRailFrame({ children, compact = false }) {
|
|
8705
|
-
return /* @__PURE__ */
|
|
8745
|
+
return /* @__PURE__ */ jsx19(
|
|
8706
8746
|
"div",
|
|
8707
8747
|
{
|
|
8708
8748
|
className: cn(
|
|
@@ -8893,7 +8933,7 @@ function TimelineRow({
|
|
|
8893
8933
|
}) {
|
|
8894
8934
|
switch (item.kind) {
|
|
8895
8935
|
case "user-message":
|
|
8896
|
-
return /* @__PURE__ */
|
|
8936
|
+
return /* @__PURE__ */ jsx19(
|
|
8897
8937
|
UserMessageRow,
|
|
8898
8938
|
{
|
|
8899
8939
|
item,
|
|
@@ -8902,9 +8942,9 @@ function TimelineRow({
|
|
|
8902
8942
|
}
|
|
8903
8943
|
);
|
|
8904
8944
|
case "human-input":
|
|
8905
|
-
return /* @__PURE__ */
|
|
8945
|
+
return /* @__PURE__ */ jsx19(HumanInputConversationRow, { item });
|
|
8906
8946
|
case "agent-message":
|
|
8907
|
-
return /* @__PURE__ */
|
|
8947
|
+
return /* @__PURE__ */ jsx19(
|
|
8908
8948
|
AgentMessageRow,
|
|
8909
8949
|
{
|
|
8910
8950
|
item,
|
|
@@ -8913,13 +8953,13 @@ function TimelineRow({
|
|
|
8913
8953
|
}
|
|
8914
8954
|
);
|
|
8915
8955
|
case "worker-completion":
|
|
8916
|
-
return /* @__PURE__ */
|
|
8956
|
+
return /* @__PURE__ */ jsx19(WorkerCompletionRow, { item, onOpenSession });
|
|
8917
8957
|
case "session-status":
|
|
8918
|
-
return /* @__PURE__ */
|
|
8958
|
+
return /* @__PURE__ */ jsx19(SessionStatusRow, { item });
|
|
8919
8959
|
case "goal":
|
|
8920
|
-
return /* @__PURE__ */
|
|
8960
|
+
return /* @__PURE__ */ jsx19(GoalRow, { item });
|
|
8921
8961
|
case "machine-input-batch":
|
|
8922
|
-
return /* @__PURE__ */
|
|
8962
|
+
return /* @__PURE__ */ jsx19(
|
|
8923
8963
|
MachineInputBatchRow,
|
|
8924
8964
|
{
|
|
8925
8965
|
item,
|
|
@@ -8928,11 +8968,11 @@ function TimelineRow({
|
|
|
8928
8968
|
}
|
|
8929
8969
|
);
|
|
8930
8970
|
case "notice":
|
|
8931
|
-
return /* @__PURE__ */
|
|
8971
|
+
return /* @__PURE__ */ jsx19(NoticeRow, { item });
|
|
8932
8972
|
case "context-compaction":
|
|
8933
|
-
return /* @__PURE__ */
|
|
8973
|
+
return /* @__PURE__ */ jsx19(CompactionRow, { item });
|
|
8934
8974
|
case "auth-needed":
|
|
8935
|
-
return renderAuthNeeded?.(item) ?? /* @__PURE__ */
|
|
8975
|
+
return renderAuthNeeded?.(item) ?? /* @__PURE__ */ jsx19(
|
|
8936
8976
|
AuthNeededRow,
|
|
8937
8977
|
{
|
|
8938
8978
|
item,
|
|
@@ -8958,7 +8998,7 @@ function CompactionRow({ item }) {
|
|
|
8958
8998
|
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";
|
|
8959
8999
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason, item.providerRejection) : null;
|
|
8960
9000
|
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;
|
|
8961
|
-
return /* @__PURE__ */
|
|
9001
|
+
return /* @__PURE__ */ jsx19("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
|
|
8962
9002
|
"div",
|
|
8963
9003
|
{
|
|
8964
9004
|
className: cn(
|
|
@@ -8967,20 +9007,20 @@ function CompactionRow({ item }) {
|
|
|
8967
9007
|
),
|
|
8968
9008
|
role: "status",
|
|
8969
9009
|
children: [
|
|
8970
|
-
/* @__PURE__ */
|
|
8971
|
-
/* @__PURE__ */
|
|
8972
|
-
/* @__PURE__ */
|
|
9010
|
+
/* @__PURE__ */ jsxs14("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
9011
|
+
/* @__PURE__ */ jsx19(ShrinkIcon2, { className: "size-3.5 shrink-0" }),
|
|
9012
|
+
/* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
|
|
8973
9013
|
title,
|
|
8974
9014
|
trigger ? ` \xB7 ${trigger}` : ""
|
|
8975
9015
|
] })
|
|
8976
9016
|
] }),
|
|
8977
|
-
subtitle ? /* @__PURE__ */
|
|
9017
|
+
subtitle ? /* @__PURE__ */ jsx19("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
|
|
8978
9018
|
]
|
|
8979
9019
|
}
|
|
8980
9020
|
) });
|
|
8981
9021
|
}
|
|
8982
9022
|
function MessageFooterTime({ occurredAt }) {
|
|
8983
|
-
return /* @__PURE__ */
|
|
9023
|
+
return /* @__PURE__ */ jsx19(
|
|
8984
9024
|
"time",
|
|
8985
9025
|
{
|
|
8986
9026
|
dateTime: occurredAt,
|
|
@@ -9000,28 +9040,28 @@ function UserMessageRow({
|
|
|
9000
9040
|
}) {
|
|
9001
9041
|
const enter = useEntranceAnimation();
|
|
9002
9042
|
const deliveryFailed = item.delivery?.state === "failed";
|
|
9003
|
-
return /* @__PURE__ */
|
|
9004
|
-
/* @__PURE__ */
|
|
9043
|
+
return /* @__PURE__ */ jsx19("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs14("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
|
|
9044
|
+
/* @__PURE__ */ jsx19(
|
|
9005
9045
|
CopyHoverFrame,
|
|
9006
9046
|
{
|
|
9007
9047
|
copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
|
|
9008
9048
|
${annotation.note}`).join("\n\n"),
|
|
9009
9049
|
label: "Copy message",
|
|
9010
9050
|
className: "w-fit max-w-full min-w-0",
|
|
9011
|
-
trailing: /* @__PURE__ */
|
|
9051
|
+
trailing: /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
9012
9052
|
renderMessageActions?.(item),
|
|
9013
|
-
/* @__PURE__ */
|
|
9053
|
+
/* @__PURE__ */ jsx19(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
9014
9054
|
] }),
|
|
9015
|
-
children: /* @__PURE__ */
|
|
9016
|
-
item.text ? /* @__PURE__ */
|
|
9055
|
+
children: /* @__PURE__ */ jsxs14("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
9056
|
+
item.text ? /* @__PURE__ */ jsx19(
|
|
9017
9057
|
"div",
|
|
9018
9058
|
{
|
|
9019
9059
|
"data-og-search-item": item.id,
|
|
9020
9060
|
"data-og-annotation-source-key": item.annotationSource?.eventId,
|
|
9021
|
-
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
9061
|
+
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx19(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx19(Markdown, { children: item.text }) })
|
|
9022
9062
|
}
|
|
9023
9063
|
) : null,
|
|
9024
|
-
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
9064
|
+
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx19(
|
|
9025
9065
|
TimelineAnnotationCards,
|
|
9026
9066
|
{
|
|
9027
9067
|
annotations: item.annotations ?? [],
|
|
@@ -9031,18 +9071,18 @@ ${annotation.note}`).join("\n\n"),
|
|
|
9031
9071
|
] })
|
|
9032
9072
|
}
|
|
9033
9073
|
),
|
|
9034
|
-
deliveryFailed ? /* @__PURE__ */
|
|
9074
|
+
deliveryFailed ? /* @__PURE__ */ jsxs14(
|
|
9035
9075
|
"div",
|
|
9036
9076
|
{
|
|
9037
9077
|
role: "status",
|
|
9038
9078
|
className: "flex max-w-full flex-col items-start gap-1 px-1 text-og-xs text-og-status-failed",
|
|
9039
9079
|
children: [
|
|
9040
|
-
/* @__PURE__ */
|
|
9041
|
-
/* @__PURE__ */
|
|
9042
|
-
/* @__PURE__ */
|
|
9080
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex min-w-0 items-start gap-1", children: [
|
|
9081
|
+
/* @__PURE__ */ jsx19(TriangleAlertIcon2, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9082
|
+
/* @__PURE__ */ jsx19("span", { className: "min-w-0 break-words", children: item.delivery?.error || "Message not sent" })
|
|
9043
9083
|
] }),
|
|
9044
|
-
/* @__PURE__ */
|
|
9045
|
-
item.delivery?.onEdit ? /* @__PURE__ */
|
|
9084
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
9085
|
+
item.delivery?.onEdit ? /* @__PURE__ */ jsx19(
|
|
9046
9086
|
"button",
|
|
9047
9087
|
{
|
|
9048
9088
|
type: "button",
|
|
@@ -9051,7 +9091,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
9051
9091
|
children: "Edit message"
|
|
9052
9092
|
}
|
|
9053
9093
|
) : null,
|
|
9054
|
-
item.delivery?.onRetry ? /* @__PURE__ */
|
|
9094
|
+
item.delivery?.onRetry ? /* @__PURE__ */ jsx19(
|
|
9055
9095
|
"button",
|
|
9056
9096
|
{
|
|
9057
9097
|
type: "button",
|
|
@@ -9060,7 +9100,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
9060
9100
|
children: "Retry"
|
|
9061
9101
|
}
|
|
9062
9102
|
) : null,
|
|
9063
|
-
item.delivery?.onRemove ? /* @__PURE__ */
|
|
9103
|
+
item.delivery?.onRemove ? /* @__PURE__ */ jsx19(
|
|
9064
9104
|
"button",
|
|
9065
9105
|
{
|
|
9066
9106
|
type: "button",
|
|
@@ -9083,26 +9123,26 @@ function HumanInputConversationRow({ item }) {
|
|
|
9083
9123
|
);
|
|
9084
9124
|
const settledLabel = item.response.outcome === "answered" ? "You answered" : item.response.outcome === "skipped" ? "Skipped" : item.response.outcome === "expired" ? "Expired" : "Cancelled";
|
|
9085
9125
|
const copyText = humanInputConversationCopyText(item, settledLabel);
|
|
9086
|
-
return /* @__PURE__ */
|
|
9126
|
+
return /* @__PURE__ */ jsxs14(
|
|
9087
9127
|
"div",
|
|
9088
9128
|
{
|
|
9089
9129
|
className: cn(enter && "animate-og-enter", "flex w-full flex-col gap-2.5"),
|
|
9090
9130
|
"data-human-input-history": item.requestId,
|
|
9091
9131
|
children: [
|
|
9092
|
-
/* @__PURE__ */
|
|
9093
|
-
/* @__PURE__ */
|
|
9094
|
-
/* @__PURE__ */
|
|
9095
|
-
/* @__PURE__ */
|
|
9096
|
-
/* @__PURE__ */
|
|
9097
|
-
question.label ? /* @__PURE__ */
|
|
9098
|
-
multipleQuestions ? /* @__PURE__ */
|
|
9132
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
9133
|
+
/* @__PURE__ */ jsx19("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__ */ jsx19(MessageCircleQuestionIcon3, { "aria-hidden": "true", className: "size-4" }) }),
|
|
9134
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
9135
|
+
/* @__PURE__ */ jsx19("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: "Agent asked" }),
|
|
9136
|
+
/* @__PURE__ */ jsx19("div", { className: "mt-1.5 space-y-3", children: item.questions.length > 0 ? item.questions.map((question, index) => /* @__PURE__ */ jsxs14("div", { children: [
|
|
9137
|
+
question.label ? /* @__PURE__ */ jsxs14("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
9138
|
+
multipleQuestions ? /* @__PURE__ */ jsxs14("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
9099
9139
|
index + 1,
|
|
9100
9140
|
"."
|
|
9101
9141
|
] }) : null,
|
|
9102
9142
|
multipleQuestions ? " " : null,
|
|
9103
9143
|
question.label
|
|
9104
9144
|
] }) : null,
|
|
9105
|
-
/* @__PURE__ */
|
|
9145
|
+
/* @__PURE__ */ jsxs14(
|
|
9106
9146
|
"p",
|
|
9107
9147
|
{
|
|
9108
9148
|
className: cn(
|
|
@@ -9110,7 +9150,7 @@ function HumanInputConversationRow({ item }) {
|
|
|
9110
9150
|
question.label && "mt-0.5 text-og-sm text-og-fg-muted"
|
|
9111
9151
|
),
|
|
9112
9152
|
children: [
|
|
9113
|
-
!question.label && multipleQuestions ? /* @__PURE__ */
|
|
9153
|
+
!question.label && multipleQuestions ? /* @__PURE__ */ jsxs14("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
9114
9154
|
index + 1,
|
|
9115
9155
|
"."
|
|
9116
9156
|
] }) : null,
|
|
@@ -9119,29 +9159,29 @@ function HumanInputConversationRow({ item }) {
|
|
|
9119
9159
|
]
|
|
9120
9160
|
}
|
|
9121
9161
|
)
|
|
9122
|
-
] }, question.id)) : /* @__PURE__ */
|
|
9162
|
+
] }, question.id)) : /* @__PURE__ */ jsx19("p", { className: "text-og-sm text-og-fg-muted", children: "The agent requested structured input." }) })
|
|
9123
9163
|
] })
|
|
9124
9164
|
] }),
|
|
9125
|
-
/* @__PURE__ */
|
|
9165
|
+
/* @__PURE__ */ jsx19("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx19(
|
|
9126
9166
|
CopyHoverFrame,
|
|
9127
9167
|
{
|
|
9128
9168
|
copyText,
|
|
9129
9169
|
label: "Copy answer",
|
|
9130
9170
|
className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
|
|
9131
|
-
trailing: /* @__PURE__ */
|
|
9132
|
-
children: /* @__PURE__ */
|
|
9133
|
-
/* @__PURE__ */
|
|
9134
|
-
item.response.outcome === "answered" ? /* @__PURE__ */
|
|
9135
|
-
multipleQuestions ? /* @__PURE__ */
|
|
9136
|
-
/* @__PURE__ */
|
|
9171
|
+
trailing: /* @__PURE__ */ jsx19(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
9172
|
+
children: /* @__PURE__ */ jsxs14("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
9173
|
+
/* @__PURE__ */ jsx19("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
|
|
9174
|
+
item.response.outcome === "answered" ? /* @__PURE__ */ jsx19("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs14("div", { children: [
|
|
9175
|
+
multipleQuestions ? /* @__PURE__ */ jsxs14("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
9176
|
+
/* @__PURE__ */ jsxs14("span", { className: "mr-1.5 tabular-nums text-og-fg-muted", children: [
|
|
9137
9177
|
questionNumberById.get(answer.questionId) ?? answerIndex + 1,
|
|
9138
9178
|
"."
|
|
9139
9179
|
] }),
|
|
9140
9180
|
" ",
|
|
9141
9181
|
answer.label
|
|
9142
9182
|
] }) : null,
|
|
9143
|
-
/* @__PURE__ */
|
|
9144
|
-
] }, answer.questionId)) : /* @__PURE__ */
|
|
9183
|
+
/* @__PURE__ */ jsx19("div", { className: cn("text-og-md text-og-fg", multipleQuestions && "mt-0.5"), children: answer.values.length > 1 ? /* @__PURE__ */ jsx19("ul", { className: "list-disc space-y-0.5 pl-5", children: answer.values.map((value) => /* @__PURE__ */ jsx19("li", { children: value }, `${answer.questionId}-${value}`)) }) : /* @__PURE__ */ jsx19("p", { children: answer.values[0] || "Answered" }) })
|
|
9184
|
+
] }, answer.questionId)) : /* @__PURE__ */ jsx19("p", { children: "Answered" }) }) : null
|
|
9145
9185
|
] })
|
|
9146
9186
|
}
|
|
9147
9187
|
) })
|
|
@@ -9169,19 +9209,19 @@ function AgentMessageRow({
|
|
|
9169
9209
|
renderMessageText
|
|
9170
9210
|
}) {
|
|
9171
9211
|
const enter = useEntranceAnimation();
|
|
9172
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
9173
|
-
return /* @__PURE__ */
|
|
9212
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx19(Markdown, { streaming: item.streaming, children: item.text });
|
|
9213
|
+
return /* @__PURE__ */ jsx19(
|
|
9174
9214
|
CopyHoverFrame,
|
|
9175
9215
|
{
|
|
9176
9216
|
copyText: item.text,
|
|
9177
9217
|
label: "Copy message",
|
|
9178
9218
|
align: "start",
|
|
9179
9219
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
9180
|
-
trailing: item.streaming ? null : /* @__PURE__ */
|
|
9220
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
9181
9221
|
renderMessageActions?.(item),
|
|
9182
|
-
/* @__PURE__ */
|
|
9222
|
+
/* @__PURE__ */ jsx19(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
9183
9223
|
] }),
|
|
9184
|
-
children: /* @__PURE__ */
|
|
9224
|
+
children: /* @__PURE__ */ jsx19(
|
|
9185
9225
|
"div",
|
|
9186
9226
|
{
|
|
9187
9227
|
"data-og-wide-table-message": "",
|
|
@@ -9230,7 +9270,7 @@ function WorkerCompletionRow({
|
|
|
9230
9270
|
onOpenSession
|
|
9231
9271
|
}) {
|
|
9232
9272
|
const enter = useEntranceAnimation();
|
|
9233
|
-
const [open, setOpen] =
|
|
9273
|
+
const [open, setOpen] = useState15(false);
|
|
9234
9274
|
const meta = workerCompletionMeta(item);
|
|
9235
9275
|
const Icon = meta.icon;
|
|
9236
9276
|
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && !!item.pausedReason?.trim();
|
|
@@ -9240,17 +9280,17 @@ function WorkerCompletionRow({
|
|
|
9240
9280
|
...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
|
|
9241
9281
|
];
|
|
9242
9282
|
const hasDetails = details.length > 0;
|
|
9243
|
-
return /* @__PURE__ */
|
|
9244
|
-
/* @__PURE__ */
|
|
9245
|
-
/* @__PURE__ */
|
|
9246
|
-
/* @__PURE__ */
|
|
9247
|
-
/* @__PURE__ */
|
|
9248
|
-
item.goalText ? /* @__PURE__ */
|
|
9283
|
+
return /* @__PURE__ */ jsx19("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
|
|
9284
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2.5", children: [
|
|
9285
|
+
/* @__PURE__ */ jsx19("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx19(Icon, { className: "size-4" }) }),
|
|
9286
|
+
/* @__PURE__ */ jsx19("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs14("p", { className: "text-og-base leading-5 text-og-fg", children: [
|
|
9287
|
+
/* @__PURE__ */ jsx19("span", { className: "font-medium", children: meta.label }),
|
|
9288
|
+
item.goalText ? /* @__PURE__ */ jsxs14("span", { className: "text-og-fg-muted", children: [
|
|
9249
9289
|
" \xB7 ",
|
|
9250
9290
|
truncate(item.goalText, 90)
|
|
9251
9291
|
] }) : null
|
|
9252
9292
|
] }) }),
|
|
9253
|
-
item.childSessionId && onOpenSession ? /* @__PURE__ */
|
|
9293
|
+
item.childSessionId && onOpenSession ? /* @__PURE__ */ jsxs14(
|
|
9254
9294
|
"button",
|
|
9255
9295
|
{
|
|
9256
9296
|
type: "button",
|
|
@@ -9262,13 +9302,13 @@ function WorkerCompletionRow({
|
|
|
9262
9302
|
),
|
|
9263
9303
|
children: [
|
|
9264
9304
|
"View session",
|
|
9265
|
-
/* @__PURE__ */
|
|
9305
|
+
/* @__PURE__ */ jsx19(ArrowRightIcon2, { className: "size-3.5" })
|
|
9266
9306
|
]
|
|
9267
9307
|
}
|
|
9268
9308
|
) : null
|
|
9269
9309
|
] }),
|
|
9270
|
-
hasDetails ? /* @__PURE__ */
|
|
9271
|
-
/* @__PURE__ */
|
|
9310
|
+
hasDetails ? /* @__PURE__ */ jsxs14(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
|
|
9311
|
+
/* @__PURE__ */ jsx19(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
|
|
9272
9312
|
"button",
|
|
9273
9313
|
{
|
|
9274
9314
|
type: "button",
|
|
@@ -9277,14 +9317,14 @@ function WorkerCompletionRow({
|
|
|
9277
9317
|
"outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
9278
9318
|
),
|
|
9279
9319
|
children: [
|
|
9280
|
-
/* @__PURE__ */
|
|
9320
|
+
/* @__PURE__ */ jsx19(ChevronRightIcon2, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
|
|
9281
9321
|
open ? "Hide details" : "Show details"
|
|
9282
9322
|
]
|
|
9283
9323
|
}
|
|
9284
9324
|
) }),
|
|
9285
|
-
/* @__PURE__ */
|
|
9286
|
-
/* @__PURE__ */
|
|
9287
|
-
/* @__PURE__ */
|
|
9325
|
+
/* @__PURE__ */ jsx19(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx19("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
9326
|
+
/* @__PURE__ */ jsx19("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
|
|
9327
|
+
/* @__PURE__ */ jsx19(
|
|
9288
9328
|
"p",
|
|
9289
9329
|
{
|
|
9290
9330
|
className: cn(
|
|
@@ -9303,7 +9343,7 @@ function SessionStatusRow({
|
|
|
9303
9343
|
}) {
|
|
9304
9344
|
const enter = useEntranceAnimation();
|
|
9305
9345
|
const meta = SESSION_STATUS_META[item.status];
|
|
9306
|
-
return /* @__PURE__ */
|
|
9346
|
+
return /* @__PURE__ */ jsxs14(
|
|
9307
9347
|
"div",
|
|
9308
9348
|
{
|
|
9309
9349
|
className: cn(
|
|
@@ -9312,15 +9352,15 @@ function SessionStatusRow({
|
|
|
9312
9352
|
),
|
|
9313
9353
|
role: "status",
|
|
9314
9354
|
children: [
|
|
9315
|
-
/* @__PURE__ */
|
|
9316
|
-
/* @__PURE__ */
|
|
9317
|
-
item.resolvedAt ? null : /* @__PURE__ */
|
|
9355
|
+
/* @__PURE__ */ jsx19("span", { className: "h-px flex-1 bg-og-border" }),
|
|
9356
|
+
/* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
9357
|
+
item.resolvedAt ? null : /* @__PURE__ */ jsx19(StatusDot, { status: item.status, className: "size-1" }),
|
|
9318
9358
|
item.resolvedAt ? "work resumed" : meta.label.toLowerCase(),
|
|
9319
9359
|
" \xB7",
|
|
9320
9360
|
" ",
|
|
9321
9361
|
formatRelativeTime(item.resolvedAt ?? item.occurredAt)
|
|
9322
9362
|
] }),
|
|
9323
|
-
/* @__PURE__ */
|
|
9363
|
+
/* @__PURE__ */ jsx19("span", { className: "h-px flex-1 bg-og-border" })
|
|
9324
9364
|
]
|
|
9325
9365
|
}
|
|
9326
9366
|
);
|
|
@@ -9358,7 +9398,7 @@ function goalMeta(action) {
|
|
|
9358
9398
|
function GoalRow({ item }) {
|
|
9359
9399
|
const enter = useEntranceAnimation();
|
|
9360
9400
|
const { label, pill, icon: Icon } = goalMeta(item.action);
|
|
9361
|
-
return /* @__PURE__ */
|
|
9401
|
+
return /* @__PURE__ */ jsx19("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
|
|
9362
9402
|
"span",
|
|
9363
9403
|
{
|
|
9364
9404
|
className: cn(
|
|
@@ -9366,8 +9406,8 @@ function GoalRow({ item }) {
|
|
|
9366
9406
|
pill
|
|
9367
9407
|
),
|
|
9368
9408
|
children: [
|
|
9369
|
-
/* @__PURE__ */
|
|
9370
|
-
/* @__PURE__ */
|
|
9409
|
+
/* @__PURE__ */ jsx19(Icon, { className: "size-3.5 shrink-0" }),
|
|
9410
|
+
/* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
|
|
9371
9411
|
label,
|
|
9372
9412
|
item.text ? `: ${truncate(item.text, 90)}` : ""
|
|
9373
9413
|
] })
|
|
@@ -9384,7 +9424,7 @@ function MachineInputBatchRow({
|
|
|
9384
9424
|
const label = machineInputBatchLabel(item.members);
|
|
9385
9425
|
const single = item.members.length === 1 ? item.members[0] : null;
|
|
9386
9426
|
if (single?.kind === "media_generation_result" && single.result) {
|
|
9387
|
-
return /* @__PURE__ */
|
|
9427
|
+
return /* @__PURE__ */ jsx19(
|
|
9388
9428
|
VideoGenerationResultRow,
|
|
9389
9429
|
{
|
|
9390
9430
|
result: single.result,
|
|
@@ -9394,15 +9434,15 @@ function MachineInputBatchRow({
|
|
|
9394
9434
|
}
|
|
9395
9435
|
const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
|
|
9396
9436
|
const showCollapsedSummary = !item.compact && single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
|
|
9397
|
-
return /* @__PURE__ */
|
|
9398
|
-
/* @__PURE__ */
|
|
9437
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
|
|
9438
|
+
/* @__PURE__ */ jsxs14(
|
|
9399
9439
|
"details",
|
|
9400
9440
|
{
|
|
9401
9441
|
className: "group w-full max-w-full",
|
|
9402
9442
|
"data-og-machine-input-batch": "",
|
|
9403
9443
|
title: `Received ${formatClockTime(item.occurredAt)}`,
|
|
9404
9444
|
children: [
|
|
9405
|
-
/* @__PURE__ */
|
|
9445
|
+
/* @__PURE__ */ jsx19("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs14(
|
|
9406
9446
|
"span",
|
|
9407
9447
|
{
|
|
9408
9448
|
className: cn(
|
|
@@ -9410,23 +9450,23 @@ function MachineInputBatchRow({
|
|
|
9410
9450
|
NEUTRAL_PILL
|
|
9411
9451
|
),
|
|
9412
9452
|
children: [
|
|
9413
|
-
/* @__PURE__ */
|
|
9453
|
+
/* @__PURE__ */ jsx19(
|
|
9414
9454
|
ChevronRightIcon2,
|
|
9415
9455
|
{
|
|
9416
9456
|
"aria-hidden": true,
|
|
9417
9457
|
className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
|
|
9418
9458
|
}
|
|
9419
9459
|
),
|
|
9420
|
-
/* @__PURE__ */
|
|
9460
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", children: label })
|
|
9421
9461
|
]
|
|
9422
9462
|
}
|
|
9423
9463
|
) }),
|
|
9424
|
-
/* @__PURE__ */
|
|
9425
|
-
/* @__PURE__ */
|
|
9464
|
+
/* @__PURE__ */ jsxs14("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: [
|
|
9465
|
+
/* @__PURE__ */ jsxs14("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
9426
9466
|
"Received ",
|
|
9427
|
-
/* @__PURE__ */
|
|
9467
|
+
/* @__PURE__ */ jsx19("time", { dateTime: item.occurredAt, children: formatClockTime(item.occurredAt) })
|
|
9428
9468
|
] }),
|
|
9429
|
-
item.members.map((member) => /* @__PURE__ */
|
|
9469
|
+
item.members.map((member) => /* @__PURE__ */ jsx19(
|
|
9430
9470
|
MachineInputRow,
|
|
9431
9471
|
{
|
|
9432
9472
|
member,
|
|
@@ -9439,7 +9479,7 @@ function MachineInputBatchRow({
|
|
|
9439
9479
|
]
|
|
9440
9480
|
}
|
|
9441
9481
|
),
|
|
9442
|
-
showCollapsedSummary ? /* @__PURE__ */
|
|
9482
|
+
showCollapsedSummary ? /* @__PURE__ */ jsx19("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
|
|
9443
9483
|
] });
|
|
9444
9484
|
}
|
|
9445
9485
|
function MachineInputRow({
|
|
@@ -9448,7 +9488,7 @@ function MachineInputRow({
|
|
|
9448
9488
|
loadVideoArtifactPlayback
|
|
9449
9489
|
}) {
|
|
9450
9490
|
if (member.kind === "media_generation_result" && member.result) {
|
|
9451
|
-
return /* @__PURE__ */
|
|
9491
|
+
return /* @__PURE__ */ jsx19(
|
|
9452
9492
|
VideoGenerationResultRow,
|
|
9453
9493
|
{
|
|
9454
9494
|
result: member.result,
|
|
@@ -9459,16 +9499,16 @@ function MachineInputRow({
|
|
|
9459
9499
|
}
|
|
9460
9500
|
const source = readableMachineInputSource(member.sourceId);
|
|
9461
9501
|
const summary = cleanMachineInputSummary(member.summary);
|
|
9462
|
-
return /* @__PURE__ */
|
|
9463
|
-
/* @__PURE__ */
|
|
9464
|
-
/* @__PURE__ */
|
|
9465
|
-
/* @__PURE__ */
|
|
9466
|
-
source && /* @__PURE__ */
|
|
9502
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
9503
|
+
/* @__PURE__ */ jsx19("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
|
|
9504
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
9505
|
+
/* @__PURE__ */ jsx19("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
|
|
9506
|
+
source && /* @__PURE__ */ jsxs14("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
|
|
9467
9507
|
"from ",
|
|
9468
9508
|
source
|
|
9469
9509
|
] }),
|
|
9470
|
-
summary ? /* @__PURE__ */
|
|
9471
|
-
/* @__PURE__ */
|
|
9510
|
+
summary ? /* @__PURE__ */ jsx19("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-og-menu leading-5 text-og-fg", children: truncate(summary, 320) }) : null,
|
|
9511
|
+
/* @__PURE__ */ jsx19(
|
|
9472
9512
|
ChildSessionLink,
|
|
9473
9513
|
{
|
|
9474
9514
|
kind: member.kind,
|
|
@@ -9486,7 +9526,7 @@ function VideoGenerationResultRow({
|
|
|
9486
9526
|
}) {
|
|
9487
9527
|
const enter = useEntranceAnimation();
|
|
9488
9528
|
if (result.status !== "ready") {
|
|
9489
|
-
return /* @__PURE__ */
|
|
9529
|
+
return /* @__PURE__ */ jsxs14(
|
|
9490
9530
|
"div",
|
|
9491
9531
|
{
|
|
9492
9532
|
className: cn(
|
|
@@ -9494,18 +9534,18 @@ function VideoGenerationResultRow({
|
|
|
9494
9534
|
"mx-auto w-full max-w-lg rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3.5 py-3"
|
|
9495
9535
|
),
|
|
9496
9536
|
children: [
|
|
9497
|
-
/* @__PURE__ */
|
|
9498
|
-
/* @__PURE__ */
|
|
9537
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
|
|
9538
|
+
/* @__PURE__ */ jsx19(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
|
|
9499
9539
|
"Video generation failed"
|
|
9500
9540
|
] }),
|
|
9501
|
-
/* @__PURE__ */
|
|
9541
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
|
|
9502
9542
|
]
|
|
9503
9543
|
}
|
|
9504
9544
|
);
|
|
9505
9545
|
}
|
|
9506
9546
|
const { receipt } = result;
|
|
9507
9547
|
const facts = receipt.video;
|
|
9508
|
-
return /* @__PURE__ */
|
|
9548
|
+
return /* @__PURE__ */ jsxs14(
|
|
9509
9549
|
"section",
|
|
9510
9550
|
{
|
|
9511
9551
|
"aria-label": "Generated video",
|
|
@@ -9515,18 +9555,18 @@ function VideoGenerationResultRow({
|
|
|
9515
9555
|
compact && "max-w-lg"
|
|
9516
9556
|
),
|
|
9517
9557
|
children: [
|
|
9518
|
-
loadVideoArtifactPlayback ? /* @__PURE__ */
|
|
9558
|
+
loadVideoArtifactPlayback ? /* @__PURE__ */ jsx19(
|
|
9519
9559
|
GeneratedVideoPlayer,
|
|
9520
9560
|
{
|
|
9521
9561
|
receipt,
|
|
9522
9562
|
loadPlaybackSource: loadVideoArtifactPlayback,
|
|
9523
9563
|
className: "rounded-none border-0 shadow-none"
|
|
9524
9564
|
}
|
|
9525
|
-
) : /* @__PURE__ */
|
|
9526
|
-
/* @__PURE__ */
|
|
9527
|
-
/* @__PURE__ */
|
|
9528
|
-
/* @__PURE__ */
|
|
9529
|
-
/* @__PURE__ */
|
|
9565
|
+
) : /* @__PURE__ */ jsx19("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx19(PlayIcon, { "aria-hidden": true, className: "size-6" }) }),
|
|
9566
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
|
|
9567
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
9568
|
+
/* @__PURE__ */ jsx19("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
|
|
9569
|
+
/* @__PURE__ */ jsxs14("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
|
|
9530
9570
|
facts.width,
|
|
9531
9571
|
"\xD7",
|
|
9532
9572
|
facts.height,
|
|
@@ -9535,7 +9575,7 @@ function VideoGenerationResultRow({
|
|
|
9535
9575
|
facts.hasAudio ? " \xB7 Audio" : ""
|
|
9536
9576
|
] })
|
|
9537
9577
|
] }),
|
|
9538
|
-
/* @__PURE__ */
|
|
9578
|
+
/* @__PURE__ */ jsx19(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
|
|
9539
9579
|
] })
|
|
9540
9580
|
]
|
|
9541
9581
|
}
|
|
@@ -9546,33 +9586,33 @@ function formatVideoDuration(seconds) {
|
|
|
9546
9586
|
}
|
|
9547
9587
|
function NoticeRow({ item }) {
|
|
9548
9588
|
const enter = useEntranceAnimation();
|
|
9549
|
-
if (item.allowance) return /* @__PURE__ */
|
|
9589
|
+
if (item.allowance) return /* @__PURE__ */ jsx19(AllowanceExhaustedRow, { refusal: item.allowance });
|
|
9550
9590
|
if (item.recordedOutcome) {
|
|
9551
|
-
return /* @__PURE__ */
|
|
9591
|
+
return /* @__PURE__ */ jsxs14(
|
|
9552
9592
|
"details",
|
|
9553
9593
|
{
|
|
9554
9594
|
className: "group text-og-sm text-og-fg-muted",
|
|
9555
9595
|
role: "note",
|
|
9556
9596
|
"data-og-recorded-outcome": "wait",
|
|
9557
9597
|
children: [
|
|
9558
|
-
/* @__PURE__ */
|
|
9559
|
-
/* @__PURE__ */
|
|
9598
|
+
/* @__PURE__ */ jsxs14("summary", { className: "flex cursor-pointer list-none items-center gap-2 py-1 [&::-webkit-details-marker]:hidden", children: [
|
|
9599
|
+
/* @__PURE__ */ jsx19(
|
|
9560
9600
|
ChevronRightIcon2,
|
|
9561
9601
|
{
|
|
9562
9602
|
"aria-hidden": true,
|
|
9563
9603
|
className: "size-3.5 transition-transform group-open:rotate-90"
|
|
9564
9604
|
}
|
|
9565
9605
|
),
|
|
9566
|
-
/* @__PURE__ */
|
|
9606
|
+
/* @__PURE__ */ jsx19("span", { title: new Date(item.occurredAt).toLocaleString(), children: recordedWaitSummary(item) })
|
|
9567
9607
|
] }),
|
|
9568
|
-
/* @__PURE__ */
|
|
9608
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-1 whitespace-pre-wrap break-words pl-5 text-og-fg-muted", children: item.text })
|
|
9569
9609
|
]
|
|
9570
9610
|
}
|
|
9571
9611
|
);
|
|
9572
9612
|
}
|
|
9573
9613
|
const resolvedApproval = Boolean(item.resolvedAt && item.text.startsWith("Approval needed"));
|
|
9574
9614
|
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" && !item.resolvedAt ? WAITING_PILL_CLASS : NEUTRAL_PILL;
|
|
9575
|
-
return /* @__PURE__ */
|
|
9615
|
+
return /* @__PURE__ */ jsxs14(
|
|
9576
9616
|
"div",
|
|
9577
9617
|
{
|
|
9578
9618
|
className: cn(
|
|
@@ -9582,20 +9622,20 @@ function NoticeRow({ item }) {
|
|
|
9582
9622
|
),
|
|
9583
9623
|
role: "status",
|
|
9584
9624
|
children: [
|
|
9585
|
-
resolvedApproval ? /* @__PURE__ */
|
|
9625
|
+
resolvedApproval ? /* @__PURE__ */ jsx19(CheckIcon2, { className: "mt-0.5 size-4 shrink-0 opacity-70", "aria-hidden": "true" }) : /* @__PURE__ */ jsx19(
|
|
9586
9626
|
TriangleAlertIcon2,
|
|
9587
9627
|
{
|
|
9588
9628
|
className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
|
|
9589
9629
|
}
|
|
9590
9630
|
),
|
|
9591
|
-
/* @__PURE__ */
|
|
9592
|
-
/* @__PURE__ */
|
|
9593
|
-
item.details ? /* @__PURE__ */
|
|
9594
|
-
/* @__PURE__ */
|
|
9595
|
-
/* @__PURE__ */
|
|
9631
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
9632
|
+
/* @__PURE__ */ jsx19("span", { className: "whitespace-pre-wrap break-words", children: resolvedApproval ? "You responded to this approval." : item.text }),
|
|
9633
|
+
item.details ? /* @__PURE__ */ jsxs14("details", { className: "mt-2 text-og-control", children: [
|
|
9634
|
+
/* @__PURE__ */ jsx19("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
9635
|
+
/* @__PURE__ */ jsx19("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-og-fg/5 p-2 font-mono", children: JSON.stringify(item.details.value, null, 2) })
|
|
9596
9636
|
] }) : null
|
|
9597
9637
|
] }),
|
|
9598
|
-
item.action ? /* @__PURE__ */
|
|
9638
|
+
item.action ? /* @__PURE__ */ jsx19(
|
|
9599
9639
|
"a",
|
|
9600
9640
|
{
|
|
9601
9641
|
className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
|
|
@@ -9614,22 +9654,22 @@ function recordedWaitSummary(item) {
|
|
|
9614
9654
|
const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
|
|
9615
9655
|
const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
|
|
9616
9656
|
if (waitedMs !== void 0) {
|
|
9617
|
-
return /* @__PURE__ */
|
|
9657
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
9618
9658
|
"Waited",
|
|
9619
9659
|
target,
|
|
9620
9660
|
" \xB7",
|
|
9621
9661
|
" ",
|
|
9622
|
-
/* @__PURE__ */
|
|
9662
|
+
/* @__PURE__ */ jsx19("time", { dateTime: `PT${Math.floor(waitedMs / 1e3)}S`, children: formatElapsed(waitedMs) })
|
|
9623
9663
|
] });
|
|
9624
9664
|
}
|
|
9625
9665
|
const started = new Date(item.occurredAt);
|
|
9626
9666
|
const sameDay = started.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
9627
|
-
return /* @__PURE__ */
|
|
9667
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
9628
9668
|
item.waitEndedAt ? "Waited" : "Waiting",
|
|
9629
9669
|
target,
|
|
9630
9670
|
" \xB7 since",
|
|
9631
9671
|
" ",
|
|
9632
|
-
/* @__PURE__ */
|
|
9672
|
+
/* @__PURE__ */ jsx19("time", { dateTime: item.occurredAt, children: sameDay ? formatClockTime(item.occurredAt) : started.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }) })
|
|
9633
9673
|
] });
|
|
9634
9674
|
}
|
|
9635
9675
|
function AuthNeededRow({
|
|
@@ -9638,8 +9678,8 @@ function AuthNeededRow({
|
|
|
9638
9678
|
resolveProviderLogo
|
|
9639
9679
|
}) {
|
|
9640
9680
|
const enter = useEntranceAnimation();
|
|
9641
|
-
const [busy, setBusy] =
|
|
9642
|
-
const [failed, setFailed] =
|
|
9681
|
+
const [busy, setBusy] = useState15(false);
|
|
9682
|
+
const [failed, setFailed] = useState15(false);
|
|
9643
9683
|
const recommendation = item.capability ?? null;
|
|
9644
9684
|
const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
|
|
9645
9685
|
const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
@@ -9662,30 +9702,30 @@ function AuthNeededRow({
|
|
|
9662
9702
|
setBusy(false);
|
|
9663
9703
|
}
|
|
9664
9704
|
};
|
|
9665
|
-
return /* @__PURE__ */
|
|
9666
|
-
/* @__PURE__ */
|
|
9667
|
-
/* @__PURE__ */
|
|
9668
|
-
/* @__PURE__ */
|
|
9705
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
|
|
9706
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
9707
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
9708
|
+
/* @__PURE__ */ jsx19(
|
|
9669
9709
|
AuthProviderLogo,
|
|
9670
9710
|
{
|
|
9671
9711
|
src: resolveProviderLogo?.(item.providerDomain) ?? null,
|
|
9672
9712
|
label: provider
|
|
9673
9713
|
}
|
|
9674
9714
|
),
|
|
9675
|
-
/* @__PURE__ */
|
|
9676
|
-
/* @__PURE__ */
|
|
9677
|
-
/* @__PURE__ */
|
|
9678
|
-
recommendation ? /* @__PURE__ */
|
|
9715
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
9716
|
+
/* @__PURE__ */ jsx19("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
|
|
9717
|
+
/* @__PURE__ */ jsx19("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
|
|
9718
|
+
recommendation ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
9679
9719
|
"Provider: ",
|
|
9680
9720
|
item.providerDomain
|
|
9681
9721
|
] }) : null,
|
|
9682
|
-
recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */
|
|
9722
|
+
recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
9683
9723
|
"Needs variables: ",
|
|
9684
9724
|
recommendation.requiredVariables.join(", ")
|
|
9685
9725
|
] }) : null
|
|
9686
9726
|
] })
|
|
9687
9727
|
] }),
|
|
9688
|
-
hostAuthorizationUrl ? /* @__PURE__ */
|
|
9728
|
+
hostAuthorizationUrl ? /* @__PURE__ */ jsxs14(
|
|
9689
9729
|
"a",
|
|
9690
9730
|
{
|
|
9691
9731
|
href: hostAuthorizationUrl,
|
|
@@ -9696,11 +9736,11 @@ function AuthNeededRow({
|
|
|
9696
9736
|
"transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
|
|
9697
9737
|
),
|
|
9698
9738
|
children: [
|
|
9699
|
-
/* @__PURE__ */
|
|
9739
|
+
/* @__PURE__ */ jsx19(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
9700
9740
|
actionLabel
|
|
9701
9741
|
]
|
|
9702
9742
|
}
|
|
9703
|
-
) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */
|
|
9743
|
+
) : item.authoritySource !== "host" && !unavailable && onReconnect ? /* @__PURE__ */ jsxs14(
|
|
9704
9744
|
"button",
|
|
9705
9745
|
{
|
|
9706
9746
|
type: "button",
|
|
@@ -9711,11 +9751,11 @@ function AuthNeededRow({
|
|
|
9711
9751
|
"transition-colors hover:bg-og-primary-hover disabled:opacity-50 pointer-coarse:min-h-9"
|
|
9712
9752
|
),
|
|
9713
9753
|
children: [
|
|
9714
|
-
/* @__PURE__ */
|
|
9754
|
+
/* @__PURE__ */ jsx19(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
|
|
9715
9755
|
busy ? "Opening\u2026" : actionLabel
|
|
9716
9756
|
]
|
|
9717
9757
|
}
|
|
9718
|
-
) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */
|
|
9758
|
+
) : item.authoritySource !== "host" && !unavailable && item.authorizationUrl ? /* @__PURE__ */ jsxs14(
|
|
9719
9759
|
"a",
|
|
9720
9760
|
{
|
|
9721
9761
|
href: item.authorizationUrl,
|
|
@@ -9726,14 +9766,14 @@ function AuthNeededRow({
|
|
|
9726
9766
|
"transition-colors hover:bg-og-primary-hover pointer-coarse:min-h-9"
|
|
9727
9767
|
),
|
|
9728
9768
|
children: [
|
|
9729
|
-
/* @__PURE__ */
|
|
9769
|
+
/* @__PURE__ */ jsx19(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
9730
9770
|
actionLabel
|
|
9731
9771
|
]
|
|
9732
9772
|
}
|
|
9733
9773
|
) : null
|
|
9734
9774
|
] }),
|
|
9735
|
-
!unavailable ? /* @__PURE__ */
|
|
9736
|
-
failed ? /* @__PURE__ */
|
|
9775
|
+
!unavailable ? /* @__PURE__ */ jsx19("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,
|
|
9776
|
+
failed ? /* @__PURE__ */ jsxs14("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
|
|
9737
9777
|
"Couldn't start ",
|
|
9738
9778
|
missing ? "connecting" : "reconnecting",
|
|
9739
9779
|
" ",
|
|
@@ -9743,15 +9783,15 @@ function AuthNeededRow({
|
|
|
9743
9783
|
] });
|
|
9744
9784
|
}
|
|
9745
9785
|
function AuthProviderLogo({ src, label }) {
|
|
9746
|
-
const [failed, setFailed] =
|
|
9747
|
-
|
|
9786
|
+
const [failed, setFailed] = useState15(false);
|
|
9787
|
+
useEffect10(() => setFailed(false), [src]);
|
|
9748
9788
|
const showImage = src && !failed;
|
|
9749
|
-
return /* @__PURE__ */
|
|
9789
|
+
return /* @__PURE__ */ jsx19(
|
|
9750
9790
|
"span",
|
|
9751
9791
|
{
|
|
9752
9792
|
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",
|
|
9753
9793
|
"aria-hidden": true,
|
|
9754
|
-
children: showImage ? /* @__PURE__ */
|
|
9794
|
+
children: showImage ? /* @__PURE__ */ jsx19(
|
|
9755
9795
|
"img",
|
|
9756
9796
|
{
|
|
9757
9797
|
src,
|
|
@@ -9761,7 +9801,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
9761
9801
|
className: "size-full object-contain p-1.5",
|
|
9762
9802
|
onError: () => setFailed(true)
|
|
9763
9803
|
}
|
|
9764
|
-
) : /* @__PURE__ */
|
|
9804
|
+
) : /* @__PURE__ */ jsx19("span", { children: monogram(label) })
|
|
9765
9805
|
}
|
|
9766
9806
|
);
|
|
9767
9807
|
}
|
|
@@ -9806,7 +9846,7 @@ function authReasonLine(reason) {
|
|
|
9806
9846
|
// src/components/queue-surface.tsx
|
|
9807
9847
|
import { Loader2Icon } from "lucide-react";
|
|
9808
9848
|
import { lazy as lazy4, Suspense as Suspense5 } from "react";
|
|
9809
|
-
import { jsx as
|
|
9849
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9810
9850
|
var loadQueueSurface = () => import("./queue-surface-implementation-ZHFI5JBP.js");
|
|
9811
9851
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
9812
9852
|
function createQueueSurface(loadImplementation) {
|
|
@@ -9817,21 +9857,21 @@ function createQueueSurface(loadImplementation) {
|
|
|
9817
9857
|
const { queue } = props;
|
|
9818
9858
|
if (queue.queue.length + queue.pendingInputs.length === 0) {
|
|
9819
9859
|
if (!queue.stoppingPreviousAttempt && !queue.error && !queue.mutationError) return null;
|
|
9820
|
-
return /* @__PURE__ */
|
|
9860
|
+
return /* @__PURE__ */ jsx20(EmptyQueueStateSurface, { queue });
|
|
9821
9861
|
}
|
|
9822
|
-
return /* @__PURE__ */
|
|
9862
|
+
return /* @__PURE__ */ jsx20(Suspense5, { fallback: /* @__PURE__ */ jsx20(QueueSurfaceFallback, {}), children: /* @__PURE__ */ jsx20(LazyQueueSurface, { ...props }) });
|
|
9823
9863
|
};
|
|
9824
9864
|
}
|
|
9825
9865
|
function QueueSurfaceFallback() {
|
|
9826
|
-
return /* @__PURE__ */
|
|
9866
|
+
return /* @__PURE__ */ jsx20(
|
|
9827
9867
|
"div",
|
|
9828
9868
|
{
|
|
9829
9869
|
"aria-live": "polite",
|
|
9830
9870
|
className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
|
|
9831
9871
|
"data-testid": "queue-surface-loading",
|
|
9832
9872
|
role: "status",
|
|
9833
|
-
children: /* @__PURE__ */
|
|
9834
|
-
/* @__PURE__ */
|
|
9873
|
+
children: /* @__PURE__ */ jsx20("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 px-3 py-2 text-og-control text-fg-muted pointer-coarse:min-h-[44px]", children: [
|
|
9874
|
+
/* @__PURE__ */ jsx20(
|
|
9835
9875
|
Loader2Icon,
|
|
9836
9876
|
{
|
|
9837
9877
|
"aria-hidden": "true",
|
|
@@ -9902,7 +9942,7 @@ import { LayoutGroup, motion as motion4 } from "motion/react";
|
|
|
9902
9942
|
import {
|
|
9903
9943
|
useImperativeHandle
|
|
9904
9944
|
} from "react";
|
|
9905
|
-
import { Fragment as Fragment7, jsx as
|
|
9945
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
9906
9946
|
function ChatComposer({
|
|
9907
9947
|
composer,
|
|
9908
9948
|
responsiveBasis,
|
|
@@ -9964,15 +10004,15 @@ function ChatComposer({
|
|
|
9964
10004
|
useImperativeHandle(focusRef, () => ({ focusInput: controller.focusInput }), [
|
|
9965
10005
|
controller.focusInput
|
|
9966
10006
|
]);
|
|
9967
|
-
return /* @__PURE__ */
|
|
9968
|
-
/* @__PURE__ */
|
|
9969
|
-
/* @__PURE__ */
|
|
9970
|
-
/* @__PURE__ */
|
|
9971
|
-
/* @__PURE__ */
|
|
9972
|
-
/* @__PURE__ */
|
|
9973
|
-
/* @__PURE__ */
|
|
10007
|
+
return /* @__PURE__ */ jsx21(Fragment7, { children: /* @__PURE__ */ jsxs16(Root, { controller, responsiveBasis, className, children: [
|
|
10008
|
+
/* @__PURE__ */ jsxs16(Frame, { children: [
|
|
10009
|
+
/* @__PURE__ */ jsx21(CommandPalette, {}),
|
|
10010
|
+
/* @__PURE__ */ jsxs16(Surface, { className: surfaceClassName, children: [
|
|
10011
|
+
/* @__PURE__ */ jsx21(PausedState, {}),
|
|
10012
|
+
/* @__PURE__ */ jsx21(RestoredResources, {}),
|
|
10013
|
+
/* @__PURE__ */ jsx21(Attachments, {}),
|
|
9974
10014
|
header,
|
|
9975
|
-
composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */
|
|
10015
|
+
composer.annotations && composer.annotations.length > 0 && composer.updateAnnotation && composer.removeAnnotation ? /* @__PURE__ */ jsx21("div", { className: "px-3.5 pt-2 md:px-4", children: /* @__PURE__ */ jsx21(
|
|
9976
10016
|
TimelineAnnotationsChip,
|
|
9977
10017
|
{
|
|
9978
10018
|
annotations: composer.annotations,
|
|
@@ -9984,21 +10024,21 @@ function ChatComposer({
|
|
|
9984
10024
|
onCommit: controller.focusInput
|
|
9985
10025
|
}
|
|
9986
10026
|
) }) : null,
|
|
9987
|
-
/* @__PURE__ */
|
|
9988
|
-
controller.confirmState ? /* @__PURE__ */
|
|
10027
|
+
/* @__PURE__ */ jsx21(Input, { ...inputProps, placeholder, autoFocus }),
|
|
10028
|
+
controller.confirmState ? /* @__PURE__ */ jsx21(Confirmation, {}) : footer !== void 0 ? footer : /* @__PURE__ */ jsx21(
|
|
9989
10029
|
Footer,
|
|
9990
10030
|
{
|
|
9991
10031
|
"data-og-stack-actions": stackActions ? "" : void 0,
|
|
9992
10032
|
className: stackActions ? "max-sm:flex-nowrap sm:flex-wrap" : void 0,
|
|
9993
|
-
children: /* @__PURE__ */
|
|
9994
|
-
hasControls ? /* @__PURE__ */
|
|
10033
|
+
children: /* @__PURE__ */ jsxs16(LayoutGroup, { id: "og-composer-footer", children: [
|
|
10034
|
+
hasControls ? /* @__PURE__ */ jsxs16(
|
|
9995
10035
|
Controls,
|
|
9996
10036
|
{
|
|
9997
10037
|
className: stackActions ? "min-w-0 max-sm:flex-1 sm:w-auto" : void 0,
|
|
9998
10038
|
children: [
|
|
9999
10039
|
controlsLeading,
|
|
10000
|
-
/* @__PURE__ */
|
|
10001
|
-
transcription ? /* @__PURE__ */
|
|
10040
|
+
/* @__PURE__ */ jsx21(AttachButton, { className: attachButtonClassName }),
|
|
10041
|
+
transcription ? /* @__PURE__ */ jsx21(
|
|
10002
10042
|
ComposerTranscriptionControl,
|
|
10003
10043
|
{
|
|
10004
10044
|
...transcription,
|
|
@@ -10006,13 +10046,13 @@ function ChatComposer({
|
|
|
10006
10046
|
className: [transcription.className, transcriptionClassName].filter(Boolean).join(" ")
|
|
10007
10047
|
}
|
|
10008
10048
|
) : null,
|
|
10009
|
-
models ? /* @__PURE__ */
|
|
10049
|
+
models ? /* @__PURE__ */ jsx21(
|
|
10010
10050
|
motion4.span,
|
|
10011
10051
|
{
|
|
10012
10052
|
layout: true,
|
|
10013
10053
|
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
10014
10054
|
className: "inline-flex min-w-0",
|
|
10015
|
-
children: /* @__PURE__ */
|
|
10055
|
+
children: /* @__PURE__ */ jsx21(
|
|
10016
10056
|
ModelPicker,
|
|
10017
10057
|
{
|
|
10018
10058
|
models,
|
|
@@ -10022,7 +10062,7 @@ function ChatComposer({
|
|
|
10022
10062
|
)
|
|
10023
10063
|
}
|
|
10024
10064
|
) : null,
|
|
10025
|
-
controlsStart ? /* @__PURE__ */
|
|
10065
|
+
controlsStart ? /* @__PURE__ */ jsx21(
|
|
10026
10066
|
motion4.span,
|
|
10027
10067
|
{
|
|
10028
10068
|
layout: true,
|
|
@@ -10033,16 +10073,16 @@ function ChatComposer({
|
|
|
10033
10073
|
) : null
|
|
10034
10074
|
]
|
|
10035
10075
|
}
|
|
10036
|
-
) : /* @__PURE__ */
|
|
10037
|
-
/* @__PURE__ */
|
|
10076
|
+
) : /* @__PURE__ */ jsx21(Hint, { children: hint }),
|
|
10077
|
+
/* @__PURE__ */ jsxs16(
|
|
10038
10078
|
Actions,
|
|
10039
10079
|
{
|
|
10040
10080
|
className: stackActions ? "max-sm:shrink-0 sm:w-auto sm:justify-end" : void 0,
|
|
10041
10081
|
children: [
|
|
10042
10082
|
actionsStart,
|
|
10043
|
-
/* @__PURE__ */
|
|
10044
|
-
/* @__PURE__ */
|
|
10045
|
-
/* @__PURE__ */
|
|
10083
|
+
/* @__PURE__ */ jsx21(PauseButton, {}),
|
|
10084
|
+
/* @__PURE__ */ jsx21(StopButton, {}),
|
|
10085
|
+
/* @__PURE__ */ jsx21(SendButton, {})
|
|
10046
10086
|
]
|
|
10047
10087
|
}
|
|
10048
10088
|
)
|
|
@@ -10051,8 +10091,8 @@ function ChatComposer({
|
|
|
10051
10091
|
)
|
|
10052
10092
|
] })
|
|
10053
10093
|
] }),
|
|
10054
|
-
/* @__PURE__ */
|
|
10055
|
-
/* @__PURE__ */
|
|
10094
|
+
/* @__PURE__ */ jsx21(Help, {}),
|
|
10095
|
+
/* @__PURE__ */ jsx21(Status, {})
|
|
10056
10096
|
] }) });
|
|
10057
10097
|
}
|
|
10058
10098
|
|
|
@@ -10078,8 +10118,8 @@ import {
|
|
|
10078
10118
|
TargetIcon as TargetIcon3
|
|
10079
10119
|
} from "lucide-react";
|
|
10080
10120
|
import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
10081
|
-
import { useEffect as
|
|
10082
|
-
import { Fragment as Fragment8, jsx as
|
|
10121
|
+
import { useEffect as useEffect11, useId as useId4, useMemo as useMemo6, useRef as useRef10, useState as useState16 } from "react";
|
|
10122
|
+
import { Fragment as Fragment8, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10083
10123
|
var GOAL_LABEL = {
|
|
10084
10124
|
pursuing: "Pursuing",
|
|
10085
10125
|
waiting: "Waiting",
|
|
@@ -10093,14 +10133,28 @@ var GOAL_LABEL = {
|
|
|
10093
10133
|
};
|
|
10094
10134
|
var GOAL_PAUSED_REASON_SUFFIX = {
|
|
10095
10135
|
max_auto_continuations: "cap",
|
|
10096
|
-
limits: "
|
|
10136
|
+
limits: "limits",
|
|
10137
|
+
model_unavailable: "model",
|
|
10138
|
+
model_policy: "policy",
|
|
10139
|
+
credits: "credits",
|
|
10140
|
+
budget: "budget",
|
|
10141
|
+
usage_limit: "usage limit",
|
|
10142
|
+
usage_policy: "limits",
|
|
10143
|
+
allowance: "allowance",
|
|
10097
10144
|
user_pause: "manually",
|
|
10098
10145
|
api: "manually",
|
|
10099
10146
|
agent: "agent"
|
|
10100
10147
|
};
|
|
10101
10148
|
var GOAL_PAUSED_REASON_EXPLANATION = {
|
|
10102
10149
|
max_auto_continuations: "Paused at the automatic continuation cap. New input (a child result, an agent message, or your prompt) resumes it; you can also resume it here.",
|
|
10103
|
-
limits: "Paused
|
|
10150
|
+
limits: "Paused by an admission limit. Resume when the blocker is resolved.",
|
|
10151
|
+
model_unavailable: "The selected model is unavailable. Choose an available model before resuming.",
|
|
10152
|
+
model_policy: "The selected model is blocked by policy. Choose an allowed model before resuming.",
|
|
10153
|
+
credits: "Insufficient Opengeni credits. Add credits before resuming.",
|
|
10154
|
+
budget: "Monthly model spending limit reached. Resume when the spending limit allows.",
|
|
10155
|
+
usage_limit: "Monthly agent run limit reached. Resume when the run limit allows.",
|
|
10156
|
+
usage_policy: "The application's usage policy blocks another run. Resume when it allows.",
|
|
10157
|
+
allowance: "Opengeni usage allowance exhausted. Resume when your allowance is available.",
|
|
10104
10158
|
user_pause: "Paused manually by a person or an API call. Resume to let the goal continue on its own.",
|
|
10105
10159
|
api: "Paused manually by a person or an API call. Resume to let the goal continue on its own.",
|
|
10106
10160
|
agent: "Paused by the agent: it is waiting on a human decision before continuing."
|
|
@@ -10116,6 +10170,8 @@ function sessionChromeGoalPillExplanation(state, record) {
|
|
|
10116
10170
|
return "Resolve the session failure, then use Continue or send a message to continue this active goal.";
|
|
10117
10171
|
}
|
|
10118
10172
|
if (state === "paused") {
|
|
10173
|
+
const rationale = record?.rationale?.trim();
|
|
10174
|
+
if (rationale) return rationale;
|
|
10119
10175
|
return record?.pausedReason ? GOAL_PAUSED_REASON_EXPLANATION[record.pausedReason] ?? null : null;
|
|
10120
10176
|
}
|
|
10121
10177
|
if (state === "scheduled") {
|
|
@@ -10199,8 +10255,8 @@ function formatCoarseElapsed(ms) {
|
|
|
10199
10255
|
}
|
|
10200
10256
|
function useLiveElapsed(startIso, live, endIso) {
|
|
10201
10257
|
const start = startIso ? Date.parse(startIso) : Number.NaN;
|
|
10202
|
-
const [now, setNow] =
|
|
10203
|
-
|
|
10258
|
+
const [now, setNow] = useState16(() => Date.now());
|
|
10259
|
+
useEffect11(() => {
|
|
10204
10260
|
if (!live) return;
|
|
10205
10261
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
10206
10262
|
return () => clearInterval(id);
|
|
@@ -10273,7 +10329,7 @@ function SessionChrome({
|
|
|
10273
10329
|
onActiveChange
|
|
10274
10330
|
}) {
|
|
10275
10331
|
const formatError = useErrorMessage();
|
|
10276
|
-
const [activityRequested, setActivityOpen] =
|
|
10332
|
+
const [activityRequested, setActivityOpen] = useState16(
|
|
10277
10333
|
Boolean(defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
|
|
10278
10334
|
);
|
|
10279
10335
|
const reactId = useId4();
|
|
@@ -10303,7 +10359,7 @@ function SessionChrome({
|
|
|
10303
10359
|
queue.queue,
|
|
10304
10360
|
queue.mutationFor
|
|
10305
10361
|
);
|
|
10306
|
-
const [activeUncontrolled, setActiveUncontrolled] =
|
|
10362
|
+
const [activeUncontrolled, setActiveUncontrolled] = useState16(
|
|
10307
10363
|
() => sessionChromeInitialActive({
|
|
10308
10364
|
defaultActive,
|
|
10309
10365
|
authoritativeQueuedCount: initialAuthoritativeQueuedCount
|
|
@@ -10314,13 +10370,13 @@ function SessionChrome({
|
|
|
10314
10370
|
const openedQueueTargetRef = useRef10(null);
|
|
10315
10371
|
const focusedQueueTargetRef = useRef10(null);
|
|
10316
10372
|
const queueTargetKey = queueFocusTarget ? `${queueFocusTarget.turnId}:${queueFocusTarget.requestId}` : null;
|
|
10317
|
-
|
|
10373
|
+
useEffect11(() => {
|
|
10318
10374
|
if (!queueTargetKey || openedQueueTargetRef.current === queueTargetKey) return;
|
|
10319
10375
|
openedQueueTargetRef.current = queueTargetKey;
|
|
10320
10376
|
if (activeControlled === void 0) setActiveUncontrolled("queue");
|
|
10321
10377
|
onActiveChange?.("queue");
|
|
10322
10378
|
}, [queueTargetKey, activeControlled, onActiveChange]);
|
|
10323
|
-
|
|
10379
|
+
useEffect11(() => {
|
|
10324
10380
|
if (!queueFocusTarget || active !== "queue" || focusedQueueTargetRef.current === queueTargetKey)
|
|
10325
10381
|
return;
|
|
10326
10382
|
const root = rootRef.current;
|
|
@@ -10373,7 +10429,7 @@ function SessionChrome({
|
|
|
10373
10429
|
tone: incoming.some(
|
|
10374
10430
|
(item) => item.classification === "action_required" || item.classification === "failure"
|
|
10375
10431
|
) ? "waiting" : "neutral",
|
|
10376
|
-
icon: /* @__PURE__ */
|
|
10432
|
+
icon: /* @__PURE__ */ jsx22(InboxIcon, { className: "size-3" })
|
|
10377
10433
|
});
|
|
10378
10434
|
}
|
|
10379
10435
|
const queuedCount = queuedTurns.length + optimisticQueued.length;
|
|
@@ -10390,7 +10446,7 @@ function SessionChrome({
|
|
|
10390
10446
|
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"}`,
|
|
10391
10447
|
...detail ? { detail } : {},
|
|
10392
10448
|
tone: queueProblem ? "waiting" : "neutral",
|
|
10393
|
-
icon: queueProblem ? /* @__PURE__ */
|
|
10449
|
+
icon: queueProblem ? /* @__PURE__ */ jsx22(TriangleAlertIcon3, { className: "size-3" }) : voiceOnly ? /* @__PURE__ */ jsx22(AudioLinesIcon, { className: "size-3" }) : /* @__PURE__ */ jsx22(ListOrderedIcon, { className: "size-3" })
|
|
10394
10450
|
});
|
|
10395
10451
|
}
|
|
10396
10452
|
if (record && goalState) {
|
|
@@ -10402,7 +10458,7 @@ function SessionChrome({
|
|
|
10402
10458
|
detail: elapsed ? `${elapsed} \xB7 ${record.text}` : record.text,
|
|
10403
10459
|
...explanation ? { title: explanation } : {},
|
|
10404
10460
|
tone: waiting ? "waiting" : goalState === "pursuing" || goalState === "scheduled" ? "accent" : "neutral",
|
|
10405
|
-
icon: /* @__PURE__ */
|
|
10461
|
+
icon: /* @__PURE__ */ jsx22(TargetIcon3, { className: "size-3" })
|
|
10406
10462
|
});
|
|
10407
10463
|
}
|
|
10408
10464
|
if (agentsSignal && agentsSignal.count > 0) {
|
|
@@ -10412,7 +10468,7 @@ function SessionChrome({
|
|
|
10412
10468
|
label: `${agentsSignal.count} agent${agentsSignal.count === 1 ? "" : "s"}`,
|
|
10413
10469
|
...detail ? { detail } : {},
|
|
10414
10470
|
tone: agentsSignal.tone ?? "neutral",
|
|
10415
|
-
icon: /* @__PURE__ */
|
|
10471
|
+
icon: /* @__PURE__ */ jsx22(BotIcon3, { className: "size-3" })
|
|
10416
10472
|
});
|
|
10417
10473
|
}
|
|
10418
10474
|
if (commandsCount > 0 || active === "commands" && hasCommandsPanel) {
|
|
@@ -10420,7 +10476,7 @@ function SessionChrome({
|
|
|
10420
10476
|
id: "commands",
|
|
10421
10477
|
label: commandsCount > 0 ? `${commandsCount} command${commandsCount === 1 ? "" : "s"}` : "Commands",
|
|
10422
10478
|
tone: commandsCount > 0 ? "running" : "neutral",
|
|
10423
|
-
icon: /* @__PURE__ */
|
|
10479
|
+
icon: /* @__PURE__ */ jsx22(TerminalIcon2, { className: "size-3" })
|
|
10424
10480
|
});
|
|
10425
10481
|
}
|
|
10426
10482
|
return rows;
|
|
@@ -10440,8 +10496,8 @@ function SessionChrome({
|
|
|
10440
10496
|
]);
|
|
10441
10497
|
const optimisticQueueKeys = optimisticQueued.map((message) => message.clientEventId).join(",");
|
|
10442
10498
|
const previousOptimisticQueueKeys = useRef10(optimisticQueueKeys);
|
|
10443
|
-
const [queueArrivalNonce, setQueueArrivalNonce] =
|
|
10444
|
-
|
|
10499
|
+
const [queueArrivalNonce, setQueueArrivalNonce] = useState16(0);
|
|
10500
|
+
useEffect11(() => {
|
|
10445
10501
|
const previous = new Set(previousOptimisticQueueKeys.current.split(",").filter(Boolean));
|
|
10446
10502
|
const arrived = optimisticQueued.some((message) => !previous.has(message.clientEventId));
|
|
10447
10503
|
previousOptimisticQueueKeys.current = optimisticQueueKeys;
|
|
@@ -10452,13 +10508,13 @@ function SessionChrome({
|
|
|
10452
10508
|
}
|
|
10453
10509
|
}, [active, activeControlled, optimisticQueueKeys, optimisticQueued]);
|
|
10454
10510
|
const queueOccupied = queuedTurns.length > 0 || optimisticQueued.length > 0;
|
|
10455
|
-
|
|
10511
|
+
useEffect11(() => {
|
|
10456
10512
|
if (queueOccupied) return;
|
|
10457
10513
|
queueOfferAdmissionSuppressedRef.current = false;
|
|
10458
10514
|
queueOfferDismissedSessionIdsRef.current.clear();
|
|
10459
10515
|
}, [queueOccupied]);
|
|
10460
10516
|
const queueOfferSuppressed = queueOfferAdmissionSuppressedRef.current || occupancySessionId != null && queueOfferDismissedSessionIdsRef.current.has(occupancySessionId);
|
|
10461
|
-
|
|
10517
|
+
useEffect11(() => {
|
|
10462
10518
|
if (!sessionChromeShouldOfferQueue({
|
|
10463
10519
|
controlled: activeControlled !== void 0,
|
|
10464
10520
|
active,
|
|
@@ -10479,28 +10535,28 @@ function SessionChrome({
|
|
|
10479
10535
|
queueOfferSuppressed,
|
|
10480
10536
|
queuedTurns.length
|
|
10481
10537
|
]);
|
|
10482
|
-
const [replaceDraftFor, setReplaceDraftFor] =
|
|
10538
|
+
const [replaceDraftFor, setReplaceDraftFor] = useState16(null);
|
|
10483
10539
|
const chipRefs = useRef10({});
|
|
10484
10540
|
const railRef = useRef10(null);
|
|
10485
|
-
const [pill, setPill] =
|
|
10541
|
+
const [pill, setPill] = useState16({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
|
|
10486
10542
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
10487
|
-
|
|
10543
|
+
useEffect11(() => {
|
|
10488
10544
|
if (!signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)))
|
|
10489
10545
|
setActivityOpen(false);
|
|
10490
10546
|
}, [signals]);
|
|
10491
|
-
|
|
10547
|
+
useEffect11(() => {
|
|
10492
10548
|
if (active && !signalIds.split(",").includes(active)) {
|
|
10493
10549
|
if (activeControlled === void 0) setActiveUncontrolled(null);
|
|
10494
10550
|
onActiveChange?.(null);
|
|
10495
10551
|
}
|
|
10496
10552
|
}, [active, activeControlled, onActiveChange, signalIds]);
|
|
10497
|
-
|
|
10553
|
+
useEffect11(() => {
|
|
10498
10554
|
if (active !== "queue" || !replaceDraftFor) return;
|
|
10499
10555
|
if (!queuedTurns.some((turn) => turn.id === replaceDraftFor)) {
|
|
10500
10556
|
setReplaceDraftFor(null);
|
|
10501
10557
|
}
|
|
10502
10558
|
}, [active, queuedTurns, replaceDraftFor]);
|
|
10503
|
-
|
|
10559
|
+
useEffect11(() => {
|
|
10504
10560
|
const rail = railRef.current;
|
|
10505
10561
|
const measure = () => {
|
|
10506
10562
|
if (!rail || !active) {
|
|
@@ -10540,14 +10596,14 @@ function SessionChrome({
|
|
|
10540
10596
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
10541
10597
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
10542
10598
|
const ease = [0.22, 1, 0.36, 1];
|
|
10543
|
-
const panelBody = active === "incoming" ? /* @__PURE__ */
|
|
10599
|
+
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx22(
|
|
10544
10600
|
IncomingPanel,
|
|
10545
10601
|
{
|
|
10546
10602
|
inputs: incoming,
|
|
10547
10603
|
onDismiss: onDismissIncoming,
|
|
10548
10604
|
onOpenSession
|
|
10549
10605
|
}
|
|
10550
|
-
) : active === "queue" ? /* @__PURE__ */
|
|
10606
|
+
) : active === "queue" ? /* @__PURE__ */ jsx22(
|
|
10551
10607
|
QueuePanel,
|
|
10552
10608
|
{
|
|
10553
10609
|
turns: queuedTurns,
|
|
@@ -10605,8 +10661,8 @@ function SessionChrome({
|
|
|
10605
10661
|
void queue.moveTurn(turnId, beforeTurnId);
|
|
10606
10662
|
} : void 0
|
|
10607
10663
|
}
|
|
10608
|
-
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */
|
|
10609
|
-
return /* @__PURE__ */
|
|
10664
|
+
) : active === "goal" && record && goalState && goal ? /* @__PURE__ */ jsx22(GoalPanel, { goal, state: goalState, elapsed, readOnly }) : active === "commands" ? /* @__PURE__ */ jsx22("div", { "data-og-session-chrome-panel": "commands", children: commandsPanel }) : active === "agents" ? /* @__PURE__ */ jsx22("div", { "data-og-session-chrome-panel": "agents", children: agentsPanel ?? /* @__PURE__ */ jsx22("p", { className: "text-og-xs text-og-fg-muted", children: "No agent details." }) }) : null;
|
|
10665
|
+
return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx22(
|
|
10610
10666
|
"div",
|
|
10611
10667
|
{
|
|
10612
10668
|
className: cn("og-session-chrome og-root w-full", className),
|
|
@@ -10614,7 +10670,7 @@ function SessionChrome({
|
|
|
10614
10670
|
ref: rootRef,
|
|
10615
10671
|
"data-og-session-chrome": "",
|
|
10616
10672
|
"data-og-session-chrome-open": open ? "true" : "false",
|
|
10617
|
-
children: /* @__PURE__ */
|
|
10673
|
+
children: /* @__PURE__ */ jsxs17(
|
|
10618
10674
|
"div",
|
|
10619
10675
|
{
|
|
10620
10676
|
className: cn(
|
|
@@ -10630,7 +10686,7 @@ function SessionChrome({
|
|
|
10630
10686
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
10631
10687
|
},
|
|
10632
10688
|
children: [
|
|
10633
|
-
/* @__PURE__ */
|
|
10689
|
+
/* @__PURE__ */ jsx22(
|
|
10634
10690
|
"div",
|
|
10635
10691
|
{
|
|
10636
10692
|
className: "relative",
|
|
@@ -10640,7 +10696,7 @@ function SessionChrome({
|
|
|
10640
10696
|
paddingLeft: "var(--og-session-chrome-rail-pad)",
|
|
10641
10697
|
paddingRight: "var(--og-session-chrome-rail-pad)"
|
|
10642
10698
|
},
|
|
10643
|
-
children: /* @__PURE__ */
|
|
10699
|
+
children: /* @__PURE__ */ jsxs17(
|
|
10644
10700
|
"div",
|
|
10645
10701
|
{
|
|
10646
10702
|
ref: railRef,
|
|
@@ -10649,7 +10705,7 @@ function SessionChrome({
|
|
|
10649
10705
|
gap: "10px"
|
|
10650
10706
|
},
|
|
10651
10707
|
children: [
|
|
10652
|
-
/* @__PURE__ */
|
|
10708
|
+
/* @__PURE__ */ jsx22(
|
|
10653
10709
|
motion5.div,
|
|
10654
10710
|
{
|
|
10655
10711
|
"aria-hidden": true,
|
|
@@ -10671,7 +10727,7 @@ function SessionChrome({
|
|
|
10671
10727
|
),
|
|
10672
10728
|
signals.filter((signal) => !["incoming", "agents", "commands"].includes(signal.id)).map((signal) => {
|
|
10673
10729
|
const selected = active === signal.id;
|
|
10674
|
-
return /* @__PURE__ */
|
|
10730
|
+
return /* @__PURE__ */ jsxs17(
|
|
10675
10731
|
"div",
|
|
10676
10732
|
{
|
|
10677
10733
|
role: "group",
|
|
@@ -10682,7 +10738,7 @@ function SessionChrome({
|
|
|
10682
10738
|
selected && "bg-og-surface-3"
|
|
10683
10739
|
),
|
|
10684
10740
|
children: [
|
|
10685
|
-
/* @__PURE__ */
|
|
10741
|
+
/* @__PURE__ */ jsxs17(
|
|
10686
10742
|
"button",
|
|
10687
10743
|
{
|
|
10688
10744
|
type: "button",
|
|
@@ -10711,7 +10767,7 @@ function SessionChrome({
|
|
|
10711
10767
|
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
10712
10768
|
},
|
|
10713
10769
|
children: [
|
|
10714
|
-
signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */
|
|
10770
|
+
signal.id === "queue" && queueArrivalNonce > 0 && !reduceMotion ? /* @__PURE__ */ jsx22(
|
|
10715
10771
|
motion5.span,
|
|
10716
10772
|
{
|
|
10717
10773
|
"aria-hidden": "true",
|
|
@@ -10723,26 +10779,26 @@ function SessionChrome({
|
|
|
10723
10779
|
},
|
|
10724
10780
|
queueArrivalNonce
|
|
10725
10781
|
) : null,
|
|
10726
|
-
/* @__PURE__ */
|
|
10727
|
-
/* @__PURE__ */
|
|
10782
|
+
/* @__PURE__ */ jsx22("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
10783
|
+
/* @__PURE__ */ jsxs17("span", { className: cn("font-medium text-og-fg", "min-w-0 truncate"), children: [
|
|
10728
10784
|
signal.id === "goal" ? "Goal \xB7 " : null,
|
|
10729
10785
|
signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : signal.id === "queue" ? queue.error || queue.mutationError ? signal.label : `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
|
|
10730
10786
|
] })
|
|
10731
10787
|
]
|
|
10732
10788
|
}
|
|
10733
10789
|
),
|
|
10734
|
-
signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */
|
|
10735
|
-
record.status === "active" || record.status === "paused" ? /* @__PURE__ */
|
|
10790
|
+
signal.id === "goal" && goal && record && !readOnly ? /* @__PURE__ */ jsxs17("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: [
|
|
10791
|
+
record.status === "active" || record.status === "paused" ? /* @__PURE__ */ jsx22(
|
|
10736
10792
|
IconAction,
|
|
10737
10793
|
{
|
|
10738
10794
|
label: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
10739
10795
|
tip: record.status === "paused" ? "Resume goal" : "Pause goal",
|
|
10740
10796
|
disabled: goal.updating,
|
|
10741
10797
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
10742
|
-
children: goal.updating ? /* @__PURE__ */
|
|
10798
|
+
children: goal.updating ? /* @__PURE__ */ jsx22(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx22(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx22(PauseIcon2, { className: "size-3" })
|
|
10743
10799
|
}
|
|
10744
10800
|
) : null,
|
|
10745
|
-
/* @__PURE__ */
|
|
10801
|
+
/* @__PURE__ */ jsx22(
|
|
10746
10802
|
IconAction,
|
|
10747
10803
|
{
|
|
10748
10804
|
label: "Clear goal",
|
|
@@ -10750,10 +10806,10 @@ function SessionChrome({
|
|
|
10750
10806
|
danger: true,
|
|
10751
10807
|
disabled: goal.updating,
|
|
10752
10808
|
onClick: () => void goal.deleteGoal(),
|
|
10753
|
-
children: /* @__PURE__ */
|
|
10809
|
+
children: /* @__PURE__ */ jsx22(Trash2Icon2, { className: "size-3" })
|
|
10754
10810
|
}
|
|
10755
10811
|
)
|
|
10756
|
-
] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */
|
|
10812
|
+
] }) : signal.id === "queue" && canMutateQueue && queuedTurns[0] ? /* @__PURE__ */ jsx22("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: /* @__PURE__ */ jsx22(
|
|
10757
10813
|
IconAction,
|
|
10758
10814
|
{
|
|
10759
10815
|
label: "Steer first queued message",
|
|
@@ -10762,7 +10818,7 @@ function SessionChrome({
|
|
|
10762
10818
|
tip: QUEUE_STEER_TIP,
|
|
10763
10819
|
disabled: queue.mutating || Boolean(queue.mutationFor(queuedTurns[0].id)),
|
|
10764
10820
|
onClick: () => void queue.steerTurn(queuedTurns[0].id),
|
|
10765
|
-
children: /* @__PURE__ */
|
|
10821
|
+
children: /* @__PURE__ */ jsx22(CornerDownRightIcon, { className: "size-3" })
|
|
10766
10822
|
}
|
|
10767
10823
|
) }) : null
|
|
10768
10824
|
]
|
|
@@ -10770,7 +10826,7 @@ function SessionChrome({
|
|
|
10770
10826
|
signal.id
|
|
10771
10827
|
);
|
|
10772
10828
|
}),
|
|
10773
|
-
signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */
|
|
10829
|
+
signals.some((signal) => ["incoming", "agents", "commands"].includes(signal.id)) ? /* @__PURE__ */ jsxs17(
|
|
10774
10830
|
"button",
|
|
10775
10831
|
{
|
|
10776
10832
|
type: "button",
|
|
@@ -10792,27 +10848,27 @@ function SessionChrome({
|
|
|
10792
10848
|
activityOpen ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg"
|
|
10793
10849
|
),
|
|
10794
10850
|
children: [
|
|
10795
|
-
/* @__PURE__ */
|
|
10796
|
-
/* @__PURE__ */
|
|
10797
|
-
commandsCount > 0 ? /* @__PURE__ */
|
|
10798
|
-
/* @__PURE__ */
|
|
10851
|
+
/* @__PURE__ */ jsx22(ActivityIcon, { className: "size-3.5" }),
|
|
10852
|
+
/* @__PURE__ */ jsx22("span", { className: "sr-only", children: "Activity" }),
|
|
10853
|
+
commandsCount > 0 ? /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
10854
|
+
/* @__PURE__ */ jsx22(
|
|
10799
10855
|
"span",
|
|
10800
10856
|
{
|
|
10801
10857
|
"aria-hidden": "true",
|
|
10802
10858
|
className: "size-1.5 shrink-0 animate-og-pulse rounded-full bg-og-fg-muted motion-reduce:animate-none"
|
|
10803
10859
|
}
|
|
10804
10860
|
),
|
|
10805
|
-
/* @__PURE__ */
|
|
10861
|
+
/* @__PURE__ */ jsxs17("span", { id: `${panelId}-commands-count`, children: [
|
|
10806
10862
|
commandsCount,
|
|
10807
10863
|
" command",
|
|
10808
10864
|
commandsCount === 1 ? "" : "s"
|
|
10809
10865
|
] })
|
|
10810
10866
|
] }) : null,
|
|
10811
|
-
incoming.length > 0 ? /* @__PURE__ */
|
|
10867
|
+
incoming.length > 0 ? /* @__PURE__ */ jsx22("span", { className: "size-1.5 rounded-full bg-og-accent" }) : null
|
|
10812
10868
|
]
|
|
10813
10869
|
}
|
|
10814
10870
|
) : null,
|
|
10815
|
-
stopping ? /* @__PURE__ */
|
|
10871
|
+
stopping ? /* @__PURE__ */ jsxs17(
|
|
10816
10872
|
"span",
|
|
10817
10873
|
{
|
|
10818
10874
|
role: "status",
|
|
@@ -10820,7 +10876,7 @@ function SessionChrome({
|
|
|
10820
10876
|
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",
|
|
10821
10877
|
"data-testid": "session-chrome-stopping",
|
|
10822
10878
|
children: [
|
|
10823
|
-
/* @__PURE__ */
|
|
10879
|
+
/* @__PURE__ */ jsx22(
|
|
10824
10880
|
Loader2Icon2,
|
|
10825
10881
|
{
|
|
10826
10882
|
"aria-hidden": "true",
|
|
@@ -10836,7 +10892,7 @@ function SessionChrome({
|
|
|
10836
10892
|
)
|
|
10837
10893
|
}
|
|
10838
10894
|
),
|
|
10839
|
-
/* @__PURE__ */
|
|
10895
|
+
/* @__PURE__ */ jsx22(AnimatePresence4, { initial: false, children: activityOpen ? /* @__PURE__ */ jsx22(
|
|
10840
10896
|
motion5.div,
|
|
10841
10897
|
{
|
|
10842
10898
|
initial: { height: 0, opacity: 0 },
|
|
@@ -10844,7 +10900,7 @@ function SessionChrome({
|
|
|
10844
10900
|
exit: { height: 0, opacity: 0 },
|
|
10845
10901
|
transition: { duration: shellDuration, ease },
|
|
10846
10902
|
style: { overflow: "hidden" },
|
|
10847
|
-
children: /* @__PURE__ */
|
|
10903
|
+
children: /* @__PURE__ */ jsx22("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__ */ jsxs17(
|
|
10848
10904
|
"button",
|
|
10849
10905
|
{
|
|
10850
10906
|
type: "button",
|
|
@@ -10866,11 +10922,11 @@ function SessionChrome({
|
|
|
10866
10922
|
},
|
|
10867
10923
|
"activity-tabs"
|
|
10868
10924
|
) : null }),
|
|
10869
|
-
goal?.mutationError ? /* @__PURE__ */
|
|
10925
|
+
goal?.mutationError ? /* @__PURE__ */ jsxs17("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
|
|
10870
10926
|
"Goal action not confirmed. ",
|
|
10871
10927
|
formatError(goal.mutationError)
|
|
10872
10928
|
] }) : null,
|
|
10873
|
-
/* @__PURE__ */
|
|
10929
|
+
/* @__PURE__ */ jsx22(
|
|
10874
10930
|
"div",
|
|
10875
10931
|
{
|
|
10876
10932
|
id: panelId,
|
|
@@ -10886,7 +10942,7 @@ function SessionChrome({
|
|
|
10886
10942
|
transitionDuration: "var(--og-session-chrome-duration)",
|
|
10887
10943
|
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
10888
10944
|
},
|
|
10889
|
-
children: /* @__PURE__ */
|
|
10945
|
+
children: /* @__PURE__ */ jsx22("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsxs17(
|
|
10890
10946
|
"div",
|
|
10891
10947
|
{
|
|
10892
10948
|
className: cn(
|
|
@@ -10899,7 +10955,7 @@ function SessionChrome({
|
|
|
10899
10955
|
paddingBlock: "var(--og-session-chrome-panel-pad-y)"
|
|
10900
10956
|
},
|
|
10901
10957
|
children: [
|
|
10902
|
-
/* @__PURE__ */
|
|
10958
|
+
/* @__PURE__ */ jsx22(AnimatePresence4, { initial: false, children: active && active !== "commands" && panelBody ? /* @__PURE__ */ jsx22(
|
|
10903
10959
|
motion5.div,
|
|
10904
10960
|
{
|
|
10905
10961
|
"data-og-session-chrome-panel-frame": active,
|
|
@@ -10917,7 +10973,7 @@ function SessionChrome({
|
|
|
10917
10973
|
},
|
|
10918
10974
|
active
|
|
10919
10975
|
) : null }),
|
|
10920
|
-
active === "commands" ? /* @__PURE__ */
|
|
10976
|
+
active === "commands" ? /* @__PURE__ */ jsx22(
|
|
10921
10977
|
motion5.div,
|
|
10922
10978
|
{
|
|
10923
10979
|
initial: reduceMotion ? false : { opacity: 0 },
|
|
@@ -10943,20 +10999,20 @@ function IncomingPanel({
|
|
|
10943
10999
|
onDismiss,
|
|
10944
11000
|
onOpenSession
|
|
10945
11001
|
}) {
|
|
10946
|
-
return /* @__PURE__ */
|
|
10947
|
-
/* @__PURE__ */
|
|
10948
|
-
/* @__PURE__ */
|
|
11002
|
+
return /* @__PURE__ */ jsxs17("div", { children: [
|
|
11003
|
+
/* @__PURE__ */ jsx22("p", { className: "mb-2 text-og-xs text-og-fg-subtle", children: "Waiting to be included in an agent turn." }),
|
|
11004
|
+
/* @__PURE__ */ jsx22(
|
|
10949
11005
|
"ul",
|
|
10950
11006
|
{
|
|
10951
11007
|
className: "flex flex-col gap-0.5",
|
|
10952
11008
|
"aria-label": "Incoming updates",
|
|
10953
11009
|
"data-og-session-chrome-panel": "incoming",
|
|
10954
|
-
children: inputs.map((input) => /* @__PURE__ */
|
|
11010
|
+
children: inputs.map((input) => /* @__PURE__ */ jsxs17(
|
|
10955
11011
|
"li",
|
|
10956
11012
|
{
|
|
10957
11013
|
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)]",
|
|
10958
11014
|
children: [
|
|
10959
|
-
/* @__PURE__ */
|
|
11015
|
+
/* @__PURE__ */ jsx22(
|
|
10960
11016
|
"span",
|
|
10961
11017
|
{
|
|
10962
11018
|
className: cn(
|
|
@@ -10966,9 +11022,9 @@ function IncomingPanel({
|
|
|
10966
11022
|
children: pendingKindLabel(input.kind)
|
|
10967
11023
|
}
|
|
10968
11024
|
),
|
|
10969
|
-
/* @__PURE__ */
|
|
10970
|
-
/* @__PURE__ */
|
|
10971
|
-
/* @__PURE__ */
|
|
11025
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
|
|
11026
|
+
/* @__PURE__ */ jsx22("p", { className: "break-words text-og-xs leading-4 text-og-fg", children: input.summary }),
|
|
11027
|
+
/* @__PURE__ */ jsx22(
|
|
10972
11028
|
ChildSessionLink,
|
|
10973
11029
|
{
|
|
10974
11030
|
kind: input.kind,
|
|
@@ -10977,14 +11033,14 @@ function IncomingPanel({
|
|
|
10977
11033
|
}
|
|
10978
11034
|
)
|
|
10979
11035
|
] }),
|
|
10980
|
-
onDismiss ? /* @__PURE__ */
|
|
11036
|
+
onDismiss ? /* @__PURE__ */ jsx22("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__ */ jsx22(
|
|
10981
11037
|
IconAction,
|
|
10982
11038
|
{
|
|
10983
11039
|
label: `Dismiss incoming ${pendingKindLabel(input.kind)}`,
|
|
10984
11040
|
tip: "Dismiss",
|
|
10985
11041
|
onClick: () => onDismiss(input.id),
|
|
10986
11042
|
danger: true,
|
|
10987
|
-
children: /* @__PURE__ */
|
|
11043
|
+
children: /* @__PURE__ */ jsx22(Trash2Icon2, { className: "size-3" })
|
|
10988
11044
|
}
|
|
10989
11045
|
) }) : null
|
|
10990
11046
|
]
|
|
@@ -11017,10 +11073,10 @@ function QueuePanel({
|
|
|
11017
11073
|
}) {
|
|
11018
11074
|
const reduceMotion = useReducedMotion4();
|
|
11019
11075
|
const turnIdsKey = turns.map((turn) => turn.id).join(",");
|
|
11020
|
-
const [interactiveTurnIds, setInteractiveTurnIds] =
|
|
11076
|
+
const [interactiveTurnIds, setInteractiveTurnIds] = useState16(
|
|
11021
11077
|
() => /* @__PURE__ */ new Set()
|
|
11022
11078
|
);
|
|
11023
|
-
|
|
11079
|
+
useEffect11(() => {
|
|
11024
11080
|
const visibleTurnIds = new Set(turnIdsKey ? turnIdsKey.split(",") : []);
|
|
11025
11081
|
setInteractiveTurnIds((current) => {
|
|
11026
11082
|
const retained = new Set([...current].filter((turnId) => visibleTurnIds.has(turnId)));
|
|
@@ -11033,7 +11089,7 @@ function QueuePanel({
|
|
|
11033
11089
|
);
|
|
11034
11090
|
return () => clearTimeout(timer);
|
|
11035
11091
|
}, [reduceMotion, turnIdsKey]);
|
|
11036
|
-
return /* @__PURE__ */
|
|
11092
|
+
return /* @__PURE__ */ jsxs17(
|
|
11037
11093
|
"ol",
|
|
11038
11094
|
{
|
|
11039
11095
|
className: "flex flex-col gap-0.5",
|
|
@@ -11049,52 +11105,52 @@ function QueuePanel({
|
|
|
11049
11105
|
const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
|
|
11050
11106
|
const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
|
|
11051
11107
|
const confirmingReplace = replaceDraftFor === turn.id;
|
|
11052
|
-
return /* @__PURE__ */
|
|
11108
|
+
return /* @__PURE__ */ jsxs17(
|
|
11053
11109
|
"li",
|
|
11054
11110
|
{
|
|
11055
11111
|
"data-queue-turn-id": turn.id,
|
|
11056
11112
|
tabIndex: -1,
|
|
11057
11113
|
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)]",
|
|
11058
11114
|
children: [
|
|
11059
|
-
/* @__PURE__ */
|
|
11060
|
-
voice ? /* @__PURE__ */
|
|
11115
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-1.5", children: [
|
|
11116
|
+
voice ? /* @__PURE__ */ jsx22(
|
|
11061
11117
|
AudioLinesIcon,
|
|
11062
11118
|
{
|
|
11063
11119
|
"aria-hidden": "true",
|
|
11064
11120
|
className: "mt-0.5 size-3 shrink-0 text-og-accent"
|
|
11065
11121
|
}
|
|
11066
|
-
) : /* @__PURE__ */
|
|
11067
|
-
/* @__PURE__ */
|
|
11122
|
+
) : /* @__PURE__ */ jsx22("span", { className: "mt-px shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: index + 1 }),
|
|
11123
|
+
/* @__PURE__ */ jsx22(
|
|
11068
11124
|
CompactQueueItemContent,
|
|
11069
11125
|
{
|
|
11070
11126
|
text: presentation.text,
|
|
11071
11127
|
annotations: turn.annotations ?? []
|
|
11072
11128
|
}
|
|
11073
11129
|
),
|
|
11074
|
-
showActions ? /* @__PURE__ */
|
|
11075
|
-
onMove && turns.length > 1 ? /* @__PURE__ */
|
|
11076
|
-
/* @__PURE__ */
|
|
11130
|
+
showActions ? /* @__PURE__ */ jsxs17("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: [
|
|
11131
|
+
onMove && turns.length > 1 ? /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11132
|
+
/* @__PURE__ */ jsx22(
|
|
11077
11133
|
IconAction,
|
|
11078
11134
|
{
|
|
11079
11135
|
label: `Move queued prompt ${index + 1} up`,
|
|
11080
11136
|
tip: "Move up",
|
|
11081
11137
|
disabled: settling || pending !== null || index === 0,
|
|
11082
11138
|
onClick: () => onMove(turn.id, beforeUp),
|
|
11083
|
-
children: /* @__PURE__ */
|
|
11139
|
+
children: /* @__PURE__ */ jsx22(ArrowUpIcon2, { className: "size-3" })
|
|
11084
11140
|
}
|
|
11085
11141
|
),
|
|
11086
|
-
/* @__PURE__ */
|
|
11142
|
+
/* @__PURE__ */ jsx22(
|
|
11087
11143
|
IconAction,
|
|
11088
11144
|
{
|
|
11089
11145
|
label: `Move queued prompt ${index + 1} down`,
|
|
11090
11146
|
tip: "Move down",
|
|
11091
11147
|
disabled: settling || pending !== null || index >= turns.length - 1,
|
|
11092
11148
|
onClick: () => onMove(turn.id, beforeDown),
|
|
11093
|
-
children: /* @__PURE__ */
|
|
11149
|
+
children: /* @__PURE__ */ jsx22(ArrowDownIcon2, { className: "size-3" })
|
|
11094
11150
|
}
|
|
11095
11151
|
)
|
|
11096
11152
|
] }) : null,
|
|
11097
|
-
onSteer ? /* @__PURE__ */
|
|
11153
|
+
onSteer ? /* @__PURE__ */ jsx22(
|
|
11098
11154
|
IconAction,
|
|
11099
11155
|
{
|
|
11100
11156
|
label: `Steer queued prompt ${index + 1}`,
|
|
@@ -11103,20 +11159,20 @@ function QueuePanel({
|
|
|
11103
11159
|
tip: QUEUE_STEER_TIP,
|
|
11104
11160
|
disabled: settling || pending !== null,
|
|
11105
11161
|
onClick: () => onSteer(turn.id),
|
|
11106
|
-
children: pending === "steer" ? /* @__PURE__ */
|
|
11162
|
+
children: pending === "steer" ? /* @__PURE__ */ jsx22(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx22(CornerDownRightIcon, { className: "size-3" })
|
|
11107
11163
|
}
|
|
11108
11164
|
) : null,
|
|
11109
|
-
onEdit ? /* @__PURE__ */
|
|
11165
|
+
onEdit ? /* @__PURE__ */ jsx22(
|
|
11110
11166
|
IconAction,
|
|
11111
11167
|
{
|
|
11112
11168
|
label: `Edit queued prompt ${index + 1}`,
|
|
11113
11169
|
tip: QUEUE_EDIT_TIP,
|
|
11114
11170
|
disabled: settling || pending !== null,
|
|
11115
11171
|
onClick: () => onEdit(turn),
|
|
11116
|
-
children: pending === "edit" ? /* @__PURE__ */
|
|
11172
|
+
children: pending === "edit" ? /* @__PURE__ */ jsx22(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx22(PencilIcon, { className: "size-3" })
|
|
11117
11173
|
}
|
|
11118
11174
|
) : null,
|
|
11119
|
-
onRemove ? /* @__PURE__ */
|
|
11175
|
+
onRemove ? /* @__PURE__ */ jsx22(
|
|
11120
11176
|
IconAction,
|
|
11121
11177
|
{
|
|
11122
11178
|
label: `Remove queued prompt ${index + 1}`,
|
|
@@ -11124,16 +11180,16 @@ function QueuePanel({
|
|
|
11124
11180
|
disabled: settling || pending !== null,
|
|
11125
11181
|
onClick: () => onRemove(turn.id),
|
|
11126
11182
|
danger: true,
|
|
11127
|
-
children: pending === "delete" ? /* @__PURE__ */
|
|
11183
|
+
children: pending === "delete" ? /* @__PURE__ */ jsx22(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx22(Trash2Icon2, { className: "size-3" })
|
|
11128
11184
|
}
|
|
11129
11185
|
) : null
|
|
11130
11186
|
] }) : null
|
|
11131
11187
|
] }),
|
|
11132
|
-
confirmingReplace ? /* @__PURE__ */
|
|
11133
|
-
/* @__PURE__ */
|
|
11134
|
-
/* @__PURE__ */
|
|
11135
|
-
/* @__PURE__ */
|
|
11136
|
-
/* @__PURE__ */
|
|
11188
|
+
confirmingReplace ? /* @__PURE__ */ jsxs17("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: [
|
|
11189
|
+
/* @__PURE__ */ jsx22("p", { children: "Your composer already has a draft. Replace it with this queued prompt?" }),
|
|
11190
|
+
/* @__PURE__ */ jsx22("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." }),
|
|
11191
|
+
/* @__PURE__ */ jsxs17("div", { className: "mt-2 flex justify-end gap-1.5", children: [
|
|
11192
|
+
/* @__PURE__ */ jsx22(
|
|
11137
11193
|
"button",
|
|
11138
11194
|
{
|
|
11139
11195
|
type: "button",
|
|
@@ -11142,7 +11198,7 @@ function QueuePanel({
|
|
|
11142
11198
|
children: "Keep current draft"
|
|
11143
11199
|
}
|
|
11144
11200
|
),
|
|
11145
|
-
/* @__PURE__ */
|
|
11201
|
+
/* @__PURE__ */ jsx22(
|
|
11146
11202
|
"button",
|
|
11147
11203
|
{
|
|
11148
11204
|
type: "button",
|
|
@@ -11158,7 +11214,7 @@ function QueuePanel({
|
|
|
11158
11214
|
turn.id
|
|
11159
11215
|
);
|
|
11160
11216
|
}),
|
|
11161
|
-
/* @__PURE__ */
|
|
11217
|
+
/* @__PURE__ */ jsx22(AnimatePresence4, { initial: false, children: optimistic.map((message, index) => /* @__PURE__ */ jsxs17(
|
|
11162
11218
|
motion5.li,
|
|
11163
11219
|
{
|
|
11164
11220
|
"aria-live": "polite",
|
|
@@ -11171,14 +11227,14 @@ function QueuePanel({
|
|
|
11171
11227
|
message.state === "failed" ? "bg-og-danger/8 text-og-danger" : "bg-og-accent-soft/45"
|
|
11172
11228
|
),
|
|
11173
11229
|
children: [
|
|
11174
|
-
/* @__PURE__ */
|
|
11175
|
-
/* @__PURE__ */
|
|
11176
|
-
/* @__PURE__ */
|
|
11177
|
-
message.state === "failed" && message.error ? /* @__PURE__ */
|
|
11230
|
+
/* @__PURE__ */ jsx22("span", { className: "shrink-0 font-og-mono text-[10px] leading-4 text-og-fg-subtle", children: turns.length + index + 1 }),
|
|
11231
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
|
|
11232
|
+
/* @__PURE__ */ jsx22(CompactQueueItemContent, { text: message.text, annotations: message.annotations }),
|
|
11233
|
+
message.state === "failed" && message.error ? /* @__PURE__ */ jsx22("p", { className: "break-words text-og-xs", children: message.error }) : null
|
|
11178
11234
|
] }),
|
|
11179
|
-
/* @__PURE__ */
|
|
11180
|
-
message.state === "failed" ? /* @__PURE__ */
|
|
11181
|
-
message.retryable !== false && onRetryOptimistic ? /* @__PURE__ */
|
|
11235
|
+
/* @__PURE__ */ jsx22("span", { className: "sr-only", children: message.state === "failed" ? message.outcomeUnknown ? "Not confirmed" : "Message not sent" : message.state === "sending" ? "Placing in queue" : "Queued" }),
|
|
11236
|
+
message.state === "failed" ? /* @__PURE__ */ jsxs17("div", { className: "flex shrink-0 items-center gap-1 text-[10px]", children: [
|
|
11237
|
+
message.retryable !== false && onRetryOptimistic ? /* @__PURE__ */ jsx22(
|
|
11182
11238
|
"button",
|
|
11183
11239
|
{
|
|
11184
11240
|
type: "button",
|
|
@@ -11187,7 +11243,7 @@ function QueuePanel({
|
|
|
11187
11243
|
children: "Retry"
|
|
11188
11244
|
}
|
|
11189
11245
|
) : null,
|
|
11190
|
-
message.retryable === false && onRestoreOptimistic ? /* @__PURE__ */
|
|
11246
|
+
message.retryable === false && onRestoreOptimistic ? /* @__PURE__ */ jsx22(
|
|
11191
11247
|
"button",
|
|
11192
11248
|
{
|
|
11193
11249
|
type: "button",
|
|
@@ -11196,36 +11252,36 @@ function QueuePanel({
|
|
|
11196
11252
|
children: "Edit message"
|
|
11197
11253
|
}
|
|
11198
11254
|
) : null,
|
|
11199
|
-
onRemoveOptimistic ? /* @__PURE__ */
|
|
11255
|
+
onRemoveOptimistic ? /* @__PURE__ */ jsx22(
|
|
11200
11256
|
"button",
|
|
11201
11257
|
{
|
|
11202
11258
|
type: "button",
|
|
11203
11259
|
"aria-label": "Dismiss unconfirmed queued prompt",
|
|
11204
11260
|
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",
|
|
11205
11261
|
onClick: () => onRemoveOptimistic(message.clientEventId),
|
|
11206
|
-
children: /* @__PURE__ */
|
|
11262
|
+
children: /* @__PURE__ */ jsx22(XIcon2, { className: "size-3" })
|
|
11207
11263
|
}
|
|
11208
11264
|
) : null
|
|
11209
|
-
] }) : message.state === "sending" ? /* @__PURE__ */
|
|
11265
|
+
] }) : message.state === "sending" ? /* @__PURE__ */ jsx22(
|
|
11210
11266
|
Loader2Icon2,
|
|
11211
11267
|
{
|
|
11212
11268
|
"aria-hidden": "true",
|
|
11213
11269
|
className: "size-3 shrink-0 animate-og-spin text-og-accent motion-reduce:animate-none"
|
|
11214
11270
|
}
|
|
11215
|
-
) : /* @__PURE__ */
|
|
11271
|
+
) : /* @__PURE__ */ jsx22(CheckIcon3, { "aria-hidden": "true", className: "size-3 shrink-0 text-og-accent" })
|
|
11216
11272
|
]
|
|
11217
11273
|
},
|
|
11218
11274
|
message.clientEventId
|
|
11219
11275
|
)) }),
|
|
11220
|
-
loadError ? /* @__PURE__ */
|
|
11276
|
+
loadError ? /* @__PURE__ */ jsxs17(
|
|
11221
11277
|
"li",
|
|
11222
11278
|
{
|
|
11223
11279
|
role: "alert",
|
|
11224
11280
|
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",
|
|
11225
11281
|
children: [
|
|
11226
|
-
/* @__PURE__ */
|
|
11227
|
-
/* @__PURE__ */
|
|
11228
|
-
/* @__PURE__ */
|
|
11282
|
+
/* @__PURE__ */ jsx22(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
11283
|
+
/* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1", children: "Queue unavailable." }),
|
|
11284
|
+
/* @__PURE__ */ jsx22(
|
|
11229
11285
|
"button",
|
|
11230
11286
|
{
|
|
11231
11287
|
type: "button",
|
|
@@ -11237,15 +11293,15 @@ function QueuePanel({
|
|
|
11237
11293
|
]
|
|
11238
11294
|
}
|
|
11239
11295
|
) : null,
|
|
11240
|
-
mutationError ? /* @__PURE__ */
|
|
11296
|
+
mutationError ? /* @__PURE__ */ jsxs17(
|
|
11241
11297
|
"li",
|
|
11242
11298
|
{
|
|
11243
11299
|
role: "alert",
|
|
11244
11300
|
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",
|
|
11245
11301
|
children: [
|
|
11246
|
-
/* @__PURE__ */
|
|
11247
|
-
/* @__PURE__ */
|
|
11248
|
-
/* @__PURE__ */
|
|
11302
|
+
/* @__PURE__ */ jsx22(TriangleAlertIcon3, { className: "size-3 shrink-0" }),
|
|
11303
|
+
/* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1", children: "Not confirmed. Check the queue before retrying." }),
|
|
11304
|
+
/* @__PURE__ */ jsx22(
|
|
11249
11305
|
"button",
|
|
11250
11306
|
{
|
|
11251
11307
|
type: "button",
|
|
@@ -11266,9 +11322,9 @@ function CompactQueueItemContent({
|
|
|
11266
11322
|
annotations
|
|
11267
11323
|
}) {
|
|
11268
11324
|
const content = queueItemContent(text, annotations.length);
|
|
11269
|
-
return /* @__PURE__ */
|
|
11270
|
-
content === "text" ? /* @__PURE__ */
|
|
11271
|
-
annotations.length > 0 ? /* @__PURE__ */
|
|
11325
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
11326
|
+
content === "text" ? /* @__PURE__ */ jsx22("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg", children: text }) : content === "unavailable" ? /* @__PURE__ */ jsx22("p", { className: "min-w-0 flex-1 truncate text-og-xs leading-4 text-og-fg-muted italic", children: QUEUE_ITEM_CONTENT_UNAVAILABLE }) : null,
|
|
11327
|
+
annotations.length > 0 ? /* @__PURE__ */ jsx22(TimelineAnnotationsChip, { annotations, className: "shrink-0", compact: true }) : null
|
|
11272
11328
|
] });
|
|
11273
11329
|
}
|
|
11274
11330
|
function GoalPanel({
|
|
@@ -11282,26 +11338,26 @@ function GoalPanel({
|
|
|
11282
11338
|
if (!record) return null;
|
|
11283
11339
|
const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
|
|
11284
11340
|
const explanation = sessionChromeGoalPillExplanation(state, record);
|
|
11285
|
-
return /* @__PURE__ */
|
|
11286
|
-
/* @__PURE__ */
|
|
11287
|
-
/* @__PURE__ */
|
|
11288
|
-
elapsed ? /* @__PURE__ */
|
|
11341
|
+
return /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", "data-og-session-chrome-panel": "goal", children: [
|
|
11342
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-og-fg-subtle", children: [
|
|
11343
|
+
/* @__PURE__ */ jsx22("span", { children: sessionChromeGoalPillLabel(state, record) }),
|
|
11344
|
+
elapsed ? /* @__PURE__ */ jsxs17("span", { className: "tabular-nums normal-case tracking-normal text-og-fg-muted", children: [
|
|
11289
11345
|
"\xB7 Created ",
|
|
11290
11346
|
elapsed,
|
|
11291
11347
|
" ago"
|
|
11292
11348
|
] }) : null,
|
|
11293
|
-
/* @__PURE__ */
|
|
11349
|
+
/* @__PURE__ */ jsxs17("span", { className: "normal-case tracking-normal text-og-fg-muted", children: [
|
|
11294
11350
|
"\xB7 v",
|
|
11295
11351
|
record.version
|
|
11296
11352
|
] })
|
|
11297
11353
|
] }),
|
|
11298
|
-
/* @__PURE__ */
|
|
11299
|
-
record.successCriteria ? /* @__PURE__ */
|
|
11300
|
-
/* @__PURE__ */
|
|
11354
|
+
/* @__PURE__ */ jsx22("p", { className: "text-og-sm leading-5 text-og-fg", children: record.text }),
|
|
11355
|
+
record.successCriteria ? /* @__PURE__ */ jsxs17("p", { className: "text-og-xs leading-4 text-og-fg-muted", children: [
|
|
11356
|
+
/* @__PURE__ */ jsx22("span", { className: "font-medium text-og-fg", children: "Done when" }),
|
|
11301
11357
|
" ",
|
|
11302
11358
|
record.successCriteria
|
|
11303
11359
|
] }) : null,
|
|
11304
|
-
explanation ? /* @__PURE__ */
|
|
11360
|
+
explanation ? /* @__PURE__ */ jsx22(
|
|
11305
11361
|
"p",
|
|
11306
11362
|
{
|
|
11307
11363
|
"data-og-session-chrome-goal-explanation": true,
|
|
@@ -11309,20 +11365,20 @@ function GoalPanel({
|
|
|
11309
11365
|
children: explanation
|
|
11310
11366
|
}
|
|
11311
11367
|
) : null,
|
|
11312
|
-
record.continuation?.lastError ? /* @__PURE__ */
|
|
11313
|
-
/* @__PURE__ */
|
|
11314
|
-
/* @__PURE__ */
|
|
11315
|
-
/* @__PURE__ */
|
|
11368
|
+
record.continuation?.lastError ? /* @__PURE__ */ jsx22("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: formatError(record.continuation.lastError) }) : null,
|
|
11369
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
|
|
11370
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
|
|
11371
|
+
/* @__PURE__ */ jsxs17("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
11316
11372
|
record.autoContinuations,
|
|
11317
11373
|
" consecutive unattended continues"
|
|
11318
11374
|
] }),
|
|
11319
|
-
/* @__PURE__ */
|
|
11375
|
+
/* @__PURE__ */ jsxs17("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
11320
11376
|
record.noProgressStreak,
|
|
11321
11377
|
" stalled"
|
|
11322
11378
|
] })
|
|
11323
11379
|
] }),
|
|
11324
|
-
!readOnly ? /* @__PURE__ */
|
|
11325
|
-
canToggle ? /* @__PURE__ */
|
|
11380
|
+
!readOnly ? /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-0.5", children: [
|
|
11381
|
+
canToggle ? /* @__PURE__ */ jsxs17(
|
|
11326
11382
|
"button",
|
|
11327
11383
|
{
|
|
11328
11384
|
type: "button",
|
|
@@ -11330,12 +11386,12 @@ function GoalPanel({
|
|
|
11330
11386
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
11331
11387
|
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",
|
|
11332
11388
|
children: [
|
|
11333
|
-
goal.updating ? /* @__PURE__ */
|
|
11389
|
+
goal.updating ? /* @__PURE__ */ jsx22(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx22(PlayIcon2, { className: "size-3" }) : /* @__PURE__ */ jsx22(PauseIcon2, { className: "size-3" }),
|
|
11334
11390
|
record.status === "paused" ? "Resume" : "Pause"
|
|
11335
11391
|
]
|
|
11336
11392
|
}
|
|
11337
11393
|
) : null,
|
|
11338
|
-
/* @__PURE__ */
|
|
11394
|
+
/* @__PURE__ */ jsxs17(
|
|
11339
11395
|
"button",
|
|
11340
11396
|
{
|
|
11341
11397
|
type: "button",
|
|
@@ -11343,7 +11399,7 @@ function GoalPanel({
|
|
|
11343
11399
|
onClick: () => void goal.deleteGoal(),
|
|
11344
11400
|
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",
|
|
11345
11401
|
children: [
|
|
11346
|
-
/* @__PURE__ */
|
|
11402
|
+
/* @__PURE__ */ jsx22(Trash2Icon2, { className: "size-3" }),
|
|
11347
11403
|
"Clear"
|
|
11348
11404
|
]
|
|
11349
11405
|
}
|
|
@@ -11352,9 +11408,9 @@ function GoalPanel({
|
|
|
11352
11408
|
] })
|
|
11353
11409
|
] });
|
|
11354
11410
|
}
|
|
11355
|
-
var QUEUE_STEER_TIP = /* @__PURE__ */
|
|
11356
|
-
/* @__PURE__ */
|
|
11357
|
-
/* @__PURE__ */
|
|
11411
|
+
var QUEUE_STEER_TIP = /* @__PURE__ */ jsxs17("span", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
11412
|
+
/* @__PURE__ */ jsx22("span", { className: "font-medium", children: "Steer" }),
|
|
11413
|
+
/* @__PURE__ */ jsx22("span", { className: "opacity-80", children: "Interrupt the current turn and send this message now" })
|
|
11358
11414
|
] });
|
|
11359
11415
|
var QUEUE_EDIT_TIP = "Edit in composer";
|
|
11360
11416
|
var QUEUE_DELETE_TIP = "Delete this queued prompt";
|
|
@@ -11368,8 +11424,8 @@ function IconAction({
|
|
|
11368
11424
|
danger,
|
|
11369
11425
|
children
|
|
11370
11426
|
}) {
|
|
11371
|
-
return /* @__PURE__ */
|
|
11372
|
-
/* @__PURE__ */
|
|
11427
|
+
return /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
11428
|
+
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
11373
11429
|
"button",
|
|
11374
11430
|
{
|
|
11375
11431
|
type: "button",
|
|
@@ -11391,7 +11447,7 @@ function IconAction({
|
|
|
11391
11447
|
]
|
|
11392
11448
|
}
|
|
11393
11449
|
) }),
|
|
11394
|
-
/* @__PURE__ */
|
|
11450
|
+
/* @__PURE__ */ jsx22(TooltipContent, { side: "top", children: tip })
|
|
11395
11451
|
] });
|
|
11396
11452
|
}
|
|
11397
11453
|
|
|
@@ -11401,16 +11457,16 @@ import {
|
|
|
11401
11457
|
lazy as lazy5,
|
|
11402
11458
|
Suspense as Suspense6,
|
|
11403
11459
|
useCallback as useCallback5,
|
|
11404
|
-
useEffect as
|
|
11460
|
+
useEffect as useEffect14,
|
|
11405
11461
|
useMemo as useMemo8,
|
|
11406
11462
|
useRef as useRef11,
|
|
11407
|
-
useState as
|
|
11463
|
+
useState as useState19
|
|
11408
11464
|
} from "react";
|
|
11409
11465
|
|
|
11410
11466
|
// src/components/session-proxy-scope.tsx
|
|
11411
11467
|
import { OpenGeniBrowserClient } from "@opengeni/sdk/browser";
|
|
11412
|
-
import { useEffect as
|
|
11413
|
-
import { jsx as
|
|
11468
|
+
import { useEffect as useEffect12, useMemo as useMemo7, useState as useState17 } from "react";
|
|
11469
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
11414
11470
|
function SessionProxyScope({
|
|
11415
11471
|
baseUrl,
|
|
11416
11472
|
workspaceId,
|
|
@@ -11420,10 +11476,10 @@ function SessionProxyScope({
|
|
|
11420
11476
|
() => new OpenGeniBrowserClient({ baseUrl, apiContract: "compatible" }),
|
|
11421
11477
|
[baseUrl]
|
|
11422
11478
|
);
|
|
11423
|
-
const [state, setState] =
|
|
11479
|
+
const [state, setState] = useState17(
|
|
11424
11480
|
workspaceId ? { status: "ready", workspaceId } : { status: "loading" }
|
|
11425
11481
|
);
|
|
11426
|
-
|
|
11482
|
+
useEffect12(() => {
|
|
11427
11483
|
if (workspaceId) {
|
|
11428
11484
|
setState({ status: "ready", workspaceId });
|
|
11429
11485
|
return;
|
|
@@ -11453,16 +11509,16 @@ function SessionProxyScope({
|
|
|
11453
11509
|
};
|
|
11454
11510
|
}, [client, workspaceId]);
|
|
11455
11511
|
if (state.status === "error") {
|
|
11456
|
-
return /* @__PURE__ */
|
|
11512
|
+
return /* @__PURE__ */ jsx23("div", { role: "alert", className: "og-root p-3 text-og-sm text-og-danger", "data-og-proxy-error": "", children: state.message });
|
|
11457
11513
|
}
|
|
11458
11514
|
if (state.status === "loading") {
|
|
11459
|
-
return /* @__PURE__ */
|
|
11515
|
+
return /* @__PURE__ */ jsx23("div", { className: "og-root", "aria-busy": "true", "data-og-proxy-loading": "" });
|
|
11460
11516
|
}
|
|
11461
|
-
return /* @__PURE__ */
|
|
11517
|
+
return /* @__PURE__ */ jsx23(OpenGeniProvider, { client, workspaceId: state.workspaceId, children });
|
|
11462
11518
|
}
|
|
11463
11519
|
|
|
11464
11520
|
// src/lib/host-theme.ts
|
|
11465
|
-
import { useLayoutEffect as useLayoutEffect6, useEffect as
|
|
11521
|
+
import { useLayoutEffect as useLayoutEffect6, useEffect as useEffect13, useState as useState18 } from "react";
|
|
11466
11522
|
var HOST_THEME_ROOT_ATTRIBUTE = "data-og-host-theme";
|
|
11467
11523
|
var HOST_THEME_ATTRIBUTES = [
|
|
11468
11524
|
"data-theme",
|
|
@@ -11690,7 +11746,7 @@ function hostSurfaceStyle(theme, background) {
|
|
|
11690
11746
|
}
|
|
11691
11747
|
return style;
|
|
11692
11748
|
}
|
|
11693
|
-
var useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
11749
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect13 : useLayoutEffect6;
|
|
11694
11750
|
function designedTheme(overrides) {
|
|
11695
11751
|
for (const token of ["--og-color-fg", "--og-color-bg", "--og-color-canvas"]) {
|
|
11696
11752
|
const value = overrides[token];
|
|
@@ -11740,7 +11796,7 @@ function resolveHostThemeState(element, preference, surface) {
|
|
|
11740
11796
|
function useHostTheme(ref, options) {
|
|
11741
11797
|
const preference = options.theme ?? "auto";
|
|
11742
11798
|
const surface = options.surface ?? "host";
|
|
11743
|
-
const [state, setState] =
|
|
11799
|
+
const [state, setState] = useState18({ theme: preference === "auto" ? void 0 : preference, inherited: false, style: null });
|
|
11744
11800
|
useIsomorphicLayoutEffect(() => {
|
|
11745
11801
|
const element = ref.current;
|
|
11746
11802
|
if (!element || typeof window === "undefined") return;
|
|
@@ -11802,19 +11858,19 @@ function useHostTheme(ref, options) {
|
|
|
11802
11858
|
}
|
|
11803
11859
|
|
|
11804
11860
|
// src/components/session-conversation.tsx
|
|
11805
|
-
import { Fragment as Fragment9, jsx as
|
|
11861
|
+
import { Fragment as Fragment9, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11806
11862
|
var DEFAULT_CONVERSATION_LABELS = {
|
|
11807
11863
|
retry: "Retry",
|
|
11808
11864
|
tryAgain: "Try again"
|
|
11809
11865
|
};
|
|
11810
11866
|
function SessionConversation({ baseUrl, ...props }) {
|
|
11811
|
-
if (baseUrl === void 0) return /* @__PURE__ */
|
|
11867
|
+
if (baseUrl === void 0) return /* @__PURE__ */ jsx24(RetryingConversation, { ...props });
|
|
11812
11868
|
const { client: _client, workspaceId, ...rest } = props;
|
|
11813
|
-
return /* @__PURE__ */
|
|
11869
|
+
return /* @__PURE__ */ jsx24(SessionProxyScope, { baseUrl, workspaceId, children: /* @__PURE__ */ jsx24(RetryingConversation, { ...rest }) });
|
|
11814
11870
|
}
|
|
11815
11871
|
function RetryingConversation(props) {
|
|
11816
|
-
const [attempt, setAttempt] =
|
|
11817
|
-
return /* @__PURE__ */
|
|
11872
|
+
const [attempt, setAttempt] = useState19(0);
|
|
11873
|
+
return /* @__PURE__ */ jsx24(
|
|
11818
11874
|
Conversation,
|
|
11819
11875
|
{
|
|
11820
11876
|
...props,
|
|
@@ -11925,7 +11981,7 @@ function Conversation({
|
|
|
11925
11981
|
if (feed.error) void feed.jumpToLatest();
|
|
11926
11982
|
};
|
|
11927
11983
|
const running = status === "running" || status === "recovering" || status === "waiting_capacity";
|
|
11928
|
-
return /* @__PURE__ */
|
|
11984
|
+
return /* @__PURE__ */ jsxs18(
|
|
11929
11985
|
"div",
|
|
11930
11986
|
{
|
|
11931
11987
|
className: cn(
|
|
@@ -11938,15 +11994,15 @@ function Conversation({
|
|
|
11938
11994
|
"data-og-host-theme": "",
|
|
11939
11995
|
"data-og-conversation": "",
|
|
11940
11996
|
children: [
|
|
11941
|
-
error && !loadFailed ? /* @__PURE__ */
|
|
11997
|
+
error && !loadFailed ? /* @__PURE__ */ jsxs18(
|
|
11942
11998
|
"div",
|
|
11943
11999
|
{
|
|
11944
12000
|
role: "alert",
|
|
11945
12001
|
className: "mx-auto flex w-full max-w-3xl shrink-0 items-center gap-3 rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-og-sm text-og-fg",
|
|
11946
12002
|
"data-og-conversation-error": "",
|
|
11947
12003
|
children: [
|
|
11948
|
-
/* @__PURE__ */
|
|
11949
|
-
/* @__PURE__ */
|
|
12004
|
+
/* @__PURE__ */ jsx24("span", { className: "min-w-0 flex-1", children: formatError(error) }),
|
|
12005
|
+
/* @__PURE__ */ jsx24(
|
|
11950
12006
|
"button",
|
|
11951
12007
|
{
|
|
11952
12008
|
type: "button",
|
|
@@ -11958,15 +12014,15 @@ function Conversation({
|
|
|
11958
12014
|
]
|
|
11959
12015
|
}
|
|
11960
12016
|
) : null,
|
|
11961
|
-
loadFailed ? /* @__PURE__ */
|
|
12017
|
+
loadFailed ? /* @__PURE__ */ jsxs18(
|
|
11962
12018
|
"div",
|
|
11963
12019
|
{
|
|
11964
12020
|
role: "alert",
|
|
11965
12021
|
className: "flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center",
|
|
11966
12022
|
"data-og-conversation-error": "",
|
|
11967
12023
|
children: [
|
|
11968
|
-
/* @__PURE__ */
|
|
11969
|
-
/* @__PURE__ */
|
|
12024
|
+
/* @__PURE__ */ jsx24("p", { className: "max-w-sm text-og-base text-og-fg-muted", children: formatError(feed.error) }),
|
|
12025
|
+
/* @__PURE__ */ jsx24(
|
|
11970
12026
|
"button",
|
|
11971
12027
|
{
|
|
11972
12028
|
type: "button",
|
|
@@ -11977,7 +12033,7 @@ function Conversation({
|
|
|
11977
12033
|
)
|
|
11978
12034
|
]
|
|
11979
12035
|
}
|
|
11980
|
-
) : /* @__PURE__ */
|
|
12036
|
+
) : /* @__PURE__ */ jsx24(
|
|
11981
12037
|
MessageTimeline,
|
|
11982
12038
|
{
|
|
11983
12039
|
renderMessageText,
|
|
@@ -12007,14 +12063,14 @@ function Conversation({
|
|
|
12007
12063
|
questionNavMinViewportHeight: 320
|
|
12008
12064
|
}
|
|
12009
12065
|
),
|
|
12010
|
-
importedArchive ? /* @__PURE__ */
|
|
12011
|
-
/* @__PURE__ */
|
|
12066
|
+
importedArchive ? /* @__PURE__ */ jsx24("p", { className: "shrink-0 px-4 py-2 text-center text-sm text-og-muted", role: "status", children: "Archived conversation \xB7 Read only" }) : /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
12067
|
+
/* @__PURE__ */ jsxs18(
|
|
12012
12068
|
"div",
|
|
12013
12069
|
{
|
|
12014
12070
|
className: "relative z-20 min-h-0 max-h-[40%] shrink-0 overflow-y-auto empty:hidden",
|
|
12015
12071
|
"data-og-conversation-inputs": "",
|
|
12016
12072
|
children: [
|
|
12017
|
-
approvals.length > 0 && !terminal ? /* @__PURE__ */
|
|
12073
|
+
approvals.length > 0 && !terminal ? /* @__PURE__ */ jsx24(
|
|
12018
12074
|
ApprovalSurface,
|
|
12019
12075
|
{
|
|
12020
12076
|
className: "mx-auto max-w-3xl",
|
|
@@ -12029,7 +12085,7 @@ function Conversation({
|
|
|
12029
12085
|
error: control.error
|
|
12030
12086
|
}
|
|
12031
12087
|
) : null,
|
|
12032
|
-
/* @__PURE__ */
|
|
12088
|
+
/* @__PURE__ */ jsx24(
|
|
12033
12089
|
HumanInputSurface,
|
|
12034
12090
|
{
|
|
12035
12091
|
className: "mx-auto max-w-3xl",
|
|
@@ -12044,7 +12100,7 @@ function Conversation({
|
|
|
12044
12100
|
decisionButtons: true
|
|
12045
12101
|
}
|
|
12046
12102
|
),
|
|
12047
|
-
terminal ? /* @__PURE__ */
|
|
12103
|
+
terminal ? /* @__PURE__ */ jsx24(SessionChrome, { queue, sessionStatus: status, readOnly: true }) : /* @__PURE__ */ jsx24(
|
|
12048
12104
|
SessionChrome,
|
|
12049
12105
|
{
|
|
12050
12106
|
queue,
|
|
@@ -12056,12 +12112,12 @@ function Conversation({
|
|
|
12056
12112
|
]
|
|
12057
12113
|
}
|
|
12058
12114
|
),
|
|
12059
|
-
/* @__PURE__ */
|
|
12115
|
+
/* @__PURE__ */ jsx24(
|
|
12060
12116
|
"div",
|
|
12061
12117
|
{
|
|
12062
12118
|
className: "relative z-20 mx-auto w-full max-w-3xl shrink-0",
|
|
12063
12119
|
"data-og-conversation-composer": "",
|
|
12064
|
-
children: /* @__PURE__ */
|
|
12120
|
+
children: /* @__PURE__ */ jsx24(
|
|
12065
12121
|
ChatComposer,
|
|
12066
12122
|
{
|
|
12067
12123
|
runControl: "stop",
|
|
@@ -12070,7 +12126,7 @@ function Conversation({
|
|
|
12070
12126
|
composer,
|
|
12071
12127
|
attachments: uploadsEnabled ? files : void 0,
|
|
12072
12128
|
disabled: terminal || composerProps?.disabled,
|
|
12073
|
-
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */
|
|
12129
|
+
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */ jsx24(
|
|
12074
12130
|
ModelPolicyPicker,
|
|
12075
12131
|
{
|
|
12076
12132
|
groupPresentation: modelPickerProps?.groupPresentation,
|
|
@@ -12083,6 +12139,9 @@ function Conversation({
|
|
|
12083
12139
|
error: catalog.error?.message,
|
|
12084
12140
|
disabled: terminal,
|
|
12085
12141
|
sessionKey: sessionId,
|
|
12142
|
+
onOpenChange: (open) => {
|
|
12143
|
+
if (open) void catalog.refresh();
|
|
12144
|
+
},
|
|
12086
12145
|
onModelChange: (model) => composer.setModel?.(model),
|
|
12087
12146
|
onEffortChange: (effort) => composer.setReasoningEffort?.(effort),
|
|
12088
12147
|
onLatencyModeChange: (mode) => composer.setLatencyMode?.(mode)
|
|
@@ -12124,17 +12183,17 @@ function useDefaultInteractiveBlock(client, workspaceId, sessionId) {
|
|
|
12124
12183
|
};
|
|
12125
12184
|
}, [client, sessionId]);
|
|
12126
12185
|
return useCallback5(
|
|
12127
|
-
(block) => /* @__PURE__ */
|
|
12186
|
+
(block) => /* @__PURE__ */ jsx24(Suspense6, { fallback: /* @__PURE__ */ jsx24("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx24(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
|
|
12128
12187
|
[scoped, workspaceId]
|
|
12129
12188
|
);
|
|
12130
12189
|
}
|
|
12131
12190
|
function useClientConfigFlags(client) {
|
|
12132
|
-
const [flags, setFlags] =
|
|
12191
|
+
const [flags, setFlags] = useState19({
|
|
12133
12192
|
uploads: false,
|
|
12134
12193
|
modelSelection: false,
|
|
12135
12194
|
sandboxFiles: false
|
|
12136
12195
|
});
|
|
12137
|
-
|
|
12196
|
+
useEffect14(() => {
|
|
12138
12197
|
let live = true;
|
|
12139
12198
|
client.getClientConfig().then(
|
|
12140
12199
|
(config) => {
|
|
@@ -12157,7 +12216,7 @@ function useClientConfigFlags(client) {
|
|
|
12157
12216
|
}
|
|
12158
12217
|
|
|
12159
12218
|
// src/hooks/use-workspace-sessions.ts
|
|
12160
|
-
import { useCallback as useCallback6, useEffect as
|
|
12219
|
+
import { useCallback as useCallback6, useEffect as useEffect15, useRef as useRef12 } from "react";
|
|
12161
12220
|
function useWorkspaceSessions(options = {}) {
|
|
12162
12221
|
const { client, workspaceId } = useOpenGeni(options);
|
|
12163
12222
|
const projection = options.projection;
|
|
@@ -12193,7 +12252,7 @@ function useWorkspaceSessions(options = {}) {
|
|
|
12193
12252
|
].join("\0");
|
|
12194
12253
|
const previousQueryKey = useRef12(queryKey);
|
|
12195
12254
|
const queryKeyTransition = previousQueryKey.current !== queryKey;
|
|
12196
|
-
|
|
12255
|
+
useEffect15(() => {
|
|
12197
12256
|
previousQueryKey.current = queryKey;
|
|
12198
12257
|
}, [queryKey]);
|
|
12199
12258
|
const load = useCallback6(
|
|
@@ -12278,8 +12337,8 @@ function useWorkspaceSessions(options = {}) {
|
|
|
12278
12337
|
// src/components/session-list.tsx
|
|
12279
12338
|
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
12280
12339
|
import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
|
|
12281
|
-
import { useEffect as
|
|
12282
|
-
import { jsx as
|
|
12340
|
+
import { useEffect as useEffect16, useRef as useRef13, useState as useState20 } from "react";
|
|
12341
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
12283
12342
|
var DEFAULT_LABELS = {
|
|
12284
12343
|
heading: "Chats",
|
|
12285
12344
|
newChat: "New chat",
|
|
@@ -12308,7 +12367,7 @@ function SessionList({
|
|
|
12308
12367
|
const labels = { ...DEFAULT_LABELS, ...labelOverrides };
|
|
12309
12368
|
const scope = { client, workspaceId };
|
|
12310
12369
|
const context = useOpenGeni(scope);
|
|
12311
|
-
const [limit, setLimit] =
|
|
12370
|
+
const [limit, setLimit] = useState20(pageSize);
|
|
12312
12371
|
const list = useWorkspaceSessions({
|
|
12313
12372
|
...scope,
|
|
12314
12373
|
parentSessionId: null,
|
|
@@ -12318,14 +12377,14 @@ function SessionList({
|
|
|
12318
12377
|
});
|
|
12319
12378
|
const refresh = list.refresh;
|
|
12320
12379
|
const firstRefreshKey = useRef13(refreshKey);
|
|
12321
|
-
|
|
12380
|
+
useEffect16(() => {
|
|
12322
12381
|
if (Object.is(refreshKey, firstRefreshKey.current)) return;
|
|
12323
12382
|
firstRefreshKey.current = refreshKey;
|
|
12324
12383
|
void refresh();
|
|
12325
12384
|
}, [refresh, refreshKey]);
|
|
12326
|
-
const [editing, setEditing] =
|
|
12327
|
-
const [busy, setBusy] =
|
|
12328
|
-
const [error, setError] =
|
|
12385
|
+
const [editing, setEditing] = useState20(null);
|
|
12386
|
+
const [busy, setBusy] = useState20(null);
|
|
12387
|
+
const [error, setError] = useState20(null);
|
|
12329
12388
|
const formatError = useErrorMessage();
|
|
12330
12389
|
const archiveClient = context.client;
|
|
12331
12390
|
const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
|
|
@@ -12360,16 +12419,16 @@ function SessionList({
|
|
|
12360
12419
|
onArchived?.(session.id);
|
|
12361
12420
|
});
|
|
12362
12421
|
const sessions = list.sessions;
|
|
12363
|
-
return /* @__PURE__ */
|
|
12422
|
+
return /* @__PURE__ */ jsxs19(
|
|
12364
12423
|
"nav",
|
|
12365
12424
|
{
|
|
12366
12425
|
className: cn("flex min-h-0 min-w-0 flex-col gap-1 text-og-fg", className),
|
|
12367
12426
|
"aria-label": labels.heading,
|
|
12368
12427
|
"data-og-session-list": "",
|
|
12369
12428
|
children: [
|
|
12370
|
-
/* @__PURE__ */
|
|
12371
|
-
/* @__PURE__ */
|
|
12372
|
-
onNewChat ? /* @__PURE__ */
|
|
12429
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
|
|
12430
|
+
/* @__PURE__ */ jsx25("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
|
|
12431
|
+
onNewChat ? /* @__PURE__ */ jsxs19(
|
|
12373
12432
|
"button",
|
|
12374
12433
|
{
|
|
12375
12434
|
type: "button",
|
|
@@ -12377,22 +12436,22 @@ function SessionList({
|
|
|
12377
12436
|
className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-og-control text-og-fg hover:bg-og-surface-2",
|
|
12378
12437
|
"data-og-new-chat": "",
|
|
12379
12438
|
children: [
|
|
12380
|
-
/* @__PURE__ */
|
|
12439
|
+
/* @__PURE__ */ jsx25(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
12381
12440
|
labels.newChat
|
|
12382
12441
|
]
|
|
12383
12442
|
}
|
|
12384
12443
|
) : null
|
|
12385
12444
|
] }),
|
|
12386
|
-
error || list.error ? /* @__PURE__ */
|
|
12387
|
-
/* @__PURE__ */
|
|
12388
|
-
list.loading && sessions.length === 0 ? /* @__PURE__ */
|
|
12389
|
-
!list.loading && !list.error && sessions.length === 0 ? /* @__PURE__ */
|
|
12445
|
+
error || list.error ? /* @__PURE__ */ jsx25("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: formatError(error ? error.cause : list.error) }) : null,
|
|
12446
|
+
/* @__PURE__ */ jsxs19("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
|
|
12447
|
+
list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx25("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
|
|
12448
|
+
!list.loading && !list.error && sessions.length === 0 ? /* @__PURE__ */ jsx25("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
|
|
12390
12449
|
sessions.map((session) => {
|
|
12391
12450
|
const selected = session.id === selectedSessionId;
|
|
12392
12451
|
const title = deriveSessionDisplayTitle(session);
|
|
12393
12452
|
if (editing?.id === session.id) {
|
|
12394
|
-
return /* @__PURE__ */
|
|
12395
|
-
/* @__PURE__ */
|
|
12453
|
+
return /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsxs19("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
|
|
12454
|
+
/* @__PURE__ */ jsx25(
|
|
12396
12455
|
"input",
|
|
12397
12456
|
{
|
|
12398
12457
|
"aria-label": labels.rename,
|
|
@@ -12406,7 +12465,7 @@ function SessionList({
|
|
|
12406
12465
|
className: "min-w-0 flex-1 rounded-md border border-og-border bg-og-bg px-2 py-1 text-og-sm text-og-fg"
|
|
12407
12466
|
}
|
|
12408
12467
|
),
|
|
12409
|
-
/* @__PURE__ */
|
|
12468
|
+
/* @__PURE__ */ jsx25(
|
|
12410
12469
|
"button",
|
|
12411
12470
|
{
|
|
12412
12471
|
type: "submit",
|
|
@@ -12416,8 +12475,8 @@ function SessionList({
|
|
|
12416
12475
|
)
|
|
12417
12476
|
] }) }, session.id);
|
|
12418
12477
|
}
|
|
12419
|
-
return /* @__PURE__ */
|
|
12420
|
-
/* @__PURE__ */
|
|
12478
|
+
return /* @__PURE__ */ jsxs19("li", { className: "group relative", children: [
|
|
12479
|
+
/* @__PURE__ */ jsxs19(
|
|
12421
12480
|
"button",
|
|
12422
12481
|
{
|
|
12423
12482
|
type: "button",
|
|
@@ -12430,36 +12489,36 @@ function SessionList({
|
|
|
12430
12489
|
),
|
|
12431
12490
|
"data-og-session-row": "",
|
|
12432
12491
|
children: [
|
|
12433
|
-
/* @__PURE__ */
|
|
12434
|
-
/* @__PURE__ */
|
|
12492
|
+
/* @__PURE__ */ jsx25("span", { className: "w-full truncate pr-12 text-og-sm text-og-fg", children: title }),
|
|
12493
|
+
/* @__PURE__ */ jsx25("span", { className: "text-og-xs text-og-fg-subtle", children: formatRelativeTime(session.updatedAt) })
|
|
12435
12494
|
]
|
|
12436
12495
|
}
|
|
12437
12496
|
),
|
|
12438
|
-
/* @__PURE__ */
|
|
12439
|
-
rename ? /* @__PURE__ */
|
|
12497
|
+
/* @__PURE__ */ jsxs19("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex", children: [
|
|
12498
|
+
rename ? /* @__PURE__ */ jsx25(
|
|
12440
12499
|
"button",
|
|
12441
12500
|
{
|
|
12442
12501
|
type: "button",
|
|
12443
12502
|
"aria-label": `${labels.rename}: ${title}`,
|
|
12444
12503
|
onClick: () => setEditing({ id: session.id, title: session.title ?? title }),
|
|
12445
12504
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
12446
|
-
children: /* @__PURE__ */
|
|
12505
|
+
children: /* @__PURE__ */ jsx25(PencilIcon2, { className: "size-3.5", "aria-hidden": true })
|
|
12447
12506
|
}
|
|
12448
12507
|
) : null,
|
|
12449
|
-
canArchive ? /* @__PURE__ */
|
|
12508
|
+
canArchive ? /* @__PURE__ */ jsx25(
|
|
12450
12509
|
"button",
|
|
12451
12510
|
{
|
|
12452
12511
|
type: "button",
|
|
12453
12512
|
"aria-label": `${labels.archive}: ${title}`,
|
|
12454
12513
|
onClick: () => archiveSession(session),
|
|
12455
12514
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
12456
|
-
children: /* @__PURE__ */
|
|
12515
|
+
children: /* @__PURE__ */ jsx25(ArchiveIcon, { className: "size-3.5", "aria-hidden": true })
|
|
12457
12516
|
}
|
|
12458
12517
|
) : null
|
|
12459
12518
|
] })
|
|
12460
12519
|
] }, session.id);
|
|
12461
12520
|
}),
|
|
12462
|
-
list.nextCursor ? /* @__PURE__ */
|
|
12521
|
+
list.nextCursor ? /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsx25(
|
|
12463
12522
|
"button",
|
|
12464
12523
|
{
|
|
12465
12524
|
type: "button",
|
|
@@ -12476,8 +12535,8 @@ function SessionList({
|
|
|
12476
12535
|
|
|
12477
12536
|
// src/components/open-geni-chat.tsx
|
|
12478
12537
|
import { ArrowUpIcon as ArrowUpIcon3, LoaderCircleIcon, MenuIcon, XIcon as XIcon3 } from "lucide-react";
|
|
12479
|
-
import { useCallback as useCallback7, useRef as useRef14, useState as
|
|
12480
|
-
import { jsx as
|
|
12538
|
+
import { useCallback as useCallback7, useRef as useRef14, useState as useState21 } from "react";
|
|
12539
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12481
12540
|
var DEFAULT_LABELS2 = {
|
|
12482
12541
|
openChats: "Open chats",
|
|
12483
12542
|
closeChats: "Close chats",
|
|
@@ -12487,9 +12546,9 @@ var DEFAULT_LABELS2 = {
|
|
|
12487
12546
|
newChatUnavailable: "New chats are not enabled for this product."
|
|
12488
12547
|
};
|
|
12489
12548
|
function OpenGeniChat({ baseUrl, ...props }) {
|
|
12490
|
-
if (baseUrl === void 0) return /* @__PURE__ */
|
|
12549
|
+
if (baseUrl === void 0) return /* @__PURE__ */ jsx26(Chat, { ...props });
|
|
12491
12550
|
const { client: _client, workspaceId, ...rest } = props;
|
|
12492
|
-
return /* @__PURE__ */
|
|
12551
|
+
return /* @__PURE__ */ jsx26(SessionProxyScope, { baseUrl, workspaceId, children: /* @__PURE__ */ jsx26(Chat, { ...rest }) });
|
|
12493
12552
|
}
|
|
12494
12553
|
function Chat({
|
|
12495
12554
|
client,
|
|
@@ -12510,10 +12569,10 @@ function Chat({
|
|
|
12510
12569
|
const labels = { ...DEFAULT_LABELS2, ...labelOverrides };
|
|
12511
12570
|
const scope = { client, workspaceId };
|
|
12512
12571
|
const context = useOpenGeni(scope);
|
|
12513
|
-
const [uncontrolled, setUncontrolled] =
|
|
12572
|
+
const [uncontrolled, setUncontrolled] = useState21(defaultSessionId);
|
|
12514
12573
|
const selected = controlledSessionId !== void 0 ? controlledSessionId : uncontrolled;
|
|
12515
|
-
const [drawerOpen, setDrawerOpen] =
|
|
12516
|
-
const [listRevision, setListRevision] =
|
|
12574
|
+
const [drawerOpen, setDrawerOpen] = useState21(false);
|
|
12575
|
+
const [listRevision, setListRevision] = useState21(0);
|
|
12517
12576
|
const root = useRef14(null);
|
|
12518
12577
|
const hostTheme = useHostTheme(root, { theme, surface });
|
|
12519
12578
|
const select = useCallback7(
|
|
@@ -12537,7 +12596,7 @@ function Chat({
|
|
|
12537
12596
|
},
|
|
12538
12597
|
[context.client, context.workspaceId, createSession, labels.newChatUnavailable]
|
|
12539
12598
|
);
|
|
12540
|
-
const list = /* @__PURE__ */
|
|
12599
|
+
const list = /* @__PURE__ */ jsx26(
|
|
12541
12600
|
SessionList,
|
|
12542
12601
|
{
|
|
12543
12602
|
...scope,
|
|
@@ -12553,7 +12612,7 @@ function Chat({
|
|
|
12553
12612
|
className: "h-full"
|
|
12554
12613
|
}
|
|
12555
12614
|
);
|
|
12556
|
-
return /* @__PURE__ */
|
|
12615
|
+
return /* @__PURE__ */ jsxs20(
|
|
12557
12616
|
"div",
|
|
12558
12617
|
{
|
|
12559
12618
|
ref: root,
|
|
@@ -12566,7 +12625,7 @@ function Chat({
|
|
|
12566
12625
|
"data-og-host-theme": "",
|
|
12567
12626
|
"data-og-chat": "",
|
|
12568
12627
|
children: [
|
|
12569
|
-
/* @__PURE__ */
|
|
12628
|
+
/* @__PURE__ */ jsx26(
|
|
12570
12629
|
"aside",
|
|
12571
12630
|
{
|
|
12572
12631
|
className: "og-chat-sidebar min-h-0 w-64 shrink-0 flex-col border-r border-og-border",
|
|
@@ -12574,21 +12633,21 @@ function Chat({
|
|
|
12574
12633
|
children: list
|
|
12575
12634
|
}
|
|
12576
12635
|
),
|
|
12577
|
-
drawerOpen ? /* @__PURE__ */
|
|
12578
|
-
/* @__PURE__ */
|
|
12579
|
-
/* @__PURE__ */
|
|
12636
|
+
drawerOpen ? /* @__PURE__ */ jsxs20("div", { className: "og-chat-drawer absolute inset-0 z-30 flex", "data-og-chat-drawer": "", children: [
|
|
12637
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-og-lg", children: [
|
|
12638
|
+
/* @__PURE__ */ jsx26("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx26(
|
|
12580
12639
|
"button",
|
|
12581
12640
|
{
|
|
12582
12641
|
type: "button",
|
|
12583
12642
|
"aria-label": labels.closeChats,
|
|
12584
12643
|
onClick: () => setDrawerOpen(false),
|
|
12585
12644
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
12586
|
-
children: /* @__PURE__ */
|
|
12645
|
+
children: /* @__PURE__ */ jsx26(XIcon3, { className: "size-4", "aria-hidden": true })
|
|
12587
12646
|
}
|
|
12588
12647
|
) }),
|
|
12589
|
-
/* @__PURE__ */
|
|
12648
|
+
/* @__PURE__ */ jsx26("div", { className: "min-h-0 flex-1", children: list })
|
|
12590
12649
|
] }),
|
|
12591
|
-
/* @__PURE__ */
|
|
12650
|
+
/* @__PURE__ */ jsx26(
|
|
12592
12651
|
"button",
|
|
12593
12652
|
{
|
|
12594
12653
|
type: "button",
|
|
@@ -12598,9 +12657,9 @@ function Chat({
|
|
|
12598
12657
|
}
|
|
12599
12658
|
)
|
|
12600
12659
|
] }) : null,
|
|
12601
|
-
/* @__PURE__ */
|
|
12602
|
-
/* @__PURE__ */
|
|
12603
|
-
/* @__PURE__ */
|
|
12660
|
+
/* @__PURE__ */ jsxs20("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
12661
|
+
/* @__PURE__ */ jsxs20("div", { className: "og-chat-menu flex items-center gap-2 px-2 py-1", children: [
|
|
12662
|
+
/* @__PURE__ */ jsx26(
|
|
12604
12663
|
"button",
|
|
12605
12664
|
{
|
|
12606
12665
|
type: "button",
|
|
@@ -12609,12 +12668,12 @@ function Chat({
|
|
|
12609
12668
|
onClick: () => setDrawerOpen(true),
|
|
12610
12669
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
12611
12670
|
"data-og-chat-menu": "",
|
|
12612
|
-
children: /* @__PURE__ */
|
|
12671
|
+
children: /* @__PURE__ */ jsx26(MenuIcon, { className: "size-4", "aria-hidden": true })
|
|
12613
12672
|
}
|
|
12614
12673
|
),
|
|
12615
|
-
/* @__PURE__ */
|
|
12674
|
+
/* @__PURE__ */ jsx26("span", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading })
|
|
12616
12675
|
] }),
|
|
12617
|
-
/* @__PURE__ */
|
|
12676
|
+
/* @__PURE__ */ jsx26("div", { className: "og-chat-main min-h-0 flex-1 px-3 pb-3 pt-1", children: selected ? /* @__PURE__ */ jsx26(
|
|
12618
12677
|
SessionConversation,
|
|
12619
12678
|
{
|
|
12620
12679
|
...conversationProps,
|
|
@@ -12622,7 +12681,7 @@ function Chat({
|
|
|
12622
12681
|
sessionId: selected,
|
|
12623
12682
|
height: "100%"
|
|
12624
12683
|
}
|
|
12625
|
-
) : /* @__PURE__ */
|
|
12684
|
+
) : /* @__PURE__ */ jsx26(
|
|
12626
12685
|
NewChat,
|
|
12627
12686
|
{
|
|
12628
12687
|
labels,
|
|
@@ -12643,9 +12702,9 @@ function NewChat({
|
|
|
12643
12702
|
create,
|
|
12644
12703
|
onCreated
|
|
12645
12704
|
}) {
|
|
12646
|
-
const [text, setText] =
|
|
12647
|
-
const [sending, setSending] =
|
|
12648
|
-
const [error, setError] =
|
|
12705
|
+
const [text, setText] = useState21("");
|
|
12706
|
+
const [sending, setSending] = useState21(false);
|
|
12707
|
+
const [error, setError] = useState21(null);
|
|
12649
12708
|
const formatError = useErrorMessage();
|
|
12650
12709
|
const idempotencyKey = useRef14(crypto.randomUUID());
|
|
12651
12710
|
const submit = async (event) => {
|
|
@@ -12665,16 +12724,16 @@ function NewChat({
|
|
|
12665
12724
|
setSending(false);
|
|
12666
12725
|
}
|
|
12667
12726
|
};
|
|
12668
|
-
return /* @__PURE__ */
|
|
12727
|
+
return /* @__PURE__ */ jsxs20(
|
|
12669
12728
|
"form",
|
|
12670
12729
|
{
|
|
12671
12730
|
onSubmit: (event) => void submit(event),
|
|
12672
12731
|
className: "mx-auto box-border flex h-full w-full max-w-3xl flex-col gap-4 p-3",
|
|
12673
12732
|
"data-og-new-chat-composer": "",
|
|
12674
12733
|
children: [
|
|
12675
|
-
/* @__PURE__ */
|
|
12676
|
-
labels.newChatTitle ? /* @__PURE__ */
|
|
12677
|
-
/* @__PURE__ */
|
|
12734
|
+
/* @__PURE__ */ jsx26("div", { "aria-hidden": true, className: "min-h-0 flex-[2]" }),
|
|
12735
|
+
labels.newChatTitle ? /* @__PURE__ */ jsx26("p", { className: "text-center text-og-md font-medium text-og-fg", children: labels.newChatTitle }) : null,
|
|
12736
|
+
/* @__PURE__ */ jsxs20(
|
|
12678
12737
|
"div",
|
|
12679
12738
|
{
|
|
12680
12739
|
className: cn(
|
|
@@ -12683,7 +12742,7 @@ function NewChat({
|
|
|
12683
12742
|
"focus-within:border-og-accent/50 focus-within:shadow-og-glow"
|
|
12684
12743
|
),
|
|
12685
12744
|
children: [
|
|
12686
|
-
/* @__PURE__ */
|
|
12745
|
+
/* @__PURE__ */ jsx26(
|
|
12687
12746
|
"textarea",
|
|
12688
12747
|
{
|
|
12689
12748
|
value: text,
|
|
@@ -12701,7 +12760,7 @@ function NewChat({
|
|
|
12701
12760
|
className: "min-h-12 flex-1 resize-none bg-transparent py-1 text-og-composer text-og-fg outline-hidden placeholder:text-og-fg-subtle md:text-og-composer-wide"
|
|
12702
12761
|
}
|
|
12703
12762
|
),
|
|
12704
|
-
/* @__PURE__ */
|
|
12763
|
+
/* @__PURE__ */ jsx26(
|
|
12705
12764
|
"button",
|
|
12706
12765
|
{
|
|
12707
12766
|
type: "submit",
|
|
@@ -12713,17 +12772,17 @@ function NewChat({
|
|
|
12713
12772
|
"transition-[background-color,transform,opacity] duration-150 ease-og-spring",
|
|
12714
12773
|
"hover:bg-og-primary-hover active:scale-95 disabled:cursor-not-allowed disabled:opacity-50"
|
|
12715
12774
|
),
|
|
12716
|
-
children: sending ? /* @__PURE__ */
|
|
12775
|
+
children: sending ? /* @__PURE__ */ jsx26(LoaderCircleIcon, { className: "size-4 animate-og-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx26(ArrowUpIcon3, { className: "size-4", "aria-hidden": true })
|
|
12717
12776
|
}
|
|
12718
12777
|
)
|
|
12719
12778
|
]
|
|
12720
12779
|
}
|
|
12721
12780
|
),
|
|
12722
|
-
error ? /* @__PURE__ */
|
|
12781
|
+
error ? /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-center text-og-sm text-og-status-failed", children: formatError(
|
|
12723
12782
|
error.cause,
|
|
12724
12783
|
error.cause instanceof Error && error.cause.message === labels.newChatUnavailable ? labels.newChatUnavailable : void 0
|
|
12725
12784
|
) }) : null,
|
|
12726
|
-
/* @__PURE__ */
|
|
12785
|
+
/* @__PURE__ */ jsx26("div", { "aria-hidden": true, className: "min-h-0 flex-[3]" })
|
|
12727
12786
|
]
|
|
12728
12787
|
}
|
|
12729
12788
|
);
|
|
@@ -12731,15 +12790,15 @@ function NewChat({
|
|
|
12731
12790
|
|
|
12732
12791
|
// src/components/session-commands-panel.tsx
|
|
12733
12792
|
import { ChevronRightIcon as ChevronRightIcon3, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
|
|
12734
|
-
import { useState as
|
|
12735
|
-
import { jsx as
|
|
12793
|
+
import { useState as useState22 } from "react";
|
|
12794
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
12736
12795
|
function SessionCommandsPanel({
|
|
12737
12796
|
commands: state,
|
|
12738
12797
|
readOnly = false
|
|
12739
12798
|
}) {
|
|
12740
12799
|
const formatError = useErrorMessage();
|
|
12741
|
-
const [pending, setPending] =
|
|
12742
|
-
const [error, setError] =
|
|
12800
|
+
const [pending, setPending] = useState22(null);
|
|
12801
|
+
const [error, setError] = useState22(null);
|
|
12743
12802
|
const active = state.commands.filter(
|
|
12744
12803
|
(command) => command.state === "running" || command.state === "stopping"
|
|
12745
12804
|
);
|
|
@@ -12754,11 +12813,11 @@ function SessionCommandsPanel({
|
|
|
12754
12813
|
setPending(null);
|
|
12755
12814
|
}
|
|
12756
12815
|
};
|
|
12757
|
-
return /* @__PURE__ */
|
|
12758
|
-
state.loading && active.length === 0 ? /* @__PURE__ */
|
|
12759
|
-
state.error ? /* @__PURE__ */
|
|
12760
|
-
/* @__PURE__ */
|
|
12761
|
-
/* @__PURE__ */
|
|
12816
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
|
|
12817
|
+
state.loading && active.length === 0 ? /* @__PURE__ */ jsx27("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
|
|
12818
|
+
state.error ? /* @__PURE__ */ jsxs21("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
|
|
12819
|
+
/* @__PURE__ */ jsx27("span", { children: "Commands unavailable." }),
|
|
12820
|
+
/* @__PURE__ */ jsx27(
|
|
12762
12821
|
"button",
|
|
12763
12822
|
{
|
|
12764
12823
|
type: "button",
|
|
@@ -12768,18 +12827,18 @@ function SessionCommandsPanel({
|
|
|
12768
12827
|
}
|
|
12769
12828
|
)
|
|
12770
12829
|
] }) : null,
|
|
12771
|
-
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */
|
|
12772
|
-
active.length > 0 ? /* @__PURE__ */
|
|
12773
|
-
/* @__PURE__ */
|
|
12774
|
-
/* @__PURE__ */
|
|
12775
|
-
/* @__PURE__ */
|
|
12830
|
+
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx27("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
|
|
12831
|
+
active.length > 0 ? /* @__PURE__ */ jsx27("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs21("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
|
|
12832
|
+
/* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
|
|
12833
|
+
/* @__PURE__ */ jsxs21("details", { className: "group/command", children: [
|
|
12834
|
+
/* @__PURE__ */ jsxs21(
|
|
12776
12835
|
"summary",
|
|
12777
12836
|
{
|
|
12778
12837
|
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",
|
|
12779
12838
|
title: "Expand command",
|
|
12780
12839
|
children: [
|
|
12781
|
-
/* @__PURE__ */
|
|
12782
|
-
/* @__PURE__ */
|
|
12840
|
+
/* @__PURE__ */ jsx27(ChevronRightIcon3, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
|
|
12841
|
+
/* @__PURE__ */ jsx27(
|
|
12783
12842
|
"span",
|
|
12784
12843
|
{
|
|
12785
12844
|
className: "min-w-0 truncate",
|
|
@@ -12790,9 +12849,9 @@ function SessionCommandsPanel({
|
|
|
12790
12849
|
]
|
|
12791
12850
|
}
|
|
12792
12851
|
),
|
|
12793
|
-
/* @__PURE__ */
|
|
12794
|
-
/* @__PURE__ */
|
|
12795
|
-
/* @__PURE__ */
|
|
12852
|
+
/* @__PURE__ */ jsxs21("div", { className: "mt-2 space-y-1", children: [
|
|
12853
|
+
/* @__PURE__ */ jsx27("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
|
|
12854
|
+
/* @__PURE__ */ jsxs21(
|
|
12796
12855
|
"time",
|
|
12797
12856
|
{
|
|
12798
12857
|
className: "block text-og-fg-subtle",
|
|
@@ -12806,9 +12865,9 @@ function SessionCommandsPanel({
|
|
|
12806
12865
|
)
|
|
12807
12866
|
] })
|
|
12808
12867
|
] }),
|
|
12809
|
-
/* @__PURE__ */
|
|
12868
|
+
/* @__PURE__ */ jsx27("p", { className: "mt-1 text-og-fg-subtle", children: command.observationStatus === "unavailable" ? command.state === "stopping" ? "Stop requested \xB7 status unavailable" : "Command status unavailable" : command.state === "stopping" ? "Stopping\u2026" : "Running" })
|
|
12810
12869
|
] }),
|
|
12811
|
-
!readOnly ? /* @__PURE__ */
|
|
12870
|
+
!readOnly ? /* @__PURE__ */ jsxs21(
|
|
12812
12871
|
"button",
|
|
12813
12872
|
{
|
|
12814
12873
|
type: "button",
|
|
@@ -12817,18 +12876,18 @@ function SessionCommandsPanel({
|
|
|
12817
12876
|
onClick: () => void stop(command.id),
|
|
12818
12877
|
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",
|
|
12819
12878
|
children: [
|
|
12820
|
-
pending === command.id || command.state === "stopping" ? /* @__PURE__ */
|
|
12879
|
+
pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx27(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx27(SquareIcon, { className: "size-3" }),
|
|
12821
12880
|
"Stop"
|
|
12822
12881
|
]
|
|
12823
12882
|
}
|
|
12824
12883
|
) : null
|
|
12825
12884
|
] }, command.id)) }) : null,
|
|
12826
|
-
error ? /* @__PURE__ */
|
|
12885
|
+
error ? /* @__PURE__ */ jsx27("p", { role: "alert", className: "text-og-danger", children: error }) : null
|
|
12827
12886
|
] });
|
|
12828
12887
|
}
|
|
12829
12888
|
|
|
12830
12889
|
// src/hooks/use-session-background-commands.ts
|
|
12831
|
-
import { useCallback as useCallback8, useEffect as
|
|
12890
|
+
import { useCallback as useCallback8, useEffect as useEffect17, useRef as useRef15 } from "react";
|
|
12832
12891
|
function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
12833
12892
|
const { client, workspaceId } = useOpenGeni(options);
|
|
12834
12893
|
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
@@ -12848,7 +12907,7 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
12848
12907
|
});
|
|
12849
12908
|
const refresh = state.refresh;
|
|
12850
12909
|
const generation = useRef15(0);
|
|
12851
|
-
|
|
12910
|
+
useEffect17(() => {
|
|
12852
12911
|
generation.current += 1;
|
|
12853
12912
|
return () => {
|
|
12854
12913
|
generation.current += 1;
|
|
@@ -12876,7 +12935,7 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
12876
12935
|
}
|
|
12877
12936
|
|
|
12878
12937
|
// src/components/session-commands.tsx
|
|
12879
|
-
import { jsx as
|
|
12938
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
12880
12939
|
function SessionCommands({
|
|
12881
12940
|
sessionId,
|
|
12882
12941
|
readOnly = false,
|
|
@@ -12886,11 +12945,11 @@ function SessionCommands({
|
|
|
12886
12945
|
pollIntervalMs: 3e3,
|
|
12887
12946
|
...options
|
|
12888
12947
|
});
|
|
12889
|
-
return /* @__PURE__ */
|
|
12948
|
+
return /* @__PURE__ */ jsx28(SessionCommandsPanel, { commands, readOnly });
|
|
12890
12949
|
}
|
|
12891
12950
|
|
|
12892
12951
|
// src/timeline/startup-timings.tsx
|
|
12893
|
-
import { jsx as
|
|
12952
|
+
import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
12894
12953
|
var LABELS = {
|
|
12895
12954
|
queue: "Worker queue",
|
|
12896
12955
|
sandbox: "Sandbox",
|
|
@@ -12903,7 +12962,7 @@ var LABELS = {
|
|
|
12903
12962
|
};
|
|
12904
12963
|
function StartupTimings({ phases }) {
|
|
12905
12964
|
if (!phases.length)
|
|
12906
|
-
return /* @__PURE__ */
|
|
12965
|
+
return /* @__PURE__ */ jsx29("p", { className: "text-og-sm text-og-fg-subtle", children: "No startup timings recorded yet." });
|
|
12907
12966
|
const byTurn = /* @__PURE__ */ new Map();
|
|
12908
12967
|
for (const phase of phases) {
|
|
12909
12968
|
const group = byTurn.get(phase.turnId) ?? [];
|
|
@@ -12918,9 +12977,9 @@ function StartupTimings({ phases }) {
|
|
|
12918
12977
|
turnPhases[0].startedAt
|
|
12919
12978
|
)
|
|
12920
12979
|
})).sort((a, b) => b.startedAt.localeCompare(a.startedAt));
|
|
12921
|
-
return /* @__PURE__ */
|
|
12922
|
-
/* @__PURE__ */
|
|
12923
|
-
turns.map((turn, index) => /* @__PURE__ */
|
|
12980
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
|
|
12981
|
+
/* @__PURE__ */ jsx29("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
|
|
12982
|
+
turns.map((turn, index) => /* @__PURE__ */ jsx29(
|
|
12924
12983
|
StartupTurn,
|
|
12925
12984
|
{
|
|
12926
12985
|
...turn,
|
|
@@ -12937,53 +12996,53 @@ function StartupTurn({
|
|
|
12937
12996
|
latest
|
|
12938
12997
|
}) {
|
|
12939
12998
|
const status = phases.some((phase) => phase.status === "failed") ? "Failed" : phases.some((phase) => phase.status === "running") ? "In progress" : phases.some((phase) => phase.status === "cancelled") ? "Interrupted" : "Ready";
|
|
12940
|
-
return /* @__PURE__ */
|
|
12941
|
-
/* @__PURE__ */
|
|
12942
|
-
/* @__PURE__ */
|
|
12943
|
-
/* @__PURE__ */
|
|
12999
|
+
return /* @__PURE__ */ jsxs22("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
|
|
13000
|
+
/* @__PURE__ */ jsxs22("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
|
|
13001
|
+
/* @__PURE__ */ jsx29("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
|
|
13002
|
+
/* @__PURE__ */ jsx29("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
|
|
12944
13003
|
hour: "2-digit",
|
|
12945
13004
|
minute: "2-digit",
|
|
12946
13005
|
second: "2-digit"
|
|
12947
13006
|
}) }),
|
|
12948
|
-
/* @__PURE__ */
|
|
13007
|
+
/* @__PURE__ */ jsx29(
|
|
12949
13008
|
"span",
|
|
12950
13009
|
{
|
|
12951
13010
|
className: status === "Failed" ? "ml-2 text-og-xs text-og-status-failed" : "ml-2 text-og-xs text-og-fg-subtle",
|
|
12952
13011
|
children: status
|
|
12953
13012
|
}
|
|
12954
13013
|
),
|
|
12955
|
-
/* @__PURE__ */
|
|
13014
|
+
/* @__PURE__ */ jsx29("span", { className: "mt-1 block break-all pl-4 font-og-mono text-og-xs text-og-fg-subtle", children: turnId ?? "No turn ID recorded" })
|
|
12956
13015
|
] }),
|
|
12957
|
-
/* @__PURE__ */
|
|
12958
|
-
/* @__PURE__ */
|
|
13016
|
+
/* @__PURE__ */ jsxs22("div", { className: "pb-2", children: [
|
|
13017
|
+
/* @__PURE__ */ jsxs22("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
12959
13018
|
"Started ",
|
|
12960
|
-
/* @__PURE__ */
|
|
13019
|
+
/* @__PURE__ */ jsx29("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
|
|
12961
13020
|
] }),
|
|
12962
|
-
/* @__PURE__ */
|
|
12963
|
-
/* @__PURE__ */
|
|
13021
|
+
/* @__PURE__ */ jsx29("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs22("table", { className: "w-full text-left text-og-xs", children: [
|
|
13022
|
+
/* @__PURE__ */ jsxs22("caption", { className: "sr-only", children: [
|
|
12964
13023
|
"Startup phases for ",
|
|
12965
13024
|
turnId ?? "unassigned events"
|
|
12966
13025
|
] }),
|
|
12967
|
-
/* @__PURE__ */
|
|
12968
|
-
/* @__PURE__ */
|
|
12969
|
-
/* @__PURE__ */
|
|
12970
|
-
/* @__PURE__ */
|
|
13026
|
+
/* @__PURE__ */ jsx29("thead", { children: /* @__PURE__ */ jsxs22("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
|
|
13027
|
+
/* @__PURE__ */ jsx29("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
|
|
13028
|
+
/* @__PURE__ */ jsx29("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
|
|
13029
|
+
/* @__PURE__ */ jsx29("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
|
|
12971
13030
|
] }) }),
|
|
12972
|
-
/* @__PURE__ */
|
|
13031
|
+
/* @__PURE__ */ jsx29("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs22(
|
|
12973
13032
|
"tr",
|
|
12974
13033
|
{
|
|
12975
13034
|
className: "border-b border-og-border/40",
|
|
12976
13035
|
title: `Turn: ${phase.turnId ?? "unknown"} \xB7 Started: ${phase.startedAt}`,
|
|
12977
13036
|
children: [
|
|
12978
|
-
/* @__PURE__ */
|
|
12979
|
-
/* @__PURE__ */
|
|
13037
|
+
/* @__PURE__ */ jsx29("th", { scope: "row", className: "py-2.5 font-normal text-og-fg-muted", children: LABELS[phase.phase] }),
|
|
13038
|
+
/* @__PURE__ */ jsx29(
|
|
12980
13039
|
"td",
|
|
12981
13040
|
{
|
|
12982
13041
|
className: `px-3 py-2.5 ${phase.status === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"}`,
|
|
12983
13042
|
children: phase.status === "running" ? "In progress" : phase.status
|
|
12984
13043
|
}
|
|
12985
13044
|
),
|
|
12986
|
-
/* @__PURE__ */
|
|
13045
|
+
/* @__PURE__ */ jsx29("td", { className: "py-2.5 text-right font-og-mono tabular-nums text-og-fg-muted", children: phase.durationMs === null ? "\u2014" : phase.durationMs < 1e3 ? `${Math.round(phase.durationMs)} ms` : `${(phase.durationMs / 1e3).toFixed(1)} s` })
|
|
12987
13046
|
]
|
|
12988
13047
|
},
|
|
12989
13048
|
phase.id
|
|
@@ -13052,4 +13111,4 @@ export {
|
|
|
13052
13111
|
SessionCommands,
|
|
13053
13112
|
StartupTimings
|
|
13054
13113
|
};
|
|
13055
|
-
//# sourceMappingURL=chunk-
|
|
13114
|
+
//# sourceMappingURL=chunk-4OTO7KBK.js.map
|