pub trait AgentRunner: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn is_available(&self) -> bool;
fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>;
fn build_args(&self, config: &TaskConfig) -> Vec<String>;
fn build_env(&self, config: &TaskConfig) -> Vec<(String, String)>;
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn version(&self, config: &TaskConfig) -> Option<String> { ... }
fn capabilities(&self) -> AgentCapabilities { ... }
fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning> { ... }
}Expand description
Trait implemented by each agent adapter.
The runner translates a unified TaskConfig into the agent-specific CLI
invocation and converts the agent’s streaming output into a unified
EventStream.
Required Methods§
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Check whether the agent binary is available on the system.
Sourcefn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
Resolve the binary path (user override or PATH lookup).
Sourcefn build_args(&self, config: &TaskConfig) -> Vec<String>
fn build_args(&self, config: &TaskConfig) -> Vec<String>
Build the command-line arguments for the agent process.
Sourcefn build_env(&self, config: &TaskConfig) -> Vec<(String, String)>
fn build_env(&self, config: &TaskConfig) -> Vec<(String, String)>
Build the environment variables for the agent process.
Sourcefn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the task and return a StreamHandle with event stream and cancel token.
Provided Methods§
Sourcefn version(&self, config: &TaskConfig) -> Option<String>
fn version(&self, config: &TaskConfig) -> Option<String>
Get the version of the installed agent binary.
Sourcefn capabilities(&self) -> AgentCapabilities
fn capabilities(&self) -> AgentCapabilities
What features this agent supports.
Sourcefn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
Validate config against this agent’s capabilities.