import { z } from 'zod'; import { SolvingEduTaskJobSchema } from '../../models'; export namespace ExecuteSolvingEduTaskCommand { export const RequestSchema = z .object({ prompt: z.string().optional(), modelId: z.string().uuid(), params: z.object({ attachedFiles: z.array(z.string().uuid()), }), }) .superRefine((data, ctx) => { const hasPrompt = typeof data.prompt === 'string' && data.prompt.length > 0; const hasAttachedFiles = data.params.attachedFiles.length > 0; if (!hasAttachedFiles && !hasPrompt) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'prompt is required when no attachedFiles provided', path: ['prompt'], }); } }); export type Request = z.infer; export const ResponseSchema = z.object({ data: SolvingEduTaskJobSchema, }); export type Response = z.infer; }