Load mode definitions from markdown files in {mode,modes}/*.md
(dir: &Path)
| 634 | |
| 635 | /// Load mode definitions from markdown files in {mode,modes}/*.md |
| 636 | fn load_modes_from_dir(dir: &Path) -> HashMap<String, AgentConfig> { |
| 637 | let mut result = HashMap::new(); |
| 638 | |
| 639 | for subdir_name in &["mode", "modes"] { |
| 640 | let subdir = dir.join(subdir_name); |
| 641 | if !subdir.is_dir() { |
| 642 | continue; |
| 643 | } |
| 644 | if let Ok(entries) = glob_md_files(&subdir) { |
| 645 | for entry in entries { |
| 646 | if let Some((name, mut config)) = parse_markdown_agent(&entry, dir) { |
| 647 | // Modes are always primary agents |
| 648 | config.mode = Some(AgentMode::Primary); |
| 649 | result.insert(name, config); |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | result |
| 656 | } |
| 657 | |
| 658 | /// Load plugin paths from .ts/.js files in {plugin,plugins}/*.{ts,js} |
| 659 | fn load_plugins_from_dir(dir: &Path) -> Vec<String> { |
no test coverage detected