Skip to main content

Module tools

Module tools 

Source
Expand description

speccoder’s tools: what an attempt may do to its worktree, served to agentplane as tool servers fs, proc and git.

Domain failures (no such file, ambiguous edit, protected path) come back as ordinary results {"ok": false, "error": …} so the model can see them and recover; agentplane ToolErrors are reserved for infrastructure.

Modules§

paths
Path rules for tools: normalisation, containment, secrets, and the protected set the model may never write.
policy
The policy classifier: every tool call is allowed, needs approval, or is denied — decided by code, before the call.

Structs§

EditFile
Replace an exact string in a file: once (it must occur exactly once) or everywhere.
GitDiff
Show the diff of the working tree against HEAD, optionally for one path.
GitStatus
Show changed, added and untracked files.
ListFiles
List files (not ignored by .gitignore), optionally under a directory and matching a glob.
ReadFile
Read a text file in the workspace, optionally a range of lines.
RunCommand
Run a program (no shell) in the workspace with a timeout; stdin is closed.
SearchCode
Search file contents with a regular expression (respects .gitignore).
ToolSpec
One tool as the model and agentplane see it.
WorkspaceTools
Tools bound to one worktree.
WriteFile
Create or replace a whole file.

Constants§

LINE_CAP
Characters kept per search-result line.
LIST_CAP
list_files cap.
MAX_COMMAND_SECS
Longest run_command timeout a model may ask for.
READ_CAP
read_file cap.
SEARCH_CAP
search_code match cap.

Functions§

catalog
Every tool, in a stable order (the order is part of the cached prompt prefix).
declarations
The model-facing declarations, in catalog order.