@oxy.so/contracts 4.25.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.
- package/dist/cjs/index.js +1 -35
- package/dist/cjs/inference/catalogue.js +2 -5
- package/dist/cjs/inference/request.js +5 -79
- package/dist/cjs/inference/version.js +1 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/inference/catalogue.js +0 -3
- package/dist/esm/inference/request.js +4 -78
- package/dist/esm/inference/version.js +1 -1
- package/dist/types/index.d.ts +0 -10
- package/dist/types/inference/catalogue.d.ts +4 -194
- package/dist/types/inference/economics.d.ts +2 -2
- package/dist/types/inference/realtime.d.ts +88 -88
- package/dist/types/inference/request.d.ts +28 -5055
- package/dist/types/inference/routingPolicy.d.ts +16 -16
- package/dist/types/inference/streamEvents.d.ts +8 -8
- package/dist/types/inference/usage.d.ts +4 -4
- package/dist/types/inference/version.d.ts +1 -1
- package/dist/types/safety.d.ts +10 -10
- package/package.json +1 -1
- package/dist/cjs/inference/decisions.js +0 -305
- package/dist/cjs/inference/privateAutoExecution.js +0 -153
- package/dist/cjs/inference/scopedExecution.js +0 -87
- package/dist/esm/inference/decisions.js +0 -299
- package/dist/esm/inference/privateAutoExecution.js +0 -149
- package/dist/esm/inference/scopedExecution.js +0 -83
- package/dist/types/inference/decisions.d.ts +0 -1853
- package/dist/types/inference/privateAutoExecution.d.ts +0 -694
- package/dist/types/inference/scopedExecution.d.ts +0 -202
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.
|
|
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; } });
|
|
@@ -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.
|
|
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
|
-
|
|
416
|
-
|
|
417
|
-
if (request.
|
|
418
|
-
|
|
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 = '
|
|
105
|
+
exports.INFERENCE_CONTRACT_VERSION = '4.0.0';
|
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';
|
|
@@ -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
|
-
|
|
413
|
-
|
|
414
|
-
if (request.
|
|
415
|
-
|
|
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 = '
|
|
102
|
+
export const INFERENCE_CONTRACT_VERSION = '4.0.0';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|