pub struct ToolContext {
pub workspace_root: PathBuf,
pub cancellation: CancellationToken,
pub sandbox: Option<Arc<SandboxManager>>,
pub os_sandbox: Option<Arc<OsSandboxRunner>>,
pub provider: Option<Arc<dyn Provider>>,
pub tools: Option<Arc<ToolRegistry>>,
pub pending_scope: Option<Arc<Mutex<Option<Scope>>>>,
pub lsp: Option<Arc<LspManager>>,
}Expand description
Context passed to tool execution — provides workspace root, cancellation, etc.
Fields§
§workspace_root: PathBuf§cancellation: CancellationToken§sandbox: Option<Arc<SandboxManager>>§os_sandbox: Option<Arc<OsSandboxRunner>>§provider: Option<Arc<dyn Provider>>Optional provider so nested tools (e.g. spawn_agent) can run an agent loop.
tools: Option<Arc<ToolRegistry>>Optional tool registry for nested agent runs.
pending_scope: Option<Arc<Mutex<Option<Scope>>>>Tools may request a scope switch; Agent applies after the tool batch.
lsp: Option<Arc<LspManager>>Optional LSP manager for diagnostics / navigation tools.
Implementations§
Source§impl ToolContext
impl ToolContext
pub fn new(workspace_root: impl Into<PathBuf>) -> Self
pub fn with_sandbox(self, sb: Arc<SandboxManager>) -> Self
pub fn with_os_sandbox(self, os: Arc<OsSandboxRunner>) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ToolContext
impl !UnwindSafe for ToolContext
impl Freeze for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
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
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>
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 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>
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