@oxyhq/contracts 0.29.0 → 0.30.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.
Files changed (40) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/identity.js +33 -1
  3. package/dist/cjs/index.js +20 -7
  4. package/dist/cjs/inference/aliaModelRelease.js +250 -0
  5. package/dist/cjs/inference/catalogue.js +1 -4
  6. package/dist/cjs/inference/identifiers.js +23 -3
  7. package/dist/cjs/inference/request.js +188 -5
  8. package/dist/cjs/inference/routingPolicy.js +81 -2
  9. package/dist/cjs/inference/streamEvents.js +27 -0
  10. package/dist/cjs/inference/usage.js +32 -1
  11. package/dist/cjs/inference/version.js +15 -2
  12. package/dist/esm/.tsbuildinfo +1 -1
  13. package/dist/esm/identity.js +32 -0
  14. package/dist/esm/index.js +8 -3
  15. package/dist/esm/inference/aliaModelRelease.js +247 -0
  16. package/dist/esm/inference/catalogue.js +2 -5
  17. package/dist/esm/inference/identifiers.js +22 -2
  18. package/dist/esm/inference/request.js +189 -6
  19. package/dist/esm/inference/routingPolicy.js +81 -2
  20. package/dist/esm/inference/streamEvents.js +27 -0
  21. package/dist/esm/inference/usage.js +32 -1
  22. package/dist/esm/inference/version.js +15 -2
  23. package/dist/types/.tsbuildinfo +1 -1
  24. package/dist/types/identity.d.ts +59 -1
  25. package/dist/types/index.d.ts +7 -5
  26. package/dist/types/inference/accountBilling.d.ts +26 -26
  27. package/dist/types/inference/aliaModelRelease.d.ts +597 -0
  28. package/dist/types/inference/catalogue.d.ts +6 -6
  29. package/dist/types/inference/entitlement.d.ts +4 -4
  30. package/dist/types/inference/identifiers.d.ts +20 -2
  31. package/dist/types/inference/money.d.ts +4 -4
  32. package/dist/types/inference/priceVersion.d.ts +14 -14
  33. package/dist/types/inference/providerConnection.d.ts +4 -4
  34. package/dist/types/inference/request.d.ts +291 -5
  35. package/dist/types/inference/routingPolicy.d.ts +109 -13
  36. package/dist/types/inference/streamEvents.d.ts +53 -26
  37. package/dist/types/inference/usage.d.ts +103 -79
  38. package/dist/types/inference/version.d.ts +15 -2
  39. package/dist/types/keyRecovery.d.ts +4 -4
  40. package/package.json +1 -1
@@ -56,8 +56,16 @@ export declare const oxyCredentialIdSchema: z.ZodString;
56
56
  * traceable as one that was served (ADR 0007, and step 1 of ADR 0010's edge
57
57
  * order). It is required on the inbound envelope, which is what makes the data
58
58
  * plane a consumer of this id rather than its source: the data plane echoes it
59
- * on every stream event, on the usage report and on anything it can be asked
60
- * about later.
59
+ * on every stream event, on the usage report, in its response header and on
60
+ * anything it can be asked about later. It never mints one for a request it
61
+ * received.
62
+ *
63
+ * The one case that is NOT an exception to that: an envelope the data plane
64
+ * cannot read or authenticate carries no id to echo, so its rejection is
65
+ * labelled with an id of the data plane's own — visibly local, and never
66
+ * correlated with an Oxy request, because there is no Oxy request it belongs to.
67
+ * Saying so is what stops "consumer, not source" from being read as forbidding
68
+ * the only id such a rejection could have.
61
69
  *
62
70
  * Correlates the Oxy edge, the data plane, the financial ledger and the
63
71
  * customer-visible receipt, so it appears on every stream event and every
@@ -95,6 +103,16 @@ export declare const inferenceTimestampSchema: z.ZodString;
95
103
  export declare const inferenceDateSchema: z.ZodString;
96
104
  /** An absolute https URL, for model cards, licenses and provider documentation. */
97
105
  export declare const inferenceHttpsUrlSchema: z.ZodString;
106
+ /**
107
+ * A content digest, `sha256:<64 lowercase hex>`.
108
+ *
109
+ * ONE spelling, because a digest is compared for equality and nothing else: an
110
+ * uppercase or unprefixed variant of the same hash is a different string, so two
111
+ * records describing the same bytes would not match. Lowercase hex with the
112
+ * algorithm prefix is what the `inference_model_revisions` CHECK stores and what
113
+ * every artifact registry emits.
114
+ */
115
+ export declare const sha256DigestSchema: z.ZodString;
98
116
  /** A publisher slug, e.g. `openai`, `anthropic`, `meta`, `alia`. */
