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

Method load

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

Load and validate the manifest from a package directory.

(pkg_dir: &Path)

Source from the content-addressed store, hash-verified

64impl IntegrationManifest {
65 /// Load and validate the manifest from a package directory.
66 pub fn load(pkg_dir: &Path) -> AgentResult<Self> {
67 let path = pkg_dir.join(MANIFEST_FILE);
68 let text = std::fs::read_to_string(&path).map_err(|e| AgentError::Integration {
69 agent: agent_name_guess(pkg_dir),
70 reason: format!("cannot read {}: {}", path.display(), e),
71 })?;
72 let manifest: IntegrationManifest =
73 toml::from_str(&text).map_err(|e| AgentError::Integration {
74 agent: agent_name_guess(pkg_dir),
75 reason: format!("invalid {}: {}", MANIFEST_FILE, e),
76 })?;
77 manifest.check_schema()?;
78 Ok(manifest)
79 }
80
81 /// Reject manifests from a newer schema than this CLI understands.
82 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