@jmp-technologies/analytics 0.1.39 → 0.1.41

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 (86) hide show
  1. package/README.md +6 -2
  2. package/ai-crawler-agents.json +63 -0
  3. package/dist/astro/client.cjs +115 -3
  4. package/dist/astro/client.cjs.map +1 -1
  5. package/dist/astro/client.d.cts +2 -2
  6. package/dist/astro/client.d.ts +2 -2
  7. package/dist/astro/client.js +1 -1
  8. package/dist/astro/content.cjs +115 -3
  9. package/dist/astro/content.cjs.map +1 -1
  10. package/dist/astro/content.d.cts +3 -3
  11. package/dist/astro/content.d.ts +3 -3
  12. package/dist/astro/content.js +2 -2
  13. package/dist/astro/integration.cjs +115 -3
  14. package/dist/astro/integration.cjs.map +1 -1
  15. package/dist/astro/integration.js +2 -2
  16. package/dist/astro/middleware.d.cts +2 -2
  17. package/dist/astro/middleware.d.ts +2 -2
  18. package/dist/astro/register.cjs +115 -3
  19. package/dist/astro/register.cjs.map +1 -1
  20. package/dist/astro/register.js +2 -2
  21. package/dist/{chunk-XAEWXWSP.js → chunk-5SXVGQVW.js} +182 -4
  22. package/dist/chunk-5SXVGQVW.js.map +1 -0
  23. package/dist/{chunk-BXPMVR7M.js → chunk-GCEIT2ON.js} +2 -2
  24. package/dist/{chunk-OCIOQIE4.js → chunk-L6IUBEUV.js} +2 -2
  25. package/dist/{chunk-JJ3JP3RV.js → chunk-MEG7QGRF.js} +2 -2
  26. package/dist/{chunk-M66PHSBO.js → chunk-QSKTA7JD.js} +2 -2
  27. package/dist/{create-jmp-analytics-C1IH32ZF.d.cts → create-jmp-analytics-B7VqQJca.d.cts} +1 -1
  28. package/dist/{create-jmp-analytics-CjVYSmPJ.d.ts → create-jmp-analytics-BGt16QGY.d.ts} +1 -1
  29. package/dist/index.cjs +187 -3
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +30 -6
  32. package/dist/index.d.ts +30 -6
  33. package/dist/index.js +13 -1
  34. package/dist/next/content.cjs +115 -3
  35. package/dist/next/content.cjs.map +1 -1
  36. package/dist/next/content.d.cts +2 -2
  37. package/dist/next/content.d.ts +2 -2
  38. package/dist/next/content.js +2 -2
  39. package/dist/next/instrumentation.cjs +115 -3
  40. package/dist/next/instrumentation.cjs.map +1 -1
  41. package/dist/next/instrumentation.js +1 -1
  42. package/dist/next/landing-pages.cjs +115 -3
  43. package/dist/next/landing-pages.cjs.map +1 -1
  44. package/dist/next/landing-pages.d.cts +2 -2
  45. package/dist/next/landing-pages.d.ts +2 -2
  46. package/dist/next/landing-pages.js +2 -2
  47. package/dist/next/locations.cjs +116 -4
  48. package/dist/next/locations.cjs.map +1 -1
  49. package/dist/next/locations.d.cts +3 -3
  50. package/dist/next/locations.d.ts +3 -3
  51. package/dist/next/locations.js +3 -3
  52. package/dist/next/locations.js.map +1 -1
  53. package/dist/next/middleware.cjs.map +1 -1
  54. package/dist/next/middleware.d.cts +2 -2
  55. package/dist/next/middleware.d.ts +2 -2
  56. package/dist/next/middleware.js.map +1 -1
  57. package/dist/next/site-root-server.cjs +115 -3
  58. package/dist/next/site-root-server.cjs.map +1 -1
  59. package/dist/next/site-root-server.d.cts +1 -1
  60. package/dist/next/site-root-server.d.ts +1 -1
  61. package/dist/next/site-root-server.js +3 -3
  62. package/dist/next/site-root-server.js.map +1 -1
  63. package/dist/next.cjs +115 -3
  64. package/dist/next.cjs.map +1 -1
  65. package/dist/next.d.cts +3 -3
  66. package/dist/next.d.ts +3 -3
  67. package/dist/next.js +3 -3
  68. package/dist/react.cjs +115 -3
  69. package/dist/react.cjs.map +1 -1
  70. package/dist/react.d.cts +2 -2
  71. package/dist/react.d.ts +2 -2
  72. package/dist/react.js +2 -2
  73. package/dist/{site-config-BN6Z2zIf.d.cts → site-config-CZl4PIbg.d.cts} +1 -1
  74. package/dist/{site-config-BEaYpZ3X.d.ts → site-config-Cq5K8hUp.d.ts} +1 -1
  75. package/dist/{track-page-view-B3OwUOYl.d.ts → track-page-view-BSlE0yI9.d.ts} +1 -1
  76. package/dist/{track-page-view-BeVjC-pV.d.cts → track-page-view-M9y_5WqT.d.cts} +1 -1
  77. package/dist/{types-uwXEaMD6.d.ts → types-DH_8sBu9.d.cts} +6 -0
  78. package/dist/{types-uwXEaMD6.d.cts → types-DH_8sBu9.d.ts} +6 -0
  79. package/dist/{utils-6a6lNKsg.d.ts → utils-C2JRomti.d.ts} +1 -1
  80. package/dist/{utils-Cbb3CO3i.d.cts → utils-JfjoqC-z.d.cts} +1 -1
  81. package/package.json +2 -1
  82. package/dist/chunk-XAEWXWSP.js.map +0 -1
  83. /package/dist/{chunk-BXPMVR7M.js.map → chunk-GCEIT2ON.js.map} +0 -0
  84. /package/dist/{chunk-OCIOQIE4.js.map → chunk-L6IUBEUV.js.map} +0 -0
  85. /package/dist/{chunk-JJ3JP3RV.js.map → chunk-MEG7QGRF.js.map} +0 -0
  86. /package/dist/{chunk-M66PHSBO.js.map → chunk-QSKTA7JD.js.map} +0 -0
