@opengeni/sdk 1.3.0 → 1.4.2

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.
Files changed (59) hide show
  1. package/README.md +25 -3
  2. package/dist/adapters/next.js +2 -2
  3. package/dist/artifacts.js +4 -4
  4. package/dist/azure-live-transport.d.ts +32 -0
  5. package/dist/browser.js +3 -3
  6. package/dist/chat/index.js +5 -5
  7. package/dist/{chunk-IB6SUE3R.js → chunk-DTIMLEPB.js} +1 -1
  8. package/dist/chunk-DTIMLEPB.js.map +1 -0
  9. package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
  10. package/dist/chunk-GZQSWAKD.js.map +1 -0
  11. package/dist/{chunk-2UXZUCEZ.js → chunk-JOI7XCG6.js} +110 -9
  12. package/dist/chunk-JOI7XCG6.js.map +1 -0
  13. package/dist/{chunk-CREM7YRK.js → chunk-TRUFUTDI.js} +2 -2
  14. package/dist/{chunk-CNSPJYF6.js → chunk-TX6ED3AP.js} +210 -6
  15. package/dist/chunk-TX6ED3AP.js.map +1 -0
  16. package/dist/{chunk-ZBICMU4Z.js → chunk-XIQIV4VL.js} +2 -2
  17. package/dist/{chunk-G5NZGPTB.js → chunk-XPWH3HKG.js} +2 -2
  18. package/dist/{chunk-YVH2PH4X.js → chunk-YWLJGEUB.js} +2 -2
  19. package/dist/{chunk-RSKO3CMZ.js → chunk-ZOSRUR2Q.js} +2 -2
  20. package/dist/codex-realtime-controller.d.ts +13 -0
  21. package/dist/codex-realtime-controller.js +3 -1
  22. package/dist/codex-realtime-v3-wire.d.ts +3 -2
  23. package/dist/codex-realtime.d.ts +4 -0
  24. package/dist/core.js +4 -4
  25. package/dist/document-authority.js +3 -3
  26. package/dist/editable-artifacts.js +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/index.js +55 -18
  29. package/dist/index.js.map +1 -1
  30. package/dist/realtime.d.ts +1 -1
  31. package/dist/realtime.js +248 -2
  32. package/dist/realtime.js.map +1 -1
  33. package/dist/session-proxy-client.d.ts +7 -3
  34. package/dist/session-proxy.d.ts +38 -7
  35. package/dist/session-proxy.js +2 -2
  36. package/dist/site.js +3 -3
  37. package/dist/transcription.d.ts +1 -1
  38. package/dist/types.d.ts +47 -8
  39. package/package.json +3 -3
  40. package/src/azure-live-transport.ts +286 -0
  41. package/src/codex-realtime-controller.ts +148 -4
  42. package/src/codex-realtime-v3-wire.ts +4 -3
  43. package/src/codex-realtime-v3.ts +11 -2
  44. package/src/codex-realtime.ts +9 -1
  45. package/src/index.ts +3 -0
  46. package/src/realtime.ts +15 -6
  47. package/src/session-proxy-client.ts +7 -3
  48. package/src/session-proxy.ts +321 -11
  49. package/src/transcription.ts +3 -0
  50. package/src/types.ts +49 -5
  51. package/dist/chunk-2UXZUCEZ.js.map +0 -1
  52. package/dist/chunk-CNSPJYF6.js.map +0 -1
  53. package/dist/chunk-IB6SUE3R.js.map +0 -1
  54. package/dist/chunk-VYCTL62C.js.map +0 -1
  55. /package/dist/{chunk-CREM7YRK.js.map → chunk-TRUFUTDI.js.map} +0 -0
  56. /package/dist/{chunk-ZBICMU4Z.js.map → chunk-XIQIV4VL.js.map} +0 -0
  57. /package/dist/{chunk-G5NZGPTB.js.map → chunk-XPWH3HKG.js.map} +0 -0
  58. /package/dist/{chunk-YVH2PH4X.js.map → chunk-YWLJGEUB.js.map} +0 -0
  59. /package/dist/{chunk-RSKO3CMZ.js.map → chunk-ZOSRUR2Q.js.map} +0 -0
package/README.md CHANGED
@@ -188,7 +188,23 @@ and, unless `modelSelection: false`, the user's explicit model choices, so it
188
188
  needs the `createSession` hook. The hook sees them as input; the proxy adds the
