delegate_task takes a task_id to hand over a task already on a list: it moves to the worker (a workspace's task stays on its list), goes to doing, and the job is linked back so its end is noted on the task. hand_over_schedule moves a bot's own routine to another bot, keeping its workspace. Users get Hand over in the Tasks UI and both routine lists. Co-Authored-By: Claude Opus 5.5 <[email protected]>
27 lines
997 B
TypeScript
27 lines
997 B
TypeScript
import { z } from "zod";
|
|
|
|
const CronJobIdField = z.coerce.number().int().positive("Pick a routine");
|
|
|
|
export const UpdateCronJobRequestSchema = z.object({
|
|
cron_job_id: CronJobIdField,
|
|
title: z.string().trim().min(1, "Give the routine a name").max(80, "Keep the name under 80 characters").optional(),
|
|
instructions: z.string().trim().min(1, "Tell the bot what to do").max(8000).optional(),
|
|
schedule: z.string().trim().min(1, "Set when it runs").max(100).optional(),
|
|
enabled: z.boolean().optional(),
|
|
});
|
|
|
|
export type UpdateCronJobRequest = z.infer<typeof UpdateCronJobRequestSchema>;
|
|
|
|
export const CronJobIdRequestSchema = z.object({
|
|
cron_job_id: CronJobIdField,
|
|
});
|
|
|
|
export type CronJobIdRequest = z.infer<typeof CronJobIdRequestSchema>;
|
|
|
|
export const HandOverCronJobRequestSchema = z.object({
|
|
cron_job_id: CronJobIdField,
|
|
bot_id: z.coerce.number().int().positive("Pick a bot"),
|
|
});
|
|
|
|
export type HandOverCronJobRequest = z.infer<typeof HandOverCronJobRequestSchema>;
|