@happyvertical/smrt-analytics 0.51.31 → 0.51.33

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/prompts.d.ts CHANGED
@@ -1,10 +1,54 @@
1
- import { ResolvedPromptAI } from '@happyvertical/smrt-prompts';
1
+ /**
2
+ * Prompt registrations for the @happyvertical/smrt-analytics package.
3
+ *
4
+ * Prompts are registered at module-load time via `definePrompt()` so that
5
+ * tenant-aware overrides can be applied at call time via `resolvePrompt()`.
6
+ *
7
+ * Mirrors the pattern used by `@happyvertical/smrt-properties` (see
8
+ * `prompts.ts`) and `@happyvertical/smrt-content` (see `content-prompts.ts`).
9
+ *
10
+ * PII / internal-field exclusion policy:
11
+ *
12
+ * Variables that this package never forwards to the AI provider:
13
+ * - `id`, `tenantId`, `propertyId` and other foreign-key/UUID fields —
14
+ * they identify internal records and provide no analytic value.
15
+ * - `apiSecret`, `measurementId`, `externalId`, `siteDomain` — these are
16
+ * provider credentials or platform-specific identifiers (e.g. GA4 API
17
+ * secrets, Matomo `idSite`, custom `G-XXXX` measurement IDs) that may
18
+ * be tenant-private configuration.
19
+ * - `providerMetadata` — extensible JSON blob that may contain
20
+ * credentials, account IDs, or other configuration secrets.
21
+ * - `lastError`, raw `dimensionFilter` / `metricFilter` JSON — internal
22
+ * error strings (which may contain auth tokens) and filter expressions
23
+ * that may reference cookie IDs or user-pseudo-IDs are kept out of the
24
+ * prompt variable set.
25
+ *
26
+ * Variables this package DOES forward (potentially carrying PII the caller
27
+ * persisted):
28
+ * - `reportData` (a JSON.stringify of the persisted `resultData`) — this
29
+ * is forwarded VERBATIM to the AI in `analyzeResults` and
30
+ * `hasPositiveTrends`. The package cannot strip PII because the row
31
+ * schema is determined by which dimensions/metrics the caller asked
32
+ * the analytics provider to return. If the persisted rows contain
33
+ * `userPseudoId`, `clientId`, IP-derived geolocation, or any other
34
+ * identifier, those fields WILL reach the AI provider. The forwarding
35
+ * is pinned by a regression test in
36
+ * `__tests__/analytics-report-prompt.test.ts`. Callers must either
37
+ * exclude PII-bearing dimensions before persisting, apply a column
38
+ * allowlist at the call site, or override the prompt template via
39
+ * `PromptOverride` to redact rows.
40
+ *
41
+ * Acceptable variables (always safe): human-readable names, time periods,
42
+ * computed aggregates (row counts, totals), and high-level dimension/metric
43
+ * labels (which are public GA4/Plausible/Matomo schema names).
44
+ */
45
+ import { type ResolvedPromptAI } from '@happyvertical/smrt-prompts';
2
46
  /**
3
47
  * `AnalyticsProperty.analyzePerformance()` prompt. Only the human-readable
4
48
  * display name, provider label, and the requested period reach the model;
5
49
  * provider IDs, API secrets, and the providerMetadata blob are excluded.
6
50
  */
7
- export declare const smrtAnalyticsAnalyzePerformancePrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
51
+ export declare const smrtAnalyticsAnalyzePerformancePrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
8
52
  /**
9
53
  * `AnalyticsReport.analyzeResults()` prompt. Surfaces report name, the
10
54
  * dimension/metric labels (which are public GA4/Plausible/Matomo schema
@@ -27,7 +71,7 @@ export declare const smrtAnalyticsAnalyzePerformancePrompt: import('@happyvertic
27
71
  * The forwarding contract is pinned by a regression test in
28
72
  * `__tests__/analytics-report-prompt.test.ts`.
29
73
  */
30
- export declare const smrtAnalyticsAnalyzeResultsPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
74
+ export declare const smrtAnalyticsAnalyzeResultsPrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
31
75
  /**
32
76
  * `AnalyticsReport.hasPositiveTrends()` boolean classifier prompt. Same
33
77
  * variables as `analyzeResults` minus the descriptive name — only the
@@ -43,7 +87,7 @@ export declare const smrtAnalyticsAnalyzeResultsPrompt: import('@happyvertical/s
43
87
  * `false` despite a positive analysis. Tenants overriding this template
44
88
  * MUST preserve the leading yes/no convention.
45
89
  */
