ssqch 0.11.0 → 0.13.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.
Files changed (138) hide show
  1. package/bundled/completions/bash +67 -9
  2. package/bundled/completions/elvish +24 -4
  3. package/bundled/completions/fish +37 -25
  4. package/bundled/completions/powershell +26 -4
  5. package/bundled/completions/zsh +45 -10
  6. package/bundled/docs/agents.md +2 -2
  7. package/bundled/docs/build-summary.md +1 -1
  8. package/bundled/docs/comparing-builds.md +7 -4
  9. package/bundled/docs/configuring.md +7 -12
  10. package/bundled/docs/deploying.md +1 -1
  11. package/bundled/docs/field-guide.md +4 -4
  12. package/bundled/docs/github-pages.md +2 -1
  13. package/bundled/docs/index.md +1 -1
  14. package/bundled/docs/install.md +1 -1
  15. package/bundled/docs/known-gaps.md +1 -1
  16. package/bundled/docs/markdown.md +11 -13
  17. package/bundled/docs/nav.yml +6 -1
  18. package/bundled/docs/netlify.md +4 -2
  19. package/bundled/docs/patrol.md +48 -0
  20. package/bundled/docs/plugins.md +6 -4
  21. package/bundled/docs/robots.md +72 -0
  22. package/bundled/docs/seo.md +2 -38
  23. package/bundled/docs/serving-markdown.md +142 -0
  24. package/bundled/docs/template-languages.md +2 -1
  25. package/bundled/docs/templates.md +2 -1
  26. package/bundled/docs/trailheads/from-component-frameworks.md +9 -10
  27. package/bundled/docs/trailheads/from-hugo.md +5 -3
  28. package/bundled/docs/trailheads/from-jekyll.md +54 -13
  29. package/bundled/docs/trailheads/from-mkdocs.md +15 -12
  30. package/bundled/docs/trailheads/from-vitepress.md +142 -0
  31. package/bundled/docs/trailheads.md +5 -5
  32. package/bundled/docs/where-values-come-from.md +5 -5
  33. package/bundled/docs/writing-plugins.md +69 -0
  34. package/bundled/ssqch.d.ts +150 -34
  35. package/bundled/starter/engines/index.edge +1 -0
  36. package/bundled/starter/engines/index.ejs +1 -0
  37. package/bundled/starter/engines/index.hbs +1 -0
  38. package/bundled/starter/engines/index.liquid +1 -0
  39. package/bundled/starter/engines/layout.edge +7 -0
  40. package/bundled/starter/engines/layout.ejs +4 -0
  41. package/bundled/starter/engines/layout.hbs +4 -0
  42. package/bundled/starter/engines/layout.liquid +4 -0
  43. package/bundled/starter/src/_data/site.json +1 -0
  44. package/bundled/starter/src/_includes/layout.jinja +4 -0
  45. package/bundled/starter/src/index.jinja +1 -0
  46. package/bundled/starter/ssqch.config.js +14 -1
  47. package/bundled/starter-docs/engines/edge/base.edge +7 -0
  48. package/bundled/starter-docs/engines/edge/doc.edge +4 -0
  49. package/bundled/starter-docs/engines/ejs/base.ejs +4 -0
  50. package/bundled/starter-docs/engines/ejs/doc.ejs +4 -0
  51. package/bundled/starter-docs/engines/hbs/base.hbs +4 -0
  52. package/bundled/starter-docs/engines/hbs/doc.hbs +3 -0
  53. package/bundled/starter-docs/engines/liquid/base.liquid +4 -0
  54. package/bundled/starter-docs/engines/liquid/doc.liquid +4 -0
  55. package/bundled/starter-docs/src/_data/site.json +1 -0
  56. package/bundled/starter-docs/src/_includes/base.jinja +4 -0
  57. package/bundled/starter-docs/src/_includes/doc.jinja +4 -0
  58. package/bundled/starter-docs/src/assets/docs.css +4 -0
  59. package/bundled/starter-docs/src/assets/docs.js +17 -0
  60. package/bundled/starter-docs/ssqch.config.js +14 -1
  61. package/lib/assets.js +13 -11
  62. package/lib/chunk-25WERNDD.js +112 -0
  63. package/lib/{chunk-H5K2ZE7B.js → chunk-2BJFGKOE.js} +13 -5
  64. package/lib/chunk-2FKYWYAB.js +268 -0
  65. package/lib/{chunk-LJOURBYT.js → chunk-3ZTRIO6O.js} +21 -19
  66. package/lib/{chunk-IOBC665M.js → chunk-4AZFCSGJ.js} +5 -3
  67. package/lib/{chunk-HWW5NCVJ.js → chunk-4Q6WMTER.js} +1 -1
  68. package/lib/{chunk-V2FSMOFX.js → chunk-55WXDGO4.js} +3 -3
  69. package/lib/{chunk-ZR3JYLFB.js → chunk-6FY77I4M.js} +331 -58
  70. package/lib/{chunk-JC54PHIT.js → chunk-6OUCRDYI.js} +514 -141
  71. package/lib/{chunk-ERAIEV3O.js → chunk-6U5VIQVY.js} +9 -7
  72. package/lib/{chunk-Z5OP43HU.js → chunk-7U5GWTEH.js} +455 -94
  73. package/lib/{chunk-CMJ7X5WW.js → chunk-AIJNG6MJ.js} +3 -2
  74. package/lib/{chunk-3K237XAX.js → chunk-C2Q7JKFI.js} +12 -10
  75. package/lib/{chunk-GS5B3CBW.js → chunk-DDV6JEC2.js} +1 -1
  76. package/lib/{chunk-A75EVUJX.js → chunk-DFJFHULZ.js} +47 -20
  77. package/lib/{chunk-KZZS4W2V.js → chunk-ENWDM2RW.js} +45 -42
  78. package/lib/{chunk-I3HYKEEW.js → chunk-ER72RPD6.js} +3 -3
  79. package/lib/chunk-F3JPNFCZ.js +23 -0
  80. package/lib/{chunk-B5E27PLU.js → chunk-FENJHLNM.js} +6 -3
  81. package/lib/{chunk-UU43WIZG.js → chunk-FJML7INB.js} +4 -2
  82. package/lib/{chunk-KCF2Z6N7.js → chunk-FQZDUDFK.js} +5 -3
  83. package/lib/{chunk-GJNIQAIH.js → chunk-GSNRAGKQ.js} +13 -6
  84. package/lib/{chunk-443ZQLVX.js → chunk-GU7BBYWB.js} +5 -4
  85. package/lib/{chunk-X2GAVYV2.js → chunk-HDKU6LRI.js} +110 -748
  86. package/lib/chunk-J3C2LEW7.js +121 -0
  87. package/lib/{chunk-XS4EJSEK.js → chunk-K5WZ2VYK.js} +7 -5
  88. package/lib/{chunk-3HZZY3Y7.js → chunk-OOKBXQAY.js} +7 -6
  89. package/lib/chunk-P2WS4RM4.js +707 -0
  90. package/lib/{chunk-RBNPBTDP.js → chunk-SNQOHNXE.js} +1 -1
  91. package/lib/{chunk-HFSWUTXX.js → chunk-SPIFZBIW.js} +1 -1
  92. package/lib/{chunk-QLUTNR37.js → chunk-T5IUI7W7.js} +12 -11
  93. package/lib/{chunk-ZINLHOX4.js → chunk-TGSVSG2G.js} +3 -2
  94. package/lib/{chunk-2L3HR67O.js → chunk-U2KEMVXO.js} +24 -16
  95. package/lib/{chunk-RYIWYWRQ.js → chunk-UHRBPZ4A.js} +7 -5
  96. package/lib/{chunk-2QTJTEBV.js → chunk-ULCT3PAV.js} +1 -1
  97. package/lib/{chunk-FCM3NYFR.js → chunk-UZNUS7RP.js} +12 -9
  98. package/lib/{chunk-GLJQ4C76.js → chunk-V3G2QGL3.js} +13 -106
  99. package/lib/{chunk-Z44IAMNG.js → chunk-VILOEVK7.js} +60 -28
  100. package/lib/chunk-VJWQSYEG.js +119 -0
  101. package/lib/{chunk-5ELAUHRL.js → chunk-WGAIE3DD.js} +23 -19
  102. package/lib/{chunk-OQGXZYZS.js → chunk-WUCRAV36.js} +13 -7
  103. package/lib/{chunk-RZYAIX2R.js → chunk-XYAWJTHM.js} +11 -10
  104. package/lib/{chunk-OSBEH67S.js → chunk-YA23NDMW.js} +5 -3
  105. package/lib/{chunk-AIMEXBTK.js → chunk-YNJNMQWU.js} +37 -142
  106. package/lib/{chunk-QJ5ZFTML.js → chunk-ZMG25MXF.js} +20 -18
  107. package/lib/cli.js +72 -35
  108. package/lib/elements.js +13 -11
  109. package/lib/from-hugo.js +36 -0
  110. package/lib/from-jekyll.js +41 -0
  111. package/lib/from-mkdocs.js +49 -0
  112. package/lib/from-vitepress.js +49 -0
  113. package/lib/image.js +12 -11
  114. package/lib/links.js +13 -11
  115. package/lib/llms.js +613 -0
  116. package/lib/minify.js +14 -12
  117. package/lib/redirects.js +13 -11
  118. package/lib/robots.js +87 -0
  119. package/lib/rss.js +24 -13
  120. package/lib/sass.js +12 -11
  121. package/lib/sitemap.js +23 -18
  122. package/lib/ssqch.js +6 -5
  123. package/lib/vue.js +400 -0
  124. package/package.json +29 -1
  125. package/types/from-hugo.d.ts +5 -0
  126. package/types/from-jekyll.d.ts +11 -0
  127. package/types/from-mkdocs.d.ts +11 -0
  128. package/types/from-vitepress.d.ts +5 -0
  129. package/types/index.d.ts +51 -31
  130. package/types/llms.d.ts +27 -0
  131. package/types/robots.d.ts +13 -0
  132. package/types/sass.d.ts +1 -1
  133. package/types/sitemap.d.ts +2 -2
  134. package/types/vue.d.ts +17 -0
  135. package/wasm/markdown.wasm +0 -0
  136. package/lib/chunk-RVXGUMFI.js +0 -21
  137. /package/lib/{chunk-ZR3JYLFB.js.LEGAL.txt → chunk-6FY77I4M.js.LEGAL.txt} +0 -0
  138. /package/lib/{chunk-AIMEXBTK.js.LEGAL.txt → chunk-YNJNMQWU.js.LEGAL.txt} +0 -0
