/** * Enforcement for `CodaliGatewayRequest.response.schema`. * * The field has been part of the request contract for a while but was never * validated — only `response.format === "json"` was read, so a caller could ask * for a schema and receive anything at all. That pushes parsing and correction * logic into every consuming product, which is precisely the duplication Codali * exists to remove. * * Validation reuses the same structural rules as tool-argument validation so a * schema behaves identically whether it describes a tool input or a response. */ export interface ResponseSchemaViolation { path: string; message: string; } export interface ResponseSchemaValidation { ok: boolean; value?: unknown; violations: ResponseSchemaViolation[]; } /** * Extracts a JSON value from a model response. Models routinely wrap JSON in * prose or a fenced block even when told not to, and rejecting those outright * would burn a repair attempt on a formatting quirk rather than a real * structural failure. */ export declare const extractJsonPayload: (content: string) => unknown; export declare const validateResponseAgainstSchema: (content: string, schema: Record | undefined) => ResponseSchemaValidation; /** Human-readable violation list, used to prompt one repair attempt. */ export declare const describeViolations: (violations: ResponseSchemaViolation[]) => string; //# sourceMappingURL=ResponseSchema.d.ts.map