rebilder 0.3.0 → 0.4.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.
- package/CHANGELOG.md +8 -0
- package/README.md +17 -14
- package/dist/bin.js +49 -14
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.js +49 -14
- package/dist/index.js.map +1 -1
- package/package.json +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ Notable changes to the `rebilder` command-line tool. Exit codes are a stable con
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.4.0 (2026-10-06)
|
|
8
|
+
|
|
9
|
+
- **Scores against ARS 0.3.** Weights and check ids are unchanged. When a page does not send a Markdown copy but links one on the same site, `check` fetches that one copy. A copy that loads earns 6 of the Markdown check's 9 points. More action words count as a page's main action, such as "shop", "free trial", "get a demo" and "talk to sales". Evidence lines and fixes are written in plain language.
|
|
10
|
+
- When a page's linked Markdown copy works, **Your next steps** says so and shows how to earn the rest: send the copy from the page address too. `diff` says when its parity check compared the linked copy rather than the two requests.
|
|
11
|
+
- `rebilder init` gives the Markdown check its real weight, 9 points. It said 10.
|
|
12
|
+
- The probe budget allows seven requests per URL instead of six, so a multi-URL run has room for linked copies.
|
|
13
|
+
- The source code is public at https://github.com/rebilder/rebilder/tree/main/packages/cli. `repository` and `bugs` point there, and issues and pull requests are welcome.
|
|
14
|
+
|
|
7
15
|
## 0.3.0 (2026-09-28)
|
|
8
16
|
|
|
9
17
|
- **Requires Node.js 22 or later.** `engines.node` moves from `>=20.11.0` to `>=22`; Node.js 20 reached end of life in April 2026.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Help AI assistants understand the business information on your website.
|
|
|
4
4
|
|
|
5
5
|
`rebilder check <url>` fetches a page the way an agent would, fetches it again
|
|
6
6
|
the way a browser would, and scores the result against
|
|
7
|
-
[the Rebilder Agent Readability Spec (ARS 0.
|
|
7
|
+
[the Rebilder Agent Readability Spec (ARS 0.3)](https://rebilder.com/spec/ars). It tells
|
|
8
8
|
you what a machine caller actually receives from your site, what that costs in
|
|
9
9
|
bytes, and which of the 22 checks you are losing points on.
|
|
10
10
|
|
|
@@ -103,9 +103,11 @@ esac
|
|
|
103
103
|
|
|
104
104
|
Per URL it makes **two requests**, an agent probe and a browser control that
|
|
105
105
|
differ in the `Accept` header **and in nothing else**, plus `/robots.txt`,
|
|
106
|
-
`/llms.txt` and `/.well-known/ucp` per origin.
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
`/llms.txt` and `/.well-known/ucp` per origin. When the page does not send a
|
|
107
|
+
Markdown copy but links one on the same site, it fetches that one copy too. A
|
|
108
|
+
copy that loads earns part of the Markdown check. Nothing else is requested;
|
|
109
|
+
there is no guessing at `/sitemap.xml` or `/mcp`. `robots.txt` is fetched first
|
|
110
|
+
and obeyed.
|
|
109
111
|
|
|
110
112
|
Same User-Agent on both probes, because that is what makes the parity check
|
|
111
113
|
meaningful and what stops a correctly installed gateway (which negotiates on
|
|
@@ -186,7 +188,7 @@ Fixes, most points first
|
|
|
186
188
|
A caller that reads the first few kilobytes should already have the fac…
|
|
187
189
|
|
|
188
190
|
Policy: robots.txt ok · assistant allow · training allow (neutral) · sitemap declared
|
|
189
|
-
ARS 0.
|
|
191
|
+
ARS 0.3.0 · ruleset 1d07a1223b34 · corpus e88662472394 · evidence b774a1e59433 · vantage public
|
|
190
192
|
|
|
191
193
|
ARS measures format and retrievability. It does not measure whether the
|
|
192
194
|
facts are true, or whether any assistant cites this page.
|
|
@@ -258,7 +260,7 @@ Fixes, most points first
|
|
|
258
260
|
Price, sizes, weights, hours, fees, lead times, dates — written out whe…
|
|
259
261
|
|
|
260
262
|
Policy: robots.txt ok · assistant allow · training allow (neutral) · sitemap declared
|
|
261
|
-
ARS 0.
|
|
263
|
+
ARS 0.3.0 · ruleset 1d07a1223b34 · corpus e88662472394 · evidence 1fe68289a133 · vantage public
|
|
262
264
|
|
|
263
265
|
ARS measures format and retrievability. It does not measure whether the
|
|
264
266
|
facts are true, or whether any assistant cites this page.
|
|
@@ -306,11 +308,11 @@ Error — —
|
|
|
306
308
|
|
|
307
309
|
Substance parity [heuristic] 3/3
|
|
308
310
|
Compared on price, currency, availability and title only — never description or free text (§3.8).
|
|
309
|
-
•
|
|
310
|
-
• Values:
|
|
311
|
+
• Facts compared: price, currency, availability, name or title [heuristic]
|
|
312
|
+
• Values: match [heuristic]
|
|
311
313
|
|
|
312
314
|
Score: 93/100 A
|
|
313
|
-
ARS 0.
|
|
315
|
+
ARS 0.3.0 · ruleset 1d07a1223b34 · corpus e88662472394 · evidence 1fe68289a133 · vantage public
|
|
314
316
|
|
|
315
317
|
ARS measures format and retrievability. It does not measure whether the
|
|
316
318
|
facts are true, or whether any assistant cites this page.
|
|
@@ -340,10 +342,10 @@ page we never scored is an `<error>`.
|
|
|
340
342
|
<property name="notice" value="ARS measures format and retrievability. It does not measure whether the facts are true, or whether any assistant cites this page."/>
|
|
341
343
|
<property name="url" value="https://basecamp-supply.example/products/alpine-trail-pack-28l"/>
|
|
342
344
|
<property name="generatedAt" value="2026-08-05T00:00:00.000Z"/>
|
|
343
|
-
<property name="tool" value="rebilder 0.
|
|
344
|
-
<property name="specVersion" value="0.
|
|
345
|
-
<property name="rulesetHash" value="
|
|
346
|
-
<property name="corpusHash" value="
|
|
345
|
+
<property name="tool" value="rebilder 0.4.0"/>
|
|
346
|
+
<property name="specVersion" value="0.3.0"/>
|
|
347
|
+
<property name="rulesetHash" value="1d07a1223b3460c3b4d37669c0970d67e9f7e60f121d861201e73dafc9b544b0"/>
|
|
348
|
+
<property name="corpusHash" value="e88662472394316deb404ff02cde136b26a08a54439c52dcd299d80bc8fd9f9e"/>
|
|
347
349
|
<property name="evidenceHash" value="e1cc1ad1476117e7335e4b608e80b4a6e1e0072ce532dd6c9b5f4cce0b2f8b19"/>
|
|
348
350
|
<property name="measuredWeight" value="63"/>
|
|
349
351
|
<property name="heuristicWeight" value="37"/>
|
|
@@ -454,7 +456,7 @@ variable, and never inherited.
|
|
|
454
456
|
|
|
455
457
|
Hand-rolled ANSI (off when stdout is not a TTY, off whenever `NO_COLOR` is set,
|
|
456
458
|
on with `FORCE_COLOR`), Unicode box drawing with an ASCII fallback chosen by the
|
|
457
|
-
locale, and `node:util`'s `parseArgs`. Node ≥
|
|
459
|
+
locale, and `node:util`'s `parseArgs`. Node ≥ 22.
|
|
458
460
|
|
|
459
461
|
Colour and Unicode are decided separately because they fail in different places:
|
|
460
462
|
a pipe into a file is perfectly capable of holding `│`, and a `LANG=C` container
|
|
@@ -577,3 +579,4 @@ one command that has to be memorable.
|
|
|
577
579
|
middleware `rebilder init` scaffolds
|
|
578
580
|
- [The Rebilder Agent Readability Spec (ARS)](https://rebilder.com/spec/ars)
|
|
579
581
|
- [Our crawler policy and opt-out](https://rebilder.com/bots)
|
|
582
|
+
- [Source, issues and pull requests](https://github.com/rebilder/rebilder/tree/main/packages/cli) on GitHub
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from 'util';
|
|
3
|
-
import { score } from '@rebilder/agent-readability';
|
|
3
|
+
import { DEFAULT_RULESET, score } from '@rebilder/agent-readability';
|
|
4
4
|
import { readFile, writeFile } from 'fs/promises';
|
|
5
5
|
import { resolve } from 'path';
|
|
6
6
|
import { createLimiter, strictPolicy, probeStrict } from '@rebilder/agent-readability/probe';
|
|
@@ -334,8 +334,6 @@ function approxTokensOf(capture) {
|
|
|
334
334
|
const characters = capture.body?.length ?? capture.bytes;
|
|
335
335
|
return Math.round(characters / 4);
|
|
336
336
|
}
|
|
337
|
-
|
|
338
|
-
// src/commands/init.ts
|
|
339
337
|
var FRAMEWORKS = [
|
|
340
338
|
"next",
|
|
341
339
|
"node",
|
|
@@ -470,7 +468,7 @@ async function runInit(command, runtime2) {
|
|
|
470
468
|
var SHARED_NOTES = [
|
|
471
469
|
"The resolvers return your source of truth. Every substantive value \u2014 price, stock, hours, policy text \u2014 comes from these fields; the gateway never invents one.",
|
|
472
470
|
"The Apache-2.0 SDK serves without a Rebilder account or subscription. Configure reporting separately.",
|
|
473
|
-
|
|
471
|
+
`Run \`rebilder check <url>\` before and after to see what changed. Sending a Markdown copy from the page address is D2.1 (${DEFAULT_RULESET.weights["machine-representation.negotiated-response"] ?? 0} points) and unlocks D2.3 and D2.4.`
|
|
474
472
|
];
|
|
475
473
|
var CONFIG_BODY = `import type { GatewayConfig } from '@rebilder/gateway'
|
|
476
474
|
|
|
@@ -848,6 +846,20 @@ function statusOf(report) {
|
|
|
848
846
|
return report.kind === "rejected" ? "rejected" : report.result.outcome.kind;
|
|
849
847
|
}
|
|
850
848
|
|
|
849
|
+
// src/markdown-copy.ts
|
|
850
|
+
var NEGOTIATED_RESPONSE = "machine-representation.negotiated-response";
|
|
851
|
+
function markdownCopyOf(result) {
|
|
852
|
+
if (result.cost.negotiatedBytes !== null) return "page-address";
|
|
853
|
+
for (const dimension of result.dimensions) {
|
|
854
|
+
for (const check of dimension.checks) {
|
|
855
|
+
if (check.id === NEGOTIATED_RESPONSE) return check.earned > 0 ? "linked" : "none";
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
return "none";
|
|
859
|
+
}
|
|
860
|
+
var LINKED_COPY_NOTE = "Your linked Markdown copy works. Send it from the page address too for full credit.";
|
|
861
|
+
var LINKED_PARITY_NOTE = "This page does not send a Markdown copy itself. These facts come from the Markdown copy it links to.";
|
|
862
|
+
|
|
851
863
|
// src/format/json.ts
|
|
852
864
|
function renderJson(payload, ctx) {
|
|
853
865
|
return JSON.stringify(jsonValue(payload, ctx), null, 2) + "\n";
|
|
@@ -882,6 +894,10 @@ function jsonValue(payload, ctx) {
|
|
|
882
894
|
agent: payload.diff.agent,
|
|
883
895
|
browser: payload.diff.browser,
|
|
884
896
|
substanceParity: payload.diff.parity,
|
|
897
|
+
// Where the Markdown copy came from, so a consumer knows what the
|
|
898
|
+
// parity check compared: `page-address` (negotiation), `linked` (the
|
|
899
|
+
// copy the page links to, ARS 0.3), or `none`.
|
|
900
|
+
markdownCopy: payload.diff.result === null ? null : markdownCopyOf(payload.diff.result),
|
|
885
901
|
result: payload.diff.result
|
|
886
902
|
};
|
|
887
903
|
case "init":
|
|
@@ -1066,15 +1082,26 @@ function nextSteps(result) {
|
|
|
1066
1082
|
const missing = result.factProfile.core.filter((kind) => !found.has(kind));
|
|
1067
1083
|
const steps = [];
|
|
1068
1084
|
if (missing.length > 0) {
|
|
1069
|
-
steps.push(
|
|
1085
|
+
steps.push(
|
|
1086
|
+
`Check these business details: ${missing.join(", ")}. They were not detected in this capture (heuristic); verify the page before adding or changing content.`
|
|
1087
|
+
);
|
|
1070
1088
|
} else {
|
|
1071
|
-
steps.push(
|
|
1089
|
+
steps.push(
|
|
1090
|
+
"The expected core business details were detected (heuristic). Review their accuracy against your current products, services and policies."
|
|
1091
|
+
);
|
|
1072
1092
|
}
|
|
1073
1093
|
const first = result.recommendations[0];
|
|
1074
1094
|
if (first !== void 0) steps.push(`Start with: ${first.title}. ${first.detail}`);
|
|
1075
|
-
|
|
1076
|
-
steps.push(
|
|
1077
|
-
|
|
1095
|
+
const copy = markdownCopyOf(result);
|
|
1096
|
+
steps.push(
|
|
1097
|
+
copy === "page-address" ? "Compare the two responses with rebilder diff <url> and confirm the same business facts reach customers and assistants." : copy === "linked" ? `${LINKED_COPY_NOTE} Run rebilder init in your project to set that up, then connect your real data before deployment.` : "To connect your existing information, run rebilder init in your project. Review the generated configuration and connect your real data before deployment."
|
|
1098
|
+
);
|
|
1099
|
+
steps.push(
|
|
1100
|
+
"After updating your site, run rebilder check <url> again. Export --format markdown --out review.md to share the findings with your team."
|
|
1101
|
+
);
|
|
1102
|
+
steps.push(
|
|
1103
|
+
"This scan measures page readability; it does not measure customer demand, AI recommendations or sales."
|
|
1104
|
+
);
|
|
1078
1105
|
return steps;
|
|
1079
1106
|
}
|
|
1080
1107
|
|
|
@@ -1193,6 +1220,9 @@ function diffSection(diff) {
|
|
|
1193
1220
|
"Compared on price, currency, availability and title only \u2014 never description or free text.",
|
|
1194
1221
|
""
|
|
1195
1222
|
);
|
|
1223
|
+
if (diff.result !== null && markdownCopyOf(diff.result) === "linked") {
|
|
1224
|
+
out.push(LINKED_PARITY_NOTE, "");
|
|
1225
|
+
}
|
|
1196
1226
|
for (const evidence of diff.parity.evidence) {
|
|
1197
1227
|
out.push(
|
|
1198
1228
|
`- ${escapeCell(evidence.label)}: ${escapeCell(evidence.value)} (${basisLabel(evidence.basis)})`
|
|
@@ -1581,6 +1611,9 @@ function diffBlock(diff, pretty) {
|
|
|
1581
1611
|
"gray"
|
|
1582
1612
|
)
|
|
1583
1613
|
);
|
|
1614
|
+
if (diff.result !== null && markdownCopyOf(diff.result) === "linked") {
|
|
1615
|
+
lines.push(paint(` ${LINKED_PARITY_NOTE}`, "gray"));
|
|
1616
|
+
}
|
|
1584
1617
|
for (const evidence of diff.parity.evidence) {
|
|
1585
1618
|
lines.push(
|
|
1586
1619
|
` ${glyphs.bullet} ${evidence.label}: ${evidence.value} [${basisLabel(evidence.basis)}]`
|
|
@@ -1696,8 +1729,9 @@ var CHECK = `rebilder check <url...>
|
|
|
1696
1729
|
|
|
1697
1730
|
Probes each URL twice \u2014 an agent request and a browser control that differ in
|
|
1698
1731
|
the Accept header and in nothing else \u2014 plus /robots.txt, /llms.txt and
|
|
1699
|
-
/.well-known/ucp per origin.
|
|
1700
|
-
|
|
1732
|
+
/.well-known/ucp per origin. When the page does not send a Markdown copy but
|
|
1733
|
+
links one on the same site, that one copy is fetched too. Nothing else is
|
|
1734
|
+
requested. robots.txt is fetched first and obeyed.
|
|
1701
1735
|
|
|
1702
1736
|
OPTIONS
|
|
1703
1737
|
--format ${FORMATS.join("|")} default pretty
|
|
@@ -1723,7 +1757,8 @@ var DIFF = `rebilder diff <url>
|
|
|
1723
1757
|
|
|
1724
1758
|
Shows what the agent request received next to what the browser request
|
|
1725
1759
|
received: status, content type, decoded bytes, an estimated token count, and
|
|
1726
|
-
the D2.4 substance-parity comparison verbatim.
|
|
1760
|
+
the D2.4 substance-parity comparison verbatim. When the page links a Markdown
|
|
1761
|
+
copy instead of sending one, that comparison uses the linked copy.
|
|
1727
1762
|
|
|
1728
1763
|
It shows structure and numbers, never an excerpt of the page. --fail-on is not
|
|
1729
1764
|
supported: diff reports, it does not grade.
|
|
@@ -1776,7 +1811,7 @@ function helpText(topic) {
|
|
|
1776
1811
|
}
|
|
1777
1812
|
|
|
1778
1813
|
// src/cli.ts
|
|
1779
|
-
var CLI_VERSION = "0.
|
|
1814
|
+
var CLI_VERSION = "0.4.0";
|
|
1780
1815
|
async function runCli(argv, runtime2) {
|
|
1781
1816
|
const caps = detectCapabilities({
|
|
1782
1817
|
env: runtime2.env,
|
|
@@ -1852,7 +1887,7 @@ function buildProbe(runtime2, urlCount, flags) {
|
|
|
1852
1887
|
});
|
|
1853
1888
|
}
|
|
1854
1889
|
function budgetFor(urlCount) {
|
|
1855
|
-
return Math.max(20, urlCount *
|
|
1890
|
+
return Math.max(20, urlCount * 7 + 4);
|
|
1856
1891
|
}
|
|
1857
1892
|
function policyFor(setup, base) {
|
|
1858
1893
|
return { ...base, allowHttp: setup.allowHttp || base.allowHttp };
|