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

Function repo_with_memory

atomic-cli/src/commands/memory/bridge.rs:415–430  ·  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

413
414 /// Create a repo+vault and a single memory via the GENERIC vault path.
415 fn repo_with_memory() -> (Repository, String, MemLiftInputs, tempfile::TempDir) {
416 let dir = tempdir().unwrap();
417 let repo = Repository::init(dir.path()).unwrap();
418 repo.init_vault().unwrap();
419 let inputs = memory_inputs();
420 let id = "01j8zc4r8t".to_string();
421 let path = normalize_memory_path(&id);
422 repo.vault_store(
423 &path,
424 VaultEntryType::Memory,
425 inputs.body.clone().into_bytes(),
426 serde_json::to_string(&inputs.frontmatter).unwrap(),
427 )
428 .unwrap();
429 (repo, id, inputs, dir)
430 }
431
432 /// Mirror `attest`'s tracked-vault write exactly.
433 fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) {

Calls 8

memory_inputsFunction · 0.85
normalize_memory_pathFunction · 0.85
vault_storeMethod · 0.80
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45
cloneMethod · 0.45