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.
9 lines
657 B
JavaScript
Executable File
9 lines
657 B
JavaScript
Executable File
#!/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();
|