pub struct ShellTool { /* private fields */ }Expand description
Shell command execution tool (with safety checks)
Optional sandbox executor integration: when sandbox is set, all commands execute through the sandbox,
providing additional isolation and resource limits.
Implementations§
Source§impl ShellTool
impl ShellTool
Sourcepub fn new_permissive() -> ShellTool
pub fn new_permissive() -> ShellTool
Create a non-strict mode Shell tool (not recommended!)
Sourcepub fn with_sandbox(self, sandbox: Arc<dyn SandboxExecutor>) -> ShellTool
pub fn with_sandbox(self, sandbox: Arc<dyn SandboxExecutor>) -> ShellTool
Set the sandbox executor; commands will be executed through the sandbox
Sourcepub fn check_command_safety(&self, command: &str) -> CommandSafety
pub fn check_command_safety(&self, command: &str) -> CommandSafety
Check whether a command is safe
Trait Implementations§
Source§impl Tool for ShellTool
impl Tool for ShellTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing accepted parameters.
Source§fn execute(
&self,
parameters: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
fn execute( &self, parameters: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
Execute the tool with untyped JSON parameters.
Source§fn validate_parameters(
&self,
_params: &HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
fn validate_parameters( &self, _params: &HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
Validate parameters before execution.
Source§fn permissions(&self) -> Vec<ToolPermission>
fn permissions(&self) -> Vec<ToolPermission>
Permissions required to invoke this tool.
Source§fn risk_level(&self) -> ToolRiskLevel
fn risk_level(&self) -> ToolRiskLevel
Risk level of this tool. Dangerous tools require explicit approval.
Auto Trait Implementations§
impl Freeze for ShellTool
impl !RefUnwindSafe for ShellTool
impl Send for ShellTool
impl Sync for ShellTool
impl Unpin for ShellTool
impl UnsafeUnpin for ShellTool
impl !UnwindSafe for ShellTool
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request