/** * copy and modify from copilotkit * https://github.com/copilotkit/copilotkit * * MIT License */ import { z, ZodRawShape } from "zod"; import { Parameter } from "./copilotkit-actions.js"; export type JSONSchemaString = { type: "string"; description?: string; enum?: string[]; }; export type JSONSchemaNumber = { type: "number"; description?: string; }; export type JSONSchemaBoolean = { type: "boolean"; description?: string; }; export type JSONSchemaObject = { type: "object"; properties?: Record; required?: string[]; description?: string; }; export type JSONSchemaArray = { type: "array"; items: JSONSchema; description?: string; }; export type JSONSchema = JSONSchemaString | JSONSchemaNumber | JSONSchemaBoolean | JSONSchemaObject | JSONSchemaArray; export declare function actionParametersToJsonSchema(actionParameters: Parameter[]): JSONSchema; export declare function convertJsonSchemaToZodRawShape(jsonSchema: any): ZodRawShape; export declare function convertJsonSchemaToZodSchema(jsonSchema: any, required: boolean): z.ZodSchema;