// tools/schemas/workers-schema.ts — Zod schemas for worker tools (SPEC-078)
import { z } from 'zod';
// ---------------------------------------------------------------------------
// Registry validation schemas
// ---------------------------------------------------------------------------
export const WorkerTriggerSchema = z.object({
    type: z
        .enum(['file-change', 'event', 'schedule'])
        .describe('Trigger type: file-change | event | schedule'),
    patterns: z
        .array(z.string().describe('Glob pattern like **/*.ts'))
        .optional()
        .describe('Glob patterns for file-change triggers'),
    events: z
        .array(z.string().describe('Event name like post-create-spec'))
        .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).describe('Unique worker name'),
    description: z.string().describe('Human-readable description of what the worker does'),
    trigger: WorkerTriggerSchema.describe('When this worker should be triggered'),
    handler: z.string().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).describe('List of worker definitions'),
});
// ---------------------------------------------------------------------------
// Tool input schemas
// ---------------------------------------------------------------------------
export const WorkerStatusInputSchema = z.object({
    projectId: z.string().min(1).describe('Project identifier'),
    workerName: z
        .string()
        .optional()
        .describe('Optional worker name to get detailed status. ' +
        'Available: test-gaps | security-audit | optimization | code-map | documentation | dependency-health'),
});
export const ConfigureWorkersInputSchema = z.object({
    projectId: z.string().min(1).describe('Project identifier'),
    workerName: z
        .string()
        .min(1)
        .describe('Worker to configure: test-gaps | security-audit | optimization | code-map | documentation | dependency-health'),
    action: z
        .enum(['enable', 'disable', 'set-cooldown', 'set-priority', 'add-pattern', 'remove-pattern'])
        .describe('Configuration action: enable | disable | set-cooldown | set-priority | add-pattern | remove-pattern'),
    value: z
        .union([z.string(), z.number()])
        .optional()
        .describe('Value for the action (ms for cooldown, 1-10 for priority, glob for patterns)'),
});
//# sourceMappingURL=workers-schema.js.map