export interface ErrorHandlerOptions { /** * Whether to include stack traces in error responses */ isDevelopment?: boolean; /** * Logger function for error logging */ logger?: { error: (message: string, meta?: any) => void; warn: (message: string, meta?: any) => void; }; /** * Custom error transformer */ errorTransformer?: (error: any) => any; } /** * Handle errors in MCP flows and format them appropriately */ export declare class ErrorHandler { private isDevelopment; private logger?; private errorTransformer?; constructor(options?: ErrorHandlerOptions); /** * Handle an error and return a formatted MCP response */ handle(error: any, context?: { flowName?: string; toolName?: string; }): { content: Array<{ type: "text"; text: string; }>; isError: true; _meta?: { errorId: string; code: string; timestamp: string; stack?: string; }; }; /** * Log error with appropriate level */ private logError; /** * Wrap a function with error handling */ wrap any>(fn: T): T; /** * Transform any error to MCP error */ private transformToMcpError; } /** * Create a global error handler instance */ export declare function createErrorHandler(options?: ErrorHandlerOptions): ErrorHandler; /** * Helper to check if an error should stop execution */ export declare function shouldStopExecution(error: any): boolean; //# sourceMappingURL=error-handler.d.ts.map