@learncard/types 5.20.0 → 5.22.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/vc.ts", "../src/did.ts", "../src/crypto.ts", "../src/obv3.ts", "../src/clr.ts", "../src/credential-format.ts", "../src/learncard.ts", "../src/learncloud.ts", "../src/mongo.ts", "../src/lcn.ts", "../src/queries.ts", "../src/auth.ts", "../src/bitstring-status-list.ts", "../src/inAppMessages.ts", "../src/credential-refresh.ts"],
4
- "sourcesContent": ["import { z } from 'zod/v4';\n\nexport const ContextValidator = z.array(z.string().or(z.record(z.string(), z.any())));\nexport type Context = z.infer<typeof ContextValidator>;\n\nexport const AchievementCriteriaValidator = z.object({\n type: z.string().optional(),\n narrative: z.string().optional(),\n});\nexport type AchievementCriteria = z.infer<typeof AchievementCriteriaValidator>;\n\nexport const ImageValidator = z.string().or(\n z.object({\n id: z.string(),\n type: z.string(),\n caption: z.string().optional(),\n })\n);\nexport type Image = z.infer<typeof ImageValidator>;\n\nexport const GeoCoordinatesValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n latitude: z.number(),\n longitude: z.number(),\n});\nexport type GeoCoordinates = z.infer<typeof GeoCoordinatesValidator>;\n\nexport const AddressValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n addressCountry: z.string().optional(),\n addressCountryCode: z.string().optional(),\n addressRegion: z.string().optional(),\n addressLocality: z.string().optional(),\n streetAddress: z.string().optional(),\n postOfficeBoxNumber: z.string().optional(),\n postalCode: z.string().optional(),\n geo: GeoCoordinatesValidator.optional(),\n});\nexport type Address = z.infer<typeof AddressValidator>;\n\nexport const IdentifierTypeValidator = z\n .enum([\n 'sourcedId',\n 'systemId',\n 'productId',\n 'userName',\n 'accountId',\n 'emailAddress',\n 'nationalIdentityNumber',\n 'isbn',\n 'issn',\n 'lisSourcedId',\n 'oneRosterSourcedId',\n 'sisSourcedId',\n 'ltiContextId',\n 'ltiDeploymentId',\n 'ltiToolId',\n 'ltiPlatformId',\n 'ltiUserId',\n 'identifier',\n ])\n .or(z.string());\nexport type IdentifierType = z.infer<typeof IdentifierTypeValidator>;\n\nexport const IdentifierEntryValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n identifier: z.string(),\n identifierType: IdentifierTypeValidator,\n});\nexport type IdentifierEntry = z.infer<typeof IdentifierEntryValidator>;\n\nexport const ProfileValidator = z.string().or(\n z\n .object({\n id: z.string().optional(),\n type: z.string().or(z.string().array().nonempty().optional()),\n name: z.string().optional(),\n url: z.string().optional(),\n phone: z.string().optional(),\n description: z.string().optional(),\n endorsement: z.any().array().optional(), // Recursive type\n image: ImageValidator.optional(),\n email: z.string().email().optional(),\n address: AddressValidator.optional(),\n otherIdentifier: IdentifierEntryValidator.array().optional(),\n official: z.string().optional(),\n parentOrg: z.any().optional(), // Recursive types are annoying =(\n familyName: z.string().optional(),\n givenName: z.string().optional(),\n additionalName: z.string().optional(),\n patronymicName: z.string().optional(),\n honorificPrefix: z.string().optional(),\n honorificSuffix: z.string().optional(),\n familyNamePrefix: z.string().optional(),\n dateOfBirth: z.string().optional(),\n })\n .catchall(z.any())\n);\nexport type Profile = z.infer<typeof ProfileValidator>;\n\nexport const CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());\nexport type CredentialSubject = z.infer<typeof CredentialSubjectValidator>;\n\nexport const CredentialStatusValidator = z\n .object({ type: z.string(), id: z.string().optional() })\n .catchall(z.any());\nexport type CredentialStatus = z.infer<typeof CredentialStatusValidator>;\n\nexport const CredentialSchemaValidator = z\n .object({ id: z.string(), type: z.string() })\n .catchall(z.any());\nexport type CredentialSchema = z.infer<typeof CredentialSchemaValidator>;\n\nexport const RefreshServiceValidator = z\n .object({ id: z.string().optional(), type: z.string() })\n .catchall(z.any());\nexport type RefreshService = z.infer<typeof RefreshServiceValidator>;\n\nexport const TermsOfUseValidator = z\n .object({ type: z.string(), id: z.string().optional() })\n .catchall(z.any());\nexport type TermsOfUse = z.infer<typeof TermsOfUseValidator>;\n\nexport const VC2EvidenceValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n name: z.string().optional(),\n narrative: z.string().optional(),\n description: z.string().optional(),\n genre: z.string().optional(),\n audience: z.string().optional(),\n })\n .catchall(z.any());\nexport type VC2Evidence = z.infer<typeof VC2EvidenceValidator>;\n\nexport const TemplateRenderMethodValidator = z.object({\n type: z.literal('TemplateRenderMethod'),\n renderSuite: z.string(),\n template: z.string(),\n renderProperty: z.array(z.string()).optional(),\n outputPreference: z\n .object({\n mediaType: z.string(),\n })\n .optional(),\n});\nexport type TemplateRenderMethod = z.infer<typeof TemplateRenderMethodValidator>;\n\nexport const RenderMethodValidator = z.union([\n TemplateRenderMethodValidator,\n z.record(z.string(), z.any()),\n]);\nexport type RenderMethod = z.infer<typeof RenderMethodValidator>;\n\nexport const UnsignedVCValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n issuer: ProfileValidator,\n credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),\n refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),\n credentialSchema: CredentialSchemaValidator.or(\n CredentialSchemaValidator.array()\n ).optional(),\n\n // V1\n issuanceDate: z.string().optional(),\n expirationDate: z.string().optional(),\n credentialStatus: CredentialStatusValidator.or(\n CredentialStatusValidator.array()\n ).optional(),\n\n // V2\n name: z.string().optional(),\n description: z.string().optional(),\n validFrom: z.string().optional(),\n validUntil: z.string().optional(),\n status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),\n termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),\n evidence: z.union([VC2EvidenceValidator, z.array(VC2EvidenceValidator)]).optional(),\n renderMethod: z.union([RenderMethodValidator, z.array(RenderMethodValidator)]).optional(),\n })\n .catchall(z.any());\nexport type UnsignedVC = z.infer<typeof UnsignedVCValidator>;\n\nexport const ProofValidator = z\n .object({\n type: z.string(),\n created: z.string().optional(),\n challenge: z.string().optional(),\n domain: z.string().optional(),\n nonce: z.string().optional(),\n proofPurpose: z.string(),\n verificationMethod: z.string(),\n jws: z.string().optional(),\n })\n .catchall(z.any())\n .superRefine((proof, ctx) => {\n if (\n proof.created === undefined &&\n (proof.type !== 'DataIntegrityProof' || proof.cryptosuite !== 'ecdsa-rdfc-2019')\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['created'],\n message: 'created is required for this proof suite',\n });\n }\n });\nexport type Proof = z.infer<typeof ProofValidator>;\n\nexport const VCValidator = UnsignedVCValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type VC = z.infer<typeof VCValidator>;\n\nexport const UnsignedVPValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string().optional(),\n type: z.string().or(z.string().array().nonempty()),\n verifiableCredential: VCValidator.or(VCValidator.array()).optional(),\n holder: z.string().optional(),\n })\n .catchall(z.any());\nexport type UnsignedVP = z.infer<typeof UnsignedVPValidator>;\n\nexport const VPValidator = UnsignedVPValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type VP = z.infer<typeof VPValidator>;\n", "import { z } from 'zod/v4';\nimport { ContextValidator, ProofValidator } from './vc';\nimport { JWKValidator } from './crypto';\n\nexport const VerificationMethodValidator = z.string().or(\n z\n .object({\n '@context': ContextValidator.optional(),\n id: z.string(),\n type: z.string(),\n controller: z.string(),\n publicKeyJwk: JWKValidator.optional(),\n publicKeyBase58: z.string().optional(),\n publicKeyMultibase: z.string().optional(),\n blockChainAccountId: z.string().optional(),\n })\n .catchall(z.any())\n);\nexport type VerificationMethod = z.infer<typeof VerificationMethodValidator>;\n\nexport const ServiceValidator = z\n .object({\n id: z.string(),\n type: z.string().or(z.string().array().nonempty()),\n serviceEndpoint: z.any().or(z.any().array().nonempty()),\n })\n .catchall(z.any());\nexport type Service = z.infer<typeof ServiceValidator>;\n\nexport const DidDocumentValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string(),\n alsoKnownAs: z.string().optional(),\n controller: z.string().or(z.string().array().nonempty()).optional(),\n verificationMethod: VerificationMethodValidator.array().optional(),\n authentication: VerificationMethodValidator.array().optional(),\n assertionMethod: VerificationMethodValidator.array().optional(),\n keyAgreement: VerificationMethodValidator.array().optional(),\n capabilityInvocation: VerificationMethodValidator.array().optional(),\n capabilityDelegation: VerificationMethodValidator.array().optional(),\n publicKey: VerificationMethodValidator.array().optional(),\n service: ServiceValidator.array().optional(),\n proof: ProofValidator.or(ProofValidator.array()).optional(),\n })\n .catchall(z.any());\nexport type DidDocument = z.infer<typeof DidDocumentValidator>;\n", "import { z } from 'zod/v4';\n\nexport const JWKValidator = z.object({\n kty: z.string(),\n crv: z.string(),\n x: z.string(),\n y: z.string().optional(),\n n: z.string().optional(),\n d: z.string().optional(),\n});\nexport type JWK = z.infer<typeof JWKValidator>;\n\nexport const JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });\nexport type JWKWithPrivateKey = z.infer<typeof JWKWithPrivateKeyValidator>;\n\nexport const JWERecipientHeaderValidator = z.object({\n alg: z.string(),\n iv: z.string(),\n tag: z.string(),\n epk: JWKValidator.partial().optional(),\n kid: z.string().optional(),\n apv: z.string().optional(),\n apu: z.string().optional(),\n});\nexport type JWERecipientHeader = z.infer<typeof JWERecipientHeaderValidator>;\n\nexport const JWERecipientValidator = z.object({\n header: JWERecipientHeaderValidator,\n encrypted_key: z.string(),\n});\nexport type JWERecipient = z.infer<typeof JWERecipientValidator>;\n\nexport const JWEValidator = z.object({\n protected: z.string(),\n iv: z.string(),\n ciphertext: z.string(),\n tag: z.string(),\n aad: z.string().optional(),\n recipients: JWERecipientValidator.array().optional(),\n});\nexport type JWE = z.infer<typeof JWEValidator>;\n", "import { z } from 'zod/v4';\nimport {\n UnsignedVCValidator,\n ProofValidator,\n ProfileValidator,\n ImageValidator,\n IdentifierEntryValidator,\n} from './vc';\n\nexport const AlignmentTargetTypeValidator = z\n .enum([\n 'ceasn:Competency',\n 'ceterms:Credential',\n 'CFItem',\n 'CFRubric',\n 'CFRubricCriterion',\n 'CFRubricCriterionLevel',\n 'CTDL',\n ])\n .or(z.string());\nexport type AlignmentTargetType = z.infer<typeof AlignmentTargetTypeValidator>;\n\nexport const AlignmentValidator = z.object({\n type: z.string().array().nonempty(),\n targetCode: z.string().optional(),\n targetDescription: z.string().optional(),\n targetName: z.string(),\n targetFramework: z.string().optional(),\n targetType: AlignmentTargetTypeValidator.optional(),\n targetUrl: z.string(),\n});\nexport type Alignment = z.infer<typeof AlignmentValidator>;\n\nexport const KnownAchievementTypeValidator = z.enum([\n 'Achievement',\n 'ApprenticeshipCertificate',\n 'Assessment',\n 'Assignment',\n 'AssociateDegree',\n 'Award',\n 'Badge',\n 'BachelorDegree',\n 'Certificate',\n 'CertificateOfCompletion',\n 'Certification',\n 'CommunityService',\n 'Competency',\n 'Course',\n 'CoCurricular',\n 'Degree',\n 'Diploma',\n 'DoctoralDegree',\n 'Fieldwork',\n 'GeneralEducationDevelopment',\n 'JourneymanCertificate',\n 'LearningProgram',\n 'License',\n 'Membership',\n 'ProfessionalDoctorate',\n 'QualityAssuranceCredential',\n 'MasterCertificate',\n 'MasterDegree',\n 'MicroCredential',\n 'ResearchDoctorate',\n 'SecondarySchoolDiploma',\n]);\nexport type KnownAchievementType = z.infer<typeof KnownAchievementTypeValidator>;\n\nexport const AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());\nexport type AchievementType = z.infer<typeof AchievementTypeValidator>;\n\nexport const CriteriaValidator = z\n .object({ id: z.string().optional(), narrative: z.string().optional() })\n .catchall(z.any());\nexport type Criteria = z.infer<typeof CriteriaValidator>;\n\nexport const EndorsementSubjectValidator = z.object({\n id: z.string(),\n type: z.string().array().nonempty(),\n endorsementComment: z.string().optional(),\n});\nexport type EndorsementSubject = z.infer<typeof EndorsementSubjectValidator>;\n\nexport const EndorsementCredentialValidator = UnsignedVCValidator.extend({\n credentialSubject: EndorsementSubjectValidator,\n proof: ProofValidator.or(ProofValidator.array()).optional(),\n});\nexport type EndorsementCredential = z.infer<typeof EndorsementCredentialValidator>;\n\nexport const RelatedValidator = z.object({\n id: z.string(),\n '@language': z.string().optional(),\n version: z.string().optional(),\n});\nexport type Related = z.infer<typeof RelatedValidator>;\n\nexport const ResultTypeValidator = z\n .enum([\n 'GradePointAverage',\n 'LetterGrade',\n 'Percent',\n 'PerformanceLevel',\n 'PredictedScore',\n 'RawScore',\n 'Result',\n 'RubricCriterion',\n 'RubricCriterionLevel',\n 'RubricScore',\n 'ScaledScore',\n 'Status',\n ])\n .or(z.string());\nexport type ResultType = z.infer<typeof ResultTypeValidator>;\n\nexport const RubricCriterionValidator = z\n .object({\n id: z.string(),\n type: z.string().array().nonempty(),\n alignment: AlignmentValidator.array().optional(),\n description: z.string().optional(),\n level: z.string().optional(),\n name: z.string(),\n points: z.string().optional(),\n })\n .catchall(z.any());\nexport type RubricCriterion = z.infer<typeof RubricCriterionValidator>;\n\nexport const ResultDescriptionValidator = z\n .object({\n id: z.string(),\n type: z.string().array().nonempty(),\n alignment: AlignmentValidator.array().optional(),\n allowedValue: z.string().array().optional(),\n name: z.string(),\n requiredLevel: z.string().optional(),\n requiredValue: z.string().optional(),\n resultType: ResultTypeValidator,\n rubricCriterionLevel: RubricCriterionValidator.array().optional(),\n valueMax: z.string().optional(),\n valueMin: z.string().optional(),\n })\n .catchall(z.any());\nexport type ResultDescription = z.infer<typeof ResultDescriptionValidator>;\n\nexport const EvidenceValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n name: z.string().optional(),\n narrative: z.string().optional(),\n description: z.string().optional(),\n genre: z.string().optional(),\n audience: z.string().optional(),\n })\n .catchall(z.any());\n\nexport type Evidence = z.infer<typeof EvidenceValidator>;\n\nexport const AchievementValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n alignment: AlignmentValidator.array().optional(),\n achievementType: AchievementTypeValidator.optional(),\n creator: ProfileValidator.optional(),\n creditsAvailable: z.number().optional(),\n criteria: CriteriaValidator,\n description: z.string(),\n endorsement: EndorsementCredentialValidator.array().optional(),\n fieldOfStudy: z.string().optional(),\n humanCode: z.string().optional(),\n image: ImageValidator.optional(),\n '@language': z.string().optional(),\n name: z.string(),\n otherIdentifier: IdentifierEntryValidator.array().optional(),\n related: RelatedValidator.array().optional(),\n resultDescription: ResultDescriptionValidator.array().optional(),\n specialization: z.string().optional(),\n tag: z.array(z.string()).optional(),\n version: z.string().optional(),\n })\n .catchall(z.any());\nexport type Achievement = z.infer<typeof AchievementValidator>;\n\nexport const IdentityObjectValidator = z.object({\n type: z.string(),\n hashed: z.boolean(),\n identityHash: z.string(),\n identityType: z.string(),\n salt: z.string().optional(),\n});\nexport type IdentityObject = z.infer<typeof IdentityObjectValidator>;\n\nexport const ResultStatusTypeValidator = z.enum([\n 'Completed',\n 'Enrolled',\n 'Failed',\n 'InProgress',\n 'OnHold',\n 'Withdrew',\n]);\nexport type ResultStatusType = z.infer<typeof ResultStatusTypeValidator>;\n\nexport const ResultValidator = z\n .object({\n type: z.string().array().nonempty(),\n achievedLevel: z.string().optional(),\n alignment: AlignmentValidator.array().optional(),\n resultDescription: z.string().optional(),\n status: ResultStatusTypeValidator.optional(),\n value: z.string().optional(),\n })\n .catchall(z.any());\nexport type Result = z.infer<typeof ResultValidator>;\n\nexport const AchievementSubjectValidator = z\n .object({\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n activityEndDate: z.string().optional(),\n activityStartDate: z.string().optional(),\n creditsEarned: z.number().optional(),\n achievement: AchievementValidator.optional(),\n identifier: IdentityObjectValidator.array().optional(),\n image: ImageValidator.optional(),\n licenseNumber: z.string().optional(),\n narrative: z.string().optional(),\n result: ResultValidator.array().optional(),\n role: z.string().optional(),\n source: ProfileValidator.optional(),\n term: z.string().optional(),\n })\n .catchall(z.any());\nexport type AchievementSubject = z.infer<typeof AchievementSubjectValidator>;\n\nexport const UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({\n name: z.string().optional(),\n description: z.string().optional(),\n image: ImageValidator.optional(),\n credentialSubject: AchievementSubjectValidator.or(\n AchievementSubjectValidator.array()\n ) as z.ZodUnion<\n [typeof AchievementSubjectValidator, z.ZodArray<typeof AchievementSubjectValidator>]\n >,\n endorsement: UnsignedVCValidator.array().optional(),\n});\nexport type UnsignedAchievementCredential = z.infer<typeof UnsignedAchievementCredentialValidator>;\n\nexport const AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type AchievementCredential = z.infer<typeof AchievementCredentialValidator>;\n", "import { z } from 'zod/v4';\n\nimport { UnsignedVCValidator, ProofValidator, ProfileValidator, ImageValidator } from './vc';\n\nimport { AchievementValidator, EndorsementCredentialValidator } from './obv3';\n\n// ---------------------------------------------------------------------------\n// CLR v2 \u2014 Comprehensive Learner Record\n// Based on 1EdTech CLR Standard v2.0\n// https://www.imsglobal.org/spec/clr/v2p0\n// ---------------------------------------------------------------------------\n\nexport const AssociationTypeValidator = z\n .enum([\n 'exactMatchOf',\n 'extends',\n 'isChildOf',\n 'isParentOf',\n 'isPartOf',\n 'isPeerOf',\n 'isRelatedTo',\n 'precedes',\n 'replacedBy',\n ])\n .or(z.string());\nexport type AssociationType = z.infer<typeof AssociationTypeValidator>;\n\nexport const AssociationValidator = z\n .object({\n type: z.string().array().nonempty(),\n associationType: AssociationTypeValidator,\n sourceId: z.string().optional(),\n targetId: z.string(),\n })\n .catchall(z.any());\nexport type Association = z.infer<typeof AssociationValidator>;\n\nexport const ClrSubjectValidator = z\n .object({\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n identifier: z.any().array().optional(),\n achievement: AchievementValidator.array().optional(),\n association: AssociationValidator.array().optional(),\n verifiableCredential: z.any().array().optional(),\n })\n .catchall(z.any());\nexport type ClrSubject = z.infer<typeof ClrSubjectValidator>;\n\nexport const UnsignedClrCredentialValidator = UnsignedVCValidator.extend({\n name: z.string().optional(),\n description: z.string().optional(),\n image: ImageValidator.optional(),\n\n credentialSubject: ClrSubjectValidator.or(ClrSubjectValidator.array()) as z.ZodUnion<\n [typeof ClrSubjectValidator, z.ZodArray<typeof ClrSubjectValidator>]\n >,\n\n endorsement: EndorsementCredentialValidator.array().optional(),\n\n partial: z.boolean().optional(),\n});\nexport type UnsignedClrCredential = z.infer<typeof UnsignedClrCredentialValidator>;\n\nexport const ClrCredentialValidator = UnsignedClrCredentialValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type ClrCredential = z.infer<typeof ClrCredentialValidator>;\n", "import { z } from 'zod/v4';\nimport type { VC } from './vc';\n\n/**\n * Wire-format identifier for a credential at rest in the wallet.\n *\n * Optional metadata on `CredentialRecord`. Existing W3C records work\n * without it. Format-aware code paths use this value to dispatch on\n * the correct wire-form representation. See ADR-0001 for rationale.\n *\n * Values follow OID4VCI / OID4VP draft-16 conventions:\n * - `w3c-vc-2.0` \u2014 JSON-LD VC, VCDM 2.0 `@context`\n * - `w3c-vc-1.1` \u2014 JSON-LD VC, VCDM 1.1 `@context` (legacy)\n * - `jwt-vc-json` \u2014 compact JWS string, VCDM \u00A76.3.1 payload shape\n * - `dc+sd-jwt` \u2014 SD-JWT-VC compact form (draft-16 canonical name)\n * - `vc+sd-jwt` \u2014 SD-JWT-VC compact form (legacy alias accepted on read)\n * - `mso_mdoc` \u2014 ISO 18013-5 mDoc, CBOR-encoded (stored base64)\n */\nexport const CredentialFormatValidator = z.enum([\n 'w3c-vc-2.0',\n 'w3c-vc-1.1',\n 'jwt-vc-json',\n 'dc+sd-jwt',\n 'vc+sd-jwt',\n 'mso_mdoc',\n]);\nexport type CredentialFormat = z.infer<typeof CredentialFormatValidator>;\n\n/**\n * Storage-plane envelope for native (non-W3C) credential formats.\n *\n * The storage plane previously accepted only `VC | VP`, which forced\n * SD-JWT-VC to synthesize a JSON-LD wrapper around the compact form\n * just to satisfy the type \u2014 even though the underlying transport\n * (LearnCloud tRPC) accepts any JSON-serializable value.\n *\n * The envelope is the on-wire shape for any credential that is NOT a\n * W3C VC/VP. Consumers identify the envelope by the presence of both\n * `format` and `data` fields (use `isStoredCredentialEnvelope`).\n *\n * Per-format `data` conventions:\n * - `dc+sd-jwt` / `vc+sd-jwt`: the compact `<JWT>~<disclosures>~`\n * string (no KB-JWT \u2014 that is per-presentation).\n * - `jwt-vc-json`: the compact JWS string.\n * - `mso_mdoc`: base64url-encoded CBOR bytes. The TypeScript type\n * allows `Uint8Array` for in-memory ergonomics; storage plugins\n * MUST convert to a base64url string at the transport boundary.\n * The Zod validator (used at the wire layer) is string-only.\n *\n * W3C VCs continue to flow through `upload(vc: VC)` directly \u2014 they\n * do not use the envelope. This keeps the legacy partner surface\n * untouched.\n */\n// Wire validator: data is `string` only because JSON transport (tRPC, OpenAPI)\n// cannot carry Uint8Array natively. Storage plugins encode binary `Uint8Array`\n// data to base64url BEFORE the validator runs at the transport boundary.\n// The TypeScript type below is intentionally wider (`string | Uint8Array`) to\n// preserve in-memory ergonomics for plugins doing the conversion.\nexport const StoredCredentialEnvelopeValidator = z\n .object({\n format: CredentialFormatValidator,\n data: z.string(),\n })\n .passthrough();\nexport type StoredCredentialEnvelope = {\n format: CredentialFormat;\n data: string | Uint8Array;\n [key: string]: unknown;\n};\n\n/**\n * Runtime typeguard for the storage envelope shape. Storage plugins\n * use this to branch in `upload`/`read.get` between the legacy W3C\n * path and the envelope path. Performs a shallow structural check \u2014\n * does not validate `data` semantics for the chosen format.\n */\nexport const isStoredCredentialEnvelope = (value: unknown): value is StoredCredentialEnvelope => {\n if (!value || typeof value !== 'object') return false;\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.format !== 'string') return false;\n if (!CredentialFormatValidator.safeParse(candidate.format).success) return false;\n return typeof candidate.data === 'string' || candidate.data instanceof Uint8Array;\n};\n\n/**\n * Format-discriminated read view over a stored credential. Returned\n * by `toStoredCredential(record)` in `@learncard/helpers`.\n *\n * The `data` field carries the correct wire-form representation for\n * the credential's format:\n * - W3C VCs: the JSON-LD VC object (also what `record.vc` holds)\n * - JWT-VC: the compact JWS string (extracted from `record.vc.proof.jwt`\n * if the record uses the legacy LDP-around-JWT envelope, otherwise\n * the raw string from `record.rawWireForm`)\n * - SD-JWT-VC: the compact `<JWT>~<disclosures>~` string\n * - mDoc: base64url-encoded CBOR bytes (stored as a string for\n * LearnCloud's JSON-only encrypted store; consumers base64-decode\n * when they need raw bytes)\n *\n * Format-aware consumers pattern-match on `format` and use `data`.\n * Legacy consumers continue to read `record.vc` directly \u2014 the\n * projector is opt-in, never required.\n */\nexport type StoredCredential =\n | { format: 'w3c-vc-2.0'; data: VC }\n | { format: 'w3c-vc-1.1'; data: VC }\n | { format: 'jwt-vc-json'; data: string }\n | { format: 'dc+sd-jwt'; data: string }\n | { format: 'vc+sd-jwt'; data: string }\n | { format: 'mso_mdoc'; data: string };\n\n/**\n * Unified display projection for any credential format. Returned by\n * the `toDisplayViewModel(stored, learnCard)` adapter that lands in\n * UI components consume this shape regardless of underlying format,\n * so the same BoostEarnedCard / category view / search index works\n * across all credential types. The format-specific decoding logic\n * lives in the per-format display adapter, not the UI.\n */\nexport interface CredentialDisplayViewModel {\n /** Source format of the underlying credential. */\n format: CredentialFormat;\n /** Best-effort issuer display name (resolved DID document or HTTPS metadata). */\n issuerName?: string;\n /** Raw DID or URL identifier of the issuer. */\n issuerDid?: string;\n /** Human-readable title (from credential `name`, derived from vct, or humanized type). */\n title?: string;\n /** Wallet category (e.g., `'Achievement'`, `'ID'`) used by the wallet's category tabs. */\n category?: string;\n /** Issuance time, if present in the credential. */\n issuedAt?: Date;\n /** Expiration time, if present. */\n expiresAt?: Date;\n /**\n * Reconstructed claims. For W3C VCs this mirrors `credentialSubject`;\n * for SD-JWT this is the payload + reconstructed disclosable claims;\n * for mDoc it's the decoded namespace tree projected as a flat record.\n */\n claims: Record<string, unknown>;\n /**\n * Whether the credential supports selective disclosure at presentation\n * time. SD-JWT-VC and mDoc \u2192 true; W3C VCs \u2192 false. UI components use\n * this to decide whether to show per-claim consent checkboxes.\n */\n isSelectivelyDisclosable: boolean;\n /**\n * The on-the-wire form for re-serialization at egress time. Apps\n * preparing outbound presentations should NEVER reconstruct from\n * `claims` \u2014 always re-serialize from this field via\n * `serializeForWire(stored)` (Phase 3).\n */\n rawWireForm: string | VC;\n}\n", "import { z } from 'zod/v4';\nimport { CredentialSubjectValidator, ProfileValidator } from './vc';\nimport { CredentialFormatValidator, type CredentialFormat } from './credential-format';\n\n/**\n * Per-entry result for the credentialStatus check.\n *\n * Surfaced from `ssi-ldp::StatusCheckEntry` (see ssi PR\n * `lc-status-array-and-structured-result`) through didkit's\n * `verifyCredential` JSON output. One entry per `credentialStatus`\n * entry on the verified credential \u2014 VC 2.0 allows multiple\n * (e.g. one revocation entry + one suspension entry).\n *\n * Combine `statusPurpose` + `isSet` to render structured UI without\n * string-matching the human-readable error in `errors`:\n *\n * - `statusPurpose: \"revocation\"`, `isSet: true` \u2192 revoked\n * - `statusPurpose: \"suspension\"`, `isSet: true` \u2192 suspended\n * - `isSet: false` \u2192 active for that purpose\n */\nexport const StatusCheckEntryValidator = z.object({\n /**\n * The `credentialStatus.type` as it appeared on the credential.\n * One of `BitstringStatusListEntry`, `StatusList2021Entry`,\n * `RevocationList2020Status`, or any future custom status type.\n */\n entryType: z.string(),\n /**\n * The claimed purpose of the entry. Standard values are\n * `\"revocation\"` and `\"suspension\"`; the spec allows arbitrary\n * strings.\n */\n statusPurpose: z.string(),\n /**\n * Whether the bit at the credential's index in the status list\n * bitstring was set.\n */\n isSet: z.boolean(),\n /** URL of the status list credential, when known. */\n statusListCredential: z.string().optional(),\n /** Original (string) index within the status list. */\n statusListIndex: z.string().optional(),\n});\nexport type StatusCheckEntry = z.infer<typeof StatusCheckEntryValidator>;\n\nexport const VerificationCheckValidator = z.object({\n /**\n * Checks that completed successfully. This does not imply that warnings can be ignored.\n */\n checks: z.string().array(),\n /**\n * Security-relevant conditions that did not prevent the requested cryptographic checks from\n * completing. In particular, a non-DID issuer warning means the signature is valid but the\n * named URL issuer's authorization of that signing key was not established.\n */\n warnings: z.string().array(),\n /** Verification failures that prevented one or more requested checks from succeeding. */\n errors: z.string().array(),\n /**\n * Per-entry results for the `credentialStatus` check, populated\n * by `@learncard/didkit-plugin` when the verified credential\n * carries one or more `credentialStatus` entries. Empty / absent\n * for credentials without a status entry.\n *\n * Marked `.optional()` because the underlying `ssi-ldp`\n * serializer omits the field when empty (`skip_serializing_if`),\n * so older WASM builds that pre-date the structured-status\n * change still validate against this schema.\n */\n status: StatusCheckEntryValidator.array().optional(),\n});\nexport type VerificationCheck = z.infer<typeof VerificationCheckValidator>;\n\nexport const VerificationStatusValidator = z.enum(['Success', 'Failed', 'Error']);\nexport type VerificationStatus = z.infer<typeof VerificationStatusValidator>;\nexport const VerificationStatusEnum = VerificationStatusValidator.enum;\n\nexport const VerificationItemValidator = z.object({\n check: z.string(),\n status: VerificationStatusValidator,\n message: z.string().optional(),\n details: z.string().optional(),\n});\nexport type VerificationItem = z.infer<typeof VerificationItemValidator>;\n\nexport const CredentialInfoValidator = z.object({\n title: z.string().optional(),\n createdAt: z.string().optional(),\n issuer: ProfileValidator.optional(),\n issuee: ProfileValidator.optional(),\n credentialSubject: CredentialSubjectValidator.optional(),\n});\nexport type CredentialInfo = z.infer<typeof CredentialInfoValidator>;\n\nexport type CredentialRecord<Metadata extends Record<string, any> = Record<never, never>> = {\n id: string;\n uri: string;\n /**\n * Wire-format discriminator for the credential. Optional \u2014 when\n * absent, legacy readers infer it from `vc` shape (see\n * `toStoredCredential` in `@learncard/helpers`). Populated on new\n * writes once the consumer is format-aware.\n *\n * Added in ADR-0001 Phase 1 as additive metadata; existing\n * records without this field continue to work unchanged.\n */\n format?: CredentialFormat;\n /**\n * Optional semantic type hint for fast filtering without parsing\n * the full credential \u2014 `vct` for SD-JWT-VC, last-non-VC type for\n * W3C VCs, doctype for mDoc. Added in ADR-0001 Phase 1.\n */\n semanticType?: string;\n /**\n * On-the-wire representation for formats whose `vc` field cannot\n * hold the canonical form (SD-JWT compact, JWT-VC compact, base64\n * mDoc CBOR). Undefined for W3C VCs (`vc` IS the wire form). Added\n * in ADR-0001 Phase 1.\n */\n rawWireForm?: string;\n [key: string]: any;\n} & Metadata;\n\nexport const CredentialRecordValidator = z\n .object({\n id: z.string(),\n uri: z.string(),\n format: CredentialFormatValidator.optional(),\n semanticType: z.string().optional(),\n rawWireForm: z.string().optional(),\n })\n .catchall(z.any()) satisfies z.ZodType<CredentialRecord>;\n", "import { z } from 'zod/v4';\n\nimport { PaginationResponseValidator } from './mongo';\nimport { JWEValidator } from './crypto';\n\nexport const EncryptedRecordValidator = z\n .object({ encryptedRecord: JWEValidator, fields: z.string().array() })\n .catchall(z.any());\nexport type EncryptedRecord = z.infer<typeof EncryptedRecordValidator>;\n\nexport const PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({\n records: EncryptedRecordValidator.array(),\n});\nexport type PaginatedEncryptedRecordsType = z.infer<typeof PaginatedEncryptedRecordsValidator>;\n\nexport const EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({\n id: z.string(),\n});\nexport type EncryptedCredentialRecord = z.infer<typeof EncryptedCredentialRecordValidator>;\n\nexport const PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({\n records: EncryptedCredentialRecordValidator.array(),\n});\nexport type PaginatedEncryptedCredentialRecordsType = z.infer<\n typeof PaginatedEncryptedCredentialRecordsValidator\n>;\n", "import { z } from 'zod/v4';\n\nexport const PaginationOptionsValidator = z.object({\n limit: z.number(),\n cursor: z.string().optional(),\n sort: z.string().optional(),\n});\nexport type PaginationOptionsType = z.infer<typeof PaginationOptionsValidator>;\n\nexport const PaginationResponseValidator = z.object({\n cursor: z.string().optional(),\n hasMore: z.boolean(),\n});\nexport type PaginationResponseType = z.infer<typeof PaginationResponseValidator>;\n", "import type {} from 'zod-openapi';\nimport { z } from 'zod/v4';\n\nimport { PaginationResponseValidator } from './mongo';\nimport { StringQuery } from './queries';\nimport { UnsignedVCValidator, VCValidator, VPValidator } from './vc';\n\nexport const LCNProfileDisplayValidator = z.object({\n backgroundColor: z.string().optional(),\n backgroundImage: z.string().optional(),\n fadeBackgroundImage: z.boolean().optional(),\n repeatBackgroundImage: z.boolean().optional(),\n fontColor: z.string().optional(),\n accentColor: z.string().optional(),\n accentFontColor: z.string().optional(),\n idBackgroundImage: z.string().optional(),\n fadeIdBackgroundImage: z.boolean().optional(),\n idBackgroundColor: z.string().optional(),\n repeatIdBackgroundImage: z.boolean().optional(),\n});\nexport type LCNProfileDisplay = z.infer<typeof LCNProfileDisplayValidator>;\n\nexport const ProfileVisibilityEnum = z.enum(['public', 'connections_only', 'private']);\nexport type ProfileVisibility = z.infer<typeof ProfileVisibilityEnum>;\n\nexport const AllowConnectionRequestsEnum = z.enum(['anyone', 'invite_only']);\nexport type AllowConnectionRequests = z.infer<typeof AllowConnectionRequestsEnum>;\n\nexport const LCNProfileValidator = z.object({\n profileId: z.string().min(3).max(40).describe('Unique, URL-safe identifier for the profile.'),\n displayName: z.string().default('').describe('Human-readable display name for the profile.'),\n shortBio: z.string().default('').describe('Short bio for the profile.'),\n bio: z.string().default('').describe('Longer bio for the profile.'),\n did: z.string().describe('Decentralized Identifier for the profile. (auto-assigned)'),\n isPrivate: z\n .boolean()\n .optional()\n .describe('Whether the profile is private or not and shows up in search results.'),\n profileVisibility: ProfileVisibilityEnum.default('public')\n .optional()\n .describe(\"Profile visibility: 'public', 'connections_only', or 'private'.\"),\n showEmail: z\n .boolean()\n .default(false)\n .optional()\n .describe('Whether to show email to connections.'),\n allowConnectionRequests: AllowConnectionRequestsEnum.default('anyone')\n .optional()\n .describe(\"Who can send connection requests: 'anyone' or 'invite_only'.\"),\n email: z.string().optional().describe('Contact email address for the profile. (deprecated)'),\n image: z.string().optional().describe('Profile image URL for the profile.'),\n heroImage: z.string().optional().describe('Hero image URL for the profile.'),\n websiteLink: z.string().optional().describe('Website link for the profile.'),\n isServiceProfile: z\n .boolean()\n .default(false)\n .optional()\n .describe('Whether the profile is a service profile or not.'),\n type: z.string().optional().describe('Profile type: e.g. \"person\", \"organization\", \"service\".'),\n notificationsWebhook: z\n .string()\n .url()\n .startsWith('http')\n .optional()\n .describe('URL to send notifications to.'),\n display: LCNProfileDisplayValidator.optional().describe('Display settings for the profile.'),\n highlightedCredentials: z\n .array(z.string())\n .max(5)\n .optional()\n .describe('Up to 5 unique boost URIs to highlight on the profile.'),\n role: z\n .string()\n .default('')\n .optional()\n .describe('Role of the profile: e.g. \"teacher\", \"student\".'),\n dob: z\n .string()\n .default('')\n .optional()\n .describe('Date of birth of the profile: e.g. \"1990-01-01\".'),\n country: z.string().optional().describe('Country for the profile.'),\n locale: z\n .string()\n .optional()\n .describe(\n \"BCP-47 language tag (e.g. 'es', 'fr', 'ar') \u2014 the user's preferred language for server-sent notifications and emails.\"\n ),\n approved: z.boolean().optional().describe('Approval status for the profile.'),\n});\nexport type LCNProfile = z.infer<typeof LCNProfileValidator>;\n\nexport const LCNPublicProfileValidator = LCNProfileValidator.pick({\n profileId: true,\n displayName: true,\n shortBio: true,\n image: true,\n heroImage: true,\n type: true,\n isServiceProfile: true,\n display: true,\n});\nexport type LCNPublicProfile = z.infer<typeof LCNPublicProfileValidator>;\n\nexport const LCNConnectionPromptStatusValidator = z.enum(['PENDING', 'SKIPPED', 'CONNECTED']);\nexport type LCNConnectionPromptStatus = z.infer<typeof LCNConnectionPromptStatusValidator>;\n\nexport const LCNConnectionPromptSurfaceValidator = z.enum(['POST_CLAIM', 'NOTIFICATION']);\nexport type LCNConnectionPromptSurface = z.infer<typeof LCNConnectionPromptSurfaceValidator>;\n\nexport const LCNConnectionPromptActionStatusValidator = z.enum([\n 'PENDING',\n 'SKIPPED',\n 'CONNECTED',\n 'STALE',\n]);\nexport type LCNConnectionPromptActionStatus = z.infer<\n typeof LCNConnectionPromptActionStatusValidator\n>;\n\nexport const LCNConnectionPromptValidator = z.object({\n promptId: z.string().uuid(),\n status: LCNConnectionPromptStatusValidator,\n surface: LCNConnectionPromptSurfaceValidator,\n triggerId: z.string(),\n triggeredAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n counterpart: LCNPublicProfileValidator,\n});\nexport type LCNConnectionPrompt = z.infer<typeof LCNConnectionPromptValidator>;\n\nexport const LCNConnectionPromptActionResultValidator = z.object({\n promptId: z.string().uuid(),\n status: LCNConnectionPromptActionStatusValidator,\n});\nexport type LCNConnectionPromptActionResult = z.infer<\n typeof LCNConnectionPromptActionResultValidator\n>;\n\nexport const LCNConnectionPromptMetadataValidator = z.object({\n promptId: z.string().uuid(),\n counterpartProfileId: z.string(),\n});\nexport type LCNConnectionPromptMetadata = z.infer<typeof LCNConnectionPromptMetadataValidator>;\n\nexport const LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({\n bio: LCNProfileValidator.shape.bio,\n websiteLink: LCNProfileValidator.shape.websiteLink,\n role: LCNProfileValidator.shape.role,\n highlightedCredentials: LCNProfileValidator.shape.highlightedCredentials,\n did: LCNProfileValidator.shape.did,\n});\nexport type LCNAuthedProfile = z.infer<typeof LCNAuthedProfileValidator>;\n\nexport const LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({\n email: LCNProfileValidator.shape.email,\n connectedAt: z.iso\n .datetime()\n .optional()\n .describe('When the viewer and this profile became connected.'),\n});\nexport type LCNConnectionProfile = z.infer<typeof LCNConnectionProfileValidator>;\n\nexport const LCNVisibleProfileValidator = z.union([\n LCNConnectionProfileValidator.strict(),\n LCNAuthedProfileValidator.strict(),\n LCNPublicProfileValidator.strict(),\n LCNProfileValidator,\n]);\nexport type LCNVisibleProfile = z.infer<typeof LCNVisibleProfileValidator>;\n\nexport const LCNProfileQueryValidator = z\n .object({\n profileId: StringQuery,\n displayName: StringQuery,\n shortBio: StringQuery,\n bio: StringQuery,\n email: StringQuery,\n websiteLink: StringQuery,\n isServiceProfile: z.boolean(),\n type: StringQuery,\n })\n .partial();\nexport type LCNProfileQuery = z.infer<typeof LCNProfileQueryValidator>;\n\nexport const PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({\n records: LCNProfileValidator.array(),\n});\nexport type PaginatedLCNProfiles = z.infer<typeof PaginatedLCNProfilesValidator>;\n\nexport const PaginatedVisibleLCNProfilesValidator = PaginationResponseValidator.extend({\n records: LCNVisibleProfileValidator.array(),\n});\nexport type PaginatedVisibleLCNProfiles = z.infer<typeof PaginatedVisibleLCNProfilesValidator>;\n\nexport const LCNProfileConnectionStatusEnum = z.enum([\n 'CONNECTED',\n 'PENDING_REQUEST_SENT',\n 'PENDING_REQUEST_RECEIVED',\n 'NOT_CONNECTED',\n]);\nexport type LCNProfileConnectionStatusEnum = z.infer<typeof LCNProfileConnectionStatusEnum>;\n\nexport const LCNProfileManagerValidator = z.object({\n id: z.string(),\n created: z.string(),\n displayName: z.string().default('').optional(),\n shortBio: z.string().default('').optional(),\n bio: z.string().default('').optional(),\n email: z.string().optional(),\n image: z.string().optional(),\n heroImage: z.string().optional(),\n});\nexport type LCNProfileManager = z.infer<typeof LCNProfileManagerValidator>;\n\nexport const PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({\n records: LCNProfileManagerValidator.extend({ did: z.string() }).array(),\n});\nexport type PaginatedLCNProfileManagers = z.infer<typeof PaginatedLCNProfileManagersValidator>;\n\nexport const LCNProfileManagerQueryValidator = z\n .object({\n id: StringQuery,\n displayName: StringQuery,\n shortBio: StringQuery,\n bio: StringQuery,\n email: StringQuery,\n })\n .partial();\nexport type LCNProfileManagerQuery = z.infer<typeof LCNProfileManagerQueryValidator>;\n\nexport const PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({\n records: z\n .object({\n profile: LCNProfileValidator,\n manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional(),\n })\n .array(),\n});\nexport type PaginatedLCNProfilesAndManagers = z.infer<\n typeof PaginatedLCNProfilesAndManagersValidator\n>;\n\nexport const SentCredentialInfoValidator = z.object({\n uri: z.string(),\n to: z.string(),\n from: z.string(),\n sent: z.iso.datetime(),\n received: z.iso.datetime().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\nexport type SentCredentialInfo = z.infer<typeof SentCredentialInfoValidator>;\n\nexport const BoostPermissionsValidator = z.object({\n role: z.string(),\n canView: z.boolean().default(true),\n canEdit: z.boolean(),\n canIssue: z.boolean(),\n canRevoke: z.boolean(),\n canManagePermissions: z.boolean(),\n canIssueChildren: z.string(),\n canCreateChildren: z.string(),\n canEditChildren: z.string(),\n canRevokeChildren: z.string(),\n canManageChildrenPermissions: z.string(),\n canManageChildrenProfiles: z.boolean().optional(),\n canViewAnalytics: z.boolean(),\n});\nexport type BoostPermissions = z.infer<typeof BoostPermissionsValidator>;\n\nexport const BoostPermissionsQueryValidator = z\n .object({\n role: StringQuery,\n canView: z.boolean(),\n canEdit: z.boolean(),\n canIssue: z.boolean(),\n canRevoke: z.boolean(),\n canManagePermissions: z.boolean(),\n canIssueChildren: StringQuery,\n canCreateChildren: StringQuery,\n canEditChildren: StringQuery,\n canRevokeChildren: StringQuery,\n canManageChildrenPermissions: StringQuery,\n canManageChildrenProfiles: z.boolean(),\n canViewAnalytics: z.boolean(),\n })\n .partial();\nexport type BoostPermissionsQuery = z.infer<typeof BoostPermissionsQueryValidator>;\n\nexport const ClaimHookTypeValidator = z.enum(['GRANT_PERMISSIONS', 'ADD_ADMIN', 'AUTO_CONNECT']);\nexport type ClaimHookType = z.infer<typeof ClaimHookTypeValidator>;\n\nexport const ClaimHookValidator = z.discriminatedUnion('type', [\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.GRANT_PERMISSIONS),\n data: z.object({\n claimUri: z.string(),\n targetUri: z.string(),\n permissions: BoostPermissionsValidator.partial(),\n }),\n }),\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.ADD_ADMIN),\n data: z.object({ claimUri: z.string(), targetUri: z.string() }),\n }),\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.AUTO_CONNECT),\n data: z.object({ claimUri: z.string(), targetUri: z.string() }),\n }),\n]);\nexport type ClaimHook = z.infer<typeof ClaimHookValidator>;\n\nexport const ClaimHookQueryValidator = z.object({\n type: StringQuery,\n data: z\n .object({\n claimUri: StringQuery,\n targetUri: StringQuery,\n permissions: BoostPermissionsQueryValidator.partial(),\n })\n .partial(),\n});\nexport type ClaimHookQuery = z.infer<typeof ClaimHookQueryValidator>;\n\nexport const FullClaimHookValidator = z\n .object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() })\n .and(ClaimHookValidator);\nexport type FullClaimHook = z.infer<typeof FullClaimHookValidator>;\n\nexport const PaginatedClaimHooksValidator = PaginationResponseValidator.extend({\n records: FullClaimHookValidator.array(),\n});\nexport type PaginatedClaimHooksType = z.infer<typeof PaginatedClaimHooksValidator>;\n\n/**\n * Status states for Boosts that control what actions can be performed.\n *\n * - **DRAFT**: Work in progress. Can edit all fields, but cannot send or generate claim links.\n * - **PROVISIONAL**: Active but iterating. Can both edit all fields AND send/issue credentials. Ideal for testing in production or soft launches.\n * - **LIVE**: Official/finalized. Can only edit meta and defaultPermissions. Core properties are locked for consistency.\n *\n * @example\n * ```typescript\n * // Create a provisional boost for testing\n * const boostUri = await learnCard.invoke.createBoost(credential, {\n * status: 'PROVISIONAL',\n * });\n * ```\n */\nexport const LCNBoostStatus = z.enum(['DRAFT', 'PROVISIONAL', 'LIVE']);\nexport type LCNBoostStatusEnum = z.infer<typeof LCNBoostStatus>;\n\nexport const BoostValidator = z.object({\n uri: z.string(),\n name: z.string().optional(),\n type: z.string().optional(),\n category: z.string().optional(),\n created: z.string().optional(),\n status: LCNBoostStatus.optional(),\n autoConnectRecipients: z.boolean().optional(),\n meta: z.record(z.string(), z.any()).optional(),\n claimPermissions: BoostPermissionsValidator.optional(),\n defaultPermissions: BoostPermissionsValidator.optional(),\n allowAnyoneToCreateChildren: z.boolean().optional(),\n});\nexport type Boost = z.infer<typeof BoostValidator>;\n\nconst BaseBoostQueryValidator = z\n .object({\n uri: StringQuery,\n name: StringQuery,\n type: StringQuery,\n category: StringQuery,\n meta: z.record(z.string(), StringQuery),\n status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),\n autoConnectRecipients: z.boolean(),\n })\n .partial();\n\nexport const BoostQueryValidator = z.union([\n z.object({\n $or: BaseBoostQueryValidator.array(),\n }),\n BaseBoostQueryValidator,\n]);\nexport type BoostQuery = z.infer<typeof BoostQueryValidator>;\n\nexport const PaginatedBoostsValidator = PaginationResponseValidator.extend({\n records: BoostValidator.array(),\n});\nexport type PaginatedBoostsType = z.infer<typeof PaginatedBoostsValidator>;\n\nexport const BoostRecipientValidator = z.object({\n to: LCNVisibleProfileValidator,\n from: z.string(),\n received: z.string().optional(),\n uri: z.string().optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type BoostRecipientInfo = z.infer<typeof BoostRecipientValidator>;\n\nexport const PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({\n records: BoostRecipientValidator.array(),\n});\nexport type PaginatedBoostRecipientsType = z.infer<typeof PaginatedBoostRecipientsValidator>;\n\nexport const BoostRecipientWithChildrenValidator = z.object({\n to: LCNVisibleProfileValidator,\n from: z.string(),\n received: z.string().optional(),\n boostUris: z.array(z.string()),\n credentialUris: z.array(z.string()).optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type BoostRecipientWithChildrenInfo = z.infer<typeof BoostRecipientWithChildrenValidator>;\n\nexport const PaginatedBoostRecipientsWithChildrenValidator = PaginationResponseValidator.extend({\n records: BoostRecipientWithChildrenValidator.array(),\n});\nexport type PaginatedBoostRecipientsWithChildrenType = z.infer<\n typeof PaginatedBoostRecipientsWithChildrenValidator\n>;\n\nexport const LCNBoostClaimLinkSigningAuthorityValidator = z.object({\n endpoint: z.string(),\n name: z.string(),\n did: z.string().optional(),\n});\nexport type LCNBoostClaimLinkSigningAuthorityType = z.infer<\n typeof LCNBoostClaimLinkSigningAuthorityValidator\n>;\n\nexport const LCNBoostClaimLinkOptionsValidator = z.object({\n ttlSeconds: z.number().optional(),\n totalUses: z.number().optional(),\n});\nexport type LCNBoostClaimLinkOptionsType = z.infer<typeof LCNBoostClaimLinkOptionsValidator>;\n\nexport const LCNSigningAuthorityValidator = z.object({\n endpoint: z.string(),\n});\nexport type LCNSigningAuthorityType = z.infer<typeof LCNSigningAuthorityValidator>;\n\nexport const LCNSigningAuthorityForUserValidator = z.object({\n signingAuthority: LCNSigningAuthorityValidator,\n relationship: z.object({\n name: z\n .string()\n .max(15)\n .regex(/^[a-z0-9-]+$/, {\n message:\n 'The input string must contain only lowercase letters, numbers, and hyphens.',\n }),\n did: z.string(),\n isPrimary: z.boolean().optional(),\n }),\n});\nexport type LCNSigningAuthorityForUserType = z.infer<typeof LCNSigningAuthorityForUserValidator>;\n\nexport const AutoBoostConfigValidator = z.object({\n boostUri: z.string(),\n signingAuthority: z.object({\n endpoint: z.string(),\n name: z.string(),\n }),\n});\nexport type AutoBoostConfig = z.infer<typeof AutoBoostConfigValidator>;\n\nconst SendBoostTemplateValidator = BoostValidator.partial()\n .omit({ uri: true, claimPermissions: true })\n .extend({\n credential: VCValidator.or(UnsignedVCValidator),\n claimPermissions: BoostPermissionsValidator.partial().optional(),\n skills: z\n .array(\n z.object({\n frameworkId: z.string(),\n id: z.string(),\n proficiencyLevel: z.number().optional(),\n })\n )\n .min(1)\n .optional(),\n });\n\n// Branding options for email/SMS delivery (used when recipient is email/phone)\nexport const SendBrandingOptionsValidator = z.object({\n issuerName: z.string().optional().describe('Name of the issuing organization'),\n issuerLogoUrl: z.string().url().optional().describe('Logo URL of the issuing organization'),\n credentialName: z.string().optional().describe('Display name for the credential'),\n recipientName: z.string().optional().describe('Name of the recipient for personalization'),\n});\nexport type SendBrandingOptions = z.infer<typeof SendBrandingOptionsValidator>;\n\nexport const GuardianStatusValidator = z.enum([\n 'AWAITING_GUARDIAN',\n 'GUARDIAN_APPROVED',\n 'GUARDIAN_REJECTED',\n]);\nexport type GuardianStatus = z.infer<typeof GuardianStatusValidator>;\n\n// Options for send method (applies when recipient is email/phone, routes to Universal Inbox)\nexport const SendOptionsValidator = z.object({\n webhookUrl: z.string().url().optional().describe('Webhook URL to receive claim notifications'),\n suppressDelivery: z\n .boolean()\n .optional()\n .describe('If true, returns claimUrl without sending email/SMS'),\n branding: SendBrandingOptionsValidator.optional().describe('Branding for email/SMS delivery'),\n guardianEmail: z\n .string()\n .email()\n .optional()\n .describe('Guardian email that must approve before student can claim'),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'How many days the credential stays claimable in the Universal Inbox (default 30). Does not change the credential validity period.'\n ),\n});\nexport type SendOptions = z.infer<typeof SendOptionsValidator>;\n\n// Route-level validator (TRPC requires ZodObject, not discriminatedUnion)\nexport const SendBoostInputValidator = z\n .object({\n type: z.literal('boost'),\n recipient: z.string().describe('Profile ID, DID, email, or phone number (auto-detected)'),\n contractUri: z.string().optional(),\n templateUri: z.string().optional(),\n template: SendBoostTemplateValidator.optional(),\n signedCredential: VCValidator.optional(),\n options: SendOptionsValidator.optional().describe(\n 'Options for email/phone recipients (Universal Inbox)'\n ),\n templateData: z.record(z.string(), z.unknown()).optional(),\n integrationId: z.string().optional().describe('Integration ID for activity tracking'),\n })\n .refine(data => data.templateUri || data.template || data.signedCredential, {\n message: 'Either templateUri, template, or signedCredential must be provided.',\n path: ['templateUri'],\n })\n .refine(\n data => {\n if (data.options?.guardianEmail) {\n return data.options.guardianEmail.toLowerCase() !== data.recipient.toLowerCase();\n }\n return true;\n },\n {\n message: 'guardianEmail must differ from recipient (self-approval not allowed)',\n path: ['options', 'guardianEmail'],\n }\n );\nexport type SendBoostInput = z.infer<typeof SendBoostInputValidator>;\n\n// Inbox-specific response fields (only present when sent via email/phone)\nexport const SendInboxResponseValidator = z.object({\n issuanceId: z.string(),\n status: z.enum(['PENDING', 'ISSUED', 'EXPIRED', 'DELIVERED', 'CLAIMED']),\n claimUrl: z.string().url().optional().describe('Present when suppressDelivery=true'),\n guardianStatus: GuardianStatusValidator.optional().describe(\n 'Present when guardianEmail was specified'\n ),\n});\nexport type SendInboxResponse = z.infer<typeof SendInboxResponseValidator>;\n\nexport const SendBoostResponseValidator = z.object({\n type: z.literal('boost'),\n credentialUri: z.string(),\n uri: z.string(),\n activityId: z.string().describe('Links to the activity lifecycle for this issuance'),\n inbox: SendInboxResponseValidator.optional().describe(\n 'Present when sent via email/phone (Universal Inbox)'\n ),\n});\nexport type SendBoostResponse = z.infer<typeof SendBoostResponseValidator>;\n\n// Plugin-level discriminated union (for extensibility)\nexport const SendInputValidator = z.discriminatedUnion('type', [SendBoostInputValidator]);\nexport type SendInput = z.infer<typeof SendInputValidator>;\n\nexport const SendResponseValidator = z.discriminatedUnion('type', [SendBoostResponseValidator]);\nexport type SendResponse = z.infer<typeof SendResponseValidator>;\n\nexport const ConsentFlowTermsStatusValidator = z.enum(['live', 'stale', 'withdrawn']);\nexport type ConsentFlowTermsStatus = z.infer<typeof ConsentFlowTermsStatusValidator>;\n\nexport const ConsentFlowContractValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n categories: z\n .record(\n z.string(),\n z.object({\n required: z.boolean(),\n defaultEnabled: z.boolean().optional(),\n })\n )\n .default({}),\n })\n .prefault({ categories: {} }),\n personal: z\n .record(\n z.string(),\n z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })\n )\n .default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n write: z\n .object({\n credentials: z\n .object({\n categories: z\n .record(\n z.string(),\n z.object({\n required: z.boolean(),\n defaultEnabled: z.boolean().optional(),\n })\n )\n .default({}),\n })\n .prefault({ categories: {} }),\n personal: z\n .record(\n z.string(),\n z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })\n )\n .default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n});\nexport type ConsentFlowContract = z.infer<typeof ConsentFlowContractValidator>;\nexport type ConsentFlowContractInput = z.input<typeof ConsentFlowContractValidator>;\n\nexport const ConsentFlowContractDetailsValidator = z.object({\n contract: ConsentFlowContractValidator,\n owner: LCNProfileValidator,\n name: z.string(),\n subtitle: z.string().optional(),\n description: z.string().optional(),\n reasonForAccessing: z.string().optional(),\n image: z.string().optional(),\n uri: z.string(),\n needsGuardianConsent: z.boolean().optional(),\n redirectUrl: z.string().optional(),\n frontDoorBoostUri: z.string().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n expiresAt: z.string().optional(),\n autoBoosts: z.string().array().optional(),\n writers: z.array(LCNProfileValidator).optional(),\n});\nexport type ConsentFlowContractDetails = z.infer<typeof ConsentFlowContractDetailsValidator>;\nexport type ConsentFlowContractDetailsInput = z.input<typeof ConsentFlowContractDetailsValidator>;\n\nexport const ConsentFlowContractRequestStatusValidator = z\n .enum(['pending', 'accepted', 'denied'])\n .nullable();\nexport type ConsentFlowContractRequestStatus = z.infer<\n typeof ConsentFlowContractRequestStatusValidator\n>;\n\nexport const ConsentFlowContractRequestReadStatusValidator = z.enum(['unseen', 'seen']).nullable();\nexport type ConsentFlowContractRequestReadStatus = z.infer<\n typeof ConsentFlowContractRequestReadStatusValidator\n>;\n\nexport const ConsentFlowContractRequestForProfileValidator = z.object({\n profile: LCNProfileValidator,\n status: ConsentFlowContractRequestStatusValidator,\n readStatus: ConsentFlowContractRequestReadStatusValidator.optional(),\n});\nexport type ConsentFlowContractRequestForProfile = z.infer<\n typeof ConsentFlowContractRequestForProfileValidator\n>;\n\nexport const ConsentFlowContractRequestForProfileListValidator = z.array(\n ConsentFlowContractRequestForProfileValidator\n);\nexport type ConsentFlowContractRequestForProfileList = z.infer<\n typeof ConsentFlowContractRequestForProfileListValidator\n>;\n\nexport const PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array(),\n});\nexport type PaginatedConsentFlowContracts = z.infer<typeof PaginatedConsentFlowContractsValidator>;\n\nexport const ConsentFlowContractDataValidator = z.object({\n credentials: z.object({ categories: z.record(z.string(), z.string().array()).default({}) }),\n personal: z.record(z.string(), z.string()).default({}),\n date: z.string(),\n});\nexport type ConsentFlowContractData = z.infer<typeof ConsentFlowContractDataValidator>;\n\nexport const PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDataValidator.array(),\n});\nexport type PaginatedConsentFlowData = z.infer<typeof PaginatedConsentFlowDataValidator>;\n\nexport const ConsentFlowTermValidator = z.object({\n sharing: z.boolean().optional(),\n shared: z.string().array().optional(),\n shareAll: z.boolean().optional(),\n shareUntil: z.string().optional(),\n});\nexport type ConsentFlowTerm = z.infer<typeof ConsentFlowTermValidator>;\n\nexport const ConsentFlowTermsValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n shareAll: z.boolean().optional(),\n sharing: z.boolean().optional(),\n categories: z.record(z.string(), ConsentFlowTermValidator).default({}),\n })\n .prefault({ categories: {} }),\n personal: z.record(z.string(), z.string()).default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n write: z\n .object({\n credentials: z\n .object({ categories: z.record(z.string(), z.boolean()).default({}) })\n .prefault({ categories: {} }),\n personal: z.record(z.string(), z.boolean()).default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n deniedWriters: z.array(z.string()).optional(),\n});\nexport type ConsentFlowTerms = z.infer<typeof ConsentFlowTermsValidator>;\nexport type ConsentFlowTermsInput = z.input<typeof ConsentFlowTermsValidator>;\nexport const PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({\n records: z\n .object({\n expiresAt: z.string().optional(),\n oneTime: z.boolean().optional(),\n terms: ConsentFlowTermsValidator,\n contract: ConsentFlowContractDetailsValidator,\n uri: z.string(),\n consenter: LCNProfileValidator,\n status: ConsentFlowTermsStatusValidator,\n })\n .array(),\n});\nexport type PaginatedConsentFlowTerms = z.infer<typeof PaginatedConsentFlowTermsValidator>;\n\nexport const ConsentFlowGuardianApprovalValidator = z.object({\n guardianProfileId: z.string(),\n guardianDid: z.string(),\n approvedAt: z.string().datetime(),\n contractUpdatedAt: z.string(),\n});\nexport type ConsentFlowGuardianApproval = z.infer<typeof ConsentFlowGuardianApprovalValidator>;\n\nexport const ConsentFlowContractDataForDidValidator = z.object({\n credentials: z.object({ category: z.string(), uri: z.string() }).array(),\n personal: z.record(z.string(), z.string()).default({}),\n date: z.string(),\n createdAt: z.string().optional(),\n contractUpdatedAt: z.string(),\n contractExpiresAt: z.string().optional(),\n reasonForAccessing: z.string().optional(),\n guardian: z.object({\n required: z.boolean(),\n approved: z.boolean(),\n approval: ConsentFlowGuardianApprovalValidator.optional(),\n }),\n contractUri: z.string(),\n termsUri: z.string(),\n status: ConsentFlowTermsStatusValidator,\n expiresAt: z.string().optional(),\n terms: ConsentFlowTermsValidator,\n});\nexport type ConsentFlowContractDataForDid = z.infer<typeof ConsentFlowContractDataForDidValidator>;\n\nexport const PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDataForDidValidator.array(),\n});\nexport type PaginatedConsentFlowDataForDid = z.infer<\n typeof PaginatedConsentFlowDataForDidValidator\n>;\n\nexport const ConsentFlowContractQueryValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n categories: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n personal: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n write: z\n .object({\n credentials: z\n .object({\n categories: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n personal: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n});\nexport type ConsentFlowContractQuery = z.infer<typeof ConsentFlowContractQueryValidator>;\nexport type ConsentFlowContractQueryInput = z.input<typeof ConsentFlowContractQueryValidator>;\n\nexport const ConsentFlowDataQueryValidator = z.object({\n anonymize: z.boolean().optional(),\n credentials: z.object({ categories: z.record(z.string(), z.boolean()).optional() }).optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n});\nexport type ConsentFlowDataQuery = z.infer<typeof ConsentFlowDataQueryValidator>;\nexport type ConsentFlowDataQueryInput = z.input<typeof ConsentFlowDataQueryValidator>;\n\nexport const ConsentFlowDataForDidQueryValidator = z.object({\n credentials: z.object({ categories: z.record(z.string(), z.boolean()).optional() }).optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n id: StringQuery.optional(),\n});\nexport type ConsentFlowDataForDidQuery = z.infer<typeof ConsentFlowDataForDidQueryValidator>;\nexport type ConsentFlowDataForDidQueryInput = z.input<typeof ConsentFlowDataForDidQueryValidator>;\n\nexport const ConsentFlowTermsQueryValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n shareAll: z.boolean().optional(),\n sharing: z.boolean().optional(),\n categories: z\n .record(z.string(), ConsentFlowTermValidator.optional())\n .optional(),\n })\n .optional(),\n personal: z.record(z.string(), z.string()).optional(),\n })\n .optional(),\n write: z\n .object({\n credentials: z\n .object({ categories: z.record(z.string(), z.boolean()).optional() })\n .optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n })\n .optional(),\n});\nexport type ConsentFlowTermsQuery = z.infer<typeof ConsentFlowTermsQueryValidator>;\nexport type ConsentFlowTermsQueryInput = z.input<typeof ConsentFlowTermsQueryValidator>;\n\nexport const ConsentFlowTransactionActionValidator = z.enum([\n 'consent',\n 'update',\n 'sync',\n 'withdraw',\n 'write',\n]);\nexport type ConsentFlowTransactionAction = z.infer<typeof ConsentFlowTransactionActionValidator>;\n\nexport const ConsentFlowTransactionsQueryValidator = z.object({\n terms: ConsentFlowTermsQueryValidator.optional(),\n action: ConsentFlowTransactionActionValidator.or(\n ConsentFlowTransactionActionValidator.array()\n ).optional(),\n date: z\n .object({ $gt: z.string() })\n .or(z.object({ $lt: z.string() }))\n .or(z.object({ $eq: z.string() }))\n .optional(),\n expiresAt: z\n .object({ $gt: z.string() })\n .or(z.object({ $lt: z.string() }))\n .or(z.object({ $eq: z.string() }))\n .optional(),\n oneTime: z.boolean().optional(),\n});\nexport type ConsentFlowTransactionsQuery = z.infer<typeof ConsentFlowTransactionsQueryValidator>;\nexport type ConsentFlowTransactionsQueryInput = z.input<\n typeof ConsentFlowTransactionsQueryValidator\n>;\n\nexport const ConsentFlowTransactionValidator = z.object({\n expiresAt: z.string().optional(),\n oneTime: z.boolean().optional(),\n terms: ConsentFlowTermsValidator.optional(),\n guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),\n id: z.string(),\n action: ConsentFlowTransactionActionValidator,\n date: z.string(),\n uris: z.string().array().optional(),\n});\nexport type ConsentFlowTransaction = z.infer<typeof ConsentFlowTransactionValidator>;\n\nexport const HolderExportConsentRecordValidator = z.object({\n termsUri: z.string(),\n status: ConsentFlowTermsStatusValidator,\n contract: ConsentFlowContractDetailsValidator,\n terms: ConsentFlowTermsValidator,\n transactions: ConsentFlowTransactionValidator.array(),\n});\nexport type HolderExportConsentRecord = z.infer<typeof HolderExportConsentRecordValidator>;\n\nexport const HolderExportMetadataValidator = z.object({\n consentRecords: HolderExportConsentRecordValidator.array(),\n truncated: z.boolean().optional(),\n warnings: z.string().array().optional(),\n limits: z\n .object({\n maxConsentRecords: z.number(),\n maxTransactionsPerConsentRecord: z.number(),\n })\n .optional(),\n});\nexport type HolderExportMetadata = z.infer<typeof HolderExportMetadataValidator>;\n\nexport const PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({\n records: ConsentFlowTransactionValidator.array(),\n});\nexport type PaginatedConsentFlowTransactions = z.infer<\n typeof PaginatedConsentFlowTransactionsValidator\n>;\n\n// Skill Frameworks: Query + Paginated types\nconst BaseSkillFrameworkQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n sourceURI: StringQuery,\n status: StringQuery,\n })\n .partial();\n\nexport const SkillFrameworkQueryValidator = z.union([\n z.object({ $or: BaseSkillFrameworkQueryValidator.array() }),\n BaseSkillFrameworkQueryValidator,\n]);\nexport type SkillFrameworkQuery = z.infer<typeof SkillFrameworkQueryValidator>;\n\n// moved below SkillFrameworkValidator\n\nexport const ContractCredentialValidator = z.object({\n credentialUri: z.string(),\n termsUri: z.string(),\n contractUri: z.string(),\n boostUri: z.string(),\n category: z.string().optional(),\n date: z.string(),\n});\nexport type ContractCredential = z.infer<typeof ContractCredentialValidator>;\n\nexport const PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({\n records: ContractCredentialValidator.array(),\n});\nexport type PaginatedContractCredentials = z.infer<typeof PaginatedContractCredentialsValidator>;\n\nexport const LCNNotificationTypeEnumValidator = z.enum([\n 'CONNECTION_REQUEST',\n 'CONNECTION_REQUEST_EXPIRED_INVITE',\n 'CONNECTION_ACCEPTED',\n 'CREDENTIAL_RECEIVED',\n 'CREDENTIAL_ACCEPTED',\n 'BOOST_RECEIVED',\n 'BOOST_ACCEPTED',\n 'PRESENTATION_REQUEST',\n 'PRESENTATION_RECEIVED',\n 'CONSENT_FLOW_TRANSACTION',\n 'ISSUANCE_CLAIMED',\n 'ISSUANCE_DELIVERED',\n 'ISSUANCE_ERROR',\n 'PROFILE_PARENT_APPROVED',\n 'APP_LISTING_SUBMITTED',\n 'APP_LISTING_APPROVED',\n 'APP_LISTING_REJECTED',\n 'APP_LISTING_WITHDRAWN',\n 'DEVICE_LINK_REQUEST',\n 'GUARDIAN_APPROVAL_PENDING',\n 'GUARDIAN_APPROVED',\n 'GUARDIAN_REJECTED',\n 'APP_NOTIFICATION',\n 'CREDENTIAL_REVOKED',\n 'CREDENTIAL_SUSPENDED',\n 'CREDENTIAL_UNSUSPENDED',\n 'CREDENTIAL_REFRESHED',\n]);\n\nexport type LCNNotificationTypeEnum = z.infer<typeof LCNNotificationTypeEnumValidator>;\n\nexport const LCNNotificationMessageValidator = z.object({\n title: z.string().optional(),\n body: z.string().optional(),\n});\n\nexport type LCNNotificationMessage = z.infer<typeof LCNNotificationMessageValidator>;\n\nexport const LCNInboxContactMethodValidator = z.object({\n type: z.string(),\n value: z.string(),\n});\n\nexport type LCNInboxContactMethod = z.infer<typeof LCNInboxContactMethodValidator>;\n\nexport const LCNInboxStatusEnumValidator = z.enum([\n 'PENDING',\n 'ISSUED',\n 'EXPIRED',\n /* DEPRECATED \u2014 use ISSUED */ 'DELIVERED',\n /* DEPRECATED \u2014 use ISSUED */ 'CLAIMED',\n]);\nexport type LCNInboxStatusEnum = z.infer<typeof LCNInboxStatusEnumValidator>;\n\nexport const LCNNotificationInboxValidator = z.object({\n issuanceId: z.string(),\n status: LCNInboxStatusEnumValidator,\n recipient: z.object({\n contactMethod: LCNInboxContactMethodValidator.optional(),\n learnCardId: z.string().optional(),\n }),\n timestamp: z.iso.datetime().optional(),\n});\n\nexport type LCNNotificationInbox = z.infer<typeof LCNNotificationInboxValidator>;\n\nexport const LCNNotificationMetadataValidator = z\n .object({\n connectionPrompt: LCNConnectionPromptMetadataValidator.optional(),\n })\n .catchall(z.unknown());\nexport type LCNNotificationMetadata = z.infer<typeof LCNNotificationMetadataValidator>;\n\nexport const LCNNotificationDataValidator = z\n .object({\n vcUris: z.array(z.string()).optional(),\n vpUris: z.array(z.string()).optional(),\n transaction: ConsentFlowTransactionValidator.optional(),\n inbox: LCNNotificationInboxValidator.optional(),\n metadata: LCNNotificationMetadataValidator.optional(),\n })\n .loose();\nexport type LCNNotificationData = z.infer<typeof LCNNotificationDataValidator>;\n\nexport const LCNNotificationValidator = z.object({\n type: LCNNotificationTypeEnumValidator,\n to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),\n from: z.union([z.string(), LCNProfileValidator.partial().and(z.object({ did: z.string() }))]),\n message: LCNNotificationMessageValidator.optional(),\n data: LCNNotificationDataValidator.optional(),\n sent: z.iso.datetime().optional(),\n webhookUrl: z.string().optional(),\n});\n\nexport type LCNNotification = z.infer<typeof LCNNotificationValidator>;\n\nexport const AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = 'auth-grant:';\n\nexport const AuthGrantValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n challenge: z\n .string()\n .startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX)\n .min(10, { message: 'Challenge is too short' })\n .max(100, { message: 'Challenge is too long' }),\n status: z.enum(['revoked', 'active'], {\n error: issue => {\n if (issue.code === 'invalid_value') return 'Status must be either active or revoked';\n return 'Status is required';\n },\n }),\n scope: z.string(),\n createdAt: z.iso.datetime({ error: 'createdAt must be a valid ISO 8601 datetime string' }),\n expiresAt: z.iso\n .datetime({ error: 'expiresAt must be a valid ISO 8601 datetime string' })\n .nullish()\n .optional(),\n});\nexport type AuthGrantType = z.infer<typeof AuthGrantValidator>;\n\nexport const FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());\nexport type FlatAuthGrantType = z.infer<typeof FlatAuthGrantValidator>;\n\nexport const AuthGrantStatusValidator = z.enum(['active', 'revoked']);\n\nexport type AuthGrantStatus = z.infer<typeof AuthGrantStatusValidator>;\n\nexport const AuthGrantQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n status: AuthGrantStatusValidator,\n })\n .partial();\n\nexport type AuthGrantQuery = z.infer<typeof AuthGrantQueryValidator>;\n\n// Contact Methods\nconst contactMethodBase = z.object({\n id: z.string(),\n isVerified: z.boolean(),\n verifiedAt: z.string().optional(),\n isPrimary: z.boolean(),\n createdAt: z.string(),\n});\n\nexport const ContactMethodValidator = z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('email'),\n value: z.string().email(),\n })\n .merge(contactMethodBase),\n z\n .object({\n type: z.literal('phone'),\n value: z.string(), // Can be improved with a regex later\n })\n .merge(contactMethodBase),\n]);\n\nexport type ContactMethodType = z.infer<typeof ContactMethodValidator>;\n\nconst createContactMethodBase = z.object({\n isVerified: z.boolean().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport const ContactMethodCreateValidator = z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('email'),\n value: z.string().email(),\n })\n .merge(createContactMethodBase),\n z\n .object({\n type: z.literal('phone'),\n value: z.string(),\n })\n .merge(createContactMethodBase),\n]);\n\nexport type ContactMethodCreateType = z.infer<typeof ContactMethodCreateValidator>;\n\nexport const ContactMethodQueryValidator = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('email'),\n value: z.string().email(),\n }),\n z.object({\n type: z.literal('phone'),\n value: z.string(),\n }),\n]);\n\nexport type ContactMethodQueryType = z.infer<typeof ContactMethodQueryValidator>;\n\nexport const ContactMethodVerificationRequestValidator = z.object({\n value: z.string(),\n type: z.enum(['email', 'phone']),\n});\n\nexport type ContactMethodVerificationRequestType = z.infer<\n typeof ContactMethodVerificationRequestValidator\n>;\n\nexport const ContactMethodVerificationValidator = z.object({\n token: z.string(),\n});\n\nexport type ContactMethodVerificationType = z.infer<typeof ContactMethodVerificationValidator>;\n\nexport const SetPrimaryContactMethodValidator = z.object({\n contactMethodId: z.string(),\n});\n\nexport type SetPrimaryContactMethodType = z.infer<typeof SetPrimaryContactMethodValidator>;\n\n// Create Inbox Claim Session for a Contact Method\nexport const CreateContactMethodSessionValidator = z.object({\n contactMethod: ContactMethodVerificationRequestValidator,\n otpChallenge: z.string(),\n});\n\nexport type CreateContactMethodSessionType = z.infer<typeof CreateContactMethodSessionValidator>;\n\nexport const CreateContactMethodSessionResponseValidator = z.object({\n sessionJwt: z.string(),\n});\n\nexport type CreateContactMethodSessionResponseType = z.infer<\n typeof CreateContactMethodSessionResponseValidator\n>;\n\n// Inbox Credentials\nexport const InboxCredentialValidator = z.object({\n id: z.string(),\n credential: z.string().optional(),\n isSigned: z.boolean(),\n currentStatus: LCNInboxStatusEnumValidator,\n isAccepted: z.boolean().optional(),\n expiresAt: z.string(),\n createdAt: z.string(),\n finalizedAt: z.string().optional(),\n expiredAt: z.string().optional(),\n credentialName: z.string().optional(),\n achievementType: z.string().optional(),\n issuerDid: z.string(),\n webhookUrl: z.string().optional(),\n boostUri: z.string().optional(),\n activityId: z.string().optional(),\n integrationId: z.string().optional(),\n signingAuthority: z\n .object({\n endpoint: z.string().optional(),\n name: z.string().optional(),\n })\n .optional(),\n // Guardian gate fields (all optional \u2014 absent on pre-existing credentials)\n guardianEmail: z.string().email().optional(),\n guardianStatus: GuardianStatusValidator.optional(),\n guardianApprovedAt: z.string().optional(),\n guardianApprovedByDid: z.string().optional(),\n});\n\nexport type InboxCredentialType = z.infer<typeof InboxCredentialValidator>;\n\nexport const PaginatedInboxCredentialsValidator = z.object({\n hasMore: z.boolean(),\n records: z.array(InboxCredentialValidator),\n cursor: z.string().optional(),\n});\n\nexport type PaginatedInboxCredentialsType = z.infer<typeof PaginatedInboxCredentialsValidator>;\n\nexport const InboxCredentialQueryValidator = z\n .object({\n currentStatus: LCNInboxStatusEnumValidator,\n id: z.string(),\n isSigned: z.boolean(),\n isAccepted: z.boolean().optional(),\n issuerDid: z.string(),\n boostUri: z.string(),\n })\n .partial();\n\nexport type InboxCredentialQuery = z.infer<typeof InboxCredentialQueryValidator>;\n\nexport const IssueInboxSigningAuthorityValidator = z.object({\n endpoint: z.string().url(),\n name: z.string(),\n});\n\nexport type IssueInboxSigningAuthority = z.infer<typeof IssueInboxSigningAuthorityValidator>;\n\nexport const IssueInboxCredentialValidator = z\n .object({\n // === CORE DATA (Required) ===\n // WHAT is being sent and WHO is it for?\n recipient: ContactMethodQueryValidator.describe('The recipient of the credential'),\n\n // Either credential OR templateUri must be provided\n credential: VCValidator.or(VPValidator)\n .or(UnsignedVCValidator)\n .optional()\n .describe(\n 'The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration.'\n ),\n templateUri: z\n .string()\n .optional()\n .describe(\n 'URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field.'\n ),\n\n // === OPTIONAL FEATURES ===\n // Add major, distinct features at the top level.\n //consentRequest: ConsentRequestValidator.optional(),\n\n // === PROCESS CONFIGURATION (Optional) ===\n // HOW should this issuance be handled?\n configuration: z\n .object({\n signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(\n 'The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed.'\n ),\n webhookUrl: z\n .string()\n .url()\n .optional()\n .describe('The webhook URL to receive credential issuance events.'),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'How many days the encrypted inbox payload remains claimable. This does not change the credential validity period.'\n ),\n templateData: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n 'Template data to render into the boost credential template using Mustache syntax. Only used when boostUri is provided.'\n ),\n // --- For User-Facing Delivery (Email/SMS) ---\n delivery: z\n .object({\n suppress: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n 'Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users.'\n ),\n template: z\n .object({\n id: z\n .enum(['universal-inbox-claim'])\n .optional()\n .describe(\n 'The template ID to use for the credential delivery. If not provided, the default template will be used.'\n ),\n model: z\n .object({\n issuer: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the organization (e.g., \"State University\").'\n ),\n logoUrl: z\n .string()\n .url()\n .optional()\n .describe(\n \"The URL of the organization's logo.\"\n ),\n })\n .optional(),\n credential: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the credential (e.g., \"Bachelor of Science\").'\n ),\n type: z\n .string()\n .optional()\n .describe(\n 'The type of the credential (e.g., \"degree\", \"certificate\").'\n ),\n })\n .optional(),\n recipient: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the recipient (e.g., \"John Doe\").'\n ),\n })\n .optional(),\n })\n .describe(\n 'The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.'\n ),\n })\n .optional()\n .describe(\n 'The template to use for the credential delivery. If not provided, the default template will be used.'\n ),\n })\n .optional()\n .describe(\n 'Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.'\n ),\n })\n .optional()\n .describe(\n 'Configuration for the credential issuance. If not provided, the default configuration will be used.'\n ),\n })\n .refine(data => data.credential || data.templateUri, {\n message: 'Either credential or templateUri must be provided.',\n path: ['credential'],\n });\n\nexport type IssueInboxCredentialType = z.infer<typeof IssueInboxCredentialValidator>;\n\nexport const IssueInboxCredentialResponseValidator = z.object({\n issuanceId: z.string(),\n status: LCNInboxStatusEnumValidator,\n recipient: ContactMethodQueryValidator,\n claimUrl: z.string().url().optional(),\n recipientDid: z.string().optional(),\n});\n\nexport type IssueInboxCredentialResponseType = z.infer<\n typeof IssueInboxCredentialResponseValidator\n>;\n\n/** A simple name reference that the server resolves to a boost template */\nexport const CredentialNameRefValidator = z.object({ name: z.string() }).passthrough();\n\nexport const ClaimInboxCredentialValidator = z.object({\n credential: VCValidator.or(VPValidator)\n .or(UnsignedVCValidator)\n .or(CredentialNameRefValidator)\n .describe('The credential to issue, or a { name } reference to resolve a boost template.'),\n configuration: z\n .object({\n publishableKey: z.string(),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'Inbox claim window in days. Defaults to 720; use a shorter window for sensitive records.'\n ),\n signingAuthorityName: z.string().optional(),\n listingId: z.string().optional(),\n listingSlug: z.string().optional(),\n })\n .optional(),\n});\n\nexport type ClaimInboxCredentialType = z.infer<typeof ClaimInboxCredentialValidator>;\n\n// Integrations\nexport const LCNDomainOrOriginValidator = z.union([\n z\n .string()\n .regex(\n /^(?:(?:[a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,63}|localhost|\\d{1,3}(?:\\.\\d{1,3}){3})(?::\\d{1,5})?$/,\n {\n message:\n 'Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port',\n }\n ),\n z\n .string()\n .regex(\n /^https?:\\/\\/(?:(?:[a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,63}|localhost|\\d{1,3}(?:\\.\\d{1,3}){3})(?::\\d{1,5})?$/,\n { message: 'Must be a valid http(s) origin' }\n ),\n]);\n\nexport const LCNIntegrationStatusEnum = z.enum(['setup', 'active', 'paused']);\nexport type LCNIntegrationStatus = z.infer<typeof LCNIntegrationStatusEnum>;\n\nexport const LCNIntegrationValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n publishableKey: z.string(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([]),\n\n // Setup/onboarding status\n status: LCNIntegrationStatusEnum.default('setup'),\n guideType: z.string().optional(),\n guideState: z.record(z.string(), z.any()).optional(),\n\n // Timestamps\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type LCNIntegration = z.infer<typeof LCNIntegrationValidator>;\n\nexport const LCNIntegrationCreateValidator = z.object({\n name: z.string(),\n description: z.string().optional(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([]),\n guideType: z.string().optional(),\n});\n\nexport type LCNIntegrationCreateType = z.infer<typeof LCNIntegrationCreateValidator>;\n\nexport const LCNIntegrationUpdateValidator = z.object({\n name: z.string().optional(),\n description: z.string().optional(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).optional(),\n rotatePublishableKey: z.boolean().optional(),\n\n // Setup/onboarding updates\n status: LCNIntegrationStatusEnum.optional(),\n guideType: z.string().optional(),\n guideState: z.record(z.string(), z.any()).optional(),\n});\n\nexport type LCNIntegrationUpdateType = z.infer<typeof LCNIntegrationUpdateValidator>;\n\nexport const LCNIntegrationQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n status: StringQuery,\n guideType: StringQuery,\n })\n .partial();\n\nexport type LCNIntegrationQueryType = z.infer<typeof LCNIntegrationQueryValidator>;\n\nexport const PaginatedLCNIntegrationsValidator = PaginationResponseValidator.extend({\n records: LCNIntegrationValidator.array(),\n});\n\nexport type PaginatedLCNIntegrationsType = z.infer<typeof PaginatedLCNIntegrationsValidator>;\n\nexport const ClaimTokenValidator = z.object({\n token: z.string(),\n contactMethodId: z.string(),\n autoVerifyContactMethod: z.boolean().optional().default(false),\n createdAt: z.string(),\n expiresAt: z.string(),\n used: z.boolean(),\n});\n\nexport type ClaimTokenType = z.infer<typeof ClaimTokenValidator>;\n\nexport const TagValidator = z.object({\n id: z.string(),\n name: z.string().min(1),\n slug: z.string().min(1),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type TagType = z.infer<typeof TagValidator>;\n\nexport const SkillStatusEnum = z.enum(['active', 'archived']);\nexport type SkillStatus = z.infer<typeof SkillStatusEnum>;\n\nexport const SkillValidator = z.object({\n id: z.string(),\n statement: z.string(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().default('skill'),\n status: SkillStatusEnum.default('active'),\n frameworkId: z.string().optional(),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type SkillType = z.infer<typeof SkillValidator>;\n\nconst BaseSkillQueryValidator = z\n .object({\n id: StringQuery,\n statement: StringQuery,\n description: StringQuery,\n code: StringQuery,\n type: StringQuery,\n status: SkillStatusEnum.or(z.object({ $in: SkillStatusEnum.array() })),\n })\n .partial();\n\nexport const SkillQueryValidator = z.union([\n z.object({\n $or: BaseSkillQueryValidator.array(),\n }),\n BaseSkillQueryValidator,\n]);\n\nexport type SkillQuery = z.infer<typeof SkillQueryValidator>;\n\nexport const SkillSemanticSearchInputValidator = z.object({\n text: z.string().min(1),\n frameworkId: z.string().optional(),\n limit: z.number().int().min(1).max(200).default(50),\n});\n\nexport type SkillSemanticSearchInput = z.infer<typeof SkillSemanticSearchInputValidator>;\n\nexport const SkillSemanticSearchResultItemValidator = SkillValidator.extend({\n score: z.number(),\n});\n\nexport type SkillSemanticSearchResultItem = z.infer<typeof SkillSemanticSearchResultItemValidator>;\n\nexport const SkillSemanticSearchResultValidator = z.object({\n records: SkillSemanticSearchResultItemValidator.array(),\n});\n\nexport type SkillSemanticSearchResult = z.infer<typeof SkillSemanticSearchResultValidator>;\n\nexport const SkillFrameworkStatusEnum = z.enum(['active', 'archived']);\nexport type SkillFrameworkStatus = z.infer<typeof SkillFrameworkStatusEnum>;\n\nexport const SkillFrameworkValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().default(false),\n status: SkillFrameworkStatusEnum.default('active'),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type SkillFrameworkType = z.infer<typeof SkillFrameworkValidator>;\n\nexport const PaginatedSkillFrameworksValidator = PaginationResponseValidator.extend({\n records: SkillFrameworkValidator.array(),\n});\nexport type PaginatedSkillFrameworksType = z.infer<typeof PaginatedSkillFrameworksValidator>;\n\nexport type SkillTreeNode = SkillType & {\n children: SkillTreeNode[];\n hasChildren: boolean;\n childrenCursor?: string | null;\n};\n\nexport const SkillTreeNodeValidator: z.ZodType<SkillTreeNode> = SkillValidator.extend({\n children: z.array(z.lazy(() => SkillTreeNodeValidator)),\n hasChildren: z.boolean(),\n childrenCursor: z.string().nullable().optional(),\n});\n\nexport const PaginatedSkillTreeValidator = z.object({\n hasMore: z.boolean(),\n cursor: z.string().nullable(),\n records: z.array(SkillTreeNodeValidator),\n});\n\nexport type PaginatedSkillTree = z.infer<typeof PaginatedSkillTreeValidator>;\n\nexport interface SkillTreeInput {\n id?: string;\n statement: string;\n description?: string;\n code?: string;\n icon?: string;\n type?: string;\n status?: 'active' | 'archived';\n children?: SkillTreeInput[];\n}\n\nexport const SkillTreeNodeInputValidator: z.ZodType<SkillTreeInput> = z.lazy(() =>\n z.object({\n id: z.string().optional(),\n statement: z.string(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().optional(),\n status: SkillStatusEnum.optional(),\n children: z.array(SkillTreeNodeInputValidator).optional(),\n })\n);\n\nexport const LinkProviderFrameworkInputValidator = z.object({\n frameworkId: z.string(),\n});\n\nexport type LinkProviderFrameworkInputType = z.infer<typeof LinkProviderFrameworkInputValidator>;\n\nexport const CreateManagedFrameworkInputValidator = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().optional(),\n status: SkillFrameworkStatusEnum.optional(),\n skills: z.array(SkillTreeNodeInputValidator).optional(),\n boostUris: z.array(z.string()).optional(),\n});\n\nexport type CreateManagedFrameworkInputType = z.infer<typeof CreateManagedFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type CreateManagedSkillFrameworkInput = CreateManagedFrameworkInputType;\n\nexport const UpdateFrameworkInputValidator = z\n .object({\n id: z.string(),\n name: z.string().min(1).optional(),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().optional(),\n status: SkillFrameworkStatusEnum.optional(),\n })\n .refine(\n data =>\n data.name !== undefined ||\n data.description !== undefined ||\n data.image !== undefined ||\n data.sourceURI !== undefined ||\n data.isPublic !== undefined ||\n data.status !== undefined,\n {\n message: 'At least one field must be provided to update',\n path: ['name'],\n }\n );\n\nexport type UpdateFrameworkInputType = z.infer<typeof UpdateFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type UpdateSkillFrameworkInput = UpdateFrameworkInputType;\n\nexport const DeleteFrameworkInputValidator = z.object({ id: z.string() });\n\nexport type DeleteFrameworkInputType = z.infer<typeof DeleteFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type DeleteSkillFrameworkInput = DeleteFrameworkInputType;\n\nexport const CreateManagedFrameworkBatchInputValidator = z.object({\n frameworks: z\n .array(\n CreateManagedFrameworkInputValidator.extend({\n skills: z.array(SkillTreeNodeInputValidator).optional(),\n })\n )\n .min(1),\n});\n\nexport type CreateManagedFrameworkBatchInputType = z.infer<\n typeof CreateManagedFrameworkBatchInputValidator\n>;\n\n// Back-compat alias for plugin naming\nexport type CreateManagedSkillFrameworkBatchInput = CreateManagedFrameworkBatchInputType;\n\nexport const SkillFrameworkAdminInputValidator = z.object({\n frameworkId: z.string(),\n profileId: z.string(),\n});\n\nexport type SkillFrameworkAdminInputType = z.infer<typeof SkillFrameworkAdminInputValidator>;\n\nexport const SkillFrameworkIdInputValidator = z.object({ frameworkId: z.string() });\n\nexport type SkillFrameworkIdInputType = z.infer<typeof SkillFrameworkIdInputValidator>;\n\nexport const SkillFrameworkAdminsValidator = LCNProfileValidator.array();\n\nexport type SkillFrameworkAdminsType = z.infer<typeof SkillFrameworkAdminsValidator>;\n\nexport const SyncFrameworkInputValidator = z.object({ id: z.string() });\n\nexport type SyncFrameworkInput = z.infer<typeof SyncFrameworkInputValidator>;\n\nexport const AddTagInputValidator = z.object({\n slug: z.string().min(1),\n name: z.string().min(1),\n});\n\nexport type AddTagInput = z.infer<typeof AddTagInputValidator>;\n\nexport const CreateSkillInputValidator = z.object({\n frameworkId: z.string(),\n skill: SkillTreeNodeInputValidator,\n parentId: z.string().nullable().optional(),\n});\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputValidator>;\n\nexport const UpdateSkillInputValidator = z\n .object({\n frameworkId: z.string(),\n id: z.string(),\n statement: z.string().optional(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().optional(),\n status: SkillStatusEnum.optional(),\n })\n .refine(\n data =>\n data.statement !== undefined ||\n data.description !== undefined ||\n data.code !== undefined ||\n data.icon !== undefined ||\n data.type !== undefined ||\n data.status !== undefined,\n {\n message: 'At least one field must be provided to update a skill',\n path: ['statement'],\n }\n );\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputValidator>;\n\nexport const SkillDeletionStrategyValidator = z.enum(['recursive', 'reparent']);\nexport type SkillDeletionStrategy = z.infer<typeof SkillDeletionStrategyValidator>;\n\nexport const DeleteSkillInputValidator = z.object({\n frameworkId: z.string(),\n id: z.string(),\n strategy: SkillDeletionStrategyValidator.optional().default('reparent'),\n});\n\nexport type DeleteSkillInput = z.infer<typeof DeleteSkillInputValidator>;\n\nexport const CreateSkillsBatchInputValidator = z.object({\n frameworkId: z.string(),\n skills: z.array(SkillTreeNodeInputValidator).min(1),\n parentId: z.string().nullable().optional(),\n});\n\nexport type CreateSkillsBatchInput = z.infer<typeof CreateSkillsBatchInputValidator>;\n\nexport const ReplaceSkillFrameworkSkillsInputValidator = z.object({\n frameworkId: z.string(),\n skills: z.array(SkillTreeNodeInputValidator).min(0),\n});\n\nexport type ReplaceSkillFrameworkSkillsInput = z.infer<\n typeof ReplaceSkillFrameworkSkillsInputValidator\n>;\n\nexport const ReplaceSkillFrameworkSkillsResultValidator = z.object({\n created: z.number().int().min(0),\n updated: z.number().int().min(0),\n deleted: z.number().int().min(0),\n unchanged: z.number().int().min(0),\n total: z.number().int().min(0),\n});\n\nexport type ReplaceSkillFrameworkSkillsResult = z.infer<\n typeof ReplaceSkillFrameworkSkillsResultValidator\n>;\n\nexport const CountSkillsInputValidator = z.object({\n frameworkId: z.string(),\n skillId: z.string().optional(),\n recursive: z.boolean().optional().default(false),\n onlyCountCompetencies: z.boolean().optional().default(false),\n});\n\nexport type CountSkillsInput = z.infer<typeof CountSkillsInputValidator>;\n\nexport const CountSkillsResultValidator = z.object({\n count: z.number().int().min(0),\n});\n\nexport type CountSkillsResult = z.infer<typeof CountSkillsResultValidator>;\n\nexport const GetFullSkillTreeInputValidator = z.object({\n frameworkId: z.string(),\n});\n\nexport type GetFullSkillTreeInput = z.infer<typeof GetFullSkillTreeInputValidator>;\n\nexport const GetFullSkillTreeResultValidator = z.object({\n skills: z.array(SkillTreeNodeValidator),\n});\n\nexport type GetFullSkillTreeResult = z.infer<typeof GetFullSkillTreeResultValidator>;\n\nexport const GetSkillPathInputValidator = z.object({\n frameworkId: z.string(),\n skillId: z.string(),\n});\n\nexport type GetSkillPathInput = z.infer<typeof GetSkillPathInputValidator>;\n\nexport const GetSkillPathResultValidator = z.object({\n path: z.array(SkillValidator),\n});\n\nexport type GetSkillPathResult = z.infer<typeof GetSkillPathResultValidator>;\n\n// Composite return shapes\nexport const FrameworkWithSkillsValidator = z.object({\n framework: SkillFrameworkValidator,\n skills: PaginatedSkillTreeValidator,\n});\n\nexport type FrameworkWithSkills = z.infer<typeof FrameworkWithSkillsValidator>;\n\n// Aliases used by the plugin type definitions\nexport type CreateSkillTreeInput = SkillTreeInput;\n\n// App Store Listing\nexport const AppListingStatusValidator = z.enum(['DRAFT', 'PENDING_REVIEW', 'LISTED', 'ARCHIVED']);\nexport type AppListingStatus = z.infer<typeof AppListingStatusValidator>;\n\nexport const LaunchTypeValidator = z.enum([\n 'EMBEDDED_IFRAME',\n 'SECOND_SCREEN',\n 'DIRECT_LINK',\n 'CONSENT_REDIRECT',\n 'SERVER_HEADLESS',\n 'AI_TUTOR',\n]);\nexport type LaunchType = z.infer<typeof LaunchTypeValidator>;\n\nexport const PromotionLevelValidator = z.enum([\n 'FEATURED_CAROUSEL',\n 'CURATED_LIST',\n 'STANDARD',\n 'DEMOTED',\n]);\nexport type PromotionLevel = z.infer<typeof PromotionLevelValidator>;\n\nexport const AgeRatingValidator = z.enum(['4+', '9+', '12+', '17+']);\nexport type AgeRating = z.infer<typeof AgeRatingValidator>;\n\nexport const AppStoreListingSubmitterValidator = z.object({\n profileId: z.string(),\n displayName: z.string(),\n email: z.string().optional(),\n});\n\nexport type AppStoreListingSubmitter = z.infer<typeof AppStoreListingSubmitterValidator>;\n\nexport const AppStoreListingValidator = z.object({\n listing_id: z.string(),\n slug: z.string().optional(),\n display_name: z.string(),\n tagline: z.string(),\n full_description: z.string(),\n icon_url: z.string(),\n app_listing_status: AppListingStatusValidator,\n launch_type: LaunchTypeValidator,\n launch_config_json: z.string(),\n category: z.string().optional(),\n promo_video_url: z.string().optional(),\n promotion_level: PromotionLevelValidator.optional(),\n ios_app_store_id: z.string().optional(),\n android_app_store_id: z.string().optional(),\n privacy_policy_url: z.string().optional(),\n terms_url: z.string().optional(),\n highlights: z.array(z.string()).optional(),\n screenshots: z.array(z.string()).optional(),\n hero_background_color: z.string().optional(),\n min_age: z.number().int().min(0).max(18).optional(),\n age_rating: AgeRatingValidator.optional(),\n submitted_at: z.string().optional(),\n submitter: AppStoreListingSubmitterValidator.optional(),\n contact_email: z.string().email().optional(),\n});\n\nexport type AppStoreListing = z.infer<typeof AppStoreListingValidator>;\n\nexport const AppStoreListingCreateValidator = AppStoreListingValidator.omit({\n listing_id: true,\n app_listing_status: true,\n promotion_level: true,\n});\n\nexport type AppStoreListingCreateType = z.infer<typeof AppStoreListingCreateValidator>;\n\nexport const AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({\n listing_id: true,\n app_listing_status: true,\n promotion_level: true,\n});\n\nexport type AppStoreListingUpdateType = z.infer<typeof AppStoreListingUpdateValidator>;\n\nexport const InstalledAppValidator = AppStoreListingValidator.extend({\n installed_at: z.string(),\n});\n\nexport type InstalledApp = z.infer<typeof InstalledAppValidator>;\n\nexport const PaginatedAppStoreListingsValidator = PaginationResponseValidator.extend({\n records: AppStoreListingValidator.array(),\n});\n\nexport type PaginatedAppStoreListings = z.infer<typeof PaginatedAppStoreListingsValidator>;\n\nexport const PaginatedInstalledAppsValidator = PaginationResponseValidator.extend({\n records: InstalledAppValidator.array(),\n});\n\nexport type PaginatedInstalledApps = z.infer<typeof PaginatedInstalledAppsValidator>;\n\n// App Store Boost Association\nexport const AppBoostValidator = z.object({\n templateAlias: z\n .string()\n .min(1)\n .max(50)\n .regex(/^[a-z0-9-]+$/),\n boostUri: z.string(),\n});\n\nexport type AppBoost = z.infer<typeof AppBoostValidator>;\n\n// App Event Types (discriminated union for type safety)\nexport const SendCredentialEventValidator = z.object({\n type: z.literal('send-credential'),\n templateAlias: z.string(),\n templateData: z.record(z.string(), z.unknown()).optional(),\n preventDuplicateClaim: z.boolean().optional(),\n});\n\nexport type SendCredentialEvent = z.infer<typeof SendCredentialEventValidator>;\n\nexport const CheckCredentialEventValidator = z\n .object({\n type: z.literal('check-credential'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type CheckCredentialEvent = z.infer<typeof CheckCredentialEventValidator>;\n\nexport const CheckIssuanceStatusEventValidator = z\n .object({\n type: z.literal('check-issuance-status'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n recipient: z.string(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type CheckIssuanceStatusEvent = z.infer<typeof CheckIssuanceStatusEventValidator>;\n\nexport const GetTemplateRecipientsEventValidator = z\n .object({\n type: z.literal('get-template-recipients'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n limit: z.number().optional(),\n cursor: z.string().optional(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type GetTemplateRecipientsEvent = z.infer<typeof GetTemplateRecipientsEventValidator>;\n\n// Request learner context event for AI tutoring systems\nexport const RequestLearnerContextEventValidator = z.object({\n type: z.literal('request-learner-context'),\n includeCredentials: z.boolean().optional().default(true),\n includePersonalData: z.boolean().optional().default(false),\n format: z.enum(['prompt', 'structured']).optional().default('prompt'),\n instructions: z.string().optional(),\n detailLevel: z.enum(['compact', 'expanded']).optional().default('compact'),\n waitForSync: z.boolean().optional().default(false),\n});\n\nexport type RequestLearnerContextEvent = z.infer<typeof RequestLearnerContextEventValidator>;\n\nexport const SummaryCredentialKeywordValidator = z.object({\n occupations: z.array(z.string()).nullable(),\n careers: z.array(z.string()).nullable(),\n jobs: z.array(z.string()).nullable(),\n skills: z.array(z.string()).nullable(),\n fieldOfStudy: z.string().nullable(),\n});\n\nexport type SummaryCredentialKeyword = z.infer<typeof SummaryCredentialKeywordValidator>;\n\nexport const SummaryCredentialDataValidator = z.object({\n title: z.string().describe('Short, concise title for the learning session or credential'),\n summary: z.string().describe('Comprehensive summary of what happened during the session'),\n learned: z.array(z.string()).describe('Bullet points of key knowledge gained'),\n skills: z\n .array(\n z.object({\n title: z.string().describe('Name of the skill category'),\n description: z\n .string()\n .describe('Detailed description of what this skill category involves'),\n })\n )\n .describe('Categorized skills learned during the session'),\n nextSteps: z\n .array(\n z.object({\n title: z.string().describe('Title of the suggested next step'),\n description: z\n .string()\n .describe('Description explaining why this next step is recommended'),\n keywords: SummaryCredentialKeywordValidator.optional().describe(\n 'Optional taxonomy keywords for occupations/careers/jobs/skills/fieldOfStudy. Omit if not relevant.'\n ),\n })\n )\n .describe('Recommended follow-up activities or learning modules'),\n reflections: z\n .array(\n z.object({\n title: z.string().describe('Title of the reflection'),\n description: z\n .string()\n .describe('Detailed description of what this reflection involves'),\n })\n )\n .describe('Reflections on the learning experience'),\n});\n\nexport type SummaryCredentialData = z.infer<typeof SummaryCredentialDataValidator>;\n\n// AI Session credential event for creating AI tutoring sessions\nexport const SendAiSessionCredentialEventValidator = z.object({\n type: z.literal('send-ai-session-credential'),\n sessionTitle: z.string(),\n summaryData: SummaryCredentialDataValidator,\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type SendAiSessionCredentialEvent = z.infer<typeof SendAiSessionCredentialEventValidator>;\n\nexport const SendNotificationEventValidator = z.object({\n type: z.literal('send-notification'),\n title: z.string().optional(),\n body: z.string().optional(),\n actionPath: z.string().optional(),\n category: z.string().optional(),\n priority: z.enum(['normal', 'high']).optional(),\n});\n\nexport type SendNotificationEvent = z.infer<typeof SendNotificationEventValidator>;\n\nconst counterKeyValidator = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'Key must be alphanumeric with _ or -');\n\nexport const IncrementCounterEventValidator = z.object({\n type: z.literal('increment-counter'),\n key: counterKeyValidator,\n amount: z.number().int().finite(),\n});\n\nexport type IncrementCounterEvent = z.infer<typeof IncrementCounterEventValidator>;\n\nexport const GetCounterEventValidator = z.object({\n type: z.literal('get-counter'),\n key: counterKeyValidator,\n});\n\nexport type GetCounterEvent = z.infer<typeof GetCounterEventValidator>;\n\nexport const GetCountersEventValidator = z.object({\n type: z.literal('get-counters'),\n keys: z.array(counterKeyValidator).min(1).max(50).optional(),\n});\n\nexport type GetCountersEvent = z.infer<typeof GetCountersEventValidator>;\n\n// Add new event types here as the union grows\nexport const AppEventValidator = z.discriminatedUnion('type', [\n SendCredentialEventValidator,\n CheckCredentialEventValidator,\n CheckIssuanceStatusEventValidator,\n GetTemplateRecipientsEventValidator,\n RequestLearnerContextEventValidator,\n SendAiSessionCredentialEventValidator,\n SendNotificationEventValidator,\n IncrementCounterEventValidator,\n GetCounterEventValidator,\n GetCountersEventValidator,\n]);\n\nexport type AppEvent = z.infer<typeof AppEventValidator>;\n\n// Full input including listingId (used by brain service)\nexport const AppEventInputValidator = z.object({\n listingId: z.string(),\n event: AppEventValidator,\n});\n\nexport type AppEventInput = z.infer<typeof AppEventInputValidator>;\n\n// Response is generic since different events may return different data\nexport const AppEventResponseValidator = z.record(z.string(), z.unknown());\n\nexport type AppEventResponse = z.infer<typeof AppEventResponseValidator>;\n// Credential Activity\nexport const CredentialActivityEventTypeValidator = z.enum([\n 'CREATED',\n 'DELIVERED',\n 'CLAIMED',\n 'EXPIRED',\n 'FAILED',\n]);\nexport type CredentialActivityEventType = z.infer<typeof CredentialActivityEventTypeValidator>;\n\nexport const CredentialActivityRecipientTypeValidator = z.enum(['profile', 'email', 'phone']);\nexport type CredentialActivityRecipientType = z.infer<\n typeof CredentialActivityRecipientTypeValidator\n>;\n\nexport const CredentialActivitySourceTypeValidator = z.enum([\n 'send',\n 'sendBoost',\n 'sendCredential',\n 'contract',\n 'claim',\n 'inbox',\n 'claimLink',\n 'acceptCredential',\n 'appEvent',\n]);\nexport type CredentialActivitySourceType = z.infer<typeof CredentialActivitySourceTypeValidator>;\n\nexport const CredentialActivityValidator = z.object({\n id: z.string(),\n activityId: z.string(),\n eventType: CredentialActivityEventTypeValidator,\n timestamp: z.string(),\n actorProfileId: z.string().optional(),\n recipientType: CredentialActivityRecipientTypeValidator,\n recipientIdentifier: z.string(),\n boostUri: z.string().optional(),\n credentialUri: z.string().optional(),\n inboxCredentialId: z.string().optional(),\n integrationId: z.string().optional(),\n source: CredentialActivitySourceTypeValidator,\n metadata: z.record(z.string(), z.unknown()).optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type CredentialActivityRecord = z.infer<typeof CredentialActivityValidator>;\n\nexport const CredentialActivityWithDetailsValidator = CredentialActivityValidator.extend({\n boost: z\n .object({\n id: z.string(),\n name: z.string().optional(),\n category: z.string().optional(),\n })\n .optional(),\n recipientProfile: z\n .object({\n profileId: z.string(),\n displayName: z.string().optional(),\n })\n .optional(),\n});\nexport type CredentialActivityWithDetails = z.infer<typeof CredentialActivityWithDetailsValidator>;\n\nexport const PaginatedCredentialActivitiesValidator = PaginationResponseValidator.extend({\n records: CredentialActivityWithDetailsValidator.array(),\n});\nexport type PaginatedCredentialActivities = z.infer<typeof PaginatedCredentialActivitiesValidator>;\n\nexport const CredentialActivityStatsValidator = z.object({\n total: z.number(),\n created: z.number(),\n delivered: z.number(),\n claimed: z.number(),\n expired: z.number(),\n failed: z.number(),\n claimRate: z.number(),\n});\nexport type CredentialActivityStats = z.infer<typeof CredentialActivityStatsValidator>;\n", "import { z } from 'zod/v4';\n\n// Helper to extract flags and pattern from regex string\nconst parseRegexString = (regexStr: string) => {\n const match = regexStr.match(/^\\/(.*)\\/([gimsuy]*)$/);\n if (!match) throw new Error('Invalid RegExp string format');\n return { pattern: match[1], flags: match[2] };\n};\n\n// TRPC validator that converts Regex strings into RegExps\nconst RegExpStringValidator = z\n .string()\n .refine(\n str => {\n try {\n parseRegexString(str);\n return true;\n } catch {\n return false;\n }\n },\n {\n message: \"Invalid RegExp string format. Must be in format '/pattern/flags'\",\n }\n )\n .transform(str => {\n const { pattern, flags } = parseRegexString(str);\n\n try {\n return new RegExp(pattern, flags);\n } catch (error) {\n throw new Error(`Invalid RegExp: ${(error as Error).message}`);\n }\n })\n .meta({ override: { type: 'string' } });\n\n// Do not use z.instanceof(RegExp) here: it is a `custom` Zod type that crashes\n// zod-openapi document generation at service boot, and `.meta({ override })` is\n// not honored for custom types. Coercing a RegExp to its `/source/flags` string\n// keeps the OpenAPI schema a plain string while still accepting RegExp inputs.\nexport const RegExpValidator = z.preprocess(\n value => (value instanceof RegExp ? `/${value.source}/${value.flags}` : value),\n RegExpStringValidator\n);\n\nconst BaseStringQuery = z\n .string()\n .or(z.object({ $in: z.string().array() }))\n .or(z.object({ $regex: RegExpValidator }));\n\nexport const StringQuery = z.union([\n BaseStringQuery,\n z.object({\n $or: BaseStringQuery.array(),\n }),\n]);\n", "/**\n * Provider-agnostic interfaces for authentication and key derivation.\n *\n * Both @learncard/sss-key-manager and learn-card-base import from here,\n * ensuring a single canonical source for abstract interfaces without\n * coupling consumers to any specific implementation.\n */\n\n// ---------------------------------------------------------------------------\n// Auth Session Error\n// ---------------------------------------------------------------------------\n\n/**\n * Typed error for auth session issues.\n * Auth providers should throw this (instead of generic Error) when the\n * session is expired, revoked, or missing so the coordinator can\n * distinguish \"not logged in\" from \"unexpected failure\".\n */\nexport class AuthSessionError extends Error {\n constructor(\n message: string,\n public readonly reason: 'expired' | 'no_session' | 'revoked' | 'network'\n ) {\n super(message);\n this.name = 'AuthSessionError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Auth Provider\n// ---------------------------------------------------------------------------\n\n/**\n * Auth provider identifier. Known values: 'firebase', 'supertokens', 'keycloak', 'oidc'.\n * Use any string to support custom auth providers without modifying this type.\n */\nexport type AuthProviderType = string;\n\nexport interface AuthUser {\n id: string;\n email?: string;\n phone?: string;\n displayName?: string;\n photoUrl?: string;\n providerType: AuthProviderType;\n\n /** Account creation timestamp (when available from the auth provider) */\n createdAt?: Date;\n}\n\n/**\n * Abstract auth provider interface.\n * Implementations wrap a specific auth SDK (Firebase, Supertokens, etc.)\n * and expose a uniform API to the coordinator.\n */\nexport interface AuthProvider {\n getIdToken(forceRefresh?: boolean): Promise<string>;\n getCurrentUser(): Promise<AuthUser | null>;\n getProviderType(): AuthProviderType;\n signOut(): Promise<void>;\n\n /**\n * Attempt to silently refresh the auth session (e.g., force-refresh\n * the JWT using the underlying refresh token).\n *\n * Returns `true` if the session was successfully refreshed.\n * Returns `false` if a full re-authentication is required.\n *\n * Optional \u2014 providers that don't implement this will require full\n * re-auth whenever the session expires.\n */\n refreshSession?(): Promise<boolean>;\n\n /**\n * Re-authenticate with a server-issued token (e.g., a Firebase custom\n * token returned after a server-side account change that invalidates\n * the current session).\n *\n * Returns the refreshed AuthUser read directly from the auth SDK\n * (not from the app store, which may be stale).\n *\n * Optional \u2014 only needed by providers whose server-side account\n * mutations invalidate the client session.\n */\n reauthenticateWithToken?(token: string): Promise<AuthUser | null>;\n}\n\n// ---------------------------------------------------------------------------\n// Sign-In Adapter (Phase 2)\n// ---------------------------------------------------------------------------\n\n/**\n * Opaque handle returned by `sendPhoneOtp()`.\n * On web this wraps a ConfirmationResult; on native it carries a verificationId.\n * Consumers pass this back to `confirmPhoneOtp()` \u2014 never inspect internals.\n */\nexport interface PhoneVerificationHandle {\n verificationId: string;\n\n /** Platform-specific confirmation object (e.g. Firebase ConfirmationResult) */\n _internal?: unknown;\n}\n\n/**\n * Abstract sign-in adapter interface.\n *\n * Encapsulates **all** provider-specific sign-in logic (Firebase, Supertokens,\n * Keycloak, \u2026). Apps register a concrete adapter at startup via\n * `registerSignInAdapterFactory()` and resolve it through the provider registry.\n *\n * The `subscribe()` method is the **single source of truth** for auth state:\n * `SignInAdapterProvider` calls it once and writes every state change to\n * `authUserStore`, replacing the Phase 1 bridge.\n *\n * Individual sign-in methods return `Promise<AuthUser>` on success and throw\n * on failure \u2014 the app-level hook (`useFirebase` / `useAuth`) handles UI\n * feedback (toasts, modals, analytics).\n */\nexport interface SignInAdapter {\n readonly providerType: AuthProviderType;\n\n // --- Auth state ---\n\n /**\n * Subscribe to auth-state changes. The callback fires immediately with\n * the current state and again on every sign-in / sign-out.\n *\n * Returns an unsubscribe function.\n */\n subscribe(onUser: (user: AuthUser | null) => void): () => void;\n\n /** Synchronous snapshot of the last user emitted by `subscribe()`. */\n getCurrentUser(): AuthUser | null;\n\n // --- Email link (passwordless) ---\n\n sendEmailLink(email: string, redirectUrl?: string): Promise<void>;\n\n verifyEmailLink(email: string, link: string): Promise<AuthUser>;\n\n isEmailLink(link: string): boolean;\n\n // --- Phone OTP ---\n\n /**\n * Send an SMS OTP to the given number.\n * On web this sets up a RecaptchaVerifier transparently.\n */\n sendPhoneOtp(phoneNumber: string): Promise<PhoneVerificationHandle>;\n\n /**\n * Confirm a phone OTP using the handle returned by `sendPhoneOtp()`.\n */\n confirmPhoneOtp(handle: PhoneVerificationHandle, code: string | number): Promise<AuthUser>;\n\n /**\n * Confirm a phone OTP using a native verificationId (Capacitor auto-verify\n * path). Falls back to `confirmPhoneOtp` when not implemented.\n */\n confirmNativePhoneOtp?(verificationId: string, code: string | number): Promise<AuthUser>;\n\n // --- OAuth ---\n\n signInWithGoogle(): Promise<AuthUser>;\n\n signInWithApple(): Promise<AuthUser>;\n\n /** Check for a pending OAuth redirect result (e.g. Apple on web). */\n checkRedirectResult?(): Promise<AuthUser | null>;\n\n // --- Custom / SSO ---\n\n signInWithCustomToken(token: string): Promise<AuthUser>;\n\n /** Sign in with an OIDC credential (e.g. Keycloak World Scouts SSO). */\n signInWithOidcCredential?(providerId: string, idToken: string): Promise<AuthUser>;\n\n // --- Account management ---\n\n deleteAccount(): Promise<void>;\n\n signOut(): Promise<void>;\n\n // --- Cleanup ---\n\n /** Tear down any DOM elements created by the adapter (e.g. RecaptchaVerifier). */\n cleanup?(): void;\n}\n\n// ---------------------------------------------------------------------------\n// Recovery (generic)\n// ---------------------------------------------------------------------------\n\n/**\n * Recovery method metadata returned by the server.\n * The `type` is a string so strategies can define their own method types\n * without modifying this interface.\n */\nexport interface RecoveryMethodInfo {\n type: string;\n createdAt: Date;\n credentialId?: string;\n}\n\n/**\n * Generic result of a successful recovery execution.\n * All strategies must produce a private key + DID.\n */\nexport interface RecoveryResult {\n privateKey: string;\n did: string;\n}\n\n// ---------------------------------------------------------------------------\n// Server Key Status\n// ---------------------------------------------------------------------------\n\n/**\n * Server key status returned by the strategy's fetchServerKeyStatus.\n * The strategy owns the server shape \u2014 different strategies may\n * have fundamentally different server payloads.\n */\nexport interface ServerKeyStatus {\n exists: boolean;\n needsMigration: boolean;\n primaryDid: string | null;\n recoveryMethods: RecoveryMethodInfo[];\n authShare: string | null;\n shareVersion: number | null;\n maskedRecoveryEmail?: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// Key Derivation Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Declarative capability flags for a key derivation strategy.\n *\n * UI components read these to decide which features to show.\n * Each strategy declares its own capabilities \u2014 no strategy-specific\n * checks needed in the UI layer.\n *\n * All flags default to `false` when absent.\n *\n * @example\n * ```ts\n * // SSS declares full capabilities:\n * capabilities: { recovery: true, deviceLinking: true, localKeyPersistence: true }\n *\n * // Web3Auth derives keys on-demand, nothing local to manage:\n * capabilities: { recovery: false, deviceLinking: false, localKeyPersistence: false }\n * ```\n */\nexport interface KeyDerivationCapabilities {\n /** Strategy supports user-facing recovery methods (setup + execution) */\n recovery: boolean;\n\n /** Strategy supports cross-device key transfer (e.g., QR-based device linking) */\n deviceLinking: boolean;\n\n /**\n * Strategy persists key material locally (e.g., device share in IndexedDB).\n * When true, \"public computer\" / \"forget device\" features are relevant.\n */\n localKeyPersistence: boolean;\n\n /**\n * Strategy supports upgrading the user's contact method (e.g., phone \u2192 email).\n * When true, the `upgradeContactMethod` method is available and the\n * email-linking gate can be shown for phone-only users.\n */\n contactMethodUpgrade: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Key Derivation Strategy (generic)\n// ---------------------------------------------------------------------------\n\n/**\n * Key Derivation Strategy\n *\n * Abstract interface for different key derivation implementations.\n * Used by AuthCoordinator to delegate key operations.\n *\n * The strategy owns:\n * - Local key storage\n * - Key splitting and reconstruction\n * - Server communication for remote key components\n * - Recovery method execution and setup\n * - Storage cleanup knowledge\n *\n * Type parameters allow each strategy to define its own recovery shapes:\n * - TRecoveryInput: what the user provides to recover (e.g., password, passkey)\n * - TRecoverySetupInput: what the user provides to set up a recovery method\n * - TRecoverySetupResult: what setup returns (e.g., generated phrase, credential ID)\n *\n * @example\n * // SSS strategy with specific recovery types:\n * type SSSStrategy = KeyDerivationStrategy<SSSRecoveryInput, SSSRecoverySetupInput, SSSRecoverySetupResult>;\n *\n * // Simple strategy with no recovery:\n * type SimpleStrategy = KeyDerivationStrategy<never, never, never>;\n */\nexport interface KeyDerivationStrategy<\n TRecoveryInput = unknown,\n TRecoverySetupInput = unknown,\n TRecoverySetupResult = unknown,\n> {\n readonly name: string;\n\n /** Declarative feature flags \u2014 UI reads these to gate features */\n readonly capabilities: KeyDerivationCapabilities;\n\n // --- Key lifecycle ---\n\n /** Check if there's a local key component (e.g., device share) */\n hasLocalKey(): Promise<boolean>;\n\n /** Get the local key component */\n getLocalKey(): Promise<string | null>;\n\n /** Store a local key component */\n storeLocalKey(key: string): Promise<void>;\n\n /** Clear all local key data */\n clearLocalKeys(): Promise<void>;\n\n /** Split a private key into shares/components */\n splitKey(privateKey: string): Promise<{ localKey: string; remoteKey: string }>;\n\n /** Reconstruct private key from components */\n reconstructKey(localKey: string, remoteKey: string): Promise<string>;\n\n /** Verify that stored keys can reconstruct the expected DID */\n verifyKeys?(\n localKey: string,\n remoteKey: string,\n expectedDid: string,\n didFromPrivateKey: (pk: string) => Promise<string>\n ): Promise<boolean>;\n\n // --- Server communication ---\n\n /** Fetch the server-side key status for the authenticated user */\n fetchServerKeyStatus(token: string, providerType: AuthProviderType): Promise<ServerKeyStatus>;\n\n /** Store the remote key component on the server */\n storeAuthShare(token: string, providerType: AuthProviderType, remoteKey: string, did: string, didAuthVp?: string): Promise<void>;\n\n /** Mark migration complete on the server (optional \u2014 only needed for migration-capable strategies) */\n markMigrated?(token: string, providerType: AuthProviderType, didAuthVp?: string): Promise<void>;\n\n // --- Recovery ---\n\n /** Execute a recovery flow and return the recovered private key + DID */\n executeRecovery(params: {\n token: string;\n providerType: AuthProviderType;\n input: TRecoveryInput;\n /** Optional: validate the reconstructed key's DID before rotating shares */\n didFromPrivateKey?: (privateKey: string) => Promise<string>;\n }): Promise<RecoveryResult>;\n\n /** Set up a new recovery method */\n setupRecoveryMethod?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n input: TRecoverySetupInput;\n authUser?: AuthUser;\n /** Optional: sign a DID-Auth VP JWT for server write operations */\n signDidAuthVp?: (privateKey: string) => Promise<string>;\n }): Promise<TRecoverySetupResult>;\n\n /** Get configured recovery methods for the authenticated user */\n getAvailableRecoveryMethods?(token: string, providerType: AuthProviderType): Promise<RecoveryMethodInfo[]>;\n\n // --- Contact method management ---\n\n /**\n * Verify email ownership and upgrade the user's contact method on the\n * server (e.g., phone \u2192 email). The server verifies the OTP code, links\n * the email to the auth account (passwordless), and atomically updates\n * the UserKey contact method.\n *\n * Strategies that don't manage server-side contact methods can omit this.\n *\n * @param token - Auth token for the current session\n * @param providerType - Auth provider type\n * @param previousPhone - The phone number being replaced\n * @param email - The new email address (already OTP-verified client-side)\n * @param code - The 6-digit verification code\n */\n upgradeContactMethod?(\n token: string,\n providerType: AuthProviderType,\n previousPhone: string,\n email: string,\n code: string\n ): Promise<{ customToken?: string } | void>;\n\n // --- Email backup ---\n\n /**\n * Send a backup share to the user's email for fail-safe recovery.\n * Called by the coordinator after key setup or migration.\n * Implementation should be fire-and-forget (non-fatal on failure).\n *\n * @param token - Auth token for server communication\n * @param providerType - Auth provider type\n * @param privateKey - The private key to derive the email share from\n * @param email - Destination email address\n */\n sendEmailBackupShare?(\n token: string,\n providerType: AuthProviderType,\n privateKey: string,\n email: string\n ): Promise<void>;\n\n // --- Share versioning ---\n\n /**\n * Get the share version associated with the local device share.\n * Used to request the matching auth share from the server and to\n * include in QR cross-device transfers.\n *\n * Returns null for legacy shares with no stored version.\n */\n getLocalShareVersion?(): Promise<number | null>;\n\n /**\n * Store the share version for the local device share.\n * Called after receiving a device share + version via QR transfer.\n */\n storeLocalShareVersion?(version: number): Promise<void>;\n\n // --- User scoping ---\n\n /**\n * Inform the strategy which user is active so it can scope local storage\n * (e.g., device shares) per-user. Called by the coordinator after\n * authentication, before any local-key operations.\n *\n * Strategies that don't need per-user scoping can omit this method.\n *\n * @param userId - Stable, unique identifier for the authenticated user\n * (e.g., Firebase UID). Must NOT change across sessions.\n */\n setActiveUser?(userId: string): void;\n\n // --- Cleanup ---\n\n /** Return storage keys (e.g., IndexedDB database names) that should be preserved during logout */\n getPreservedStorageKeys(): string[];\n\n /** Strategy-specific cleanup beyond clearLocalKeys (optional) */\n cleanup?(): Promise<void>;\n}\n", "import { z } from 'zod/v4';\n\nexport const BITSTRING_STATUS_PURPOSES = ['revocation', 'suspension'] as const;\nexport const DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131_072;\n\nexport const BitstringStatusPurposeValidator = z.enum(BITSTRING_STATUS_PURPOSES);\nexport type BitstringStatusPurpose = z.infer<typeof BitstringStatusPurposeValidator>;\n\nexport const BitstringStatusListEntryValidator = z.object({\n id: z.string().optional(),\n type: z.literal('BitstringStatusListEntry'),\n statusPurpose: BitstringStatusPurposeValidator,\n statusListIndex: z.string().or(z.number().int().nonnegative()),\n statusListCredential: z.string(),\n});\nexport type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;\n\nexport const AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({\n id: z.string(),\n});\nexport type AllocatedBitstringStatusListEntry = z.infer<\n typeof AllocatedBitstringStatusListEntryValidator\n>;\n\nexport const BitstringStatusListCredentialSubjectValidator = z.object({\n id: z.string().optional(),\n type: z.literal('BitstringStatusList'),\n statusPurpose: BitstringStatusPurposeValidator,\n encodedList: z.string(),\n});\nexport type BitstringStatusListCredentialSubject = z.infer<\n typeof BitstringStatusListCredentialSubjectValidator\n>;\n\nexport const AllocateCredentialStatusInputValidator = z\n .object({\n statusPurposes: z.array(BitstringStatusPurposeValidator).optional(),\n listSize: z.number().int().positive().optional(),\n })\n .default({});\nexport type AllocateCredentialStatusInput = z.infer<typeof AllocateCredentialStatusInputValidator>;\n\nexport type BitstringCredentialStatusPurpose = BitstringStatusPurpose;\nexport type BitstringCredentialStatusEntry = AllocatedBitstringStatusListEntry;\n", "import { z } from 'zod';\n\n/**\n * In-App Messages \u2014 schema for the LaunchDarkly JSON flag that drives\n * conditional, targeted user prompts across LearnCard apps.\n *\n * The flag value is a versioned list of messages. Each message carries its own\n * targeting predicate tree that is evaluated ON DEVICE, because the client\n * knows things LaunchDarkly's own targeting rules cannot reliably see \u2014 the\n * Capacitor platform, the native binary version, and (crucially) the live\n * Capgo/OTA bundle version. Keeping targeting in the JSON also makes the whole\n * system unit-testable without a live LaunchDarkly connection.\n *\n * Consumed by `useInAppMessages()` in `learn-card-base`.\n */\n\n/** Runtime platform, as reported by `Capacitor.getPlatform()`. */\nexport const inAppMessagePlatformValidator = z.enum(['ios', 'android', 'web']);\nexport type InAppMessagePlatform = z.infer<typeof inAppMessagePlatformValidator>;\n\n/**\n * Which version number a `version` predicate compares against:\n * - `native` \u2014 the installed native binary version (`App.getInfo().version`)\n * - `web` \u2014 the web build's package.json version (`__APP_VERSION__`)\n * - `capgo` \u2014 the live Capgo/OTA bundle version (`CapacitorUpdater.current()`)\n */\nexport const inAppMessageVersionSourceValidator = z.enum(['native', 'web', 'capgo']);\nexport type InAppMessageVersionSource = z.infer<typeof inAppMessageVersionSourceValidator>;\n\n/** Semantic-version comparison operator (less-than, ..., greater-than). */\nexport const inAppMessageVersionOpValidator = z.enum(['lt', 'lte', 'eq', 'gte', 'gt']);\nexport type InAppMessageVersionOp = z.infer<typeof inAppMessageVersionOpValidator>;\n\n/** Match when the runtime platform is one of the listed platforms. */\nexport const platformPredicateValidator = z\n .object({ platform: z.array(inAppMessagePlatformValidator).nonempty() })\n .strict();\n\n/** Match when the current user's profile role is one of the listed roles. */\nexport const rolePredicateValidator = z.object({ role: z.array(z.string()).nonempty() }).strict();\n\n/** Match when a chosen version source satisfies a semver comparison. */\nexport const versionPredicateValidator = z\n .object({\n version: z\n .object({\n source: inAppMessageVersionSourceValidator,\n op: inAppMessageVersionOpValidator,\n value: z.string(),\n })\n .strict(),\n })\n .strict();\n\nexport type InAppMessagePredicate =\n | z.infer<typeof platformPredicateValidator>\n | z.infer<typeof rolePredicateValidator>\n | z.infer<typeof versionPredicateValidator>\n | { all: InAppMessagePredicate[] }\n | { any: InAppMessagePredicate[] }\n | { not: InAppMessagePredicate };\n\nexport const inAppMessagePredicateValidator: z.ZodType<InAppMessagePredicate> = z.lazy(() =>\n z.union([\n platformPredicateValidator,\n rolePredicateValidator,\n versionPredicateValidator,\n z.object({ all: z.array(inAppMessagePredicateValidator) }).strict(),\n z.object({ any: z.array(inAppMessagePredicateValidator) }).strict(),\n z.object({ not: inAppMessagePredicateValidator }).strict(),\n ])\n);\n\n/** Visual weight of an action button \u2014 maps to the app's button styles. */\nexport const inAppMessageActionStyleValidator = z\n .enum(['primary', 'secondary', 'positive', 'dismiss'])\n .default('secondary');\nexport type InAppMessageActionStyle = z.infer<typeof inAppMessageActionStyleValidator>;\n\n// Action validators use .passthrough() (old clients tolerate new fields on\n// actions), while predicate validators are .strict() so a typo in targeting\n// fails closed at parse time instead of silently matching everyone.\n\n/** Navigate to an in-app route (react-router path). */\nexport const internalLinkActionValidator = z\n .object({ type: z.literal('internalLink'), path: z.string() })\n .passthrough();\n\n/** Open an external URL (native: Capacitor Browser; web: new tab). */\nexport const externalLinkActionValidator = z\n .object({ type: z.literal('externalLink'), url: z.string() })\n .passthrough();\n\n/**\n * Open this app's store page, resolved per-platform at runtime:\n * iOS \u2192 App Store, Android \u2192 Google Play, web \u2192 configured fallback URL.\n * Optional overrides win over tenant-config-derived links.\n */\nexport const appStoreActionValidator = z\n .object({\n type: z.literal('appStore'),\n iosUrl: z.string().optional(),\n androidUrl: z.string().optional(),\n webUrl: z.string().optional(),\n })\n .passthrough();\n\n/** Trigger a Capgo OTA bundle check + download (with progress) + reload. */\nexport type AppStoreAction = z.infer<typeof appStoreActionValidator>;\n\nexport const capgoUpdateActionValidator = z\n .object({ type: z.literal('capgoUpdate') })\n .passthrough();\n\n/** Dismiss/close the message without any side effect. */\nexport const dismissActionValidator = z.object({ type: z.literal('dismiss') }).passthrough();\n\nexport const inAppMessageActionTargetValidator = z.union([\n internalLinkActionValidator,\n externalLinkActionValidator,\n appStoreActionValidator,\n capgoUpdateActionValidator,\n dismissActionValidator,\n]);\nexport type InAppMessageActionTarget = z.infer<typeof inAppMessageActionTargetValidator>;\n\nexport const inAppMessageActionValidator = z\n .object({\n label: z.string(),\n style: inAppMessageActionStyleValidator,\n action: inAppMessageActionTargetValidator,\n /** When true, the message closes after this action runs (default true). */\n closeOnComplete: z.boolean().default(true),\n })\n .passthrough();\nexport type InAppMessageAction = z.infer<typeof inAppMessageActionValidator>;\n\nexport const inAppMessageMediaValidator = z\n .object({\n type: z.enum(['youtube', 'image', 'gif']),\n url: z.string(),\n /** Aspect ratio hint, e.g. \"16:9\" or \"1:1\". Defaults to 16:9. */\n aspect: z.string().default('16:9'),\n /** Alt text for images/gifs (accessibility). */\n alt: z.string().optional(),\n })\n .passthrough();\nexport type InAppMessageMedia = z.infer<typeof inAppMessageMediaValidator>;\n\n/**\n * How often a message may re-appear after being seen/dismissed:\n * - `once` \u2014 show a single time, ever (persisted forever)\n * - `session` \u2014 at most once per app session (in-memory)\n * - `always` \u2014 every eligible render (no suppression)\n * - `{ everyDays: n }` \u2014 again only after n days have elapsed\n */\nexport const inAppMessageFrequencyValidator = z\n .union([\n z.literal('once'),\n z.literal('session'),\n z.literal('always'),\n z.object({ everyDays: z.number().positive() }).strict(),\n ])\n .default('once');\nexport type InAppMessageFrequency = z.infer<typeof inAppMessageFrequencyValidator>;\n\nexport const inAppMessagePresentationValidator = z\n .enum(['modal', 'banner', 'toast'])\n .default('modal');\nexport type InAppMessagePresentation = z.infer<typeof inAppMessagePresentationValidator>;\n\nexport const inAppMessageValidator = z\n .object({\n /** Stable identifier \u2014 used to persist dismissal / frequency state. */\n id: z.string(),\n /** Higher priority wins when multiple messages match. Default 0. */\n priority: z.number().default(0),\n /** When false, the message is required/blocking (no dismiss affordance). */\n dismissible: z.boolean().default(true),\n frequency: inAppMessageFrequencyValidator,\n presentation: inAppMessagePresentationValidator,\n media: inAppMessageMediaValidator.optional(),\n /** Optional emoji hero glyph \u2014 rendered only when `media` is not set. */\n emoji: z.string().optional(),\n title: z.string(),\n body: z.string().optional(),\n actions: z.array(inAppMessageActionValidator).default([]),\n /** Targeting predicate tree. Omitted \u2192 matches everyone. */\n targeting: inAppMessagePredicateValidator.optional(),\n /** Allow disabling a message without removing it from the flag. */\n enabled: z.boolean().default(true),\n })\n .passthrough();\nexport type InAppMessage = z.infer<typeof inAppMessageValidator>;\n\nexport const inAppMessagesFlagValidator = z\n .object({\n version: z.number().default(1),\n messages: z.array(inAppMessageValidator).default([]),\n })\n .passthrough();\nexport type InAppMessagesFlag = z.infer<typeof inAppMessagesFlagValidator>;\n\n/** Empty, safe default used when the flag is absent or malformed. */\nexport const EMPTY_IN_APP_MESSAGES_FLAG: InAppMessagesFlag = { version: 1, messages: [] };\n\n/**\n * Parse an unknown flag value into a validated `InAppMessagesFlag`.\n * Returns the empty flag (never throws) so a malformed flag can never crash\n * the host app.\n */\nexport const parseInAppMessagesFlag = (raw: unknown): InAppMessagesFlag => {\n const result = inAppMessagesFlagValidator.safeParse(raw);\n\n return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;\n};\n", "import { z } from 'zod/v4';\n\nimport { UnsignedVCValidator, VCValidator } from './vc';\nimport { JWEValidator } from './crypto';\n\n/**\n * Shared contracts for managed credential refresh (LC-2117, LC-2135, LC-2136).\n *\n * The generic `RefreshServiceValidator` in vc.ts intentionally remains permissive so\n * unknown third-party refresh services keep parsing. These validators model the\n * LearnCard-managed `LearnCardCredentialRefresh2026` service, its allocation/publication\n * lifecycle, the holder-facing response envelopes, and safe refresh outcomes.\n */\n\n/** LearnCard DID-auth extension descriptor for a managed refresh service */\nexport const LearnCardRefreshAuthorizationValidator = z\n .object({ type: z.literal('LearnCardDIDAuth') })\n .catchall(z.any());\nexport type LearnCardRefreshAuthorization = z.infer<typeof LearnCardRefreshAuthorizationValidator>;\n\n/**\n * Managed refresh service descriptor.\n *\n * Requires a resolvable `id` and the versioned LearnCard type, and optionally carries a\n * LearnCard authorization descriptor. This is distinct from the 1EdTech protocol.\n */\nexport const ManagedCredentialRefreshServiceValidator = z\n .object({\n id: z.string().min(1),\n type: z.literal('LearnCardCredentialRefresh2026'),\n authorization: LearnCardRefreshAuthorizationValidator.optional(),\n })\n .catchall(z.any());\nexport type ManagedCredentialRefreshService = z.infer<\n typeof ManagedCredentialRefreshServiceValidator\n>;\n\n/** Standard 1EdTech protocol: HTTPS GET returning a signed VC or VC-JWT. */\nexport const StandardCredentialRefreshServiceValidator = z\n .object({\n id: z.string().min(1),\n type: z.literal('1EdTechCredentialRefresh'),\n })\n .catchall(z.any());\nexport const SupportedCredentialRefreshServiceValidator = z.union([\n ManagedCredentialRefreshServiceValidator,\n StandardCredentialRefreshServiceValidator,\n]);\nexport type SupportedCredentialRefreshService = z.infer<\n typeof SupportedCredentialRefreshServiceValidator\n>;\n\n// --- Allocation (before signing) -------------------------------------------\n\nexport const AllocateCredentialRefreshInputValidator = z.object({\n holder: z.object({\n profileId: z.string().optional(),\n did: z.string().min(1),\n }),\n credentialId: z.string().min(1),\n});\nexport type AllocateCredentialRefreshInput = z.infer<\n typeof AllocateCredentialRefreshInputValidator\n>;\n\nexport const AllocateCredentialRefreshResultValidator = z.object({\n refreshId: z.string().min(1),\n refreshService: ManagedCredentialRefreshServiceValidator.extend({\n authorization: LearnCardRefreshAuthorizationValidator,\n }),\n});\nexport type AllocateCredentialRefreshResult = z.infer<\n typeof AllocateCredentialRefreshResultValidator\n>;\n\n// --- Publication ------------------------------------------------------------\n\nexport const CredentialRefreshSigningModeValidator = z.enum(['issuer-signed', 'signing-authority']);\nexport type CredentialRefreshSigningMode = z.infer<typeof CredentialRefreshSigningModeValidator>;\n\nconst PublishCredentialRefreshBaseFields = {\n refreshId: z.string().min(1),\n notifyHolder: z.boolean().optional(),\n updateSummary: z.string().optional(),\n idempotencyKey: z.string().optional(),\n};\n\n/** Issuer-signed mode: the caller supplies a fully signed updated VC */\nexport const PublishIssuerSignedRefreshValidator = z.object({\n ...PublishCredentialRefreshBaseFields,\n mode: z.literal('issuer-signed'),\n signedCredential: VCValidator,\n});\nexport type PublishIssuerSignedRefresh = z.infer<typeof PublishIssuerSignedRefreshValidator>;\n\n/** Signing-authority mode: the caller supplies updated unsigned claims and brain-service signs */\nexport const PublishSigningAuthorityRefreshValidator = z.object({\n ...PublishCredentialRefreshBaseFields,\n mode: z.literal('signing-authority'),\n credential: UnsignedVCValidator,\n signingAuthority: z\n .object({\n type: z.string().min(1),\n })\n .catchall(z.any()),\n});\nexport type PublishSigningAuthorityRefresh = z.infer<\n typeof PublishSigningAuthorityRefreshValidator\n>;\n\n/**\n * Top-level object form required by trpc-to-openapi.\n *\n * Keep the public TypeScript type discriminated even though the runtime object has\n * optional fields for both modes. The refinement preserves the same required-field\n * behavior as the former z.discriminatedUnion without crashing OpenAPI generation.\n */\nexport const PublishCredentialRefreshInputValidator = z\n .object({\n ...PublishCredentialRefreshBaseFields,\n mode: CredentialRefreshSigningModeValidator,\n signedCredential: VCValidator.optional(),\n credential: UnsignedVCValidator.optional(),\n signingAuthority: z\n .object({\n type: z.string().min(1),\n })\n .catchall(z.any())\n .optional(),\n })\n .superRefine((input, ctx) => {\n if (input.mode === 'issuer-signed' && !input.signedCredential) {\n ctx.addIssue({\n code: 'custom',\n path: ['signedCredential'],\n message: 'signedCredential is required for issuer-signed publication',\n });\n }\n\n if (\n input.mode === 'issuer-signed' &&\n (input.credential !== undefined || input.signingAuthority !== undefined)\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['mode'],\n message: 'issuer-signed publication cannot include signing-authority fields',\n });\n }\n\n if (input.mode === 'signing-authority') {\n if (input.signedCredential !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['signedCredential'],\n message: 'signing-authority publication cannot include signedCredential',\n });\n }\n\n if (!input.credential) {\n ctx.addIssue({\n code: 'custom',\n path: ['credential'],\n message: 'credential is required for signing-authority publication',\n });\n }\n\n if (!input.signingAuthority) {\n ctx.addIssue({\n code: 'custom',\n path: ['signingAuthority'],\n message: 'signingAuthority is required for signing-authority publication',\n });\n }\n }\n });\nexport type PublishCredentialRefreshInput =\n PublishIssuerSignedRefresh | PublishSigningAuthorityRefresh;\n\nexport const PublishCredentialRefreshNotificationValidator = z.enum([\n 'queued',\n 'suppressed',\n 'not-applicable',\n /** Publication succeeded, but the post-commit notification enqueue must be retried. */\n 'delivery-failed',\n]);\nexport type PublishCredentialRefreshNotification = z.infer<\n typeof PublishCredentialRefreshNotificationValidator\n>;\n\nexport const PublishCredentialRefreshResultValidator = z.object({\n refreshId: z.string().min(1),\n version: z.number().int().positive(),\n publishedAt: z.string().min(1),\n notification: PublishCredentialRefreshNotificationValidator,\n});\nexport type PublishCredentialRefreshResult = z.infer<\n typeof PublishCredentialRefreshResultValidator\n>;\n\n// --- Version history (metadata only, never credential bodies) ----------------\n\nexport const CredentialRefreshVersionMetadataValidator = z.object({\n version: z.number().int().positive(),\n publishedAt: z.string().min(1),\n effectiveAt: z.string().optional(),\n etag: z.string().optional(),\n signingMode: CredentialRefreshSigningModeValidator.optional(),\n updateSummary: z.string().optional(),\n});\nexport type CredentialRefreshVersionMetadata = z.infer<\n typeof CredentialRefreshVersionMetadataValidator\n>;\n\nexport const GetCredentialRefreshHistoryInputValidator = z.object({\n refreshId: z.string().min(1),\n cursor: z.string().optional(),\n limit: z.number().int().positive().optional(),\n});\nexport type GetCredentialRefreshHistoryInput = z.infer<\n typeof GetCredentialRefreshHistoryInputValidator\n>;\n\nexport const GetCredentialRefreshHistoryResultValidator = z.object({\n records: CredentialRefreshVersionMetadataValidator.array(),\n hasMore: z.boolean(),\n cursor: z.string().optional(),\n});\nexport type GetCredentialRefreshHistoryResult = z.infer<\n typeof GetCredentialRefreshHistoryResultValidator\n>;\n\n// --- Holder authentication challenge ------------------------------------------\n\n/**\n * Short-lived, single-use challenge returned by a managed refresh endpoint. Contains\n * no holder, issuer, credential, or lifecycle information.\n */\nexport const CredentialRefreshChallengeValidator = z.object({\n challenge: z.string().min(1),\n expiresAt: z.string().min(1),\n domain: z.string().optional(),\n scheme: z.literal('LearnCardDIDAuth').optional(),\n});\nexport type CredentialRefreshChallenge = z.infer<typeof CredentialRefreshChallengeValidator>;\n\n// --- Response envelopes --------------------------------------------------------\n\n/** Plain (interoperable) response: an unencrypted signed VC */\nexport const PublicCredentialRefreshEnvelopeValidator = z.object({\n format: z.literal('vc'),\n credential: VCValidator,\n etag: z.string().optional(),\n});\nexport type PublicCredentialRefreshEnvelope = z.infer<\n typeof PublicCredentialRefreshEnvelopeValidator\n>;\n\n/** Managed response: the credential encrypted to the holder as a JWE */\nexport const JweCredentialRefreshEnvelopeValidator = z.object({\n format: z.literal('jwe'),\n jwe: JWEValidator,\n etag: z.string().optional(),\n /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */\n version: z.number().int().positive().optional(),\n});\nexport type JweCredentialRefreshEnvelope = z.infer<typeof JweCredentialRefreshEnvelopeValidator>;\n\nexport const CredentialRefreshResponseEnvelopeValidator = z.discriminatedUnion('format', [\n PublicCredentialRefreshEnvelopeValidator,\n JweCredentialRefreshEnvelopeValidator,\n]);\nexport type CredentialRefreshResponseEnvelope = z.infer<\n typeof CredentialRefreshResponseEnvelopeValidator\n>;\n\n// --- Refresh outcomes ----------------------------------------------------------\n\n/**\n * Safe, machine-readable failure codes. Raw response bodies are never surfaced.\n */\nexport const CredentialRefreshFailureCodeValidator = z.enum([\n 'UNAVAILABLE',\n 'TIMEOUT',\n 'UNSUPPORTED_SERVICE',\n 'UNAUTHORIZED',\n 'MALFORMED_RESPONSE',\n 'INVALID_PROOF',\n 'ISSUER_MISMATCH',\n 'ID_MISMATCH',\n 'ROLLBACK',\n 'REVOKED',\n 'UNSAFE_ENDPOINT',\n]);\nexport type CredentialRefreshFailureCode = z.infer<typeof CredentialRefreshFailureCodeValidator>;\n\nexport const CredentialRefreshUpdatedResultValidator = z.object({\n status: z.literal('updated'),\n credential: VCValidator,\n etag: z.string().optional(),\n managedVersion: z.number().int().positive().optional(),\n});\nexport type CredentialRefreshUpdatedResult = z.infer<\n typeof CredentialRefreshUpdatedResultValidator\n>;\n\nexport const CredentialRefreshUnchangedResultValidator = z.object({\n status: z.literal('unchanged'),\n checkedAt: z.string().min(1),\n etag: z.string().optional(),\n});\nexport type CredentialRefreshUnchangedResult = z.infer<\n typeof CredentialRefreshUnchangedResultValidator\n>;\n\nexport const CredentialRefreshUnsupportedResultValidator = z.object({\n status: z.literal('unsupported'),\n});\nexport type CredentialRefreshUnsupportedResult = z.infer<\n typeof CredentialRefreshUnsupportedResultValidator\n>;\n\nexport const CredentialRefreshFailedResultValidator = z.object({\n status: z.literal('failed'),\n code: CredentialRefreshFailureCodeValidator,\n retryable: z.boolean(),\n});\nexport type CredentialRefreshFailedResult = z.infer<typeof CredentialRefreshFailedResultValidator>;\n\nexport const CredentialRefreshResultValidator = z.discriminatedUnion('status', [\n CredentialRefreshUpdatedResultValidator,\n CredentialRefreshUnchangedResultValidator,\n CredentialRefreshUnsupportedResultValidator,\n CredentialRefreshFailedResultValidator,\n]);\nexport type CredentialRefreshResult = z.infer<typeof CredentialRefreshResultValidator>;\n"],
5
- "mappings": ";;;;AAAA,SAAS,SAAS;AAEX,IAAM,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAG7E,IAAM,+BAA+B,EAAE,OAAO;AAAA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AI,CAAC;AAAA,EAC3B,MAAMA,IAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAKM,IAAM,8CAA8CA,IAAE,OAAO;AAAA,EAChE,QAAQA,IAAE,QAAQ,aAAa;AACnC,CAAC;AAKM,IAAM,yCAAyCA,IAAE,OAAO;AAAA,EAC3D,QAAQA,IAAE,QAAQ,QAAQ;AAAA,EAC1B,MAAM;AAAA,EACN,WAAWA,IAAE,QAAQ;AACzB,CAAC;AAGM,IAAM,mCAAmCA,IAAE,mBAAmB,UAAU;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;",
6
- "names": ["z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z"]
3
+ "sources": ["../src/vc.ts", "../src/did.ts", "../src/crypto.ts", "../src/obv3.ts", "../src/clr.ts", "../src/credential-format.ts", "../src/learncard.ts", "../src/learncloud.ts", "../src/mongo.ts", "../src/lcn.ts", "../src/queries.ts", "../src/credential-refresh.ts", "../src/auth.ts", "../src/bitstring-status-list.ts", "../src/inAppMessages.ts", "../src/share-links.ts"],
4
+ "sourcesContent": ["import { z } from 'zod/v4';\n\nexport const ContextValidator = z.array(z.string().or(z.record(z.string(), z.any())));\nexport type Context = z.infer<typeof ContextValidator>;\n\nexport const AchievementCriteriaValidator = z.object({\n type: z.string().optional(),\n narrative: z.string().optional(),\n});\nexport type AchievementCriteria = z.infer<typeof AchievementCriteriaValidator>;\n\nexport const ImageValidator = z.string().or(\n z.object({\n id: z.string(),\n type: z.string(),\n caption: z.string().optional(),\n })\n);\nexport type Image = z.infer<typeof ImageValidator>;\n\nexport const GeoCoordinatesValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n latitude: z.number(),\n longitude: z.number(),\n});\nexport type GeoCoordinates = z.infer<typeof GeoCoordinatesValidator>;\n\nexport const AddressValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n addressCountry: z.string().optional(),\n addressCountryCode: z.string().optional(),\n addressRegion: z.string().optional(),\n addressLocality: z.string().optional(),\n streetAddress: z.string().optional(),\n postOfficeBoxNumber: z.string().optional(),\n postalCode: z.string().optional(),\n geo: GeoCoordinatesValidator.optional(),\n});\nexport type Address = z.infer<typeof AddressValidator>;\n\nexport const IdentifierTypeValidator = z\n .enum([\n 'sourcedId',\n 'systemId',\n 'productId',\n 'userName',\n 'accountId',\n 'emailAddress',\n 'nationalIdentityNumber',\n 'isbn',\n 'issn',\n 'lisSourcedId',\n 'oneRosterSourcedId',\n 'sisSourcedId',\n 'ltiContextId',\n 'ltiDeploymentId',\n 'ltiToolId',\n 'ltiPlatformId',\n 'ltiUserId',\n 'identifier',\n ])\n .or(z.string());\nexport type IdentifierType = z.infer<typeof IdentifierTypeValidator>;\n\nexport const IdentifierEntryValidator = z.object({\n type: z.string().min(1).or(z.string().array().nonempty()),\n identifier: z.string(),\n identifierType: IdentifierTypeValidator,\n});\nexport type IdentifierEntry = z.infer<typeof IdentifierEntryValidator>;\n\nexport const ProfileValidator = z.string().or(\n z\n .object({\n id: z.string().optional(),\n type: z.string().or(z.string().array().nonempty().optional()),\n name: z.string().optional(),\n url: z.string().optional(),\n phone: z.string().optional(),\n description: z.string().optional(),\n endorsement: z.any().array().optional(), // Recursive type\n image: ImageValidator.optional(),\n email: z.string().email().optional(),\n address: AddressValidator.optional(),\n otherIdentifier: IdentifierEntryValidator.array().optional(),\n official: z.string().optional(),\n parentOrg: z.any().optional(), // Recursive types are annoying =(\n familyName: z.string().optional(),\n givenName: z.string().optional(),\n additionalName: z.string().optional(),\n patronymicName: z.string().optional(),\n honorificPrefix: z.string().optional(),\n honorificSuffix: z.string().optional(),\n familyNamePrefix: z.string().optional(),\n dateOfBirth: z.string().optional(),\n })\n .catchall(z.any())\n);\nexport type Profile = z.infer<typeof ProfileValidator>;\n\nexport const CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());\nexport type CredentialSubject = z.infer<typeof CredentialSubjectValidator>;\n\nexport const CredentialStatusValidator = z\n .object({ type: z.string(), id: z.string().optional() })\n .catchall(z.any());\nexport type CredentialStatus = z.infer<typeof CredentialStatusValidator>;\n\nexport const CredentialSchemaValidator = z\n .object({ id: z.string(), type: z.string() })\n .catchall(z.any());\nexport type CredentialSchema = z.infer<typeof CredentialSchemaValidator>;\n\nexport const RefreshServiceValidator = z\n .object({ id: z.string().optional(), type: z.string() })\n .catchall(z.any());\nexport type RefreshService = z.infer<typeof RefreshServiceValidator>;\n\nexport const TermsOfUseValidator = z\n .object({ type: z.string(), id: z.string().optional() })\n .catchall(z.any());\nexport type TermsOfUse = z.infer<typeof TermsOfUseValidator>;\n\nexport const VC2EvidenceValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n name: z.string().optional(),\n narrative: z.string().optional(),\n description: z.string().optional(),\n genre: z.string().optional(),\n audience: z.string().optional(),\n })\n .catchall(z.any());\nexport type VC2Evidence = z.infer<typeof VC2EvidenceValidator>;\n\nexport const TemplateRenderMethodValidator = z.object({\n type: z.literal('TemplateRenderMethod'),\n renderSuite: z.string(),\n template: z.string(),\n renderProperty: z.array(z.string()).optional(),\n outputPreference: z\n .object({\n mediaType: z.string(),\n })\n .optional(),\n});\nexport type TemplateRenderMethod = z.infer<typeof TemplateRenderMethodValidator>;\n\nexport const RenderMethodValidator = z.union([\n TemplateRenderMethodValidator,\n z.record(z.string(), z.any()),\n]);\nexport type RenderMethod = z.infer<typeof RenderMethodValidator>;\n\nexport const UnsignedVCValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n issuer: ProfileValidator,\n credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),\n refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),\n credentialSchema: CredentialSchemaValidator.or(\n CredentialSchemaValidator.array()\n ).optional(),\n\n // V1\n issuanceDate: z.string().optional(),\n expirationDate: z.string().optional(),\n credentialStatus: CredentialStatusValidator.or(\n CredentialStatusValidator.array()\n ).optional(),\n\n // V2\n name: z.string().optional(),\n description: z.string().optional(),\n validFrom: z.string().optional(),\n validUntil: z.string().optional(),\n status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),\n termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),\n evidence: z.union([VC2EvidenceValidator, z.array(VC2EvidenceValidator)]).optional(),\n renderMethod: z.union([RenderMethodValidator, z.array(RenderMethodValidator)]).optional(),\n })\n .catchall(z.any());\nexport type UnsignedVC = z.infer<typeof UnsignedVCValidator>;\n\nexport const ProofValidator = z\n .object({\n type: z.string(),\n created: z.string().optional(),\n challenge: z.string().optional(),\n domain: z.string().optional(),\n nonce: z.string().optional(),\n proofPurpose: z.string(),\n verificationMethod: z.string(),\n jws: z.string().optional(),\n })\n .catchall(z.any())\n .superRefine((proof, ctx) => {\n if (\n proof.created === undefined &&\n (proof.type !== 'DataIntegrityProof' || proof.cryptosuite !== 'ecdsa-rdfc-2019')\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['created'],\n message: 'created is required for this proof suite',\n });\n }\n });\nexport type Proof = z.infer<typeof ProofValidator>;\n\nexport const VCValidator = UnsignedVCValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type VC = z.infer<typeof VCValidator>;\n\nexport const UnsignedVPValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string().optional(),\n type: z.string().or(z.string().array().nonempty()),\n verifiableCredential: VCValidator.or(VCValidator.array()).optional(),\n holder: z.string().optional(),\n })\n .catchall(z.any());\nexport type UnsignedVP = z.infer<typeof UnsignedVPValidator>;\n\nexport const VPValidator = UnsignedVPValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type VP = z.infer<typeof VPValidator>;\n", "import { z } from 'zod/v4';\nimport { ContextValidator, ProofValidator } from './vc';\nimport { JWKValidator } from './crypto';\n\nexport const VerificationMethodValidator = z.string().or(\n z\n .object({\n '@context': ContextValidator.optional(),\n id: z.string(),\n type: z.string(),\n controller: z.string(),\n publicKeyJwk: JWKValidator.optional(),\n publicKeyBase58: z.string().optional(),\n publicKeyMultibase: z.string().optional(),\n blockChainAccountId: z.string().optional(),\n })\n .catchall(z.any())\n);\nexport type VerificationMethod = z.infer<typeof VerificationMethodValidator>;\n\nexport const ServiceValidator = z\n .object({\n id: z.string(),\n type: z.string().or(z.string().array().nonempty()),\n serviceEndpoint: z.any().or(z.any().array().nonempty()),\n })\n .catchall(z.any());\nexport type Service = z.infer<typeof ServiceValidator>;\n\nexport const DidDocumentValidator = z\n .object({\n '@context': ContextValidator,\n id: z.string(),\n alsoKnownAs: z.string().optional(),\n controller: z.string().or(z.string().array().nonempty()).optional(),\n verificationMethod: VerificationMethodValidator.array().optional(),\n authentication: VerificationMethodValidator.array().optional(),\n assertionMethod: VerificationMethodValidator.array().optional(),\n keyAgreement: VerificationMethodValidator.array().optional(),\n capabilityInvocation: VerificationMethodValidator.array().optional(),\n capabilityDelegation: VerificationMethodValidator.array().optional(),\n publicKey: VerificationMethodValidator.array().optional(),\n service: ServiceValidator.array().optional(),\n proof: ProofValidator.or(ProofValidator.array()).optional(),\n })\n .catchall(z.any());\nexport type DidDocument = z.infer<typeof DidDocumentValidator>;\n", "import { z } from 'zod/v4';\n\nexport const JWKValidator = z.object({\n kty: z.string(),\n crv: z.string(),\n x: z.string(),\n y: z.string().optional(),\n n: z.string().optional(),\n d: z.string().optional(),\n});\nexport type JWK = z.infer<typeof JWKValidator>;\n\nexport const JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });\nexport type JWKWithPrivateKey = z.infer<typeof JWKWithPrivateKeyValidator>;\n\nexport const JWERecipientHeaderValidator = z.object({\n alg: z.string(),\n iv: z.string(),\n tag: z.string(),\n epk: JWKValidator.partial().optional(),\n kid: z.string().optional(),\n apv: z.string().optional(),\n apu: z.string().optional(),\n});\nexport type JWERecipientHeader = z.infer<typeof JWERecipientHeaderValidator>;\n\nexport const JWERecipientValidator = z.object({\n header: JWERecipientHeaderValidator,\n encrypted_key: z.string(),\n});\nexport type JWERecipient = z.infer<typeof JWERecipientValidator>;\n\nexport const JWEValidator = z.object({\n protected: z.string(),\n iv: z.string(),\n ciphertext: z.string(),\n tag: z.string(),\n aad: z.string().optional(),\n recipients: JWERecipientValidator.array().optional(),\n});\nexport type JWE = z.infer<typeof JWEValidator>;\n", "import { z } from 'zod/v4';\nimport {\n UnsignedVCValidator,\n ProofValidator,\n ProfileValidator,\n ImageValidator,\n IdentifierEntryValidator,\n} from './vc';\n\nexport const AlignmentTargetTypeValidator = z\n .enum([\n 'ceasn:Competency',\n 'ceterms:Credential',\n 'CFItem',\n 'CFRubric',\n 'CFRubricCriterion',\n 'CFRubricCriterionLevel',\n 'CTDL',\n ])\n .or(z.string());\nexport type AlignmentTargetType = z.infer<typeof AlignmentTargetTypeValidator>;\n\nexport const AlignmentValidator = z.object({\n type: z.string().array().nonempty(),\n targetCode: z.string().optional(),\n targetDescription: z.string().optional(),\n targetName: z.string(),\n targetFramework: z.string().optional(),\n targetType: AlignmentTargetTypeValidator.optional(),\n targetUrl: z.string(),\n});\nexport type Alignment = z.infer<typeof AlignmentValidator>;\n\nexport const KnownAchievementTypeValidator = z.enum([\n 'Achievement',\n 'ApprenticeshipCertificate',\n 'Assessment',\n 'Assignment',\n 'AssociateDegree',\n 'Award',\n 'Badge',\n 'BachelorDegree',\n 'Certificate',\n 'CertificateOfCompletion',\n 'Certification',\n 'CommunityService',\n 'Competency',\n 'Course',\n 'CoCurricular',\n 'Degree',\n 'Diploma',\n 'DoctoralDegree',\n 'Fieldwork',\n 'GeneralEducationDevelopment',\n 'JourneymanCertificate',\n 'LearningProgram',\n 'License',\n 'Membership',\n 'ProfessionalDoctorate',\n 'QualityAssuranceCredential',\n 'MasterCertificate',\n 'MasterDegree',\n 'MicroCredential',\n 'ResearchDoctorate',\n 'SecondarySchoolDiploma',\n]);\nexport type KnownAchievementType = z.infer<typeof KnownAchievementTypeValidator>;\n\nexport const AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());\nexport type AchievementType = z.infer<typeof AchievementTypeValidator>;\n\nexport const CriteriaValidator = z\n .object({ id: z.string().optional(), narrative: z.string().optional() })\n .catchall(z.any());\nexport type Criteria = z.infer<typeof CriteriaValidator>;\n\nexport const EndorsementSubjectValidator = z.object({\n id: z.string(),\n type: z.string().array().nonempty(),\n endorsementComment: z.string().optional(),\n});\nexport type EndorsementSubject = z.infer<typeof EndorsementSubjectValidator>;\n\nexport const EndorsementCredentialValidator = UnsignedVCValidator.extend({\n credentialSubject: EndorsementSubjectValidator,\n proof: ProofValidator.or(ProofValidator.array()).optional(),\n});\nexport type EndorsementCredential = z.infer<typeof EndorsementCredentialValidator>;\n\nexport const RelatedValidator = z.object({\n id: z.string(),\n '@language': z.string().optional(),\n version: z.string().optional(),\n});\nexport type Related = z.infer<typeof RelatedValidator>;\n\nexport const ResultTypeValidator = z\n .enum([\n 'GradePointAverage',\n 'LetterGrade',\n 'Percent',\n 'PerformanceLevel',\n 'PredictedScore',\n 'RawScore',\n 'Result',\n 'RubricCriterion',\n 'RubricCriterionLevel',\n 'RubricScore',\n 'ScaledScore',\n 'Status',\n ])\n .or(z.string());\nexport type ResultType = z.infer<typeof ResultTypeValidator>;\n\nexport const RubricCriterionValidator = z\n .object({\n id: z.string(),\n type: z.string().array().nonempty(),\n alignment: AlignmentValidator.array().optional(),\n description: z.string().optional(),\n level: z.string().optional(),\n name: z.string(),\n points: z.string().optional(),\n })\n .catchall(z.any());\nexport type RubricCriterion = z.infer<typeof RubricCriterionValidator>;\n\nexport const ResultDescriptionValidator = z\n .object({\n id: z.string(),\n type: z.string().array().nonempty(),\n alignment: AlignmentValidator.array().optional(),\n allowedValue: z.string().array().optional(),\n name: z.string(),\n requiredLevel: z.string().optional(),\n requiredValue: z.string().optional(),\n resultType: ResultTypeValidator,\n rubricCriterionLevel: RubricCriterionValidator.array().optional(),\n valueMax: z.string().optional(),\n valueMin: z.string().optional(),\n })\n .catchall(z.any());\nexport type ResultDescription = z.infer<typeof ResultDescriptionValidator>;\n\nexport const EvidenceValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n name: z.string().optional(),\n narrative: z.string().optional(),\n description: z.string().optional(),\n genre: z.string().optional(),\n audience: z.string().optional(),\n })\n .catchall(z.any());\n\nexport type Evidence = z.infer<typeof EvidenceValidator>;\n\nexport const AchievementValidator = z\n .object({\n id: z.string().optional(),\n type: z.array(z.string()).nonempty(),\n alignment: AlignmentValidator.array().optional(),\n achievementType: AchievementTypeValidator.optional(),\n creator: ProfileValidator.optional(),\n creditsAvailable: z.number().optional(),\n criteria: CriteriaValidator,\n description: z.string(),\n endorsement: EndorsementCredentialValidator.array().optional(),\n fieldOfStudy: z.string().optional(),\n humanCode: z.string().optional(),\n image: ImageValidator.optional(),\n '@language': z.string().optional(),\n name: z.string(),\n otherIdentifier: IdentifierEntryValidator.array().optional(),\n related: RelatedValidator.array().optional(),\n resultDescription: ResultDescriptionValidator.array().optional(),\n specialization: z.string().optional(),\n tag: z.array(z.string()).optional(),\n version: z.string().optional(),\n })\n .catchall(z.any());\nexport type Achievement = z.infer<typeof AchievementValidator>;\n\nexport const IdentityObjectValidator = z.object({\n type: z.string(),\n hashed: z.boolean(),\n identityHash: z.string(),\n identityType: z.string(),\n salt: z.string().optional(),\n});\nexport type IdentityObject = z.infer<typeof IdentityObjectValidator>;\n\nexport const ResultStatusTypeValidator = z.enum([\n 'Completed',\n 'Enrolled',\n 'Failed',\n 'InProgress',\n 'OnHold',\n 'Withdrew',\n]);\nexport type ResultStatusType = z.infer<typeof ResultStatusTypeValidator>;\n\nexport const ResultValidator = z\n .object({\n type: z.string().array().nonempty(),\n achievedLevel: z.string().optional(),\n alignment: AlignmentValidator.array().optional(),\n resultDescription: z.string().optional(),\n status: ResultStatusTypeValidator.optional(),\n value: z.string().optional(),\n })\n .catchall(z.any());\nexport type Result = z.infer<typeof ResultValidator>;\n\nexport const AchievementSubjectValidator = z\n .object({\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n activityEndDate: z.string().optional(),\n activityStartDate: z.string().optional(),\n creditsEarned: z.number().optional(),\n achievement: AchievementValidator.optional(),\n identifier: IdentityObjectValidator.array().optional(),\n image: ImageValidator.optional(),\n licenseNumber: z.string().optional(),\n narrative: z.string().optional(),\n result: ResultValidator.array().optional(),\n role: z.string().optional(),\n source: ProfileValidator.optional(),\n term: z.string().optional(),\n })\n .catchall(z.any());\nexport type AchievementSubject = z.infer<typeof AchievementSubjectValidator>;\n\nexport const UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({\n name: z.string().optional(),\n description: z.string().optional(),\n image: ImageValidator.optional(),\n credentialSubject: AchievementSubjectValidator.or(\n AchievementSubjectValidator.array()\n ) as z.ZodUnion<\n [typeof AchievementSubjectValidator, z.ZodArray<typeof AchievementSubjectValidator>]\n >,\n endorsement: UnsignedVCValidator.array().optional(),\n});\nexport type UnsignedAchievementCredential = z.infer<typeof UnsignedAchievementCredentialValidator>;\n\nexport const AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type AchievementCredential = z.infer<typeof AchievementCredentialValidator>;\n", "import { z } from 'zod/v4';\n\nimport { UnsignedVCValidator, ProofValidator, ProfileValidator, ImageValidator } from './vc';\n\nimport { AchievementValidator, EndorsementCredentialValidator } from './obv3';\n\n// ---------------------------------------------------------------------------\n// CLR v2 \u2014 Comprehensive Learner Record\n// Based on 1EdTech CLR Standard v2.0\n// https://www.imsglobal.org/spec/clr/v2p0\n// ---------------------------------------------------------------------------\n\nexport const AssociationTypeValidator = z\n .enum([\n 'exactMatchOf',\n 'extends',\n 'isChildOf',\n 'isParentOf',\n 'isPartOf',\n 'isPeerOf',\n 'isRelatedTo',\n 'precedes',\n 'replacedBy',\n ])\n .or(z.string());\nexport type AssociationType = z.infer<typeof AssociationTypeValidator>;\n\nexport const AssociationValidator = z\n .object({\n type: z.string().array().nonempty(),\n associationType: AssociationTypeValidator,\n sourceId: z.string().optional(),\n targetId: z.string(),\n })\n .catchall(z.any());\nexport type Association = z.infer<typeof AssociationValidator>;\n\nexport const ClrSubjectValidator = z\n .object({\n id: z.string().optional(),\n type: z.string().array().nonempty(),\n identifier: z.any().array().optional(),\n achievement: AchievementValidator.array().optional(),\n association: AssociationValidator.array().optional(),\n verifiableCredential: z.any().array().optional(),\n })\n .catchall(z.any());\nexport type ClrSubject = z.infer<typeof ClrSubjectValidator>;\n\nexport const UnsignedClrCredentialValidator = UnsignedVCValidator.extend({\n name: z.string().optional(),\n description: z.string().optional(),\n image: ImageValidator.optional(),\n\n credentialSubject: ClrSubjectValidator.or(ClrSubjectValidator.array()) as z.ZodUnion<\n [typeof ClrSubjectValidator, z.ZodArray<typeof ClrSubjectValidator>]\n >,\n\n endorsement: EndorsementCredentialValidator.array().optional(),\n\n partial: z.boolean().optional(),\n});\nexport type UnsignedClrCredential = z.infer<typeof UnsignedClrCredentialValidator>;\n\nexport const ClrCredentialValidator = UnsignedClrCredentialValidator.extend({\n proof: ProofValidator.or(ProofValidator.array()),\n});\nexport type ClrCredential = z.infer<typeof ClrCredentialValidator>;\n", "import { z } from 'zod/v4';\nimport type { VC } from './vc';\n\n/**\n * Wire-format identifier for a credential at rest in the wallet.\n *\n * Optional metadata on `CredentialRecord`. Existing W3C records work\n * without it. Format-aware code paths use this value to dispatch on\n * the correct wire-form representation. See ADR-0001 for rationale.\n *\n * Values follow OID4VCI / OID4VP draft-16 conventions:\n * - `w3c-vc-2.0` \u2014 JSON-LD VC, VCDM 2.0 `@context`\n * - `w3c-vc-1.1` \u2014 JSON-LD VC, VCDM 1.1 `@context` (legacy)\n * - `jwt-vc-json` \u2014 compact JWS string, VCDM \u00A76.3.1 payload shape\n * - `dc+sd-jwt` \u2014 SD-JWT-VC compact form (draft-16 canonical name)\n * - `vc+sd-jwt` \u2014 SD-JWT-VC compact form (legacy alias accepted on read)\n * - `mso_mdoc` \u2014 ISO 18013-5 mDoc, CBOR-encoded (stored base64)\n */\nexport const CredentialFormatValidator = z.enum([\n 'w3c-vc-2.0',\n 'w3c-vc-1.1',\n 'jwt-vc-json',\n 'dc+sd-jwt',\n 'vc+sd-jwt',\n 'mso_mdoc',\n]);\nexport type CredentialFormat = z.infer<typeof CredentialFormatValidator>;\n\n/**\n * Storage-plane envelope for native (non-W3C) credential formats.\n *\n * The storage plane previously accepted only `VC | VP`, which forced\n * SD-JWT-VC to synthesize a JSON-LD wrapper around the compact form\n * just to satisfy the type \u2014 even though the underlying transport\n * (LearnCloud tRPC) accepts any JSON-serializable value.\n *\n * The envelope is the on-wire shape for any credential that is NOT a\n * W3C VC/VP. Consumers identify the envelope by the presence of both\n * `format` and `data` fields (use `isStoredCredentialEnvelope`).\n *\n * Per-format `data` conventions:\n * - `dc+sd-jwt` / `vc+sd-jwt`: the compact `<JWT>~<disclosures>~`\n * string (no KB-JWT \u2014 that is per-presentation).\n * - `jwt-vc-json`: the compact JWS string.\n * - `mso_mdoc`: base64url-encoded CBOR bytes. The TypeScript type\n * allows `Uint8Array` for in-memory ergonomics; storage plugins\n * MUST convert to a base64url string at the transport boundary.\n * The Zod validator (used at the wire layer) is string-only.\n *\n * W3C VCs continue to flow through `upload(vc: VC)` directly \u2014 they\n * do not use the envelope. This keeps the legacy partner surface\n * untouched.\n */\n// Wire validator: data is `string` only because JSON transport (tRPC, OpenAPI)\n// cannot carry Uint8Array natively. Storage plugins encode binary `Uint8Array`\n// data to base64url BEFORE the validator runs at the transport boundary.\n// The TypeScript type below is intentionally wider (`string | Uint8Array`) to\n// preserve in-memory ergonomics for plugins doing the conversion.\nexport const StoredCredentialEnvelopeValidator = z\n .object({\n format: CredentialFormatValidator,\n data: z.string(),\n })\n .passthrough();\nexport type StoredCredentialEnvelope = {\n format: CredentialFormat;\n data: string | Uint8Array;\n [key: string]: unknown;\n};\n\n/**\n * Runtime typeguard for the storage envelope shape. Storage plugins\n * use this to branch in `upload`/`read.get` between the legacy W3C\n * path and the envelope path. Performs a shallow structural check \u2014\n * does not validate `data` semantics for the chosen format.\n */\nexport const isStoredCredentialEnvelope = (value: unknown): value is StoredCredentialEnvelope => {\n if (!value || typeof value !== 'object') return false;\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.format !== 'string') return false;\n if (!CredentialFormatValidator.safeParse(candidate.format).success) return false;\n return typeof candidate.data === 'string' || candidate.data instanceof Uint8Array;\n};\n\n/**\n * Format-discriminated read view over a stored credential. Returned\n * by `toStoredCredential(record)` in `@learncard/helpers`.\n *\n * The `data` field carries the correct wire-form representation for\n * the credential's format:\n * - W3C VCs: the JSON-LD VC object (also what `record.vc` holds)\n * - JWT-VC: the compact JWS string (extracted from `record.vc.proof.jwt`\n * if the record uses the legacy LDP-around-JWT envelope, otherwise\n * the raw string from `record.rawWireForm`)\n * - SD-JWT-VC: the compact `<JWT>~<disclosures>~` string\n * - mDoc: base64url-encoded CBOR bytes (stored as a string for\n * LearnCloud's JSON-only encrypted store; consumers base64-decode\n * when they need raw bytes)\n *\n * Format-aware consumers pattern-match on `format` and use `data`.\n * Legacy consumers continue to read `record.vc` directly \u2014 the\n * projector is opt-in, never required.\n */\nexport type StoredCredential =\n | { format: 'w3c-vc-2.0'; data: VC }\n | { format: 'w3c-vc-1.1'; data: VC }\n | { format: 'jwt-vc-json'; data: string }\n | { format: 'dc+sd-jwt'; data: string }\n | { format: 'vc+sd-jwt'; data: string }\n | { format: 'mso_mdoc'; data: string };\n\n/**\n * Unified display projection for any credential format. Returned by\n * the `toDisplayViewModel(stored, learnCard)` adapter that lands in\n * UI components consume this shape regardless of underlying format,\n * so the same BoostEarnedCard / category view / search index works\n * across all credential types. The format-specific decoding logic\n * lives in the per-format display adapter, not the UI.\n */\nexport interface CredentialDisplayViewModel {\n /** Source format of the underlying credential. */\n format: CredentialFormat;\n /** Best-effort issuer display name (resolved DID document or HTTPS metadata). */\n issuerName?: string;\n /** Raw DID or URL identifier of the issuer. */\n issuerDid?: string;\n /** Human-readable title (from credential `name`, derived from vct, or humanized type). */\n title?: string;\n /** Wallet category (e.g., `'Achievement'`, `'ID'`) used by the wallet's category tabs. */\n category?: string;\n /** Issuance time, if present in the credential. */\n issuedAt?: Date;\n /** Expiration time, if present. */\n expiresAt?: Date;\n /**\n * Reconstructed claims. For W3C VCs this mirrors `credentialSubject`;\n * for SD-JWT this is the payload + reconstructed disclosable claims;\n * for mDoc it's the decoded namespace tree projected as a flat record.\n */\n claims: Record<string, unknown>;\n /**\n * Whether the credential supports selective disclosure at presentation\n * time. SD-JWT-VC and mDoc \u2192 true; W3C VCs \u2192 false. UI components use\n * this to decide whether to show per-claim consent checkboxes.\n */\n isSelectivelyDisclosable: boolean;\n /**\n * The on-the-wire form for re-serialization at egress time. Apps\n * preparing outbound presentations should NEVER reconstruct from\n * `claims` \u2014 always re-serialize from this field via\n * `serializeForWire(stored)` (Phase 3).\n */\n rawWireForm: string | VC;\n}\n", "import { z } from 'zod/v4';\nimport { CredentialSubjectValidator, ProfileValidator } from './vc';\nimport { CredentialFormatValidator, type CredentialFormat } from './credential-format';\n\n/**\n * Per-entry result for the credentialStatus check.\n *\n * Surfaced from `ssi-ldp::StatusCheckEntry` (see ssi PR\n * `lc-status-array-and-structured-result`) through didkit's\n * `verifyCredential` JSON output. One entry per `credentialStatus`\n * entry on the verified credential \u2014 VC 2.0 allows multiple\n * (e.g. one revocation entry + one suspension entry).\n *\n * Combine `statusPurpose` + `isSet` to render structured UI without\n * string-matching the human-readable error in `errors`:\n *\n * - `statusPurpose: \"revocation\"`, `isSet: true` \u2192 revoked\n * - `statusPurpose: \"suspension\"`, `isSet: true` \u2192 suspended\n * - `isSet: false` \u2192 active for that purpose\n */\nexport const StatusCheckEntryValidator = z.object({\n /**\n * The `credentialStatus.type` as it appeared on the credential.\n * One of `BitstringStatusListEntry`, `StatusList2021Entry`,\n * `RevocationList2020Status`, or any future custom status type.\n */\n entryType: z.string(),\n /**\n * The claimed purpose of the entry. Standard values are\n * `\"revocation\"` and `\"suspension\"`; the spec allows arbitrary\n * strings.\n */\n statusPurpose: z.string(),\n /**\n * Whether the bit at the credential's index in the status list\n * bitstring was set.\n */\n isSet: z.boolean(),\n /** URL of the status list credential, when known. */\n statusListCredential: z.string().optional(),\n /** Original (string) index within the status list. */\n statusListIndex: z.string().optional(),\n});\nexport type StatusCheckEntry = z.infer<typeof StatusCheckEntryValidator>;\n\nexport const VerificationCheckValidator = z.object({\n /**\n * Checks that completed successfully. This does not imply that warnings can be ignored.\n */\n checks: z.string().array(),\n /**\n * Security-relevant conditions that did not prevent the requested cryptographic checks from\n * completing. In particular, a non-DID issuer warning means the signature is valid but the\n * named URL issuer's authorization of that signing key was not established.\n */\n warnings: z.string().array(),\n /** Verification failures that prevented one or more requested checks from succeeding. */\n errors: z.string().array(),\n /**\n * Per-entry results for the `credentialStatus` check, populated\n * by `@learncard/didkit-plugin` when the verified credential\n * carries one or more `credentialStatus` entries. Empty / absent\n * for credentials without a status entry.\n *\n * Marked `.optional()` because the underlying `ssi-ldp`\n * serializer omits the field when empty (`skip_serializing_if`),\n * so older WASM builds that pre-date the structured-status\n * change still validate against this schema.\n */\n status: StatusCheckEntryValidator.array().optional(),\n});\nexport type VerificationCheck = z.infer<typeof VerificationCheckValidator>;\n\nexport const VerificationStatusValidator = z.enum(['Success', 'Failed', 'Error']);\nexport type VerificationStatus = z.infer<typeof VerificationStatusValidator>;\nexport const VerificationStatusEnum = VerificationStatusValidator.enum;\n\nexport const VerificationItemValidator = z.object({\n check: z.string(),\n status: VerificationStatusValidator,\n message: z.string().optional(),\n details: z.string().optional(),\n});\nexport type VerificationItem = z.infer<typeof VerificationItemValidator>;\n\nexport const CredentialInfoValidator = z.object({\n title: z.string().optional(),\n createdAt: z.string().optional(),\n issuer: ProfileValidator.optional(),\n issuee: ProfileValidator.optional(),\n credentialSubject: CredentialSubjectValidator.optional(),\n});\nexport type CredentialInfo = z.infer<typeof CredentialInfoValidator>;\n\nexport type CredentialRecord<Metadata extends Record<string, any> = Record<never, never>> = {\n id: string;\n uri: string;\n /**\n * Wire-format discriminator for the credential. Optional \u2014 when\n * absent, legacy readers infer it from `vc` shape (see\n * `toStoredCredential` in `@learncard/helpers`). Populated on new\n * writes once the consumer is format-aware.\n *\n * Added in ADR-0001 Phase 1 as additive metadata; existing\n * records without this field continue to work unchanged.\n */\n format?: CredentialFormat;\n /**\n * Optional semantic type hint for fast filtering without parsing\n * the full credential \u2014 `vct` for SD-JWT-VC, last-non-VC type for\n * W3C VCs, doctype for mDoc. Added in ADR-0001 Phase 1.\n */\n semanticType?: string;\n /**\n * On-the-wire representation for formats whose `vc` field cannot\n * hold the canonical form (SD-JWT compact, JWT-VC compact, base64\n * mDoc CBOR). Undefined for W3C VCs (`vc` IS the wire form). Added\n * in ADR-0001 Phase 1.\n */\n rawWireForm?: string;\n [key: string]: any;\n} & Metadata;\n\nexport const CredentialRecordValidator = z\n .object({\n id: z.string(),\n uri: z.string(),\n format: CredentialFormatValidator.optional(),\n semanticType: z.string().optional(),\n rawWireForm: z.string().optional(),\n })\n .catchall(z.any()) satisfies z.ZodType<CredentialRecord>;\n", "import { z } from 'zod/v4';\n\nimport { PaginationResponseValidator } from './mongo';\nimport { JWEValidator } from './crypto';\n\nexport const EncryptedRecordValidator = z\n .object({ encryptedRecord: JWEValidator, fields: z.string().array() })\n .catchall(z.any());\nexport type EncryptedRecord = z.infer<typeof EncryptedRecordValidator>;\n\nexport const PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({\n records: EncryptedRecordValidator.array(),\n});\nexport type PaginatedEncryptedRecordsType = z.infer<typeof PaginatedEncryptedRecordsValidator>;\n\nexport const EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({\n id: z.string(),\n});\nexport type EncryptedCredentialRecord = z.infer<typeof EncryptedCredentialRecordValidator>;\n\nexport const PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({\n records: EncryptedCredentialRecordValidator.array(),\n});\nexport type PaginatedEncryptedCredentialRecordsType = z.infer<\n typeof PaginatedEncryptedCredentialRecordsValidator\n>;\n", "import { z } from 'zod/v4';\n\nexport const PaginationOptionsValidator = z.object({\n limit: z.number(),\n cursor: z.string().optional(),\n sort: z.string().optional(),\n});\nexport type PaginationOptionsType = z.infer<typeof PaginationOptionsValidator>;\n\nexport const PaginationResponseValidator = z.object({\n cursor: z.string().optional(),\n hasMore: z.boolean(),\n});\nexport type PaginationResponseType = z.infer<typeof PaginationResponseValidator>;\n", "import type {} from 'zod-openapi';\nimport { z } from 'zod/v4';\n\nimport { PaginationResponseValidator } from './mongo';\nimport { StringQuery } from './queries';\nimport { UnsignedVCValidator, VCValidator, VPValidator } from './vc';\nimport {\n ManagedCredentialRefreshReceiptValidator,\n InboxCredentialRefreshReceiptValidator,\n ManagedCredentialRefreshServiceValidator,\n} from './credential-refresh';\n\nexport const LCNProfileDisplayValidator = z.object({\n backgroundColor: z.string().optional(),\n backgroundImage: z.string().optional(),\n fadeBackgroundImage: z.boolean().optional(),\n repeatBackgroundImage: z.boolean().optional(),\n fontColor: z.string().optional(),\n accentColor: z.string().optional(),\n accentFontColor: z.string().optional(),\n idBackgroundImage: z.string().optional(),\n fadeIdBackgroundImage: z.boolean().optional(),\n idBackgroundColor: z.string().optional(),\n repeatIdBackgroundImage: z.boolean().optional(),\n});\nexport type LCNProfileDisplay = z.infer<typeof LCNProfileDisplayValidator>;\n\nexport const ProfileVisibilityEnum = z.enum(['public', 'connections_only', 'private']);\nexport type ProfileVisibility = z.infer<typeof ProfileVisibilityEnum>;\n\nexport const AllowConnectionRequestsEnum = z.enum(['anyone', 'invite_only']);\nexport type AllowConnectionRequests = z.infer<typeof AllowConnectionRequestsEnum>;\n\nexport const LCNProfileValidator = z.object({\n profileId: z.string().min(3).max(40).describe('Unique, URL-safe identifier for the profile.'),\n displayName: z.string().default('').describe('Human-readable display name for the profile.'),\n shortBio: z.string().default('').describe('Short bio for the profile.'),\n bio: z.string().default('').describe('Longer bio for the profile.'),\n did: z.string().describe('Decentralized Identifier for the profile. (auto-assigned)'),\n isPrivate: z\n .boolean()\n .optional()\n .describe('Whether the profile is private or not and shows up in search results.'),\n profileVisibility: ProfileVisibilityEnum.default('public')\n .optional()\n .describe(\"Profile visibility: 'public', 'connections_only', or 'private'.\"),\n showEmail: z\n .boolean()\n .default(false)\n .optional()\n .describe('Whether to show email to connections.'),\n allowConnectionRequests: AllowConnectionRequestsEnum.default('anyone')\n .optional()\n .describe(\"Who can send connection requests: 'anyone' or 'invite_only'.\"),\n email: z.string().optional().describe('Contact email address for the profile. (deprecated)'),\n image: z.string().optional().describe('Profile image URL for the profile.'),\n heroImage: z.string().optional().describe('Hero image URL for the profile.'),\n websiteLink: z.string().optional().describe('Website link for the profile.'),\n isServiceProfile: z\n .boolean()\n .default(false)\n .optional()\n .describe('Whether the profile is a service profile or not.'),\n type: z.string().optional().describe('Profile type: e.g. \"person\", \"organization\", \"service\".'),\n notificationsWebhook: z\n .string()\n .url()\n .startsWith('http')\n .optional()\n .describe('URL to send notifications to.'),\n display: LCNProfileDisplayValidator.optional().describe('Display settings for the profile.'),\n highlightedCredentials: z\n .array(z.string())\n .max(5)\n .optional()\n .describe('Up to 5 unique boost URIs to highlight on the profile.'),\n role: z\n .string()\n .default('')\n .optional()\n .describe('Role of the profile: e.g. \"teacher\", \"student\".'),\n dob: z\n .string()\n .default('')\n .optional()\n .describe('Date of birth of the profile: e.g. \"1990-01-01\".'),\n country: z.string().optional().describe('Country for the profile.'),\n locale: z\n .string()\n .optional()\n .describe(\n \"BCP-47 language tag (e.g. 'es', 'fr', 'ar') \u2014 the user's preferred language for server-sent notifications and emails.\"\n ),\n approved: z.boolean().optional().describe('Approval status for the profile.'),\n});\nexport type LCNProfile = z.infer<typeof LCNProfileValidator>;\n\nexport const LCNPublicProfileValidator = LCNProfileValidator.pick({\n profileId: true,\n displayName: true,\n shortBio: true,\n image: true,\n heroImage: true,\n type: true,\n isServiceProfile: true,\n display: true,\n});\nexport type LCNPublicProfile = z.infer<typeof LCNPublicProfileValidator>;\n\nexport const LCNConnectionPromptStatusValidator = z.enum(['PENDING', 'SKIPPED', 'CONNECTED']);\nexport type LCNConnectionPromptStatus = z.infer<typeof LCNConnectionPromptStatusValidator>;\n\nexport const LCNConnectionPromptSurfaceValidator = z.enum(['POST_CLAIM', 'NOTIFICATION']);\nexport type LCNConnectionPromptSurface = z.infer<typeof LCNConnectionPromptSurfaceValidator>;\n\nexport const LCNConnectionPromptActionStatusValidator = z.enum([\n 'PENDING',\n 'SKIPPED',\n 'CONNECTED',\n 'STALE',\n]);\nexport type LCNConnectionPromptActionStatus = z.infer<\n typeof LCNConnectionPromptActionStatusValidator\n>;\n\nexport const LCNConnectionPromptValidator = z.object({\n promptId: z.string().uuid(),\n status: LCNConnectionPromptStatusValidator,\n surface: LCNConnectionPromptSurfaceValidator,\n triggerId: z.string(),\n triggeredAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n counterpart: LCNPublicProfileValidator,\n});\nexport type LCNConnectionPrompt = z.infer<typeof LCNConnectionPromptValidator>;\n\nexport const LCNConnectionPromptActionResultValidator = z.object({\n promptId: z.string().uuid(),\n status: LCNConnectionPromptActionStatusValidator,\n});\nexport type LCNConnectionPromptActionResult = z.infer<\n typeof LCNConnectionPromptActionResultValidator\n>;\n\nexport const LCNConnectionPromptMetadataValidator = z.object({\n promptId: z.string().uuid(),\n counterpartProfileId: z.string(),\n});\nexport type LCNConnectionPromptMetadata = z.infer<typeof LCNConnectionPromptMetadataValidator>;\n\nexport const LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({\n bio: LCNProfileValidator.shape.bio,\n websiteLink: LCNProfileValidator.shape.websiteLink,\n role: LCNProfileValidator.shape.role,\n highlightedCredentials: LCNProfileValidator.shape.highlightedCredentials,\n did: LCNProfileValidator.shape.did,\n});\nexport type LCNAuthedProfile = z.infer<typeof LCNAuthedProfileValidator>;\n\nexport const LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({\n email: LCNProfileValidator.shape.email,\n connectedAt: z.iso\n .datetime()\n .optional()\n .describe('When the viewer and this profile became connected.'),\n});\nexport type LCNConnectionProfile = z.infer<typeof LCNConnectionProfileValidator>;\n\nexport const LCNVisibleProfileValidator = z.union([\n LCNConnectionProfileValidator.strict(),\n LCNAuthedProfileValidator.strict(),\n LCNPublicProfileValidator.strict(),\n LCNProfileValidator,\n]);\nexport type LCNVisibleProfile = z.infer<typeof LCNVisibleProfileValidator>;\n\nexport const LCNProfileQueryValidator = z\n .object({\n profileId: StringQuery,\n displayName: StringQuery,\n shortBio: StringQuery,\n bio: StringQuery,\n email: StringQuery,\n websiteLink: StringQuery,\n isServiceProfile: z.boolean(),\n type: StringQuery,\n })\n .partial();\nexport type LCNProfileQuery = z.infer<typeof LCNProfileQueryValidator>;\n\nexport const PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({\n records: LCNProfileValidator.array(),\n});\nexport type PaginatedLCNProfiles = z.infer<typeof PaginatedLCNProfilesValidator>;\n\nexport const PaginatedVisibleLCNProfilesValidator = PaginationResponseValidator.extend({\n records: LCNVisibleProfileValidator.array(),\n});\nexport type PaginatedVisibleLCNProfiles = z.infer<typeof PaginatedVisibleLCNProfilesValidator>;\n\nexport const LCNProfileConnectionStatusEnum = z.enum([\n 'CONNECTED',\n 'PENDING_REQUEST_SENT',\n 'PENDING_REQUEST_RECEIVED',\n 'NOT_CONNECTED',\n]);\nexport type LCNProfileConnectionStatusEnum = z.infer<typeof LCNProfileConnectionStatusEnum>;\n\nexport const LCNProfileManagerValidator = z.object({\n id: z.string(),\n created: z.string(),\n displayName: z.string().default('').optional(),\n shortBio: z.string().default('').optional(),\n bio: z.string().default('').optional(),\n email: z.string().optional(),\n image: z.string().optional(),\n heroImage: z.string().optional(),\n});\nexport type LCNProfileManager = z.infer<typeof LCNProfileManagerValidator>;\n\nexport const PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({\n records: LCNProfileManagerValidator.extend({ did: z.string() }).array(),\n});\nexport type PaginatedLCNProfileManagers = z.infer<typeof PaginatedLCNProfileManagersValidator>;\n\nexport const LCNProfileManagerQueryValidator = z\n .object({\n id: StringQuery,\n displayName: StringQuery,\n shortBio: StringQuery,\n bio: StringQuery,\n email: StringQuery,\n })\n .partial();\nexport type LCNProfileManagerQuery = z.infer<typeof LCNProfileManagerQueryValidator>;\n\nexport const PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({\n records: z\n .object({\n profile: LCNProfileValidator,\n manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional(),\n })\n .array(),\n});\nexport type PaginatedLCNProfilesAndManagers = z.infer<\n typeof PaginatedLCNProfilesAndManagersValidator\n>;\n\nexport const SentCredentialInfoValidator = z.object({\n uri: z.string(),\n to: z.string(),\n from: z.string(),\n sent: z.iso.datetime(),\n received: z.iso.datetime().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\nexport type SentCredentialInfo = z.infer<typeof SentCredentialInfoValidator>;\n\nexport const BoostPermissionsValidator = z.object({\n role: z.string(),\n canView: z.boolean().default(true),\n canEdit: z.boolean(),\n canIssue: z.boolean(),\n canRevoke: z.boolean(),\n canManagePermissions: z.boolean(),\n canIssueChildren: z.string(),\n canCreateChildren: z.string(),\n canEditChildren: z.string(),\n canRevokeChildren: z.string(),\n canManageChildrenPermissions: z.string(),\n canManageChildrenProfiles: z.boolean().optional(),\n canViewAnalytics: z.boolean(),\n});\nexport type BoostPermissions = z.infer<typeof BoostPermissionsValidator>;\n\nexport const BoostPermissionsQueryValidator = z\n .object({\n role: StringQuery,\n canView: z.boolean(),\n canEdit: z.boolean(),\n canIssue: z.boolean(),\n canRevoke: z.boolean(),\n canManagePermissions: z.boolean(),\n canIssueChildren: StringQuery,\n canCreateChildren: StringQuery,\n canEditChildren: StringQuery,\n canRevokeChildren: StringQuery,\n canManageChildrenPermissions: StringQuery,\n canManageChildrenProfiles: z.boolean(),\n canViewAnalytics: z.boolean(),\n })\n .partial();\nexport type BoostPermissionsQuery = z.infer<typeof BoostPermissionsQueryValidator>;\n\nexport const ClaimHookTypeValidator = z.enum(['GRANT_PERMISSIONS', 'ADD_ADMIN', 'AUTO_CONNECT']);\nexport type ClaimHookType = z.infer<typeof ClaimHookTypeValidator>;\n\nexport const ClaimHookValidator = z.discriminatedUnion('type', [\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.GRANT_PERMISSIONS),\n data: z.object({\n claimUri: z.string(),\n targetUri: z.string(),\n permissions: BoostPermissionsValidator.partial(),\n }),\n }),\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.ADD_ADMIN),\n data: z.object({ claimUri: z.string(), targetUri: z.string() }),\n }),\n z.object({\n type: z.literal(ClaimHookTypeValidator.enum.AUTO_CONNECT),\n data: z.object({ claimUri: z.string(), targetUri: z.string() }),\n }),\n]);\nexport type ClaimHook = z.infer<typeof ClaimHookValidator>;\n\nexport const ClaimHookQueryValidator = z.object({\n type: StringQuery,\n data: z\n .object({\n claimUri: StringQuery,\n targetUri: StringQuery,\n permissions: BoostPermissionsQueryValidator.partial(),\n })\n .partial(),\n});\nexport type ClaimHookQuery = z.infer<typeof ClaimHookQueryValidator>;\n\nexport const FullClaimHookValidator = z\n .object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() })\n .and(ClaimHookValidator);\nexport type FullClaimHook = z.infer<typeof FullClaimHookValidator>;\n\nexport const PaginatedClaimHooksValidator = PaginationResponseValidator.extend({\n records: FullClaimHookValidator.array(),\n});\nexport type PaginatedClaimHooksType = z.infer<typeof PaginatedClaimHooksValidator>;\n\n/**\n * Status states for Boosts that control what actions can be performed.\n *\n * - **DRAFT**: Work in progress. Can edit all fields, but cannot send or generate claim links.\n * - **PROVISIONAL**: Active but iterating. Can both edit all fields AND send/issue credentials. Ideal for testing in production or soft launches.\n * - **LIVE**: Official/finalized. Can only edit meta and defaultPermissions. Core properties are locked for consistency.\n *\n * @example\n * ```typescript\n * // Create a provisional boost for testing\n * const boostUri = await learnCard.invoke.createBoost(credential, {\n * status: 'PROVISIONAL',\n * });\n * ```\n */\nexport const LCNBoostStatus = z.enum(['DRAFT', 'PROVISIONAL', 'LIVE']);\nexport type LCNBoostStatusEnum = z.infer<typeof LCNBoostStatus>;\n\nexport const BoostValidator = z.object({\n uri: z.string(),\n name: z.string().optional(),\n type: z.string().optional(),\n category: z.string().optional(),\n created: z.string().optional(),\n status: LCNBoostStatus.optional(),\n autoConnectRecipients: z.boolean().optional(),\n meta: z.record(z.string(), z.any()).optional(),\n claimPermissions: BoostPermissionsValidator.optional(),\n defaultPermissions: BoostPermissionsValidator.optional(),\n allowAnyoneToCreateChildren: z.boolean().optional(),\n});\nexport type Boost = z.infer<typeof BoostValidator>;\n\nconst BaseBoostQueryValidator = z\n .object({\n uri: StringQuery,\n name: StringQuery,\n type: StringQuery,\n category: StringQuery,\n meta: z.record(z.string(), StringQuery),\n status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),\n autoConnectRecipients: z.boolean(),\n })\n .partial();\n\nexport const BoostQueryValidator = z.union([\n z.object({\n $or: BaseBoostQueryValidator.array(),\n }),\n BaseBoostQueryValidator,\n]);\nexport type BoostQuery = z.infer<typeof BoostQueryValidator>;\n\nexport const PaginatedBoostsValidator = PaginationResponseValidator.extend({\n records: BoostValidator.array(),\n});\nexport type PaginatedBoostsType = z.infer<typeof PaginatedBoostsValidator>;\n\nexport const BoostRecipientValidator = z.object({\n to: LCNVisibleProfileValidator,\n from: z.string(),\n received: z.string().optional(),\n uri: z.string().optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type BoostRecipientInfo = z.infer<typeof BoostRecipientValidator>;\n\nexport const PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({\n records: BoostRecipientValidator.array(),\n});\nexport type PaginatedBoostRecipientsType = z.infer<typeof PaginatedBoostRecipientsValidator>;\n\nexport const BoostRecipientWithChildrenValidator = z.object({\n to: LCNVisibleProfileValidator,\n from: z.string(),\n received: z.string().optional(),\n boostUris: z.array(z.string()),\n credentialUris: z.array(z.string()).optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type BoostRecipientWithChildrenInfo = z.infer<typeof BoostRecipientWithChildrenValidator>;\n\nexport const PaginatedBoostRecipientsWithChildrenValidator = PaginationResponseValidator.extend({\n records: BoostRecipientWithChildrenValidator.array(),\n});\nexport type PaginatedBoostRecipientsWithChildrenType = z.infer<\n typeof PaginatedBoostRecipientsWithChildrenValidator\n>;\n\nexport const LCNBoostClaimLinkSigningAuthorityValidator = z.object({\n endpoint: z.string(),\n name: z.string(),\n did: z.string().optional(),\n});\nexport type LCNBoostClaimLinkSigningAuthorityType = z.infer<\n typeof LCNBoostClaimLinkSigningAuthorityValidator\n>;\n\nexport const LCNBoostClaimLinkOptionsValidator = z.object({\n ttlSeconds: z.number().optional(),\n totalUses: z.number().optional(),\n});\nexport type LCNBoostClaimLinkOptionsType = z.infer<typeof LCNBoostClaimLinkOptionsValidator>;\n\nexport const LCNSigningAuthorityValidator = z.object({\n endpoint: z.string(),\n});\nexport type LCNSigningAuthorityType = z.infer<typeof LCNSigningAuthorityValidator>;\n\nexport const LCNSigningAuthorityForUserValidator = z.object({\n signingAuthority: LCNSigningAuthorityValidator,\n relationship: z.object({\n name: z\n .string()\n .max(15)\n .regex(/^[a-z0-9-]+$/, {\n message:\n 'The input string must contain only lowercase letters, numbers, and hyphens.',\n }),\n did: z.string(),\n isPrimary: z.boolean().optional(),\n }),\n});\nexport type LCNSigningAuthorityForUserType = z.infer<typeof LCNSigningAuthorityForUserValidator>;\n\nexport const AutoBoostConfigValidator = z.object({\n boostUri: z.string(),\n signingAuthority: z.object({\n endpoint: z.string(),\n name: z.string(),\n }),\n});\nexport type AutoBoostConfig = z.infer<typeof AutoBoostConfigValidator>;\n\nexport const SendBoostTemplateValidator = BoostValidator.partial()\n .omit({ uri: true, claimPermissions: true })\n .extend({\n credential: VCValidator.or(UnsignedVCValidator),\n claimPermissions: BoostPermissionsValidator.partial().optional(),\n skills: z\n .array(\n z.object({\n frameworkId: z.string(),\n id: z.string(),\n proficiencyLevel: z.number().optional(),\n })\n )\n .min(1)\n .optional(),\n });\n\n// Branding options for email/SMS delivery (used when recipient is email/phone)\nexport const SendBrandingOptionsValidator = z.object({\n issuerName: z.string().optional().describe('Name of the issuing organization'),\n issuerLogoUrl: z.string().url().optional().describe('Logo URL of the issuing organization'),\n credentialName: z.string().optional().describe('Display name for the credential'),\n recipientName: z.string().optional().describe('Name of the recipient for personalization'),\n});\nexport type SendBrandingOptions = z.infer<typeof SendBrandingOptionsValidator>;\n\nexport const GuardianStatusValidator = z.enum([\n 'AWAITING_GUARDIAN',\n 'GUARDIAN_APPROVED',\n 'GUARDIAN_REJECTED',\n]);\nexport type GuardianStatus = z.infer<typeof GuardianStatusValidator>;\n\n// Options for send method (applies when recipient is email/phone, routes to Universal Inbox)\nexport const SendOptionsValidator = z.object({\n webhookUrl: z.string().url().optional().describe('Webhook URL to receive claim notifications'),\n suppressDelivery: z\n .boolean()\n .optional()\n .describe('If true, returns claimUrl without sending email/SMS'),\n branding: SendBrandingOptionsValidator.optional().describe('Branding for email/SMS delivery'),\n guardianEmail: z\n .string()\n .email()\n .optional()\n .describe('Guardian email that must approve before student can claim'),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'How many days the credential stays claimable in the Universal Inbox (default 30). Does not change the credential validity period.'\n ),\n});\nexport type SendOptions = z.infer<typeof SendOptionsValidator>;\n\n// Route-level validator (TRPC requires ZodObject, not discriminatedUnion)\nexport const SendBoostInputValidator = z\n .object({\n type: z.literal('boost'),\n recipient: z.string().describe('Profile ID, DID, email, or phone number (auto-detected)'),\n contractUri: z.string().optional(),\n templateUri: z.string().optional(),\n template: SendBoostTemplateValidator.optional(),\n signedCredential: VCValidator.optional(),\n options: SendOptionsValidator.optional().describe(\n 'Options for email/phone recipients (Universal Inbox)'\n ),\n templateData: z.record(z.string(), z.unknown()).optional(),\n integrationId: z.string().optional().describe('Integration ID for activity tracking'),\n refresh: z\n .boolean()\n .optional()\n .describe(\n 'Request managed credential refresh for this send. Profile/DID recipients use immediate issuance; email/phone recipients use deferred Universal Inbox signing and bind the holder at claim.'\n ),\n idempotencyKey: z\n .string()\n .min(1)\n .max(200)\n .optional()\n .describe(\n 'Caller-chosen key that makes a managed refresh send (refresh: true) safe to retry as a whole: retries with the same key reuse the same boost, refresh allocation and result. Reusing a key for a different request is rejected. With signedCredential, requires prior tRPC prepareRefreshableSend; direct REST callers omit the key and retry the exact signed credential and templateUri.'\n ),\n })\n .refine(data => data.templateUri || data.template || data.signedCredential, {\n message: 'Either templateUri, template, or signedCredential must be provided.',\n path: ['templateUri'],\n })\n .refine(\n data => {\n if (data.options?.guardianEmail) {\n return data.options.guardianEmail.toLowerCase() !== data.recipient.toLowerCase();\n }\n return true;\n },\n {\n message: 'guardianEmail must differ from recipient (self-approval not allowed)',\n path: ['options', 'guardianEmail'],\n }\n )\n .refine(data => !data.idempotencyKey || data.refresh === true, {\n message: 'idempotencyKey is only supported with refresh: true.',\n path: ['idempotencyKey'],\n });\nexport type SendBoostInput = z.infer<typeof SendBoostInputValidator>;\n\n// Inbox-specific response fields (only present when sent via email/phone)\nexport const SendInboxResponseValidator = z.object({\n refresh: InboxCredentialRefreshReceiptValidator.optional(),\n issuanceId: z.string(),\n status: z.enum(['PENDING', 'ISSUED', 'EXPIRED', 'DELIVERED', 'CLAIMED']),\n claimUrl: z.string().url().optional().describe('Present when suppressDelivery=true'),\n guardianStatus: GuardianStatusValidator.optional().describe(\n 'Present when guardianEmail was specified'\n ),\n});\nexport type SendInboxResponse = z.infer<typeof SendInboxResponseValidator>;\n\nexport const SendBoostResponseValidator = z.object({\n type: z.literal('boost'),\n credentialUri: z.string(),\n uri: z.string(),\n activityId: z.string().describe('Links to the activity lifecycle for this issuance'),\n inbox: SendInboxResponseValidator.optional().describe(\n 'Present when sent via email/phone (Universal Inbox)'\n ),\n refresh: ManagedCredentialRefreshReceiptValidator.optional().describe(\n 'Present when managed refresh was requested: issuance metadata the issuer keeps to publish future updates'\n ),\n});\nexport type SendBoostResponse = z.infer<typeof SendBoostResponseValidator>;\n\nexport const PrepareRefreshableSendInputValidator = z\n .object({\n recipient: z.string(),\n templateUri: z.string().optional(),\n template: SendBoostTemplateValidator.optional(),\n contractUri: z.string().optional(),\n templateData: z.record(z.string(), z.unknown()).optional(),\n integrationId: z.string().optional(),\n /** Credential ID to allocate for; generated server-side when omitted. */\n credentialId: z.string().min(1).optional(),\n idempotencyKey: z.string().min(1).max(200).optional(),\n })\n .refine(data => Boolean(data.templateUri) !== Boolean(data.template), {\n message: 'Provide exactly one of templateUri or template.',\n });\nexport type PrepareRefreshableSendInput = z.infer<typeof PrepareRefreshableSendInputValidator>;\n\nexport const PrepareRefreshableSendResultValidator = z.object({\n boostUri: z.string(),\n credentialId: z.string(),\n refreshId: z.string(),\n refreshService: ManagedCredentialRefreshServiceValidator,\n /** The DID to use as credentialSubject.id (recipient DID, or the profile's did:web). */\n holderDid: z.string(),\n /** Present when this idempotencyKey already completed: return it without signing. */\n completed: SendBoostResponseValidator.optional(),\n});\nexport type PrepareRefreshableSendResult = z.infer<typeof PrepareRefreshableSendResultValidator>;\n\n// Plugin-level discriminated union (for extensibility)\nexport const SendInputValidator = z.discriminatedUnion('type', [SendBoostInputValidator]);\nexport type SendInput = z.infer<typeof SendInputValidator>;\n\nexport const SendResponseValidator = z.discriminatedUnion('type', [SendBoostResponseValidator]);\nexport type SendResponse = z.infer<typeof SendResponseValidator>;\n\nexport const ConsentFlowTermsStatusValidator = z.enum(['live', 'stale', 'withdrawn']);\nexport type ConsentFlowTermsStatus = z.infer<typeof ConsentFlowTermsStatusValidator>;\n\nexport const ConsentFlowContractValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n categories: z\n .record(\n z.string(),\n z.object({\n required: z.boolean(),\n defaultEnabled: z.boolean().optional(),\n })\n )\n .default({}),\n })\n .prefault({ categories: {} }),\n personal: z\n .record(\n z.string(),\n z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })\n )\n .default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n write: z\n .object({\n credentials: z\n .object({\n categories: z\n .record(\n z.string(),\n z.object({\n required: z.boolean(),\n defaultEnabled: z.boolean().optional(),\n })\n )\n .default({}),\n })\n .prefault({ categories: {} }),\n personal: z\n .record(\n z.string(),\n z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })\n )\n .default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n});\nexport type ConsentFlowContract = z.infer<typeof ConsentFlowContractValidator>;\nexport type ConsentFlowContractInput = z.input<typeof ConsentFlowContractValidator>;\n\nexport const ConsentFlowContractDetailsValidator = z.object({\n contract: ConsentFlowContractValidator,\n owner: LCNProfileValidator,\n name: z.string(),\n subtitle: z.string().optional(),\n description: z.string().optional(),\n reasonForAccessing: z.string().optional(),\n image: z.string().optional(),\n uri: z.string(),\n needsGuardianConsent: z.boolean().optional(),\n redirectUrl: z.string().optional(),\n frontDoorBoostUri: z.string().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n expiresAt: z.string().optional(),\n autoBoosts: z.string().array().optional(),\n writers: z.array(LCNProfileValidator).optional(),\n});\nexport type ConsentFlowContractDetails = z.infer<typeof ConsentFlowContractDetailsValidator>;\nexport type ConsentFlowContractDetailsInput = z.input<typeof ConsentFlowContractDetailsValidator>;\n\nexport const ConsentFlowContractRequestStatusValidator = z\n .enum(['pending', 'accepted', 'denied'])\n .nullable();\nexport type ConsentFlowContractRequestStatus = z.infer<\n typeof ConsentFlowContractRequestStatusValidator\n>;\n\nexport const ConsentFlowContractRequestReadStatusValidator = z.enum(['unseen', 'seen']).nullable();\nexport type ConsentFlowContractRequestReadStatus = z.infer<\n typeof ConsentFlowContractRequestReadStatusValidator\n>;\n\nexport const ConsentFlowContractRequestForProfileValidator = z.object({\n profile: LCNProfileValidator,\n status: ConsentFlowContractRequestStatusValidator,\n readStatus: ConsentFlowContractRequestReadStatusValidator.optional(),\n});\nexport type ConsentFlowContractRequestForProfile = z.infer<\n typeof ConsentFlowContractRequestForProfileValidator\n>;\n\nexport const ConsentFlowContractRequestForProfileListValidator = z.array(\n ConsentFlowContractRequestForProfileValidator\n);\nexport type ConsentFlowContractRequestForProfileList = z.infer<\n typeof ConsentFlowContractRequestForProfileListValidator\n>;\n\nexport const PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array(),\n});\nexport type PaginatedConsentFlowContracts = z.infer<typeof PaginatedConsentFlowContractsValidator>;\n\nexport const ConsentFlowContractDataValidator = z.object({\n credentials: z.object({ categories: z.record(z.string(), z.string().array()).default({}) }),\n personal: z.record(z.string(), z.string()).default({}),\n date: z.string(),\n});\nexport type ConsentFlowContractData = z.infer<typeof ConsentFlowContractDataValidator>;\n\nexport const PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDataValidator.array(),\n});\nexport type PaginatedConsentFlowData = z.infer<typeof PaginatedConsentFlowDataValidator>;\n\nexport const ConsentFlowTermValidator = z.object({\n sharing: z.boolean().optional(),\n shared: z.string().array().optional(),\n shareAll: z.boolean().optional(),\n shareUntil: z.string().optional(),\n});\nexport type ConsentFlowTerm = z.infer<typeof ConsentFlowTermValidator>;\n\nexport const ConsentFlowTermsValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n shareAll: z.boolean().optional(),\n sharing: z.boolean().optional(),\n categories: z.record(z.string(), ConsentFlowTermValidator).default({}),\n })\n .prefault({ categories: {} }),\n personal: z.record(z.string(), z.string()).default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n write: z\n .object({\n credentials: z\n .object({ categories: z.record(z.string(), z.boolean()).default({}) })\n .prefault({ categories: {} }),\n personal: z.record(z.string(), z.boolean()).default({}),\n })\n .prefault({ credentials: { categories: {} }, personal: {} }),\n deniedWriters: z.array(z.string()).optional(),\n});\nexport type ConsentFlowTerms = z.infer<typeof ConsentFlowTermsValidator>;\nexport type ConsentFlowTermsInput = z.input<typeof ConsentFlowTermsValidator>;\nexport const PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({\n records: z\n .object({\n expiresAt: z.string().optional(),\n oneTime: z.boolean().optional(),\n terms: ConsentFlowTermsValidator,\n contract: ConsentFlowContractDetailsValidator,\n uri: z.string(),\n consenter: LCNProfileValidator,\n status: ConsentFlowTermsStatusValidator,\n })\n .array(),\n});\nexport type PaginatedConsentFlowTerms = z.infer<typeof PaginatedConsentFlowTermsValidator>;\n\nexport const ConsentFlowGuardianApprovalValidator = z.object({\n guardianProfileId: z.string(),\n guardianDid: z.string(),\n approvedAt: z.string().datetime(),\n contractUpdatedAt: z.string(),\n});\nexport type ConsentFlowGuardianApproval = z.infer<typeof ConsentFlowGuardianApprovalValidator>;\n\nexport const ConsentFlowContractDataForDidValidator = z.object({\n credentials: z.object({ category: z.string(), uri: z.string() }).array(),\n personal: z.record(z.string(), z.string()).default({}),\n date: z.string(),\n createdAt: z.string().optional(),\n contractUpdatedAt: z.string(),\n contractExpiresAt: z.string().optional(),\n reasonForAccessing: z.string().optional(),\n guardian: z.object({\n required: z.boolean(),\n approved: z.boolean(),\n approval: ConsentFlowGuardianApprovalValidator.optional(),\n }),\n contractUri: z.string(),\n termsUri: z.string(),\n status: ConsentFlowTermsStatusValidator,\n expiresAt: z.string().optional(),\n terms: ConsentFlowTermsValidator,\n});\nexport type ConsentFlowContractDataForDid = z.infer<typeof ConsentFlowContractDataForDidValidator>;\n\nexport const PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({\n records: ConsentFlowContractDataForDidValidator.array(),\n});\nexport type PaginatedConsentFlowDataForDid = z.infer<\n typeof PaginatedConsentFlowDataForDidValidator\n>;\n\nexport const ConsentFlowContractQueryValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n categories: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n personal: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n write: z\n .object({\n credentials: z\n .object({\n categories: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n personal: z\n .record(z.string(), z.object({ required: z.boolean().optional() }))\n .optional(),\n })\n .optional(),\n});\nexport type ConsentFlowContractQuery = z.infer<typeof ConsentFlowContractQueryValidator>;\nexport type ConsentFlowContractQueryInput = z.input<typeof ConsentFlowContractQueryValidator>;\n\nexport const ConsentFlowDataQueryValidator = z.object({\n anonymize: z.boolean().optional(),\n credentials: z.object({ categories: z.record(z.string(), z.boolean()).optional() }).optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n});\nexport type ConsentFlowDataQuery = z.infer<typeof ConsentFlowDataQueryValidator>;\nexport type ConsentFlowDataQueryInput = z.input<typeof ConsentFlowDataQueryValidator>;\n\nexport const ConsentFlowDataForDidQueryValidator = z.object({\n credentials: z.object({ categories: z.record(z.string(), z.boolean()).optional() }).optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n id: StringQuery.optional(),\n});\nexport type ConsentFlowDataForDidQuery = z.infer<typeof ConsentFlowDataForDidQueryValidator>;\nexport type ConsentFlowDataForDidQueryInput = z.input<typeof ConsentFlowDataForDidQueryValidator>;\n\nexport const ConsentFlowTermsQueryValidator = z.object({\n read: z\n .object({\n anonymize: z.boolean().optional(),\n credentials: z\n .object({\n shareAll: z.boolean().optional(),\n sharing: z.boolean().optional(),\n categories: z\n .record(z.string(), ConsentFlowTermValidator.optional())\n .optional(),\n })\n .optional(),\n personal: z.record(z.string(), z.string()).optional(),\n })\n .optional(),\n write: z\n .object({\n credentials: z\n .object({ categories: z.record(z.string(), z.boolean()).optional() })\n .optional(),\n personal: z.record(z.string(), z.boolean()).optional(),\n })\n .optional(),\n});\nexport type ConsentFlowTermsQuery = z.infer<typeof ConsentFlowTermsQueryValidator>;\nexport type ConsentFlowTermsQueryInput = z.input<typeof ConsentFlowTermsQueryValidator>;\n\nexport const ConsentFlowTransactionActionValidator = z.enum([\n 'consent',\n 'update',\n 'sync',\n 'withdraw',\n 'write',\n]);\nexport type ConsentFlowTransactionAction = z.infer<typeof ConsentFlowTransactionActionValidator>;\n\nexport const ConsentFlowTransactionsQueryValidator = z.object({\n terms: ConsentFlowTermsQueryValidator.optional(),\n action: ConsentFlowTransactionActionValidator.or(\n ConsentFlowTransactionActionValidator.array()\n ).optional(),\n date: z\n .object({ $gt: z.string() })\n .or(z.object({ $lt: z.string() }))\n .or(z.object({ $eq: z.string() }))\n .optional(),\n expiresAt: z\n .object({ $gt: z.string() })\n .or(z.object({ $lt: z.string() }))\n .or(z.object({ $eq: z.string() }))\n .optional(),\n oneTime: z.boolean().optional(),\n});\nexport type ConsentFlowTransactionsQuery = z.infer<typeof ConsentFlowTransactionsQueryValidator>;\nexport type ConsentFlowTransactionsQueryInput = z.input<\n typeof ConsentFlowTransactionsQueryValidator\n>;\n\nexport const ConsentFlowTransactionValidator = z.object({\n expiresAt: z.string().optional(),\n oneTime: z.boolean().optional(),\n terms: ConsentFlowTermsValidator.optional(),\n guardianApproval: ConsentFlowGuardianApprovalValidator.optional(),\n id: z.string(),\n action: ConsentFlowTransactionActionValidator,\n date: z.string(),\n uris: z.string().array().optional(),\n});\nexport type ConsentFlowTransaction = z.infer<typeof ConsentFlowTransactionValidator>;\n\nexport const HolderExportConsentRecordValidator = z.object({\n termsUri: z.string(),\n status: ConsentFlowTermsStatusValidator,\n contract: ConsentFlowContractDetailsValidator,\n terms: ConsentFlowTermsValidator,\n transactions: ConsentFlowTransactionValidator.array(),\n});\nexport type HolderExportConsentRecord = z.infer<typeof HolderExportConsentRecordValidator>;\n\nexport const HolderExportMetadataValidator = z.object({\n consentRecords: HolderExportConsentRecordValidator.array(),\n truncated: z.boolean().optional(),\n warnings: z.string().array().optional(),\n limits: z\n .object({\n maxConsentRecords: z.number(),\n maxTransactionsPerConsentRecord: z.number(),\n })\n .optional(),\n});\nexport type HolderExportMetadata = z.infer<typeof HolderExportMetadataValidator>;\n\nexport const PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({\n records: ConsentFlowTransactionValidator.array(),\n});\nexport type PaginatedConsentFlowTransactions = z.infer<\n typeof PaginatedConsentFlowTransactionsValidator\n>;\n\n// Skill Frameworks: Query + Paginated types\nconst BaseSkillFrameworkQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n sourceURI: StringQuery,\n status: StringQuery,\n })\n .partial();\n\nexport const SkillFrameworkQueryValidator = z.union([\n z.object({ $or: BaseSkillFrameworkQueryValidator.array() }),\n BaseSkillFrameworkQueryValidator,\n]);\nexport type SkillFrameworkQuery = z.infer<typeof SkillFrameworkQueryValidator>;\n\n// moved below SkillFrameworkValidator\n\nexport const ContractCredentialValidator = z.object({\n credentialUri: z.string(),\n termsUri: z.string(),\n contractUri: z.string(),\n boostUri: z.string(),\n category: z.string().optional(),\n date: z.string(),\n});\nexport type ContractCredential = z.infer<typeof ContractCredentialValidator>;\n\nexport const PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({\n records: ContractCredentialValidator.array(),\n});\nexport type PaginatedContractCredentials = z.infer<typeof PaginatedContractCredentialsValidator>;\n\nexport const LCNNotificationTypeEnumValidator = z.enum([\n 'CONNECTION_REQUEST',\n 'CONNECTION_REQUEST_EXPIRED_INVITE',\n 'CONNECTION_ACCEPTED',\n 'CREDENTIAL_RECEIVED',\n 'CREDENTIAL_ACCEPTED',\n 'BOOST_RECEIVED',\n 'BOOST_ACCEPTED',\n 'PRESENTATION_REQUEST',\n 'PRESENTATION_RECEIVED',\n 'CONSENT_FLOW_TRANSACTION',\n 'ISSUANCE_CLAIMED',\n 'ISSUANCE_DELIVERED',\n 'ISSUANCE_ERROR',\n 'PROFILE_PARENT_APPROVED',\n 'APP_LISTING_SUBMITTED',\n 'APP_LISTING_APPROVED',\n 'APP_LISTING_REJECTED',\n 'APP_LISTING_WITHDRAWN',\n 'DEVICE_LINK_REQUEST',\n 'GUARDIAN_APPROVAL_PENDING',\n 'GUARDIAN_APPROVED',\n 'GUARDIAN_REJECTED',\n 'APP_NOTIFICATION',\n 'CREDENTIAL_REVOKED',\n 'CREDENTIAL_SUSPENDED',\n 'CREDENTIAL_UNSUSPENDED',\n 'CREDENTIAL_REFRESHED',\n]);\n\nexport type LCNNotificationTypeEnum = z.infer<typeof LCNNotificationTypeEnumValidator>;\n\nexport const LCNNotificationMessageValidator = z.object({\n title: z.string().optional(),\n body: z.string().optional(),\n});\n\nexport type LCNNotificationMessage = z.infer<typeof LCNNotificationMessageValidator>;\n\nexport const LCNInboxContactMethodValidator = z.object({\n type: z.string(),\n value: z.string(),\n});\n\nexport type LCNInboxContactMethod = z.infer<typeof LCNInboxContactMethodValidator>;\n\nexport const LCNInboxStatusEnumValidator = z.enum([\n 'PENDING',\n 'ISSUED',\n 'EXPIRED',\n /* DEPRECATED \u2014 use ISSUED */ 'DELIVERED',\n /* DEPRECATED \u2014 use ISSUED */ 'CLAIMED',\n]);\nexport type LCNInboxStatusEnum = z.infer<typeof LCNInboxStatusEnumValidator>;\n\nexport const LCNNotificationInboxValidator = z.object({\n issuanceId: z.string(),\n status: LCNInboxStatusEnumValidator,\n recipient: z.object({\n contactMethod: LCNInboxContactMethodValidator.optional(),\n learnCardId: z.string().optional(),\n }),\n timestamp: z.iso.datetime().optional(),\n});\n\nexport type LCNNotificationInbox = z.infer<typeof LCNNotificationInboxValidator>;\n\nexport const LCNNotificationMetadataValidator = z\n .object({\n connectionPrompt: LCNConnectionPromptMetadataValidator.optional(),\n })\n .catchall(z.unknown());\nexport type LCNNotificationMetadata = z.infer<typeof LCNNotificationMetadataValidator>;\n\nexport const LCNNotificationDataValidator = z\n .object({\n vcUris: z.array(z.string()).optional(),\n vpUris: z.array(z.string()).optional(),\n transaction: ConsentFlowTransactionValidator.optional(),\n inbox: LCNNotificationInboxValidator.optional(),\n metadata: LCNNotificationMetadataValidator.optional(),\n })\n .loose();\nexport type LCNNotificationData = z.infer<typeof LCNNotificationDataValidator>;\n\nexport const LCNNotificationValidator = z.object({\n type: LCNNotificationTypeEnumValidator,\n to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),\n from: z.union([z.string(), LCNProfileValidator.partial().and(z.object({ did: z.string() }))]),\n message: LCNNotificationMessageValidator.optional(),\n data: LCNNotificationDataValidator.optional(),\n sent: z.iso.datetime().optional(),\n webhookUrl: z.string().optional(),\n});\n\nexport type LCNNotification = z.infer<typeof LCNNotificationValidator>;\n\nexport const AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = 'auth-grant:';\nexport const ACT_AS_HEADER = 'X-LearnCard-Act-As';\n\nexport const AuthGrantValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n challenge: z\n .string()\n .startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX)\n .min(10, { message: 'Challenge is too short' })\n .max(100, { message: 'Challenge is too long' }),\n status: z.enum(['revoked', 'active'], {\n error: issue => {\n if (issue.code === 'invalid_value') return 'Status must be either active or revoked';\n return 'Status is required';\n },\n }),\n scope: z.string(),\n actAs: z.string().optional(),\n createdAt: z.iso.datetime({ error: 'createdAt must be a valid ISO 8601 datetime string' }),\n expiresAt: z.iso\n .datetime({ error: 'expiresAt must be a valid ISO 8601 datetime string' })\n .nullish()\n .optional(),\n});\nexport type AuthGrantType = z.infer<typeof AuthGrantValidator>;\n\nexport const FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());\nexport type FlatAuthGrantType = z.infer<typeof FlatAuthGrantValidator>;\n\nexport const AuthGrantStatusValidator = z.enum(['active', 'revoked']);\n\nexport type AuthGrantStatus = z.infer<typeof AuthGrantStatusValidator>;\n\nexport const AuthGrantQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n status: AuthGrantStatusValidator,\n })\n .partial();\n\nexport type AuthGrantQuery = z.infer<typeof AuthGrantQueryValidator>;\n\n// Contact Methods\nconst contactMethodBase = z.object({\n id: z.string(),\n isVerified: z.boolean(),\n verifiedAt: z.string().optional(),\n isPrimary: z.boolean(),\n createdAt: z.string(),\n});\n\nexport const ContactMethodValidator = z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('email'),\n value: z.string().email(),\n })\n .merge(contactMethodBase),\n z\n .object({\n type: z.literal('phone'),\n value: z.string(), // Can be improved with a regex later\n })\n .merge(contactMethodBase),\n]);\n\nexport type ContactMethodType = z.infer<typeof ContactMethodValidator>;\n\nconst createContactMethodBase = z.object({\n isVerified: z.boolean().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport const ContactMethodCreateValidator = z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('email'),\n value: z.string().email(),\n })\n .merge(createContactMethodBase),\n z\n .object({\n type: z.literal('phone'),\n value: z.string(),\n })\n .merge(createContactMethodBase),\n]);\n\nexport type ContactMethodCreateType = z.infer<typeof ContactMethodCreateValidator>;\n\nexport const ContactMethodQueryValidator = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('email'),\n value: z.string().email(),\n }),\n z.object({\n type: z.literal('phone'),\n value: z.string(),\n }),\n]);\n\nexport type ContactMethodQueryType = z.infer<typeof ContactMethodQueryValidator>;\n\nexport const ContactMethodVerificationRequestValidator = z.object({\n value: z.string(),\n type: z.enum(['email', 'phone']),\n});\n\nexport type ContactMethodVerificationRequestType = z.infer<\n typeof ContactMethodVerificationRequestValidator\n>;\n\nexport const ContactMethodVerificationValidator = z.object({\n token: z.string(),\n});\n\nexport type ContactMethodVerificationType = z.infer<typeof ContactMethodVerificationValidator>;\n\nexport const SetPrimaryContactMethodValidator = z.object({\n contactMethodId: z.string(),\n});\n\nexport type SetPrimaryContactMethodType = z.infer<typeof SetPrimaryContactMethodValidator>;\n\n// Create Inbox Claim Session for a Contact Method\nexport const CreateContactMethodSessionValidator = z.object({\n contactMethod: ContactMethodVerificationRequestValidator,\n otpChallenge: z.string(),\n});\n\nexport type CreateContactMethodSessionType = z.infer<typeof CreateContactMethodSessionValidator>;\n\nexport const CreateContactMethodSessionResponseValidator = z.object({\n sessionJwt: z.string(),\n});\n\nexport type CreateContactMethodSessionResponseType = z.infer<\n typeof CreateContactMethodSessionResponseValidator\n>;\n\n// Inbox Credentials\nexport const InboxCredentialValidator = z.object({\n refresh: InboxCredentialRefreshReceiptValidator.optional(),\n refreshId: z.string().optional(),\n id: z.string(),\n credential: z.string().optional(),\n isSigned: z.boolean(),\n currentStatus: LCNInboxStatusEnumValidator,\n isAccepted: z.boolean().optional(),\n expiresAt: z.string(),\n createdAt: z.string(),\n finalizedAt: z.string().optional(),\n expiredAt: z.string().optional(),\n credentialName: z.string().optional(),\n achievementType: z.string().optional(),\n issuerDid: z.string(),\n webhookUrl: z.string().optional(),\n boostUri: z.string().optional(),\n activityId: z.string().optional(),\n integrationId: z.string().optional(),\n signingAuthority: z\n .object({\n endpoint: z.string().optional(),\n name: z.string().optional(),\n })\n .optional(),\n // Guardian gate fields (all optional \u2014 absent on pre-existing credentials)\n guardianEmail: z.string().email().optional(),\n guardianStatus: GuardianStatusValidator.optional(),\n guardianApprovedAt: z.string().optional(),\n guardianApprovedByDid: z.string().optional(),\n});\n\nexport type InboxCredentialType = z.infer<typeof InboxCredentialValidator>;\n\nexport const PaginatedInboxCredentialsValidator = z.object({\n hasMore: z.boolean(),\n records: z.array(InboxCredentialValidator),\n cursor: z.string().optional(),\n});\n\nexport type PaginatedInboxCredentialsType = z.infer<typeof PaginatedInboxCredentialsValidator>;\n\nexport const InboxCredentialQueryValidator = z\n .object({\n currentStatus: LCNInboxStatusEnumValidator,\n id: z.string(),\n isSigned: z.boolean(),\n isAccepted: z.boolean().optional(),\n issuerDid: z.string(),\n boostUri: z.string(),\n })\n .partial();\n\nexport type InboxCredentialQuery = z.infer<typeof InboxCredentialQueryValidator>;\n\nexport const IssueInboxSigningAuthorityValidator = z.object({\n endpoint: z.string().url(),\n name: z.string(),\n});\n\nexport type IssueInboxSigningAuthority = z.infer<typeof IssueInboxSigningAuthorityValidator>;\n\nexport const IssueInboxCredentialValidator = z\n .object({\n // === CORE DATA (Required) ===\n // WHAT is being sent and WHO is it for?\n recipient: ContactMethodQueryValidator.describe('The recipient of the credential'),\n\n // Either credential OR templateUri must be provided\n credential: VCValidator.or(VPValidator)\n .or(UnsignedVCValidator)\n .optional()\n .describe(\n 'The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration.'\n ),\n templateUri: z\n .string()\n .optional()\n .describe(\n 'URI of a boost template to use for issuance. The boost credential will be resolved and used. Mutually exclusive with credential field.'\n ),\n\n refresh: z\n .boolean()\n .optional()\n .describe(\n 'Allocate managed refresh before signing. Requires unsigned content and a registered signing authority; binds the holder on claim.'\n ),\n idempotencyKey: z.string().min(1).max(200).optional(),\n // === OPTIONAL FEATURES ===\n // Add major, distinct features at the top level.\n //consentRequest: ConsentRequestValidator.optional(),\n\n // === PROCESS CONFIGURATION (Optional) ===\n // HOW should this issuance be handled?\n configuration: z\n .object({\n guardianEmail: z\n .string()\n .email()\n .optional()\n .describe(\n 'Require approval from this guardian before the recipient can claim. Must differ from the recipient email.'\n ),\n signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(\n 'The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed.'\n ),\n webhookUrl: z\n .string()\n .url()\n .optional()\n .describe('The webhook URL to receive credential issuance events.'),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'How many days the encrypted inbox payload remains claimable. This does not change the credential validity period.'\n ),\n templateData: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n 'Template data to render into the boost credential template using Mustache syntax. Only used when boostUri is provided.'\n ),\n // --- For User-Facing Delivery (Email/SMS) ---\n delivery: z\n .object({\n suppress: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n 'Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users.'\n ),\n template: z\n .object({\n id: z\n .enum(['universal-inbox-claim'])\n .optional()\n .describe(\n 'The template ID to use for the credential delivery. If not provided, the default template will be used.'\n ),\n model: z\n .object({\n issuer: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the organization (e.g., \"State University\").'\n ),\n logoUrl: z\n .string()\n .url()\n .optional()\n .describe(\n \"The URL of the organization's logo.\"\n ),\n })\n .optional(),\n credential: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the credential (e.g., \"Bachelor of Science\").'\n ),\n type: z\n .string()\n .optional()\n .describe(\n 'The type of the credential (e.g., \"degree\", \"certificate\").'\n ),\n })\n .optional(),\n recipient: z\n .object({\n name: z\n .string()\n .optional()\n .describe(\n 'The name of the recipient (e.g., \"John Doe\").'\n ),\n })\n .optional(),\n })\n .describe(\n 'The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.'\n ),\n })\n .optional()\n .describe(\n 'The template to use for the credential delivery. If not provided, the default template will be used.'\n ),\n })\n .optional()\n .describe(\n 'Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.'\n ),\n })\n .optional()\n .describe(\n 'Configuration for the credential issuance. If not provided, the default configuration will be used.'\n ),\n })\n .refine(data => !data.idempotencyKey || data.refresh === true, {\n message: 'idempotencyKey requires refresh: true.',\n })\n .refine(data => data.credential || data.templateUri, {\n message: 'Either credential or templateUri must be provided.',\n path: ['credential'],\n })\n .refine(\n data =>\n !data.configuration?.guardianEmail ||\n data.recipient.type !== 'email' ||\n data.configuration.guardianEmail.toLowerCase() !== data.recipient.value.toLowerCase(),\n {\n message: 'guardianEmail must differ from recipient (self-approval not allowed)',\n path: ['configuration', 'guardianEmail'],\n }\n );\n\nexport type IssueInboxCredentialType = z.infer<typeof IssueInboxCredentialValidator>;\n\nexport const IssueInboxCredentialResponseValidator = z.object({\n refresh: InboxCredentialRefreshReceiptValidator.optional(),\n issuanceId: z.string(),\n status: LCNInboxStatusEnumValidator,\n recipient: ContactMethodQueryValidator,\n claimUrl: z.string().url().optional(),\n recipientDid: z.string().optional(),\n});\n\n// Do not apply delivery defaults before merging: omitted per-item fields inherit batch defaults.\nconst InboxBatchConfigurationValidator = IssueInboxCredentialValidator.shape.configuration\n .unwrap()\n .extend({\n refresh: IssueInboxCredentialValidator.shape.refresh.describe(\n 'Enable managed refresh by default. An item configuration.refresh overrides this value, including false.'\n ),\n delivery: IssueInboxCredentialValidator.shape.configuration\n .unwrap()\n .shape.delivery.unwrap()\n .extend({ suppress: z.boolean().optional() })\n .optional(),\n });\n\nconst InboxBatchItemConfigurationValidator = InboxBatchConfigurationValidator.extend({\n guardianEmail: InboxBatchConfigurationValidator.shape.guardianEmail\n .nullable()\n .describe(\n 'Require guardian approval, or set null to clear a batch-level guardianEmail for this item.'\n ),\n});\n\nexport const IssueInboxCredentialBatchItemValidator = z\n .object({\n ...IssueInboxCredentialValidator.shape,\n configuration: InboxBatchItemConfigurationValidator.optional(),\n idempotencyKey: z.string().max(256).optional(),\n })\n .refine(data => data.credential || data.templateUri, {\n message: 'Either credential or templateUri must be provided.',\n path: ['credential'],\n })\n .describe(\n 'One issuance: provide credential or templateUri. Invalid input is rejected at submission with its item index.'\n );\n\nexport const IssueInboxCredentialBatchValidator = z\n .object({\n requestId: z.string().min(1).max(256).optional(),\n items: z.array(IssueInboxCredentialBatchItemValidator).min(1).max(100),\n configuration: InboxBatchConfigurationValidator.optional(),\n })\n .superRefine((batch, ctx) => {\n batch.items.forEach((item, index) => {\n const itemGuardian = item.configuration?.guardianEmail;\n const guardian =\n itemGuardian === null\n ? undefined\n : (itemGuardian ?? batch.configuration?.guardianEmail);\n if (\n guardian &&\n item.recipient.type === 'email' &&\n guardian.toLowerCase() === item.recipient.value.toLowerCase()\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['items', index, 'configuration', 'guardianEmail'],\n message: 'guardianEmail must differ from recipient (self-approval not allowed)',\n });\n }\n });\n });\nexport type IssueInboxCredentialBatch = z.infer<typeof IssueInboxCredentialBatchValidator>;\n\nexport const InboxBatchErrorReasonValidator = z.enum([\n 'DUPLICATE_KEY',\n 'IDEMPOTENCY_MISMATCH',\n 'IN_PROGRESS',\n 'UNCONFIRMED',\n]);\nexport type InboxBatchErrorReason = z.infer<typeof InboxBatchErrorReasonValidator>;\n\nexport const IssueInboxCredentialBatchItemResultValidator = z.discriminatedUnion('success', [\n IssueInboxCredentialResponseValidator.extend({\n success: z.literal(true),\n index: z.number().int().nonnegative(),\n deduplicated: z.boolean().optional(),\n guardianStatus: GuardianStatusValidator.optional(),\n idempotencyKey: z.string().optional(),\n }),\n z.object({\n success: z.literal(false),\n index: z.number().int().nonnegative(),\n idempotencyKey: z.string().optional(),\n recipient: ContactMethodQueryValidator.optional(),\n error: z.object({\n code: z.string(),\n message: z.string(),\n reason: InboxBatchErrorReasonValidator.optional(),\n }),\n issuanceId: z\n .string()\n .optional()\n .describe(\n 'Present when issuance completed but replay storage could not be confirmed. Reconcile this issuance; do not issue again with a new key.'\n ),\n claimUrl: z\n .string()\n .url()\n .optional()\n .describe(\n 'Claim URL of the completed issuance, if available, when replay storage could not be confirmed.'\n ),\n }),\n]);\nexport type IssueInboxCredentialBatchItemResult = z.infer<\n typeof IssueInboxCredentialBatchItemResultValidator\n>;\n\nexport const IssueInboxCredentialBatchResponseValidator = z.object({\n results: z.array(IssueInboxCredentialBatchItemResultValidator),\n summary: z.object({\n total: z.number(),\n succeeded: z.number(),\n failed: z.number(),\n deduplicated: z.number(),\n }),\n});\nexport type IssueInboxCredentialBatchResponse = z.infer<\n typeof IssueInboxCredentialBatchResponseValidator\n>;\n\n/** Submission acknowledges durable storage, not completed credential delivery. */\nexport const InboxBatchReceiptValidator = z.object({\n batchId: z.string(),\n status: z.enum(['QUEUED', 'PROCESSING', 'COMPLETED', 'NEEDS_RECONCILIATION']),\n createdAt: z.string(),\n});\nexport type InboxBatchReceipt = z.infer<typeof InboxBatchReceiptValidator>;\n\nexport const InboxBatchStatusValidator = z.object({\n batchId: z.string(),\n createdAt: z.string(),\n done: z\n .boolean()\n .describe(\n 'True when no queued or processing items remain, including unconfirmed outcomes.'\n ),\n status: z.enum(['QUEUED', 'PROCESSING', 'COMPLETED', 'NEEDS_RECONCILIATION']),\n items: z.array(\n z.object({\n index: z.number().int().nonnegative(),\n state: z.enum(['QUEUED', 'PROCESSING', 'COMPLETED', 'NEEDS_RECONCILIATION']),\n result: IssueInboxCredentialBatchItemResultValidator.optional(),\n })\n ),\n summary: IssueInboxCredentialBatchResponseValidator.shape.summary.extend({\n completed: z.number(),\n pending: z.number(),\n unconfirmed: z.number(),\n }),\n});\nexport type InboxBatchStatus = z.infer<typeof InboxBatchStatusValidator>;\n\nexport type IssueInboxCredentialResponseType = z.infer<\n typeof IssueInboxCredentialResponseValidator\n>;\n\n/** A simple name reference that the server resolves to a boost template */\nexport const CredentialNameRefValidator = z.object({ name: z.string() }).passthrough();\n\nexport const ClaimInboxCredentialValidator = z.object({\n credential: VCValidator.or(VPValidator)\n .or(UnsignedVCValidator)\n .or(CredentialNameRefValidator)\n .describe('The credential to issue, or a { name } reference to resolve a boost template.'),\n configuration: z\n .object({\n publishableKey: z.string(),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n 'Inbox claim window in days. Defaults to 720; use a shorter window for sensitive records.'\n ),\n signingAuthorityName: z.string().optional(),\n listingId: z.string().optional(),\n listingSlug: z.string().optional(),\n })\n .optional(),\n});\n\nexport type ClaimInboxCredentialType = z.infer<typeof ClaimInboxCredentialValidator>;\n\n// Integrations\nexport const LCNDomainOrOriginValidator = z.union([\n z\n .string()\n .regex(\n /^(?:(?:[a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,63}|localhost|\\d{1,3}(?:\\.\\d{1,3}){3})(?::\\d{1,5})?$/,\n {\n message:\n 'Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port',\n }\n ),\n z\n .string()\n .regex(\n /^https?:\\/\\/(?:(?:[a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,63}|localhost|\\d{1,3}(?:\\.\\d{1,3}){3})(?::\\d{1,5})?$/,\n { message: 'Must be a valid http(s) origin' }\n ),\n]);\n\nexport const LCNIntegrationStatusEnum = z.enum(['setup', 'active', 'paused']);\nexport type LCNIntegrationStatus = z.infer<typeof LCNIntegrationStatusEnum>;\n\nexport const LCNIntegrationValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n publishableKey: z.string(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([]),\n\n // Setup/onboarding status\n status: LCNIntegrationStatusEnum.default('setup'),\n guideType: z.string().optional(),\n guideState: z.record(z.string(), z.any()).optional(),\n\n // Timestamps\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type LCNIntegration = z.infer<typeof LCNIntegrationValidator>;\n\nexport const LCNIntegrationCreateValidator = z.object({\n name: z.string(),\n description: z.string().optional(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([]),\n guideType: z.string().optional(),\n});\n\nexport type LCNIntegrationCreateType = z.infer<typeof LCNIntegrationCreateValidator>;\n\nexport const LCNIntegrationUpdateValidator = z.object({\n name: z.string().optional(),\n description: z.string().optional(),\n whitelistedDomains: z.array(LCNDomainOrOriginValidator).optional(),\n rotatePublishableKey: z.boolean().optional(),\n\n // Setup/onboarding updates\n status: LCNIntegrationStatusEnum.optional(),\n guideType: z.string().optional(),\n guideState: z.record(z.string(), z.any()).optional(),\n});\n\nexport type LCNIntegrationUpdateType = z.infer<typeof LCNIntegrationUpdateValidator>;\n\nexport const LCNIntegrationQueryValidator = z\n .object({\n id: StringQuery,\n name: StringQuery,\n description: StringQuery,\n status: StringQuery,\n guideType: StringQuery,\n })\n .partial();\n\nexport type LCNIntegrationQueryType = z.infer<typeof LCNIntegrationQueryValidator>;\n\nexport const PaginatedLCNIntegrationsValidator = PaginationResponseValidator.extend({\n records: LCNIntegrationValidator.array(),\n});\n\nexport type PaginatedLCNIntegrationsType = z.infer<typeof PaginatedLCNIntegrationsValidator>;\n\nexport const ClaimTokenValidator = z.object({\n token: z.string(),\n contactMethodId: z.string(),\n autoVerifyContactMethod: z.boolean().optional().default(false),\n createdAt: z.string(),\n expiresAt: z.string(),\n used: z.boolean(),\n});\n\nexport type ClaimTokenType = z.infer<typeof ClaimTokenValidator>;\n\nexport const TagValidator = z.object({\n id: z.string(),\n name: z.string().min(1),\n slug: z.string().min(1),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type TagType = z.infer<typeof TagValidator>;\n\nexport const SkillStatusEnum = z.enum(['active', 'archived']);\nexport type SkillStatus = z.infer<typeof SkillStatusEnum>;\n\nexport const SkillValidator = z.object({\n id: z.string(),\n statement: z.string(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().default('skill'),\n status: SkillStatusEnum.default('active'),\n frameworkId: z.string().optional(),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type SkillType = z.infer<typeof SkillValidator>;\n\nconst BaseSkillQueryValidator = z\n .object({\n id: StringQuery,\n statement: StringQuery,\n description: StringQuery,\n code: StringQuery,\n type: StringQuery,\n status: SkillStatusEnum.or(z.object({ $in: SkillStatusEnum.array() })),\n })\n .partial();\n\nexport const SkillQueryValidator = z.union([\n z.object({\n $or: BaseSkillQueryValidator.array(),\n }),\n BaseSkillQueryValidator,\n]);\n\nexport type SkillQuery = z.infer<typeof SkillQueryValidator>;\n\nexport const SkillSemanticSearchInputValidator = z.object({\n text: z.string().min(1),\n frameworkId: z.string().optional(),\n limit: z.number().int().min(1).max(200).default(50),\n});\n\nexport type SkillSemanticSearchInput = z.infer<typeof SkillSemanticSearchInputValidator>;\n\nexport const SkillSemanticSearchResultItemValidator = SkillValidator.extend({\n score: z.number(),\n});\n\nexport type SkillSemanticSearchResultItem = z.infer<typeof SkillSemanticSearchResultItemValidator>;\n\nexport const SkillSemanticSearchResultValidator = z.object({\n records: SkillSemanticSearchResultItemValidator.array(),\n});\n\nexport type SkillSemanticSearchResult = z.infer<typeof SkillSemanticSearchResultValidator>;\n\nexport const SkillFrameworkStatusEnum = z.enum(['active', 'archived']);\nexport type SkillFrameworkStatus = z.infer<typeof SkillFrameworkStatusEnum>;\n\nexport const SkillFrameworkValidator = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().default(false),\n status: SkillFrameworkStatusEnum.default('active'),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n});\n\nexport type SkillFrameworkType = z.infer<typeof SkillFrameworkValidator>;\n\nexport const PaginatedSkillFrameworksValidator = PaginationResponseValidator.extend({\n records: SkillFrameworkValidator.array(),\n});\nexport type PaginatedSkillFrameworksType = z.infer<typeof PaginatedSkillFrameworksValidator>;\n\nexport type SkillTreeNode = SkillType & {\n children: SkillTreeNode[];\n hasChildren: boolean;\n childrenCursor?: string | null;\n};\n\nexport const SkillTreeNodeValidator: z.ZodType<SkillTreeNode> = SkillValidator.extend({\n children: z.array(z.lazy(() => SkillTreeNodeValidator)),\n hasChildren: z.boolean(),\n childrenCursor: z.string().nullable().optional(),\n});\n\nexport const PaginatedSkillTreeValidator = z.object({\n hasMore: z.boolean(),\n cursor: z.string().nullable(),\n records: z.array(SkillTreeNodeValidator),\n});\n\nexport type PaginatedSkillTree = z.infer<typeof PaginatedSkillTreeValidator>;\n\nexport interface SkillTreeInput {\n id?: string;\n statement: string;\n description?: string;\n code?: string;\n icon?: string;\n type?: string;\n status?: 'active' | 'archived';\n children?: SkillTreeInput[];\n}\n\nexport const SkillTreeNodeInputValidator: z.ZodType<SkillTreeInput> = z.lazy(() =>\n z.object({\n id: z.string().optional(),\n statement: z.string(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().optional(),\n status: SkillStatusEnum.optional(),\n children: z.array(SkillTreeNodeInputValidator).optional(),\n })\n);\n\nexport const LinkProviderFrameworkInputValidator = z.object({\n frameworkId: z.string(),\n});\n\nexport type LinkProviderFrameworkInputType = z.infer<typeof LinkProviderFrameworkInputValidator>;\n\nexport const CreateManagedFrameworkInputValidator = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().optional(),\n status: SkillFrameworkStatusEnum.optional(),\n skills: z.array(SkillTreeNodeInputValidator).optional(),\n boostUris: z.array(z.string()).optional(),\n});\n\nexport type CreateManagedFrameworkInputType = z.infer<typeof CreateManagedFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type CreateManagedSkillFrameworkInput = CreateManagedFrameworkInputType;\n\nexport const UpdateFrameworkInputValidator = z\n .object({\n id: z.string(),\n name: z.string().min(1).optional(),\n description: z.string().optional(),\n image: z.string().optional(),\n sourceURI: z.string().url().optional(),\n isPublic: z.boolean().optional(),\n status: SkillFrameworkStatusEnum.optional(),\n })\n .refine(\n data =>\n data.name !== undefined ||\n data.description !== undefined ||\n data.image !== undefined ||\n data.sourceURI !== undefined ||\n data.isPublic !== undefined ||\n data.status !== undefined,\n {\n message: 'At least one field must be provided to update',\n path: ['name'],\n }\n );\n\nexport type UpdateFrameworkInputType = z.infer<typeof UpdateFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type UpdateSkillFrameworkInput = UpdateFrameworkInputType;\n\nexport const DeleteFrameworkInputValidator = z.object({ id: z.string() });\n\nexport type DeleteFrameworkInputType = z.infer<typeof DeleteFrameworkInputValidator>;\n\n// Back-compat alias for plugin naming\nexport type DeleteSkillFrameworkInput = DeleteFrameworkInputType;\n\nexport const CreateManagedFrameworkBatchInputValidator = z.object({\n frameworks: z\n .array(\n CreateManagedFrameworkInputValidator.extend({\n skills: z.array(SkillTreeNodeInputValidator).optional(),\n })\n )\n .min(1),\n});\n\nexport type CreateManagedFrameworkBatchInputType = z.infer<\n typeof CreateManagedFrameworkBatchInputValidator\n>;\n\n// Back-compat alias for plugin naming\nexport type CreateManagedSkillFrameworkBatchInput = CreateManagedFrameworkBatchInputType;\n\nexport const SkillFrameworkAdminInputValidator = z.object({\n frameworkId: z.string(),\n profileId: z.string(),\n});\n\nexport type SkillFrameworkAdminInputType = z.infer<typeof SkillFrameworkAdminInputValidator>;\n\nexport const SkillFrameworkIdInputValidator = z.object({ frameworkId: z.string() });\n\nexport type SkillFrameworkIdInputType = z.infer<typeof SkillFrameworkIdInputValidator>;\n\nexport const SkillFrameworkAdminsValidator = LCNProfileValidator.array();\n\nexport type SkillFrameworkAdminsType = z.infer<typeof SkillFrameworkAdminsValidator>;\n\nexport const SyncFrameworkInputValidator = z.object({ id: z.string() });\n\nexport type SyncFrameworkInput = z.infer<typeof SyncFrameworkInputValidator>;\n\nexport const AddTagInputValidator = z.object({\n slug: z.string().min(1),\n name: z.string().min(1),\n});\n\nexport type AddTagInput = z.infer<typeof AddTagInputValidator>;\n\nexport const CreateSkillInputValidator = z.object({\n frameworkId: z.string(),\n skill: SkillTreeNodeInputValidator,\n parentId: z.string().nullable().optional(),\n});\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputValidator>;\n\nexport const UpdateSkillInputValidator = z\n .object({\n frameworkId: z.string(),\n id: z.string(),\n statement: z.string().optional(),\n description: z.string().optional(),\n code: z.string().optional(),\n icon: z.string().optional(),\n type: z.string().optional(),\n status: SkillStatusEnum.optional(),\n })\n .refine(\n data =>\n data.statement !== undefined ||\n data.description !== undefined ||\n data.code !== undefined ||\n data.icon !== undefined ||\n data.type !== undefined ||\n data.status !== undefined,\n {\n message: 'At least one field must be provided to update a skill',\n path: ['statement'],\n }\n );\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputValidator>;\n\nexport const SkillDeletionStrategyValidator = z.enum(['recursive', 'reparent']);\nexport type SkillDeletionStrategy = z.infer<typeof SkillDeletionStrategyValidator>;\n\nexport const DeleteSkillInputValidator = z.object({\n frameworkId: z.string(),\n id: z.string(),\n strategy: SkillDeletionStrategyValidator.optional().default('reparent'),\n});\n\nexport type DeleteSkillInput = z.infer<typeof DeleteSkillInputValidator>;\n\nexport const CreateSkillsBatchInputValidator = z.object({\n frameworkId: z.string(),\n skills: z.array(SkillTreeNodeInputValidator).min(1),\n parentId: z.string().nullable().optional(),\n});\n\nexport type CreateSkillsBatchInput = z.infer<typeof CreateSkillsBatchInputValidator>;\n\nexport const ReplaceSkillFrameworkSkillsInputValidator = z.object({\n frameworkId: z.string(),\n skills: z.array(SkillTreeNodeInputValidator).min(0),\n});\n\nexport type ReplaceSkillFrameworkSkillsInput = z.infer<\n typeof ReplaceSkillFrameworkSkillsInputValidator\n>;\n\nexport const ReplaceSkillFrameworkSkillsResultValidator = z.object({\n created: z.number().int().min(0),\n updated: z.number().int().min(0),\n deleted: z.number().int().min(0),\n unchanged: z.number().int().min(0),\n total: z.number().int().min(0),\n});\n\nexport type ReplaceSkillFrameworkSkillsResult = z.infer<\n typeof ReplaceSkillFrameworkSkillsResultValidator\n>;\n\nexport const CountSkillsInputValidator = z.object({\n frameworkId: z.string(),\n skillId: z.string().optional(),\n recursive: z.boolean().optional().default(false),\n onlyCountCompetencies: z.boolean().optional().default(false),\n});\n\nexport type CountSkillsInput = z.infer<typeof CountSkillsInputValidator>;\n\nexport const CountSkillsResultValidator = z.object({\n count: z.number().int().min(0),\n});\n\nexport type CountSkillsResult = z.infer<typeof CountSkillsResultValidator>;\n\nexport const GetFullSkillTreeInputValidator = z.object({\n frameworkId: z.string(),\n});\n\nexport type GetFullSkillTreeInput = z.infer<typeof GetFullSkillTreeInputValidator>;\n\nexport const GetFullSkillTreeResultValidator = z.object({\n skills: z.array(SkillTreeNodeValidator),\n});\n\nexport type GetFullSkillTreeResult = z.infer<typeof GetFullSkillTreeResultValidator>;\n\nexport const GetSkillPathInputValidator = z.object({\n frameworkId: z.string(),\n skillId: z.string(),\n});\n\nexport type GetSkillPathInput = z.infer<typeof GetSkillPathInputValidator>;\n\nexport const GetSkillPathResultValidator = z.object({\n path: z.array(SkillValidator),\n});\n\nexport type GetSkillPathResult = z.infer<typeof GetSkillPathResultValidator>;\n\n// Composite return shapes\nexport const FrameworkWithSkillsValidator = z.object({\n framework: SkillFrameworkValidator,\n skills: PaginatedSkillTreeValidator,\n});\n\nexport type FrameworkWithSkills = z.infer<typeof FrameworkWithSkillsValidator>;\n\n// Aliases used by the plugin type definitions\nexport type CreateSkillTreeInput = SkillTreeInput;\n\n// App Store Listing\nexport const AppListingStatusValidator = z.enum(['DRAFT', 'PENDING_REVIEW', 'LISTED', 'ARCHIVED']);\nexport type AppListingStatus = z.infer<typeof AppListingStatusValidator>;\n\nexport const LaunchTypeValidator = z.enum([\n 'EMBEDDED_IFRAME',\n 'SECOND_SCREEN',\n 'DIRECT_LINK',\n 'CONSENT_REDIRECT',\n 'SERVER_HEADLESS',\n 'AI_TUTOR',\n]);\nexport type LaunchType = z.infer<typeof LaunchTypeValidator>;\n\nexport const PromotionLevelValidator = z.enum([\n 'FEATURED_CAROUSEL',\n 'CURATED_LIST',\n 'STANDARD',\n 'DEMOTED',\n]);\nexport type PromotionLevel = z.infer<typeof PromotionLevelValidator>;\n\nexport const AgeRatingValidator = z.enum(['4+', '9+', '12+', '17+']);\nexport type AgeRating = z.infer<typeof AgeRatingValidator>;\n\nexport const AppStoreListingSubmitterValidator = z.object({\n profileId: z.string(),\n displayName: z.string(),\n email: z.string().optional(),\n});\n\nexport type AppStoreListingSubmitter = z.infer<typeof AppStoreListingSubmitterValidator>;\n\nexport const AppStoreListingValidator = z.object({\n listing_id: z.string(),\n slug: z.string().optional(),\n display_name: z.string(),\n tagline: z.string(),\n full_description: z.string(),\n icon_url: z.string(),\n app_listing_status: AppListingStatusValidator,\n launch_type: LaunchTypeValidator,\n launch_config_json: z.string(),\n category: z.string().optional(),\n promo_video_url: z.string().optional(),\n promotion_level: PromotionLevelValidator.optional(),\n ios_app_store_id: z.string().optional(),\n android_app_store_id: z.string().optional(),\n privacy_policy_url: z.string().optional(),\n terms_url: z.string().optional(),\n highlights: z.array(z.string()).optional(),\n screenshots: z.array(z.string()).optional(),\n hero_background_color: z.string().optional(),\n min_age: z.number().int().min(0).max(18).optional(),\n age_rating: AgeRatingValidator.optional(),\n submitted_at: z.string().optional(),\n submitter: AppStoreListingSubmitterValidator.optional(),\n contact_email: z.string().email().optional(),\n});\n\nexport type AppStoreListing = z.infer<typeof AppStoreListingValidator>;\n\nexport const AppStoreListingCreateValidator = AppStoreListingValidator.omit({\n listing_id: true,\n app_listing_status: true,\n promotion_level: true,\n});\n\nexport type AppStoreListingCreateType = z.infer<typeof AppStoreListingCreateValidator>;\n\nexport const AppStoreListingUpdateValidator = AppStoreListingValidator.partial().omit({\n listing_id: true,\n app_listing_status: true,\n promotion_level: true,\n});\n\nexport type AppStoreListingUpdateType = z.infer<typeof AppStoreListingUpdateValidator>;\n\nexport const InstalledAppValidator = AppStoreListingValidator.extend({\n installed_at: z.string(),\n});\n\nexport type InstalledApp = z.infer<typeof InstalledAppValidator>;\n\nexport const PaginatedAppStoreListingsValidator = PaginationResponseValidator.extend({\n records: AppStoreListingValidator.array(),\n});\n\nexport type PaginatedAppStoreListings = z.infer<typeof PaginatedAppStoreListingsValidator>;\n\nexport const PaginatedInstalledAppsValidator = PaginationResponseValidator.extend({\n records: InstalledAppValidator.array(),\n});\n\nexport type PaginatedInstalledApps = z.infer<typeof PaginatedInstalledAppsValidator>;\n\n// App Store Boost Association\nexport const AppBoostValidator = z.object({\n templateAlias: z\n .string()\n .min(1)\n .max(50)\n .regex(/^[a-z0-9-]+$/),\n boostUri: z.string(),\n});\n\nexport type AppBoost = z.infer<typeof AppBoostValidator>;\n\n// App Event Types (discriminated union for type safety)\nexport const SendCredentialEventValidator = z.object({\n type: z.literal('send-credential'),\n templateAlias: z.string(),\n templateData: z.record(z.string(), z.unknown()).optional(),\n preventDuplicateClaim: z.boolean().optional(),\n});\n\nexport type SendCredentialEvent = z.infer<typeof SendCredentialEventValidator>;\n\nexport const CheckCredentialEventValidator = z\n .object({\n type: z.literal('check-credential'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type CheckCredentialEvent = z.infer<typeof CheckCredentialEventValidator>;\n\nexport const CheckIssuanceStatusEventValidator = z\n .object({\n type: z.literal('check-issuance-status'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n recipient: z.string(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type CheckIssuanceStatusEvent = z.infer<typeof CheckIssuanceStatusEventValidator>;\n\nexport const GetTemplateRecipientsEventValidator = z\n .object({\n type: z.literal('get-template-recipients'),\n templateAlias: z.string().optional(),\n boostUri: z.string().optional(),\n limit: z.number().optional(),\n cursor: z.string().optional(),\n })\n .refine(input => Boolean(input.templateAlias) !== Boolean(input.boostUri), {\n message: 'Exactly one of templateAlias or boostUri is required',\n });\n\nexport type GetTemplateRecipientsEvent = z.infer<typeof GetTemplateRecipientsEventValidator>;\n\n// Request learner context event for AI tutoring systems\nexport const RequestLearnerContextEventValidator = z.object({\n type: z.literal('request-learner-context'),\n includeCredentials: z.boolean().optional().default(true),\n includePersonalData: z.boolean().optional().default(false),\n format: z.enum(['prompt', 'structured']).optional().default('prompt'),\n instructions: z.string().optional(),\n detailLevel: z.enum(['compact', 'expanded']).optional().default('compact'),\n waitForSync: z.boolean().optional().default(false),\n});\n\nexport type RequestLearnerContextEvent = z.infer<typeof RequestLearnerContextEventValidator>;\n\nexport const SummaryCredentialKeywordValidator = z.object({\n occupations: z.array(z.string()).nullable(),\n careers: z.array(z.string()).nullable(),\n jobs: z.array(z.string()).nullable(),\n skills: z.array(z.string()).nullable(),\n fieldOfStudy: z.string().nullable(),\n});\n\nexport type SummaryCredentialKeyword = z.infer<typeof SummaryCredentialKeywordValidator>;\n\nexport const SummaryCredentialDataValidator = z.object({\n title: z.string().describe('Short, concise title for the learning session or credential'),\n summary: z.string().describe('Comprehensive summary of what happened during the session'),\n learned: z.array(z.string()).describe('Bullet points of key knowledge gained'),\n skills: z\n .array(\n z.object({\n title: z.string().describe('Name of the skill category'),\n description: z\n .string()\n .describe('Detailed description of what this skill category involves'),\n })\n )\n .describe('Categorized skills learned during the session'),\n nextSteps: z\n .array(\n z.object({\n title: z.string().describe('Title of the suggested next step'),\n description: z\n .string()\n .describe('Description explaining why this next step is recommended'),\n keywords: SummaryCredentialKeywordValidator.optional().describe(\n 'Optional taxonomy keywords for occupations/careers/jobs/skills/fieldOfStudy. Omit if not relevant.'\n ),\n })\n )\n .describe('Recommended follow-up activities or learning modules'),\n reflections: z\n .array(\n z.object({\n title: z.string().describe('Title of the reflection'),\n description: z\n .string()\n .describe('Detailed description of what this reflection involves'),\n })\n )\n .describe('Reflections on the learning experience'),\n});\n\nexport type SummaryCredentialData = z.infer<typeof SummaryCredentialDataValidator>;\n\n// AI Session credential event for creating AI tutoring sessions\nexport const SendAiSessionCredentialEventValidator = z.object({\n type: z.literal('send-ai-session-credential'),\n sessionTitle: z.string(),\n summaryData: SummaryCredentialDataValidator,\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type SendAiSessionCredentialEvent = z.infer<typeof SendAiSessionCredentialEventValidator>;\n\nexport const SendNotificationEventValidator = z.object({\n type: z.literal('send-notification'),\n title: z.string().optional(),\n body: z.string().optional(),\n actionPath: z.string().optional(),\n category: z.string().optional(),\n priority: z.enum(['normal', 'high']).optional(),\n});\n\nexport type SendNotificationEvent = z.infer<typeof SendNotificationEventValidator>;\n\nconst counterKeyValidator = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'Key must be alphanumeric with _ or -');\n\nexport const IncrementCounterEventValidator = z.object({\n type: z.literal('increment-counter'),\n key: counterKeyValidator,\n amount: z.number().int().finite(),\n});\n\nexport type IncrementCounterEvent = z.infer<typeof IncrementCounterEventValidator>;\n\nexport const GetCounterEventValidator = z.object({\n type: z.literal('get-counter'),\n key: counterKeyValidator,\n});\n\nexport type GetCounterEvent = z.infer<typeof GetCounterEventValidator>;\n\nexport const GetCountersEventValidator = z.object({\n type: z.literal('get-counters'),\n keys: z.array(counterKeyValidator).min(1).max(50).optional(),\n});\n\nexport type GetCountersEvent = z.infer<typeof GetCountersEventValidator>;\n\n// Add new event types here as the union grows\nexport const AppEventValidator = z.discriminatedUnion('type', [\n SendCredentialEventValidator,\n CheckCredentialEventValidator,\n CheckIssuanceStatusEventValidator,\n GetTemplateRecipientsEventValidator,\n RequestLearnerContextEventValidator,\n SendAiSessionCredentialEventValidator,\n SendNotificationEventValidator,\n IncrementCounterEventValidator,\n GetCounterEventValidator,\n GetCountersEventValidator,\n]);\n\nexport type AppEvent = z.infer<typeof AppEventValidator>;\n\n// Full input including listingId (used by brain service)\nexport const AppEventInputValidator = z.object({\n listingId: z.string(),\n event: AppEventValidator,\n});\n\nexport type AppEventInput = z.infer<typeof AppEventInputValidator>;\n\n// Response is generic since different events may return different data\nexport const AppEventResponseValidator = z.record(z.string(), z.unknown());\n\nexport type AppEventResponse = z.infer<typeof AppEventResponseValidator>;\n// Credential Activity\nexport const CredentialActivityEventTypeValidator = z.enum([\n 'CREATED',\n 'DELIVERED',\n 'CLAIMED',\n 'EXPIRED',\n 'FAILED',\n]);\nexport type CredentialActivityEventType = z.infer<typeof CredentialActivityEventTypeValidator>;\n\nexport const CredentialActivityRecipientTypeValidator = z.enum(['profile', 'email', 'phone']);\nexport type CredentialActivityRecipientType = z.infer<\n typeof CredentialActivityRecipientTypeValidator\n>;\n\nexport const CredentialActivitySourceTypeValidator = z.enum([\n 'send',\n 'sendBoost',\n 'sendCredential',\n 'contract',\n 'claim',\n 'inbox',\n 'claimLink',\n 'acceptCredential',\n 'appEvent',\n]);\nexport type CredentialActivitySourceType = z.infer<typeof CredentialActivitySourceTypeValidator>;\n\nexport const CredentialActivityValidator = z.object({\n id: z.string(),\n activityId: z.string(),\n eventType: CredentialActivityEventTypeValidator,\n timestamp: z.string(),\n actorProfileId: z.string().optional(),\n onBehalfOf: z.string().optional(),\n recipientType: CredentialActivityRecipientTypeValidator,\n recipientIdentifier: z.string(),\n boostUri: z.string().optional(),\n credentialUri: z.string().optional(),\n inboxCredentialId: z.string().optional(),\n integrationId: z.string().optional(),\n source: CredentialActivitySourceTypeValidator,\n metadata: z.record(z.string(), z.unknown()).optional(),\n status: z.enum(['active', 'revoked', 'suspended']).optional(),\n});\nexport type CredentialActivityRecord = z.infer<typeof CredentialActivityValidator>;\n\nexport const CredentialActivityWithDetailsValidator = CredentialActivityValidator.extend({\n boost: z\n .object({\n id: z.string(),\n name: z.string().optional(),\n category: z.string().optional(),\n })\n .optional(),\n recipientProfile: z\n .object({\n profileId: z.string(),\n displayName: z.string().optional(),\n })\n .optional(),\n});\nexport type CredentialActivityWithDetails = z.infer<typeof CredentialActivityWithDetailsValidator>;\n\nexport const PaginatedCredentialActivitiesValidator = PaginationResponseValidator.extend({\n records: CredentialActivityWithDetailsValidator.array(),\n});\nexport type PaginatedCredentialActivities = z.infer<typeof PaginatedCredentialActivitiesValidator>;\n\nexport const CredentialActivityStatsValidator = z.object({\n total: z.number(),\n created: z.number(),\n delivered: z.number(),\n claimed: z.number(),\n expired: z.number(),\n failed: z.number(),\n claimRate: z.number(),\n});\nexport type CredentialActivityStats = z.infer<typeof CredentialActivityStatsValidator>;\n", "import { z } from 'zod/v4';\n\n// Helper to extract flags and pattern from regex string\nconst parseRegexString = (regexStr: string) => {\n const match = regexStr.match(/^\\/(.*)\\/([gimsuy]*)$/);\n if (!match) throw new Error('Invalid RegExp string format');\n return { pattern: match[1], flags: match[2] };\n};\n\n// TRPC validator that converts Regex strings into RegExps\nconst RegExpStringValidator = z\n .string()\n .refine(\n str => {\n try {\n parseRegexString(str);\n return true;\n } catch {\n return false;\n }\n },\n {\n message: \"Invalid RegExp string format. Must be in format '/pattern/flags'\",\n }\n )\n .transform(str => {\n const { pattern, flags } = parseRegexString(str);\n\n try {\n return new RegExp(pattern, flags);\n } catch (error) {\n throw new Error(`Invalid RegExp: ${(error as Error).message}`);\n }\n })\n .meta({ override: { type: 'string' } });\n\n// Do not use z.instanceof(RegExp) here: it is a `custom` Zod type that crashes\n// zod-openapi document generation at service boot, and `.meta({ override })` is\n// not honored for custom types. Coercing a RegExp to its `/source/flags` string\n// keeps the OpenAPI schema a plain string while still accepting RegExp inputs.\nexport const RegExpValidator = z.preprocess(\n value => (value instanceof RegExp ? `/${value.source}/${value.flags}` : value),\n RegExpStringValidator\n);\n\nconst BaseStringQuery = z\n .string()\n .or(z.object({ $in: z.string().array() }))\n .or(z.object({ $regex: RegExpValidator }));\n\nexport const StringQuery = z.union([\n BaseStringQuery,\n z.object({\n $or: BaseStringQuery.array(),\n }),\n]);\n", "import { z } from 'zod/v4';\n\nimport { CredentialStatusValidator, UnsignedVCValidator, VCValidator } from './vc';\nimport { JWEValidator } from './crypto';\n\n/**\n * Shared contracts for managed credential refresh (LC-2117, LC-2135, LC-2136).\n *\n * The generic `RefreshServiceValidator` in vc.ts intentionally remains permissive so\n * unknown third-party refresh services keep parsing. These validators model the\n * LearnCard-managed `LearnCardCredentialRefresh2026` service, its allocation/publication\n * lifecycle, the holder-facing response envelopes, and safe refresh outcomes.\n */\n\n/** LearnCard DID-auth extension descriptor for a managed refresh service */\nexport const LearnCardRefreshAuthorizationValidator = z\n .object({ type: z.literal('LearnCardDIDAuth') })\n .catchall(z.any());\nexport type LearnCardRefreshAuthorization = z.infer<typeof LearnCardRefreshAuthorizationValidator>;\n\n/**\n * Managed refresh service descriptor.\n *\n * Requires a resolvable `id` and the versioned LearnCard type, and optionally carries a\n * LearnCard authorization descriptor. This is distinct from the 1EdTech protocol.\n */\nexport const ManagedCredentialRefreshServiceValidator = z\n .object({\n id: z.string().min(1),\n type: z.literal('LearnCardCredentialRefresh2026'),\n authorization: LearnCardRefreshAuthorizationValidator.optional(),\n })\n .catchall(z.any());\nexport type ManagedCredentialRefreshService = z.infer<\n typeof ManagedCredentialRefreshServiceValidator\n>;\n\n/** Standard 1EdTech protocol: HTTPS GET returning a signed VC or VC-JWT. */\nexport const StandardCredentialRefreshServiceValidator = z\n .object({\n id: z.string().min(1),\n type: z.literal('1EdTechCredentialRefresh'),\n })\n .catchall(z.any());\nexport const SupportedCredentialRefreshServiceValidator = z.union([\n ManagedCredentialRefreshServiceValidator,\n StandardCredentialRefreshServiceValidator,\n]);\nexport type SupportedCredentialRefreshService = z.infer<\n typeof SupportedCredentialRefreshServiceValidator\n>;\n\n// --- Allocation (before signing) -------------------------------------------\n\nexport const AllocateCredentialRefreshInputValidator = z.object({\n holder: z.object({\n profileId: z.string().optional(),\n did: z.string().min(1),\n }),\n credentialId: z.string().min(1),\n});\nexport type AllocateCredentialRefreshInput = z.infer<\n typeof AllocateCredentialRefreshInputValidator\n>;\n\nexport const AllocateCredentialRefreshResultValidator = z.object({\n refreshId: z.string().min(1),\n refreshService: ManagedCredentialRefreshServiceValidator.extend({\n authorization: LearnCardRefreshAuthorizationValidator,\n }),\n});\nexport type AllocateCredentialRefreshResult = z.infer<\n typeof AllocateCredentialRefreshResultValidator\n>;\n\n// --- Managed issuance receipt (returned to the issuer after a refreshable send) ---\n\n/**\n * Issuance metadata returned to the authenticated issuer after a refreshable send\n * (unified send with `refresh: true`, or `sendBoost` with `enableRefresh: true`).\n *\n * Populated from the actual signed version 1 credential \u2014 never from the template or\n * allocation alone. This is issuance metadata only: it must not contain credential\n * claims, subject bodies, plaintext VCs, or JWEs. The issuer retains its own\n * template/claims alongside this receipt, and preserves the exact `credentialStatus`\n * descriptor when publishing an update (no new allocation).\n */\nexport const ManagedCredentialRefreshReceiptValidator = z\n .object({\n refreshId: z.string().min(1),\n refreshService: ManagedCredentialRefreshServiceValidator,\n credentialId: z.string().min(1),\n issuerDid: z.string().min(1),\n holderDid: z.string().min(1),\n credentialStatus: CredentialStatusValidator.or(\n CredentialStatusValidator.array()\n ).optional(),\n })\n .strip();\nexport type ManagedCredentialRefreshReceipt = z.infer<\n typeof ManagedCredentialRefreshReceiptValidator\n>;\n\n/** Allocation metadata for deferred Inbox issuance. No holder is invented before claim. */\nexport const InboxCredentialRefreshReceiptValidator = ManagedCredentialRefreshReceiptValidator.omit(\n { holderDid: true }\n).extend({ holderDid: z.string().min(1).optional() });\nexport type InboxCredentialRefreshReceipt = z.infer<typeof InboxCredentialRefreshReceiptValidator>;\n\n// --- Publication ------------------------------------------------------------\n\nexport const CredentialRefreshSigningModeValidator = z.enum(['issuer-signed', 'signing-authority']);\nexport type CredentialRefreshSigningMode = z.infer<typeof CredentialRefreshSigningModeValidator>;\n\nconst PublishCredentialRefreshBaseFields = {\n refreshId: z.string().min(1),\n notifyHolder: z.boolean().optional(),\n updateSummary: z.string().optional(),\n idempotencyKey: z.string().optional(),\n};\n\n/** Issuer-signed mode: the caller supplies a fully signed updated VC */\nexport const PublishIssuerSignedRefreshValidator = z.object({\n ...PublishCredentialRefreshBaseFields,\n mode: z.literal('issuer-signed'),\n signedCredential: VCValidator,\n});\nexport type PublishIssuerSignedRefresh = z.infer<typeof PublishIssuerSignedRefreshValidator>;\n\n/** Signing-authority mode: the caller supplies updated unsigned claims and brain-service signs */\nexport const PublishSigningAuthorityRefreshValidator = z.object({\n ...PublishCredentialRefreshBaseFields,\n mode: z.literal('signing-authority'),\n credential: UnsignedVCValidator,\n signingAuthority: z\n .object({\n type: z.string().min(1),\n })\n .catchall(z.any()),\n});\nexport type PublishSigningAuthorityRefresh = z.infer<\n typeof PublishSigningAuthorityRefreshValidator\n>;\n\n/**\n * Top-level object form required by trpc-to-openapi.\n *\n * Keep the public TypeScript type discriminated even though the runtime object has\n * optional fields for both modes. The refinement preserves the same required-field\n * behavior as the former z.discriminatedUnion without crashing OpenAPI generation.\n */\nexport const PublishCredentialRefreshInputValidator = z\n .object({\n ...PublishCredentialRefreshBaseFields,\n mode: CredentialRefreshSigningModeValidator,\n signedCredential: VCValidator.optional(),\n credential: UnsignedVCValidator.optional(),\n signingAuthority: z\n .object({\n type: z.string().min(1),\n })\n .catchall(z.any())\n .optional(),\n })\n .superRefine((input, ctx) => {\n if (input.mode === 'issuer-signed' && !input.signedCredential) {\n ctx.addIssue({\n code: 'custom',\n path: ['signedCredential'],\n message: 'signedCredential is required for issuer-signed publication',\n });\n }\n\n if (\n input.mode === 'issuer-signed' &&\n (input.credential !== undefined || input.signingAuthority !== undefined)\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['mode'],\n message: 'issuer-signed publication cannot include signing-authority fields',\n });\n }\n\n if (input.mode === 'signing-authority') {\n if (input.signedCredential !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['signedCredential'],\n message: 'signing-authority publication cannot include signedCredential',\n });\n }\n\n if (!input.credential) {\n ctx.addIssue({\n code: 'custom',\n path: ['credential'],\n message: 'credential is required for signing-authority publication',\n });\n }\n\n if (!input.signingAuthority) {\n ctx.addIssue({\n code: 'custom',\n path: ['signingAuthority'],\n message: 'signingAuthority is required for signing-authority publication',\n });\n }\n }\n });\nexport type PublishCredentialRefreshInput =\n PublishIssuerSignedRefresh | PublishSigningAuthorityRefresh;\n\nexport const PublishCredentialRefreshNotificationValidator = z.enum([\n 'queued',\n 'suppressed',\n 'not-applicable',\n /** Publication succeeded, but the post-commit notification enqueue must be retried. */\n 'delivery-failed',\n]);\nexport type PublishCredentialRefreshNotification = z.infer<\n typeof PublishCredentialRefreshNotificationValidator\n>;\n\nexport const PublishCredentialRefreshResultValidator = z.object({\n refreshId: z.string().min(1),\n version: z.number().int().positive(),\n publishedAt: z.string().min(1),\n notification: PublishCredentialRefreshNotificationValidator,\n});\nexport type PublishCredentialRefreshResult = z.infer<\n typeof PublishCredentialRefreshResultValidator\n>;\n\n// --- Version history (metadata only, never credential bodies) ----------------\n\nexport const CredentialRefreshVersionMetadataValidator = z.object({\n version: z.number().int().positive(),\n publishedAt: z.string().min(1),\n effectiveAt: z.string().optional(),\n etag: z.string().optional(),\n signingMode: CredentialRefreshSigningModeValidator.optional(),\n updateSummary: z.string().optional(),\n});\nexport type CredentialRefreshVersionMetadata = z.infer<\n typeof CredentialRefreshVersionMetadataValidator\n>;\n\nexport const GetCredentialRefreshHistoryInputValidator = z.object({\n refreshId: z.string().min(1),\n cursor: z.string().optional(),\n limit: z.number().int().positive().optional(),\n});\nexport type GetCredentialRefreshHistoryInput = z.infer<\n typeof GetCredentialRefreshHistoryInputValidator\n>;\n\nexport const GetCredentialRefreshHistoryResultValidator = z.object({\n records: CredentialRefreshVersionMetadataValidator.array(),\n hasMore: z.boolean(),\n cursor: z.string().optional(),\n});\nexport type GetCredentialRefreshHistoryResult = z.infer<\n typeof GetCredentialRefreshHistoryResultValidator\n>;\n\n// --- Holder authentication challenge ------------------------------------------\n\n/**\n * Short-lived, single-use challenge returned by a managed refresh endpoint. Contains\n * no holder, issuer, credential, or lifecycle information.\n */\nexport const CredentialRefreshChallengeValidator = z.object({\n challenge: z.string().min(1),\n expiresAt: z.string().min(1),\n domain: z.string().optional(),\n scheme: z.literal('LearnCardDIDAuth').optional(),\n});\nexport type CredentialRefreshChallenge = z.infer<typeof CredentialRefreshChallengeValidator>;\n\n// --- Response envelopes --------------------------------------------------------\n\n/** Plain (interoperable) response: an unencrypted signed VC */\nexport const PublicCredentialRefreshEnvelopeValidator = z.object({\n format: z.literal('vc'),\n credential: VCValidator,\n etag: z.string().optional(),\n});\nexport type PublicCredentialRefreshEnvelope = z.infer<\n typeof PublicCredentialRefreshEnvelopeValidator\n>;\n\n/** Managed response: the credential encrypted to the holder as a JWE */\nexport const JweCredentialRefreshEnvelopeValidator = z.object({\n format: z.literal('jwe'),\n jwe: JWEValidator,\n etag: z.string().optional(),\n /** Present on LearnCard-managed endpoints; optional for interoperable JWE services. */\n version: z.number().int().positive().optional(),\n});\nexport type JweCredentialRefreshEnvelope = z.infer<typeof JweCredentialRefreshEnvelopeValidator>;\n\nexport const CredentialRefreshResponseEnvelopeValidator = z.discriminatedUnion('format', [\n PublicCredentialRefreshEnvelopeValidator,\n JweCredentialRefreshEnvelopeValidator,\n]);\nexport type CredentialRefreshResponseEnvelope = z.infer<\n typeof CredentialRefreshResponseEnvelopeValidator\n>;\n\n// --- Refresh outcomes ----------------------------------------------------------\n\n/**\n * Safe, machine-readable failure codes. Raw response bodies are never surfaced.\n */\nexport const CredentialRefreshFailureCodeValidator = z.enum([\n 'UNAVAILABLE',\n 'TIMEOUT',\n 'UNSUPPORTED_SERVICE',\n 'UNAUTHORIZED',\n 'MALFORMED_RESPONSE',\n 'INVALID_PROOF',\n 'ISSUER_MISMATCH',\n 'ID_MISMATCH',\n 'ROLLBACK',\n 'REVOKED',\n 'UNSAFE_ENDPOINT',\n]);\nexport type CredentialRefreshFailureCode = z.infer<typeof CredentialRefreshFailureCodeValidator>;\n\nexport const CredentialRefreshUpdatedResultValidator = z.object({\n status: z.literal('updated'),\n credential: VCValidator,\n etag: z.string().optional(),\n managedVersion: z.number().int().positive().optional(),\n});\nexport type CredentialRefreshUpdatedResult = z.infer<\n typeof CredentialRefreshUpdatedResultValidator\n>;\n\nexport const CredentialRefreshUnchangedResultValidator = z.object({\n status: z.literal('unchanged'),\n checkedAt: z.string().min(1),\n etag: z.string().optional(),\n});\nexport type CredentialRefreshUnchangedResult = z.infer<\n typeof CredentialRefreshUnchangedResultValidator\n>;\n\nexport const CredentialRefreshUnsupportedResultValidator = z.object({\n status: z.literal('unsupported'),\n});\nexport type CredentialRefreshUnsupportedResult = z.infer<\n typeof CredentialRefreshUnsupportedResultValidator\n>;\n\nexport const CredentialRefreshFailedResultValidator = z.object({\n status: z.literal('failed'),\n code: CredentialRefreshFailureCodeValidator,\n retryable: z.boolean(),\n});\nexport type CredentialRefreshFailedResult = z.infer<typeof CredentialRefreshFailedResultValidator>;\n\nexport const CredentialRefreshResultValidator = z.discriminatedUnion('status', [\n CredentialRefreshUpdatedResultValidator,\n CredentialRefreshUnchangedResultValidator,\n CredentialRefreshUnsupportedResultValidator,\n CredentialRefreshFailedResultValidator,\n]);\nexport type CredentialRefreshResult = z.infer<typeof CredentialRefreshResultValidator>;\n", "/**\n * Provider-agnostic interfaces for authentication and key derivation.\n *\n * Both @learncard/sss-key-manager and learn-card-base import from here,\n * ensuring a single canonical source for abstract interfaces without\n * coupling consumers to any specific implementation.\n */\n\nimport { z } from 'zod';\n\n// ---------------------------------------------------------------------------\n// Auth Session Error\n// ---------------------------------------------------------------------------\n\n/**\n * Typed error for auth session issues.\n * Auth providers should throw this (instead of generic Error) when the\n * session is expired, revoked, or missing so the coordinator can\n * distinguish \"not logged in\" from \"unexpected failure\".\n */\nexport class AuthSessionError extends Error {\n constructor(\n message: string,\n public readonly reason: 'expired' | 'no_session' | 'revoked' | 'network'\n ) {\n super(message);\n this.name = 'AuthSessionError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Auth Provider\n// ---------------------------------------------------------------------------\n\n/**\n * Auth provider identifier. Known values: 'firebase', 'supertokens', 'keycloak', 'oidc'.\n * Use any string to support custom auth providers without modifying this type.\n */\nexport type AuthProviderType = string;\n\nexport interface AuthUser {\n id: string;\n email?: string;\n phone?: string;\n displayName?: string;\n photoUrl?: string;\n providerType: AuthProviderType;\n\n /** Account creation timestamp (when available from the auth provider) */\n createdAt?: Date;\n}\n\n/**\n * Abstract auth provider interface.\n * Implementations wrap a specific auth SDK (Firebase, Supertokens, etc.)\n * and expose a uniform API to the coordinator.\n */\nexport interface AuthProvider {\n getIdToken(forceRefresh?: boolean): Promise<string>;\n getCurrentUser(): Promise<AuthUser | null>;\n getProviderType(): AuthProviderType;\n signOut(): Promise<void>;\n\n /**\n * Attempt to silently refresh the auth session (e.g., force-refresh\n * the JWT using the underlying refresh token).\n *\n * Returns `true` if the session was successfully refreshed.\n * Returns `false` if a full re-authentication is required.\n *\n * Optional \u2014 providers that don't implement this will require full\n * re-auth whenever the session expires.\n */\n refreshSession?(): Promise<boolean>;\n\n /**\n * Re-authenticate with a server-issued token (e.g., a Firebase custom\n * token returned after a server-side account change that invalidates\n * the current session).\n *\n * Returns the refreshed AuthUser read directly from the auth SDK\n * (not from the app store, which may be stale).\n *\n * Optional \u2014 only needed by providers whose server-side account\n * mutations invalidate the client session.\n */\n reauthenticateWithToken?(token: string): Promise<AuthUser | null>;\n}\n\n// ---------------------------------------------------------------------------\n// Sign-In Adapter (Phase 2)\n// ---------------------------------------------------------------------------\n\n/**\n * Opaque handle returned by `sendPhoneOtp()`.\n * On web this wraps a ConfirmationResult; on native it carries a verificationId.\n * Consumers pass this back to `confirmPhoneOtp()` \u2014 never inspect internals.\n */\nexport interface PhoneVerificationHandle {\n verificationId: string;\n\n /** Platform-specific confirmation object (e.g. Firebase ConfirmationResult) */\n _internal?: unknown;\n}\n\n/** Sign-in features available to the UI, independent of the provider name. */\nexport interface SignInCapabilities {\n readonly emailLink: boolean;\n /** Email OTP is verified by the app's server, then exchanged via customToken. */\n readonly emailOtp: boolean;\n readonly phoneOtp: boolean;\n readonly google: boolean;\n readonly apple: boolean;\n readonly social: boolean;\n readonly customToken: boolean;\n readonly deleteAccount: boolean;\n}\n\nexport interface SocialSignInOptions {\n /** Restore a session using the existing re-authentication interaction. */\n intent?: 'signIn' | 'reauthenticate';\n}\n\n/**\n * Abstract sign-in adapter interface.\n *\n * Encapsulates **all** provider-specific sign-in logic (Firebase, Supertokens,\n * Keycloak, \u2026). Apps register a concrete adapter at startup via\n * `registerSignInAdapterFactory()` and resolve it through the provider registry.\n *\n * The `subscribe()` method is the **single source of truth** for auth state:\n * `SignInAdapterProvider` calls it once and writes every state change to\n * `authUserStore`, replacing the Phase 1 bridge.\n *\n * Individual sign-in methods return `Promise<AuthUser>` on success and throw\n * on failure \u2014 the app-level hook (`useFirebase` / `useAuth`) handles UI\n * feedback (toasts, modals, analytics).\n */\nexport interface SignInAdapter {\n readonly providerType: AuthProviderType;\n readonly capabilities: SignInCapabilities;\n\n // --- Auth state ---\n\n /**\n * Subscribe to auth-state changes. The callback fires immediately with\n * the current state and again on every sign-in / sign-out.\n *\n * Returns an unsubscribe function.\n */\n subscribe(onUser: (user: AuthUser | null) => void): () => void;\n\n /** Synchronous snapshot of the last user emitted by `subscribe()`. */\n getCurrentUser(): AuthUser | null;\n\n // --- Email link (passwordless) ---\n\n sendEmailLink(email: string, redirectUrl?: string): Promise<void>;\n\n verifyEmailLink(email: string, link: string): Promise<AuthUser>;\n\n isEmailLink(link: string): boolean;\n\n /** Authoritative provider check; isEmailLink remains a synchronous hint. */\n validateEmailLink(link: string): Promise<boolean>;\n\n // --- Phone OTP ---\n\n /**\n * Send an SMS OTP to the given number.\n * On web this sets up a RecaptchaVerifier transparently.\n */\n sendPhoneOtp(phoneNumber: string): Promise<PhoneVerificationHandle>;\n\n /**\n * Confirm a phone OTP using the handle returned by `sendPhoneOtp()`.\n */\n confirmPhoneOtp(handle: PhoneVerificationHandle, code: string | number): Promise<AuthUser>;\n\n /** Preferred API: confirm the most recent request without exposing SDK state. */\n confirmPhoneOtp(code: string | number): Promise<AuthUser>;\n\n /** Fires when a code is ready for entry, on either platform. */\n onPhoneCodeSent(callback: () => void): () => void;\n\n /** Auto-retrieved code; call confirmPhoneOtp before starting key derivation. */\n onPhoneVerificationCompleted(callback: (code: string | undefined) => void): () => void;\n\n onPhoneVerificationFailed(callback: (error: unknown) => void): () => void;\n\n /**\n * Confirm a phone OTP using a native verificationId (Capacitor auto-verify\n * path). Falls back to `confirmPhoneOtp` when not implemented.\n */\n confirmNativePhoneOtp?(verificationId: string, code: string | number): Promise<AuthUser>;\n\n // --- OAuth ---\n\n signInWithGoogle(options?: SocialSignInOptions): Promise<AuthUser>;\n\n signInWithApple(options?: SocialSignInOptions): Promise<AuthUser>;\n\n /** Check for a pending OAuth redirect result (e.g. Apple on web). */\n checkRedirectResult?(): Promise<AuthUser | null>;\n\n // --- Custom / SSO ---\n\n signInWithCustomToken(token: string): Promise<AuthUser>;\n\n /** Sign in with an OIDC credential (e.g. Keycloak World Scouts SSO). */\n signInWithOidcCredential?(providerId: string, idToken: string): Promise<AuthUser>;\n\n // --- Account management ---\n\n deleteAccount(): Promise<void>;\n\n /** Update the signed-in user's display profile, when supported. */\n updateProfile?(profile: {\n displayName?: string | null;\n photoUrl?: string | null;\n }): Promise<void>;\n\n /** Limit the auth session to this browser tab on a public computer. */\n setSessionPersistence?(sessionOnly: boolean): Promise<void>;\n\n signOut(): Promise<void>;\n\n // --- Cleanup ---\n\n /** Tear down any DOM elements created by the adapter (e.g. RecaptchaVerifier). */\n cleanup?(): void;\n}\n\n// ---------------------------------------------------------------------------\n// Recovery (generic)\n// ---------------------------------------------------------------------------\n\n/**\n * Recovery method metadata returned by the server.\n * The `type` is a string so strategies can define their own method types\n * without modifying this interface.\n */\nexport interface RecoveryMethodInfo {\n type: string;\n createdAt: Date;\n credentialId?: string;\n shareVersion?: number;\n confirmedAt?: Date;\n}\n\n/**\n * Generic result of a successful recovery execution.\n * All strategies must produce a private key + DID.\n */\nexport interface RecoveryResult {\n privateKey: string;\n did: string;\n}\n\nexport interface IdentityRecoverySession {\n recoverySessionToken: string;\n recoveryMethods: RecoveryMethodInfo[];\n}\n\n// ---------------------------------------------------------------------------\n// Server Key Status\n// ---------------------------------------------------------------------------\n\nexport type SssActivationState = 'provisional' | 'active';\n\n/** Optional PIN enrollment requires rotating the existing escrow share. */\nexport type EscrowEnrollmentOptions = { pin?: string };\n\n/** Stable error-message contract shared by PIN recovery clients and servers. */\nexport const ESCROW_PIN_LOCKED_MESSAGE =\n 'Too many incorrect PIN attempts. You can still recover by waiting.';\nexport const ESCROW_PIN_UNAVAILABLE_MESSAGE = 'PIN recovery is not available for this account.';\nexport const ESCROW_PIN_MISMATCH_PATTERN = /^Incorrect PIN\\. (\\d+) attempts left\\.$/;\nexport const escrowPinMismatchMessage = (attemptsRemaining: number): string =>\n `Incorrect PIN. ${attemptsRemaining} attempts left.`;\n\n/** Public PIN availability and remaining lifetime attempts; never includes the verifier. */\nexport const EscrowPinStatusValidator = z.object({\n state: z.enum(['none', 'enabled', 'locked', 'stale']),\n enabled: z.boolean(),\n attemptsRemaining: z.number().int().nonnegative(),\n salt: z.string().optional(),\n});\nexport type EscrowPinStatus = z.infer<typeof EscrowPinStatusValidator>;\n\n/** Enrollment details for PIN-aware strategies. Legacy strategies may still return a string. */\nexport interface EscrowEnrollmentState {\n state: 'enrolled' | 'not-enrolled' | 'opted-out' | 'disabled';\n escrowPin?: EscrowPinStatus;\n}\n\n/**\n * Server key status returned by the strategy's fetchServerKeyStatus.\n * The strategy owns the server shape \u2014 different strategies may\n * have fundamentally different server payloads.\n */\nexport interface ServerKeyStatus {\n exists: boolean;\n needsMigration: boolean;\n primaryDid: string | null;\n recoveryMethods: RecoveryMethodInfo[];\n authShare: string | null;\n shareVersion: number | null;\n maskedRecoveryEmail?: string | null;\n escrowOptedOut?: boolean;\n escrowPin?: EscrowPinStatus;\n sssActivationState?: SssActivationState | null;\n}\n\n/** Signs a DID-Auth VP. A supplied challenge must be embedded as the VP nonce. */\nexport type DidAuthVpSigner = (privateKey: string, challenge?: string) => Promise<string>;\n\n// ---------------------------------------------------------------------------\n// Key Derivation Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Declarative capability flags for a key derivation strategy.\n *\n * UI components read these to decide which features to show.\n * Each strategy declares its own capabilities \u2014 no strategy-specific\n * checks needed in the UI layer.\n *\n * All flags default to `false` when absent.\n *\n * @example\n * ```ts\n * // SSS declares full capabilities:\n * capabilities: { recovery: true, deviceLinking: true, localKeyPersistence: true }\n *\n * // Web3Auth derives keys on-demand, nothing local to manage:\n * capabilities: { recovery: false, deviceLinking: false, localKeyPersistence: false }\n * ```\n */\nexport interface KeyDerivationCapabilities {\n /** Strategy supports user-facing recovery methods (setup + execution) */\n recovery: boolean;\n\n /** Strategy supports cross-device key transfer (e.g., QR-based device linking) */\n deviceLinking: boolean;\n\n /**\n * Strategy persists key material locally (e.g., device share in IndexedDB).\n * When true, \"public computer\" / \"forget device\" features are relevant.\n */\n localKeyPersistence: boolean;\n\n /**\n * Strategy supports upgrading the user's contact method (e.g., phone \u2192 email).\n * When true, the `upgradeContactMethod` method is available and the\n * email-linking gate can be shown for phone-only users.\n */\n contactMethodUpgrade: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Key Derivation Strategy (generic)\n// ---------------------------------------------------------------------------\n\n/**\n * Key Derivation Strategy\n *\n * Abstract interface for different key derivation implementations.\n * Used by AuthCoordinator to delegate key operations.\n *\n * The strategy owns:\n * - Local key storage\n * - Key splitting and reconstruction\n * - Server communication for remote key components\n * - Recovery method execution and setup\n * - Storage cleanup knowledge\n *\n * Type parameters allow each strategy to define its own recovery shapes:\n * - TRecoveryInput: what the user provides to recover (e.g., password, passkey)\n * - TRecoverySetupInput: what the user provides to set up a recovery method\n * - TRecoverySetupResult: what setup returns (e.g., generated phrase, credential ID)\n *\n * @example\n * // SSS strategy with specific recovery types:\n * type SSSStrategy = KeyDerivationStrategy<SSSRecoveryInput, SSSRecoverySetupInput, SSSRecoverySetupResult>;\n *\n * // Simple strategy with no recovery:\n * type SimpleStrategy = KeyDerivationStrategy<never, never, never>;\n */\nexport interface KeyDerivationStrategy<\n TRecoveryInput = unknown,\n TRecoverySetupInput = unknown,\n TRecoverySetupResult = unknown,\n TRecoveryConfirmationInput = unknown,\n> {\n readonly name: string;\n\n /** Declarative feature flags \u2014 UI reads these to gate features */\n readonly capabilities: KeyDerivationCapabilities;\n\n // --- Key lifecycle ---\n\n /** Check if there's a local key component (e.g., device share) */\n hasLocalKey(): Promise<boolean>;\n\n /** Get the local key component */\n getLocalKey(): Promise<string | null>;\n\n /** Store a local key component */\n storeLocalKey(key: string): Promise<void>;\n\n /** Clear local key data; automatic stale-key cleanup may retain unresolved writes. */\n clearLocalKeys(options?: { preservePending?: boolean }): Promise<void>;\n\n /** Split a private key into shares/components */\n splitKey(privateKey: string): Promise<{ localKey: string; remoteKey: string }>;\n\n /** Reconstruct private key from components */\n reconstructKey(localKey: string, remoteKey: string): Promise<string>;\n\n /** Verify that stored keys can reconstruct the expected DID */\n verifyKeys?(\n localKey: string,\n remoteKey: string,\n expectedDid: string,\n didFromPrivateKey: (pk: string) => Promise<string>\n ): Promise<boolean>;\n\n /**\n * Atomically split and persist a private key's local and remote components.\n * Strategies that implement this use it for initial setup and rotations so\n * callers never have to coordinate device/server writes themselves.\n */\n atomicUpdateShares?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n did: string;\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<void>;\n\n /**\n * Repair local/server share-version skew after an ambiguous write. Returns\n * the recovered key when reconciliation was needed, otherwise null.\n */\n reconcileShares?(params: {\n token: string;\n providerType: AuthProviderType;\n expectedDid: string;\n didFromPrivateKey: (privateKey: string) => Promise<string>;\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<RecoveryResult | null>;\n\n /** Obtain a short-lived, single-use challenged DID-Auth VP for a write. */\n getFreshDidAuthVp?(\n privateKey: string,\n did: string,\n signDidAuthVp: DidAuthVpSigner\n ): Promise<string>;\n\n // --- Server communication ---\n\n /** Fetch the server-side key status for the authenticated user */\n fetchServerKeyStatus(token: string, providerType: AuthProviderType): Promise<ServerKeyStatus>;\n\n /** Store the remote key component on the server */\n storeAuthShare(\n token: string,\n providerType: AuthProviderType,\n remoteKey: string,\n did: string,\n didAuthVp?: string\n ): Promise<void>;\n\n /** Mark migration complete on the server (optional \u2014 only needed for migration-capable strategies) */\n markMigrated?(token: string, providerType: AuthProviderType, didAuthVp?: string): Promise<void>;\n\n /** Commit a provisioned key after the server verifies recovery enrollment. */\n activate?(token: string, providerType: AuthProviderType, didAuthVp?: string): Promise<void>;\n\n // --- Recovery ---\n\n /** Read the current automatic recovery enrollment status. */\n getEscrowEnrollmentState?(params: {\n token: string;\n providerType: AuthProviderType;\n }): Promise<EscrowEnrollmentState['state'] | EscrowEnrollmentState>;\n\n /** Opt out with an owner proof; requires another confirmed recovery method. */\n disableEscrowRecovery?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n }): Promise<void>;\n\n /** Opt back in and enroll automatic recovery material. */\n enableEscrowRecovery?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n options?: EscrowEnrollmentOptions;\n }): Promise<\n | { enrolled: false; reason: 'disabled' | 'opted-out' }\n | { enrolled: true; changed: false }\n | { enrolled: true; changed: true; shareVersion: number }\n >;\n\n /** Repair escrow enrollment, rotating shares only when no current confirmed enrollment exists. */\n ensureEscrowEnrollment?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n options?: EscrowEnrollmentOptions;\n }): Promise<\n | { enrolled: false; reason: 'disabled' | 'opted-out' }\n | { enrolled: true; changed: false }\n | { enrolled: true; changed: true; shareVersion: number }\n >;\n\n /** Set or change a PIN by rotating escrow material with an owner proof. */\n setEscrowPin?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n pin: string;\n }): Promise<void>;\n\n /** Remove a PIN by rotating escrow material with an owner proof. */\n clearEscrowPin?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n }): Promise<void>;\n\n /** Start an escrow hold. Securely persist the returned secrets; null means an existing hold. */\n startEscrowRecovery?(params: {\n token?: string;\n providerType?: AuthProviderType;\n recoverySessionToken?: string;\n tenantId?: string;\n options?: { releasePolicy?: 'hold' | 'pin'; restart?: boolean };\n }): Promise<{\n holdId: string;\n status: 'pending' | 'cancelled' | 'completed' | 'expired';\n requestedAt: string;\n releaseAfter: string;\n cancelledAt?: string;\n completedAt?: string;\n resumeToken: string | null;\n clientEphemeralPrivateKey: string;\n pinSalt?: string;\n /** Absent on legacy hold-only strategies. */\n releasePolicy?: 'hold' | 'pin';\n }>;\n\n /** Read a hold using its resume proof or the active device's provider session. */\n getEscrowRecoveryStatus?(\n params:\n | { holdId: string; resumeToken: string }\n | { token: string; providerType: AuthProviderType }\n ): Promise<{\n holdId: string;\n status: 'pending' | 'cancelled' | 'completed' | 'expired';\n requestedAt: string;\n releaseAfter: string;\n /** Absent on legacy hold-only strategies. */\n releasePolicy?: 'hold' | 'pin';\n cancelledAt?: string;\n completedAt?: string;\n } | null>;\n\n /** Cancel a pending hold with a fresh, owner-signed DID challenge. */\n cancelEscrowRecovery?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n signDidAuthVp: DidAuthVpSigner;\n }): Promise<{ cancelled: boolean }>;\n\n /** Execute a recovery flow and return the recovered private key + DID */\n executeRecovery(params: {\n token: string;\n providerType: AuthProviderType;\n input: TRecoveryInput;\n /** Optional: validate the reconstructed key's DID before rotating shares */\n didFromPrivateKey?: (privateKey: string) => Promise<string>;\n /** Optional: sign the fresh challenge required to persist rotated shares */\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<RecoveryResult>;\n\n /** Set up a new recovery method */\n setupRecoveryMethod?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n input: TRecoverySetupInput;\n authUser?: AuthUser;\n /** Optional: sign a DID-Auth VP JWT for server write operations */\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<TRecoverySetupResult>;\n\n /** Confirm a pending method after the strategy verifies proof of receipt locally. */\n confirmRecoveryMethod?(params: {\n token: string;\n providerType: AuthProviderType;\n privateKey: string;\n input: TRecoveryConfirmationInput;\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<void>;\n\n /** Get configured recovery methods for the authenticated user */\n getAvailableRecoveryMethods?(\n token: string,\n providerType: AuthProviderType\n ): Promise<RecoveryMethodInfo[]>;\n\n // --- Lost login identity recovery ---\n\n /** Send an OTP to the verified recovery email without requiring provider auth. */\n startIdentityRecovery?(email: string): Promise<void>;\n\n /** Verify the OTP and receive a one-use, recovery-scoped session. */\n verifyIdentityRecovery?(email: string, code: string): Promise<IdentityRecoverySession>;\n\n /** Reconstruct and hard-validate the key before the replacement login is bound. */\n prepareIdentityRecovery?(params: {\n recoverySessionToken: string;\n input: TRecoveryInput;\n didFromPrivateKey: (privateKey: string) => Promise<string>;\n }): Promise<RecoveryResult>;\n\n /** Whether reconstructed identity recovery is waiting for a replacement login. */\n hasPendingIdentityRecovery?(): boolean;\n\n /** Discard any reconstructed identity recovery that has not been rebound. */\n cancelIdentityRecovery?(): void;\n\n /** Bind the current provider identity and commit a full share rotation. */\n completeIdentityRecovery?(params: {\n token: string;\n providerType: AuthProviderType;\n signDidAuthVp?: DidAuthVpSigner;\n }): Promise<RecoveryResult>;\n\n // --- Contact method management ---\n\n /**\n * Verify email ownership and upgrade the user's contact method on the\n * server (e.g., phone \u2192 email). The server verifies the OTP code, links\n * the email to the auth account (passwordless), and atomically updates\n * the UserKey contact method.\n *\n * Strategies that don't manage server-side contact methods can omit this.\n *\n * @param token - Auth token for the current session\n * @param providerType - Auth provider type\n * @param previousPhone - The phone number being replaced\n * @param email - The new email address (already OTP-verified client-side)\n * @param code - The 6-digit verification code\n */\n upgradeContactMethod?(\n token: string,\n providerType: AuthProviderType,\n previousPhone: string,\n email: string,\n code: string\n ): Promise<{ customToken?: string } | void>;\n\n // --- Email backup ---\n\n /**\n * Send a backup share to the user's email for fail-safe recovery.\n * Called by the coordinator after key setup or migration.\n * Implementation should be fire-and-forget (non-fatal on failure).\n *\n * @param token - Auth token for server communication\n * @param providerType - Auth provider type\n * @param privateKey - The private key to derive the email share from\n * @param email - Destination email address\n */\n sendEmailBackupShare?(\n token: string,\n providerType: AuthProviderType,\n privateKey: string,\n email: string,\n didAuthVp?: string\n ): Promise<void>;\n\n // --- Share versioning ---\n\n /**\n * Get the share version associated with the local device share.\n * Used to request the matching auth share from the server and to\n * include in QR cross-device transfers.\n *\n * Returns null for legacy shares with no stored version.\n */\n getLocalShareVersion?(): Promise<number | null>;\n\n /**\n * Store the share version for the local device share.\n * Called after receiving a device share + version via QR transfer.\n */\n storeLocalShareVersion?(version: number): Promise<void>;\n\n // --- User scoping ---\n\n /**\n * Inform the strategy which user is active so it can scope local storage\n * (e.g., device shares) per-user. Called by the coordinator after\n * authentication, before any local-key operations.\n *\n * Strategies that don't need per-user scoping can omit this method.\n *\n * @param userId - Stable, unique identifier for the authenticated user\n * (e.g., Firebase UID). Must NOT change across sessions.\n */\n setActiveUser?(userId: string): void;\n\n // --- Cleanup ---\n\n /** Return storage keys (e.g., IndexedDB database names) that should be preserved during logout */\n getPreservedStorageKeys(): string[];\n\n /** Strategy-specific cleanup beyond clearLocalKeys (optional) */\n cleanup?(): Promise<void>;\n}\n", "import { z } from 'zod/v4';\n\nexport const BITSTRING_STATUS_PURPOSES = ['revocation', 'suspension'] as const;\nexport const DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131_072;\n\nexport const BitstringStatusPurposeValidator = z.enum(BITSTRING_STATUS_PURPOSES);\nexport type BitstringStatusPurpose = z.infer<typeof BitstringStatusPurposeValidator>;\n\nexport const BitstringStatusListEntryValidator = z.object({\n id: z.string().optional(),\n type: z.literal('BitstringStatusListEntry'),\n statusPurpose: BitstringStatusPurposeValidator,\n statusListIndex: z.string().or(z.number().int().nonnegative()),\n statusListCredential: z.string(),\n});\nexport type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;\n\nexport const AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({\n id: z.string(),\n});\nexport type AllocatedBitstringStatusListEntry = z.infer<\n typeof AllocatedBitstringStatusListEntryValidator\n>;\n\nexport const BitstringStatusListCredentialSubjectValidator = z.object({\n id: z.string().optional(),\n type: z.literal('BitstringStatusList'),\n statusPurpose: BitstringStatusPurposeValidator,\n encodedList: z.string(),\n});\nexport type BitstringStatusListCredentialSubject = z.infer<\n typeof BitstringStatusListCredentialSubjectValidator\n>;\n\nexport const AllocateCredentialStatusInputValidator = z\n .object({\n statusPurposes: z.array(BitstringStatusPurposeValidator).optional(),\n listSize: z.number().int().positive().optional(),\n })\n .default({});\nexport type AllocateCredentialStatusInput = z.infer<typeof AllocateCredentialStatusInputValidator>;\n\nexport type BitstringCredentialStatusPurpose = BitstringStatusPurpose;\nexport type BitstringCredentialStatusEntry = AllocatedBitstringStatusListEntry;\n", "import { z } from 'zod';\n\n/**\n * In-App Messages \u2014 schema for the LaunchDarkly JSON flag that drives\n * conditional, targeted user prompts across LearnCard apps.\n *\n * The flag value is a versioned list of messages. Each message carries its own\n * targeting predicate tree that is evaluated ON DEVICE, because the client\n * knows things LaunchDarkly's own targeting rules cannot reliably see \u2014 the\n * Capacitor platform, the native binary version, and (crucially) the live\n * Capgo/OTA bundle version. Keeping targeting in the JSON also makes the whole\n * system unit-testable without a live LaunchDarkly connection.\n *\n * Consumed by `useInAppMessages()` in `learn-card-base`.\n */\n\n/** Runtime platform, as reported by `Capacitor.getPlatform()`. */\nexport const inAppMessagePlatformValidator = z.enum(['ios', 'android', 'web']);\nexport type InAppMessagePlatform = z.infer<typeof inAppMessagePlatformValidator>;\n\n/**\n * Which version number a `version` predicate compares against:\n * - `native` \u2014 the installed native binary version (`App.getInfo().version`)\n * - `web` \u2014 the web build's package.json version (`__APP_VERSION__`)\n * - `capgo` \u2014 the live Capgo/OTA bundle version (`CapacitorUpdater.current()`)\n */\nexport const inAppMessageVersionSourceValidator = z.enum(['native', 'web', 'capgo']);\nexport type InAppMessageVersionSource = z.infer<typeof inAppMessageVersionSourceValidator>;\n\n/** Semantic-version comparison operator (less-than, ..., greater-than). */\nexport const inAppMessageVersionOpValidator = z.enum(['lt', 'lte', 'eq', 'gte', 'gt']);\nexport type InAppMessageVersionOp = z.infer<typeof inAppMessageVersionOpValidator>;\n\n/** Match when the runtime platform is one of the listed platforms. */\nexport const platformPredicateValidator = z\n .object({ platform: z.array(inAppMessagePlatformValidator).nonempty() })\n .strict();\n\n/** Match when the current user's profile role is one of the listed roles. */\nexport const rolePredicateValidator = z.object({ role: z.array(z.string()).nonempty() }).strict();\n\n/** Match when a chosen version source satisfies a semver comparison. */\nexport const versionPredicateValidator = z\n .object({\n version: z\n .object({\n source: inAppMessageVersionSourceValidator,\n op: inAppMessageVersionOpValidator,\n value: z.string(),\n })\n .strict(),\n })\n .strict();\n\nexport type InAppMessagePredicate =\n | z.infer<typeof platformPredicateValidator>\n | z.infer<typeof rolePredicateValidator>\n | z.infer<typeof versionPredicateValidator>\n | { all: InAppMessagePredicate[] }\n | { any: InAppMessagePredicate[] }\n | { not: InAppMessagePredicate };\n\nexport const inAppMessagePredicateValidator: z.ZodType<InAppMessagePredicate> = z.lazy(() =>\n z.union([\n platformPredicateValidator,\n rolePredicateValidator,\n versionPredicateValidator,\n z.object({ all: z.array(inAppMessagePredicateValidator) }).strict(),\n z.object({ any: z.array(inAppMessagePredicateValidator) }).strict(),\n z.object({ not: inAppMessagePredicateValidator }).strict(),\n ])\n);\n\n/** Visual weight of an action button \u2014 maps to the app's button styles. */\nexport const inAppMessageActionStyleValidator = z\n .enum(['primary', 'secondary', 'positive', 'dismiss'])\n .default('secondary');\nexport type InAppMessageActionStyle = z.infer<typeof inAppMessageActionStyleValidator>;\n\n// Action validators use .passthrough() (old clients tolerate new fields on\n// actions), while predicate validators are .strict() so a typo in targeting\n// fails closed at parse time instead of silently matching everyone.\n\n/** Navigate to an in-app route (react-router path). */\nexport const internalLinkActionValidator = z\n .object({ type: z.literal('internalLink'), path: z.string() })\n .passthrough();\n\n/** Open an external URL (native: Capacitor Browser; web: new tab). */\nexport const externalLinkActionValidator = z\n .object({ type: z.literal('externalLink'), url: z.string() })\n .passthrough();\n\n/**\n * Open this app's store page, resolved per-platform at runtime:\n * iOS \u2192 App Store, Android \u2192 Google Play, web \u2192 configured fallback URL.\n * Optional overrides win over tenant-config-derived links.\n */\nexport const appStoreActionValidator = z\n .object({\n type: z.literal('appStore'),\n iosUrl: z.string().optional(),\n androidUrl: z.string().optional(),\n webUrl: z.string().optional(),\n })\n .passthrough();\n\n/** Trigger a Capgo OTA bundle check + download (with progress) + reload. */\nexport type AppStoreAction = z.infer<typeof appStoreActionValidator>;\n\nexport const capgoUpdateActionValidator = z\n .object({ type: z.literal('capgoUpdate') })\n .passthrough();\n\n/** Dismiss/close the message without any side effect. */\nexport const dismissActionValidator = z.object({ type: z.literal('dismiss') }).passthrough();\n\nexport const inAppMessageActionTargetValidator = z.union([\n internalLinkActionValidator,\n externalLinkActionValidator,\n appStoreActionValidator,\n capgoUpdateActionValidator,\n dismissActionValidator,\n]);\nexport type InAppMessageActionTarget = z.infer<typeof inAppMessageActionTargetValidator>;\n\nexport const inAppMessageActionValidator = z\n .object({\n label: z.string(),\n style: inAppMessageActionStyleValidator,\n action: inAppMessageActionTargetValidator,\n /** When true, the message closes after this action runs (default true). */\n closeOnComplete: z.boolean().default(true),\n })\n .passthrough();\nexport type InAppMessageAction = z.infer<typeof inAppMessageActionValidator>;\n\nexport const inAppMessageMediaValidator = z\n .object({\n type: z.enum(['youtube', 'image', 'gif']),\n url: z.string(),\n /** Aspect ratio hint, e.g. \"16:9\" or \"1:1\". Defaults to 16:9. */\n aspect: z.string().default('16:9'),\n /** Alt text for images/gifs (accessibility). */\n alt: z.string().optional(),\n })\n .passthrough();\nexport type InAppMessageMedia = z.infer<typeof inAppMessageMediaValidator>;\n\n/**\n * How often a message may re-appear after being seen/dismissed:\n * - `once` \u2014 show a single time, ever (persisted forever)\n * - `session` \u2014 at most once per app session (in-memory)\n * - `always` \u2014 every eligible render (no suppression)\n * - `{ everyDays: n }` \u2014 again only after n days have elapsed\n */\nexport const inAppMessageFrequencyValidator = z\n .union([\n z.literal('once'),\n z.literal('session'),\n z.literal('always'),\n z.object({ everyDays: z.number().positive() }).strict(),\n ])\n .default('once');\nexport type InAppMessageFrequency = z.infer<typeof inAppMessageFrequencyValidator>;\n\nexport const inAppMessagePresentationValidator = z\n .enum(['modal', 'banner', 'toast'])\n .default('modal');\nexport type InAppMessagePresentation = z.infer<typeof inAppMessagePresentationValidator>;\n\nexport const inAppMessageValidator = z\n .object({\n /** Stable identifier \u2014 used to persist dismissal / frequency state. */\n id: z.string(),\n /** Higher priority wins when multiple messages match. Default 0. */\n priority: z.number().default(0),\n /** When false, the message is required/blocking (no dismiss affordance). */\n dismissible: z.boolean().default(true),\n frequency: inAppMessageFrequencyValidator,\n presentation: inAppMessagePresentationValidator,\n media: inAppMessageMediaValidator.optional(),\n /** Optional emoji hero glyph \u2014 rendered only when `media` is not set. */\n emoji: z.string().optional(),\n title: z.string(),\n body: z.string().optional(),\n actions: z.array(inAppMessageActionValidator).default([]),\n /** Targeting predicate tree. Omitted \u2192 matches everyone. */\n targeting: inAppMessagePredicateValidator.optional(),\n /** Allow disabling a message without removing it from the flag. */\n enabled: z.boolean().default(true),\n })\n .passthrough();\nexport type InAppMessage = z.infer<typeof inAppMessageValidator>;\n\nexport const inAppMessagesFlagValidator = z\n .object({\n version: z.number().default(1),\n messages: z.array(inAppMessageValidator).default([]),\n })\n .passthrough();\nexport type InAppMessagesFlag = z.infer<typeof inAppMessagesFlagValidator>;\n\n/** Empty, safe default used when the flag is absent or malformed. */\nexport const EMPTY_IN_APP_MESSAGES_FLAG: InAppMessagesFlag = { version: 1, messages: [] };\n\n/**\n * Parse an unknown flag value into a validated `InAppMessagesFlag`.\n * Returns the empty flag (never throws) so a malformed flag can never crash\n * the host app.\n */\nexport const parseInAppMessagesFlag = (raw: unknown): InAppMessagesFlag => {\n const result = inAppMessagesFlagValidator.safeParse(raw);\n\n return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;\n};\n", "import { z } from 'zod/v4';\n\nimport { JWEValidator } from './crypto';\nimport { PaginationResponseValidator } from './mongo';\nimport { VCValidator, VPValidator } from './vc';\n\n/**\n * LC-2187 multi-credential share-link protocol types.\n *\n * This module is the single source of truth for the *recipient* payload grammar\n * and the owner-facing recovery/API shapes. It is deliberately storage-agnostic:\n * it defines bytes and structure, never where those bytes live.\n *\n * Security boundaries encoded here (see planning/lc-2187/task-a-contract.md and\n * task-a2-review.md):\n * - A share id / content key / IV / ciphertext is accepted only when it is\n * canonical base64url: alphabet, no `=`, exact decoded byte length, and a\n * re-encode round trip. Permissive decoders accept unused padding bits, so one\n * byte string would otherwise have several spellings and could defeat an AAD\n * or signature binding keyed on the string.\n * - The recipient manifest never carries source URIs. Credentials are referenced\n * by local index into the holder-signed presentation only.\n * - Envelope authenticity (AES-GCM) only proves a key holder produced the bytes.\n * It is NOT issuer identity. Signed VP/credential verification is a separate,\n * later step (see `ShareManifestProofVerifier` in learn-card-base).\n */\n\n/** Raw byte length of the opaque share id (128 bits). */\nexport const SHARE_LINK_ID_BYTES = 16;\n/** Raw byte length of the symmetric content key (256 bits). */\nexport const SHARE_CONTENT_KEY_BYTES = 32;\n/** AES-GCM nonce length (96 bits). */\nexport const SHARE_IV_BYTES = 12;\n/** AES-GCM authentication tag length (128 bits). */\nexport const SHARE_TAG_BYTES = 16;\n/** Maximum decoded ciphertext length, tag included (512 KiB). */\nexport const MAX_SHARE_CIPHERTEXT_BYTES = 512 * 1024;\n/** Maximum UTF-8 length of the serialized owner recovery JWE (64 KiB). */\nexport const MAX_SHARE_RECOVERY_JWE_BYTES = 64 * 1024;\n/** Maximum number of selected credentials in one share (50). */\nexport const MAX_SELECTED_CREDENTIALS = 50;\n/** Maximum number of public endorsements attached to one share (200). */\nexport const MAX_ENDORSEMENTS = 200;\n/**\n * Conservative total bound on holder-signed VP members (selected + endorsements).\n * The sum is intentional: the two collections are disjoint and every member must\n * be classified exactly once, so their maximums bound the VP.\n */\nexport const MAX_VP_MEMBERS = MAX_SELECTED_CREDENTIALS + MAX_ENDORSEMENTS;\n/** Maximum length of an owner-private source URI in recovery. */\nexport const MAX_SHARE_SOURCE_URI_CHARS = 2048;\n/**\n * Maximum UTF-8 byte length of one complete owner share-link request body,\n * measured raw (before Zod strips unknown fields). This is the transport-level\n * bound enforced ahead of schema parsing; individual field bounds are not a\n * substitute for it.\n */\nexport const MAX_SHARE_LINK_REQUEST_BYTES = 1024 * 1024;\n\n/** Recipient plaintext protocol id. */\nexport const SHARE_LINK_PROTOCOL = 'lc-share/v1';\n/** Owner recovery plaintext protocol id. */\nexport const SHARE_RECOVERY_PROTOCOL = 'lc-share-recovery/v1';\n/** Domain-separation prefix for the AES-GCM AAD. */\nexport const SHARE_AAD_PREFIX = 'lc-share:v1';\n\nconst BASE64URL_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\n/** Reverse lookup for the base64url alphabet; -1 marks an invalid character. */\nconst BASE64URL_LOOKUP = (() => {\n const table = new Int16Array(128).fill(-1);\n for (let index = 0; index < BASE64URL_ALPHABET.length; index += 1) {\n table[BASE64URL_ALPHABET.charCodeAt(index)] = index;\n }\n return table;\n})();\n\n/**\n * Encode bytes as unpadded base64url. Browser/Node isomorphic on purpose: no\n * `Buffer`, and no dependency on `btoa`/`atob` encoding quirks.\n */\nexport const encodeBase64Url = (bytes: Uint8Array): string => {\n let output = '';\n\n for (let index = 0; index < bytes.length; index += 3) {\n const first = bytes[index];\n const second = bytes[index + 1];\n const third = bytes[index + 2];\n\n output += BASE64URL_ALPHABET[first >> 2];\n output += BASE64URL_ALPHABET[((first & 0b11) << 4) | ((second ?? 0) >> 4)];\n if (second === undefined) break;\n output += BASE64URL_ALPHABET[((second & 0b1111) << 2) | ((third ?? 0) >> 6)];\n if (third === undefined) break;\n output += BASE64URL_ALPHABET[third & 0b111111];\n }\n\n return output;\n};\n\n/**\n * Decode unpadded base64url to bytes. Returns `null` for any non-alphabet,\n * padding or otherwise malformed input. This step is intentionally more lenient\n * about trailing padding bits than {@link isCanonicalBase64Url}; callers that\n * need one unambiguous spelling must re-encode and compare.\n */\nexport const decodeBase64Url = (value: string): Uint8Array | null => {\n if (typeof value !== 'string') return null;\n\n const output = new Uint8Array(Math.floor((value.length * 6) / 8));\n let bits = 0;\n let bitCount = 0;\n let outputIndex = 0;\n\n for (let index = 0; index < value.length; index += 1) {\n const code = value.charCodeAt(index);\n const digit = code < 128 ? BASE64URL_LOOKUP[code] : -1;\n if (digit < 0) return null;\n\n bits = (bits << 6) | digit;\n bitCount += 6;\n\n if (bitCount >= 8) {\n bitCount -= 8;\n output[outputIndex] = (bits >> bitCount) & 0xff;\n outputIndex += 1;\n }\n }\n\n return output;\n};\n\n/**\n * Strict canonicity check: valid alphabet, no padding, and\n * `encode(decode(value)) === value`. When `expectedBytes` is supplied the decoded\n * length must match exactly.\n */\nexport const isCanonicalBase64Url = (value: unknown, expectedBytes?: number): boolean => {\n if (typeof value !== 'string') return false;\n if (expectedBytes !== undefined && value.length !== Math.ceil((expectedBytes * 4) / 3))\n return false;\n\n const decoded = decodeBase64Url(value);\n if (decoded === null) return false;\n if (expectedBytes !== undefined && decoded.length !== expectedBytes) return false;\n\n return encodeBase64Url(decoded) === value;\n};\n\n/** Base64url-encoded byte length without materializing the decoded string. */\nexport const decodedBase64UrlByteLength = (value: string): number | null =>\n decodeBase64Url(value)?.length ?? null;\n\n/** UTF-8 byte length, independent of the platform's string length semantics. */\nexport const utf8ByteLength = (value: string): number => new TextEncoder().encode(value).length;\n\nconst canonicalBase64Url = (bytes: number) =>\n z.string().refine(value => isCanonicalBase64Url(value, bytes), {\n message: `must be canonical base64url for exactly ${bytes} bytes`,\n });\n\n/** 16-byte / 22-character share id. */\nexport const ShareLinkIdValidator = canonicalBase64Url(SHARE_LINK_ID_BYTES);\nexport type ShareLinkId = z.infer<typeof ShareLinkIdValidator>;\n\n/** 32-byte / 43-character symmetric content key. */\nexport const ShareContentKeyValidator = canonicalBase64Url(SHARE_CONTENT_KEY_BYTES);\nexport type ShareContentKey = z.infer<typeof ShareContentKeyValidator>;\n\n/** 12-byte / 16-character AES-GCM nonce. */\nexport const ShareIvValidator = canonicalBase64Url(SHARE_IV_BYTES);\nexport type ShareIv = z.infer<typeof ShareIvValidator>;\n\n/**\n * Ciphertext||tag as canonical base64url. The decoded length includes the\n * 16-byte GCM tag, must be at least that tag, and is capped at\n * {@link MAX_SHARE_CIPHERTEXT_BYTES}.\n */\nexport const ShareCiphertextValidator = z.string().refine(\n value => {\n if (value.length > Math.ceil((MAX_SHARE_CIPHERTEXT_BYTES * 4) / 3)) return false;\n const decoded = decodeBase64Url(value);\n if (decoded === null) return false;\n if (encodeBase64Url(decoded) !== value) return false;\n return decoded.length >= SHARE_TAG_BYTES && decoded.length <= MAX_SHARE_CIPHERTEXT_BYTES;\n },\n {\n message: `must be canonical base64url decoding to ${SHARE_TAG_BYTES}..${MAX_SHARE_CIPHERTEXT_BYTES} bytes`,\n }\n);\nexport type ShareCiphertext = z.infer<typeof ShareCiphertextValidator>;\n\n/**\n * AES-256-GCM envelope. `v`/`alg` are literals so an unknown version or\n * algorithm is rejected by the schema before any decryption is attempted.\n */\nexport const ShareEnvelopeValidator = z\n .object({\n v: z.literal(1),\n alg: z.literal('A256GCM'),\n iv: ShareIvValidator,\n ct: ShareCiphertextValidator,\n })\n .strict();\nexport type ShareEnvelope = z.infer<typeof ShareEnvelopeValidator>;\n\nconst safeVersion = z\n .number()\n .int()\n .min(1)\n .max(2 ** 31 - 1);\nconst safeCredentialIndex = z\n .number()\n .int()\n .min(0)\n .max(MAX_VP_MEMBERS - 1);\n\n/** Index-only reference to a selected credential inside the signed VP. */\nexport const ShareSelectionEntryValidator = z\n .object({ credentialIndex: safeCredentialIndex })\n .strict();\nexport type ShareSelectionEntry = z.infer<typeof ShareSelectionEntryValidator>;\n\n/**\n * Index-only reference to an endorsement credential, plus the selected credential\n * it endorses. Extra keys (for example a source `ref`/`uri`) are rejected so a\n * recipient payload can never leak the owner's private source index.\n */\nexport const ShareEndorsementEntryValidator = z\n .object({ credentialIndex: safeCredentialIndex, targetCredentialIndex: safeCredentialIndex })\n .strict();\nexport type ShareEndorsementEntry = z.infer<typeof ShareEndorsementEntryValidator>;\n\nexport const ShareSharerValidator = z\n .object({\n profileId: z.string().min(1).max(128),\n displayName: z.string().min(1).max(120),\n avatar: z.string().max(2048).optional(),\n })\n .strict();\nexport type ShareSharer = z.infer<typeof ShareSharerValidator>;\n\n/**\n * Holder-signed presentation carried by the manifest. `verifiableCredential` is a\n * required non-empty array so the local indices are always resolvable. Individual\n * credentials keep the existing permissive VC shape (`.catchall`) \u2014 no signed\n * credential field is stripped or rewritten by validation.\n */\nconst presentationShape = VPValidator.extend({\n verifiableCredential: VCValidator.array().min(1).max(MAX_VP_MEMBERS),\n});\n\n/** Bound nested CLR credentials and JSON depth before schema traversal. */\nconst hasBoundedPresentation = (value: unknown): boolean => {\n let credentialCount = 0;\n const ancestors = new Set<object>();\n const visit = (node: unknown, depth: number): boolean => {\n if (node === null || typeof node !== 'object') return true;\n if (depth > 32 || ancestors.has(node)) return false;\n ancestors.add(node);\n try {\n for (const [key, child] of Object.entries(node)) {\n if (key === 'verifiableCredential') {\n credentialCount += Array.isArray(child) ? child.length : 1;\n if (credentialCount > MAX_VP_MEMBERS) return false;\n }\n if (!visit(child, depth + 1)) return false;\n }\n return true;\n } finally {\n ancestors.delete(node);\n }\n };\n return visit(value, 0);\n};\n\n// Validate without returning Zod's parsed copy: nested VC schemas may strip\n// extension fields, which would change the signed document before verification.\nexport const ShareManifestPresentationValidator = z.custom<z.infer<typeof presentationShape>>(\n value => hasBoundedPresentation(value) && presentationShape.safeParse(value).success,\n { message: 'invalid share presentation' }\n);\nexport type ShareManifestPresentation = z.infer<typeof ShareManifestPresentationValidator>;\n\nexport const SharePayloadValidatorShape = z\n .object({\n protocol: z.literal(SHARE_LINK_PROTOCOL),\n shareId: ShareLinkIdValidator,\n contentVersion: safeVersion,\n createdAt: z.iso.datetime(),\n sharer: ShareSharerValidator,\n presentation: ShareManifestPresentationValidator,\n selection: ShareSelectionEntryValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),\n endorsements: ShareEndorsementEntryValidator.array().max(MAX_ENDORSEMENTS).default([]),\n })\n .strict();\nexport type SharePayloadShape = z.infer<typeof SharePayloadValidatorShape>;\n\n/** Structured classification failure raised by {@link classifyShareManifest}. */\nexport type ShareManifestClassificationCode =\n | 'NO_PRESENTATION_MEMBERS'\n | 'TOO_MANY_VP_MEMBERS'\n | 'BAD_SELECTION'\n | 'BAD_ENDORSEMENTS'\n | 'SELECTION_INDEX_OUT_OF_BOUNDS'\n | 'SELECTION_INDEX_DUPLICATE'\n | 'ENDORSEMENT_INDEX_OUT_OF_BOUNDS'\n | 'VP_MEMBER_CLASSIFIED_TWICE'\n | 'ENDORSEMENT_TARGET_NOT_SELECTED'\n | 'ENDORSEMENT_TARGET_UNBOUND'\n | 'UNCLASSIFIED_VP_MEMBER';\n\nexport interface ShareManifestClassification {\n /** Ordered selected VP member indices, exactly as the manifest declares them. */\n selectedIndices: number[];\n /** Endorsement VP member indices (unordered classification helper). */\n endorsementIndices: number[];\n /** Total VP members, all of which are classified. */\n memberCount: number;\n}\n\nexport type ShareManifestClassificationResult =\n | { ok: true; classification: ShareManifestClassification }\n | {\n ok: false;\n code: ShareManifestClassificationCode;\n message: string;\n path: (string | number)[];\n };\n\nconst classificationFailure = (\n code: ShareManifestClassificationCode,\n message: string,\n path: (string | number)[] = []\n): ShareManifestClassificationResult => ({ ok: false, code, message, path });\n\n/** Read a credential's self-declared target id from either endorsement claim shape. */\nconst readSignedClaimId = (member: unknown): unknown => {\n if (member === null || typeof member !== 'object') return undefined;\n\n const record = member as Record<string, unknown>;\n const claim = record.credentialSubject ?? record.endorsement;\n if (claim === null || typeof claim !== 'object') return undefined;\n\n const claimRecord = claim as Record<string, unknown>;\n const nested = claimRecord.endorsement;\n const nestedId =\n nested !== null && typeof nested === 'object'\n ? (nested as Record<string, unknown>).id\n : undefined;\n\n return claimRecord.id ?? nestedId;\n};\n\n/**\n * Structurally classify every holder-signed VP member exactly once.\n *\n * This is *structural* validation only: it proves each member is either selected\n * or an endorsement of a selected member and that no member is smuggled. It does\n * not verify any cryptographic proof. Endorsement target binding here reads the\n * endorsement's own signed claim (`credentialSubject.id` / `endorsement.id`); it\n * is still not signature verification.\n */\nexport const classifyShareManifest = (\n payload: Pick<SharePayloadShape, 'presentation' | 'selection' | 'endorsements'>\n): ShareManifestClassificationResult => {\n const members = payload.presentation?.verifiableCredential;\n\n if (!Array.isArray(members) || members.length === 0) {\n return classificationFailure('NO_PRESENTATION_MEMBERS', 'presentation has no credentials');\n }\n if (members.length > MAX_VP_MEMBERS) {\n return classificationFailure(\n 'TOO_MANY_VP_MEMBERS',\n `presentation has ${members.length} members, over the ${MAX_VP_MEMBERS} bound`\n );\n }\n\n const selection = payload.selection;\n const endorsements = payload.endorsements ?? [];\n\n if (\n !Array.isArray(selection) ||\n selection.length < 1 ||\n selection.length > MAX_SELECTED_CREDENTIALS\n ) {\n return classificationFailure('BAD_SELECTION', 'selection must contain 1..50 entries');\n }\n if (!Array.isArray(endorsements) || endorsements.length > MAX_ENDORSEMENTS) {\n return classificationFailure(\n 'BAD_ENDORSEMENTS',\n 'endorsements must contain at most 200 entries'\n );\n }\n\n const selectedIndices: number[] = [];\n const selected = new Set<number>();\n\n for (let index = 0; index < selection.length; index += 1) {\n const entry = selection[index];\n const credentialIndex = entry?.credentialIndex;\n\n if (\n !Number.isSafeInteger(credentialIndex) ||\n credentialIndex < 0 ||\n credentialIndex >= members.length\n ) {\n return classificationFailure(\n 'SELECTION_INDEX_OUT_OF_BOUNDS',\n `selection[${index}].credentialIndex is out of bounds`,\n ['selection', index, 'credentialIndex']\n );\n }\n if (selected.has(credentialIndex)) {\n return classificationFailure(\n 'SELECTION_INDEX_DUPLICATE',\n `selection[${index}].credentialIndex is duplicated`,\n ['selection', index, 'credentialIndex']\n );\n }\n\n selected.add(credentialIndex);\n selectedIndices.push(credentialIndex);\n }\n\n const classified = new Set<number>(selected);\n const endorsementIndices: number[] = [];\n\n for (let index = 0; index < endorsements.length; index += 1) {\n const entry = endorsements[index];\n const credentialIndex = entry?.credentialIndex;\n const targetIndex = entry?.targetCredentialIndex;\n\n if (\n !Number.isSafeInteger(credentialIndex) ||\n credentialIndex < 0 ||\n credentialIndex >= members.length\n ) {\n return classificationFailure(\n 'ENDORSEMENT_INDEX_OUT_OF_BOUNDS',\n `endorsements[${index}].credentialIndex is out of bounds`,\n ['endorsements', index, 'credentialIndex']\n );\n }\n if (classified.has(credentialIndex)) {\n return classificationFailure(\n 'VP_MEMBER_CLASSIFIED_TWICE',\n `endorsements[${index}].credentialIndex was already classified`,\n ['endorsements', index, 'credentialIndex']\n );\n }\n if (!selected.has(targetIndex)) {\n return classificationFailure(\n 'ENDORSEMENT_TARGET_NOT_SELECTED',\n `endorsements[${index}].targetCredentialIndex must reference a selected credential`,\n ['endorsements', index, 'targetCredentialIndex']\n );\n }\n\n const referenced = readSignedClaimId(members[credentialIndex]);\n const target = members[targetIndex];\n const targetId: unknown =\n target !== null && typeof target === 'object'\n ? (target as Record<string, unknown>).id\n : undefined;\n\n if (\n typeof referenced !== 'string' ||\n typeof targetId !== 'string' ||\n referenced !== targetId\n ) {\n return classificationFailure(\n 'ENDORSEMENT_TARGET_UNBOUND',\n `endorsements[${index}] claim does not reference the target credential id`,\n ['endorsements', index]\n );\n }\n\n classified.add(credentialIndex);\n endorsementIndices.push(credentialIndex);\n }\n\n if (classified.size !== members.length) {\n return classificationFailure(\n 'UNCLASSIFIED_VP_MEMBER',\n 'every presentation member must be classified exactly once',\n ['presentation', 'verifiableCredential']\n );\n }\n\n return {\n ok: true,\n classification: { selectedIndices, endorsementIndices, memberCount: members.length },\n };\n};\n\n/**\n * Manifest validator. Beyond the strict shape it enforces the full structural\n * classification, so a parsed manifest is guaranteed to classify every VP member\n * exactly once with in-bounds indices and claim-bound endorsement targets.\n */\nexport const SharePayloadValidator = SharePayloadValidatorShape.superRefine((payload, ctx) => {\n const result = classifyShareManifest(payload);\n if (!result.ok) {\n ctx.addIssue({\n code: 'custom',\n message: result.message,\n path: result.path,\n params: { shareLinkCode: result.code },\n });\n }\n});\nexport type SharePayload = z.infer<typeof SharePayloadValidatorShape>;\n\n/** Ordered selected source reference. Source URIs live only in owner recovery. */\nexport const ShareRecoverySelectionValidator = z\n .object({\n ref: z.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS),\n order: z\n .number()\n .int()\n .min(0)\n .max(MAX_SELECTED_CREDENTIALS - 1),\n })\n .strict();\nexport type ShareRecoverySelection = z.infer<typeof ShareRecoverySelectionValidator>;\n\nexport const ShareRecoveryEndorsementValidator = z\n .object({ targetRef: z.string().min(1).max(MAX_SHARE_SOURCE_URI_CHARS) })\n .strict();\nexport type ShareRecoveryEndorsement = z.infer<typeof ShareRecoveryEndorsementValidator>;\n\nexport const ShareRecoveryPlaintextValidator = z\n .object({\n protocol: z.literal(SHARE_RECOVERY_PROTOCOL),\n shareId: ShareLinkIdValidator,\n ownerProfileId: z.string().min(1).max(128),\n createdAt: z.iso.datetime(),\n latest: z.object({ contentVersion: safeVersion, key: ShareContentKeyValidator }).strict(),\n selection: ShareRecoverySelectionValidator.array().min(1).max(MAX_SELECTED_CREDENTIALS),\n endorsements: ShareRecoveryEndorsementValidator.array().max(MAX_ENDORSEMENTS).default([]),\n })\n .strict()\n .superRefine((recovery, ctx) => {\n const orders = new Set<number>();\n\n recovery.selection.forEach((entry, index) => {\n if (entry.order >= recovery.selection.length) {\n ctx.addIssue({\n code: 'custom',\n message: 'order must be within the selection bounds',\n path: ['selection', index, 'order'],\n });\n }\n if (orders.has(entry.order)) {\n ctx.addIssue({\n code: 'custom',\n message: 'order must be unique within the selection',\n path: ['selection', index, 'order'],\n });\n }\n orders.add(entry.order);\n });\n });\nexport type ShareRecoveryPlaintext = z.infer<typeof ShareRecoveryPlaintextValidator>;\n\n/**\n * Owner-encrypted recovery JWE. The cap applies to the *serialized envelope*\n * (UTF-8 of the JWE), not to the plaintext index \u2014 see Task A2 review item 7.\n */\nexport const ShareOwnerRecoveryValidator = JWEValidator.refine(\n value => utf8ByteLength(JSON.stringify(value)) <= MAX_SHARE_RECOVERY_JWE_BYTES,\n { message: `serialized recovery JWE must be at most ${MAX_SHARE_RECOVERY_JWE_BYTES} bytes` }\n);\nexport type ShareOwnerRecovery = z.infer<typeof ShareOwnerRecoveryValidator>;\n\nexport const ShareLinkStatusValidator = z.enum(['pending', 'active', 'stopped']);\nexport type ShareLinkStatus = z.infer<typeof ShareLinkStatusValidator>;\n\nexport const ShareContentStateValidator = z.enum(['staging', 'finalized', 'content_missing']);\nexport type ShareContentState = z.infer<typeof ShareContentStateValidator>;\n\n/**\n * Owner-facing share metadata. Never returned to unauthenticated callers; the\n * public projection below omits age-policy and owner-private fields entirely.\n */\nexport const ShareLinkValidator = z.object({\n id: ShareLinkIdValidator,\n title: z.string().min(1).max(120),\n note: z.string().max(500).optional(),\n selectedCount: z.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),\n version: safeVersion,\n contentVersion: safeVersion,\n status: ShareLinkStatusValidator,\n contentState: ShareContentStateValidator,\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n expiresAt: z.iso.datetime().nullable(),\n stoppedAt: z.iso.datetime().nullable(),\n lastViewedAt: z.iso.datetime().nullable(),\n viewCount: z.number().int().min(0).optional(),\n passcodeProtected: z.boolean(),\n notifyOnView: z.boolean(),\n minorPolicy: z.object({\n isMinor: z.boolean().nullable(),\n policyResolved: z.boolean(),\n defaultExpiryDays: z.union([z.literal(30), z.literal(365)]),\n viewCountingEnabled: z.boolean(),\n }),\n /**\n * Guarded application/API URL for the content. Optional because owner APIs in\n * D1 have no public resolve/content endpoint yet; it must never be a\n * LearnCloud object URL or carry a fabricated decryption key.\n */\n contentUrl: z.string().optional(),\n});\nexport type ShareLink = z.infer<typeof ShareLinkValidator>;\n\nconst clientRequestId = z.string().uuid();\n\nexport const CreateShareLinkInputValidator = z\n .object({\n id: ShareLinkIdValidator,\n clientRequestId,\n title: z.string().min(1).max(120),\n note: z.string().max(500).optional(),\n expiresAt: z.iso.datetime().nullable().optional(),\n passcode: z.string().min(8).max(64).optional(),\n notifyOnView: z.boolean().default(false),\n selectedCount: z.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),\n contentVersion: z.literal(1),\n envelope: ShareEnvelopeValidator,\n ownerEncryptedRecovery: ShareOwnerRecoveryValidator,\n })\n .strict();\nexport type CreateShareLinkInput = z.infer<typeof CreateShareLinkInputValidator>;\n\n/**\n * Dependent fields: a content replacement supplies `contentVersion`,\n * `selectedCount`, `envelope` and `ownerEncryptedRecovery` together, or none of\n * them. A metadata-only update must not touch content.\n */\nexport const UpdateShareLinkInputValidator = z\n .object({\n id: ShareLinkIdValidator,\n expectedVersion: safeVersion,\n clientRequestId,\n title: z.string().min(1).max(120).optional(),\n note: z.string().max(500).nullable().optional(),\n expiresAt: z.iso.datetime().nullable().optional(),\n /** Omitted preserves the current passcode, null removes it, and a string replaces it. */\n passcode: z.string().min(8).max(64).nullable().optional(),\n notifyOnView: z.boolean().optional(),\n contentVersion: safeVersion.optional(),\n selectedCount: z.number().int().min(1).max(MAX_SELECTED_CREDENTIALS).optional(),\n envelope: ShareEnvelopeValidator.optional(),\n ownerEncryptedRecovery: ShareOwnerRecoveryValidator.optional(),\n })\n .strict()\n .superRefine((value, ctx) => {\n const provided = [\n value.contentVersion,\n value.selectedCount,\n value.envelope,\n value.ownerEncryptedRecovery,\n ].filter(field => field !== undefined).length;\n\n if (provided !== 0 && provided !== 4) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'content replacement requires contentVersion, selectedCount, envelope and ownerEncryptedRecovery together',\n });\n }\n });\nexport type UpdateShareLinkInput = z.infer<typeof UpdateShareLinkInputValidator>;\n\nexport const ShareLinkIdInputValidator = z.object({ id: ShareLinkIdValidator }).strict();\nexport type ShareLinkIdInput = z.infer<typeof ShareLinkIdInputValidator>;\n\n/**\n * Owner-scoped retry key. Only the opaque share id and the caller operation id\n * are accepted; the server re-derives every immutable binding (object ref,\n * generation, lease, hashes) from persisted Brain state under the owner's own\n * namespace. This is never a reservation descriptor.\n */\nexport const ShareLinkOperationKeyInputValidator = z\n .object({ id: ShareLinkIdValidator, operationId: z.string().uuid() })\n .strict();\nexport type ShareLinkOperationKeyInput = z.infer<typeof ShareLinkOperationKeyInputValidator>;\n\n/**\n * Sanitized owner mutation output. A pending result exposes only the retry key.\n *\n * `completed` means the request reached a recorded terminal outcome; the\n * authoritative share state (`share.status`, e.g. `stopped` after revoke) is\n * carried inside `share` and must never be overwritten by the outer tag.\n */\nexport const ShareLinkOwnerCommitOutputValidator = z.discriminatedUnion('status', [\n z.object({ status: z.literal('completed'), share: ShareLinkValidator }).strict(),\n z\n .object({\n status: z.literal('pending'),\n id: ShareLinkIdValidator,\n operationId: z.string().uuid(),\n })\n .strict(),\n]);\nexport type ShareLinkOwnerCommitOutput = z.infer<typeof ShareLinkOwnerCommitOutputValidator>;\n\n/**\n * Sanitized owner status output; never a raw coordinator record. `found` means a\n * share snapshot was returned and `share.status` is authoritative (active or\n * stopped); it does not itself assert the share is active.\n */\nexport const ShareLinkOwnerStatusOutputValidator = z.discriminatedUnion('status', [\n z.object({ status: z.literal('found'), share: ShareLinkValidator }).strict(),\n z\n .object({\n status: z.literal('pending'),\n id: ShareLinkIdValidator,\n operationId: z.string().uuid(),\n })\n .strict(),\n z.object({ status: z.literal('not_found'), id: ShareLinkIdValidator }).strict(),\n]);\nexport type ShareLinkOwnerStatusOutput = z.infer<typeof ShareLinkOwnerStatusOutputValidator>;\n\n/** Owner-only recovery response: the owner-encrypted JWE and nothing else. */\nexport const ShareLinkOwnerRecoveryOutputValidator = z\n .object({ recovery: ShareOwnerRecoveryValidator })\n .strict();\nexport type ShareLinkOwnerRecoveryOutput = z.infer<typeof ShareLinkOwnerRecoveryOutputValidator>;\n\n/** Authenticated owner-only ciphertext response; never includes a view receipt or storage refs. */\nexport const ShareLinkOwnerContentOutputValidator = z\n .object({\n id: ShareLinkIdValidator,\n contentVersion: safeVersion,\n envelope: ShareEnvelopeValidator,\n })\n .strict();\nexport type ShareLinkOwnerContentOutput = z.infer<typeof ShareLinkOwnerContentOutputValidator>;\n\nexport const ResolveShareLinkInputValidator = z\n .object({\n id: ShareLinkIdValidator,\n /** Sent only in a POST body; it must never be placed in a share URL. */\n passcode: z.string().min(4).max(64).optional(),\n })\n .strict();\nexport type ResolveShareLinkInput = z.infer<typeof ResolveShareLinkInputValidator>;\n\n/** Public state. No `isMinor`, `policyResolved`, thresholds or count policy. */\nexport const ShareLinkPublicStateValidator = z.discriminatedUnion('state', [\n z\n .object({\n state: z.literal('passcode_required'),\n id: ShareLinkIdValidator,\n })\n .strict(),\n z.object({ state: z.literal('try_later'), id: ShareLinkIdValidator }).strict(),\n z\n .object({\n state: z.literal('active'),\n id: ShareLinkIdValidator,\n title: z.string().max(120),\n note: z.string().max(500).optional(),\n selectedCount: z.number().int().min(1).max(MAX_SELECTED_CREDENTIALS),\n contentVersion: safeVersion,\n contentUrl: z.string(),\n sharer: z.object({\n displayName: z.string().max(120),\n avatar: z.string().max(2048).optional(),\n }),\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n expiresAt: z.iso.datetime().nullable(),\n })\n .strict(),\n z\n .object({\n state: z.literal('expired'),\n id: ShareLinkIdValidator,\n expiresAt: z.iso.datetime(),\n })\n .strict(),\n z\n .object({\n state: z.literal('stopped'),\n id: ShareLinkIdValidator,\n stoppedAt: z.iso.datetime(),\n })\n .strict(),\n z.object({ state: z.literal('not_found'), id: ShareLinkIdValidator }).strict(),\n]);\nexport type ShareLinkPublicState = z.infer<typeof ShareLinkPublicStateValidator>;\n\nexport const ListShareLinksInputValidator = z\n .object({\n limit: z.number().int().min(1).max(50).default(25),\n cursor: z.string().max(512).optional(),\n })\n .strict();\nexport type ListShareLinksInput = z.infer<typeof ListShareLinksInputValidator>;\n\nexport const PaginatedShareLinksValidator = PaginationResponseValidator.extend({\n records: ShareLinkValidator.array(),\n});\nexport type PaginatedShareLinks = z.infer<typeof PaginatedShareLinksValidator>;\n\nexport const AcknowledgeViewInputValidator = z\n .object({\n receipt: z\n .string()\n .min(22)\n .max(128)\n .regex(/^[A-Za-z0-9_-]+$/),\n })\n .strict();\nexport type AcknowledgeViewInput = z.infer<typeof AcknowledgeViewInputValidator>;\n\n/** Uniform response: never reveal eligibility or whether a receipt incremented a count. */\nexport const AcknowledgeViewOutputValidator = z.object({ ok: z.literal(true) }).strict();\nexport type AcknowledgeViewOutput = z.infer<typeof AcknowledgeViewOutputValidator>;\n\n/**\n * Fixed short TTL for a persisted view receipt. Acknowledgement binds the\n * receipt to one committed `(namespace, share, owner, contentVersion, object,\n * operation)` tuple; the node is pruned after this window (or once consumed).\n */\nexport const SHARE_VIEW_RECEIPT_TTL_SECONDS = 10 * 60;\n\n/**\n * Public content response. The envelope and `contentVersion` come from one\n * committed tuple; no object ref, hash, operation id, owner recovery, owner id\n * or policy field is ever returned. `receipt` is ALWAYS present with identical\n * shape/entropy whether or not the owner is eligible for counting: ineligible,\n * unknown, managed, minor or dependency-failure responses carry a CSPRNG\n * padding value that is never persisted, so the response is not an eligibility\n * oracle.\n */\nexport const ShareLinkPublicContentViewValidator = z\n .object({\n id: ShareLinkIdValidator,\n contentVersion: safeVersion,\n envelope: ShareEnvelopeValidator,\n contentUrl: z.string(),\n receipt: z\n .string()\n .min(22)\n .max(128)\n .regex(/^[A-Za-z0-9_-]+$/),\n })\n .strict();\nexport type ShareLinkPublicContentView = z.infer<typeof ShareLinkPublicContentViewValidator>;\n"],
5
+ "mappings": ";;;;AAAA,SAAS,SAAS;AAEX,IAAM,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAG7E,IAAM,+BAA+B,EAAE,OAAO;AAAA,EACjD,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,WAAW,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAGM,IAAM,iBAAiB,EAAE,OAAO,EAAE;AAAA,EACrC,EAAE,OAAO;AAAA,IACL,IAAI,EAAE,OAAO;AAAA,IACb,MAAM,EAAE,OAAO;AAAA,IACf,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,CAAC;AACL;AAGO,IAAM,0BAA0B,EAAE,OAA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