/**
 * Shared truncation utilities for tool outputs.
 *
 * Single limit: character count (default 20,000 chars).
 * Truncation always happens at line boundaries — never mid-line.
 */
export declare const DEFAULT_MAX_CHARS = 50000;
export declare const GREP_MAX_LINE_LENGTH = 500;
export declare const ERROR_MAX_CHARS_UI = 200;
export declare const ERROR_MAX_CHARS_LLM = 500;
export interface TruncationResult {
    /** The truncated content */
    content: string;
    /** Whether truncation occurred */
    truncated: boolean;
    /** Total number of characters in the original content */
    totalChars: number;
    /** Number of characters in the truncated output */
    outputChars: number;
    /** The max chars limit that was applied */
    maxChars: number;
}
/**
 * Format character count as human-readable size.
 */
export declare function formatSize(chars: number): string;
/**
 * Truncate content from the head (keep first N chars).
 * Cuts at the last complete line boundary before maxChars.
 * If the first line alone exceeds maxChars, returns it hard-cut at maxChars.
 */
export declare function truncateHead(content: string, maxChars?: number): TruncationResult;
/**
 * Truncate content from the tail (keep the last N chars).
 * Cuts at the first complete line boundary after the start point.
 * If no newline exists after the start point, returns the last maxChars chars.
 */
export declare function truncateTail(content: string, maxChars?: number): TruncationResult;
/**
 * Truncate content and return a single string with a notice appended if truncated.
 * This is the main entry point for tool outputs going back to the LLM.
 *
 * Returns content as-is if no truncation needed, or:
 *   <truncated content>\n\n[Truncated: showing 5.0k of 50.0k chars]
 */
export declare function truncateOutput(content: string, maxChars?: number): string;
/**
 * Truncate long errors by keeping both the start and the end.
 * This preserves traceback endings where the exception type/message usually lives.
 */
export declare function truncateErrorOutput(content: string, maxChars?: number): string;
/**
 * Truncate a single line to max characters, adding [truncated] suffix.
 * Used for grep match lines.
 */
export declare function truncateLine(line: string, maxChars?: number): {
    text: string;
    wasTruncated: boolean;
};
//# sourceMappingURL=truncate.d.ts.map