@letterstory/cli 0.176.58 → 0.176.60
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 +3 -2
- package/lib/commands/build.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.60";
|
|
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;
|
|
@@ -1745,6 +1745,7 @@ Build (a change to your site, or launching what isn't code; the Build box's own
|
|
|
1745
1745
|
build reads Done with no PR to merge. --again repeats an open build's ask.
|
|
1746
1746
|
--new-site: a website of its own, built and hosted (deploy create)
|
|
1747
1747
|
--look-like a.com,b.com (with --new-site): sites to model its look after
|
|
1748
|
+
--site-name <name> (with --new-site): its name; left out, named after --site
|
|
1748
1749
|
build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness letterpress-1|claude-code|codex]
|
|
1749
1750
|
[--repo owner/name] [--action build|build_pr|build_merge]
|
|
1750
1751
|
One turn of a conversation with Build (questions, follow-ups on a build)
|
|
@@ -1955,7 +1956,7 @@ Bench (Benches: open-source benchmarks on their own domains, kept running; @lett
|
|
|
1955
1956
|
bench replicate <id> REPLICATE.md: how an agent reproduces the results
|
|
1956
1957
|
|
|
1957
1958
|
Replicate (the Replicator: a website rebuilt as a native Next.js repo, page for page; @letterstory.com only):
|
|
1958
|
-
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>]
|
|
1959
1960
|
Capture every page, rebuild it, compare it pixel by pixel
|
|
1960
1961
|
replicate [list] Your replications: stage, how closely each matches
|
|
1961
1962
|
replicate show <id> [--failing] Pages with their routes and pixel match; collections; events
|
package/lib/commands/build.mjs
CHANGED
|
@@ -69,6 +69,8 @@ const ARGS = {
|
|
|
69
69
|
new_site: { flag: "new-site", type: "bool" },
|
|
70
70
|
// --new-site --look-like linear.app,supabase.com: other companies' sites to model its look after.
|
|
71
71
|
look_like: { value: (flags) => (flagCsv(flags["look-like"]).length ? flagCsv(flags["look-like"]) : undefined) },
|
|
72
|
+
// --new-site --site-name OLAPdb: the name it keeps; left out, it is named after --site.
|
|
73
|
+
site_name: "site-name",
|
|
72
74
|
// --plan-only: answer what it would do and start nothing (--json for the plan to send back).
|
|
73
75
|
plan_only: { flag: "plan-only", type: "bool" },
|
|
74
76
|
// --plan-only always plans what it's given, as /plan does: it was asked for by name.
|
|
@@ -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}`);
|