/** * Merge Ordering Utility * * Computes the order in which worktrees should be merged based on * pipeline step dependencies using topological sort. */ export interface StepDependency { id: string; dependsOn: string[]; } /** * Compute merge order for pipeline steps using topological sort. * Returns array of arrays - each inner array contains steps that can merge in parallel. * * @param steps - Array of steps with their dependencies * @returns Batched merge order (steps in each batch have no dependencies on each other) * @throws Error if circular dependency detected */ export declare function computeMergeOrder(steps: StepDependency[]): string[][]; /** * Validate that all dependencies exist in the step list. * * @param steps - Array of steps with their dependencies * @returns Array of missing dependency errors */ export declare function validateDependencies(steps: StepDependency[]): string[]; /** * Get all steps that depend on a given step (direct and transitive). * Useful for determining impact of a step failure. * * @param stepId - The step to find dependents for * @param steps - All steps in the pipeline * @returns Array of step IDs that depend on the given step */ export declare function getDependents(stepId: string, steps: StepDependency[]): string[]; /** * Check if merging a step is safe (all its dependencies are already merged). * * @param stepId - The step to check * @param steps - All steps in the pipeline * @param mergedSteps - Set of already merged step IDs * @returns true if safe to merge */ export declare function canMergeStep(stepId: string, steps: StepDependency[], mergedSteps: Set): boolean; //# sourceMappingURL=merge-ordering.d.ts.map