pub struct LocalFileExecutor { /* private fields */ }Expand description
Same-process Ticket file executor. The immutable snapshot is supplied by the Host’s exact canonical Child activation, never by tool arguments. Parsing, policy checks, schemas and idempotent raw-call identity are shared with the remote route; only its authority transport differs.
Implementations§
Source§impl LocalFileExecutor
impl LocalFileExecutor
pub fn new( inner: Arc<dyn ToolExecutor>, service: Arc<TicketService>, canonical_child_snapshot: Session, run_id: String, ceiling: &[String], ) -> Result<Self>
Trait Implementations§
Source§impl ToolExecutor for LocalFileExecutor
impl ToolExecutor for LocalFileExecutor
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes a tool call Read more
Source§fn execute_with_context_outcome<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_with_context_outcome<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Outcome-aware dispatch: returns the tool’s
ToolOutcome rather than the
collapsed ToolResult, so the agent loop can branch on
Completed/Running/NeedsHuman directly instead of sniffing markers on
a result. The default collapses via the execute_with_context path
(always Completed), so executors that never surface Running/NeedsHuman
(composition, MCP, tests) need no override; the built-in + overlay
executors override this to return the real outcome.Source§fn execute_with_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_with_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Executes a tool call with streaming-capable context. Read more
Source§fn check_permissions_for<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: &'life2 ToolExecutionContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn check_permissions_for<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: &'life2 ToolExecutionContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Permission gate for a tool call, exposed on the executor trait so the
check is part of the executor chain. Read more
Source§fn list_tools(&self) -> Vec<ToolSchema>
fn list_tools(&self) -> Vec<ToolSchema>
Lists all available tools and their schemas Read more
Source§fn owns_exact_tool(&self, name: &str) -> bool
fn owns_exact_tool(&self, name: &str) -> bool
Returns whether this executor owns
tool_name as a complete, exact,
case-sensitive execution identity. Read moreSource§fn exact_tool_owner(&self, name: &str) -> Option<&dyn ToolExecutor>
fn exact_tool_owner(&self, name: &str) -> Option<&dyn ToolExecutor>
Read-only observation of the concrete exact owner in a known routing
chain. Unknown wrappers return None; existence/name is not provenance.
Source§fn for_session(&self, _session: &Session) -> Option<Arc<dyn ToolExecutor>>
fn for_session(&self, _session: &Session) -> Option<Arc<dyn ToolExecutor>>
Optionally bind an already installed Host tool surface to a canonical
Session contract. This selects registrations, never adds a grant.
Unknown wrappers retain the existing behavior with None.
Source§fn resolve_reference_for_session(
&self,
session: &Session,
reference: &str,
) -> Option<String>
fn resolve_reference_for_session( &self, session: &Session, reference: &str, ) -> Option<String>
Use the same versioned exact owner for live dispatch and typed replay.
Source§fn execute_exact_with_context_outcome<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
ctx: ToolExecutionContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn execute_exact_with_context_outcome<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
ctx: ToolExecutionContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Execute a call through an already-selected exact owner. Read more
Source§fn check_permissions_for_exact<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
ctx: &'life3 ToolExecutionContext<'life4>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn check_permissions_for_exact<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
ctx: &'life3 ToolExecutionContext<'life4>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Permission gate for an already-selected exact owner identity. Read more
Source§fn check_permissions_for_resolved<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
args: &'life3 Value,
ctx: &'life4 ToolExecutionContext<'life5>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Self: 'async_trait,
fn check_permissions_for_resolved<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
execution_name: &'life2 str,
args: &'life3 Value,
ctx: &'life4 ToolExecutionContext<'life5>,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutcome>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Self: 'async_trait,
Permission gate for a call whose exact execution identity and effective
arguments have already been resolved by a wrapping executor. Read more
Source§fn execution_contract_for_exact(&self, name: &str) -> Option<&'static str>
fn execution_contract_for_exact(&self, name: &str) -> Option<&'static str>
Observe semantics through the existing exact-owner chain. Calling only
the owner’s local hook avoids recursion when an owner returns
self.
Opaque wrappers supply no provenance, even when their catalog has a name.Source§fn local_execution_contract(&self, _name: &str) -> Option<&'static str>
fn local_execution_contract(&self, _name: &str) -> Option<&'static str>
Only concrete owners override this hook. Transparent wrappers retain
their existing exact-owner forwarding instead of guessing provenance.
Source§fn tool_instance_for_exact(&self, name: &str) -> Option<Arc<dyn Tool>>
fn tool_instance_for_exact(&self, name: &str) -> Option<Arc<dyn Tool>>
Registry replacement is observable even if name and contract agree.
fn local_tool_instance(&self, _name: &str) -> Option<Arc<dyn Tool>>
Source§fn framework_session_tool_for_exact(
&self,
name: &str,
) -> Option<HostFrameworkSessionTool>
fn framework_session_tool_for_exact( &self, name: &str, ) -> Option<HostFrameworkSessionTool>
Only an explicit Host factory supplies this opaque in-process proof.
Unknown wrappers and names/contract strings alone supply no provenance.
fn local_framework_session_tool( &self, _name: &str, ) -> Option<HostFrameworkSessionTool>
Source§fn tool_guidance(&self) -> Option<String>
fn tool_guidance(&self) -> Option<String>
Server-level usage guidance to surface in the system prompt for whatever
this executor currently exposes — e.g. the
instructions an MCP server
returns from initialize. Because it is derived from the live executor,
the text is naturally scoped to what is actually connected/loaded for the
run (a disconnected server contributes nothing). Read moreSource§fn tool_mutability(&self, tool_name: &str) -> ToolMutability
fn tool_mutability(&self, tool_name: &str) -> ToolMutability
Returns mutability metadata for a tool name when available.
Executors that can inspect concrete tools should override this.
Source§fn call_mutability(&self, call: &ToolCall) -> ToolMutability
fn call_mutability(&self, call: &ToolCall) -> ToolMutability
Returns mutability metadata for a specific tool call when available.
Defaults to name-based classification.
Source§fn tool_concurrency_safe(&self, tool_name: &str) -> bool
fn tool_concurrency_safe(&self, tool_name: &str) -> bool
Returns whether a tool can safely execute in parallel with other
read-only tools. Executors that can inspect concrete tools should
override this. Fallback keeps current behavior for known read-only tools.
Source§fn call_concurrency_safe(&self, call: &ToolCall) -> bool
fn call_concurrency_safe(&self, call: &ToolCall) -> bool
Returns whether a specific tool call can safely run in parallel.
Defaults to the tool-name level classification.
Source§fn call_parallel_classification(
&self,
call: &ToolCall,
) -> (ToolMutability, bool)
fn call_parallel_classification( &self, call: &ToolCall, ) -> (ToolMutability, bool)
Classify a tool call’s mutability AND concurrency-safety together,
returning
(mutability, concurrency_safe). Read moreAuto Trait Implementations§
impl !Freeze for LocalFileExecutor
impl !RefUnwindSafe for LocalFileExecutor
impl !UnwindSafe for LocalFileExecutor
impl Send for LocalFileExecutor
impl Sync for LocalFileExecutor
impl Unpin for LocalFileExecutor
impl UnsafeUnpin for LocalFileExecutor
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