Defining Events
UseAgentNetworkEvent.of() to define an event with a name and a payload schema:
Event Envelope
Every event flowing through the system is wrapped in an envelope:meta fields are automatically managed by the runtime. You only need to provide the name and payload when emitting events from agents.
API Summary
| Method | Description |
|---|---|
AgentNetworkEvent.of(name, schema) | Creates an event definition |
.make(payload) | Creates an unbound event for emit; meta injected at runtime |
.makeBound(meta, payload) | Creates full envelope for tests or manual triggers |
.makeEffect(payload) | Effect version of make |
.makeBoundEffect(meta, payload) | Effect version of makeBound |
.decode(unknown) | Decodes unknown value into validated envelope |
.is(value) | Type guard for event shape |

