import { type EntryErrorReason } from "../entry-error.js"; /** * One failed element, for `getErrorRecoveryPrompt`. * * @example * const failure: RenderFailure = { key: "chart", message: error.message, reason: error.reason }; */ export type RenderFailure = { /** The failed element's key. */ key: string; /** What went wrong, e.g. the error's `message`. */ message: string; /** Adds what this kind of failure means to the line; a reason whose fault is `"environment"` adds nothing. */ reason?: EntryErrorReason; }; /** * Options for `getErrorRecoveryPrompt`. * * @example * const options: ErrorRecoveryPromptOptions = { failures: [{ key: "chart", message: error.message }] }; */ export type ErrorRecoveryPromptOptions = { /** One per failed element. */ failures: RenderFailure[]; }; /** * A user message naming the elements that failed, so the model sends fixed ones under the same keys. One turn's * content, not part of the system prompt. * * @example * getErrorRecoveryPrompt({ * failures: [{ key: "chart", message: "chartData.map is not a function", reason: "expression-runtime" }], * }); */ export declare function getErrorRecoveryPrompt({ failures }: ErrorRecoveryPromptOptions): string;