@oxy.so/contracts 4.5.0 → 4.7.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.
@@ -96,17 +96,32 @@ export declare const routingPolicyScopeSchema: z.ZodDiscriminatedUnion<"kind", [
96
96
  */
97
97
  export declare const routingFallbackPolicySchema: z.ZodObject<{
98
98
  disabled: z.ZodBoolean;
99
- sameModelDeployment: z.ZodBoolean;
99
+ /**
100
+ * Same-model deployment failover. OPTIONAL since contract set 3.4.0, and
101
+ * absent means ON unless `disabled` is set: serving the same weights from
102
+ * another deployment of the same revision is an availability decision, not
103
+ * a substitution. A policy opts out with an explicit `false` (or
104
+ * `disabled: true`). See `effectiveSameModelDeployment`.
105
+ */
106
+ sameModelDeployment: z.ZodOptional<z.ZodBoolean>;
100
107
  authorizedCrossModel: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
101
108
  }, "strict", z.ZodTypeAny, {
102
109
  disabled: boolean;
103
- sameModelDeployment: boolean;
104
110
  authorizedCrossModel: string[];
111
+ sameModelDeployment?: boolean | undefined;
105
112
  }, {
106
113
  disabled: boolean;
107
- sameModelDeployment: boolean;
114
+ sameModelDeployment?: boolean | undefined;
108
115
  authorizedCrossModel?: string[] | undefined;
109
116
  }>;
117
+ /**
118
+ * Whether a fallback block authorizes same-model deployment failover: an
119
+ * explicit `sameModelDeployment` wins; absent means on unless `disabled`.
120
+ */
121
+ export declare function effectiveSameModelDeployment(fallback: {
122
+ readonly disabled: boolean;
123
+ readonly sameModelDeployment?: boolean;
124
+ }): boolean;
110
125
  /**
111
126
  * A versioned routing policy.
112
127
  *
@@ -206,17 +221,32 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
206
221
  requireCommercialUseRights: z.ZodBoolean;
207
222
  fallback: z.ZodObject<{
208
223
  disabled: z.ZodBoolean;
209
- sameModelDeployment: z.ZodBoolean;
224
+ /**
225
+ * Same-model deployment failover. OPTIONAL since contract set 3.4.0, and
226
+ * absent means ON unless `disabled` is set: serving the same weights from
227
+ * another deployment of the same revision is an availability decision, not
228
+ * a substitution. A policy opts out with an explicit `false` (or
229
+ * `disabled: true`). See `effectiveSameModelDeployment`.
230
+ */
231
+ sameModelDeployment: z.ZodOptional<z.ZodBoolean>;
210
232
  authorizedCrossModel: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
211
233
  }, "strict", z.ZodTypeAny, {
212
234
  disabled: boolean;
213
- sameModelDeployment: boolean;
214
235
  authorizedCrossModel: string[];
236
+ sameModelDeployment?: boolean | undefined;
215
237
  }, {
216
238
  disabled: boolean;
217
- sameModelDeployment: boolean;
239
+ sameModelDeployment?: boolean | undefined;
218
240
  authorizedCrossModel?: string[] | undefined;
219
241
  }>;
242
+ /**
243
+ * The routing profiles (power levels) this scope may target, by exact id
244
+ * (contract set 3.4.0). Empty means no restriction. A request naming a
245
+ * profile outside a non-empty list is refused with `policy_violation`, and
246
+ * `auto` only climbs to levels on the list. Concrete model targets are
247
+ * governed by the other controls, not by this list.
248
+ */
249
+ allowedRoutingProfileIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
220
250
  /** Whether the customer's own provider credentials may or must be used. */
221
251
  byokPreference: z.ZodEnum<["disabled", "prefer", "require"]>;
222
252
  /** Enterprise reserved capacity rather than shared endpoints. */
@@ -254,9 +284,10 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
254
284
  requireCommercialUseRights: boolean;
255
285
  fallback: {
256
286
  disabled: boolean;
257
- sameModelDeployment: boolean;
258
287
  authorizedCrossModel: string[];
288
+ sameModelDeployment?: boolean | undefined;
259
289
  };
