Skip to main content

cuenv_core/tools/
mod.rs

1//! Tool provider system for fetching development tools.
2//!
3//! This module provides a pluggable system for fetching development tools from
4//! various sources (GitHub, OCI, Nix). Each source is implemented
5//! as a `ToolProvider` that can resolve and fetch tools.
6//!
7//! # Architecture
8//!
9//! The tool system consists of:
10//!
11//! - [`ToolProvider`] - Trait implemented by each source (GitHub, Nix, etc.)
12//! - [`ToolRegistry`] - Collection of registered providers
13//! - [`Platform`], [`Os`], [`Arch`] - Platform identification types
14//! - [`ToolSource`] - Source-specific resolution data
15//! - [`ResolvedTool`] - A fully resolved tool ready to fetch
16//! - [`FetchedTool`] - Result of fetching a tool
17//!
18//! # Example
19//!
20//! ```ignore
21//! use cuenv_core::tools::{ToolRegistry, Platform, ToolOptions};
22//!
23//! // Create registry with providers
24//! let mut registry = ToolRegistry::new();
25//! registry.register(GitHubToolProvider::new());
26//! registry.register(NixToolProvider::new());
27//!
28//! // Resolve and fetch a tool
29//! let provider = registry.get("github").unwrap();
30//! let resolved = provider.resolve(&ToolResolveRequest {
31//!     tool_name: "jq",
32//!     version: "1.7.1",
33//!     platform: &Platform::current(),
34//!     config: &config,
35//!     token: None,
36//! }).await?;
37//! let fetched = provider.fetch(&resolved, &ToolOptions::default()).await?;
38//! ```
39
40pub mod activation;
41mod provider;
42mod registry;
43
44pub use activation::{
45    ResolvedToolActivationStep, ToolActivationOperation, ToolActivationResolveOptions,
46    ToolActivationSource, ToolActivationStep, apply_resolved_tool_activation,
47    resolve_tool_activation, validate_tool_activation,
48};
49pub use provider::{
50    Arch, FetchedTool, Os, Platform, ResolvedTool, ToolExtract, ToolOptions, ToolProvider,
51    ToolResolveRequest, ToolSource, default_cache_dir,
52};
53pub use registry::ToolRegistry;