/** Deterministic, signed route manifest: contract × assurance × capabilities × classification. */ import type { AssuranceReport } from "./assurance.js"; import type { CapabilityAssuranceReport } from "./capabilities.js"; import { type ResponseClassification } from "./classification.js"; import { type DiffSeverity, type RouteChange, type RouteSnapshotSchema } from "./diff.js"; import type { ProjectEvidenceSnapshot } from "./evidence.js"; export interface NifraManifestAssurance { readonly rule?: string; readonly evidence: readonly { readonly id: string; readonly source: string; }[]; } export interface NifraManifestCapabilities { readonly declared: readonly string[]; readonly evidenced: readonly string[]; readonly unproven: readonly string[]; readonly covered: boolean; } export interface NifraManifestRoute { readonly method: string; readonly path: string; readonly schema?: RouteSnapshotSchema; readonly assurance?: NifraManifestAssurance; readonly capabilities?: NifraManifestCapabilities; readonly classification?: ResponseClassification; } export interface NifraManifest { readonly manifestVersion: 1; readonly routes: readonly NifraManifestRoute[]; /** SHA-256 hex of the canonical manifest body (`manifestVersion` + `routes`). */ readonly contentHash: string; } export interface NifraManifestSigner { readonly algorithm: "Ed25519"; readonly keyId: string; sign(payload: Uint8Array): ArrayBuffer | Uint8Array | Promise; } export interface NifraManifestSignature { readonly nifraManifestSignature: 1; readonly algorithm: "Ed25519"; readonly keyId: string; readonly contentHash: string; /** Base64url Ed25519 signature over the canonical manifest body. */ readonly signature: string; } export interface BuildNifraManifestInput { /** Runtime route source, retained for compatibility with callers that have not built a snapshot. */ readonly source?: unknown; /** Canonical offline evidence; when supplied, no second route reflection is performed. */ readonly evidence?: ProjectEvidenceSnapshot; readonly assurance?: AssuranceReport; readonly capabilities?: CapabilityAssuranceReport; } /** Canonical bytes are stable across runtime, object-key order, and route registration order. */ export declare function canonicalManifest(manifest: Pick): string; /** Byte-stable artifact serialization (including `contentHash`). */ export declare function serializeNifraManifest(manifest: NifraManifest): string; /** Byte-stable serialization for the detached signature sidecar. */ export declare function serializeNifraManifestSignature(signature: NifraManifestSignature): string; /** Parse the detached sidecar before selecting its operator-controlled public key. */ export declare function parseNifraManifestSignature(content: string, source?: string): NifraManifestSignature; /** Build one fail-closed, deterministic manifest from already-evaluated assurance reports. */ export declare function buildNifraManifest(input: BuildNifraManifestInput): Promise; /** Sign without handling private keys: the operator-supplied signer may call KMS/HSM/local WebCrypto. */ export declare function signNifraManifest(manifest: NifraManifest, signer: NifraManifestSigner): Promise; /** Verify the hash first, then the detached Ed25519 signature. Malformed/tampered input returns false. */ export declare function verifyNifraManifestSignature(manifest: NifraManifest, signature: NifraManifestSignature, publicKey: CryptoKey): Promise; /** Parse and hash-verify an emitted manifest before it is trusted by diff/codegen tooling. */ export declare function parseNifraManifest(content: string, source?: string): Promise; export interface NifraManifestChange { readonly severity: DiffSeverity; readonly method: string; readonly path: string; readonly section: RouteChange["section"] | "assurance" | "capabilities" | "classification"; readonly field?: string; readonly message: string; } export interface NifraManifestDiff { readonly changes: readonly NifraManifestChange[]; readonly hasBreaking: boolean; } /** Contract changes reuse the route-diff engine; governance changes fail closed on expanded risk. */ export declare function diffNifraManifests(before: NifraManifest, after: NifraManifest): NifraManifestDiff; //# sourceMappingURL=manifest.d.ts.map