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

Method install_integration

atomic-cli/src/commands/agent/enable.rs:372–395  ·  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

370 /// cache. Installation itself is done by the integrations engine per the
371 /// package's atomic-integration.toml.
372 fn install_integration(
373 &self,
374 agent_name: &str,
375 spec: &atomic_agent::integrations::IntegrationSpec,
376 ) -> CliResult<atomic_agent::integrations::InstallOutcome> {
377 let source;
378 let pkg_dir = if let Some(ref from) = self.from {
379 source = from.display().to_string();
380 from.clone()
381 } else {
382 source = spec.url.clone();
383 sync_integration_package(agent_name, spec, self.force)?
384 };
385
386 let opts = atomic_agent::integrations::InstallOptions {
387 force: self.force,
388 cli_version: env!("CARGO_PKG_VERSION").to_string(),
389 source,
390 expect_agent: Some(agent_name.to_string()),
391 };
392
393 atomic_agent::integrations::install_from_dir(&pkg_dir, &opts)
394 .map_err(|e| crate::error::CliError::Internal(anyhow::anyhow!(e.to_string())))
395 }
396
397 /// Install hooks from an integration-supplied manifest file.
398 ///

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