/**
 * HeadroomPolicy — proactive context compaction trigger.
 *
 * Industrial control-loop policy: given current token usage and model
 * context window, decide whether to compact BEFORE utilization reaches
 * a configurable threshold (default 90%).
 *
 * Prefers the external `headroom` CLI compressor when available;
 * falls back to the built-in `optimizeContextBudget` when not.
 *
 * Deterministic except for the injectable `runHeadroom` runner.
 */
export interface HeadroomDecision {
    readonly shouldCompact: boolean;
    readonly utilization: number;
    readonly threshold: number;
    readonly usedTokens: number;
    readonly contextWindow: number;
    readonly reason: string;
}
export interface HeadroomCompactResult {
    readonly compacted: boolean;
    readonly via: "headroom" | "fallback" | "none";
}
export declare function resolveHeadroomThreshold(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): number;
export declare function isHeadroomEnabled(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): boolean;
export declare function evaluateHeadroom(input: {
    usedTokens: number;
    contextWindow: number;
    env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
}): HeadroomDecision;
export declare function maybeCompactWithHeadroom(args: {
    decision: HeadroomDecision;
    text?: string;
    runHeadroom?: (text: string) => Promise<string | null>;
    fallback?: () => Promise<void>;
}): Promise<HeadroomCompactResult>;