46
- export declare const smrtAnalyticsHasPositiveTrendsPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
90
+ export declare const smrtAnalyticsHasPositiveTrendsPrompt: import("@happyvertical/smrt-prompts").PromptDefinition;
47
91
  /**
48
92
  * Build the message-options object passed to `aiClient.message()` from a
49
93
  * `ResolvedPromptAI` shape. Mirrors the helper in `smrt-properties` and
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-analytics",
6
- "packageVersion": "0.51.31",
6
+ "packageVersion": "0.51.33",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "8f5da29a47067a9daa1e84b030cfc77e4bbb286be563c5204f296e15fdc64927",
11
- "packageJson": "f202e299e56a6e05673c9e2e9c3d7da7c91ee7aa9a29f26c0ea662bc3deb189c",
10
+ "manifest": "f7832ca9a3ae2e584a4883e031cc73f22c3c11a275758ca25988d048d9ed45ae",
11
+ "packageJson": "d738a8706e3a2e35e847b4a5334cf6275b2fc1772ef2a98b3133f58a9fefa547",
12
12
  "agents": "baaeb44320f95dc5dc86925318e791369681ad80acfbb82a0f667f2aed0e511c"
13
13
  },
14
14
  "exports": [
@@ -32,7 +32,7 @@
32
32
  "fast-glob": "3.3.3",
33
33
  "svelte-check": "^4.7.6",
34
34
  "svelte": "^5.57.1",
35
- "typescript": "5.9.3",
35
+ "typescript": "6.0.3",
36
36
  "vite": "8.1.4",
37
37
  "vitest": "4.1.10"
38
38
  },
package/dist/ui.d.ts CHANGED
@@ -1,4 +1,17 @@
1
- import { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
1
+ /**
2
+ * Analytics Module UI Slot Declarations
3
+ *
4
+ * This file defines the UI extension points for the analytics module.
5
+ * UI components are implemented in the ./svelte subpath and auto-register
6
+ * with `ModuleUIRegistry` when that subpath is imported.
7
+ *
8
+ * @example Usage
9
+ * ```typescript
10
+ * import { ANALYTICS_MODULE_META } from '@happyvertical/smrt-analytics/ui';
11
+ * console.log(ANALYTICS_MODULE_META.uiSlots);
12
+ * ```
13
+ */
14
+ import type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
2
15
  /**
3
16
  * Analytics module UI slots
4
17
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-analytics",
3
- "version": "0.51.31",
3
+ "version": "0.51.33",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "Analytics integration models for SMRT framework",
6
6
  "type": "module",
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@happyvertical/smrt-core": "0.51.31",
37
- "@happyvertical/smrt-prompts": "0.51.31",
38
- "@happyvertical/smrt-tenancy": "0.51.31",
39
- "@happyvertical/smrt-types": "0.51.31",
40
- "@happyvertical/smrt-ui": "0.51.31"
36
+ "@happyvertical/smrt-core": "0.51.33",
37
+ "@happyvertical/smrt-prompts": "0.51.33",
38
+ "@happyvertical/smrt-tenancy": "0.51.33",
39
+ "@happyvertical/smrt-types": "0.51.33",
40
+ "@happyvertical/smrt-ui": "0.51.33"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "svelte": "^5.57.1"
@@ -48,14 +48,14 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@happyvertical/smrt-vitest": "0.51.31",
51
+ "@happyvertical/smrt-vitest": "0.51.33",
52
52
  "@happyvertical/sql": "^0.94.1",
53
53
  "@sveltejs/package": "^2.5.8",
54
54
  "@types/node": "24.13.6",
55
55
  "fast-glob": "3.3.3",
56
56
  "svelte-check": "^4.7.6",
57
57
  "svelte": "^5.57.1",
58
- "typescript": "5.9.3",
58
+ "typescript": "6.0.3",
59
59
  "vite": "8.1.4",
60
60
  "vitest": "4.1.10"
61
61
  },