/**
 * Head/Tail Output Truncation (Codex-inspired)
 *
 * Keeps the first N and last M lines of large outputs,
 * inserting a "[... X lines omitted ...]" marker in the middle.
 * Better than simple truncation because it preserves both
 * the beginning (setup/context) and end (results/errors) of output.
 */
export interface HeadTailOptions {
    /** Max lines to keep from the start (default: 100) */
    headLines?: number;
    /** Max lines to keep from the end (default: 80) */
    tailLines?: number;
    /** Max total characters allowed (default: 50000) */
    maxChars?: number;
    /** Max output size in bytes before triggering (default: 1MB) */
    maxBytes?: number;
}
export interface TruncationResult {
    output: string;
    truncated: boolean;
    originalLines: number;
    omittedLines: number;
    originalBytes: number;
}
/**
 * Apply head/tail truncation to output text.
 * Returns the truncated text with a marker showing omitted lines.
 */
export declare function headTailTruncate(text: string, options?: HeadTailOptions): TruncationResult;
/**
 * Quick check if text exceeds thresholds and needs truncation.
 */
export declare function needsTruncation(text: string, options?: HeadTailOptions): boolean;
export interface SemanticTruncationOptions extends HeadTailOptions {
    /** Preserve error lines (stderr patterns) in the middle section */
    preserveErrors?: boolean;
    /** Preserve JSON structure (keep opening/closing braces balanced) */
    preserveJson?: boolean;
    /** Custom patterns to always preserve (regex) */
    preservePatterns?: RegExp[];
}
/**
 * Semantic truncation: preserves important content in the middle.
 *
 * Unlike basic head/tail truncation, this:
 * 1. Scans the middle section for error patterns
 * 2. Preserves those error lines in the output
 * 3. Attempts to keep JSON structure balanced
 * 4. Preserves custom user-defined patterns
 */
export declare function semanticTruncate(text: string, options?: SemanticTruncationOptions): TruncationResult;
