@kaana.ai/contracts 4.3.0 → 4.4.1

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.
@@ -289,6 +289,34 @@ export declare const modelDeploymentSchema: z.ZodObject<{
289
289
  dedicatedCapacity: z.ZodBoolean;
290
290
  priceVersionId: z.ZodOptional<z.ZodString>;
291
291
  }, z.core.$strip>;
292
+ /**
293
+ * The commercial facts Kaana publishes about ONE deployment on the descriptors
294
+ * it serves to Oxy (`POST /internal/v1/deployments/query` and
295
+ * `/internal/v1/models/query`), from the reviewed file
296
+ * `configs/deployment-commercial.json`. A deployment that is not sold carries
297
+ * no `commercial` at all, which is why the member is optional on the
298
+ * descriptor. New in contract set 4.4.0.
299
+ *
300
+ * `customer_byok` is the commercial basis of a `byok_only` route and of no
301
+ * other: the two say the same thing and may not disagree.
302
+ */
303
+ export declare const deploymentCommercialSchema: z.ZodObject<{
304
+ availabilityScope: z.ZodEnum<{
305
+ platform_internal: "platform_internal";
306
+ public_payg: "public_payg";
307
+ enterprise: "enterprise";
308
+ byok_only: "byok_only";
309
+ oxy_hosted: "oxy_hosted";
310
+ }>;
311
+ commercialPermission: z.ZodEnum<{
312
+ standard_application_use: "standard_application_use";
313
+ public_resale_approved: "public_resale_approved";
314
+ wholesale_contract: "wholesale_contract";
315
+ customer_byok: "customer_byok";
316
+ open_weight_hosting: "open_weight_hosting";
317
+ }>;
318
+ dedicatedCapacity: z.ZodOptional<z.ZodBoolean>;
319
+ }, z.core.$strict>;
292
320
  /** One candidate a profile may resolve to, and how strongly it is preferred. */
293
321
  export declare const routingProfileCandidateSchema: z.ZodObject<{
294
322
  modelReference: z.ZodString;
@@ -1019,6 +1047,7 @@ export type DeclaredModel = z.infer<typeof declaredModelSchema>;
1019
1047
  export type DeclaredCatalogue = z.infer<typeof declaredCatalogueSchema>;
1020
1048
  export type AvailabilityScope = z.infer<typeof availabilityScopeSchema>;
1021
1049
  export type CommercialPermission = z.infer<typeof commercialPermissionSchema>;
1050
+ export type DeploymentCommercial = z.infer<typeof deploymentCommercialSchema>;
1022
1051
  export type ModelPublisher = z.infer<typeof modelPublisherSchema>;
1023
1052
  export type CatalogueModel = z.infer<typeof catalogueModelSchema>;
1024
1053
  export type ModelRevision = z.infer<typeof modelRevisionSchema>;
@@ -211,6 +211,46 @@ export const modelDeploymentSchema = z
211
211
  });
212
212
  }
213
213
  });
214
+ /**
215
+ * The commercial facts Kaana publishes about ONE deployment on the descriptors
216
+ * it serves to Oxy (`POST /internal/v1/deployments/query` and
217
+ * `/internal/v1/models/query`), from the reviewed file
218
+ * `configs/deployment-commercial.json`. A deployment that is not sold carries
219
+ * no `commercial` at all, which is why the member is optional on the
220
+ * descriptor. New in contract set 4.4.0.
221
+ *
222
+ * `customer_byok` is the commercial basis of a `byok_only` route and of no
223
+ * other: the two say the same thing and may not disagree.
224
+ */
225
+ export const deploymentCommercialSchema = z
226
+ .object({
227
+ availabilityScope: availabilityScopeSchema,
228
+ commercialPermission: commercialPermissionSchema,
229
+ /** Reserved capacity for one enterprise account; absent means shared. */
230
+ dedicatedCapacity: z.boolean().optional(),
231
+ })
232
+ .strict()
233
+ .superRefine((commercial, ctx) => {
234
+ const byokScope = commercial.availabilityScope === 'byok_only';
235
+ const byokPermission = commercial.commercialPermission === 'customer_byok';
236
+ if (byokScope !== byokPermission) {
237
+ ctx.addIssue({
238
+ code: 'custom',
239
+ path: ['commercialPermission'],
240
+ message: 'customer_byok is the permission of a byok_only route, and only of it',
241
+ });
242
+ }
243
+ if (commercial.availabilityScope === 'public_payg' &&
244
+ commercial.commercialPermission !== 'public_resale_approved' &&
245
+ commercial.commercialPermission !== 'wholesale_contract' &&
246
+ commercial.commercialPermission !== 'open_weight_hosting') {
247
+ ctx.addIssue({
248
+ code: 'custom',
249
+ path: ['commercialPermission'],
250
+ message: 'a public pay-as-you-go route requires an approved resale permission',
251
+ });
252
+ }
253
+ });
214
254
  /** One candidate a profile may resolve to, and how strongly it is preferred. */
