/** * Agent Instances Validator (Issue #869). * * Validates the `agentInstances` payload accepted by * `PATCH /api/worktrees/[id]`. Mirrors selected-agents-validator: returns a * structured `{ valid, value?, error? }` result instead of throwing, so the API * layer can map failures to 400 responses. * * Rules: * - 1..MAX_AGENT_INSTANCES entries (a worktree always keeps at least one). * - Each entry: valid instance id, valid CLI tool, alias string within length. * - Instance ids must be unique within the payload. * - When an instance id equals a CLI tool id (the primary anchor), its * `cliTool` must match that id, keeping `id === cliTool` consistent. * - `order` is normalized to the array position so drag-and-drop reordering * only needs to send the array in the desired order. */ import { type AgentInstance } from './cli-tools/types'; /** Minimum number of agent instances a worktree must retain (Issue #869). */ export declare const MIN_AGENT_INSTANCES = 1; /** * Validate the `agentInstances` input from an API request body. * * @param input - Raw value from the request body (unknown for safety) * @returns Validation result with a normalized AgentInstance[] or an error */ export declare function validateAgentInstancesInput(input: unknown): { valid: boolean; value?: AgentInstance[]; error?: string; }; //# sourceMappingURL=agent-instances-validator.d.ts.map