Create a new agent registry with configuration Loads built-in agents first, then loads agents from configured directories.
(config: &CodeConfig)
| 587 | /// |
| 588 | /// Loads built-in agents first, then loads agents from configured directories. |
| 589 | pub fn with_config(config: &CodeConfig) -> Self { |
| 590 | let registry = Self::new(); |
| 591 | |
| 592 | // Load agents from configured directories |
| 593 | for dir in &config.agent_dirs { |
| 594 | let agents = load_agents_from_dir(dir); |
| 595 | for agent in agents { |
| 596 | tracing::info!("Loaded agent '{}' from {}", agent.name, dir.display()); |
| 597 | registry.register(agent); |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | registry |
| 602 | } |
| 603 | |
| 604 | /// Register an agent definition |
| 605 | pub fn register(&self, agent: AgentDefinition) { |
nothing calls this directly
no test coverage detected