pub struct ToolDefExtension { /* private fields */ }Expand description
Bash extension that registers ToolDef-backed commands plus help and discover.
Each ToolDefExtensionBuilder::build mints a fresh invocation log, so
distinct builds (e.g. per tenant) never share traces. Cloning also creates
a fresh log, allowing cloned configuration to be installed into separate
Bash instances without cross-tenant trace leakage. Use
ToolDefExtension::invocation_trace to intentionally retain a trace
handle before registering an extension.
Implementations§
Source§impl ToolDefExtension
impl ToolDefExtension
Sourcepub fn builder() -> ToolDefExtensionBuilder
pub fn builder() -> ToolDefExtensionBuilder
Create an empty builder.
Sourcepub fn sanitize_errors(self, sanitize: bool) -> Self
pub fn sanitize_errors(self, sanitize: bool) -> Self
Control whether callback errors are sanitized.
Sourcepub fn invocation_trace(&self) -> ToolDefInvocationTrace
pub fn invocation_trace(&self) -> ToolDefInvocationTrace
Return an explicit handle for this extension’s invocation trace.
The handle intentionally shares trace state with this extension and can
be retained after moving the extension into a Bash builder. Prefer a
distinct extension/handle pair per tenant.
Sourcepub fn take_invocations(&self) -> Vec<ScriptedCommandInvocation>
pub fn take_invocations(&self) -> Vec<ScriptedCommandInvocation>
Return and clear accumulated command invocation trace entries.