// lavinmq's events entrypoint, loaded by the per-node tool host (the provisioner container runs // ./provisioner separately). The broker lifecycle events are EMITTED from the provisioner, where the // lifecycle actually happens (novox/hq ADR 0041/0042): // module.lavinmq.amqp.provisioned — a consumer's vhost + user was created // module.lavinmq.amqp.deprovisioned — that vhost + user was removed // Here in the tool host we react to them, keeping a lightweight audit trail of who was granted a // broker and who lost one — observability the provider itself is best placed to log. import { on } from "@novox/mesh-sdk/events"; interface AmqpEvent { consumer?: string; user: string; vhost?: string; } await on("amqp.provisioned", async (e) => { console.log(`[lavinmq] broker provisioned for ${e.body.consumer ?? "?"} (user ${e.body.user}, vhost ${e.body.vhost})`); }); await on("amqp.deprovisioned", async (e) => { console.log(`[lavinmq] broker deprovisioned (user ${e.body.user})`); }); console.log("[lavinmq] auditing broker lifecycle events");