@hanzo/event 0.3.21 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-CHLpJy51.cjs';
2
2
  export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-CHLpJy51.cjs';
3
+ export { EVENTS, EXCEPTION, EventName, PAGEVIEW } from '@hanzo/events';
3
4
 
4
5
  /** Read the persisted first-touch attribution. */
5
6
  declare function getFirstTouch(): Attribution | undefined;
@@ -128,56 +129,6 @@ declare function scrubPII(s: string): string;
128
129
  * first: unbounded text is a denial-of-service surface, not just a size problem. */
129
130
  declare function scrubText(s: string | undefined, capturePII?: boolean): string;
130
131
 
131
- declare const EVENTS: {
132
- readonly SIGNUP_VIEWED: "signup_viewed";
133
- readonly SIGNUP_SUBMITTED: "signup_submitted";
134
- readonly SIGNUP_VERIFIED: "signup_verified";
135
- readonly SIGNUP_COMPLETED: "signup_completed";
136
- /** A RETURNING user authenticated — the non-signup half of the IAM callback.
137
- * Keeping it distinct is what stops returning logins from inflating signups. */
138
- readonly LOGIN_COMPLETED: "login_completed";
139
- /** Activation: the first moment of real value. ONE event for every product —
140
- * the product-specific moment is the `action` property (api_call, app_live,
141
- * chat_reply), never a new event name. */
142
- readonly FIRST_ACTION: "first_action";
143
- readonly WAITLIST_JOINED: "waitlist_joined";
144
- readonly WAITLIST_SHARED: "waitlist_shared";
145
- readonly REFERRAL_USED: "referral_used";
146
- readonly REFERRAL_CLAIMED: "referral_claimed";
147
- readonly PRICING_VIEWED: "pricing_viewed";
148
- readonly PLAN_CLICKED: "plan_clicked";
149
- readonly CHECKOUT_STARTED: "checkout_started";
150
- readonly ORDER_COMPLETED: "order_completed";
151
- readonly FEATURE_USED: "feature_used";
152
- readonly API_KEY_CREATED: "api_key_created";
153
- readonly APP_CREATED: "app_created";
154
- readonly PROJECT_CREATED: "project_created";
155
- readonly AGENT_CREATED: "agent_created";
156
- readonly CHAT_STARTED: "chat_started";
157
- readonly CHAT_MESSAGE_SENT: "chat_message_sent";
158
- /** The user switched model/endpoint — the single strongest quality signal a
159
- * chat surface emits (a switch usually follows a bad answer). */
160
- readonly MODEL_SWITCHED: "model_switched";
161
- readonly TASK_STARTED: "task_started";
162
- readonly TASK_COMPLETED: "task_completed";
163
- readonly BUILD_STARTED: "build_started";
164
- /** A model finished producing an artifact (an app build, a chat reply, an agent
165
- * run). Carries `durationMs` — the outcome event owns its own duration, so no
166
- * paired start event is needed. */
167
- readonly GENERATION_COMPLETED: "generation_completed";
168
- readonly GENERATION_FAILED: "generation_failed";
169
- readonly DEPLOY_STARTED: "deploy_started";
170
- readonly DEPLOY_SUCCEEDED: "deploy_succeeded";
171
- readonly DEPLOY_FAILED: "deploy_failed";
172
- };
173
- type EventName = (typeof EVENTS)[keyof typeof EVENTS];
174
- /** The reserved event name a pageview is stored under (server + read lens). */
175
- declare const PAGEVIEW = "$pageview";
176
- /** The reserved name every captured exception is emitted under. Error Tracking
177
- * reads exactly this name; an exception emitted under its own message instead
178
- * makes every distinct message a permanent entry in the event taxonomy. */
179
- declare const EXCEPTION = "$exception";
180
-
181
132
  /**
182
133
  * digest is a stable 32-hex-char (128-bit) content hash, computed synchronously.
183
134
  *
@@ -353,4 +304,4 @@ declare function hasAttribution(a: Attribution): boolean;
353
304
  /** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
354
305
  declare function isoWeek(d: Date): string;
355
306
 
356
- export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, EXCEPTION, type ErrorIdentity, type EventName, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
307
+ export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, type ErrorIdentity, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-CHLpJy51.js';
2
2
  export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-CHLpJy51.js';
3
+ export { EVENTS, EXCEPTION, EventName, PAGEVIEW } from '@hanzo/events';
3
4
 
4
5
  /** Read the persisted first-touch attribution. */
