@oxy.so/contracts 5.8.0 → 6.0.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/civic.js +10 -9
- package/dist/cjs/client/check.js +61 -53
- 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 +15 -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 +42 -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/civic.js +8 -7
- package/dist/esm/client/check.js +61 -53
- 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 +4 -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 +42 -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/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/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/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 +5 -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 +53 -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 +2 -2
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelDocumentationSchema = exports.modelReleaseIngestionResultSchema = exports.modelReleaseIngestionRequestSchema = exports.modelLineDeclarationSchema = exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchema = exports.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS = exports.trainingComputeFlopsSchema = exports.modelSystemicRiskTierSchema = exports.modelDistributionMethodSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* Model documentation: what a first-party release must DECLARE, what a
|
|
4
8
|
* downstream developer may READ, and the request that ingests both.
|
|
@@ -72,8 +76,6 @@
|
|
|
72
76
|
*
|
|
73
77
|
* Decided in: docs/adr/0008-catalogue-concept-separation.md, issue #972 §12.
|
|
74
78
|
*/
|
|
75
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.modelDocumentationSchema = exports.modelReleaseIngestionResultSchema = exports.modelReleaseIngestionRequestSchema = exports.modelLineDeclarationSchema = exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchema = exports.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS = exports.trainingComputeFlopsSchema = exports.modelSystemicRiskTierSchema = exports.modelDistributionMethodSchema = void 0;
|
|
77
79
|
const zod_1 = require("zod");
|
|
78
80
|
const aliaModelRelease_1 = require("./aliaModelRelease");
|
|
79
81
|
const catalogue_1 = require("./catalogue");
|
|
@@ -137,7 +139,7 @@ exports.modelSystemicRiskTierSchema = zod_1.z.enum([
|
|
|
137
139
|
*/
|
|
138
140
|
exports.trainingComputeFlopsSchema = zod_1.z
|
|
139
141
|
.string()
|
|
140
|
-
.
|
|
142
|
+
.check((0, stringChecks_1.utf16MaxLength)(40))
|
|
141
143
|
.regex(/^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:e\+?(?:0|[1-9][0-9]?))?$/, 'training compute must be a decimal or scientific figure, e.g. 4.2e25');
|
|
142
144
|
/**
|
|
143
145
|
* Article 51(2)'s presumption threshold, as a number.
|
|
@@ -168,13 +170,13 @@ exports.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS = 1e25;
|
|
|
168
170
|
exports.modelDownstreamDocumentationSchema = zod_1.z
|
|
169
171
|
.object({
|
|
170
172
|
/** Annex XI §1(2), Annex XII §1(a): the tasks the model is intended for. */
|
|
171
|
-
intendedTasks: zod_1.z.string().
|
|
173
|
+
intendedTasks: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2000)).optional(),
|
|
172
174
|
/** Annex XI §1(4), Annex XII §1(a). */
|
|
173
175
|
distributionMethods: zod_1.z.array(exports.modelDistributionMethodSchema).min(1),
|
|
174
176
|
/** Annex XI §1(5), reachable through Annex XII §1(a) ("points 1 to 5"). */
|
|
175
|
-
architecture: zod_1.z.string().
|
|
177
|
+
architecture: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(500)).optional(),
|
|
176
178
|
/** Annex XI §1(5): the number of parameters. */
|
|
177
|
-
parameterCount: zod_1.z.number().
|
|
179
|
+
parameterCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
178
180
|
/** Article 53(1)(d): the publicly available summary of training content. */
|
|
179
181
|
trainingDataSummaryUrl: identifiers_1.inferenceHttpsUrlSchema,
|
|
180
182
|
/**
|
|
@@ -213,13 +215,13 @@ exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchem
|
|
|
213
215
|
/** Annex XI §2(b): the computational resources used for training. */
|
|
214
216
|
trainingComputeFlops: exports.trainingComputeFlopsSchema.optional(),
|
|
215
217
|
/** Annex XI §2(b): the training time. */
|
|
216
|
-
trainingTimeHours: zod_1.z.number().positive().
|
|
218
|
+
trainingTimeHours: zod_1.z.number().positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
217
219
|
/**
|
|
218
220
|
* Annex XI §2(c): the known or ESTIMATED energy consumption. The Act asks
|
|
219
221
|
* for an estimate where the figure is not known, so absence here means the
|
|
220
222
|
* Annex XI set is exempt rather than that the number was hard to obtain.
|
|
221
223
|
*/
|
|
222
|
-
energyConsumptionMwh: zod_1.z.number().nonnegative().
|
|
224
|
+
energyConsumptionMwh: zod_1.z.number().nonnegative().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
223
225
|
/**
|
|
224
226
|
* Article 55(1)(a): the model evaluation, including adversarial testing,
|
|
225
227
|
* performed for a model with systemic risk. A pointer, like every other
|
|
@@ -312,8 +314,8 @@ exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchem
|
|
|
312
314
|
*/
|
|
313
315
|
exports.modelLineDeclarationSchema = zod_1.z
|
|
314
316
|
.object({
|
|
315
|
-
displayName: zod_1.z.string().
|
|
316
|
-
description: zod_1.z.string().
|
|
317
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
318
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(4000)).optional(),
|
|
317
319
|
capabilities: catalogue_1.modelCapabilitiesSchema,
|
|
318
320
|
knowledgeCutoff: identifiers_1.inferenceDateSchema.optional(),
|
|
319
321
|
releasedOn: identifiers_1.inferenceDateSchema.optional(),
|
|
@@ -356,15 +358,15 @@ exports.modelReleaseIngestionResultSchema = zod_1.z
|
|
|
356
358
|
.object({
|
|
357
359
|
/** See `version.ts`: served on its own, so it is versioned. */
|
|
358
360
|
schemaVersion: zod_1.z.literal(1),
|
|
359
|
-
releaseId: zod_1.z.string().
|
|
361
|
+
releaseId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
360
362
|
modelId: identifiers_1.modelIdSchema,
|
|
361
363
|
revision: identifiers_1.modelRevisionLabelSchema,
|
|
362
364
|
reference: identifiers_1.modelReferenceSchema,
|
|
363
365
|
/** Whether this request created the release, or found it already ingested. */
|
|
364
366
|
outcome: zod_1.z.enum(['ingested', 'already_ingested']),
|
|
365
|
-
artifactCount: zod_1.z.number().
|
|
366
|
-
signatureCount: zod_1.z.number().
|
|
367
|
-
evaluationCount: zod_1.z.number().
|
|
367
|
+
artifactCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
368
|
+
signatureCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
369
|
+
evaluationCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
368
370
|
ingestedAt: identifiers_1.inferenceTimestampSchema,
|
|
369
371
|
})
|
|
370
372
|
.strict();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unitPriceSchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageQuantitySchema = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
2
5
|
/**
|
|
3
6
|
* Money and usage units for the inference contracts.
|
|
4
7
|
*
|
|
@@ -28,8 +31,6 @@
|
|
|
28
31
|
*
|
|
29
32
|
* Decided in: docs/adr/0009-usage-reservation-and-settlement.md.
|
|
30
33
|
*/
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.unitPriceSchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageQuantitySchema = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = void 0;
|
|
33
34
|
const zod_1 = require("zod");
|
|
34
35
|
/* -------------------------------------------------------------------------- */
|
|
35
36
|
/* Money */
|
|
@@ -203,7 +204,7 @@ exports.usageUnitSchema = zod_1.z.enum(exports.USAGE_UNITS);
|
|
|
203
204
|
exports.usageQuantitySchema = zod_1.z
|
|
204
205
|
.object({
|
|
205
206
|
unit: exports.usageUnitSchema,
|
|
206
|
-
quantity: zod_1.z.number().
|
|
207
|
+
quantity: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
207
208
|
})
|
|
208
209
|
.strict();
|
|
209
210
|
/**
|
|
@@ -228,7 +229,7 @@ exports.unitPriceSchema = zod_1.z
|
|
|
228
229
|
.object({
|
|
229
230
|
unit: exports.usageUnitSchema,
|
|
230
231
|
amount: exports.exactDecimalSchema,
|
|
231
|
-
per: zod_1.z.number().
|
|
232
|
+
per: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
232
233
|
currency: exports.currencyCodeSchema,
|
|
233
234
|
})
|
|
234
235
|
.strict();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.priceSnapshotSchema = exports.priceVersionSchema = exports.priceVersionStatusSchema = void 0;
|
|
4
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
5
|
/**
|
|
3
6
|
* Price versions — the immutable snapshots customer pricing is quoted and
|
|
4
7
|
* settled against.
|
|
@@ -17,8 +20,6 @@
|
|
|
17
20
|
*
|
|
18
21
|
* Decided in: docs/adr/0009-usage-reservation-and-settlement.md.
|
|
19
22
|
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.priceSnapshotSchema = exports.priceVersionSchema = exports.priceVersionStatusSchema = void 0;
|
|
22
23
|
const zod_1 = require("zod");
|
|
23
24
|
const identifiers_1 = require("./identifiers");
|
|
24
25
|
const money_1 = require("./money");
|
|
@@ -41,7 +42,7 @@ exports.priceVersionSchema = zod_1.z
|
|
|
41
42
|
.object({
|
|
42
43
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
43
44
|
schemaVersion: zod_1.z.literal(1),
|
|
44
|
-
priceVersionId: zod_1.z.string().
|
|
45
|
+
priceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
45
46
|
status: exports.priceVersionStatusSchema,
|
|
46
47
|
modelReference: identifiers_1.modelReferenceSchema,
|
|
47
48
|
provider: identifiers_1.inferenceProviderSlugSchema,
|
|
@@ -51,7 +52,11 @@ exports.priceVersionSchema = zod_1.z
|
|
|
51
52
|
/** Absent while this version is the current one. */
|
|
52
53
|
effectiveUntil: identifiers_1.inferenceTimestampSchema.optional(),
|
|
53
54
|
/** The version this one replaced, absent for the first version of a route. */
|
|
54
|
-
supersedesPriceVersionId: zod_1.z
|
|
55
|
+
supersedesPriceVersionId: zod_1.z
|
|
56
|
+
.string()
|
|
57
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
58
|
+
.check((0, stringChecks_1.utf16MaxLength)(128))
|
|
59
|
+
.optional(),
|
|
55
60
|
createdAt: identifiers_1.inferenceTimestampSchema,
|
|
56
61
|
})
|
|
57
62
|
.superRefine((priceVersion, ctx) => {
|
|
@@ -103,7 +108,7 @@ exports.priceVersionSchema = zod_1.z
|
|
|
103
108
|
*/
|
|
104
109
|
exports.priceSnapshotSchema = zod_1.z
|
|
105
110
|
.object({
|
|
106
|
-
priceVersionId: zod_1.z.string().
|
|
111
|
+
priceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
107
112
|
currency: money_1.currencyCodeSchema,
|
|
108
113
|
unitPrices: zod_1.z.array(money_1.unitPriceSchema).min(1),
|
|
109
114
|
})
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = exports.kaanaCredentialIdentitySchema = exports.kaanaCredentialOperationActionSchema = exports.kaanaCredentialOperationIdSchema = exports.kaanaCredentialHandleSchema = exports.providerConnectionScopeSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* BYOK provider connections — the metadata Oxy holds about a customer's own
|
|
4
8
|
* upstream provider credential.
|
|
@@ -24,8 +28,6 @@
|
|
|
24
28
|
*
|
|
25
29
|
* Decided in: issue #972 workstream 10.
|
|
26
30
|
*/
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = exports.kaanaCredentialIdentitySchema = exports.kaanaCredentialOperationActionSchema = exports.kaanaCredentialOperationIdSchema = exports.kaanaCredentialHandleSchema = exports.providerConnectionScopeSchema = void 0;
|
|
29
31
|
const zod_1 = require("zod");
|
|
30
32
|
const identifiers_1 = require("./identifiers");
|
|
31
33
|
/**
|
|
@@ -69,7 +71,7 @@ exports.kaanaCredentialIdentitySchema = zod_1.z
|
|
|
69
71
|
.strict();
|
|
70
72
|
const kaanaCredentialOperationActorSchema = zod_1.z
|
|
71
73
|
.string()
|
|
72
|
-
.
|
|
74
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
73
75
|
.refine((value) => new TextEncoder().encode(value).byteLength <= 256 &&
|
|
74
76
|
value === value.trim() &&
|
|
75
77
|
!/[\r\n]/.test(value), {
|
|
@@ -111,8 +113,8 @@ function isVisibleASCIIProviderCredential(value) {
|
|
|
111
113
|
}
|
|
112
114
|
const kaanaCredentialSecretBase64Schema = zod_1.z
|
|
113
115
|
.string()
|
|
114
|
-
.
|
|
115
|
-
.
|
|
116
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
117
|
+
.check((0, stringChecks_1.utf16MaxLength)(8192))
|
|
116
118
|
.regex(identifiers_1.PADDED_BASE64_PATTERN)
|
|
117
119
|
.refine(isVisibleASCIIProviderCredential, {
|
|
118
120
|
message: 'a decoded provider credential is 1-4096 visible ASCII bytes',
|
|
@@ -135,7 +137,7 @@ exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialIdentitySch
|
|
|
135
137
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
136
138
|
expectedRevision: zod_1.z
|
|
137
139
|
.number()
|
|
138
|
-
.
|
|
140
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
139
141
|
.positive()
|
|
140
142
|
.max(Number.MAX_SAFE_INTEGER - 1),
|
|
141
143
|
secretBase64: kaanaCredentialSecretBase64Schema,
|
|
@@ -150,7 +152,7 @@ exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialIdentitySch
|
|
|
150
152
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
151
153
|
expectedRevision: zod_1.z
|
|
152
154
|
.number()
|
|
153
|
-
.
|
|
155
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
154
156
|
.positive()
|
|
155
157
|
.max(Number.MAX_SAFE_INTEGER - 1),
|
|
156
158
|
})
|
|
@@ -175,7 +177,7 @@ exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialIdent
|
|
|
175
177
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
176
178
|
expectedRevision: zod_1.z
|
|
177
179
|
.number()
|
|
178
|
-
.
|
|
180
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
179
181
|
.positive()
|
|
180
182
|
.max(Number.MAX_SAFE_INTEGER - 1),
|
|
181
183
|
})
|
|
@@ -188,7 +190,7 @@ exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialIdent
|
|
|
188
190
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
189
191
|
expectedRevision: zod_1.z
|
|
190
192
|
.number()
|
|
191
|
-
.
|
|
193
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
192
194
|
.positive()
|
|
193
195
|
.max(Number.MAX_SAFE_INTEGER - 1),
|
|
194
196
|
})
|
|
@@ -205,7 +207,7 @@ exports.kaanaCredentialAppliedOutcomeSchema = zod_1.z
|
|
|
205
207
|
action: exports.kaanaCredentialOperationActionSchema,
|
|
206
208
|
status: zod_1.z.literal('applied'),
|
|
207
209
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
208
|
-
revision: zod_1.z.number().
|
|
210
|
+
revision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
209
211
|
})
|
|
210
212
|
.strict();
|
|
211
213
|
exports.kaanaCredentialConflictOutcomeSchema = zod_1.z
|
|
@@ -233,7 +235,7 @@ exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialIdentitySch
|
|
|
233
235
|
operationId: exports.kaanaCredentialOperationIdSchema,
|
|
234
236
|
applicationId: identifiers_1.oxyApplicationIdSchema,
|
|
235
237
|
credentialHandle: exports.kaanaCredentialHandleSchema,
|
|
236
|
-
credentialRevision: zod_1.z.number().
|
|
238
|
+
credentialRevision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
237
239
|
deploymentId: identifiers_1.deploymentIdSchema,
|
|
238
240
|
})
|
|
239
241
|
.strict();
|
|
@@ -306,7 +308,7 @@ exports.providerCredentialValidationOperationSchema = zod_1.z
|
|
|
306
308
|
.object({
|
|
307
309
|
schemaVersion: zod_1.z.literal(1),
|
|
308
310
|
operationId: exports.kaanaCredentialOperationIdSchema,
|
|
309
|
-
connectionId: zod_1.z.string().
|
|
311
|
+
connectionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
310
312
|
applicationId: identifiers_1.oxyApplicationIdSchema,
|
|
311
313
|
deploymentId: identifiers_1.deploymentIdSchema,
|
|
312
314
|
state: exports.kaanaCredentialValidationOutcomeStateSchema,
|
|
@@ -401,7 +403,7 @@ exports.providerConnectionSchema = zod_1.z
|
|
|
401
403
|
.object({
|
|
402
404
|
/** See `version.ts`: exchanged with the data plane and rendered by Console. */
|
|
403
405
|
schemaVersion: zod_1.z.literal(2),
|
|
404
|
-
connectionId: zod_1.z.string().
|
|
406
|
+
connectionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
405
407
|
provider: identifiers_1.inferenceProviderSlugSchema,
|
|
406
408
|
/** The Oxy account that owns the connection and answers for its use. */
|
|
407
409
|
ownerAccountId: identifiers_1.oxyAccountIdSchema,
|
|
@@ -410,7 +412,12 @@ exports.providerConnectionSchema = zod_1.z
|
|
|
410
412
|
status: exports.providerConnectionStatusSchema,
|
|
411
413
|
custodyState: exports.providerCredentialCustodyStateSchema,
|
|
412
414
|
credentialHandle: exports.kaanaCredentialHandleSchema.optional(),
|
|
413
|
-
credentialRevision: zod_1.z
|
|
415
|
+
credentialRevision: zod_1.z
|
|
416
|
+
.number()
|
|
417
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
418
|
+
.positive()
|
|
419
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
420
|
+
.optional(),
|
|
414
421
|
validation: exports.providerConnectionValidationSchema,
|
|
415
422
|
/**
|
|
416
423
|
* Always `true` for a BYOK connection: the provider bills the customer's own
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.realtimeTranscriptDoneEventSchema = exports.realtimeTranscriptDeltaEventSchema = exports.realtimeTranscriptSourceSchema = exports.realtimeOutputAudioDoneEventSchema = exports.realtimeOutputAudioDeltaEventSchema = exports.realtimeResponseCreatedEventSchema = exports.realtimeInputAudioClearedEventSchema = exports.realtimeInputAudioCommittedEventSchema = exports.realtimeSpeechStoppedEventSchema = exports.realtimeSpeechStartedEventSchema = exports.realtimeItemTruncatedEventSchema = exports.realtimeItemDeletedEventSchema = exports.realtimeItemDoneEventSchema = exports.realtimeItemAddedEventSchema = exports.realtimeCommandAcceptedEventSchema = exports.realtimeSessionResumedEventSchema = exports.realtimeSessionUpdatedEventSchema = exports.realtimeSessionCreatedEventSchema = exports.realtimeClientCommandSchema = exports.realtimeSessionCloseCommandSchema = exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = exports.realtimeItemCreateCommandSchema = exports.realtimeSessionUpdateCommandSchema = exports.realtimeResponseParametersSchema = exports.realtimeConversationItemSchema = exports.realtimeContentPartSchema = exports.realtimeSessionRequestSchema = exports.realtimeClientMetadataSchema = exports.realtimeSessionLimitsSchema = exports.realtimeSessionConfigUpdateSchema = exports.realtimeSessionConfigSchema = exports.realtimeTranslationSchema = exports.realtimeInputTranscriptionSchema = exports.realtimeTurnDetectionSchema = exports.realtimeOutputModalitySchema = exports.realtimeAudioFormatSchema = exports.realtimeResponseIdSchema = exports.realtimeItemIdSchema = exports.realtimeCommandIdSchema = exports.MAX_REALTIME_RESUME_WINDOW_MS = exports.MAX_REALTIME_SESSION_AUDIO_BYTES = exports.MAX_REALTIME_SESSION_DURATION_MS = exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = void 0;
|
|
4
|
+
exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = void 0;
|
|
5
|
+
const numberChecks_1 = require("../numberChecks");
|
|
6
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
7
|
/**
|
|
3
8
|
* Realtime sessions — the one inference family that is not a request.
|
|
4
9
|
*
|
|
@@ -84,9 +89,6 @@
|
|
|
84
89
|
*
|
|
85
90
|
* Decided in: OxyHQ/Kaana#90.
|
|
86
91
|
*/
|
|
87
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
88
|
-
exports.realtimeTranscriptDoneEventSchema = exports.realtimeTranscriptDeltaEventSchema = exports.realtimeTranscriptSourceSchema = exports.realtimeOutputAudioDoneEventSchema = exports.realtimeOutputAudioDeltaEventSchema = exports.realtimeResponseCreatedEventSchema = exports.realtimeInputAudioClearedEventSchema = exports.realtimeInputAudioCommittedEventSchema = exports.realtimeSpeechStoppedEventSchema = exports.realtimeSpeechStartedEventSchema = exports.realtimeItemTruncatedEventSchema = exports.realtimeItemDeletedEventSchema = exports.realtimeItemDoneEventSchema = exports.realtimeItemAddedEventSchema = exports.realtimeCommandAcceptedEventSchema = exports.realtimeSessionResumedEventSchema = exports.realtimeSessionUpdatedEventSchema = exports.realtimeSessionCreatedEventSchema = exports.realtimeClientCommandSchema = exports.realtimeSessionCloseCommandSchema = exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = exports.realtimeItemCreateCommandSchema = exports.realtimeSessionUpdateCommandSchema = exports.realtimeResponseParametersSchema = exports.realtimeConversationItemSchema = exports.realtimeContentPartSchema = exports.realtimeSessionRequestSchema = exports.realtimeClientMetadataSchema = exports.realtimeSessionLimitsSchema = exports.realtimeSessionConfigUpdateSchema = exports.realtimeSessionConfigSchema = exports.realtimeTranslationSchema = exports.realtimeInputTranscriptionSchema = exports.realtimeTurnDetectionSchema = exports.realtimeOutputModalitySchema = exports.realtimeAudioFormatSchema = exports.realtimeResponseIdSchema = exports.realtimeItemIdSchema = exports.realtimeCommandIdSchema = exports.MAX_REALTIME_RESUME_WINDOW_MS = exports.MAX_REALTIME_SESSION_AUDIO_BYTES = exports.MAX_REALTIME_SESSION_DURATION_MS = exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = void 0;
|
|
89
|
-
exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = void 0;
|
|
90
92
|
const zod_1 = require("zod");
|
|
91
93
|
const attribution_1 = require("./attribution");
|
|
92
94
|
const catalogue_1 = require("./catalogue");
|
|
@@ -120,11 +122,17 @@ exports.MAX_REALTIME_RESUME_WINDOW_MS = 60000;
|
|
|
120
122
|
/* Vocabulary */
|
|
121
123
|
/* -------------------------------------------------------------------------- */
|
|
122
124
|
/** A client-chosen command identity, unique within one session. */
|
|
123
|
-
exports.realtimeCommandIdSchema = zod_1.z
|
|
125
|
+
exports.realtimeCommandIdSchema = zod_1.z
|
|
126
|
+
.string()
|
|
127
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
128
|
+
.check((0, stringChecks_1.utf16MaxLength)(128));
|
|
124
129
|
/** A conversation item's identity within one session. */
|
|
125
|
-
exports.realtimeItemIdSchema = zod_1.z.string().
|
|
130
|
+
exports.realtimeItemIdSchema = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128));
|
|
126
131
|
/** A response's identity within one session. */
|
|
127
|
-
exports.realtimeResponseIdSchema = zod_1.z
|
|
132
|
+
exports.realtimeResponseIdSchema = zod_1.z
|
|
133
|
+
.string()
|
|
134
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
135
|
+
.check((0, stringChecks_1.utf16MaxLength)(128));
|
|
128
136
|
/**
|
|
129
137
|
* The audio encodings a session carries, in both directions. Named by what they
|
|
130
138
|
* ARE (sample format, rate) because a realtime stream has no container to say so.
|
|
@@ -134,11 +142,11 @@ exports.realtimeAudioFormatSchema = zod_1.z.enum(['pcm16_24khz', 'g711_ulaw', 'g
|
|
|
134
142
|
exports.realtimeOutputModalitySchema = zod_1.z.enum(['text', 'audio']);
|
|
135
143
|
const audioFrameSchema = zod_1.z
|
|
136
144
|
.string()
|
|
137
|
-
.
|
|
138
|
-
.
|
|
145
|
+
.check((0, stringChecks_1.utf16MinLength)(4))
|
|
146
|
+
.check((0, stringChecks_1.utf16MaxLength)(exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH))
|
|
139
147
|
.regex(identifiers_1.PADDED_BASE64_PATTERN);
|
|
140
|
-
const sequenceSchema = zod_1.z.number().
|
|
141
|
-
const milliseconds = zod_1.z.number().
|
|
148
|
+
const sequenceSchema = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)());
|
|
149
|
+
const milliseconds = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)());
|
|
142
150
|
/* -------------------------------------------------------------------------- */
|
|
143
151
|
/* Session configuration */
|
|
144
152
|
/* -------------------------------------------------------------------------- */
|
|
@@ -157,8 +165,8 @@ exports.realtimeTurnDetectionSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
157
165
|
.object({
|
|
158
166
|
type: zod_1.z.literal('server_vad'),
|
|
159
167
|
threshold: zod_1.z.number().min(0).max(1).optional(),
|
|
160
|
-
prefixPaddingMs: zod_1.z.number().
|
|
161
|
-
silenceDurationMs: zod_1.z.number().
|
|
168
|
+
prefixPaddingMs: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(0).max(5000).optional(),
|
|
169
|
+
silenceDurationMs: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(0).max(10000).optional(),
|
|
162
170
|
createResponse: zod_1.z.boolean(),
|
|
163
171
|
interruptResponse: zod_1.z.boolean(),
|
|
164
172
|
})
|
|
@@ -180,15 +188,15 @@ exports.realtimeTurnDetectionSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
180
188
|
exports.realtimeInputTranscriptionSchema = zod_1.z
|
|
181
189
|
.object({
|
|
182
190
|
/** A BCP 47 tag, when the caller knows the language. */
|
|
183
|
-
language: zod_1.z.string().
|
|
184
|
-
prompt: zod_1.z.string().
|
|
191
|
+
language: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(2)).check((0, stringChecks_1.utf16MaxLength)(35)).optional(),
|
|
192
|
+
prompt: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(4096)).optional(),
|
|
185
193
|
})
|
|
186
194
|
.strict();
|
|
187
195
|
/** The target of a `translation` session. */
|
|
188
196
|
exports.realtimeTranslationSchema = zod_1.z
|
|
189
197
|
.object({
|
|
190
198
|
/** A BCP 47 tag. */
|
|
191
|
-
targetLanguage: zod_1.z.string().
|
|
199
|
+
targetLanguage: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(2)).check((0, stringChecks_1.utf16MaxLength)(35)),
|
|
192
200
|
})
|
|
193
201
|
.strict();
|
|
194
202
|
/**
|
|
@@ -202,9 +210,9 @@ exports.realtimeTranslationSchema = zod_1.z
|
|
|
202
210
|
*/
|
|
203
211
|
exports.realtimeSessionConfigSchema = zod_1.z
|
|
204
212
|
.object({
|
|
205
|
-
instructions: zod_1.z.string().
|
|
213
|
+
instructions: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(32768)).optional(),
|
|
206
214
|
outputModalities: zod_1.z.array(exports.realtimeOutputModalitySchema).min(1).max(2).optional(),
|
|
207
|
-
voice: zod_1.z.string().
|
|
215
|
+
voice: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)).optional(),
|
|
208
216
|
inputAudioFormat: exports.realtimeAudioFormatSchema,
|
|
209
217
|
outputAudioFormat: exports.realtimeAudioFormatSchema.optional(),
|
|
210
218
|
turnDetection: exports.realtimeTurnDetectionSchema,
|
|
@@ -214,7 +222,12 @@ exports.realtimeSessionConfigSchema = zod_1.z
|
|
|
214
222
|
toolChoice: request_1.toolChoiceSchema.optional(),
|
|
215
223
|
temperature: zod_1.z.number().min(0).max(2).optional(),
|
|
216
224
|
/** Per response, not per session: the session's ceiling is `limits`. */
|
|
217
|
-
maxOutputTokens: zod_1.z
|
|
225
|
+
maxOutputTokens: zod_1.z
|
|
226
|
+
.number()
|
|
227
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
228
|
+
.positive()
|
|
229
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
230
|
+
.optional(),
|
|
218
231
|
})
|
|
219
232
|
.strict();
|
|
220
233
|
/**
|
|
@@ -227,14 +240,19 @@ exports.realtimeSessionConfigSchema = zod_1.z
|
|
|
227
240
|
*/
|
|
228
241
|
exports.realtimeSessionConfigUpdateSchema = zod_1.z
|
|
229
242
|
.object({
|
|
230
|
-
instructions: zod_1.z.string().
|
|
243
|
+
instructions: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(32768)).optional(),
|
|
231
244
|
outputModalities: zod_1.z.array(exports.realtimeOutputModalitySchema).min(1).max(2).optional(),
|
|
232
245
|
turnDetection: exports.realtimeTurnDetectionSchema.optional(),
|
|
233
246
|
inputAudioTranscription: exports.realtimeInputTranscriptionSchema.optional(),
|
|
234
247
|
tools: zod_1.z.array(request_1.toolDefinitionSchema).max(128).optional(),
|
|
235
248
|
toolChoice: request_1.toolChoiceSchema.optional(),
|
|
236
249
|
temperature: zod_1.z.number().min(0).max(2).optional(),
|
|
237
|
-
maxOutputTokens: zod_1.z
|
|
250
|
+
maxOutputTokens: zod_1.z
|
|
251
|
+
.number()
|
|
252
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
253
|
+
.positive()
|
|
254
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
255
|
+
.optional(),
|
|
238
256
|
})
|
|
239
257
|
.strict()
|
|
240
258
|
.superRefine((update, ctx) => {
|
|
@@ -253,11 +271,27 @@ exports.realtimeSessionConfigUpdateSchema = zod_1.z
|
|
|
253
271
|
*/
|
|
254
272
|
exports.realtimeSessionLimitsSchema = zod_1.z
|
|
255
273
|
.object({
|
|
256
|
-
maxDurationMs: zod_1.z
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
274
|
+
maxDurationMs: zod_1.z
|
|
275
|
+
.number()
|
|
276
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
277
|
+
.min(1000)
|
|
278
|
+
.max(exports.MAX_REALTIME_SESSION_DURATION_MS),
|
|
279
|
+
idleTimeoutMs: zod_1.z
|
|
280
|
+
.number()
|
|
281
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
282
|
+
.min(1000)
|
|
283
|
+
.max(exports.MAX_REALTIME_SESSION_DURATION_MS),
|
|
284
|
+
maxInputAudioBytes: zod_1.z
|
|
285
|
+
.number()
|
|
286
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
287
|
+
.positive()
|
|
288
|
+
.max(exports.MAX_REALTIME_SESSION_AUDIO_BYTES),
|
|
289
|
+
maxOutputAudioBytes: zod_1.z
|
|
290
|
+
.number()
|
|
291
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
292
|
+
.positive()
|
|
293
|
+
.max(exports.MAX_REALTIME_SESSION_AUDIO_BYTES),
|
|
294
|
+
maxResponses: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().max(10000),
|
|
261
295
|
})
|
|
262
296
|
.strict();
|
|
263
297
|
/**
|
|
@@ -267,10 +301,10 @@ exports.realtimeSessionLimitsSchema = zod_1.z
|
|
|
267
301
|
exports.realtimeClientMetadataSchema = zod_1.z
|
|
268
302
|
.object({
|
|
269
303
|
/** The public path, e.g. `/v1/realtime`. */
|
|
270
|
-
endpoint: zod_1.z.string().
|
|
271
|
-
clientSessionId: zod_1.z.string().
|
|
304
|
+
endpoint: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
|
|
305
|
+
clientSessionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
272
306
|
receivedAt: identifiers_1.inferenceTimestampSchema,
|
|
273
|
-
labels: zod_1.z.record(zod_1.z.string().
|
|
307
|
+
labels: zod_1.z.record(zod_1.z.string(), zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(256))).optional(),
|
|
274
308
|
})
|
|
275
309
|
.strict();
|
|
276
310
|
/* -------------------------------------------------------------------------- */
|
|
@@ -392,7 +426,9 @@ exports.realtimeSessionRequestSchema = zod_1.z
|
|
|
392
426
|
* item echoing it carries only the format and, once known, the transcript.
|
|
393
427
|
*/
|
|
394
428
|
exports.realtimeContentPartSchema = zod_1.z.discriminatedUnion('type', [
|
|
395
|
-
zod_1.z
|
|
429
|
+
zod_1.z
|
|
430
|
+
.object({ type: zod_1.z.literal('input_text'), text: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(1048576)) })
|
|
431
|
+
.strict(),
|
|
396
432
|
zod_1.z
|
|
397
433
|
.object({
|
|
398
434
|
type: zod_1.z.literal('input_audio'),
|
|
@@ -431,8 +467,8 @@ exports.realtimeConversationItemSchema = zod_1.z
|
|
|
431
467
|
.object({
|
|
432
468
|
type: zod_1.z.literal('function_call'),
|
|
433
469
|
itemId: exports.realtimeItemIdSchema.optional(),
|
|
434
|
-
callId: zod_1.z.string().
|
|
435
|
-
name: zod_1.z.string().
|
|
470
|
+
callId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
471
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
436
472
|
arguments: zod_1.z.string(),
|
|
437
473
|
})
|
|
438
474
|
.strict(),
|
|
@@ -440,8 +476,8 @@ exports.realtimeConversationItemSchema = zod_1.z
|
|
|
440
476
|
.object({
|
|
441
477
|
type: zod_1.z.literal('function_call_output'),
|
|
442
478
|
itemId: exports.realtimeItemIdSchema.optional(),
|
|
443
|
-
callId: zod_1.z.string().
|
|
444
|
-
output: zod_1.z.string().
|
|
479
|
+
callId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
480
|
+
output: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(1048576)),
|
|
445
481
|
})
|
|
446
482
|
.strict(),
|
|
447
483
|
])
|
|
@@ -471,9 +507,14 @@ exports.realtimeConversationItemSchema = zod_1.z
|
|
|
471
507
|
/** Per-response overrides for `response.create`. Absent fields keep the session's. */
|
|
472
508
|
exports.realtimeResponseParametersSchema = zod_1.z
|
|
473
509
|
.object({
|
|
474
|
-
instructions: zod_1.z.string().
|
|
510
|
+
instructions: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(32768)).optional(),
|
|
475
511
|
outputModalities: zod_1.z.array(exports.realtimeOutputModalitySchema).min(1).max(2).optional(),
|
|
476
|
-
maxOutputTokens: zod_1.z
|
|
512
|
+
maxOutputTokens: zod_1.z
|
|
513
|
+
.number()
|
|
514
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
515
|
+
.positive()
|
|
516
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
517
|
+
.optional(),
|
|
477
518
|
toolChoice: request_1.toolChoiceSchema.optional(),
|
|
478
519
|
})
|
|
479
520
|
.strict();
|
|
@@ -512,7 +553,7 @@ exports.realtimeItemTruncateCommandSchema = zod_1.z.object({
|
|
|
512
553
|
...commandBase,
|
|
513
554
|
type: zod_1.z.literal('conversation.item.truncate'),
|
|
514
555
|
itemId: exports.realtimeItemIdSchema,
|
|
515
|
-
contentIndex: zod_1.z.number().
|
|
556
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
516
557
|
audioEndMs: milliseconds,
|
|
517
558
|
});
|
|
518
559
|
exports.realtimeInputAudioAppendCommandSchema = zod_1.z.object({
|
|
@@ -547,7 +588,7 @@ exports.realtimeResponseCancelCommandSchema = zod_1.z.object({
|
|
|
547
588
|
exports.realtimeSessionResumeCommandSchema = zod_1.z.object({
|
|
548
589
|
...commandBase,
|
|
549
590
|
type: zod_1.z.literal('session.resume'),
|
|
550
|
-
afterSequence: zod_1.z.number().
|
|
591
|
+
afterSequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(-1).check((0, numberChecks_1.safeNumberCheck)()),
|
|
551
592
|
});
|
|
552
593
|
exports.realtimeSessionCloseCommandSchema = zod_1.z.object({
|
|
553
594
|
...commandBase,
|
|
@@ -594,7 +635,7 @@ exports.realtimeSessionCreatedEventSchema = zod_1.z.object({
|
|
|
594
635
|
kind: catalogue_1.realtimeSessionKindSchema,
|
|
595
636
|
config: exports.realtimeSessionConfigSchema,
|
|
596
637
|
limits: exports.realtimeSessionLimitsSchema,
|
|
597
|
-
resumeWindowMs: zod_1.z.number().
|
|
638
|
+
resumeWindowMs: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(exports.MAX_REALTIME_RESUME_WINDOW_MS),
|
|
598
639
|
startedAt: identifiers_1.inferenceTimestampSchema,
|
|
599
640
|
expiresAt: identifiers_1.inferenceTimestampSchema,
|
|
600
641
|
});
|
|
@@ -606,7 +647,7 @@ exports.realtimeSessionUpdatedEventSchema = zod_1.z.object({
|
|
|
606
647
|
exports.realtimeSessionResumedEventSchema = zod_1.z.object({
|
|
607
648
|
...eventBase,
|
|
608
649
|
type: zod_1.z.literal('session.resumed'),
|
|
609
|
-
afterSequence: zod_1.z.number().
|
|
650
|
+
afterSequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(-1).check((0, numberChecks_1.safeNumberCheck)()),
|
|
610
651
|
});
|
|
611
652
|
/** Sent before a command is applied. `duplicate` means it was not applied again. */
|
|
612
653
|
exports.realtimeCommandAcceptedEventSchema = zod_1.z.object({
|
|
@@ -637,7 +678,7 @@ exports.realtimeItemTruncatedEventSchema = zod_1.z.object({
|
|
|
637
678
|
...eventBase,
|
|
638
679
|
type: zod_1.z.literal('conversation.item.truncated'),
|
|
639
680
|
itemId: exports.realtimeItemIdSchema,
|
|
640
|
-
contentIndex: zod_1.z.number().
|
|
681
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
641
682
|
audioEndMs: milliseconds,
|
|
642
683
|
});
|
|
643
684
|
/**
|
|
@@ -678,7 +719,7 @@ exports.realtimeOutputAudioDeltaEventSchema = zod_1.z.object({
|
|
|
678
719
|
type: zod_1.z.literal('output_audio.delta'),
|
|
679
720
|
responseId: exports.realtimeResponseIdSchema,
|
|
680
721
|
itemId: exports.realtimeItemIdSchema,
|
|
681
|
-
contentIndex: zod_1.z.number().
|
|
722
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
682
723
|
format: exports.realtimeAudioFormatSchema,
|
|
683
724
|
data: audioFrameSchema,
|
|
684
725
|
});
|
|
@@ -687,7 +728,7 @@ exports.realtimeOutputAudioDoneEventSchema = zod_1.z.object({
|
|
|
687
728
|
type: zod_1.z.literal('output_audio.done'),
|
|
688
729
|
responseId: exports.realtimeResponseIdSchema,
|
|
689
730
|
itemId: exports.realtimeItemIdSchema,
|
|
690
|
-
contentIndex: zod_1.z.number().
|
|
731
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
691
732
|
});
|
|
692
733
|
/**
|
|
693
734
|
* Which audio a transcript describes: the caller's (`input_audio`) or the
|
|
@@ -699,7 +740,7 @@ exports.realtimeTranscriptDeltaEventSchema = zod_1.z.object({
|
|
|
699
740
|
type: zod_1.z.literal('transcript.delta'),
|
|
700
741
|
source: exports.realtimeTranscriptSourceSchema,
|
|
701
742
|
itemId: exports.realtimeItemIdSchema,
|
|
702
|
-
contentIndex: zod_1.z.number().
|
|
743
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
703
744
|
/** Present for `output_audio`: the response whose speech this is. */
|
|
704
745
|
responseId: exports.realtimeResponseIdSchema.optional(),
|
|
705
746
|
text: zod_1.z.string(),
|
|
@@ -709,7 +750,7 @@ exports.realtimeTranscriptDoneEventSchema = zod_1.z.object({
|
|
|
709
750
|
type: zod_1.z.literal('transcript.done'),
|
|
710
751
|
source: exports.realtimeTranscriptSourceSchema,
|
|
711
752
|
itemId: exports.realtimeItemIdSchema,
|
|
712
|
-
contentIndex: zod_1.z.number().
|
|
753
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
713
754
|
responseId: exports.realtimeResponseIdSchema.optional(),
|
|
714
755
|
transcript: zod_1.z.string(),
|
|
715
756
|
});
|
|
@@ -719,7 +760,7 @@ exports.realtimeTextDeltaEventSchema = zod_1.z.object({
|
|
|
719
760
|
type: zod_1.z.literal('text.delta'),
|
|
720
761
|
responseId: exports.realtimeResponseIdSchema,
|
|
721
762
|
itemId: exports.realtimeItemIdSchema,
|
|
722
|
-
contentIndex: zod_1.z.number().
|
|
763
|
+
contentIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
723
764
|
text: zod_1.z.string(),
|
|
724
765
|
});
|
|
725
766
|
/** A tool call being streamed; same accumulation rules as the one-shot event. */
|
|
@@ -728,8 +769,8 @@ exports.realtimeToolCallEventSchema = zod_1.z.object({
|
|
|
728
769
|
type: zod_1.z.literal('tool_call'),
|
|
729
770
|
responseId: exports.realtimeResponseIdSchema,
|
|
730
771
|
itemId: exports.realtimeItemIdSchema,
|
|
731
|
-
toolCallId: zod_1.z.string().
|
|
732
|
-
name: zod_1.z.string().
|
|
772
|
+
toolCallId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
773
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
733
774
|
argumentsDelta: zod_1.z.string().optional(),
|
|
734
775
|
complete: zod_1.z.boolean(),
|
|
735
776
|
});
|