mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-06 20:42:15 +02:00
inline task agent v1
This commit is contained in:
parent
5aba6025dc
commit
bd4cc1145d
13 changed files with 1221 additions and 6 deletions
33
apps/x/packages/shared/src/inline-task.ts
Normal file
33
apps/x/packages/shared/src/inline-task.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
export const InlineTaskScheduleSchema = z.discriminatedUnion('type', [
|
||||
z.object({
|
||||
type: z.literal('cron'),
|
||||
expression: z.string(),
|
||||
startDate: z.string(),
|
||||
endDate: z.string(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('window'),
|
||||
cron: z.string(),
|
||||
startTime: z.string(),
|
||||
endTime: z.string(),
|
||||
startDate: z.string(),
|
||||
endDate: z.string(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('once'),
|
||||
runAt: z.string(),
|
||||
}),
|
||||
]);
|
||||
|
||||
export type InlineTaskSchedule = z.infer<typeof InlineTaskScheduleSchema>;
|
||||
|
||||
export const InlineTaskBlockSchema = z.object({
|
||||
instruction: z.string(),
|
||||
schedule: InlineTaskScheduleSchema.optional(),
|
||||
'schedule-label': z.string().optional(),
|
||||
lastRunAt: z.string().optional(),
|
||||
});
|
||||
|
||||
export type InlineTaskBlock = z.infer<typeof InlineTaskBlockSchema>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue