/** * Write `content` to `filePath` atomically: temp file + fsync + rename. * Creates parent directories as needed. Returns when the bytes are durable * (fsync on the temp file) and visible (rename completed). */ export declare function atomicWriteFile(filePath: string, content: string | Buffer, encoding?: BufferEncoding): void; /** * Serialize `value` as pretty-printed JSON and write it atomically. * Centralizes the JSON.stringify settings so every config file matches. */ export declare function atomicWriteJson(filePath: string, value: unknown): void; /** * Remove every `.tmp-*` file under `dir`. Called from the session_start hook * to clean up after a previous session that crashed between temp-file write * and rename. Returns the number of files removed. */ export declare function cleanupTempFiles(dir: string): number; /** Best-effort detection of the platform temp dir (used in tests). */ export declare function tmpDirForTest(): string;