pub struct List {
pub workspace: Arc<dyn Workspace>,
pub base: Option<PathBuf>,
pub confine: bool,
}Expand description
Lists the files under a directory, as far down as asked, honouring
.gitignore (Listing::Visible, or Listing::Hidden when asked or
when the glob names a hidden path): one path per line below the listed directory, and each
directory deeper than the listing goes once, as dir/. Publishes what
it listed (FilesListed) and, when the list was cut, OutputCut.
Fields§
§workspace: Arc<dyn Workspace>Where the files are listed.
base: Option<PathBuf>The directory a relative path is listed from; None is the
workspace’s working directory.
confine: boolWhether a path that resolves outside base is refused, before
anything is listed.
Trait Implementations§
Source§impl Tool for List
impl Tool for List
Source§type Error = ToolExecutionError
type Error = ToolExecutionError
Typed error returned by direct calls to this tool. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Model-facing description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for arguments.
Source§fn annotations(&self) -> ToolAnnotations
fn annotations(&self) -> ToolAnnotations
What calling the tool does to the world, for the host’s policies
(approval, plan mode, which calls run side by side). Nothing is
stated by default, which reads as the protocol’s defaults
(
ToolAnnotations).Source§fn footprint(&self, args: &ListArgs) -> Touches
fn footprint(&self, args: &ListArgs) -> Touches
What a call with
args may read and change, so a host runs the
calls of one reply that touch different things side by side. The
default reads it from the annotations: a
read-only tool reads anything, any other writes anything.Source§async fn call(
&self,
context: &mut ToolContext,
args: ListArgs,
) -> Result<String, ToolExecutionError>
async fn call( &self, context: &mut ToolContext, args: ListArgs, ) -> Result<String, ToolExecutionError>
Execute the tool.
Auto Trait Implementations§
impl !RefUnwindSafe for List
impl !UnwindSafe for List
impl Freeze for List
impl Send for List
impl Sync for List
impl Unpin for List
impl UnsafeUnpin for List
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