/**
 * DEPENDENCY RESOLVER
 *
 * Handles dependency graph operations for execution plans.
 * Supports topological sorting and circular dependency detection.
 */
/**
 * Error thrown when circular dependencies are detected
 */
export declare class CircularDependencyError extends Error {
    cycle: string[];
    constructor(cycle: string[], message?: string);
}
/**
 * Error thrown when dependencies reference unknown steps
 */
export declare class InvalidDependencyError extends Error {
    stepId: string;
    unknownDep: string;
    constructor(stepId: string, unknownDep: string);
}
/**
 * DependencyResolver - Manages step dependencies and execution ordering
 */
export declare class DependencyResolver {
    /**
     * Validate that all dependencies reference existing steps
     */
    validateDependencies(steps: {
        id: string;
    }[], dependencies: Record<string, string[]>): void;
    /**
     * Get execution order using topological sort (Kahn's algorithm)
     * Throws CircularDependencyError if cycles are detected.
     */
    getExecutionOrder(stepIds: string[], dependencies: Record<string, string[]>): string[];
    /**
     * Find a cycle in the dependency graph using DFS
     */
    findCycle(stepIds: string[], dependencies: Record<string, string[]>): string[];
    /**
     * Get execution levels for parallel execution
     * Steps in the same level have no dependencies between them
     */
    getExecutionLevels(stepIds: string[], dependencies: Record<string, string[]>): string[][];
    /**
     * Build reverse dependency map (step -> steps that depend on it)
     */
    buildReverseDependencyMap(stepIds: string[], dependencies: Record<string, string[]>): Record<string, string[]>;
    /**
     * Get all transitive dependencies of a step
     */
    getTransitiveDependencies(stepId: string, dependencies: Record<string, string[]>): Set<string>;
    /**
     * Get all transitive dependents of a step (steps that depend on it)
     */
    getTransitiveDependents(stepId: string, stepIds: string[], dependencies: Record<string, string[]>): Set<string>;
    /**
     * Check if adding a dependency would create a cycle
     */
    wouldCreateCycle(stepId: string, newDependency: string, stepIds: string[], dependencies: Record<string, string[]>): boolean;
    /**
     * Get the critical path (longest path through the graph)
     * Returns step IDs in the critical path and total duration
     */
    getCriticalPath(steps: {
        id: string;
        estimatedDuration?: number;
    }[], dependencies: Record<string, string[]>): {
        path: string[];
        duration: number;
    };
}
/**
 * Create a new dependency resolver instance
 */
export declare function createDependencyResolver(): DependencyResolver;
//# sourceMappingURL=dependency.d.ts.map