/**
 * Inline JSON-Schema validator for the MCP schema-conformance matchers.
 *
 * The schema matchers (`tool-input-schema` / `tool-output-schema`) validate a
 * recorded tool call's input/output against a supplied JSON Schema. Unlike the
 * value-equality matchers (`tool-input-matches` / `tool-output-matches`), which
 * compare exact key/value pairs, these answer a shape/type question ("is
 * `query` a string?", "is the result a non-empty array?") with a real JSON
 * Schema validator rather than a homegrown key-comparison loop (D0079).
 *
 * ## Why the validator is compiled to an inlined string
 *
 * Promptfoo runs a multiline `javascript` assertion via
 * `new Function("output", "context", "process", body)` — a sandbox with no
 * module scope and no `require` (see the bridge in `./assertions.ts`). So the
 * validator can't `import` Ajv at assertion-run time; it has to BE part of the
 * generated body. Ajv's standalone code generation is built for exactly this:
 * it compiles a (compile-time-known) schema into a self-contained validate
 * function as JS source. We wrap that source with a `module`/`require` shim so
 * it runs verbatim, supply the two tiny Ajv runtime helpers it can reference
 * (`ucs2length` for string length, deep-equal for `uniqueItems`/object-valued
 * `enum`/`const`), and base64-encode the whole factory.
 *
 * ## Why base64
 *
 * Promptfoo nunjucks-renders the assertion value before executing it, so the
 * body must contain none of `{{`, `}}`, `{%`, `%}`, `{#` (the bridge test
 * enforces this). Ajv's generated code is dense and routinely contains `}}`
 * (nested closing braces), which nunjucks would mangle. Base64 keeps the
 * varying, codegen-produced part to the base64 alphabet, which has no nunjucks
 * delimiters; the surrounding hand-written body stays delimiter-free by
 * construction.
 */
/**
 * Compile a JSON Schema into a base64-encoded validator factory.
 *
 * The decoded factory is a function body that returns Ajv's standalone
 * `validate` function (with `.errors` populated on failure). The caller embeds
 * the base64 string in an assertion body and instantiates it at runtime via
 * `new Function(atob(<base64>))()` — see {@link inlineSchemaValidator}.
 *
 * Throws (at compile time, surfaced as a task warning) when the schema is
 * invalid or uses a feature that would need an unsupported Ajv runtime
 * dependency — failing loud beats emitting an assertion that can't run.
 */
export declare function compileSchemaValidatorFactory(schema: unknown, errorLabel: string): string;
/**
 * JS snippet that decodes a base64 validator factory and instantiates it into
 * a local `validate` function. Pairs with {@link compileSchemaValidatorFactory}.
 *
 * Emitted into an assertion body; assumes the `new Function(output, context,
 * process)` sandbox promptfoo uses. `atob` is a Node global (16+); the `Buffer`
 * branch is a defensive fallback. The decoded factory contains no nunjucks
 * delimiters (it's base64), so this is rendering-safe.
 */
export declare function inlineSchemaValidator(base64Factory: string): string;
/**
 * JS snippet defining `formatSchemaErrors(errors)` — turns Ajv's error array
 * into a compact human-readable string for an assertion `reason`. Defined once
 * per assertion body. Delimiter-free by construction.
 */
export declare function schemaErrorFormatterSource(): string;
