/**
 * Context Compression Module for UAP
 *
 * Implements semantic compression to reduce token usage while preserving meaning.
 * Based on Acon (Agent Context Optimization) and AgentCompress research.
 */
export interface CompressionResult {
    original: string;
    compressed: string;
    originalTokens: number;
    compressedTokens: number;
    tokenReduction: number;
    preservedSemantics: number;
}
export interface CompressorConfig {
    maxTokens: number;
    minSemanticPreservation: number;
    compressionLevel: 'light' | 'medium' | 'aggressive';
}
/**
 * Estimate token count using improved heuristics for mixed code/prose
 * More accurate than simple length/4: accounts for whitespace splits,
 * special characters, camelCase, and numeric tokens.
 */
export declare function estimateTokens(text: string): number;
/**
 * Compress a single memory entry
 */
export declare function compressMemoryEntry(content: string, config?: Partial<CompressorConfig>): CompressionResult;
/**
 * Compress multiple memories into a consolidated context
 */
export declare function compressMemoryBatch(memories: Array<{
    content: string;
    type: string;
    importance?: number;
}>, config?: Partial<CompressorConfig>): CompressionResult;
/**
 * Summarize old memories into a single compressed entry
 */
export declare function summarizeMemories(memories: Array<{
    content: string;
    timestamp: string;
    type: string;
}>, maxOutputTokens?: number): string;
/**
 * Smart truncation using head+tail split.
 * Preserves both initial context (setup, config) and final output (errors, results).
 * Head gets 60%, tail gets 40% of the allowed line budget.
 */
export declare function smartTruncate(content: string, maxChars: number): string;
/**
 * Context budget manager
 */
export declare class ContextBudget {
    private maxTokens;
    private usedTokens;
    private sections;
    constructor(maxTokens?: number);
    allocate(section: string, content: string): {
        content: string;
        tokens: number;
        truncated: boolean;
    };
    remaining(): number;
    usage(): {
        total: number;
        used: number;
        remaining: number;
        sections: Record<string, number>;
    };
    reset(): void;
}
/**
 * Compression tier based on remaining budget
 */
export type CompressionTier = 'light' | 'medium' | 'aggressive';
/**
 * Dynamic Compressor - adjusts compression level based on available context budget.
 *
 * Tiers:
 * - light   (budget >70% remaining): remove whitespace/comments only
 * - medium  (30-70%): also summarize verbose sections
 * - aggressive (<30%): extract only key facts
 */
export declare class DynamicCompressor {
    /**
     * Determine compression tier from budget ratio.
     */
    private determineTier;
    /**
     * Light compression: strip whitespace and comment lines only.
     */
    private compressLight;
    /**
     * Medium compression: light + summarize verbose sections by removing filler.
     */
    private compressMedium;
    /**
     * Aggressive compression: extract only key facts (entities, decisions, actions).
     */
    private compressAggressive;
    /**
     * Compress content dynamically based on remaining context budget.
     *
     * @param content - The text to compress
     * @param budgetRemaining - Tokens remaining in the context budget
     * @param budgetTotal - Total context budget in tokens
     * @returns Compressed content and compression ratio
     */
    compressDynamic(content: string, budgetRemaining: number, budgetTotal: number): {
        compressed: string;
        ratio: number;
    };
}
//# sourceMappingURL=context-compressor.d.ts.map