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

Function read_memory

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

Read a memory by id (or path) from the vault and return its lift inputs.

(repo: &Repository, id_or_path: &str)

Source from the content-addressed store, hash-verified

97
98/// Read a memory by id (or path) from the vault and return its lift inputs.
99pub fn read_memory(repo: &Repository, id_or_path: &str) -> CliResult<MemLiftInputs> {
100 let path = normalize_memory_path(id_or_path);
101 let entry = repo
102 .vault_retrieve(&path)
103 .map_err(CliError::Repository)?
104 .ok_or_else(|| CliError::InvalidArgument {
105 message: format!("memory not found: {id_or_path} (create with `atomic memory new`)"),
106 })?;
107 inputs_from_entry(&entry)
108}
109
110/// Lift the given inputs into a canonical `MemoryNode`, mapping a lift failure
111/// (missing `uid`, missing `memoryKind`, …) to a clean argument error.

Callers 8

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
compute_rowFunction · 0.85
attest_withFunction · 0.85
write_trackedFunction · 0.85

Calls 3

vault_retrieveMethod · 0.80
normalize_memory_pathFunction · 0.70
inputs_from_entryFunction · 0.70

Tested by 2

runMethod · 0.68