Load agent definitions from markdown files in {agent,agents}/**/*.md
(dir: &Path)
| 613 | |
| 614 | /// Load agent definitions from markdown files in {agent,agents}/**/*.md |
| 615 | fn load_agents_from_dir(dir: &Path) -> HashMap<String, AgentConfig> { |
| 616 | let mut result = HashMap::new(); |
| 617 | |
| 618 | for subdir_name in &["agent", "agents"] { |
| 619 | let subdir = dir.join(subdir_name); |
| 620 | if !subdir.is_dir() { |
| 621 | continue; |
| 622 | } |
| 623 | if let Ok(entries) = glob_md_files(&subdir) { |
| 624 | for entry in entries { |
| 625 | if let Some((name, config)) = parse_markdown_agent(&entry, dir) { |
| 626 | result.insert(name, config); |
| 627 | } |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | result |
| 633 | } |
| 634 | |
| 635 | /// Load mode definitions from markdown files in {mode,modes}/*.md |
| 636 | fn load_modes_from_dir(dir: &Path) -> HashMap<String, AgentConfig> { |
no test coverage detected