/** * File system utilities */ import type { Stats } from 'fs'; export declare class DirectoryNotFoundError extends Error { readonly dirPath: string; constructor(dirPath: string); } export declare class FileNotFoundError extends Error { readonly filePath: string; constructor(filePath: string); } /** * Read file with error handling */ export declare function readFile(filePath: string): Promise; /** * Write file with directory creation and sandbox resilience */ export declare function writeFile(filePath: string, content: string): Promise; /** * Append content to file with directory creation and sandbox resilience */ export declare function appendFile(filePath: string, content: string): Promise; /** * Check if file exists */ export declare function fileExists(filePath: string): boolean; /** * Check if directory exists */ export declare function dirExists(dirPath: string): boolean; /** * List files in directory */ export declare function listFiles(dirPath: string, extension?: string): Promise; /** * List directories */ export declare function listDirectories(dirPath: string): Promise; /** * Recursively find files by pattern */ export declare function findFiles(dirPath: string, pattern: RegExp, maxDepth?: number): Promise; /** * Ensure directory exists */ export declare function ensureDir(dirPath: string): Promise; /** * Get file stats */ export declare function getFileStats(filePath: string): Promise; /** * @deprecated Use paths.ts and resource-resolver.ts instead. * Resolve path relative to package root directory. */ export declare function resolveAIPath(...segments: string[]): string; /** * @deprecated Use getPackageRoot() from './paths.js' instead. * Returns the package root directory. */ export declare function getAIRoot(): string; /** * Read and parse JSON file with type safety */ export declare function readJSON = Record>(filePath: string): Promise; /** * Write object as JSON to file */ export declare function writeJSON = Record>(filePath: string, data: T): Promise; //# sourceMappingURL=file-utils.d.ts.map