@oxy.so/contracts 4.24.0 → 5.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.
Files changed (34) hide show
  1. package/dist/cjs/client/index.js +15 -0
  2. package/dist/cjs/index.js +2 -35
  3. package/dist/cjs/inference/catalogue.js +2 -5
  4. package/dist/cjs/inference/request.js +5 -79
  5. package/dist/cjs/inference/version.js +1 -1
  6. package/dist/cjs/products/one.js +142 -0
  7. package/dist/esm/client/index.js +1 -0
  8. package/dist/esm/index.js +1 -5
  9. package/dist/esm/inference/catalogue.js +0 -3
  10. package/dist/esm/inference/request.js +4 -78
  11. package/dist/esm/inference/version.js +1 -1
  12. package/dist/esm/products/one.js +137 -0
  13. package/dist/types/client/index.d.ts +1 -0
  14. package/dist/types/index.d.ts +1 -10
  15. package/dist/types/inference/catalogue.d.ts +4 -194
  16. package/dist/types/inference/economics.d.ts +2 -2
  17. package/dist/types/inference/realtime.d.ts +88 -88
  18. package/dist/types/inference/request.d.ts +28 -5055
  19. package/dist/types/inference/routingPolicy.d.ts +16 -16
  20. package/dist/types/inference/streamEvents.d.ts +8 -8
  21. package/dist/types/inference/usage.d.ts +4 -4
  22. package/dist/types/inference/version.d.ts +1 -1
  23. package/dist/types/products/one.d.ts +250 -0
  24. package/dist/types/safety.d.ts +10 -10
  25. package/package.json +1 -1
  26. package/dist/cjs/inference/decisions.js +0 -305
  27. package/dist/cjs/inference/privateAutoExecution.js +0 -153
  28. package/dist/cjs/inference/scopedExecution.js +0 -87
  29. package/dist/esm/inference/decisions.js +0 -299
  30. package/dist/esm/inference/privateAutoExecution.js +0 -149
  31. package/dist/esm/inference/scopedExecution.js +0 -83
  32. package/dist/types/inference/decisions.d.ts +0 -1853
  33. package/dist/types/inference/privateAutoExecution.d.ts +0 -694
  34. package/dist/types/inference/scopedExecution.d.ts +0 -202
@@ -15,6 +15,20 @@
15
15
  * behaviour by `__tests__/clientChecks.parity.test.ts`. Types are not repeated
16
16
  * here; import them from `@oxy.so/contracts` with `import type`.
17
17
  */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
+ };
18
32
  Object.defineProperty(exports, "__esModule", { value: true });
19
33
  exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = exports.executeAgentKeyOperationCheck = exports.agentVerifyRequestCheck = exports.agentProofClaimsCheck = exports.agentKeyOperationResultCheck = exports.agentKeyOperationCheck = exports.agentKeyOperationChallengeCheck = exports.agentKeyListResponseCheck = exports.agentChallengeRequestCheck = exports.AGENT_PROOF_TTL_MS = exports.AGENT_PROOF_AUDIENCE = exports.AGENT_PROOF_ACTIONS = exports.ACCOUNT_AUTH_METHODS = exports.emailVerificationStartResponseCheck = exports.emailVerificationConfirmResponseCheck = exports.emailTicketCheck = exports.emailAddressCheck = exports.EMAIL_VERIFICATION_PURPOSES = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_LENGTH = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.MAX_ACCOUNT_CATEGORIES = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.parseContract = exports.formatCheckPath = exports.checkContract = exports.ContractCheckError = void 0;
20
34
  exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = void 0;
