@queryrev/ai-readiness 0.0.0-stage → 1.0.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 (66) hide show
  1. package/CITATION.cff +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +195 -2
  4. package/SECURITY.md +34 -0
  5. package/data/LICENSE +409 -0
  6. package/dist/chunks/cli-BK65ic84.js +56 -0
  7. package/dist/chunks/fetch-text-NUUnM91O.js +866 -0
  8. package/dist/chunks/findings-CTetT2bF.js +2950 -0
  9. package/dist/chunks/main-Bd0uzoHe.js +1491 -0
  10. package/dist/cli/args.d.ts +27 -0
  11. package/dist/cli/bin.d.ts +2 -0
  12. package/dist/cli/commands/check.d.ts +4 -0
  13. package/dist/cli/commands/crawlers.d.ts +3 -0
  14. package/dist/cli/commands/llms-generate.d.ts +4 -0
  15. package/dist/cli/commands/llms-validate.d.ts +4 -0
  16. package/dist/cli/commands/robots-test.d.ts +4 -0
  17. package/dist/cli/common.d.ts +27 -0
  18. package/dist/cli/finding.d.ts +3 -0
  19. package/dist/cli/main.d.ts +7 -0
  20. package/dist/cli/node-context.d.ts +3 -0
  21. package/dist/cli/render.d.ts +26 -0
  22. package/dist/cli/run.d.ts +11 -0
  23. package/dist/cli/sanitize.d.ts +8 -0
  24. package/dist/cli/types.d.ts +59 -0
  25. package/dist/cli/usage.d.ts +1 -0
  26. package/dist/cli.js +36 -0
  27. package/dist/crawlers/index.d.ts +79 -0
  28. package/dist/facts/app-shell.d.ts +24 -0
  29. package/dist/facts/check-site.d.ts +13 -0
  30. package/dist/facts/domain.d.ts +15 -0
  31. package/dist/facts/findings.d.ts +5 -0
  32. package/dist/facts/home-page.d.ts +18 -0
  33. package/dist/facts/home-response.d.ts +5 -0
  34. package/dist/facts/html.d.ts +37 -0
  35. package/dist/facts/index.d.ts +16 -0
  36. package/dist/facts/json-ld.d.ts +35 -0
  37. package/dist/facts/marks.d.ts +51 -0
  38. package/dist/facts/organization.d.ts +23 -0
  39. package/dist/facts/origin-robots.d.ts +20 -0
  40. package/dist/facts/profiles.d.ts +13 -0
  41. package/dist/facts/reader.d.ts +2 -0
  42. package/dist/facts/schema-org-organization-types.d.ts +6 -0
  43. package/dist/facts/schema-org-types.d.ts +2 -0
  44. package/dist/facts/sitemap.d.ts +24 -0
  45. package/dist/facts/types.d.ts +214 -0
  46. package/dist/facts/words.d.ts +15 -0
  47. package/dist/generate/generate-llms.d.ts +51 -0
  48. package/dist/generate/index.d.ts +70 -0
  49. package/dist/index.d.ts +10 -0
  50. package/dist/index.js +1023 -0
  51. package/dist/llms/findings.d.ts +7 -0
  52. package/dist/llms/index.d.ts +88 -0
  53. package/dist/llms/links.d.ts +46 -0
  54. package/dist/net/address.d.ts +26 -0
  55. package/dist/net/charset.d.ts +20 -0
  56. package/dist/net/cli.d.ts +13 -0
  57. package/dist/net/fetch-text.d.ts +191 -0
  58. package/dist/net/guard.d.ts +71 -0
  59. package/dist/net/testing/fixture-fetcher.d.ts +15 -0
  60. package/dist/net/testing/fixture-guard.d.ts +20 -0
  61. package/dist/net/testing/index.d.ts +7 -0
  62. package/dist/net-cli.js +1 -0
  63. package/dist/robots/index.d.ts +67 -0
  64. package/dist/run.js +1 -0
  65. package/dist/testing.js +58 -0
  66. package/package.json +78 -4
