import { Tool } from 'ai'; import { z } from 'zod/v4'; /** * Parse error from various types */ export declare const parseError: (error: Error | string | object) => any; /** * Filter Zod schema properties using path-based filtering. * Keeps properties in the keep list, all their descendants, and the path to reach them. * * Algorithm: * - If property name is in keep list → keep it entirely (with all descendants) * - If property is a container → check if it contains kept properties * - If yes → keep container and recurse * - If no → remove it * * @param schema - The Zod schema to filter * @param propertiesToKeep - Array of property names to keep (with all their descendants) * @returns A new filtered Zod schema */ export declare const filterSchemaProperties: (schema: z.ZodTypeAny, propertiesToKeep: string[]) => z.ZodTypeAny; /** * Exclude specified properties from a Zod schema. * Removes properties in the exclude list and all their descendants. * * Algorithm: * - If property name is in exclude list → remove entirely (with all descendants) * - Otherwise → keep and recurse to handle nested exclusions * * @param schema - The Zod schema to process * @param propertiesToExclude - Array of property names to remove (with all their descendants) * @returns A new filtered Zod schema */ export declare const excludeSchemaProperties: (schema: z.ZodTypeAny, propertiesToExclude: string[]) => z.ZodTypeAny; /** * Convert a Zod schema to a readable type string representation. */ export declare const zodToReadableType: (schema: z.ZodTypeAny, depth?: number, propName?: string, isOptional?: boolean) => string; /** * Create a decoupled zodFunction that wraps Zod schemas for AI SDK tools. * * This is a pure function that does NOT depend on stores or session management. * It only wraps the schema and delegates to the provided function with a generic context. */ export declare function zodFunction>({ function: fn, schema, description, name, strict, }: { function: (args: T, context: TContext) => Promise; schema: z.ZodType; description?: string; name?: string; strict?: boolean; }): { name: string; tool: Tool; }; export type ActionParseResult = { success: true; data: z.infer; } | { success: false; error: z.ZodError>; }; /** * Validates a tool action with pre-parse guards and the discriminated union. * Use this at execution time — tool inputSchema must stay a plain union so the * AI SDK can convert it to JSON Schema (z.custom() cannot). */ export declare function parseActionWithGuards(actionSchema: T, input: unknown, toolName: 'buildChart' | 'buildDashboard'): ActionParseResult; export declare function createActionDiscriminatorError(toolName: string): z.core.$ZodErrorMap;