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:
@@ -7,6 +7,7 @@ import { HookEngine } from '../hooks/index.js';
|
|||||||
import { ToolRegistry, ToolExecutor, allBuiltinTools } from '../tools/index.js';
|
import { ToolRegistry, ToolExecutor, allBuiltinTools } from '../tools/index.js';
|
||||||
import { GatewayServer } from '../gateway/index.js';
|
import { GatewayServer } from '../gateway/index.js';
|
||||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter } from '../channels/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 type { InboundMessage, OutboundMessage } from '../channels/index.js';
|
||||||
import { McpManager } from '../mcp/index.js';
|
import { McpManager } from '../mcp/index.js';
|
||||||
import { SkillRegistry, SkillInstaller, loadAllSkills } from '../skills/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 });
|
const webChatAdapter = new WebChatAdapter({ gateway });
|
||||||
channelRegistry.register(webChatAdapter);
|
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 ───────────────────────────────────────────
|
// ── Signal Handlers ───────────────────────────────────────────
|
||||||
|
|
||||||
const signalHandler = () => {
|
const signalHandler = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user