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

Method load

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

Load an agent's receipt, if one exists.

(agent: &str)

Source from the content-addressed store, hash-verified

130
131 /// Load an agent's receipt, if one exists.
132 pub fn load(agent: &str) -> AgentResult<Option<Self>> {
133 let path = receipt_path(agent)?;
134 if !path.exists() {
135 return Ok(None);
136 }
137 let text = std::fs::read_to_string(&path)?;
138 let receipt: Receipt =
139 serde_json::from_str(&text).map_err(|e| AgentError::Integration {
140 agent: agent.to_string(),
141 reason: format!("corrupt receipt at {}: {}", path.display(), e),
142 })?;
143 Ok(Some(receipt))
144 }
145
146 /// Delete the receipt file. Returns `true` if one existed.
147 pub fn remove(agent: &str) -> AgentResult<bool> {

Callers

nothing calls this directly

Calls 2

receipt_pathFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected