/**
 * Task Graph (DAG)
 *
 * Directed Acyclic Graph for task execution ordering.
 * Supports topological sort, parallel execution, cycle detection.
 */
import { EventEmitter } from 'events';
export interface PlannedTask {
    id: string;
    description: string;
    dependencies: string[];
    delegateTo?: 'code-reviewer' | 'debugger' | 'test-runner' | 'explorer' | 'refactorer' | 'documenter';
    parallel?: boolean;
    estimatedTokens?: number;
    status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
    result?: TaskResult;
}
export interface TaskResult {
    success: boolean;
    output: string;
    duration: number;
    error?: string;
}
export interface TaskGraphResult {
    success: boolean;
    results: Map<string, TaskResult>;
    totalDuration: number;
    completedCount: number;
    failedCount: number;
    skippedCount: number;
}
export declare class TaskGraph extends EventEmitter {
    private tasks;
    constructor(tasks?: PlannedTask[]);
    addTask(task: PlannedTask): void;
    getTask(id: string): PlannedTask | undefined;
    getAllTasks(): PlannedTask[];
    /**
     * Get tasks that are ready to execute (no pending dependencies)
     */
    getReady(): PlannedTask[];
    /**
     * Mark a task as complete
     */
    markComplete(id: string, result?: TaskResult): void;
    /**
     * Mark a task as failed
     */
    markFailed(id: string, error: string): void;
    /**
     * Skip all tasks that depend on a failed task
     */
    private skipDependents;
    /**
     * Detect cycles in the graph
     */
    hasCycle(): boolean;
    /**
     * Get topological sort of tasks
     */
    topologicalSort(): PlannedTask[];
    /**
     * Execute all tasks respecting the dependency graph
     */
    execute(executor: (task: PlannedTask) => Promise<TaskResult>, options?: {
        maxParallel?: number;
    }): Promise<TaskGraphResult>;
    /**
     * Get progress summary
     */
    getProgress(): {
        total: number;
        completed: number;
        failed: number;
        running: number;
        pending: number;
        skipped: number;
    };
}
