import type { AgentTool } from "../types.js";
import { type CheckpointHandle } from "./checkpoint.js";
import { type ReadStateHandle } from "./read-state.js";
declare const writeSchema: import("@sinclair/typebox").TObject<{
    path: import("@sinclair/typebox").TString;
    content: import("@sinclair/typebox").TString;
}>;
/**
 * Pluggable filesystem callbacks for the write tool. Override them to direct
 * writes at an alternate backend, for instance an SSH or remote-mount layer.
 */
export interface WriteOperations {
    /** Write text out to a file. */
    writeFile: (absolutePath: string, content: string) => Promise<void>;
    /** Make sure a directory is present, building any missing parents along the way. */
    mkdir: (dir: string) => Promise<void>;
    /** Optional callback for taking a snapshot of a file ahead of overwriting it. */
    copyFile?: (from: string, to: string) => Promise<void>;
}
export interface WriteToolOptions {
    /** Swap out the filesystem callbacks; the local disk is used by default. */
    operations?: WriteOperations;
    /** If set, duplicate any existing file to a sibling .bak before it is overwritten. */
    createBackup?: boolean;
    /**
     * Optional read-before-edit gate store. When present, overwriting an EXISTING
     * file is refused unless it was read this session and has not drifted on disk;
     * brand-new files (not yet on disk) are exempt. Absent → no gate (no-op).
     */
    readState?: ReadStateHandle;
    /**
     * Optional file-checkpoint sink. When present, the file's pre-mutation
     * on-disk content (or `null` when it did not exist) is captured exactly once
     * before the overwrite, so a later rewind can roll the working tree back.
     * Absent → no snapshot (no-op).
     */
    checkpoint?: CheckpointHandle;
}
export declare function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema>;
/** Ready-to-use write tool bound to the current working directory. */
export declare const writeTool: AgentTool<import("@sinclair/typebox").TObject<{
    path: import("@sinclair/typebox").TString;
    content: import("@sinclair/typebox").TString;
}>, any>;
export {};
