feat: created a new builtin function for agents who can spawn other agents to list available agents via agent__list_available

This commit is contained in:
2026-07-22 12:50:41 -06:00
parent dfacf31f6a
commit 420db4bb88
6 changed files with 199 additions and 130 deletions
+13
View File
@@ -1016,6 +1016,19 @@ pub fn list_agents() -> Vec<String> {
agents
}
pub fn list_agents_with_descriptions() -> Vec<(String, String)> {
list_agents()
.into_iter()
.map(|name| {
let description = AgentConfig::load(&paths::agent_config_file(&name))
.ok()
.map(|c| c.description)
.unwrap_or_default();
(name, description)
})
.collect()
}
pub fn complete_agent_variables(agent_name: &str) -> Vec<(String, Option<String>)> {
let config_path = paths::agent_config_file(agent_name);
if !config_path.exists() {