@letterstory/cli 0.177.46 → 0.177.48

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 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.46";
92
+ export const VERSION = "0.177.48";
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,
@@ -59,6 +59,17 @@ export function ideaLines(item, n) {
59
59
  return lines;
60
60
  }
61
61
 
62
+ /**
63
+ * Pure: Fix's strategic rows (the door's `problems`: recipes staff placed in Fix), under the issues as the Fix tab's
64
+ * Strategic view lists them, numbered on from the items (2026-11-14: the terminal never showed them).
65
+ */
66
+ export function problemLines(r) {
67
+ const problems = r.problems ?? [];
68
+ if (!problems.length) return [];
69
+ const from = r.items?.length ?? 0;
70
+ return ["Strategic:", ...problems.flatMap((p, at) => ideaLines(p, from + at + 1))];
71
+ }
72
+
62
73
  /** Pure: an answer's footer: what nothing does, and a first read still under way. */
63
74
  function tailLines(r) {
64
75
  const lines = [];
@@ -78,7 +89,7 @@ export async function cmdAsk(ctx) {
78
89
  throw new CliError("One ask at a time: --outcome, --strategy <id>, --lens fix|build, or your words.");
79
90
  const result = await client.callTool("ask_letterpress", args);
80
91
  printResult(io, flags, result, (r) =>
81
- [r.message, ...r.items.flatMap((i, at) => ideaLines(i, at + 1)), ...tailLines(r)].join("\n")
92
+ [r.message, ...r.items.flatMap((i, at) => ideaLines(i, at + 1)), ...problemLines(r), ...tailLines(r)].join("\n")
82
93
  );
83
94
  return 0;
84
95
  }
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.46",
3
+ "version": "0.177.48",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",