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)
| 75 | /// agent config, at the uninstall base or in the home config) plus agents |
| 76 | /// with an integration receipt (package files). |
| 77 | fn 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 | |
| 105 | impl Command for Disable { |
| 106 | fn run(&self) -> CliResult<()> { |