import { SessionState } from './session'; import { BotState } from './bot'; /** * Error severity levels */ export declare enum ErrorSeverity { /** * Critical error requiring immediate attention */ CRITICAL = "critical", /** * Error that prevents normal operation */ ERROR = "error", /** * Warning that may affect functionality */ WARNING = "warning", /** * Informational message */ INFO = "info" } /** * Error categories for classification */ export declare enum ErrorCategory { /** * Network connectivity issues */ NETWORK = "network", /** * Authentication/authorization failures */ AUTH = "auth", /** * API/backend errors */ API = "api", /** * LiveKit connection issues */ CONNECTION = "connection", /** * Bot spawning/management errors */ BOT = "bot", /** * Session management errors */ SESSION = "session", /** * Configuration errors */ CONFIG = "config", /** * Unknown/uncategorized errors */ UNKNOWN = "unknown" } /** * Error recovery strategies */ export declare enum RecoveryStrategy { /** * No automatic recovery possible - user intervention required */ NONE = "none", /** * Retry the operation automatically */ RETRY = "retry", /** * Reconnect to service */ RECONNECT = "reconnect", /** * Recreate session */ RECREATE_SESSION = "recreate_session", /** * Refresh authentication */ REFRESH_AUTH = "refresh_auth", /** * Fallback to alternative method */ FALLBACK = "fallback" } /** * User-facing error message with action suggestions */ export interface UserMessage { /** * Short, user-friendly title */ title: string; /** * Detailed explanation of what went wrong */ message: string; /** * Suggested actions the user can take */ actions?: string[]; } /** * Base error class with enhanced metadata */ export declare class PresentationError extends Error { /** * Error code for programmatic handling */ readonly code: string; /** * Error category */ readonly category: ErrorCategory; /** * Error severity */ readonly severity: ErrorSeverity; /** * Whether this error is recoverable */ readonly recoverable: boolean; /** * Suggested recovery strategy */ readonly recoveryStrategy: RecoveryStrategy; /** * User-facing message */ readonly userMessage: UserMessage; /** * Original error if this wraps another error */ readonly cause?: Error; /** * Additional context data */ readonly context?: Record; /** * Timestamp when error occurred */ readonly timestamp: Date; constructor(message: string, options: { code: string; category: ErrorCategory; severity?: ErrorSeverity; recoverable?: boolean; recoveryStrategy?: RecoveryStrategy; userMessage: UserMessage; cause?: Error; context?: Record; }); /** * Convert error to JSON for logging/transport */ toJSON(): Record; } /** * Session-related errors */ export declare class SessionError extends PresentationError { readonly sessionState?: SessionState; constructor(message: string, options: { code: string; severity?: ErrorSeverity; recoverable?: boolean; recoveryStrategy?: RecoveryStrategy; userMessage: UserMessage; cause?: Error; context?: Record; sessionState?: SessionState; }); } /** * Network connectivity errors */ export declare class NetworkError extends PresentationError { readonly statusCode?: number; readonly retryAfter?: number; constructor(message: string, options: { code: string; severity?: ErrorSeverity; userMessage: UserMessage; cause?: Error; context?: Record; statusCode?: number; retryAfter?: number; }); } /** * API/Backend errors */ export declare class APIError extends PresentationError { readonly statusCode: number; readonly endpoint?: string; constructor(message: string, options: { code: string; statusCode: number; endpoint?: string; severity?: ErrorSeverity; recoverable?: boolean; recoveryStrategy?: RecoveryStrategy; userMessage: UserMessage; cause?: Error; context?: Record; }); } /** * LiveKit connection errors */ export declare class ConnectionError extends PresentationError { readonly connectionState?: string; readonly reconnectAttempt?: number; constructor(message: string, options: { code: string; severity?: ErrorSeverity; userMessage: UserMessage; cause?: Error; context?: Record; connectionState?: string; reconnectAttempt?: number; }); } /** * Bot management errors */ export declare class BotError extends PresentationError { readonly botId?: string; readonly botType?: string; readonly botState?: BotState; constructor(message: string, options: { code: string; severity?: ErrorSeverity; recoverable?: boolean; recoveryStrategy?: RecoveryStrategy; userMessage: UserMessage; cause?: Error; context?: Record; botId?: string; botType?: string; botState?: BotState; }); } /** * Authentication/Authorization errors */ export declare class AuthError extends PresentationError { constructor(message: string, options: { code: string; severity?: ErrorSeverity; userMessage: UserMessage; cause?: Error; context?: Record; }); } /** * Configuration errors */ export declare class ConfigError extends PresentationError { readonly configKey?: string; constructor(message: string, options: { code: string; severity?: ErrorSeverity; userMessage: UserMessage; cause?: Error; context?: Record; configKey?: string; }); } /** * Type guard to check if error is PresentationError */ export declare function isPresentationError(error: unknown): error is PresentationError; /** * Type guard to check if error is SessionError */ export declare function isSessionError(error: unknown): error is SessionError; /** * Type guard to check if error is NetworkError */ export declare function isNetworkError(error: unknown): error is NetworkError; /** * Type guard to check if error is ConnectionError */ export declare function isConnectionError(error: unknown): error is ConnectionError; /** * Type guard to check if error is BotError */ export declare function isBotError(error: unknown): error is BotError;