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

Method load

atomic-agent/src/integrations/manifest.rs:172–185  ·  view source on GitHub ↗

Load and validate the manifest from a package directory.

(pkg_dir: &Path)

Source from the content-addressed store, hash-verified

170impl IntegrationManifest {
171 /// Load and validate the manifest from a package directory.
172 pub fn load(pkg_dir: &Path) -> AgentResult<Self> {
173 let path = pkg_dir.join(MANIFEST_FILE);
174 let text = std::fs::read_to_string(&path).map_err(|e| AgentError::Integration {
175 agent: agent_name_guess(pkg_dir),
176 reason: format!("cannot read {}: {}", path.display(), e),
177 })?;
178 let manifest: IntegrationManifest =
179 toml::from_str(&text).map_err(|e| AgentError::Integration {
180 agent: agent_name_guess(pkg_dir),
181 reason: format!("invalid {}: {}", MANIFEST_FILE, e),
182 })?;
183 manifest.check_schema()?;
184 Ok(manifest)
185 }
186
187 /// Reject manifests from a newer schema than this CLI understands.
188 pub fn check_schema(&self) -> AgentResult<()> {

Callers

nothing calls this directly

Calls 2

agent_name_guessFunction · 0.85
check_schemaMethod · 0.80

Tested by

no test coverage detected