/** * Standardized Error Handling for autonoma Agents * * Provides consistent error handling, logging, and user-friendly messages * across all agent implementations. */ export interface ErrorMetadata { executionTime: number; errorType: string; agentName: string; timestamp: string; } export interface StandardErrorResponse { error: string; timestamp: string; metadata?: ErrorMetadata; statusCode?: number; } /** * Configuration for agent-specific error messages */ export declare const AGENT_ERROR_CONFIGS: { readonly 'market-maker': { readonly name: "Market Maker Agent"; readonly defaultMessage: "I'm sorry, I encountered an error while processing your trading request. Please check your connection and try again."; readonly errorPrefix: "Trading Error"; }; readonly apy: { readonly name: "DeFi Yield Agent"; readonly defaultMessage: "I'm sorry, I encountered an error while processing your DeFi request. Please check your connection and try again."; readonly errorPrefix: "DeFi Error"; }; readonly 'portfolio-manager': { readonly name: "Portfolio Manager Agent"; readonly defaultMessage: "I'm sorry, I encountered an error while processing your portfolio request. Please check your connection and try again."; readonly errorPrefix: "Portfolio Error"; }; readonly memecoin: { readonly name: "Memecoin Agent"; readonly defaultMessage: "I'm sorry, I encountered an error while analyzing memecoins. Please check your connection and try again."; readonly errorPrefix: "Memecoin Error"; }; readonly orchestrator: { readonly name: "Agent Orchestrator"; readonly defaultMessage: "I'm sorry, I encountered an error while coordinating agents. Please check your connection and try again."; readonly errorPrefix: "Orchestrator Error"; }; }; export type AgentType = keyof typeof AGENT_ERROR_CONFIGS; /** * Standardized error handler for all autonoma agents */ export declare class AgentErrorHandler { private agentType; private startTime; constructor(agentType: AgentType, startTime?: number); /** * Handle and format errors with consistent logging and user messages */ handleError(error: unknown, customMessage?: string): StandardErrorResponse; /** * Handle validation errors specifically */ handleValidationError(field: string, issue: string): StandardErrorResponse; /** * Handle service unavailable errors (like MCP servers down) */ handleServiceUnavailable(serviceName: string): StandardErrorResponse; } /** * Quick factory function for creating error handlers */ export declare function createErrorHandler(agentType: AgentType, startTime?: number): AgentErrorHandler; /** * Simple error response for cases where we don't need the full handler */ export declare function createErrorResponse(agentType: AgentType, error: unknown, customMessage?: string): StandardErrorResponse; //# sourceMappingURL=error-handler.d.ts.map