package/README.md CHANGED
@@ -136,7 +136,11 @@ export async function GET() {
136
136
  }
137
137
  ```
138
138
 
139
- Place that in `app/robots.txt/route.ts` for Next.js App Router sites. The policy uses robots.txt `Disallow` rules for known AI crawler user agents; crawlers that ignore robots.txt or use undisclosed names may still access public pages.
139
+ Place that in `app/robots.txt/route.ts` for Next.js App Router sites. Use `mergeJmpRobotsTxt()` if the site also needs private-path disallows and a sitemap line. Pass `ensureAiCrawlerDisallows: true` only when this site should always list AI `Disallow` rules even if the JMP dashboard toggle is off. The policy uses robots.txt `Disallow` rules for known AI crawler user agents.
140
+
141
+ **Enforcement:** robots.txt is advisory. When this JMP setting is on, also add a `vercel.json` WAF deny (`jmpAiCrawlerVercelWafRoute()` or `create-jmp-client --block-ai-crawlers`) and set Vercel **AI Bots** to **deny**. Crawlers that spoof a normal browser or use undisclosed names may still access public pages. Generic Applebot is not WAF-denied so Apple Search can still crawl; `Applebot-Extended` is denied.
142
+
143
+ Use **≥ 0.1.41** for the shared crawler list, `mergeJmpRobotsTxt`, and WAF route helper (0.1.40 source had them; the published types did not).
140
144
 
141
145
  ---
142
146
 
@@ -355,6 +359,6 @@ After publish, on client sites:
355
359
  npm install @jmp-technologies/analytics@latest
356
360
  ```
357
361
 
358
- Use **≥ 0.1.8** for `getJmpSiteProfile` / `extras`. Use **≥ 0.1.10** for `email_click` tracking and `JmpTrackedMailtoLink`. Use **≥ 0.1.37** so server content fetches and server page views send `Origin` from `siteUrl` / `NEXT_PUBLIC_SITE_URL` (required for capabilities writes after the matching dashboard deploy). Use **≥ 0.1.38** so `contentManifest.routes` with wrapper `legal` or `pages` reports page URLs to the dashboard Pages tab. Use **≥ 0.1.39** so JMP content `fetch` uses the `jmp-content` cache tag (client webhooks revalidate it).
362
+ Use **≥ 0.1.8** for `getJmpSiteProfile` / `extras`. Use **≥ 0.1.10** for `email_click` tracking and `JmpTrackedMailtoLink`. Use **≥ 0.1.37** so server content fetches and server page views send `Origin` from `siteUrl` / `NEXT_PUBLIC_SITE_URL` (required for capabilities writes after the matching dashboard deploy). Use **≥ 0.1.38** so `contentManifest.routes` with wrapper `legal` or `pages` reports page URLs to the dashboard Pages tab. Use **≥ 0.1.39** so JMP content `fetch` uses the `jmp-content` cache tag (client webhooks revalidate it). Use **≥ 0.1.41** so npm types export `mergeJmpRobotsTxt`, `buildAiCrawlerRobotsTxt`, and the Vercel WAF route helper.
359
363
 
