feat(daemon): wire CronScheduler into channel registry

Registers CronScheduler as a channel adapter when automation.cron
jobs are configured, enabling scheduled message delivery through
the agent pipeline.
This commit is contained in:
William Valentin
2026-02-05 22:23:03 -08:00
parent b9e008ea23
commit ba15b36e49
+8
View File
@@ -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<DaemonContext> {
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 = () => {