pub struct ToolExecutor { /* private fields */ }Implementations§
Source§impl ToolExecutor
impl ToolExecutor
pub fn new(policy: SecurityPolicy) -> Self
pub fn empty(policy: SecurityPolicy) -> Self
pub fn empty_with_security_policy( policy: SecurityPolicy, security: Arc<dyn ToolSecurityPolicy>, ) -> Self
Sourcepub fn set_rewind_store(&mut self, store: Option<Arc<Mutex<RewindStore>>>)
pub fn set_rewind_store(&mut self, store: Option<Arc<Mutex<RewindStore>>>)
Attach a session rewind store so successful writes track dirty paths.
Sourcepub fn rewind_store(&self) -> Option<Arc<Mutex<RewindStore>>>
pub fn rewind_store(&self) -> Option<Arc<Mutex<RewindStore>>>
Shared handle for write tools / runtime rebind.
pub fn with_security_policy( policy: SecurityPolicy, security: Arc<dyn ToolSecurityPolicy>, ) -> Self
pub fn registry(&self) -> &ToolRegistry
pub fn registry_mut(&mut self) -> &mut ToolRegistry
Sourcepub fn search_tools(
&self,
query: &str,
max_results: usize,
) -> Vec<ToolDefinition>
pub fn search_tools( &self, query: &str, max_results: usize, ) -> Vec<ToolDefinition>
Searches tools by keyword across name, description, tags, and capabilities.
pub fn set_harness_profile(&mut self, profile: String)
Sourcepub fn set_security_policy(&mut self, policy: SecurityPolicy)
pub fn set_security_policy(&mut self, policy: SecurityPolicy)
Replaces the security policy used for subsequent tool validations.
Sourcepub fn security_policy(&self) -> &SecurityPolicy
pub fn security_policy(&self) -> &SecurityPolicy
Returns a reference to the active security policy.
pub fn register_skill_loader( &mut self, project_dir: PathBuf, data_dir: PathBuf, config: Arc<RwLock<NaviConfig>>, )
pub fn definitions(&self) -> Vec<ToolDefinition>
pub fn all_definitions(&self) -> Vec<ToolDefinition>
pub fn definition(&self, name: &str) -> Option<ToolDefinition>
pub fn parallelism_for(&self, tool_name: &str) -> ToolParallelism
pub fn register_tool(&mut self, tool: Arc<dyn Tool>) -> Option<Arc<dyn Tool>>
pub fn validate_arguments( &self, inv: &ToolInvocation, ) -> Result<(), ToolCallInvalid>
pub fn tool_names(&self) -> Vec<String>
Sourcepub fn retain_tools<F>(&mut self, pred: F)
pub fn retain_tools<F>(&mut self, pred: F)
Keep only tools whose names satisfy pred. Removes matching entries from
the live tool map, validators, invalid-schema cache, and registry.
Sourcepub fn clear_tools(&mut self)
pub fn clear_tools(&mut self)
Remove every registered tool (model schema becomes empty).
pub fn unregister_plugin_tools(&mut self)
pub fn invalid_tool_result( &self, inv: &ToolInvocation, err: ToolCallInvalid, ) -> ToolResult
pub fn validate(&self, inv: &ToolInvocation) -> SecurityDecision
Sourcepub fn fork_with_policy_and_tools(
&self,
policy: SecurityPolicy,
allowed_tool_names: &[String],
) -> Self
pub fn fork_with_policy_and_tools( &self, policy: SecurityPolicy, allowed_tool_names: &[String], ) -> Self
Clone this executor with a different security policy and only the named tools (used by workflow workers for write_allow / path gates).
pub fn policy(&self) -> &SecurityPolicy
pub async fn invoke(&self, invocation: ToolInvocation) -> ToolResult
pub async fn invoke_with_event_tx( &self, invocation: ToolInvocation, event_tx: Option<UnboundedSender<AgentEvent>>, ) -> ToolResult
pub async fn invoke_approved_with_event_tx( &self, invocation: ToolInvocation, event_tx: Option<UnboundedSender<AgentEvent>>, ) -> ToolResult
pub async fn invoke_with_full_context( &self, invocation: ToolInvocation, context: ToolInvocationContext, approval_granted: bool, ) -> ToolResult
Sourcepub async fn list_background_commands(&self) -> Vec<BackgroundCommandSnapshot>
pub async fn list_background_commands(&self) -> Vec<BackgroundCommandSnapshot>
Lists all active background bash commands.
Sourcepub async fn poll_background_command(
&self,
task_id: &str,
) -> Option<BackgroundCommandSnapshot>
pub async fn poll_background_command( &self, task_id: &str, ) -> Option<BackgroundCommandSnapshot>
Polls a specific background bash command.
Sourcepub async fn cancel_background_command(
&self,
task_id: &str,
) -> Option<BackgroundCommandSnapshot>
pub async fn cancel_background_command( &self, task_id: &str, ) -> Option<BackgroundCommandSnapshot>
Cancels a specific background bash command.
Auto Trait Implementations§
impl !RefUnwindSafe for ToolExecutor
impl !UnwindSafe for ToolExecutor
impl Freeze for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnsafeUnpin for ToolExecutor
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<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