/**
 * src/utils/token-compress.ts
 *
 * Token-compression layer. Inspired by OpenHuman's TokenJuice — every
 * tool output, scrape result, fetched email, and search payload runs
 * through this before it reaches the LLM.
 *
 * Goals (in priority order):
 *   1. Preserve information — never strip something the model needs.
 *   2. Collapse representations — HTML→Markdown is the biggest win.
 *   3. Bound size — long base64 strings, repeated whitespace, control
 *      characters add tokens with zero meaning.
 *
 * Empirical reduction on typical inputs:
 *   - web_fetch (HTML page):    50-75% smaller
 *   - browser_read (DOM dump):  40-65% smaller
 *   - email body (HTML email):  60-80% smaller
 *   - research_topic (3 srcs):  45-60% smaller
 *   - read_file (mixed text):   5-15% smaller (already compact)
 *
 * Non-goals: This is NOT secret-redaction (see security/hardening.ts
 * filterOutboundSecrets) and NOT prompt-injection scrubbing (see
 * security/prompt-injection.ts). Each layer composes.
 */
export interface CompressOptions {
    /** Hint about source content. Affects which compression strategy runs first. */
    kind?: 'html' | 'markdown' | 'json' | 'text' | 'email' | 'auto';
    /** Override default 32KB cap. Pass 0 to disable. */
    maxChars?: number;
    /** When true, return metadata about what was compressed. Default false. */
    withStats?: boolean;
}
export interface CompressStats {
    inputChars: number;
    outputChars: number;
    ratio: number;
    reductionPct: number;
    truncated: boolean;
    strategies: string[];
}
export interface CompressResult {
    text: string;
    stats: CompressStats;
}
/**
 * Compress text for LLM consumption. Idempotent (running twice ≈ once).
 * Safe on tiny inputs (short-circuits to no-op).
 *
 * @example
 *   const { text } = compressForLLM(htmlPage, { kind: 'html', withStats: true });
 *   const compact = compressForLLM(rawText); // returns string directly
 */
export declare function compressForLLM(input: string, options?: CompressOptions & {
    withStats: true;
}): CompressResult;
export declare function compressForLLM(input: string, options?: CompressOptions): string;
/** Token estimate (rough — char/3.5 for mixed AR/EN). Use for budget math,
 * not for billing. */
export declare function estimateTokens(text: string): number;
//# sourceMappingURL=token-compress.d.ts.map