package/CITATION.cff ADDED
@@ -0,0 +1,31 @@
1
+ cff-version: 1.2.0
2
+ message: 'If you use this software, please cite it using the metadata below.'
3
+ type: software
4
+ title: 'QueryRev AI Readiness'
5
+ abstract: >-
6
+ Command line and library that read a site's public files and report how they treat AI
7
+ crawlers: robots.txt access for a list of AI crawlers, llms.txt validation and generation,
8
+ and structured-data findings, each with its evidence. No model calls, no telemetry.
9
+ authors:
10
+ - name: 'QueryRev'
11
+ version: 1.0.1
12
+ date-released: '2026-10-24'
13
+ license: MIT
14
+ repository-code: 'https://github.com/QueryRevAI/ai-readiness'
15
+ url: 'https://queryrev.com/research/ai-search-readiness'
16
+ keywords:
17
+ - robots.txt
18
+ - llms.txt
19
+ - AI crawlers
20
+ - generative engine optimization
21
+ - answer engine optimization
22
+ references:
23
+ - type: dataset
24
+ title: 'State of AI Crawler Access (October 2026)'
25
+ authors:
26
+ - name: 'QueryRev Research'
27
+ year: 2026
28
+ doi: 10.5281/zenodo.23424275
29
+ license: CC-BY-4.0
30
+ publisher:
31
+ name: Zenodo
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QueryRev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,196 @@
1
- # Temporary Holding Version
1
+ # QueryRev AI Readiness
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Checks how a site's public files treat AI crawlers: which of 11 AI crawlers robots.txt lets in, whether the llms.txt is a real llms.txt, and what the home page says without running scripts. Every result is a finding with its evidence. There are no scores, no model calls and no telemetry.
4
+
5
+ ```
6
+ npx @queryrev/ai-readiness check www.example.com
7
+ ```
8
+
9
+ Requires Node 22.19 or later. One runtime dependency (`undici`).
10
+
11
+ ## Install
12
+
13
+ ```
14
+ npx @queryrev/ai-readiness <command> # no install
15
+ npm install --global @queryrev/ai-readiness
16
+ ai-readiness <command>
17
+ ```
18
+
19
+ ## Commands
20
+
21
+ | Command | What it does |
22
+ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ |
23
+ | `check <url>` | Crawler access, llms.txt, the home page as served, structured data and the sitemap |
24
+ | `robots test <file\|url> --agent --path` | Which robots.txt line decides for a crawler and a path. A file is read offline |
25
+ | `llms validate <file\|url> [--links]` | Checks an llms.txt against [llmstxt.org](https://llmstxt.org); `--links` also requests up to 20 links |
26
+ | `llms generate <url> [--max-pages 30]` | Builds the skeleton of an llms.txt from the site's own sitemap or home page links |
27
+ | `crawlers` | The crawlers covered, with vendor and purpose |
28
+
29
+ Options: `--json`, `--fail-on fail|warn`, `--allow-private-network`, `--no-color`, `--help`, `--version`. Options go after the command.
30
+
31
+ ### `check`
32
+
33
+ ```
34
+ $ ai-readiness check www.example.com
35
+ AI readiness check: https://www.example.com
36
+
37
+ Crawler access (robots.txt, whole site)
38
+ Crawler Purpose Access
39
+ GPTBot training allowed
40
+ OAI-SearchBot search allowed
41
+ ...
42
+
43
+ Findings
44
+ PASS robots-txt robots.txt found (77 bytes).
45
+ PASS sitemap-in-robots robots.txt lists a sitemap.
46
+ | https://www.example.com/sitemap.xml
47
+ PASS ai-search-crawler-access All 5 AI search and user-fetch crawlers on the list can read the home page.
48
+ INFO ai-training-crawler-access No AI training crawler on the list is blocked. Blocking them is the site's choice.
49
+ WARN organization-same-as The Organization has no sameAs link to a profile on another site.
50
+ ...
51
+
52
+ 13 pass, 1 warn, 0 fail, 2 info
53
+ ```
54
+
55
+ `check` asks for four files, in this order, and only where robots.txt lets this tool in: `/robots.txt`, the home page, `/llms.txt` and the sitemap. If robots.txt cannot be read, nothing else is requested and the exit code is 3.
56
+
57
+ Training crawlers are reported but never counted as a failure: blocking them is the site's choice. A crawler for AI search or for fetching a page when a user asks is a `fail` when robots.txt keeps it from the home page.
58
+
59
+ ### `robots test`
60
+
61
+ ```
62
+ $ ai-readiness robots test robots.txt --agent OAI-SearchBot --path /account/settings
63
+ FAIL robots-access OAI-SearchBot may not fetch /account/settings: the "*" group (line 9), decided by line 10 (Disallow: /account/).
64
+ | line 10: Disallow: /account/
65
+ ```
66
+
67
+ With `--agent` the exit code answers the question: 0 when the crawler may fetch the path, 1 when it may not. Any token can be tested; the tool suggests only the crawlers it covers. Without `--agent` it tests every covered crawler.
68
+
69
+ Matching follows RFC 9309: the group that names the token applies, else the `*` group; the longest matching rule wins and `Allow` wins a tie.
70
+
71
+ ### `llms validate`
72
+
73
+ ```
74
+ $ ai-readiness llms validate https://www.example.com --links
75
+ PASS llms-txt-found The file is an llms.txt.
76
+ PASS llms-txt-h1 The file has one H1, as llmstxt.org asks.
77
+ PASS llms-txt-summary The file has a summary blockquote.
78
+ PASS llms-txt-sections The file has 2 H2 sections of links and 14 links in all.
79
+ FAIL llms-txt-links 1 of 14 checked links answer 404 or 410.
80
+ | 404 https://www.example.com/old-guide
81
+ ```
82
+
83
+ A 200 alone is not enough: an HTML page, or a robots.txt, served at `/llms.txt` is reported as not being an llms.txt, and so is text that does not open with a Markdown H1. For a local file, `--links` needs `--base <site address>` to resolve the links.
84
+
85
+ ### `llms generate`
86
+
87
+ ```
88
+ $ ai-readiness llms generate https://www.example.com --max-pages 30 --out llms.txt
89
+ ```
90
+
91
+ Reads robots.txt, then the sitemaps it lists (at most 5 files), else the links on the home page. Only pages on the same site are listed; pages that say `noindex`, redirect elsewhere or are closed to this tool by robots.txt are left out. Each page's title and meta description are used as the page wrote them. The result is a skeleton: read it and edit it before you publish it. With `--out` the file is written only if it does not exist, unless `--force` is given. Without `--out` the file goes to standard output and the notes to standard error.
92
+
93
+ ## Crawlers covered
94
+
95
+ Crawlers covered: the 11 AI crawlers on this list, from OpenAI, Perplexity, Google, Apple, Common Crawl, Meta, Amazon and ByteDance. Other crawlers are not checked.
96
+
97
+ | Crawler | Vendor | Purpose |
98
+ | ------------------ | ------------ | -------- |
99
+ | GPTBot | OpenAI | training |
100
+ | OAI-SearchBot | OpenAI | search |
101
+ | ChatGPT-User | OpenAI | user |
102
+ | PerplexityBot | Perplexity | search |
103
+ | Perplexity-User | Perplexity | user |
104
+ | Google-Extended | Google | training |
105
+ | Applebot-Extended | Apple | training |
106
+ | CCBot | Common Crawl | training |
107
+ | Meta-ExternalAgent | Meta | training |
108
+ | Amazonbot | Amazon | search |
109
+ | Bytespider | ByteDance | training |
110
+
111
+ The line is printed at the end of `check`, `crawlers`, `llms validate`, `llms generate` and `robots test` without `--agent`, and is the `crawlersCovered` field of their JSON. `robots test --agent` tests the one token you name, covered or not. Nothing here says "all AI crawlers".
112
+
113
+ ## What it cannot see
114
+
115
+ It reads public files over HTTP, as one visitor from your machine. It cannot see:
116
+
117
+ - a CDN or firewall rule that answers AI crawlers differently from how it answers this tool (a crawler that robots.txt allows can still be blocked at the network edge);
118
+ - what a crawler actually fetches, how often, or whether a page is cited by an AI answer;
119
+ - content that only appears after scripts run: the home page is read as served, without scripts;
120
+ - anything behind a login, a bot check or a block of this tool's own address.
121
+
122
+ ## Network behaviour
123
+
124
+ The tool is meant to be run by anyone against any address, so it is strict about what it touches.
125
+
126
+ - User agent: `Mozilla/5.0 (compatible; QueryRev-AIReadiness/1.0; +https://queryrev.com/bot)`. Its robots.txt token is `QueryRev-AIReadiness`, and it obeys the rules written for that token (or `*`), including `Crawl-delay` up to 10 seconds.
127
+ - `check` and `llms generate` request a file only where robots.txt lets this tool in. `robots test` and `llms validate` fetch the one file you point them at; `llms validate --links` asks robots.txt before it requests each link.
128
+ - `GET` only. No cookies, no credentials, no proxy taken from the environment.
129
+ - Only `http` and `https`, only ports 80 and 443, no user name or password in the address, no IP-literal hosts, host names of at most 253 characters.
130
+ - The host name is resolved once and the connection goes to the address that was checked. Private, loopback, link-local, cloud metadata and other special-purpose ranges are refused.
131
+ - At most 3 redirects, each checked again; a redirect to another site is not followed.
132
+ - 5 seconds to connect, 10 seconds a request, 30 seconds for `check`, 120 seconds for `llms generate`.
133
+ - Size limits, counted after decompression and reported when reached: robots.txt 500 KiB, llms.txt 1 MiB, pages 2 MiB, sitemaps 5 MiB.
134
+ - One request a second to a host. The tool stops asking a host that answers 429 or 503.
135
+ - Text from a site is stripped of control and escape characters before it is printed.
136
+ - `--allow-private-network` lets the command line reach a staging site on a private network. It never opens cloud metadata addresses, IP-literal hosts or other ports. The library entry point has no such option.
137
+ - Nothing is sent to queryrev.com or to anyone but the site you ask about. There is no telemetry, no account and no key. The "Full report" link at the end of a report is printed, not opened.
138
+
139
+ ## Use in CI
140
+
141
+ The exit code is the contract:
142
+
143
+ | Code | Meaning |
144
+ | ---- | ------------------------------------------------------------------------------------- |
145
+ | 0 | Nothing at or above `--fail-on` (`fail` by default; `warn` to be stricter) |
146
+ | 1 | Checks failed |
147
+ | 2 | Usage error: a wrong command, option or input file |
148
+ | 3 | The site could not be read: refused, unreachable, timed out, or robots.txt unreadable |
149
+ | 4 | Internal error |
150
+
151
+ ```
152
+ npx @queryrev/ai-readiness check https://www.example.com --fail-on fail
153
+ ```
154
+
155
+ `--json` prints one JSON document on standard output and nothing else, for every exit code, errors included:
156
+
157
+ ```json
158
+ {
159
+ "schemaVersion": 1,
160
+ "command": "check",
161
+ "exitCode": 0,
162
+ "failOn": "fail",
163
+ "summary": { "pass": 13, "warn": 1, "fail": 0, "info": 2 },
164
+ "site": { "origin": "https://www.example.com", "crawlerAccess": [], "findings": [] }
165
+ }
166
+ ```
167
+
168
+ `schemaVersion`, the flags and the exit codes are the contract: a change to them is a major version. Within version 1, fields may be added. Each finding has a stable `id`, a `level` (`pass`, `warn`, `fail` or `info`), one sentence in `message`, a `docUrl`, and its evidence in `snippet` when there is one.
169
+
170
+ The `examples/` folder has a CI script that acts on the exit codes (`ci.sh`), a plain-Node consumer of the JSON (`read-report.mjs`), and a robots.txt with a script that tests it (`robots.txt`, `robots-check.sh`).
171
+
172
+ ## In an MCP client and in GitHub
173
+
174
+ - **MCP server.** [`@queryrev/ai-readiness-mcp`](https://www.npmjs.com/package/@queryrev/ai-readiness-mcp) offers the same checks as tools and works with any MCP client that starts a local server: `npx -y @queryrev/ai-readiness-mcp`. Each tool returns the document that `--json` prints. Its source is the `mcp/` folder of this repository.
175
+ - **GitHub Action.** [`QueryRevAI/ai-readiness-action`](https://github.com/QueryRevAI/ai-readiness-action) fails a pull request when a change to `robots.txt` or `llms.txt` closes the site to AI search crawlers. It is offline by default.
176
+
177
+ ## Licences
178
+
179
+ - The code is MIT (see `LICENSE`).
180
+ - The data under `data/` is CC BY 4.0 (see `data/LICENSE`). Credit it by citing the dataset below.
181
+
182
+ ## How to cite
183
+
184
+ Cite the software with the metadata in `CITATION.cff` (GitHub shows a "Cite this repository" button). The crawler study the covered list comes from is a dataset under CC BY 4.0:
185
+
186
+ > QueryRev Research. State of AI Crawler Access (October 2026). Zenodo. https://doi.org/10.5281/zenodo.23424275
187
+
188
+ ## Contributing
189
+
190
+ Issues and pull requests are welcome at https://github.com/QueryRevAI/ai-readiness. This repository is updated by release snapshots, so we apply an accepted change ourselves and credit you as a co-author on the commit; the next release carries it. A pull request is therefore closed with a note instead of being merged.
191
+
192
+ A new crawler for the covered list needs a link to the vendor's own documentation of its token.
193
+
194
+ ## Security
195
+
196
+ Report a vulnerability to **security@queryrev.com**, not in a public issue. See `SECURITY.md`.
package/SECURITY.md ADDED
@@ -0,0 +1,34 @@
1
+ # Security policy
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Email **security@queryrev.com** with what you found and how to reproduce it. Please do not open
6
+ a public issue for a vulnerability.
7
+
8
+ We reply within three working days, tell you whether we can reproduce the problem, and keep you
9
+ informed until a fix is released. We credit reporters in the release notes unless you prefer not
10
+ to be named.
11
+
12
+ ## What counts
13
+
14
+ This package reads files from sites that strangers type in, so the parts that matter most are:
15
+
16
+ - the network layer: anything that lets a request reach an address it should not (private or
17
+ reserved networks, cloud metadata addresses, a redirect or a DNS answer that changes between
18
+ the check and the connection), or that exceeds the limits on size, time, redirects or request
19
+ rate described in the README;
20
+ - the parsers (robots.txt, llms.txt, sitemaps, HTML, JSON-LD): input that makes them run for
21
+ far longer than the size of the input warrants, or use unbounded memory;
22
+ - output: text from a site that reaches a terminal with control or escape characters intact;
23
+ - the `--allow-private-network` option, which must stay limited to the command line and keep
24
+ refusing cloud metadata addresses.
25
+
26
+ ## Supported versions
27
+
28
+ The latest release receives fixes. Older releases are not patched.
29
+
30
+ ## What this package never does
31
+
32
+ It sends nothing to queryrev.com or anywhere else but the site you asked about. It has no
33
+ telemetry, no account and no key. It requests only public files, with `GET`, and sends no
34
+ cookies or credentials.