@oxy.so/contracts 4.25.0 → 5.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.
Files changed (40) hide show
  1. package/dist/cjs/client/accountEmail.js +3 -1
  2. package/dist/cjs/client/signIn.js +7 -0
  3. package/dist/cjs/identityLink.js +3 -5
  4. package/dist/cjs/index.js +11 -43
  5. package/dist/cjs/inference/catalogue.js +2 -5
  6. package/dist/cjs/inference/request.js +5 -79
  7. package/dist/cjs/inference/version.js +1 -1
  8. package/dist/cjs/signIn.js +22 -13
  9. package/dist/esm/client/accountEmail.js +3 -1
  10. package/dist/esm/client/signIn.js +7 -0
  11. package/dist/esm/identityLink.js +4 -6
  12. package/dist/esm/index.js +1 -6
  13. package/dist/esm/inference/catalogue.js +0 -3
  14. package/dist/esm/inference/request.js +4 -78
  15. package/dist/esm/inference/version.js +1 -1
  16. package/dist/esm/signIn.js +21 -12
  17. package/dist/types/client/accountEmail.d.ts +3 -1
  18. package/dist/types/client/signIn.d.ts +7 -1
  19. package/dist/types/identityLink.d.ts +32 -13
  20. package/dist/types/index.d.ts +2 -12
  21. package/dist/types/inference/catalogue.d.ts +4 -194
  22. package/dist/types/inference/economics.d.ts +2 -2
  23. package/dist/types/inference/realtime.d.ts +88 -88
  24. package/dist/types/inference/request.d.ts +28 -5055
  25. package/dist/types/inference/routingPolicy.d.ts +16 -16
  26. package/dist/types/inference/streamEvents.d.ts +8 -8
  27. package/dist/types/inference/usage.d.ts +4 -4
  28. package/dist/types/inference/version.d.ts +1 -1
  29. package/dist/types/safety.d.ts +10 -10
  30. package/dist/types/signIn.d.ts +159 -30
  31. package/package.json +1 -1
  32. package/dist/cjs/inference/decisions.js +0 -305
  33. package/dist/cjs/inference/privateAutoExecution.js +0 -153
  34. package/dist/cjs/inference/scopedExecution.js +0 -87
  35. package/dist/esm/inference/decisions.js +0 -299
  36. package/dist/esm/inference/privateAutoExecution.js +0 -149
  37. package/dist/esm/inference/scopedExecution.js +0 -83
  38. package/dist/types/inference/decisions.d.ts +0 -1853
  39. package/dist/types/inference/privateAutoExecution.d.ts +0 -694
  40. package/dist/types/inference/scopedExecution.d.ts +0 -202
@@ -23,10 +23,7 @@
23
23
  * Decided in: docs/adr/0010-public-api-compatibility.md,
24
24
  * docs/adr/0017-authorized-routes-in-the-envelope.md.
25
25
  */
26
- import { decisionInputSchema } from './decisions.js';
27
26
  import { z } from "zod";
28
- import { scopedExecutionSchema, SCOPED_REQUEST_ENVELOPE_VERSION } from "./scopedExecution.js";
29
- import { privateAutoExecutionSchema, privateAutoInputSchema, PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION } from "./privateAutoExecution.js";
30
27
  import { inferenceAttributionSchema } from "./attribution.js";
31
28
  import { inferenceApiFormatSchema, inferenceModalitySchema, reasoningEffortSchema, } from "./catalogue.js";
32
29
  import { idempotencyKeySchema, inferenceTimestampSchema } from "./identifiers.js";
@@ -198,7 +195,6 @@ export const inferenceMessageSchema = z
198
195
  * that both metering and provider translation depend on.
199
196
  */
200
197
  export const inferenceInputSchema = z.discriminatedUnion("format", [
201
- z.object({ format: z.literal("decisions"), decisions: decisionInputSchema }).strict(),
202
198
  z
203
199
  .object({
204
200
  format: z.literal("messages"),
@@ -353,8 +349,6 @@ export const inferenceRequestSchema = z
353
349
  .object({
354
350
  /** See `version.ts`: this is the Oxy→data-plane request envelope. */
355
351
  schemaVersion: z.literal(2),
356
- /** Recognized so v2 refuses rather than silently stripping a restriction. */
357
- scopedExecution: scopedExecutionSchema.optional(),
358
352
  attribution: inferenceAttributionSchema,
359
353
  target: routingTargetSchema,
360
354
  modality: inferenceModalitySchema,
@@ -409,18 +403,10 @@ export const inferenceRequestSchema = z
409
403
  authorizedRoutes: z.array(authorizedRouteSchema).min(1).optional(),
410
404
  })
411
405
  .superRefine((request, ctx) => {
412
- if (request.scopedExecution !== undefined)
413
- ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["scopedExecution"], message: "Scoped execution requires envelope v3." });
414
- if (request.input.format === "decisions" || request.client.apiFormat === "decisions") {
415
- const exactModel = request.target.kind === "model" && request.target.modelReference.includes('@');
416
- const foreignRoute = request.authorizedRoutes?.some((route) => request.target.kind !== "model" || route.modelReference !== request.target.modelReference || route.substitution !== "same_model");
417
- if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
418
- request.modality !== "text" || request.stream || !exactModel || foreignRoute ||
419
- request.maxOutputTokens !== undefined || Object.keys(request.sampling).length > 0 ||
420
- request.tools.length > 0 || request.toolChoice !== undefined || request.responseFormat !== undefined ||
421
- request.reasoning !== undefined || request.speech !== undefined || request.audioOutput !== undefined) {
422
- ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["input"], message: "Decisions require exact-model typed nonstreaming input without generation controls or model substitution." });
423
- }
406
+ // Decisions are a grant operation of `kaana.ai/v1` (Kaana ADR 0002) and
407
+ // never ride this envelope.
408
+ if (request.client.apiFormat === "decisions") {
409
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["client", "apiFormat"], message: "Decisions are served by https://kaana.ai/v1/decisions, never on this envelope." });
424
410
  }
