pub trait Subagent:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn execute<'a>(
&'a self,
context: &'a SubagentContext,
ast_tools: &'a mut ASTAgentTools,
cancel_flag: Arc<AtomicBool>,
) -> Pin<Box<dyn Future<Output = SubagentResult<AgentResult>> + Send + 'a>>;
fn capabilities(&self) -> Vec<String>;
fn supports_file_type(&self, file_path: &Path) -> bool;
// Provided method
fn execution_time_estimate(&self) -> Duration { ... }
}Expand description
Core trait for all subagents
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Agent description
Sourcefn execute<'a>(
&'a self,
context: &'a SubagentContext,
ast_tools: &'a mut ASTAgentTools,
cancel_flag: Arc<AtomicBool>,
) -> Pin<Box<dyn Future<Output = SubagentResult<AgentResult>> + Send + 'a>>
fn execute<'a>( &'a self, context: &'a SubagentContext, ast_tools: &'a mut ASTAgentTools, cancel_flag: Arc<AtomicBool>, ) -> Pin<Box<dyn Future<Output = SubagentResult<AgentResult>> + Send + 'a>>
Execute the agent with given context Returns a boxed future to make the trait object-safe
Sourcefn capabilities(&self) -> Vec<String>
fn capabilities(&self) -> Vec<String>
Get agent capabilities and tool requirements
Sourcefn supports_file_type(&self, file_path: &Path) -> bool
fn supports_file_type(&self, file_path: &Path) -> bool
Check if agent can handle the given file types
Provided Methods§
Sourcefn execution_time_estimate(&self) -> Duration
fn execution_time_estimate(&self) -> Duration
Get expected execution time range