/** * Executes parallel workflow steps concurrently and aggregates results. * * When onStream is provided, uses ParallelLogger to prefix each * sub-step output with `[name]` for readable interleaved display. */ import type { WorkflowStep, WorkflowState, WorkflowMaxSteps, WorkflowResumePointEntry } from '../../models/types.js'; import type { OptionsBuilder } from './OptionsBuilder.js'; import type { StepExecutor } from './StepExecutor.js'; import type { WorkflowEngineOptions, PhaseName, PhasePromptParts, JudgeStageEntry, StepRunResult } from '../types.js'; import type { RuntimeStepResolution } from '../types.js'; import type { WorkflowStepExecutionDeadlineContext } from './step-deadline.js'; import type { QualityGateRunResult } from '../quality-gates/types.js'; import type { WorkflowCallRunner } from './WorkflowCallRunner.js'; import type { DynamicParallelSelectorCoordinator } from '../dynamic-parallel/selector-coordinator.js'; export declare const MAX_EXPLICIT_PARALLEL_ERROR_RETRIES = 3; export interface ParallelRunnerDeps { readonly optionsBuilder: OptionsBuilder; readonly stepExecutor: StepExecutor; readonly engineOptions: WorkflowEngineOptions; readonly getAbortSignal?: () => AbortSignal | undefined; readonly getCwd: () => string; readonly dynamicParallelSelector: DynamicParallelSelectorCoordinator; readonly getWorkflowName: () => string; readonly getTask: () => string; readonly getInteractive: () => boolean; readonly observabilityEnabled: boolean; readonly observabilityRunId?: string; readonly sanitizeObservabilityText?: (text: string) => string; readonly getCurrentWorkflowStack?: () => WorkflowResumePointEntry[] | undefined; readonly emitEvent: (event: string, ...args: unknown[]) => void; readonly getWorkflowCallRunner?: () => WorkflowCallRunner; readonly claimStepOccurrence: (step: WorkflowStep, resumeStackPrefix: readonly WorkflowResumePointEntry[]) => number; readonly updateMaxSteps: (maxSteps: WorkflowMaxSteps) => void; readonly setActiveResumePoint: (step: WorkflowStep, iteration: number, occurrence: number) => void; readonly getRunId: () => string; readonly runQualityGates: (options: { qualityGates: WorkflowStep['qualityGates']; projectRoot: string; step: WorkflowStep; childProcessEnv?: Readonly>; observabilityEnabled: boolean; runId?: string; workflowName?: string; }) => Promise; readonly onPhaseStart?: (step: WorkflowStep, phase: 1 | 2 | 3, phaseName: PhaseName, instruction: string, promptParts: PhasePromptParts, phaseExecutionId?: string, iteration?: number) => void; readonly onPhaseComplete?: (step: WorkflowStep, phase: 1 | 2 | 3, phaseName: PhaseName, content: string, status: string, error?: string, phaseExecutionId?: string, iteration?: number) => void; readonly onJudgeStage?: (step: WorkflowStep, phase: 3, phaseName: 'judge', entry: JudgeStageEntry, phaseExecutionId?: string, iteration?: number) => void; } export declare class ParallelRunner { private readonly deps; private readonly explicitErrorAttemptsByStep; constructor(deps: ParallelRunnerDeps); private resolveAbortSignal; /** * Run a parallel step: execute all sub-steps concurrently, then aggregate results. * The aggregated output becomes the parent step response for rules evaluation. */ runParallelStep(step: WorkflowStep, state: WorkflowState, task: string, maxSteps: WorkflowMaxSteps, updatePersonaSession: (persona: string, sessionId: string | undefined) => void, runtime?: RuntimeStepResolution, activeStepIteration?: number, executionDeadlineContext?: WorkflowStepExecutionDeadlineContext): Promise; private runParallelStepAttempt; private runWorkflowCallSubStep; private requireWorkflowCallResumeStack; private mergeWorkflowCallSubStepEffects; private mergeWorkflowCallSessionUpdates; private emitSubStepRoutingDecisionEvents; private recordSubStepRoutingResults; private executeSubStepAgent; private buildParallelLoggerOptions; private createTerminalParentResult; private selectFailureByDefinitionOrder; private toRunFailure; private collectTerminalResults; private hasExplicitErrorAggregateRule; private buildSubStepErrorDiagnostic; private buildTerminalDiagnostic; private firstFailureResult; } //# sourceMappingURL=ParallelRunner.d.ts.map