inline task agent v1

This commit is contained in:
Arjun 2026-03-04 22:15:15 +05:30
parent 35aee99300
commit ad3b6a28c1
13 changed files with 1221 additions and 6 deletions

View file

@ -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 };

View 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>;

View file

@ -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;
// ============================================================================