@opengeni/react 0.36.1 → 0.40.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/README.md +92 -2
- package/dist/{chunk-J2RVJ6JX.js → chunk-4IJCL7YO.js} +13 -2
- package/dist/chunk-4IJCL7YO.js.map +1 -0
- package/dist/{chunk-7CJOAW3V.js → chunk-EB67J347.js} +1 -135
- package/dist/chunk-EB67J347.js.map +1 -0
- package/dist/chunk-EKZH6IDG.js +141 -0
- package/dist/chunk-EKZH6IDG.js.map +1 -0
- package/dist/{chunk-OKKMZDQF.js → chunk-JALF5FI3.js} +9 -7
- package/dist/{chunk-OKKMZDQF.js.map → chunk-JALF5FI3.js.map} +1 -1
- package/dist/{chunk-Z5FV355Z.js → chunk-KR2SK5GJ.js} +1382 -724
- package/dist/chunk-KR2SK5GJ.js.map +1 -0
- package/dist/{chunk-N4XEBE23.js → chunk-OMCFRWHL.js} +22 -13
- package/dist/{chunk-N4XEBE23.js.map → chunk-OMCFRWHL.js.map} +1 -1
- package/dist/{chunk-FT2TXNGZ.js → chunk-Q2NCKWTK.js} +183 -18
- package/dist/chunk-Q2NCKWTK.js.map +1 -0
- package/dist/{chunk-22RM4GMO.js → chunk-SJKT4TKW.js} +26 -2
- package/dist/chunk-SJKT4TKW.js.map +1 -0
- package/dist/{chunk-ALA3UGWB.js → chunk-SXIQK54Z.js} +8 -6
- package/dist/{chunk-ALA3UGWB.js.map → chunk-SXIQK54Z.js.map} +1 -1
- package/dist/chunk-WZT5G5OR.js +433 -0
- package/dist/chunk-WZT5G5OR.js.map +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/components/chat-composer.d.ts +7 -1
- package/dist/components/human-input-form.d.ts +16 -6
- package/dist/components/human-input-surface.d.ts +19 -0
- package/dist/components/machine-input-display.d.ts +12 -0
- package/dist/components/message-timeline.d.ts +6 -1
- package/dist/components/model-policy-picker.d.ts +78 -0
- package/dist/components/session-chrome.d.ts +2 -1
- package/dist/components/tip-follow.d.ts +30 -0
- package/dist/composer.d.ts +2 -0
- package/dist/composer.js +22 -5
- package/dist/hooks/use-composer.d.ts +10 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +2261 -2230
- package/dist/index.js.map +1 -1
- package/dist/machines.js +4 -3
- package/dist/model-policy.d.ts +12 -4
- package/dist/model-policy.js +5 -1
- package/dist/realtime/dropdown-menu.d.ts +16 -0
- package/dist/realtime/realtime-control.d.ts +126 -0
- package/dist/realtime.d.ts +11 -0
- package/dist/realtime.js +1023 -0
- package/dist/realtime.js.map +1 -0
- package/dist/session-context.d.ts +7 -1
- package/dist/session-ui.d.ts +2 -0
- package/dist/session-ui.js +6 -4
- package/dist/session.js +5 -4
- package/dist/timeline/compute-label.d.ts +2 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/types.d.ts +5 -0
- package/package.json +7 -2
- package/src/client.ts +13 -0
- package/src/components/chat-composer.tsx +19 -5
- package/src/components/composer-transcription-control.tsx +2 -2
- package/src/components/composer.tsx +14 -5
- package/src/components/human-input-form.tsx +506 -186
- package/src/components/human-input-surface.tsx +80 -0
- package/src/components/machine-input-display.ts +83 -0
- package/src/components/message-timeline.tsx +348 -308
- package/src/components/model-policy-picker.tsx +587 -0
- package/src/components/sandbox-files.tsx +1 -1
- package/src/components/session-chrome.tsx +141 -15
- package/src/components/tip-follow.ts +127 -6
- package/src/composer.ts +13 -0
- package/src/hooks/use-composer.ts +229 -29
- package/src/index.ts +19 -0
- package/src/model-policy.ts +51 -7
- package/src/realtime/dropdown-menu.tsx +123 -0
- package/src/realtime/realtime-control.tsx +1178 -0
- package/src/realtime.ts +27 -0
- package/src/session-context.ts +16 -0
- package/src/session-ui.ts +2 -0
- package/src/timeline/compute-label.tsx +18 -0
- package/src/timeline/index.ts +3 -0
- package/src/timeline/projection.ts +21 -1
- package/src/timeline/tool-renderers.tsx +232 -43
- package/src/timeline/types.ts +5 -0
- package/styles/index.css +61 -0
- package/styles/tokens.css +2 -0
- package/dist/chunk-22RM4GMO.js.map +0 -1
- package/dist/chunk-7CJOAW3V.js.map +0 -1
- package/dist/chunk-FT2TXNGZ.js.map +0 -1
- package/dist/chunk-J2RVJ6JX.js.map +0 -1
- package/dist/chunk-Z5FV355Z.js.map +0 -1
package/dist/machines.js
CHANGED
|
@@ -24,10 +24,11 @@ import {
|
|
|
24
24
|
healthPulses,
|
|
25
25
|
pointsFor,
|
|
26
26
|
useMachines
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-SXIQK54Z.js";
|
|
28
|
+
import "./chunk-EB67J347.js";
|
|
29
|
+
import "./chunk-EKZH6IDG.js";
|
|
30
30
|
import "./chunk-LAKLF4PA.js";
|
|
31
|
+
import "./chunk-TK7G6XLT.js";
|
|
31
32
|
export {
|
|
32
33
|
CONNECTION_STATUS_META,
|
|
33
34
|
ConnectionDot,
|
package/dist/model-policy.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClientModel, ReasoningEffort, WorkspaceModelCatalogModel } from "@opengeni/sdk";
|
|
2
2
|
export type PickerBillingClass = "opengeni_credits" | "codex_subscription" | "byok";
|
|
3
|
-
export type PickerModelRow = {
|
|
3
|
+
export type PickerModelRow<TCatalog extends ClientModel = WorkspaceModelCatalogModel> = {
|
|
4
4
|
id: string;
|
|
5
5
|
label: string;
|
|
6
6
|
billingClass: PickerBillingClass;
|
|
@@ -9,7 +9,7 @@ export type PickerModelRow = {
|
|
|
9
9
|
unavailableReason: string | null;
|
|
10
10
|
provider: string;
|
|
11
11
|
providerLabel: string;
|
|
12
|
-
catalog:
|
|
12
|
+
catalog: TCatalog;
|
|
13
13
|
};
|
|
14
14
|
export type LatencyModeId = "standard" | "priority" | "fast";
|
|
15
15
|
export declare function billingClassForModel(model: ClientModel): PickerBillingClass;
|
|
@@ -20,13 +20,21 @@ export declare function defaultEffortForModel(model: ClientModel): ReasoningEffo
|
|
|
20
20
|
export declare function coerceReasoningEffortForModel(model: ClientModel, effort: ReasoningEffort): ReasoningEffort;
|
|
21
21
|
export declare function runnableLatencyModesForModel(model: ClientModel): LatencyModeId[];
|
|
22
22
|
export declare function labelLatencyMode(mode: LatencyModeId): string;
|
|
23
|
+
export declare function labelReasoningEffort(effort: ReasoningEffort): string;
|
|
23
24
|
export declare function payerSummaryForModel(model: ClientModel): string;
|
|
24
25
|
export declare function advancedSourceSummary(model: ClientModel): string | null;
|
|
25
26
|
export declare function projectPickerRows(models: WorkspaceModelCatalogModel[]): PickerModelRow[];
|
|
26
|
-
|
|
27
|
-
export declare function
|
|
27
|
+
/** Project the lightweight client-config model list into the same picker contract. */
|
|
28
|
+
export declare function projectClientModelRows(models: ClientModel[]): PickerModelRow<ClientModel>[];
|
|
29
|
+
export declare function sortPickerRows<TCatalog extends ClientModel>(rows: PickerModelRow<TCatalog>[]): PickerModelRow<TCatalog>[];
|
|
30
|
+
export declare function findPickerRow<TCatalog extends ClientModel>(rows: PickerModelRow<TCatalog>[], modelId: string): PickerModelRow<TCatalog> | null;
|
|
28
31
|
export declare function groupPickerRowsByBillingClass(rows: PickerModelRow[]): Array<{
|
|
29
32
|
billingClass: PickerBillingClass;
|
|
30
33
|
label: string;
|
|
31
34
|
rows: PickerModelRow[];
|
|
32
35
|
}>;
|
|
36
|
+
export declare function groupPickerRowsByBillingClass<TCatalog extends ClientModel>(rows: PickerModelRow<TCatalog>[]): Array<{
|
|
37
|
+
billingClass: PickerBillingClass;
|
|
38
|
+
label: string;
|
|
39
|
+
rows: PickerModelRow<TCatalog>[];
|
|
40
|
+
}>;
|
package/dist/model-policy.js
CHANGED
|
@@ -9,11 +9,13 @@ import {
|
|
|
9
9
|
findPickerRow,
|
|
10
10
|
groupPickerRowsByBillingClass,
|
|
11
11
|
labelLatencyMode,
|
|
12
|
+
labelReasoningEffort,
|
|
12
13
|
payerSummaryForModel,
|
|
14
|
+
projectClientModelRows,
|
|
13
15
|
projectPickerRows,
|
|
14
16
|
runnableLatencyModesForModel,
|
|
15
17
|
sortPickerRows
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SJKT4TKW.js";
|
|
17
19
|
export {
|
|
18
20
|
advancedSourceSummary,
|
|
19
21
|
availabilityReasonLabel,
|
|
@@ -25,7 +27,9 @@ export {
|
|
|
25
27
|
findPickerRow,
|
|
26
28
|
groupPickerRowsByBillingClass,
|
|
27
29
|
labelLatencyMode,
|
|
30
|
+
labelReasoningEffort,
|
|
28
31
|
payerSummaryForModel,
|
|
32
|
+
projectClientModelRows,
|
|
29
33
|
projectPickerRows,
|
|
30
34
|
runnableLatencyModesForModel,
|
|
31
35
|
sortPickerRows
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
declare function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
7
|
+
inset?: boolean;
|
|
8
|
+
variant?: "default" | "destructive";
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type EffectiveSessionControl, type SessionEvent, type SessionStatus } from "@opengeni/sdk";
|
|
2
|
+
import { type SessionRealtimeClientLike, type SessionRealtimeController, type SessionRealtimeControllerSnapshot, type CreateSessionRealtimeControllerOptions, type SessionRealtimeModel } from "@opengeni/sdk/realtime";
|
|
3
|
+
import { type RefObject } from "react";
|
|
4
|
+
import type { EmbeddedRealtimeSessionClientLike } from "../client";
|
|
5
|
+
export type RealtimeModelOption = {
|
|
6
|
+
id: SessionRealtimeModel;
|
|
7
|
+
label: string;
|
|
8
|
+
provider: "OpenGeni" | "Connected Codex" | "Your Gateway";
|
|
9
|
+
description: string;
|
|
10
|
+
available: boolean;
|
|
11
|
+
unavailableReason: string | null;
|
|
12
|
+
recommended: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const REALTIME_MODEL_PROVIDERS: readonly ["OpenGeni", "Connected Codex", "Your Gateway"];
|
|
15
|
+
type RealtimeModelProvider = (typeof REALTIME_MODEL_PROVIDERS)[number];
|
|
16
|
+
type RealtimeControllerClient = EmbeddedRealtimeSessionClientLike & SessionRealtimeClientLike;
|
|
17
|
+
export type SessionRealtimeControllerFactory = (options: CreateSessionRealtimeControllerOptions) => SessionRealtimeController;
|
|
18
|
+
type AdmissionInput = {
|
|
19
|
+
sessionStatus: SessionStatus;
|
|
20
|
+
controlState: "active" | "paused";
|
|
21
|
+
settlement: {
|
|
22
|
+
state: string;
|
|
23
|
+
} | null;
|
|
24
|
+
codexConnected: boolean;
|
|
25
|
+
lifecycleActive: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare function codexRealtimeAdmissionAllowed(input: AdmissionInput): boolean;
|
|
28
|
+
export declare function codexRealtimeAdmissionBlocker(input: AdmissionInput): string | null;
|
|
29
|
+
export declare function useSessionRealtime(options: {
|
|
30
|
+
client?: RealtimeControllerClient | undefined;
|
|
31
|
+
workspaceId?: string | undefined;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
sessionStatus: SessionStatus;
|
|
34
|
+
effectiveControl: EffectiveSessionControl;
|
|
35
|
+
events: SessionEvent[];
|
|
36
|
+
eventsReady: boolean;
|
|
37
|
+
codexConnected: boolean;
|
|
38
|
+
model?: SessionRealtimeModel | undefined;
|
|
39
|
+
modelAvailable?: boolean | undefined;
|
|
40
|
+
modelUnavailableReason?: string | null | undefined;
|
|
41
|
+
/** Deterministic browser-test/demo seam. Production hosts should use the SDK default. */
|
|
42
|
+
controllerFactory?: SessionRealtimeControllerFactory | undefined;
|
|
43
|
+
}): {
|
|
44
|
+
snapshot: import("@opengeni/sdk").CodexRealtimeControllerSnapshot;
|
|
45
|
+
lifecycleActive: boolean;
|
|
46
|
+
canStart: boolean;
|
|
47
|
+
admissionBlocker: string | null;
|
|
48
|
+
codexConnected: boolean;
|
|
49
|
+
audioRef: RefObject<HTMLAudioElement | null>;
|
|
50
|
+
start: () => Promise<void>;
|
|
51
|
+
stop: () => Promise<void>;
|
|
52
|
+
retry: () => Promise<void>;
|
|
53
|
+
retryAudibleOutput: () => Promise<void>;
|
|
54
|
+
setInputMuted: (muted: boolean) => void;
|
|
55
|
+
setOutputMuted: (muted: boolean) => void;
|
|
56
|
+
};
|
|
57
|
+
export declare function SessionRealtimeControl(props: {
|
|
58
|
+
client?: RealtimeControllerClient | undefined;
|
|
59
|
+
workspaceId?: string | undefined;
|
|
60
|
+
sessionId: string;
|
|
61
|
+
sessionStatus: SessionStatus;
|
|
62
|
+
effectiveControl: EffectiveSessionControl;
|
|
63
|
+
events: SessionEvent[];
|
|
64
|
+
eventsReady: boolean;
|
|
65
|
+
codexConnected: boolean;
|
|
66
|
+
realtimeAutostartModel?: SessionRealtimeModel | undefined;
|
|
67
|
+
onRealtimeAutostartConsumed?: (() => void) | undefined;
|
|
68
|
+
/** Deterministic browser-test/demo seam. Production hosts should use the SDK default. */
|
|
69
|
+
controllerFactory?: SessionRealtimeControllerFactory | undefined;
|
|
70
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export declare function useRealtimeModelSelection(options: {
|
|
72
|
+
client?: RealtimeControllerClient | undefined;
|
|
73
|
+
workspaceId?: string | undefined;
|
|
74
|
+
codexConnected: boolean;
|
|
75
|
+
activeModel?: SessionRealtimeModel | null | undefined;
|
|
76
|
+
}): {
|
|
77
|
+
models: RealtimeModelOption[];
|
|
78
|
+
selectedModel: RealtimeModelOption;
|
|
79
|
+
selectModel: (value: string) => void;
|
|
80
|
+
};
|
|
81
|
+
export declare function NewSessionRealtimeControl(props: {
|
|
82
|
+
client?: RealtimeControllerClient | undefined;
|
|
83
|
+
workspaceId?: string | undefined;
|
|
84
|
+
codexConnected: boolean;
|
|
85
|
+
disabled?: boolean | undefined;
|
|
86
|
+
disabledReason?: string | null | undefined;
|
|
87
|
+
onStart: (model: SessionRealtimeModel) => Promise<boolean>;
|
|
88
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
export declare function RealtimeVoiceControl(props: {
|
|
90
|
+
snapshot: SessionRealtimeControllerSnapshot;
|
|
91
|
+
canStart: boolean;
|
|
92
|
+
admissionBlocker?: string | null | undefined;
|
|
93
|
+
modelAvailable: boolean;
|
|
94
|
+
selectionDisabled?: boolean | undefined;
|
|
95
|
+
/** Prefer `bottom` on home/new-session; `top` for the docked session composer. */
|
|
96
|
+
menuSide?: "top" | "bottom" | undefined;
|
|
97
|
+
showDiagnostics?: boolean;
|
|
98
|
+
audioRef: RefObject<HTMLAudioElement | null>;
|
|
99
|
+
selectedModel?: RealtimeModelOption | undefined;
|
|
100
|
+
models?: readonly RealtimeModelOption[] | undefined;
|
|
101
|
+
onSelectModel?: ((modelId: string) => void) | undefined;
|
|
102
|
+
onStart: () => Promise<void>;
|
|
103
|
+
onStop: () => Promise<void>;
|
|
104
|
+
onRetry: () => Promise<void>;
|
|
105
|
+
onRetryAudibleOutput: () => Promise<void>;
|
|
106
|
+
onSetInputMuted: (muted: boolean) => void;
|
|
107
|
+
onSetOutputMuted: (muted: boolean) => void;
|
|
108
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare function RealtimeModelPickerMenu(props: {
|
|
110
|
+
models: readonly RealtimeModelOption[];
|
|
111
|
+
selectedModel: RealtimeModelOption;
|
|
112
|
+
provider: RealtimeModelProvider | null;
|
|
113
|
+
direction: 1 | -1;
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
onProviderChange: (provider: RealtimeModelProvider | null, direction: 1 | -1) => void;
|
|
116
|
+
onSelect: (modelId: SessionRealtimeModel) => void;
|
|
117
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
/** @deprecated Use the provider-neutral realtime names. */
|
|
119
|
+
export declare const useSessionCodexRealtime: typeof useSessionRealtime;
|
|
120
|
+
/** @deprecated Use the provider-neutral realtime names. */
|
|
121
|
+
export declare const useWorkspaceRealtimeModelSelection: typeof useRealtimeModelSelection;
|
|
122
|
+
/** @deprecated Use the provider-neutral realtime names. */
|
|
123
|
+
export declare const SessionCodexRealtimeControl: typeof SessionRealtimeControl;
|
|
124
|
+
/** @deprecated Use the provider-neutral realtime names. */
|
|
125
|
+
export declare const CodexRealtimeControl: typeof RealtimeVoiceControl;
|
|
126
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batteries-included realtime voice controls and hooks.
|
|
3
|
+
*
|
|
4
|
+
* Import this subpath lazily when the composer action slot is rendered. The
|
|
5
|
+
* base `@opengeni/react` entry remains SSR/browser safe and does not eagerly
|
|
6
|
+
* load microphone, WebRTC, Gateway, or realtime UI code.
|
|
7
|
+
*/
|
|
8
|
+
export { CodexRealtimeControl, NewSessionRealtimeControl, RealtimeModelPickerMenu, RealtimeVoiceControl, SessionCodexRealtimeControl, SessionRealtimeControl, codexRealtimeAdmissionAllowed, codexRealtimeAdmissionBlocker, useRealtimeModelSelection, useSessionCodexRealtime, useSessionRealtime, useWorkspaceRealtimeModelSelection, } from "./realtime/realtime-control";
|
|
9
|
+
export type { RealtimeModelOption, SessionRealtimeControllerFactory, } from "./realtime/realtime-control";
|
|
10
|
+
export type { EmbeddedRealtimeSessionClientLike } from "./client";
|
|
11
|
+
export type { EmbeddedRealtimeSessionClientOverride } from "./session-context";
|