@opengeni/react 7.6.1-canary.37062299158001 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -19
- package/dist/{browser-viewer-63TXMINB.js → browser-viewer-5X47I6T2.js} +5 -6
- package/dist/{chunk-TKB4SB44.js → chunk-45GE35O7.js} +2 -10
- package/dist/chunk-45GE35O7.js.map +1 -0
- package/dist/{chunk-DOJWJQ3F.js → chunk-5EXGU7UF.js} +3 -3
- package/dist/{chunk-YN7I3STW.js → chunk-6NEZPF53.js} +32 -153
- package/dist/chunk-6NEZPF53.js.map +1 -0
- package/dist/{chunk-I7IWRQLN.js → chunk-BI57CQUV.js} +2 -2
- package/dist/{chunk-6ZSWSH4I.js → chunk-CHPKSLPN.js} +1 -3
- package/dist/chunk-CHPKSLPN.js.map +1 -0
- package/dist/{chunk-Q5QBEZIQ.js → chunk-DV2DBNPQ.js} +29 -48
- package/dist/chunk-DV2DBNPQ.js.map +1 -0
- package/dist/{chunk-RDKBXMWX.js → chunk-FGBCYQOT.js} +74 -120
- package/dist/chunk-FGBCYQOT.js.map +1 -0
- package/dist/{chunk-AAG4R3QN.js → chunk-KGENSZKS.js} +3 -4
- package/dist/chunk-KGENSZKS.js.map +1 -0
- package/dist/{chunk-YQEAA6LT.js → chunk-KZ73RL76.js} +3 -7
- package/dist/chunk-KZ73RL76.js.map +1 -0
- package/dist/{chunk-LFXYGZWK.js → chunk-LZ3KHA55.js} +60 -169
- package/dist/chunk-LZ3KHA55.js.map +1 -0
- package/dist/{chunk-2QUSQVF2.js → chunk-UINDK6C3.js} +3 -3
- package/dist/{chunk-UTRTG6LH.js → chunk-UJRYEWZI.js} +8 -48
- package/dist/chunk-UJRYEWZI.js.map +1 -0
- package/dist/{chunk-XOAMRDDK.js → chunk-VGIKFIO2.js} +3 -6
- package/dist/chunk-VGIKFIO2.js.map +1 -0
- package/dist/{chunk-ELCE5SXV.js → chunk-WZ55DVGK.js} +4 -8
- package/dist/chunk-WZ55DVGK.js.map +1 -0
- package/dist/{chunk-IQUCRAT7.js → chunk-XA6R7DJQ.js} +3 -3
- package/dist/{chunk-TOAH2BKA.js → chunk-YCGBREUV.js} +2 -6
- package/dist/{chunk-TOAH2BKA.js.map → chunk-YCGBREUV.js.map} +1 -1
- package/dist/{chunk-HNFCAQ5R.js → chunk-YRYF2GLG.js} +31 -39
- package/dist/chunk-YRYF2GLG.js.map +1 -0
- package/dist/{chunk-GISEVGS6.js → chunk-YSMMDOOE.js} +2 -10
- package/dist/chunk-YSMMDOOE.js.map +1 -0
- package/dist/{chunk-CWWKTNKK.js → chunk-Z3DISEQN.js} +18 -35
- package/dist/chunk-Z3DISEQN.js.map +1 -0
- package/dist/client.d.ts +1 -4
- package/dist/commands/types.d.ts +0 -2
- package/dist/components/approval-surface.d.ts +0 -15
- package/dist/composer.js +7 -8
- package/dist/{computer-viewer-X2MBRZY4.js → computer-viewer-7GF35SNY.js} +4 -5
- package/dist/connect.js +3 -3
- package/dist/hooks/use-browser-session.d.ts +0 -4
- package/dist/hooks/use-composer.d.ts +0 -2
- package/dist/hooks/use-computer-session.d.ts +0 -2
- package/dist/hooks/use-file-attachments.d.ts +0 -2
- package/dist/hooks/use-session-events.d.ts +1 -1
- package/dist/hooks/use-workspace-sessions.d.ts +5 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -28
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +5 -6
- package/dist/interaction.js.map +1 -1
- package/dist/{latest-question-CNEZ5KAN.js → latest-question-3BJGKQQ6.js} +3 -3
- package/dist/lib/format.d.ts +3 -27
- package/dist/lib/interaction-errors.d.ts +0 -3
- package/dist/machines.js +4 -5
- package/dist/{model-policy-picker-menu-JSA64TNN.js → model-policy-picker-menu-PUTA5JOB.js} +4 -4
- package/dist/model-policy.js +1 -1
- package/dist/provider.d.ts +1 -5
- package/dist/{queue-surface-implementation-HENWYFWA.js → queue-surface-implementation-2CAQAIHM.js} +2 -3
- package/dist/{queue-surface-implementation-HENWYFWA.js.map → queue-surface-implementation-2CAQAIHM.js.map} +1 -1
- package/dist/realtime.js +2 -2
- package/dist/{sandbox-files-BBC47SLD.js → sandbox-files-AEJTWGT4.js} +3 -4
- package/dist/session-ui.d.ts +1 -1
- package/dist/session-ui.js +12 -13
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +6 -7
- package/dist/usage.js +1 -2
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +1 -5
- package/src/commands/registry.ts +15 -18
- package/src/commands/types.ts +0 -2
- package/src/components/approval-surface.tsx +42 -166
- package/src/components/browser-viewer.tsx +9 -38
- package/src/components/composer.tsx +2 -9
- package/src/components/computer-viewer.tsx +30 -160
- package/src/components/generated-video-player.tsx +2 -4
- package/src/components/human-input-form.tsx +5 -18
- package/src/components/message-timeline.tsx +2 -4
- package/src/components/open-geni-chat.tsx +4 -11
- package/src/components/queue-surface-state.tsx +1 -3
- package/src/components/session-chrome.tsx +2 -5
- package/src/components/session-commands-panel.tsx +1 -3
- package/src/components/session-conversation.tsx +2 -4
- package/src/components/session-list.tsx +5 -7
- package/src/components/session-mcp-capability-card.tsx +1 -11
- package/src/hooks/internal.ts +2 -3
- package/src/hooks/use-browser-session.ts +79 -115
- package/src/hooks/use-composer.ts +31 -70
- package/src/hooks/use-computer-session.ts +6 -57
- package/src/hooks/use-file-attachments.ts +3 -16
- package/src/hooks/use-goal.ts +1 -2
- package/src/hooks/use-session-capabilities.ts +2 -3
- package/src/hooks/use-session-events.ts +8 -15
- package/src/hooks/use-slash-commands.ts +11 -6
- package/src/hooks/use-turn-queue.ts +1 -2
- package/src/hooks/use-workspace-sessions.ts +7 -40
- package/src/index.ts +2 -7
- package/src/interaction.ts +0 -1
- package/src/lib/format.ts +9 -73
- package/src/lib/interaction-errors.ts +0 -15
- package/src/model-policy.ts +0 -5
- package/src/provider.tsx +4 -12
- package/src/session-ui.ts +1 -1
- package/src/timeline/projection.ts +1 -12
- package/styles/compiled.css +0 -14
- package/dist/chunk-6ZSWSH4I.js.map +0 -1
- package/dist/chunk-AAG4R3QN.js.map +0 -1
- package/dist/chunk-CWWKTNKK.js.map +0 -1
- package/dist/chunk-ELCE5SXV.js.map +0 -1
- package/dist/chunk-GISEVGS6.js.map +0 -1
- package/dist/chunk-HNFCAQ5R.js.map +0 -1
- package/dist/chunk-LFXYGZWK.js.map +0 -1
- package/dist/chunk-Q5QBEZIQ.js.map +0 -1
- package/dist/chunk-RDKBXMWX.js.map +0 -1
- package/dist/chunk-TKB4SB44.js.map +0 -1
- package/dist/chunk-UGLEYEMP.js +0 -33
- package/dist/chunk-UGLEYEMP.js.map +0 -1
- package/dist/chunk-UTRTG6LH.js.map +0 -1
- package/dist/chunk-XOAMRDDK.js.map +0 -1
- package/dist/chunk-YN7I3STW.js.map +0 -1
- package/dist/chunk-YQEAA6LT.js.map +0 -1
- package/dist/lib/error-message.d.ts +0 -7
- package/src/lib/error-message.ts +0 -37
- /package/dist/{browser-viewer-63TXMINB.js.map → browser-viewer-5X47I6T2.js.map} +0 -0
- /package/dist/{chunk-DOJWJQ3F.js.map → chunk-5EXGU7UF.js.map} +0 -0
- /package/dist/{chunk-I7IWRQLN.js.map → chunk-BI57CQUV.js.map} +0 -0
- /package/dist/{chunk-2QUSQVF2.js.map → chunk-UINDK6C3.js.map} +0 -0
- /package/dist/{chunk-IQUCRAT7.js.map → chunk-XA6R7DJQ.js.map} +0 -0
- /package/dist/{computer-viewer-X2MBRZY4.js.map → computer-viewer-7GF35SNY.js.map} +0 -0
- /package/dist/{latest-question-CNEZ5KAN.js.map → latest-question-3BJGKQQ6.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-JSA64TNN.js.map → model-policy-picker-menu-PUTA5JOB.js.map} +0 -0
- /package/dist/{sandbox-files-BBC47SLD.js.map → sandbox-files-AEJTWGT4.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TimelineAnnotationsChip,
|
|
9
9
|
queueItemContent,
|
|
10
10
|
requestQueueDraftEdit
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YCGBREUV.js";
|
|
12
12
|
import {
|
|
13
13
|
TimelineAnnotationSourceRootContext
|
|
14
14
|
} from "./chunk-5QHL6BLH.js";
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
useSessionControl,
|
|
29
29
|
useSessionEvents,
|
|
30
30
|
useTurnQueue
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-Z3DISEQN.js";
|
|
32
32
|
import {
|
|
33
33
|
buildTimeline,
|
|
34
34
|
groupTimeline
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KGENSZKS.js";
|
|
36
36
|
import {
|
|
37
37
|
mcpToolLeaf,
|
|
38
38
|
toolDisplayName
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
useForcedDefaultOpen,
|
|
58
58
|
useTimelineSearchNavigation,
|
|
59
59
|
useTimelineSearchReveal
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-BI57CQUV.js";
|
|
61
61
|
import {
|
|
62
62
|
prefersReducedMotion
|
|
63
63
|
} from "./chunk-GIMRELBW.js";
|
|
@@ -95,10 +95,10 @@ import {
|
|
|
95
95
|
Status,
|
|
96
96
|
Surface,
|
|
97
97
|
useChatComposerController
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-YRYF2GLG.js";
|
|
99
99
|
import {
|
|
100
100
|
useComposer
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-DV2DBNPQ.js";
|
|
102
102
|
import {
|
|
103
103
|
LightboxProvider,
|
|
104
104
|
Tooltip,
|
|
@@ -108,11 +108,11 @@ import {
|
|
|
108
108
|
} from "./chunk-BRM6FVZA.js";
|
|
109
109
|
import {
|
|
110
110
|
ModelPolicyPicker
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-UINDK6C3.js";
|
|
112
112
|
import {
|
|
113
113
|
projectPickerRows,
|
|
114
114
|
sortPickerRows
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-CHPKSLPN.js";
|
|
116
116
|
import {
|
|
117
117
|
formatBytes,
|
|
118
118
|
formatClockTime,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
stringifyPayload,
|
|
121
121
|
truncate,
|
|
122
122
|
tryParseJson
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-UJRYEWZI.js";
|
|
124
124
|
import {
|
|
125
125
|
allowanceLabels,
|
|
126
126
|
allowanceResetSentence,
|
|
@@ -128,10 +128,7 @@ import {
|
|
|
128
128
|
} from "./chunk-B3V6TG77.js";
|
|
129
129
|
import {
|
|
130
130
|
usePolledValue
|
|
131
|
-
} from "./chunk-
|
|
132
|
-
import {
|
|
133
|
-
useErrorMessage
|
|
134
|
-
} from "./chunk-UGLEYEMP.js";
|
|
131
|
+
} from "./chunk-KZ73RL76.js";
|
|
135
132
|
import {
|
|
136
133
|
useOpenGeni,
|
|
137
134
|
useOpenGeniClient
|
|
@@ -144,8 +141,6 @@ import {
|
|
|
144
141
|
import { ChevronDownIcon, ChevronUpIcon, MessageCircleQuestionIcon } from "lucide-react";
|
|
145
142
|
import { useEffect, useId, useRef, useState } from "react";
|
|
146
143
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
147
|
-
var SkillReviewVerificationError = class extends Error {
|
|
148
|
-
};
|
|
149
144
|
var defaultHumanInputFormMessages = {
|
|
150
145
|
title: "Input required",
|
|
151
146
|
/** Multi-question chrome has no default subtitle; hosts may still override. */
|
|
@@ -191,7 +186,6 @@ function HumanInputRequestForm({
|
|
|
191
186
|
defaultCollapsed = false,
|
|
192
187
|
className
|
|
193
188
|
}) {
|
|
194
|
-
const formatError = useErrorMessage();
|
|
195
189
|
const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
|
|
196
190
|
const singleQuestion = request.questions.length === 1 ? request.questions[0] : null;
|
|
197
191
|
const resolvedTitle = title === void 0 ? singleQuestion ? singleQuestion.label ?? singleQuestion.prompt : messages.title : title;
|
|
@@ -236,14 +230,12 @@ function HumanInputRequestForm({
|
|
|
236
230
|
questions.map(async (question) => {
|
|
237
231
|
if (!loadSkillReview)
|
|
238
232
|
throw new Error(
|
|
239
|
-
"This client cannot preview Skill files.
|
|
233
|
+
"This client cannot preview Skill files. Open this request in Opengeni to review it."
|
|
240
234
|
);
|
|
241
235
|
const reference = question.reference;
|
|
242
236
|
const record = await loadSkillReview(reference);
|
|
243
237
|
if (record.id !== reference.skillId || record.revisionId !== reference.revisionId || (record.removalOperationId ?? void 0) !== reference.removalOperationId || !record.files.some((file) => file.path === "SKILL.md")) {
|
|
244
|
-
throw new
|
|
245
|
-
"The requested Skill revision could not be verified."
|
|
246
|
-
);
|
|
238
|
+
throw new Error("The requested Skill revision could not be verified.");
|
|
247
239
|
}
|
|
248
240
|
return [question.id, record];
|
|
249
241
|
})
|
|
@@ -261,16 +253,13 @@ function HumanInputRequestForm({
|
|
|
261
253
|
loader: loadSkillReview,
|
|
262
254
|
identity: reviewIdentity,
|
|
263
255
|
records: {},
|
|
264
|
-
error:
|
|
265
|
-
cause,
|
|
266
|
-
cause instanceof SkillReviewVerificationError ? cause.message : !loadSkillReview ? "This client cannot preview Skill files. Ask your administrator for a review-capable client." : void 0
|
|
267
|
-
)
|
|
256
|
+
error: cause instanceof Error ? cause.message : "Could not load the Skill files."
|
|
268
257
|
});
|
|
269
258
|
});
|
|
270
259
|
return () => {
|
|
271
260
|
current = false;
|
|
272
261
|
};
|
|
273
|
-
}, [loadSkillReview, reviewIdentity, reviewReload
|
|
262
|
+
}, [loadSkillReview, reviewIdentity, reviewReload]);
|
|
274
263
|
const visibleReviews = reviews?.loader === loadSkillReview && reviews?.identity === reviewIdentity ? reviews : null;
|
|
275
264
|
const preview = (question) => {
|
|
276
265
|
if (!question.skillReview) return null;
|
|
@@ -341,7 +330,7 @@ function HumanInputRequestForm({
|
|
|
341
330
|
await onSubmit(response);
|
|
342
331
|
} catch (cause) {
|
|
343
332
|
if (generation === submissionGeneration.current) {
|
|
344
|
-
setSubmissionError(
|
|
333
|
+
setSubmissionError(cause instanceof Error ? cause.message : String(cause));
|
|
345
334
|
}
|
|
346
335
|
} finally {
|
|
347
336
|
if (generation === submissionGeneration.current) {
|
|
@@ -891,22 +880,18 @@ function HumanInputSurface({
|
|
|
891
880
|
|
|
892
881
|
// src/components/approval-surface.tsx
|
|
893
882
|
import { CheckIcon, ShieldCheckIcon, XIcon } from "lucide-react";
|
|
894
|
-
import {
|
|
895
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
883
|
+
import { useEffect as useEffect3, useId as useId2, useRef as useRef3, useState as useState2 } from "react";
|
|
884
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
896
885
|
var defaultApprovalSurfaceMessages = {
|
|
897
|
-
title: "Approval
|
|
886
|
+
title: "Approval required",
|
|
898
887
|
description: "Review the requested action before the agent continues.",
|
|
899
888
|
approve: "Approve",
|
|
900
889
|
reject: "Reject",
|
|
901
890
|
approving: "Approving\u2026",
|
|
902
891
|
rejecting: "Rejecting\u2026",
|
|
903
|
-
formatToolName: (name) => name.includes("__") || /^[a-f0-9]{64}$/.test(name) ? toolDisplayName(name) : name.replaceAll("_", " ").replaceAll(".", " \u203A ")
|
|
904
|
-
showDetails: "Show exact arguments",
|
|
905
|
-
hideDetails: "Hide exact arguments"
|
|
892
|
+
formatToolName: (name) => name.includes("__") || /^[a-f0-9]{64}$/.test(name) ? toolDisplayName(name) : name.replaceAll("_", " ").replaceAll(".", " \u203A ")
|
|
906
893
|
};
|
|
907
894
|
var APPROVAL_ARGUMENT_PREVIEW_CHARACTERS = 4e3;
|
|
908
|
-
var APPROVAL_FIELD_LIMIT = 12;
|
|
909
|
-
var APPROVAL_LIST_LIMIT = 10;
|
|
910
895
|
function approvalArgumentsPreview(value) {
|
|
911
896
|
if (value === void 0) return null;
|
|
912
897
|
let serialized;
|
|
@@ -920,46 +905,6 @@ function approvalArgumentsPreview(value) {
|
|
|
920
905
|
return `${characters.slice(0, APPROVAL_ARGUMENT_PREVIEW_CHARACTERS).join("")}
|
|
921
906
|
\u2026 ${characters.length - APPROVAL_ARGUMENT_PREVIEW_CHARACTERS} characters omitted`;
|
|
922
907
|
}
|
|
923
|
-
var ACRONYMS = /* @__PURE__ */ new Set(["id", "ids", "url", "uri", "api", "ip", "sku", "utc", "iban", "vat"]);
|
|
924
|
-
function fieldLabel(key) {
|
|
925
|
-
const words = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_.-]+/).filter(Boolean).map((word) => ACRONYMS.has(word.toLowerCase()) ? word.toUpperCase() : word.toLowerCase());
|
|
926
|
-
const label = words.join(" ");
|
|
927
|
-
return label ? label.charAt(0).toUpperCase() + label.slice(1) : key;
|
|
928
|
-
}
|
|
929
|
-
function scalarText(value) {
|
|
930
|
-
if (typeof value === "string") return value;
|
|
931
|
-
if (typeof value === "number" || typeof value === "bigint") return String(value);
|
|
932
|
-
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
933
|
-
if (value === null) return "None";
|
|
934
|
-
return null;
|
|
935
|
-
}
|
|
936
|
-
function approvalArgumentFields(value) {
|
|
937
|
-
let record = value;
|
|
938
|
-
if (typeof record === "string") {
|
|
939
|
-
try {
|
|
940
|
-
record = JSON.parse(record);
|
|
941
|
-
} catch {
|
|
942
|
-
return null;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
if (!record || typeof record !== "object" || Array.isArray(record)) return null;
|
|
946
|
-
const entries = Object.entries(record);
|
|
947
|
-
if (entries.length === 0 || entries.length > APPROVAL_FIELD_LIMIT) return null;
|
|
948
|
-
const fields = [];
|
|
949
|
-
for (const [key, entry] of entries) {
|
|
950
|
-
let text = scalarText(entry);
|
|
951
|
-
if (text === null && Array.isArray(entry) && entry.length <= APPROVAL_LIST_LIMIT) {
|
|
952
|
-
const items = entry.map(scalarText);
|
|
953
|
-
if (items.every((item) => item !== null)) text = items.join(", ");
|
|
954
|
-
}
|
|
955
|
-
if (text === null || text.length > APPROVAL_ARGUMENT_PREVIEW_CHARACTERS) return null;
|
|
956
|
-
fields.push({ key, label: fieldLabel(key), value: text });
|
|
957
|
-
}
|
|
958
|
-
return fields;
|
|
959
|
-
}
|
|
960
|
-
function isEmptyArguments(value) {
|
|
961
|
-
return value === void 0 || value === null || typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0;
|
|
962
|
-
}
|
|
963
908
|
function approvalOwnershipKey(approval) {
|
|
964
909
|
return `${approval.id}\0${approval.name}\0${approvalArgumentsPreview(approval.arguments) ?? ""}`;
|
|
965
910
|
}
|
|
@@ -974,8 +919,6 @@ function ApprovalSurface({
|
|
|
974
919
|
className
|
|
975
920
|
}) {
|
|
976
921
|
const titleId = useId2();
|
|
977
|
-
const formatError = useErrorMessage();
|
|
978
|
-
const descriptionId = useId2();
|
|
979
922
|
const messages = { ...defaultApprovalSurfaceMessages, ...overrides };
|
|
980
923
|
const [pending, setPending] = useState2(null);
|
|
981
924
|
const pendingRef = useRef3(null);
|
|
@@ -1003,45 +946,50 @@ function ApprovalSurface({
|
|
|
1003
946
|
if (pendingRef.current?.token === token) {
|
|
1004
947
|
pendingRef.current = null;
|
|
1005
948
|
setPending((current) => current?.token === token ? null : current);
|
|
1006
|
-
setDecisionError(
|
|
949
|
+
setDecisionError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
1007
950
|
}
|
|
1008
951
|
}
|
|
1009
952
|
};
|
|
1010
|
-
const errorMessage = decisionError
|
|
953
|
+
const errorMessage = decisionError?.message ?? (error instanceof Error ? error.message : error);
|
|
1011
954
|
return /* @__PURE__ */ jsxs2(
|
|
1012
955
|
"section",
|
|
1013
956
|
{
|
|
1014
957
|
className: cn(
|
|
1015
|
-
"og-root
|
|
958
|
+
"og-root flex w-full flex-col gap-3 rounded-og-lg border border-og-status-waiting/35 bg-og-status-waiting/5 p-4 shadow-og-sm",
|
|
1016
959
|
className
|
|
1017
960
|
),
|
|
1018
961
|
"aria-labelledby": titleId,
|
|
1019
|
-
"aria-describedby": descriptionId,
|
|
1020
|
-
"data-og-approval-surface": "",
|
|
1021
962
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
|
|
1024
|
-
|
|
963
|
+
/* @__PURE__ */ jsxs2("header", { className: "flex items-start gap-3", children: [
|
|
964
|
+
/* @__PURE__ */ jsx3("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/12 text-og-status-waiting", children: /* @__PURE__ */ jsx3(ShieldCheckIcon, { "aria-hidden": "true", className: "size-4" }) }),
|
|
965
|
+
/* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
|
|
966
|
+
/* @__PURE__ */ jsx3("h2", { id: titleId, className: "text-og-md font-semibold text-og-fg", children: messages.title }),
|
|
967
|
+
/* @__PURE__ */ jsx3("p", { className: "mt-0.5 text-og-sm text-og-fg-muted", children: messages.description })
|
|
968
|
+
] })
|
|
969
|
+
] }),
|
|
970
|
+
/* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-2", children: approvals.map((approval) => {
|
|
1025
971
|
const approvalKey = approvalOwnershipKey(approval);
|
|
1026
972
|
const active = pending?.approvalKey === approvalKey ? pending.decision : null;
|
|
973
|
+
const argumentsPreview = approvalArgumentsPreview(approval.arguments);
|
|
1027
974
|
return /* @__PURE__ */ jsxs2(
|
|
1028
975
|
"article",
|
|
1029
976
|
{
|
|
1030
977
|
"data-approval-id": approval.id,
|
|
1031
|
-
className: "
|
|
978
|
+
className: "rounded-og-md border border-og-border bg-og-surface-1 p-3",
|
|
1032
979
|
children: [
|
|
1033
|
-
renderApproval ? /* @__PURE__ */ jsxs2(
|
|
1034
|
-
/* @__PURE__ */ jsx3("p", { className: "
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
980
|
+
renderApproval ? renderApproval(approval) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
981
|
+
/* @__PURE__ */ jsx3("p", { className: "text-og-sm font-medium text-og-fg", children: approval.display?.title ?? messages.formatToolName(approval.display?.toolName ?? approval.name) }),
|
|
982
|
+
approval.display?.accountLabel ? /* @__PURE__ */ jsx3("p", { className: "mt-1 break-words text-og-xs text-og-fg-muted", children: approval.display.accountLabel }) : null,
|
|
983
|
+
argumentsPreview !== null ? /* @__PURE__ */ jsx3("pre", { className: "mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-og-sm bg-og-surface-2 p-2 font-mono text-og-xs text-og-fg-muted", children: argumentsPreview }) : null
|
|
984
|
+
] }),
|
|
985
|
+
/* @__PURE__ */ jsxs2("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: [
|
|
1038
986
|
/* @__PURE__ */ jsxs2(
|
|
1039
987
|
"button",
|
|
1040
988
|
{
|
|
1041
989
|
type: "button",
|
|
1042
990
|
disabled: busy,
|
|
1043
991
|
onClick: () => void decide(approval, "reject"),
|
|
1044
|
-
className: "inline-flex min-h-
|
|
992
|
+
className: "inline-flex min-h-9 items-center gap-1.5 rounded-og-md border border-og-border px-3 py-1.5 text-og-sm font-medium text-og-fg-muted transition-colors hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50",
|
|
1045
993
|
children: [
|
|
1046
994
|
/* @__PURE__ */ jsx3(XIcon, { "aria-hidden": "true", className: "size-3.5" }),
|
|
1047
995
|
active === "reject" ? messages.rejecting : messages.reject
|
|
@@ -1054,7 +1002,7 @@ function ApprovalSurface({
|
|
|
1054
1002
|
type: "button",
|
|
1055
1003
|
disabled: busy,
|
|
1056
1004
|
onClick: () => void decide(approval, "approve"),
|
|
1057
|
-
className: "inline-flex min-h-
|
|
1005
|
+
className: "inline-flex min-h-9 items-center gap-1.5 rounded-og-md border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-1.5 text-og-sm font-medium transition-colors hover:bg-og-primary-hover disabled:opacity-50",
|
|
1058
1006
|
children: [
|
|
1059
1007
|
/* @__PURE__ */ jsx3(CheckIcon, { "aria-hidden": "true", className: "size-3.5" }),
|
|
1060
1008
|
active === "approve" ? messages.approving : messages.approve
|
|
@@ -1067,42 +1015,11 @@ function ApprovalSurface({
|
|
|
1067
1015
|
approval.id
|
|
1068
1016
|
);
|
|
1069
1017
|
}) }),
|
|
1070
|
-
errorMessage ? /* @__PURE__ */ jsx3("p", { role: "alert", className: "
|
|
1018
|
+
errorMessage ? /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-og-sm text-og-status-failed", children: errorMessage }) : null
|
|
1071
1019
|
]
|
|
1072
1020
|
}
|
|
1073
1021
|
);
|
|
1074
1022
|
}
|
|
1075
|
-
function ApprovalDetails({
|
|
1076
|
-
approval,
|
|
1077
|
-
messages
|
|
1078
|
-
}) {
|
|
1079
|
-
const [showExact, setShowExact] = useState2(false);
|
|
1080
|
-
const fields = approvalArgumentFields(approval.arguments);
|
|
1081
|
-
const exact = isEmptyArguments(approval.arguments) ? null : approvalArgumentsPreview(approval.arguments);
|
|
1082
|
-
return /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
1083
|
-
/* @__PURE__ */ jsx3("span", { className: "mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-og-md bg-og-status-waiting/12 text-og-status-waiting", children: /* @__PURE__ */ jsx3(ShieldCheckIcon, { "aria-hidden": "true", className: "size-4" }) }),
|
|
1084
|
-
/* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
|
|
1085
|
-
/* @__PURE__ */ jsx3("p", { className: "text-og-xs font-medium text-og-status-waiting", children: messages.title }),
|
|
1086
|
-
/* @__PURE__ */ jsx3("p", { className: "mt-0.5 break-words text-og-md font-semibold text-og-fg", children: approval.display?.title ?? messages.formatToolName(approval.display?.toolName ?? approval.name) }),
|
|
1087
|
-
approval.display?.accountLabel ? /* @__PURE__ */ jsx3("p", { className: "mt-0.5 break-words text-og-xs text-og-fg-muted", children: approval.display.accountLabel }) : null,
|
|
1088
|
-
fields ? /* @__PURE__ */ jsx3("dl", { className: "m-0 mt-3 grid grid-cols-[minmax(5.5rem,max-content)_minmax(0,1fr)] gap-x-5 gap-y-1.5 text-og-sm", children: fields.map((field) => /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
1089
|
-
/* @__PURE__ */ jsx3("dt", { className: "m-0 text-og-fg-muted", children: field.label }),
|
|
1090
|
-
/* @__PURE__ */ jsx3("dd", { className: "m-0 max-h-32 min-w-0 overflow-auto whitespace-pre-wrap break-words text-og-fg", children: field.value })
|
|
1091
|
-
] }, field.key)) }) : null,
|
|
1092
|
-
exact !== null && (!fields || showExact) ? /* @__PURE__ */ jsx3("pre", { className: "mt-3 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-og-sm bg-og-fg/5 p-2.5 font-mono text-og-xs text-og-fg-muted", children: exact }) : null,
|
|
1093
|
-
fields && exact !== null ? /* @__PURE__ */ jsx3(
|
|
1094
|
-
"button",
|
|
1095
|
-
{
|
|
1096
|
-
type: "button",
|
|
1097
|
-
"aria-expanded": showExact,
|
|
1098
|
-
onClick: () => setShowExact((value) => !value),
|
|
1099
|
-
className: "mt-2 text-og-xs text-og-fg-muted underline-offset-2 hover:text-og-fg hover:underline",
|
|
1100
|
-
children: showExact ? messages.hideDetails ?? defaultApprovalSurfaceMessages.hideDetails : messages.showDetails ?? defaultApprovalSurfaceMessages.showDetails
|
|
1101
|
-
}
|
|
1102
|
-
) : null
|
|
1103
|
-
] })
|
|
1104
|
-
] });
|
|
1105
|
-
}
|
|
1106
1023
|
|
|
1107
1024
|
// src/timeline/knowledge-receipt.tsx
|
|
1108
1025
|
import { createContext, useContext, useState as useState3 } from "react";
|
|
@@ -5372,7 +5289,6 @@ function GeneratedVideoPlayer({
|
|
|
5372
5289
|
className,
|
|
5373
5290
|
label = "Generated video"
|
|
5374
5291
|
}) {
|
|
5375
|
-
const formatError = useErrorMessage();
|
|
5376
5292
|
const [retry, setRetry] = useState11(0);
|
|
5377
5293
|
const [state, setState] = useState11({ kind: "loading" });
|
|
5378
5294
|
useEffect7(() => {
|
|
@@ -5386,12 +5302,12 @@ function GeneratedVideoPlayer({
|
|
|
5386
5302
|
if (controller.signal.aborted) return;
|
|
5387
5303
|
setState({
|
|
5388
5304
|
kind: "error",
|
|
5389
|
-
message:
|
|
5305
|
+
message: error instanceof Error ? error.message : "Playback is unavailable."
|
|
5390
5306
|
});
|
|
5391
5307
|
}
|
|
5392
5308
|
);
|
|
5393
5309
|
return () => controller.abort();
|
|
5394
|
-
}, [loadPlaybackSource, receipt.artifact.artifactId, retry
|
|
5310
|
+
}, [loadPlaybackSource, receipt.artifact.artifactId, retry]);
|
|
5395
5311
|
if (state.kind === "loading") {
|
|
5396
5312
|
return /* @__PURE__ */ jsx13(
|
|
5397
5313
|
"div",
|
|
@@ -6500,7 +6416,6 @@ function MessageTimeline({
|
|
|
6500
6416
|
emptyState,
|
|
6501
6417
|
className
|
|
6502
6418
|
}) {
|
|
6503
|
-
const formatError = useErrorMessage();
|
|
6504
6419
|
const resolvedItems = useMemo5(() => {
|
|
6505
6420
|
const projectedItems = items ?? buildTimeline(events ?? []);
|
|
6506
6421
|
if (!shouldRenderAuthNeeded) {
|
|
@@ -6580,12 +6495,12 @@ function MessageTimeline({
|
|
|
6580
6495
|
setNewerRetryPending(false);
|
|
6581
6496
|
setNewerFailure({
|
|
6582
6497
|
key: newerBoundaryKey,
|
|
6583
|
-
message:
|
|
6498
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
6584
6499
|
});
|
|
6585
6500
|
}
|
|
6586
6501
|
);
|
|
6587
6502
|
},
|
|
6588
|
-
[onLoadNewer, loadingNewer, newerBoundaryKey
|
|
6503
|
+
[onLoadNewer, loadingNewer, newerBoundaryKey]
|
|
6589
6504
|
);
|
|
6590
6505
|
const previousSourceIdsRef = useRef9(/* @__PURE__ */ new Set());
|
|
6591
6506
|
const previousSourceBoundaryRef = useRef9(void 0);
|
|
@@ -9613,7 +9528,7 @@ function authReasonLine(reason) {
|
|
|
9613
9528
|
import { Loader2Icon } from "lucide-react";
|
|
9614
9529
|
import { lazy as lazy4, Suspense as Suspense5 } from "react";
|
|
9615
9530
|
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9616
|
-
var loadQueueSurface = () => import("./queue-surface-implementation-
|
|
9531
|
+
var loadQueueSurface = () => import("./queue-surface-implementation-2CAQAIHM.js");
|
|
9617
9532
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
9618
9533
|
function createQueueSurface(loadImplementation) {
|
|
9619
9534
|
const LazyQueueSurface = lazy4(async () => ({
|
|
@@ -10068,7 +9983,6 @@ function SessionChrome({
|
|
|
10068
9983
|
defaultActive = null,
|
|
10069
9984
|
onActiveChange
|
|
10070
9985
|
}) {
|
|
10071
|
-
const formatError = useErrorMessage();
|
|
10072
9986
|
const [activityRequested, setActivityOpen] = useState16(
|
|
10073
9987
|
Boolean(defaultActive && ["incoming", "agents", "commands"].includes(defaultActive))
|
|
10074
9988
|
);
|
|
@@ -10664,7 +10578,7 @@ function SessionChrome({
|
|
|
10664
10578
|
) : null }),
|
|
10665
10579
|
goal?.mutationError ? /* @__PURE__ */ jsxs16("p", { role: "alert", className: "px-3 pb-2 text-og-xs text-og-danger", children: [
|
|
10666
10580
|
"Goal action not confirmed. ",
|
|
10667
|
-
|
|
10581
|
+
goal.mutationError.message
|
|
10668
10582
|
] }) : null,
|
|
10669
10583
|
/* @__PURE__ */ jsx21(
|
|
10670
10584
|
"div",
|
|
@@ -11073,7 +10987,6 @@ function GoalPanel({
|
|
|
11073
10987
|
elapsed,
|
|
11074
10988
|
readOnly
|
|
11075
10989
|
}) {
|
|
11076
|
-
const formatError = useErrorMessage();
|
|
11077
10990
|
const record = goal.goal;
|
|
11078
10991
|
if (!record) return null;
|
|
11079
10992
|
const canToggle = !readOnly && (record.status === "active" || record.status === "paused");
|
|
@@ -11105,7 +11018,7 @@ function GoalPanel({
|
|
|
11105
11018
|
children: explanation
|
|
11106
11019
|
}
|
|
11107
11020
|
) : null,
|
|
11108
|
-
record.continuation?.lastError ? /* @__PURE__ */ jsx21("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children:
|
|
11021
|
+
record.continuation?.lastError ? /* @__PURE__ */ jsx21("p", { className: "rounded-og-sm bg-og-status-waiting/10 px-1.5 py-1 text-og-xs leading-4 text-og-status-waiting", children: record.continuation.lastError }) : null,
|
|
11109
11022
|
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center justify-between gap-1.5 pt-0.5", children: [
|
|
11110
11023
|
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1 text-[10px] text-og-fg-muted", children: [
|
|
11111
11024
|
/* @__PURE__ */ jsxs16("span", { className: "rounded bg-og-surface-3/70 px-1 py-px", children: [
|
|
@@ -11227,7 +11140,6 @@ function Conversation({
|
|
|
11227
11140
|
}) {
|
|
11228
11141
|
const scope = { client, workspaceId };
|
|
11229
11142
|
const context = useOpenGeni(scope);
|
|
11230
|
-
const formatError = useErrorMessage();
|
|
11231
11143
|
const config = useClientConfigFlags(context.client);
|
|
11232
11144
|
const showModelPicker = modelPicker ?? config.modelSelection;
|
|
11233
11145
|
const catalog = useWorkspaceModelCatalog({
|
|
@@ -11305,7 +11217,7 @@ function Conversation({
|
|
|
11305
11217
|
style: { height },
|
|
11306
11218
|
"data-og-conversation": "",
|
|
11307
11219
|
children: [
|
|
11308
|
-
error && /* @__PURE__ */ jsx22("p", { role: "alert", children:
|
|
11220
|
+
error && /* @__PURE__ */ jsx22("p", { role: "alert", children: error.message }),
|
|
11309
11221
|
/* @__PURE__ */ jsx22(
|
|
11310
11222
|
MessageTimeline,
|
|
11311
11223
|
{
|
|
@@ -11366,7 +11278,7 @@ function Conversation({
|
|
|
11366
11278
|
await human.respond(id, response);
|
|
11367
11279
|
},
|
|
11368
11280
|
respondingRequestId: human.respondingRequestId,
|
|
11369
|
-
error: human.mutationError
|
|
11281
|
+
error: human.mutationError?.message,
|
|
11370
11282
|
autoFocus: false
|
|
11371
11283
|
}
|
|
11372
11284
|
),
|
|
@@ -11470,13 +11382,11 @@ function useClientConfigFlags(client) {
|
|
|
11470
11382
|
import { useCallback as useCallback6, useEffect as useEffect13, useRef as useRef12 } from "react";
|
|
11471
11383
|
function useWorkspaceSessions(options = {}) {
|
|
11472
11384
|
const { client, workspaceId } = useOpenGeni(options);
|
|
11473
|
-
const projection = options.projection;
|
|
11474
11385
|
const limit = options.limit;
|
|
11475
11386
|
const parentSessionId = options.parentSessionId;
|
|
11476
11387
|
const cursor = options.cursor;
|
|
11477
11388
|
const search = options.search;
|
|
11478
11389
|
const pinsOnly = options.pinsOnly;
|
|
11479
|
-
const includePinned = options.includePinned;
|
|
11480
11390
|
const archivedOnly = options.archivedOnly;
|
|
11481
11391
|
const sortBy = options.sortBy;
|
|
11482
11392
|
const archiveStatus = options.archiveStatus;
|
|
@@ -11486,13 +11396,11 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11486
11396
|
const beginRead = options.beginRead;
|
|
11487
11397
|
const queryKey = [
|
|
11488
11398
|
workspaceId,
|
|
11489
|
-
projection ?? "full",
|
|
11490
11399
|
limit ?? "",
|
|
11491
11400
|
parentSessionId === null ? "null" : parentSessionId ?? "",
|
|
11492
11401
|
cursor ?? "",
|
|
11493
11402
|
search ?? "",
|
|
11494
11403
|
pinsOnly ? "1" : "",
|
|
11495
|
-
includePinned === false ? "no-pins" : "",
|
|
11496
11404
|
archivedOnly ? "archived" : "active",
|
|
11497
11405
|
sortBy ?? "",
|
|
11498
11406
|
archiveStatus ?? ""
|
|
@@ -11505,26 +11413,17 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11505
11413
|
const load = useCallback6(
|
|
11506
11414
|
async (signal) => {
|
|
11507
11415
|
const readGeneration = beginRead?.() ?? ++nextReadGeneration.current;
|
|
11508
|
-
const
|
|
11416
|
+
const page2 = await client.listSessionPage(workspaceId, {
|
|
11509
11417
|
...limit !== void 0 ? { limit } : {},
|
|
11510
11418
|
...parentSessionId !== void 0 ? { parentSessionId } : {},
|
|
11511
11419
|
...cursor !== void 0 ? { cursor } : {},
|
|
11512
11420
|
...search !== void 0 ? { search } : {},
|
|
11513
11421
|
...pinsOnly ? { pinsOnly: true } : {},
|
|
11514
|
-
...includePinned === false ? { includePinned: false } : {},
|
|
11515
11422
|
...archivedOnly ? { archivedOnly: true } : {},
|
|
11516
11423
|
...sortBy ? { sortBy } : {},
|
|
11517
11424
|
...archiveStatus ? { archiveStatus } : {},
|
|
11518
11425
|
signal
|
|
11519
|
-
};
|
|
11520
|
-
const page2 = projection === "summary" ? client.listSessionSummaryPage ? await client.listSessionSummaryPage(workspaceId, query) : await client.listSessionPage(workspaceId, query).then(async (full) => {
|
|
11521
|
-
const { sessionListEntry } = await import("@opengeni/sdk/session-list-entries");
|
|
11522
|
-
return {
|
|
11523
|
-
...full,
|
|
11524
|
-
pinned: full.pinned.map(sessionListEntry),
|
|
11525
|
-
sessions: full.sessions.map(sessionListEntry)
|
|
11526
|
-
};
|
|
11527
|
-
}) : await client.listSessionPage(workspaceId, query);
|
|
11426
|
+
});
|
|
11528
11427
|
return {
|
|
11529
11428
|
queryKey,
|
|
11530
11429
|
page: page2,
|
|
@@ -11536,13 +11435,11 @@ function useWorkspaceSessions(options = {}) {
|
|
|
11536
11435
|
beginRead,
|
|
11537
11436
|
client,
|
|
11538
11437
|
workspaceId,
|
|
11539
|
-
projection,
|
|
11540
11438
|
limit,
|
|
11541
11439
|
parentSessionId,
|
|
11542
11440
|
cursor,
|
|
11543
11441
|
search,
|
|
11544
11442
|
pinsOnly,
|
|
11545
|
-
includePinned,
|
|
11546
11443
|
archivedOnly,
|
|
11547
11444
|
sortBy,
|
|
11548
11445
|
archiveStatus,
|
|
@@ -11627,7 +11524,6 @@ function SessionList({
|
|
|
11627
11524
|
const [editing, setEditing] = useState18(null);
|
|
11628
11525
|
const [busy, setBusy] = useState18(null);
|
|
11629
11526
|
const [error, setError] = useState18(null);
|
|
11630
|
-
const formatError = useErrorMessage();
|
|
11631
11527
|
const archiveClient = context.client;
|
|
11632
11528
|
const canArchive = archive && typeof archiveClient.updateSessionArchive === "function";
|
|
11633
11529
|
const run = async (id, action) => {
|
|
@@ -11637,7 +11533,7 @@ function SessionList({
|
|
|
11637
11533
|
await action();
|
|
11638
11534
|
await list.refresh();
|
|
11639
11535
|
} catch (cause) {
|
|
11640
|
-
setError(
|
|
11536
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
11641
11537
|
} finally {
|
|
11642
11538
|
setBusy(null);
|
|
11643
11539
|
}
|
|
@@ -11684,10 +11580,10 @@ function SessionList({
|
|
|
11684
11580
|
}
|
|
11685
11581
|
) : null
|
|
11686
11582
|
] }),
|
|
11687
|
-
error
|
|
11583
|
+
error ? /* @__PURE__ */ jsx23("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: error }) : null,
|
|
11688
11584
|
/* @__PURE__ */ jsxs18("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
|
|
11689
11585
|
list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx23("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
|
|
11690
|
-
!list.loading &&
|
|
11586
|
+
!list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx23("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
|
|
11691
11587
|
sessions.map((session) => {
|
|
11692
11588
|
const selected = session.id === selectedSessionId;
|
|
11693
11589
|
const title = deriveSessionDisplayTitle(session);
|
|
@@ -11931,7 +11827,6 @@ function NewChat({
|
|
|
11931
11827
|
const [text, setText] = useState19("");
|
|
11932
11828
|
const [sending, setSending] = useState19(false);
|
|
11933
11829
|
const [error, setError] = useState19(null);
|
|
11934
|
-
const formatError = useErrorMessage();
|
|
11935
11830
|
const idempotencyKey = useRef14(crypto.randomUUID());
|
|
11936
11831
|
const submit = async (event) => {
|
|
11937
11832
|
event.preventDefault();
|
|
@@ -11945,7 +11840,7 @@ function NewChat({
|
|
|
11945
11840
|
setText("");
|
|
11946
11841
|
onCreated(id);
|
|
11947
11842
|
} catch (cause) {
|
|
11948
|
-
setError(
|
|
11843
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
11949
11844
|
} finally {
|
|
11950
11845
|
setSending(false);
|
|
11951
11846
|
}
|
|
@@ -11954,13 +11849,10 @@ function NewChat({
|
|
|
11954
11849
|
"form",
|
|
11955
11850
|
{
|
|
11956
11851
|
onSubmit: (event) => void submit(event),
|
|
11957
|
-
className: "
|
|
11852
|
+
className: "flex h-full flex-col justify-end gap-2 p-3",
|
|
11958
11853
|
"data-og-new-chat-composer": "",
|
|
11959
11854
|
children: [
|
|
11960
|
-
error ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-og-xs text-og-status-failed", children:
|
|
11961
|
-
error.cause,
|
|
11962
|
-
error.cause instanceof Error && error.cause.message === labels.newChatUnavailable ? labels.newChatUnavailable : void 0
|
|
11963
|
-
) }) : null,
|
|
11855
|
+
error ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null,
|
|
11964
11856
|
/* @__PURE__ */ jsxs19("div", { className: "flex items-end gap-2 rounded-lg border border-og-border bg-og-surface-1 p-2", children: [
|
|
11965
11857
|
/* @__PURE__ */ jsx24(
|
|
11966
11858
|
"textarea",
|
|
@@ -12004,7 +11896,6 @@ function SessionCommandsPanel({
|
|
|
12004
11896
|
commands: state,
|
|
12005
11897
|
readOnly = false
|
|
12006
11898
|
}) {
|
|
12007
|
-
const formatError = useErrorMessage();
|
|
12008
11899
|
const [pending, setPending] = useState20(null);
|
|
12009
11900
|
const [error, setError] = useState20(null);
|
|
12010
11901
|
const active = state.commands.filter(
|
|
@@ -12016,7 +11907,7 @@ function SessionCommandsPanel({
|
|
|
12016
11907
|
try {
|
|
12017
11908
|
await state.cancel(id);
|
|
12018
11909
|
} catch (cause) {
|
|
12019
|
-
setError(
|
|
11910
|
+
setError(cause instanceof Error ? cause.message : "Stop was not confirmed. Try again.");
|
|
12020
11911
|
} finally {
|
|
12021
11912
|
setPending(null);
|
|
12022
11913
|
}
|
|
@@ -12319,4 +12210,4 @@ export {
|
|
|
12319
12210
|
SessionCommands,
|
|
12320
12211
|
StartupTimings
|
|
12321
12212
|
};
|
|
12322
|
-
//# sourceMappingURL=chunk-
|
|
12213
|
+
//# sourceMappingURL=chunk-LZ3KHA55.js.map
|