@actuate-media/cms-core 0.68.0 → 0.69.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.
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared selection + mapping for the llms.txt family of routes (`/llms.txt`,
3
+ * `/llms-full.txt`). Keeping this in one place means the curation rules and the
4
+ * privacy boundary (noindex exclusion) can never drift between the two surfaces.
5
+ */
6
+ import { resolveDocumentUrl } from './page-meta.js';
7
+ /** Tri-state per-doc include flag; defaults to AUTO for unrecognized values. */
8
+ export function readLlmsInclude(data) {
9
+ const v = String(data?.llmsInclude ?? '').toUpperCase();
10
+ return v === 'ALWAYS' || v === 'NEVER' ? v : 'AUTO';
11
+ }
12
+ /** A doc is excluded from every llms surface when it is noindexed. */
13
+ export function isLlmsNoindex(data) {
14
+ const d = data;
15
+ return d?.noindex === true || d?.robotsNoindex === true || d?.noindex === 'true';
16
+ }
17
+ /**
18
+ * Apply the curation + privacy rules:
19
+ * - internal/system collections excluded
20
+ * - noindexed docs excluded (privacy boundary)
21
+ * - `llmsInclude` NEVER excluded, ALWAYS included (overrides eligibility),
22
+ * AUTO included only when the collection is eligible
23
+ */
24
+ export function selectLlmsDocs(docs, opts) {
25
+ return docs
26
+ .filter((d) => !opts.isInternalCollection(d.collection))
27
+ .filter((d) => {
28
+ const data = d.data || {};
29
+ if (isLlmsNoindex(data))
30
+ return false;
31
+ const include = readLlmsInclude(data);
32
+ if (include === 'NEVER')
33
+ return false;
34
+ if (include === 'ALWAYS')
35
+ return true;
36
+ return opts.eligible ? opts.eligible.has(d.collection) : true;
37
+ });
38
+ }
39
+ /** Map a selected document to the generator's page shape (curation-aware). */
40
+ export function toLlmsPage(d, opts) {
41
+ const data = d.data || {};
42
+ const section = typeof data.llmsSection === 'string' && data.llmsSection.trim()
43
+ ? data.llmsSection.trim()
44
+ : undefined;
45
+ const str = (v) => typeof v === 'string' && v.trim() ? v : undefined;
46
+ return {
47
+ title: str(data.metaTitle) ?? d.title ?? str(data.title) ?? 'Untitled',
48
+ url: resolveDocumentUrl({
49
+ siteUrl: opts.base,
50
+ urlPrefix: opts.urlPrefix,
51
+ slug: d.slug ?? undefined,
52
+ data,
53
+ }),
54
+ description: str(data.llmsDescription) ??
55
+ str(data.keyTakeaway) ??
56
+ str(data.metaDescription) ??
57
+ str(data.seoDescription) ??
58
+ '',
59
+ collection: d.collection,
60
+ section,
61
+ optional: data.llmsOptional === true,
62
+ priority: typeof data.llmsPriority === 'number' ? data.llmsPriority : undefined,
63
+ updatedAt: d.updatedAt?.toISOString(),
64
+ isCornerstone: data.isCornerstone === true,
65
+ };
66
+ }
67
+ //# sourceMappingURL=llms-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llms-select.js","sourceRoot":"","sources":["../../src/seo/llms-select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAKnD,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAE,IAAgC,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IACpF,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AACrD,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,aAAa,CAAC,IAAa;IACzC,MAAM,CAAC,GAAG,IAA+B,CAAA;IACzC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,EAAE,aAAa,KAAK,IAAI,IAAI,CAAC,EAAE,OAAO,KAAK,MAAM,CAAA;AAClF,CAAC;AAOD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAS,EACT,IAAoF;IAEpF,OAAO,IAAI;SACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,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AI,CAAC,IAAI;YAClB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS;YACzB,IAAI;SACL,CAAC;QACF,WAAW,EACT,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;YACrB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC;YACxB,EAAE;QACJ,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,OAAO;QACP,QAAQ,EAAE,IAAI,CAAC,YAAY,KAAK,IAAI;QACpC,QAAQ,EAAE,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;QAC/E,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE;QACrC,aAAa,EAAE,IAAI,CAAC,aAAa,KAAK,IAAI;KAC3C,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actuate-media/cms-core",
3
- "version": "0.68.0",
3
+ "version": "0.69.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/actuate-media/actuatecms.git",
@@ -111,6 +111,7 @@
111
111
  "pg": "^8.20.0",
112
112
  "sanitize-html": "^2.17.4",
113
113
  "sharp": "^0.34.5",
114
+ "turndown": "^7.2.4",
114
115
  "yjs": "^13.6.0",
115
116
  "zod": "^3.23.0",
116
117
  "@actuate-media/realtime": "0.1.1"
@@ -118,6 +119,7 @@
118
119
  "devDependencies": {
119
120
  "@types/sanitize-html": "^2.16.1",
120
121
  "@types/sharp": "^0.32.0",
122
+ "@types/turndown": "^5.0.6",
121
123
  "@types/ws": "^8.5.10",
122
124
  "dotenv": "^17.3.1",
123
125
  "prisma": "^7.8.0",