@letterstory/cli 0.148.0 → 0.148.1
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 +1 -1
- package/lib/commands/site.mjs +23 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
|
|
66
66
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
67
67
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
68
|
-
export const VERSION = "0.148.
|
|
68
|
+
export const VERSION = "0.148.1";
|
|
69
69
|
|
|
70
70
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
71
71
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
package/lib/commands/site.mjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// site tree <host> [path] → get_site_tree site page <host> <path> → get_site_page
|
|
5
5
|
// site builds <host> → list_build_suggestions (--limit n)
|
|
6
6
|
// site research-builds <host> → research_builds (Build's suggestion pass: propose, check, Jev, store)
|
|
7
|
+
// site research-fixes <host> → research_fixes (Fix's suggestion pass: exact edits on pages that exist)
|
|
7
8
|
// site metrics <host> [path] → get_site_metrics (--window 7d|28d|90d, --page <path>…, --no-compare)
|
|
8
9
|
// site observations <host> → list_site_observations site observe <host> → observe_site
|
|
9
10
|
// site dismiss <host> <id> → dismiss_site_observation
|
|
@@ -87,6 +88,9 @@ const ARGS = {
|
|
|
87
88
|
research_builds: {
|
|
88
89
|
host: { positional: 0, required: true, label: "host" },
|
|
89
90
|
},
|
|
91
|
+
research_fixes: {
|
|
92
|
+
host: { positional: 0, required: true, label: "host" },
|
|
93
|
+
},
|
|
90
94
|
get_site_metrics: {
|
|
91
95
|
host: { positional: 0, required: true, label: "host" },
|
|
92
96
|
path: { positional: 1, label: "path" },
|
|
@@ -210,6 +214,8 @@ export async function cmdSite(ctx) {
|
|
|
210
214
|
return siteTree(rest);
|
|
211
215
|
case "research-builds":
|
|
212
216
|
return siteResearchBuilds(rest);
|
|
217
|
+
case "research-fixes":
|
|
218
|
+
return siteResearchFixes(rest);
|
|
213
219
|
case "builds":
|
|
214
220
|
return siteBuilds(rest);
|
|
215
221
|
case "metrics":
|
|
@@ -439,6 +445,23 @@ async function siteResearchBuilds(ctx) {
|
|
|
439
445
|
return 0;
|
|
440
446
|
}
|
|
441
447
|
|
|
448
|
+
async function siteResearchFixes(ctx) {
|
|
449
|
+
const { client, flags, io } = ctx;
|
|
450
|
+
refuseUnknownFlags(ctx, ARGS.research_fixes);
|
|
451
|
+
const result = await client.callTool("research_fixes", argsFromFlags(ARGS.research_fixes, flags, ctx.positionals));
|
|
452
|
+
printResult(io, flags, result, (r) => {
|
|
453
|
+
if (!r.ran) return `Not run (${r.reason ?? "fresh"}); the stored fixes are on the site's Fix list.`;
|
|
454
|
+
const lines = r.suggestions.map(
|
|
455
|
+
(s) => `KEPT ${s.page}: ${s.summary}\n now: ${s.current}\n after: ${s.change}\n ${s.id}`
|
|
456
|
+
);
|
|
457
|
+
for (const x of r.rejected) lines.push(`DROPPED ${x.page}: ${x.summary} (${x.reason})`);
|
|
458
|
+
if (r.pass?.resolved) lines.push(`Resolved ${r.pass.resolved} open fix(es) whose page changed.`);
|
|
459
|
+
if (!r.suggestions.length) lines.push("Nothing passed: zero is a valid result.");
|
|
460
|
+
return lines.join("\n");
|
|
461
|
+
});
|
|
462
|
+
return 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
442
465
|
async function siteMetrics(ctx) {
|
|
443
466
|
const { client, flags, io } = ctx;
|
|
444
467
|
refuseUnknownFlags(ctx, ARGS.get_site_metrics);
|