use forge_runtime::function::FunctionRegistry;
#[cfg(feature = "cron")]
use forge_runtime::cron::CronRegistry;
#[cfg(feature = "daemons")]
use forge_runtime::daemon::DaemonRegistry;
#[cfg(feature = "jobs")]
use forge_runtime::jobs::JobRegistry;
#[cfg(feature = "gateway")]
use forge_runtime::mcp::McpToolRegistry;
#[cfg(feature = "gateway")]
use forge_runtime::webhook::WebhookRegistry;
#[cfg(feature = "workflows")]
use forge_runtime::workflow::WorkflowRegistry;
pub struct HandlerRegistries {
pub functions: FunctionRegistry,
#[cfg(feature = "jobs")]
pub jobs: JobRegistry,
#[cfg(feature = "cron")]
pub crons: CronRegistry,
#[cfg(feature = "workflows")]
pub workflows: WorkflowRegistry,
#[cfg(feature = "daemons")]
pub daemons: DaemonRegistry,
#[cfg(feature = "gateway")]
pub webhooks: WebhookRegistry,
#[cfg(feature = "gateway")]
pub mcp_tools: McpToolRegistry,
}
pub struct AutoHandler(pub fn(&mut HandlerRegistries));
inventory::collect!(AutoHandler);
pub fn auto_register_all(registries: &mut HandlerRegistries) {
for entry in inventory::iter::<AutoHandler> {
(entry.0)(registries);
}
}