A launched tool emits through its runtime, and calls run beside the stdio loop (hq ADR 0193)

A launched bundle holds no bus connection. The stdio loop binds a broker whose publish asks the
runtime (mesh/publish) and resolves when the runtime has published; asking, answering and
subscribing are refused by name. Tool calls run beside the loop, so a tool awaiting the runtime's
answer to its emit does not deadlock the line that carries it. 0.1.5.
This commit is contained in:
jochen
2026-10-03 21:12:14 +02:00
parent 9c2399d595
commit fdd5c58a87
4 changed files with 92 additions and 8 deletions
+8
View File
@@ -0,0 +1,8 @@
// A launched bundle whose tool emits (novox/hq ADR 0193): the emit travels to the runtime over stdio.
import { registerModuleTools } from "../../dist/tools/index.js";
import { emit } from "../../dist/events/index.js";
import { serveRegisteredOverStdio } from "../../dist/stdio/index.js";
registerModuleTools("chime", () => [
{ name: "ring", description: "rings and says so", input: {}, run: async () => { await emit("rang", { times: 1 }); return { rang: true }; } },
]);
await serveRegisteredOverStdio();