/** * Worker Fleet Runner — Programmatic API for the worker fleet manager CLI. * * Spawns and manages multiple worker processes for parallel agent execution. * Each worker runs as a separate OS process with its own resources. */ import { type ChildProcess } from 'child_process'; export interface FleetRunnerConfig { /** Number of worker processes (default: CPU cores / 2) */ workers?: number; /** Agents per worker (default: 3) */ capacity?: number; /** Show configuration without starting workers (default: false) */ dryRun?: boolean; /** Coordinator API URL (required) */ apiUrl: string; /** API key for authentication (required) */ apiKey: string; /** Path to the worker script/binary (default: auto-detect from this package) */ workerScript?: string; /** Linear project names for workers to accept (undefined = all) */ projects?: string[]; /** Enable auto-update (CLI flag override) */ autoUpdate?: boolean; } /** * Resolve when the given child process has exited. If it has *already* exited * by the time this is called, the returned promise resolves immediately. * * Exported for testing. The naive * * new Promise((resolve) => child.on('exit', () => resolve())) * * pattern deadlocks when the exit event has already fired: Node does not * re-emit `exit` to handlers registered after the fact. That matters for the * fleet's shutdown path because SIGINT reaches worker children directly * through the process group, so they often exit before the parent's shutdown * code gets to register its listener. */ export declare function waitForProcessExit(child: ChildProcess): Promise; /** * Run a fleet of worker processes. * * The caller can cancel via the optional {@link AbortSignal}. The function * returns once all workers have been stopped. */ export declare function runWorkerFleet(config: FleetRunnerConfig, signal?: AbortSignal): Promise; //# sourceMappingURL=worker-fleet-runner.d.ts.map