Expand description
§agent-event-emit
Structured event emitter for agent runs. One event per significant step (LLM call, tool call, error, etc.). Each event carries:
run_id— caller-supplied; same across the whole run.id— monotonic per-emitter; assigned on emit.ts_unix_ms— wall-clock millis when emitted.kind— short string label.payload— arbitraryserde_json::Value.
Serializes cleanly to JSON Lines for log shipping.
§Example
use agent_event_emit::Emitter;
use serde_json::json;
let mut e = Emitter::new("run-123");
let ev = e.emit("tool_call", json!({"name": "read_file", "path": "a.txt"}));
assert_eq!(ev.id, 1);
assert_eq!(ev.run_id, "run-123");