//#region src/backend.d.ts type StateEntryType = "file" | "directory" | "symlink"; interface StateCapabilities { chmod: boolean; utimes: boolean; hardLinks: boolean; } interface StateDirent { name: string; type: StateEntryType; } interface StateStat { type: StateEntryType; size: number; mtime: Date; mode?: number; } interface StateMkdirOptions { recursive?: boolean; } interface StateRmOptions { recursive?: boolean; force?: boolean; } interface StateCopyOptions { recursive?: boolean; } interface StateMoveOptions { recursive?: boolean; } interface StateJsonWriteOptions { spaces?: number; } interface StateSearchOptions { caseSensitive?: boolean; regex?: boolean; wholeWord?: boolean; contextBefore?: number; contextAfter?: number; maxMatches?: number; } interface StateTextMatch { line: number; column: number; match: string; lineText: string; beforeLines?: string[]; afterLines?: string[]; } interface StateFindOptions { name?: string; pathPattern?: string; type?: StateEntryType | StateEntryType[]; minDepth?: number; maxDepth?: number; empty?: boolean; sizeMin?: number; sizeMax?: number; mtimeAfter?: string | Date; mtimeBefore?: string | Date; } interface StateFindEntry { path: string; name: string; type: StateEntryType; depth: number; size: number; mtime: Date; } type StateJsonUpdateOperation = | { op: "set"; path: string; value: unknown; } | { op: "delete"; path: string; }; interface StateJsonUpdateResult { value: unknown; content: string; diff: string; operationsApplied: number; } interface StateArchiveEntry { path: string; type: "file" | "directory"; size: number; } interface StateArchiveCreateResult { path: string; entries: StateArchiveEntry[]; bytesWritten: number; } interface StateArchiveExtractResult { destination: string; entries: StateArchiveEntry[]; } interface StateCompressionResult { path: string; destination: string; bytesWritten: number; } interface StateTreeOptions { maxDepth?: number; } interface StateTreeNode { path: string; name: string; type: StateEntryType; size: number; children?: StateTreeNode[]; } interface StateTreeSummary { files: number; directories: number; symlinks: number; totalBytes: number; maxDepth: number; } interface StateFileDetection { mime: string; description: string; extension?: string; binary: boolean; } interface StateHashOptions { algorithm?: "md5" | "sha1" | "sha256"; } interface StateReplaceResult { replaced: number; content: string; } interface StateFileSearchResult { path: string; matches: StateTextMatch[]; } interface StateReplaceInFilesOptions extends StateSearchOptions { dryRun?: boolean; rollbackOnError?: boolean; } interface StateFileReplaceResult { path: string; replaced: number; content: string; diff: string; } interface StateReplaceInFilesResult { dryRun: boolean; files: StateFileReplaceResult[]; totalFiles: number; totalReplacements: number; } interface StateEdit { path: string; content: string; } interface StateWriteEditInstruction { kind: "write"; path: string; content: string; } interface StateReplaceEditInstruction { kind: "replace"; path: string; search: string; replacement: string; options?: StateSearchOptions; } interface StateWriteJsonEditInstruction { kind: "writeJson"; path: string; value: unknown; options?: StateJsonWriteOptions; } type StateEditInstruction = | StateWriteEditInstruction | StateReplaceEditInstruction | StateWriteJsonEditInstruction; interface StateApplyEditsOptions { dryRun?: boolean; rollbackOnError?: boolean; } interface StateAppliedEditResult { path: string; changed: boolean; content: string; diff: string; } interface StateApplyEditsResult { dryRun: boolean; edits: StateAppliedEditResult[]; totalChanged: number; } interface StatePlannedEdit { instruction: StateEditInstruction; path: string; changed: boolean; content: string; diff: string; } interface StateEditPlan { edits: StatePlannedEdit[]; totalChanged: number; totalInstructions: number; } declare class StateBatchOperationError extends Error { readonly operation: "replaceInFiles" | "applyEdits"; readonly rolledBack: boolean; readonly rollbackError?: string; constructor(options: { operation: "replaceInFiles" | "applyEdits"; message: string; rolledBack: boolean; rollbackError?: string; }); } interface StateBackend { getCapabilities(): Promise; readFile(path: string): Promise; readFileBytes(path: string): Promise; writeFile(path: string, content: string): Promise; writeFileBytes(path: string, content: Uint8Array): Promise; appendFile(path: string, content: string | Uint8Array): Promise; readJson(path: string): Promise; writeJson( path: string, value: unknown, options?: StateJsonWriteOptions ): Promise; queryJson(path: string, query: string): Promise; updateJson( path: string, operations: StateJsonUpdateOperation[] ): Promise; exists(path: string): Promise; stat(path: string): Promise; lstat(path: string): Promise; mkdir(path: string, options?: StateMkdirOptions): Promise; readdir(path: string): Promise; readdirWithFileTypes(path: string): Promise; find(path: string, options?: StateFindOptions): Promise; walkTree(path: string, options?: StateTreeOptions): Promise; summarizeTree( path: string, options?: StateTreeOptions ): Promise; searchText( path: string, query: string, options?: StateSearchOptions ): Promise; searchFiles( pattern: string, query: string, options?: StateSearchOptions ): Promise; replaceInFile( path: string, search: string, replacement: string, options?: StateSearchOptions ): Promise; replaceInFiles( pattern: string, search: string, replacement: string, options?: StateReplaceInFilesOptions ): Promise; rm(path: string, options?: StateRmOptions): Promise; cp(src: string, dest: string, options?: StateCopyOptions): Promise; mv(src: string, dest: string, options?: StateMoveOptions): Promise; symlink(target: string, linkPath: string): Promise; readlink(path: string): Promise; realpath(path: string): Promise; resolvePath(base: string, path: string): Promise; glob(pattern: string): Promise; diff(pathA: string, pathB: string): Promise; diffContent(path: string, newContent: string): Promise; createArchive( path: string, sources: string[] ): Promise; listArchive(path: string): Promise; extractArchive( path: string, destination: string ): Promise; compressFile( path: string, destination?: string ): Promise; decompressFile( path: string, destination?: string ): Promise; hashFile(path: string, options?: StateHashOptions): Promise; detectFile(path: string): Promise; removeTree(path: string): Promise; copyTree(src: string, dest: string): Promise; moveTree(src: string, dest: string): Promise; planEdits(instructions: StateEditInstruction[]): Promise; applyEditPlan( plan: StateEditPlan, options?: StateApplyEditsOptions ): Promise; applyEdits( edits: StateEdit[], options?: StateApplyEditsOptions ): Promise; } declare const STATE_METHOD_NAMES: readonly [ "getCapabilities", "readFile", "readFileBytes", "writeFile", "writeFileBytes", "appendFile", "readJson", "writeJson", "queryJson", "updateJson", "exists", "stat", "lstat", "mkdir", "readdir", "readdirWithFileTypes", "find", "walkTree", "summarizeTree", "searchText", "searchFiles", "replaceInFile", "replaceInFiles", "rm", "cp", "mv", "symlink", "readlink", "realpath", "resolvePath", "glob", "diff", "diffContent", "createArchive", "listArchive", "extractArchive", "compressFile", "decompressFile", "hashFile", "detectFile", "removeTree", "copyTree", "moveTree", "planEdits", "applyEditPlan", "applyEdits" ]; type StateMethodName = (typeof STATE_METHOD_NAMES)[number]; //#endregion export { StateSearchOptions as A, StateMethodName as C, StateReplaceInFilesResult as D, StateReplaceInFilesOptions as E, StateTreeSummary as F, StateTextMatch as M, StateTreeNode as N, StateReplaceResult as O, StateTreeOptions as P, StateJsonWriteOptions as S, StateMoveOptions as T, StateFindEntry as _, StateArchiveExtractResult as a, StateJsonUpdateOperation as b, StateCapabilities as c, StateDirent as d, StateEdit as f, StateFileSearchResult as g, StateFileDetection as h, StateArchiveEntry as i, StateStat as j, StateRmOptions as k, StateCompressionResult as l, StateEditPlan as m, StateApplyEditsResult as n, StateBackend as o, StateEditInstruction as p, StateArchiveCreateResult as r, StateBatchOperationError as s, StateApplyEditsOptions as t, StateCopyOptions as u, StateFindOptions as v, StateMkdirOptions as w, StateJsonUpdateResult as x, StateHashOptions as y }; //# sourceMappingURL=backend-CFf0snjM.d.ts.map