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

Method install_integration

atomic-cli/src/commands/agent/enable.rs:443–466  ·  view source on GitHub ↗

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.

(
        &self,
        agent_name: &str,
        spec: &atomic_agent::integrations::IntegrationSpec,
    )

Source from the content-addressed store, hash-verified

441 /// cache. Installation itself is done by the integrations engine per the
442 /// package's atomic-integration.toml.
443 fn install_integration(
444 &self,
445 agent_name: &str,
446 spec: &atomic_agent::integrations::IntegrationSpec,
447 ) -> CliResult<atomic_agent::integrations::InstallOutcome> {
448 let source;
449 let pkg_dir = if let Some(ref from) = self.from {
450 source = from.display().to_string();
451 from.clone()
452 } else {
453 source = spec.url.clone();
454 sync_integration_package(agent_name, spec, self.force)?
455 };
456
457 let opts = atomic_agent::integrations::InstallOptions {
458 force: self.force,
459 cli_version: env!("CARGO_PKG_VERSION").to_string(),
460 source,
461 expect_agent: Some(agent_name.to_string()),
462 };
463
464 atomic_agent::integrations::install_from_dir(&pkg_dir, &opts)
465 .map_err(|e| crate::error::CliError::Internal(anyhow::anyhow!(e.to_string())))
466 }
467
468 /// Install hooks from an integration-supplied manifest file.
469 ///

Callers 1

runMethod · 0.80

Calls 4

sync_integration_packageFunction · 0.85
install_from_dirFunction · 0.85
displayMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected