/** * Error Handling Utilities * AI-friendly error messages and suggestions for email operations */ export declare class EmailMCPError extends Error { code: string; suggestion?: string | undefined; details?: unknown; constructor(message: string, code: string, suggestion?: string | undefined, details?: unknown); toJSON(): { error: string; code: string; message: string; suggestion: string | undefined; details: unknown; }; } /** * Wrap an operation failure while preserving the underlying cause for diagnosis. */ export declare function wrapOperationError(operation: string, cause: unknown): Error; /** * Sanitize error object to remove sensitive information (passwords, tokens) */ export declare function sanitizeErrorDetails(error: unknown): Record | unknown; /** * Enhance email-related errors with helpful context */ export declare function enhanceError(error: unknown): EmailMCPError; /** * Find the closest matching string from a list of valid options. * Uses bigram similarity for fuzzy matching. */ export declare function findClosestMatch(input: string, validOptions: string[]): string | null; /** * Create AI-readable error message */ export declare function aiReadableMessage(error: EmailMCPError): string; /** * Suggest fixes based on error */ export declare function suggestFixes(error: EmailMCPError): string[]; /** * Wrap async function with error handling */ export declare function withErrorHandling(fn: (...args: Args) => Promise): (...args: Args) => Promise; /** * Create a standard error for unknown actions */ export declare function createUnknownActionError(action: string, supportedActions: string): EmailMCPError; //# sourceMappingURL=errors.d.ts.map