189
189
  files and applies those choices to the request the hook returns. Voice input
190
190
  (`POST .../transcriptions`) is forwarded as the resolved user unless
191
- `voiceInput: false`.
191
+ `voiceInput: false`. The client config the proxy serves reports what it can do:
192
+ `sessionCreation` (a `createSession` hook exists), `archive`, and `artifacts`
193
+ (`false` unless `artifacts: true`). The stock UI hides "New chat" and
194
+ "Archive" when they are off, shows Site previews as unavailable without a
195
+ request, and shows the composer microphone only when `voiceInput.available`.
196
+
197
+ Live voice (speech-to-speech) is forwarded the same way unless
198
+ `realtimeVoice: false`: the workspace's voice model catalog and the call routes
199
+ under `.../sessions/{id}/realtime` (start, provider connect, heartbeat,
200
+ activate, transcript sync, end). Opengeni still checks the user's
201
+ `sessions:control` permission, binds the call to that user and browser, runs
202
+ spoken requests as steers of the same chat, and meters deployment-funded voice
203
+ against your credits. `authorizeSession` runs on every call route, and
204
+ `beforeForwardMessage` sees `delivery: "realtime"` when a call starts (refuse
205
+ it, or return `mcpCredentialUpdates`; the proxy also refreshes the `toolServer`
206
+ token) and before transcripts and spoken requests are saved (refuse them, or add
207
+ `modelContext`, which must be the same when a request is retried).
192
208
 
193
209
  `listSessionPage` includes personal pinned details by default. A caller with a
194
210
  separate `pinsOnly: true` read can pass `includePinned: false` on ordinary pages
@@ -209,8 +225,14 @@ workspace. Only the native routes `OpenGeniProvider` and the conversation use
209
225
  are served: client config; workspace read, model catalog, live control stream,
210
226
  and workspace Resume; session read/rename, events (list and SSE with
211
227
  `Last-Event-ID` resume), send/steer/approval/human-input, queue, composer
212
- draft, pause/resume; and, unless `files: false`, attachment upload and download
213
- URLs. Every other route or method is a 404 (cancel and workspace Pause are
228
+ draft, pause/resume, and the session goal (read; pause/resume, forwarding only
229
+ `{ status: "paused" | "active" }`; and clear, the proxy's only `DELETE`); and, unless `files: false`, attachment upload and download
230
+ URLs plus the media the session produced (generated images and video,
231
+ published files, and browser or computer screenshots). Workspace-level
232
+ artifact reads (`artifacts/:id/content` with `Range`, `artifacts/:id/playback-source`)
233
+ must name their session in `x-opengeni-session-id`; the proxy runs
234
+ `authorizeSession` and forwards only an artifact OpenGeni proves that session
235
+ produced. Every other route or method is a 404 (cancel and workspace Pause are
214
236
  refused); unknown query parameters on served reads pass through. Browser session creation is disabled
215
237
  unless you supply `createSession`; the browser may then send only
216
238
  `initialMessage` and `idempotencyKey`, and your hook returns the full request
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createSessionProxyHandler
3
- } from "../chunk-CNSPJYF6.js";
3
+ } from "../chunk-TX6ED3AP.js";
4
4
  import "../chunk-UM4ZXXJR.js";
5
5
  import "../chunk-U6CV2SXO.js";
6
6
  import "../chunk-APXVSSSY.js";
7
- import "../chunk-IB6SUE3R.js";
7
+ import "../chunk-DTIMLEPB.js";
8
8
  import "../chunk-V6GIY62B.js";
9
9
 
10
10
  // src/adapters/next.ts
package/dist/artifacts.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-YVH2PH4X.js";
4
- import "./chunk-G5NZGPTB.js";
5
- import "./chunk-RSKO3CMZ.js";
3
+ } from "./chunk-YWLJGEUB.js";
4
+ import "./chunk-XPWH3HKG.js";
5
+ import "./chunk-ZOSRUR2Q.js";
6
6
  import "./chunk-VPVMLM7Q.js";
7
7
  import "./chunk-APXVSSSY.js";
8
- import "./chunk-IB6SUE3R.js";
8
+ import "./chunk-DTIMLEPB.js";
9
9
  import "./chunk-NC57YMUO.js";
