modular_agent_kit/registry.rs
1use crate::{AgentDefinition, MAK};
2
3/// Registration entry emitted by the `#[mak_agent]` macro.
4pub struct AgentRegistration {
5 pub build: fn() -> AgentDefinition,
6}
7
8inventory::collect!(AgentRegistration);
9
10/// Register all agents collected via the `#[mak_agent]` macro.
11pub fn register_inventory_agents(mak: &MAK) {
12 for reg in inventory::iter::<AgentRegistration> {
13 mak.register_agent_definiton((reg.build)());
14 }
15}