feat(automation): add daily briefing preset and cron backup scheduling

This commit is contained in:
William Valentin
2026-02-16 13:42:18 -08:00
parent 52231b7a93
commit ce621d1b72
13 changed files with 350 additions and 45 deletions
+36
View File
@@ -142,4 +142,40 @@ describe('registerChannels', () => {
expect(names).toContain('zalo');
expect(gateway.setZaloHandler).toHaveBeenCalledTimes(1);
});
it('registers cron scheduler when daily briefing preset is enabled', () => {
const config = configSchema.parse({
telegram: { bot_token: 'test-token', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
automation: {
daily_briefing: {
enabled: true,
schedule: '0 8 * * *',
output: { channel: 'telegram', peer: '1' },
},
},
});
const channelRegistry = new ChannelRegistry();
const gateway = {
setWebhookHandler: vi.fn(),
setGmailHandler: vi.fn(),
setTeamsHandler: vi.fn(),
setGoogleChatHandler: vi.fn(),
setBlueBubblesHandler: vi.fn(),
setLineHandler: vi.fn(),
setFeishuHandler: vi.fn(),
setZaloHandler: vi.fn(),
};
registerChannels({
config,
channelRegistry,
hookEngine: new HookEngine(config.hooks),
gateway: gateway as unknown as Parameters<typeof registerChannels>[0]['gateway'],
});
const names = channelRegistry.list().map((adapter) => adapter.name);
expect(names).toContain('cron');
});
});