28 lines
760 B
Rust
28 lines
760 B
Rust
use std::path::PathBuf;
|
|||
|
|
use super::spawn::AgentDefinition;
|
||
|
|
|
||
|
|
pub const REVIEWER_ALLOWED: &[&str] = &["read", "grep", "glob", "recall", "remember"];
|
||
|
|
|
||
|
|
pub struct SubagentContext {
|
||
|
|
pub system_prompt: String,
|
||
|
|
pub allowed_tools: Vec<String>,
|
||
|
|
pub max_steps: usize,
|
||
|
|
pub session_dir: PathBuf,
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn build_subagent_context(def: AgentDefinition) -> SubagentContext {
|
||
|
|
let allowed_tools = def.allowed_tools.clone().unwrap_or_else(|| {
|
||
|
|
if def.role == "reviewer" {
|
||
|
|
REVIEWER_ALLOWED.iter().map(|s| s.to_string()).collect()
|
||
|
|
} else {
|
||
|
|
Vec::new()
|
||
|
|
}
|
||
|
|
});
|
||
|
|
SubagentContext {
|
||
|
|
system_prompt: String::new(),
|
||
|
|
allowed_tools,
|
||
|
|
max_steps: 25,
|
||
|
|
session_dir: PathBuf::new(),
|
||
|
|
}
|
||
|
|
}
|