360
364
  Ensure the **dashboard** is deployed with migrations **020** and **021** and `/api/content/site` is live before relying on `getJmpSiteProfile` in production.
@@ -0,0 +1,63 @@
1
+ {
2
+ "robotsUserAgents": [
3
+ "GPTBot",
4
+ "ChatGPT-User",
5
+ "OAI-SearchBot",
6
+ "OAI-AdsBot",
7
+ "ClaudeBot",
8
+ "Claude-User",
9
+ "Claude-SearchBot",
10
+ "Claude-Web",
11
+ "PerplexityBot",
12
+ "Perplexity-User",
13
+ "Google-Extended",
14
+ "GoogleOther",
15
+ "GoogleOther-Image",
16
+ "GoogleOther-Video",
17
+ "Google-CloudVertexBot",
18
+ "Meta-ExternalAgent",
19
+ "Meta-ExternalFetcher",
20
+ "FacebookBot",
21
+ "Applebot",
22
+ "Applebot-Extended",
23
+ "CCBot",
24
+ "Bytespider",
25
+ "cohere-ai",
26
+ "cohere-training-data-crawler",
27
+ "YouBot",
28
+ "MistralAI-User",
29
+ "GrokBot",
30
+ "Grok-DeepSearch",
31
+ "xAI-Grok",
32
+ "xAI-Bot"
33
+ ],
34
+ "wafUserAgents": [
35
+ "GPTBot",
36
+ "ChatGPT-User",
37
+ "OAI-SearchBot",
38
+ "OAI-AdsBot",
39
+ "ClaudeBot",
40
+ "Claude-User",
41
+ "Claude-SearchBot",
42
+ "Claude-Web",
43
+ "PerplexityBot",
44
+ "Perplexity-User",
45
+ "Google-Extended",
46
+ "GoogleOther",
47
+ "Google-CloudVertexBot",
48
+ "Meta-ExternalAgent",
49
+ "Meta-ExternalFetcher",
50
+ "FacebookBot",
51
+ "Applebot-Extended",
52
+ "CCBot",
53
+ "Bytespider",
54
+ "cohere-ai",
55
+ "cohere-training-data-crawler",
56
+ "YouBot",
57
+ "MistralAI-User",
58
+ "GrokBot",
59
+ "Grok-DeepSearch",
60
+ "xAI-Grok",
61
+ "xAI-Bot"
62
+ ]
63
+ }
@@ -308,7 +308,7 @@ function extractMailtoTarget(href) {
308
308
  }
309
309
 
310
310
  // package.json
311
- var version = "0.1.39";
311
+ var version = "0.1.41";
312
312
 
313
313
  // src/constants.ts
314
314
  var JMP_ANALYTICS_SDK_VERSION = version;
