Skip to main content

ToolExecutor

Struct ToolExecutor 

Source
pub struct ToolExecutor { /* private fields */ }

Implementations§

Source§

impl ToolExecutor

Source

pub fn new(policy: SecurityPolicy) -> Self

Source

pub fn empty(policy: SecurityPolicy) -> Self

Source

pub fn empty_with_security_policy( policy: SecurityPolicy, security: Arc<dyn ToolSecurityPolicy>, ) -> Self

Source

pub fn set_rewind_store(&mut self, store: Option<Arc<Mutex<RewindStore>>>)

Attach a session rewind store so successful writes track dirty paths.

Source

pub fn rewind_store(&self) -> Option<Arc<Mutex<RewindStore>>>

Shared handle for write tools / runtime rebind.

Source

pub fn with_security_policy( policy: SecurityPolicy, security: Arc<dyn ToolSecurityPolicy>, ) -> Self

Source

pub fn registry(&self) -> &ToolRegistry

Source

pub fn registry_mut(&mut self) -> &mut ToolRegistry

Source

pub fn search_tools( &self, query: &str, max_results: usize, ) -> Vec<ToolDefinition>

Searches tools by keyword across name, description, tags, and capabilities.

Source

pub fn set_harness_profile(&mut self, profile: String)

Source

pub fn set_security_policy(&mut self, policy: SecurityPolicy)

Replaces the security policy used for subsequent tool validations.

Source

pub fn security_policy(&self) -> &SecurityPolicy

Returns a reference to the active security policy.

Source

pub fn register_skill_loader( &mut self, project_dir: PathBuf, data_dir: PathBuf, config: Arc<RwLock<NaviConfig>>, )

Source

pub fn definitions(&self) -> Vec<ToolDefinition>

Source

pub fn all_definitions(&self) -> Vec<ToolDefinition>

Source

pub fn definition(&self, name: &str) -> Option<ToolDefinition>

Source

pub fn parallelism_for(&self, tool_name: &str) -> ToolParallelism

Source

pub fn register_tool(&mut self, tool: Arc<dyn Tool>) -> Option<Arc<dyn Tool>>

Source

pub fn validate_arguments( &self, inv: &ToolInvocation, ) -> Result<(), ToolCallInvalid>

Source

pub fn tool_names(&self) -> Vec<String>

Source

pub fn retain_tools<F>(&mut self, pred: F)
where F: FnMut(&str) -> bool,

Keep only tools whose names satisfy pred. Removes matching entries from the live tool map, validators, invalid-schema cache, and registry.

Source

pub fn clear_tools(&mut self)

Remove every registered tool (model schema becomes empty).

Source

pub fn unregister_plugin_tools(&mut self)

Source

pub fn invalid_tool_result( &self, inv: &ToolInvocation, err: ToolCallInvalid, ) -> ToolResult

Source

pub fn validate(&self, inv: &ToolInvocation) -> SecurityDecision

Source

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).

Source

pub fn policy(&self) -> &SecurityPolicy

Source

pub async fn invoke(&self, invocation: ToolInvocation) -> ToolResult

Source

pub async fn invoke_with_event_tx( &self, invocation: ToolInvocation, event_tx: Option<UnboundedSender<AgentEvent>>, ) -> ToolResult

Source

pub async fn invoke_approved_with_event_tx( &self, invocation: ToolInvocation, event_tx: Option<UnboundedSender<AgentEvent>>, ) -> ToolResult

Source

pub async fn invoke_with_full_context( &self, invocation: ToolInvocation, context: ToolInvocationContext, approval_granted: bool, ) -> ToolResult

Source

pub async fn list_background_commands(&self) -> Vec<BackgroundCommandSnapshot>

Lists all active background bash commands.

Source

pub async fn poll_background_command( &self, task_id: &str, ) -> Option<BackgroundCommandSnapshot>

Polls a specific background bash command.

Source

pub async fn cancel_background_command( &self, task_id: &str, ) -> Option<BackgroundCommandSnapshot>

Cancels a specific background bash command.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more