import { type AgentTool } from "@caupulican/pi-agent-core/types"; import { type Static, Type } from "typebox"; import type { ToolDefinition } from "../extensions/types.ts"; import { type FileFailureRecoveryAuthority } from "./file-failure-recovery.ts"; import { FileMutationIntentController } from "./file-mutation-intent.ts"; declare const writeSchema: Type.TUnion<[Type.TObject<{ path: Type.TString; content: Type.TString; }>, Type.TObject<{ path: Type.TString; contentRef: Type.TString; }>, Type.TObject<{ path: Type.TString; payloadRef: Type.TString; }>]>; export type WriteToolInput = Static; /** * Pluggable operations for the write tool. * Override these to delegate file writing to remote systems (for example SSH). */ export interface WriteOperations { /** Atomically create a new file and fail if any entry already occupies the path. */ createFile: (absolutePath: string, content: string) => Promise; /** Create directory recursively */ mkdir: (dir: string) => Promise; } export interface WriteToolOptions { /** Custom operations for file writing. Default: local filesystem */ operations?: WriteOperations; /** Shared backend identity for exact cross-tool recovery with custom operations. */ failureRecoveryAuthority?: FileFailureRecoveryAuthority; /** Session-owned harness preflight and exact-content-reference authority. */ intentController?: FileMutationIntentController; } export interface WriteToolDetails { phase: "written"; contentRef?: string; byteCount?: number; } export declare function createWriteToolDefinition(cwd: string, options?: WriteToolOptions): ToolDefinition; export declare function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool; export {}; //# sourceMappingURL=write.d.ts.map