import type { ToolResultOutput } from '@ai-sdk/provider-utils'; import type { z } from 'zod'; export type ToolParameterValue = string | { [key: string]: ToolParameterValue; } | ToolParameterValue[]; export type ToolParameter = { name: string; description: string; required: boolean; usageValue?: string; allowMultiple?: boolean; children?: ToolParameter[]; }; export type ToolInfo = { name: string; description: string; parameters: z.ZodObject; }; export type FullToolInfo = ToolInfo & { handler: ToolHandler; }; export type ToolResponseResult = ToolResultOutput; export type ToolResponseResultContentPart = Extract['value'][number]; export type ToolResponseResultMedia = Extract; export type ToolResponse = { success: boolean; message: ToolResponseResult; }; export type ToolHandler<_T, P> = (provider: P, args: Partial>) => Promise;