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

Function agents_with_installs

atomic-cli/src/commands/agent/disable.rs:77–103  ·  view source on GitHub ↗

Agents with anything to uninstall: adapter-reported installs (hooks in agent config, at the uninstall base or in the home config) plus agents with an integration receipt (package files).

(registry: &AgentRegistry, install_base: &std::path::Path)

Source from the content-addressed store, hash-verified

75/// agent config, at the uninstall base or in the home config) plus agents
76/// with an integration receipt (package files).
77fn agents_with_installs(registry: &AgentRegistry, install_base: &std::path::Path) -> Vec<String> {
78 let mut names: Vec<String> = registry
79 .installed(install_base)
80 .iter()
81 .map(|s| s.to_string())
82 .collect();
83
84 // Hooks also live in the home config: the integration packages target
85 // it directly, and the pre-package global installs put them there too.
86 if let Some(home) = dirs::home_dir() {
87 for name in registry.installed(&home) {
88 if !names.iter().any(|n| n == name) {
89 names.push(name.to_string());
90 }
91 }
92 }
93
94 for name in atomic_agent::integrations::registered_integrations() {
95 if names.iter().any(|n| n == &name) {
96 continue;
97 }
98 if let Ok(Some(_)) = atomic_agent::integrations::Receipt::load(&name) {
99 names.push(name);
100 }
101 }
102 names
103}
104
105impl Command for Disable {
106 fn run(&self) -> CliResult<()> {

Callers 1

runMethod · 0.85

Calls 4

installedMethod · 0.80
collectMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected