// engine/workers/schema.ts — Registry validation schemas for worker definitions (SPEC-078)
// Lives in engine/ so worker-engine.ts can import without violating architecture.
import { z } from 'zod';
export const WorkerTriggerSchema = z.object({
    type: z
        .enum(['file-change', 'event', 'schedule'])
        .describe('Trigger type: file-change | event | schedule'),
    patterns: z
        .array(z.string().max(4096).describe('Glob pattern like **/*.ts'))
        .max(100)
        .optional()
        .describe('Glob patterns for file-change triggers'),
    events: z
        .array(z.string().max(500).describe('Event name like post-create-spec'))
        .max(100)
        .optional()
        .describe('Event names for event triggers'),
    intervalMs: z
        .number()
        .int()
        .positive()
        .optional()
        .describe('Interval in ms for schedule triggers'),
});
export const WorkerDefinitionSchema = z.object({
    name: z.string().min(1).max(500).describe('Unique worker name'),
    description: z
        .string()
        .max(10_000)
        .describe('Human-readable description of what the worker does'),
    trigger: WorkerTriggerSchema.describe('When this worker should be triggered'),
    handler: z.string().max(4096).describe('Path to handler module'),
    priority: z.number().int().min(1).max(10).describe('Priority 1-10, higher = more important'),
    cooldownMs: z.number().int().min(0).describe('Minimum milliseconds between executions'),
    enabled: z.boolean().describe('Whether the worker is active'),
    tier: z.enum(['free', 'pro']).describe('License tier: free | pro'),
});
export const WorkerRegistrySchema = z.object({
    workers: z.array(WorkerDefinitionSchema).max(1000).describe('List of worker definitions'),
});
//# sourceMappingURL=schema.js.map