/** * DAG Execution Engine for Composite Steps * * Why: Enables parallel execution of independent composite steps * while maintaining correct dependency order. * * Uses Kahn's algorithm for topological sorting - BFS-based approach * that detects cycles and determines execution levels. */ import type { CompositeStep } from '../types/profile.js'; /** * Execution level containing steps that can run in parallel */ export interface ExecutionLevel { steps: CompositeStep[]; stepIndices: number[]; } /** * Topological sort result for DAG execution */ export interface TopologicalSortResult { levels: ExecutionLevel[]; hasCycles: boolean; errorMessage?: string; } /** * Execute composite steps with DAG-based parallelization * * Why: Some steps may depend on others (e.g., get MR ID, then fetch comments). * Independent steps can run in parallel for better performance. */ export declare class DAGExecutor { /** * Sort composite steps into execution levels using Kahn's algorithm * * @param steps Composite steps with optional depends_on * @returns Execution levels where each level can run in parallel * @throws Error if cycles detected or invalid dependencies */ static topologicalSort(steps: CompositeStep[]): ExecutionLevel[]; /** * Analyze DAG structure without throwing * * @param steps Composite steps to analyze * @returns Analysis result with levels or error info */ static analyzeDAG(steps: CompositeStep[]): TopologicalSortResult; } //# sourceMappingURL=dag-executor.d.ts.map