/**
 * Context compression pipeline — extracted phase of the tool loop (CC query.ts parity).
 *
 * Pure-ish transform with a side-channel of `recovery` events: takes the round's
 * messages and runs the staged compaction
 *   tool-result-budget → snip → microcompact → context-collapse → autocompact
 * → whitespace filter, returning the messages to send to the LLM. Each stage runs
 * before the next; an earlier stage that brings us under threshold makes later
 * stages no-ops.
 *
 * Extracted from the main loop to cut its reading cost: this phase has no control-flow
 * escape (never continues/returns the outer loop), so it is a clean `yield*` boundary.
 * The only outward state mutation (resetting the reactive-compact guard after autocompact)
 * is handed back through `onAutocompact` so the loop keeps ownership of its State.
 */
import type { AgentLogger, HookRegistry, TurnEvent } from "../types.js";
import type { ToolLoopRuntimePorts } from "../../runtime/ports/index.js";
import { type CollapseStore, type TurnLoopGuardConfig, type TurnLoopGuardState } from "../../orchestration/index.js";
export interface CompressionPipelineDeps {
    messages: unknown[];
    contentReplacementState: unknown;
    snipRemovedIds: Set<string>;
    collapseStore: CollapseStore;
    guardState: TurnLoopGuardState;
    guardConfig: TurnLoopGuardConfig;
    runtimePorts: ToolLoopRuntimePorts;
    hooks: HookRegistry | undefined;
    hookCtx: {
        sessionId: string;
        turnId: string;
    };
    sessionId: string;
    currentModel: string;
    log: AgentLogger;
    /** Build + record a recovery event (centralized in the loop's recovery trace). */
    recovery: (action: string, detail?: string) => TurnEvent;
    /** Invoked when autocompact drops messages — caller resets its reactive-compact guard. */
    onAutocompact: () => void;
}
/**
 * Run the compression pipeline for one round. Yields `recovery` events for stages
 * that actually fired; returns the (possibly compacted) messages to query with.
 */
export declare function runCompressionPipeline(deps: CompressionPipelineDeps): AsyncGenerator<TurnEvent, unknown[]>;
