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("jq", "1.7.1", &Platform::current(), &config).await?;
31//! let fetched = provider.fetch(&resolved, &ToolOptions::default()).await?;
32//! ```
33
34mod provider;
35mod registry;
36
37pub use provider::{
38    Arch, FetchedTool, Os, Platform, ResolvedTool, ToolOptions, ToolProvider, ToolSource,
39    default_cache_dir,
40};
41pub use registry::ToolRegistry;