/**
 * Reactive Compact — Emergency context compression when API returns prompt-too-long.
 *
 * Aligned with Claude Code's reactive compact chain:
 * 1. API 413 → withhold error → attempt reactive compact → retry
 * 2. Only one reactive compact attempt per turn (prevent infinite loops)
 * 3. Falls back to abort if compact fails
 *
 * Also handles post-compact restoration:
 * - Todo list re-injection
 * - Skill context re-injection
 * - Tool delta re-injection (new/removed tools since last compact)
 */
export interface ReactiveCompactConfig {
    /** Maximum consecutive auto-compact failures before giving up (CC: 3). */
    maxConsecutiveFailures: number;
    /** Minimum messages to keep after reactive compact. */
    minMessagesAfterCompact: number;
    /** Target token usage after compact (percentage of context window). */
    targetUsagePercent: number;
}
export declare const DEFAULT_REACTIVE_COMPACT_CONFIG: ReactiveCompactConfig;
export interface PostCompactRestorationPayload {
    /** Current active todo list to re-inject after compact. */
    todoList?: Array<{
        id: number;
        title: string;
        status: string;
    }>;
    /** Active skill context (if LLM is executing a skill). */
    activeSkillContext?: {
        name: string;
        step: number;
        instructions: string;
    };
    /** Tool delta since last compact (tools added/removed from available set). */
    toolDelta?: {
        added: string[];
        removed: string[];
    };
    /** Custom restoration blocks from memory hooks. */
    customBlocks?: Array<{
        label: string;
        content: string;
    }>;
}
/**
 * Build the restoration message to inject after a compact operation.
 * This ensures critical state survives context compression.
 */
export declare function buildPostCompactRestorationMessage(payload: PostCompactRestorationPayload): string | null;
export interface ReactiveCompactState {
    /** Number of consecutive compact failures. */
    consecutiveFailures: number;
    /** Whether reactive compact has been attempted in this turn. */
    attemptedThisTurn: boolean;
    /** Last compact timestamp. */
    lastCompactAt: number | null;
    /** Tool names at time of last compact (for delta calculation). */
    toolsAtLastCompact: string[];
}
export declare function createReactiveCompactState(): ReactiveCompactState;
/**
 * Determine if reactive compact should be attempted.
 */
export declare function shouldAttemptReactiveCompact(state: ReactiveCompactState, config?: ReactiveCompactConfig): boolean;
/**
 * Calculate the tool delta since last compact.
 */
export declare function computeToolDelta(currentTools: string[], toolsAtLastCompact: string[]): {
    added: string[];
    removed: string[];
};
