pub struct Registry { /* private fields */ }Expand description
A catalog of tools that dispatches through the leash.
Each Registry::dispatch looks up the named tool, has a fresh Gate
authorize it against the supplied grant (the single mint site), then runs
it. A registry has no ambient authority of its own — all authority flows in
per-dispatch as the granted caveats.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn builder() -> RegistryBuilder
pub fn builder() -> RegistryBuilder
Start building a registry with explicit tool registration.
Sourcepub fn tool_definitions(&self) -> Vec<Value>
pub fn tool_definitions(&self) -> Vec<Value>
The MCP tools/list payload: one object per tool with name,
description-free inputSchema. (Descriptions are a frontend concern.)
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
The set of registered tool names (sorted). Used by the CI presence test.
Sourcepub async fn dispatch(
&self,
name: &str,
args: Value,
granted: &Caveats,
) -> Result<Value, ToolError>
pub async fn dispatch( &self, name: &str, args: Value, granted: &Caveats, ) -> Result<Value, ToolError>
Dispatch name with args, enforced by the leash.
A fresh gate (seeded with the grant’s max_calls and the registry’s
generation) authorizes the tool, minting the crate::ToolContext the
tool needs. If authorization is denied, the tool never runs.
Sourcepub async fn dispatch_with_strength_floor(
&self,
name: &str,
args: Value,
granted: &Caveats,
strength_floor: AxisEnforcement,
) -> Result<Value, ToolError>
pub async fn dispatch_with_strength_floor( &self, name: &str, args: Value, granted: &Caveats, strength_floor: AxisEnforcement, ) -> Result<Value, ToolError>
Dispatch name with an explicit minimum confinement strength.
This is the strong-principal form of Self::dispatch. The selected
floor is stamped into the unforgeable crate::ToolContext at the
gate’s mint site and follows delegated trusted-worker requests. A
subprocess boundary then refuses to launch if any restricted axis would
fall below that floor. This closes the gap between a host’s prospective
enforcement check and the backend actually governing execution.
The ordinary Self::dispatch remains backwards-compatible and uses
the default AxisEnforcement::Advisory floor.
Auto Trait Implementations§
impl !Freeze for Registry
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.impl<T> ErasedDestructor for Twhere
T: 'static,
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