@@ -1107,7 +1107,50 @@ function normalizeManifestDefaults(defaults) {
1107
1107
  function normalizeContact(contact) {
1108
1108
  if (!contact || typeof contact !== "object") return null;
1109
1109
  const extras = normalizeContactExtras(contact.extras);
1110
- return extras.length > 0 ? { extras } : null;
1110
+ const leadInbox = normalizeLeadInbox(contact.leadInbox);
1111
+ if (extras.length === 0 && !leadInbox) return null;
1112
+ return {
1113
+ ...extras.length > 0 ? { extras } : {},
1114
+ ...leadInbox ? { leadInbox } : {}
1115
+ };
1116
+ }
1117
+ function normalizeLeadInbox(raw) {
1118
+ if (!raw || typeof raw !== "object") return null;
1119
+ const list = normalizeInboxKeyList(raw.list, 8);
1120
+ const detail = normalizeInboxKeyList(raw.detail, 24);
1121
+ const labels = normalizeInboxLabels(raw.labels);
1122
+ if (!list && !detail && !labels) return null;
1123
+ return {
1124
+ ...list ? { list } : {},
1125
+ ...detail ? { detail } : {},
1126
+ ...labels ? { labels } : {}
1127
+ };
1128
+ }
1129
+ function normalizeInboxKeyList(raw, max) {
1130
+ if (!Array.isArray(raw)) return void 0;
1131
+ const seen = /* @__PURE__ */ new Set();
1132
+ const out = [];
1133
+ for (const item of raw) {
1134
+ if (typeof item !== "string" || out.length >= max) continue;
1135
+ const key = item.trim();
1136
+ const token = key.replace(/[^a-zA-Z0-9]+/g, "").toLowerCase();
1137
+ if (!key || !token || seen.has(token)) continue;
1138
+ seen.add(token);
1139
+ out.push(key);
1140
+ }
1141
+ return out.length > 0 ? out : void 0;
1142
+ }
1143
+ function normalizeInboxLabels(raw) {
1144
+ if (!raw || typeof raw !== "object") return void 0;
1145
+ const out = {};
1146
+ for (const [key, value] of Object.entries(raw)) {
1147
+ if (typeof value !== "string") continue;
1148
+ const label = value.trim().slice(0, 60);
1149
+ const token = key.trim();
1150
+ if (!token || !label) continue;
1151
+ out[token] = label;
1152
+ }
1153
+ return Object.keys(out).length > 0 ? out : void 0;
1111
1154
  }
1112
1155
  function normalizeContactExtras(extras) {
1113
1156
  if (!Array.isArray(extras)) return [];
@@ -1137,7 +1180,7 @@ function inferWrapperSlotsFromManifest(manifest) {
1137
1180
  slots.add(`trust.${block.section}`);
1138
1181
  slots.add("trust");
1139
1182
  }
1140
- if (manifest?.contact?.extras?.length) {
1183
+ if (manifest?.contact?.extras?.length || manifest?.contact?.leadInbox) {
1141
1184
  slots.add("contact");
1142
1185
  }
1143
1186
  return [...slots];
@@ -1325,6 +1368,75 @@ async function registerJmpContentWrappers(config) {
1325
1368
  }
1326
1369
  setContentWrapperSyncHandler(registerJmpContentWrappers);
1327
1370
 
1371
+ // ai-crawler-agents.json
1372
+ var ai_crawler_agents_default = {
1373
+ robotsUserAgents: [
1374
+ "GPTBot",
1375
+ "ChatGPT-User",
1376
+ "OAI-SearchBot",
1377
+ "OAI-AdsBot",
1378
+ "ClaudeBot",
1379
+ "Claude-User",
1380
+ "Claude-SearchBot",
1381
+ "Claude-Web",
1382
+ "PerplexityBot",
1383
+ "Perplexity-User",
1384
+ "Google-Extended",
1385
+ "GoogleOther",
1386
+ "GoogleOther-Image",
1387
+ "GoogleOther-Video",
1388
+ "Google-CloudVertexBot",
1389
+ "Meta-ExternalAgent",
1390
+ "Meta-ExternalFetcher",
1391
+ "FacebookBot",
1392
+ "Applebot",
1393
+ "Applebot-Extended",
1394
+ "CCBot",
1395
+ "Bytespider",
1396
+ "cohere-ai",
1397
+ "cohere-training-data-crawler",
1398
+ "YouBot",
1399
+ "MistralAI-User",
1400
+ "GrokBot",
1401
+ "Grok-DeepSearch",
1402
+ "xAI-Grok",
1403
+ "xAI-Bot"
1404
+ ],
1405
+ wafUserAgents: [
1406
+ "GPTBot",
1407
+ "ChatGPT-User",
1408
+ "OAI-SearchBot",
1409
+ "OAI-AdsBot",
1410
+ "ClaudeBot",
1411
+ "Claude-User",
1412
+ "Claude-SearchBot",
1413
+ "Claude-Web",
1414
+ "PerplexityBot",
1415
+ "Perplexity-User",
1416
+ "Google-Extended",
1417
+ "GoogleOther",
1418
+ "Google-CloudVertexBot",
1419
+ "Meta-ExternalAgent",
1420
+ "Meta-ExternalFetcher",
1421
+ "FacebookBot",
1422
+ "Applebot-Extended",
1423
+ "CCBot",
1424
+ "Bytespider",
1425
+ "cohere-ai",
1426
+ "cohere-training-data-crawler",
1427
+ "YouBot",
1428
+ "MistralAI-User",
1429
+ "GrokBot",
1430
+ "Grok-DeepSearch",
1431
+ "xAI-Grok",
1432
+ "xAI-Bot"
1433
+ ]
1434
+ };
1435
+
1436
+ // src/ai-crawlers.ts
1437
+ var AI_CRAWLER_ROBOTS_USER_AGENTS = ai_crawler_agents_default.robotsUserAgents;
1438
+ var JMP_AI_CRAWLER_WAF_USER_AGENTS = ai_crawler_agents_default.wafUserAgents;
1439
+
1328
1440
  // src/astro/client.ts
1329
1441
  var import_meta = {};
1330
1442
  var jmpAnalyticsSingleton = null;