import { z, ZodTypeAny, ZodRawShape } from 'zod'; import { CallToolResultSchema } from './CallToolResultSchema'; type Primitive = string | number | boolean | bigint | null | undefined; type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { [K in keyof T]: Flatten; } : T; type Infer = Flatten>; export type CallToolResult = Infer; export type ESTool = { name: string; params: { description: string; inputSchema: ZodRawShape; outputSchema?: ZodRawShape; }; func: (args: any) => Promise; }; /** * MCP工具类型 */ export type MCPToolParams = { inputSchema: { [x: string]: unknown; type: "object"; properties?: Record | undefined; required?: string[] | undefined; }; name: string; description?: string | undefined; outputSchema?: { [x: string]: unknown; type: "object"; properties?: Record | undefined; required?: string[] | undefined; } | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; destructiveHint?: boolean | undefined; idempotentHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; execution?: { taskSupport?: "optional" | "required" | "forbidden" | undefined; } | undefined; _meta?: Record | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }; export interface ToolCallParams { name: string; arguments: Record; } export {};