Load command definitions from markdown files in {command,commands}/**/*.md
(dir: &Path)
| 592 | |
| 593 | /// Load command definitions from markdown files in {command,commands}/**/*.md |
| 594 | fn load_commands_from_dir(dir: &Path) -> HashMap<String, CommandConfig> { |
| 595 | let mut result = HashMap::new(); |
| 596 | |
| 597 | for subdir_name in &["command", "commands"] { |
| 598 | let subdir = dir.join(subdir_name); |
| 599 | if !subdir.is_dir() { |
| 600 | continue; |
| 601 | } |
| 602 | if let Ok(entries) = glob_md_files(&subdir) { |
| 603 | for entry in entries { |
| 604 | if let Some((name, content)) = parse_markdown_command(&entry, dir) { |
| 605 | result.insert(name, content); |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | result |
| 612 | } |
| 613 | |
| 614 | /// Load agent definitions from markdown files in {agent,agents}/**/*.md |
| 615 | fn load_agents_from_dir(dir: &Path) -> HashMap<String, AgentConfig> { |
no test coverage detected