290
+ allowedRoutingProfileIds: string[];
260
291
  byokPreference: "disabled" | "prefer" | "require";
261
292
  defaultTarget?: {
262
293
  kind: "model";
@@ -290,7 +321,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
290
321
  requireCommercialUseRights: boolean;
291
322
  fallback: {
292
323
  disabled: boolean;
293
- sameModelDeployment: boolean;
324
+ sameModelDeployment?: boolean | undefined;
294
325
  authorizedCrossModel?: string[] | undefined;
295
326
  };
296
327
  byokPreference: "disabled" | "prefer" | "require";
@@ -316,6 +347,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
316
347
  amount: string;
317
348
  } | undefined;
318
349
  allowedLicenseIds?: string[] | undefined;
350
+ allowedRoutingProfileIds?: string[] | undefined;
319
351
  }>, {
320
352
  updatedAt: string;
321
353
  schemaVersion: 2;
@@ -348,9 +380,10 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
348
380
  requireCommercialUseRights: boolean;
349
381
  fallback: {
350
382
  disabled: boolean;
351
- sameModelDeployment: boolean;
352
383
  authorizedCrossModel: string[];
384
+ sameModelDeployment?: boolean | undefined;
353
385
  };
386
+ allowedRoutingProfileIds: string[];
354
387
  byokPreference: "disabled" | "prefer" | "require";
355
388
  defaultTarget?: {
356
389
  kind: "model";
@@ -384,7 +417,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
384
417
  requireCommercialUseRights: boolean;
385
418
  fallback: {
386
419
  disabled: boolean;
387
- sameModelDeployment: boolean;
420
+ sameModelDeployment?: boolean | undefined;
388
421
  authorizedCrossModel?: string[] | undefined;
389
422
  };
390
423
  byokPreference: "disabled" | "prefer" | "require";
@@ -410,6 +443,7 @@ export declare const routingPolicySchema: z.ZodEffects<z.ZodObject<{
410
443
  amount: string;
411
444
  } | undefined;
412
445
  allowedLicenseIds?: string[] | undefined;
446
+ allowedRoutingProfileIds?: string[] | undefined;
413
447
  }>;
414
448
  /**
415
449
  * The reference a request records: which policy, at which of the customer's own
@@ -46,8 +46,8 @@ export declare const inferenceStreamStartEventSchema: z.ZodObject<{
46
46
  requestId: string;
47
47
  resolvedModelReference: string;
48
48
  servingProvider: string;
49
- sequence: number;
50
49
  startedAt: string;
50
+ sequence: number;
51
51
  generationId?: string | undefined;
52
52
  }, {
53
53
  type: "start";
@@ -55,8 +55,8 @@ export declare const inferenceStreamStartEventSchema: z.ZodObject<{
55
55
  requestId: string;
56
56
  resolvedModelReference: string;
57
57
  servingProvider: string;
58
- sequence: number;
59
58
  startedAt: string;
59
+ sequence: number;
60
60
  generationId?: string | undefined;
61
61
  }>;
62
62
  /**
@@ -225,23 +225,23 @@ export declare const inferenceStreamUsageEventSchema: z.ZodObject<{
225
225
  schemaVersion: 2;
226
226
  requestId: string;
227
227
  deploymentId: string;
228
- sequence: number;
229
228
  units: {
230
229
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
231
230
  quantity: number;
232
231
  }[];
233
232
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
233
+ sequence: number;
234
234
  }, {
235
235
  type: "usage";
236
236
  schemaVersion: 2;
237
237
  requestId: string;
238
238
  deploymentId: string;
239
- sequence: number;
240
239
  units: {
241
240
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
242
241
  quantity: number;
243
242
  }[];
244
243
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
244
+ sequence: number;
245
245
  }>;
246
246
  /**
247
247
  * What kind of re-route happened.
@@ -609,8 +609,8 @@ export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<"type",
609
609
  requestId: string;
610
610
  resolvedModelReference: string;
611
611
  servingProvider: string;
612
- sequence: number;
613
612
  startedAt: string;
613
+ sequence: number;
614
614
  generationId?: string | undefined;
615
615
  }, {
616
616
  type: "start";
@@ -618,8 +618,8 @@ export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<"type",
618
618
  requestId: string;
619
619
  resolvedModelReference: string;
620
620
  servingProvider: string;
621
- sequence: number;
622
621
  startedAt: string;
622
+ sequence: number;
623
623
  generationId?: string | undefined;
624
624
  }>, z.ZodObject<{
625
625
  /** See `version.ts`: each stream event is a whole message on the wire. */
@@ -730,23 +730,23 @@ export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<"type",
730
730
  schemaVersion: 2;
731
731
  requestId: string;
732
732
  deploymentId: string;
733
- sequence: number;
734
733
  units: {
735
734
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
736
735
  quantity: number;
737
736
  }[];
738
737
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
738
+ sequence: number;
739
739
  }, {
740
740
  type: "usage";
741
741
  schemaVersion: 2;
742
742
  requestId: string;
743
743
  deploymentId: string;
744
- sequence: number;
745
744
  units: {
746
745
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
747
746
  quantity: number;
748
747
  }[];
749
748
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
749
+ sequence: number;
750
750
  }>, z.ZodObject<{
751
751
  /** See `version.ts`: each stream event is a whole message on the wire. */
752
752
  schemaVersion: z.ZodLiteral<1>;
@@ -509,13 +509,13 @@ export declare const normalizedUsageReportSchema: z.ZodEffects<z.ZodObject<{
509
509
  };
510
510
  deploymentId: string;
511
511
  completedAt: string;
512
- startedAt: string;
513
512
  units: {
514
513
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
515
514
  quantity: number;
516
515
  }[];
517
516
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
518
517
  routeSwitches: number;
518
+ startedAt: string;
519
519
  generationId?: string | undefined;
520
520
  timeToFirstTokenMs?: number | undefined;
521
521
  }, {
@@ -540,13 +540,13 @@ export declare const normalizedUsageReportSchema: z.ZodEffects<z.ZodObject<{
540
540
  };
541
541
  deploymentId: string;
542
542
  completedAt: string;
543
- startedAt: string;
544
543
  units: {
545
544
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
546
545
  quantity: number;
547
546
  }[];
548
547
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
549
548
  routeSwitches: number;
549
+ startedAt: string;
550
550
  generationId?: string | undefined;
551
551
  timeToFirstTokenMs?: number | undefined;
552
552
  }>, {
@@ -571,13 +571,13 @@ export declare const normalizedUsageReportSchema: z.ZodEffects<z.ZodObject<{
571
571
  };
572
572
  deploymentId: string;
573
573
  completedAt: string;
574
- startedAt: string;
575
574
  units: {
576
575
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
577
576
  quantity: number;
578
577
  }[];
579
578
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
580
579
  routeSwitches: number;
580
+ startedAt: string;
581
581
  generationId?: string | undefined;
582
582
  timeToFirstTokenMs?: number | undefined;
583
583
  }, {
@@ -602,13 +602,13 @@ export declare const normalizedUsageReportSchema: z.ZodEffects<z.ZodObject<{
602
602
  };
603
603
  deploymentId: string;
604
604
  completedAt: string;
605
- startedAt: string;
606
605
  units: {
607
606
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings" | "audio_input_tokens" | "cached_audio_input_tokens" | "audio_output_tokens" | "session_milliseconds";
608
607
  quantity: number;
609
608
  }[];
610
609
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
611
610
  routeSwitches: number;
611
+ startedAt: string;
612
612
  generationId?: string | undefined;
613
613
  timeToFirstTokenMs?: number | undefined;
614
614
  }>;
@@ -99,4 +99,4 @@
99
99
  * change to, say, the catalogue reject every in-flight inference request; the
100
100
  * per-shape `schemaVersion` is what a message is validated against.
101
101
  */
102
- export declare const INFERENCE_CONTRACT_VERSION = "3.3.0";
102
+ export declare const INFERENCE_CONTRACT_VERSION = "3.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",