/** * Compute the wire (JSON Schema) representation of a tool's parameters. * * Tools may author parameters as ArkType schemas or legacy TypeBox / plain JSON * Schema documents. Both are normalized at the boundary so providers and * validators see the same JSON Schema dialect. */ import type { Type } from "@oh-my-pi/omptype"; import type { Tool } from "../../types.js"; /** * True when `value` is a live ArkType schema instance. * * ArkType schemas are callable functions carrying `toJsonSchema`/`assert` * methods, while raw JSON Schema is a plain object. */ export declare function isArkSchema(value: unknown): value is Type; /** * Normalize `{}` (an unconstrained schema) to boolean `true` in every * schema-valued position. JSON Schema draft 2020-12 ยง4.3.1 defines them as * semantically equivalent. Grammar-constrained samplers often treat the object * form as "generate an empty object" rather than "any JSON value". * * Mutates in place and applies to every tool wire schema. */ export declare function normalizeEmptySchemas(node: unknown): void; /** * Convert an ArkType schema into the JSON Schema shape providers consume. */ export declare function arkToWireSchema(schema: Type): Record; /** * Resolve a tool's parameters to a JSON Schema object suitable for sending * over the wire. ArkType schemas are converted and cached; legacy TypeBox / * raw JSON Schema parameters are upgraded to draft 2020-12 and cached. */ export declare function toolWireSchema(tool: Tool): Record; /** * Return a deep clone of `schema` with every `description` annotation removed. * The result is memoized on the input via a non-enumerable symbol (`stamp`) so * repeated provider requests reuse the same stripped object; the input is never * mutated, so the stamped `toolWireSchema` cache stays intact for * system-prompt/UI rendering. */ export declare function stripSchemaDescriptions(schema: Record): Record; /** * Strip a tool's human-readable text from its provider-bound spec: empties the * top-level `description` and removes nested schema `description` annotations. * Used when the full tool catalog is rendered into the system prompt instead, so * the descriptions ride the wire once (in the prompt) rather than duplicated on * every tool definition. Parameters are resolved to wire JSON Schema and cloned, * leaving the original tool objects and the stamped schema cache untouched. */ export declare function stripToolDescriptions(tools: readonly Tool[]): Tool[];