import { BaseFileStore } from "../../schema/index.js"; export class InMemoryFileStore extends BaseFileStore { lc_namespace = ["langchain", "stores", "file", "in_memory"]; private files: Map = new Map(); async readFile(path: string): Promise { const contents = this.files.get(path); if (contents === undefined) { throw new Error(`File not found: ${path}`); } return contents; } async writeFile(path: string, contents: string): Promise { this.files.set(path, contents); } }