@happyvertical/smrt-analytics 0.55.7 → 0.55.8

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/AGENTS.md CHANGED
@@ -59,6 +59,35 @@ import { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';
59
59
  const StatCard = ModuleUIRegistry.get('@happyvertical/smrt-analytics', 'stat-card');
60
60
  ```
61
61
 
62
+ ## Recipes (#3719)
63
+
64
+ `src/recipes.ts` declares `analytics.reports` (`AnalyticsReportsRecipe`:
65
+ `AnalyticsProperty` and `AnalyticsReport`), emitted into the built
66
+ `manifest.json` and `smrt-knowledge.json` `recipes`. `AnalyticsEvent` and
67
+ `AnalyticsDataStream` are left out: event tracking and stream setup are separate
68
+ concerns. User-facing help is `src/reports.recipe.md` (#3591); keep it and the
69
+ `@field({ description })` text on the two models in plain language, and never
70
+ reference a `sensitive` field (`apiSecret`, `providerMetadata`) in help.
71
+
72
+ - **Runtime is `server`.** Reports and their rows live in the app database, the
73
+ AI summary needs a server-held key, and provider credentials sit on the
74
+ property row (so no `providers` are declared: there are no env secrets to name).
75
+ - **One route, deliberately.** `/analytics/summary` mounts
76
+ `@happyvertical/smrt-analytics/svelte#AnalyticsSummary`, which renders an empty
77
+ state without data. `PropertyInfo` and `EventsTable` take required row props
78
+ and throw with none, so they are not routes; a host places them in its own
79
+ pages. Add a route only for a component that survives being mounted bare.
80
+ - **No demo seed.** The playground sample data is module-local, not an export.
81
+ - **What the assistant can do.** Generated MCP exposes `list` and `get` on
82
+ `AnalyticsReport` only; `analyzeResults()` is a model method the app calls,
83
+ not a tool. The help says so and points at `reports.query` (declared reports,
84
+ `@happyvertical/smrt-reports`) and `reports.runtime.*` (runtime reports,
85
+ `@happyvertical/smrt-chat`) for aggregates over the app's own data.
86
+
87
+ `src/__tests__/recipes.test.ts` runs the real scan, manifest and generation
88
+ passes in memory and renders the help. See
89
+ [core recipes](../core/agents/recipes.md).
90
+
62
91
  ## Gotchas
63
92
 
64
93
  - **`apiSecret` / `providerMetadata` stripped from API/MCP**: marked `@field({ sensitive: true })` (#1540) so they never appear in generated responses or `where` filters. They are still stored at rest **unencrypted** — envelope encryption via `@happyvertical/smrt-secrets` is a separate, breaking follow-up (tracked, not done here).
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import './prompts.js';
12
12
  export { AnalyticsDataStreamCollection, AnalyticsEventCollection, AnalyticsPropertyCollection, AnalyticsReportCollection, } from './collections/index.js';
13
13
  export { AnalyticsDataStream, AnalyticsEvent, AnalyticsProperty, AnalyticsReport, } from './models/index.js';
14
14
  export { promptMessageOptions, smrtAnalyticsAnalyzePerformancePrompt, smrtAnalyticsAnalyzeResultsPrompt, smrtAnalyticsHasPositiveTrendsPrompt, } from './prompts.js';
15
+ export { AnalyticsReportsRecipe } from './recipes.js';
15
16
  export type { AnalyticsCapabilities, AnalyticsInterface, PropertyStatsWithTrend, SDKCustomDimension, SDKCustomMetric, SDKDataStream, SDKKeyEvent, SDKPageviewEvent, SDKProperty, SDKReportOptions, SDKReportResult, SDKTrackEvent, } from './types/index.js';
16
17
  export { AnalyticsPropertyStatus, AnalyticsProvider, CountingMethod, CustomDimensionScope, DataStreamStatus, DataStreamType, ReportFrequency, ReportStatus, TrackingEventStatus, } from './types/index.js';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,cAAc,CAAC;AAGtB,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,cAAc,CAAC;AAGtB,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}