pub trait Agent: Send + Sync {
// Required methods
fn build_command(&self, instruction_path: &str) -> Vec<String>;
fn volumes(&self) -> Vec<(String, String, String)>;
fn environment(&self) -> Vec<(String, String)>;
fn create_log_processor(
&self,
file_system: Arc<dyn FileSystemOperations>,
) -> Box<dyn LogProcessor>;
fn name(&self) -> &str;
// Provided methods
fn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait defining the interface for AI agents that can execute tasks
Required Methods§
Sourcefn build_command(&self, instruction_path: &str) -> Vec<String>
fn build_command(&self, instruction_path: &str) -> Vec<String>
Returns the command to execute the agent with the given instruction file
Sourcefn volumes(&self) -> Vec<(String, String, String)>
fn volumes(&self) -> Vec<(String, String, String)>
Returns the volumes to mount for this agent Format: Vec<(host_path, container_path, options)> where options is like “:ro” for read-only
Sourcefn environment(&self) -> Vec<(String, String)>
fn environment(&self) -> Vec<(String, String)>
Returns environment variables for this agent
Sourcefn create_log_processor(
&self,
file_system: Arc<dyn FileSystemOperations>,
) -> Box<dyn LogProcessor>
fn create_log_processor( &self, file_system: Arc<dyn FileSystemOperations>, ) -> Box<dyn LogProcessor>
Creates a log processor for this agent’s output
Provided Methods§
Sourcefn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validates that this agent is properly configured
Sourcefn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs any necessary warmup steps before launching the Docker container
This method is called after validation but before container creation. It can be used to execute host-side setup commands, refresh credentials, or perform any other preparatory work needed by the agent.
The default implementation does nothing, allowing backward compatibility.