export declare const MAX_LINES = 2000; export declare const MAX_BYTES: number; /** @deprecated Use MAX_BYTES instead. Kept for backwards compatibility with tests. */ export declare const MAX_CHARS: number; export interface TruncateResult { content: string; truncated: boolean; totalLines: number; keptLines: number; } /** * Truncate from the end — keep the first N lines. * Used by the read tool. */ export declare function truncateHead(content: string, maxLines?: number, maxBytes?: number): TruncateResult; /** * Truncate from the beginning — keep the last N lines. * Used by the bash tool. */ export declare function truncateTail(content: string, maxLines?: number, maxBytes?: number): TruncateResult; /** Hard cap on the descriptor appended to a truncation note. */ export declare const OMITTED_NOTE_MAX_CHARS = 300; /** * Describe WHAT a truncation dropped, so the agent can decide whether to fetch * the rest (modelled on headroomlabs-ai/headroom PR #3635's CCR descriptor): * error/warning line counts, distinct error codes / exception names, distinct * source files referenced by diagnostics/stack frames, and the first few * distinct error lines. Labels, files and sample lines already visible in * `shown` are left out — the note justifies retrieval, it doesn't restate. * * Returns `""` when nothing notable was cut (the note stays byte-identical), * otherwise `"Omitted part: …."`, never longer than OMITTED_NOTE_MAX_CHARS. * Deterministic: first-appearance order, no hashing or randomness. */ export declare function describeOmitted(omitted: readonly string[], shown: string): string; /** * `describeOmitted` for a non-positional cut (content-aware compression): * the omitted lines are the original lines with no counterpart in `shown`. * Repeats collapsed to `line (×N)` / `(×N similar)` count as shown. */ export declare function describeCompressed(original: string, shown: string): string;