From 2bb7b94a66a9da5fcb88a4625f2b8111e1289e21 Mon Sep 17 00:00:00 2001 From: "noether (claude)" Date: Sat, 18 Jul 2026 13:23:29 +0200 Subject: [PATCH] tools.d: add boltzmann stash tool (fleet-memory CLI wrapper) Wraps incus exec memory -- docker exec stash-stash-1 /stash behind one MCP tool so pi-agents call stash command:="recall ... -n /infra/hosts" instead of hand-typing the incus/docker chain. Loaded via LMCP_TOOLS_DIR=/opt/lmcp/tools.d. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01EWpfhDgYNA21tETDP9ueBE --- tools.d/boltzmann.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools.d/boltzmann.lua diff --git a/tools.d/boltzmann.lua b/tools.d/boltzmann.lua new file mode 100644 index 0000000..a742ada --- /dev/null +++ b/tools.d/boltzmann.lua @@ -0,0 +1,30 @@ +-- boltzmann-tools plugin: `stash` — fleet persistent-memory CLI wrapper. +-- Receives (server, run). Runs the stash CLI inside the memory Incus container's +-- stash-stash-1 docker container (which has NO shell — /stash is invoked directly +-- as argv; docker exec handles that, no `sh -c` inside the container). +local server, run = ... + +server:tool("stash", + "Fleet persistent memory (stash knowledge graph on the memory container). " + .. "`command` = a stash subcommand + its args as ONE string. " + .. "Examples: command:=\"recall escher plug AIN\" | command:=\"facts\" | " + .. "command:=\"remember 'the NAS is at 192.168.88.10'\" | command:=\"namespace list\". " + .. "Wrap multi-word text in single quotes. Read subcommands: recall, facts, namespace list, " + .. "goal list, context show. Write: remember, forget, consolidate run.", + { type = "object", properties = { + command = { type = "string", + description = "stash subcommand + args, e.g. \"recall \" or \"remember ''\"" }, + }, required = { "command" } }, + function(a) + local c = tostring(a.command or ""):gsub("^%s+", ""):gsub("%s+$", "") + if c == "" then return "Error: command required (e.g. command:=\"recall \")" end + return run("incus exec memory -- docker exec stash-stash-1 /stash " .. c, 60) + end, + { annotations = { + title = "Stash fleet memory", + readOnlyHint = false, + destructiveHint = false, + idempotentHint = false, + openWorldHint = true, + } } +)