A launched bundle is told the module it serves (hq ADR 0193)
node-tools sets MESH_SERVED_MODULE for each child it launches, so the SDK's stdio loop lists that module's tools by their names and a seat's verbs as the seat's, whichever was registered first.
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
// A launched bundle registering its seat before its own tools, served through the SDK's loop
|
||||
// (novox/hq ADR 0193): which is the seat's and which the module's comes from the name it is given.
|
||||
import { registerModuleTools } from "@novox/mesh-sdk/tools";
|
||||
import { serveRegisteredOverStdio } from "@novox/mesh-sdk/stdio";
|
||||
registerModuleTools("node-shelf", () => [{ name: "list", description: "the shelf", input: {}, run: async () => ({ shelf: ["x"] }) }]);
|
||||
registerModuleTools("theta", (env) => [{ name: "own", description: "theta's", input: {}, run: async () => ({ theta: env.THETA_WORD ?? null }) }]);
|
||||
await serveRegisteredOverStdio();
|
||||
Reference in New Issue
Block a user