/**
 * Middleware pipeline orchestrator.
 *
 * Implements the same { onMessage, finalize } interface that runAgent() expects,
 * while internally dispatching to an ordered list of middleware plugins.
 */
import { PhaseDetector } from './phase-detector';
import type { Middleware, SDKMessage } from './types';
export declare class MiddlewarePipeline {
    private middlewares;
    private store;
    private phaseDetector;
    private autoDetectPhases;
    private _currentPhase;
    private _currentPhaseFreshContext;
    constructor(middlewares: Middleware[], opts?: {
        phaseDetector?: PhaseDetector;
        autoDetectPhases?: boolean;
    });
    /** Feed an SDK message through all middleware (satisfies tracker.onMessage) */
    onMessage(message: SDKMessage): void;
    /** Finalize the run (satisfies tracker.finalize) */
    finalize(resultMessage: SDKMessage, totalDurationMs: number): unknown;
    /** Explicit phase start (for phased runner support) */
    startPhase(name: string, freshContext: boolean): void;
    private transitionPhase;
    private createContext;
    private createStore;
}
