turva-llms-txt-validator 0.8.4 → 0.8.5
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/README.md +11 -11
- package/dist/src/index.js +8 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ llms-txt-validate --help
|
|
|
37
37
|
llms-txt-validate --version
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
A domain, an HTTP URL or an HTTPS URL is accepted. Validation always uses the host's `/llms.txt` and home page over HTTPS, regardless of the supplied path. If the address has a path other than `/` or `/llms.txt`, the result names that path first in an `info` line.
|
|
40
|
+
A domain, an HTTP URL or an HTTPS URL is accepted. A host given with port 80 or 443 is read at HTTPS on port 443, and any other port is refused. Validation always uses the host's `/llms.txt` and home page over HTTPS, regardless of the supplied path. If the address has a path other than `/` or `/llms.txt`, the result names that path first in an `info` line.
|
|
41
41
|
|
|
42
42
|
| Option | Effect |
|
|
43
43
|
| --- | --- |
|
|
@@ -108,7 +108,7 @@ In an error report the `target` is the address given on the command line. When i
|
|
|
108
108
|
| 3 | First non-empty line is a Markdown H1, written `# Title` or as one line of text underlined with `=` | Missing H1, a title indented as a code block, or an H1 with no text, whether written with `#` or underlined with `=` | none |
|
|
109
109
|
| 4 | Blockquote summary follows the title | none | Missing summary, a blockquote block in which no line has text after the `>`, or a blockquote after other text but before the first H2, named by its line |
|
|
110
110
|
| 5 | H2 sections group the content | none | No H2 sections, no section with a Markdown link list, a heading between the title and the first H2, or a second H1 |
|
|
111
|
-
| 6 | Markdown links have names and absolute HTTP or HTTPS targets | none | Missing links, empty names, relative targets or targets that do not parse as HTTP or HTTPS URLs, or a list line under an H2 of one of two kinds. The first kind looks like a link entry but is not a Markdown link, such as an unclosed destination in `- [Name](https://example.com/a.md: notes)`. The second kind opens with an en dash, an em dash or a bullet instead of a list marker, followed by a space or a tab and an opening bracket, whether or not its link parses. A line with such a character and no opening bracket is not counted, and a no-break space does not count as the space. The detail has one sentence per kind, each with its count and the first five line numbers |
|
|
111
|
+
| 6 | Markdown links have names and absolute HTTP or HTTPS targets | none | Missing links, empty names, relative targets or targets that do not parse as HTTP or HTTPS URLs, or a list line under an H2 of one of two kinds. The first kind looks like a link entry but is not a Markdown link, such as an unclosed destination in `- [Name](https://example.com/a.md: notes)`. The second kind opens with an en dash, an em dash or a bullet instead of a list marker, followed by a space or a tab and an opening bracket, whether or not its link parses. A line with such a character and no opening bracket is not counted, and a no-break space does not count as the space. When the read was truncated, the last line read is not counted, because the read limit may have cut it. The detail has one sentence per kind, each with its count and the first five line numbers |
|
|
112
112
|
| 7 | File is small enough to read cheaply | none | Over 50 KiB, which is 51,200 bytes, or truncated at the 256 KiB read limit |
|
|
113
113
|
| 8 | File contains no HTML markup | none | An opening tag with its closing `>`, a closing tag or an HTML comment is found in the prose. Inline code spans, fenced code and backslash-escaped angle brackets such as `\<node-name\>` are not read, so `<endpoint-id>` in a code span does not warn. An attribute name is any run of characters other than white space, quotes, `<`, `>`, `/` and `=` that holds a Unicode letter, a Unicode digit or the character `_`, so `<div @click="x">` warns. Autolinks such as `<https://example.com>` and prose such as `a <b + c` are not tags. A tag still open at the end of the file, such as `<div class="x"`, has no closing `>` and does not warn |
|
|
114
114
|
|
|
@@ -234,7 +234,7 @@ The default validation requests two documents: `https://<host>/llms.txt` and `ht
|
|
|
234
234
|
|
|
235
235
|
**DNS resolution is not checked for private addresses.** A syntactically public domain can resolve to a private IP, so if you expose this package through a service that accepts untrusted domains, enforce private-address restrictions at the network layer. Local and CI runs use their own network policy. The hosted validator runs on the Cloudflare edge.
|
|
236
236
|
|
|
237
|
-
For vulnerability reporting and supported versions, see [SECURITY.md](https://github.com/
|
|
237
|
+
For vulnerability reporting and supported versions, see [SECURITY.md](https://github.com/turva-dev/llms-txt-validator/blob/main/SECURITY.md).
|
|
238
238
|
|
|
239
239
|
## Release process
|
|
240
240
|
|
|
@@ -246,24 +246,24 @@ GitHub Actions tests Node.js 22, 24 and 26 on Ubuntu and Node.js 22 on Windows.
|
|
|
246
246
|
|
|
247
247
|
Up to 0.3.21 the package was plain JavaScript modules, starting with `src/index.mjs`. Version 0.4.0, released on 21 October 2026, ports it to TypeScript compiled to `dist/`, and the entry point moved to `dist/src/index.js` behind the same `exports` name. The compiled library has the same 12 493 JavaScript tokens as 0.3.21, apart from the relative path to `package.json`. A differential run fed both versions 4 160 000 generated `llms.txt` inputs and 832 000 HTML heads and found no difference. The CLI kept its flags, its output and its exit codes.
|
|
248
248
|
|
|
249
|
-
The strict type check found two inputs that could leave `undefined` in a check's detail. Neither `fetchLlmsTxt` nor `validateHost` produces them, and 0.4.1 fixed both. Each release is described in [CHANGELOG.md](https://github.com/
|
|
249
|
+
The strict type check found two inputs that could leave `undefined` in a check's detail. Neither `fetchLlmsTxt` nor `validateHost` produces them, and 0.4.1 fixed both. Each release is described in [CHANGELOG.md](https://github.com/turva-dev/llms-txt-validator/blob/main/CHANGELOG.md).
|
|
250
250
|
|
|
251
251
|
## Verify a release
|
|
252
252
|
|
|
253
253
|
GitHub Actions publishes every version from 0.1.3 on with npm trusted publishing, and each one carries a provenance attestation. To check one, install it in an empty directory and ask npm to verify the signatures. Replace the version with the one you want to check.
|
|
254
254
|
|
|
255
255
|
```sh
|
|
256
|
-
mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.8.
|
|
256
|
+
mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.8.5 --ignore-scripts && npm audit signatures
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
`npm audit signatures` checks the registry signature and the provenance attestation of each installed package that has one. The attestation of this package names three things to compare with what you expect: the repository
|
|
259
|
+
`npm audit signatures` checks the registry signature and the provenance attestation of each installed package that has one. The attestation of this package names three things to compare with what you expect: the repository, the workflow file `.github/workflows/publish.yml` and the commit that produced the tarball. Versions up to and including 0.8.4 were built in `github.com/erekola/llms-txt-validator`, before the repository moved to the turva-dev organization on 2026-11-25. Every later release is built in `github.com/turva-dev/llms-txt-validator`. The npm version page shows them under Provenance.
|
|
260
260
|
|
|
261
|
-
Tag `v0.8.
|
|
261
|
+
Tag `v0.8.5` must point at that same commit, and `gh api repos/turva-dev/llms-txt-validator/commits/v0.8.5 --jq .sha` prints it. A mismatch is a reason not to use that version. Provenance proves which workflow built a release and from which commit. It does not prove that the code is safe, so reading the source and the dependencies stays your job.
|
|
262
262
|
|
|
263
263
|
## Development
|
|
264
264
|
|
|
265
265
|
```sh
|
|
266
|
-
git clone https://github.com/
|
|
266
|
+
git clone https://github.com/turva-dev/llms-txt-validator.git
|
|
267
267
|
cd llms-txt-validator
|
|
268
268
|
npm ci --ignore-scripts
|
|
269
269
|
npm run typecheck
|
|
@@ -274,7 +274,7 @@ npm test
|
|
|
274
274
|
|
|
275
275
|
## Hosted version and source
|
|
276
276
|
|
|
277
|
-
The [hosted validator](https://turva.dev/llms-txt-validator) accepts any public domain in the browser. For any host other than turva.dev itself it requests the same two documents, `/llms.txt` and the home page. For turva.dev it validates the site's own files directly, without a request. The hosted validator reads www.turva.dev the same way and reports https://turva.dev/llms.txt as the target. This package requests www.turva.dev as typed, follows its redirect and reports https://www.turva.dev/llms.txt. It runs the same checks. Its source is in the [turva.dev Cloudflare Worker](https://github.com/
|
|
277
|
+
The [hosted validator](https://turva.dev/llms-txt-validator) accepts any public domain in the browser. For any host other than turva.dev itself it requests the same two documents, `/llms.txt` and the home page. For turva.dev it validates the site's own files directly, without a request. The hosted validator reads www.turva.dev the same way and reports https://turva.dev/llms.txt as the target. This package requests www.turva.dev as typed, follows its redirect and reports https://www.turva.dev/llms.txt. It runs the same checks. Its source is in the [turva.dev Cloudflare Worker](https://github.com/turva-dev/turva-worker). The hosted validator is the canonical implementation: if results diverge, this package is updated to match it.
|
|
278
278
|
|
|
279
279
|
The hosted version also returns JSON with the same result shape for a completed validation. Its errors are shaped differently: an `error` field, plus a `docs` link when the `url` parameter is missing, with HTTP status 400 and no `target`. The site-wide rate limiter can also answer HTTP 429 as plain text, with a `Retry-After` header, before the validator runs, and that answer is not JSON.
|
|
280
280
|
|
|
@@ -288,13 +288,13 @@ In Windows PowerShell, use `curl.exe` if `curl` resolves to `Invoke-WebRequest`.
|
|
|
288
288
|
|
|
289
289
|
## Check HTML and Markdown content
|
|
290
290
|
|
|
291
|
-
[markdown-parity-check](https://github.com/
|
|
291
|
+
[markdown-parity-check](https://github.com/turva-dev/markdown-parity-check) is a separate tool for a different question. This validator reads the structure of `llms.txt` and the home page's discovery links. The parity check compares the main content of one page's HTML and Markdown versions and reports changed text, numbers, links or blocks. It requires Node.js 22 or newer:
|
|
292
292
|
|
|
293
293
|
```sh
|
|
294
294
|
npx --yes markdown-parity-check --url https://example.com/page --format json
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
-
Replace the URL with your page. If Markdown is served at another address, add `--markdown-url https://example.com/page.md`. Its [browser version](https://turva.dev/markdown-parity-check) on turva.dev checks turva.dev's own pages only. See the [comparison README](https://github.com/
|
|
297
|
+
Replace the URL with your page. If Markdown is served at another address, add `--markdown-url https://example.com/page.md`. Its [browser version](https://turva.dev/markdown-parity-check) on turva.dev checks turva.dev's own pages only. See the [comparison README](https://github.com/turva-dev/markdown-parity-check) for local-file mode, exit codes and limits.
|
|
298
298
|
|
|
299
299
|
## License
|
|
300
300
|
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// turva-llms-txt-validator: validate a site's llms.txt structure.
|
|
2
2
|
// The checks mirror the hosted validator at https://turva.dev/llms-txt-validator,
|
|
3
3
|
// which runs this same logic inside the turva.dev Cloudflare Worker
|
|
4
|
-
// (https://github.com/
|
|
4
|
+
// (https://github.com/turva-dev/turva-worker). The hosted validator stays
|
|
5
5
|
// canonical: if the two ever disagree, the hosted one wins and this package
|
|
6
6
|
// gets the fix. No tool compares the two sources: the mirror is kept by hand, and the
|
|
7
7
|
// test files of the two repos carry the same inputs and expectations by hand too.
|
|
@@ -2192,6 +2192,13 @@ export function validateLlmsTxt(f) {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
// A list line that looks like a link entry but is not one (Tek-730) turns the links check to a warn.
|
|
2194
2194
|
const lookalikes = unparsedLinkEntries(lines, fenced, new Set(proseLinks.map((m) => m.at)), codeSpanMask(linkText, linkBlocks), defAt, htmlLine);
|
|
2195
|
+
// A truncated read can end inside a list line, so that last line is left out of this check:
|
|
2196
|
+
// calling a line malformed when the read cut it is unsupported (0.8.5, mirrors the hosted validator).
|
|
2197
|
+
if (f.truncated) {
|
|
2198
|
+
const cut = lines.length;
|
|
2199
|
+
lookalikes.unparsed = lookalikes.unparsed.filter((n) => n !== cut);
|
|
2200
|
+
lookalikes.marker = lookalikes.marker.filter((n) => n !== cut);
|
|
2201
|
+
}
|
|
2195
2202
|
if (lookalikes.unparsed.length + lookalikes.marker.length > 0) {
|
|
2196
2203
|
const lk = checks[checks.length - 1];
|
|
2197
2204
|
lk.status = "warn";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turva-llms-txt-validator",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Validate a site's llms.txt structure: eight checks as pass/warn/fail plus two llms.txt v2 discovery checks that read pass or info and never move the summary, JSON output. Same checks as the hosted validator at turva.dev/llms-txt-validator.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/
|
|
46
|
+
"url": "git+https://github.com/turva-dev/llms-txt-validator.git"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://turva.dev/llms-txt-validator",
|
|
49
49
|
"bugs": {
|
|
50
|
-
"url": "https://github.com/
|
|
50
|
+
"url": "https://github.com/turva-dev/llms-txt-validator/issues"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.20.5",
|