1use forge_runtime::function::FunctionRegistry;
4
5#[cfg(feature = "cron")]
6use forge_runtime::cron::CronRegistry;
7#[cfg(feature = "daemons")]
8use forge_runtime::daemon::DaemonRegistry;
9#[cfg(feature = "jobs")]
10use forge_runtime::jobs::JobRegistry;
11#[cfg(feature = "gateway")]
12use forge_runtime::mcp::McpToolRegistry;
13#[cfg(feature = "gateway")]
14use forge_runtime::webhook::WebhookRegistry;
15#[cfg(feature = "workflows")]
16use forge_runtime::workflow::WorkflowRegistry;
17
18pub struct HandlerRegistries {
22 pub functions: FunctionRegistry,
23 #[cfg(feature = "jobs")]
24 pub jobs: JobRegistry,
25 #[cfg(feature = "cron")]
26 pub crons: CronRegistry,
27 #[cfg(feature = "workflows")]
28 pub workflows: WorkflowRegistry,
29 #[cfg(feature = "daemons")]
30 pub daemons: DaemonRegistry,
31 #[cfg(feature = "gateway")]
32 pub webhooks: WebhookRegistry,
33 #[cfg(feature = "gateway")]
34 pub mcp_tools: McpToolRegistry,
35}
36
37pub struct AutoHandler(pub fn(&mut HandlerRegistries));
39
40inventory::collect!(AutoHandler);
41
42pub fn auto_register_all(registries: &mut HandlerRegistries) {
44 for entry in inventory::iter::<AutoHandler> {
45 (entry.0)(registries);
46 }
47}