diff --git a/src/daemon/index.ts b/src/daemon/index.ts index 5573ad6..e46e7e9 100644 --- a/src/daemon/index.ts +++ b/src/daemon/index.ts @@ -7,6 +7,7 @@ import { HookEngine } from '../hooks/index.js'; import { ToolRegistry, ToolExecutor, allBuiltinTools } from '../tools/index.js'; import { GatewayServer } from '../gateway/index.js'; import { ChannelRegistry, TelegramAdapter, WebChatAdapter } from '../channels/index.js'; +import { CronScheduler } from '../automation/index.js'; import type { InboundMessage, OutboundMessage } from '../channels/index.js'; import { McpManager } from '../mcp/index.js'; import { SkillRegistry, SkillInstaller, loadAllSkills } from '../skills/index.js'; @@ -276,6 +277,13 @@ export async function startDaemon(config: Config): Promise { const webChatAdapter = new WebChatAdapter({ gateway }); channelRegistry.register(webChatAdapter); + // Register cron scheduler adapter (if any cron jobs configured) + if (config.automation.cron.length > 0) { + const cronScheduler = new CronScheduler(config.automation.cron, channelRegistry); + channelRegistry.register(cronScheduler); + console.log(`Registered ${config.automation.cron.length} cron job(s)`); + } + // ── Signal Handlers ─────────────────────────────────────────── const signalHandler = () => {