feat: file attachment input

This commit is contained in:
Acbox
2026-02-06 16:09:11 +08:00
parent 5a35ef34ac
commit fe71e7d36d
5 changed files with 28 additions and 8 deletions
+15 -1
View File
@@ -40,4 +40,18 @@ export const ScheduleModel = z.object({
pattern: z.string().min(1, 'Schedule pattern is required'),
maxCalls: z.number().nullable().optional(),
command: z.string().min(1, 'Schedule command is required'),
})
})
export const ImageAttachmentModel = z.object({
type: z.literal('image'),
base64: z.string().min(1, 'Image base64 is required'),
metadata: z.record(z.string(), z.any()).optional(),
})
export const FileAttachmentModel = z.object({
type: z.literal('file'),
path: z.string().min(1, 'File path is required'),
metadata: z.record(z.string(), z.any()).optional(),
})
export const AttachmentModel = z.union([ImageAttachmentModel, FileAttachmentModel])