/**
 * Worker pool task execution strategy.
 *
 * Runs tasks using a fixed-size worker pool. Each worker picks up the next
 * available task as soon as it finishes the current one, maximizing slot
 * utilization. Works for both sequential (concurrency=1) and parallel
 * (concurrency>1) execution through the same code path.
 *
 * Polls for newly added tasks at a configurable interval so that tasks
 * added to .takt/tasks.yaml during execution are picked up without waiting
 * for an active task to complete.
 */
import type { TaskRunner, TaskInfo } from '../../../infra/task/index.js';
import type { TaskExecutionOptions } from './types.js';
export interface WorkerPoolResult {
    success: number;
    fail: number;
    executedTaskNames: string[];
}
interface RunWorkerOptions {
    ignoreIterationLimit?: boolean;
}
/**
 * Run tasks using a worker pool with the given concurrency.
 *
 * Algorithm:
 * 1. Create a shared AbortController
 * 2. Maintain a queue of pending tasks and a set of active promises
 * 3. Fill available slots from the queue
 * 4. Wait for any active task to complete OR a poll timer to fire (Promise.race)
 * 5. On task completion: record result
 * 6. On poll tick or completion: claim new tasks and fill freed slots
 * 7. Repeat until queue is empty and all active tasks complete
 */
export declare function runWithWorkerPool(taskRunner: TaskRunner, initialTasks: TaskInfo[], concurrency: number, cwd: string, taskExecutionOptions: TaskExecutionOptions | undefined, runOptions: RunWorkerOptions | undefined, pollIntervalMs: number): Promise<WorkerPoolResult>;
export {};
//# sourceMappingURL=parallelExecution.d.ts.map