@letterstory/cli 0.165.0 → 0.165.2

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
@@ -74,7 +74,7 @@ import {
74
74
  } from "./commands.mjs";
75
75
 
76
76
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
77
- export const VERSION = "0.165.0";
77
+ export const VERSION = "0.165.2";
78
78
 
79
79
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
80
80
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -1444,7 +1444,9 @@ Mailers (the sending mailboxes):
1444
1444
  Recent mail (envelopes)
1445
1445
  mailers message <mailer-id> <uid> --folder inbox|sent
1446
1446
  One message in full (plain-text body)
1447
- mailers forward <mailer-id> (--to <email> | --clear) Copy inbound mail to an address
1447
+ mailers forward <mailer-id> (--to <email> | --clear) Forward replies to sequences to an address
1448
+ mailers forwards <mailer-id> [--outcome forwarded|held|failed] [--limit <n>]
1449
+ What forwarding forwarded or held, and why
1448
1450
  mailers warmup start|pause <mailer-id> Start / pause warming (14+ days; ready at score 85)
1449
1451
  mailers limit <mailer-id> <per-day> Daily send limit, 0..500 (not while warming)
1450
1452
  mailers retire <mailer-id> [--release-mailbox --yes] Disable a mailer; --release-mailbox also deletes
@@ -1499,6 +1501,11 @@ Build (a change to your site, or launching what isn't code; the Build box's own
1499
1501
  build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness claude-code|letterpress-1]
1500
1502
  [--repo owner/name]
1501
1503
  One turn of a conversation with Build (questions, follow-ups on a build)
