@oxy.so/contracts 5.8.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/accountAccess.js +6 -5
- package/dist/cjs/accountEmail.js +13 -5
- package/dist/cjs/accountGraph.js +10 -9
- package/dist/cjs/accountName.js +3 -2
- package/dist/cjs/agency.js +91 -34
- package/dist/cjs/agentKeys.js +21 -17
- package/dist/cjs/appAssertions.js +14 -13
- package/dist/cjs/applicationRoles.js +19 -12
- package/dist/cjs/campaignAttribution.js +28 -0
- package/dist/cjs/civic.js +10 -9
- package/dist/cjs/client/campaignAttribution.js +14 -0
- package/dist/cjs/client/check.js +61 -53
- package/dist/cjs/client/index.js +7 -1
- package/dist/cjs/client/language.js +7 -0
- package/dist/cjs/consoleOnboarding.js +9 -4
- package/dist/cjs/contentClaims.js +23 -14
- package/dist/cjs/deviceDirectory.js +11 -9
- package/dist/cjs/deviceSession.js +27 -25
- package/dist/cjs/email/messages.js +20 -18
- package/dist/cjs/emailAgentContext.js +11 -9
- package/dist/cjs/externalIdentity.js +15 -11
- package/dist/cjs/federationInstanceFetch.js +12 -7
- package/dist/cjs/identity.js +19 -17
- package/dist/cjs/identityLink.js +6 -4
- package/dist/cjs/identityProof.js +6 -4
- package/dist/cjs/inboxPush.js +5 -4
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/inference/accountBilling.js +35 -33
- package/dist/cjs/inference/aliaModelRelease.js +9 -7
- package/dist/cjs/inference/attribution.js +14 -12
- package/dist/cjs/inference/catalogue.js +35 -29
- package/dist/cjs/inference/economics.js +24 -19
- package/dist/cjs/inference/embeddings.js +9 -7
- package/dist/cjs/inference/entitlement.js +17 -15
- package/dist/cjs/inference/errors.js +15 -8
- package/dist/cjs/inference/identifiers.js +33 -21
- package/dist/cjs/inference/inbox.js +37 -35
- package/dist/cjs/inference/modelDocumentation.js +16 -14
- package/dist/cjs/inference/money.js +5 -4
- package/dist/cjs/inference/priceVersion.js +10 -5
- package/dist/cjs/inference/providerConnection.js +21 -14
- package/dist/cjs/inference/realtime.js +88 -47
- package/dist/cjs/inference/request.js +27 -25
- package/dist/cjs/inference/routingPolicy.js +12 -10
- package/dist/cjs/inference/streamEvents.js +22 -16
- package/dist/cjs/inference/usage.js +32 -15
- package/dist/cjs/keyRecovery.js +8 -6
- package/dist/cjs/keyRotation.js +5 -4
- package/dist/cjs/linkedAccounts.js +22 -18
- package/dist/cjs/moderationReputation.js +29 -27
- package/dist/cjs/notifications.js +25 -9
- package/dist/cjs/numberChecks.js +45 -0
- package/dist/cjs/oauth.js +14 -12
- package/dist/cjs/organizations.js +23 -21
- package/dist/cjs/products/access.js +10 -8
- package/dist/cjs/products/billing.js +10 -8
- package/dist/cjs/products/checkout.js +22 -10
- package/dist/cjs/products/plans.js +15 -10
- package/dist/cjs/protocol.js +6 -5
- package/dist/cjs/recommendations.js +27 -19
- package/dist/cjs/reputation.js +15 -13
- package/dist/cjs/safety.js +43 -27
- package/dist/cjs/serviceToken.js +81 -2
- package/dist/cjs/sessionRevocation.js +8 -6
- package/dist/cjs/signIn.js +50 -24
- package/dist/cjs/stickers.js +19 -15
- package/dist/cjs/stringChecks.js +70 -0
- package/dist/cjs/transparency.js +14 -12
- package/dist/cjs/updates.js +24 -22
- package/dist/cjs/userInvalidation.js +7 -5
- package/dist/cjs/userResponse.js +8 -7
- package/dist/cjs/username.js +7 -6
- package/dist/esm/accountAccess.js +4 -3
- package/dist/esm/accountEmail.js +13 -5
- package/dist/esm/accountGraph.js +8 -7
- package/dist/esm/accountName.js +3 -2
- package/dist/esm/agency.js +90 -33
- package/dist/esm/agentKeys.js +21 -17
- package/dist/esm/appAssertions.js +11 -10
- package/dist/esm/applicationRoles.js +16 -9
- package/dist/esm/campaignAttribution.js +25 -0
- package/dist/esm/civic.js +8 -7
- package/dist/esm/client/campaignAttribution.js +10 -0
- package/dist/esm/client/check.js +61 -53
- package/dist/esm/client/index.js +2 -0
- package/dist/esm/client/language.js +4 -0
- package/dist/esm/consoleOnboarding.js +7 -2
- package/dist/esm/contentClaims.js +23 -14
- package/dist/esm/deviceDirectory.js +11 -9
- package/dist/esm/deviceSession.js +27 -25
- package/dist/esm/email/messages.js +18 -16
- package/dist/esm/emailAgentContext.js +11 -9
- package/dist/esm/externalIdentity.js +15 -11
- package/dist/esm/federationInstanceFetch.js +10 -5
- package/dist/esm/identity.js +17 -15
- package/dist/esm/identityLink.js +6 -4
- package/dist/esm/identityProof.js +6 -4
- package/dist/esm/inboxPush.js +3 -2
- package/dist/esm/index.js +5 -2
- package/dist/esm/inference/accountBilling.js +33 -31
- package/dist/esm/inference/aliaModelRelease.js +7 -5
- package/dist/esm/inference/attribution.js +14 -12
- package/dist/esm/inference/catalogue.js +33 -27
- package/dist/esm/inference/economics.js +22 -17
- package/dist/esm/inference/embeddings.js +9 -7
- package/dist/esm/inference/entitlement.js +15 -13
- package/dist/esm/inference/errors.js +13 -6
- package/dist/esm/inference/identifiers.js +31 -19
- package/dist/esm/inference/inbox.js +37 -35
- package/dist/esm/inference/modelDocumentation.js +14 -12
- package/dist/esm/inference/money.js +3 -2
- package/dist/esm/inference/priceVersion.js +8 -3
- package/dist/esm/inference/providerConnection.js +19 -12
- package/dist/esm/inference/realtime.js +85 -44
- package/dist/esm/inference/request.js +25 -23
- package/dist/esm/inference/routingPolicy.js +9 -7
- package/dist/esm/inference/streamEvents.js +20 -14
- package/dist/esm/inference/usage.js +30 -13
- package/dist/esm/keyRecovery.js +8 -6
- package/dist/esm/keyRotation.js +5 -4
- package/dist/esm/linkedAccounts.js +20 -16
- package/dist/esm/moderationReputation.js +27 -25
- package/dist/esm/notifications.js +23 -7
- package/dist/esm/numberChecks.js +41 -0
- package/dist/esm/oauth.js +14 -12
- package/dist/esm/organizations.js +23 -21
- package/dist/esm/products/access.js +10 -8
- package/dist/esm/products/billing.js +10 -8
- package/dist/esm/products/checkout.js +22 -10
- package/dist/esm/products/plans.js +15 -10
- package/dist/esm/protocol.js +4 -3
- package/dist/esm/recommendations.js +25 -17
- package/dist/esm/reputation.js +13 -11
- package/dist/esm/safety.js +43 -27
- package/dist/esm/serviceToken.js +80 -1
- package/dist/esm/sessionRevocation.js +6 -4
- package/dist/esm/signIn.js +50 -24
- package/dist/esm/stickers.js +17 -13
- package/dist/esm/stringChecks.js +63 -0
- package/dist/esm/transparency.js +14 -12
- package/dist/esm/updates.js +22 -20
- package/dist/esm/userInvalidation.js +4 -2
- package/dist/esm/userResponse.js +4 -3
- package/dist/esm/username.js +3 -2
- package/dist/types/accountAccess.d.ts +29 -70
- package/dist/types/accountEmail.d.ts +2 -14
- package/dist/types/accountGraph.d.ts +179 -171
- package/dist/types/accountName.d.ts +1 -1
- package/dist/types/accountSubject.d.ts +20 -93
- package/dist/types/agency.d.ts +528 -2924
- package/dist/types/agentKeys.d.ts +48 -421
- package/dist/types/appAssertions.d.ts +56 -210
- package/dist/types/applicationRoles.d.ts +30 -276
- package/dist/types/avatarCharacter.d.ts +1 -1
- package/dist/types/campaignAttribution.d.ts +10 -0
- package/dist/types/civic.d.ts +1 -13
- package/dist/types/client/agentKeys.d.ts +18 -18
- package/dist/types/client/appAssertions.d.ts +3 -3
- package/dist/types/client/campaignAttribution.d.ts +12 -0
- package/dist/types/client/check.d.ts +13 -13
- package/dist/types/client/deviceDirectory.d.ts +51 -51
- package/dist/types/client/deviceSession.d.ts +14 -14
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/client/language.d.ts +2 -0
- package/dist/types/client/organizations.d.ts +25 -25
- package/dist/types/client/products.d.ts +33 -33
- package/dist/types/client/recommendations.d.ts +2 -2
- package/dist/types/client/safety.d.ts +45 -45
- package/dist/types/client/sessionStatus.d.ts +4 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +4 -1
- package/dist/types/consoleOnboarding.d.ts +24 -44
- package/dist/types/contentClaims.d.ts +24 -180
- package/dist/types/deviceDirectory.d.ts +109 -1040
- package/dist/types/deviceSession.d.ts +36 -298
- package/dist/types/email/messages.d.ts +212 -1793
- package/dist/types/emailAgentContext.d.ts +10 -194
- package/dist/types/externalIdentity.d.ts +121 -615
- package/dist/types/federationInstanceFetch.d.ts +3 -32
- package/dist/types/identity.d.ts +15 -92
- package/dist/types/identityLink.d.ts +6 -84
- package/dist/types/identityProof.d.ts +5 -17
- package/dist/types/inboxPush.d.ts +1 -9
- package/dist/types/index.d.ts +7 -3
- package/dist/types/inference/accountBilling.d.ts +151 -488
- package/dist/types/inference/aliaModelRelease.d.ts +42 -439
- package/dist/types/inference/attribution.d.ts +75 -104
- package/dist/types/inference/catalogue.d.ts +417 -1599
- package/dist/types/inference/economics.d.ts +69 -276
- package/dist/types/inference/embeddings.d.ts +110 -406
- package/dist/types/inference/entitlement.d.ts +80 -335
- package/dist/types/inference/errors.d.ts +90 -102
- package/dist/types/inference/identifiers.d.ts +12 -4
- package/dist/types/inference/inbox.d.ts +105 -420
- package/dist/types/inference/modelDocumentation.d.ts +201 -1390
- package/dist/types/inference/money.d.ts +65 -32
- package/dist/types/inference/priceVersion.d.ts +53 -120
- package/dist/types/inference/providerConnection.d.ts +253 -710
- package/dist/types/inference/realtime.d.ts +954 -6825
- package/dist/types/inference/request.d.ts +300 -2572
- package/dist/types/inference/routingPolicy.d.ts +95 -503
- package/dist/types/inference/streamEvents.d.ts +253 -721
- package/dist/types/inference/usage.d.ts +317 -950
- package/dist/types/keyRecovery.d.ts +3 -51
- package/dist/types/keyRotation.d.ts +3 -38
- package/dist/types/linkedAccounts.d.ts +50 -236
- package/dist/types/moderationReputation.d.ts +81 -14
- package/dist/types/notifications.d.ts +19 -51
- package/dist/types/numberChecks.d.ts +9 -0
- package/dist/types/oauth.d.ts +101 -809
- package/dist/types/organizations.d.ts +268 -921
- package/dist/types/oxyRecordTypes.d.ts +11 -1
- package/dist/types/products/access.d.ts +125 -775
- package/dist/types/products/billing.d.ts +67 -503
- package/dist/types/products/checkout.d.ts +16 -69
- package/dist/types/products/plans.d.ts +33 -366
- package/dist/types/recommendations.d.ts +76 -389
- package/dist/types/reputation.d.ts +37 -5
- package/dist/types/safety.d.ts +408 -2048
- package/dist/types/serviceToken.d.ts +247 -7
- package/dist/types/sessionRevocation.d.ts +2 -17
- package/dist/types/sessionStatus.d.ts +27 -115
- package/dist/types/signIn.d.ts +62 -553
- package/dist/types/stickers.d.ts +67 -819
- package/dist/types/stringChecks.d.ts +16 -0
- package/dist/types/transparency.d.ts +14 -302
- package/dist/types/updates.d.ts +60 -316
- package/dist/types/userInvalidation.d.ts +4 -13
- package/dist/types/userResponse.d.ts +302 -2400
- package/dist/types/username.d.ts +3 -3
- package/package.json +6 -4
|
@@ -1,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
|
});
|
|
@@ -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()
|