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

Method detect

atomic-agent/src/hooks/mod.rs:395–401  ·  view source on GitHub ↗

Detect which registered agents are present in the given repository. Calls `detect_presence()` on each registered agent and returns the names of agents that are detected. # Example ```rust,no_run use atomic_agent::hooks::AgentRegistry; use std::path::Path; let registry = AgentRegistry::with_defaults(); let detected = registry.detect(Path::new("/path/to/repo")); for name in detected { println!("

(&self, repo_root: &Path)

Source from the content-addressed store, hash-verified

393 /// }
394 /// ```
395 pub fn detect(&self, repo_root: &Path) -> Vec<&str> {
396 self.agents
397 .iter()
398 .filter(|a| a.detect_presence(repo_root))
399 .map(|a| a.name())
400 .collect()
401 }
402
403 /// Returns all agents that have hooks currently installed.
404 pub fn installed(&self, repo_root: &Path) -> Vec<&str> {

Calls 3

iterMethod · 0.45
detect_presenceMethod · 0.45
nameMethod · 0.45