/**
 * Comprehensive Error Handling System for Any Browser MCP
 *
 * @fileoverview Provides specific error types for different failure scenarios with detailed
 * messages, recovery suggestions, and comprehensive error context. This system enables
 * better debugging and user guidance when issues occur.
 *
 * @example
 * ```typescript
 * import { ErrorFactory, ErrorCode } from './errors.js';
 *
 * // Create specific error types
 * const connectionError = ErrorFactory.createConnectionError(
 *   'Failed to connect to browser',
 *   { operation: 'checkBrowserAvailability', details: { port: 9223 } }
 * );
 *
 * // Get formatted error message with recovery actions
 * console.error(connectionError.getFormattedMessage());
 *
 * // Convert to JSON for logging
 * console.log(JSON.stringify(connectionError.toJSON(), null, 2));
 * ```
 *
 * @category Error Handling
 */
/**
 * Enumeration of all possible error codes in the Any Browser MCP system.
 *
 * @description Each error code represents a specific type of failure that can occur
 * during browser automation operations. These codes help categorize errors for
 * better handling and user guidance.
 *
 * @example
 * ```typescript
 * if (error.code === ErrorCode.CONNECTION_FAILED) {
 *   // Handle connection-specific errors
 *   console.log('Browser connection failed');
 * } else if (error.code === ErrorCode.TOOL_EXECUTION_FAILED) {
 *   // Handle tool execution errors
 *   console.log('Browser tool failed to execute');
 * }
 * ```
 */
export declare enum ErrorCode {
    /** Browser connection failed to establish */
    CONNECTION_FAILED = "CONNECTION_FAILED",
    /** Browser connection timed out */
    CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT",
    /** Browser connection was refused */
    CONNECTION_REFUSED = "CONNECTION_REFUSED",
    /** Browser connection was lost during operation */
    CONNECTION_LOST = "CONNECTION_LOST",
    /** Browser executable not found on system */
    BROWSER_NOT_FOUND = "BROWSER_NOT_FOUND",
    /** Browser failed to launch */
    BROWSER_LAUNCH_FAILED = "BROWSER_LAUNCH_FAILED",
    /** Browser launch operation timed out */
    BROWSER_LAUNCH_TIMEOUT = "BROWSER_LAUNCH_TIMEOUT",
    /** Insufficient permissions to launch browser */
    BROWSER_PERMISSION_DENIED = "BROWSER_PERMISSION_DENIED",
    /** Configuration file is invalid */
    CONFIG_INVALID = "CONFIG_INVALID",
    /** Configuration file is missing */
    CONFIG_MISSING = "CONFIG_MISSING",
    /** Configuration validation failed */
    CONFIG_VALIDATION_FAILED = "CONFIG_VALIDATION_FAILED",
    /** Browser tool execution failed */
    TOOL_EXECUTION_FAILED = "TOOL_EXECUTION_FAILED",
    /** Browser tool execution timed out */
    TOOL_TIMEOUT = "TOOL_TIMEOUT",
    /** Invalid parameters provided to browser tool */
    TOOL_INVALID_PARAMS = "TOOL_INVALID_PARAMS",
    /** Element not found on page */
    ELEMENT_NOT_FOUND = "ELEMENT_NOT_FOUND",
    /** Failed to copy browser data */
    DATA_COPY_FAILED = "DATA_COPY_FAILED",
    /** Access denied to browser data */
    DATA_ACCESS_DENIED = "DATA_ACCESS_DENIED",
    /** Browser data corruption detected */
    DATA_CORRUPTION = "DATA_CORRUPTION",
    /** Insufficient system permissions */
    INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS",
    /** Required resource unavailable */
    RESOURCE_UNAVAILABLE = "RESOURCE_UNAVAILABLE",
    /** General system error */
    SYSTEM_ERROR = "SYSTEM_ERROR"
}
export interface ErrorContext {
    operation?: string;
    component?: string;
    timestamp?: Date;
    details?: Record<string, any>;
    stack?: string;
}
export interface RecoveryAction {
    action: string;
    description: string;
    command?: string;
    automated?: boolean;
}
export declare abstract class MCPError extends Error {
    readonly code: ErrorCode;
    readonly context: ErrorContext;
    readonly recoveryActions: RecoveryAction[];
    readonly userFriendly: boolean;
    constructor(message: string, code: ErrorCode, context?: ErrorContext, recoveryActions?: RecoveryAction[], userFriendly?: boolean);
    /**
     * Get a formatted error message with context and recovery suggestions
     */
    getFormattedMessage(): string;
    /**
     * Convert error to JSON for logging or transmission
     */
    toJSON(): object;
}
/**
 * Browser Connection Errors
 */
export declare class BrowserConnectionError extends MCPError {
    constructor(message: string, context?: ErrorContext, cause?: Error);
}
/**
 * Browser Launch Errors
 */
export declare class BrowserLaunchError extends MCPError {
    constructor(message: string, context?: ErrorContext, cause?: Error);
}
/**
 * Configuration Errors
 */
export declare class ConfigurationError extends MCPError {
    constructor(message: string, context?: ErrorContext, validationErrors?: any[]);
}
/**
 * Tool Execution Errors
 */
export declare class ToolExecutionError extends MCPError {
    constructor(toolName: string, message: string, context?: ErrorContext, cause?: Error);
}
/**
 * Data Operation Errors
 */
export declare class DataOperationError extends MCPError {
    constructor(operation: string, message: string, context?: ErrorContext, cause?: Error);
}
/**
 * Lazy Initialization Errors
 */
export declare class LazyInitializationError extends MCPError {
    constructor(message: string, context?: ErrorContext, cause?: Error);
}
/**
 * Element Not Found Errors
 */
export declare class ElementNotFoundError extends MCPError {
    constructor(selector: string, context?: ErrorContext);
}
/**
 * Error Factory for creating appropriate error types
 */
export declare class ErrorFactory {
    static createConnectionError(message: string, context?: ErrorContext, cause?: Error): BrowserConnectionError;
    static createLaunchError(message: string, context?: ErrorContext, cause?: Error): BrowserLaunchError;
    static createConfigError(message: string, context?: ErrorContext, validationErrors?: any[]): ConfigurationError;
    static createToolError(toolName: string, message: string, context?: ErrorContext, cause?: Error): ToolExecutionError;
    static createDataError(operation: string, message: string, context?: ErrorContext, cause?: Error): DataOperationError;
    static createLazyInitError(message: string, context?: ErrorContext, cause?: Error): LazyInitializationError;
    static createElementNotFoundError(selector: string, context?: ErrorContext): ElementNotFoundError;
}
//# sourceMappingURL=errors.d.ts.map