UNPKG

agentlang

Version:

The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans

93 lines 3.1 kB
import { ExtendedFileSystem, FileStat } from './interfaces.js'; /** * Node.js filesystem implementation */ export declare class NodeFileSystem implements ExtendedFileSystem { /** * Read a file as text * @param filePath Path to the file * @returns Promise resolving to file content as string */ readFile(filePath: string): Promise<string>; /** * Read a file as binary * @param filePath Path to the file * @returns Promise resolving to file content as Buffer */ readFileBuffer(filePath: string): Promise<Buffer>; /** * Write content to a file * @param filePath Path to the file * @param data Content to write (string or Buffer) * @returns Promise that resolves when write is complete */ writeFile(filePath: string, data: string | Buffer): Promise<void>; /** * Check if a file or directory exists * @param filePath Path to check * @returns Promise resolving to boolean which indicates existence */ exists(filePath: string): Promise<boolean>; /** * Create a directory * @param dirPath Directory path to create * @returns Promise that resolves when directory is created */ mkdir(dirPath: string): Promise<void>; /** * List files in a directory * @param dirPath Directory path * @returns Promise resolving to an array of file names */ readdir(dirPath: string): Promise<string[]>; /** * Get stats for a file or directory * @param filePath Path to check * @returns Promise resolving to stats object */ stat(filePath: string): Promise<FileStat>; /** * Remove a file * @param filePath Path to the file * @returns Promise that resolves when a file is removed */ unlink(filePath: string): Promise<void>; /** * Remove a directory * @param dirPath Path to the directory * @returns Promise that resolves when directory is removed */ rmdir(dirPath: string): Promise<void>; /** * Copy a file * @param src Source path * @param dest Destination path * @returns Promise that resolves when copy is complete */ copyFile(src: string, dest: string): Promise<void>; /** * Move a file * @param src Source path * @param dest Destination path * @returns Promise that resolves when move is complete */ moveFile(src: string, dest: string): Promise<void>; /** * Ensure a directory exists, creating it and any parent directories if needed * @param dirPath Directory path * @returns Promise that resolves when directory exists */ ensureDir(dirPath: string): Promise<void>; /** * Remove a directory and all its contents recursively * @param dirPath Directory path * @returns Promise that resolves when directory is removed */ removeDir(dirPath: string): Promise<void>; } /** * Create a new Node.js filesystem instance * @returns NodeFileSystem instance */ export declare function createNodeFS(): ExtendedFileSystem; //# sourceMappingURL=node-fs.d.ts.map