feat(automation): add timezone-safe daily briefing dedupe
This commit is contained in:
@@ -863,6 +863,7 @@ describe('configSchema automation', () => {
|
||||
expect(result.automation.daily_briefing.enabled).toBe(false);
|
||||
expect(result.automation.daily_briefing.schedule).toBe('0 8 * * *');
|
||||
expect(result.automation.daily_briefing.name).toBe('daily-briefing');
|
||||
expect(result.automation.daily_briefing.dedupe_per_local_day).toBe(true);
|
||||
});
|
||||
|
||||
it('accepts isolated automation delivery mode', () => {
|
||||
@@ -931,11 +932,13 @@ describe('configSchema automation', () => {
|
||||
output: { channel: 'telegram', peer: '123' },
|
||||
enabled: false,
|
||||
timezone: 'America/New_York',
|
||||
once_per_local_day: true,
|
||||
}],
|
||||
},
|
||||
});
|
||||
expect(result.automation.cron[0].enabled).toBe(false);
|
||||
expect(result.automation.cron[0].timezone).toBe('America/New_York');
|
||||
expect(result.automation.cron[0].once_per_local_day).toBe(true);
|
||||
});
|
||||
|
||||
it('accepts daily briefing automation config', () => {
|
||||
@@ -947,6 +950,7 @@ describe('configSchema automation', () => {
|
||||
name: 'weekday-briefing',
|
||||
schedule: '0 7 * * 1-5',
|
||||
timezone: 'America/New_York',
|
||||
dedupe_per_local_day: false,
|
||||
output: { channel: 'telegram', peer: '123' },
|
||||
prompt: 'Custom briefing prompt',
|
||||
model_tier: 'fast',
|
||||
@@ -958,6 +962,7 @@ describe('configSchema automation', () => {
|
||||
expect(result.automation.daily_briefing.name).toBe('weekday-briefing');
|
||||
expect(result.automation.daily_briefing.schedule).toBe('0 7 * * 1-5');
|
||||
expect(result.automation.daily_briefing.timezone).toBe('America/New_York');
|
||||
expect(result.automation.daily_briefing.dedupe_per_local_day).toBe(false);
|
||||
expect(result.automation.daily_briefing.output).toEqual({ channel: 'telegram', peer: '123' });
|
||||
expect(result.automation.daily_briefing.prompt).toBe('Custom briefing prompt');
|
||||
expect(result.automation.daily_briefing.model_tier).toBe('fast');
|
||||
|
||||
@@ -251,6 +251,7 @@ const cronJobSchema = z.object({
|
||||
enabled: z.boolean().default(true),
|
||||
timezone: z.string().optional(),
|
||||
model_tier: modelTierEnum.optional(),
|
||||
once_per_local_day: z.boolean().default(false),
|
||||
});
|
||||
|
||||
const webhookSchema = z.object({
|
||||
@@ -350,6 +351,7 @@ const dailyBriefingSchema = z.object({
|
||||
name: z.string().min(1).default('daily-briefing'),
|
||||
schedule: z.string().min(1).default('0 8 * * *'),
|
||||
timezone: z.string().optional(),
|
||||
dedupe_per_local_day: z.boolean().default(true),
|
||||
output: z.object({
|
||||
channel: z.string().min(1),
|
||||
peer: z.string().min(1),
|
||||
|
||||
Reference in New Issue
Block a user