pub struct AgentEventEnvelope {
pub event_id: Uuid,
pub sequence: u64,
pub timestamp: OffsetDateTime,
pub event: AgentEvent,
}Expand description
Envelope wrapping every AgentEvent with idempotency metadata.
Mobile clients can use event_id for deduplication on retry, sequence
for ordering after persistence, and timestamp for display.
The event field is flattened in JSON so that event_id, sequence,
timestamp, and the event’s type discriminant all appear at the same level.
Fields§
§event_id: UuidUnique identifier for this event emission.
UUID v4 when created via AgentEventEnvelope::wrap (SDK-local path),
UUID v7 when created via server-committed CommittedEvent::into_envelope.
sequence: u64Monotonically increasing sequence number within a single run.
timestamp: OffsetDateTimeUTC timestamp of when the event was emitted.
event: AgentEventThe actual event payload.
Implementations§
Source§impl AgentEventEnvelope
impl AgentEventEnvelope
Sourcepub fn wrap(event: AgentEvent, seq: &SequenceCounter) -> AgentEventEnvelope
pub fn wrap(event: AgentEvent, seq: &SequenceCounter) -> AgentEventEnvelope
Wrap an AgentEvent in an envelope, assigning it a unique ID,
the next sequence number, and the current UTC timestamp.
Trait Implementations§
Source§impl Clone for AgentEventEnvelope
impl Clone for AgentEventEnvelope
Source§fn clone(&self) -> AgentEventEnvelope
fn clone(&self) -> AgentEventEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more