prompts: document tool discovery in session-9p.md

- Global catalog: read /tools
- Loaded tools: read agent/tools
- Load a tool: write tool name to agent/tools
- Added tools to agent directory file table
This commit is contained in:
Levi Neely 2026-08-03 11:26:37 +02:00
parent 8aff88d0a1
commit 8bb4246cde
1 changed files with 19 additions and 14 deletions

View File

@ -11,34 +11,38 @@ Access 9P files using the `ollie-9p` command (which auto-discovers the server vi
| `agents` | read | Available agent names, one per line |
| `backends` | read | Available backend names, one per line |
| `models` | read | Available models (backend\tmodel per line) |
| `tools` | read | Global tool catalog (all discoverable tools) |
| `help` | read | Help text |
| `ctl` | write | Server control commands (e.g. `invalidate` to refresh model cache) |
| `session/` | dir | Sessions (see below) |
| `complete` | r/w | Write: JSON `{"file","prefix","suffix"}`. Read: code completion result. |
| `generate` | r/w | Write: JSON `{"prompt"}` or plain text. Read: one-shot LLM generation result. |
| `route` | r/w | Write: task description. Read: `backend=X model=Y` recommendation. |
| `tools` | r/w | Write: tool name. Read: tool's full prompt/documentation. |
`complete`, `generate`, `route`, and `tools` are request-response files. Write a query, then read the response:
`complete`, `generate`, and `route` are request-response files:
```bash
# Get a tool's documentation
echo 'file_edit' | ollie-9p rdwr tools
# → returns file_edit's usage, args, and examples
# Pick a backend+model for a task
echo 'implement login page' | ollie-9p rdwr route
# → returns "backend=anthropic model=claude-sonnet-4-20250514"
# Generate text (one-shot, no session)
echo '{"prompt":"summarize X"}' | ollie-9p rdwr generate
# → returns the generated text
# Get a code completion
echo '{"file":"main.go","prefix":"func "}' | ollie-9p rdwr complete
# → returns completion candidates
```
## Tool Discovery
Tools are loaded dynamically per-agent. The system has three levels:
| Path | Purpose |
|---|---|
| `ollie-9p read tools` | **Global catalog** — all available tools on disk |
| `ollie-9p read session/{id}/agent/{aid}/tools` | **Loaded tools** — tools active in this agent |
| `echo "name" \| ollie-9p write session/{id}/agent/{aid}/tools` | **Load a tool** — activate it for this agent |
- **List available tools** — `ollie-9p read tools` (global catalog with descriptions)
- **See loaded tools** — `ollie-9p read session/{id}/agent/{aid}/tools`
- **Load a tool** — `echo "toolname" | ollie-9p write session/{id}/agent/{aid}/tools` (or use `tool_load`)
Once loaded, a tool becomes a first-class callable function with typed arguments. Load tools as needed — do not load everything upfront.
## Peer Agent Discovery
Sessions sharing your `cwd` are your peer agents. Read `session/idx` to discover other sessions available for cooperation:
@ -93,6 +97,7 @@ Each agent in a session gets its own subdirectory with its own plan, state, and
| File | Mode | Purpose |
|---|---|---|
| `tools` | r/w | Read: loaded tools. Write: load a tool by name. |
| `plan` | r/w | Markdown checklist; survives compaction; visible to peers |
## Operations