/** * Dependency graph resolution - topological sort, cycle detection, impact analysis. * @task T4464 * @task T4659 * @epic T4454 * @epic T4654 */ import type { Task, TaskRef } from '@cleocode/contracts'; import { type DataAccessor } from '../store/data-accessor.js'; /** * Invalidate the cached TaskFile (call after writes). * @task T4659 * @epic T4654 */ export declare function invalidateDepsCache(): void; /** A node in the dependency graph. */ export interface DepNode { id: string; title: string; status: string; depends: string[]; dependents: string[]; } /** Dependency overview result. */ export interface DepsOverviewResult { nodes: DepNode[]; totalTasks: number; withDependencies: number; withDependents: number; roots: string[]; leaves: string[]; } /** Single task dependency result. */ export interface TaskDepsResult { task: TaskRef; upstream: TaskRef[]; downstream: TaskRef[]; blockedBy: TaskRef[]; } /** Execution wave (group of parallelizable tasks). */ export interface ExecutionWave { wave: number; tasks: Array; } /** Critical path result. */ export interface CriticalPathResult { path: TaskRef[]; length: number; } /** Cycle detection result. */ export interface CycleResult { hasCycles: boolean; cycles: string[][]; } /** * Build an adjacency graph from task dependencies. * @task T4464 */ export declare function buildGraph(tasks: Task[]): Map; /** * Get dependency overview for all tasks. * @task T4464 */ export declare function getDepsOverview(cwd?: string, accessor?: DataAccessor): Promise; /** * Get dependencies for a specific task. * @task T4464 */ export declare function getTaskDeps(taskId: string, cwd?: string, accessor?: DataAccessor): Promise; /** * Topological sort of tasks respecting dependencies. * Returns tasks in execution order. Throws on cycles. * @task T4464 */ export declare function topologicalSort(tasks: Task[]): Task[]; /** * Group tasks into parallelizable execution waves. * @task T4464 */ export declare function getExecutionWaves(epicId?: string, cwd?: string, accessor?: DataAccessor): Promise; /** * Find the critical path (longest dependency chain) from a task. * @task T4464 */ export declare function getCriticalPath(taskId: string, cwd?: string, accessor?: DataAccessor): Promise; /** * Find all tasks affected by changes to a given task. * @task T4464 */ export declare function getImpact(taskId: string, maxDepth?: number, cwd?: string, accessor?: DataAccessor): Promise; /** * Detect circular dependencies in the task graph. * @task T4464 */ export declare function detectCycles(cwd?: string, accessor?: DataAccessor): Promise; /** * Build task hierarchy tree. * @task T4464 */ export declare function getTaskTree(rootId?: string, cwd?: string, accessor?: DataAccessor): Promise; /** Tree node representation. */ export interface TreeNode { id: string; title: string; status: string; type?: string; children: TreeNode[]; } /** * Manage task relationships (relates/blocks). * @task T4464 */ export declare function addRelation(taskId: string, relatedId: string, _cwd?: string, accessor?: DataAccessor): Promise<{ taskId: string; relatedId: string; }>; //# sourceMappingURL=deps.d.ts.map