import type { AgentResponse, LoopMonitorConfig, WorkflowMaxSteps, WorkflowState, WorkflowStep } from '../../models/types.js';
import type { RuntimeStepResolution, StepProviderInfo, StepRunResult, WorkflowEngineOptions, WorkflowRunResult } from '../types.js';
import type { WorkflowRuleTransition } from './transitions.js';
import { type StepSpanParams } from '../observability/workflowSpans.js';
import type { QualityGateRunResult } from '../quality-gates/types.js';
interface WorkflowRunLoopDeps {
    state: WorkflowState;
    options: WorkflowEngineOptions;
    getWorkflowName: () => string;
    getCurrentWorkflowStack: () => StepSpanParams['workflowStack'];
    getCwd: () => string;
    getMaxSteps: () => WorkflowMaxSteps;
    getReportDir: () => string;
    abortRequested: () => boolean;
    getStep: (name: string) => WorkflowStep;
    applyRuntimeEnvironment: (stage: 'step') => void;
    loopDetectorCheck: (stepName: string) => {
        shouldWarn?: boolean;
        shouldAbort?: boolean;
        count: number;
        isLoop: boolean;
    };
    cycleDetectorRecordAndCheck: (stepName: string) => {
        triggered: boolean;
        monitor?: LoopMonitorConfig;
        cycleCount: number;
    };
    resolveDoneTransition: (step: WorkflowStep, response: AgentResponse) => WorkflowRuleTransition;
    runLoopMonitorJudge: (monitor: LoopMonitorConfig, cycleCount: number, triggeringStep: WorkflowStep, triggeringRuntime?: RuntimeStepResolution) => Promise<string>;
    runStep: (step: WorkflowStep, prebuiltInstruction?: string, runtime?: RuntimeStepResolution) => Promise<StepRunResult>;
    runQualityGates: (options: {
        qualityGates: WorkflowStep['qualityGates'];
        projectRoot: string;
        step: WorkflowStep;
    }) => Promise<QualityGateRunResult>;
    persistPreviousResponseSnapshot: (state: WorkflowState, stepName: string, stepIteration: number, content: string) => void;
    buildInstruction: (step: WorkflowStep, stepIteration: number) => string;
    buildPhase1Instruction: (step: WorkflowStep, instruction: string, runtime?: RuntimeStepResolution) => string;
    resolveStepProviderModel: (step: WorkflowStep, runtime?: RuntimeStepResolution) => StepProviderInfo;
    resolveRuntimeForStep: (step: WorkflowStep) => RuntimeStepResolution | undefined;
    setActiveStep: (step: WorkflowStep, iteration: number) => void;
    addUserInput: (input: string) => void;
    emit: (event: string, ...args: unknown[]) => void;
    updateMaxSteps: (maxSteps: number) => void;
}
export declare function runWorkflowToCompletion(deps: WorkflowRunLoopDeps): Promise<WorkflowRunResult>;
export declare function runSingleWorkflowIteration(deps: WorkflowRunLoopDeps): Promise<{
    response: AgentResponse;
    nextStep: string;
    isComplete: boolean;
    loopDetected?: boolean;
}>;
export {};
//# sourceMappingURL=WorkflowRunLoop.d.ts.map