/**
 * Nexus Prime — Pattern Codebook
 *
 * A learned dictionary of common token/phrase patterns. When a pattern
 * repeats above a threshold frequency, it gets compressed into a single
 * codebook entry, achieving high compression for boilerplate and common
 * idioms while preserving novel content at full fidelity.
 *
 * Phase: 9B (Continuous Attention Streams)
 */
export interface CodebookEntry {
    id: string;
    pattern: string;
    code: string;
    frequency: number;
    weight: number;
    created: number;
    lastUsed: number;
}
export interface CodebookStats {
    size: number;
    totalCompressions: number;
    avgCompressionRatio: number;
    topPatterns: {
        pattern: string;
        frequency: number;
    }[];
}
export declare class PatternCodebook {
    private entries;
    private codeToPattern;
    private nextCode;
    private totalCompressions;
    private readonly MIN_FREQUENCY;
    private readonly MIN_LENGTH;
    private readonly MAX_ENTRIES;
    /**
     * Observe a token sequence. If it repeats enough, add to codebook.
     */
    observe(text: string): void;
    /**
     * Compress text using the learned codebook.
     * Replaces known patterns with their short codes.
     */
    compress(text: string): {
        compressed: string;
        ratio: number;
        replacements: number;
    };
    /**
     * Decompress text — expand codebook codes back to original patterns.
     */
    decompress(text: string): string;
    /**
     * Manually learn a specific pattern (e.g., from external feedback).
     */
    learnPattern(pattern: string, frequency?: number): void;
    /**
     * Get codebook statistics.
     */
    getStats(): CodebookStats;
    /** Extract word n-grams from text */
    private extractNgrams;
    /** Remove least-used entries when codebook is too large */
    private prune;
}
