@urun-sh/openai 0.6.52 → 0.6.54

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.
@@ -420,6 +420,17 @@ interface RealtimeBinding<S = unknown> {
420
420
  * the leg — the loud `session_gone` close carries the name.
421
421
  */
422
422
  composite?: true;
423
+ /**
424
+ * THE DUPLEX ENGINE: the backend is a self-turning full-duplex speech
425
+ * engine (the s2s cascade, Moshi-class models) that decides its OWN turns
426
+ * and serves no upstream turn seam. The connection subscribes its voice
427
+ * OUT at connect; the engine's `turn_end` commits the user item but never
428
+ * dispatches a model turn; engine speech opens a SERVER-INITIATED response
429
+ * (`response.output_audio.delta`), closed `completed` by a quiet-track run
430
+ * or `cancelled` by the user's `turn_start`; a client `response.create` is
431
+ * the non-fatal `duplex_engine_owns_turns` error. Requires `voice`.
432
+ */
433
+ duplex?: boolean;
423
434
  /**
424
435
  * THE COMPOSITE TURN'S PROMPT CANCEL (ENG-451): stop the ACTIVE turn's
425
436
  * legs beyond the turn seam — the composite binding aborts its per-turn
@@ -927,6 +938,16 @@ interface RouteTarget {
927
938
  * session and its usage stay attributed to the CALLER org.
928
939
  */
929
940
  sharedApp?: boolean;
941
+ /**
942
+ * THE REQUESTOR ORG (ENG-636 1.5): the CALLER org that dialed this proxy —
943
+ * sourced from the proxy's authenticated request context at the builder
944
+ * ({@link ModelRouterOptions.callerOrgId}, wired from BackhaulConfig.orgId).
945
+ * A user-triggered cold pick on a SHARED app carries it to the lane demand's
946
+ * create (DIAL SHAPE: requestor = the caller org, provider = the shared
947
+ * org). Absent when the auth context names no org — never a guessed or
948
+ * defaulted id (an absent requestor is the designed standard path).
949
+ */
950
+ callerOrgId?: string;
930
951
  /** Shared lanes only: the catalog id the request pinned (capability joins). */
931
952
  modelId?: string;
932
953
  /** Shared lanes only: the catalog variant the request pinned. */
@@ -991,6 +1012,13 @@ interface ModelRouterOptions<S> {
991
1012
  * declared `serves` protocol (see {@link ModelRouter.servable}).
992
1013
  */
993
1014
  fnName: string;
1015
+ /**
1016
+ * THE REQUESTOR ORG (ENG-636 1.5): the authenticated CALLER's org id — the
1017
+ * proxy's request context (BackhaulConfig.orgId, resolved from the caller's
1018
+ * API key on the hosted lane). Stamped on every resolved {@link RouteTarget};
1019
+ * absent/empty ⇒ no target ever carries one. No default, no guess.
1020
+ */
1021
+ callerOrgId?: string;
994
1022
  /**
995
1023
  * Open a backhaul session for a resolved dial target (called at most once
996
1024
  * per pool key). The SECOND argument is the POOL KEY the entry will
@@ -1250,6 +1278,8 @@ declare class ModelRouter<S> {
1250
1278
  * SHARED org's app with `sharedApp: true` — the cross-org session dial.
1251
1279
  */
1252
1280
  private resolveTarget;
1281
+ /** The dial resolution itself — {@link resolveTarget} stamps the requestor. */
1282
+ private dialTargetFor;
1253
1283
  /**
1254
1284
  * THE BILLING IDENTITY of a request's model: the CATALOG `(model_id,
1255
1285
  * variant)` the request actually resolved to, or `null` when the route
@@ -132,6 +132,8 @@ interface RealtimeBinding<S = unknown> {
132
132
 
133
133
  composite?: true;
134
134
 
135
+ duplex?: boolean;
136
+
135
137
  cancelActiveTurn?: () => void;
136
138
 
137
139
  release?: () => Promise<void> | void;
@@ -303,6 +305,8 @@ interface RouteTarget {
303
305
 
304
306
  sharedApp?: boolean;
305
307
 
308
+ callerOrgId?: string;
309
+
306
310
  modelId?: string;
307
311
 
308
312
  variant?: string;
@@ -321,6 +325,8 @@ interface ModelRouterOptions<S> {
321
325
 
322
326
  fnName: string;
323
327
 
328
+ callerOrgId?: string;
329
+
324
330
  openSession: (target: RouteTarget, poolKey: string) => S | Promise<S>;
325
331
 
326
332
  closeSession: (entry: S) => Promise<void>;
@@ -383,6 +389,8 @@ declare class ModelRouter<S> {
383
389
 
384
390
  private resolveTarget;
385
391
 
392
+ private dialTargetFor;
393
+
386
394
  catalogIdentityFor(model: string | undefined): Promise<{
387
395
  model_id: string;
388
396
  variant: string;