import { i as RootReadOptions, n as OpenResult, r as Root } from "./root-impl-DRXbHPA1.js"; import { t as ReadResult } from "./read-opened-file-Do-jsWFN.js"; import { Readable } from "node:stream"; //#region node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts type SidecarLockRetryOptions = { retries?: number; factor?: number; minTimeout?: number; maxTimeout?: number; randomize?: boolean; }; type SidecarLockStaleRecovery = "fail-closed" | "remove-if-unchanged"; //#endregion //#region node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts type FileStorePruneOptions = { ttlMs: number; recursive?: boolean; maxDepth?: number; pruneEmptyDirs?: boolean; }; //#endregion //#region node_modules/@openclaw/fs-safe/dist/file-lock.d.ts type FileLockRetryOptions = SidecarLockRetryOptions; //#endregion //#region node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts type JsonStoreLockOptions = { staleMs?: number; timeoutMs?: number; retry?: FileLockRetryOptions; staleRecovery?: SidecarLockStaleRecovery; managerKey?: string; }; type JsonFileStoreOptions = { trailingNewline?: boolean; lock?: boolean | JsonStoreLockOptions; }; type JsonStore = { readonly filePath: string; read(): Promise; readOr(fallback: T): Promise; readRequired(): Promise; write(value: T): Promise; update(run: (current: T | undefined) => T | Promise): Promise; updateOr(fallback: T, run: (current: T) => T | Promise): Promise; }; //#endregion //#region node_modules/@openclaw/fs-safe/dist/file-store.d.ts type FileStoreWriteOptions = { dirMode?: number; mode?: number; maxBytes?: number; tempPrefix?: string; }; type FileStoreReadOptions = RootReadOptions & { encoding?: BufferEncoding; }; type FileStore = { readonly rootDir: string; path(relativePath: string): string; root(): Promise; write(relativePath: string, data: string | Uint8Array, options?: FileStoreWriteOptions): Promise; writeStream(relativePath: string, stream: Readable, options?: FileStoreWriteOptions): Promise; copyIn(relativePath: string, sourcePath: string, options?: FileStoreWriteOptions): Promise; open(relativePath: string, options?: RootReadOptions): Promise; read(relativePath: string, options?: RootReadOptions): Promise; readBytes(relativePath: string, options?: RootReadOptions): Promise; readText(relativePath: string, options?: FileStoreReadOptions): Promise; readTextIfExists(relativePath: string, options?: FileStoreReadOptions): Promise; readJson(relativePath: string, options?: FileStoreReadOptions): Promise; readJsonIfExists(relativePath: string, options?: FileStoreReadOptions): Promise; remove(relativePath: string): Promise; exists(relativePath: string): Promise; writeText(relativePath: string, data: string | Uint8Array, options?: FileStoreWriteOptions): Promise; writeJson(relativePath: string, data: unknown, options?: FileStoreWriteOptions & { trailingNewline?: boolean; }): Promise; json(relativePath: string, options?: JsonFileStoreOptions): JsonStore; pruneExpired(options: FileStorePruneOptions): Promise; }; type FileStoreSync = { readonly rootDir: string; path(relativePath: string): string; readTextIfExists(relativePath: string, options?: { maxBytes?: number; }): string | null; readJsonIfExists(relativePath: string, options?: { maxBytes?: number; }): T | null; write(relativePath: string, data: string | Uint8Array, options?: FileStoreWriteOptions): string; writeText(relativePath: string, data: string | Uint8Array, options?: FileStoreWriteOptions): string; writeJson(relativePath: string, data: unknown, options?: FileStoreWriteOptions & { trailingNewline?: boolean; }): string; }; //#endregion export { FileStoreSync as n, FileStore as t };