@oxyhq/contracts 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/identity.js +33 -1
  3. package/dist/cjs/index.js +20 -7
  4. package/dist/cjs/inference/aliaModelRelease.js +250 -0
  5. package/dist/cjs/inference/catalogue.js +1 -4
  6. package/dist/cjs/inference/identifiers.js +23 -3
  7. package/dist/cjs/inference/request.js +188 -5
  8. package/dist/cjs/inference/routingPolicy.js +81 -2
  9. package/dist/cjs/inference/streamEvents.js +27 -0
  10. package/dist/cjs/inference/usage.js +32 -1
  11. package/dist/cjs/inference/version.js +15 -2
  12. package/dist/esm/.tsbuildinfo +1 -1
  13. package/dist/esm/identity.js +32 -0
  14. package/dist/esm/index.js +8 -3
  15. package/dist/esm/inference/aliaModelRelease.js +247 -0
  16. package/dist/esm/inference/catalogue.js +2 -5
  17. package/dist/esm/inference/identifiers.js +22 -2
  18. package/dist/esm/inference/request.js +189 -6
  19. package/dist/esm/inference/routingPolicy.js +81 -2
  20. package/dist/esm/inference/streamEvents.js +27 -0
  21. package/dist/esm/inference/usage.js +32 -1
  22. package/dist/esm/inference/version.js +15 -2
  23. package/dist/types/.tsbuildinfo +1 -1
  24. package/dist/types/identity.d.ts +59 -1
  25. package/dist/types/index.d.ts +7 -5
  26. package/dist/types/inference/accountBilling.d.ts +26 -26
  27. package/dist/types/inference/aliaModelRelease.d.ts +597 -0
  28. package/dist/types/inference/catalogue.d.ts +6 -6
  29. package/dist/types/inference/entitlement.d.ts +4 -4
  30. package/dist/types/inference/identifiers.d.ts +20 -2
  31. package/dist/types/inference/money.d.ts +4 -4
  32. package/dist/types/inference/priceVersion.d.ts +14 -14
  33. package/dist/types/inference/providerConnection.d.ts +4 -4
  34. package/dist/types/inference/request.d.ts +291 -5
  35. package/dist/types/inference/routingPolicy.d.ts +109 -13
  36. package/dist/types/inference/streamEvents.d.ts +53 -26
  37. package/dist/types/inference/usage.d.ts +103 -79
  38. package/dist/types/inference/version.d.ts +15 -2
  39. package/dist/types/keyRecovery.d.ts +4 -4
  40. package/package.json +1 -1
@@ -39,7 +39,7 @@
39
39
  * `require()`).
40
40
  */
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.exportBundleSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = void 0;
42
+ exports.exportBundleSchema = exports.exportFinancialSectionSchema = exports.exportUsageReservationSchema = exports.exportLedgerEntrySchema = exports.exportUsageReceiptSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = void 0;
43
43
  const zod_1 = require("zod");
44
44
  // The option schemas are left UN-annotated so they keep their concrete
45
45
  // `ZodObject` type — `z.discriminatedUnion` requires object options and an
@@ -207,6 +207,37 @@ exports.exportAttestationSchema = zod_1.z.object({
207
207
  signature: zod_1.z.string(),
208
208
  signedAt: zod_1.z.number(),
209
209
  });
210
+ exports.exportUsageReceiptSchema = zod_1.z.object({
211
+ receiptId: zod_1.z.string(),
212
+ requestId: zod_1.z.string(),
213
+ settledAt: zod_1.z.string(),
214
+ billedAmount: zod_1.z.string(),
215
+ currency: zod_1.z.string(),
216
+ outcome: zod_1.z.string(),
217
+ resolvedModelReference: zod_1.z.string(),
218
+ servingProvider: zod_1.z.string(),
219
+ platformFeeOnly: zod_1.z.boolean(),
220
+ });
221
+ exports.exportLedgerEntrySchema = zod_1.z.object({
222
+ entryId: zod_1.z.string(),
223
+ kind: zod_1.z.string(),
224
+ currency: zod_1.z.string(),
225
+ createdAt: zod_1.z.string(),
226
+ });
227
+ exports.exportUsageReservationSchema = zod_1.z.object({
228
+ reservationId: zod_1.z.string(),
229
+ requestId: zod_1.z.string(),
230
+ status: zod_1.z.string(),
231
+ reservedAmount: zod_1.z.string(),
232
+ currency: zod_1.z.string(),
233
+ createdAt: zod_1.z.string(),
234
+ expiresAt: zod_1.z.string(),
235
+ });
236
+ exports.exportFinancialSectionSchema = zod_1.z.object({
237
+ receipts: zod_1.z.array(exports.exportUsageReceiptSchema),
238
+ ledgerEntries: zod_1.z.array(exports.exportLedgerEntrySchema),
239
+ reservations: zod_1.z.array(exports.exportUsageReservationSchema),
240
+ });
210
241
  exports.exportBundleSchema = zod_1.z.object({
211
242
  '$schema': zod_1.z.string(),
212
243
  exportedAt: zod_1.z.string(),
@@ -221,6 +252,7 @@ exports.exportBundleSchema = zod_1.z.object({
221
252
  following: zod_1.z.array(zod_1.z.string()),
222
253
  followers: zod_1.z.array(zod_1.z.string()),
223
254
  }),
255
+ financial: exports.exportFinancialSectionSchema,
224
256
  attestation: exports.exportAttestationSchema.nullable(),
225
257
  proof: exports.exportAttestationSchema.optional(),
226
258
  });
