import { type Hex } from 'viem'; import type { BuildDescriptorInput, ContentCommitment, ContentDescriptor, DelegatingSigner, DelegatedAuthorityVerifier, SignatureVerifier } from './types.js'; /** * The frozen Phase-1 normalization profile id (spec 266 §7). Rules of * `canonical-text-v1`: NFC; trim leading/trailing whitespace; collapse internal * whitespace runs to a single space; text body only (verse numbers, labels, * footnotes, headings, cross-refs, formatting are excluded by the caller before * commitment); digest SHA-256 over UTF-8. Bump the version to change any rule. */ export declare const NORMALIZATION_V1 = "ap:normalization:canonical-text-v1"; /** Apply the canonical-text-v1 normalization to a rendering body. */ export declare function canonicalizeRendering(text: string): string; /** * Structured commitment to an off-platform rendering (spec 266 §7): * SHA-256 of the canonical-text-v1-normalized body. SHA-256 (not keccak) keeps * the content commitment portable/standard; it is verified off-chain and never * stored on-chain (ADR-0033 R3). Binds a descriptor to a rendering WITHOUT * revealing it. */ export declare function contentCommitment(text: string): ContentCommitment; /** True iff `text` canonicalizes+hashes to the commitment value. */ export declare function verifyCommitment(text: string, commitment: ContentCommitment): boolean; /** Throwing variant of {@link verifyCommitment}. */ export declare function assertCommitment(text: string, commitment: ContentCommitment): void; /** * Deterministic, domain-separated hash of the unsigned descriptor — both its * cryptographic identity (ContentDescriptorId) AND the ERC-1271 signing * preimage. `keccak256("ap:content-descriptor:v1\0" || JCS(unsigned))`. The * domain separator keeps it from ever colliding with a canonical-locus id. */ export declare function descriptorHash(d: BuildDescriptorInput): Hex; /** * Build a signed {@link ContentDescriptor}. `sign` signs {@link descriptorHash} — either as the issuer's * own Smart Agent (ERC-1271), or, when `delegatingSigner` is given, as the issuer-AUTHORIZED operational * key (e.g. Cloud KMS). The attached `delegatingSigner` lets a verifier root trust in the issuer SA while * the day-to-day signing key is delegated/rotatable (no issuer custodian key held). */ export declare function buildContentDescriptor(input: BuildDescriptorInput, sign: (hash: Hex) => Promise | Hex, delegatingSigner?: DelegatingSigner): Promise; export interface VerifyDescriptorOpts { /** Verifies an ERC-1271/ECDSA signature by a signer (injected; ADR-0006). */ verifySignature: SignatureVerifier; /** Verifies an issuer→delegate authorization leaf — REQUIRED when the descriptor carries * `delegatingSigner` (else delegate-signed descriptors fail closed). Injected (ADR-0006). */ verifyDelegatedAuthority?: DelegatedAuthorityVerifier; /** Required when proofPolicy is `merkle-membership-v1`. */ corpusRoot?: Hex; inclusionProof?: Hex[]; /** Current time (seconds) for validity/status checks; defaults to now. */ nowSeconds?: number; } /** Result of {@link verifyContentDescriptor} — an auditable VerificationResult. */ export interface VerificationResult { ok: boolean; reason?: string; signatureVerified: boolean; statusOk: boolean; withinValidity: boolean; inclusionVerified?: boolean; } /** * Verify a descriptor fail-closed (spec 266 §7): status must be `active`, the * validity window must contain `now`, the issuer ERC-1271 signature over the * canonical descriptor hash must verify, and — for `merkle-membership-v1` — the * commitment must prove under `corpusRoot`. Reserved proof policies are rejected. */ export declare function verifyContentDescriptor(d: ContentDescriptor, opts: VerifyDescriptorOpts): Promise; //# sourceMappingURL=descriptor.d.ts.map