/** * Pipeline Manager * * Manages multi-step task DAGs with dependency resolution. * Generates TaskCreate instructions for Claude to execute. */ import type { Logger } from "../observability/logger.js"; import type { WorktreeManager } from "../worktrees/manager.js"; import type { AgentResponse, PipelineDefinition, PipelineExecution, PipelineStep, StepWorktreeAllocation } from "../types.js"; export declare class PipelineManager { private executions; private stepWorktrees; private logger; constructor(logger: Logger); /** * Allocate a worktree for a pipeline step. */ allocateWorktreeForStep(stepId: string, allocation: StepWorktreeAllocation): void; /** * Get the worktree allocation for a step. */ getStepWorktree(stepId: string): StepWorktreeAllocation | undefined; /** * Get all allocated worktrees. */ getAllocatedWorktrees(): Map; /** * Update the status of a step's worktree allocation. */ updateStepWorktreeStatus(stepId: string, status: StepWorktreeAllocation['status']): void; /** * Validate pipeline definition for cycles and missing dependencies. * Uses topological sort (Kahn's algorithm) to detect cycles. * @throws Error if validation fails */ validateDefinition(definition: PipelineDefinition): void; /** * Generate TaskCreate instructions for all pipeline steps. * Returns a string with all the TaskCreate calls Claude should execute. */ generatePipelineCreation(definition: PipelineDefinition): string; /** * Create a new pipeline execution tracker. */ createExecution(definition: PipelineDefinition): PipelineExecution; /** * Get a pipeline execution by ID. */ getExecution(pipelineId: string): PipelineExecution | undefined; /** * Register task IDs after Claude creates the tasks. */ registerTaskIds(pipelineId: string, taskIdMap: Map): void; /** * Determine which steps are ready to execute (all dependencies complete). */ getReadySteps(execution: PipelineExecution): PipelineStep[]; /** * Mark a step as completed with its result. */ completeStep(pipelineId: string, stepName: string, result: AgentResponse): void; /** * Mark a step as failed. */ failStep(pipelineId: string, stepName: string, error: Error): void; /** * Build context for a step, including results from completed dependencies. * Truncates if total context exceeds MAX_CONTEXT_LENGTH. */ buildStepContext(execution: PipelineExecution, step: PipelineStep): string; /** * Get all active pipeline executions. */ getActiveExecutions(): PipelineExecution[]; /** * Cleanup worktrees after successful pipeline merge. * @param pipelineId - Pipeline to cleanup * @param worktreeManager - WorktreeManager instance * @param deleteBranches - Whether to delete the merged branches */ cleanupPipelineWorktrees(pipelineId: string, worktreeManager: WorktreeManager, deleteBranches?: boolean): Promise<{ cleaned: number; errors: string[]; }>; /** * Mark a pipeline as failed and preserve worktrees for debugging. * @param pipelineId - Pipeline to rollback * @param reason - Failure reason */ markPipelineFailed(pipelineId: string, reason: string): void; /** * Get cleanup summary for a pipeline. */ getWorktreeCleanupSummary(): { total: number; pending: number; active: number; completed: number; merged: number; conflict: number; }; } //# sourceMappingURL=pipeline-manager.d.ts.map