/** * sanitizeSchemaForStrictMode — strip JSON Schema constraints rejected by * oMLX json_schema strict mode. * * Known-rejected constraints (Run C, eval-adversarial.mjs): * - `pattern` on string fields → strict-mode schema rejection * - `format: "email"` → same * - `format: "uri"` → same * * Conservatively stripped (untested regime per Unknown #3): * - `format: "date-time"` — assume risky until tested * - `multipleOf` on numbers — untested; strip proactively * * Hard reject (cannot resolve): * - `$ref` anywhere in the schema → returns { ok: false, reason: 'ref-detected' } * * Callers receive a `stripped` list of JSON Pointer paths to each removed * constraint. The extract tool surfaces these via * `_meta[dev.localmcptoolbelt/schema_stripped]` so callers can re-validate * using their original Zod schema on the bridge's output. * * Unit tests: tests/unit/sanitize.test.ts */ /** Minimal JSON Schema node type used internally. */ type JsonSchemaNode = Record; export type SanitizeResult = { ok: true; schema: JsonSchemaNode; stripped: string[]; } | { ok: false; reason: 'ref-detected'; path: string; }; /** * Walk a JSON Schema object and strip constraints known or assumed to be * rejected by oMLX json_schema strict mode. Mutates a deep clone; does not modify the input. * * @param schema The JSON Schema object (e.g. from z.toJSONSchema()). * @returns SanitizeResult — ok=true with sanitized schema and stripped * paths, or ok=false if a `$ref` was encountered. */ export declare function sanitizeSchemaForStrictMode(schema: unknown): SanitizeResult; export {}; //# sourceMappingURL=sanitize.d.ts.map