@actuate-media/cms-core 0.70.0 → 0.71.1

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 (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/__tests__/actions/document-crud.test.js +27 -0
  3. package/dist/__tests__/actions/document-crud.test.js.map +1 -1
  4. package/dist/__tests__/api/ai-crawlers.test.d.ts +2 -0
  5. package/dist/__tests__/api/ai-crawlers.test.d.ts.map +1 -0
  6. package/dist/__tests__/api/ai-crawlers.test.js +194 -0
  7. package/dist/__tests__/api/ai-crawlers.test.js.map +1 -0
  8. package/dist/__tests__/api/media-upload-storage.test.js +19 -0
  9. package/dist/__tests__/api/media-upload-storage.test.js.map +1 -1
  10. package/dist/__tests__/api/route-contracts.test.js +3 -0
  11. package/dist/__tests__/api/route-contracts.test.js.map +1 -1
  12. package/dist/__tests__/seo/ai-bots.test.js +40 -1
  13. package/dist/__tests__/seo/ai-bots.test.js.map +1 -1
  14. package/dist/actions.d.ts.map +1 -1
  15. package/dist/actions.js +24 -7
  16. package/dist/actions.js.map +1 -1
  17. package/dist/api/handler-factory.d.ts.map +1 -1
  18. package/dist/api/handler-factory.js +22 -1
  19. package/dist/api/handler-factory.js.map +1 -1
  20. package/dist/api/routes/media.d.ts.map +1 -1
  21. package/dist/api/routes/media.js +13 -1
  22. package/dist/api/routes/media.js.map +1 -1
  23. package/dist/api/routes/seo.d.ts.map +1 -1
  24. package/dist/api/routes/seo.js +80 -1
  25. package/dist/api/routes/seo.js.map +1 -1
  26. package/dist/config/types.d.ts +8 -0
  27. package/dist/config/types.d.ts.map +1 -1
  28. package/dist/db/model-types.d.ts +10 -0
  29. package/dist/db/model-types.d.ts.map +1 -1
  30. package/dist/seo/ai-bots.d.ts +14 -0
  31. package/dist/seo/ai-bots.d.ts.map +1 -1
  32. package/dist/seo/ai-bots.js +21 -0
  33. package/dist/seo/ai-bots.js.map +1 -1
  34. package/dist/seo/ai-crawler-log.d.ts +14 -0
  35. package/dist/seo/ai-crawler-log.d.ts.map +1 -0
  36. package/dist/seo/ai-crawler-log.js +48 -0
  37. package/dist/seo/ai-crawler-log.js.map +1 -0
  38. package/dist/seo/index.d.ts +4 -2
  39. package/dist/seo/index.d.ts.map +1 -1
  40. package/dist/seo/index.js +2 -1
  41. package/dist/seo/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/prisma/migrations/0003_ai_crawler_hits/migration.sql +21 -0
  44. package/prisma/schema.prisma +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actuate-media/cms-core",
3
- "version": "0.70.0",
3
+ "version": "0.71.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/actuate-media/actuatecms.git",
@@ -0,0 +1,21 @@
1
+ -- AI crawler activity panel: aggregated per-(bot, surface) hit counters for the
2
+ -- llms.txt / llms-full.txt / per-page .md surfaces (plus an optional honeypot).
3
+ -- Stored aggregated (one row per bot+surface, upserted on hit) so the table
4
+ -- stays bounded and needs no periodic pruning.
5
+ CREATE TABLE "actuate_ai_crawler_hits" (
6
+ "id" TEXT NOT NULL,
7
+ "bot" TEXT NOT NULL,
8
+ "surface" TEXT NOT NULL,
9
+ "category" TEXT NOT NULL DEFAULT 'other',
10
+ "hits" INTEGER NOT NULL DEFAULT 1,
11
+ "firstSeenAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ "lastSeenAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+
14
+ CONSTRAINT "actuate_ai_crawler_hits_pkey" PRIMARY KEY ("id")
15
+ );
16
+
17
+ -- One aggregate row per bot token + surface.
18
+ CREATE UNIQUE INDEX "actuate_ai_crawler_hits_bot_surface_key" ON "actuate_ai_crawler_hits"("bot", "surface");
19
+
20
+ -- Supports "recently active" ordering in the admin panel.
21
+ CREATE INDEX "actuate_ai_crawler_hits_lastSeenAt_idx" ON "actuate_ai_crawler_hits"("lastSeenAt");
@@ -632,6 +632,25 @@ model Redirect404Hit {
632
632
  @@map("actuate_redirect_404_hits")
633
633
  }
634
634
 
635
+ /// Aggregated AI-crawler activity for the admin "AI crawler activity" panel.
636
+ /// One row per (bot token, surface), upserted on each hit so the table stays
637
+ /// bounded (~known bots × surfaces) and needs no periodic pruning.
638
+ /// `surface` ∈ "llms" | "llms-full" | "md" | "honeypot".
639
+ /// `category` mirrors the ai-bots taxonomy: "training" | "retrieval" | "other".
640
+ model AiCrawlerHit {
641
+ id String @id @default(cuid())
642
+ bot String
643
+ surface String
644
+ category String @default("other")
645
+ hits Int @default(1)
646
+ firstSeenAt DateTime @default(now())
647
+ lastSeenAt DateTime @default(now())
648
+
649
+ @@unique([bot, surface])
650
+ @@index([lastSeenAt])
651
+ @@map("actuate_ai_crawler_hits")
652
+ }
653
+
635
654
  /// An AI/heuristic suggestion for a 404 destination. Confidence-scored and
636
655
  /// never auto-applied below the configured threshold.
637
656
  model RedirectSuggestion {