import type { KnowledgeGraph } from './types.js'; export declare function parseJsonlMemory(content: string): KnowledgeGraph; export declare function serializeJsonlMemory(graph: KnowledgeGraph): string; export declare function readJsonlMemoryFile(memoryFilePath: string): Promise; /** * Write the store atomically: full content to a sibling temp file, then rename over the * target. `rename` within a directory is atomic on POSIX, so a concurrent reader sees * either the entire previous store or the entire new one — never a truncated prefix and * never an empty file. * * The previous implementation was a bare `fs.writeFile`, which truncates and then * writes. A reader landing in that window got a partial store, and — worse — a * SYNTACTICALLY VALID partial store, because every whole line before the cut parses * fine. That is undetectable by any reader: fewer charts is not distinguishable from * fewer charts existing. Six MCP servers currently point at one store file, so the * window is real rather than theoretical. * * WHAT THIS DOES NOT FIX: two processes that both load, then both write, still lose the * earlier update — last writer wins, and both report success. Atomicity removes torn * READS; it does not provide compare-and-swap. That remains open. * * The temp file is a sibling so the rename stays on one filesystem; a rename across * devices is not atomic and would fail with EXDEV. */ export declare function writeJsonlMemoryFile(memoryFilePath: string, graph: KnowledgeGraph): Promise;