@@ -0,0 +1,268 @@
1
+ import { createRequire as __ssqchCreateRequire } from "node:module";
2
+ const require = __ssqchCreateRequire(import.meta.url);
3
+ import {
4
+ htmlText
5
+ } from "./chunk-25WERNDD.js";
6
+ import {
7
+ count
8
+ } from "./chunk-6U5VIQVY.js";
9
+ import "./chunk-DDV6JEC2.js";
10
+ import {
11
+ markdown
12
+ } from "./chunk-6OUCRDYI.js";
13
+ import "./chunk-SPIFZBIW.js";
14
+ import "./chunk-FVZ5JBRI.js";
15
+ import "./chunk-FJML7INB.js";
16
+ import "./chunk-4AZFCSGJ.js";
17
+ import "./chunk-CMUWRPSQ.js";
18
+ import {
19
+ bail
20
+ } from "./chunk-YNJNMQWU.js";
21
+ import {
22
+ compareText
23
+ } from "./chunk-VJWQSYEG.js";
24
+ import "./chunk-I3PS26CI.js";
25
+
26
+ // src/patrol.ts
27
+ import fs from "node:fs";
28
+ import path from "node:path";
29
+ var LLMS_LIMIT = 5e4;
30
+ var COPY_LONG = 5e4;
31
+ var COPY_CUT = 1e5;
32
+ var walk = (dir, rel = "") => fs.readdirSync(path.join(dir, rel), { withFileTypes: true }).flatMap((e) => {
33
+ const r = rel ? `${rel}/${e.name}` : e.name;
34
+ return e.isDirectory() ? walk(dir, r) : e.isFile() ? [r] : [];
35
+ }).sort(compareText);
36
+ var urlOf = (file) => `/${file.replace(/(^|\/)index\.html?$/, "$1")}`;
37
+ var textOf = (html) => htmlText(html.replace(/<(script|style|svg|template|noscript)\b[\s\S]*?<\/\1\s*>/gi, " "));
38
+ function part(html, name) {
39
+ const open = new RegExp(`<${name}\\b[^>]*>`, "i").exec(html);
40
+ if (!open) return void 0;
41
+ const close = html.toLowerCase().lastIndexOf(`</${name}`);
42
+ return close > open.index ? { start: open.index, html: html.slice(open.index + open[0].length, close) } : void 0;
43
+ }
44
+ var words = (text) => text.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter((w) => w.length > 1);
45
+ function covered(a, b) {
46
+ if (!a.length) return 1;
47
+ const have = /* @__PURE__ */ new Map();
48
+ for (const w of b) have.set(w, (have.get(w) ?? 0) + 1);
49
+ let hits = 0;
50
+ for (const w of a) {
51
+ const n = have.get(w) ?? 0;
52
+ if (n > 0) {
53
+ hits++;
54
+ have.set(w, n - 1);
55
+ }
56
+ }
57
+ return hits / a.length;
58
+ }
59
+ function linksIn(md) {
60
+ const out = [];
61
+ let fence;
62
+ for (const line of md.split("\n")) {
63
+ const marker = /^\s{0,3}(`{3,}|~{3,})/.exec(line)?.[1];
64
+ if (fence !== void 0) {
65
+ if (marker && marker[0] === fence[0] && marker.length >= fence.length && line.trim() === marker) fence = void 0;
66
+ continue;
67
+ }
68
+ if (marker) {
69
+ fence = marker;
70
+ continue;
71
+ }
72
+ const ref = /^ {0,3}\[[^\]]+\]:\s*<?([^\s>]+)/.exec(line);
73
+ if (ref) out.push(ref[1]);
74
+ for (const m of line.replace(/`+[^`]*`+/g, "").matchAll(/\]\(\s*<?([^\s)>]+)/g)) out.push(m[1]);
75
+ }
76
+ return out;
77
+ }
78
+ function prose(md) {
79
+ let fence;
80
+ return md.split("\n").filter((line) => {
81
+ const marker = /^\s{0,3}(`{3,}|~{3,})/.exec(line)?.[1];
82
+ if (fence !== void 0) {
83
+ if (marker && marker[0] === fence[0] && marker.length >= fence.length && line.trim() === marker) fence = void 0;
84
+ return false;
85
+ }
86
+ if (marker) {
87
+ fence = marker;
88
+ return false;
89
+ }
90
+ return true;
91
+ }).map((line) => line.replace(/`+[^`]*`+/g, "")).join("\n");
92
+ }
93
+ function fencesClose(md) {
94
+ let fence;
95
+ for (const line of md.split("\n")) {
96
+ const marker = /^\s{0,3}(`{3,}|~{3,})/.exec(line)?.[1];
97
+ if (fence === void 0) {
98
+ if (marker) fence = marker;
99
+ } else if (marker && marker[0] === fence[0] && marker.length >= fence.length && line.trim() === marker) fence = void 0;
100
+ }
101
+ return fence === void 0;
102
+ }
103
+ var relative = (href) => !/^[A-Za-z][A-Za-z0-9+.-]*:/.test(href) && !href.startsWith("#") && !href.startsWith("/");
104
+ function patrol(dir) {
105
+ let stat;
106
+ try {
107
+ stat = fs.statSync(dir);
108
+ } catch {
109
+ bail(`${dir} isn't there: build the site first (\`ssqch build\`), or name a build folder`);
110
+ }
111
+ if (!stat.isDirectory()) bail(`${dir} is a file, not a build folder`);
112
+ const files = walk(dir);
113
+ const has = new Set(files);
114
+ const read = (file) => fs.readFileSync(path.join(dir, file), "utf8");
115
+ const found = /* @__PURE__ */ new Map();
116
+ const say = (code, message, file) => {
117
+ const f = found.get(code) ?? { code, message, files: [] };
118
+ if (file !== void 0) f.files.push(file);
119
+ found.set(code, f);
120
+ };
121
+ const pages = files.filter((f) => /\.html?$/i.test(f) && !/(^|\/)404\.html?$/i.test(f));
122
+ const robots = has.has("robots.txt") ? read("robots.txt") : void 0;
123
+ const sitemapFile = has.has("sitemap.xml") ? "sitemap.xml" : void 0;
124
+ const sitemapLine = robots && /^\s*sitemap:\s*(\S+)/im.exec(robots)?.[1];
125
+ const sitemap = sitemapFile ? read(sitemapFile) : void 0;
126
+ const locs = sitemap ? [...sitemap.matchAll(/<loc>\s*([^<\s]+)\s*<\/loc>/g)].map((m) => m[1].replace(/&amp;/g, "&")) : [];
127
+ const origins = /* @__PURE__ */ new Set();
128
+ for (const u of [sitemapLine, ...locs.slice(0, 1)]) {
129
+ try {
130
+ if (u) origins.add(new URL(u).origin);
131
+ } catch {
132
+ }
133
+ }
134
+ const fileOf = (href) => {
135
+ let p;
136
+ if (href.startsWith("/") && !href.startsWith("//")) p = href;
137
+ else {
138
+ try {
139
+ const u = new URL(href);
140
+ if (!origins.has(u.origin)) return void 0;
141
+ p = u.pathname;
142
+ } catch {
143
+ return void 0;
144
+ }
145
+ }
146
+ p = decodeURIComponent(p.replace(/[?#].*$/, "")).replace(/^\/+/, "");
147
+ if (has.has(p)) return p;
148
+ if (has.has(`${p.replace(/\/$/, "")}/index.html`.replace(/^\//, ""))) return `${p.replace(/\/$/, "")}/index.html`.replace(/^\//, "");
149
+ return "";
150
+ };
151
+ if (!robots) say("no-robots", "no robots.txt: crawlers find no sitemap line and no rules for AI crawlers (robotsPlugin() writes one)");
152
+ if (!sitemapFile && !sitemapLine) say("no-sitemap", "no sitemap.xml, and robots.txt names none (sitemapPlugin({ url }) writes one)");
153
+ if (!has.has("404.html")) say("no-404", "no 404.html: a missing page gets the host's error page, or worse, a 200");
154
+ else if (has.has("index.html") && read("404.html") === read("index.html")) say("no-404", "404.html is the home page: a missing page should say it's missing");
155
+ const llms = has.has("llms.txt") ? read("llms.txt") : void 0;
156
+ const listed = /* @__PURE__ */ new Set();
157
+ if (llms === void 0) say("no-llms", "no llms.txt: an agent gets no map of the site (llmsPlugin() writes one, with a Markdown copy of each page)");
158
+ else {
159
+ if (!/^?# \S/.test(llms)) say("llms-shape", "llms.txt doesn't start with a `# ` heading (the site's name), which llmstxt.org's format requires", "llms.txt");
160
+ if (llms.length > LLMS_LIMIT) say("llms-long", `llms.txt is ${count(llms.length)} characters, over ${count(LLMS_LIMIT)}: more than an agent reads before deciding where to go (link section files from it instead)`, "llms.txt");
161
+ for (const href of linksIn(llms)) {
162
+ if (relative(href)) {
163
+ say("relative-links", "links that aren't whole addresses (or from the site's root): they break once the text is read on its own", "llms.txt");
164
+ continue;
165
+ }
166
+ const file = fileOf(href);
167
+ if (file === void 0) continue;
168
+ if (file === "") say("llms-broken", `llms.txt links to files that aren't in the build`, href);
169
+ else {
170
+ if (!/\.(md|markdown|txt)$/i.test(file)) say("llms-html", "llms.txt links to pages, not their Markdown: an agent reads Markdown without the page's chrome", href);
171
+ listed.add(file);
172
+ }
173
+ }
174
+ }
175
+ let copies = 0;
176
+ const pageUrls = [];
177
+ for (const file of pages) {
178
+ const html = read(file);
179
+ if (/<meta\s[^>]*http-equiv=["']?refresh/i.test(html)) continue;
180
+ pageUrls.push(urlOf(file));
181
+ const h1 = (html.match(/<h1[\s>]/gi) ?? []).length;
182
+ if (h1 === 0) say("no-h1", "pages with no <h1>: an agent takes the first heading as what the page is about", file);
183
+ else if (h1 > 1) say("h1s", "pages with more than one <h1>", file);
184
+ if (!/<meta\s[^>]*name=["']?description["']?[^>]*content=["']?[^"'\s>]/i.test(html) && !/<meta\s[^>]*content=["']?[^"'>]+["']?[^>]*name=["']?description/i.test(html)) say("no-description", 'pages with no <meta name="description">: what search results and agents show for a link', file);
185
+ const body = part(html, "body")?.html ?? html;
186
+ const content = part(body, "main") ?? part(body, "article");
187
+ if (!content) say("no-main", "pages with their content in neither <main> nor <article>: an agent can't tell the page from its navigation", file);
188
+ else {
189
+ const before = words(textOf(body.slice(0, content.start))).length;
190
+ const all = words(textOf(body)).length;
191
+ if (all > 0 && before / all > 0.5) say("content-late", "pages whose <main> comes after most of their text (navigation first): an agent with a short read sees the menus", file);
192
+ }
193
+ const linked = /<link\s[^>]*rel=["']?alternate["']?[^>]*type=["']?text\/markdown["']?[^>]*>/i.exec(html)?.[0] ?? /<link\s[^>]*type=["']?text\/markdown["']?[^>]*rel=["']?alternate["']?[^>]*>/i.exec(html)?.[0];
194
+ const href = linked ? /href=["']?([^"'\s>]+)/i.exec(linked)?.[1] : void 0;
195
+ let copy;
196
+ if (href !== void 0) {
197
+ const target = fileOf(href.startsWith("/") || /^[a-z]+:/i.test(href) ? href : `/${path.posix.join(path.posix.dirname(file), href)}`);
198
+ if (target === "") {
199
+ say("copy-missing", "pages that link a Markdown copy that isn't in the build", file);
200
+ continue;
201
+ }
202
+ copy = target;
203
+ } else {
204
+ const guess = file.replace(/\.html?$/i, ".md");
205
+ if (has.has(guess)) copy = guess;
206
+ }
207
+ if (!copy) continue;
208
+ copies++;
209
+ const md = read(copy);
210
+ if (md.length > COPY_CUT) say("copy-cut-off", `Markdown copies over ${count(COPY_CUT)} characters, where Claude Code's fetch stops reading`, copy);
211
+ else if (md.length > COPY_LONG) say("copy-long", `Markdown copies over ${count(COPY_LONG)} characters: long for one fetch`, copy);
212
+ if (!fencesClose(md)) say("copy-fence", "Markdown copies with a code fence that never closes: the rest reads as code", copy);
213
+ if (linksIn(md).some(relative)) say("relative-links", "links that aren't whole addresses (or from the site's root): they break once the text is read on its own", copy);
214
+ if ([...linksIn(md), ...[...prose(md).matchAll(/<(?:img|a|source)\b[^>]*\s(?:src|href)\s*=\s*["']([^"']+)["']/gi)].map((m) => m[1])].some((href2) => !relative(href2) && fileOf(href2) === "")) say("copy-broken", "Markdown copies that link the site's own files that aren't in the build (an image's source path, say)", copy);
215
+ if (content) {
216
+ const page = words(textOf(content.html));
217
+ const own = words(textOf(markdown(md)));
218
+ if (page.length >= 20 && (covered(own, page) < 0.8 || covered(page, own) < 0.5)) say("copy-differs", "Markdown copies that don't say what their page says (under 80% of the copy's words on the page, or under half the page's in the copy)", copy);
219
+ }
220
+ }
221
+ if (llms !== void 0 && locs.length && listed.size) {
222
+ const copyFor = (file) => file.replace(/\.html?$/i, ".md");
223
+ const inList = locs.filter((loc) => {
224
+ const file = fileOf(loc);
225
+ return !file || listed.has(file) || listed.has(copyFor(file));
226
+ }).length;
227
+ if (inList / locs.length < 0.95) say("llms-coverage", `llms.txt lists ${count(inList)} of the sitemap's ${count(locs.length)} pages: under 95%, so an agent misses some (llmsPlugin() lists them all)`, "llms.txt");
228
+ }
229
+ return {
230
+ pages: pageUrls.length,
231
+ signs: { robots: robots !== void 0, sitemap: sitemapFile !== void 0 || Boolean(sitemapLine), llms: llms !== void 0, notFound: has.has("404.html") },
232
+ copies,
233
+ findings: [...found.values()].map((f) => ({ ...f, files: [...new Set(f.files)] }))
234
+ };
235
+ }
236
+ function patrolText(p, shown) {
237
+ const sign = (name, there) => `${name} ${there ? "posted" : "missing"}`;
238
+ let out = `Patrol of ${shown}: ${p.pages} page${p.pages === 1 ? "" : "s"}, ${p.copies} with a Markdown copy
239
+ `;
240
+ out += ` ${[sign("robots.txt", p.signs.robots), sign("sitemap", p.signs.sitemap), sign("llms.txt", p.signs.llms), sign("404.html", p.signs.notFound)].join(", ")}
241
+ `;
242
+ if (!p.findings.length) return `${out}
243
+ All clear: nothing on the trail for an agent to trip on.
244
+ `;
245
+ out += "\n";
246
+ for (const f of p.findings) {
247
+ const n = f.files.length;
248
+ out += `warn[${f.code}]: ${f.message}${n > 1 ? ` (${n})` : ""}
249
+ `;
250
+ for (const file of f.files.slice(0, 5)) out += ` ${file}
251
+ `;
252
+ if (n > 5) out += ` and ${n - 5} more (--format json lists them all)
253
+ `;
254
+ }
255
+ const files = new Set(p.findings.flatMap((f) => f.files)).size;
256
+ out += `
257
+ ${p.findings.length} kind${p.findings.length === 1 ? "" : "s"} of warning${files ? ` in ${files} file${files === 1 ? "" : "s"}` : ""}. \`ssqch docs "what patrol checks"\` says what each code means.
258
+ `;
259
+ return out;
260
+ }
261
+ function patrolJson(p, output) {
262
+ return { schemaVersion: 1, output, pages: p.pages, copies: p.copies, signs: p.signs, warnings: p.findings.map((f) => ({ code: f.code, message: f.message, files: f.files })) };
263
+ }
264
+ export {
265
+ patrol,
266
+ patrolJson,
267
+ patrolText
268
+ };
@@ -2,26 +2,28 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  OUTPUT_LIST
5
- } from "./chunk-ZR3JYLFB.js";
6
- import "./chunk-OSBEH67S.js";
7
- import "./chunk-HWW5NCVJ.js";
8
- import "./chunk-GLJQ4C76.js";
9
- import "./chunk-RYIWYWRQ.js";
10
- import "./chunk-Z44IAMNG.js";
11
- import "./chunk-2QTJTEBV.js";
5
+ } from "./chunk-6FY77I4M.js";
6
+ import "./chunk-YA23NDMW.js";
7
+ import "./chunk-V3G2QGL3.js";
8
+ import "./chunk-4Q6WMTER.js";
9
+ import "./chunk-UHRBPZ4A.js";
10
+ import "./chunk-25WERNDD.js";
11
+ import "./chunk-VILOEVK7.js";
12
+ import "./chunk-ULCT3PAV.js";
12
13
  import {
13
14
  count
14
- } from "./chunk-ERAIEV3O.js";
15
+ } from "./chunk-6U5VIQVY.js";
15
16
  import "./chunk-AD3HAW3W.js";
16
17
  import "./chunk-YCOTX2VM.js";
17
- import "./chunk-GS5B3CBW.js";
18
- import "./chunk-JC54PHIT.js";
19
- import "./chunk-HFSWUTXX.js";
18
+ import "./chunk-DDV6JEC2.js";
19
+ import "./chunk-6OUCRDYI.js";
20
+ import "./chunk-SPIFZBIW.js";
20
21
  import "./chunk-FVZ5JBRI.js";
21
- import "./chunk-UU43WIZG.js";
22
- import "./chunk-IOBC665M.js";
22
+ import "./chunk-FJML7INB.js";
23
+ import "./chunk-4AZFCSGJ.js";
23
24
  import "./chunk-CMUWRPSQ.js";
24
- import "./chunk-AIMEXBTK.js";
25
+ import "./chunk-YNJNMQWU.js";
26
+ import "./chunk-VJWQSYEG.js";
25
27
  import "./chunk-I3PS26CI.js";
26
28
 
27
29
  // src/commands/sighting.ts
@@ -37,8 +39,8 @@ var PHOTO = `
37
39
  || || / \\ ||
38
40
  || || / \\ ||
39
41
  `;
40
- function lastSiting(root, now) {
41
- const none = "No confirmed sitings here yet. `ssqch build` would be the first.";
42
+ function lastSighting(root, now) {
43
+ const none = "No confirmed sightings here yet. `ssqch build` would be the first.";
42
44
  let list;
43
45
  try {
44
46
  list = JSON.parse(fs.readFileSync(path.join(root, OUTPUT_LIST), "utf8")) ?? {};
@@ -60,17 +62,17 @@ function lastSiting(root, now) {
60
62
  const minutes = Math.max(0, Math.floor((now - newest) / 6e4));
61
63
  const unit = (n, name) => `${n} ${name}${n === 1 ? "" : "s"} ago`;
62
64
  const ago = minutes === 0 ? "just now" : minutes < 60 ? unit(minutes, "minute") : minutes < 1440 ? unit(Math.floor(minutes / 60), "hour") : unit(Math.floor(minutes / 1440), "day");
63
- return `Last confirmed siting: ${count(pages.length)} page${pages.length === 1 ? "" : "s"} in ${output}/, ${ago}.`;
65
+ return `Last confirmed sighting: ${count(pages.length)} page${pages.length === 1 ? "" : "s"} in ${output}/, ${ago}.`;
64
66
  }
65
67
  function runSighting(root) {
66
68
  process.stdout.write(`${PHOTO}
67
69
  Image quality meets cryptozoological standards.
68
70
 
69
- ${lastSiting(root, Date.now())}
71
+ ${lastSighting(root, Date.now())}
70
72
  `);
71
73
  return 0;
72
74
  }
73
75
  export {
74
- lastSiting,
76
+ lastSighting,
75
77
  runSighting
76
78
  };
@@ -1,9 +1,11 @@
1
1
  import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
- BuildError,
4
+ BuildError
5
+ } from "./chunk-YNJNMQWU.js";
6
+ import {
5
7
  realPath
6
- } from "./chunk-AIMEXBTK.js";
8
+ } from "./chunk-VJWQSYEG.js";
7
9
 
8
10
  // src/modules.ts
9
11
  import fs from "node:fs";
@@ -13,7 +15,7 @@ import os from "node:os";
13
15
  import { registerHooks } from "node:module";
14
16
  import { fileURLToPath, pathToFileURL } from "node:url";
15
17
  var SELF = path.dirname(path.dirname(fileURLToPath(new URL("../src/modules.ts", import.meta.url).href)));
16
- var BUILT_IN = ["ssqch/image", "ssqch/rss", "ssqch/assets", "ssqch/links", "ssqch/sitemap", "ssqch/redirects", "ssqch/sass", "ssqch/elements", "ssqch/minify"];
18
+ var BUILT_IN = ["ssqch/image", "ssqch/rss", "ssqch/assets", "ssqch/links", "ssqch/sitemap", "ssqch/redirects", "ssqch/sass", "ssqch/elements", "ssqch/minify", "ssqch/llms", "ssqch/vue", "ssqch/robots", "ssqch/from-vitepress", "ssqch/from-mkdocs", "ssqch/from-jekyll", "ssqch/from-hugo"];
17
19
  var COMPILED = fs.existsSync(path.join(SELF, "lib", "ssqch.js"));
18
20
  var API = COMPILED ? pathToFileURL(path.join(SELF, "lib", "ssqch.js")).href : new URL("./exports/ssqch.ts", new URL("../src/modules.ts", import.meta.url).href).href;
19
21
  var builtInUrl = (specifier) => COMPILED ? pathToFileURL(path.join(SELF, "lib", `${specifier.slice(6)}.js`)) : new URL(`./exports/${specifier.slice(6)}.ts`, new URL("../src/modules.ts", import.meta.url).href);
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  isDir
5
- } from "./chunk-AIMEXBTK.js";
5
+ } from "./chunk-VJWQSYEG.js";
6
6
 
7
7
  // src/command-line.ts
8
8
  import os from "node:os";
@@ -2,7 +2,7 @@ import { createRequire as __ssqchCreateRequire } from "node:module";
2
2
  const require = __ssqchCreateRequire(import.meta.url);
3
3
  import {
4
4
  Options
5
- } from "./chunk-RBNPBTDP.js";
5
+ } from "./chunk-SNQOHNXE.js";
6
6
  import {
7
7
  BUILTINS,
8
8
  addImagePlugin,
@@ -11,10 +11,10 @@ import {
11
11
  imageOptionsFor,
12
12
  meant,
13
13
  parseFormat
14
- } from "./chunk-Z44IAMNG.js";
14
+ } from "./chunk-VILOEVK7.js";
15
15
  import {
16
16
  bail
17
- } from "./chunk-AIMEXBTK.js";
17
+ } from "./chunk-YNJNMQWU.js";
18
18
 
19
19
  // src/modules/image.ts
20
20
  import fs from "node:fs";