pub struct KillShellTool { /* private fields */ }Expand description
Tool that terminates a background shell via SIGTERM and falls through to SIGKILL after a grace window.
Implementations§
Source§impl KillShellTool
impl KillShellTool
Sourcepub fn new(registry: Arc<BashBgRegistry>) -> Self
pub fn new(registry: Arc<BashBgRegistry>) -> Self
Build with an explicit registry handle.
Sourcepub fn with_grace(registry: Arc<BashBgRegistry>, grace: Duration) -> Self
pub fn with_grace(registry: Arc<BashBgRegistry>, grace: Duration) -> Self
Build with a custom SIGTERM→SIGKILL grace window (for tests).
Sourcepub fn with_global_registry() -> Self
pub fn with_global_registry() -> Self
Build using the process singleton.
Trait Implementations§
Source§impl Debug for KillShellTool
impl Debug for KillShellTool
Source§impl Tool for KillShellTool
impl Tool for KillShellTool
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable, unique-within-registry name. Must match the model’s
expected tool name in the system prompt or schema.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Description sent to the model.
Source§fn input_schema(&self) -> &Value
fn input_schema(&self) -> &Value
JSON Schema for the input. Returned by reference to avoid cloning
per request.
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Value,
_cx: ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContentBlock>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Value,
_cx: ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContentBlock>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool. Returns the content blocks to splice into the
ToolResult message. Read moreSource§fn parallel_conflict_key(&self, _input: &Value) -> Option<String>
fn parallel_conflict_key(&self, _input: &Value) -> Option<String>
Returns
Some(key) when this tool call has a conflict identity that
must not run in parallel with another call sharing the same key.
Returns None (the default) when the tool is fully parallel-safe. Read moreSource§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether this tool is side-effect-free — it only reads state (or injects
context) and never mutates the workspace or the outside world. Read more
Source§fn mutates_files(&self) -> bool
fn mutates_files(&self) -> bool
Whether a successful call mutates files in the workspace. Read more
Source§fn as_any(&self) -> Option<&(dyn Any + 'static)>
fn as_any(&self) -> Option<&(dyn Any + 'static)>
Optional downcast hook for recovering a tool’s concrete type at
runtime. The default returns
None; tools that expose extra
session metadata beyond the trait (e.g. the Skill tool surfacing
its loaded skill names) override it to return Some(self).Auto Trait Implementations§
impl !Freeze for KillShellTool
impl RefUnwindSafe for KillShellTool
impl Send for KillShellTool
impl Sync for KillShellTool
impl Unpin for KillShellTool
impl UnsafeUnpin for KillShellTool
impl UnwindSafe for KillShellTool
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
Mutably borrows from an owned value. Read more