/** * Type definitions for the autonoma Agent Core library. * * Provides standardized interfaces for AI agents across the ecosystem. */ export type Tool = any; export type BaseChatModel = any; export type MemorySaver = any; export type ReactAgent = any; export type AgentKit = any; export type WalletProvider = any; export interface AgentConfig { name: string; description?: string; llm?: { model?: string; temperature?: number; maxTokens?: number; openAIApiKey?: string; }; agentKit?: { cdpApiKeyId?: string; cdpApiKeySecret?: string; networkId?: string; walletDataFile?: string; }; tools?: { enableMCP?: boolean; enableRAG?: boolean; enableAgentKit?: boolean; mcpServerUrl?: string; ragServerUrl?: string; customTools?: any[]; }; prompt?: { systemMessage?: string; capabilities?: string[]; context?: string; instructions?: string; enableConversationMemory?: boolean; }; memory?: { enabled?: boolean; persistentThreadId?: boolean; maxMessages?: number; }; services?: { messageService?: boolean | MessageService; ragService?: boolean | RAGService; analyticsService?: boolean; loggingEnabled?: boolean; }; } export interface TradingAgentConfig extends AgentConfig { prompt?: AgentConfig['prompt'] & { capabilities?: ('question_answering' | 'knowledge_base_search' | 'issue_escalation' | 'conversation_management' | 'sentiment_analysis' | 'market_making' | 'exchange_connectivity' | 'real_time_analytics' | 'risk_management' | 'automated_trading' | 'performance_monitoring' | 'defi_yield_optimization' | 'multi_chain_analysis' | 'apy_strategy_development' | 'portfolio_optimization' | 'liquidity_provision' | 'yield_farming' | 'protocol_analysis' | 'viral_detection' | 'memecoin_analysis' | 'social_sentiment' | 'trend_analysis')[]; }; } /** * Enhanced agent environment interface supporting agent-specific API keys * with fallback to global keys for backward compatibility */ export interface AgentEnvironment { OPENAI_API_KEY?: string; OPENAI_MODEL?: string; OPENAI_MAX_TOKENS?: string; CDP_API_KEY_ID?: string; CDP_API_KEY_SECRET?: string; NETWORK_ID?: string; PORTFOLIO_MANAGER_OPENAI_API_KEY?: string; PORTFOLIO_MANAGER_CDP_API_KEY_ID?: string; PORTFOLIO_MANAGER_CDP_API_KEY_SECRET?: string; PORTFOLIO_MANAGER_NETWORK_ID?: string; PORTFOLIO_MANAGER_OPENAI_MODEL?: string; PORTFOLIO_MANAGER_MAX_TOKENS?: string; MARKET_MAKER_OPENAI_API_KEY?: string; MARKET_MAKER_CDP_API_KEY_ID?: string; MARKET_MAKER_CDP_API_KEY_SECRET?: string; MARKET_MAKER_NETWORK_ID?: string; MARKET_MAKER_OPENAI_MODEL?: string; MARKET_MAKER_MAX_TOKENS?: string; MEMECOIN_OPENAI_API_KEY?: string; MEMECOIN_CDP_API_KEY_ID?: string; MEMECOIN_CDP_API_KEY_SECRET?: string; MEMECOIN_NETWORK_ID?: string; MEMECOIN_OPENAI_MODEL?: string; MEMECOIN_MAX_TOKENS?: string; APY_OPENAI_API_KEY?: string; APY_CDP_API_KEY_ID?: string; APY_CDP_API_KEY_SECRET?: string; APY_NETWORK_ID?: string; APY_OPENAI_MODEL?: string; APY_MAX_TOKENS?: string; MCP_SERVER_URL?: string; RAG_SERVER_URL?: string; NODE_ENV?: string; } /** * Utility function to get agent-specific environment variables with fallback */ export declare function getAgentEnvironment(agentType: 'portfolio-manager' | 'market-maker' | 'memecoin' | 'apy'): { openaiApiKey: string | undefined; cdpApiKeyId: string | undefined; cdpApiKeySecret: string | undefined; networkId: string; openaiModel: string; maxTokens: number; }; export interface autonomaAgent { id: string; name: string; description?: string; capabilities: string[]; tools: Tool[]; config: AgentConfig; start(): Promise; stop(): Promise; process(message: AgentMessage): Promise; updateConfig(config: Partial): Promise; addTool(tool: Tool): Promise; removeTool(toolName: string): Promise; getStatus(): AgentStatus; getMetrics(): AgentMetrics; clearMemory(): Promise; getConversationHistory(limit?: number): Promise; } export interface AgentMessage { role: 'user' | 'assistant' | 'system'; content: string; timestamp?: string; metadata?: Record; } export interface AgentResponse { content: string; timestamp: string; toolCalls?: ToolCall[]; metrics?: { processingTime: number; tokensUsed: number; toolsUsed: string[]; }; error?: string; } export interface ToolCall { tool: string; input: any; output: any; duration: number; success: boolean; error?: string; } export interface AgentStatus { status: 'idle' | 'processing' | 'error' | 'stopped'; uptime: number; lastActivity: string; activeTools: string[]; memoryUsage?: { conversationMessages: number; totalMemoryMB: number; }; } export interface AgentMetrics { totalMessages: number; totalToolCalls: number; averageResponseTime: number; successRate: number; topTools: Array<{ tool: string; count: number; }>; errorCount: number; uptime: number; } export interface MessageService { saveMessage(message: AgentMessage): Promise; getRecentMessages(limit: number): Promise; getConversationStats(): Promise<{ totalMessages: number; userMessages: number; assistantMessages: number; }>; clearHistory(): Promise; } export interface RAGService { search(query: string, options?: SearchOptions): Promise; getContext(query: string): Promise; addDocument(document: Document): Promise; getStatus(): Promise<{ available: boolean; documentCount: number; }>; } export interface SearchOptions { limit?: number; category?: string; threshold?: number; } export interface SearchResult { content: string; metadata: Record; score: number; } export interface Document { id: string; content: string; metadata: Record; } export interface AgentBuilder { setName(name: string): AgentBuilder; setDescription(description: string): AgentBuilder; setLLM(config: AgentConfig['llm']): AgentBuilder; setAgentKit(config: AgentConfig['agentKit']): AgentBuilder; setTools(config: AgentConfig['tools']): AgentBuilder; setPrompt(config: AgentConfig['prompt']): AgentBuilder; setMemory(config: AgentConfig['memory']): AgentBuilder; setServices(config: AgentConfig['services']): AgentBuilder; addCustomTool(tool: Tool): AgentBuilder; build(): Promise; } export type LangGraphAgent = ReactAgent; export interface LangGraphConfig { llm: BaseChatModel; tools: Tool[]; checkpointSaver?: MemorySaver; messageModifier?: string; } export interface AgentKitConfig { agentKit: AgentKit; walletProvider: WalletProvider; networkId: string; } export interface DataAnalysisAgentConfig extends AgentConfig { analysis?: { dataSources?: string[]; updateFrequency?: number; analysisTypes?: string[]; }; } export interface CustomerServiceAgentConfig extends AgentConfig { customerService?: { knowledgeBase?: string; escalationRules?: Record; supportedLanguages?: string[]; }; } export interface DeFiYieldAgentConfig extends AgentConfig { defiConfig?: { maxProtocolAllocation?: number; maxPortfolioRisk?: number; minLiquidityThreshold?: number; maxRiskScore?: number; optimizationStrategy?: 'max_sharpe' | 'risk_parity' | 'mean_variance'; rebalancingThreshold?: number; rebalancingFrequency?: 'daily' | 'weekly' | 'monthly'; supportedChains?: string[]; preferredChains?: string[]; whitelistedProtocols?: string[]; blacklistedProtocols?: string[]; minProtocolTVL?: number; minAuditScore?: number; maxGasCost?: number; slippageTolerance?: number; mevProtection?: boolean; benchmarkStrategy?: string; performanceReportingFrequency?: 'daily' | 'weekly' | 'monthly'; enableRealTimeAlerts?: boolean; }; ragConfig?: { serverUrl?: string; enableHistoricalDecisions?: boolean; enableProtocolKnowledge?: boolean; enableRiskAnalysis?: boolean; knowledgeUpdateFrequency?: 'hourly' | 'daily' | 'weekly'; }; orchestratorConfig?: { url?: string; enableCoordination?: boolean; conflictResolutionStrategy?: 'priority' | 'consensus' | 'arbitration'; resourceSharingEnabled?: boolean; }; } //# sourceMappingURL=types.d.ts.map