mesh/merge-gate pass: builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of …
mesh/repo-check pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the change's judges the pull requests after it merges; it…
mesh/delivery-group group fix/365-a-tool-call-names-its-caller delivering: 0 of 4 delivered
mesh/delivery superseded: a newer head of the same pull request
Each tool and seat verb is also served on its caller-named subject, kind call with the caller's bus user last, which the controller grants each user with its own name alone; the runtime hands the module that caller in the call's _meta, never from the body. Calls through the runtime (the console and modules' invokes) ask the caller-named subject first and the old one only when the first reached nobody: nothing serves it yet, or the bus refused it because the grant is not delivered yet, which ends the call at once rather than after 30 s. The old subjects stay served and say no caller for one release (hq issue 464).
25 lines
1.3 KiB
Python
Executable File
25 lines
1.3 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
# A tools bundle that says who the runtime said called it (novox/hq issue 365): MCP over stdio, no SDK. Its tool
|
|
# and its seat verb answer the caller the call's `_meta` named — "" when it named none — and the arguments as given.
|
|
import json, sys
|
|
|
|
def say(m):
|
|
m["jsonrpc"] = "2.0"; sys.stdout.write(json.dumps(m) + "\n"); sys.stdout.flush()
|
|
|
|
TOOLS = [
|
|
{"name": "who", "description": "who called", "inputSchema": {"type": "object", "properties": {}}},
|
|
{"name": "node-desk.who", "description": "who called the seat's verb", "inputSchema": {"type": "object", "properties": {}}},
|
|
]
|
|
for line in sys.stdin:
|
|
req = json.loads(line); rid = req.get("id"); m = req.get("method"); p = req.get("params") or {}
|
|
if m == "initialize":
|
|
say({"id": rid, "result": {"protocolVersion": "2025-03-26", "capabilities": {"tools": {}}, "serverInfo": {"name": "ledger", "version": "1"}}})
|
|
elif m == "tools/list":
|
|
say({"id": rid, "result": {"tools": TOOLS}})
|
|
elif m == "tools/call":
|
|
meta = p.get("_meta") or {}
|
|
said = {"caller": meta.get("mesh/caller", ""), "arguments": p.get("arguments") or {}}
|
|
say({"id": rid, "result": {"content": [{"type": "text", "text": json.dumps(said)}]}})
|
|
elif rid is not None:
|
|
say({"id": rid, "result": {}})
|