feat(event): @hanzo/capture → @hanzo/event — the ONE telemetry client (errors are events)

Rename the capture SDK to @hanzo/event and fold error tracking into it, so ONE
client emits every kind of event — pageview/event/identify/group AND errors — on
one batched stream. The server lenses that one stream into product analytics, web
analytics, and error tracking (insights/analytics/sentry.hanzo.ai). Subsumes
@sentry: no second SDK, no second pipe.

- New 'error' EventKind + Exception type; WireEvent carries the exception.
- Analytics.captureError()/captureException(): normalize any throwable, emit a
  type:'error' event, flush at once (a crash may unload the page). Never throws
  back into the app.
- Auto-capture (config captureErrors, default on, browser-only): window.onerror +
  unhandledrejection → error events. The drop-in @sentry replacement.
- React ErrorBoundary (./react): reports render errors React swallows before
  window.onerror sees them — the React half of the replacement.
- 0.1.1 → 0.2.0. 28/28 tests pass (6 new error-capture specs), tsup build green.

Consumers (app/chat/console/hanzo.ai/operator) migrate @hanzo/capture →
@hanzo/event next; @hanzo/capture stops shipping new versions.
This commit is contained in:
Hanzo AI
2026-07-20 16:05:22 -07:00
parent 59f751e21c
commit afd5f82fea
16 changed files with 0 additions and 0 deletions