/** * Canonical payload digests for the durable application primitives (WFT-84). * * Idempotency binds a retry to `(caller, target, kind, payloadDigest)`, so the * digest has to be stable for values that are logically equal but built in a * different order. Object key insertion order, `Map` entry order, and `Set` * member order all change MessagePack bytes without changing meaning, so this * module canonicalizes those orderings first and only then hands the value to * Weft's structured-clone codec. * * Digesting the codec's own output — rather than a hand-rolled JSON walk — is * deliberate: `Uint8Array`, `Date`, `Map`, and `Set` keep their identity, so an * opaque multimodal or managed-asset reference contributes its real bytes to the * digest instead of being coerced to text. * * @module core/application-payload-digest */ import { WeftError } from './weft-error.ts'; /** * Thrown when a value cannot be canonicalized into a stable digest — a cycle, a * type the structured-clone codec cannot carry, or nesting past the depth * ceiling. * * Internal by design: callers see it re-thrown as the public * `ApplicationCommandValidationError` with this error as `cause`, so the public * error union stays small while the specific reason survives. */ export declare class PayloadDigestError extends WeftError<'PayloadDigestError'> { constructor(message: string); } /** * SHA-256 the canonical encoding of an arbitrary structured-clone value. * * @throws {PayloadDigestError} When the value cycles, nests too deeply, or holds * a type the structured-clone codec cannot carry. */ export declare function computePayloadDigest(value: unknown): Promise; /** * SHA-256 a list of opaque identity components, length-prefixed so no component * boundary can be forged by embedding a separator. */ export declare function computeIdentityDigest(components: readonly string[]): Promise;