Structs§
- Path
Entry - Static
Tool Provider - A
ToolProviderthat serves a fixed set ofToolDefinitions from a cache, delegating execution to anStaticToolExecute. - Truncation
Meta
Constants§
- FS_
DEFAULTS_ PREAMBLE - Shared preamble describing default filesystem-listing behavior.
Used by
lsandglobso both tools document hidden-file and.gitignorehandling in identical wording.
Traits§
- Static
Tool Execute - Per-call execution behavior for a
StaticToolProvider.
Functions§
- agent_
surface - build_
path_ entry - Build a normalized filesystem entry for tool output. Returns the entry plus raw mtime for optional sorting.
- canonicalize_
under - Resolve
pathagainstbase(viaresolve_under) and then canonicalize it on disk, resolving symlinks to their real path. Fails if the path does not exist. Use this only when a tool needs a real, existence-checked path (e.g. a security/scope decision or distinguishing a file from a directory); preferresolve_underfor write/patch targets that may not exist yet. - compact_
diff - Generate a compact unified diff between old and new content.
Truncates to
max_lineslines if the diff is too long. - display_
relative - Render
pathrelative tobasefor display, falling back to the file name (then the full path) whenpathis not underbase. Backslashes are normalized to forward slashes so output is stable across platforms. - filesystem_
entries_ output_ schema - filesystem_
entries_ result - Build the standard result envelope returned by filesystem listing tools.
- normalize_
lexical - Lexically collapse
.and..components inpathwithout touching the filesystem. Leading..components (that would escape the root) are preserved verbatim, matchingPath::joinintuitions for relative roots. - object_
schema - parse_
optional_ bool - Parse optional bool arg with a default.
- parse_
optional_ usize_ arg - Parse an optional positive integer arg.
Accepts
nullor"none"whenallow_noneis true. - path_
entry_ output_ schema - require_
str - Extract a required non-empty string arg, or return ToolResult::err.
- resolve_
under - Resolve a possibly-relative
pathagainstbase, returning a lexically normalizedPathBuf. - rg_
file_ list - run_
blocking - Run blocking filesystem work off the async runtime.
- run_
blocking_ value - Run blocking work off the async runtime and return a typed value.