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

Function read_memory

atomic-cli/src/commands/memory/bridge.rs:99–110  ·  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::VaultEntityNotFound {
105 kind: "memory",
106 id: id_or_path.to_string(),
107 hint: Some("create with `atomic memory new`".to_string()),
108 })?;
109 inputs_from_entry(&entry)
110}
111
112/// Lift the given inputs into a canonical `MemoryNode`, mapping a lift failure
113/// (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

normalize_memory_pathFunction · 0.85
vault_retrieveMethod · 0.80
inputs_from_entryFunction · 0.70

Tested by 2

runMethod · 0.68