/**
 * Enhanced Context Compression
 *
 * Advanced compression strategies that preserve important information:
 * - Sliding window with overlap for continuity
 * - Intelligent summarization of old messages
 * - Key information preservation (decisions, errors, modified files)
 * - Content-type-aware compression
 * - Compression metrics tracking
 * - Full context recovery capability
 */
import { CodeBuddyMessage } from '../codebuddy/client.js';
import { TokenCounter } from './token-counter.js';
import { EnhancedCompressionResult, SlidingWindowConfig, SummarizationConfig } from './types.js';
/**
 * Configuration for the enhanced compression engine.
 */
export interface EnhancedCompressionConfig {
    /** Sliding window configuration. */
    slidingWindow: SlidingWindowConfig;
    /** Summarization configuration. */
    summarization: SummarizationConfig;
    /** Maximum length for tool outputs before truncation. */
    maxToolOutputLength: number;
    /** Whether to archive full context before compression. */
    enableArchiving: boolean;
    /** Maximum archives to keep in memory. */
    maxArchives: number;
    /** Importance threshold for preservation (0-1). */
    preservationThreshold: number;
}
/**
 * Default configuration for enhanced compression.
 */
export declare const DEFAULT_ENHANCED_CONFIG: EnhancedCompressionConfig;
/**
 * Enhanced Context Compression Engine.
 *
 * Implements advanced compression strategies while preserving
 * important context and enabling recovery of full history.
 */
export declare class EnhancedContextCompressor {
    private config;
    private tokenCounter;
    private archives;
    private archiveIdCounter;
    constructor(tokenCounter: TokenCounter, config?: Partial<EnhancedCompressionConfig>);
    /**
     * Compress messages with enhanced strategies and preservation.
     *
     * @param messages - Messages to compress.
     * @param tokenLimit - Maximum allowed tokens.
     * @param sessionId - Optional session identifier for archiving.
     * @returns Enhanced compression result with metrics and preserved info.
     */
    compress(messages: CodeBuddyMessage[], tokenLimit: number, sessionId?: string): EnhancedCompressionResult;
    /**
     * Apply sliding window with overlap for continuity.
     * Keeps a window of recent messages plus overlap from previous context.
     */
    private applySlidingWindowWithOverlap;
    /**
     * Smart truncation of tool results based on content type.
     * Preserves more information from error outputs and code.
     */
    private truncateToolResultsSmart;
    /**
     * Apply intelligent summarization that preserves key information.
     */
    private applyIntelligentSummarization;
    /**
     * Remove messages by importance score when other strategies insufficient.
     */
    private removeByImportance;
    /**
     * Hard truncation as last resort - keeps most recent messages.
     */
    private hardTruncate;
    /**
     * Classify all messages by content type and importance.
     */
    private classifyMessages;
    /**
     * Detect the content type of a message.
     */
    private detectContentType;
    /**
     * Calculate importance score for a message.
     */
    private calculateImportance;
    /**
     * Extract key information from messages.
     */
    private extractKeyInformation;
    /**
     * Create a summary of conversation flow.
     */
    private summarizeConversationFlow;
    /**
     * Create a context summary for old messages.
     */
    private createContextSummary;
    /**
     * Archive the full context before compression.
     */
    private archiveContext;
    /**
     * Recover full context from an archive.
     *
     * @param archiveId - The archive ID to recover, or undefined for most recent.
     * @returns The archived messages, or undefined if not found.
     */
    recoverContext(archiveId?: string): CodeBuddyMessage[] | undefined;
    /**
     * List available archives.
     */
    listArchives(): Array<{
        id: string;
        timestamp: Date;
        messageCount: number;
        tokenCount: number;
    }>;
    /**
     * Clear all archives.
     */
    clearArchives(): void;
    /**
     * Get current configuration.
     */
    getConfig(): EnhancedCompressionConfig;
    /**
     * Update configuration.
     */
    updateConfig(config: Partial<EnhancedCompressionConfig>): void;
    /**
     * Count tokens in messages.
     */
    private countTokens;
    /**
     * Create the compression result object.
     */
    private createResult;
}
