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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user