@oxyhq/contracts 0.29.0 → 0.31.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 (51) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountGraph.js +41 -0
  3. package/dist/cjs/identity.js +33 -1
  4. package/dist/cjs/index.js +35 -7
  5. package/dist/cjs/inference/aliaModelRelease.js +262 -0
  6. package/dist/cjs/inference/catalogue.js +1 -4
  7. package/dist/cjs/inference/identifiers.js +23 -3
  8. package/dist/cjs/inference/modelDocumentation.js +433 -0
  9. package/dist/cjs/inference/providerConnection.js +77 -7
  10. package/dist/cjs/inference/request.js +188 -5
  11. package/dist/cjs/inference/routingPolicy.js +81 -2
  12. package/dist/cjs/inference/streamEvents.js +27 -0
  13. package/dist/cjs/inference/usage.js +32 -1
  14. package/dist/cjs/inference/version.js +15 -2
  15. package/dist/cjs/updates.js +2 -0
  16. package/dist/esm/.tsbuildinfo +1 -1
  17. package/dist/esm/accountGraph.js +41 -0
  18. package/dist/esm/identity.js +32 -0
  19. package/dist/esm/index.js +14 -4
  20. package/dist/esm/inference/aliaModelRelease.js +259 -0
  21. package/dist/esm/inference/catalogue.js +2 -5
  22. package/dist/esm/inference/identifiers.js +22 -2
  23. package/dist/esm/inference/modelDocumentation.js +430 -0
  24. package/dist/esm/inference/providerConnection.js +76 -6
  25. package/dist/esm/inference/request.js +189 -6
  26. package/dist/esm/inference/routingPolicy.js +81 -2
  27. package/dist/esm/inference/streamEvents.js +27 -0
  28. package/dist/esm/inference/usage.js +32 -1
  29. package/dist/esm/inference/version.js +15 -2
  30. package/dist/esm/updates.js +2 -0
  31. package/dist/types/.tsbuildinfo +1 -1
  32. package/dist/types/accountGraph.d.ts +43 -0
  33. package/dist/types/identity.d.ts +59 -1
  34. package/dist/types/index.d.ts +10 -6
  35. package/dist/types/inference/accountBilling.d.ts +26 -26
  36. package/dist/types/inference/aliaModelRelease.d.ts +609 -0
  37. package/dist/types/inference/catalogue.d.ts +6 -6
  38. package/dist/types/inference/entitlement.d.ts +4 -4
  39. package/dist/types/inference/identifiers.d.ts +20 -2
  40. package/dist/types/inference/modelDocumentation.d.ts +1603 -0
  41. package/dist/types/inference/money.d.ts +4 -4
  42. package/dist/types/inference/priceVersion.d.ts +14 -14
  43. package/dist/types/inference/providerConnection.d.ts +37 -8
  44. package/dist/types/inference/request.d.ts +291 -5
  45. package/dist/types/inference/routingPolicy.d.ts +109 -13
  46. package/dist/types/inference/streamEvents.d.ts +53 -26
  47. package/dist/types/inference/usage.d.ts +103 -79
  48. package/dist/types/inference/version.d.ts +15 -2
  49. package/dist/types/keyRecovery.d.ts +4 -4
  50. package/dist/types/updates.d.ts +10 -0
  51. package/package.json +1 -1
