vx_core/
lib.rs

1//! Core traits and interfaces for vx tool manager
2//!
3//! This crate provides a highly abstracted plugin system that makes it easy for developers
4//! to implement new tools and package managers with minimal boilerplate code.
5//!
6//! # Quick Start for Plugin Developers
7//!
8//! To create a new tool plugin, implement the `VxTool` trait:
9//!
10//! ```rust
11//! use vx_core::{VxTool, ToolContext, VersionInfo, Result};
12//!
13//! #[derive(Default)]
14//! struct MyTool;
15//!
16//! #[async_trait::async_trait]
17//! impl VxTool for MyTool {
18//!     fn name(&self) -> &str { "mytool" }
19//!
20//!     async fn fetch_versions(&self, _include_prerelease: bool) -> Result<Vec<VersionInfo>> {
21//!         // Fetch versions from your tool's API
22//!         Ok(vec![])
23//!     }
24//!
25//!     async fn install_version(&self, version: &str, force: bool) -> Result<()> {
26//!         // Download and install the tool
27//!         Ok(())
28//!     }
29//! }
30//! ```
31
32pub mod config;
33pub mod config_figment;
34// Tests moved to tests/ directory
35pub mod error;
36pub mod global_tool_manager;
37pub mod install_configs;
38pub mod installer;
39pub mod package_manager;
40pub mod plugin;
41pub mod proxy;
42pub mod registry;
43pub mod shim_integration;
44pub mod symlink_venv;
45pub mod tool;
46pub mod version;
47
48// Utility modules
49pub mod downloader;
50pub mod environment;
51pub mod http;
52pub mod platform;
53pub mod url_builder;
54pub mod venv;
55pub mod version_manager;
56pub mod version_parser;
57
58// Re-export main traits for convenience
59// Current plugin system (VxPlugin-based)
60pub use plugin::{
61    ConfigurableTool, StandardPlugin, ToolMetadata, UrlBuilder, VersionParser, VxPackageManager,
62    VxPlugin, VxTool,
63};
64// New plugin system (Plugin-based) - for future migration
65pub use config::{GlobalConfig, ToolConfig};
66pub use config_figment::{
67    ConfigStatus, DefaultConfig, FigmentConfigManager, ProjectInfo, ProjectType, VxConfig,
68};
69pub use error::{Result, VxError};
70pub use install_configs::{
71    get_install_config, get_manual_install_instructions, supports_auto_install,
72};
73pub use installer::{InstallConfig, InstallProgress, InstallStage};
74pub use package_manager::{Ecosystem, PackageInfo, PackageSpec};
75pub use registry::{PluginRegistry, ToolRegistry};
76pub use tool::{
77    AsyncTool, Configuration, Environment, Plugin, Tool, ToolContext, ToolExecutionResult,
78    ToolInfo, ToolStatus,
79};
80pub use version::VersionInfo; // Re-enabled for current system
81
82// Re-export utility modules
83pub use downloader::ToolDownloader;
84pub use environment::{EnvironmentConfig, ToolInstallation, VxEnvironment};
85pub use global_tool_manager::{GlobalToolInfo, GlobalToolManager, VenvDependency};
86pub use http::{get_http_client, HttpUtils};
87pub use platform::{Architecture, OperatingSystem, Platform};
88pub use proxy::{ProxyContext, ToolProxy};
89pub use shim_integration::VxShimManager;
90pub use symlink_venv::{SymlinkVenv, SymlinkVenvManager};
91pub use url_builder::{
92    GenericUrlBuilder, GoUrlBuilder, NodeUrlBuilder, PythonUrlBuilder, RustUrlBuilder, UvUrlBuilder,
93};
94pub use venv::{ProjectConfig, ProjectSettings, VenvConfig, VenvManager};
95pub use version_manager::{Version, VersionManager};
96pub use version_parser::{
97    GitHubVersionParser, GoVersionParser, NodeVersionParser, VersionParserUtils,
98};