@letterstory/cli 0.176.59 → 0.176.61
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/lib/cli.mjs +2 -2
- package/lib/commands/admin.mjs +2 -0
- package/lib/commands/replicate.mjs +18 -2
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
86
86
|
|
|
87
87
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
88
|
-
export const VERSION = "0.176.
|
|
88
|
+
export const VERSION = "0.176.61";
|
|
89
89
|
|
|
90
90
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
91
91
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1956,7 +1956,7 @@ Bench (Benches: open-source benchmarks on their own domains, kept running; @lett
|
|
|
1956
1956
|
bench replicate <id> REPLICATE.md: how an agent reproduces the results
|
|
1957
1957
|
|
|
1958
1958
|
Replicate (the Replicator: a website rebuilt as a native Next.js repo, page for page; @letterstory.com only):
|
|
1959
|
-
replicate <https://site> [--max-pages <n>] [--repo-name <r>] [--repo-owner <o>]
|
|
1959
|
+
replicate <https://site> [--max-pages <n>] [--refine-budget <usd>] [--repo-name <r>] [--repo-owner <o>]
|
|
1960
1960
|
Capture every page, rebuild it, compare it pixel by pixel
|
|
1961
1961
|
replicate [list] Your replications: stage, how closely each matches
|
|
1962
1962
|
replicate show <id> [--failing] Pages with their routes and pixel match; collections; events
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5131,6 +5131,8 @@ const RECIPE_FILE_FIELDS = [
|
|
|
5131
5131
|
"weight",
|
|
5132
5132
|
"approaches",
|
|
5133
5133
|
"reads",
|
|
5134
|
+
// The inputs the fit is told a recipe cannot run without (2026-11-08: left out here, an import never carried them).
|
|
5135
|
+
"requires",
|
|
5134
5136
|
"runs",
|
|
5135
5137
|
"primitives_access",
|
|
5136
5138
|
"immediate",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// attach_replication_repo, advance_replication, archive_replication), the same lib functions the
|
|
6
6
|
// app calls.
|
|
7
7
|
//
|
|
8
|
-
// letterstory replicate https://example.com [--max-pages 300] [--repo-name example-site] [--repo-owner <account>]
|
|
8
|
+
// letterstory replicate https://example.com [--max-pages 300] [--refine-budget 25] [--repo-name example-site] [--repo-owner <account>]
|
|
9
9
|
// letterstory replicate list
|
|
10
10
|
// letterstory replicate show <id> [--failing]
|
|
11
11
|
// letterstory replicate attach <id> <repo-name> [--repo-owner <account>]
|
|
@@ -21,6 +21,7 @@ export const ARGS = {
|
|
|
21
21
|
create_replication: {
|
|
22
22
|
url: { positional: 0, label: "url", required: true },
|
|
23
23
|
max_pages: { flag: "max-pages", type: "num" },
|
|
24
|
+
refine_budget_usd: { flag: "refine-budget", type: "num" },
|
|
24
25
|
repo_name: "repo-name",
|
|
25
26
|
repo_owner: "repo-owner",
|
|
26
27
|
},
|
|
@@ -100,6 +101,12 @@ function headline(x) {
|
|
|
100
101
|
` ${x.summary.replicated} of ${x.summary.pages} pages replicated; ${x.summary.passing} match the original at every width (mean ${pct(x.summary.meanPixel)})`,
|
|
101
102
|
]
|
|
102
103
|
: []),
|
|
104
|
+
...(x.agent_pass
|
|
105
|
+
? [
|
|
106
|
+
` Agent pass: ${x.agent_pass.model}, $${x.agent_pass.cost_usd.toFixed(2)} of $${x.agent_pass.budget_usd.toFixed(2)} spent`,
|
|
107
|
+
...(x.agent_pass.refused ? [` Agent pass stopped: ${x.agent_pass.refused}`] : []),
|
|
108
|
+
]
|
|
109
|
+
: []),
|
|
103
110
|
...(x.media
|
|
104
111
|
? [
|
|
105
112
|
` Media ${x.media.files} large file${x.media.files === 1 ? "" : "s"} (${(x.media.bytes / 1e6).toFixed(1)} MB) served from Letter's media CDN, not the repo`,
|
|
@@ -128,10 +135,19 @@ function replicationDetail(ctx, result) {
|
|
|
128
135
|
const lines = headline(r.replication);
|
|
129
136
|
if (r.pages?.length) {
|
|
130
137
|
lines.push("", "Pages:");
|
|
131
|
-
for (const p of r.pages)
|
|
138
|
+
for (const p of r.pages) {
|
|
132
139
|
lines.push(
|
|
133
140
|
` ${p.passing ? "✓" : "✗"} ${p.path.padEnd(48)} ${p.scores.map((s) => `${s.viewport} ${pct(s.pixel)}`).join(" ")}${p.error ? ` (${p.error})` : ""}`
|
|
134
141
|
);
|
|
142
|
+
// Where a page under the bar is off: its worst section at each width.
|
|
143
|
+
if (!p.passing)
|
|
144
|
+
for (const s of p.scores) {
|
|
145
|
+
const worst = [...(s.sections ?? [])].sort((a, b) => a.pixel - b.pixel)[0];
|
|
146
|
+
if (worst && worst.pixel < 0.995)
|
|
147
|
+
lines.push(` ${s.viewport}: "${worst.label}" ${pct(worst.pixel)}`);
|
|
148
|
+
}
|
|
149
|
+
if (p.refined) lines.push(` changed by the agent pass: ${p.refined}`);
|
|
150
|
+
}
|
|
135
151
|
}
|
|
136
152
|
if (r.dropped?.length)
|
|
137
153
|
lines.push("", `The site's own code left out (needs its builder's runtime): ${r.dropped.length}`);
|