@opengeni/react 7.6.1 → 7.7.0-canary.37111190284001
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 +47 -2
- package/dist/{browser-viewer-5X47I6T2.js → browser-viewer-63TXMINB.js} +6 -5
- package/dist/{chunk-5EXGU7UF.js → chunk-55DDDVKU.js} +3 -3
- package/dist/{chunk-UINDK6C3.js → chunk-7CYYXWHU.js} +5 -8
- package/dist/chunk-7CYYXWHU.js.map +1 -0
- package/dist/{chunk-LZ3KHA55.js → chunk-A2L5N3EI.js} +332 -339
- package/dist/chunk-A2L5N3EI.js.map +1 -0
- package/dist/{chunk-KGENSZKS.js → chunk-AAG4R3QN.js} +4 -3
- package/dist/chunk-AAG4R3QN.js.map +1 -0
- package/dist/{chunk-Z3DISEQN.js → chunk-CWWKTNKK.js} +35 -18
- package/dist/chunk-CWWKTNKK.js.map +1 -0
- package/dist/{chunk-WZ55DVGK.js → chunk-ELCE5SXV.js} +8 -4
- package/dist/chunk-ELCE5SXV.js.map +1 -0
- package/dist/{chunk-YSMMDOOE.js → chunk-GISEVGS6.js} +10 -2
- package/dist/chunk-GISEVGS6.js.map +1 -0
- package/dist/{chunk-BI57CQUV.js → chunk-I7IWRQLN.js} +2 -2
- package/dist/{chunk-XA6R7DJQ.js → chunk-IQUCRAT7.js} +3 -3
- package/dist/{chunk-CHPKSLPN.js → chunk-NBZ64YY7.js} +4 -2
- package/dist/chunk-NBZ64YY7.js.map +1 -0
- package/dist/{chunk-DV2DBNPQ.js → chunk-Q5QBEZIQ.js} +48 -29
- package/dist/chunk-Q5QBEZIQ.js.map +1 -0
- package/dist/{chunk-FGBCYQOT.js → chunk-RDKBXMWX.js} +120 -74
- package/dist/chunk-RDKBXMWX.js.map +1 -0
- package/dist/{chunk-45GE35O7.js → chunk-TKB4SB44.js} +10 -2
- package/dist/chunk-TKB4SB44.js.map +1 -0
- package/dist/{chunk-YCGBREUV.js → chunk-TOAH2BKA.js} +6 -2
- package/dist/{chunk-YCGBREUV.js.map → chunk-TOAH2BKA.js.map} +1 -1
- package/dist/chunk-UGLEYEMP.js +33 -0
- package/dist/chunk-UGLEYEMP.js.map +1 -0
- package/dist/{chunk-UJRYEWZI.js → chunk-UTRTG6LH.js} +48 -8
- package/dist/chunk-UTRTG6LH.js.map +1 -0
- package/dist/{chunk-YRYF2GLG.js → chunk-WYVLAAJA.js} +39 -31
- package/dist/chunk-WYVLAAJA.js.map +1 -0
- package/dist/{chunk-VGIKFIO2.js → chunk-XOAMRDDK.js} +6 -3
- package/dist/chunk-XOAMRDDK.js.map +1 -0
- package/dist/{chunk-6NEZPF53.js → chunk-YN7I3STW.js} +153 -32
- package/dist/chunk-YN7I3STW.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-YQEAA6LT.js} +7 -3
- package/dist/chunk-YQEAA6LT.js.map +1 -0
- package/dist/client.d.ts +4 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/approval-surface.d.ts +15 -0
- package/dist/components/session-conversation.d.ts +3 -0
- package/dist/composer.js +8 -7
- package/dist/{computer-viewer-7GF35SNY.js → computer-viewer-X2MBRZY4.js} +5 -4
- package/dist/connect.js +3 -3
- package/dist/hooks/use-browser-session.d.ts +4 -0
- package/dist/hooks/use-composer.d.ts +2 -0
- package/dist/hooks/use-computer-session.d.ts +2 -0
- package/dist/hooks/use-file-attachments.d.ts +2 -0
- package/dist/hooks/use-session-events.d.ts +1 -1
- package/dist/hooks/use-workspace-sessions.d.ts +15 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -21
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +6 -5
- package/dist/interaction.js.map +1 -1
- package/dist/{latest-question-3BJGKQQ6.js → latest-question-CNEZ5KAN.js} +3 -3
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +27 -3
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/machines.js +5 -4
- package/dist/{model-policy-picker-menu-PUTA5JOB.js → model-policy-picker-menu-GN2LTB7Z.js} +4 -4
- package/dist/model-policy.js +1 -1
- package/dist/provider.d.ts +5 -1
- package/dist/{queue-surface-implementation-2CAQAIHM.js → queue-surface-implementation-HENWYFWA.js} +3 -2
- package/dist/{queue-surface-implementation-2CAQAIHM.js.map → queue-surface-implementation-HENWYFWA.js.map} +1 -1
- package/dist/realtime.js +2 -2
- package/dist/{sandbox-files-AEJTWGT4.js → sandbox-files-BBC47SLD.js} +4 -3
- package/dist/session-ui.d.ts +1 -1
- package/dist/session-ui.js +13 -12
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +7 -6
- package/dist/usage.js +2 -1
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +5 -1
- package/src/commands/registry.ts +18 -15
- package/src/commands/types.ts +2 -0
- package/src/components/approval-surface.tsx +166 -42
- package/src/components/browser-viewer.tsx +38 -9
- package/src/components/composer.tsx +9 -2
- package/src/components/computer-viewer.tsx +160 -30
- package/src/components/generated-video-player.tsx +4 -2
- package/src/components/human-input-form.tsx +18 -5
- package/src/components/message-timeline.tsx +120 -168
- package/src/components/model-policy-picker.tsx +2 -15
- package/src/components/open-geni-chat.tsx +11 -4
- package/src/components/queue-surface-state.tsx +3 -1
- package/src/components/session-chrome.tsx +5 -2
- package/src/components/session-commands-panel.tsx +3 -1
- package/src/components/session-conversation.tsx +10 -3
- package/src/components/session-list.tsx +7 -5
- package/src/components/session-mcp-capability-card.tsx +11 -1
- package/src/hooks/internal.ts +3 -2
- package/src/hooks/use-browser-session.ts +115 -79
- package/src/hooks/use-composer.ts +70 -31
- package/src/hooks/use-computer-session.ts +57 -6
- package/src/hooks/use-file-attachments.ts +16 -3
- package/src/hooks/use-goal.ts +2 -1
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-events.ts +15 -8
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-turn-queue.ts +2 -1
- package/src/hooks/use-workspace-sessions.ts +40 -7
- package/src/index.ts +7 -2
- package/src/interaction.ts +1 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +73 -9
- package/src/lib/interaction-errors.ts +15 -0
- package/src/model-policy.ts +6 -1
- package/src/provider.tsx +12 -4
- package/src/session-ui.ts +1 -1
- package/src/timeline/projection.ts +12 -1
- package/styles/compiled.css +14 -30
- package/dist/chunk-45GE35O7.js.map +0 -1
- package/dist/chunk-6NEZPF53.js.map +0 -1
- package/dist/chunk-CHPKSLPN.js.map +0 -1
- package/dist/chunk-DV2DBNPQ.js.map +0 -1
- package/dist/chunk-FGBCYQOT.js.map +0 -1
- package/dist/chunk-KGENSZKS.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-LZ3KHA55.js.map +0 -1
- package/dist/chunk-UINDK6C3.js.map +0 -1
- package/dist/chunk-UJRYEWZI.js.map +0 -1
- package/dist/chunk-VGIKFIO2.js.map +0 -1
- package/dist/chunk-WZ55DVGK.js.map +0 -1
- package/dist/chunk-YRYF2GLG.js.map +0 -1
- package/dist/chunk-YSMMDOOE.js.map +0 -1
- package/dist/chunk-Z3DISEQN.js.map +0 -1
- package/dist/components/timeline-pill-geometry.d.ts +0 -8
- package/dist/components/timeline-pill-placement.d.ts +0 -24
- package/dist/timeline-pill-geometry-Z23V243M.js +0 -110
- package/dist/timeline-pill-geometry-Z23V243M.js.map +0 -1
- package/src/components/timeline-pill-geometry.ts +0 -169
- package/src/components/timeline-pill-placement.ts +0 -99
- /package/dist/{browser-viewer-5X47I6T2.js.map → browser-viewer-63TXMINB.js.map} +0 -0
- /package/dist/{chunk-5EXGU7UF.js.map → chunk-55DDDVKU.js.map} +0 -0
- /package/dist/{chunk-BI57CQUV.js.map → chunk-I7IWRQLN.js.map} +0 -0
- /package/dist/{chunk-XA6R7DJQ.js.map → chunk-IQUCRAT7.js.map} +0 -0
- /package/dist/{computer-viewer-7GF35SNY.js.map → computer-viewer-X2MBRZY4.js.map} +0 -0
- /package/dist/{latest-question-3BJGKQQ6.js.map → latest-question-CNEZ5KAN.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-PUTA5JOB.js.map → model-policy-picker-menu-GN2LTB7Z.js.map} +0 -0
- /package/dist/{sandbox-files-AEJTWGT4.js.map → sandbox-files-BBC47SLD.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldSteerOnKey,
|
|
3
3
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q5QBEZIQ.js";
|
|
5
5
|
import {
|
|
6
6
|
Tooltip,
|
|
7
7
|
TooltipContent,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-BRM6FVZA.js";
|
|
12
12
|
import {
|
|
13
13
|
groupPickerRowsByBillingClass
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NBZ64YY7.js";
|
|
15
15
|
import {
|
|
16
16
|
ComposerResponsiveContext
|
|
17
17
|
} from "./chunk-VZTQ73XT.js";
|
|
@@ -19,7 +19,10 @@ import {
|
|
|
19
19
|
composerSubmissionErrorMessage,
|
|
20
20
|
formatBytes,
|
|
21
21
|
formatRelativeTime
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UTRTG6LH.js";
|
|
23
|
+
import {
|
|
24
|
+
useErrorMessage
|
|
25
|
+
} from "./chunk-UGLEYEMP.js";
|
|
23
26
|
import {
|
|
24
27
|
cn
|
|
25
28
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -28,6 +31,7 @@ import {
|
|
|
28
31
|
var OPEN_WORKSTREAM_CONTROL_EVENT = "opengeni:open-workstream-control";
|
|
29
32
|
|
|
30
33
|
// src/commands/registry.ts
|
|
34
|
+
import { formatErrorMessage } from "@opengeni/sdk";
|
|
31
35
|
function parseCommandLine(value) {
|
|
32
36
|
if (value[0] !== "/") {
|
|
33
37
|
return null;
|
|
@@ -146,7 +150,10 @@ var defaultCommands = [
|
|
|
146
150
|
});
|
|
147
151
|
return { status: "ok", message: action === "pause" ? "Goal paused." : "Goal resumed." };
|
|
148
152
|
} catch (cause) {
|
|
149
|
-
return {
|
|
153
|
+
return {
|
|
154
|
+
status: "error",
|
|
155
|
+
message: commandErrorMessage(ctx, cause, goalErrorMessage(cause, action))
|
|
156
|
+
};
|
|
150
157
|
}
|
|
151
158
|
}
|
|
152
159
|
},
|
|
@@ -161,7 +168,7 @@ var defaultCommands = [
|
|
|
161
168
|
const result = await ctx.client.compactSessionContext(ctx.workspaceId, sessionId);
|
|
162
169
|
return { status: "ok", message: result.message };
|
|
163
170
|
} catch (cause) {
|
|
164
|
-
return { status: "error", message:
|
|
171
|
+
return { status: "error", message: commandErrorMessage(ctx, cause) };
|
|
165
172
|
}
|
|
166
173
|
}
|
|
167
174
|
},
|
|
@@ -181,16 +188,16 @@ var defaultCommands = [
|
|
|
181
188
|
await ctx.client.clearSessionContext(ctx.workspaceId, sessionId);
|
|
182
189
|
return { status: "ok", message: "Context cleared." };
|
|
183
190
|
} catch (cause) {
|
|
184
|
-
return {
|
|
191
|
+
return {
|
|
192
|
+
status: "error",
|
|
193
|
+
message: commandErrorMessage(ctx, cause, clearErrorMessage(cause))
|
|
194
|
+
};
|
|
185
195
|
}
|
|
186
196
|
}
|
|
187
197
|
}
|
|
188
198
|
];
|
|
189
|
-
function
|
|
190
|
-
|
|
191
|
-
return cause.message;
|
|
192
|
-
}
|
|
193
|
-
return void 0;
|
|
199
|
+
function commandErrorMessage(ctx, cause, message = formatErrorMessage(cause)) {
|
|
200
|
+
return ctx.formatError?.(cause, message) || message;
|
|
194
201
|
}
|
|
195
202
|
function statusCode(cause) {
|
|
196
203
|
if (cause && typeof cause === "object" && "status" in cause && typeof cause.status === "number") {
|
|
@@ -206,18 +213,19 @@ function goalErrorMessage(cause, action) {
|
|
|
206
213
|
if (code === 409) {
|
|
207
214
|
return action === "resume" ? "Only a paused goal can be resumed." : "Goal is already in a terminal state.";
|
|
208
215
|
}
|
|
209
|
-
return
|
|
216
|
+
return formatErrorMessage(cause);
|
|
210
217
|
}
|
|
211
218
|
function clearErrorMessage(cause) {
|
|
212
219
|
if (statusCode(cause) === 409) {
|
|
213
220
|
return "Pause the session and wait for the current inference to settle, then clear context.";
|
|
214
221
|
}
|
|
215
|
-
return
|
|
222
|
+
return formatErrorMessage(cause);
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
// src/hooks/use-slash-commands.ts
|
|
219
226
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
220
227
|
function useSlashCommands(options) {
|
|
228
|
+
const formatError = useErrorMessage();
|
|
221
229
|
const { commands, context, handlers, value, setValue } = options;
|
|
222
230
|
const [highlight, setHighlight] = useState(0);
|
|
223
231
|
const [dismissedValue, setDismissedValue] = useState(null);
|
|
@@ -261,9 +269,9 @@ function useSlashCommands(options) {
|
|
|
261
269
|
if (!context) {
|
|
262
270
|
return null;
|
|
263
271
|
}
|
|
264
|
-
return { ...context, ...handlers, confirm: () => handlers.confirm(command) };
|
|
272
|
+
return { ...context, ...handlers, formatError, confirm: () => handlers.confirm(command) };
|
|
265
273
|
},
|
|
266
|
-
[context, handlers]
|
|
274
|
+
[context, handlers, formatError]
|
|
267
275
|
);
|
|
268
276
|
const execute = useCallback(
|
|
269
277
|
async (command, args) => {
|
|
@@ -280,10 +288,10 @@ function useSlashCommands(options) {
|
|
|
280
288
|
setValue("");
|
|
281
289
|
}
|
|
282
290
|
} catch (cause) {
|
|
283
|
-
ctx.notice({ tone: "error", message:
|
|
291
|
+
ctx.notice({ tone: "error", message: formatError(cause) });
|
|
284
292
|
}
|
|
285
293
|
},
|
|
286
|
-
[buildContext, setValue]
|
|
294
|
+
[buildContext, setValue, formatError]
|
|
287
295
|
);
|
|
288
296
|
const autocomplete = useCallback(
|
|
289
297
|
(command) => {
|
|
@@ -417,12 +425,6 @@ function useSlashCommands(options) {
|
|
|
417
425
|
autocompleteHighlighted
|
|
418
426
|
};
|
|
419
427
|
}
|
|
420
|
-
function errorMessage2(cause) {
|
|
421
|
-
if (cause instanceof Error) {
|
|
422
|
-
return cause.message;
|
|
423
|
-
}
|
|
424
|
-
return String(cause);
|
|
425
|
-
}
|
|
426
428
|
|
|
427
429
|
// src/components/command-palette.tsx
|
|
428
430
|
import { AnimatePresence, motion } from "motion/react";
|
|
@@ -647,7 +649,9 @@ var defaultChatComposerMessages = {
|
|
|
647
649
|
messagePlaceholder: "Message the agent\u2026",
|
|
648
650
|
pausedPlaceholder: "Message the agent \u2014 it will wait in the queue\u2026",
|
|
649
651
|
inputLabel: "Message the agent",
|
|
650
|
-
|
|
652
|
+
// Shortcuts live in the send button's title; the footer stays quiet unless
|
|
653
|
+
// the host supplies its own hint.
|
|
654
|
+
keyboardHint: "",
|
|
651
655
|
slashCommandBlocked: "That's a slash command \u2014 press Enter in the command list to run it, or edit the line to send a message.",
|
|
652
656
|
controlChangedError: "This workstream was paused while you were sending. Nothing was sent, and your draft is still here.",
|
|
653
657
|
sendFailedError: "Sending failed \u2014 your draft is still here. Try again.",
|
|
@@ -784,6 +788,7 @@ function useChatComposerController({
|
|
|
784
788
|
onPaste,
|
|
785
789
|
messages: messageOverrides
|
|
786
790
|
}) {
|
|
791
|
+
const formatError = useErrorMessage();
|
|
787
792
|
const messages = useMemo3(
|
|
788
793
|
() => ({ ...defaultChatComposerMessages, ...messageOverrides }),
|
|
789
794
|
[messageOverrides]
|
|
@@ -1027,7 +1032,10 @@ function useChatComposerController({
|
|
|
1027
1032
|
);
|
|
1028
1033
|
const activeNotice = notice ?? (delivery.error ? {
|
|
1029
1034
|
tone: "error",
|
|
1030
|
-
message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError :
|
|
1035
|
+
message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError : formatError(
|
|
1036
|
+
delivery.error,
|
|
1037
|
+
composerSubmissionErrorMessage(delivery.error) || messages.sendFailedError
|
|
1038
|
+
)
|
|
1031
1039
|
} : null);
|
|
1032
1040
|
useEffect(() => {
|
|
1033
1041
|
if (notice?.tone !== "ok") return;
|
|
@@ -4336,8 +4344,8 @@ function ComposerTranscriptionControl({
|
|
|
4336
4344
|
const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
|
|
4337
4345
|
const unavailableMessage = composer.disabled ? messages.unavailableDisabled : !capability?.available || !workspaceEnabled ? messages.unavailable : !transcription.available ? messages.errorStorageUnavailable : null;
|
|
4338
4346
|
const idleLabel = unavailableMessage ?? (status === "error" ? messages.retry : messages.start);
|
|
4339
|
-
const
|
|
4340
|
-
const announcement = status === "requesting-permission" ? messages.requestingPermission : status === "recording" ? messages.recording : status === "saving" ? messages.saving : status === "transcribing" ? messages.transcribing : retrying ? messages.retrying : status === "recovered" ? messages.recovered : status === "transcript-ready" ? messages.recoveredTranscript : status === "error" ?
|
|
4347
|
+
const errorMessage = transcription.error ? transcriptionErrorMessage(transcription.error, messages) : null;
|
|
4348
|
+
const announcement = status === "requesting-permission" ? messages.requestingPermission : status === "recording" ? messages.recording : status === "saving" ? messages.saving : status === "transcribing" ? messages.transcribing : retrying ? messages.retrying : status === "recovered" ? messages.recovered : status === "transcript-ready" ? messages.recoveredTranscript : status === "error" ? errorMessage ?? messages.errorUnknown : unavailableMessage;
|
|
4341
4349
|
function start(event) {
|
|
4342
4350
|
if (unavailableMessage) {
|
|
4343
4351
|
event.preventDefault();
|
|
@@ -4374,7 +4382,7 @@ function ComposerTranscriptionControl({
|
|
|
4374
4382
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4375
4383
|
),
|
|
4376
4384
|
children: [
|
|
4377
|
-
/* @__PURE__ */ jsx4("span", { className: "og-transcription-recovered-label max-w-44 truncate text-og-xs text-og-fg-muted max-sm:max-w-28", children: savedTranscript ?
|
|
4385
|
+
/* @__PURE__ */ jsx4("span", { className: "og-transcription-recovered-label max-w-44 truncate text-og-xs text-og-fg-muted max-sm:max-w-28", children: savedTranscript ? errorMessage ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage ?? messages.errorRetryable : messages.recovered }),
|
|
4378
4386
|
/* @__PURE__ */ jsx4(
|
|
4379
4387
|
Tip,
|
|
4380
4388
|
{
|
|
@@ -4503,12 +4511,12 @@ function ComposerTranscriptionControl({
|
|
|
4503
4511
|
children: /* @__PURE__ */ jsx4(MicIcon, { className: "size-4" })
|
|
4504
4512
|
}
|
|
4505
4513
|
) }, "idle") }),
|
|
4506
|
-
status === "error" &&
|
|
4514
|
+
status === "error" && errorMessage && !recoverable ? /* @__PURE__ */ jsx4(Tip, { tip: errorMessage, children: /* @__PURE__ */ jsx4(
|
|
4507
4515
|
"span",
|
|
4508
4516
|
{
|
|
4509
4517
|
"aria-hidden": "true",
|
|
4510
4518
|
className: "og-transcription-error-label max-w-40 truncate text-og-xs text-og-status-failed max-sm:max-w-24",
|
|
4511
|
-
children:
|
|
4519
|
+
children: errorMessage
|
|
4512
4520
|
}
|
|
4513
4521
|
) }) : null,
|
|
4514
4522
|
/* @__PURE__ */ jsx4(
|
|
@@ -4691,4 +4699,4 @@ export {
|
|
|
4691
4699
|
useVoiceInput,
|
|
4692
4700
|
ComposerTranscriptionControl
|
|
4693
4701
|
};
|
|
4694
|
-
//# sourceMappingURL=chunk-
|
|
4702
|
+
//# sourceMappingURL=chunk-WYVLAAJA.js.map
|