swink-agent 0.9.0

Core scaffolding for running LLM-powered agentic loops
1
2
3
4
5
6
7
8
9
10
11
12
13
# AGENTS.md — Built-in Tools

## Scope

`src/tools/` — BashTool, EditFileTool, ReadFileTool, WriteFileTool. Feature-gated behind `builtin-tools` (default-enabled).

## Key Invariants

- `MAX_OUTPUT_BYTES` = 100KB shared truncation limit.
- Two-phase cancellation: pre-check `is_cancelled()` before I/O; BashTool also races via `tokio::select!` and kills child on cancel/timeout.
- BashTool runs `sh -c` — not safe for untrusted users.
- Pipe draining must be concurrent (stdout/stderr via `tokio::spawn`). Sequential reads deadlock on large outputs.
- EditFileTool: exact match first, then line-by-line ignoring trailing whitespace. Edits applied in-memory before atomic write (`{filename}.swink-edit.tmp` + rename).