@se-studio/markdown-renderer 1.8.35 → 1.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @se-studio/markdown-renderer
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0a1bb04: Add opt-in multi-group robots.txt (preamble, AI_AGENT_USER_AGENTS / ai-agents preset, Content-Signal per group, shared no-drift disallow + allowExtra inheritance) and general llms.txt customisation (customBlocks placements, llmsAccessPolicyBlock preset, size/heading guards). Mistral token corrected to `MistralAI-Index` (vendor docs). Both surfaces remain code-configured only — no CMS fields.
8
+
9
+ ## 1.8.36
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [93c764d]
14
+ - @se-studio/contentful-rest-api@2.0.3
15
+
3
16
  ## 1.8.35
4
17
 
5
18
  ### Patch Changes
package/dist/llmsTxt.d.ts CHANGED
@@ -2,6 +2,12 @@ import type { IArticleLink, IArticleTypeLink, IInternalLink } from '@se-studio/c
2
2
  /**
3
3
  * Types for llms.txt generation per the llms.txt spec (https://llmstxt.org/)
4
4
  */
5
+ /** Soft cap for the blockquote summary (trimmed when exceeded). */
6
+ export declare const LLMS_SUMMARY_SOFT_MAX_CHARS = 500;
7
+ /** Hard cap for a single custom-block body (UTF-8 bytes). */
8
+ export declare const LLMS_BLOCK_BODY_HARD_MAX_BYTES: number;
9
+ /** Hard cap for the entire llms.txt output (UTF-8 bytes). */
10
+ export declare const LLMS_TOTAL_HARD_MAX_BYTES: number;
5
11
  export interface LlmsTxtSection {
6
12
  title: string;
7
13
  items: Array<{
@@ -10,14 +16,48 @@ export interface LlmsTxtSection {
10
16
  description?: string;
11
17
  }>;
12
18
  }
19
+ /**
20
+ * Placement of a custom block relative to generated llms.txt content.
21
+ * - `after-summary` — post-blockquote freeform zone (before markdown-access / H2 lists)
22
+ * - `before-sections` — after markdown-access (if any), before `sections[]`
23
+ * - `after-sections` / `before-optional` — after `sections[]`, before Optional
24
+ */
25
+ export type LlmsTxtBlockPlacement = 'after-summary' | 'before-sections' | 'after-sections' | 'before-optional';
26
+ export type LlmsTxtCustomBlock = {
27
+ kind: 'prose';
28
+ /** Optional H2. Prefer omit for spec-pure freeform; presets may set a title. */
29
+ title?: string;
30
+ /** Markdown body. Newlines preserved. No nested H1. */
31
+ body: string;
32
+ /** Default: `after-summary`. */
33
+ placement?: LlmsTxtBlockPlacement;
34
+ } | {
35
+ kind: 'links';
36
+ /** Required H2 for file-list sections. */
37
+ title: string;
38
+ items: Array<{
39
+ url: string;
40
+ title: string;
41
+ description?: string;
42
+ }>;
43
+ /** Default: `before-sections`. */
44
+ placement?: LlmsTxtBlockPlacement;
45
+ };
13
46
  export interface LlmsTxtOptions {
14
47
  siteName: string;
48
+ /** Blockquote description — the summary/description override. */
15
49
  summary: string;
50
+ /** Legacy freeform body; emitted in the after-summary zone before `customBlocks`. */
16
51
  details?: string;
17
52
  /** Description of how to access markdown (e.g. "Append .md to any page URL") */
18
53
  markdownUrlPattern?: string;
19
54
  sections?: LlmsTxtSection[];
20
55
  optionalSection?: LlmsTxtSection;
56
+ /**
57
+ * Ordered site-defined blocks; stable order within the same placement.
58
+ * Code-configured only (route / constants) — not CMS.
59
+ */
60
+ customBlocks?: readonly LlmsTxtCustomBlock[];
21
61
  }
22
62
  export interface MarkdownIndexLinks {
23
63
  pages: Array<{
@@ -41,6 +81,13 @@ export interface MarkdownIndexLinks {
41
81
  title: string;
42
82
  }>;
43
83
  }
84
+ /**
85
+ * Preset: Access policy as a titled prose block in the after-summary zone.
86
+ * Sites supply legal copy; the heading string is shared across the fleet.
87
+ */
88
+ export declare function llmsAccessPolicyBlock(body: string, options?: {
89
+ placement?: LlmsTxtBlockPlacement;
90
+ }): LlmsTxtCustomBlock;
44
91
  /**
45
92
  * Converts an internal href to its markdown URL.
46
93
  * Appends .md to path, strips trailing slash.
@@ -59,6 +106,21 @@ export declare function buildMarkdownLinksFromAppLinks(options: {
59
106
  }): MarkdownIndexLinks;
60
107
  /**
61
108
  * Generates llms.txt content per the llms.txt spec (https://llmstxt.org/)
109
+ *
110
+ * Emission order:
111
+ * 1. `# siteName`
112
+ * 2. `> summary`
113
+ * 3. Legacy `details` (if any)
114
+ * 4. `customBlocks` with `after-summary`
115
+ * 5. `## Markdown access` (if `markdownUrlPattern`)
116
+ * 6. `customBlocks` with `before-sections`
117
+ * 7. Generated `sections[]`
118
+ * 8. `customBlocks` with `after-sections` / `before-optional`
119
+ * 9. `## Optional` + `optionalSection`
120
+ *
121
+ * Omit `customBlocks` for byte-compatible legacy output. Site values are
122
+ * code-configured only — not CMS. Prefer {@link llmsAccessPolicyBlock} over
123
+ * stuffing `## Access policy` into `details`.
62
124
  */
63
125
  export declare function generateLlmsTxt(options: LlmsTxtOptions): string;
64
126
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"llmsTxt.d.ts","sourceRoot":"","sources":["../src/llmsTxt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK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B,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B,GAAG,kBAAkB,CA8BrB;AAoGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAsE/D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,kBAAkB,EACzB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7B,MAAM,CA0BR"}
package/dist/llmsTxt.js CHANGED
@@ -1,3 +1,24 @@
1
+ /**
2
+ * Types for llms.txt generation per the llms.txt spec (https://llmstxt.org/)
3
+ */
4
+ /** Soft cap for the blockquote summary (trimmed when exceeded). */
5
+ export const LLMS_SUMMARY_SOFT_MAX_CHARS = 500;
6
+ /** Hard cap for a single custom-block body (UTF-8 bytes). */
7
+ export const LLMS_BLOCK_BODY_HARD_MAX_BYTES = 64 * 1024;
8
+ /** Hard cap for the entire llms.txt output (UTF-8 bytes). */
9
+ export const LLMS_TOTAL_HARD_MAX_BYTES = 256 * 1024;
10
+ /**
11
+ * Preset: Access policy as a titled prose block in the after-summary zone.
12
+ * Sites supply legal copy; the heading string is shared across the fleet.
13
+ */
14
+ export function llmsAccessPolicyBlock(body, options) {
15
+ return {
16
+ kind: 'prose',
17
+ title: 'Access policy',
18
+ body,
19
+ placement: options?.placement ?? 'after-summary',
20
+ };
21
+ }
1
22
  /**
2
23
  * Converts an internal href to its markdown URL.
3
24
  * Appends .md to path, strips trailing slash.
@@ -43,46 +64,166 @@ export function buildMarkdownLinksFromAppLinks(options) {
43
64
  .map((link) => ({ href: link.href, title: link.title }));
44
65
  return { pages, articles, articleTypes, tags, people };
45
66
  }
67
+ function utf8ByteLength(value) {
68
+ return new TextEncoder().encode(value).byteLength;
69
+ }
70
+ function assertNoNewlines(value, label) {
71
+ if (value.includes('\n') || value.includes('\r')) {
72
+ throw new Error(`llms.txt ${label} must not contain newlines`);
73
+ }
74
+ }
75
+ function normalizeSummary(summary) {
76
+ if (summary.length <= LLMS_SUMMARY_SOFT_MAX_CHARS) {
77
+ return summary;
78
+ }
79
+ return summary.slice(0, LLMS_SUMMARY_SOFT_MAX_CHARS);
80
+ }
81
+ /** Empty / whitespace-only prose titles are treated as omitted (untitled freeform). */
82
+ function normalizeProseTitle(title) {
83
+ if (title === undefined) {
84
+ return undefined;
85
+ }
86
+ const trimmed = title.trim();
87
+ return trimmed.length > 0 ? trimmed : undefined;
88
+ }
89
+ function assertProseBody(body, title) {
90
+ const bytes = utf8ByteLength(body);
91
+ if (bytes > LLMS_BLOCK_BODY_HARD_MAX_BYTES) {
92
+ throw new Error(`llms.txt custom prose body exceeds ${LLMS_BLOCK_BODY_HARD_MAX_BYTES} bytes (${bytes})`);
93
+ }
94
+ const lines = body.split(/\r?\n/);
95
+ for (const line of lines) {
96
+ if (/^#\s/.test(line)) {
97
+ throw new Error('llms.txt custom prose body must not contain H1 headings');
98
+ }
99
+ if (title !== undefined && /^#{1,6}\s/.test(line)) {
100
+ throw new Error('llms.txt titled prose body must not contain markdown headings (use the title field)');
101
+ }
102
+ }
103
+ }
104
+ function assertLinkItems(items) {
105
+ for (const item of items) {
106
+ assertNoNewlines(item.url, 'link url');
107
+ assertNoNewlines(item.title, 'link title');
108
+ if (item.description !== undefined) {
109
+ assertNoNewlines(item.description, 'link description');
110
+ }
111
+ }
112
+ }
113
+ function resolvePlacement(block) {
114
+ if (block.placement) {
115
+ return block.placement === 'before-optional' ? 'after-sections' : block.placement;
116
+ }
117
+ return block.kind === 'links' ? 'before-sections' : 'after-summary';
118
+ }
119
+ function formatLinkItems(items) {
120
+ const lines = [];
121
+ for (const item of items) {
122
+ const desc = item.description ? `: ${item.description}` : '';
123
+ lines.push(`- [${item.title}](${item.url})${desc}`);
124
+ }
125
+ return lines;
126
+ }
127
+ function emitCustomBlock(block) {
128
+ if (block.kind === 'prose') {
129
+ const title = normalizeProseTitle(block.title);
130
+ assertProseBody(block.body, title);
131
+ const lines = [];
132
+ if (title) {
133
+ assertNoNewlines(title, 'prose title');
134
+ lines.push(`## ${title}`);
135
+ lines.push('');
136
+ }
137
+ lines.push(block.body);
138
+ lines.push('');
139
+ return lines;
140
+ }
141
+ assertNoNewlines(block.title, 'links title');
142
+ assertLinkItems(block.items);
143
+ const lines = [`## ${block.title}`, ''];
144
+ lines.push(...formatLinkItems(block.items));
145
+ lines.push('');
146
+ return lines;
147
+ }
46
148
  /**
47
149
  * Generates llms.txt content per the llms.txt spec (https://llmstxt.org/)
150
+ *
151
+ * Emission order:
152
+ * 1. `# siteName`
153
+ * 2. `> summary`
154
+ * 3. Legacy `details` (if any)
155
+ * 4. `customBlocks` with `after-summary`
156
+ * 5. `## Markdown access` (if `markdownUrlPattern`)
157
+ * 6. `customBlocks` with `before-sections`
158
+ * 7. Generated `sections[]`
159
+ * 8. `customBlocks` with `after-sections` / `before-optional`
160
+ * 9. `## Optional` + `optionalSection`
161
+ *
162
+ * Omit `customBlocks` for byte-compatible legacy output. Site values are
163
+ * code-configured only — not CMS. Prefer {@link llmsAccessPolicyBlock} over
164
+ * stuffing `## Access policy` into `details`.
48
165
  */
49
166
  export function generateLlmsTxt(options) {
50
167
  const lines = [];
51
168
  lines.push(`# ${options.siteName}`);
52
169
  lines.push('');
53
- lines.push(`> ${options.summary}`);
170
+ lines.push(`> ${normalizeSummary(options.summary)}`);
54
171
  lines.push('');
55
172
  if (options.details) {
56
173
  lines.push(options.details);
57
174
  lines.push('');
58
175
  }
176
+ const customBlocks = options.customBlocks ?? [];
177
+ const afterSummary = [];
178
+ const beforeSections = [];
179
+ const afterSections = [];
180
+ for (const block of customBlocks) {
181
+ const placement = resolvePlacement(block);
182
+ if (placement === 'after-summary') {
183
+ afterSummary.push(block);
184
+ }
185
+ else if (placement === 'before-sections') {
186
+ beforeSections.push(block);
187
+ }
188
+ else {
189
+ afterSections.push(block);
190
+ }
191
+ }
192
+ for (const block of afterSummary) {
193
+ lines.push(...emitCustomBlock(block));
194
+ }
59
195
  if (options.markdownUrlPattern) {
60
196
  lines.push('## Markdown access');
61
197
  lines.push('');
62
198
  lines.push(options.markdownUrlPattern);
63
199
  lines.push('');
64
200
  }
201
+ for (const block of beforeSections) {
202
+ lines.push(...emitCustomBlock(block));
203
+ }
65
204
  if (options.sections) {
66
205
  for (const section of options.sections) {
67
206
  lines.push(`## ${section.title}`);
68
207
  lines.push('');
69
- for (const item of section.items) {
70
- const desc = item.description ? `: ${item.description}` : '';
71
- lines.push(`- [${item.title}](${item.url})${desc}`);
72
- }
208
+ lines.push(...formatLinkItems(section.items));
73
209
  lines.push('');
74
210
  }
75
211
  }
212
+ for (const block of afterSections) {
213
+ lines.push(...emitCustomBlock(block));
214
+ }
76
215
  if (options.optionalSection) {
77
216
  lines.push('## Optional');
78
217
  lines.push('');
79
- for (const item of options.optionalSection.items) {
80
- const desc = item.description ? `: ${item.description}` : '';
81
- lines.push(`- [${item.title}](${item.url})${desc}`);
82
- }
218
+ lines.push(...formatLinkItems(options.optionalSection.items));
83
219
  lines.push('');
84
220
  }
85
- return lines.join('\n').trimEnd();
221
+ const output = lines.join('\n').trimEnd();
222
+ const totalBytes = utf8ByteLength(output);
223
+ if (totalBytes > LLMS_TOTAL_HARD_MAX_BYTES) {
224
+ throw new Error(`llms.txt output exceeds ${LLMS_TOTAL_HARD_MAX_BYTES} bytes (${totalBytes})`);
225
+ }
226
+ return output;
86
227
  }
87
228
  /**
88
229
  * Generates a plain text list of absolute markdown URLs (one per line).
@@ -1 +1 @@
1
- {"version":3,"file":"llmsTxt.js","sourceRoot":"","sources":["../src/llmsTxt.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACvE,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,IAAI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YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC1C,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,EAAE;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
package/docs/llms.md CHANGED
@@ -38,39 +38,77 @@ await exporter.exportAll({ outputDir: './public/markdown' });
38
38
 
39
39
  ## LLMs.txt Generation
40
40
 
41
- Generates a machine-readable site index in the llmstxt.org format:
41
+ Generates a machine-readable site index in the llmstxt.org format. **Site values (`summary`, Access policy, custom blocks) are code-configured only** — pass constants from `llms.txt/route.ts` (or a small `llms-custom.ts`). Do not fetch these from Contentful.
42
42
 
43
43
  ```ts
44
- import { generateLlmsTxt, generateMarkdownIndex } from '@se-studio/markdown-renderer';
44
+ import {
45
+ generateLlmsTxt,
46
+ generateMarkdownIndex,
47
+ llmsAccessPolicyBlock,
48
+ } from '@se-studio/markdown-renderer';
45
49
 
46
- // Generate llms.txt content (links to all markdown pages)
47
50
  const llmsTxt = generateLlmsTxt({
48
- title: 'My Site',
49
- description: 'Site description',
50
- links: markdownLinks,
51
+ siteName: 'My Site',
52
+ // Blockquote description — this is the summary/description override
53
+ summary: siteDescription,
54
+ markdownUrlPattern: 'Append .md to any page URL to fetch Markdown.',
55
+ customBlocks: [
56
+ llmsAccessPolicyBlock(ACCESS_POLICY_COPY),
57
+ // Optional extra prose or link lists with placement:
58
+ // { kind: 'prose', body: '…', placement: 'after-summary' },
59
+ // { kind: 'links', title: 'Guides', items: [...], placement: 'before-sections' },
60
+ ],
61
+ sections: [{ title: 'Key pages', items: keyPageItems }],
62
+ optionalSection: {
63
+ title: 'Optional', // heading is hard-coded "Optional"; title on the object is unused
64
+ items: optionalItems,
65
+ },
51
66
  });
52
67
 
53
- // Generate a markdown index of all content
54
- const index = generateMarkdownIndex({
55
- pages: allPageLinks,
56
- articles: allArticleLinks,
57
- urlCalculators,
58
- });
68
+ const index = generateMarkdownIndex(markdownLinks, { baseUrl });
59
69
  ```
60
70
 
71
+ ### Emission order
72
+
73
+ 1. `# siteName`
74
+ 2. `> summary`
75
+ 3. Legacy `details` (if any)
76
+ 4. `customBlocks` with `placement: 'after-summary'` (default for prose / Access policy)
77
+ 5. `## Markdown access` (if `markdownUrlPattern`)
78
+ 6. `customBlocks` with `placement: 'before-sections'` (default for `kind: 'links'`)
79
+ 7. Generated `sections[]`
80
+ 8. `customBlocks` with `after-sections` / `before-optional`
81
+ 9. `## Optional` + `optionalSection`
82
+
83
+ Omit `customBlocks` for byte-compatible legacy output. Prefer `llmsAccessPolicyBlock(copy)` over stuffing `## Access policy` into `details`.
84
+
85
+ ### Guards
86
+
87
+ | Guard | Behaviour |
88
+ |-------|-----------|
89
+ | Summary length | Soft-trim above 500 characters |
90
+ | Per-block prose body | Hard fail above 64 KiB UTF-8 |
91
+ | Total output | Hard fail above 256 KiB |
92
+ | Headings in prose | Reject H1 always; reject `#{1–6}` lines when `title` is set (empty-string title = untitled) |
93
+ | Link urls/titles | Reject raw newlines in custom link blocks |
94
+
95
+ Misconfigured `customBlocks` (oversized bodies, heading injection, newlines in link fields, total over 256 KiB) throw from `generateLlmsTxt` by design — the `/llms.txt` route will 500 until the site constants are fixed.
96
+
97
+ `llms-full.txt` is **not** generated by this package (not part of llmstxt.org v2). Custom blocks apply to `generateLlmsTxt` only.
98
+
61
99
  ## URL Builder Helpers
62
100
 
63
101
  ```ts
64
102
  import { buildMarkdownLinksFromAppLinks, toMarkdownUrl } from '@se-studio/markdown-renderer';
65
103
 
66
104
  // Convert a page/article href to a markdown URL
67
- const mdUrl = toMarkdownUrl('/blog/my-post'); // → '/markdown/blog/my-post'
105
+ const mdUrl = toMarkdownUrl('/blog/my-post'); // → '/blog/my-post.md'
68
106
 
69
107
  // Build markdown link list from Contentful link arrays
70
108
  const links = buildMarkdownLinksFromAppLinks({
71
109
  pageLinks: allPageLinks,
72
110
  articleLinks: allArticleLinks,
73
- urlCalculators,
111
+ tagLinks: allTagLinks,
74
112
  });
75
113
  ```
76
114
 
@@ -163,5 +201,5 @@ import type { ContentData } from '@se-studio/markdown-renderer';
163
201
 
164
202
  - **Search indexing**: `MarkdownExporter.fetchContent` is called by `@se-studio/search`'s `rebuildSearchIndex`
165
203
  - **LLM ingestion**: use `MarkdownConverter.convert` to turn CMS pages into readable Markdown
166
- - **Static exports**: expose `/markdown/*` routes so LLMs can crawl the site as Markdown
204
+ - **Static exports**: expose `/{path}.md` routes so LLMs can crawl the site as Markdown
167
205
  - **llms.txt**: expose `/llms.txt` with `generateLlmsTxt` for llmstxt.org discovery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/markdown-renderer",
3
- "version": "1.8.35",
3
+ "version": "1.9.0",
4
4
  "description": "Markdown renderer for Contentful content",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "@contentful/rich-text-types": "^17.2.7",
31
- "@se-studio/contentful-rest-api": "2.0.2",
31
+ "@se-studio/contentful-rest-api": "2.0.3",
32
32
  "@se-studio/core-data-types": "2.0.1",
33
33
  "html-entities": "^2.6.0",
34
34
  "js-yaml": "^5.4.2"