pub struct EditTool {
pub root: PathBuf,
pub extra_roots: Vec<(PathBuf, AccessTier)>,
pub session_roots: Option<SharedSandboxRoots>,
pub read_state: Option<Arc<Mutex<ReadFileState>>>,
}Fields§
§root: PathBuf§extra_roots: Vec<(PathBuf, AccessTier)>§session_roots: Option<SharedSandboxRoots>§read_state: Option<Arc<Mutex<ReadFileState>>>When Some, enforces the partial-read guard: edits on files that were
never read, or only partially read, are rejected with a clear error.
None (default) disables the guard for backward compatibility.
Implementations§
Source§impl EditTool
impl EditTool
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn with_read_state(self, slot: Arc<Mutex<ReadFileState>>) -> Self
Sourcepub fn with_extra_roots(
self,
extra: impl IntoIterator<Item = (PathBuf, AccessTier)>,
) -> Self
pub fn with_extra_roots( self, extra: impl IntoIterator<Item = (PathBuf, AccessTier)>, ) -> Self
Append additional allowed sandbox roots. See
crate::tools::fs::ReadFile::with_extra_roots.
Sourcepub fn with_session_roots(self, slot: SharedSandboxRoots) -> Self
pub fn with_session_roots(self, slot: SharedSandboxRoots) -> Self
Attach the shared, session-mutable roots slot. See SharedSandboxRoots.
Sourcepub fn with_session_roots_opt(self, slot: Option<SharedSandboxRoots>) -> Self
pub fn with_session_roots_opt(self, slot: Option<SharedSandboxRoots>) -> Self
Convenience: attach the shared slot only when Some.
Trait Implementations§
Source§impl Tool for EditTool
impl Tool for EditTool
fn spec(&self) -> ToolSpec
Source§fn side_effect_class(&self) -> ToolSideEffect
fn side_effect_class(&self) -> ToolSideEffect
Classify this tool’s observable side-effects. Default is the most
conservative value (
External) so any unannotated tool is treated
as risky on resume. Override to ReadOnly or Mutating for
built-in tools; MCP tools derive this from their annotations.Source§fn kind(&self) -> ToolKind
fn kind(&self) -> ToolKind
Return the ACP
ToolKind for tool_call notifications (Sprint 3).
Defaults to ToolKind::Other. Concrete tools override to map
to their corresponding ACP category.fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_deferred(&self) -> bool
fn is_deferred(&self) -> bool
Return
true to send this tool as deferred (name-only) in the initial
prompt; the model must call ToolSearch to load its full schema.
Default is false (eager). Override in low-frequency tools.Source§fn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Convenience: a tool is read-only iff it classifies as
ReadOnly.
Used by the parallel-dispatch path in agent.rs. Override only if
you have an unusual reason (you almost never should — override
side_effect_class instead and let this default through).Auto Trait Implementations§
impl Freeze for EditTool
impl RefUnwindSafe for EditTool
impl Send for EditTool
impl Sync for EditTool
impl Unpin for EditTool
impl UnsafeUnpin for EditTool
impl UnwindSafe for EditTool
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.