Event Inference
When you define events withAgentNetworkEvent.of(), the payload type is inferred from the Effect schema:
Agent Logic Inference
In.logic(), triggerEvent is a union of all listensTo event envelopes:
Emit Typing
Theemit() function only accepts events declared in .emits(). TypeScript will error if you emit an undeclared event or wrong payload shape.
Channel Names
Channel names use a branded type (ChannelName) and must be kebab-case. This is enforced at runtime.
Effect Integration
m4trix uses Effect for schema validation and concurrency. The event plane runs inside an Effect scope. For advanced use, you can compose with Effect’sEffect type and use .makeEffect() / .makeBoundEffect() for event creation.