425
411
  const isSpeech = request.client.apiFormat === "audio_speech";
426
412
  if (isSpeech && request.speech !== undefined && (request.modality !== "audio" || request.input.format !== "text" || request.stream)) {
@@ -540,63 +526,3 @@ export const inferenceRequestSchema = z
540
526
  });
541
527
  }
542
528
  });
543
- /** Explicit restrictive generation: old v2 receivers reject this version whole. */
544
- export const scopedInferenceRequestSchema = inferenceRequestSchema.innerType()
545
- .extend({ schemaVersion: z.literal(SCOPED_REQUEST_ENVELOPE_VERSION), scopedExecution: scopedExecutionSchema })
546
- .superRefine((request, ctx) => {
547
- const { scopedExecution: scope, ...base } = request;
548
- const legacy = inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
549
- if (!legacy.success)
550
- for (const issue of legacy.error.issues)
551
- ctx.addIssue(issue);
552
- const principal = request.attribution.principal;
553
- const route = request.authorizedRoutes?.[0];
554
- if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
555
- scope.requestId !== request.attribution.requestId ||
556
- scope.idempotencyKey !== request.idempotencyKey ||
557
- scope.principal.accountId !== principal.billing.accountId ||
558
- scope.principal.applicationId !== principal.applicationId ||
559
- scope.principal.credentialId !== principal.credentialId ||
560
- scope.principal.environment !== principal.environment ||
561
- scope.policy.routingPolicyId !== request.routingPolicy.routingPolicyId ||
562
- scope.policy.policyVersion !== request.routingPolicy.policyVersion ||
563
- request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
564
- route?.deploymentId !== scope.deploymentId || route?.provider !== scope.provider ||
565
- route?.modelReference !== scope.modelReference ||
566
- request.target.kind !== "model" || request.target.modelReference !== scope.modelReference) {
567
- ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["scopedExecution"], message: "Scoped execution must restrict the exact attributed decisions request and one platform route." });
568
- }
569
- });
570
- /** Private repeated Auto is independently negotiated, never a v3 fixture renewal. */
571
- export const privateAutoInferenceRequestSchema = inferenceRequestSchema.innerType()
572
- .omit({ scopedExecution: true })
573
- .extend({ schemaVersion: z.literal(PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION), privateAutoExecution: privateAutoExecutionSchema })
574
- .strict()
575
- .superRefine((request, ctx) => {
576
- const { privateAutoExecution: permit, ...base } = request;
577
- const legacy = inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
578
- if (!legacy.success)
579
- for (const issue of legacy.error.issues)
580
- ctx.addIssue(issue);
581
- const input = privateAutoInputSchema.safeParse(request.input);
582
- if (!input.success)
583
- for (const issue of input.error.issues)
584
- ctx.addIssue({ ...issue, path: ['input', ...issue.path] });
585
- const principal = request.attribution.principal;
586
- const route = request.authorizedRoutes?.[0];
587
- if (request.attribution.userId !== undefined || request.client.apiFormat !== 'decisions' || permit.requestId !== request.attribution.requestId ||
588
- permit.operationId !== request.idempotencyKey ||
589
- permit.principal.accountId !== principal.billing.accountId ||
590
- permit.principal.applicationId !== principal.applicationId ||
591
- permit.principal.credentialId !== principal.credentialId || permit.principal.environment !== principal.environment ||
592
- !principal.inferenceScopes.includes('inference:invoke') || request.client.endpoint !== '/internal/auto-classification' ||
593
- permit.policy.routingPolicyId !== request.routingPolicy.routingPolicyId || permit.policy.policyVersion !== request.routingPolicy.policyVersion ||
594
- request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
595
- route?.deploymentId !== permit.deploymentId || route?.provider !== permit.provider || route?.modelReference !== permit.modelReference ||
596
- request.target.kind !== 'model' || request.target.modelReference !== permit.modelReference ||
597
- route.regions.length !== permit.regions.length || route.regions.some((region) => !permit.regions.includes(region)) ||
598
- Date.parse(permit.runtimeExpiresAt) <= Date.parse(request.client.receivedAt) ||
599
- Date.parse(permit.runtimeExpiresAt) > Date.parse(request.client.receivedAt) + 1000) {
600
- ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['privateAutoExecution'], message: 'Private Auto must bind one exact attributed decisions child and platform route.' });
601
- }
602
- });
@@ -99,4 +99,4 @@
99
99
  * change to, say, the catalogue reject every in-flight inference request; the