215
255
  export const routingProfileCandidateSchema = z
216
256
  .object({
@@ -303,6 +303,7 @@ export declare const grantStepLimitsSchema: z.ZodObject<{
303
303
  prohibitTrainingOnCustomerData: z.ZodBoolean;
304
304
  allowedLicenseIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
305
305
  requireCommercialUseRights: z.ZodBoolean;
306
+ sameModelFailover: z.ZodDefault<z.ZodBoolean>;
306
307
  }, z.core.$strict>;
307
308
  /**
308
309
  * One step: a target and its limits. Kaana tries the steps IN ORDER and moves
@@ -349,6 +350,7 @@ export declare const grantStepSchema: z.ZodObject<{
349
350
  prohibitTrainingOnCustomerData: z.ZodBoolean;
350
351
  allowedLicenseIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
351
352
  requireCommercialUseRights: z.ZodBoolean;
353
+ sameModelFailover: z.ZodDefault<z.ZodBoolean>;
352
354
  }, z.core.$strict>;
353
355
  }, z.core.$strict>;
354
356
  /**
@@ -474,6 +476,7 @@ export declare const grantSchema: z.ZodObject<{
474
476
  prohibitTrainingOnCustomerData: z.ZodBoolean;
475
477
  allowedLicenseIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
476
478
  requireCommercialUseRights: z.ZodBoolean;
479
+ sameModelFailover: z.ZodDefault<z.ZodBoolean>;
477
480
  }, z.core.$strict>;
478
481
  }, z.core.$strict>>;
479
482
  exactRoute: z.ZodOptional<z.ZodObject<{
@@ -240,6 +240,14 @@ export const grantStepLimitsSchema = z
240
240
  prohibitTrainingOnCustomerData: z.boolean(),
241
241
  allowedLicenseIds: z.array(z.string().min(1).max(128)).default([]),
242
242
  requireCommercialUseRights: z.boolean(),
243
+ /**
244
+ * Whether Kaana may fail over, inside this step, between providers (and
245
+ * keys) serving the SAME admitted line. `false` serves each admitted line
246
+ * with exactly one provider and one key: the cheapest admissible one, with
247
+ * no move to another provider of the line within the step. Absent means
248
+ * `true`. New in contract set 4.4.0.
249
+ */
250
+ sameModelFailover: z.boolean().default(true),
243
251
  })
244
252
  .strict()
