export type TextSelectionMode = "full" | "grep" | "head" | "tail" | "slice";
export declare const DEFAULT_TAIL_LINES = 80;
export declare const DEFAULT_HEAD_LINES = 50;
export declare const DEFAULT_GREP_MAX_RESULTS = 50;
export declare const MAX_SELECTED_LINES = 2000;
export declare const MAX_SELECTED_BYTES: number;
export interface TextSelectionOptions {
    mode?: TextSelectionMode;
    implicitDefault?: boolean;
    pattern?: string;
    context?: number;
    maxResults?: number;
    /** Compatibility alias matching gate_inspect/bash_bg-style parameter names. */
    max_results?: number;
    lines?: number;
    from?: number;
    to?: number;
}
export interface TextSelectionMetadata {
    mode: TextSelectionMode;
    totalLines: number;
    range?: {
        from: number;
        to: number;
    };
    matchCount?: number;
    shownMatches?: number;
    truncated: boolean;
    truncationReason?: string;
    omittedHint?: string;
}
export interface TextSelectionResult extends TextSelectionMetadata {
    text: string;
    selection: TextSelectionMetadata;
    /** 1-indexed source line numbers included in text; omitted hints are not included. */
    selectedLineNumbers: number[];
}
export declare class TextSelectionError extends Error {
    constructor(message: string);
}
export declare function splitLines(text: string): string[];
export declare function countTextLines(text: string): number;
export interface TextBudgetResult {
    text: string;
    truncated: boolean;
    truncationReason?: string;
    lines: number;
    bytes: number;
}
export declare function truncateTextToBudget(text: string, maxLines?: number, maxBytes?: number): TextBudgetResult;
export declare function selectText(text: string, options?: TextSelectionOptions): TextSelectionResult;
//# sourceMappingURL=text-selection.d.ts.map