tool registry: lazy-loading tool promotion, README docs

This commit is contained in:
Ollie Agent 2026-07-28 14:58:50 +02:00
parent fbe2bf2d8d
commit f09e8b5f32
2 changed files with 29 additions and 5 deletions

2
9p

@ -1 +1 @@
Subproject commit 96dda6e5f03f810122d401a3454f8bbb1b74e01b
Subproject commit b387b33593940a629282e321235abb52342d355c

View File

@ -123,6 +123,7 @@ Monorepo with Git submodules. Each submodule has its own Go module (except `el`
- **Sandboxed execution** — every tool call runs inside a Landlock sandbox with per-profile filesystem access rules
- **Extensible tools** — tools are executable scripts with header metadata; add one by dropping a file in a directory
- **Lazy-loading tool registry** — all tools are discoverable; only loaded tools are callable. Write a tool name to `s/{sid}/tools` to promote it to a native callable function — no MCP server, no SDK, no protocol boilerplate
- **Elevation** — commands that need to escape the sandbox can request elevation through a streaming protocol (frame-based, over unix socket)
### Agents
@ -332,13 +333,36 @@ The D-Bus interface is what makes native desktop integration possible:
All of these talk to `org.ollie.SessionManager` over D-Bus using Qt's native bindings — no IPC glue code, no subprocess management.
### Tool documentation lookup
### Tool registry: lazy-loading native tools
```sh
# Query a tool's full prompt/documentation
exec 3<>/mnt/ollie/tools; echo 'file_edit' >&3; cat <&3; exec 3>&-
Tools are scripts in `~/.config/ollie/tools/`. Write one, add a JSON schema header, and it's **discoverable** immediately. But it's only **callable** when you promote it into your session.
```bash
# Discover all available tools
cat s/{sid}/tools
# Load one into your session — it becomes a native callable function
echo file_glob | 9p write s/{sid}/tools
# The model sees it as a first-class tool on the next turn.
# No MCP server. No protocol. No SDK. Just a script with a header.
```
The tool header is minimal:
```bash
#!/usr/bin/env bash
# args_json: {"type":"object","properties":{"pattern":{"type":"string"}},"required":["pattern"]}
# ollie:prompt
# ## file_glob
# Find files by glob pattern.
# ollie:end
```
The `args_json` field is the JSON schema the model uses to call it. The `ollie:prompt` block is the documentation. Everything else is just a script.
This is the anti-MCP. No subprocess servers, no protocol negotiation, no capability advertisement, no transport layer. A file. A header. A script. The model calls it natively.
## Credits
Many sources of inspiration: