mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-01 11:26:23 +02:00
inline task agent v1
This commit is contained in:
parent
35aee99300
commit
ad3b6a28c1
13 changed files with 1221 additions and 6 deletions
|
|
@ -6,5 +6,6 @@ export * as workspace from './workspace.js';
|
|||
export * as mcp from './mcp.js';
|
||||
export * as agentSchedule from './agent-schedule.js';
|
||||
export * as agentScheduleState from './agent-schedule-state.js';
|
||||
export * as serviceEvents from './service-events.js';
|
||||
export * as serviceEvents from './service-events.js'
|
||||
export * as inlineTask from './inline-task.js';
|
||||
export { PrefixLogger };
|
||||
|
|
|
|||
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>;
|
||||
|
|
@ -437,6 +437,19 @@ const ipcSchemas = {
|
|||
})),
|
||||
}),
|
||||
},
|
||||
// Inline task schedule classification
|
||||
'inline-task:classifySchedule': {
|
||||
req: z.object({
|
||||
instruction: z.string(),
|
||||
}),
|
||||
res: z.object({
|
||||
schedule: z.union([
|
||||
z.object({ type: z.literal('cron'), expression: z.string(), startDate: z.string(), endDate: z.string(), label: z.string() }),
|
||||
z.object({ type: z.literal('window'), cron: z.string(), startTime: z.string(), endTime: z.string(), startDate: z.string(), endDate: z.string(), label: z.string() }),
|
||||
z.object({ type: z.literal('once'), runAt: z.string(), label: z.string() }),
|
||||
]).nullable(),
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue