GizStack
View .mdOpen in ChatGPTOpen in Claude

gizai/agent/coding

The coding tools of an agent that works on one machine: read, bash, edit and write, with the names, arguments, limits and result texts that coding models are trained on (pi's tool set, github.com/earendil-works/pi, MIT). Each tool is a bash command of the host's Shell (a container, a computer, a remote host), so the tools work wherever bash runs, and a result is plain text: a file's lines reach the model as lines, not as an escaped JSON string.

gizlang
import * as Coding from "gizai/agent/coding";

Types

Shell

gizlang
type Shell = (command: string, input: Option<bytes>, seconds: i64) => Ran

Runs COMMAND with bash on the machine, INPUT (when given) on its standard input, its standard error merged into its output, killed after SECONDS: exit code 124 when it was.

Functions

instructions

gizlang
function instructions(cwd: string): string

The instructions that go with the tools, for an agent working in folder CWD; the host appends its own.

Effects: fail, alloc.

tools

gizlang
function tools(shell: Shell): Vec<Agent.Tool>

The tools read, bash, edit and write on the machine of SHELL.

Effects: fail, read, write, alloc.