@oxy.so/contracts 5.8.0 → 6.1.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.
- package/dist/cjs/accountAccess.js +6 -5
- package/dist/cjs/accountEmail.js +13 -5
- package/dist/cjs/accountGraph.js +10 -9
- package/dist/cjs/accountName.js +3 -2
- package/dist/cjs/agency.js +91 -34
- package/dist/cjs/agentKeys.js +21 -17
- package/dist/cjs/appAssertions.js +14 -13
- package/dist/cjs/applicationRoles.js +19 -12
- package/dist/cjs/campaignAttribution.js +28 -0
- package/dist/cjs/civic.js +10 -9
- package/dist/cjs/client/campaignAttribution.js +14 -0
- package/dist/cjs/client/check.js +61 -53
- package/dist/cjs/client/index.js +7 -1
- package/dist/cjs/client/language.js +7 -0
- package/dist/cjs/consoleOnboarding.js +9 -4
- package/dist/cjs/contentClaims.js +23 -14
- package/dist/cjs/deviceDirectory.js +11 -9
- package/dist/cjs/deviceSession.js +27 -25
- package/dist/cjs/email/messages.js +20 -18
- package/dist/cjs/emailAgentContext.js +11 -9
- package/dist/cjs/externalIdentity.js +15 -11
- package/dist/cjs/federationInstanceFetch.js +12 -7
- package/dist/cjs/identity.js +19 -17
- package/dist/cjs/identityLink.js +6 -4
- package/dist/cjs/identityProof.js +6 -4
- package/dist/cjs/inboxPush.js +5 -4
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/inference/accountBilling.js +35 -33
- package/dist/cjs/inference/aliaModelRelease.js +9 -7
- package/dist/cjs/inference/attribution.js +14 -12
- package/dist/cjs/inference/catalogue.js +35 -29
- package/dist/cjs/inference/economics.js +24 -19
- package/dist/cjs/inference/embeddings.js +9 -7
- package/dist/cjs/inference/entitlement.js +17 -15
- package/dist/cjs/inference/errors.js +15 -8
- package/dist/cjs/inference/identifiers.js +33 -21
- package/dist/cjs/inference/inbox.js +37 -35
- package/dist/cjs/inference/modelDocumentation.js +16 -14
- package/dist/cjs/inference/money.js +5 -4
- package/dist/cjs/inference/priceVersion.js +10 -5
- package/dist/cjs/inference/providerConnection.js +21 -14
- package/dist/cjs/inference/realtime.js +88 -47
- package/dist/cjs/inference/request.js +27 -25
- package/dist/cjs/inference/routingPolicy.js +12 -10
- package/dist/cjs/inference/streamEvents.js +22 -16
- package/dist/cjs/inference/usage.js +32 -15
- package/dist/cjs/keyRecovery.js +8 -6
- package/dist/cjs/keyRotation.js +5 -4
- package/dist/cjs/linkedAccounts.js +22 -18
- package/dist/cjs/moderationReputation.js +29 -27
- package/dist/cjs/notifications.js +25 -9
- package/dist/cjs/numberChecks.js +45 -0
- package/dist/cjs/oauth.js +14 -12
- package/dist/cjs/organizations.js +23 -21
- package/dist/cjs/products/access.js +10 -8
- package/dist/cjs/products/billing.js +10 -8
- package/dist/cjs/products/checkout.js +22 -10
- package/dist/cjs/products/plans.js +15 -10
- package/dist/cjs/protocol.js +6 -5
- package/dist/cjs/recommendations.js +27 -19
- package/dist/cjs/reputation.js +15 -13
- package/dist/cjs/safety.js +43 -27
- package/dist/cjs/serviceToken.js +81 -2
- package/dist/cjs/sessionRevocation.js +8 -6
- package/dist/cjs/signIn.js +50 -24
- package/dist/cjs/stickers.js +19 -15
- package/dist/cjs/stringChecks.js +70 -0
- package/dist/cjs/transparency.js +14 -12
- package/dist/cjs/updates.js +24 -22
- package/dist/cjs/userInvalidation.js +7 -5
- package/dist/cjs/userResponse.js +8 -7
- package/dist/cjs/username.js +7 -6
- package/dist/esm/accountAccess.js +4 -3
- package/dist/esm/accountEmail.js +13 -5
- package/dist/esm/accountGraph.js +8 -7
- package/dist/esm/accountName.js +3 -2
- package/dist/esm/agency.js +90 -33
- package/dist/esm/agentKeys.js +21 -17
- package/dist/esm/appAssertions.js +11 -10
- package/dist/esm/applicationRoles.js +16 -9
- package/dist/esm/campaignAttribution.js +25 -0
- package/dist/esm/civic.js +8 -7
- package/dist/esm/client/campaignAttribution.js +10 -0
- package/dist/esm/client/check.js +61 -53
- package/dist/esm/client/index.js +2 -0
- package/dist/esm/client/language.js +4 -0
- package/dist/esm/consoleOnboarding.js +7 -2
- package/dist/esm/contentClaims.js +23 -14
- package/dist/esm/deviceDirectory.js +11 -9
- package/dist/esm/deviceSession.js +27 -25
- package/dist/esm/email/messages.js +18 -16
- package/dist/esm/emailAgentContext.js +11 -9
- package/dist/esm/externalIdentity.js +15 -11
- package/dist/esm/federationInstanceFetch.js +10 -5
- package/dist/esm/identity.js +17 -15
- package/dist/esm/identityLink.js +6 -4
- package/dist/esm/identityProof.js +6 -4
- package/dist/esm/inboxPush.js +3 -2
- package/dist/esm/index.js +5 -2
- package/dist/esm/inference/accountBilling.js +33 -31
- package/dist/esm/inference/aliaModelRelease.js +7 -5
- package/dist/esm/inference/attribution.js +14 -12
- package/dist/esm/inference/catalogue.js +33 -27
- package/dist/esm/inference/economics.js +22 -17
- package/dist/esm/inference/embeddings.js +9 -7
- package/dist/esm/inference/entitlement.js +15 -13
- package/dist/esm/inference/errors.js +13 -6
- package/dist/esm/inference/identifiers.js +31 -19
- package/dist/esm/inference/inbox.js +37 -35
- package/dist/esm/inference/modelDocumentation.js +14 -12
- package/dist/esm/inference/money.js +3 -2
- package/dist/esm/inference/priceVersion.js +8 -3
- package/dist/esm/inference/providerConnection.js +19 -12
- package/dist/esm/inference/realtime.js +85 -44
- package/dist/esm/inference/request.js +25 -23
- package/dist/esm/inference/routingPolicy.js +9 -7
- package/dist/esm/inference/streamEvents.js +20 -14
- package/dist/esm/inference/usage.js +30 -13
- package/dist/esm/keyRecovery.js +8 -6
- package/dist/esm/keyRotation.js +5 -4
- package/dist/esm/linkedAccounts.js +20 -16
- package/dist/esm/moderationReputation.js +27 -25
- package/dist/esm/notifications.js +23 -7
- package/dist/esm/numberChecks.js +41 -0
- package/dist/esm/oauth.js +14 -12
- package/dist/esm/organizations.js +23 -21
- package/dist/esm/products/access.js +10 -8
- package/dist/esm/products/billing.js +10 -8
- package/dist/esm/products/checkout.js +22 -10
- package/dist/esm/products/plans.js +15 -10
- package/dist/esm/protocol.js +4 -3
- package/dist/esm/recommendations.js +25 -17
- package/dist/esm/reputation.js +13 -11
- package/dist/esm/safety.js +43 -27
- package/dist/esm/serviceToken.js +80 -1
- package/dist/esm/sessionRevocation.js +6 -4
- package/dist/esm/signIn.js +50 -24
- package/dist/esm/stickers.js +17 -13
- package/dist/esm/stringChecks.js +63 -0
- package/dist/esm/transparency.js +14 -12
- package/dist/esm/updates.js +22 -20
- package/dist/esm/userInvalidation.js +4 -2
- package/dist/esm/userResponse.js +4 -3
- package/dist/esm/username.js +3 -2
- package/dist/types/accountAccess.d.ts +29 -70
- package/dist/types/accountEmail.d.ts +2 -14
- package/dist/types/accountGraph.d.ts +179 -171
- package/dist/types/accountName.d.ts +1 -1
- package/dist/types/accountSubject.d.ts +20 -93
- package/dist/types/agency.d.ts +528 -2924
- package/dist/types/agentKeys.d.ts +48 -421
- package/dist/types/appAssertions.d.ts +56 -210
- package/dist/types/applicationRoles.d.ts +30 -276
- package/dist/types/avatarCharacter.d.ts +1 -1
- package/dist/types/campaignAttribution.d.ts +10 -0
- package/dist/types/civic.d.ts +1 -13
- package/dist/types/client/agentKeys.d.ts +18 -18
- package/dist/types/client/appAssertions.d.ts +3 -3
- package/dist/types/client/campaignAttribution.d.ts +12 -0
- package/dist/types/client/check.d.ts +13 -13
- package/dist/types/client/deviceDirectory.d.ts +51 -51
- package/dist/types/client/deviceSession.d.ts +14 -14
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/client/language.d.ts +2 -0
- package/dist/types/client/organizations.d.ts +25 -25
- package/dist/types/client/products.d.ts +33 -33
- package/dist/types/client/recommendations.d.ts +2 -2
- package/dist/types/client/safety.d.ts +45 -45
- package/dist/types/client/sessionStatus.d.ts +4 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +4 -1
- package/dist/types/consoleOnboarding.d.ts +24 -44
- package/dist/types/contentClaims.d.ts +24 -180
- package/dist/types/deviceDirectory.d.ts +109 -1040
- package/dist/types/deviceSession.d.ts +36 -298
- package/dist/types/email/messages.d.ts +212 -1793
- package/dist/types/emailAgentContext.d.ts +10 -194
- package/dist/types/externalIdentity.d.ts +121 -615
- package/dist/types/federationInstanceFetch.d.ts +3 -32
- package/dist/types/identity.d.ts +15 -92
- package/dist/types/identityLink.d.ts +6 -84
- package/dist/types/identityProof.d.ts +5 -17
- package/dist/types/inboxPush.d.ts +1 -9
- package/dist/types/index.d.ts +7 -3
- package/dist/types/inference/accountBilling.d.ts +151 -488
- package/dist/types/inference/aliaModelRelease.d.ts +42 -439
- package/dist/types/inference/attribution.d.ts +75 -104
- package/dist/types/inference/catalogue.d.ts +417 -1599
- package/dist/types/inference/economics.d.ts +69 -276
- package/dist/types/inference/embeddings.d.ts +110 -406
- package/dist/types/inference/entitlement.d.ts +80 -335
- package/dist/types/inference/errors.d.ts +90 -102
- package/dist/types/inference/identifiers.d.ts +12 -4
- package/dist/types/inference/inbox.d.ts +105 -420
- package/dist/types/inference/modelDocumentation.d.ts +201 -1390
- package/dist/types/inference/money.d.ts +65 -32
- package/dist/types/inference/priceVersion.d.ts +53 -120
- package/dist/types/inference/providerConnection.d.ts +253 -710
- package/dist/types/inference/realtime.d.ts +954 -6825
- package/dist/types/inference/request.d.ts +300 -2572
- package/dist/types/inference/routingPolicy.d.ts +95 -503
- package/dist/types/inference/streamEvents.d.ts +253 -721
- package/dist/types/inference/usage.d.ts +317 -950
- package/dist/types/keyRecovery.d.ts +3 -51
- package/dist/types/keyRotation.d.ts +3 -38
- package/dist/types/linkedAccounts.d.ts +50 -236
- package/dist/types/moderationReputation.d.ts +81 -14
- package/dist/types/notifications.d.ts +19 -51
- package/dist/types/numberChecks.d.ts +9 -0
- package/dist/types/oauth.d.ts +101 -809
- package/dist/types/organizations.d.ts +268 -921
- package/dist/types/oxyRecordTypes.d.ts +11 -1
- package/dist/types/products/access.d.ts +125 -775
- package/dist/types/products/billing.d.ts +67 -503
- package/dist/types/products/checkout.d.ts +16 -69
- package/dist/types/products/plans.d.ts +33 -366
- package/dist/types/recommendations.d.ts +76 -389
- package/dist/types/reputation.d.ts +37 -5
- package/dist/types/safety.d.ts +408 -2048
- package/dist/types/serviceToken.d.ts +247 -7
- package/dist/types/sessionRevocation.d.ts +2 -17
- package/dist/types/sessionStatus.d.ts +27 -115
- package/dist/types/signIn.d.ts +62 -553
- package/dist/types/stickers.d.ts +67 -819
- package/dist/types/stringChecks.d.ts +16 -0
- package/dist/types/transparency.d.ts +14 -302
- package/dist/types/updates.d.ts +60 -316
- package/dist/types/userInvalidation.d.ts +4 -13
- package/dist/types/userResponse.d.ts +302 -2400
- package/dist/types/username.d.ts +3 -3
- package/package.json +6 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { integerCheck, safeNumberCheck } from '../numberChecks.js';
|
|
2
|
+
import { utf16MaxLength, utf16MinLength } from '../stringChecks.js';
|
|
1
3
|
/**
|
|
2
4
|
* The canonical model catalogue.
|
|
3
5
|
*
|
|
@@ -152,8 +154,8 @@ export const modelCapabilitiesSchema = z
|
|
|
152
154
|
reasoningEfforts: z.array(reasoningEffortSchema).default([]),
|
|
153
155
|
streaming: z.boolean(),
|
|
154
156
|
promptCaching: z.boolean(),
|
|
155
|
-
maxContextTokens: z.number().
|
|
156
|
-
maxOutputTokens: z.number().
|
|
157
|
+
maxContextTokens: z.number().check(integerCheck()).positive().check(safeNumberCheck()),
|
|
158
|
+
maxOutputTokens: z.number().check(integerCheck()).positive().check(safeNumberCheck()),
|
|
157
159
|
/**
|
|
158
160
|
* The request dialects a route to this model can EXECUTE. Modalities say
|
|
159
161
|
* what a model consumes and produces; they do not say which request shape a
|
|
@@ -216,8 +218,8 @@ export const modelCapabilitiesSchema = z
|
|
|
216
218
|
export const modelLicenseSchema = z
|
|
217
219
|
.object({
|
|
218
220
|
/** SPDX identifier where one exists, otherwise the publisher's own name. */
|
|
219
|
-
licenseId: z.string().
|
|
220
|
-
displayName: z.string().
|
|
221
|
+
licenseId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
222
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
221
223
|
url: inferenceHttpsUrlSchema.optional(),
|
|
222
224
|
commercialUseAllowed: z.boolean(),
|
|
223
225
|
requiresAttribution: z.boolean(),
|
|
@@ -241,7 +243,7 @@ export const modelProvenanceSchema = z
|
|
|
241
243
|
]),
|
|
242
244
|
/** The model this one was derived/fine-tuned from, where there is one. */
|
|
243
245
|
baseModelId: modelIdSchema.optional(),
|
|
244
|
-
trainingOrganization: z.string().
|
|
246
|
+
trainingOrganization: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)).optional(),
|
|
245
247
|
})
|
|
246
248
|
.strict();
|
|
247
249
|
/**
|
|
@@ -254,11 +256,13 @@ export const inferenceDataPolicySchema = z
|
|
|
254
256
|
.object({
|
|
255
257
|
retainsPayloads: z.boolean(),
|
|
256
258
|
/** Zero when nothing is retained. */
|
|
257
|
-
retentionDays: z.number().
|
|
259
|
+
retentionDays: z.number().check(integerCheck()).nonnegative().max(3650),
|
|
258
260
|
trainsOnCustomerData: z.boolean(),
|
|
259
261
|
zeroDataRetentionAvailable: z.boolean(),
|
|
260
262
|
/** Named subprocessors a payload may pass through, for compliance review. */
|
|
261
|
-
subprocessors: z
|
|
263
|
+
subprocessors: z
|
|
264
|
+
.array(z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)))
|
|
265
|
+
.default([]),
|
|
262
266
|
policyUrl: inferenceHttpsUrlSchema.optional(),
|
|
263
267
|
})
|
|
264
268
|
.strict()
|
|
@@ -323,10 +327,10 @@ export const modelDeprecationSchema = z
|
|
|
323
327
|
/** One published evaluation result for a revision. */
|
|
324
328
|
export const modelEvaluationResultSchema = z
|
|
325
329
|
.object({
|
|
326
|
-
suite: z.string().
|
|
327
|
-
metric: z.string().
|
|
330
|
+
suite: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
331
|
+
metric: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
328
332
|
/** Kept as a string: an eval score is published text, not arithmetic. */
|
|
329
|
-
score: z.string().
|
|
333
|
+
score: z.string().check(utf16MinLength(1)).check(utf16MaxLength(64)),
|
|
330
334
|
evaluatedAt: inferenceTimestampSchema.optional(),
|
|
331
335
|
reportUrl: inferenceHttpsUrlSchema.optional(),
|
|
332
336
|
})
|
|
@@ -339,7 +343,9 @@ export const modelSafetyMetadataSchema = z
|
|
|
339
343
|
.object({
|
|
340
344
|
safetyCardUrl: inferenceHttpsUrlSchema.optional(),
|
|
341
345
|
contentFilteringDefault: z.enum(['none', 'provider_default', 'strict']),
|
|
342
|
-
knownLimitations: z
|
|
346
|
+
knownLimitations: z
|
|
347
|
+
.array(z.string().check(utf16MinLength(1)).check(utf16MaxLength(500)))
|
|
348
|
+
.default([]),
|
|
343
349
|
/** Content-provenance marking the modality requires, where it requires one. */
|
|
344
350
|
provenanceMarking: z.enum(['none', 'visible_watermark', 'invisible_watermark', 'c2pa']),
|
|
345
351
|
})
|
|
@@ -351,10 +357,10 @@ export const modelSafetyMetadataSchema = z
|
|
|
351
357
|
export const modelPublisherSchema = z.object({
|
|
352
358
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
353
359
|
schemaVersion: z.literal(1),
|
|
354
|
-
publisherId: z.string().
|
|
360
|
+
publisherId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
355
361
|
slug: publisherSlugSchema,
|
|
356
|
-
displayName: z.string().
|
|
357
|
-
description: z.string().
|
|
362
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
363
|
+
description: z.string().check(utf16MaxLength(2000)).optional(),
|
|
358
364
|
websiteUrl: inferenceHttpsUrlSchema.optional(),
|
|
359
365
|
});
|
|
360
366
|
/* -------------------------------------------------------------------------- */
|
|
@@ -374,8 +380,8 @@ export const catalogueModelSchema = z
|
|
|
374
380
|
modelId: modelIdSchema,
|
|
375
381
|
publisher: publisherSlugSchema,
|
|
376
382
|
slug: modelSlugSchema,
|
|
377
|
-
displayName: z.string().
|
|
378
|
-
description: z.string().
|
|
383
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
384
|
+
description: z.string().check(utf16MaxLength(4000)).optional(),
|
|
379
385
|
capabilities: modelCapabilitiesSchema,
|
|
380
386
|
license: modelLicenseSchema,
|
|
381
387
|
provenance: modelProvenanceSchema,
|
|
@@ -421,7 +427,7 @@ export const modelRevisionSchema = z
|
|
|
421
427
|
.object({
|
|
422
428
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
423
429
|
schemaVersion: z.literal(1),
|
|
424
|
-
revisionId: z.string().
|
|
430
|
+
revisionId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
425
431
|
modelId: modelIdSchema,
|
|
426
432
|
revision: modelRevisionLabelSchema,
|
|
427
433
|
reference: modelReferenceSchema,
|
|
@@ -449,9 +455,9 @@ export const modelRevisionSchema = z
|
|
|
449
455
|
export const inferenceProviderSchema = z.object({
|
|
450
456
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
451
457
|
schemaVersion: z.literal(1),
|
|
452
|
-
providerId: z.string().
|
|
458
|
+
providerId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
453
459
|
slug: inferenceProviderSlugSchema,
|
|
454
|
-
displayName: z.string().
|
|
460
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
455
461
|
/**
|
|
456
462
|
* `customer_byok` means the customer's own upstream account is billed
|
|
457
463
|
* directly by the provider and Oxy charges only its platform fee.
|
|
@@ -494,7 +500,7 @@ export const modelDeploymentSchema = z
|
|
|
494
500
|
/** Reserved capacity for one enterprise account rather than shared. */
|
|
495
501
|
dedicatedCapacity: z.boolean(),
|
|
496
502
|
/** The price version customers are charged under on this route. */
|
|
497
|
-
priceVersionId: z.string().
|
|
503
|
+
priceVersionId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)).optional(),
|
|
498
504
|
})
|
|
499
505
|
.superRefine((deployment, ctx) => {
|
|
500
506
|
if (!deployment.modelReference.includes('@')) {
|
|
@@ -545,7 +551,7 @@ export const routingProfileCandidateSchema = z
|
|
|
545
551
|
.object({
|
|
546
552
|
modelReference: modelReferenceSchema,
|
|
547
553
|
/** Lower sorts first. Ties are broken by the profile's optimisation target. */
|
|
548
|
-
priority: z.number().
|
|
554
|
+
priority: z.number().check(integerCheck()).nonnegative().max(1000),
|
|
549
555
|
})
|
|
550
556
|
.strict();
|
|
551
557
|
/**
|
|
@@ -561,8 +567,8 @@ export const routingProfileSchema = z.object({
|
|
|
561
567
|
schemaVersion: z.literal(1),
|
|
562
568
|
routingProfileId: routingProfileIdSchema,
|
|
563
569
|
slug: routingProfileSlugSchema,
|
|
564
|
-
displayName: z.string().
|
|
565
|
-
description: z.string().
|
|
570
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
571
|
+
description: z.string().check(utf16MaxLength(2000)).optional(),
|
|
566
572
|
/** What the profile optimises for when several candidates qualify. */
|
|
567
573
|
optimiseFor: z.enum(['price', 'latency', 'throughput', 'quality', 'balanced']),
|
|
568
574
|
candidates: z.array(routingProfileCandidateSchema).min(1),
|
|
@@ -590,7 +596,7 @@ export const routingProfileSchema = z.object({
|
|
|
590
596
|
export const cataloguePublisherSummarySchema = z
|
|
591
597
|
.object({
|
|
592
598
|
slug: publisherSlugSchema,
|
|
593
|
-
displayName: z.string().
|
|
599
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
594
600
|
websiteUrl: inferenceHttpsUrlSchema.optional(),
|
|
595
601
|
})
|
|
596
602
|
.strict();
|
|
@@ -604,7 +610,7 @@ export const cataloguePublisherSummarySchema = z
|
|
|
604
610
|
export const catalogueServingProviderSummarySchema = z
|
|
605
611
|
.object({
|
|
606
612
|
slug: inferenceProviderSlugSchema,
|
|
607
|
-
displayName: z.string().
|
|
613
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
608
614
|
regions: z.array(inferenceRegionSchema).default([]),
|
|
609
615
|
dataPolicy: inferenceDataPolicySchema,
|
|
610
616
|
})
|
|
@@ -621,8 +627,8 @@ export const modelCatalogueEntrySchema = z.object({
|
|
|
621
627
|
schemaVersion: z.literal(3),
|
|
622
628
|
modelId: modelIdSchema,
|
|
623
629
|
publisher: cataloguePublisherSummarySchema,
|
|
624
|
-
displayName: z.string().
|
|
625
|
-
description: z.string().
|
|
630
|
+
displayName: z.string().check(utf16MinLength(1)).check(utf16MaxLength(200)),
|
|
631
|
+
description: z.string().check(utf16MaxLength(4000)).optional(),
|
|
626
632
|
currentRevision: modelRevisionLabelSchema,
|
|
627
633
|
/** Revisions a customer may pin today, newest first. */
|
|
628
634
|
availableRevisions: z.array(modelRevisionLabelSchema).min(1),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { integerCheck, safeNumberCheck } from '../numberChecks.js';
|
|
2
|
+
import { isoDateTime, utf16MinLength } from '../stringChecks.js';
|
|
1
3
|
/**
|
|
2
4
|
* Economic treatment and durable usage/cost reporting for inference
|
|
3
5
|
* (issue #1526, plan item I09).
|
|
@@ -41,7 +43,7 @@ export const inferenceEconomicTreatmentSchema = z.enum(INFERENCE_ECONOMIC_TREATM
|
|
|
41
43
|
*/
|
|
42
44
|
export const PROVIDER_COST_SOURCES = ['provider_reported', 'rate_card', 'unknown'];
|
|
43
45
|
export const providerCostSourceSchema = z.enum(PROVIDER_COST_SOURCES);
|
|
44
|
-
const nonNegativeCount = z.number().
|
|
46
|
+
const nonNegativeCount = z.number().check(integerCheck()).nonnegative().check(safeNumberCheck());
|
|
45
47
|
/** One amount family, with the rows it could not include counted beside it. */
|
|
46
48
|
const knownAmountSchema = z
|
|
47
49
|
.object({
|
|
@@ -66,8 +68,8 @@ export const costCenterUsageSchema = z
|
|
|
66
68
|
costCenter: costCenterSchema.nullable(),
|
|
67
69
|
treatment: inferenceEconomicTreatmentSchema,
|
|
68
70
|
currency: currencyCodeSchema,
|
|
69
|
-
periodStart: z.string().
|
|
70
|
-
periodEnd: z.string().
|
|
71
|
+
periodStart: z.string().check(isoDateTime()),
|
|
72
|
+
periodEnd: z.string().check(isoDateTime()),
|
|
71
73
|
/** Requests settled in the window (completed, failed, cancelled or partial). */
|
|
72
74
|
requestCount: nonNegativeCount,
|
|
73
75
|
/** Requests admitted and not yet settled when the report was read. */
|
|
@@ -87,10 +89,10 @@ export const costCenterUsageSchema = z
|
|
|
87
89
|
/** Attempts priced in a different currency, excluded without currency conversion. */
|
|
88
90
|
otherCurrencyCount: nonNegativeCount.default(0),
|
|
89
91
|
/** Amount stated by the provider; this is not a copy of its invoice. */
|
|
90
|
-
providerReportedAmount: exactDecimalSchema.
|
|
92
|
+
providerReportedAmount: exactDecimalSchema.prefault('0'),
|
|
91
93
|
providerReportedCount: nonNegativeCount.default(0),
|
|
92
94
|
/** Amount estimated from Kaana's immutable rate card, never described as invoiced. */
|
|
93
|
-
estimatedAmount: exactDecimalSchema.
|
|
95
|
+
estimatedAmount: exactDecimalSchema.prefault('0'),
|
|
94
96
|
estimatedCount: nonNegativeCount.default(0),
|
|
95
97
|
}),
|
|
96
98
|
/**
|
|
@@ -108,35 +110,38 @@ export const meteredGenerationSchema = z
|
|
|
108
110
|
.object({
|
|
109
111
|
schemaVersion: z.literal(2),
|
|
110
112
|
kind: z.literal('metered_usage'),
|
|
111
|
-
meteredUsageId: z.string().
|
|
112
|
-
requestId: z.string().
|
|
113
|
-
generationId: z.string().
|
|
114
|
-
parentRequestId: z.string().
|
|
115
|
-
applicationId: z.string().
|
|
116
|
-
credentialId: z.string().
|
|
117
|
-
delegatedUserId: z.string().
|
|
113
|
+
meteredUsageId: z.string().check(utf16MinLength(1)),
|
|
114
|
+
requestId: z.string().check(utf16MinLength(1)),
|
|
115
|
+
generationId: z.string().check(utf16MinLength(1)).optional(),
|
|
116
|
+
parentRequestId: z.string().check(utf16MinLength(1)).optional(),
|
|
117
|
+
applicationId: z.string().check(utf16MinLength(1)),
|
|
118
|
+
credentialId: z.string().check(utf16MinLength(1)),
|
|
119
|
+
delegatedUserId: z.string().check(utf16MinLength(1)).optional(),
|
|
118
120
|
environment: inferenceEnvironmentSchema,
|
|
119
121
|
economicTreatment: z.literal('internal_metered'),
|
|
120
|
-
economicPolicyVersion: z.string().
|
|
122
|
+
economicPolicyVersion: z.string().check(utf16MinLength(1)),
|
|
121
123
|
outcome: inferenceRequestOutcomeSchema,
|
|
122
124
|
usageSource: usageSourceSchema,
|
|
123
125
|
units: z.array(usageQuantitySchema),
|
|
124
126
|
resolvedModelReference: modelReferenceSchema,
|
|
125
|
-
servingProvider: z.string().
|
|
127
|
+
servingProvider: z.string().check(utf16MinLength(1)),
|
|
126
128
|
tariff: z.discriminatedUnion('status', [
|
|
127
129
|
z
|
|
128
130
|
.object({
|
|
129
131
|
status: z.literal('quoted'),
|
|
130
132
|
amount: exactDecimalSchema,
|
|
131
133
|
currency: currencyCodeSchema,
|
|
132
|
-
priceVersionId: z.string().
|
|
134
|
+
priceVersionId: z.string().check(utf16MinLength(1)),
|
|
133
135
|
})
|
|
134
136
|
.strict(),
|
|
135
137
|
z
|
|
136
|
-
.object({
|
|
138
|
+
.object({
|
|
139
|
+
status: z.literal('unpriced'),
|
|
140
|
+
priceVersionId: z.string().check(utf16MinLength(1)).nullable(),
|
|
141
|
+
})
|
|
137
142
|
.strict(),
|
|
138
143
|
]),
|
|
139
144
|
customerCharge: z.object({ status: z.literal('not_charged') }).strict(),
|
|
140
|
-
settledAt: z.string().
|
|
145
|
+
settledAt: z.string().check(isoDateTime()),
|
|
141
146
|
})
|
|
142
147
|
.strict();
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { integerCheck } from '../numberChecks.js';
|
|
2
|
+
import { utf16MaxLength, utf16MinLength } from '../stringChecks.js';
|
|
1
3
|
import { z } from 'zod';
|
|
2
4
|
import { inferenceErrorSchema } from './errors.js';
|
|
3
5
|
export const embeddingVectorSchema = z
|
|
4
6
|
.object({
|
|
5
|
-
index: z.number().
|
|
7
|
+
index: z.number().check(integerCheck()).nonnegative(),
|
|
6
8
|
embedding: z.array(z.number().finite()).min(1).max(1024),
|
|
7
9
|
})
|
|
8
10
|
.strict();
|
|
9
11
|
export const embeddingUsageSchema = z
|
|
10
12
|
.object({
|
|
11
|
-
inputTokens: z.number().
|
|
12
|
-
totalTokens: z.number().
|
|
13
|
+
inputTokens: z.number().check(integerCheck()).nonnegative(),
|
|
14
|
+
totalTokens: z.number().check(integerCheck()).nonnegative(),
|
|
13
15
|
})
|
|
14
16
|
.strict()
|
|
15
17
|
.refine((usage) => usage.totalTokens >= usage.inputTokens, {
|
|
@@ -19,9 +21,9 @@ export const embeddingUsageSchema = z
|
|
|
19
21
|
export const embeddingSuccessSchema = z
|
|
20
22
|
.object({
|
|
21
23
|
schemaVersion: z.literal(1),
|
|
22
|
-
requestId: z.string().
|
|
23
|
-
model: z.string().
|
|
24
|
-
dimension: z.number().
|
|
24
|
+
requestId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
25
|
+
model: z.string().check(utf16MinLength(1)).check(utf16MaxLength(255)),
|
|
26
|
+
dimension: z.number().check(integerCheck()).positive().max(1024),
|
|
25
27
|
data: z.array(embeddingVectorSchema).min(1).max(2048),
|
|
26
28
|
usage: embeddingUsageSchema,
|
|
27
29
|
})
|
|
@@ -47,7 +49,7 @@ export const embeddingSuccessSchema = z
|
|
|
47
49
|
export const embeddingFailureSchema = z
|
|
48
50
|
.object({
|
|
49
51
|
schemaVersion: z.literal(1),
|
|
50
|
-
requestId: z.string().
|
|
52
|
+
requestId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
|
|
51
53
|
error: inferenceErrorSchema,
|
|
52
54
|
})
|
|
53
55
|
.strict();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { integerCheck, safeNumberCheck } from '../numberChecks.js';
|
|
2
|
+
import { isoDateTime, utf16MaxLength, utf16MinLength } from '../stringChecks.js';
|
|
1
3
|
/**
|
|
2
4
|
* Product entitlements — the interface a first-party product (Alia) queries to
|
|
3
5
|
* learn what an account is entitled to, WITHOUT learning anything it could
|
|
@@ -87,8 +89,8 @@ export const planAllowanceSchema = z
|
|
|
87
89
|
/** A stable machine name, e.g. `api_credits_per_month`. */
|
|
88
90
|
key: z.string().regex(/^[a-z][a-z0-9_]{0,62}$/),
|
|
89
91
|
/** Whole units included per period. Never money. */
|
|
90
|
-
included: z.number().
|
|
91
|
-
remaining: z.number().
|
|
92
|
+
included: z.number().check(integerCheck()).nonnegative().check(safeNumberCheck()),
|
|
93
|
+
remaining: z.number().check(integerCheck()).nonnegative().check(safeNumberCheck()).optional(),
|
|
92
94
|
})
|
|
93
95
|
.strict();
|
|
94
96
|
/**
|
|
@@ -101,12 +103,12 @@ export const planAllowanceSchema = z
|
|
|
101
103
|
*/
|
|
102
104
|
export const productPlanSchema = z
|
|
103
105
|
.object({
|
|
104
|
-
id: z.string().
|
|
105
|
-
name: z.string().
|
|
106
|
+
id: z.string().check(utf16MinLength(1)).check(utf16MaxLength(64)),
|
|
107
|
+
name: z.string().check(utf16MinLength(1)).check(utf16MaxLength(120)),
|
|
106
108
|
status: productPlanStatusSchema,
|
|
107
109
|
live: z.boolean(),
|
|
108
|
-
currentPeriodStart: z.string().
|
|
109
|
-
currentPeriodEnd: z.string().
|
|
110
|
+
currentPeriodStart: z.string().check(isoDateTime()),
|
|
111
|
+
currentPeriodEnd: z.string().check(isoDateTime()),
|
|
110
112
|
cancelAtPeriodEnd: z.boolean(),
|
|
111
113
|
allowances: z.array(planAllowanceSchema),
|
|
112
114
|
})
|
|
@@ -156,10 +158,10 @@ export const costCenterSchema = z
|
|
|
156
158
|
schemaVersion: z.literal(1),
|
|
157
159
|
accountId: oxyAccountIdSchema,
|
|
158
160
|
slug: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/),
|
|
159
|
-
label: z.string().
|
|
161
|
+
label: z.string().check(utf16MinLength(1)).check(utf16MaxLength(120)),
|
|
160
162
|
status: costCenterStatusSchema,
|
|
161
|
-
createdAt: z.string().
|
|
162
|
-
updatedAt: z.string().
|
|
163
|
+
createdAt: z.string().check(isoDateTime()),
|
|
164
|
+
updatedAt: z.string().check(isoDateTime()),
|
|
163
165
|
})
|
|
164
166
|
.strict();
|
|
165
167
|
/**
|
|
@@ -175,10 +177,10 @@ export const costCenterSpendSchema = z
|
|
|
175
177
|
schemaVersion: z.literal(1),
|
|
176
178
|
costCenter: costCenterSchema,
|
|
177
179
|
currency: currencyCodeSchema,
|
|
178
|
-
periodStart: z.string().
|
|
179
|
-
periodEnd: z.string().
|
|
180
|
+
periodStart: z.string().check(isoDateTime()),
|
|
181
|
+
periodEnd: z.string().check(isoDateTime()),
|
|
180
182
|
billedAmount: exactDecimalSchema,
|
|
181
|
-
requestCount: z.number().
|
|
183
|
+
requestCount: z.number().check(integerCheck()).nonnegative().check(safeNumberCheck()),
|
|
182
184
|
})
|
|
183
185
|
.strict();
|
|
184
186
|
/* -------------------------------------------------------------------------- */
|
|
@@ -209,6 +211,6 @@ export const productEntitlementSchema = z
|
|
|
209
211
|
payAsYouGo: payAsYouGoEntitlementSchema.nullable(),
|
|
210
212
|
costCenter: costCenterSchema.nullable(),
|
|
211
213
|
/** When this view was computed. Entitlements are eventually consistent. */
|
|
212
|
-
resolvedAt: z.string().
|
|
214
|
+
resolvedAt: z.string().check(isoDateTime()),
|
|
213
215
|
})
|
|
214
216
|
.strict();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { integerCheck, safeNumberCheck } from '../numberChecks.js';
|
|
2
|
+
import { utf16MaxLength, utf16MinLength } from '../stringChecks.js';
|
|
1
3
|
/**
|
|
2
4
|
* Inference errors and retryability.
|
|
3
5
|
*
|
|
@@ -223,8 +225,8 @@ const CREDENTIAL_PATTERNS = [
|
|
|
223
225
|
*/
|
|
224
226
|
export const safeErrorTextSchema = z
|
|
225
227
|
.string()
|
|
226
|
-
.
|
|
227
|
-
.
|
|
228
|
+
.check(utf16MinLength(1))
|
|
229
|
+
.check(utf16MaxLength(2000))
|
|
228
230
|
.refine((value) => !CREDENTIAL_PATTERNS.some((pattern) => pattern.test(value)), 'error text must not contain credential-shaped material');
|
|
229
231
|
/**
|
|
230
232
|
* A coarse classification of an upstream failure (ADR 0010's `upstreamCategory`).
|
|
@@ -258,9 +260,9 @@ export const providerErrorPassthroughSchema = z
|
|
|
258
260
|
.object({
|
|
259
261
|
provider: inferenceProviderSlugSchema,
|
|
260
262
|
/** The upstream HTTP status, when the upstream spoke HTTP. */
|
|
261
|
-
status: z.number().
|
|
263
|
+
status: z.number().check(integerCheck()).min(100).max(599).optional(),
|
|
262
264
|
/** The upstream's own error code, verbatim and uninterpreted. */
|
|
263
|
-
code: z.string().
|
|
265
|
+
code: z.string().check(utf16MaxLength(128)).optional(),
|
|
264
266
|
/** The upstream's message, subject to the same credential refusal. */
|
|
265
267
|
message: safeErrorTextSchema.optional(),
|
|
266
268
|
})
|
|
@@ -281,9 +283,14 @@ export const inferenceErrorSchema = z
|
|
|
281
283
|
retryable: z.boolean(),
|
|
282
284
|
requestId: requestIdSchema,
|
|
283
285
|
/** How long to wait before retrying. Only meaningful when `retryable`. */
|
|
284
|
-
retryAfterMs: z
|
|
286
|
+
retryAfterMs: z
|
|
287
|
+
.number()
|
|
288
|
+
.check(integerCheck())
|
|
289
|
+
.nonnegative()
|
|
290
|
+
.check(safeNumberCheck())
|
|
291
|
+
.optional(),
|
|
285
292
|
/** The request field at fault, for `invalid_request`. */
|
|
286
|
-
param: z.string().
|
|
293
|
+
param: z.string().check(utf16MaxLength(128)).optional(),
|
|
287
294
|
/** Present only when an upstream provider was reached and failed. */
|
|
288
295
|
upstreamCategory: upstreamErrorCategorySchema.optional(),
|
|
289
296
|
providerError: providerErrorPassthroughSchema.optional(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoDateTime, utf16MaxLength, utf16MinLength } from '../stringChecks.js';
|
|
1
2
|
/**
|
|
2
3
|
* Identifiers, references and wire primitives shared by every Oxy↔data-plane
|
|
3
4
|
* inference contract.
|
|
@@ -32,7 +33,11 @@ import { z } from 'zod';
|
|
|
32
33
|
* of a header, a JWT claim or a request body — is not assignable to it; the
|
|
33
34
|
* only way to obtain one is to parse a value through this schema.
|
|
34
35
|
*/
|
|
35
|
-
export const oxyAccountIdSchema = z
|
|
36
|
+
export const oxyAccountIdSchema = z
|
|
37
|
+
.string()
|
|
38
|
+
.check(utf16MinLength(1))
|
|
39
|
+
.check(utf16MaxLength(64))
|
|
40
|
+
.brand();
|
|
36
41
|
/**
|
|
37
42
|
* A delegated end-user identity (Alia's `X-Oxy-User-Id`), branded with a
|
|
38
43
|
* DIFFERENT brand from {@link oxyAccountIdSchema} so the two cannot be
|
|
@@ -43,16 +48,20 @@ export const oxyAccountIdSchema = z.string().min(1).max(64).brand();
|
|
|
43
48
|
* a billing principal, never an access-control principal, and its presence
|
|
44
49
|
* never changes which account is charged.
|
|
45
50
|
*/
|
|
46
|
-
export const delegatedUserIdSchema = z
|
|
51
|
+
export const delegatedUserIdSchema = z
|
|
52
|
+
.string()
|
|
53
|
+
.check(utf16MinLength(1))
|
|
54
|
+
.check(utf16MaxLength(64))
|
|
55
|
+
.brand();
|
|
47
56
|
/**
|
|
48
57
|
* An Oxy `Application._id`. Not branded: no invariant in this contract turns on
|
|
49
58
|
* confusing it with another id, and brand inflation costs every producer a
|
|
50
59
|
* parse call for no safety. The two ids above are branded because ADR 0007's
|
|
51
60
|
* rule is exactly that they must not be interchangeable.
|
|
52
61
|
*/
|
|
53
|
-
export const oxyApplicationIdSchema = z.string().
|
|
62
|
+
export const oxyApplicationIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(64));
|
|
54
63
|
/** An Oxy `ApplicationCredential._id` — the credential used for this request. */
|
|
55
|
-
export const oxyCredentialIdSchema = z.string().
|
|
64
|
+
export const oxyCredentialIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(64));
|
|
56
65
|
/**
|
|
57
66
|
* A request id allocated by the Oxy EDGE, at admission and BEFORE
|
|
58
67
|
* authentication, so that a request rejected for a bad credential is as
|
|
@@ -74,18 +83,18 @@ export const oxyCredentialIdSchema = z.string().min(1).max(64);
|
|
|
74
83
|
* customer-visible receipt, so it appears on every stream event and every
|
|
75
84
|
* ledger record.
|
|
76
85
|
*/
|
|
77
|
-
export const requestIdSchema = z.string().
|
|
86
|
+
export const requestIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(128));
|
|
78
87
|
/**
|
|
79
88
|
* A generation id generated by the data plane, present when a request produced
|
|
80
89
|
* a generation that can be looked up later (`GET /v1/generations/:id`).
|
|
81
90
|
*/
|
|
82
|
-
export const generationIdSchema = z.string().
|
|
91
|
+
export const generationIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(128));
|
|
83
92
|
/**
|
|
84
93
|
* A caller-supplied idempotency key. Every reserve/settle/refund call is keyed
|
|
85
94
|
* on one so a retry, a redelivered event or a duplicated webhook can never
|
|
86
95
|
* charge twice.
|
|
87
96
|
*/
|
|
88
|
-
export const idempotencyKeySchema = z.string().
|
|
97
|
+
export const idempotencyKeySchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(255));
|
|
89
98
|
/** Credential environments. A credential is issued into exactly one of them. */
|
|
90
99
|
export const inferenceEnvironmentSchema = z.enum(['development', 'staging', 'production']);
|
|
91
100
|
/* -------------------------------------------------------------------------- */
|
|
@@ -100,7 +109,7 @@ export const inferenceEnvironmentSchema = z.enum(['development', 'staging', 'pro
|
|
|
100
109
|
* settled. One canonical spelling (UTC, `Z`) so two records that describe the
|
|
101
110
|
* same moment compare and sort as equal, which a mix of offsets would not.
|
|
102
111
|
*/
|
|
103
|
-
export const inferenceTimestampSchema = z.string().
|
|
112
|
+
export const inferenceTimestampSchema = z.string().check(isoDateTime());
|
|
104
113
|
/**
|
|
105
114
|
* A calendar DATE with no instant attached (`2026-05-01`) — a knowledge cutoff
|
|
106
115
|
* or a release date, which are published as days and become wrong when a
|
|
@@ -112,7 +121,7 @@ export const inferenceDateSchema = z
|
|
|
112
121
|
/** An absolute https URL, for model cards, licenses and provider documentation. */
|
|
113
122
|
export const inferenceHttpsUrlSchema = z
|
|
114
123
|
.string()
|
|
115
|
-
.
|
|
124
|
+
.check(utf16MaxLength(2048))
|
|
116
125
|
.regex(/^https:\/\/[^\s]+$/, 'must be an absolute https URL');
|
|
117
126
|
/**
|
|
118
127
|
* A content digest, `sha256:<64 lowercase hex>`.
|
|
@@ -138,12 +147,12 @@ const REVISION_PATTERN = '[a-zA-Z0-9](?:[a-zA-Z0-9._-]*[a-zA-Z0-9])?';
|
|
|
138
147
|
/** A publisher slug, e.g. `openai`, `anthropic`, `meta`, `alia`. */
|
|
139
148
|
export const publisherSlugSchema = z
|
|
140
149
|
.string()
|
|
141
|
-
.
|
|
150
|
+
.check(utf16MaxLength(64))
|
|
142
151
|
.regex(new RegExp(`^${SLUG_PATTERN}$`), 'publisher must be a lowercase URL-safe slug');
|
|
143
152
|
/** A model slug within its publisher's namespace, e.g. `gpt-5`, `llama-3.1-70b`. */
|
|
144
153
|
export const modelSlugSchema = z
|
|
145
154
|
.string()
|
|
146
|
-
.
|
|
155
|
+
.check(utf16MaxLength(64))
|
|
147
156
|
.regex(new RegExp(`^${SLUG_PATTERN}$`), 'model must be a lowercase URL-safe slug');
|
|
148
157
|
/**
|
|
149
158
|
* A canonical model id, `<publisher>/<model>`. This names a MODEL — a
|
|
@@ -152,12 +161,12 @@ export const modelSlugSchema = z
|
|
|
152
161
|
*/
|
|
153
162
|
export const modelIdSchema = z
|
|
154
163
|
.string()
|
|
155
|
-
.
|
|
164
|
+
.check(utf16MaxLength(129))
|
|
156
165
|
.regex(new RegExp(`^${SLUG_PATTERN}/${SLUG_PATTERN}$`), 'model id must be <publisher>/<model>');
|
|
157
166
|
/** An immutable revision label, unique within its model, e.g. `2026-05-01`. */
|
|
158
167
|
export const modelRevisionLabelSchema = z
|
|
159
168
|
.string()
|
|
160
|
-
.
|
|
169
|
+
.check(utf16MaxLength(64))
|
|
161
170
|
.regex(new RegExp(`^${REVISION_PATTERN}$`), 'revision must be a URL-safe label');
|
|
162
171
|
/**
|
|
163
172
|
* A model reference as a customer writes it: `<publisher>/<model>` (the model's
|
|
@@ -171,7 +180,7 @@ export const modelRevisionLabelSchema = z
|
|
|
171
180
|
*/
|
|
172
181
|
export const modelReferenceSchema = z
|
|
173
182
|
.string()
|
|
174
|
-
.
|
|
183
|
+
.check(utf16MaxLength(194))
|
|
175
184
|
.regex(new RegExp(`^${SLUG_PATTERN}/${SLUG_PATTERN}(?:@${REVISION_PATTERN})?$`), 'model reference must be <publisher>/<model> or <publisher>/<model>@<revision>');
|
|
176
185
|
/**
|
|
177
186
|
* A routing-profile slug, e.g. `auto`, `fast`, `quality`.
|
|
@@ -183,7 +192,7 @@ export const modelReferenceSchema = z
|
|
|
183
192
|
*/
|
|
184
193
|
export const routingProfileSlugSchema = z
|
|
185
194
|
.string()
|
|
186
|
-
.
|
|
195
|
+
.check(utf16MaxLength(64))
|
|
187
196
|
.regex(new RegExp(`^${SLUG_PATTERN}$`), 'routing profile must be a lowercase URL-safe slug');
|
|
188
197
|
/**
|
|
189
198
|
* The opaque PostgreSQL identity of one routing profile.
|
|
@@ -191,11 +200,14 @@ export const routingProfileSlugSchema = z
|
|
|
191
200
|
* No trim, case-folding or format heuristic: callers selecting by id must name
|
|
192
201
|
* the exact stored bytes. The database lookup is the authority for existence.
|
|
193
202
|
*/
|
|
194
|
-
export const routingProfileIdSchema = z
|
|
203
|
+
export const routingProfileIdSchema = z
|
|
204
|
+
.string()
|
|
205
|
+
.check(utf16MinLength(1))
|
|
206
|
+
.check(utf16MaxLength(128));
|
|
195
207
|
/** An inference provider slug, e.g. `openai`, `bedrock`, `oxy-hosted`. */
|
|
196
208
|
export const inferenceProviderSlugSchema = z
|
|
197
209
|
.string()
|
|
198
|
-
.
|
|
210
|
+
.check(utf16MaxLength(64))
|
|
199
211
|
.regex(new RegExp(`^${SLUG_PATTERN}$`), 'provider must be a lowercase URL-safe slug');
|
|
200
212
|
/**
|
|
201
213
|
* A deployment/endpoint id. Opaque to customers: which concrete endpoint served
|
|
@@ -203,7 +215,7 @@ export const inferenceProviderSlugSchema = z
|
|
|
203
215
|
* subset of it is ever attributed back (see the catalogue's serving-boundary
|
|
204
216
|
* rules).
|
|
205
217
|
*/
|
|
206
|
-
export const deploymentIdSchema = z.string().
|
|
218
|
+
export const deploymentIdSchema = z.string().check(utf16MinLength(1)).check(utf16MaxLength(128));
|
|
207
219
|
/**
|
|
208
220
|
* A region identifier, e.g. `us-west-2`, `eu-central-1`. Free-form rather than
|
|
209
221
|
* a closed enum because the set is provider-defined and grows without any
|
|
@@ -211,7 +223,7 @@ export const deploymentIdSchema = z.string().min(1).max(128);
|
|
|
211
223
|
*/
|
|
212
224
|
export const inferenceRegionSchema = z
|
|
213
225
|
.string()
|
|
214
|
-
.
|
|
226
|
+
.check(utf16MaxLength(64))
|
|
215
227
|
.regex(new RegExp(`^${SLUG_PATTERN}$`), 'region must be a lowercase URL-safe slug');
|
|
216
228
|
/**
|
|
217
229
|
* The publisher namespace reserved for models Alia actually owns or derives.
|