pub struct FileOpsTool { /* private fields */ }Expand description
File operations tool with multiple modes
Implementations§
Source§impl FileOpsTool
impl FileOpsTool
Sourcepub fn normalize_user_path<'a>(
&'a self,
path: &'a str,
) -> impl Future<Output = Result<PathBuf>> + 'a
pub fn normalize_user_path<'a>( &'a self, path: &'a str, ) -> impl Future<Output = Result<PathBuf>> + 'a
Public helper to normalize and validate a user-provided path against the workspace root. Inline-delegating wrapper that returns the inner future directly to avoid an extra coroutine state machine (audit section 16).
Source§impl FileOpsTool
impl FileOpsTool
pub fn new(workspace_root: PathBuf, grep_search: Arc<GrepSearchManager>) -> Self
pub fn new_with_monitor( workspace_root: PathBuf, grep_search: Arc<GrepSearchManager>, edited_file_monitor: Arc<EditedFileMonitor>, ) -> Self
Sourcepub fn edited_file_monitor_ref(&self) -> &EditedFileMonitor
pub fn edited_file_monitor_ref(&self) -> &EditedFileMonitor
Borrow the edited-file monitor without exposing shared ownership.
Sourcepub fn edited_file_monitor(&self) -> &Arc<EditedFileMonitor> ⓘ
pub fn edited_file_monitor(&self) -> &Arc<EditedFileMonitor> ⓘ
Get the shared edited-file monitor handle for callers that need to clone it.
Source§impl FileOpsTool
impl FileOpsTool
Sourcepub async fn create_file(&self, args: Value) -> Result<Value>
pub async fn create_file(&self, args: Value) -> Result<Value>
Execute basic directory listing
Sourcepub async fn delete_file(&self, args: Value) -> Result<Value>
pub async fn delete_file(&self, args: Value) -> Result<Value>
Delete a file or directory (with recursive flag).
Source§impl FileOpsTool
impl FileOpsTool
Trait Implementations§
Source§impl CacheableTool for FileOpsTool
impl CacheableTool for FileOpsTool
Source§impl Clone for FileOpsTool
impl Clone for FileOpsTool
Source§impl FileTool for FileOpsTool
impl FileTool for FileOpsTool
Source§fn workspace_root(&self) -> &PathBuf
fn workspace_root(&self) -> &PathBuf
Get the workspace root
Source§impl ModeTool for FileOpsTool
impl ModeTool for FileOpsTool
Source§fn supported_modes(&self) -> Vec<&'static str>
fn supported_modes(&self) -> Vec<&'static str>
Get supported modes
Source§impl Tool for FileOpsTool
impl Tool for FileOpsTool
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with given arguments Read more
Source§fn description(&self) -> &str
fn description(&self) -> &str
Get the tool’s description
Source§fn execute_dual<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_dual<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute with dual-channel output (LLM summary + UI content) Read more
Source§fn parameter_schema(&self) -> Option<Value>
fn parameter_schema(&self) -> Option<Value>
Optional JSON schema for the tool’s parameters, if available.
Source§fn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Optional JSON schema for the tool’s configuration, if available.
Source§fn state_schema(&self) -> Option<Value>
fn state_schema(&self) -> Option<Value>
Optional JSON schema describing state persisted by the tool, if any.
Source§fn prompt_path(&self) -> Option<Cow<'static, str>>
fn prompt_path(&self) -> Option<Cow<'static, str>>
Optional prompt path metadata (e.g., for loading companion prompts).
Source§fn default_permission(&self) -> ToolPolicy
fn default_permission(&self) -> ToolPolicy
Default execution policy for this tool.
Source§fn allow_patterns(&self) -> Option<&'static [&'static str]>
fn allow_patterns(&self) -> Option<&'static [&'static str]>
Optional allowlist patterns the tool considers pre-approved.
Source§fn deny_patterns(&self) -> Option<&'static [&'static str]>
fn deny_patterns(&self) -> Option<&'static [&'static str]>
Optional denylist patterns the tool considers blocked.
Source§fn is_mutating(&self) -> bool
fn is_mutating(&self) -> bool
Whether this tool mutates state (files, environment, etc). Read more
Source§fn is_parallel_safe(&self) -> bool
fn is_parallel_safe(&self) -> bool
Whether this tool is safe to run in parallel with other tools. Read more
Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
Get the kind/category of this tool for matching against policies. Read more
Source§fn matches_kind(&self, pattern: &str) -> bool
fn matches_kind(&self, pattern: &str) -> bool
Check if this tool matches a given kind pattern. Read more
Source§fn resource_hints(&self, _args: &Value) -> Vec<String>
fn resource_hints(&self, _args: &Value) -> Vec<String>
Resources this tool might access (paths, URLs, etc). Read more
Source§fn execution_cost(&self) -> u8
fn execution_cost(&self) -> u8
Estimated execution cost (1-10 scale). Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FileOpsTool
impl !UnwindSafe for FileOpsTool
impl Forget for FileOpsTool
impl Freeze for FileOpsTool
impl Move for FileOpsTool
impl Send for FileOpsTool
impl Sync for FileOpsTool
impl Unpin for FileOpsTool
impl UnsafeUnpin for FileOpsTool
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
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> 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