Load all agent definitions from a directory Scans for *.yaml and *.md files and parses them as agent definitions. Invalid files are logged and skipped.
(dir: &Path)
| 904 | /// Scans for *.yaml and *.md files and parses them as agent definitions. |
| 905 | /// Invalid files are logged and skipped. |
| 906 | pub fn load_agents_from_dir(dir: &Path) -> Vec<AgentDefinition> { |
| 907 | let mut agents = Vec::new(); |
| 908 | load_agents_from_dir_inner(dir, &mut agents); |
| 909 | agents |
| 910 | } |
| 911 | |
| 912 | fn load_agents_from_dir_inner(dir: &Path, agents: &mut Vec<AgentDefinition>) { |
| 913 | let Ok(entries) = std::fs::read_dir(dir) else { |