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

Method resolve_body_from

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

Resolve a `body_from` reference (`"atomic-skills:AGENTS.md"`) into an absolute path inside the skills cache. Returns `None` if the format is unrecognized.

(&self, body_from: &str, skills_cache: &Path)

Source from the content-addressed store, hash-verified

233 /// absolute path inside the skills cache. Returns `None` if the format is
234 /// unrecognized.
235 pub fn resolve_body_from(&self, body_from: &str, skills_cache: &Path) -> Option<PathBuf> {
236 let (pkg, rel) = body_from.split_once(':')?;
237 // The package name in body_from must match the skills-source package.
238 let expected = self.skills_source.as_ref()?.package.as_str();
239 if pkg != expected {
240 return None;
241 }
242 Some(skills_cache.join(rel))
243 }
244}
245
246fn agent_name_guess(pkg_dir: &Path) -> String {

Callers 1

install_from_dirFunction · 0.80

Calls 2

as_refMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected