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>>,
}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”.