@letterstory/cli 0.177.214 → 0.177.216
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 +4 -3
- package/lib/commands/automate.mjs +6 -0
- package/lib/commands/site.mjs +28 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.216";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -810,7 +810,7 @@ Reviewers:
|
|
|
810
810
|
relink_posts|mention_revisions|fix_autopilot|auto_plan|ai_portrayal] [--letterbase <id>|--host <site>]
|
|
811
811
|
[--name <n>] [--trigger competitor_page|competitor_change|visitor_identified|issue_found|build_suggestion|plan_update|post_ready|
|
|
812
812
|
preview_ready|transact_ask|custom|schedule]
|
|
813
|
-
[--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
|
|
813
|
+
[--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--tag <U…>] [--instruction <which events>]
|
|
814
814
|
[--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
|
|
815
815
|
[--every <n> --unit hours|days|weeks|months] [--facts <a,b>] [--recipe <id>]
|
|
816
816
|
[--fit-run <run-id> --publication-host <site>]
|
|
@@ -829,7 +829,7 @@ Reviewers:
|
|
|
829
829
|
(relink_posts, mention_revisions: --letterbase;
|
|
830
830
|
auto_plan: --host; fix_autopilot) is made, or added
|
|
831
831
|
back where someone removed it, acting as Letter
|
|
832
|
-
automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--slack-channel <C…>|none]
|
|
832
|
+
automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--slack-channel <C…>|none] [--tag <U…>|none]
|
|
833
833
|
[--backfill all|<YYYY-MM-DD>] [--on|--off] ...
|
|
834
834
|
automate try [<automation-id>] [--trigger <t> --prompt <text> --instruction <text> ...] [--limit <n>]
|
|
835
835
|
What it would do with the latest events (acts on none)
|
|
@@ -2082,6 +2082,7 @@ The Site (one model of your whole marketing site, keyed by host and path):
|
|
|
2082
2082
|
site highlight <domain> [--off] Highlight a competitor; its changes lead the top changes
|
|
2083
2083
|
site prospect <url> [--pages <n>] [--max-pages <n>] [--depth <n>]
|
|
2084
2084
|
Staff: any company's site, no account: what Fix would list, each PR
|
|
2085
|
+
site score <url> Any site, no account: agent readiness out of 100, what to fix first
|
|
2085
2086
|
site suggest <host> --idea <id> | --draft-id <id>... | --pattern <folder> | --item <id> --path <path>
|
|
2086
2087
|
Open PR on a suggestion the Site stores, as one job
|
|
2087
2088
|
site screenshot [url] [--run <id>] [--path <p>] [--viewport desktop|phone] [--full-page]
|
|
@@ -86,6 +86,10 @@ const slackChannel = {
|
|
|
86
86
|
? null
|
|
87
87
|
: String(flags["slack-channel"]),
|
|
88
88
|
};
|
|
89
|
+
// --tag U0123ABCD: who each post in the channel starts by tagging (a member of its workspace), or none.
|
|
90
|
+
const slackMention = {
|
|
91
|
+
value: (flags) => (flags.tag === undefined ? undefined : flags.tag === "none" ? null : String(flags.tag)),
|
|
92
|
+
};
|
|
89
93
|
const enabled = { value: (flags) => (flags.off === true ? false : flags.on === true ? true : undefined) };
|
|
90
94
|
// --backfill all (the whole history the trigger's source keeps) or --backfill 2026-09-01 (from that day):
|
|
91
95
|
// also run it on past events, oldest first.
|
|
@@ -167,6 +171,7 @@ export const ARGS = {
|
|
|
167
171
|
instruction: { flag: "instruction" },
|
|
168
172
|
prompt: { flag: "prompt" },
|
|
169
173
|
slack_channel: slackChannel,
|
|
174
|
+
slack_mention: slackMention,
|
|
170
175
|
enabled,
|
|
171
176
|
backfill,
|
|
172
177
|
},
|
|
@@ -179,6 +184,7 @@ export const ARGS = {
|
|
|
179
184
|
instruction: { flag: "instruction" },
|
|
180
185
|
prompt: { flag: "prompt" },
|
|
181
186
|
slack_channel: slackChannel,
|
|
187
|
+
slack_mention: slackMention,
|
|
182
188
|
enabled,
|
|
183
189
|
backfill,
|
|
184
190
|
},
|
package/lib/commands/site.mjs
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// site competitors → list_competitor_sites site watch-competitors [d] → watch_competitor_sites
|
|
17
17
|
// site highlight <domain> [--off] → set_competitor_highlight
|
|
18
18
|
// site prospect <url> → read_prospect_site (staff: any company's site, no account, nothing stored)
|
|
19
|
+
// site score <url> → read_agent_readiness (any site, no account: can agents find, read, trust and act on it)
|
|
19
20
|
// site suggest <host> --idea <id> | --draft-id <id>… | --pattern <folder> | --item <id> --path <p>
|
|
20
21
|
// | --new-page <folder> --words "<what the page is>" [--merge once_ready|window|by_hand] → start_suggestion
|
|
21
22
|
|
|
@@ -94,6 +95,7 @@ const ARGS = {
|
|
|
94
95
|
max_pages: { flag: "max-pages", type: "num" },
|
|
95
96
|
depth: { flag: "depth", type: "num" },
|
|
96
97
|
},
|
|
98
|
+
read_agent_readiness: { url: { positional: 0, required: true, label: "url" } },
|
|
97
99
|
get_llms_txt: { host: { positional: 0, required: true, label: "host" } },
|
|
98
100
|
get_site_facts: { domain: { positional: 0, label: "host" } },
|
|
99
101
|
get_site_tree: {
|
|
@@ -311,6 +313,8 @@ export async function cmdSite(ctx) {
|
|
|
311
313
|
return siteHighlight(rest);
|
|
312
314
|
case "prospect":
|
|
313
315
|
return siteProspect(rest);
|
|
316
|
+
case "score":
|
|
317
|
+
return siteScore(rest);
|
|
314
318
|
case "suggest":
|
|
315
319
|
return siteSuggest(rest);
|
|
316
320
|
case "screenshot":
|
|
@@ -319,7 +323,7 @@ export async function cmdSite(ctx) {
|
|
|
319
323
|
return siteSpeed(rest);
|
|
320
324
|
default:
|
|
321
325
|
throw new CliError(
|
|
322
|
-
`Unknown site subcommand: ${sub ?? "(none)"}. Try: list, map, refresh, unmap, tree, facts, builds, metrics, page, observations, observe, dismiss, families, decide-family, proposals, propose, decide, fix, competitors, watch-competitors, highlight, prospect, suggest, screenshot, speed`
|
|
326
|
+
`Unknown site subcommand: ${sub ?? "(none)"}. Try: list, map, refresh, unmap, tree, facts, builds, metrics, page, observations, observe, dismiss, families, decide-family, proposals, propose, decide, fix, competitors, watch-competitors, highlight, prospect, score, suggest, screenshot, speed`
|
|
323
327
|
);
|
|
324
328
|
}
|
|
325
329
|
}
|
|
@@ -490,6 +494,29 @@ async function siteProspect(ctx) {
|
|
|
490
494
|
return 0;
|
|
491
495
|
}
|
|
492
496
|
|
|
497
|
+
async function siteScore(ctx) {
|
|
498
|
+
const { client, flags, io } = ctx;
|
|
499
|
+
refuseUnknownFlags(ctx, ARGS.read_agent_readiness);
|
|
500
|
+
const read = await client.callTool(
|
|
501
|
+
"read_agent_readiness",
|
|
502
|
+
argsFromFlags(ARGS.read_agent_readiness, flags, ctx.positionals)
|
|
503
|
+
);
|
|
504
|
+
printResult(io, flags, read, (r) => {
|
|
505
|
+
const head = [
|
|
506
|
+
`${r.domain}: ${r.score}/100, ${r.grade} (${r.band})${r.capped ? ", held at 59 by a gate" : ""}`,
|
|
507
|
+
r.layers.map((l) => `${l.label} ${Math.round(l.earned)}/${Math.round(l.weight)}`).join(" "),
|
|
508
|
+
];
|
|
509
|
+
const byId = new Map(r.checks.map((c) => [c.id, c]));
|
|
510
|
+
const rows = r.fixes.map((id) => {
|
|
511
|
+
const c = byId.get(id);
|
|
512
|
+
const by = c.fixedBy === "pr" ? " [PR]" : c.fixedBy === "agent_site" ? " [Agent Site]" : "";
|
|
513
|
+
return ` +${c.gain} ${c.fix}${by}\n ${c.saw}`;
|
|
514
|
+
});
|
|
515
|
+
return [...head, ...rows].join("\n");
|
|
516
|
+
});
|
|
517
|
+
return 0;
|
|
518
|
+
}
|
|
519
|
+
|
|
493
520
|
async function siteRefresh(ctx) {
|
|
494
521
|
const { client, flags, io } = ctx;
|
|
495
522
|
refuseUnknownFlags(ctx, ARGS.refresh_site);
|