/** Result type from Standard Schema validation. */ type StandardResult = { readonly value: Output; readonly issues?: undefined; } | { readonly issues: ReadonlyArray<{ readonly message: string; }>; }; /** * Standard Schema V1 interface. * * Implemented by Zod v4, Valibot, ArkType, and others. * Defined inline to avoid a runtime dependency on `@standard-schema/spec`. */ export interface StandardSchemaV1 { readonly "~standard": { readonly version: 1; readonly vendor: string; readonly validate: (value: unknown) => StandardResult | Promise>; readonly types?: { readonly input: Input; readonly output: Output; } | undefined; }; } /** Extract the output type from a Standard Schema. */ export type InferOutput = T extends StandardSchemaV1 ? O : never; /** Check whether a value implements the Standard Schema V1 protocol. */ export declare function isStandardSchema(value: unknown): value is StandardSchemaV1; /** Tag for schemas created by jsonSchema(). */ declare const JSON_SCHEMA_TAG = "__jsonSchema"; /** A Standard Schema wrapper around raw JSON Schema. */ export type JsonSchemaWrapper = StandardSchemaV1 & { readonly [JSON_SCHEMA_TAG]: Record; }; /** * Wrap a raw JSON Schema object so it can be passed as `output_schema` * in `call()` — flows through the same overload as Zod / Valibot schemas. * * @example * ```typescript * const result = await client.call("fn", { * output_schema: jsonSchema<{ name: string }>({ type: "object", properties: { name: { type: "string" } } }), * input: "...", * }); * result.data.name; // string * ``` */ export declare function jsonSchema(schema: Record): JsonSchemaWrapper; /** * Resolve a value that may be a Standard Schema or a plain JSON Schema object. * Returns a plain JSON Schema in either case. */ export declare function resolveSchema(value: Record | StandardSchemaV1): Promise>; /** * Extract a JSON Schema object from a Standard Schema. * * Resolution order: * 1. `jsonSchema()` wrapper → return the embedded schema directly * 2. Zod v4 (vendor `"zod"`) → dynamic `import("zod")` then `z.toJSONSchema()` * 3. Other vendors → throw with a helpful message */ export declare function toJsonSchema(schema: StandardSchemaV1): Promise>; export {};