/** * Wire 0.2 Extension Validation (envelope-level superRefine helper) * * Validates the extensions record inside Wire02ClaimsSchema.superRefine(): * 1. Extension key grammar validation * 2. Recursive plain-JSON-value guard (rejects non-JSON-safe values) * 3. Known extension group schema validation * 4. Byte-budget enforcement * * NORMATIVE: Extension group values MUST be plain JSON values all the * way down (objects, arrays, strings, finite numbers, booleans, null). * Arbitrary JavaScript objects (functions, Symbols, Dates, BigInt, * objects with toJSON(), circular references, non-finite numbers, etc.) * are not a supported input class and are rejected at the validation * boundary via E_EXTENSION_NON_JSON_VALUE. This ensures cross-language * portability and reproducible byte-budget measurement. * * MEASUREMENT BASIS: Byte budgets are measured as the UTF-8 byte length * of ECMAScript JSON.stringify() output on plain JSON data. This is * explicitly ECMAScript-defined, not language-neutral canonical JSON. * Equivalent objects with different member order can yield different * byte counts; if cross-language reproducibility is needed in the * future, a canonical JSON profile (e.g., JCS / RFC 8785) can be * adopted via a future DD without changing the budget constants. * See EXTENSION_BUDGET in @peac/kernel for the full specification. * * Schema does NOT emit warnings (unknown_extension_preserved belongs * in @peac/protocol.verifyLocal(), Layer 3). * * Layer 1 (@peac/schema): pure Zod validation, zero I/O. */ import { z } from 'zod'; /** * Check whether a value is a plain JSON value all the way down. * * This is the public entry point for the recursive guard. It initializes * the depth counter and circular-reference detection set. * * @param value - Value to check * @returns true if the entire value tree is plain JSON */ declare function isPlainJsonValue(value: unknown): boolean; /** * Validate extensions record in Wire02ClaimsSchema.superRefine(). * * Steps: * 1. Validate extension key grammar * 2. Recursive guard: reject non-plain-JSON values (E_EXTENSION_NON_JSON_VALUE) * 3. Validate known extension groups against their Zod schemas * 4. Unconditional byte-budget enforcement * * @param extensions - The extensions record from Wire 0.2 claims * @param ctx - Zod refinement context */ export declare function validateKnownExtensions(extensions: Record | undefined, ctx: z.RefinementCtx): void; export { isPlainJsonValue as _isPlainJsonValue }; //# sourceMappingURL=validation.d.ts.map