Install an externally-packaged integration for an agent. The package directory comes from `--from` (a local checkout) or from syncing the registry's Atomic storage project into the CLI-managed cache. Installation itself is done by the integrations engine per the package's atomic-integration.toml. When the manifest declares `[skills-source]`, the shared atomic-skills cache is synced (or reused) a
(
&self,
agent_name: &str,
spec: &atomic_agent::integrations::IntegrationSpec,
)
| 555 | /// `--agents-md` or the prompt, the repo root is passed so |
| 556 | /// `[[repo-file]]` entries land in the repo. |
| 557 | fn install_integration( |
| 558 | &self, |
| 559 | agent_name: &str, |
| 560 | spec: &atomic_agent::integrations::IntegrationSpec, |
| 561 | ) -> CliResult<atomic_agent::integrations::InstallOutcome> { |
| 562 | let source; |
| 563 | let pkg_dir = if let Some(ref from) = self.from { |
| 564 | source = from.display().to_string(); |
| 565 | from.clone() |
| 566 | } else { |
| 567 | source = spec.url.clone(); |
| 568 | sync_integration_package(agent_name, spec, self.force)? |
| 569 | }; |
| 570 | |
| 571 | // Peek at the manifest to see if we need the skills cache. |
| 572 | let manifest = atomic_agent::integrations::IntegrationManifest::load(&pkg_dir) |
| 573 | .map_err(|e| crate::error::CliError::Internal(anyhow::anyhow!(e.to_string())))?; |
| 574 | |
| 575 | let skills_cache_dir = if manifest.skills_source.is_some() |
| 576 | || manifest.skills_config.is_some() |
| 577 | || manifest.agent_definition.is_some() |
| 578 | || !manifest.skills.is_empty() |
| 579 | { |
| 580 | if let Some(ref from_skills) = self.from_skills { |
| 581 | if !std::fs::exists(from_skills).unwrap_or(false) { |
| 582 | return Err(crate::error::CliError::InvalidArgument { |
| 583 | message: format!( |
| 584 | "--from-skills: no checkout at {}; point it at a local \ |
| 585 | atomic-skills checkout (or omit it to sync from storage)", |
| 586 | from_skills.display() |
| 587 | ), |
| 588 | }); |
| 589 | } |
| 590 | Some(from_skills.clone()) |
| 591 | } else { |
| 592 | Some(sync_skills_cache(self.force)?) |
| 593 | } |
| 594 | } else { |
| 595 | None |
| 596 | }; |
| 597 | |
| 598 | // Determine repo_root from the --agents-md / --no-agents-md flags |
| 599 | // or the interactive prompt. Only relevant when the manifest has |
| 600 | // [[repo-file]] entries. Outside a repository the entries are |
| 601 | // skipped with a warning rather than failing the whole install — |
| 602 | // `enable` does not require a repository. |
| 603 | let repo_root = if !manifest.repo_files.is_empty() && self.agents_md { |
| 604 | match find_repository_root() { |
| 605 | Ok(root) => Some(root), |
| 606 | Err(_) => { |
| 607 | print_warning( |
| 608 | "--agents-md requires an Atomic repository — skipping [[repo-file]] entries.", |
| 609 | ); |
| 610 | None |
| 611 | } |
| 612 | } |
| 613 | } else { |
| 614 | None |
no test coverage detected