@thecms/cli 0.20.1-dev.126 → 0.20.2-dev.128
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/dist/{chunk-CI6BYK5Z.js → chunk-3XYLUUS6.js} +34 -2
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -175,7 +175,7 @@ function realContext(env = process.env) {
|
|
|
175
175
|
import { parseArgs } from "util";
|
|
176
176
|
|
|
177
177
|
// src/context.ts
|
|
178
|
-
var CLI_VERSION = "0.20.
|
|
178
|
+
var CLI_VERSION = "0.20.2-dev.128";
|
|
179
179
|
function call(ctx, path, init = {}) {
|
|
180
180
|
const { token, client = "cli", ...rest } = init;
|
|
181
181
|
const headers = new Headers(rest.headers);
|
|
@@ -9298,13 +9298,45 @@ async function verifyOne(ctx, only, ref, render, siteBase) {
|
|
|
9298
9298
|
];
|
|
9299
9299
|
const before2 = problems;
|
|
9300
9300
|
let silent = false;
|
|
9301
|
+
const platform = await res.text();
|
|
9302
|
+
const titleOf2 = (text2) => text2.split("\n").find((l) => l.startsWith("# "))?.trim() ?? "";
|
|
9303
|
+
let another = false;
|
|
9301
9304
|
for (const [url, how] of routes) {
|
|
9302
9305
|
const answer2 = await ctx.fetch(url, { headers: { Accept: "text/plain, text/markdown" }, redirect: "manual" }).catch(() => null);
|
|
9303
9306
|
if (!answer2) {
|
|
9304
9307
|
silent = true;
|
|
9305
9308
|
continue;
|
|
9306
9309
|
}
|
|
9307
|
-
if (!answer2.ok)
|
|
9310
|
+
if (!answer2.ok) {
|
|
9311
|
+
problem2(`AI readers are on but the site's ${url} answers ${answer2.status}: ${how}`);
|
|
9312
|
+
continue;
|
|
9313
|
+
}
|
|
9314
|
+
if (url.endsWith("/llms.txt")) {
|
|
9315
|
+
const theirs = titleOf2(await answer2.text());
|
|
9316
|
+
if (theirs !== titleOf2(platform)) {
|
|
9317
|
+
another = true;
|
|
9318
|
+
problem2(`Another site answers at ${base}: its llms.txt is "${theirs.slice(2) || "not a theCMS. one"}", this workspace's "${titleOf2(platform).slice(2)}" \u2014 start this site there, or check its address: thecms verify --site-url <its address>`);
|
|
9319
|
+
break;
|
|
9320
|
+
}
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9323
|
+
if (!silent && !another && problems === before2) {
|
|
9324
|
+
const links = [...platform.matchAll(/\]\((https?:\/\/[^)\s]+)\)/g)].map((m) => {
|
|
9325
|
+
try {
|
|
9326
|
+
const u = new URL(m[1]);
|
|
9327
|
+
return u.pathname === "/llms" || u.pathname.startsWith("/llms/") ? `${base}${u.pathname}` : null;
|
|
9328
|
+
} catch {
|
|
9329
|
+
return null;
|
|
9330
|
+
}
|
|
9331
|
+
}).filter((u) => !!u);
|
|
9332
|
+
const failed = [];
|
|
9333
|
+
for (let i = 0; i < links.length; i += 8) {
|
|
9334
|
+
await Promise.all(links.slice(i, i + 8).map(async (url) => {
|
|
9335
|
+
const answer2 = await ctx.fetch(url, { headers: { Accept: "text/plain, text/markdown" }, redirect: "manual" }).catch(() => null);
|
|
9336
|
+
if (!answer2?.ok) failed.push(`${url} (${answer2 ? answer2.status : "no answer"}${answer2?.headers.get("x-cms-text") ? `: ${answer2.headers.get("x-cms-text")}` : ""})`);
|
|
9337
|
+
}));
|
|
9338
|
+
}
|
|
9339
|
+
if (failed.length) problem2(`AI readers are on but ${failed.length} of the ${links.length} pages llms.txt lists have no text: ${failed.slice(0, 5).join(", ")}${failed.length > 5 ? ", \u2026" : ""}`);
|
|
9308
9340
|
}
|
|
9309
9341
|
if (problems > before2 && !siteBase) note(`Not online at ${base} yet? Check the started build: thecms verify --site-url <its address>`);
|
|
9310
9342
|
if (silent) note(`The site does not answer at ${base}: its addresses for AI readers (/llms.txt, /llms) are checked once it is online`);
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecms/cli",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2-dev.128",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "theCMS. command line: the standard's starter, checks, brand, the method's docs, sign-in with a personal token",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
38
38
|
"@resvg/resvg-wasm": "2.6.2",
|
|
39
|
-
"@thecms/sdk": "0.20.
|
|
39
|
+
"@thecms/sdk": "0.20.2-dev.128",
|
|
40
40
|
"libpg-query": "18.2.0",
|
|
41
41
|
"zod": "4.6.5"
|
|
42
42
|
},
|