@opengeni/sdk 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 +57 -2
- package/dist/chunk-DXDL7EEW.js +573 -0
- package/dist/chunk-DXDL7EEW.js.map +1 -0
- package/dist/chunk-OINSI33U.js +97 -0
- package/dist/chunk-OINSI33U.js.map +1 -0
- package/dist/{chunk-B7E4FPNZ.js → chunk-SSQPCFEN.js} +159 -108
- package/dist/chunk-SSQPCFEN.js.map +1 -0
- package/dist/chunk-XBBPYTI5.js +2018 -0
- package/dist/chunk-XBBPYTI5.js.map +1 -0
- package/dist/client.d.ts +39 -4
- package/dist/codex-realtime-controller.d.ts +124 -0
- package/dist/codex-realtime-controller.js +18 -0
- package/dist/codex-realtime-controller.js.map +1 -0
- package/dist/codex-realtime-lifecycle.d.ts +18 -0
- package/dist/codex-realtime-v3-wire.d.ts +86 -0
- package/dist/codex-realtime-v3.d.ts +52 -0
- package/dist/codex-realtime.d.ts +68 -0
- package/dist/core.js +6 -4
- package/dist/gateway-realtime-transport.d.ts +2 -0
- package/dist/gateway-realtime-transport.js +7 -0
- package/dist/gateway-realtime-transport.js.map +1 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.js +40 -6
- package/dist/index.js.map +1 -1
- package/dist/realtime.d.ts +45 -0
- package/dist/realtime.js +73 -0
- package/dist/realtime.js.map +1 -0
- package/dist/types.d.ts +225 -6
- package/dist/workspace-instruction-policies.d.ts +12 -0
- package/dist/workspace-state.d.ts +70 -4
- package/package.json +14 -1
- package/src/client.ts +248 -20
- package/src/codex-realtime-controller.ts +1465 -0
- package/src/codex-realtime-lifecycle.ts +97 -0
- package/src/codex-realtime-v3-wire.ts +349 -0
- package/src/codex-realtime-v3.ts +575 -0
- package/src/codex-realtime.ts +411 -0
- package/src/gateway-realtime-transport.ts +650 -0
- package/src/index.ts +81 -0
- package/src/realtime.ts +172 -0
- package/src/types.ts +280 -6
- package/src/workspace-instruction-policies.ts +13 -0
- package/src/workspace-state.ts +82 -4
- package/dist/chunk-B7E4FPNZ.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -27,6 +27,56 @@ export { parseSseStream } from "./sse";
|
|
|
27
27
|
export type { SseMessage } from "./sse";
|
|
28
28
|
export { normalizeMcpOutput } from "./mcp-output";
|
|
29
29
|
export type { NormalizedMcpOutput } from "./mcp-output";
|
|
30
|
+
export {
|
|
31
|
+
CodexRealtimeMicrophoneError,
|
|
32
|
+
acquireCodexRealtimeMicrophone,
|
|
33
|
+
codexRealtimeMicrophoneHealthy,
|
|
34
|
+
startCodexRealtimeWebrtc,
|
|
35
|
+
} from "./codex-realtime";
|
|
36
|
+
export type {
|
|
37
|
+
AcquireCodexRealtimeMicrophoneOptions,
|
|
38
|
+
CodexRealtimeAudibleOutputState,
|
|
39
|
+
CodexRealtimeConnectionHealth,
|
|
40
|
+
CodexRealtimeMicrophoneErrorCode,
|
|
41
|
+
CodexRealtimeNegotiator,
|
|
42
|
+
CodexRealtimeWebrtcSession,
|
|
43
|
+
StartCodexRealtimeWebrtcOptions,
|
|
44
|
+
} from "./codex-realtime";
|
|
45
|
+
export {
|
|
46
|
+
CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,
|
|
47
|
+
contextAppendChunks,
|
|
48
|
+
createCodexRealtimeV3Bridge,
|
|
49
|
+
encodeCodexRealtimeV3DelegationContextAppend,
|
|
50
|
+
encodeCodexRealtimeV3SessionContextAppend,
|
|
51
|
+
parseCodexRealtimeV3Event,
|
|
52
|
+
} from "./codex-realtime-v3";
|
|
53
|
+
export type {
|
|
54
|
+
CodexRealtimeV3Bridge,
|
|
55
|
+
CodexRealtimeV3BridgeOptions,
|
|
56
|
+
CodexRealtimeV3BridgeSnapshot,
|
|
57
|
+
CodexRealtimeV3ContextAppendChannel,
|
|
58
|
+
CodexRealtimeV3DelegationContextAppend,
|
|
59
|
+
CodexRealtimeV3Event,
|
|
60
|
+
CodexRealtimeV3ParseFailure,
|
|
61
|
+
CodexRealtimeV3ParseResult,
|
|
62
|
+
CodexRealtimeV3SessionContextAppend,
|
|
63
|
+
} from "./codex-realtime-v3";
|
|
64
|
+
export { createCodexRealtimeController } from "./codex-realtime-controller";
|
|
65
|
+
export type {
|
|
66
|
+
CodexRealtimeController,
|
|
67
|
+
CodexRealtimeControllerClient,
|
|
68
|
+
CodexRealtimeDiagnostic,
|
|
69
|
+
CodexRealtimeDiagnosticKind,
|
|
70
|
+
CodexRealtimeControllerSnapshot,
|
|
71
|
+
CodexRealtimeControllerStatus,
|
|
72
|
+
CodexRealtimeMicrophoneState,
|
|
73
|
+
CodexRealtimeOwnerStorage,
|
|
74
|
+
CreateCodexRealtimeControllerOptions,
|
|
75
|
+
RealtimeControllerTransportStarter,
|
|
76
|
+
} from "./codex-realtime-controller";
|
|
77
|
+
export { createGatewayRealtimeTransportStarter } from "./gateway-realtime-transport";
|
|
78
|
+
export { projectSessionRealtimeLifecycle } from "./codex-realtime-lifecycle";
|
|
79
|
+
export type { SessionRealtimeLifecycleProjection } from "./codex-realtime-lifecycle";
|
|
30
80
|
// Desktop (noVNC) transport contract — pure, zero-dep (the RFB import lives in
|
|
31
81
|
// @opengeni/react). URL assembler + connection state machine + rotation fence.
|
|
32
82
|
export { desktopSocketUrl, nextDesktopState, applyUrlRotation } from "./desktop";
|
|
@@ -86,6 +136,7 @@ export type {
|
|
|
86
136
|
WorkspaceInstructionPolicyKind,
|
|
87
137
|
WorkspaceInstructionPolicyListOptions,
|
|
88
138
|
WorkspaceInstructionPolicyListResponse,
|
|
139
|
+
WorkspaceInstructionPolicyOperationReuseResponse,
|
|
89
140
|
WorkspaceInstructionPolicyProvenanceSource,
|
|
90
141
|
WorkspaceInstructionPolicyRevision,
|
|
91
142
|
WorkspaceInstructionPolicyRevisionIdentity,
|
|
@@ -94,7 +145,10 @@ export type {
|
|
|
94
145
|
} from "./workspace-instruction-policies";
|
|
95
146
|
export type {
|
|
96
147
|
WorkspaceStateDocumentStatusCounts,
|
|
148
|
+
WorkspaceStateAttemptGovernance,
|
|
97
149
|
WorkspaceStateGapCode,
|
|
150
|
+
WorkspaceStateGetOptions,
|
|
151
|
+
WorkspaceStateGovernanceDriftStatus,
|
|
98
152
|
WorkspaceStateMemoryKindCounts,
|
|
99
153
|
WorkspaceStateMemoryStatusCounts,
|
|
100
154
|
WorkspaceStateResponse,
|
|
@@ -158,6 +212,7 @@ export type {
|
|
|
158
212
|
WorkspaceTranscriptionTarget,
|
|
159
213
|
} from "./transcription";
|
|
160
214
|
export {
|
|
215
|
+
DEFAULT_FILE_RESOURCE_MOUNT_ROOT,
|
|
161
216
|
KNOWN_PERMISSIONS,
|
|
162
217
|
KNOWN_USAGE_EVENT_TYPES,
|
|
163
218
|
OPENGENI_API_CONTRACT_HEADER,
|
|
@@ -169,10 +224,12 @@ export {
|
|
|
169
224
|
} from "./types";
|
|
170
225
|
export type {
|
|
171
226
|
AccessContext,
|
|
227
|
+
ActivateCodexRealtimeConnectionRequest,
|
|
172
228
|
AccessGrant,
|
|
173
229
|
AccountGrant,
|
|
174
230
|
AccountRole,
|
|
175
231
|
AddWorkspaceMemberRequest,
|
|
232
|
+
BeginSessionRealtimeRequest,
|
|
176
233
|
AgentMessageCompletedPayload,
|
|
177
234
|
AgentTextDeltaPayload,
|
|
178
235
|
AgentToolCallCreatedPayload,
|
|
@@ -215,6 +272,14 @@ export type {
|
|
|
215
272
|
ClientConfig,
|
|
216
273
|
ClientVoiceInputConfig,
|
|
217
274
|
ClientModel,
|
|
275
|
+
CodexRealtimeVoice,
|
|
276
|
+
CodexRealtimeWebrtcRequest,
|
|
277
|
+
CodexRealtimeWebrtcResponse,
|
|
278
|
+
CodexRealtimeWebrtcVersion,
|
|
279
|
+
GatewayRealtimeConnectRequest,
|
|
280
|
+
GatewayRealtimeConnectResponse,
|
|
281
|
+
GatewayRealtimeInitialItem,
|
|
282
|
+
EndSessionRealtimeRequest,
|
|
218
283
|
ModelAvailabilityV1,
|
|
219
284
|
ModelBillingAttributionV1,
|
|
220
285
|
ModelCapabilitiesV1,
|
|
@@ -224,8 +289,16 @@ export type {
|
|
|
224
289
|
ModelCredentialSourceV1,
|
|
225
290
|
ModelPricingScheduleV1,
|
|
226
291
|
ModelPricingV1,
|
|
292
|
+
RenewSessionRealtimeRequest,
|
|
293
|
+
SessionRealtimeEndReason,
|
|
294
|
+
SessionRealtimeMode,
|
|
295
|
+
SessionRealtimeModel,
|
|
296
|
+
SessionRealtimeMutationResponse,
|
|
297
|
+
SessionRealtimeState,
|
|
227
298
|
WorkspaceModelCatalogModel,
|
|
228
299
|
WorkspaceModelCatalogResponse,
|
|
300
|
+
WorkspaceRealtimeModelCatalogItem,
|
|
301
|
+
WorkspaceRealtimeModelCatalogResponse,
|
|
229
302
|
CodexAccount,
|
|
230
303
|
CodexAccountOverview,
|
|
231
304
|
CodexAccountsResponse,
|
|
@@ -261,6 +334,8 @@ export type {
|
|
|
261
334
|
CreateCapabilityCatalogItemRequest,
|
|
262
335
|
OpenGeniSlackBotInstallRequest,
|
|
263
336
|
OpenGeniSlackBotInstallStart,
|
|
337
|
+
SlackReactionChannel,
|
|
338
|
+
SlackReactionChannelListResponse,
|
|
264
339
|
CreateConnectionRequest,
|
|
265
340
|
CreateCheckoutRequest,
|
|
266
341
|
CreateCheckoutResponse,
|
|
@@ -278,6 +353,7 @@ export type {
|
|
|
278
353
|
CreateWorkspaceRequest,
|
|
279
354
|
DiscoverMcpCapabilitiesResponse,
|
|
280
355
|
Document,
|
|
356
|
+
DocumentAuthorityKind,
|
|
281
357
|
DocumentBase,
|
|
282
358
|
DocumentCuration,
|
|
283
359
|
DocumentCurationStatus,
|
|
@@ -313,7 +389,11 @@ export type {
|
|
|
313
389
|
GitHubRepositoriesResponse,
|
|
314
390
|
GoogleDriveBrowseItem,
|
|
315
391
|
GoogleDriveBrowseResponse,
|
|
392
|
+
GoogleDriveConnectionLifecycle,
|
|
393
|
+
GoogleDriveConnectionLifecycleState,
|
|
316
394
|
GoogleDriveConnectionMetadata,
|
|
395
|
+
GoogleDriveDisconnectRequest,
|
|
396
|
+
GoogleDriveLifecycleActionRequest,
|
|
317
397
|
GoogleDriveOAuthStartRequest,
|
|
318
398
|
GoogleDriveOAuthStartResponse,
|
|
319
399
|
GoogleDriveReadPolicy,
|
|
@@ -535,6 +615,7 @@ export type {
|
|
|
535
615
|
UpdateWorkspaceMemberRequest,
|
|
536
616
|
UpdateWorkspaceRequest,
|
|
537
617
|
UpdateWorkspaceSettingsRequest,
|
|
618
|
+
WorkspaceSlackReactionSummonSettings,
|
|
538
619
|
TranscribeAudioResponse,
|
|
539
620
|
UploadFileInput,
|
|
540
621
|
UsageEvent,
|
package/src/realtime.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public, provider-neutral realtime browser SDK.
|
|
3
|
+
*
|
|
4
|
+
* Import this subpath lazily in browser applications. The base `@opengeni/sdk`
|
|
5
|
+
* entry remains free of eager realtime transport initialization.
|
|
6
|
+
*/
|
|
7
|
+
import {
|
|
8
|
+
createCodexRealtimeController,
|
|
9
|
+
hasStoredSessionRealtimeOwnerProof,
|
|
10
|
+
sessionRealtimeOwnerStorageKey,
|
|
11
|
+
sessionRealtimeOwnerStorageNamespace,
|
|
12
|
+
type CodexRealtimeController,
|
|
13
|
+
type CodexRealtimeControllerClient,
|
|
14
|
+
type CodexRealtimeControllerSnapshot,
|
|
15
|
+
type CodexRealtimeControllerStatus,
|
|
16
|
+
type CodexRealtimeDiagnostic,
|
|
17
|
+
type CodexRealtimeDiagnosticKind,
|
|
18
|
+
type CodexRealtimeMicrophoneState,
|
|
19
|
+
type CodexRealtimeOwnerStorage,
|
|
20
|
+
type CreateCodexRealtimeControllerOptions,
|
|
21
|
+
type RealtimeControllerTransportStarter,
|
|
22
|
+
} from "./codex-realtime-controller";
|
|
23
|
+
import { createGatewayRealtimeTransportStarter } from "./gateway-realtime-transport";
|
|
24
|
+
import type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from "./types";
|
|
25
|
+
|
|
26
|
+
/** Exact backend-facing methods required by the batteries-included realtime SDK. */
|
|
27
|
+
export type SessionRealtimeClientLike = CodexRealtimeControllerClient & {
|
|
28
|
+
getWorkspaceRealtimeModelCatalog(
|
|
29
|
+
workspaceId: string,
|
|
30
|
+
): Promise<WorkspaceRealtimeModelCatalogResponse>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type SessionRealtimeTransportKind = "codex" | "gateway";
|
|
34
|
+
|
|
35
|
+
/** Provider-neutral names for the existing, battle-tested controller projection. */
|
|
36
|
+
export type SessionRealtimeController = CodexRealtimeController;
|
|
37
|
+
export type SessionRealtimeControllerSnapshot = CodexRealtimeControllerSnapshot;
|
|
38
|
+
export type SessionRealtimeControllerStatus = CodexRealtimeControllerStatus;
|
|
39
|
+
export type SessionRealtimeDiagnostic = CodexRealtimeDiagnostic;
|
|
40
|
+
export type SessionRealtimeDiagnosticKind = CodexRealtimeDiagnosticKind;
|
|
41
|
+
export type SessionRealtimeMicrophoneState = CodexRealtimeMicrophoneState;
|
|
42
|
+
export type SessionRealtimeOwnerStorage = CodexRealtimeOwnerStorage;
|
|
43
|
+
|
|
44
|
+
export type CreateSessionRealtimeControllerOptions = Omit<
|
|
45
|
+
CreateCodexRealtimeControllerOptions,
|
|
46
|
+
"client" | "model" | "ownerStorageNamespace" | "startTransport"
|
|
47
|
+
> & {
|
|
48
|
+
client: CodexRealtimeControllerClient;
|
|
49
|
+
model: SessionRealtimeModel;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Select the existing transport without exposing provider mechanics to hosts. */
|
|
53
|
+
export function sessionRealtimeTransportKind(
|
|
54
|
+
model: SessionRealtimeModel,
|
|
55
|
+
): SessionRealtimeTransportKind {
|
|
56
|
+
return model === "gpt-live-1-boulder-alpha" ? "codex" : "gateway";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Compose the exact current controller with its existing Codex Live or AI
|
|
61
|
+
* Gateway transport. Wire, ledger, delegation, recovery, and lifecycle
|
|
62
|
+
* semantics remain owned by the existing implementations below this facade.
|
|
63
|
+
*/
|
|
64
|
+
export function createSessionRealtimeController(
|
|
65
|
+
options: CreateSessionRealtimeControllerOptions,
|
|
66
|
+
): SessionRealtimeController {
|
|
67
|
+
const transport = sessionRealtimeTransportKind(options.model);
|
|
68
|
+
return createCodexRealtimeController({
|
|
69
|
+
...options,
|
|
70
|
+
ownerStorageNamespace: sessionRealtimeOwnerStorageNamespace(options.model),
|
|
71
|
+
...(transport === "gateway" ? { startTransport: createGatewayRealtimeTransportStarter() } : {}),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
createCodexRealtimeController,
|
|
77
|
+
createGatewayRealtimeTransportStarter,
|
|
78
|
+
hasStoredSessionRealtimeOwnerProof,
|
|
79
|
+
sessionRealtimeOwnerStorageKey,
|
|
80
|
+
sessionRealtimeOwnerStorageNamespace,
|
|
81
|
+
};
|
|
82
|
+
export type {
|
|
83
|
+
CodexRealtimeController,
|
|
84
|
+
CodexRealtimeControllerClient,
|
|
85
|
+
CodexRealtimeControllerSnapshot,
|
|
86
|
+
CodexRealtimeControllerStatus,
|
|
87
|
+
CodexRealtimeDiagnostic,
|
|
88
|
+
CodexRealtimeDiagnosticKind,
|
|
89
|
+
CodexRealtimeMicrophoneState,
|
|
90
|
+
CodexRealtimeOwnerStorage,
|
|
91
|
+
CreateCodexRealtimeControllerOptions,
|
|
92
|
+
RealtimeControllerTransportStarter,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,
|
|
97
|
+
projectSessionRealtimeLifecycle,
|
|
98
|
+
} from "./codex-realtime-controller";
|
|
99
|
+
export type { SessionRealtimeLifecycleProjection } from "./codex-realtime-lifecycle";
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
CodexRealtimeMicrophoneError,
|
|
103
|
+
acquireCodexRealtimeMicrophone,
|
|
104
|
+
codexRealtimeMicrophoneHealthy,
|
|
105
|
+
startCodexRealtimeWebrtc,
|
|
106
|
+
} from "./codex-realtime";
|
|
107
|
+
export type {
|
|
108
|
+
AcquireCodexRealtimeMicrophoneOptions,
|
|
109
|
+
CodexRealtimeAudibleOutputState,
|
|
110
|
+
CodexRealtimeConnectionHealth,
|
|
111
|
+
CodexRealtimeMicrophoneErrorCode,
|
|
112
|
+
CodexRealtimeNegotiator,
|
|
113
|
+
CodexRealtimeWebrtcSession,
|
|
114
|
+
StartCodexRealtimeWebrtcOptions,
|
|
115
|
+
} from "./codex-realtime";
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,
|
|
119
|
+
CODEX_REALTIME_V3_MAX_EVENT_BYTES,
|
|
120
|
+
CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES,
|
|
121
|
+
CODEX_REALTIME_V3_MAX_TEXT_BYTES,
|
|
122
|
+
CODEX_REALTIME_V3_PENDING_MAX_BYTES,
|
|
123
|
+
CODEX_REALTIME_V3_PENDING_MAX_ENTRIES,
|
|
124
|
+
CODEX_REALTIME_V3_SYNC_MAX_ENTRIES,
|
|
125
|
+
contextAppendChunks,
|
|
126
|
+
createCodexRealtimeV3Bridge,
|
|
127
|
+
encodeCodexRealtimeV3DelegationContextAppend,
|
|
128
|
+
encodeCodexRealtimeV3SessionContextAppend,
|
|
129
|
+
parseCodexRealtimeV3Event,
|
|
130
|
+
} from "./codex-realtime-v3";
|
|
131
|
+
export type {
|
|
132
|
+
CodexRealtimeV3Bridge,
|
|
133
|
+
CodexRealtimeV3BridgeFatal,
|
|
134
|
+
CodexRealtimeV3BridgeOptions,
|
|
135
|
+
CodexRealtimeV3BridgeSnapshot,
|
|
136
|
+
CodexRealtimeV3ContextAppendChannel,
|
|
137
|
+
CodexRealtimeV3DelegationContextAppend,
|
|
138
|
+
CodexRealtimeV3Event,
|
|
139
|
+
CodexRealtimeV3ParseFailure,
|
|
140
|
+
CodexRealtimeV3ParseResult,
|
|
141
|
+
CodexRealtimeV3SessionContextAppend,
|
|
142
|
+
} from "./codex-realtime-v3";
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT,
|
|
146
|
+
CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS,
|
|
147
|
+
} from "./codex-realtime-v3-wire";
|
|
148
|
+
export type { CodexRealtimeInitialItem } from "./codex-realtime-v3-wire";
|
|
149
|
+
|
|
150
|
+
export type {
|
|
151
|
+
ActivateCodexRealtimeConnectionRequest,
|
|
152
|
+
BeginSessionRealtimeRequest,
|
|
153
|
+
CodexRealtimeVoice,
|
|
154
|
+
CodexRealtimeWebrtcRequest,
|
|
155
|
+
CodexRealtimeWebrtcResponse,
|
|
156
|
+
CodexRealtimeWebrtcVersion,
|
|
157
|
+
EndSessionRealtimeRequest,
|
|
158
|
+
GatewayRealtimeConnectRequest,
|
|
159
|
+
GatewayRealtimeConnectResponse,
|
|
160
|
+
GatewayRealtimeInitialItem,
|
|
161
|
+
RenewSessionRealtimeRequest,
|
|
162
|
+
SessionRealtimeEndReason,
|
|
163
|
+
SessionRealtimeLedgerEntry,
|
|
164
|
+
SessionRealtimeMode,
|
|
165
|
+
SessionRealtimeModel,
|
|
166
|
+
SessionRealtimeMutationResponse,
|
|
167
|
+
SessionRealtimeState,
|
|
168
|
+
SyncSessionRealtimeLedgerRequest,
|
|
169
|
+
SyncSessionRealtimeLedgerResponse,
|
|
170
|
+
WorkspaceRealtimeModelCatalogItem,
|
|
171
|
+
WorkspaceRealtimeModelCatalogResponse,
|
|
172
|
+
} from "./types";
|