10
10
  import "./chunk-V6GIY62B.js";
11
11
  export {
@@ -0,0 +1,32 @@
1
+ import { type StartCodexRealtimeWebrtcOptions } from "./codex-realtime.js";
2
+ import type { RealtimeControllerTransportStarter } from "./codex-realtime-controller.js";
3
+ /** Azure Live has timed transcript fragments, not provider-finalized turns. */
4
+ export declare class AzureLiveDataChannel extends EventTarget {
5
+ private readonly raw;
6
+ private readonly drainTimeoutMs;
7
+ private pending;
8
+ private timer;
9
+ private ordinal;
10
+ private readonly prefix;
11
+ private closed;
12
+ private closeSent;
13
+ private providerClosed;
14
+ private readonly delegations;
15
+ private userSinceDelegation;
16
+ private draining;
17
+ private finishDrain;
18
+ private readonly onOpen;
19
+ private readonly onClose;
20
+ private readonly onError;
21
+ private readonly onMessage;
22
+ constructor(raw: RTCDataChannel, drainTimeoutMs?: number);
23
+ get readyState(): RTCDataChannelState;
24
+ asRtcDataChannel(): RTCDataChannel;
25
+ private emit;
26
+ private flush;
27
+ private receive;
28
+ send(payload: string): void;
29
+ drain(): Promise<void>;
30
+ close(): void;
31
+ }
32
+ export declare function createAzureLiveTransportStarter(options?: Pick<StartCodexRealtimeWebrtcOptions, "remoteAudio" | "createPeerConnection">): RealtimeControllerTransportStarter;
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveWorkspaceVoiceInputEnabled
3
- } from "./chunk-VYCTL62C.js";
3
+ } from "./chunk-GZQSWAKD.js";
4
4
  import {
5
5
  OpenGeniToolCallError,
6
6
  OpenGeniToolReapprovalRequiredError,
@@ -8,13 +8,13 @@ import {
8
8
  } from "./chunk-4SMEOV3P.js";
9
9
  import {
10
10
  OpenGeniClient
11
- } from "./chunk-RSKO3CMZ.js";
11
+ } from "./chunk-ZOSRUR2Q.js";
12
12
  import "./chunk-VPVMLM7Q.js";
13
13
  import "./chunk-APXVSSSY.js";
14
14
  import {
15
15
  OPENGENI_API_CONTRACT_HEADER,
16
16
  OPENGENI_API_CONTRACT_REVISION
17
- } from "./chunk-IB6SUE3R.js";
17
+ } from "./chunk-DTIMLEPB.js";
18
18
  import "./chunk-NC57YMUO.js";
19
19
  import {
20
20
  OpenGeniAllowanceExhaustedError,
@@ -11,18 +11,18 @@ import {
11
11
  EMPTY_FINAL_REPLY_NOTICE,
12
12
  OpenGeniEmbeddingClient,
13
13
  turnCompletedWithEmptyFinalReply
14
- } from "../chunk-ZBICMU4Z.js";
15
- import "../chunk-YVH2PH4X.js";
16
- import "../chunk-G5NZGPTB.js";
14
+ } from "../chunk-XIQIV4VL.js";
15
+ import "../chunk-YWLJGEUB.js";
16
+ import "../chunk-XPWH3HKG.js";
17
17
  import {
18
18
  chatDefaults
19
19
  } from "../chunk-UM4ZXXJR.js";
20
- import "../chunk-RSKO3CMZ.js";
20
+ import "../chunk-ZOSRUR2Q.js";
21
21
  import "../chunk-VPVMLM7Q.js";
22
22
  import {
23
23
  parseSseStream
24
24
  } from "../chunk-APXVSSSY.js";
25
- import "../chunk-IB6SUE3R.js";
25
+ import "../chunk-DTIMLEPB.js";
26
26
  import "../chunk-NC57YMUO.js";
27
27
  import {
28
28
  OpenGeniApiError,
@@ -250,4 +250,4 @@ export {
250
250
  GENERATED_VIDEO_MAX_BYTES,
251
251
  KNOWN_USAGE_EVENT_TYPES
252
252
  };
253
- //# sourceMappingURL=chunk-IB6SUE3R.js.map
253
+ //# sourceMappingURL=chunk-DTIMLEPB.js.map