From f09e8b5f32bb3c957a616fa3e1e25a762c87412d Mon Sep 17 00:00:00 2001 From: Ollie Agent Date: Tue, 28 Jul 2026 14:58:50 +0200 Subject: [PATCH] tool registry: lazy-loading tool promotion, README docs --- 9p | 2 +- README.md | 32 ++++++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/9p b/9p index 96dda6e..b387b33 160000 --- a/9p +++ b/9p @@ -1 +1 @@ -Subproject commit 96dda6e5f03f810122d401a3454f8bbb1b74e01b +Subproject commit b387b33593940a629282e321235abb52342d355c diff --git a/README.md b/README.md index 8126493..51a891a 100644 --- a/README.md +++ b/README.md @@ -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: