Read a memory by id (or path) from the vault and return its lift inputs.
(repo: &Repository, id_or_path: &str)
| 97 | |
| 98 | /// Read a memory by id (or path) from the vault and return its lift inputs. |
| 99 | pub 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. |