Expand description
Shared infrastructure and seven concrete coding tools.
Ports .references/pi/packages/coding-agent/src/core/tools/: the ordered
built-in registry, read/bash/edit/write/grep/find/ls implementations,
truncation, rolling-output spill, per-realpath mutation serialization, and
path resolution.
Re-exports§
pub use bash::BashOperations;pub use bash::BashSpawnContext;pub use bash::BashSpawnHook;pub use bash::BashTool;pub use bash::BashToolDetails;pub use bash::BashToolInput;pub use bash::BashToolOptions;pub use bash::LocalBashOperations;pub use bash::create_bash_tool;pub use edit::EditTool;pub use edit::EditToolDetails;pub use edit::EditToolInput;pub use edit::EditToolOptions;pub use edit::ReplaceEditInput;pub use edit::create_edit_tool;pub use find::FindTool;pub use find::FindToolDetails;pub use find::FindToolInput;pub use find::FindToolOptions;pub use find::create_find_tool;pub use grep::GrepTool;pub use grep::GrepToolDetails;pub use grep::GrepToolInput;pub use grep::GrepToolOptions;pub use grep::create_grep_tool;pub use ls::LsTool;pub use ls::LsToolDetails;pub use ls::LsToolInput;pub use ls::LsToolOptions;pub use ls::create_ls_tool;pub use mutation_queue::MutationQueueError;pub use mutation_queue::with_file_mutation_queue;pub use output_accumulator::DEFAULT_TEMP_FILE_PREFIX;pub use output_accumulator::OutputAccumulator;pub use output_accumulator::OutputAccumulatorError;pub use output_accumulator::OutputAccumulatorOptions;pub use output_accumulator::OutputSnapshot;pub use path_utils::PathResolveError;pub use path_utils::expand_path;pub use path_utils::path_exists;pub use path_utils::resolve_read_path;pub use path_utils::resolve_read_path_async;pub use path_utils::resolve_to_cwd;pub use read::ReadTool;pub use read::ReadToolDetails;pub use read::ReadToolInput;pub use read::ReadToolOptions;pub use read::create_read_tool;pub use read::detect_supported_image_mime_type;pub use truncate::DEFAULT_MAX_BYTES;pub use truncate::DEFAULT_MAX_LINES;pub use truncate::GREP_MAX_LINE_LENGTH;pub use truncate::TruncatedBy;pub use truncate::TruncatedLine;pub use truncate::TruncationOptions;pub use truncate::TruncationResult;pub use truncate::format_size;pub use truncate::truncate_head;pub use truncate::truncate_line;pub use truncate::truncate_line_with;pub use truncate::truncate_tail;pub use write::WriteTool;pub use write::WriteToolDetails;pub use write::WriteToolInput;pub use write::WriteToolOptions;pub use write::create_write_tool;
Modules§
- bash
- Bash tool: execute a shell command with streamed, tail-truncated output.
- edit
- Edit tool: exact multi-replacement file edits under the mutation queue.
- edit_
diff - Pure edit matching and diff helpers for the edit tool.
- find
- Find files by glob pattern using
globset+ignore::WalkBuilder. - grep
- Search file contents with native regex / literal matching.
- ls
- List directory contents (dotfiles included).
- mutation_
queue - Per-realpath serialization for file mutations (edit / write).
- output_
accumulator - Streaming output accumulator with bounded memory and full-output spill.
- path_
utils - Path expansion, cwd resolution, and macOS path-variant fallback for tool file arguments.
- read
- Read tool: text files and supported images.
- truncate
- Shared truncation utilities for tool outputs.
- write
- Write tool: create or overwrite a file under the mutation queue.
Structs§
- Unknown
Tool Name - Error returned by
ToolName’sFromStrimplementation. Display text matches TypeScriptUnknown tool name: ${toolName}exactly.
Enums§
- Tool
Name - Name of one of the seven built-in coding tools (TypeScript
ToolName).
Constants§
- ALL_
TOOL_ NAMES - Full registry order (TypeScript
allToolNamesinsertion order andcreateAllToolDefinitionskey order): read → bash → edit → write → grep → find → ls. - DEFAULT_
ACTIVE_ TOOL_ NAMES - Default session-active tools (TypeScript
defaultActiveToolNames/createCodingToolDefinitions): read, bash, edit, write. The full registry still contains grep/find/ls; they stay inactive until activated. - READ_
ONLY_ TOOL_ NAMES - Read-only tool set (TypeScript
createReadOnlyToolDefinitions): read, grep, find, ls.
Functions§
- create_
all_ tool_ definitions - Builds all seven tools in provider-visible registry order.
- create_
coding_ tool_ definitions - Builds the four tools enabled by default for coding sessions.
- create_
read_ only_ tool_ definitions - Builds the read-only tool set in registry order.