
// A simple in-memory file system to demonstrate agent capabilities

export class VirtualFileSystem {
    private files: Map<string, string> = new Map();

    constructor() {
        this.files.set('/README.md', '# Project Root\n\nGenerated by Agent.');
    }

    readFile(path: string): string {
        if (!this.files.has(path)) {
            throw new Error(`File not found: ${path}`);
        }
        return this.files.get(path)!;
    }

    writeFile(path: string, content: string): void {
        this.files.set(path, content);
    }

    listFiles(dir: string = '/'): string[] {
        return Array.from(this.files.keys()).filter(k => k?.startsWith(dir));
    }

    getZipBytes(): Uint8Array {
        // Placeholder for zip generation
        return new Uint8Array();
    }
}

export const vfs = new VirtualFileSystem();
