import type { Tool } from '../core/tools/tool-types.js'; export declare function countOccurrences(haystack: string, needle: string): number; /** Strip read_file-style line-number prefixes the model often pastes back. */ export declare function stripLineNumberPrefixes(s: string): string; export declare function stripTrailingWhitespacePerLine(s: string): string; export declare function normalizeEditQuotes(s: string): string; /** * Compact unified-style preview for edit_file / multi_edit results so the * transcript always shows what changed (CC/Codex visibility), independent of * whether the UI expands tool inputRaw. * @internal exported for tests */ export declare function formatCompactEditPreview(oldString: string, newString: string, maxLines?: number): string; /** * Find multi-line windows whose trailing-whitespace-stripped form equals the * stripped needle. Returns character offsets into the original content. */ export declare function findTrailingWsMatches(content: string, needle: string, allowMultiple: boolean): Array<{ start: number; end: number; }>; /** Score lines for closest-match hints when old_string is missing. */ export declare function findClosestLineHints(content: string, needle: string, maxHints?: number): string[]; export declare const readFileTool: Tool; export declare const writeFileTool: Tool; export type PreciseEditMatchMode = 'exact' | 'quotes' | 'trailing-ws'; export interface PreciseEditRequest { oldString: string; newString: string; replaceAll?: boolean; } export interface PreciseEditSuccess { ok: true; content: string; occurrences: number; matchMode: PreciseEditMatchMode; } export interface PreciseEditFailure { ok: false; error: string; } /** * Core surgical-edit matcher shared by edit_file and multi_edit. * Handles line-number prefix stripping, quote normalization, and * trailing-whitespace-tolerant multi-line windows. */ export declare function applyPreciseEditToContent(content: string, request: PreciseEditRequest): PreciseEditSuccess | PreciseEditFailure; export declare const editFileTool: Tool; export declare const multiEditTool: Tool; export declare const moveFileTool: Tool; /** * Codex-style depth-limited directory listing (BFS). Returns relative paths * from the listing root with `/` for directories and `@` for symlinks. */ export declare function listDirEntries(rootAbs: string, depth: number, limit: number): Promise; export declare const listDirectoryTool: Tool; //# sourceMappingURL=file-tools.d.ts.map