Register a new agent adapter. If an agent with the same name is already registered, the new one replaces it.
(&mut self, agent: Box<dyn AgentHook>)
| 308 | /// If an agent with the same name is already registered, the new one |
| 309 | /// replaces it. |
| 310 | pub fn register(&mut self, agent: Box<dyn AgentHook>) { |
| 311 | // Replace existing agent with the same name |
| 312 | self.agents.retain(|a| a.name() != agent.name()); |
| 313 | self.agents.push(agent); |
| 314 | } |
| 315 | |
| 316 | /// Look up an agent adapter by name. |
| 317 | /// |