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

Method detect

atomic-agent/src/hooks/mod.rs:392–398  ·  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

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

Calls 3

iterMethod · 0.45
detect_presenceMethod · 0.45
nameMethod · 0.45