1504
+ build benchmark <words…> [--prompt <text>] [--site <host>] [--agent letterpress-1|claude-code|codex]...
1505
+ [--attach <path>]... [--attach-url <name>=<https url>]... [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
1506
+ Staff only. The same prompt on Letterpress-1 (as Build runs it) and on
1507
+ stock Claude Code and stock Codex, each a preview to compare
1508
+ build benchmarks [--id <uuid>] [--limit <n>] Staff only. Benchmarks, each arm's state, preview, cost and agent time
1502
1509
 
1503
1510
  The Site (one model of your whole marketing site, keyed by host and path):
1504
1511
  site list Mapped hosts, and hosts you already have elsewhere
@@ -5048,7 +5048,7 @@ function recipeFromFlags(flags) {
5048
5048
  const ENGINE = "/api/superadmin/engine-settings";
5049
5049
  const LETTERPRESS = "/api/superadmin/letterpress";
5050
5050
  const ENGINE_USAGE =
5051
- "Usage: admin letterpress status | gaps | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|clear> [--note …] | settings | flip <build|fix|plan> <off|shadow|live> | set <weights.<ask>.<reading>|lenses.<lens>.mode|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|asks.<lens>.ask|asks.<lens>.guidance> <value>";
5051
+ "Usage: admin letterpress status | gaps | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|clear> [--note …] | settings | flip <build|fix|plan> <off|shadow|live> | set <weights.<ask>.<reading>|lenses.<lens>.mode|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance> <value>";
5052
5052
 
5053
5053
  /** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
5054
5054
  function engineSettingsPatch(path, value) {
@@ -4,6 +4,9 @@
4
4
  // main blog, is carried out by Build itself with nothing to merge.
5
5
  // build <words…> → start_build (--prompt for a long ask; --again to repeat one)
6
6
  // build talk <words…> → send_build_message (--conversation <id> | --build <id> to continue)
7
+ // build benchmark <words…> → start_build_benchmark (staff only: Letterpress-1, stock Claude Code
8
+ // and stock Codex on the same prompt, each a preview)
9
+ // build benchmarks → list_build_benchmarks (staff only; --id <uuid> for one)
7
10
 
8
11
  import { CliError } from "../client.mjs";
9
12
  import { argsFromFlags, flagList, flagStr, ok, printResult, refuseUnknownFlags } from "./shared.mjs";
@@ -37,6 +40,17 @@ const ARGS = {
37
40
  // --repo owner/name: the repo you're working in, where a Proofs install goes.
38
41
  repo: "repo",
39
42
  },
43
+ start_build_benchmark: {
44
+ prompt: { value: (flags, positionals) => flagStr(flags.prompt) ?? (positionals.join(" ").trim() || undefined) },
45
+ domain: "site",
46
+ files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
47
+ // --agent (repeatable): fewer arms; all three when omitted.
48
+ agents: { flag: "agent", type: "list" },
49
+ },
50
+ list_build_benchmarks: {
51
+ id: "id",
52
+ limit: { flag: "limit", type: "num" },
53
+ },
40
54
  };
41
55
 
42
56
  const FILE_FLAGS = ["attach", "attach-url", "attach-ref", "attach-url-ref"];
@@ -55,9 +69,47 @@ async function attachedFiles(ctx) {
55
69
 
56
70
  export async function cmdBuild(ctx) {
57
71
  if (ctx.positionals[0] === "talk") return buildTalk({ ...ctx, positionals: ctx.positionals.slice(1) });
72
+ if (ctx.positionals[0] === "benchmark") return buildBenchmark({ ...ctx, positionals: ctx.positionals.slice(1) });
73
+ if (ctx.positionals[0] === "benchmarks") return buildBenchmarks({ ...ctx, positionals: ctx.positionals.slice(1) });
58
74
  return buildStart(ctx);
59
75
  }
60
76
 
77
+ /** A benchmark as lines: the prompt, then each arm's state, preview, cost and agent time. */
78
+ export function benchmarkLines(b) {
79
+ const lines = [`${b.id} ${b.status} ${b.prompt.split("\n")[0].slice(0, 100)}`];
80
+ for (const arm of b.arms ?? []) {
81
+ const time = arm.agent_ms === null ? "" : ` ${Math.round(arm.agent_ms / 1000)}s`;
82
+ lines.push(` ${arm.label}${arm.stock ? " (stock)" : ""}: ${arm.state} $${arm.cost_usd.toFixed(2)}${time}`);
83
+ if (arm.message) lines.push(` ${arm.message}`);
84
+ for (const run of arm.runs ?? []) {
85
+ lines.push(` ${run.id} ${run.preview_url ?? run.pr_url ?? run.lane ?? run.status}`);
86
+ }
87
+ }
88
+ return lines.join("\n");
89
+ }
90
+
91
+ async function buildBenchmark(ctx) {
92
+ const { client, flags, io } = ctx;
93
+ refuseUnknownFlags(ctx, {}, ["prompt", "site", "agent", ...FILE_FLAGS]);
94
+ const files = await attachedFiles(ctx);
95
+ const args = argsFromFlags(ARGS.start_build_benchmark, flags, ctx.positionals, { files });
96
+ if (!args.prompt) throw new CliError('Say what to build: letterstory build benchmark "add a pricing page"');
97
+ const result = await client.callTool("start_build_benchmark", args);
98
+ printResult(io, flags, result, (r) => benchmarkLines(r.benchmark));
99
+ return 0;
100
+ }
101
+
102
+ async function buildBenchmarks(ctx) {
103
+ const { client, flags, io } = ctx;
104
+ refuseUnknownFlags(ctx, {}, ["id", "limit"]);
105
+ const args = argsFromFlags(ARGS.list_build_benchmarks, flags, ctx.positionals);
106
+ const result = await client.callTool("list_build_benchmarks", args);
107
+ printResult(io, flags, result, (r) =>
108
+ r.benchmarks.length ? r.benchmarks.map(benchmarkLines).join("\n\n") : "No benchmarks yet."
109
+ );
110
+ return 0;
111
+ }
112
+
61
113
  async function buildStart(ctx) {
62
114
  const { client, flags, io } = ctx;
63
115
  refuseUnknownFlags(ctx, {}, [
@@ -352,6 +352,11 @@ export const ARGS = {
352
352
  uid: messageRefPositional(1, "uid"),
353
353
  folder: { flag: "folder", required: true, enum: MAILER_FOLDERS },
354
354
  },
355
+ list_mailer_forwards: {
356
+ mailer_id: { positional: 0, label: "mailer-id", required: true },
357
+ outcome: { flag: "outcome", enum: ["pending", "forwarded", "held", "failed"] },
358
+ limit: { flag: "limit", type: "num" },
359
+ },
355
360
  set_mailer_forwarding: {
356
361
  mailer_id: { positional: 0, label: "mailer-id", required: true },
357
362
  forward_to: {
@@ -698,7 +703,7 @@ async function prospectsColumns(ctx, sub) {
698
703
  }
699
704
  }
700
705
 
701
- const MAILERS_USAGE = `Usage: mailers <list|domains|domain|quote|launch|move|messages|message|forward|warmup|limit|retire|suppressions>`;
706
+ const MAILERS_USAGE = `Usage: mailers <list|domains|domain|quote|launch|move|messages|message|forward|forwards|warmup|limit|retire|suppressions>`;
702
707
 
703
708
  export async function cmdMailers(ctx) {
704
709
  const sub = ctx.positionals[0];
@@ -746,6 +751,8 @@ export async function cmdMailers(ctx) {
746
751
  return run(rest, "get_mailer_message");
747
752
  case "forward":
748
753
  return run(rest, "set_mailer_forwarding", "Forwarding updated.");
754
+ case "forwards":
755
+ return run(rest, "list_mailer_forwards");
749
756
  case "warmup": {
750
757
  const action = rest.positionals[0];
751
758
  const inner = { ...rest, positionals: rest.positionals.slice(1) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.165.0",
3
+ "version": "0.165.2",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",