pub struct ToolPermissions;Expand description
Helper functions for creating tool-specific permission requests.
Implementations§
Source§impl ToolPermissions
impl ToolPermissions
Sourcepub fn file_read(tool_use_id: &str, path: impl AsRef<Path>) -> PermissionRequest
pub fn file_read(tool_use_id: &str, path: impl AsRef<Path>) -> PermissionRequest
Creates a permission request for reading a file.
Sourcepub fn file_write(
tool_use_id: &str,
path: impl AsRef<Path>,
is_create: bool,
) -> PermissionRequest
pub fn file_write( tool_use_id: &str, path: impl AsRef<Path>, is_create: bool, ) -> PermissionRequest
Creates a permission request for writing a file.
Sourcepub fn file_edit(tool_use_id: &str, path: impl AsRef<Path>) -> PermissionRequest
pub fn file_edit(tool_use_id: &str, path: impl AsRef<Path>) -> PermissionRequest
Creates a permission request for editing a file.
Sourcepub fn multi_edit(
tool_use_id: &str,
paths: &[impl AsRef<Path>],
) -> Vec<PermissionRequest>
pub fn multi_edit( tool_use_id: &str, paths: &[impl AsRef<Path>], ) -> Vec<PermissionRequest>
Creates a permission request for multi-edit operations.
Sourcepub fn glob_search(
tool_use_id: &str,
directory: impl AsRef<Path>,
) -> PermissionRequest
pub fn glob_search( tool_use_id: &str, directory: impl AsRef<Path>, ) -> PermissionRequest
Creates a permission request for glob/search in a directory.
Sourcepub fn grep_search(
tool_use_id: &str,
directory: impl AsRef<Path>,
) -> PermissionRequest
pub fn grep_search( tool_use_id: &str, directory: impl AsRef<Path>, ) -> PermissionRequest
Creates a permission request for grep/search in a directory.
Sourcepub fn list_directory(
tool_use_id: &str,
directory: impl AsRef<Path>,
) -> PermissionRequest
pub fn list_directory( tool_use_id: &str, directory: impl AsRef<Path>, ) -> PermissionRequest
Creates a permission request for listing a directory.
Sourcepub fn bash_command(tool_use_id: &str, command: &str) -> PermissionRequest
pub fn bash_command(tool_use_id: &str, command: &str) -> PermissionRequest
Creates a permission request for bash command execution.
The permission level is determined by the command:
- Read-only commands (ls, cat, git status) -> Execute
- Modifying commands (git commit, cargo build) -> Execute
- Dangerous commands (rm -rf, sudo) -> Admin
Sourcepub fn network_access(
tool_use_id: &str,
domain: &str,
method: &str,
) -> PermissionRequest
pub fn network_access( tool_use_id: &str, domain: &str, method: &str, ) -> PermissionRequest
Creates a permission request for network access.
Sourcepub fn web_search(tool_use_id: &str, query: &str) -> PermissionRequest
pub fn web_search(tool_use_id: &str, query: &str) -> PermissionRequest
Creates a permission request for web search.
Auto Trait Implementations§
impl Freeze for ToolPermissions
impl RefUnwindSafe for ToolPermissions
impl Send for ToolPermissions
impl Sync for ToolPermissions
impl Unpin for ToolPermissions
impl UnwindSafe for ToolPermissions
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