use anyhow::Result;
use std::path::PathBuf;
use super::mapping::ToolNameMapping;
use crate::parser::ToolCall;
#[derive(Debug, Clone, Default)]
pub struct ExecutionConfig {
pub working_dir: Option<PathBuf>,
pub extra_args: Vec<String>,
}
impl ExecutionConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_working_dir(mut self, dir: PathBuf) -> Self {
self.working_dir = Some(dir);
self
}
}
#[derive(Debug)]
pub struct RawExecutionResult {
pub session_log_path: Option<PathBuf>,
pub stdout: Option<String>,
}
pub trait Agent: Send + Sync {
fn name(&self) -> &'static str;
fn execute(&self, prompt: &str, config: &ExecutionConfig) -> Result<RawExecutionResult>;
fn parse_session(&self, result: &RawExecutionResult) -> Result<Vec<ToolCall>>;
fn tool_mapping(&self) -> &ToolNameMapping;
fn is_available(&self) -> bool;
}