export declare const IS_WIN: boolean; export declare const EXEC_DEFAULT_TIMEOUT_MS: number; /** * ToolStateManager — encapsulates mutable state shared across tools. * * Tracks file read timestamps to detect stale writes (when a file is modified * between read and write operations). Previously this was module-level state; * now it's an instance, enabling per-agent or per-session state isolation. */ /** Claude Code FileRead "unchanged since last read" stub — saves context. */ export declare const FILE_UNCHANGED_STUB = "File unchanged since last read. The content from the earlier read_file result in this conversation is still current \u2014 refer to that instead of re-reading."; export declare class ToolStateManager { private readonly fileReadState; /** Last read window per path (`full` or `offset:limit`) for unchanged stubs. */ private readonly fileReadRange; recordFileState(resolvedPath: string, rangeKey?: string): Promise; /** True when read_file (or a successful write/edit) recorded this path. */ hasRecorded(resolvedPath: string): boolean; /** * Claude Code FileRead parity: when the file mtime and the requested window * match the last successful read, the full body is still in context — return * a short stub instead of re-dumping the file (token + latency win). */ unchangedSinceLastRead(resolvedPath: string, rangeKey?: string): Promise; /** * Claude Code FileEdit parity: require a prior *full-file* read (or a * successful write/edit that re-stamps `full`) before surgical edit. * A partial offset/limit page does not unlock full-file old_string matching * — that was a thrash hole (edit outside the paged window → miss → retry). */ requirePriorReadError(resolvedPath: string, displayPath: string): string | null; staleWriteError(resolvedPath: string, displayPath: string): Promise; clearFileState(): void; /** * Drop prior-read credit for one path so the next surgical edit must * re-read. Used after old_string miss / failed multi_edit so the model * cannot thrash the same unread snapshot (Claude FileEdit discipline). */ invalidateFileState(resolvedPath: string): void; } /** * Claude Code findSimilarFile parity: when a path is missing, suggest a * similarly named sibling in the same directory (case/extension drift). */ export declare function findSimilarFileName(missingPath: string, workspaceDir: string): Promise; export declare const globalToolStateManager: ToolStateManager; export declare function childEnv(_workspaceDir: string): Record; export declare function safePath(inputPath: string, workspaceDir: string): Promise; export declare function toolError(prefix: string, err: unknown): Error; export declare const LINE_NUMBER_WIDTH = 6; export declare function withLineNumbers(text: string, startLine?: number): string; /** * Meaningful tail lines from a failed exec/device_exec tool result for TUI rows. * Skips bare `exit_code: N` / section headers so users see the real error without Ctrl+O. */ export declare function extractCommandFailurePreview(resultText: string, maxLines?: number): string[]; /** * Compact tail preview for successful exec/device_exec tool rows. * Keeps noise low: only when output is multi-line / long enough to hide useful info. */ export declare function extractCommandOutputPreview(resultText: string, options?: { maxLines?: number; minChars?: number; minLines?: number; }): string[]; //# sourceMappingURL=tool-helpers.d.ts.map