pub struct PublicCapability {
pub id: String,
pub kind: String,
pub mcp_tool: Option<String>,
pub mcp_resource: Option<String>,
pub http: Option<HttpBinding>,
pub cli: Option<String>,
pub input: Option<Value>,
pub output: Option<Value>,
}Expand description
One public capability, reduced to what a caller outside this repository can depend on.
Everything here is a promise; nothing here is an implementation detail. The title and the description are deliberately absent — they are how the contract is explained, not what it is, and a reworded description that forced a release would make the gate a thing to route around within a week.
use majordomus_cli::release::surface::{public_capabilities, PublicCapability};
use serde_json::json;
let caps = public_capabilities(&json!({"capabilities": [{
"id": "a.one", "kind": "query", "visibility": "public",
"exposure": {"cli": {"path": ["a", "one"]}},
"output": {"schema": {"type": "object", "description": "prose"}}
}]}));
let capability: &PublicCapability = &caps["a.one"];
assert_eq!(capability.cli.as_deref(), Some("a one"));
// Prose is normalised away: a reworded description is not a contract change.
assert!(capability.output.as_ref().unwrap().get("description").is_none());Fields§
§id: Stringrelease.analysis.
kind: Stringquery or command: whether calling it changes anything.
mcp_tool: Option<String>The MCP tool name, when it answers to one.
mcp_resource: Option<String>The MCP resource URI, when it is readable as one.
http: Option<HttpBinding>The HTTP method and path, when it is bound to one.
cli: Option<String>The command-line path that dispatches it, when one does.
input: Option<Value>The normalised input contract: what a caller may send.
output: Option<Value>The normalised output contract: what a caller is promised back.
Trait Implementations§
Source§impl Clone for PublicCapability
impl Clone for PublicCapability
Source§fn clone(&self) -> PublicCapability
fn clone(&self) -> PublicCapability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PublicCapability
impl Debug for PublicCapability
Source§impl<'de> Deserialize<'de> for PublicCapability
impl<'de> Deserialize<'de> for PublicCapability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PublicCapability
Source§impl JsonSchema for PublicCapability
impl JsonSchema for PublicCapability
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PublicCapability
impl PartialEq for PublicCapability
Source§fn eq(&self, other: &PublicCapability) -> bool
fn eq(&self, other: &PublicCapability) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PublicCapability
impl Serialize for PublicCapability
impl StructuralPartialEq for PublicCapability
Auto Trait Implementations§
impl Freeze for PublicCapability
impl RefUnwindSafe for PublicCapability
impl Send for PublicCapability
impl Sync for PublicCapability
impl Unpin for PublicCapability
impl UnsafeUnpin for PublicCapability
impl UnwindSafe for PublicCapability
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.