coro_core/agent/
base.rs

1//! Base agent trait and structures
2
3use super::config::AgentConfig;
4use crate::error::Result;
5use crate::trajectory::TrajectoryRecorder;
6use async_trait::async_trait;
7
8use super::execution::AgentExecution;
9
10/// Result type for agent operations
11pub type AgentResult<T> = Result<T>;
12
13/// Base trait for all agents
14#[async_trait]
15pub trait Agent: Send + Sync {
16    /// Execute a task
17    async fn execute_task(&mut self, task: &str) -> AgentResult<AgentExecution>;
18
19    /// Get the agent's configuration
20    fn config(&self) -> &AgentConfig;
21
22    /// Get the agent's name/type
23    fn agent_type(&self) -> &str;
24
25    /// Set the trajectory recorder
26    fn set_trajectory_recorder(&mut self, recorder: TrajectoryRecorder);
27
28    /// Get the trajectory recorder
29    fn trajectory_recorder(&self) -> Option<&TrajectoryRecorder>;
30}
31
32// TODO: AgentFactory needs to be updated for new config system
33// /// Factory for creating agents
34// pub struct AgentFactory;