pub struct Plugin {
pub owner: String,
pub name: String,
pub version: String,
pub arguments: Option<IndexMap<String, Value>>,
}Expand description
One plugin declaration: the plugin’s coordinates plus optional startup arguments for its MCP server.
NOTE: name (the repository segment) is slated for removal in a
later iteration of the plugin model; it remains part of the
identity triple for now.
Fields§
§owner: StringGitHub <owner> segment.
name: StringRepository segment.
version: StringPlugin version.
arguments: Option<IndexMap<String, Value>>Optional key→value arguments handed to the plugin’s MCP server
at startup. Values are free-form JSON: a string behaves as
--key value and null as a bare --key flag, but an object,
an array or a number is equally valid and the plugin author
decides how to interpret them.
prepare normalizes (an empty STRING becomes null, so the
two spellings of a valueless flag canonicalize together), sorts
the map by key AND every object key nested inside a value at
any depth, and collapses an empty map to None — so two
equivalent declarations serialize byte-identically, which is
what makes an agent id content-addressable. Array element order
is left alone: that is data, not spelling.
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
owner, name, and version must all be non-empty; version
must start with v — it IS the plugin repo’s git tag, Go-modules
style (v1.2.3), byte-for-byte with no rewriting anywhere
downstream. Every arguments key (if present) must be non-empty
(values may be empty — they canonicalize to bare flags in
prepare).
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Plugin
impl<'arbitrary> Arbitrary<'arbitrary> for Plugin
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<'de> Deserialize<'de> for Plugin
impl<'de> Deserialize<'de> for Plugin
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>,
Source§impl JsonSchema for Plugin
impl JsonSchema for Plugin
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 moreimpl StructuralPartialEq for Plugin
Auto Trait Implementations§
impl Freeze for Plugin
impl RefUnwindSafe for Plugin
impl Send for Plugin
impl Sync for Plugin
impl Unpin for Plugin
impl UnsafeUnpin for Plugin
impl UnwindSafe for Plugin
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
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more