mirror of
https://github.com/hanzoai/cli.git
synced 2026-10-30 15:00:27 +00:00
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.
23 lines
664 B
TOML
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"] }
|