/** * [WHO]: EditTool, editTool, createEditTool, EditToolInput, EditOperations * [FROM]: Depends on agent-core, node:fs, edit-diff.ts, path-utils.ts * [TO]: Consumed by core/tools/index.ts * [HERE]: core/tools/edit.ts - filesystem mutation via diff application; consumed by orchestrator */ import type { AgentTool } from "@catui/agent-core"; import { type Static } from "@sinclair/typebox"; declare const editSchema: import("@sinclair/typebox").TObject<{ path: import("@sinclair/typebox").TString; oldText: import("@sinclair/typebox").TString; newText: import("@sinclair/typebox").TString; }>; export type EditToolInput = Static; export interface EditToolDetails { /** Unified diff of the changes made */ diff: string; /** Line number of the first change in the new file (for editor navigation) */ firstChangedLine?: number; /** Structured patch data (hunks with line-level detail) for GUI diff rendering */ structuredPatch?: unknown; } /** * Pluggable operations for the edit tool. * Override these to delegate file editing to remote systems (e.g., SSH). */ export interface EditOperations { /** Read file contents as a Buffer */ readFile: (absolutePath: string) => Promise; /** Write content to a file */ writeFile: (absolutePath: string, content: string) => Promise; /** Check if file is readable and writable (throw if not) */ access: (absolutePath: string) => Promise; } export interface EditToolOptions { /** Custom operations for file editing. Default: local filesystem */ operations?: EditOperations; /** Optional guard called with the resolved absolute path before writing. */ beforeWrite?: (absolutePath: string) => void | Promise; } export declare function createEditTool(cwd: string, options?: EditToolOptions): AgentTool; /** Default edit tool using process.cwd() - for backwards compatibility */ export declare const editTool: AgentTool, any>; export {};