@urun-sh/openai 0.6.53 → 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.
@@ -938,6 +938,16 @@ interface RouteTarget {
938
938
  * session and its usage stay attributed to the CALLER org.
939
939
  */
940
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;
941
951
  /** Shared lanes only: the catalog id the request pinned (capability joins). */
942
952
  modelId?: string;
943
953
  /** Shared lanes only: the catalog variant the request pinned. */
@@ -1002,6 +1012,13 @@ interface ModelRouterOptions<S> {
1002
1012
  * declared `serves` protocol (see {@link ModelRouter.servable}).
1003
1013
  */
1004
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;
1005
1022
  /**
1006
1023
  * Open a backhaul session for a resolved dial target (called at most once
1007
1024
  * per pool key). The SECOND argument is the POOL KEY the entry will
@@ -1261,6 +1278,8 @@ declare class ModelRouter<S> {
1261
1278
  * SHARED org's app with `sharedApp: true` — the cross-org session dial.
1262
1279
  */
1263
1280
  private resolveTarget;
1281
+ /** The dial resolution itself — {@link resolveTarget} stamps the requestor. */
1282
+ private dialTargetFor;
1264
1283
  /**
1265
1284
  * THE BILLING IDENTITY of a request's model: the CATALOG `(model_id,
1266
1285
  * variant)` the request actually resolved to, or `null` when the route
@@ -305,6 +305,8 @@ interface RouteTarget {
305
305
 
306
306
  sharedApp?: boolean;
307
307
 
308
+ callerOrgId?: string;
309
+
308
310
  modelId?: string;
309
311
 
310
312
  variant?: string;
@@ -323,6 +325,8 @@ interface ModelRouterOptions<S> {
323
325
 
324
326
  fnName: string;
325
327
 
328
+ callerOrgId?: string;
329
+
326
330
  openSession: (target: RouteTarget, poolKey: string) => S | Promise<S>;
327
331
 
328
332
  closeSession: (entry: S) => Promise<void>;
@@ -385,6 +389,8 @@ declare class ModelRouter<S> {
385
389
 
386
390
  private resolveTarget;
387
391
 
392
+ private dialTargetFor;
393
+
388
394
  catalogIdentityFor(model: string | undefined): Promise<{
389
395
  model_id: string;
390
396
  variant: string;