package/dist/cjs/index.js CHANGED
@@ -12,13 +12,14 @@
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = exports.oxyUserInvalidationEventSchema = exports.isPublishedOxyUserChangeReason = exports.OXY_PUBLISHED_USER_CHANGE_REASONS = exports.OXY_USER_CHANGE_REASONS = exports.OXY_USER_INVALIDATION_CHANNEL = exports.inboxEmailPushDataSchema = exports.INBOX_EMAIL_PUSH_TYPE = exports.INBOX_EMAIL_PUSH_CHANNEL = exports.IDENTITY_APPROVAL_PUSH_CHANNEL = exports.commonsDenyReasonSchema = exports.COMMONS_DENY_REASONS = exports.sessionStatusSchema = exports.publicApplicationSchema = exports.applicationTypeSchema = exports.safeParseContract = exports.resolveUserId = exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.themePreferenceSchema = exports.userRelationshipSchema = exports.userNameSchema = exports.createAccountRequestSchema = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.newlyAddedRetiredCategories = exports.MAX_ACCOUNT_CATEGORIES = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.accountCategoryIdSchema = exports.accountCategoriesSchema = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.isActAsEligibleKind = exports.isAccountKind = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
15
- exports.reputationBalanceBreakdownSchema = exports.reputationTransactionSchema = exports.reputationInfluenceContextSchema = exports.reputationDisputeStatusSchema = exports.reputationTargetEntityTypeSchema = exports.trustTierSchema = exports.reputationTransactionStatusSchema = exports.reputationCategorySchema = exports.REPUTATION_INFLUENCE_CONTEXTS = exports.REPUTATION_DISPUTE_STATUSES = exports.REPUTATION_TARGET_ENTITY_TYPES = exports.TRUST_TIERS = exports.REPUTATION_TRANSACTION_STATUSES = exports.REPUTATION_CATEGORIES = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = exports.personhoodBreakdownSchema = exports.personhoodVouchRecordSchema = exports.validationVoteResultSchema = exports.validationRequestSummarySchema = exports.validationOpenResultSchema = exports.validationOpenRequestSchema = exports.validationVerdictRecordSchema = exports.realLifeAttestationResultSchema = exports.realLifeAttestationRecordSchema = exports.signedPublicCardSchema = exports.publicCardSchema = exports.logPageResponseSchema = exports.chainHeadResponseSchema = exports.oxySignedRecordTypeSchema = exports.exportBundleSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = void 0;
16
- exports.reverseModerationEffectSchema = exports.finalizeModerationDecisionSchema = exports.moderationDecisionEventSchema = exports.moderationPolicyVersionsSchema = exports.moderationDecisionEventSubjectSchema = exports.moderationFindingSchema = exports.applicationModerationStandingSchema = exports.identityBindingStatusSchema = exports.identityBindingTypeSchema = exports.personhoodStatusSchema = exports.contributionTierSchema = exports.conductStandingSchema = exports.conductStrikeStatusSchema = exports.moderationEffectSkipReasonSchema = exports.moderationEffectStatusSchema = exports.moderationEffectTypeSchema = exports.moderationDecisionStatusSchema = exports.moderationAttributionSchema = exports.moderationFindingScopeSchema = exports.moderationSeveritySchema = exports.APPLICATION_MODERATION_STANDINGS = exports.IDENTITY_BINDING_STATUSES = exports.IDENTITY_BINDING_TYPES = exports.PERSONHOOD_STATUSES = exports.CONTRIBUTION_TIERS = exports.CONDUCT_STANDINGS = exports.CONDUCT_STRIKE_STATUSES = exports.MODERATION_EFFECT_SKIP_REASONS = exports.MODERATION_EFFECT_STATUSES = exports.MODERATION_EFFECT_TYPES = exports.MODERATION_DECISION_STATUSES = exports.MODERATION_ATTRIBUTIONS = exports.MODERATION_FINDING_SCOPES = exports.MODERATION_SEVERITIES = exports.isFullReputationBalance = exports.reverseReputationTransactionSchema = exports.upsertReputationRuleSchema = exports.resolveReputationDisputeSchema = exports.createReputationDisputeSchema = exports.awardReputationSchema = exports.reverseReputationTransactionResultSchema = exports.reputationInfluenceResultSchema = exports.reputationLeaderboardEntrySchema = exports.reputationLeaderboardUserSchema = exports.reputationRuleSchema = exports.reputationDisputeSchema = exports.reputationBalanceSchema = exports.reputationBalanceSummarySchema = exports.reputationReliabilitySchema = exports.reputationInfluenceSchema = void 0;
17
- exports.hubActivateRequestSchema = exports.hubClaimRequestSchema = exports.hubSessionSchema = exports.browserHubRevokeResponseSchema = exports.browserHubErrorSchema = exports.browserHubResolveResponseSchema = exports.browserHubHandleResponseSchema = exports.browserHubHandleRequestSchema = exports.browserHubHandleSchema = exports.BROWSER_HUB_HANDLE_TTL_MS = exports.BROWSER_HUB_COOKIE_ATTRIBUTES = exports.BROWSER_HUB_COOKIE_NAME = exports.oauthAuthorizeCodeResponseSchema = exports.oauthConsentDecisionSchema = exports.deviceDirectorySyncSchema = exports.deviceActivateResponseSchema = exports.deviceActivateRequestSchema = exports.deviceDirectorySchema = exports.devicePrincipalSchema = exports.deviceAccountContextSchema = exports.deviceDirectoryProfileSchema = exports.deviceContextRelationshipSchema = exports.sessionAccountsChangedEventSchema = exports.sessionAccountsChangedReasonSchema = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceBackgroundTokenResponseSchema = exports.deviceBackgroundTokenRequestSchema = exports.deviceBackgroundCredentialResponseSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.applicationModerationTrustSchema = exports.reputationContextualInfluenceSchema = exports.reputationReviewingSchema = exports.reputationReportingSchema = exports.reputationConductSchema = exports.reputationContributionSchema = exports.reputationPersonhoodSchema = exports.identityBindingSchema = exports.registerIdentityBindingSchema = exports.reverseModerationEffectResultSchema = exports.applyModerationDecisionResultSchema = exports.moderationEffectSchema = void 0;
18
- exports.transparencyCheckpointSchema = exports.transparencyAnchorSchema = exports.transparencyCheckpointSignatureSchema = exports.deviceTransferDenyResponseSchema = exports.deviceTransferApproveResponseSchema = exports.deviceTransferApproveRequestSchema = exports.deviceTransferInfoResponseSchema = exports.deviceTransferInitResponseSchema = exports.deviceTransferInitRequestSchema = exports.devicePairingStatusSchema = exports.webauthnLoginVerifyRequestSchema = exports.webauthnRegisterVerifyRequestSchema = exports.webauthnLoginOptionsRequestSchema = exports.webauthnRegisterOptionsRequestSchema = exports.updateRolloutPatchSchema = exports.promoteRequestSchema = exports.rollbackToEmbeddedRequestSchema = exports.rollbackRequestSchema = exports.updateListResponseSchema = exports.channelListResponseSchema = exports.channelSchema = exports.rollbackToEmbeddedEntrySchema = exports.createUpdateResponseSchema = exports.updateSchema = exports.createUpdateRequestSchema = exports.updateAssetRefSchema = exports.assetCompleteResponseSchema = exports.assetCompleteResultItemSchema = exports.assetCompleteRequestSchema = exports.assetInitResponseSchema = exports.assetUploadTicketSchema = exports.assetInitRequestSchema = exports.assetInitItemSchema = exports.rolloutPercentSchema = exports.runtimeVersionSchema = exports.channelNameSchema = exports.sha256HexSchema = exports.updateAssetStatusSchema = exports.updateStatusSchema = exports.updatePlatformSchema = exports.backupStatusResponseSchema = exports.backupUploadRequestSchema = exports.encryptedBackupEnvelopeSchema = exports.backupLookupIdSchema = exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = exports.loginResultSchema = exports.hubAuthorizeResultSchema = exports.hubAuthorizeRequestSchema = void 0;
19
- exports.inferenceModalitySchema = exports.priceSnapshotSchema = exports.priceVersionSchema = exports.priceVersionStatusSchema = exports.inferenceErrorSchema = exports.providerErrorPassthroughSchema = exports.safeErrorTextSchema = exports.upstreamErrorCategorySchema = exports.inferenceErrorCodeSchema = exports.NON_RETRYABLE_INFERENCE_ERROR_CODES = exports.INFERENCE_ERROR_CODES = exports.inferenceAttributionSchema = exports.authenticatedPrincipalSchema = exports.billingPrincipalSchema = exports.inferenceScopeSchema = exports.INFERENCE_SCOPES = exports.unitPriceSchema = exports.usageQuantitySchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = exports.RESERVED_ALIA_PUBLISHER = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = exports.oxyApplicationIdSchema = exports.delegatedUserIdSchema = exports.oxyAccountIdSchema = exports.INFERENCE_CONTRACT_VERSION = exports.transparencyCheckpointListSchema = exports.transparencyInclusionProofSchema = void 0;
20
- exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = 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 = void 0;
21
- exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = 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.providerSecretReferenceSchema = exports.providerConnectionScopeSchema = exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = void 0;
15
+ exports.reputationTargetEntityTypeSchema = exports.trustTierSchema = exports.reputationTransactionStatusSchema = exports.reputationCategorySchema = exports.REPUTATION_INFLUENCE_CONTEXTS = exports.REPUTATION_DISPUTE_STATUSES = exports.REPUTATION_TARGET_ENTITY_TYPES = exports.TRUST_TIERS = exports.REPUTATION_TRANSACTION_STATUSES = exports.REPUTATION_CATEGORIES = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = exports.personhoodBreakdownSchema = exports.personhoodVouchRecordSchema = exports.validationVoteResultSchema = exports.validationRequestSummarySchema = exports.validationOpenResultSchema = exports.validationOpenRequestSchema = exports.validationVerdictRecordSchema = exports.realLifeAttestationResultSchema = exports.realLifeAttestationRecordSchema = exports.signedPublicCardSchema = exports.publicCardSchema = exports.logPageResponseSchema = exports.chainHeadResponseSchema = exports.oxySignedRecordTypeSchema = exports.exportBundleSchema = exports.exportFinancialSectionSchema = exports.exportUsageReservationSchema = exports.exportLedgerEntrySchema = exports.exportUsageReceiptSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = void 0;
16
+ exports.moderationDecisionEventSubjectSchema = exports.moderationFindingSchema = exports.applicationModerationStandingSchema = exports.identityBindingStatusSchema = exports.identityBindingTypeSchema = exports.personhoodStatusSchema = exports.contributionTierSchema = exports.conductStandingSchema = exports.conductStrikeStatusSchema = exports.moderationEffectSkipReasonSchema = exports.moderationEffectStatusSchema = exports.moderationEffectTypeSchema = exports.moderationDecisionStatusSchema = exports.moderationAttributionSchema = exports.moderationFindingScopeSchema = exports.moderationSeveritySchema = exports.APPLICATION_MODERATION_STANDINGS = exports.IDENTITY_BINDING_STATUSES = exports.IDENTITY_BINDING_TYPES = exports.PERSONHOOD_STATUSES = exports.CONTRIBUTION_TIERS = exports.CONDUCT_STANDINGS = exports.CONDUCT_STRIKE_STATUSES = exports.MODERATION_EFFECT_SKIP_REASONS = exports.MODERATION_EFFECT_STATUSES = exports.MODERATION_EFFECT_TYPES = exports.MODERATION_DECISION_STATUSES = exports.MODERATION_ATTRIBUTIONS = exports.MODERATION_FINDING_SCOPES = exports.MODERATION_SEVERITIES = exports.isFullReputationBalance = exports.reverseReputationTransactionSchema = exports.upsertReputationRuleSchema = exports.resolveReputationDisputeSchema = exports.createReputationDisputeSchema = exports.awardReputationSchema = exports.reverseReputationTransactionResultSchema = exports.reputationInfluenceResultSchema = exports.reputationLeaderboardEntrySchema = exports.reputationLeaderboardUserSchema = exports.reputationRuleSchema = exports.reputationDisputeSchema = exports.reputationBalanceSchema = exports.reputationBalanceSummarySchema = exports.reputationReliabilitySchema = exports.reputationInfluenceSchema = exports.reputationBalanceBreakdownSchema = exports.reputationTransactionSchema = exports.reputationInfluenceContextSchema = exports.reputationDisputeStatusSchema = void 0;
17
+ exports.browserHubErrorSchema = exports.browserHubResolveResponseSchema = exports.browserHubHandleResponseSchema = exports.browserHubHandleRequestSchema = exports.browserHubHandleSchema = exports.BROWSER_HUB_HANDLE_TTL_MS = exports.BROWSER_HUB_COOKIE_ATTRIBUTES = exports.BROWSER_HUB_COOKIE_NAME = exports.oauthAuthorizeCodeResponseSchema = exports.oauthConsentDecisionSchema = exports.deviceDirectorySyncSchema = exports.deviceActivateResponseSchema = exports.deviceActivateRequestSchema = exports.deviceDirectorySchema = exports.devicePrincipalSchema = exports.deviceAccountContextSchema = exports.deviceDirectoryProfileSchema = exports.deviceContextRelationshipSchema = exports.sessionAccountsChangedEventSchema = exports.sessionAccountsChangedReasonSchema = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceBackgroundTokenResponseSchema = exports.deviceBackgroundTokenRequestSchema = exports.deviceBackgroundCredentialResponseSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.applicationModerationTrustSchema = exports.reputationContextualInfluenceSchema = exports.reputationReviewingSchema = exports.reputationReportingSchema = exports.reputationConductSchema = exports.reputationContributionSchema = exports.reputationPersonhoodSchema = exports.identityBindingSchema = exports.registerIdentityBindingSchema = exports.reverseModerationEffectResultSchema = exports.applyModerationDecisionResultSchema = exports.moderationEffectSchema = exports.reverseModerationEffectSchema = exports.finalizeModerationDecisionSchema = exports.moderationDecisionEventSchema = exports.moderationPolicyVersionsSchema = void 0;
18
+ exports.deviceTransferApproveResponseSchema = exports.deviceTransferApproveRequestSchema = exports.deviceTransferInfoResponseSchema = exports.deviceTransferInitResponseSchema = exports.deviceTransferInitRequestSchema = exports.devicePairingStatusSchema = exports.webauthnLoginVerifyRequestSchema = exports.webauthnRegisterVerifyRequestSchema = exports.webauthnLoginOptionsRequestSchema = exports.webauthnRegisterOptionsRequestSchema = exports.updateRolloutPatchSchema = exports.promoteRequestSchema = exports.rollbackToEmbeddedRequestSchema = exports.rollbackRequestSchema = exports.updateListResponseSchema = exports.channelListResponseSchema = exports.channelSchema = exports.rollbackToEmbeddedEntrySchema = exports.createUpdateResponseSchema = exports.updateSchema = exports.createUpdateRequestSchema = exports.updateAssetRefSchema = exports.assetCompleteResponseSchema = exports.assetCompleteResultItemSchema = exports.assetCompleteRequestSchema = exports.assetInitResponseSchema = exports.assetUploadTicketSchema = exports.assetInitRequestSchema = exports.assetInitItemSchema = exports.rolloutPercentSchema = exports.runtimeVersionSchema = exports.channelNameSchema = exports.sha256HexSchema = exports.updateAssetStatusSchema = exports.updateStatusSchema = exports.updatePlatformSchema = exports.backupStatusResponseSchema = exports.backupUploadRequestSchema = exports.encryptedBackupEnvelopeSchema = exports.backupLookupIdSchema = exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = exports.loginResultSchema = exports.hubAuthorizeResultSchema = exports.hubAuthorizeRequestSchema = exports.hubActivateRequestSchema = exports.hubClaimRequestSchema = exports.hubSessionSchema = exports.browserHubRevokeResponseSchema = void 0;
19
+ exports.providerErrorPassthroughSchema = exports.safeErrorTextSchema = exports.upstreamErrorCategorySchema = exports.inferenceErrorCodeSchema = exports.NON_RETRYABLE_INFERENCE_ERROR_CODES = exports.INFERENCE_ERROR_CODES = exports.inferenceAttributionSchema = exports.authenticatedPrincipalSchema = exports.billingPrincipalSchema = exports.inferenceScopeSchema = exports.INFERENCE_SCOPES = exports.unitPriceSchema = exports.usageQuantitySchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = exports.RESERVED_ALIA_PUBLISHER = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.sha256DigestSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = exports.oxyApplicationIdSchema = exports.delegatedUserIdSchema = exports.oxyAccountIdSchema = exports.INFERENCE_CONTRACT_VERSION = exports.transparencyCheckpointListSchema = exports.transparencyInclusionProofSchema = exports.transparencyCheckpointSchema = exports.transparencyAnchorSchema = exports.transparencyCheckpointSignatureSchema = exports.deviceTransferDenyResponseSchema = void 0;
20
+ exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = exports.aliaModelReleaseManifestSchema = exports.aliaReleaseSignatureSchema = exports.aliaReleaseArtifactSchema = exports.authorizedRouteSchema = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = 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.inferenceModalitySchema = exports.priceSnapshotSchema = exports.priceVersionSchema = exports.priceVersionStatusSchema = exports.inferenceErrorSchema = void 0;
21
+ 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.providerSecretReferenceSchema = exports.providerConnectionScopeSchema = exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = void 0;
22
+ exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = void 0;
22
23
  var accountGraph_1 = require("./accountGraph");
