turva-llms-txt-validator 0.7.1 → 0.7.2
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 +2 -2
- package/dist/src/index.js +9 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -222,10 +222,10 @@ The strict type check found two inputs that could leave `undefined` in a check's
|
|
|
222
222
|
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.
|
|
223
223
|
|
|
224
224
|
```sh
|
|
225
|
-
mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.7.
|
|
225
|
+
mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.7.2 --ignore-scripts && npm audit signatures
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
`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 `github.com/erekola/llms-txt-validator`, the workflow file `.github/workflows/publish.yml` and the commit that produced the tarball. The npm version page shows them under Provenance. Tag `v0.7.
|
|
228
|
+
`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 `github.com/erekola/llms-txt-validator`, the workflow file `.github/workflows/publish.yml` and the commit that produced the tarball. The npm version page shows them under Provenance. Tag `v0.7.2` must point at that same commit, and `gh api repos/erekola/llms-txt-validator/commits/v0.7.2 --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.
|
|
229
229
|
|
|
230
230
|
## Development
|
|
231
231
|
|
package/dist/src/index.js
CHANGED
|
@@ -146,9 +146,12 @@ export function normalizeHostInput(raw) {
|
|
|
146
146
|
// as a fetch proxy, so a typed /docs/llms.txt used to be dropped without a word while the result
|
|
147
147
|
// described the root file (outside retest 2026-09-26). The result now names the unused path in an
|
|
148
148
|
// info check. The case of the path is kept, and the query and fragment are never returned.
|
|
149
|
-
// Mirrors worker.ts enteredPath() (v3.176.0).
|
|
149
|
+
// Mirrors worker.ts enteredPath() (v3.176.0). The hosted route removes tab, CR and LF from the typed
|
|
150
|
+
// address before it calls enteredPath, as normalizeHostInput does, so this function removes them
|
|
151
|
+
// itself: "ht<TAB>tps://example.com" validates example.com and names no path. Without it the scheme
|
|
152
|
+
// test below did not match and the URL parser read the text as a path (audit round 25, R5-1).
|
|
150
153
|
export function enteredPath(raw) {
|
|
151
|
-
let s = String(raw || "").trim();
|
|
154
|
+
let s = String(raw || "").replace(/[\t\r\n]/g, "").trim();
|
|
152
155
|
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(s))
|
|
153
156
|
s = "https://" + s;
|
|
154
157
|
let u;
|
|
@@ -2350,15 +2353,6 @@ var AFTER_HEAD_ELEMENTS = ["base", "basefont", "bgsound", "link", "meta", "nofra
|
|
|
2350
2353
|
// Their content is not markup: script, style, title, noscript (a parser with scripting on
|
|
2351
2354
|
// reads it as raw text) and noframes are raw text or RCDATA, and template content is inert.
|
|
2352
2355
|
var HEAD_SKIPPED_CONTENT = ["script", "style", "title", "noscript", "noframes", "template"];
|
|
2353
|
-
// The end of a raw text or RCDATA element: the first </name that is followed by optional
|
|
2354
|
-
// whitespace, an optional "/" (a parser closes on </script/> too) and a ">". Returns the
|
|
2355
|
-
// index after it, or -1 when the element never closes, which means the rest of the
|
|
2356
|
-
// document is inside it.
|
|
2357
|
-
function skipSpace(lower, j) {
|
|
2358
|
-
while (j < lower.length && (lower[j] === " " || lower[j] === "\t" || lower[j] === "\n" || lower[j] === "\r" || lower[j] === "\f"))
|
|
2359
|
-
j++;
|
|
2360
|
-
return j;
|
|
2361
|
-
}
|
|
2362
2356
|
// True when the character ends a tag name: whitespace, "/", ">" or the end of the input.
|
|
2363
2357
|
function isTagBoundary(c) {
|
|
2364
2358
|
return c === undefined || c === ">" || c === "/" || c === " " || c === "\t" || c === "\n" || c === "\r" || c === "\f";
|
|
@@ -2373,6 +2367,10 @@ function endTagAt(lower, name, at) {
|
|
|
2373
2367
|
const gt = tagEnd(lower, at);
|
|
2374
2368
|
return gt === -1 ? -2 : gt + 1;
|
|
2375
2369
|
}
|
|
2370
|
+
// The end of a raw text or RCDATA element: the first </name that is followed by optional
|
|
2371
|
+
// whitespace, an optional "/" (a parser closes on </script/> too) and a ">". Returns the
|
|
2372
|
+
// index after it, or -1 when the element never closes, which means the rest of the
|
|
2373
|
+
// document is inside it.
|
|
2376
2374
|
function rawTextEnd(lower, name, from) {
|
|
2377
2375
|
for (let at = lower.indexOf("</" + name, from); at !== -1; at = lower.indexOf("</" + name, at + name.length + 2)) {
|
|
2378
2376
|
const end = endTagAt(lower, name, at);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turva-llms-txt-validator",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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",
|