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

Method save

atomic-agent/src/integrations/receipt.rs:121–129  ·  view source on GitHub ↗

Persist the receipt under `~/.atomic/integrations/ /`.

(&self)

Source from the content-addressed store, hash-verified

119
120 /// Persist the receipt under `~/.atomic/integrations/<agent>/`.
121 pub fn save(&self) -> AgentResult<PathBuf> {
122 let path = receipt_path(&self.agent)?;
123 if let Some(parent) = path.parent() {
124 std::fs::create_dir_all(parent)?;
125 }
126 let json = serde_json::to_string_pretty(self)?;
127 std::fs::write(&path, format!("{json}\n"))?;
128 Ok(path)
129 }
130
131 /// Load an agent's receipt, if one exists.
132 pub fn load(agent: &str) -> AgentResult<Option<Self>> {

Callers 1

install_from_dirFunction · 0.45

Calls 3

receipt_pathFunction · 0.85
writeFunction · 0.85
parentMethod · 0.80

Tested by

no test coverage detected