import { z } from 'zod';
export const createRunSchema = z.object({
    name: z.string().min(1, 'Name is required').max(200, 'Name too long'),
    input: z.unknown().optional(),
    clientToken: z.string().min(1).max(200).optional(),
    tags: z.array(z.string().min(1).max(50)).max(20, 'Too many tags').optional(),
});
export const listRunsQuerySchema = z.object({
    status: z.enum(['created', 'running', 'completed', 'failed']).optional(),
    tag: z.string().max(50).optional(),
    clientToken: z.string().max(200).optional(),
    limit: z
        .union([z.string(), z.number()])
        .optional()
        .default('100')
        .transform((v) => typeof v === 'number' ? v : parseInt(v, 10))
        .refine((n) => !Number.isNaN(n) && n > 0 && n <= 1000, {
        message: 'limit must be between 1 and 1000',
    }),
    offset: z
        .union([z.string(), z.number()])
        .optional()
        .default('0')
        .transform((v) => typeof v === 'number' ? v : parseInt(v, 10))
        .refine((n) => !Number.isNaN(n) && n >= 0, {
        message: 'offset must be >= 0',
    }),
});
export const runIdParamSchema = z.object({
    id: z.string().refine((val) => {
        const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
        const customRegex = /^run-\d+-[a-z0-9]+$/i;
        return uuidRegex.test(val) || customRegex.test(val);
    }, { message: 'Invalid run ID format' }),
});
export const updateRunStatusSchema = z.object({
    status: z.enum(['created', 'running', 'completed', 'failed'], {
        errorMap: () => ({ message: 'status must be one of: created, running, completed, failed' }),
    }),
    output: z.unknown().optional(),
    error: z.string().optional(),
});
export const workspacePlanSchema = z.object({
    prompt: z.string().min(1, 'Prompt is required').max(10000, 'Prompt too long'),
    context: z.record(z.unknown()).optional(),
    options: z.object({
        temperature: z.number().min(0).max(2).optional(),
        maxTokens: z.number().min(1).max(100000).optional(),
        model: z.string().optional(),
    }).optional(),
});
export const registryPublishSchema = z.object({
    name: z.string().min(1).max(100),
    version: z.string().regex(/^\d+\.\d+\.\d+$/, 'Version must be in semver format (e.g., 1.0.0)'),
    description: z.string().max(500).optional(),
    code: z.string().min(1),
    metadata: z.record(z.unknown()).optional(),
});
export const privacyToggleSchema = z.object({
    enabled: z.boolean(),
    level: z.enum(['strict', 'moderate', 'permissive']).optional(),
});
//# sourceMappingURL=runs.js.map