/** * The dialect a wire speaks, and how to say the same schema in it. * * A tool has one Zod schema. What changes between providers is not the tool — * it is the JSON Schema dialect the wire parses, which is a property of the * wire. So the shape is rendered once, canonically, and each driver converts * at the boundary where it knows which wire it is about to talk to. * * This exists because that layering was missing and it cost a production * outage. `renderToolSchema` emits draft-07 (zod-to-json-schema's * `jsonSchema7` target), every driver forwarded it verbatim, and one of the * wires namzu speaks requires draft 2020-12. Measured against that live * endpoint: * * | tool schema | result | * |--------------------------------|-----------------------------------------| * | `items: [a, b]` (draft-07) | 400 — "must match JSON Schema draft 2020-12" | * | `prefixItems: [a, b]` (2020-12)| accepted | * | `items: { a }` | accepted | * * The failure is NOT about strict tool use. It fires with strict validation * unset, and with it on the dialect error arrives *before* the strict-subset * error — so a guard scoped to strict misses it entirely. One was, and did. * * Which wires want which dialect is the drivers' knowledge, not this file's: * the vocabulary lives beside the wire that speaks it, and only the mechanism * lives here. * * Only the conversions namzu can actually emit are implemented. The renderer * runs with `$refStrategy: 'none'`, so there are no `$ref`/`definitions` to * rewrite; a construct that cannot appear is not worth code that cannot be * tested. */ /** Which spelling of JSON Schema a wire accepts. */ export type JsonSchemaDialect = 'draft-07' | '2020-12'; /** * Say this schema in the dialect the wire parses. * * Returns the input unchanged — same reference — when nothing needs saying * differently, so the common case costs one map lookup and no allocation. */ export declare function toSchemaDialect(schema: Record, dialect: JsonSchemaDialect): Record; /** * Whether a schema still carries a construct the 2020-12 wire refuses. * * Exported so a test can sweep every shipped tool without reaching into the * conversion, and so a driver can assert rather than hope. */ export declare function findDraft07Only(schema: unknown, path?: string): string[]; //# sourceMappingURL=dialect.d.ts.map