/** * The schema shape every wire namzu speaks reads the same way. * * `dialect.ts` solves the problem one wire at a time: render draft-07, and let * each driver say it again in the dialect it knows its endpoint parses. That * works only where a driver HAS a measurement. Of the ten driver packages, * three convert; the other seven forward the rendering verbatim, because * nobody had measured their wires. * * One of those seven then got measured, the hard way. Its gateway validates a * tool's `parameters` against the JSON Schema 2020-12 metaschema, and `read`'s * `readRange` — the only `z.tuple(...)` in the first-party tool surface — * renders draft-07 as `items: [a, b]`: * * [400] Tool 4 function has invalid 'parameters' schema: * [{'minimum': 1, 'type': 'integer'}, {'minimum': 1, 'type': 'integer'}] * is not of type 'object', 'boolean' * * The lesson is not "convert in five more drivers". Wiring each driver to a * dialect requires a measurement per wire, and the two hardest to measure are * precisely the ones nobody can measure on a user's behalf: the driver whose * schema field the vendor documents nowhere, and every compatible endpoint a * user points the generic HTTP driver at. * * So the kernel emits the INTERSECTION instead: the subset of JSON Schema that * is valid, and means the same thing, in draft-07 and in 2020-12 alike. A * schema in that subset needs no conversion anywhere, which is why this runs at * the rendering boundary rather than at ten driver boundaries. * * `toSchemaDialect` is not replaced by this and does not become dead: a driver * can still be handed a `parameters` object namzu never rendered (a host * passing `ChatCompletionParams` straight in), and converting at the boundary * remains the right answer there. */ export interface PortableSchemaViolation { /** Dotted path to the offending keyword, e.g. `properties.readRange.items`. */ readonly path: string; readonly keyword: string; /** What to write instead. */ readonly remedy: string; } /** * Every place a schema leaves the intersection, with its exact path. * * Exported so a test can sweep every shipped tool and a driver can assert * rather than hope. The path is the point: the vendor's error names the tool * index and the offending fragment but never where inside the schema it sits. */ export declare function findPortableSchemaViolations(schema: unknown, path?: string): PortableSchemaViolation[]; /** * Rewrite what can be rewritten, so a tuple cannot reach a wire. * * Only the tuple spellings and `$schema` are rewritten. The rest of the * deny-list is reported and not repaired on purpose: inlining a `$ref` or * choosing which member of a `type` list the author meant is a guess about * intent, and a guess that silently changes what a tool accepts is worse than * the 400 it avoids. Those are caught by the profile test at the source. * * Returns the input unchanged — the SAME reference — when nothing needs * rewriting, which is the overwhelming common case. The tools block sits at * position 0 of the prompt-cache prefix, so a fresh, equal object per request * would invalidate the cache for the whole turn. */ export declare function toPortableToolSchema(json: Record): Record; //# sourceMappingURL=portable.d.ts.map