/**
 * Dependency checking - validate task dependency graphs.
 * Ported from lib/tasks/dependency-check.sh
 *
 * @epic T4454
 * @task T4529
 */
import type { Task } from '@cleocode/contracts';
/** Result of a dependency validation check. */
export interface DependencyCheckResult {
    valid: boolean;
    errors: DependencyError[];
    warnings: DependencyWarning[];
}
/** A dependency error. */
export interface DependencyError {
    code: string;
    taskId: string;
    message: string;
    relatedIds?: string[];
}
/** A dependency warning. */
export interface DependencyWarning {
    code: string;
    taskId: string;
    message: string;
}
/**
 * Detect circular dependencies using DFS.
 * Returns the cycle path if found, empty array otherwise.
 */
export declare function detectCircularDeps(taskId: string, tasks: Task[]): string[];
/**
 * Check if adding a dependency would create a cycle.
 */
export declare function wouldCreateCycle(fromId: string, toId: string, tasks: Task[]): boolean;
/**
 * Get tasks that are blocked (have unmet dependencies).
 */
export declare function getBlockedTasks(tasks: Task[]): Task[];
/**
 * Get tasks that are ready (all dependencies met).
 */
export declare function getReadyTasks(tasks: Task[]): Task[];
/**
 * Get tasks that depend on a given task.
 */
export declare function getDependents(taskId: string, tasks: Task[]): Task[];
/**
 * Get dependent IDs.
 */
export declare function getDependentIds(taskId: string, tasks: Task[]): string[];
/**
 * Get unresolved dependencies for a task (deps that are not done/cancelled).
 */
export declare function getUnresolvedDeps(taskId: string, tasks: Task[]): string[];
/**
 * Validate dependencies for missing references.
 */
export declare function validateDependencyRefs(tasks: Task[]): DependencyError[];
/**
 * Full dependency graph validation.
 */
export declare function validateDependencies(tasks: Task[]): DependencyCheckResult;
/**
 * Topological sort of tasks by dependencies.
 * Returns sorted task IDs or null if cycle detected.
 */
export declare function topologicalSort(tasks: Task[]): string[] | null;
/**
 * Walk upstream recursively through a task's dependency chain.
 * Returns all non-done/non-cancelled dependency IDs (deduplicated).
 * Uses a visited set for cycle protection.
 */
export declare function getTransitiveBlockers(taskId: string, tasks: Task[]): string[];
/**
 * From the transitive blockers, return only "leaf" blockers — those whose
 * own dependencies are all resolved (done/cancelled) or that have no
 * dependencies at all. These are the root-cause tasks that need action first.
 */
export declare function getLeafBlockers(taskId: string, tasks: Task[]): string[];
//# sourceMappingURL=dependency-check.d.ts.map