99
117
  export declare const publisherSlugSchema: z.ZodString;
100
118
  /** A model slug within its publisher's namespace, e.g. `gpt-5`, `llama-3.1-70b`. */
@@ -69,11 +69,11 @@ export declare const moneySchema: z.ZodObject<{
69
69
  amount: z.ZodBranded<z.ZodString, "ExactDecimal">;
70
70
  currency: z.ZodString;
71
71
  }, "strict", z.ZodTypeAny, {
72
- amount: string & z.BRAND<"ExactDecimal">;
73
72
  currency: string;
73
+ amount: string & z.BRAND<"ExactDecimal">;
74
74
  }, {
75
- amount: string;
76
75
  currency: string;
76
+ amount: string;
77
77
  }>;
78
78
  /**
79
79
  * The closed set of units inference is metered in.
@@ -166,13 +166,13 @@ export declare const unitPriceSchema: z.ZodObject<{
166
166
  per: z.ZodNumber;
167
167
  currency: z.ZodString;
168
168
  }, "strict", z.ZodTypeAny, {
169
- amount: string & z.BRAND<"ExactDecimal">;
170
169
  currency: string;
170
+ amount: string & z.BRAND<"ExactDecimal">;
171
171
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
172
172
  per: number;
173
173
  }, {
174
- amount: string;
175
174
  currency: string;
175
+ amount: string;
176
176
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
177
177
  per: number;
178
178
  }>;
@@ -46,13 +46,13 @@ export declare const priceVersionSchema: z.ZodEffects<z.ZodObject<{
46
46
  per: z.ZodNumber;
47
47
  currency: z.ZodString;
48
48
  }, "strict", z.ZodTypeAny, {
49
- amount: string & z.BRAND<"ExactDecimal">;
50
49
  currency: string;
50
+ amount: string & z.BRAND<"ExactDecimal">;
51
51
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
52
52
  per: number;
53
53
  }, {
54
- amount: string;
55
54
  currency: string;
55
+ amount: string;
56
56
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
57
57
  per: number;
58
58
  }>, "many">;
@@ -64,15 +64,15 @@ export declare const priceVersionSchema: z.ZodEffects<z.ZodObject<{
64
64
  createdAt: z.ZodString;
65
65
  }, "strip", z.ZodTypeAny, {
66
66
  status: "active" | "superseded" | "draft";
67
- createdAt: string;
68
67
  currency: string;
68
+ createdAt: string;
69
69
  provider: string;
70
70
  schemaVersion: 1;
71
71
  priceVersionId: string;
72
72
  modelReference: string;
73
73
  unitPrices: {
74
- amount: string & z.BRAND<"ExactDecimal">;
75
74
  currency: string;
75
+ amount: string & z.BRAND<"ExactDecimal">;
76
76
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
77
77
  per: number;
78
78
  }[];
@@ -81,15 +81,15 @@ export declare const priceVersionSchema: z.ZodEffects<z.ZodObject<{
81
81
  supersedesPriceVersionId?: string | undefined;
82
82
  }, {
83
83
  status: "active" | "superseded" | "draft";
84
- createdAt: string;
85
84
  currency: string;
85
+ createdAt: string;
86
86
  provider: string;
87
87
  schemaVersion: 1;
88
88
  priceVersionId: string;
89
89
  modelReference: string;
90
90
  unitPrices: {
91
- amount: string;
92
91
  currency: string;
92
+ amount: string;
93
93
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
94
94
  per: number;
95
95
  }[];
@@ -98,15 +98,15 @@ export declare const priceVersionSchema: z.ZodEffects<z.ZodObject<{
98
98
  supersedesPriceVersionId?: string | undefined;
99
99
  }>, {
100
100
  status: "active" | "superseded" | "draft";
101
- createdAt: string;
102
101
  currency: string;
102
+ createdAt: string;
103
103
  provider: string;
104
104
  schemaVersion: 1;
105
105
  priceVersionId: string;
106
106
  modelReference: string;
107
107
  unitPrices: {
108
- amount: string & z.BRAND<"ExactDecimal">;
109
108
  currency: string;
109
+ amount: string & z.BRAND<"ExactDecimal">;
110
110
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
111
111
  per: number;
112
112
  }[];
@@ -115,15 +115,15 @@ export declare const priceVersionSchema: z.ZodEffects<z.ZodObject<{
115
115
  supersedesPriceVersionId?: string | undefined;
116
116
  }, {
117
117
  status: "active" | "superseded" | "draft";
118
- createdAt: string;
119
118
  currency: string;
119
+ createdAt: string;
120
120
  provider: string;
121
121
  schemaVersion: 1;
122
122
  priceVersionId: string;
123
123
  modelReference: string;
124
124
  unitPrices: {
125
- amount: string;
126
125
  currency: string;
126
+ amount: string;
127
127
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
128
128
  per: number;
129
129
  }[];
@@ -148,13 +148,13 @@ export declare const priceSnapshotSchema: z.ZodObject<{
148
148
  per: z.ZodNumber;
149
149
  currency: z.ZodString;
150
150
  }, "strict", z.ZodTypeAny, {
151
- amount: string & z.BRAND<"ExactDecimal">;
152
151
  currency: string;
152
+ amount: string & z.BRAND<"ExactDecimal">;
153
153
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
154
154
  per: number;
155
155
  }, {
156
- amount: string;
157
156
  currency: string;
157
+ amount: string;
158
158
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
159
159
  per: number;
160
160
  }>, "many">;
@@ -162,8 +162,8 @@ export declare const priceSnapshotSchema: z.ZodObject<{
162
162
  currency: string;
163
163
  priceVersionId: string;
164
164
  unitPrices: {
165
- amount: string & z.BRAND<"ExactDecimal">;
166
165
  currency: string;
166
+ amount: string & z.BRAND<"ExactDecimal">;
167
167
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
168
168
  per: number;
169
169
  }[];
@@ -171,8 +171,8 @@ export declare const priceSnapshotSchema: z.ZodObject<{
171
171
  currency: string;
172
172
  priceVersionId: string;
173
173
  unitPrices: {
174
- amount: string;
175
174
  currency: string;
175
+ amount: string;
176
176
  unit: "input_tokens" | "cached_input_tokens" | "output_tokens" | "reasoning_tokens" | "requests" | "images" | "audio_input_milliseconds" | "audio_output_milliseconds" | "video_milliseconds" | "characters" | "embeddings";
177
177
  per: number;
178
178
  }[];
@@ -178,6 +178,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
178
178
  failureCode?: "unknown" | "network" | "rate_limited" | "unauthorized" | "forbidden" | "not_found" | undefined;
179
179
  };
180
180
  status: "active" | "revoked" | "disabled" | "pending_validation";
181
+ createdAt: string;
181
182
  scope: {
182
183
  kind: "account";
183
184
  accountId: string & z.BRAND<"OxyAccountId">;
@@ -189,7 +190,6 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
189
190
  accountId: string & z.BRAND<"OxyAccountId">;
190
191
  applicationId: string;
191
192
  };
192
- createdAt: string;
193
193
  provider: string;
194
194
  schemaVersion: 1;
195
195
  connectionId: string;
@@ -208,6 +208,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
208
208
  failureCode?: "unknown" | "network" | "rate_limited" | "unauthorized" | "forbidden" | "not_found" | undefined;
209
209
  };
210
210
  status: "active" | "revoked" | "disabled" | "pending_validation";
211
+ createdAt: string;
211
212
  scope: {
212
213
  kind: "account";
213
214
  accountId: string;
@@ -219,7 +220,6 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
219
220
  accountId: string;
220
221
  applicationId: string;
221
222
  };
222
- createdAt: string;
223
223
  provider: string;
224
224
  schemaVersion: 1;
225
225
  connectionId: string;
@@ -238,6 +238,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
238
238
  failureCode?: "unknown" | "network" | "rate_limited" | "unauthorized" | "forbidden" | "not_found" | undefined;
239
239
  };
240
240
  status: "active" | "revoked" | "disabled" | "pending_validation";
241
+ createdAt: string;
241
242
  scope: {
242
243
  kind: "account";
243
244
  accountId: string & z.BRAND<"OxyAccountId">;
@@ -249,7 +250,6 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
249
250
  accountId: string & z.BRAND<"OxyAccountId">;
250
251
  applicationId: string;
251
252
  };
252
- createdAt: string;
253
253
  provider: string;
254
254
  schemaVersion: 1;
255
255
  connectionId: string;
@@ -268,6 +268,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
268
268
  failureCode?: "unknown" | "network" | "rate_limited" | "unauthorized" | "forbidden" | "not_found" | undefined;
269
269
  };
270
270
  status: "active" | "revoked" | "disabled" | "pending_validation";
271
+ createdAt: string;
271
272
  scope: {
272
273
  kind: "account";
273
274
  accountId: string;
@@ -279,7 +280,6 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
279
280
  accountId: string;
280
281
  applicationId: string;
281
282
  };
282
- createdAt: string;
283
283
  provider: string;
284
284
  schemaVersion: 1;
285
285
  connectionId: string;