1use std::path::PathBuf;
2
3use vs_config::Scope;
4use vs_plugin_api::{AvailableVersion, PluginManifest};
5use vs_registry::RegistryEntry;
6
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub enum UseScope {
10 Global,
12 Project,
14 Session,
16}
17
18impl UseScope {
19 pub fn as_str(self) -> &'static str {
21 match self {
22 Self::Global => "global",
23 Self::Project => "project",
24 Self::Session => "session",
25 }
26 }
27}
28
29#[derive(Debug, Clone, PartialEq, Eq)]
31pub struct CurrentTool {
32 pub plugin: String,
34 pub version: String,
36 pub scope: Scope,
38 pub source: PathBuf,
40}
41
42#[derive(Debug, Clone, PartialEq, Eq)]
44pub struct InstalledVersion {
45 pub plugin: String,
47 pub version: String,
49 pub install_dir: PathBuf,
51}
52
53#[derive(Debug, Clone, PartialEq, Eq)]
55pub struct PluginInfo {
56 pub entry: RegistryEntry,
58 pub manifest: PluginManifest,
60 pub available_versions: Vec<AvailableVersion>,
62 pub installed_versions: Vec<String>,
64}
65
66#[derive(Debug, Clone, PartialEq, Eq)]
68pub struct MigrateSummary {
69 pub source_home: PathBuf,
71 pub copied_roots: usize,
73}
74
75#[derive(Debug, Clone, PartialEq, Eq)]
77pub struct SelfUpgradeSummary {
78 pub current_version: String,
80 pub latest_version: String,
82 pub updated: bool,
84}