@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.inferenceRequestSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.clientRequestMetadataSchema = exports.inferenceReasoningSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* The normalized inference request — the canonical internal envelope Oxy's
|
|
4
8
|
* public edge forwards to the data plane.
|
|
@@ -24,8 +28,6 @@
|
|
|
24
28
|
* Decided in: docs/adr/0010-public-api-compatibility.md,
|
|
25
29
|
* docs/adr/0017-authorized-routes-in-the-envelope.md.
|
|
26
30
|
*/
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.inferenceRequestSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.clientRequestMetadataSchema = exports.inferenceReasoningSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = void 0;
|
|
29
31
|
const zod_1 = require("zod");
|
|
30
32
|
const attribution_1 = require("./attribution");
|
|
31
33
|
const catalogue_1 = require("./catalogue");
|
|
@@ -43,13 +45,13 @@ const routingPolicy_1 = require("./routingPolicy");
|
|
|
43
45
|
*/
|
|
44
46
|
exports.inferenceContentSourceSchema = zod_1.z.discriminatedUnion("kind", [
|
|
45
47
|
zod_1.z
|
|
46
|
-
.object({ kind: zod_1.z.literal("url"), url: zod_1.z.string().
|
|
48
|
+
.object({ kind: zod_1.z.literal("url"), url: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(4096)) })
|
|
47
49
|
.strict(),
|
|
48
50
|
zod_1.z
|
|
49
51
|
.object({
|
|
50
52
|
kind: zod_1.z.literal("inline"),
|
|
51
|
-
mediaType: zod_1.z.string().
|
|
52
|
-
data: zod_1.z.string().
|
|
53
|
+
mediaType: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(255)),
|
|
54
|
+
data: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
53
55
|
})
|
|
54
56
|
.strict(),
|
|
55
57
|
]);
|
|
@@ -102,7 +104,7 @@ exports.inferenceContentPartSchema = zod_1.z.discriminatedUnion("type", [
|
|
|
102
104
|
.object({
|
|
103
105
|
type: zod_1.z.literal("file"),
|
|
104
106
|
source: exports.inferenceContentSourceSchema,
|
|
105
|
-
filename: zod_1.z.string().
|
|
107
|
+
filename: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(255)).optional(),
|
|
106
108
|
})
|
|
107
109
|
.strict(),
|
|
108
110
|
/**
|
|
@@ -120,8 +122,8 @@ exports.inferenceContentPartSchema = zod_1.z.discriminatedUnion("type", [
|
|
|
120
122
|
*/
|
|
121
123
|
exports.inferenceToolCallSchema = zod_1.z
|
|
122
124
|
.object({
|
|
123
|
-
id: zod_1.z.string().
|
|
124
|
-
name: zod_1.z.string().
|
|
125
|
+
id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
126
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
125
127
|
arguments: zod_1.z.string(),
|
|
126
128
|
})
|
|
127
129
|
.strict();
|
|
@@ -145,9 +147,9 @@ exports.inferenceMessageSchema = zod_1.z
|
|
|
145
147
|
role: exports.inferenceMessageRoleSchema,
|
|
146
148
|
content: zod_1.z.array(exports.inferenceContentPartSchema),
|
|
147
149
|
/** Participant name, where the dialect supports naming participants. */
|
|
148
|
-
name: zod_1.z.string().
|
|
150
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
149
151
|
/** The tool call this message answers. Required on, and only on, `tool`. */
|
|
150
|
-
toolCallId: zod_1.z.string().
|
|
152
|
+
toolCallId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
151
153
|
/** Tool calls the assistant made. Only on `assistant`. */
|
|
152
154
|
toolCalls: zod_1.z.array(exports.inferenceToolCallSchema).optional(),
|
|
153
155
|
})
|
|
@@ -220,12 +222,12 @@ exports.samplingParametersSchema = zod_1.z
|
|
|
220
222
|
.object({
|
|
221
223
|
temperature: zod_1.z.number().min(0).max(2).optional(),
|
|
222
224
|
topP: zod_1.z.number().min(0).max(1).optional(),
|
|
223
|
-
topK: zod_1.z.number().
|
|
225
|
+
topK: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
224
226
|
frequencyPenalty: zod_1.z.number().min(-2).max(2).optional(),
|
|
225
227
|
presencePenalty: zod_1.z.number().min(-2).max(2).optional(),
|
|
226
228
|
/** A seed makes a request reproducible on providers that honour one. */
|
|
227
|
-
seed: zod_1.z.number().
|
|
228
|
-
stopSequences: zod_1.z.array(zod_1.z.string().
|
|
229
|
+
seed: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
230
|
+
stopSequences: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256))).max(8).optional(),
|
|
229
231
|
})
|
|
230
232
|
.strict();
|
|
231
233
|
/**
|
|
@@ -236,9 +238,9 @@ exports.samplingParametersSchema = zod_1.z
|
|
|
236
238
|
exports.toolDefinitionSchema = zod_1.z
|
|
237
239
|
.object({
|
|
238
240
|
type: zod_1.z.literal("function"),
|
|
239
|
-
name: zod_1.z.string().
|
|
240
|
-
description: zod_1.z.string().
|
|
241
|
-
parameters: zod_1.z.record(zod_1.z.unknown()),
|
|
241
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
242
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(2000)).optional(),
|
|
243
|
+
parameters: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
242
244
|
/** Ask the provider to enforce the schema, where it supports enforcement. */
|
|
243
245
|
strict: zod_1.z.boolean().optional(),
|
|
244
246
|
})
|
|
@@ -247,7 +249,7 @@ exports.toolDefinitionSchema = zod_1.z
|
|
|
247
249
|
exports.toolChoiceSchema = zod_1.z.union([
|
|
248
250
|
zod_1.z.enum(["auto", "none", "required"]),
|
|
249
251
|
zod_1.z
|
|
250
|
-
.object({ type: zod_1.z.literal("function"), name: zod_1.z.string().
|
|
252
|
+
.object({ type: zod_1.z.literal("function"), name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)) })
|
|
251
253
|
.strict(),
|
|
252
254
|
]);
|
|
253
255
|
/** Structured-output request: free text, any JSON object, or a named schema. */
|
|
@@ -257,8 +259,8 @@ exports.responseFormatSchema = zod_1.z.discriminatedUnion("type", [
|
|
|
257
259
|
zod_1.z
|
|
258
260
|
.object({
|
|
259
261
|
type: zod_1.z.literal("json_schema"),
|
|
260
|
-
name: zod_1.z.string().
|
|
261
|
-
schema: zod_1.z.record(zod_1.z.unknown()),
|
|
262
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
263
|
+
schema: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
262
264
|
strict: zod_1.z.boolean(),
|
|
263
265
|
})
|
|
264
266
|
.strict(),
|
|
@@ -294,11 +296,11 @@ exports.clientRequestMetadataSchema = zod_1.z
|
|
|
294
296
|
/** The public dialect the customer called. The response is rendered in it. */
|
|
295
297
|
apiFormat: catalogue_1.inferenceApiFormatSchema,
|
|
296
298
|
/** The public path, e.g. `/v1/responses`. */
|
|
297
|
-
endpoint: zod_1.z.string().
|
|
299
|
+
endpoint: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
|
|
298
300
|
/** The customer's own correlation id, when they sent one. */
|
|
299
|
-
clientRequestId: zod_1.z.string().
|
|
301
|
+
clientRequestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
300
302
|
receivedAt: identifiers_1.inferenceTimestampSchema,
|
|
301
|
-
labels: zod_1.z.record(zod_1.z.string().
|
|
303
|
+
labels: zod_1.z.record(zod_1.z.string(), zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(256))).optional(),
|
|
302
304
|
})
|
|
303
305
|
.strict();
|
|
304
306
|
/* -------------------------------------------------------------------------- */
|
|
@@ -317,7 +319,7 @@ const modelLineOf = (reference) => {
|
|
|
317
319
|
};
|
|
318
320
|
/** Parameters for text-to-speech, preserved in the signed request. */
|
|
319
321
|
exports.inferenceSpeechParametersSchema = zod_1.z.object({
|
|
320
|
-
voice: zod_1.z.string().
|
|
322
|
+
voice: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
|
|
321
323
|
responseFormat: zod_1.z.enum(["mp3", "opus", "aac", "flac", "wav", "pcm"]),
|
|
322
324
|
speed: zod_1.z.number().min(0.25).max(4).optional(),
|
|
323
325
|
}).strict();
|
|
@@ -336,7 +338,7 @@ exports.inferenceSpeechParametersSchema = zod_1.z.object({
|
|
|
336
338
|
*/
|
|
337
339
|
exports.inferenceAudioOutputParametersSchema = zod_1.z
|
|
338
340
|
.object({
|
|
339
|
-
voice: zod_1.z.string().
|
|
341
|
+
voice: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
|
|
340
342
|
format: zod_1.z.enum(["wav", "mp3", "flac", "opus", "pcm"]),
|
|
341
343
|
})
|
|
342
344
|
.strict();
|
|
@@ -357,7 +359,7 @@ exports.inferenceRequestSchema = zod_1.z
|
|
|
357
359
|
modality: catalogue_1.inferenceModalitySchema,
|
|
358
360
|
input: exports.inferenceInputSchema,
|
|
359
361
|
stream: zod_1.z.boolean(),
|
|
360
|
-
maxOutputTokens: zod_1.z.number().
|
|
362
|
+
maxOutputTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
361
363
|
sampling: exports.samplingParametersSchema,
|
|
362
364
|
/** Absent means the route's own default reasoning behaviour. */
|
|
363
365
|
reasoning: exports.inferenceReasoningSchema.optional(),
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authorizedRouteSchema = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = void 0;
|
|
4
|
+
exports.effectiveSameModelDeployment = effectiveSameModelDeployment;
|
|
5
|
+
const numberChecks_1 = require("../numberChecks");
|
|
6
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
7
|
/**
|
|
3
8
|
* Routing policy — the customer-facing routing configuration.
|
|
4
9
|
*
|
|
@@ -32,9 +37,6 @@
|
|
|
32
37
|
* Decided in: docs/adr/0008-catalogue-concept-separation.md,
|
|
33
38
|
* docs/adr/0017-authorized-routes-in-the-envelope.md, issue #972 workstream 6.
|
|
34
39
|
*/
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.authorizedRouteSchema = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = void 0;
|
|
37
|
-
exports.effectiveSameModelDeployment = effectiveSameModelDeployment;
|
|
38
40
|
const zod_1 = require("zod");
|
|
39
41
|
const identifiers_1 = require("./identifiers");
|
|
40
42
|
const providerConnection_1 = require("./providerConnection");
|
|
@@ -121,8 +123,8 @@ exports.routingPolicySchema = zod_1.z
|
|
|
121
123
|
.object({
|
|
122
124
|
/** See `version.ts`: exchanged with the data plane on its own. */
|
|
123
125
|
schemaVersion: zod_1.z.literal(2),
|
|
124
|
-
routingPolicyId: zod_1.z.string().
|
|
125
|
-
policyVersion: zod_1.z.number().
|
|
126
|
+
routingPolicyId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
127
|
+
policyVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
126
128
|
scope: exports.routingPolicyScopeSchema,
|
|
127
129
|
/** Absent when every request must name its own model. */
|
|
128
130
|
defaultTarget: exports.routingTargetSchema.optional(),
|
|
@@ -145,7 +147,7 @@ exports.routingPolicySchema = zod_1.z
|
|
|
145
147
|
/** Serve only from Oxy's own hosting of open-weight models. */
|
|
146
148
|
oxyHostedOnly: zod_1.z.boolean(),
|
|
147
149
|
/** License / usage-right constraints. Empty license list means unconstrained. */
|
|
148
|
-
allowedLicenseIds: zod_1.z.array(zod_1.z.string().
|
|
150
|
+
allowedLicenseIds: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128))).default([]),
|
|
149
151
|
requireCommercialUseRights: zod_1.z.boolean(),
|
|
150
152
|
fallback: exports.routingFallbackPolicySchema,
|
|
151
153
|
/**
|
|
@@ -262,8 +264,8 @@ exports.routingPolicySchema = zod_1.z
|
|
|
262
264
|
*/
|
|
263
265
|
exports.routingPolicyReferenceSchema = zod_1.z
|
|
264
266
|
.object({
|
|
265
|
-
routingPolicyId: zod_1.z.string().
|
|
266
|
-
policyVersion: zod_1.z.number().
|
|
267
|
+
routingPolicyId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
268
|
+
policyVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
267
269
|
})
|
|
268
270
|
.strict();
|
|
269
271
|
/* -------------------------------------------------------------------------- */
|
|
@@ -312,9 +314,9 @@ const authorizedRouteFields = {
|
|
|
312
314
|
customerProviderCredential: zod_1.z
|
|
313
315
|
.object({
|
|
314
316
|
credentialHandle: providerConnection_1.kaanaCredentialHandleSchema,
|
|
315
|
-
credentialRevision: zod_1.z.number().
|
|
317
|
+
credentialRevision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
316
318
|
ownerAccountId: identifiers_1.oxyAccountIdSchema,
|
|
317
|
-
connectionId: zod_1.z.string().
|
|
319
|
+
connectionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
318
320
|
environment: zod_1.z.enum(["development", "staging", "production"]),
|
|
319
321
|
})
|
|
320
322
|
.strict()
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* Normalized stream events — what the data plane emits and the Oxy edge
|
|
4
8
|
* forwards as SSE.
|
|
@@ -21,8 +25,6 @@
|
|
|
21
25
|
*
|
|
22
26
|
* Decided in: docs/adr/0010-public-api-compatibility.md, docs/adr/0008-catalogue-concept-separation.md.
|
|
23
27
|
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = void 0;
|
|
26
28
|
const zod_1 = require("zod");
|
|
27
29
|
const identifiers_1 = require("./identifiers");
|
|
28
30
|
const errors_1 = require("./errors");
|
|
@@ -40,7 +42,7 @@ exports.inferenceStreamStartEventSchema = zod_1.z.object({
|
|
|
40
42
|
schemaVersion: zod_1.z.literal(1),
|
|
41
43
|
type: zod_1.z.literal('start'),
|
|
42
44
|
requestId: identifiers_1.requestIdSchema,
|
|
43
|
-
sequence: zod_1.z.number().
|
|
45
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
44
46
|
generationId: identifiers_1.generationIdSchema.optional(),
|
|
45
47
|
/** Always revision-pinned, even when the request named only the model. */
|
|
46
48
|
resolvedModelReference: identifiers_1.modelReferenceSchema,
|
|
@@ -59,9 +61,9 @@ exports.inferenceStreamDeltaEventSchema = zod_1.z.object({
|
|
|
59
61
|
schemaVersion: zod_1.z.literal(1),
|
|
60
62
|
type: zod_1.z.literal('delta'),
|
|
61
63
|
requestId: identifiers_1.requestIdSchema,
|
|
62
|
-
sequence: zod_1.z.number().
|
|
64
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
63
65
|
/** Which output of a multi-output response this chunk belongs to. */
|
|
64
|
-
outputIndex: zod_1.z.number().
|
|
66
|
+
outputIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
65
67
|
/**
|
|
66
68
|
* `output_audio_transcript` (contract set 3.2.0) carries the words of spoken
|
|
67
69
|
* output requested with `audioOutput`. It is its own channel for the same
|
|
@@ -87,10 +89,14 @@ exports.inferenceStreamAudioEventSchema = zod_1.z.object({
|
|
|
87
89
|
schemaVersion: zod_1.z.literal(1),
|
|
88
90
|
type: zod_1.z.literal('audio'),
|
|
89
91
|
requestId: identifiers_1.requestIdSchema,
|
|
90
|
-
sequence: zod_1.z.number().
|
|
91
|
-
outputIndex: zod_1.z.number().
|
|
92
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
93
|
+
outputIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
92
94
|
mediaType: exports.inferenceAudioMediaTypeSchema,
|
|
93
|
-
data: zod_1.z
|
|
95
|
+
data: zod_1.z
|
|
96
|
+
.string()
|
|
97
|
+
.check((0, stringChecks_1.utf16MinLength)(4))
|
|
98
|
+
.check((0, stringChecks_1.utf16MaxLength)(65536))
|
|
99
|
+
.regex(identifiers_1.PADDED_BASE64_PATTERN),
|
|
94
100
|
});
|
|
95
101
|
/**
|
|
96
102
|
* A tool call being streamed.
|
|
@@ -103,10 +109,10 @@ exports.inferenceStreamToolCallEventSchema = zod_1.z.object({
|
|
|
103
109
|
schemaVersion: zod_1.z.literal(1),
|
|
104
110
|
type: zod_1.z.literal('tool_call'),
|
|
105
111
|
requestId: identifiers_1.requestIdSchema,
|
|
106
|
-
sequence: zod_1.z.number().
|
|
107
|
-
toolCallId: zod_1.z.string().
|
|
112
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
113
|
+
toolCallId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
108
114
|
/** Present on the first event of a call. */
|
|
109
|
-
name: zod_1.z.string().
|
|
115
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
110
116
|
argumentsDelta: zod_1.z.string().optional(),
|
|
111
117
|
complete: zod_1.z.boolean(),
|
|
112
118
|
});
|
|
@@ -150,7 +156,7 @@ exports.inferenceStreamUsageEventSchema = zod_1.z.object({
|
|
|
150
156
|
schemaVersion: zod_1.z.literal(2),
|
|
151
157
|
type: zod_1.z.literal('usage'),
|
|
152
158
|
requestId: identifiers_1.requestIdSchema,
|
|
153
|
-
sequence: zod_1.z.number().
|
|
159
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
154
160
|
/** Exact deployment whose metering produced these partial units. */
|
|
155
161
|
deploymentId: identifiers_1.deploymentIdSchema,
|
|
156
162
|
units: zod_1.z.array(money_1.usageQuantitySchema).min(1),
|
|
@@ -215,7 +221,7 @@ exports.inferenceStreamRouteSwitchEventSchema = zod_1.z.object({
|
|
|
215
221
|
schemaVersion: zod_1.z.literal(1),
|
|
216
222
|
type: zod_1.z.literal('route_switch'),
|
|
217
223
|
requestId: identifiers_1.requestIdSchema,
|
|
218
|
-
sequence: zod_1.z.number().
|
|
224
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
219
225
|
reason: exports.inferenceRouteSwitchReasonSchema,
|
|
220
226
|
detail: exports.inferenceRouteSwitchDetailSchema,
|
|
221
227
|
occurredAt: identifiers_1.inferenceTimestampSchema,
|
|
@@ -229,7 +235,7 @@ exports.inferenceStreamErrorEventSchema = zod_1.z.object({
|
|
|
229
235
|
schemaVersion: zod_1.z.literal(1),
|
|
230
236
|
type: zod_1.z.literal('error'),
|
|
231
237
|
requestId: identifiers_1.requestIdSchema,
|
|
232
|
-
sequence: zod_1.z.number().
|
|
238
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
233
239
|
/** Carries its own `schemaVersion`: the same body is returned non-streaming. */
|
|
234
240
|
error: errors_1.inferenceErrorSchema,
|
|
235
241
|
});
|
|
@@ -262,10 +268,10 @@ exports.inferenceStreamDoneEventSchema = zod_1.z.object({
|
|
|
262
268
|
schemaVersion: zod_1.z.literal(1),
|
|
263
269
|
type: zod_1.z.literal('done'),
|
|
264
270
|
requestId: identifiers_1.requestIdSchema,
|
|
265
|
-
sequence: zod_1.z.number().
|
|
271
|
+
sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
266
272
|
generationId: identifiers_1.generationIdSchema.optional(),
|
|
267
273
|
finishReason: exports.inferenceFinishReasonSchema,
|
|
268
|
-
receiptId: zod_1.z.string().
|
|
274
|
+
receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
269
275
|
completedAt: identifiers_1.inferenceTimestampSchema,
|
|
270
276
|
});
|
|
271
277
|
/**
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* The reserve → settle → refund protocol.
|
|
4
8
|
*
|
|
@@ -29,8 +33,6 @@
|
|
|
29
33
|
*
|
|
30
34
|
* Decided in: docs/adr/0009-usage-reservation-and-settlement.md.
|
|
31
35
|
*/
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = void 0;
|
|
34
36
|
const zod_1 = require("zod");
|
|
35
37
|
const attribution_1 = require("./attribution");
|
|
36
38
|
const identifiers_1 = require("./identifiers");
|
|
@@ -57,12 +59,12 @@ exports.usageReservationRequestSchema = zod_1.z.object({
|
|
|
57
59
|
/** Units already determined by the request itself, e.g. input tokens. */
|
|
58
60
|
knownUnits: zod_1.z.array(money_1.usageQuantitySchema).default([]),
|
|
59
61
|
/** The ceiling on generated output, when the request set one. */
|
|
60
|
-
maxOutputTokens: zod_1.z.number().
|
|
62
|
+
maxOutputTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
61
63
|
/** The price version of the most expensive route the policy permits. */
|
|
62
|
-
ceilingPriceVersionId: zod_1.z.string().
|
|
64
|
+
ceilingPriceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
63
65
|
maxAmount: money_1.exactDecimalSchema,
|
|
64
66
|
currency: money_1.currencyCodeSchema,
|
|
65
|
-
expiresInSeconds: zod_1.z.number().
|
|
67
|
+
expiresInSeconds: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().max(86400),
|
|
66
68
|
});
|
|
67
69
|
/** Lifecycle of a hold. Terminal states are `settled`, `released`, `expired`. */
|
|
68
70
|
exports.usageReservationStatusSchema = zod_1.z.enum(['held', 'settled', 'released', 'expired']);
|
|
@@ -77,17 +79,17 @@ exports.usageReservationSchema = zod_1.z
|
|
|
77
79
|
.object({
|
|
78
80
|
/** See `version.ts`: read back by the edge and the Console on its own. */
|
|
79
81
|
schemaVersion: zod_1.z.literal(1),
|
|
80
|
-
reservationId: zod_1.z.string().
|
|
82
|
+
reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
81
83
|
idempotencyKey: identifiers_1.idempotencyKeySchema,
|
|
82
84
|
attribution: attribution_1.inferenceAttributionSchema,
|
|
83
85
|
status: exports.usageReservationStatusSchema,
|
|
84
86
|
reservedAmount: money_1.exactDecimalSchema,
|
|
85
87
|
currency: money_1.currencyCodeSchema,
|
|
86
|
-
ceilingPriceVersionId: zod_1.z.string().
|
|
88
|
+
ceilingPriceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
87
89
|
createdAt: identifiers_1.inferenceTimestampSchema,
|
|
88
90
|
expiresAt: identifiers_1.inferenceTimestampSchema,
|
|
89
91
|
/** The receipt that consumed this hold. Present exactly when `settled`. */
|
|
90
|
-
settledReceiptId: zod_1.z.string().
|
|
92
|
+
settledReceiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
91
93
|
})
|
|
92
94
|
.superRefine((reservation, ctx) => {
|
|
93
95
|
if (reservation.status === 'settled' && reservation.settledReceiptId === undefined) {
|
|
@@ -172,7 +174,7 @@ exports.normalizedUsageReportSchema = zod_1.z
|
|
|
172
174
|
/** Exact Kaana deployment that attempted the request; never inferred from names. */
|
|
173
175
|
deploymentId: identifiers_1.deploymentIdSchema,
|
|
174
176
|
/** How many allowed route switches occurred while serving this request. */
|
|
175
|
-
routeSwitches: zod_1.z.number().
|
|
177
|
+
routeSwitches: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(100),
|
|
176
178
|
/**
|
|
177
179
|
* The funding tier of the platform key that served the final attempt, as
|
|
178
180
|
* the data plane states it (ADR 0038). Absent when the key's economics
|
|
@@ -183,7 +185,12 @@ exports.normalizedUsageReportSchema = zod_1.z
|
|
|
183
185
|
fundingTier: identifiers_1.inferenceFundingTierSchema.optional(),
|
|
184
186
|
startedAt: identifiers_1.inferenceTimestampSchema,
|
|
185
187
|
completedAt: identifiers_1.inferenceTimestampSchema,
|
|
186
|
-
timeToFirstTokenMs: zod_1.z
|
|
188
|
+
timeToFirstTokenMs: zod_1.z
|
|
189
|
+
.number()
|
|
190
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
191
|
+
.nonnegative()
|
|
192
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
193
|
+
.optional(),
|
|
187
194
|
})
|
|
188
195
|
.superRefine((report, ctx) => {
|
|
189
196
|
// Compared as instants: two spellings of one moment sort differently as text.
|
|
@@ -229,9 +236,9 @@ exports.usageReceiptSchema = zod_1.z
|
|
|
229
236
|
.object({
|
|
230
237
|
/** See `version.ts`: returned to customers by `GET /v1/generations/:id`. */
|
|
231
238
|
schemaVersion: zod_1.z.literal(1),
|
|
232
|
-
receiptId: zod_1.z.string().
|
|
239
|
+
receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
233
240
|
/** The hold this settled against. Absent for a charge with no reservation. */
|
|
234
|
-
reservationId: zod_1.z.string().
|
|
241
|
+
reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
235
242
|
idempotencyKey: identifiers_1.idempotencyKeySchema,
|
|
236
243
|
attribution: attribution_1.inferenceAttributionSchema,
|
|
237
244
|
outcome: exports.inferenceRequestOutcomeSchema,
|
|
@@ -273,8 +280,18 @@ exports.usageReceiptSchema = zod_1.z
|
|
|
273
280
|
* ledger accounts and only the second one is visible on an invoice.
|
|
274
281
|
*/
|
|
275
282
|
exports.usageRefundSubjectSchema = zod_1.z.discriminatedUnion('kind', [
|
|
276
|
-
zod_1.z
|
|
277
|
-
|
|
283
|
+
zod_1.z
|
|
284
|
+
.object({
|
|
285
|
+
kind: zod_1.z.literal('reservation'),
|
|
286
|
+
reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
287
|
+
})
|
|
288
|
+
.strict(),
|
|
289
|
+
zod_1.z
|
|
290
|
+
.object({
|
|
291
|
+
kind: zod_1.z.literal('receipt'),
|
|
292
|
+
receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
293
|
+
})
|
|
294
|
+
.strict(),
|
|
278
295
|
]);
|
|
279
296
|
/** Why money was given back or a hold was released. */
|
|
280
297
|
exports.usageRefundReasonSchema = zod_1.z.enum([
|
|
@@ -303,7 +320,7 @@ exports.usageRefundSchema = zod_1.z
|
|
|
303
320
|
.object({
|
|
304
321
|
/** See `version.ts`: a ledger record read back on its own. */
|
|
305
322
|
schemaVersion: zod_1.z.literal(1),
|
|
306
|
-
refundId: zod_1.z.string().
|
|
323
|
+
refundId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
307
324
|
idempotencyKey: identifiers_1.idempotencyKeySchema,
|
|
308
325
|
attribution: attribution_1.inferenceAttributionSchema,
|
|
309
326
|
subject: exports.usageRefundSubjectSchema,
|
package/dist/cjs/keyRecovery.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.backupStatusResponseSchema = exports.backupUploadRequestSchema = exports.encryptedBackupEnvelopeSchema = exports.backupLookupIdSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("./numberChecks");
|
|
5
|
+
const stringChecks_1 = require("./stringChecks");
|
|
4
6
|
/**
|
|
5
7
|
* Encrypted off-device identity backup contract (b3 Feature 1).
|
|
6
8
|
*
|
|
@@ -57,13 +59,13 @@ exports.backupLookupIdSchema = zod_1.z
|
|
|
57
59
|
* - `createdAt` — ISO-8601 creation timestamp.
|
|
58
60
|
*/
|
|
59
61
|
exports.encryptedBackupEnvelopeSchema = zod_1.z.object({
|
|
60
|
-
version: zod_1.z.number().
|
|
62
|
+
version: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
|
|
61
63
|
algorithm: zod_1.z.literal('xchacha20poly1305'),
|
|
62
|
-
kdfInfo: zod_1.z.string().
|
|
63
|
-
nonce: zod_1.z.string().trim().
|
|
64
|
-
ciphertext: zod_1.z.string().trim().
|
|
65
|
-
publicKeyHint: zod_1.z.string().trim().
|
|
66
|
-
createdAt: zod_1.z.string().trim().
|
|
64
|
+
kdfInfo: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
65
|
+
nonce: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
66
|
+
ciphertext: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
67
|
+
publicKeyHint: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
68
|
+
createdAt: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
67
69
|
});
|
|
68
70
|
/**
|
|
69
71
|
* Request body of `POST /identity/backup` — the envelope PLUS the raw
|
package/dist/cjs/keyRotation.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = void 0;
|
|
4
|
+
const stringChecks_1 = require("./stringChecks");
|
|
4
5
|
/**
|
|
5
6
|
* Key-rotation contract (b3 Feature 3 — key rotation + last-credential replacement).
|
|
6
7
|
*
|
|
@@ -54,11 +55,11 @@ exports.rotateKeyChallengeResponseSchema = zod_1.z.object({
|
|
|
54
55
|
* key Y.
|
|
55
56
|
*/
|
|
56
57
|
exports.rotateKeyCompleteRequestSchema = zod_1.z.object({
|
|
57
|
-
newPublicKey: zod_1.z.string().trim().
|
|
58
|
-
challenge: zod_1.z.string().trim().
|
|
59
|
-
signature: zod_1.z.string().trim().
|
|
58
|
+
newPublicKey: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
59
|
+
challenge: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
60
|
+
signature: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
60
61
|
/** Proof-of-possession: the NEW key signs the rotate_key_new payload. */
|
|
61
|
-
newKeyProof: zod_1.z.string().trim().
|
|
62
|
+
newKeyProof: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
62
63
|
timestamp: zod_1.z.number(),
|
|
63
64
|
/**
|
|
64
65
|
* When true, all OTHER active sessions for the account are revoked after a
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linkedAccountStartErrorDetailsSchema = exports.linkedAccountStartErrorReasonSchema = exports.LINKED_ACCOUNT_START_ERROR_REASONS = exports.LINKED_ACCOUNT_CALLBACK_ERRORS = exports.serviceLinkedAccountListResponseSchema = exports.serviceLinkedAccountSchema = exports.linkedAccountListResponseSchema = exports.completeLinkedAccountResponseSchema = exports.linkedAccountSchema = exports.completeLinkedAccountRequestSchema = exports.startLinkedAccountResponseSchema = exports.startLinkedAccountRequestSchema = exports.linkedAccountNetworkSchema = exports.LINKED_ACCOUNT_NETWORKS = void 0;
|
|
4
|
+
const stringChecks_1 = require("./stringChecks");
|
|
2
5
|
/**
|
|
3
6
|
* Wire contract for Oxy linked accounts — external accounts (any Mastodon-API
|
|
4
7
|
* server, Bluesky) a LOCAL Oxy user has proven they own by completing an OAuth
|
|
@@ -10,8 +13,6 @@
|
|
|
10
13
|
*
|
|
11
14
|
* Platform-agnostic — zod only, no react/react-native/expo.
|
|
12
15
|
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.linkedAccountStartErrorDetailsSchema = exports.linkedAccountStartErrorReasonSchema = exports.LINKED_ACCOUNT_START_ERROR_REASONS = exports.LINKED_ACCOUNT_CALLBACK_ERRORS = exports.serviceLinkedAccountListResponseSchema = exports.serviceLinkedAccountSchema = exports.linkedAccountListResponseSchema = exports.completeLinkedAccountResponseSchema = exports.linkedAccountSchema = exports.completeLinkedAccountRequestSchema = exports.startLinkedAccountResponseSchema = exports.startLinkedAccountRequestSchema = exports.linkedAccountNetworkSchema = exports.LINKED_ACCOUNT_NETWORKS = void 0;
|
|
15
16
|
const zod_1 = require("zod");
|
|
16
17
|
exports.LINKED_ACCOUNT_NETWORKS = ['activitypub', 'atproto'];
|
|
17
18
|
exports.linkedAccountNetworkSchema = zod_1.z.enum(exports.LINKED_ACCOUNT_NETWORKS);
|
|
@@ -27,16 +28,16 @@ exports.linkedAccountNetworkSchema = zod_1.z.enum(exports.LINKED_ACCOUNT_NETWORK
|
|
|
27
28
|
*/
|
|
28
29
|
exports.startLinkedAccountRequestSchema = zod_1.z
|
|
29
30
|
.object({
|
|
30
|
-
instance: zod_1.z.string().trim().
|
|
31
|
-
handle: zod_1.z.string().trim().
|
|
32
|
-
clientId: zod_1.z.string().trim().
|
|
33
|
-
returnTo: zod_1.z.string().trim().
|
|
31
|
+
instance: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(320)).optional(),
|
|
32
|
+
handle: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(320)).optional(),
|
|
33
|
+
clientId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
|
|
34
|
+
returnTo: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)),
|
|
34
35
|
})
|
|
35
36
|
.strict();
|
|
36
37
|
exports.startLinkedAccountResponseSchema = zod_1.z
|
|
37
38
|
.object({
|
|
38
|
-
authorizeUrl: zod_1.z.string().
|
|
39
|
-
expiresAt: zod_1.z.string().
|
|
39
|
+
authorizeUrl: zod_1.z.string().check((0, stringChecks_1.urlCheck)()),
|
|
40
|
+
expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
40
41
|
})
|
|
41
42
|
.strict();
|
|
42
43
|
/**
|
|
@@ -46,22 +47,22 @@ exports.startLinkedAccountResponseSchema = zod_1.z
|
|
|
46
47
|
* other user it is refused (403) and burned.
|
|
47
48
|
*/
|
|
48
49
|
exports.completeLinkedAccountRequestSchema = zod_1.z
|
|
49
|
-
.object({ code: zod_1.z.string().trim().
|
|
50
|
+
.object({ code: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)) })
|
|
50
51
|
.strict();
|
|
51
52
|
/** One live linked account, as its owner sees it. */
|
|
52
53
|
exports.linkedAccountSchema = zod_1.z
|
|
53
54
|
.object({
|
|
54
|
-
id: zod_1.z.string().
|
|
55
|
+
id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
55
56
|
network: exports.linkedAccountNetworkSchema,
|
|
56
57
|
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
57
|
-
accountKey: zod_1.z.string().
|
|
58
|
+
accountKey: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
58
59
|
/** ActivityPub actor id, or the DID for atproto. */
|
|
59
|
-
actorUri: zod_1.z.string().
|
|
60
|
-
handle: zod_1.z.string().
|
|
61
|
-
host: zod_1.z.string().
|
|
60
|
+
actorUri: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
61
|
+
handle: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
62
|
+
host: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
62
63
|
proofMethod: zod_1.z.literal('oauth'),
|
|
63
|
-
verifiedAt: zod_1.z.string().
|
|
64
|
-
createdAt: zod_1.z.string().
|
|
64
|
+
verifiedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
65
|
+
createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
65
66
|
})
|
|
66
67
|
.strict();
|
|
67
68
|
exports.completeLinkedAccountResponseSchema = zod_1.z
|
|
@@ -77,10 +78,13 @@ exports.linkedAccountListResponseSchema = zod_1.z
|
|
|
77
78
|
* content Oxy federated in before the account was linked.
|
|
78
79
|
*/
|
|
79
80
|
exports.serviceLinkedAccountSchema = exports.linkedAccountSchema
|
|
80
|
-
.extend({ federatedUserId: zod_1.z.string().
|
|
81
|
+
.extend({ federatedUserId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).nullable() })
|
|
81
82
|
.strict();
|
|
82
83
|
exports.serviceLinkedAccountListResponseSchema = zod_1.z
|
|
83
|
-
.object({
|
|
84
|
+
.object({
|
|
85
|
+
userId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
86
|
+
linkedAccounts: zod_1.z.array(exports.serviceLinkedAccountSchema),
|
|
87
|
+
})
|
|
84
88
|
.strict();
|
|
85
89
|
/**
|
|
86
90
|
* Error codes the callback appends as `?link_error=<code>` to `returnTo`. An
|