@opengeni/react 3.1.0 → 3.3.2-canary.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/dist/accounts.js +87 -11
- package/dist/accounts.js.map +1 -1
- package/dist/{browser-viewer-AEFHUYZK.js → browser-viewer-MKKFRRRV.js} +3 -3
- package/dist/{chunk-YFKJ7VZH.js → chunk-7EAFGICR.js} +45 -11
- package/dist/chunk-7EAFGICR.js.map +1 -0
- package/dist/{chunk-W6NFJXSA.js → chunk-7KBJLTKS.js} +52 -12
- package/dist/chunk-7KBJLTKS.js.map +1 -0
- package/dist/{chunk-YJFGAFBD.js → chunk-E5KISKFG.js} +241 -97
- package/dist/chunk-E5KISKFG.js.map +1 -0
- package/dist/{chunk-MZ2G2XBA.js → chunk-IOLVN74D.js} +31 -4
- package/dist/chunk-IOLVN74D.js.map +1 -0
- package/dist/{chunk-D3UIAJKY.js → chunk-JAQ5K7W6.js} +3 -2
- package/dist/{chunk-D3UIAJKY.js.map → chunk-JAQ5K7W6.js.map} +1 -1
- package/dist/{chunk-LAKLF4PA.js → chunk-VTOREEXF.js} +8 -7
- package/dist/chunk-VTOREEXF.js.map +1 -0
- package/dist/{chunk-X4A66EWZ.js → chunk-X5S426G2.js} +38 -44
- package/dist/chunk-X5S426G2.js.map +1 -0
- package/dist/{chunk-HQVCKCLG.js → chunk-YG4QEQF5.js} +354 -255
- package/dist/chunk-YG4QEQF5.js.map +1 -0
- package/dist/{chunk-XXWH2JLC.js → chunk-YVCHAQZY.js} +2 -2
- package/dist/{chunk-RGALCTWO.js → chunk-ZKNTK7IA.js} +13 -9
- package/dist/{chunk-RGALCTWO.js.map → chunk-ZKNTK7IA.js.map} +1 -1
- package/dist/{chunk-OAM4WAAM.js → chunk-ZPBTI3TE.js} +2 -2
- package/dist/components/fleet-tile.d.ts +2 -2
- package/dist/components/model-policy-picker.d.ts +9 -0
- package/dist/components/tip-follow.d.ts +16 -0
- package/dist/composer.js +6 -6
- package/dist/hooks/use-file-attachments.d.ts +2 -0
- package/dist/hooks/use-session-events.d.ts +3 -3
- package/dist/index.js +77 -69
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/machines.js +2 -2
- package/dist/model-policy.d.ts +2 -1
- package/dist/model-policy.js +1 -1
- package/dist/realtime.js +47 -8
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.js +4 -4
- package/dist/session.js +4 -4
- package/dist/timeline/entrance.d.ts +13 -1
- package/package.json +3 -2
- package/src/accounts.tsx +116 -14
- package/src/components/composer.tsx +15 -5
- package/src/components/fleet-tile.tsx +4 -15
- package/src/components/message-timeline.tsx +237 -101
- package/src/components/model-policy-picker.tsx +59 -13
- package/src/components/tip-follow.ts +52 -0
- package/src/components/tooltip.tsx +38 -5
- package/src/hooks/use-available-models.ts +20 -14
- package/src/hooks/use-composer.ts +49 -3
- package/src/hooks/use-file-attachments.ts +28 -2
- package/src/hooks/use-goal.ts +31 -7
- package/src/hooks/use-last-started-turn-policy.ts +11 -5
- package/src/hooks/use-session-events.ts +186 -61
- package/src/hooks/use-session-lineage.ts +20 -16
- package/src/hooks/use-session.ts +23 -19
- package/src/hooks/use-workspace-sessions.ts +31 -27
- package/src/lib/format.ts +8 -6
- package/src/model-policy.ts +45 -54
- package/src/realtime/realtime-control.tsx +55 -6
- package/src/timeline/entrance.tsx +28 -3
- package/src/timeline/projection.ts +4 -0
- package/styles/compiled.css +5 -0
- package/dist/chunk-HQVCKCLG.js.map +0 -1
- package/dist/chunk-LAKLF4PA.js.map +0 -1
- package/dist/chunk-MZ2G2XBA.js.map +0 -1
- package/dist/chunk-W6NFJXSA.js.map +0 -1
- package/dist/chunk-X4A66EWZ.js.map +0 -1
- package/dist/chunk-YFKJ7VZH.js.map +0 -1
- package/dist/chunk-YJFGAFBD.js.map +0 -1
- /package/dist/{browser-viewer-AEFHUYZK.js.map → browser-viewer-MKKFRRRV.js.map} +0 -0
- /package/dist/{chunk-XXWH2JLC.js.map → chunk-YVCHAQZY.js.map} +0 -0
- /package/dist/{chunk-OAM4WAAM.js.map → chunk-ZPBTI3TE.js.map} +0 -0
package/dist/interaction.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBrowserSession,
|
|
8
8
|
useBrowserSessions,
|
|
9
9
|
useSiteAuthConnections
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZPBTI3TE.js";
|
|
11
11
|
import {
|
|
12
12
|
ComputerViewer,
|
|
13
13
|
useComputerFrameStream,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
useEmbeddedInterventions
|
|
29
29
|
} from "./chunk-NEXLLTP4.js";
|
|
30
30
|
import "./chunk-JVYQRRC4.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-VTOREEXF.js";
|
|
32
32
|
import "./chunk-22KP6LR5.js";
|
|
33
33
|
|
|
34
34
|
// src/hooks/use-network-routes.ts
|
package/dist/machines.js
CHANGED
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
healthPulses,
|
|
29
29
|
pointsFor,
|
|
30
30
|
useMachines
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YVCHAQZY.js";
|
|
32
32
|
import "./chunk-KZ73RL76.js";
|
|
33
33
|
import "./chunk-NEXLLTP4.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-VTOREEXF.js";
|
|
35
35
|
import "./chunk-22KP6LR5.js";
|
|
36
36
|
export {
|
|
37
37
|
CONNECTION_STATUS_META,
|
package/dist/model-policy.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type ModelPickerBillingClass } from "@opengeni/sdk/model-picker-order";
|
|
1
2
|
import type { ClientModel, ReasoningEffort, WorkspaceModelCatalogModel } from "@opengeni/sdk";
|
|
2
|
-
export type PickerBillingClass =
|
|
3
|
+
export type PickerBillingClass = ModelPickerBillingClass;
|
|
3
4
|
export type PickerModelRow<TCatalog extends ClientModel = WorkspaceModelCatalogModel> = {
|
|
4
5
|
id: string;
|
|
5
6
|
label: string;
|
package/dist/model-policy.js
CHANGED
package/dist/realtime.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PickerAnimatedPage,
|
|
4
4
|
PickerBackHeader,
|
|
5
5
|
PickerNavRow
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-7KBJLTKS.js";
|
|
7
|
+
import "./chunk-X5S426G2.js";
|
|
8
8
|
import {
|
|
9
9
|
usePortalTokenSource,
|
|
10
10
|
usePortalTokenStyle
|
|
@@ -243,17 +243,23 @@ function pruneRealtimeModelCatalogCache(cache, now) {
|
|
|
243
243
|
cache.delete(oldestWorkspaceId);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
function loadRealtimeModelCatalog(client, workspaceId) {
|
|
246
|
+
function loadRealtimeModelCatalog(client, workspaceId, signal) {
|
|
247
247
|
const load = client.getWorkspaceRealtimeModelCatalog;
|
|
248
248
|
if (!load) return null;
|
|
249
|
+
if (signal?.aborted) {
|
|
250
|
+
return Promise.reject(signal.reason ?? new DOMException("Request aborted", "AbortError"));
|
|
251
|
+
}
|
|
249
252
|
const now = Date.now();
|
|
250
253
|
const cache = realtimeModelCatalogCacheFor(client);
|
|
251
254
|
const entry = cache.get(workspaceId);
|
|
252
|
-
if (entry?.state === "loading"
|
|
255
|
+
if (entry?.state === "loading" && !entry.controller.signal.aborted) {
|
|
256
|
+
return consumeRealtimeModelCatalog(entry, signal);
|
|
257
|
+
}
|
|
253
258
|
if (entry?.state === "ready" && entry.expiresAt > now) return Promise.resolve(entry.models);
|
|
254
259
|
if (entry) cache.delete(workspaceId);
|
|
255
260
|
pruneRealtimeModelCatalogCache(cache, now);
|
|
256
|
-
const
|
|
261
|
+
const controller = new AbortController();
|
|
262
|
+
const promise = load.call(client, workspaceId, { signal: controller.signal }).then((response) => response.models.map(toRealtimeModelOption)).then((models) => {
|
|
257
263
|
const current = cache.get(workspaceId);
|
|
258
264
|
if (current?.state === "loading" && current.promise === promise) {
|
|
259
265
|
cache.delete(workspaceId);
|
|
@@ -269,8 +275,39 @@ function loadRealtimeModelCatalog(client, workspaceId) {
|
|
|
269
275
|
if (current?.state === "loading" && current.promise === promise) cache.delete(workspaceId);
|
|
270
276
|
throw error;
|
|
271
277
|
});
|
|
272
|
-
|
|
273
|
-
|
|
278
|
+
const loading = {
|
|
279
|
+
state: "loading",
|
|
280
|
+
promise,
|
|
281
|
+
controller,
|
|
282
|
+
consumers: 0
|
|
283
|
+
};
|
|
284
|
+
cache.set(workspaceId, loading);
|
|
285
|
+
return consumeRealtimeModelCatalog(loading, signal);
|
|
286
|
+
}
|
|
287
|
+
function consumeRealtimeModelCatalog(entry, signal) {
|
|
288
|
+
entry.consumers += 1;
|
|
289
|
+
return new Promise((resolve, reject) => {
|
|
290
|
+
let released = false;
|
|
291
|
+
const release = (abandoned) => {
|
|
292
|
+
if (released) return;
|
|
293
|
+
released = true;
|
|
294
|
+
entry.consumers = Math.max(0, entry.consumers - 1);
|
|
295
|
+
if (abandoned && entry.consumers === 0) {
|
|
296
|
+
entry.controller.abort(
|
|
297
|
+
signal?.reason ?? new DOMException("Request abandoned", "AbortError")
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const onAbort = () => {
|
|
302
|
+
release(true);
|
|
303
|
+
reject(signal?.reason ?? new DOMException("Request aborted", "AbortError"));
|
|
304
|
+
};
|
|
305
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
306
|
+
void entry.promise.then(resolve, reject).finally(() => {
|
|
307
|
+
signal?.removeEventListener("abort", onAbort);
|
|
308
|
+
release(false);
|
|
309
|
+
});
|
|
310
|
+
});
|
|
274
311
|
}
|
|
275
312
|
function codexRealtimeAdmissionAllowed(input) {
|
|
276
313
|
return codexRealtimeAdmissionBlocker(input) === null;
|
|
@@ -532,6 +569,7 @@ function useRealtimeModelSelection(options) {
|
|
|
532
569
|
});
|
|
533
570
|
useEffect(() => {
|
|
534
571
|
let disposed = false;
|
|
572
|
+
const requestAbort = new AbortController();
|
|
535
573
|
const applyCatalog = (models) => {
|
|
536
574
|
catalogScopeRef.current = { client, workspaceId, source: "cache" };
|
|
537
575
|
setCatalog(models);
|
|
@@ -548,7 +586,7 @@ function useRealtimeModelSelection(options) {
|
|
|
548
586
|
}
|
|
549
587
|
return;
|
|
550
588
|
}
|
|
551
|
-
const loading = loadRealtimeModelCatalog(client, workspaceId);
|
|
589
|
+
const loading = loadRealtimeModelCatalog(client, workspaceId, requestAbort.signal);
|
|
552
590
|
if (!loading) return;
|
|
553
591
|
void loading.then((models) => {
|
|
554
592
|
if (disposed) return;
|
|
@@ -556,6 +594,7 @@ function useRealtimeModelSelection(options) {
|
|
|
556
594
|
}).catch(() => void 0);
|
|
557
595
|
return () => {
|
|
558
596
|
disposed = true;
|
|
597
|
+
requestAbort.abort();
|
|
559
598
|
};
|
|
560
599
|
}, [client, workspaceId]);
|
|
561
600
|
useEffect(() => {
|