pub struct ToolExecutionContext {
pub working_dir: PathBuf,
pub fighter_id: FighterId,
pub memory: Arc<MemorySubstrate>,
pub coordinator: Option<Arc<dyn AgentCoordinator>>,
pub approval_engine: Option<Arc<PolicyEngine>>,
pub sandbox: Option<Arc<SandboxEnforcer>>,
pub bleed_detector: Option<Arc<ShellBleedDetector>>,
pub browser_pool: Option<Arc<BrowserPool>>,
pub plugin_registry: Option<Arc<PluginRegistry>>,
pub mcp_clients: Option<Arc<DashMap<String, Arc<McpClient>>>>,
}Expand description
Context passed to every tool execution.
Fields§
§working_dir: PathBufWorking directory for filesystem and shell operations.
fighter_id: FighterIdThe fighter invoking the tool.
memory: Arc<MemorySubstrate>Memory substrate for memory/knowledge tools.
coordinator: Option<Arc<dyn AgentCoordinator>>Optional agent coordinator for inter-agent tools (agent_spawn, agent_message, agent_list).
This is None when the fighter does not have agent coordination capabilities.
approval_engine: Option<Arc<PolicyEngine>>Optional policy engine for approval-gated tool execution. When present, every tool call is checked against the configured policies before dispatching. The referee must approve the move.
sandbox: Option<Arc<SandboxEnforcer>>Optional subprocess sandbox (containment ring) for shell and filesystem tools. When present, commands are validated and environments are sanitized before execution.
bleed_detector: Option<Arc<ShellBleedDetector>>Optional shell bleed detector — scans shell commands for leaked secrets before the move lands. If a Secret or Confidential bleed is detected, the command is blocked.
browser_pool: Option<Arc<BrowserPool>>Optional browser session pool for browser automation tools. When present, browser scouting moves (navigate, screenshot, click, etc.) can manage sessions through the pool. The actual CDP driver is plugged in separately — without it, browser tools report “browser not available”.
plugin_registry: Option<Arc<PluginRegistry>>Optional plugin registry for WASM plugin invocation.
When present, the wasm_invoke tool can dispatch calls to loaded
WASM plugins (imported techniques). Without it, the tool reports
“plugin runtime not configured”.
mcp_clients: Option<Arc<DashMap<String, Arc<McpClient>>>>Active MCP server clients, keyed by server name.
When present, tools prefixed with mcp_{server}_ are routed to the
corresponding MCP server for execution.
Auto Trait Implementations§
impl Freeze for ToolExecutionContext
impl !RefUnwindSafe for ToolExecutionContext
impl Send for ToolExecutionContext
impl Sync for ToolExecutionContext
impl Unpin for ToolExecutionContext
impl UnsafeUnpin for ToolExecutionContext
impl !UnwindSafe for ToolExecutionContext
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
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