Skip to main content

vtcode_core/marketplace/
manifest.rs

1//! Marketplace and plugin manifest formats
2
3use std::path::PathBuf;
4
5use serde::{Deserialize, Serialize};
6
7/// Marketplace manifest format
8#[derive(Debug, Clone, Deserialize, Serialize)]
9pub struct MarketplaceManifest {
10    /// Name of the marketplace
11    pub name: String,
12
13    /// Description of the marketplace
14    pub description: String,
15
16    /// List of plugins available in this marketplace
17    pub plugins: Vec<PluginManifest>,
18}
19
20/// Plugin manifest format - similar to existing PluginManifest but with marketplace additions
21#[derive(Debug, Clone, Deserialize, Serialize)]
22pub struct PluginManifest {
23    /// Unique identifier for the plugin
24    pub id: String,
25
26    /// Human-readable name
27    pub name: String,
28
29    /// Semantic version
30    pub version: String,
31
32    /// Description of the plugin
33    pub description: String,
34
35    /// Entrypoint for the plugin
36    pub entrypoint: PathBuf,
37
38    /// Capabilities provided by the plugin
39    pub capabilities: Vec<String>,
40
41    /// Source URL where the plugin can be downloaded
42    pub source: String,
43
44    /// Optional trust level
45    pub trust_level: Option<crate::config::PluginTrustLevel>,
46
47    /// Dependencies (other plugins or system requirements)
48    #[serde(default)]
49    pub dependencies: Vec<String>,
50
51    /// Author information
52    #[serde(default)]
53    pub author: String,
54
55    /// License information
56    #[serde(default)]
57    pub license: String,
58
59    /// Homepage URL
60    #[serde(default)]
61    pub homepage: String,
62
63    /// Repository URL
64    #[serde(default)]
65    pub repository: String,
66}
67
68impl PluginManifest {
69    pub fn new(id: String, name: String, version: String) -> Self {
70        Self {
71            id,
72            name,
73            version,
74            description: String::new(),
75            entrypoint: PathBuf::new(),
76            capabilities: Vec::new(),
77            source: String::new(),
78            trust_level: None,
79            dependencies: Vec::new(),
80            author: String::new(),
81            license: String::new(),
82            homepage: String::new(),
83            repository: String::new(),
84        }
85    }
86}