import type { TurnMiddleware } from "./turn-middleware.js";
/** Threshold (fraction of context window) that triggers the soft warning. */
export declare const CONTEXT_WARNING_THRESHOLD = 0.85;
/**
 * Threshold that triggers proactive compaction in `prepareReplyTurn`.
 * Higher than the soft warning so the user sees the heads-up first;
 * compaction runs the next turn the threshold is observed.
 */
export declare const CONTEXT_PROACTIVE_COMPACT_THRESHOLD = 0.9;
/**
 * Pure decision for "should `prepareReplyTurn` run proactive compaction
 * before the next turn?" — extracted so the trigger logic is unit-testable
 * without mocking the rest of the prep pipeline.
 *
 * Returns true ONLY when:
 *   - we have a session id (otherwise compaction has no target),
 *   - we have a positive context window,
 *   - we have a positive cumulative usage from the previous turn,
 *   - usage / window ≥ CONTEXT_PROACTIVE_COMPACT_THRESHOLD.
 */
export declare function shouldProactivelyCompact(args: {
    totalTokens: number | undefined;
    contextTokens: number | undefined;
    sessionId: string | undefined;
}): boolean;
/**
 * After-turn hook that surfaces a one-time soft warning when usage
 * crosses the context threshold. Mutates the result text to append
 * the warning when triggered, and persists `contextWarningSent: true`
 * on the session entry so the warning doesn't fire again.
 */
export declare function withContextUsageWarning(): TurnMiddleware;
