@opengeni/react 7.6.1-canary.37073905159001 → 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldSteerOnKey,
|
|
3
3
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DV2DBNPQ.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-CHPKSLPN.js";
|
|
15
15
|
import {
|
|
16
16
|
ComposerResponsiveContext
|
|
17
17
|
} from "./chunk-VZTQ73XT.js";
|
|
@@ -19,10 +19,7 @@ import {
|
|
|
19
19
|
composerSubmissionErrorMessage,
|
|
20
20
|
formatBytes,
|
|
21
21
|
formatRelativeTime
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
useErrorMessage
|
|
25
|
-
} from "./chunk-UGLEYEMP.js";
|
|
22
|
+
} from "./chunk-UJRYEWZI.js";
|
|
26
23
|
import {
|
|
27
24
|
cn
|
|
28
25
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -31,7 +28,6 @@ import {
|
|
|
31
28
|
var OPEN_WORKSTREAM_CONTROL_EVENT = "opengeni:open-workstream-control";
|
|
32
29
|
|
|
33
30
|
// src/commands/registry.ts
|
|
34
|
-
import { formatErrorMessage } from "@opengeni/sdk";
|
|
35
31
|
function parseCommandLine(value) {
|
|
36
32
|
if (value[0] !== "/") {
|
|
37
33
|
return null;
|
|
@@ -150,10 +146,7 @@ var defaultCommands = [
|
|
|
150
146
|
});
|
|
151
147
|
return { status: "ok", message: action === "pause" ? "Goal paused." : "Goal resumed." };
|
|
152
148
|
} catch (cause) {
|
|
153
|
-
return {
|
|
154
|
-
status: "error",
|
|
155
|
-
message: commandErrorMessage(ctx, cause, goalErrorMessage(cause, action))
|
|
156
|
-
};
|
|
149
|
+
return { status: "error", message: goalErrorMessage(cause, action) };
|
|
157
150
|
}
|
|
158
151
|
}
|
|
159
152
|
},
|
|
@@ -168,7 +161,7 @@ var defaultCommands = [
|
|
|
168
161
|
const result = await ctx.client.compactSessionContext(ctx.workspaceId, sessionId);
|
|
169
162
|
return { status: "ok", message: result.message };
|
|
170
163
|
} catch (cause) {
|
|
171
|
-
return { status: "error", message:
|
|
164
|
+
return { status: "error", message: errorMessage(cause) ?? "Could not compact context." };
|
|
172
165
|
}
|
|
173
166
|
}
|
|
174
167
|
},
|
|
@@ -188,16 +181,16 @@ var defaultCommands = [
|
|
|
188
181
|
await ctx.client.clearSessionContext(ctx.workspaceId, sessionId);
|
|
189
182
|
return { status: "ok", message: "Context cleared." };
|
|
190
183
|
} catch (cause) {
|
|
191
|
-
return {
|
|
192
|
-
status: "error",
|
|
193
|
-
message: commandErrorMessage(ctx, cause, clearErrorMessage(cause))
|
|
194
|
-
};
|
|
184
|
+
return { status: "error", message: clearErrorMessage(cause) };
|
|
195
185
|
}
|
|
196
186
|
}
|
|
197
187
|
}
|
|
198
188
|
];
|
|
199
|
-
function
|
|
200
|
-
|
|
189
|
+
function errorMessage(cause) {
|
|
190
|
+
if (cause && typeof cause === "object" && "message" in cause && typeof cause.message === "string") {
|
|
191
|
+
return cause.message;
|
|
192
|
+
}
|
|
193
|
+
return void 0;
|
|
201
194
|
}
|
|
202
195
|
function statusCode(cause) {
|
|
203
196
|
if (cause && typeof cause === "object" && "status" in cause && typeof cause.status === "number") {
|
|
@@ -213,19 +206,18 @@ function goalErrorMessage(cause, action) {
|
|
|
213
206
|
if (code === 409) {
|
|
214
207
|
return action === "resume" ? "Only a paused goal can be resumed." : "Goal is already in a terminal state.";
|
|
215
208
|
}
|
|
216
|
-
return
|
|
209
|
+
return errorMessage(cause) ?? `Could not ${action} the goal.`;
|
|
217
210
|
}
|
|
218
211
|
function clearErrorMessage(cause) {
|
|
219
212
|
if (statusCode(cause) === 409) {
|
|
220
213
|
return "Pause the session and wait for the current inference to settle, then clear context.";
|
|
221
214
|
}
|
|
222
|
-
return
|
|
215
|
+
return errorMessage(cause) ?? "Could not clear context.";
|
|
223
216
|
}
|
|
224
217
|
|
|
225
218
|
// src/hooks/use-slash-commands.ts
|
|
226
219
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
227
220
|
function useSlashCommands(options) {
|
|
228
|
-
const formatError = useErrorMessage();
|
|
229
221
|
const { commands, context, handlers, value, setValue } = options;
|
|
230
222
|
const [highlight, setHighlight] = useState(0);
|
|
231
223
|
const [dismissedValue, setDismissedValue] = useState(null);
|
|
@@ -269,9 +261,9 @@ function useSlashCommands(options) {
|
|
|
269
261
|
if (!context) {
|
|
270
262
|
return null;
|
|
271
263
|
}
|
|
272
|
-
return { ...context, ...handlers,
|
|
264
|
+
return { ...context, ...handlers, confirm: () => handlers.confirm(command) };
|
|
273
265
|
},
|
|
274
|
-
[context, handlers
|
|
266
|
+
[context, handlers]
|
|
275
267
|
);
|
|
276
268
|
const execute = useCallback(
|
|
277
269
|
async (command, args) => {
|
|
@@ -288,10 +280,10 @@ function useSlashCommands(options) {
|
|
|
288
280
|
setValue("");
|
|
289
281
|
}
|
|
290
282
|
} catch (cause) {
|
|
291
|
-
ctx.notice({ tone: "error", message:
|
|
283
|
+
ctx.notice({ tone: "error", message: errorMessage2(cause) });
|
|
292
284
|
}
|
|
293
285
|
},
|
|
294
|
-
[buildContext, setValue
|
|
286
|
+
[buildContext, setValue]
|
|
295
287
|
);
|
|
296
288
|
const autocomplete = useCallback(
|
|
297
289
|
(command) => {
|
|
@@ -425,6 +417,12 @@ function useSlashCommands(options) {
|
|
|
425
417
|
autocompleteHighlighted
|
|
426
418
|
};
|
|
427
419
|
}
|
|
420
|
+
function errorMessage2(cause) {
|
|
421
|
+
if (cause instanceof Error) {
|
|
422
|
+
return cause.message;
|
|
423
|
+
}
|
|
424
|
+
return String(cause);
|
|
425
|
+
}
|
|
428
426
|
|
|
429
427
|
// src/components/command-palette.tsx
|
|
430
428
|
import { AnimatePresence, motion } from "motion/react";
|
|
@@ -649,9 +647,7 @@ var defaultChatComposerMessages = {
|
|
|
649
647
|
messagePlaceholder: "Message the agent\u2026",
|
|
650
648
|
pausedPlaceholder: "Message the agent \u2014 it will wait in the queue\u2026",
|
|
651
649
|
inputLabel: "Message the agent",
|
|
652
|
-
|
|
653
|
-
// the host supplies its own hint.
|
|
654
|
-
keyboardHint: "",
|
|
650
|
+
keyboardHint: "Enter to queue \xB7 Cmd/Ctrl+Enter to steer \xB7 Shift+Enter for a new line",
|
|
655
651
|
slashCommandBlocked: "That's a slash command \u2014 press Enter in the command list to run it, or edit the line to send a message.",
|
|
656
652
|
controlChangedError: "This workstream was paused while you were sending. Nothing was sent, and your draft is still here.",
|
|
657
653
|
sendFailedError: "Sending failed \u2014 your draft is still here. Try again.",
|
|
@@ -788,7 +784,6 @@ function useChatComposerController({
|
|
|
788
784
|
onPaste,
|
|
789
785
|
messages: messageOverrides
|
|
790
786
|
}) {
|
|
791
|
-
const formatError = useErrorMessage();
|
|
792
787
|
const messages = useMemo3(
|
|
793
788
|
() => ({ ...defaultChatComposerMessages, ...messageOverrides }),
|
|
794
789
|
[messageOverrides]
|
|
@@ -1032,10 +1027,7 @@ function useChatComposerController({
|
|
|
1032
1027
|
);
|
|
1033
1028
|
const activeNotice = notice ?? (delivery.error ? {
|
|
1034
1029
|
tone: "error",
|
|
1035
|
-
message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError :
|
|
1036
|
-
delivery.error,
|
|
1037
|
-
composerSubmissionErrorMessage(delivery.error) || messages.sendFailedError
|
|
1038
|
-
)
|
|
1030
|
+
message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError : composerSubmissionErrorMessage(delivery.error) || messages.sendFailedError
|
|
1039
1031
|
} : null);
|
|
1040
1032
|
useEffect(() => {
|
|
1041
1033
|
if (notice?.tone !== "ok") return;
|
|
@@ -4344,8 +4336,8 @@ function ComposerTranscriptionControl({
|
|
|
4344
4336
|
const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
|
|
4345
4337
|
const unavailableMessage = composer.disabled ? messages.unavailableDisabled : !capability?.available || !workspaceEnabled ? messages.unavailable : !transcription.available ? messages.errorStorageUnavailable : null;
|
|
4346
4338
|
const idleLabel = unavailableMessage ?? (status === "error" ? messages.retry : messages.start);
|
|
4347
|
-
const
|
|
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" ?
|
|
4339
|
+
const errorMessage3 = transcription.error ? transcriptionErrorMessage(transcription.error, messages) : null;
|
|
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" ? errorMessage3 ?? messages.errorUnknown : unavailableMessage;
|
|
4349
4341
|
function start(event) {
|
|
4350
4342
|
if (unavailableMessage) {
|
|
4351
4343
|
event.preventDefault();
|
|
@@ -4382,7 +4374,7 @@ function ComposerTranscriptionControl({
|
|
|
4382
4374
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4383
4375
|
),
|
|
4384
4376
|
children: [
|
|
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 ?
|
|
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 ? errorMessage3 ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage3 ?? messages.errorRetryable : messages.recovered }),
|
|
4386
4378
|
/* @__PURE__ */ jsx4(
|
|
4387
4379
|
Tip,
|
|
4388
4380
|
{
|
|
@@ -4511,12 +4503,12 @@ function ComposerTranscriptionControl({
|
|
|
4511
4503
|
children: /* @__PURE__ */ jsx4(MicIcon, { className: "size-4" })
|
|
4512
4504
|
}
|
|
4513
4505
|
) }, "idle") }),
|
|
4514
|
-
status === "error" &&
|
|
4506
|
+
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */ jsx4(Tip, { tip: errorMessage3, children: /* @__PURE__ */ jsx4(
|
|
4515
4507
|
"span",
|
|
4516
4508
|
{
|
|
4517
4509
|
"aria-hidden": "true",
|
|
4518
4510
|
className: "og-transcription-error-label max-w-40 truncate text-og-xs text-og-status-failed max-sm:max-w-24",
|
|
4519
|
-
children:
|
|
4511
|
+
children: errorMessage3
|
|
4520
4512
|
}
|
|
4521
4513
|
) }) : null,
|
|
4522
4514
|
/* @__PURE__ */ jsx4(
|
|
@@ -4699,4 +4691,4 @@ export {
|
|
|
4699
4691
|
useVoiceInput,
|
|
4700
4692
|
ComposerTranscriptionControl
|
|
4701
4693
|
};
|
|
4702
|
-
//# sourceMappingURL=chunk-
|
|
4694
|
+
//# sourceMappingURL=chunk-YRYF2GLG.js.map
|