Expand description
Built-in tools: read, bash, edit, write, and the optional grep,
find and ls.
Ports of packages/coding-agent/src/core/tools in pi v1.0.0. Declarations
(names, descriptions, schemas) match pi byte for byte, because they are part of
every request.
Re-exports§
pub use bash::Bash;
Modules§
- bash
bash: run a command, stream its combined output, keep the tail.- external
rgandfdfor thegrepandfindtools: the agent’s copy, else the system’s, else a download of the latest release.- mutation
- Serializes writes to the same file across concurrently running tool calls.
- path
- Resolving paths the model writes:
@prefixes,~,file://, odd spaces, and the macOS screenshot and quote variants of existing files. - registry
- The session’s tools and which of them are active, as pi’s
AgentSessionkeeps them (_refreshToolRegistry,_applyToolLoadoutin piv1.0.0). - truncate
- Output truncation shared by the tools: by lines and by bytes, from the head or the tail.
Structs§
- Described
- A tool declared with another description. Everything else is the tool’s.
- Edit
- The
edittool. - Find
- The
findtool. - Grep
- The
greptool. - Ls
- The
lstool. - Namespace
- A group of tools, such as one MCP server’s.
- Read
- The
readtool. - Registered
Tool - A tool as registered with a session: the tool, the text it adds to the system prompt, and how it reaches the model.
- Replacement
- One requested replacement.
- Runtime
- Session state tools read while running.
- ToolEnv
- What built-in tools share: the working directory, the session state and where helper binaries live.
- Write
- The
writetool.
Enums§
- Exposure
- pi’s
ToolExposure: how a tool reaches the model.
Constants§
- BUILTIN_
TOOLS - Every built-in tool, in pi’s registration order.
- DEFAULT_
TOOLS - Names of the tools active by default.
Functions§
- builtin
- Creates the named built-in tool.
- image_
mime_ type - The MIME type of a supported image, from its first 4100 bytes as pi sniffs them.
- js_
number - A number as JavaScript prints it.
- node_
error - The message Node gives a failed file system call, such as
ENOENT: no such file or directory, access '/a/b'. - preview_
edits - pi’s
computeEditsDiff: the diffeditswould make to the file atpath(resolved againstcwd), or why they cannot apply. Nothing is written.