@@ -357,4 +357,45 @@ exports.createAccountRequestSchema = zod_1.z.object({
357
357
  description: zod_1.z.string().trim().max(1000).optional(),
358
358
  /** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
359
359
  accountCategories: exports.accountCategoriesSchema.optional(),
360
+ /**
361
+ * Create the account already opted OUT of discovery.
362
+ *
363
+ * ## Why this belongs at CREATION and not only on the privacy route
364
+ *
365
+ * Every account is born discoverable: the column defaults to `false` and
366
+ * nothing on the create path wrote it, so a new account appears in people
367
+ * search the instant it exists. For a human signing themselves up that is the
368
+ * right default and it is NOT changed here. For an account a program creates
369
+ * on someone's behalf — an agent, an unlaunched project, an organization for
370
+ * something not yet announced — it publishes the thing before its owner ever
371
+ * decided to.
372
+ *
373
+ * The alternative is a second call right after create, which is a window in
374
+ * which the account IS public, and a window whose closing depends on a second
375
+ * request succeeding. A field here has neither: one statement, one row, born
376
+ * in the state the caller asked for.
377
+ *
378
+ * ## It reuses the existing flag deliberately
379
+ *
380
+ * This is `privacy_is_private_account`, the same one `PUT /users/:id/privacy`
381
+ * toggles — not a new "published" column. A second visibility flag would be a
382
+ * second source of truth for one question, and the two would disagree.
383
+ *
384
+ * Inherited semantics, stated because reusing a flag means inheriting ALL of
385
+ * it: the account is kept out of people search, out of the follow-graph lists
386
+ * (`followers` / `following` / `mutuals`), out of `/similar` and out of the
387
+ * recommendation candidate pools, and its non-public, non-unlisted media
388
+ * becomes follower-gated. It does NOT hide the profile from someone who knows
389
+ * the handle, and it carries NO follow-approval flow — following is immediate
390
+ * and unilateral whatever this says, so nothing here creates a request queue
391
+ * nobody attends.
392
+ *
393
+ * ## Not conditioned on `kind`, on purpose
394
+ *
395
+ * The same reasoning as `accountCategories` above: this object does not
396
+ * refine on kind, and an unlaunched organization has exactly the problem an
397
+ * unpublished agent does. The discovery predicate never reads `kind`, so the
398
+ * remedy must not either.
399
+ */
400
+ isPrivateAccount: zod_1.z.boolean().optional(),
360
401
  });
