- 1
//! Whether a capability is usable right now. - 2
//! - 3
//! Every capability is knowable offline: it is declared, or it has been - 4
//! revoked. Nothing here talks to anything. An MCP server's connection state - 5
//! — its catalog, its last failure, its retry backoff — belongs to the - 6
//! on-demand pool (`vak_mcp::McpManager`), the one place a server is ever - 7
//! started, and reaches the registry as declared data. The registry once - 8
//! probed servers itself on a background timer, which meant spawning them - 9
//! with nobody asking and re-spawning them after the pool had evicted them - 10
//! for idleness. - 11
- 12
use serde::{Deserialize, Serialize}; - 13
- 14
/// The lifecycle of one capability's usability. - 15
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] - 16
#[serde(tag = "state", rename_all = "kebab-case")] - 17
pub enum Resolution { - 18
/// Declared and usable. - 19
Available, - 20
/// Revoked. Kept as a tombstone while a live epoch still references it, - 21
/// so a session mid-turn can still resolve what it was told about. - 22
Retired { reason: String }, - 23
} - 24
- 25
impl Resolution { - 26
/// Whether a turn may use this capability. - 27
pub fn is_usable(&self) -> bool { - 28
matches!(self, Resolution::Available) - 29
} - 30
- 31
/// One-line status for the operator report and the model's standing - 32
/// section. Both read this, so they cannot disagree. - 33
pub fn summary(&self) -> String { - 34
match self { - 35
Resolution::Available => "ready".into(), - 36
Resolution::Retired { reason } => format!("removed: {reason}"), - 37
} - 38
} - 39
} - 40
Indexing the workspace…
Vakyartha documentation is discovering safe artifacts, anchors, and source references.