pub struct ExtensionTool { /* private fields */ }Implementations§
Source§impl ExtensionTool
impl ExtensionTool
pub fn new( plugin_id: impl Into<String>, tool_name: impl Into<String>, runtime: Arc<StdioRuntime>, ) -> Self
Sourcepub fn with_descriptor_metadata(
self,
description: impl Into<String>,
input_schema: Value,
) -> Self
pub fn with_descriptor_metadata( self, description: impl Into<String>, input_schema: Value, ) -> Self
Attach description + input_schema after construction so
lifecycle hooks / introspection code can read what the extension
advertised at handshake time. Idempotent.
Sourcepub fn with_context_passthrough(self, enabled: bool) -> Self
pub fn with_context_passthrough(self, enabled: bool) -> Self
Phase 11.5 follow-up — builder to opt this tool into context
propagation. When true, call injects _meta.agent_id and
_meta.session_id into the args object before forwarding.
pub fn plugin_id(&self) -> &str
pub fn tool_name(&self) -> &str
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
The description the extension advertised at registration time.
None when the tool was constructed without a descriptor (e.g.
legacy call sites).
Sourcepub fn input_schema(&self) -> Option<&Value>
pub fn input_schema(&self) -> Option<&Value>
The input_schema (JSON Schema) the extension advertised at
registration time. None when the tool was constructed without
a descriptor.
Sourcepub fn prefixed_name(plugin_id: &str, tool_name: &str) -> String
pub fn prefixed_name(plugin_id: &str, tool_name: &str) -> String
Full LLM-facing tool name: ext_{plugin_id}_{tool_name}. When the
concatenation overflows ToolDef::MAX_NAME_LEN, falls back to a
deterministic ext_{id}_{head}_{hash6} form — see
ToolDef::fit_name. Routing still uses the original tool_name.
Sourcepub fn tool_def(desc: &ToolDescriptor, plugin_id: &str) -> ToolDef
pub fn tool_def(desc: &ToolDescriptor, plugin_id: &str) -> ToolDef
Build a ToolDef ready for ToolRegistry::register. Decorates the
description with [ext:<id>] so the LLM knows where the tool comes
from when reasoning over its options.
Trait Implementations§
Source§impl ToolHandler for ExtensionTool
impl ToolHandler for ExtensionTool
Auto Trait Implementations§
impl Freeze for ExtensionTool
impl !RefUnwindSafe for ExtensionTool
impl Send for ExtensionTool
impl Sync for ExtensionTool
impl Unpin for ExtensionTool
impl UnsafeUnpin for ExtensionTool
impl !UnwindSafe for ExtensionTool
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> 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