MCPcopy Create free account
hub / github.com/apache/maka / readMemoryBundle

Function readMemoryBundle

packages/storage/src/memory-bundle-io.ts:77–87  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

75}
76
77export async function readMemoryBundle(root: string): Promise<MemoryBundleSnapshot> {
78 const directory = await bindMemoryDirectory(root);
79 if (!directory) return bundleSnapshot(missingDocument(), missingDocument());
80 if (await bindTransactionDirectory(directory)) {
81 throw new MemoryBundleStoreError(
82 'io_failed',
83 'Memory bundle requires writer recovery before it can be read',
84 );
85 }
86 return readBoundMemoryBundle(directory);
87}
88
89async function readBoundMemoryBundle(directory: DirectoryBinding): Promise<MemoryBundleSnapshot> {
90 const memory = await readDocument(directory, 'memory');

Callers 4

commitMemoryBundleFunction · 0.85
restoreMemoryBackupFunction · 0.85
readMethod · 0.85

Calls 5

bindMemoryDirectoryFunction · 0.85
bundleSnapshotFunction · 0.85
missingDocumentFunction · 0.85
bindTransactionDirectoryFunction · 0.85
readBoundMemoryBundleFunction · 0.85

Tested by

no test coverage detected