/** * Shared service for consistent error handling and user-friendly error messages * Consolidates error handling patterns and provides contextual help */ export interface ErrorContext { component: string; operation: string; userInput?: string; suggestions?: string[]; } export interface ErrorResult { success: false; error: string; context?: ErrorContext; suggestions?: string[]; } export interface SuccessResult { success: true; data: T; } export type Result = SuccessResult | ErrorResult; export declare class ErrorHandler { /** * Handle and format errors consistently */ static handle(error: Error | string, context?: ErrorContext): ErrorResult; /** * Wrap async operations with consistent error handling */ static wrap(operation: () => Promise, context: ErrorContext): Promise>; /** * Wrap sync operations with consistent error handling */ static wrapSync(operation: () => T, context: ErrorContext): Result; /** * Convert technical error messages to user-friendly ones */ private static getFriendlyMessage; /** * Generate helpful suggestions based on error type */ private static getSuggestions; /** * Extract tool name from error message */ private static extractToolName; /** * Clean up technical error messages */ private static cleanErrorMessage; /** * Format error for console output */ static formatForConsole(result: ErrorResult): string; /** * Create context for error handling */ static createContext(component: string, operation: string, userInput?: string, suggestions?: string[]): ErrorContext; /** * Common file operation error handler */ static fileOperation(operation: string, path: string): ErrorContext; /** * Common network operation error handler */ static networkOperation(operation: string, target?: string): ErrorContext; /** * Common MCP operation error handler */ static mcpOperation(operation: string, tool?: string): ErrorContext; } //# sourceMappingURL=error-handler.d.ts.map