@letterstory/cli 0.177.46 → 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 +10 -1
- package/lib/commands/proofs.mjs +63 -0
- 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",
|
|
@@ -2056,6 +2059,11 @@ Domains (the domains you hold, and free ones that match what people search):
|
|
|
2056
2059
|
Build and Launch Site: buys the domain if needed, builds
|
|
2057
2060
|
the plan and puts it live
|
|
2058
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
|
+
|
|
2059
2067
|
Vary (A/B tests of a page's words and images on your own site):
|
|
2060
2068
|
vary [list] [--status running] [--site <id>] Your variationals and how many visitors each has seen
|
|
2061
2069
|
vary create --page <url> [--name <n>] [--goals-file <path>]
|
|
@@ -2261,6 +2269,7 @@ const CLIENT_COMMANDS = {
|
|
|
2261
2269
|
sim: cmdSim,
|
|
2262
2270
|
vary: cmdVary,
|
|
2263
2271
|
domains: cmdDomains,
|
|
2272
|
+
proofs: cmdProofs,
|
|
2264
2273
|
bench: cmdBench,
|
|
2265
2274
|
replicate: cmdReplicate,
|
|
2266
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.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";
|