245
253
  .superRefine((limits, ctx) => {
@@ -111,6 +111,21 @@ export declare const settlementAcknowledgementSchema: z.ZodObject<{
111
111
  settled: "settled";
112
112
  }>;
113
113
  }, z.core.$strict>;
114
+ /**
115
+ * The signature domain of Oxy's reconciliation read, under the Oxy edge key
116
+ * (`KAANA_EDGE_PUBLIC_KEYS`). New in package 4.4.1; Kaana has verified under it
117
+ * since contract set 4.2.0.
118
+ */
119
+ export declare const SETTLEMENT_READ_SIGNATURE_DOMAIN = "oxy-kaana-settlement-read:v1";
120
+ /** Where Oxy reads the outbox, on `https://kaana.ai`. */
121
+ export declare const SETTLEMENT_READ_PATH = "/internal/v1/settlements";
122
+ /**
123
+ * The query string of a reconciliation read, without its `?`: both what Oxy
124
+ * sends and the exact bytes it signs. Kaana verifies the raw query and nothing
125
+ * else — the path is fixed by the domain — so signing `path?query`, or encoding
126
+ * the cursor differently from what is sent, is refused as unsigned.
127
+ */
128
+ export declare function settlementReadQuery(cursor: string | null): string;
114
129
  /** `GET /internal/v1/settlements?cursor=`: what Oxy reconciles against. */
115
130
  export declare const settlementPageSchema: z.ZodObject<{
116
131
  data: z.ZodArray<z.ZodObject<{
@@ -61,6 +61,23 @@ export const settlementAcknowledgementSchema = z
61
61
  status: z.enum(['settled', 'duplicate']),
62
62
  })
63
63
  .strict();
64
+ /**
65
+ * The signature domain of Oxy's reconciliation read, under the Oxy edge key
66
+ * (`KAANA_EDGE_PUBLIC_KEYS`). New in package 4.4.1; Kaana has verified under it
67
+ * since contract set 4.2.0.
68
+ */
69
+ export const SETTLEMENT_READ_SIGNATURE_DOMAIN = 'oxy-kaana-settlement-read:v1';
70
+ /** Where Oxy reads the outbox, on `https://kaana.ai`. */
71
+ export const SETTLEMENT_READ_PATH = '/internal/v1/settlements';
72
+ /**
73
+ * The query string of a reconciliation read, without its `?`: both what Oxy
74
+ * sends and the exact bytes it signs. Kaana verifies the raw query and nothing
75
+ * else — the path is fixed by the domain — so signing `path?query`, or encoding
76
+ * the cursor differently from what is sent, is refused as unsigned.
77
+ */
78
+ export function settlementReadQuery(cursor) {
79
+ return cursor === null ? '' : `cursor=${encodeURIComponent(cursor)}`;
80
+ }
64
81
  /** `GET /internal/v1/settlements?cursor=`: what Oxy reconciles against. */
65
82
  export const settlementPageSchema = z
66
83
  .object({
@@ -100,7 +100,7 @@
100
100
  * change to, say, the catalogue reject every in-flight inference request; the
101
101
  * per-shape `schemaVersion` is what a message is validated against.
102
102
  */
103
- export declare const INFERENCE_CONTRACT_VERSION = "4.3.0";
103
+ export declare const INFERENCE_CONTRACT_VERSION = "4.4.0";
104
104
  /**
105
105
  * Contract set 4.0.0 (Kaana ADR 0002) is the first published as
106
106
  * `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
@@ -128,6 +128,13 @@ export declare const INFERENCE_CONTRACT_VERSION = "4.3.0";
128
128
  * Kaana declares (identity, licence, data policy, capabilities and the list
129
129
  * price per unit), carried to Oxy as `declaredCatalogue` on the signed
130
130
  * `GET /internal/v1/models`. Nothing in 4.2.0 changes.
131
+ *
132
+ * Contract set 4.4.0 (Kaana ADR 0002, amendment 2026-10-15) is additive: the
133
+ * internal `deploymentCommercialSchema`, the optional `commercial` member of
134
+ * every deployment descriptor Kaana serves (availability scope, commercial
135
+ * permission, dedicated capacity), and `sameModelFailover` on
136
+ * `grantStepLimitsSchema` (default `true`: what 4.3.0 did). Nothing in 4.3.0
137
+ * changes.
131
138
  */
132
139
  /** The public API's one origin and version. */
133
140
  export declare const KAANA_API_BASE_URL = "https://kaana.ai/v1";
@@ -100,7 +100,7 @@
100
100
  * change to, say, the catalogue reject every in-flight inference request; the
101
101
  * per-shape `schemaVersion` is what a message is validated against.
102
102
  */
103
- export const INFERENCE_CONTRACT_VERSION = '4.3.0';
103
+ export const INFERENCE_CONTRACT_VERSION = '4.4.0';
104
104
  /**
105
105
  * Contract set 4.0.0 (Kaana ADR 0002) is the first published as
106
106
  * `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
@@ -128,6 +128,13 @@ export const INFERENCE_CONTRACT_VERSION = '4.3.0';
128
128
  * Kaana declares (identity, licence, data policy, capabilities and the list
129
129
  * price per unit), carried to Oxy as `declaredCatalogue` on the signed
130
130
  * `GET /internal/v1/models`. Nothing in 4.2.0 changes.
131
+ *
132
+ * Contract set 4.4.0 (Kaana ADR 0002, amendment 2026-10-15) is additive: the
133
+ * internal `deploymentCommercialSchema`, the optional `commercial` member of
134
+ * every deployment descriptor Kaana serves (availability scope, commercial
135
+ * permission, dedicated capacity), and `sameModelFailover` on
136
+ * `grantStepLimitsSchema` (default `true`: what 4.3.0 did). Nothing in 4.3.0
137
+ * changes.
131
138
  */
132
139
  /** The public API's one origin and version. */
133
140
  export const KAANA_API_BASE_URL = 'https://kaana.ai/v1';
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Kaana API",
5
- "version": "4.3.0",
5
+ "version": "4.4.0",
6
6
  "description": "Kaana inference API. Generated from @kaana.ai/contracts; the Zod source is the authority. Accounts, applications, oxy_sk_ keys, limits and billing are managed in Oxy Console: https://console.oxy.so"
7
7
  },
8
8
  "servers": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaana.ai/contracts",
3
- "version": "4.3.0",
3
+ "version": "4.4.1",
4
4
  "description": "Kaana inference contract: the Zod schemas of the public API at https://kaana.ai/v1 and, under /internal, of the Oxy-Kaana grant, settlement and signed lane.",
5
5
  "type": "module",
6
6
  "sideEffects": false,