@@ -238,3 +252,4 @@ Object.defineProperty(exports, "OXY_APP_ASSERTION_TYPE", { enumerable: true, get
238
252
  Object.defineProperty(exports, "appAssertionChallengeResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAssertionChallengeResponseCheck; } });
239
253
  Object.defineProperty(exports, "appAssertionResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAssertionResponseCheck; } });
240
254
  Object.defineProperty(exports, "appAttestKeyResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAttestKeyResponseCheck; } });
255
+ __exportStar(require("../products/one"), exports);
package/dist/cjs/index.js CHANGED
@@ -38,8 +38,7 @@ exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSch
38
38
  exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = exports.kaanaCredentialIdentitySchema = exports.kaanaCredentialOperationActionSchema = exports.kaanaCredentialOperationIdSchema = exports.kaanaCredentialHandleSchema = exports.providerConnectionScopeSchema = exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = 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 = void 0;
39
39
  exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = exports.reconciliationReportSchema = exports.reconciliationRunSchema = exports.reconciliationDiscrepancySchema = exports.reconciliationRunStatusSchema = exports.RECONCILIATION_RUN_STATUSES = exports.reconciliationDiscrepancyKindSchema = exports.RECONCILIATION_DISCREPANCY_KINDS = exports.autoRechargeAttemptSchema = exports.autoRechargeStatusSchema = exports.AUTO_RECHARGE_STATUSES = exports.externalPaymentSchema = exports.externalPaymentKindSchema = exports.EXTERNAL_PAYMENT_KINDS = exports.externalPaymentProviderSchema = exports.EXTERNAL_PAYMENT_PROVIDERS = exports.billingInvoiceSchema = exports.billingInvoiceStatusSchema = exports.BILLING_INVOICE_STATUSES = exports.accountBillingStateSchema = exports.billingProfileSchema = exports.autoRechargeSchema = exports.billingProfileStatusSchema = exports.BILLING_PROFILE_STATUSES = exports.billingModeSchema = exports.BILLING_MODES = exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = void 0;
40
40
  exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentAvailabilitySchema = exports.applicationAgentSchema = exports.applicationAgentWriteSchema = exports.applicationAgentAvailabilitySchema = exports.APPLICATION_AGENT_AVAILABILITIES = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.autonomyLevelSchema = exports.CAPABILITY_PACKAGES = exports.AUTONOMY_LEVELS = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = void 0;
41
- exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.privateAutoInferenceRequestSchema = exports.privateAutoOperationId = exports.privateAutoInputSchema = exports.privateAutoExecutionSchema = exports.privateAutoSourceApprovalSchema = exports.privateAutoPrincipalSchema = exports.PRIVATE_AUTO_QUESTION = exports.PRIVATE_AUTO_INSTRUCTIONS = exports.PRIVATE_AUTO_LIMITS = exports.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION = exports.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION = exports.scopedInferenceRequestSchema = exports.canonicalScopedExecutionJson = exports.scopedExecutionSchema = exports.scopedExecutionAudienceSchema = exports.SCOPED_REQUEST_ENVELOPE_VERSION = exports.SCOPED_EXECUTION_CONTRACT_VERSION = exports.decisionAnswersMatch = exports.decisionFitsGateway = exports.decisionInputBudget = exports.decisionFailureSchema = exports.decisionSuccessSchema = exports.decisionResultSchema = exports.decisionAnswerSchema = exports.decisionRequestSchema = exports.decisionInputSchema = exports.decisionQuestionSchema = exports.decisionEffortSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = void 0;
42
- exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = void 0;
41
+ exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = void 0;
43
42
  var accountGraph_1 = require("./accountGraph");
44
43
  Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
45
44
  Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
@@ -837,39 +836,6 @@ __exportStar(require("./accountAccess"), exports);
837
836
  __exportStar(require("./notifications"), exports);
838
837
  __exportStar(require("./email/messages"), exports);
839
838
  __exportStar(require("./stickers"), exports);
840
- var decisions_1 = require("./inference/decisions");
841
- Object.defineProperty(exports, "decisionEffortSchema", { enumerable: true, get: function () { return decisions_1.decisionEffortSchema; } });
842
- Object.defineProperty(exports, "decisionQuestionSchema", { enumerable: true, get: function () { return decisions_1.decisionQuestionSchema; } });
843
- Object.defineProperty(exports, "decisionInputSchema", { enumerable: true, get: function () { return decisions_1.decisionInputSchema; } });
844
- Object.defineProperty(exports, "decisionRequestSchema", { enumerable: true, get: function () { return decisions_1.decisionRequestSchema; } });
845
- Object.defineProperty(exports, "decisionAnswerSchema", { enumerable: true, get: function () { return decisions_1.decisionAnswerSchema; } });
846
- Object.defineProperty(exports, "decisionResultSchema", { enumerable: true, get: function () { return decisions_1.decisionResultSchema; } });
847
- Object.defineProperty(exports, "decisionSuccessSchema", { enumerable: true, get: function () { return decisions_1.decisionSuccessSchema; } });
848
- Object.defineProperty(exports, "decisionFailureSchema", { enumerable: true, get: function () { return decisions_1.decisionFailureSchema; } });
849
- Object.defineProperty(exports, "decisionInputBudget", { enumerable: true, get: function () { return decisions_1.decisionInputBudget; } });
850
- Object.defineProperty(exports, "decisionFitsGateway", { enumerable: true, get: function () { return decisions_1.decisionFitsGateway; } });
851
- Object.defineProperty(exports, "decisionAnswersMatch", { enumerable: true, get: function () { return decisions_1.decisionAnswersMatch; } });
852
- var scopedExecution_1 = require("./inference/scopedExecution");
853
- Object.defineProperty(exports, "SCOPED_EXECUTION_CONTRACT_VERSION", { enumerable: true, get: function () { return scopedExecution_1.SCOPED_EXECUTION_CONTRACT_VERSION; } });
854
- Object.defineProperty(exports, "SCOPED_REQUEST_ENVELOPE_VERSION", { enumerable: true, get: function () { return scopedExecution_1.SCOPED_REQUEST_ENVELOPE_VERSION; } });
855
- Object.defineProperty(exports, "scopedExecutionAudienceSchema", { enumerable: true, get: function () { return scopedExecution_1.scopedExecutionAudienceSchema; } });
856
- Object.defineProperty(exports, "scopedExecutionSchema", { enumerable: true, get: function () { return scopedExecution_1.scopedExecutionSchema; } });
857
- Object.defineProperty(exports, "canonicalScopedExecutionJson", { enumerable: true, get: function () { return scopedExecution_1.canonicalScopedExecutionJson; } });
858
- var request_2 = require("./inference/request");
859
- Object.defineProperty(exports, "scopedInferenceRequestSchema", { enumerable: true, get: function () { return request_2.scopedInferenceRequestSchema; } });
860
- var privateAutoExecution_1 = require("./inference/privateAutoExecution");
861
- Object.defineProperty(exports, "PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION; } });
862
- Object.defineProperty(exports, "PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION; } });
863
- Object.defineProperty(exports, "PRIVATE_AUTO_LIMITS", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_LIMITS; } });
864
- Object.defineProperty(exports, "PRIVATE_AUTO_INSTRUCTIONS", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_INSTRUCTIONS; } });
865
- Object.defineProperty(exports, "PRIVATE_AUTO_QUESTION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_QUESTION; } });
866
- Object.defineProperty(exports, "privateAutoPrincipalSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoPrincipalSchema; } });
867
- Object.defineProperty(exports, "privateAutoSourceApprovalSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoSourceApprovalSchema; } });
868
- Object.defineProperty(exports, "privateAutoExecutionSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoExecutionSchema; } });
869
- Object.defineProperty(exports, "privateAutoInputSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoInputSchema; } });
870
- Object.defineProperty(exports, "privateAutoOperationId", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoOperationId; } });
871
- var request_3 = require("./inference/request");
872
- Object.defineProperty(exports, "privateAutoInferenceRequestSchema", { enumerable: true, get: function () { return request_3.privateAutoInferenceRequestSchema; } });
873
839
  var access_1 = require("./products/access");
874
840
  Object.defineProperty(exports, "productDefinitionSchema", { enumerable: true, get: function () { return access_1.productDefinitionSchema; } });
875
841
  Object.defineProperty(exports, "subjectProductAccessQuerySchema", { enumerable: true, get: function () { return access_1.subjectProductAccessQuerySchema; } });
@@ -907,3 +873,4 @@ Object.defineProperty(exports, "serviceTokenOptionsSchema", { enumerable: true,
907
873
  __exportStar(require("./applicationRoles"), exports);
908
874
  __exportStar(require("./contentClaims"), exports);
909
875
  __exportStar(require("./appAssertions"), exports);
876
+ __exportStar(require("./products/one"), exports);
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
4
- const scopedExecution_1 = require("./scopedExecution");
5
2
  /**
6
3
  * The canonical model catalogue.
7
4
  *
@@ -30,6 +27,8 @@ const scopedExecution_1 = require("./scopedExecution");
30
27
  *
31
28
  * Decided in: docs/adr/0008-catalogue-concept-separation.md.
32
29
  */
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
33
32
  const zod_1 = require("zod");
34
33
  const identifiers_1 = require("./identifiers");
35
34
  const priceVersion_1 = require("./priceVersion");
@@ -487,8 +486,6 @@ exports.modelDeploymentSchema = zod_1.z
487
486
  /** See `version.ts`: exchanged with the data plane on its own. */
488
487
  schemaVersion: zod_1.z.literal(2),
489
488
  deploymentId: identifiers_1.deploymentIdSchema,
490
- /** Restrictive audience; never an eligibility approval. */
491
- scopedExecution: scopedExecution_1.scopedExecutionAudienceSchema.optional(),
492
489
  provider: identifiers_1.inferenceProviderSlugSchema,
493
490
  /** Always revision-pinned: a deployment serves specific weights. */
494
491
  modelReference: identifiers_1.modelReferenceSchema,
@@ -25,11 +25,8 @@
25
25
  * docs/adr/0017-authorized-routes-in-the-envelope.md.
26
26
  */
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.privateAutoInferenceRequestSchema = exports.scopedInferenceRequestSchema = 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
- const decisions_1 = require("./decisions");
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;
30
29
  const zod_1 = require("zod");
31
- const scopedExecution_1 = require("./scopedExecution");
32
- const privateAutoExecution_1 = require("./privateAutoExecution");
33
30
  const attribution_1 = require("./attribution");
34
31
  const catalogue_1 = require("./catalogue");
35
32
  const identifiers_1 = require("./identifiers");
@@ -201,7 +198,6 @@ exports.inferenceMessageSchema = zod_1.z
201
198
  * that both metering and provider translation depend on.
202
199
  */
203
200
  exports.inferenceInputSchema = zod_1.z.discriminatedUnion("format", [
204
- zod_1.z.object({ format: zod_1.z.literal("decisions"), decisions: decisions_1.decisionInputSchema }).strict(),
205
201
  zod_1.z
206
202
  .object({
207
203
  format: zod_1.z.literal("messages"),
@@ -356,8 +352,6 @@ exports.inferenceRequestSchema = zod_1.z
356
352
  .object({
357
353
  /** See `version.ts`: this is the Oxy→data-plane request envelope. */
358
354
  schemaVersion: zod_1.z.literal(2),
359
- /** Recognized so v2 refuses rather than silently stripping a restriction. */
360
- scopedExecution: scopedExecution_1.scopedExecutionSchema.optional(),
361
355
  attribution: attribution_1.inferenceAttributionSchema,
362
356
  target: routingPolicy_1.routingTargetSchema,
363
357
  modality: catalogue_1.inferenceModalitySchema,
@@ -412,18 +406,10 @@ exports.inferenceRequestSchema = zod_1.z
412
406
  authorizedRoutes: zod_1.z.array(routingPolicy_1.authorizedRouteSchema).min(1).optional(),
413
407
  })
414
408
  .superRefine((request, ctx) => {
415
- if (request.scopedExecution !== undefined)
416
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["scopedExecution"], message: "Scoped execution requires envelope v3." });
417
- if (request.input.format === "decisions" || request.client.apiFormat === "decisions") {
418
- const exactModel = request.target.kind === "model" && request.target.modelReference.includes('@');
419
- const foreignRoute = request.authorizedRoutes?.some((route) => request.target.kind !== "model" || route.modelReference !== request.target.modelReference || route.substitution !== "same_model");
420
- if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
421
- request.modality !== "text" || request.stream || !exactModel || foreignRoute ||
422
- request.maxOutputTokens !== undefined || Object.keys(request.sampling).length > 0 ||
423
- request.tools.length > 0 || request.toolChoice !== undefined || request.responseFormat !== undefined ||
424
- request.reasoning !== undefined || request.speech !== undefined || request.audioOutput !== undefined) {
425
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["input"], message: "Decisions require exact-model typed nonstreaming input without generation controls or model substitution." });
426
- }
409
+ // Decisions are a grant operation of `kaana.ai/v1` (Kaana ADR 0002) and
410
+ // never ride this envelope.
411
+ if (request.client.apiFormat === "decisions") {
412
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["client", "apiFormat"], message: "Decisions are served by https://kaana.ai/v1/decisions, never on this envelope." });
427
413
  }
428
414
  const isSpeech = request.client.apiFormat === "audio_speech";
429
415
  if (isSpeech && request.speech !== undefined && (request.modality !== "audio" || request.input.format !== "text" || request.stream)) {
@@ -543,63 +529,3 @@ exports.inferenceRequestSchema = zod_1.z
543
529
  });
544
530
  }
545
531
  });
546
- /** Explicit restrictive generation: old v2 receivers reject this version whole. */
547
- exports.scopedInferenceRequestSchema = exports.inferenceRequestSchema.innerType()
548
- .extend({ schemaVersion: zod_1.z.literal(scopedExecution_1.SCOPED_REQUEST_ENVELOPE_VERSION), scopedExecution: scopedExecution_1.scopedExecutionSchema })
549
- .superRefine((request, ctx) => {
550
- const { scopedExecution: scope, ...base } = request;
551
- const legacy = exports.inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
552
- if (!legacy.success)
553
- for (const issue of legacy.error.issues)
554
- ctx.addIssue(issue);
555
- const principal = request.attribution.principal;
556
- const route = request.authorizedRoutes?.[0];
557
- if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
558
- scope.requestId !== request.attribution.requestId ||
559
- scope.idempotencyKey !== request.idempotencyKey ||
560
- scope.principal.accountId !== principal.billing.accountId ||
561
- scope.principal.applicationId !== principal.applicationId ||
562
- scope.principal.credentialId !== principal.credentialId ||
563
- scope.principal.environment !== principal.environment ||
564
- scope.policy.routingPolicyId !== request.routingPolicy.routingPolicyId ||
565
- scope.policy.policyVersion !== request.routingPolicy.policyVersion ||
566
- request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
567
- route?.deploymentId !== scope.deploymentId || route?.provider !== scope.provider ||
568
- route?.modelReference !== scope.modelReference ||
569
- request.target.kind !== "model" || request.target.modelReference !== scope.modelReference) {
570
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["scopedExecution"], message: "Scoped execution must restrict the exact attributed decisions request and one platform route." });
571
- }
572
- });
573
- /** Private repeated Auto is independently negotiated, never a v3 fixture renewal. */
574
- exports.privateAutoInferenceRequestSchema = exports.inferenceRequestSchema.innerType()
575
- .omit({ scopedExecution: true })
576
- .extend({ schemaVersion: zod_1.z.literal(privateAutoExecution_1.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION), privateAutoExecution: privateAutoExecution_1.privateAutoExecutionSchema })
577
- .strict()
578
- .superRefine((request, ctx) => {
579
- const { privateAutoExecution: permit, ...base } = request;
580
- const legacy = exports.inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
581
- if (!legacy.success)
582
- for (const issue of legacy.error.issues)
583
- ctx.addIssue(issue);
584
- const input = privateAutoExecution_1.privateAutoInputSchema.safeParse(request.input);
585
- if (!input.success)
586
- for (const issue of input.error.issues)
587
- ctx.addIssue({ ...issue, path: ['input', ...issue.path] });
588
- const principal = request.attribution.principal;
589
- const route = request.authorizedRoutes?.[0];
590
- if (request.attribution.userId !== undefined || request.client.apiFormat !== 'decisions' || permit.requestId !== request.attribution.requestId ||
591
- permit.operationId !== request.idempotencyKey ||
592
- permit.principal.accountId !== principal.billing.accountId ||
593
- permit.principal.applicationId !== principal.applicationId ||
594
- permit.principal.credentialId !== principal.credentialId || permit.principal.environment !== principal.environment ||
595
- !principal.inferenceScopes.includes('inference:invoke') || request.client.endpoint !== '/internal/auto-classification' ||
596
- permit.policy.routingPolicyId !== request.routingPolicy.routingPolicyId || permit.policy.policyVersion !== request.routingPolicy.policyVersion ||
597
- request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
598
- route?.deploymentId !== permit.deploymentId || route?.provider !== permit.provider || route?.modelReference !== permit.modelReference ||
599
- request.target.kind !== 'model' || request.target.modelReference !== permit.modelReference ||
600
- route.regions.length !== permit.regions.length || route.regions.some((region) => !permit.regions.includes(region)) ||
601
- Date.parse(permit.runtimeExpiresAt) <= Date.parse(request.client.receivedAt) ||
602
- Date.parse(permit.runtimeExpiresAt) > Date.parse(request.client.receivedAt) + 1000) {
603
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ['privateAutoExecution'], message: 'Private Auto must bind one exact attributed decisions child and platform route.' });
604
- }
605
- });
@@ -102,4 +102,4 @@ exports.INFERENCE_CONTRACT_VERSION = void 0;
102
102
  * change to, say, the catalogue reject every in-flight inference request; the
