Files
cli/crates/event/Cargo.toml
zeekay 53ce26ddc3 feat(telemetry): canonical /v1/event emitter, wired at the command seam
Add crates/event (hanzo-event): a small, shared, best-effort emitter that POSTs
the canonical Event wire (event, distinctId, time, properties) to
{api}/v1/event as a batched [Event] array. Fail-soft, opt-out
(HANZO_TELEMETRY=0, DO_NOT_TRACK), no PII (visitor is a random per-install
device id; a command reports only its verb, duration, and outcome), and bounded
so it never blocks a command. Auth is one bearer header: the active identity's
token when signed in, else a publishable key (HANZO_EVENT_KEY); with neither,
the fail-closed door would reject the event, so it is not sent.

Wire it into the CLI at the dispatch seam: build once per run, record the
top-level command on completion, flush at exit. dev consumes the same crate via
a pinned git dependency.
2026-07-22 18:21:53 -07:00

23 lines
664 B
TOML

[package]
name = "hanzo-event"
version = "0.1.0"
edition = "2021"
authors = ["Hanzo AI"]
description = "Canonical Event emitter — best-effort, privacy-respecting telemetry to the /v1/event front door"
license = "MIT"
repository = "https://github.com/hanzoai/cli"
[lib]
name = "hanzo_event"
path = "src/lib.rs"
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
getrandom = "0.2"
[dev-dependencies]
tokio = { version = "1", features = ["rt", "macros"] }