use super::{Agent, LogProcessor};
use async_trait::async_trait;
pub struct NoOpAgent;
#[async_trait]
impl Agent for NoOpAgent {
fn build_command(&self, instructions_path: &str, is_interactive: bool) -> Vec<String> {
if is_interactive {
vec![
"sh".to_string(),
"-c".to_string(),
format!(
"sleep 0.5; echo '=== Task Instructions ==='; cat '{}'; echo; echo '=== Starting Interactive Session ==='; exec /bin/bash",
instructions_path
),
]
} else {
vec![
"sh".to_string(),
"-c".to_string(),
format!(
"echo '=== Task Instructions ==='; cat '{}'; echo; echo '=== End Instructions ==='",
instructions_path
),
]
}
}
fn volumes(&self) -> Vec<(String, String, String)> {
vec![]
}
fn environment(&self) -> Vec<(String, String)> {
vec![]
}
fn create_log_processor(&self, _task: Option<&crate::task::Task>) -> Box<dyn LogProcessor> {
Box::new(super::no_op_log_processor::NoOpLogProcessor::new())
}
fn name(&self) -> &'static str {
"no-op"
}
async fn validate(&self) -> Result<(), String> {
Ok(())
}
async fn warmup(&self) -> Result<(), String> {
Ok(())
}
fn version(&self) -> String {
"1.0.0".to_string()
}
}