import { ErrorCategory } from "./error-category.type.mjs"; import { AIError, AIErrorOptions } from "./ai-error.mjs"; //#region ../ai/src/errors/tool-execution-error.d.ts /** * Payload passed to `ToolExecutionError` — identifies which tool * failed and, when applicable, which trip it was dispatched from. */ type ToolExecutionErrorOptions = AIErrorOptions & { toolName: string; tripIndex?: number; }; /** * A registered tool's `execute()` threw during dispatch — the tool * code itself failed (not its input schema). The model's request was * valid; the implementation crashed. * * Carries `toolName` so consumers can branch on which tool failed * without regex-parsing the message, and `tripIndex` to correlate * with the `LLMTrip` entry in `result.report.trips`. * * @example * if (result.error instanceof ToolExecutionError) { * metrics.increment("tool.failure", { tool: result.error.toolName }); * } */ declare class ToolExecutionError extends AIError { static readonly defaultCategory: ErrorCategory; readonly toolName: string; readonly tripIndex?: number; constructor(message: string, options: ToolExecutionErrorOptions); } //#endregion export { ToolExecutionError, ToolExecutionErrorOptions }; //# sourceMappingURL=tool-execution-error.d.mts.map