/** * Shared opaque-reference schema for v0.14.1 observational extensions * (a2a-handoff, cli-execution, lifecycle-observation). * * Generalizes the single-prefix precedent established by ReceiptRefSchema * (sha256:<64 hex>) and CredentialRefSchema ((sha256|hmac-sha256):<64 hex>) * into a multi-prefix grammar that uniformly rejects email shapes, raw human * names in any language, numeric strings, inline JSON, and free text without * language-specific or numeric-specific heuristics. * * Grammar (binding): * - String, max UTF-8 byte length 256 by default (per call site). * - MUST NOT contain whitespace. * - MUST NOT contain `@` (rejects email shapes). * - MUST NOT start with JSON-structural characters: `{` `[` `"`. * - MUST start with one of the recognized reference prefixes: * `ref:` `urn:` `did:` `sha256:` `peac:` `https://` * - When the value starts with `sha256:`, the suffix MUST be exactly * 64 lowercase hex characters (matches the canonical PEAC digest grammar * in `wire-02-extensions/shared-validators.ts`). * - When the value starts with `https://`, the URL MUST contain at least * one additional non-whitespace character after the scheme. * * Byte-length enforcement uses UTF-8 byte length (TextEncoder) rather than * JavaScript string length (which counts UTF-16 code units), so multi-byte * payloads are correctly bounded. */ import { z } from 'zod'; export declare const OPAQUE_REF_PREFIXES: readonly ["ref:", "urn:", "did:", "sha256:", "peac:", "https://"]; export interface OpaqueRefSchemaOptions { maxBytes?: number; /** Stable diagnostic code attached to every refinement message. */ errorCode?: string; } /** * Construct an opaque-reference Zod schema with grammar enforcement. * Default max is 256 UTF-8 bytes; pass `maxBytes` to override per call site. * Pass `errorCode` to attach a stable code (e.g. `lifecycle.opaque_ref_grammar_violation`) * to every rejection message; downstream validators map this to their own * structured error reporting. */ export declare function createOpaqueRefSchema(options?: OpaqueRefSchemaOptions): z.ZodString; export declare const OpaqueRefSchema: z.ZodString; export type OpaqueRef = z.infer; //# sourceMappingURL=opaque-ref.d.ts.map