import { NxJsonConfiguration } from '../config/nx-json';
import { ProjectGraph } from '../config/project-graph';
import { Task, TaskGraph } from '../config/task-graph';
import { DaemonClient } from '../daemon/client/client';
import { TaskHasher } from '../hasher/task-hasher';
import { NxArgs } from '../utils/command-line-utils';
import { DefaultTasksRunnerOptions } from './default-tasks-runner';
import { TaskResult } from './life-cycle';
import { RunningTask } from './running-tasks/running-task';
import { TaskStatus } from './tasks-runner';
import { Batch } from './tasks-schedule';
import { SharedRunningTask } from './running-tasks/shared-running-task';
export declare class TaskOrchestrator {
    private readonly hasher;
    private readonly initiatingProject;
    private readonly initiatingTasks;
    private readonly projectGraph;
    private readonly taskGraph;
    private readonly nxJson;
    private readonly options;
    private readonly bail;
    private readonly daemon;
    private readonly outputStyle;
    private readonly taskGraphForHashing;
    private taskDetails;
    private cache;
    private readonly tuiEnabled;
    private forkedProcessTaskRunner;
    private runningTasksService;
    private tasksSchedule;
    private batchEnv;
    private reverseTaskDeps;
    private initializingTaskIds;
    private processedTasks;
    private completedTasks;
    private waitingForTasks;
    private groups;
    private bailed;
    private resolveStopPromise;
    private stopRequested;
    private runningContinuousTasks;
    private runningRunCommandsTasks;
    private runningDiscreteTasks;
    private discreteTaskExitHandled;
    private cleanupDone;
    constructor(hasher: TaskHasher, initiatingProject: string | undefined, initiatingTasks: Task[], projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, options: NxArgs & DefaultTasksRunnerOptions, bail: boolean, daemon: DaemonClient, outputStyle: string, taskGraphForHashing?: TaskGraph);
    init(): Promise<void>;
    run(): Promise<{
        [id: string]: TaskStatus;
    }>;
    nextBatch(): Batch;
    private executeNextBatchOfTasksUsingTaskSchedule;
    private processTasks;
    private processTask;
    processAllScheduledTasks(): void;
    private applyCachedResults;
    private applyCachedResult;
    /**
     * Hash all batch tasks and resolve cache hits topologically.
     *
     * Walks the task graph level by level. Every task gets a preliminary hash
     * (so startTasks always has a valid hash for Cloud). Tasks with depsOutputs
     * whose deps weren't cached are ineligible for cache lookup but still
     * receive a preliminary hash — they'll be re-hashed after execution.
     */
    private applyBatchCachedResults;
    private hashBatchTasks;
    applyFromCacheOrRunBatch(doNotSkipCache: boolean, batch: Batch, groupId: number): Promise<TaskResult[]>;
    private runBatch;
    applyFromCacheOrRunTask(doNotSkipCache: boolean, task: Task, groupId: number): Promise<TaskResult>;
    private runTask;
    private runTaskInForkedProcess;
    startContinuousTask(task: Task, groupId: number): Promise<RunningTask | SharedRunningTask>;
    private preRunSteps;
    private postRunSteps;
    private scheduleNextTasksAndReleaseThreads;
    private complete;
    /**
     * Unified task completion handler for a set of tasks.
     * - Calls endTasks() lifecycle hook (non-skipped only)
     * - Marks complete in scheduler
     * - Sets completedTasks
     * - Updates TUI status
     * - Skip dependent tasks
     */
    private completeTasks;
    private pipeOutputCapture;
    private shouldCacheTaskResult;
    private closeGroup;
    private openGroup;
    private shouldCopyOutputsFromCache;
    private recordOutputsHash;
    private registerContinuousTaskExitHandler;
    private completeContinuousTask;
    private cleanup;
    private setupSignalHandlers;
    private cleanUpUnneededContinuousTasks;
}
export declare function getThreadCount(options: NxArgs & DefaultTasksRunnerOptions, taskGraph: TaskGraph): number;
//# sourceMappingURL=task-orchestrator.d.ts.map