MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / repo_with_memory

Function repo_with_memory

atomic-cli/src/commands/memory/bridge.rs:304–319  ·  view source on GitHub ↗

Create a repo+vault and a single memory via the GENERIC vault path.

()

Source from the content-addressed store, hash-verified

302
303 /// Create a repo+vault and a single memory via the GENERIC vault path.
304 fn repo_with_memory() -> (Repository, String, MemLiftInputs, tempfile::TempDir) {
305 let dir = tempdir().unwrap();
306 let repo = Repository::init(dir.path()).unwrap();
307 repo.init_vault().unwrap();
308 let inputs = memory_inputs();
309 let id = "01j8zc4r8t".to_string();
310 let path = normalize_memory_path(&id);
311 repo.vault_store(
312 &path,
313 VaultEntryType::Memory,
314 inputs.body.clone().into_bytes(),
315 serde_json::to_string(&inputs.frontmatter).unwrap(),
316 )
317 .unwrap();
318 (repo, id, inputs, dir)
319 }
320
321 /// Mirror `attest`'s tracked-vault write exactly.
322 fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) {

Calls 7

memory_inputsFunction · 0.85
vault_storeMethod · 0.80
normalize_memory_pathFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45
cloneMethod · 0.45