# Variable AgentEventSchema`Const`

AgentEventSchema: ZodObject<
{
eventId: ZodString;
timestamp: ZodISODateTime;
agentId: ZodString;
eventType: ZodEnum<
{
error: "error";
state_change: "state_change";
message_sent: "message_sent";
message_received: "message_received";
tool_invoked: "tool_invoked";
tool_completed: "tool_completed";
memory_read: "memory_read";
memory_write: "memory_write";
task_started: "task_started";
task_completed: "task_completed";
},
>;
traceId: ZodString;
spanId: ZodString;
parentSpanId: ZodOptional<ZodString>;
payload: ZodRecord<ZodString, ZodUnknown>;
durationMs: ZodOptional<ZodNumber>;
},
$strip,
> = ...

Zod schema for AgentEvent validation.

- Defined in packages/nexus-agents/src/observability/swarm-observer-schemas.ts:41