@letterstory/cli 0.177.45 → 0.177.47
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 +14 -4
- package/lib/commands/proofs.mjs +63 -0
- package/lib/commands/repo.mjs +3 -2
- package/lib/commands.mjs +1 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
cmdSim,
|
|
80
80
|
cmdVary,
|
|
81
81
|
cmdDomains,
|
|
82
|
+
cmdProofs,
|
|
82
83
|
cmdBench,
|
|
83
84
|
cmdReplicate,
|
|
84
85
|
cmdDeploy,
|
|
@@ -88,7 +89,7 @@ import {
|
|
|
88
89
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
89
90
|
|
|
90
91
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
91
|
-
export const VERSION = "0.177.
|
|
92
|
+
export const VERSION = "0.177.47";
|
|
92
93
|
|
|
93
94
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
94
95
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -127,6 +128,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
127
128
|
"from-plan",
|
|
128
129
|
// domains plan: scores only, no model call.
|
|
129
130
|
"no-write",
|
|
131
|
+
// proofs verify-domain: refused with a pointer to --yes (adding the record changes DNS).
|
|
132
|
+
"write",
|
|
130
133
|
// admin letterpress endings: no model reading; write the proposed eval cases locally.
|
|
131
134
|
"no-model",
|
|
132
135
|
"write-cases",
|
|
@@ -1973,9 +1976,10 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
1973
1976
|
repo fix-audit --issue <issue-type>... [--audit <id>] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
|
|
1974
1977
|
One PR fixing site-audit issues (repeat --issue to bundle) on every affected page,
|
|
1975
1978
|
in the repo verified to build the site
|
|
1976
|
-
repo install-letterprove --repo <owner/name> [--gitlab] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
|
|
1977
|
-
One PR adding
|
|
1978
|
-
(
|
|
1979
|
+
repo install-letterprove --repo <owner/name> [--gitlab] [--host <domain>] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
|
|
1980
|
+
One PR adding Proofs to your product: Letter's script on signed-in
|
|
1981
|
+
pages (identification off) and the identify call
|
|
1982
|
+
(pick the repo where users sign in; --host: where they do)
|
|
1979
1983
|
repo install-visitors [--site <id> | --host <domain>] [--repo <owner/name> [--gitlab]] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
|
|
1980
1984
|
One PR adding the Visitors script tag and server snippet to the repo that
|
|
1981
1985
|
builds the site (--repo: another repo)
|
|
@@ -2055,6 +2059,11 @@ Domains (the domains you hold, and free ones that match what people search):
|
|
|
2055
2059
|
Build and Launch Site: buys the domain if needed, builds
|
|
2056
2060
|
the plan and puts it live
|
|
2057
2061
|
|
|
2062
|
+
Proofs (signed proof of the companies using your product):
|
|
2063
|
+
proofs verify-domain [--yes] Verify your domain with DNS: where Letter adds the TXT
|
|
2064
|
+
record, or the record for your own agent to add;
|
|
2065
|
+
--yes adds it where Letter can, then checks it
|
|
2066
|
+
|
|
2058
2067
|
Vary (A/B tests of a page's words and images on your own site):
|
|
2059
2068
|
vary [list] [--status running] [--site <id>] Your variationals and how many visitors each has seen
|
|
2060
2069
|
vary create --page <url> [--name <n>] [--goals-file <path>]
|
|
@@ -2260,6 +2269,7 @@ const CLIENT_COMMANDS = {
|
|
|
2260
2269
|
sim: cmdSim,
|
|
2261
2270
|
vary: cmdVary,
|
|
2262
2271
|
domains: cmdDomains,
|
|
2272
|
+
proofs: cmdProofs,
|
|
2263
2273
|
bench: cmdBench,
|
|
2264
2274
|
replicate: cmdReplicate,
|
|
2265
2275
|
deploy: cmdDeploy,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// `proofs` — Proofs (Letterprove) from a terminal. Thin wrapper over letterprove_add_domain_record, the same lib
|
|
2
|
+
// function Build's Proofs reply reads (lib/proofs/dns-verify.ts).
|
|
3
|
+
//
|
|
4
|
+
// letterstory proofs verify-domain where Letter would add the DNS TXT record, or the record to add
|
|
5
|
+
// yourself; changes nothing
|
|
6
|
+
// letterstory proofs verify-domain --yes reads that plan and adds the record where Letter can write the DNS,
|
|
7
|
+
// with the plan's confirm (a write goes only with it), then checks it
|
|
8
|
+
|
|
9
|
+
import { CliError } from "../client.mjs";
|
|
10
|
+
import { argsFromFlags, printResult } from "./shared.mjs";
|
|
11
|
+
|
|
12
|
+
export const ARGS = {
|
|
13
|
+
letterprove_add_domain_record: {
|
|
14
|
+
// The plan is always read first; --yes writes it with its confirm (proofsVerifyDomain), as `domains buy --yes`
|
|
15
|
+
// buys at the price it just read.
|
|
16
|
+
write: { value: () => undefined },
|
|
17
|
+
confirm: { value: () => undefined },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export async function cmdProofs(ctx) {
|
|
22
|
+
const sub = ctx.positionals[0];
|
|
23
|
+
const rest = { ...ctx, positionals: ctx.positionals.slice(1) };
|
|
24
|
+
switch (sub) {
|
|
25
|
+
case "verify-domain":
|
|
26
|
+
case "dns":
|
|
27
|
+
return proofsVerifyDomain(rest);
|
|
28
|
+
default:
|
|
29
|
+
throw new CliError(`Unknown proofs subcommand: ${sub ?? "(none)"}. Try: verify-domain`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const WHERE = { letter: "Letter's DNS", org_vercel: "your Vercel DNS" };
|
|
34
|
+
|
|
35
|
+
function lines(r) {
|
|
36
|
+
const out = [r.message];
|
|
37
|
+
if (r.record && r.state !== "verified")
|
|
38
|
+
out.push("", ` Name: ${r.record.name}`, " Type: TXT", ` Value: ${r.record.value}`);
|
|
39
|
+
if (r.state === "would_write")
|
|
40
|
+
out.push("", `Run again with --yes to add it on ${WHERE[r.where.by]} for ${r.where.zone}.`);
|
|
41
|
+
if (r.state === "add_record" && r.agent_prompt) out.push("", r.agent_prompt);
|
|
42
|
+
if (r.state === "written") out.push("", "Check again in a few minutes: letterstory proofs verify-domain");
|
|
43
|
+
return out.join("\n");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function proofsVerifyDomain(ctx) {
|
|
47
|
+
const { client, flags, io } = ctx;
|
|
48
|
+
if (flags.write === true) throw new CliError("Adding the record changes your DNS: run with --yes to add it.");
|
|
49
|
+
const base = argsFromFlags(ARGS.letterprove_add_domain_record, flags, ctx.positionals);
|
|
50
|
+
const plan = await client.callTool("letterprove_add_domain_record", base);
|
|
51
|
+
// Only a plan Letter can write goes on: verified, or a record for you to add, is the answer as it is.
|
|
52
|
+
if (flags.yes !== true || plan?.state !== "would_write" || !plan.confirm) {
|
|
53
|
+
printResult(io, flags, plan, lines);
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
const written = await client.callTool("letterprove_add_domain_record", {
|
|
57
|
+
...base,
|
|
58
|
+
write: true,
|
|
59
|
+
confirm: plan.confirm,
|
|
60
|
+
});
|
|
61
|
+
printResult(io, flags, written, lines);
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -181,6 +181,7 @@ const ARGS = {
|
|
|
181
181
|
},
|
|
182
182
|
letterprove_open_install_pr: {
|
|
183
183
|
provider,
|
|
184
|
+
host: "host",
|
|
184
185
|
repo_owner: { value: (flags) => splitRepo(flags).owner },
|
|
185
186
|
repo_name: { value: (flags) => splitRepo(flags).name },
|
|
186
187
|
base_branch: "branch",
|
|
@@ -579,10 +580,10 @@ async function repoFixAudit(ctx) {
|
|
|
579
580
|
return followRun(ctx, result.run);
|
|
580
581
|
}
|
|
581
582
|
|
|
582
|
-
/** `repo install-letterprove --repo owner/name [--branch b] [--wait]`:
|
|
583
|
+
/** `repo install-letterprove --repo owner/name [--host h] [--branch b] [--wait]`: the Visitors script on the product + identify → one PR. */
|
|
583
584
|
async function repoInstallLetterprove(ctx) {
|
|
584
585
|
const { client, flags, io } = ctx;
|
|
585
|
-
refuseUnknownFlags(ctx, {}, ["repo", "owner", "name", "gitlab", "branch", "action", "wait"]);
|
|
586
|
+
refuseUnknownFlags(ctx, {}, ["repo", "owner", "name", "gitlab", "host", "branch", "action", "wait"]);
|
|
586
587
|
const result = await client.callTool(
|
|
587
588
|
"letterprove_open_install_pr",
|
|
588
589
|
argsFromFlags(ARGS.letterprove_open_install_pr, flags, ctx.positionals)
|
package/lib/commands.mjs
CHANGED
|
@@ -55,6 +55,7 @@ export * from "./commands/visits.mjs";
|
|
|
55
55
|
export * from "./commands/sim.mjs";
|
|
56
56
|
export * from "./commands/vary.mjs";
|
|
57
57
|
export * from "./commands/domains.mjs";
|
|
58
|
+
export * from "./commands/proofs.mjs";
|
|
58
59
|
export * from "./commands/bench.mjs";
|
|
59
60
|
export * from "./commands/replicate.mjs";
|
|
60
61
|
export * from "./commands/deploy.mjs";
|