/** * JSON Schema utilities for tool parameter definitions. * * Provides helpers for extracting and normalizing JSON Schema from tool * parameters, including provider-specific cleaning (e.g., Gemini). * * Reimplemented from OpenClaw's schema handling. * Original source: openclaw/src/agents/pi-tool-definition-adapter.ts (MIT license) * * @module */ import type { Tool } from "../types.js"; /** * Extract a JSON Schema tool definition suitable for sending to an LLM. * * @param tool - The tool to extract schema from. * @returns An object with name, description, and input_schema. */ export declare function extractToolSchema(tool: Tool): { name: string; description: string; input_schema: Record; }; /** * Normalize a parameter schema to ensure it's a valid JSON Schema object type. * * Ensures the root is always `type: "object"` with `properties`. */ export declare function normalizeSchema(schema: unknown): Record; /** * Clean a JSON Schema for Gemini compatibility by stripping unsupported keywords. * * @param schema - The schema to clean. * @returns A new schema with unsupported keywords removed. */ export declare function cleanSchemaForGemini(schema: Record): Record; /** * Extract tool schemas from an array of tools, ready for LLM submission. * * @param tools - Array of tools. * @param providerOrApi - Optional provider name **or** API transport string for * provider-specific schema cleaning. Accepts either `connector.provider` * (e.g. `"google"`) or `connector.api` (e.g. `"google-generative-ai"`, * `"google-gemini-cli"`, `"google-vertex"`). When either matches a known Google transport, Gemini- * incompatible JSON Schema keywords are stripped from the schemas. * @returns Array of tool schema objects. */ export declare function extractToolSchemas(tools: Tool[], providerOrApi?: string): Array<{ name: string; description: string; input_schema: Record; }>; //# sourceMappingURL=schema.d.ts.map