import { ErrorCategory } from "./error-category.type.mjs"; import { AIError, AIErrorOptions } from "./ai-error.mjs"; import { StandardSchemaV1 } from "@standard-schema/spec"; //#region ../ai/src/errors/schema-validation-error.d.ts /** * Payload passed to `SchemaValidationError`. Subset of * `AIErrorOptions` plus the machine-readable validation issues list. */ type SchemaValidationErrorOptions = AIErrorOptions & { issues?: readonly StandardSchemaV1.Issue[]; }; /** * A `StandardSchemaV1` validation call returned issues, or the input * was not valid JSON before validation could even run. * * Produced in two places today: * - Agent output parsing — the final trip text failed `JSON.parse` or * the parsed value failed `~standard.validate`. * - Tool input validation — the model's raw arguments for a tool call * didn't match the tool's `input` schema. * * `issues` carries the structured validation result when available so * consumers can present per-field feedback. * * @example * if (result.error instanceof SchemaValidationError) { * for (const issue of result.error.issues ?? []) { * console.warn(issue.path, issue.message); * } * } */ declare class SchemaValidationError extends AIError { static readonly defaultCategory: ErrorCategory; readonly issues?: readonly StandardSchemaV1.Issue[]; constructor(message: string, options?: SchemaValidationErrorOptions); } //#endregion export { SchemaValidationError, SchemaValidationErrorOptions }; //# sourceMappingURL=schema-validation-error.d.mts.map