103
103
  * per-shape `schemaVersion` is what a message is validated against.
104
104
  */
105
- exports.INFERENCE_CONTRACT_VERSION = '3.9.0';
105
+ exports.INFERENCE_CONTRACT_VERSION = '4.0.0';
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OXY_ONE_APP_SUBSCRIPTIONS = exports.OXY_ONE_CREATOR_PLANS = exports.OXY_ONE_BUSINESS_PLANS = exports.OXY_ONE_FAMILY_PLANS = exports.OXY_ONE_PERSONAL_PLANS = exports.OXY_ONE_AUDIENCE_THEMES = exports.OXY_ONE_FAMILY_MEMBERS = exports.OXY_ONE_ANNUAL_DISCOUNT = void 0;
4
+ exports.getOnePlans = getOnePlans;
5
+ exports.onePlanQuote = onePlanQuote;
6
+ exports.OXY_ONE_ANNUAL_DISCOUNT = 20;
7
+ exports.OXY_ONE_FAMILY_MEMBERS = 6;
8
+ exports.OXY_ONE_AUDIENCE_THEMES = {
9
+ personal: 'one-plans-theme',
10
+ creator: 'one-creator-theme',
11
+ business: 'one-professional-theme',
12
+ };
13
+ /** Approved prices and credits; proposed storage capacities for the bundle design.
14
+ * USD minor units; credits renew monthly even on annual plans. Free 2 GB and Go 20 GB follow
15
+ * the new product direction; existing backend quotas are not changed here. */
16
+ exports.OXY_ONE_PERSONAL_PLANS = {
17
+ Free: { monthlyPrice: 0, monthlyCredits: 0, creditDiscount: 0, storageGB: 2 },
18
+ Go: { monthlyPrice: 1500, monthlyCredits: 4000, creditDiscount: 5, storageGB: 20 },
19
+ Pro: { monthlyPrice: 2999, monthlyCredits: 10000, creditDiscount: 10, storageGB: 100 },
20
+ Max: { monthlyPrice: 9900, monthlyCredits: 50000, creditDiscount: 15, storageGB: 500 },
21
+ Ultra: { monthlyPrice: 40000, monthlyCredits: 200000, creditDiscount: 20, storageGB: 2000 },
22
+ };
23
+ /** A family quota belongs to the whole group, never multiplied by member count. */
24
+ exports.OXY_ONE_FAMILY_PLANS = {
25
+ Go: { monthlyPrice: 2500, monthlyCredits: 8000, creditDiscount: 5, storageGB: 40 },
26
+ Pro: { monthlyPrice: 4900, monthlyCredits: 20000, creditDiscount: 10, storageGB: 200 },
27
+ Max: { monthlyPrice: 16900, monthlyCredits: 100000, creditDiscount: 15, storageGB: 1000 },
28
+ Ultra: { monthlyPrice: 59900, monthlyCredits: 300000, creditDiscount: 20, storageGB: 4000 },
29
+ };
30
+ exports.OXY_ONE_BUSINESS_PLANS = {
31
+ Go: {
32
+ monthlyPrice: 3900,
33
+ monthlySeatPrice: 900,
34
+ monthlyCredits: 8000,
35
+ creditsPerSeat: 2000,
36
+ creditDiscount: 15,
37
+ storageGB: 20,
38
+ storagePerSeatGB: 5,
39
+ },
40
+ Pro: {
41
+ monthlyPrice: 9999,
42
+ monthlySeatPrice: 1900,
43
+ monthlyCredits: 25000,
44
+ creditsPerSeat: 5000,
45
+ creditDiscount: 25,
46
+ storageGB: 100,
47
+ storagePerSeatGB: 10,
48
+ },
49
+ Max: {
50
+ monthlyPrice: 19900,
51
+ monthlySeatPrice: 2900,
52
+ monthlyCredits: 60000,
53
+ creditsPerSeat: 8000,
54
+ creditDiscount: 30,
55
+ storageGB: 500,
56
+ storagePerSeatGB: 25,
57
+ },
58
+ Ultra: {
59
+ monthlyPrice: 59900,
60
+ monthlySeatPrice: 4900,
61
+ monthlyCredits: 200000,
62
+ creditsPerSeat: 15000,
63
+ creditDiscount: 35,
64
+ storageGB: 2000,
65
+ storagePerSeatGB: 50,
66
+ },
67
+ };
68
+ /** Verification, basic app access and model access are not subscription gates. */
69
+ exports.OXY_ONE_CREATOR_PLANS = {
70
+ Go: { monthlyPrice: 2900, monthlyCredits: 10000, creditDiscount: 10, storageGB: 20 },
71
+ Pro: { monthlyPrice: 6900, monthlyCredits: 25000, creditDiscount: 15, storageGB: 100 },
72
+ Max: { monthlyPrice: 14900, monthlyCredits: 60000, creditDiscount: 20, storageGB: 500 },
73
+ Ultra: { monthlyPrice: 49900, monthlyCredits: 250000, creditDiscount: 25, storageGB: 2000 },
74
+ };
75
+ function getOnePlans(audience, mode = 'individual') {
76
+ const plans = audience === 'business'
77
+ ? exports.OXY_ONE_BUSINESS_PLANS
78
+ : audience === 'creator'
79
+ ? exports.OXY_ONE_CREATOR_PLANS
80
+ : mode === 'family'
81
+ ? exports.OXY_ONE_FAMILY_PLANS
82
+ : exports.OXY_ONE_PERSONAL_PLANS;
83
+ return Object.entries(plans).map(([name, plan]) => ({ name, ...plan }));
84
+ }
85
+ /** Each product owns its tier names; an Oxy One level selects an app subscription.
86
+ * Bundle inclusion is a proposal and does not activate product entitlements. */
87
+ exports.OXY_ONE_APP_SUBSCRIPTIONS = {
88
+ alia: { name: 'Alia', tiers: { Free: null, Go: 'Go', Pro: 'Pro', Max: 'Max', Ultra: 'Ultra' } },
89
+ // Product-owned names; these bundle mappings remain a proposal.
90
+ mention: {
91
+ name: 'Mention',
92
+ tiers: { Free: null, Go: 'Plus', Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
93
+ },
94
+ mercaria: {
95
+ name: 'Mercaria',
96
+ tiers: { Free: null, Go: 'Go', Pro: 'Plus', Max: 'Plus', Ultra: 'Ultra' },
97
+ creatorTiers: { Free: null, Go: 'Creator', Pro: 'Creator', Max: 'Creator', Ultra: 'Creator' },
98
+ },
99
+ noted: { name: 'Noted', tiers: { Free: null, Go: '+', Pro: '+', Max: '+', Ultra: '+' } },
100
+ clarity: {
101
+ name: 'Clarity',
102
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
103
+ },
104
+ schedio: {
105
+ name: 'Schedio',
106
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
107
+ },
108
+ inbox: {
109
+ name: 'Inbox',
110
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
111
+ },
112
+ homiio: {
113
+ name: 'Homiio',
114
+ tiers: { Free: null, Go: 'Plus', Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
115
+ },
116
+ };
117
+ /** Annual rounding follows the billable base and per-seat line items. */
118
+ function onePlanQuote(plan, period, seats) {
119
+ const annual = (value) => Math.round(value * 12 * (1 - exports.OXY_ONE_ANNUAL_DISCOUNT / 100));
120
+ const baseAnnual = annual(plan.monthlyPrice);
121
+ const seatAnnual = plan.monthlySeatPrice === undefined ? undefined : annual(plan.monthlySeatPrice);
122
+ const known = plan.monthlySeatPrice === undefined || seats !== undefined;
123
+ const totalAnnual = known ? baseAnnual + (seatAnnual ?? 0) * (seats ?? 0) : undefined;
124
+ return {
125
+ baseMonthly: period === 'annual' ? Math.round(baseAnnual / 12) : plan.monthlyPrice,
126
+ seatMonthly: seatAnnual === undefined
127
+ ? undefined
128
+ : period === 'annual'
129
+ ? Math.round(seatAnnual / 12)
130
+ : plan.monthlySeatPrice,
131
+ totalMonthly: totalAnnual === undefined
132
+ ? undefined
133
+ : period === 'annual'
134
+ ? Math.round(totalAnnual / 12)
135
+ : plan.monthlyPrice + (plan.monthlySeatPrice ?? 0) * (seats ?? 0),
136
+ totalAnnual,
137
+ storageGB: known ? plan.storageGB + (plan.storagePerSeatGB ?? 0) * (seats ?? 0) : undefined,
138
+ monthlyCredits: known
139
+ ? plan.monthlyCredits + (plan.creditsPerSeat ?? 0) * (seats ?? 0)
140
+ : undefined,
141
+ };
142
+ }
@@ -37,3 +37,4 @@ export { BOT_USERNAME_INVALID_MESSAGE, BOT_USERNAME_SUFFIX, NUMERIC_USERNAME_MES
37
37
  export { userNameCheck } from './userResponse.js';
38
38
  export { CLAIMANT_RELATIONSHIPS, CLOSED_CONTENT_CLAIM_STATES, CONTENT_CLAIM_COUNTER_NOTICE_LIMITS, CONTENT_CLAIM_ERROR_CODES, CONTENT_CLAIM_KINDS, CONTENT_CLAIM_LIMITS, CONTENT_CLAIM_REFERENCE_PATTERN, CONTENT_CLAIM_STATES, COUNTER_NOTICE_STATEMENT_VERSION, COUNTER_NOTICE_STATEMENTS, ERASURE_REQUEST_DEADLINE_DAYS, OPEN_CONTENT_CLAIM_STATES, isErasureRequest, isRightsClaim, } from './contentClaims.js';
39
39
  export { APP_ASSERTION_CHALLENGE_PURPOSES, APP_ASSERTION_ERROR_CODES, APP_ASSERTION_PLATFORMS, OXY_APP_ASSERTION_AUDIENCE, OXY_APP_ASSERTION_HEADER, OXY_APP_ASSERTION_TTL_SECONDS, OXY_APP_ASSERTION_TYPE, appAssertionChallengeResponseCheck, appAssertionResponseCheck, appAttestKeyResponseCheck, } from './appAssertions.js';
40
+ export * from '../products/one.js';
package/dist/esm/index.js CHANGED
@@ -191,11 +191,6 @@ export * from './accountAccess.js';
191
191
  export * from './notifications.js';
192
192
  export * from './email/messages.js';
193
193
  export * from './stickers.js';
194
- export { decisionEffortSchema, decisionQuestionSchema, decisionInputSchema, decisionRequestSchema, decisionAnswerSchema, decisionResultSchema, decisionSuccessSchema, decisionFailureSchema, decisionInputBudget, decisionFitsGateway, decisionAnswersMatch, } from './inference/decisions.js';
195
- export { SCOPED_EXECUTION_CONTRACT_VERSION, SCOPED_REQUEST_ENVELOPE_VERSION, scopedExecutionAudienceSchema, scopedExecutionSchema, canonicalScopedExecutionJson, } from './inference/scopedExecution.js';
196
- export { scopedInferenceRequestSchema } from './inference/request.js';
197
- 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.js';
198
- export { privateAutoInferenceRequestSchema } from './inference/request.js';
199
194
  export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access.js';
200
195
  export { meteredGenerationSchema } from './inference/economics.js';
201
196
  export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin, } from './capabilityBindings.js';
@@ -209,3 +204,4 @@ export { serviceTokenScopesSchema, serviceTokenOptionsSchema, } from './serviceT
209
204
  export * from './applicationRoles.js';
210
205
  export * from './contentClaims.js';
211
206
  export * from './appAssertions.js';
207
+ export * from './products/one.js';
@@ -1,4 +1,3 @@
1
- import { scopedExecutionAudienceSchema } from './scopedExecution.js';
2
1
  /**
3
2
  * The canonical model catalogue.
4
3
  *
@@ -484,8 +483,6 @@ export const modelDeploymentSchema = z
484
483
  /** See `version.ts`: exchanged with the data plane on its own. */
485
484
  schemaVersion: z.literal(2),
486
485
  deploymentId: deploymentIdSchema,
487
- /** Restrictive audience; never an eligibility approval. */
488
- scopedExecution: scopedExecutionAudienceSchema.optional(),
489
486
  provider: inferenceProviderSlugSchema,
490
487
  /** Always revision-pinned: a deployment serves specific weights. */
491
488
  modelReference: modelReferenceSchema,
@@ -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';