23
24
  Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
24
25
  Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
@@ -99,6 +100,10 @@ Object.defineProperty(exports, "domainVerificationInstructionsSchema", { enumera
99
100
  Object.defineProperty(exports, "authMethodEntrySchema", { enumerable: true, get: function () { return identity_1.authMethodEntrySchema; } });
100
101
  Object.defineProperty(exports, "authMethodsResponseSchema", { enumerable: true, get: function () { return identity_1.authMethodsResponseSchema; } });
101
102
  Object.defineProperty(exports, "exportAttestationSchema", { enumerable: true, get: function () { return identity_1.exportAttestationSchema; } });
103
+ Object.defineProperty(exports, "exportUsageReceiptSchema", { enumerable: true, get: function () { return identity_1.exportUsageReceiptSchema; } });
104
+ Object.defineProperty(exports, "exportLedgerEntrySchema", { enumerable: true, get: function () { return identity_1.exportLedgerEntrySchema; } });
105
+ Object.defineProperty(exports, "exportUsageReservationSchema", { enumerable: true, get: function () { return identity_1.exportUsageReservationSchema; } });
106
+ Object.defineProperty(exports, "exportFinancialSectionSchema", { enumerable: true, get: function () { return identity_1.exportFinancialSectionSchema; } });
102
107
  Object.defineProperty(exports, "exportBundleSchema", { enumerable: true, get: function () { return identity_1.exportBundleSchema; } });
103
108
  var oxyRecordTypes_1 = require("./oxyRecordTypes");
104
109
  // Schemas
@@ -353,6 +358,7 @@ Object.defineProperty(exports, "inferenceEnvironmentSchema", { enumerable: true,
353
358
  Object.defineProperty(exports, "inferenceTimestampSchema", { enumerable: true, get: function () { return identifiers_1.inferenceTimestampSchema; } });
354
359
  Object.defineProperty(exports, "inferenceDateSchema", { enumerable: true, get: function () { return identifiers_1.inferenceDateSchema; } });
355
360
  Object.defineProperty(exports, "inferenceHttpsUrlSchema", { enumerable: true, get: function () { return identifiers_1.inferenceHttpsUrlSchema; } });
361
+ Object.defineProperty(exports, "sha256DigestSchema", { enumerable: true, get: function () { return identifiers_1.sha256DigestSchema; } });
356
362
  // Catalogue references
357
363
  Object.defineProperty(exports, "publisherSlugSchema", { enumerable: true, get: function () { return identifiers_1.publisherSlugSchema; } });
358
364
  Object.defineProperty(exports, "modelSlugSchema", { enumerable: true, get: function () { return identifiers_1.modelSlugSchema; } });
@@ -427,6 +433,13 @@ Object.defineProperty(exports, "routingPolicyScopeSchema", { enumerable: true, g
427
433
  Object.defineProperty(exports, "routingFallbackPolicySchema", { enumerable: true, get: function () { return routingPolicy_1.routingFallbackPolicySchema; } });
428
434
  Object.defineProperty(exports, "routingPolicySchema", { enumerable: true, get: function () { return routingPolicy_1.routingPolicySchema; } });
429
435
  Object.defineProperty(exports, "routingPolicyReferenceSchema", { enumerable: true, get: function () { return routingPolicy_1.routingPolicyReferenceSchema; } });
436
+ // What the data plane actually receives: the routes the policy authorized.
437
+ Object.defineProperty(exports, "authorizedRouteSchema", { enumerable: true, get: function () { return routingPolicy_1.authorizedRouteSchema; } });
438
+ var aliaModelRelease_1 = require("./inference/aliaModelRelease");
439
+ // The signed Alia model release manifest (ingestion contract; no endpoint).
440
+ Object.defineProperty(exports, "aliaReleaseArtifactSchema", { enumerable: true, get: function () { return aliaModelRelease_1.aliaReleaseArtifactSchema; } });
441
+ Object.defineProperty(exports, "aliaReleaseSignatureSchema", { enumerable: true, get: function () { return aliaModelRelease_1.aliaReleaseSignatureSchema; } });
442
+ Object.defineProperty(exports, "aliaModelReleaseManifestSchema", { enumerable: true, get: function () { return aliaModelRelease_1.aliaModelReleaseManifestSchema; } });
430
443
  var request_1 = require("./inference/request");
431
444
  // The normalized Oxy→data-plane request envelope.
432
445
  Object.defineProperty(exports, "inferenceContentSourceSchema", { enumerable: true, get: function () { return request_1.inferenceContentSourceSchema; } });
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ /**
3
+ * The signed Alia model release manifest — the ingestion contract for a
4
+ * first-party model release.
5
+ *
6
+ * The catalogue already STORES everything such a manifest carries: the model
7
+ * card, the licence block, the provenance and base model, the evaluation table,
8
+ * the safety metadata, and an artifact digest with a `sha256:<64 hex>` CHECK.
9
+ * What did not exist was the manifest itself — a single document Alia SIGNS,
10
+ * asserting all of it at once — and that is the gap this shape closes. Nothing
11
+ * here re-declares a catalogue field; the manifest COMPOSES the published shapes
12
+ * so a manifest and the catalogue row it produces cannot describe a release
13
+ * differently.
14
+ *
15
+ * ## The manifest tightens the revision it carries
16
+ *
17
+ * `modelRevisionSchema` makes `modelCardUrl`, `artifactDigest`, `evaluations`
18
+ * and `safety` optional, because a third-party route legitimately has none of
19
+ * them — Oxy did not train those weights and cannot publish a card for them. A
20
+ * FIRST-PARTY release has no such excuse: the documentation trail is the reason
21
+ * a release manifest exists at all, and a model Alia ships without one is not a
22
+ * release, it is a deployment. So the refinement below requires all four,
23
+ * without changing the catalogue shape that a third-party entry still parses
24
+ * through.
25
+ *
26
+ * ## `.strict()` at the top level, and here that is forced rather than chosen
27
+ *
28
+ * The shapes exchanged with the data plane tolerate an unknown field, because
29
+ * refusing a producer one minor version ahead is a worse failure than ignoring
30
+ * its addition (`version.ts`). A SIGNED document inverts that: the signature is
31
+ * over the canonical bytes of the manifest, so a field silently stripped at this
32
+ * parse is a field missing from the bytes Oxy re-canonicalizes, and verification
33
+ * fails. A tolerant parse would therefore report "the signature is invalid" for
34
+ * what is really "this build does not understand this manifest" — the wrong
35
+ * diagnosis of the right problem. Strict says the true thing, and the cost is
36
+ * bounded: ingestion is a release-time operation an operator retries once Oxy
37
+ * takes the newer contract, not a served request that becomes unsettleable.
38
+ *
39
+ * ## What is deliberately NOT here
40
+ *
41
+ * **No HTTP write path.** The catalogue's emptiness is currently a safety
42
+ * property — `scripts/seed-inference-catalogue.ts` refuses to invent a licence
43
+ * or a retention flag because "a plausible invented value in a catalogue is
44
+ * worse than an absent one" — and a staff write path into it with nothing to
45
+ * ingest is an unexercised hazard. The schema lands; the endpoint waits for a
46
+ * real manifest to ingest.
47
+ *
48
+ * **No `payloadDigest` field.** The signature is over the canonical
49
+ * serialization of this manifest with `signatures` removed, and a verifier
50
+ * recomputes it. Storing the digest beside the document it digests would be a
51
+ * second source of truth for one fact, and a verifier that compared the
52
+ * signature against the DECLARED digest rather than the recomputed one would
53
+ * verify nothing at all.
54
+ *
55
+ * **No verification RESULT.** Whether a signature checked out is Oxy's finding
56
+ * about the document, not a claim the document makes about itself; a `verified`
57
+ * field inside a signed manifest is the signer asserting its own signature.
58
+ *
59
+ * ## The open owner decision this shape does not take
60
+ *
61
+ * **What signs, and what verifies, is not decided.** Oxy holds no Alia signing
62
+ * key, and whether to resolve `keyId` through the existing attestation machinery
63
+ * (`services/oxyVerificationResolver.ts`, the civic attestation code) or to
64
+ * introduce a dedicated Alia release key is a real choice with different
65
+ * custody, rotation and revocation consequences. So `keyId` is an OPAQUE
66
+ * identifier and this file names no registry that resolves it: either answer
67
+ * fits, and neither is presupposed. Until it is answered a manifest can be
68
+ * parsed and cannot be verified, which is the second reason no endpoint ships.
69
+ *
70
+ * Decided in: docs/adr/0008-catalogue-concept-separation.md,
71
+ * docs/adr/0017-authorized-routes-in-the-envelope.md, issue #972 §12.
72
+ */
73
+ Object.defineProperty(exports, "__esModule", { value: true });
74
+ exports.aliaModelReleaseManifestSchema = exports.aliaReleaseSignatureSchema = exports.aliaReleaseArtifactSchema = void 0;
75
+ const zod_1 = require("zod");
76
+ const catalogue_1 = require("./catalogue");
77
+ const identifiers_1 = require("./identifiers");
78
+ /**
79
+ * One artifact of a release, by path and digest.
80
+ *
81
+ * `sizeBytes` is required beside the digest so a verifier can refuse a stream
82
+ * that is the wrong length before reading it to the end, rather than only after.
83
+ */
84
+ exports.aliaReleaseArtifactSchema = zod_1.z
85
+ .object({
86
+ /** Path within the release, e.g. `model-00001-of-00004.safetensors`. */
87
+ path: zod_1.z.string().min(1).max(512),
88
+ digest: identifiers_1.sha256DigestSchema,
89
+ sizeBytes: zod_1.z.number().int().positive().safe(),
90
+ mediaType: zod_1.z.string().min(1).max(255).optional(),
91
+ })
92
+ .strict();
93
+ /**
94
+ * One detached signature over the manifest.
95
+ *
96
+ * `algorithm` is a CLOSED enum with one member, and both halves of that are
97
+ * deliberate. Closed, because a verifier that trusts a document's own algorithm
98
+ * name accepts whatever that document nominates, `none` included. One member,
99
+ * because Ed25519 is the scheme ADR 0012 already chose for asymmetric
100
+ * verification on this platform, and naming a scheme nothing here can check
101
+ * would be advertising a capability that does not exist. A second member lands
102
+ * when a verifier for it does — which is a closed enum gaining a member, and
103
+ * therefore a MINOR contract-set change the handshake surfaces (`version.ts`).
104
+ *
105
+ * `keyId` is opaque on purpose: see the header. It identifies the public key
106
+ * without saying what resolves it.
107
+ *
108
+ * The signature covers the canonical serialization (RFC 8785 JCS) of the
109
+ * manifest with `signatures` removed. The canonicalization is NAMED rather than
110
+ * left implicit because a digest over "the manifest" is not verifiable by two
111
+ * implementations that serialize JSON differently; naming it is a mechanical
112
+ * necessity and is independent of the open question of which key signs.
113
+ */
114
+ exports.aliaReleaseSignatureSchema = zod_1.z
115
+ .object({
116
+ algorithm: zod_1.z.enum(['ed25519']),
117
+ canonicalization: zod_1.z.enum(['jcs']),
118
+ /** Opaque identifier of the public key. Resolving it is undecided. */
119
+ keyId: zod_1.z.string().min(1).max(256),
120
+ /**
121
+ * Unpadded base64url. Exactly 86 characters, which is a 64-byte Ed25519
122
+ * signature — the one algorithm above. A second algorithm moves this length
123
+ * into a refinement keyed on `algorithm`.
124
+ */
125
+ signature: zod_1.z
126
+ .string()
127
+ .regex(/^[A-Za-z0-9_-]{86}$/, 'signature must be a 64-byte ed25519 signature in unpadded base64url'),
128
+ signedAt: identifiers_1.inferenceTimestampSchema,
129
+ })
130
+ .strict();
131
+ /**
132
+ * A signed release of an `alia/*` model revision.
133
+ *
134
+ * `signatures` is a LIST rather than one signature, because "what signs" is
135
+ * undecided: a single field would presuppose one signer, while a list lets an
136
+ * Alia release key and an existing attestation co-sign the same document without
137
+ * either being retrofitted later.
138
+ */
139
+ exports.aliaModelReleaseManifestSchema = zod_1.z
140
+ .object({
141
+ /** See `version.ts`: an ingestion payload is a whole message on the wire. */
142
+ schemaVersion: zod_1.z.literal(1),
143
+ /** The release's own identity, so ingestion is idempotent on it. */
144
+ releaseId: zod_1.z.string().min(1).max(128),
145
+ issuedAt: identifiers_1.inferenceTimestampSchema,
146
+ /**
147
+ * The revision being released. Carries its OWN `schemaVersion`, like
148
+ * `billingProfileSchema` inside `accountBillingStateSchema`: the manifest's
149
+ * version governs the manifest and the revision's governs the revision,
150
+ * which is two versions of two things rather than two versions of one.
151
+ */
152
+ revision: catalogue_1.modelRevisionSchema,
153
+ /** On the MODEL rather than the revision in the catalogue, so carried here. */
154
+ provenance: catalogue_1.modelProvenanceSchema,
155
+ license: catalogue_1.modelLicenseSchema,
156
+ artifacts: zod_1.z.array(exports.aliaReleaseArtifactSchema).min(1),
157
+ signatures: zod_1.z.array(exports.aliaReleaseSignatureSchema).min(1),
158
+ })
159
+ .strict()
160
+ .superRefine((manifest, ctx) => {
161
+ // The same rule `catalogueModelSchema` enforces on a model, applied to the
162
+ // carrier that creates one: `alia/*` names models Alia actually owns or
163
+ // derived, and a manifest is the document that would launder somebody else's
164
+ // weights into the namespace.
165
+ const publisher = manifest.revision.modelId.slice(0, manifest.revision.modelId.indexOf('/'));
166
+ if (publisher !== identifiers_1.RESERVED_ALIA_PUBLISHER) {
167
+ ctx.addIssue({
168
+ code: zod_1.z.ZodIssueCode.custom,
169
+ path: ['revision', 'modelId'],
170
+ message: `an Alia release manifest releases a ${identifiers_1.RESERVED_ALIA_PUBLISHER}/* model`,
171
+ });
172
+ }
173
+ if (manifest.provenance.releaseKind !== 'first_party_original' &&
174
+ manifest.provenance.releaseKind !== 'first_party_derived') {
175
+ ctx.addIssue({
176
+ code: zod_1.z.ZodIssueCode.custom,
177
+ path: ['provenance', 'releaseKind'],
178
+ message: 'an Alia release manifest describes a first-party release',
179
+ });
180
+ }
181
+ // A derived model's base is the licence-attribution trail. Recording the
182
+ // derivation without naming what it derives from loses exactly the fact
183
+ // attribution needs.
184
+ if (manifest.provenance.releaseKind === 'first_party_derived' &&
185
+ manifest.provenance.baseModelId === undefined) {
186
+ ctx.addIssue({
187
+ code: zod_1.z.ZodIssueCode.custom,
188
+ path: ['provenance', 'baseModelId'],
189
+ message: 'a derived release names the model it derives from',
190
+ });
191
+ }
192
+ // The four fields a third-party catalogue entry may omit and a first-party
193
+ // release may not. See the header.
194
+ if (manifest.revision.modelCardUrl === undefined) {
195
+ ctx.addIssue({
196
+ code: zod_1.z.ZodIssueCode.custom,
197
+ path: ['revision', 'modelCardUrl'],
198
+ message: 'a first-party release publishes a model card',
199
+ });
200
+ }
201
+ if (manifest.revision.safety === undefined) {
202
+ ctx.addIssue({
203
+ code: zod_1.z.ZodIssueCode.custom,
204
+ path: ['revision', 'safety'],
205
+ message: 'a first-party release publishes its safety metadata',
206
+ });
207
+ }
208
+ if (manifest.revision.evaluations.length === 0) {
209
+ ctx.addIssue({
210
+ code: zod_1.z.ZodIssueCode.custom,
211
+ path: ['revision', 'evaluations'],
212
+ message: 'a first-party release publishes at least one evaluation result',
213
+ });
214
+ }
215
+ // The digest the catalogue will serve has to be one of the digests this
216
+ // manifest signed. Otherwise the signature covers a set of artifacts that
217
+ // does not include the weights anybody runs.
218
+ if (manifest.revision.artifactDigest === undefined) {
219
+ ctx.addIssue({
220
+ code: zod_1.z.ZodIssueCode.custom,
221
+ path: ['revision', 'artifactDigest'],
222
+ message: 'a first-party release names the digest of the artifact it serves',
223
+ });
224
+ }
225
+ else if (!manifest.artifacts.some((artifact) => artifact.digest === manifest.revision.artifactDigest)) {
226
+ ctx.addIssue({
227
+ code: zod_1.z.ZodIssueCode.custom,
228
+ path: ['revision', 'artifactDigest'],
229
+ message: 'the served artifact digest must appear among the signed artifacts',
230
+ });
231
+ }
232
+ const paths = manifest.artifacts.map((artifact) => artifact.path);
233
+ if (new Set(paths).size !== paths.length) {
234
+ ctx.addIssue({
235
+ code: zod_1.z.ZodIssueCode.custom,
236
+ path: ['artifacts'],
237
+ message: 'each artifact path appears once in a release',
238
+ });
239
+ }
240
+ // Two signatures from one key are one signature written twice, and a
241
+ // duplicate would make a "two independent signers" check pass on one signer.
242
+ const keyIds = manifest.signatures.map((signature) => signature.keyId);
243
+ if (new Set(keyIds).size !== keyIds.length) {
244
+ ctx.addIssue({
245
+ code: zod_1.z.ZodIssueCode.custom,
246
+ path: ['signatures'],
247
+ message: 'each signing key signs a manifest once',
248
+ });
249
+ }
250
+ });
@@ -282,10 +282,7 @@ exports.modelRevisionSchema = zod_1.z
282
282
  releasedAt: identifiers_1.inferenceTimestampSchema,
283
283
  retiredAt: identifiers_1.inferenceTimestampSchema.optional(),
284
284
  /** Digest of the served artifact, where Oxy hosts the weights itself. */
285
- artifactDigest: zod_1.z
286
- .string()
287
- .regex(/^sha256:[a-f0-9]{64}$/, 'artifact digest must be sha256:<64 lowercase hex>')
288
- .optional(),
285
+ artifactDigest: identifiers_1.sha256DigestSchema.optional(),
289
286
  modelCardUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
290
287
  evaluations: zod_1.z.array(exports.modelEvaluationResultSchema).default([]),
291
288
  safety: exports.modelSafetyMetadataSchema.optional(),
@@ -19,7 +19,7 @@
19
19
  * Decided in: docs/adr/0007-canonical-request-attribution.md, docs/adr/0008-catalogue-concept-separation.md.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.RESERVED_ALIA_PUBLISHER = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = exports.oxyApplicationIdSchema = exports.delegatedUserIdSchema = exports.oxyAccountIdSchema = void 0;
22
+ exports.RESERVED_ALIA_PUBLISHER = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.sha256DigestSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = exports.oxyApplicationIdSchema = exports.delegatedUserIdSchema = exports.oxyAccountIdSchema = void 0;
23
23
  const zod_1 = require("zod");
24
24
  /* -------------------------------------------------------------------------- */
25
25
  /* Principal identifiers */
@@ -62,8 +62,16 @@ exports.oxyCredentialIdSchema = zod_1.z.string().min(1).max(64);
62
62
  * traceable as one that was served (ADR 0007, and step 1 of ADR 0010's edge
63
63
  * order). It is required on the inbound envelope, which is what makes the data
64
64
  * plane a consumer of this id rather than its source: the data plane echoes it
65
- * on every stream event, on the usage report and on anything it can be asked
66
- * about later.
65
+ * on every stream event, on the usage report, in its response header and on
66
+ * anything it can be asked about later. It never mints one for a request it
67
+ * received.
68
+ *
69
+ * The one case that is NOT an exception to that: an envelope the data plane
70
+ * cannot read or authenticate carries no id to echo, so its rejection is
71
+ * labelled with an id of the data plane's own — visibly local, and never
72
+ * correlated with an Oxy request, because there is no Oxy request it belongs to.
73
+ * Saying so is what stops "consumer, not source" from being read as forbidding
74
+ * the only id such a rejection could have.
67
75
  *
68
76
  * Correlates the Oxy edge, the data plane, the financial ledger and the
69
77
  * customer-visible receipt, so it appears on every stream event and every
@@ -109,6 +117,18 @@ exports.inferenceHttpsUrlSchema = zod_1.z
109
117
  .string()
110
118
  .max(2048)
111
119
  .regex(/^https:\/\/[^\s]+$/, 'must be an absolute https URL');
120
+ /**
121
+ * A content digest, `sha256:<64 lowercase hex>`.
122
+ *
123
+ * ONE spelling, because a digest is compared for equality and nothing else: an
124
+ * uppercase or unprefixed variant of the same hash is a different string, so two
125
+ * records describing the same bytes would not match. Lowercase hex with the
126
+ * algorithm prefix is what the `inference_model_revisions` CHECK stores and what
127
+ * every artifact registry emits.
128
+ */
129
+ exports.sha256DigestSchema = zod_1.z
130
+ .string()
131
+ .regex(/^sha256:[a-f0-9]{64}$/, 'digest must be sha256:<64 lowercase hex>');
112
132
  /* -------------------------------------------------------------------------- */
113
133
  /* Catalogue references */
114
134
  /* -------------------------------------------------------------------------- */