// showcase's event consumer — loaded by a tool host, not run on its own. // // **This is one of the four things a module's code can be**, and the one that is easiest to // forget: tools are called, a provisioner is invoked, a process runs, and a consumer simply reacts. // It is here so the module exercises the shape rather than describing it. import { on, emit } from "@novox/mesh-sdk/events"; await on<{ who?: string }>("module.showcase.greeted", async (event) => { console.log(`[showcase] greeted ${event.body.who ?? "somebody"}`); // A consumer may emit, which is what makes an event graph rather than a list of sinks. await emit("module.showcase.acknowledged", { who: event.body.who ?? "somebody" }); });