import { EventEmitter } from 'events'; import { AgentConfig, RunOptions, RunResult } from './types'; import { MemoryInterface } from '../memory/memory-interface'; import { EnhancedMemoryInterface } from '../memory/enhanced-memory-interface'; import { LLMProviderInterface } from './provider-interface'; import { ProviderConfig } from './provider-factory'; import { PlannerInterface } from '../planning/planner-interface'; import { Logger } from '../utils/logger'; /** * Core Agent class that serves as the foundation for AI agents in the framework */ export declare class Agent extends EventEmitter { id: string; config: AgentConfig; memory?: MemoryInterface | EnhancedMemoryInterface; provider: LLMProviderInterface; planner?: PlannerInterface; logger: Logger; /** * Creates a new Agent instance * * @param config - Configuration options for the agent * @param provider - Optional LLM provider (uses ProviderFactory default if not provided) * @param providerConfig - Optional provider configuration (if provider not directly provided) */ constructor(config: AgentConfig, provider?: LLMProviderInterface, providerConfig?: ProviderConfig); /** * Sets the memory system for the agent * * @param memory - The memory implementation to use * @returns The agent instance (for chaining) */ setMemory(memory: MemoryInterface | EnhancedMemoryInterface): Agent; /** * Sets the planner for breaking down complex tasks * * @param planner - The planner implementation to use * @returns The agent instance (for chaining) */ setPlanner(planner: PlannerInterface): Agent; /** * Runs the agent with a specific task * * @param options - Execution options including the task to perform * @returns Promise resolving to the execution result */ run(options: RunOptions): Promise; /** * Heuristic to decide if a task is complex enough to require planning * * @param task - The task to evaluate * @returns Boolean indicating if planning should be used */ private shouldUsePlanner; /** * Generates a default system prompt based on the agent's configuration * * @param config - The agent configuration * @returns A formatted system prompt */ private generateDefaultSystemPrompt; }