@code-insights/cli 3.2.0 → 3.3.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dashboard-dist/assets/index-cAfuFBOl.js +552 -0
  3. package/dashboard-dist/index.html +1 -1
  4. package/dist/commands/config.js +2 -2
  5. package/dist/commands/config.js.map +1 -1
  6. package/dist/commands/dashboard.js +1 -1
  7. package/dist/commands/dashboard.js.map +1 -1
  8. package/dist/commands/init.js +1 -1
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/install-hook.js +1 -1
  11. package/dist/commands/install-hook.js.map +1 -1
  12. package/dist/commands/open.js +2 -2
  13. package/dist/commands/open.js.map +1 -1
  14. package/dist/commands/reset.js +1 -1
  15. package/dist/commands/reset.js.map +1 -1
  16. package/dist/commands/stats/actions/cost.d.ts.map +1 -1
  17. package/dist/commands/stats/actions/cost.js +6 -3
  18. package/dist/commands/stats/actions/cost.js.map +1 -1
  19. package/dist/commands/stats/actions/models.d.ts.map +1 -1
  20. package/dist/commands/stats/actions/models.js +6 -3
  21. package/dist/commands/stats/actions/models.js.map +1 -1
  22. package/dist/commands/stats/actions/overview.d.ts.map +1 -1
  23. package/dist/commands/stats/actions/overview.js +6 -3
  24. package/dist/commands/stats/actions/overview.js.map +1 -1
  25. package/dist/commands/stats/actions/projects.d.ts.map +1 -1
  26. package/dist/commands/stats/actions/projects.js +6 -3
  27. package/dist/commands/stats/actions/projects.js.map +1 -1
  28. package/dist/commands/stats/actions/today.d.ts.map +1 -1
  29. package/dist/commands/stats/actions/today.js +6 -3
  30. package/dist/commands/stats/actions/today.js.map +1 -1
  31. package/dist/commands/status.js +1 -1
  32. package/dist/commands/status.js.map +1 -1
  33. package/dist/commands/sync.d.ts +1 -0
  34. package/dist/commands/sync.d.ts.map +1 -1
  35. package/dist/commands/sync.js +33 -4
  36. package/dist/commands/sync.js.map +1 -1
  37. package/dist/commands/telemetry.d.ts.map +1 -1
  38. package/dist/commands/telemetry.js +10 -14
  39. package/dist/commands/telemetry.js.map +1 -1
  40. package/dist/utils/telemetry.d.ts +36 -31
  41. package/dist/utils/telemetry.d.ts.map +1 -1
  42. package/dist/utils/telemetry.js +136 -188
  43. package/dist/utils/telemetry.js.map +1 -1
  44. package/package.json +3 -2
  45. package/server-dist/index.d.ts.map +1 -1
  46. package/server-dist/index.js +13 -6
  47. package/server-dist/index.js.map +1 -1
  48. package/server-dist/routes/analysis.d.ts.map +1 -1
  49. package/server-dist/routes/analysis.js +72 -9
  50. package/server-dist/routes/analysis.js.map +1 -1
  51. package/server-dist/routes/export.js +1 -1
  52. package/server-dist/routes/export.js.map +1 -1
  53. package/server-dist/routes/telemetry.d.ts +4 -0
  54. package/server-dist/routes/telemetry.d.ts.map +1 -0
  55. package/server-dist/routes/telemetry.js +21 -0
  56. package/server-dist/routes/telemetry.js.map +1 -0
  57. package/dashboard-dist/assets/index-DzBnL32c.js +0 -549
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  All notable changes to `@code-insights/cli` will be documented in this file.
4
4
 
5
+ ## [3.3.0] - 2026-03-02
6
+
7
+ ### Changed
8
+
9
+ - **Telemetry migrated from Supabase to PostHog** — Replaces the custom Supabase Edge Function with PostHog for product analytics. Provides retention charts, feature funnels, and a real analytics dashboard instead of raw event storage.
10
+ - **Stable machine identity** — Machine IDs no longer rotate monthly, enabling accurate unique user counts and retention analysis. IDs remain anonymous (SHA-256 hash, no PII).
11
+ - **Expanded event schema** — All CLI commands now include `duration_ms` for performance tracking. Sync events include exact session counts and per-provider breakdowns. Analysis events capture LLM provider and model.
12
+ - **Dashboard telemetry** — Page views and load timing tracked via `posthog-js` (client-side). Configured with `autocapture: false`, `persistence: 'memory'`, `ip: false` for privacy.
13
+ - **`trackEvent` signature change** — Now accepts `(event: TelemetryEventName, properties?)` instead of `(command, success, subcommand?)`. Typed event names for autocomplete and typo prevention.
14
+
15
+ ### Added
16
+
17
+ - **`GET /api/telemetry/identity`** — New server endpoint returns shared `distinct_id` for dashboard SPA initialization.
18
+ - **`shutdownTelemetry()`** — Graceful PostHog flush on server shutdown with 3-second timeout guard.
19
+ - **`posthog-node`** dependency in CLI (~20KB, lazy-initialized)
20
+ - **`posthog-js`** dependency in dashboard (~45KB, memory-only persistence)
21
+ - **Analysis failure tracking** — `analysis_run` events now fire on both success and failure for observability.
22
+
23
+ ### Removed
24
+
25
+ - Supabase Edge Function endpoint, HMAC signing key, and `signPayload()`
26
+ - Monthly-rotating machine ID (`getMachineId()` with date salt)
27
+ - `getSessionCountBucket()` — replaced by exact `total_sessions` person property
28
+ - `getDataSource()` — always 'local', provided no value
29
+
30
+ ### Fixed
31
+
32
+ - **`RecurringInsightResult.groups`** — Fixed type error using `.insights` instead of `.groups` for recurring insight count.
33
+
5
34
  ## [3.1.1] - 2026-03-02
6
35
 
7
36
  ### Fixed