vfa_tui/models/
mcp_ref.rs1use serde::{Deserialize, Serialize};
2
3use super::harness::{Harness, SourceType};
4use super::provider::Provider;
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
8pub enum McpType {
9 #[serde(rename = "mcp-reference")]
10 McpReference,
11}
12
13impl std::fmt::Display for McpType {
14 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15 match self {
16 McpType::McpReference => write!(f, "mcp-reference"),
17 }
18 }
19}
20
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
23#[serde(rename_all = "kebab-case")]
24pub enum SignedRelease {
25 Cosign,
26 GhAttestation,
27 Unsigned,
28 Unknown,
29}
30
31impl std::fmt::Display for SignedRelease {
32 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33 match self {
34 SignedRelease::Cosign => write!(f, "cosign"),
35 SignedRelease::GhAttestation => write!(f, "gh-attestation"),
36 SignedRelease::Unsigned => write!(f, "unsigned"),
37 SignedRelease::Unknown => write!(f, "unknown"),
38 }
39 }
40}
41
42#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
44#[serde(rename_all = "kebab-case")]
45pub enum PinStrategy {
46 Digest,
47 Tag,
48 Version,
49 None,
50}
51
52impl std::fmt::Display for PinStrategy {
53 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
54 match self {
55 PinStrategy::Digest => write!(f, "digest"),
56 PinStrategy::Tag => write!(f, "tag"),
57 PinStrategy::Version => write!(f, "version"),
58 PinStrategy::None => write!(f, "none"),
59 }
60 }
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(deny_unknown_fields)]
66pub struct TrustMatrix {
67 pub mutation_capable: bool,
68 pub requires_egress: bool,
69 pub requires_credentials: bool,
70 pub signed_release: SignedRelease,
71 pub pin_strategy: PinStrategy,
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(deny_unknown_fields)]
77pub struct McpReference {
78 pub id: String,
79 pub name: String,
80 #[serde(rename = "type")]
81 pub entity_type: McpType,
82 pub provider: Provider,
83 pub harnesses: Vec<Harness>,
84 pub summary: String,
85 pub source_type: SourceType,
86 pub official_docs: Vec<String>,
87 pub security_notes: String,
88 pub last_verified: String,
89 pub path: String,
90 pub official_project_url: String,
91 pub vendor: String,
92 pub auth_model: String,
93 pub install_example: String,
94 pub unofficial_warning: String,
95 #[serde(default)]
96 pub trust_matrix: Option<TrustMatrix>,
97}