pub struct ToolExecutionContext { /* private fields */ }Expand description
Context passed to a tool executor.
The context is intentionally small for the MVP: cancellation is cooperative
and runtime state mutation stays owned by crate::Runtime::execute_tool_call.
Implementations§
Source§impl ToolExecutionContext
impl ToolExecutionContext
Sourcepub fn new(cancellation_token: CancellationToken) -> Self
pub fn new(cancellation_token: CancellationToken) -> Self
Creates a tool execution context with the provided cancellation token.
Sourcepub fn cancellation_token(&self) -> &CancellationToken
pub fn cancellation_token(&self) -> &CancellationToken
Returns the cancellation token for this tool execution.
Executors should check this token at cancellation points and return
ToolExecutionError::Cancelled when no durable result was produced.
Sourcepub fn approved_apply_patch(&self) -> Option<&WorkspacePatchProposal>
pub fn approved_apply_patch(&self) -> Option<&WorkspacePatchProposal>
Borrows the approved workspace patch proposal for this execution.
This is executor-internal runtime state. It is never rendered into provider-visible tool specs, tool result artifacts, or continuations.
Sourcepub fn approved_path_grants(&self) -> &[PathAccessRule]
pub fn approved_path_grants(&self) -> &[PathAccessRule]
Returns single-action path grants approved for this exact tool execution.
Sourcepub fn approved_network_domains(&self) -> &[String]
pub fn approved_network_domains(&self) -> &[String]
Returns single-action exact network domain grants approved for this exact tool execution.