The runtime imported a bundle into its own process, which only JavaScript can be. Now an entrypoint that is not a plain JavaScript file — or is one marked executable — is started as a child with the runtime's environment and asked `tools/list` once and `tools/call` per call; what it lists is registered exactly as an imported bundle's registrations are, a `<seat>.<verb>` name as the seat's implementation. So a tools bundle may be in any language, and the mesh's part — the subjects, the seats, the `tools` answer, a failed bundle named — stays in the runtime and is shared by all of them. A child that exits mid-call tells the caller so and is started again on its next call. Proven against a real bus beside the three bundles already there: a Python bundle with no SDK at all answers its tool and its seat verb; a TypeScript bundle written against the protocol and marked executable is served through the launcher, shortcut off; a bundle told to exit is relaunched.
9 lines
399 B
JavaScript
Executable File
9 lines
399 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
// A TypeScript bundle written against the protocol and marked executable: served through the
|
|
// launcher like any other language, with the in-process shortcut off (novox/hq ADR 0187).
|
|
import { serveStdio } from "@novox/mesh-sdk/stdio";
|
|
|
|
await serveStdio("epsilon", [
|
|
{ name: "seven", description: "epsilon's", input: {}, run: async () => ({ epsilon: 7, via: "stdio" }) },
|
|
]);
|