@@ -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.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = exports.modelDocumentationSchema = exports.modelReleaseIngestionResultSchema = exports.modelReleaseIngestionRequestSchema = exports.modelLineDeclarationSchema = exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchema = exports.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS = exports.trainingComputeFlopsSchema = exports.modelSystemicRiskTierSchema = exports.modelDistributionMethodSchema = 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.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.PROVIDER_SECRET_REFERENCE_NAMESPACE = 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 = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = void 0;
22
+ 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 = 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,27 @@ 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; } });
443
+ var modelDocumentation_1 = require("./inference/modelDocumentation");
444
+ // Model documentation: the GPAI/EU AI Act record, the ingestion request that
445
+ // accepts it beside a signed manifest, and the revision-scoped documentation
446
+ // view a downstream developer reads.
447
+ Object.defineProperty(exports, "modelDistributionMethodSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelDistributionMethodSchema; } });
448
+ Object.defineProperty(exports, "modelSystemicRiskTierSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelSystemicRiskTierSchema; } });
449
+ Object.defineProperty(exports, "trainingComputeFlopsSchema", { enumerable: true, get: function () { return modelDocumentation_1.trainingComputeFlopsSchema; } });
450
+ Object.defineProperty(exports, "SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS", { enumerable: true, get: function () { return modelDocumentation_1.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS; } });
451
+ Object.defineProperty(exports, "modelDownstreamDocumentationSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelDownstreamDocumentationSchema; } });
452
+ Object.defineProperty(exports, "modelGpaiDocumentationSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelGpaiDocumentationSchema; } });
453
+ Object.defineProperty(exports, "modelLineDeclarationSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelLineDeclarationSchema; } });
454
+ Object.defineProperty(exports, "modelReleaseIngestionRequestSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelReleaseIngestionRequestSchema; } });
455
+ Object.defineProperty(exports, "modelReleaseIngestionResultSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelReleaseIngestionResultSchema; } });
456
+ Object.defineProperty(exports, "modelDocumentationSchema", { enumerable: true, get: function () { return modelDocumentation_1.modelDocumentationSchema; } });
430
457
  var request_1 = require("./inference/request");
431
458
  // The normalized Oxy→data-plane request envelope.
432
459
  Object.defineProperty(exports, "inferenceContentSourceSchema", { enumerable: true, get: function () { return request_1.inferenceContentSourceSchema; } });
@@ -467,6 +494,7 @@ Object.defineProperty(exports, "usageRefundReasonSchema", { enumerable: true, ge
467
494
  Object.defineProperty(exports, "usageRefundSchema", { enumerable: true, get: function () { return usage_1.usageRefundSchema; } });
468
495
  var providerConnection_1 = require("./inference/providerConnection");
469
496
  // BYOK connection metadata that structurally cannot carry a secret.
497
+ Object.defineProperty(exports, "PROVIDER_SECRET_REFERENCE_NAMESPACE", { enumerable: true, get: function () { return providerConnection_1.PROVIDER_SECRET_REFERENCE_NAMESPACE; } });
470
498
  Object.defineProperty(exports, "providerConnectionScopeSchema", { enumerable: true, get: function () { return providerConnection_1.providerConnectionScopeSchema; } });
471
499
  Object.defineProperty(exports, "providerSecretReferenceSchema", { enumerable: true, get: function () { return providerConnection_1.providerSecretReferenceSchema; } });
472
500
  Object.defineProperty(exports, "providerConnectionValidationSchema", { enumerable: true, get: function () { return providerConnection_1.providerConnectionValidationSchema; } });
@@ -0,0 +1,262 @@
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
+ * ## The ingestion path, which this file used to say did not exist
40
+ *
41
+ * It does now: `POST /inference/admin/model-releases`, defined by
42
+ * `modelReleaseIngestionRequestSchema` in `modelDocumentation.ts`. This shape is
43
+ * unchanged — the request COMPOSES it, alongside two records that are Oxy's own
44
+ * rather than the signer's (the GPAI documentation and the capability sheet a
45
+ * manifest does not carry), precisely so the bytes a signature covers stay
46
+ * exactly the bytes described here.
47
+ *
48
+ * The earlier objection was that a staff write path into an empty catalogue is
49
+ * an unexercised hazard. What answers it is containment rather than emptiness: an
50
+ * ingested revision lands with `is_current = false` and no deployment, so nothing
51
+ * it creates is servable or listed, and a route still needs an approved
52
+ * contract/legal review before any customer can select it.
53
+ *
54
+ * ## What is deliberately NOT here
55
+ *
56
+ * **No `payloadDigest` field.** The signature is over the canonical
57
+ * serialization of this manifest with `signatures` removed, and a verifier
58
+ * recomputes it. Storing the digest beside the document it digests would be a
59
+ * second source of truth for one fact, and a verifier that compared the
60
+ * signature against the DECLARED digest rather than the recomputed one would
61
+ * verify nothing at all.
62
+ *
63
+ * **No verification RESULT.** Whether a signature checked out is Oxy's finding
64
+ * about the document, not a claim the document makes about itself; a `verified`
65
+ * field inside a signed manifest is the signer asserting its own signature.
66
+ *
67
+ * ## The open owner decision this shape does not take
68
+ *
69
+ * **What signs, and what verifies, is not decided.** Oxy holds no Alia signing
70
+ * key, and whether to resolve `keyId` through the existing attestation machinery
71
+ * (`services/oxyVerificationResolver.ts`, the civic attestation code) or to
72
+ * introduce a dedicated Alia release key is a real choice with different
73
+ * custody, rotation and revocation consequences. So `keyId` is an OPAQUE
74
+ * identifier and this file names no registry that resolves it: either answer
75
+ * fits, and neither is presupposed. Until it is answered a manifest can be
76
+ * parsed and cannot be VERIFIED, so the ingestion path records no verification
77
+ * finding at all: it stores the signatures and the manifest as received, and the
78
+ * authority for the ingest is the staff member who performed it. A nullable
79
+ * `verified` column nothing ever writes would read, to whoever scanned the table
80
+ * later, as a check that ran.
81
+ *
82
+ * Decided in: docs/adr/0008-catalogue-concept-separation.md,
83
+ * docs/adr/0017-authorized-routes-in-the-envelope.md, issue #972 §12.
84
+ */
85
+ Object.defineProperty(exports, "__esModule", { value: true });
86
+ exports.aliaModelReleaseManifestSchema = exports.aliaReleaseSignatureSchema = exports.aliaReleaseArtifactSchema = void 0;
87
+ const zod_1 = require("zod");
88
+ const catalogue_1 = require("./catalogue");
89
+ const identifiers_1 = require("./identifiers");
90
+ /**
91
+ * One artifact of a release, by path and digest.
92
+ *
93
+ * `sizeBytes` is required beside the digest so a verifier can refuse a stream
94
+ * that is the wrong length before reading it to the end, rather than only after.
95
+ */
96
+ exports.aliaReleaseArtifactSchema = zod_1.z
97
+ .object({
98
+ /** Path within the release, e.g. `model-00001-of-00004.safetensors`. */
99
+ path: zod_1.z.string().min(1).max(512),
100
+ digest: identifiers_1.sha256DigestSchema,
101
+ sizeBytes: zod_1.z.number().int().positive().safe(),
102
+ mediaType: zod_1.z.string().min(1).max(255).optional(),
103
+ })
104
+ .strict();
105
+ /**
106
+ * One detached signature over the manifest.
107
+ *
108
+ * `algorithm` is a CLOSED enum with one member, and both halves of that are
109
+ * deliberate. Closed, because a verifier that trusts a document's own algorithm
110
+ * name accepts whatever that document nominates, `none` included. One member,
111
+ * because Ed25519 is the scheme ADR 0012 already chose for asymmetric
112
+ * verification on this platform, and naming a scheme nothing here can check
113
+ * would be advertising a capability that does not exist. A second member lands
114
+ * when a verifier for it does — which is a closed enum gaining a member, and
115
+ * therefore a MINOR contract-set change the handshake surfaces (`version.ts`).
116
+ *
117
+ * `keyId` is opaque on purpose: see the header. It identifies the public key
118
+ * without saying what resolves it.
119
+ *
120
+ * The signature covers the canonical serialization (RFC 8785 JCS) of the
121
+ * manifest with `signatures` removed. The canonicalization is NAMED rather than
122
+ * left implicit because a digest over "the manifest" is not verifiable by two
123
+ * implementations that serialize JSON differently; naming it is a mechanical
124
+ * necessity and is independent of the open question of which key signs.
125
+ */
126
+ exports.aliaReleaseSignatureSchema = zod_1.z
127
+ .object({
128
+ algorithm: zod_1.z.enum(['ed25519']),
129
+ canonicalization: zod_1.z.enum(['jcs']),
130
+ /** Opaque identifier of the public key. Resolving it is undecided. */
131
+ keyId: zod_1.z.string().min(1).max(256),
132
+ /**
133
+ * Unpadded base64url. Exactly 86 characters, which is a 64-byte Ed25519
134
+ * signature — the one algorithm above. A second algorithm moves this length
135
+ * into a refinement keyed on `algorithm`.
136
+ */
137
+ signature: zod_1.z
138
+ .string()
139
+ .regex(/^[A-Za-z0-9_-]{86}$/, 'signature must be a 64-byte ed25519 signature in unpadded base64url'),
140
+ signedAt: identifiers_1.inferenceTimestampSchema,
141
+ })
142
+ .strict();
143
+ /**
144
+ * A signed release of an `alia/*` model revision.
145
+ *
146
+ * `signatures` is a LIST rather than one signature, because "what signs" is
147
+ * undecided: a single field would presuppose one signer, while a list lets an
148
+ * Alia release key and an existing attestation co-sign the same document without
149
+ * either being retrofitted later.
150
+ */
151
+ exports.aliaModelReleaseManifestSchema = zod_1.z
152
+ .object({
153
+ /** See `version.ts`: an ingestion payload is a whole message on the wire. */
154
+ schemaVersion: zod_1.z.literal(1),
155
+ /** The release's own identity, so ingestion is idempotent on it. */
156
+ releaseId: zod_1.z.string().min(1).max(128),
157
+ issuedAt: identifiers_1.inferenceTimestampSchema,
158
+ /**
159
+ * The revision being released. Carries its OWN `schemaVersion`, like
160
+ * `billingProfileSchema` inside `accountBillingStateSchema`: the manifest's
161
+ * version governs the manifest and the revision's governs the revision,
162
+ * which is two versions of two things rather than two versions of one.
163
+ */
164
+ revision: catalogue_1.modelRevisionSchema,
165
+ /** On the MODEL rather than the revision in the catalogue, so carried here. */
166
+ provenance: catalogue_1.modelProvenanceSchema,
167
+ license: catalogue_1.modelLicenseSchema,
168
+ artifacts: zod_1.z.array(exports.aliaReleaseArtifactSchema).min(1),
169
+ signatures: zod_1.z.array(exports.aliaReleaseSignatureSchema).min(1),
170
+ })
171
+ .strict()
172
+ .superRefine((manifest, ctx) => {
173
+ // The same rule `catalogueModelSchema` enforces on a model, applied to the
174
+ // carrier that creates one: `alia/*` names models Alia actually owns or
175
+ // derived, and a manifest is the document that would launder somebody else's
176
+ // weights into the namespace.
177
+ const publisher = manifest.revision.modelId.slice(0, manifest.revision.modelId.indexOf('/'));
178
+ if (publisher !== identifiers_1.RESERVED_ALIA_PUBLISHER) {
179
+ ctx.addIssue({
180
+ code: zod_1.z.ZodIssueCode.custom,
181
+ path: ['revision', 'modelId'],
182
+ message: `an Alia release manifest releases a ${identifiers_1.RESERVED_ALIA_PUBLISHER}/* model`,
183
+ });
184
+ }
185
+ if (manifest.provenance.releaseKind !== 'first_party_original' &&
186
+ manifest.provenance.releaseKind !== 'first_party_derived') {
187
+ ctx.addIssue({
188
+ code: zod_1.z.ZodIssueCode.custom,
189
+ path: ['provenance', 'releaseKind'],
190
+ message: 'an Alia release manifest describes a first-party release',
191
+ });
192
+ }
193
+ // A derived model's base is the licence-attribution trail. Recording the
194
+ // derivation without naming what it derives from loses exactly the fact
195
+ // attribution needs.
196
+ if (manifest.provenance.releaseKind === 'first_party_derived' &&
197
+ manifest.provenance.baseModelId === undefined) {
198
+ ctx.addIssue({
199
+ code: zod_1.z.ZodIssueCode.custom,
200
+ path: ['provenance', 'baseModelId'],
201
+ message: 'a derived release names the model it derives from',
202
+ });
203
+ }
204
+ // The four fields a third-party catalogue entry may omit and a first-party
205
+ // release may not. See the header.
206
+ if (manifest.revision.modelCardUrl === undefined) {
207
+ ctx.addIssue({
208
+ code: zod_1.z.ZodIssueCode.custom,
209
+ path: ['revision', 'modelCardUrl'],
210
+ message: 'a first-party release publishes a model card',
211
+ });
212
+ }
213
+ if (manifest.revision.safety === undefined) {
214
+ ctx.addIssue({
215
+ code: zod_1.z.ZodIssueCode.custom,
216
+ path: ['revision', 'safety'],
217
+ message: 'a first-party release publishes its safety metadata',
218
+ });
219
+ }
220
+ if (manifest.revision.evaluations.length === 0) {
221
+ ctx.addIssue({
222
+ code: zod_1.z.ZodIssueCode.custom,
223
+ path: ['revision', 'evaluations'],
224
+ message: 'a first-party release publishes at least one evaluation result',
225
+ });
226
+ }
227
+ // The digest the catalogue will serve has to be one of the digests this
228
+ // manifest signed. Otherwise the signature covers a set of artifacts that
229
+ // does not include the weights anybody runs.
230
+ if (manifest.revision.artifactDigest === undefined) {
231
+ ctx.addIssue({
232
+ code: zod_1.z.ZodIssueCode.custom,
233
+ path: ['revision', 'artifactDigest'],
234
+ message: 'a first-party release names the digest of the artifact it serves',
235
+ });
236
+ }
237
+ else if (!manifest.artifacts.some((artifact) => artifact.digest === manifest.revision.artifactDigest)) {
238
+ ctx.addIssue({
239
+ code: zod_1.z.ZodIssueCode.custom,
240
+ path: ['revision', 'artifactDigest'],
241
+ message: 'the served artifact digest must appear among the signed artifacts',
242
+ });
243
+ }
244
+ const paths = manifest.artifacts.map((artifact) => artifact.path);
245
+ if (new Set(paths).size !== paths.length) {
246
+ ctx.addIssue({
247
+ code: zod_1.z.ZodIssueCode.custom,
248
+ path: ['artifacts'],
249
+ message: 'each artifact path appears once in a release',
250
+ });
251
+ }
252
+ // Two signatures from one key are one signature written twice, and a
253
+ // duplicate would make a "two independent signers" check pass on one signer.
254
+ const keyIds = manifest.signatures.map((signature) => signature.keyId);
255
+ if (new Set(keyIds).size !== keyIds.length) {
256
+ ctx.addIssue({
257
+ code: zod_1.z.ZodIssueCode.custom,
258
+ path: ['signatures'],
259
+ message: 'each signing key signs a manifest once',
260
+ });
261
+ }
262
+ });
@@ -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
  /* -------------------------------------------------------------------------- */