/**
 * Nexus Prime — Continuous Attention Stream (CAS) Engine
 *
 * Replaces discrete token chunks with weighted continuous fluid potentials.
 * Common patterns get compressed; novel information gets expanded.
 * Achieves 5-100× effective context expansion by treating tokens as
 * weighted attention units rather than flat character sequences.
 *
 * "What if tokens weren't discrete?"
 *   Current: [word][word][word] → discrete tokens
 *   CAS:     [word=========]   → weighted continuous
 *
 * Phase: 9B (Continuous Attention Streams)
 */
import { PatternCodebook } from './pattern-codebook.js';
export interface AttentionFluid {
    /** Original tokens before compression */
    tokens: string[];
    /** Per-token attention weight (0.0 - 1.0) */
    weights: number[];
    /** The compressed output stream */
    compressed: string;
    /** Compression ratio achieved */
    compressionRatio: number;
    /** Per-token novelty flag: true = novel/expanded, false = compressed */
    noveltyMap: boolean[];
    /** Total attention allocated (sum of weights) */
    totalAttention: number;
}
export interface CASStats {
    codebookSize: number;
    totalEncodes: number;
    totalDecodes: number;
    avgCompression: number;
    patternsLearned: number;
}
export declare class AttentionScorer {
    private documentFrequency;
    private totalDocuments;
    /**
     * Update IDF statistics from a new document.
     */
    observe(tokens: string[]): void;
    /**
     * Splits text into code-aware tokens, handling CamelCase, punctuation, and whitespace.
     */
    static tokenize(text: string): string[];
    /**
     * Compute attention weights for tokens relative to a task.
     * Uses TF-IDF + task relevance to assign weights.
     *
     * Higher weight = more novel/important = gets expanded.
     * Lower weight = more common = gets compressed.
     */
    score(tokens: string[], task: string): number[];
}
export declare class ContinuousAttentionStream {
    private codebook;
    private scorer;
    private totalEncodes;
    private totalDecodes;
    private compressionHistory;
    constructor(codebook?: PatternCodebook);
    /**
     * Encode: convert discrete token array into weighted continuous stream.
     *
     * 1. Score tokens by attention weight (TF-IDF + task relevance)
     * 2. Compress common patterns via codebook
     * 3. Expand novel tokens (keep at full fidelity)
     * 4. Produce a compressed output string
     */
    encode(tokens: string[], task: string): AttentionFluid;
    /**
     * Decode: expand compressed stream back to weighted tokens.
     */
    decode(fluid: AttentionFluid): string[];
    /**
     * Manually teach the codebook a common pattern.
     */
    learnPattern(pattern: string, frequency?: number): void;
    /**
     * Get CAS statistics.
     */
    getStats(): CASStats;
    /**
     * Get the underlying codebook for direct access.
     */
    getCodebook(): PatternCodebook;
    private median;
}
