feat(config): add automation.cron schema for scheduled jobs
This commit is contained in:
@@ -71,6 +71,22 @@ const mcpSchema = z.object({
|
||||
servers: z.array(mcpServerSchema).default([]),
|
||||
}).default({ servers: [] });
|
||||
|
||||
const cronJobSchema = z.object({
|
||||
name: z.string().min(1, 'Cron job name is required'),
|
||||
schedule: z.string().min(1, 'Cron schedule is required'),
|
||||
message: z.string().min(1, 'Cron message is required'),
|
||||
output: z.object({
|
||||
channel: z.string().min(1),
|
||||
peer: z.string().min(1),
|
||||
}),
|
||||
enabled: z.boolean().default(true),
|
||||
timezone: z.string().optional(),
|
||||
});
|
||||
|
||||
const automationSchema = z.object({
|
||||
cron: z.array(cronJobSchema).default([]),
|
||||
}).default({});
|
||||
|
||||
export const configSchema = z.object({
|
||||
telegram: telegramSchema,
|
||||
server: serverSchema.default({}),
|
||||
@@ -79,8 +95,10 @@ export const configSchema = z.object({
|
||||
hooks: hooksSchema.default({}),
|
||||
skills: skillsSchema.default({}),
|
||||
mcp: mcpSchema.default({ servers: [] }),
|
||||
automation: automationSchema,
|
||||
});
|
||||
|
||||
export type Config = z.infer<typeof configSchema>;
|
||||
export type TelegramConfig = z.infer<typeof telegramSchema>;
|
||||
export type ModelConfig = z.infer<typeof modelConfigSchema>;
|
||||
export type CronJobConfig = z.infer<typeof cronJobSchema>;
|
||||
|
||||
Reference in New Issue
Block a user