From 5c016cfdbcb122e2b4f0496ef946642d68953c4b Mon Sep 17 00:00:00 2001 From: T Date: Wed, 27 May 2026 20:39:45 -0600 Subject: tool names prefixed with `std.` --- agent/tools/edit.lua | 6 +++--- agent/tools/read.lua | 10 +++++----- agent/tools/shell.lua | 2 +- agent/tools/write.lua | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/agent/tools/edit.lua b/agent/tools/edit.lua index a56c334..7ad39c2 100644 --- a/agent/tools/edit.lua +++ b/agent/tools/edit.lua @@ -1,5 +1,5 @@ --- Apply a batch of exact-text replacements to a file. Pi-style terse --- tool description; the rules are enforced here rather than re-stated +-- Apply a batch of exact-text replacements to a file. Keep the tool +-- description terse; the rules are enforced here rather than re-stated -- in prose, with the rejection message naming exactly which rule each -- entry tripped so the model can self-correct on the next call. -- @@ -11,7 +11,7 @@ -- progressively against the result of earlier entries. return { - name = "edit", + name = "std.edit", description = "Apply exact-text replacements to a file. Each entry's `old` must match exactly once in the original file (not progressively). Edits whose ranges overlap, match zero times, or match multiple times reject the entire call — no partial edits, file untouched. Keep `old` minimal but unique; widen with surrounding context if needed.", schema = { type = "object", diff --git a/agent/tools/read.lua b/agent/tools/read.lua index e6192ae..05661c4 100644 --- a/agent/tools/read.lua +++ b/agent/tools/read.lua @@ -1,14 +1,14 @@ -- Read a file from disk and return its text verbatim. -- --- Output cap: 50 KB and 2000 lines, whichever is hit first. Matches --- pi's defaults; large enough to be useful, small enough to keep the --- model's context manageable. A single tool result that blows out the +-- Output cap: 50 KB and 2000 lines, whichever is hit first. Large +-- enough to be useful, small enough to keep the model's context +-- manageable. A single tool result that blows out the context window is -- context window is worse than one that silently asks for a follow-up -- scoped read. -- -- The slicing knobs are `offset` (1-based line to start at) and -- `limit` (max lines to return). SQL-shaped — models recognize the --- idiom — and matches pi's tool surface. When the cap is hit, a +-- idiom. When the cap is hit, a -- `[truncated: ...]` marker names the next `offset` for a follow-up -- call. The file body itself is byte-for-byte what's on disk, so -- `edit` anchors round-trip exactly. @@ -17,7 +17,7 @@ local MAX_BYTES = 50 * 1024 -- 50 KB local MAX_LINES = 2000 return { - name = "read", + name = "std.read", description = "Read a file from disk. Output is truncated to the first 50KB or 2000 lines, whichever is hit first; on truncation a marker names the next offset for a follow-up call. Use offset/limit to slice.", schema = { type = "object", diff --git a/agent/tools/shell.lua b/agent/tools/shell.lua index c615d1c..a9e9de3 100644 --- a/agent/tools/shell.lua +++ b/agent/tools/shell.lua @@ -94,7 +94,7 @@ end -- --------------------------------------------------------------------------- return { - name = "shell", + name = "std.shell", description = string.format("Execute a shell command via `/bin/sh -c`. Returns merged stdout+stderr after the command exits, prefixed with an exit-status header. Output is truncated to the last %dKB; on truncation the full transcript is saved to `$PANTO_HOME/shell-output/` and its path is included for follow-up `read` calls. Default timeout 5 minutes.", MAX_BYTES / 1024), schema = { type = "object", diff --git a/agent/tools/write.lua b/agent/tools/write.lua index 70aa5c8..01bf3b2 100644 --- a/agent/tools/write.lua +++ b/agent/tools/write.lua @@ -1,5 +1,5 @@ --- Write text to a file, creating parent directories as needed. Pi-style --- terse description because every byte of every tool description rides +-- Write text to a file, creating parent directories as needed. Keep the +-- description terse because every byte of every tool description rides -- in the system prompt on every turn. local uv = require("luv") @@ -31,7 +31,7 @@ local function dirname(path) end return { - name = "write", + name = "std.write", description = "Save content to a path. Overwrites existing files; missing parent directories are created automatically.", schema = { type = "object", -- cgit v1.3