100
100
  * per-shape `schemaVersion` is what a message is validated against.
101
101
  */
102
- export const INFERENCE_CONTRACT_VERSION = '3.9.0';
102
+ export const INFERENCE_CONTRACT_VERSION = '4.0.0';
@@ -208,18 +208,6 @@ export const reauthProofSchema = z
208
208
  .refine((proof) => proof.password !== undefined || proof.emailCode !== undefined, {
209
209
  message: 'password or emailCode is required',
210
210
  });
211
- /** A proof by email code only (+ TOTP): deleting an account, linking Commons. */
212
- export const emailReauthProofSchema = z
213
- .object({
214
- emailCode: z
215
- .object({
216
- verificationId: z.string().trim().min(1).max(64),
217
- code: sixDigits,
218
- })
219
- .strict(),
220
- totpCode: secondFactorCodeSchema.optional(),
221
- })
222
- .strict();
223
211
  /** `PUT /users/me/password` — set or change the password. */
224
212
  export const passwordSetRequestSchema = z
225
213
  .object({
@@ -229,6 +217,27 @@ export const passwordSetRequestSchema = z
229
217
  revokeOtherSessions: z.boolean().optional(),
230
218
  })
231
219
  .strict();
220
+ /**
221
+ * `DELETE /users/me/password` — only while the account has an email to sign
222
+ * in with; `DELETE /users/me/email` — only while it has a password, and
223
+ * confirmed with that password.
224
+ */
225
+ export const signInMethodRemoveRequestSchema = z.object({ reauth: reauthProofSchema }).strict();
226
+ /** `POST /users/me/email/verify/start` — a code to the address the account moves to. */
227
+ export const emailChangeStartRequestSchema = z.object({ email: emailAddressSchema }).strict();
228
+ /**
229
+ * `PUT /users/me/email` — add or change the email: the NEW address and the
230
+ * code it got (`verificationId`, `code`), and the proof it is the person (the
231
+ * password, or a code to the current email; plus the authenticator's).
232
+ */
233
+ export const emailSetRequestSchema = z
234
+ .object({
235
+ email: emailAddressSchema,
236
+ verificationId: z.string().trim().min(1).max(64),
237
+ code: sixDigits,
238
+ reauth: reauthProofSchema,
239
+ })
240
+ .strict();
232
241
  export const signInMethodsSchema = z.object({
233
242
  hasEmail: z.boolean(),
234
243
  hasPassword: z.boolean(),
@@ -10,8 +10,10 @@ import type { EmailVerificationConfirmResponse, EmailVerificationStartResponse }
10
10
  * - `reauth`: a signed-in person proving it is them before a sensitive step
11
11
  * (`POST /users/me/reauth/email`): a password, an authenticator, deleting the
12
12
  * account, linking Commons.
13
+ * - `email_change`: a signed-in account proving the NEW address it moves to
14
+ * (`POST /users/me/email/verify/start`); bound to the account and that address.
13
15
  */
14
- export declare const EMAIL_VERIFICATION_PURPOSES: readonly ["signup", "signin", "reauth"];
16
+ export declare const EMAIL_VERIFICATION_PURPOSES: readonly ["signup", "signin", "reauth", "email_change"];
15
17
  export type EmailVerificationPurpose = (typeof EMAIL_VERIFICATION_PURPOSES)[number];
16
18
  /** Digits in a code. */
17
19
  export declare const EMAIL_CODE_LENGTH = 6;
@@ -50,7 +50,7 @@ export declare function isEmailSignInChooseAccount(result: EmailSignInStepResult
50
50
  * What a re-verification email code confirms. The code is bound to it: a code
51
51
  * asked for one change never authorises another, and the email names it.
52
52
  */
53
- export declare const REAUTH_ACTIONS: readonly ["change_password", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"];
53
+ export declare const REAUTH_ACTIONS: readonly ["change_password", "change_email", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"];
54
54
  export type ReauthAction = (typeof REAUTH_ACTIONS)[number];
55
55
  /**
56
56
  * Stable error codes (`error.code` in the API error body). Clients map these
@@ -87,6 +87,12 @@ export declare const SIGN_IN_ERROR_CODES: {
87
87
  readonly usernameTaken: "USERNAME_TAKEN";
88
88
  /** The email already holds `EMAIL_ACCOUNTS_MAX` accounts: no sign-up adds another. */
89
89
  readonly emailAccountsFull: "EMAIL_ACCOUNTS_FULL";
90
+ /** Removing the one way in left (the email when there is no password, or the reverse). */
91
+ readonly lastSignInMethod: "LAST_SIGN_IN_METHOD";
92
+ /** Removing the email needs a password set, and is confirmed with it. */
93
+ readonly passwordRequired: "PASSWORD_REQUIRED";
94
+ /** The new email is the one the account already has. */
95
+ readonly emailUnchanged: "EMAIL_UNCHANGED";
90
96
  };
91
97
  export type SignInErrorCode = (typeof SIGN_IN_ERROR_CODES)[keyof typeof SIGN_IN_ERROR_CODES];
92
98
  export declare const emailSignInStartResponseCheck: import("./check").Check<EmailSignInStartResponse>;
@@ -89,12 +89,13 @@ export declare const identityLinkProofRequestSchema: z.ZodObject<{
89
89
  export type IdentityLinkProofRequest = z.infer<typeof identityLinkProofRequestSchema>;
90
90
  /**
91
91
  * `POST /identity/link/:linkId/complete` — the account's own confirmation: a
92
- * code just sent to its email for this link (`reauth`, plus its authenticator
93
- * code when it has one).
92
+ * code just sent to its email for this link, or its password when it has no
93
+ * email (`reauth`, plus its authenticator code when it has one).
94
94
  */
95
95
  export declare const identityLinkCompleteRequestSchema: z.ZodObject<{
96
- reauth: z.ZodObject<{
97
- emailCode: z.ZodObject<{
96
+ reauth: z.ZodEffects<z.ZodObject<{
97
+ password: z.ZodOptional<z.ZodString>;
98
+ emailCode: z.ZodOptional<z.ZodObject<{
98
99
  verificationId: z.ZodString;
99
100
  code: z.ZodString;
100
101
  }, "strict", z.ZodTypeAny, {
@@ -103,35 +104,53 @@ export declare const identityLinkCompleteRequestSchema: z.ZodObject<{
103
104
  }, {
104
105
  code: string;
105
106
  verificationId: string;
106
- }>;
107
+ }>>;
107
108
  totpCode: z.ZodOptional<z.ZodString>;
108
109
  }, "strict", z.ZodTypeAny, {
109
- emailCode: {
110
+ password?: string | undefined;
111
+ emailCode?: {
110
112
  code: string;
111
113
  verificationId: string;
112
- };
114
+ } | undefined;
113
115
  totpCode?: string | undefined;
114
116
  }, {
115
- emailCode: {
117
+ password?: string | undefined;
118
+ emailCode?: {
116
119
  code: string;
117
120
  verificationId: string;
118
- };
121
+ } | undefined;
122
+ totpCode?: string | undefined;
123
+ }>, {
124
+ password?: string | undefined;
125
+ emailCode?: {
126
+ code: string;
127
+ verificationId: string;
128
+ } | undefined;
129
+ totpCode?: string | undefined;
130
+ }, {
131
+ password?: string | undefined;
132
+ emailCode?: {
133
+ code: string;
134
+ verificationId: string;
135
+ } | undefined;
119
136
  totpCode?: string | undefined;
120
137
  }>;
121
138
  }, "strict", z.ZodTypeAny, {
122
139
  reauth: {
123
- emailCode: {
140
+ password?: string | undefined;
141
+ emailCode?: {
124
142
  code: string;
125
143
  verificationId: string;
126
- };
144
+ } | undefined;
127
145
  totpCode?: string | undefined;
128
146
  };
129
147
  }, {
130
148
  reauth: {
131
- emailCode: {
149
+ password?: string | undefined;
150
+ emailCode?: {
132
151
  code: string;
133
152
  verificationId: string;
134
- };
153
+ } | undefined;
135
154
  totpCode?: string | undefined;
136
155
  };
137
156
  }>;
@@ -58,8 +58,8 @@ export type { IdentityProofAction, IdentityErrorCode, IdentityProofClaims, Ident
58
58
  export { updatePlatformSchema, updateStatusSchema, updateAssetStatusSchema, sha256HexSchema, channelNameSchema, runtimeVersionSchema, rolloutPercentSchema, assetInitItemSchema, assetInitRequestSchema, assetUploadTicketSchema, assetInitResponseSchema, assetCompleteRequestSchema, assetCompleteResultItemSchema, assetCompleteResponseSchema, updateAssetRefSchema, createUpdateRequestSchema, updateSchema, createUpdateResponseSchema, rollbackToEmbeddedEntrySchema, channelSchema, channelListResponseSchema, updateListResponseSchema, rollbackRequestSchema, rollbackToEmbeddedRequestSchema, promoteRequestSchema, updateRolloutPatchSchema, } from './updates';
59
59
  export type { UpdatePlatform, UpdateStatus, UpdateAssetStatus, AssetInitItem, AssetInitRequest, AssetUploadTicket, AssetInitResponse, AssetCompleteRequest, AssetCompleteResultItem, AssetCompleteResponse, UpdateAssetRef, CreateUpdateRequest, Update, CreateUpdateResponse, RollbackToEmbeddedEntry, Channel, ChannelListResponse, UpdateListResponse, RollbackRequest, RollbackToEmbeddedRequest, PromoteRequest, UpdateRolloutPatch, } from './updates';
60
60
  export { EMAIL_VERIFICATION_PURPOSES, EMAIL_CODE_LENGTH, EMAIL_CODE_TTL_MS, EMAIL_CODE_MAX_ATTEMPTS, EMAIL_TICKET_TTL_MS, EMAIL_VERIFICATION_ERROR_CODES, emailAddressSchema, emailTicketSchema, emailVerificationStartRequestSchema, emailVerificationStartResponseSchema, emailVerificationConfirmRequestSchema, emailVerificationConfirmResponseSchema, } from './accountEmail';
61
- export { EMAIL_SIGNIN_LINK_TTL_MS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, TOTP_DIGITS, TOTP_PERIOD_SECONDS, TOTP_BACKUP_CODE_COUNT, SIGN_IN_ERROR_CODES, signInIdentifierSchema, passwordInputSchema, newPasswordSchema, secondFactorCodeSchema, emailSignInStartRequestSchema, emailSignInStartResponseSchema, emailSignInConfirmRequestSchema, emailSignInCodeSchema, normalizeEmailSignInCode, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, emailSignInCollectRequestSchema, emailSignInLinkRequestSchema, emailSignInLinkResponseSchema, emailSignInPendingSchema, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_ACCOUNTS_MAX, emailSignInAccountOptionSchema, emailSignInChooseAccountSchema, emailSignInChooseRequestSchema, isEmailSignInChooseAccount, passwordSignInRequestSchema, secondFactorSignInRequestSchema, secondFactorRequiredSchema, signUpRequestSchema, isSecondFactorRequired, reauthProofSchema, emailReauthProofSchema, REAUTH_ACTIONS, reauthEmailStartRequestSchema, passwordSetRequestSchema, signInMethodsSchema, totpEnrollResponseSchema, totpConfirmRequestSchema, totpReauthRequestSchema, totpBackupCodesResponseSchema, } from './signIn';
62
- export type { EmailSignInStartRequest, EmailSignInStartResponse, EmailSignInConfirmRequest, EmailSignInCollectRequest, EmailSignInLinkRequest, EmailSignInLinkResponse, EmailSignInPending, EmailSignInAccountOption, EmailSignInChooseAccount, EmailSignInChooseRequest, EmailSignInStepResult, PasswordSignInRequest, SecondFactorSignInRequest, SecondFactorRequired, SignInStepResult, SignUpRequest, ReauthProof, EmailReauthProof, ReauthAction, ReauthEmailStartRequest, PasswordSetRequest, SignInMethods, TotpEnrollResponse, TotpConfirmRequest, TotpReauthRequest, TotpBackupCodesResponse, SignInErrorCode, } from './signIn';
61
+ export { EMAIL_SIGNIN_LINK_TTL_MS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, TOTP_DIGITS, TOTP_PERIOD_SECONDS, TOTP_BACKUP_CODE_COUNT, SIGN_IN_ERROR_CODES, signInIdentifierSchema, passwordInputSchema, newPasswordSchema, secondFactorCodeSchema, emailSignInStartRequestSchema, emailSignInStartResponseSchema, emailSignInConfirmRequestSchema, emailSignInCodeSchema, normalizeEmailSignInCode, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, emailSignInCollectRequestSchema, emailSignInLinkRequestSchema, emailSignInLinkResponseSchema, emailSignInPendingSchema, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_ACCOUNTS_MAX, emailSignInAccountOptionSchema, emailSignInChooseAccountSchema, emailSignInChooseRequestSchema, isEmailSignInChooseAccount, passwordSignInRequestSchema, secondFactorSignInRequestSchema, secondFactorRequiredSchema, signUpRequestSchema, isSecondFactorRequired, reauthProofSchema, REAUTH_ACTIONS, reauthEmailStartRequestSchema, passwordSetRequestSchema, signInMethodRemoveRequestSchema, emailChangeStartRequestSchema, emailSetRequestSchema, signInMethodsSchema, totpEnrollResponseSchema, totpConfirmRequestSchema, totpReauthRequestSchema, totpBackupCodesResponseSchema, } from './signIn';
62
+ export type { EmailSignInStartRequest, EmailSignInStartResponse, EmailSignInConfirmRequest, EmailSignInCollectRequest, EmailSignInLinkRequest, EmailSignInLinkResponse, EmailSignInPending, EmailSignInAccountOption, EmailSignInChooseAccount, EmailSignInChooseRequest, EmailSignInStepResult, PasswordSignInRequest, SecondFactorSignInRequest, SecondFactorRequired, SignInStepResult, SignUpRequest, ReauthProof, ReauthAction, ReauthEmailStartRequest, PasswordSetRequest, SignInMethodRemoveRequest, EmailChangeStartRequest, EmailSetRequest, SignInMethods, TotpEnrollResponse, TotpConfirmRequest, TotpReauthRequest, TotpBackupCodesResponse, SignInErrorCode, } from './signIn';
63
63
  export { IDENTITY_LINK_STATUSES, IDENTITY_LINK_QR_PREFIX, identityLinkIdSchema, buildIdentityLinkQrPayload, parseIdentityLinkQrPayload, identityLinkCreateResponseSchema, identityLinkStateSchema, identityLinkProofRequestSchema, identityLinkCompleteRequestSchema, } from './identityLink';
64
64
  export type { IdentityLinkStatus, IdentityLinkCreateResponse, IdentityLinkState, IdentityLinkProofRequest, IdentityLinkCompleteRequest, } from './identityLink';
65
65
  export type { EmailVerificationPurpose, EmailVerificationStartRequest, EmailVerificationStartResponse, EmailVerificationConfirmRequest, EmailVerificationConfirmResponse, EmailVerificationErrorCode, } from './accountEmail';
@@ -117,16 +117,6 @@ export * from './accountAccess';
117
117
  export * from './notifications';
118
118
  export * from './email/messages';
119
119
  export * from './stickers';
120
- export { decisionEffortSchema, decisionQuestionSchema, decisionInputSchema, decisionRequestSchema, decisionAnswerSchema, decisionResultSchema, decisionSuccessSchema, decisionFailureSchema, decisionInputBudget, decisionFitsGateway, decisionAnswersMatch, } from './inference/decisions';
121
- export type { DecisionQuestion, DecisionInput, DecisionRequest, DecisionAnswer, DecisionFailure, DecisionResult, DecisionSuccess, } from './inference/decisions';
122
- export { SCOPED_EXECUTION_CONTRACT_VERSION, SCOPED_REQUEST_ENVELOPE_VERSION, scopedExecutionAudienceSchema, scopedExecutionSchema, canonicalScopedExecutionJson, } from './inference/scopedExecution';
123
- export type { ScopedExecutionAudience, ScopedExecution } from './inference/scopedExecution';
124
- export { scopedInferenceRequestSchema } from './inference/request';
125
- export type { ScopedInferenceRequest } from './inference/request';
126
- export { PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION, PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION, PRIVATE_AUTO_LIMITS, PRIVATE_AUTO_INSTRUCTIONS, PRIVATE_AUTO_QUESTION, privateAutoPrincipalSchema, privateAutoSourceApprovalSchema, privateAutoExecutionSchema, privateAutoInputSchema, privateAutoOperationId, } from './inference/privateAutoExecution';
127
- export type { PrivateAutoPrincipal, PrivateAutoSourceApproval, PrivateAutoExecution, } from './inference/privateAutoExecution';
128
- export { privateAutoInferenceRequestSchema } from './inference/request';
129
- export type { PrivateAutoInferenceRequest } from './inference/request';
130
120
  export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access';
131
121
  export type { ProductDefinition, SubjectProductAccessQuery, SubjectProductGrantSnapshot, ProductBenefit, ProductOffer, ProductSubscriptionSource, ProductAccessGrant, ProductOfferSegment, SubjectProductAccess, } from './products/access';
132
122
  export { meteredGenerationSchema, type MeteredGeneration } from './inference/economics';
@@ -1071,96 +1071,6 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1071
1071
  /** See `version.ts`: exchanged with the data plane on its own. */
1072
1072
  schemaVersion: z.ZodLiteral<2>;
1073
1073
  deploymentId: z.ZodString;
1074
- /** Restrictive audience; never an eligibility approval. */
1075
- scopedExecution: z.ZodOptional<z.ZodObject<{
1076
- permitId: z.ZodString;
1077
- idempotencyKey: z.ZodString;
1078
- fixtureSha256: z.ZodString;
1079
- expiresAt: z.ZodString;
1080
- principal: z.ZodObject<{
1081
- accountId: z.ZodString;
1082
- applicationId: z.ZodString;
1083
- credentialId: z.ZodString;
1084
- environment: z.ZodEnum<["development", "staging", "production"]>;
1085
- }, "strict", z.ZodTypeAny, {
1086
- accountId: string;
1087
- environment: "development" | "staging" | "production";
1088
- applicationId: string;
1089
- credentialId: string;
1090
- }, {
1091
- accountId: string;
1092
- environment: "development" | "staging" | "production";
1093
- applicationId: string;
1094
- credentialId: string;
1095
- }>;
1096
- policy: z.ZodObject<{
1097
- routingPolicyId: z.ZodString;
1098
- policyVersion: z.ZodNumber;
1099
- }, "strict", z.ZodTypeAny, {
1100
- routingPolicyId: string;
1101
- policyVersion: number;
1102
- }, {
1103
- routingPolicyId: string;
1104
- policyVersion: number;
1105
- }>;
1106
- deploymentId: z.ZodString;
1107
- provider: z.ZodString;
1108
- keyId: z.ZodString;
1109
- modelReference: z.ZodEffects<z.ZodString, string, string>;
1110
- upstreamModelId: z.ZodString;
1111
- priceVersionId: z.ZodString;
1112
- providerRateCardVersionId: z.ZodString;
1113
- providerSourceVersion: z.ZodString;
1114
- maxCostUsd: z.ZodEffects<z.ZodBranded<z.ZodString, "ExactDecimal">, string & z.BRAND<"ExactDecimal">, string>;
1115
- }, "strict", z.ZodTypeAny, {
1116
- expiresAt: string;
1117
- keyId: string;
1118
- idempotencyKey: string;
1119
- principal: {
1120
- accountId: string;
1121
- environment: "development" | "staging" | "production";
1122
- applicationId: string;
1123
- credentialId: string;
1124
- };
1125
- provider: string;
1126
- priceVersionId: string;
1127
- modelReference: string;
1128
- permitId: string;
1129
- fixtureSha256: string;
1130
- policy: {
1131
- routingPolicyId: string;
1132
- policyVersion: number;
1133
- };
1134
- deploymentId: string;
1135
- upstreamModelId: string;
1136
- providerRateCardVersionId: string;
1137
- providerSourceVersion: string;
1138
- maxCostUsd: string & z.BRAND<"ExactDecimal">;
1139
- }, {
1140
- expiresAt: string;
1141
- keyId: string;
1142
- idempotencyKey: string;
1143
- principal: {
1144
- accountId: string;
1145
- environment: "development" | "staging" | "production";
1146
- applicationId: string;
1147
- credentialId: string;
1148
- };
1149
- provider: string;
1150
- priceVersionId: string;
1151
- modelReference: string;
1152
- permitId: string;
1153
- fixtureSha256: string;
1154
- policy: {
1155
- routingPolicyId: string;
1156
- policyVersion: number;
1157
- };
1158
- deploymentId: string;
1159
- upstreamModelId: string;
1160
- providerRateCardVersionId: string;
1161
- providerSourceVersion: string;
1162
- maxCostUsd: string;
1163
- }>>;
1164
1074
  provider: z.ZodString;
1165
1075
  /** Always revision-pinned: a deployment serves specific weights. */
1166
1076
  modelReference: z.ZodString;
@@ -1215,7 +1125,6 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1215
1125
  schemaVersion: 2;
1216
1126
  provider: string;
1217
1127
  modelReference: string;
1218
- deploymentId: string;
1219
1128
  regions: string[];
1220
1129
  dataPolicy: {
1221
1130
  retainsPayloads: boolean;
@@ -1225,41 +1134,16 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1225
1134
  subprocessors: string[];
1226
1135
  policyUrl?: string | undefined;
1227
1136
  };
1137
+ deploymentId: string;
1228
1138
  availabilityScope: "platform_internal" | "public_payg" | "enterprise" | "byok_only" | "oxy_hosted";
1229
1139
  commercialPermission: "standard_application_use" | "public_resale_approved" | "wholesale_contract" | "customer_byok" | "open_weight_hosting";
1230
1140
  dedicatedCapacity: boolean;
1231
1141
  priceVersionId?: string | undefined;
1232
- scopedExecution?: {
1233
- expiresAt: string;
1234
- keyId: string;
1235
- idempotencyKey: string;
1236
- principal: {
1237
- accountId: string;
1238
- environment: "development" | "staging" | "production";
1239
- applicationId: string;
1240
- credentialId: string;
1241
- };
1242
- provider: string;
1243
- priceVersionId: string;
1244
- modelReference: string;
1245
- permitId: string;
1246
- fixtureSha256: string;
1247
- policy: {
1248
- routingPolicyId: string;
1249
- policyVersion: number;
1250
- };
1251
- deploymentId: string;
1252
- upstreamModelId: string;
1253
- providerRateCardVersionId: string;
1254
- providerSourceVersion: string;
1255
- maxCostUsd: string & z.BRAND<"ExactDecimal">;
1256
- } | undefined;
1257
1142
  }, {
1258
1143
  status: "active" | "retired" | "disabled" | "degraded";
1259
1144
  schemaVersion: 2;
1260
1145
  provider: string;
1261
1146
  modelReference: string;
1262
- deploymentId: string;
1263
1147
  regions: string[];
1264
1148
  dataPolicy: {
1265
1149
  retainsPayloads: boolean;
@@ -1269,41 +1153,16 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1269
1153
  subprocessors?: string[] | undefined;
1270
1154
  policyUrl?: string | undefined;
1271
1155
  };
1156
+ deploymentId: string;
1272
1157
  availabilityScope: "platform_internal" | "public_payg" | "enterprise" | "byok_only" | "oxy_hosted";
1273
1158
  commercialPermission: "standard_application_use" | "public_resale_approved" | "wholesale_contract" | "customer_byok" | "open_weight_hosting";
1274
1159
  dedicatedCapacity: boolean;
1275
1160
  priceVersionId?: string | undefined;
1276
- scopedExecution?: {
1277
- expiresAt: string;
1278
- keyId: string;
1279
- idempotencyKey: string;
1280
- principal: {
1281
- accountId: string;
1282
- environment: "development" | "staging" | "production";
1283
- applicationId: string;
1284
- credentialId: string;
1285
- };
1286
- provider: string;
1287
- priceVersionId: string;
1288
- modelReference: string;
1289
- permitId: string;
1290
- fixtureSha256: string;
1291
- policy: {
1292
- routingPolicyId: string;
1293
- policyVersion: number;
1294
- };
1295
- deploymentId: string;
1296
- upstreamModelId: string;
1297
- providerRateCardVersionId: string;
1298
- providerSourceVersion: string;
1299
- maxCostUsd: string;
1300
- } | undefined;
1301
1161
  }>, {
1302
1162
  status: "active" | "retired" | "disabled" | "degraded";
1303
1163
  schemaVersion: 2;
1304
1164
  provider: string;
1305
1165
  modelReference: string;
1306
- deploymentId: string;
1307
1166
  regions: string[];
1308
1167
  dataPolicy: {
1309
1168
  retainsPayloads: boolean;
@@ -1313,41 +1172,16 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1313
1172
  subprocessors: string[];
1314
1173
  policyUrl?: string | undefined;
1315
1174
  };
1175
+ deploymentId: string;
1316
1176
  availabilityScope: "platform_internal" | "public_payg" | "enterprise" | "byok_only" | "oxy_hosted";
1317
1177
  commercialPermission: "standard_application_use" | "public_resale_approved" | "wholesale_contract" | "customer_byok" | "open_weight_hosting";
1318
1178
  dedicatedCapacity: boolean;
1319
1179
  priceVersionId?: string | undefined;
1320
- scopedExecution?: {
1321
- expiresAt: string;
1322
- keyId: string;
1323
- idempotencyKey: string;
1324
- principal: {
1325
- accountId: string;
1326
- environment: "development" | "staging" | "production";
1327
- applicationId: string;
1328
- credentialId: string;
1329
- };
1330
- provider: string;
1331
- priceVersionId: string;
1332
- modelReference: string;
1333
- permitId: string;
1334
- fixtureSha256: string;
1335
- policy: {
1336
- routingPolicyId: string;
1337
- policyVersion: number;
1338
- };
1339
- deploymentId: string;
1340
- upstreamModelId: string;
1341
- providerRateCardVersionId: string;
1342
- providerSourceVersion: string;
1343
- maxCostUsd: string & z.BRAND<"ExactDecimal">;
1344
- } | undefined;
1345
1180
  }, {
1346
1181
  status: "active" | "retired" | "disabled" | "degraded";
1347
1182
  schemaVersion: 2;
1348
1183
  provider: string;
1349
1184
  modelReference: string;
1350
- deploymentId: string;
1351
1185
  regions: string[];
1352
1186
  dataPolicy: {
1353
1187
  retainsPayloads: boolean;
@@ -1357,35 +1191,11 @@ export declare const modelDeploymentSchema: z.ZodEffects<z.ZodObject<{
1357
1191
  subprocessors?: string[] | undefined;
1358
1192
  policyUrl?: string | undefined;
1359
1193
  };
1194
+ deploymentId: string;
1360
1195
  availabilityScope: "platform_internal" | "public_payg" | "enterprise" | "byok_only" | "oxy_hosted";
1361
1196
  commercialPermission: "standard_application_use" | "public_resale_approved" | "wholesale_contract" | "customer_byok" | "open_weight_hosting";
1362
1197
  dedicatedCapacity: boolean;
1363
1198
  priceVersionId?: string | undefined;
1364
- scopedExecution?: {
1365
- expiresAt: string;
1366
- keyId: string;
1367
- idempotencyKey: string;
1368
- principal: {
1369
- accountId: string;
1370
- environment: "development" | "staging" | "production";
1371
- applicationId: string;
1372
- credentialId: string;
1373
- };
1374
- provider: string;
1375
- priceVersionId: string;
1376
- modelReference: string;
1377
- permitId: string;
1378
- fixtureSha256: string;
1379
- policy: {
1380
- routingPolicyId: string;
1381
- policyVersion: number;
1382
- };
1383
- deploymentId: string;
1384
- upstreamModelId: string;
1385
- providerRateCardVersionId: string;
1386
- providerSourceVersion: string;
1387
- maxCostUsd: string;
1388
- } | undefined;
1389
1199
  }>;
1390
1200
  /** One candidate a profile may resolve to, and how strongly it is preferred. */
1391
1201
  export declare const routingProfileCandidateSchema: z.ZodObject<{
@@ -320,7 +320,6 @@ export declare const meteredGenerationSchema: z.ZodObject<{
320
320
  quantity: number;
321
321
  }[];
322
322
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
323
- economicPolicyVersion: string;
324
323
  tariff: {
325
324
  status: "quoted";
326
325
  currency: string;
@@ -335,6 +334,7 @@ export declare const meteredGenerationSchema: z.ZodObject<{
335
334
  };
336
335
  meteredUsageId: string;
337
336
  economicTreatment: "internal_metered";
337
+ economicPolicyVersion: string;
338
338
  generationId?: string | undefined;
339
339
  parentRequestId?: string | undefined;
340
340
  delegatedUserId?: string | undefined;
@@ -354,7 +354,6 @@ export declare const meteredGenerationSchema: z.ZodObject<{
354
354
  quantity: number;
355
355
  }[];
356
356
  usageSource: "provider_reported" | "oxy_measured" | "estimated";
357
- economicPolicyVersion: string;
358
357
  tariff: {
359
358
  status: "quoted";
360
359
  currency: string;
@@ -369,6 +368,7 @@ export declare const meteredGenerationSchema: z.ZodObject<{
369
368
  };
370
369
  meteredUsageId: string;
371
370
  economicTreatment: "internal_metered";
371
+ economicPolicyVersion: string;
372
372
  generationId?: string | undefined;
373
373
  parentRequestId?: string | undefined;
374
374
  delegatedUserId?: string | undefined;