export type DirectoryEntry = { name: string path: string type: "file" | "directory" } export type ProjectFileSystem = { readText(filePath: string): Promise writeText(filePath: string, content: string): Promise mkdir(dirPath: string): Promise readdir(dirPath: string): Promise exists(filePath: string): Promise stat(filePath: string): Promise<{ type: "file" | "directory" }> } export function requireProjectFileSystem(fs: ProjectFileSystem | undefined): ProjectFileSystem { if (fs === undefined) { throw new Error("A ProjectFileSystem adapter is required.") } return fs }