5
6
  declare function getFirstTouch(): Attribution | undefined;
@@ -128,56 +129,6 @@ declare function scrubPII(s: string): string;
128
129
  * first: unbounded text is a denial-of-service surface, not just a size problem. */
129
130
  declare function scrubText(s: string | undefined, capturePII?: boolean): string;
130
131
 
131
- declare const EVENTS: {
132
- readonly SIGNUP_VIEWED: "signup_viewed";
133
- readonly SIGNUP_SUBMITTED: "signup_submitted";
134
- readonly SIGNUP_VERIFIED: "signup_verified";
135
- readonly SIGNUP_COMPLETED: "signup_completed";
136
- /** A RETURNING user authenticated — the non-signup half of the IAM callback.
137
- * Keeping it distinct is what stops returning logins from inflating signups. */
138
- readonly LOGIN_COMPLETED: "login_completed";
139
- /** Activation: the first moment of real value. ONE event for every product —
140
- * the product-specific moment is the `action` property (api_call, app_live,
141
- * chat_reply), never a new event name. */
142
- readonly FIRST_ACTION: "first_action";
143
- readonly WAITLIST_JOINED: "waitlist_joined";
144
- readonly WAITLIST_SHARED: "waitlist_shared";
145
- readonly REFERRAL_USED: "referral_used";
146
- readonly REFERRAL_CLAIMED: "referral_claimed";
147
- readonly PRICING_VIEWED: "pricing_viewed";
148
- readonly PLAN_CLICKED: "plan_clicked";
149
- readonly CHECKOUT_STARTED: "checkout_started";
150
- readonly ORDER_COMPLETED: "order_completed";
151
- readonly FEATURE_USED: "feature_used";
152
- readonly API_KEY_CREATED: "api_key_created";
153
- readonly APP_CREATED: "app_created";
154
- readonly PROJECT_CREATED: "project_created";
155
- readonly AGENT_CREATED: "agent_created";
156
- readonly CHAT_STARTED: "chat_started";
157
- readonly CHAT_MESSAGE_SENT: "chat_message_sent";
158
- /** The user switched model/endpoint — the single strongest quality signal a
159
- * chat surface emits (a switch usually follows a bad answer). */
160
- readonly MODEL_SWITCHED: "model_switched";
161
- readonly TASK_STARTED: "task_started";
162
- readonly TASK_COMPLETED: "task_completed";
163
- readonly BUILD_STARTED: "build_started";
164
- /** A model finished producing an artifact (an app build, a chat reply, an agent
165
- * run). Carries `durationMs` — the outcome event owns its own duration, so no
166
- * paired start event is needed. */
167
- readonly GENERATION_COMPLETED: "generation_completed";
168
- readonly GENERATION_FAILED: "generation_failed";
169
- readonly DEPLOY_STARTED: "deploy_started";
170
- readonly DEPLOY_SUCCEEDED: "deploy_succeeded";
171
- readonly DEPLOY_FAILED: "deploy_failed";
172
- };
173
- type EventName = (typeof EVENTS)[keyof typeof EVENTS];
174
- /** The reserved event name a pageview is stored under (server + read lens). */
175
- declare const PAGEVIEW = "$pageview";
176
- /** The reserved name every captured exception is emitted under. Error Tracking
177
- * reads exactly this name; an exception emitted under its own message instead
178
- * makes every distinct message a permanent entry in the event taxonomy. */
179
- declare const EXCEPTION = "$exception";
180
-
181
132
  /**
182
133
  * digest is a stable 32-hex-char (128-bit) content hash, computed synchronously.
183
134
  *
@@ -353,4 +304,4 @@ declare function hasAttribution(a: Attribution): boolean;
353
304
  /** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
354
305
  declare function isoWeek(d: Date): string;
355
306
 
356
- export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, EXCEPTION, type ErrorIdentity, type EventName, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
307
+ export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, type ErrorIdentity, ExceptionEntry, ExceptionProperties, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, SentryLevel, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
package/dist/index.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ import { EVENTS, PAGEVIEW, EXCEPTION } from '@hanzo/events';
2
+ export { EVENTS, EXCEPTION, PAGEVIEW } from '@hanzo/events';
3
+
1
4
  // src/attribution.ts
2
5
  var SOCIAL_HOSTS = [
3
6
  "facebook.",
@@ -87,59 +90,6 @@ function dsnForProduct(product, key) {
87
90
  return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
88
91
  }
89
92
 
90
- // src/events.ts
91
- var EVENTS = {
92
- // Signup funnel: view -> submit -> verify -> completed -> first action.
93
- SIGNUP_VIEWED: "signup_viewed",
94
- SIGNUP_SUBMITTED: "signup_submitted",
95
- SIGNUP_VERIFIED: "signup_verified",
96
- SIGNUP_COMPLETED: "signup_completed",
97
- /** A RETURNING user authenticated — the non-signup half of the IAM callback.
98
- * Keeping it distinct is what stops returning logins from inflating signups. */
99
- LOGIN_COMPLETED: "login_completed",
100
- /** Activation: the first moment of real value. ONE event for every product —
101
- * the product-specific moment is the `action` property (api_call, app_live,
102
- * chat_reply), never a new event name. */
103
- FIRST_ACTION: "first_action",
104
- // Waitlist + referral.
105
- WAITLIST_JOINED: "waitlist_joined",
106
- WAITLIST_SHARED: "waitlist_shared",
107
- REFERRAL_USED: "referral_used",
108
- REFERRAL_CLAIMED: "referral_claimed",
109
- // Upgrade-intent + purchase.
110
- PRICING_VIEWED: "pricing_viewed",
111
- PLAN_CLICKED: "plan_clicked",
112
- CHECKOUT_STARTED: "checkout_started",
113
- ORDER_COMPLETED: "order_completed",
114
- // Feature usage — generic + the common key surfaces across products.
115
- FEATURE_USED: "feature_used",
116
- API_KEY_CREATED: "api_key_created",
117
- APP_CREATED: "app_created",
118
- PROJECT_CREATED: "project_created",
119
- AGENT_CREATED: "agent_created",
120
- CHAT_STARTED: "chat_started",
121
- CHAT_MESSAGE_SENT: "chat_message_sent",
122
- /** The user switched model/endpoint — the single strongest quality signal a
123
- * chat surface emits (a switch usually follows a bad answer). */
124
- MODEL_SWITCHED: "model_switched",
125
- TASK_STARTED: "task_started",
126
- TASK_COMPLETED: "task_completed",
127
- // Build → ship. `build_*` is a MODEL producing an artifact; `deploy_*` is that
128
- // artifact going live. Intent (build_started) is never the same event as the
129
- // artifact existing (app_created) — conflating them makes the funnel lie.
130
- BUILD_STARTED: "build_started",
131
- /** A model finished producing an artifact (an app build, a chat reply, an agent
132
- * run). Carries `durationMs` — the outcome event owns its own duration, so no
133
- * paired start event is needed. */
134
- GENERATION_COMPLETED: "generation_completed",
135
- GENERATION_FAILED: "generation_failed",
136
- DEPLOY_STARTED: "deploy_started",
137
- DEPLOY_SUCCEEDED: "deploy_succeeded",
138
- DEPLOY_FAILED: "deploy_failed"
139
- };
140
- var PAGEVIEW = "$pageview";
141
- var EXCEPTION = "$exception";
142
-
143
93
  // src/scrub.ts
144
94
  var REDACTED = "[redacted]";
145
95
  var EMAIL_MARK = "[email]";
@@ -1241,6 +1191,6 @@ var COHORTS = {
1241
1191
  * reformat of one copy is a diff against the other.
1242
1192
  */
1243
1193
 
1244
- export { Analytics, COHORTS, EVENTS, EXCEPTION, FUNNELS, GOALS, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
1194
+ export { Analytics, COHORTS, FUNNELS, GOALS, PRODUCTS, PRODUCT_PROJECT, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, digest, dsnForProduct, eventsOf, exceptionEntry, exceptionProperties, fingerprint, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
1245
1195
  //# sourceMappingURL=index.mjs.map
1246
1196
  //# sourceMappingURL=index.mjs.map