@letterstory/cli 0.176.15 → 0.176.17

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
@@ -66,6 +66,7 @@ import {
66
66
  cmdRepo,
67
67
  cmdBuild,
68
68
  cmdAsk,
69
+ cmdPlan,
69
70
  cmdSite,
70
71
  cmdEvals,
71
72
  cmdOfferings,
@@ -80,7 +81,7 @@ import {
80
81
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
81
82
 
82
83
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
83
- export const VERSION = "0.176.15";
84
+ export const VERSION = "0.176.17";
84
85
 
85
86
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
86
87
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -602,8 +603,8 @@ Reviewers:
602
603
  automate list Your automations: an event, which ones it acts on,
603
604
  and what Letterpress then does
604
605
  automate show <automation-id>
605
- automate add [--template post_new_issues|fix_new_issues|recommended_actions|competitor_pages|icp_visitors]
606
- [--name <n>] [--trigger competitor_page|visitor_identified|issue_found|build_suggestion|custom]
606
+ automate add [--template post_new_issues|fix_new_issues|recommended_actions|competitor_pages|icp_visitors|plan_updates]
607
+ [--name <n>] [--trigger competitor_page|visitor_identified|issue_found|build_suggestion|plan_update|custom]
607
608
  [--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
608
609
  [--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
609
610
  [--hot-leads-only] [--per-day <n>] [--off]
@@ -1630,6 +1631,12 @@ Insights:
1630
1631
  Plan tab's box), what's broken (--lens fix, most pressing
1631
1632
  first), what to build (--lens build), or your own words. Nothing asked:
1632
1633
  each list's head. The same answer as the console and Slack.
1634
+ plan auto [activate|disable] [--site host] [--veto-hours <1-168>|off] [--auto-merge on|off]
1635
+ [--aggression low|medium|high|xhigh] [--slack-channel <C…>|none]
1636
+ Auto-Plan on a site: Letterpress picks its strategies and builds
1637
+ them; each pick waits --veto-hours for a veto. Settings shown when none given.
1638
+ plan pending [--site host] What Auto-Plan picked and is waiting to build
1639
+ plan veto <proposal-id> Veto one: it is never built
1633
1640
  insights summary [--period …] [--part <block>]... Measure Overview: AI named/cited rates, share of voice, search, targets
1634
1641
  insights reads [--period …] [--site all|own|phantoms|<key>]... [--path <path>] [--engine <operator>]
1635
1642
  Measure → Reads: AI engines and people reading your sites, counted one way
@@ -1652,12 +1659,12 @@ Insights:
1652
1659
  Build (a change to your site, or launching what isn't code; the Build box's own door):
1653
1660
  build <words…> [--prompt <text>] [--site <host>] [--subject <host/path>]... [--action build|build_pr|build_merge|slack|linear]
1654
1661
  [--attach <path>]... [--attach-url <name>=<https url>]... [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
1655
- [--harness claude-code|letterpress-1] [--notify-slack] [--again]
1662
+ [--harness letterpress-1|claude-code|codex] [--effort low|medium|high|xhigh] [--notify-slack] [--again]
1656
1663
  Build from your words: "add a pricing page" opens a preview or PR;
1657
1664
  "launch a phantom for us", "set up mailers" or "onboard my blog" is
1658
1665
  done by Build itself (a phantom site buys its own domain), and the
1659
1666
  build reads Done with no PR to merge. --again repeats an open build's ask
1660
- build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness claude-code|letterpress-1]
1667
+ build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness letterpress-1|claude-code|codex]
1661
1668
  [--repo owner/name] [--action build|build_pr|build_merge]
1662
1669
  One turn of a conversation with Build (questions, follow-ups on a build)
1663
1670
  build cancel <build-id> Stop a build before it merges: what's being built stops, its
@@ -1697,7 +1704,7 @@ The Site (one model of your whole marketing site, keyed by host and path):
1697
1704
  [--observation <id>]... Propose a registry tool call; input is validated now
1698
1705
  site decide <proposal-id> --decision accept|dismiss [--reason <why>]
1699
1706
  site fix <host> <observation-id>... [--action build|build_pr|build_merge|slack|linear|handoff] [--with-preview]
1700
- [--harness claude-code|letterpress-1]
1707
+ [--harness letterpress-1|claude-code|codex]
1701
1708
  One change for N observations; handoff prints the prompt, slack/linear need no repo
1702
1709
  site competitors [--since <iso> | --days <n>] [--limit <n>] Tracked competitors' sites: new and removed pages, by folder
1703
1710
  site watch-competitors [domain] [--limit <n>] Map competitors' sitemaps (the next few unmapped, or one now)
@@ -1728,11 +1735,12 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
1728
1735
  [--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]...
1729
1736
  [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
1730
1737
  [--action build|build_pr|build_merge|slack|linear] [--with-preview]
1731
- [--harness claude-code|letterpress-1] [--verifier|--no-verifier] [--wait]
1738
+ [--harness letterpress-1|claude-code|codex] [--effort low|medium|high|xhigh] [--verifier|--no-verifier] [--wait]
1732
1739
  Start a change (attached files go to the sandbox;
1733
1740
  -ref ones are context, never put in the repo);
1734
1741
  --with-preview keeps a preview up next to the PR;
1735
1742
  --harness picks the coding agent (default: the deployment's);
1743
+ --effort is how hard it works (default: its own);
1736
1744
  --verifier reviews the change and has the agent fix
1737
1745
  what's blocking before it goes out;
1738
1746
  --wait follows it to the PR;
@@ -1927,6 +1935,7 @@ const CLIENT_COMMANDS = {
1927
1935
  repo: cmdRepo,
1928
1936
  build: cmdBuild,
1929
1937
  ask: cmdAsk,
1938
+ plan: cmdPlan,
1930
1939
  site: cmdSite,
1931
1940
  evals: cmdEvals,
1932
1941
  visits: cmdVisits,
@@ -7,8 +7,15 @@
7
7
  import { CliError } from "../client.mjs";
8
8
  import { printResult, ok, argsFromFlags, flagList, refuseUnknownFlags } from "./shared.mjs";
9
9
 
10
- const TRIGGERS = ["competitor_page", "visitor_identified", "issue_found", "build_suggestion", "custom"];
11
- const TEMPLATES = ["post_new_issues", "fix_new_issues", "recommended_actions", "competitor_pages", "icp_visitors"];
10
+ const TRIGGERS = ["competitor_page", "visitor_identified", "issue_found", "build_suggestion", "plan_update", "custom"];
11
+ const TEMPLATES = [
12
+ "post_new_issues",
13
+ "fix_new_issues",
14
+ "recommended_actions",
15
+ "competitor_pages",
16
+ "icp_visitors",
17
+ "plan_updates",
18
+ ];
12
19
  const STATUSES = ["pending", "proposed", "acting", "acted", "skipped", "failed", "rejected"];
13
20
 
14
21
  const triggerParams = {
@@ -30,7 +30,9 @@ const ARGS = {
30
30
  files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
31
31
  delivery: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
32
32
  notify_slack: { flag: "notify-slack", type: "bool" },
33
- harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
33
+ harness: { flag: "harness", enum: ["letterpress-1", "claude-code", "codex"] },
34
+ // --effort low|medium|high|xhigh: how hard the coding agent works on each change; omitted, its own default.
35
+ effort: { flag: "effort", enum: ["low", "medium", "high", "xhigh"] },
34
36
  again: { flag: "again", type: "bool" },
35
37
  // --recipe <id>: the recipe the build carries out (a Plan row's), recorded on it.
36
38
  recipe: "recipe",
@@ -46,7 +48,7 @@ const ARGS = {
46
48
  // --recipe <id>: the recipe the words carry out (a Plan row's), recorded on the build it starts.
47
49
  recipe: "recipe",
48
50
  files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
49
- harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
51
+ harness: { flag: "harness", enum: ["letterpress-1", "claude-code", "codex"] },
50
52
  // --repo owner/name: the repo you're working in, where a Proofs install goes.
51
53
  repo: "repo",
52
54
  // --action build|build_pr|build_merge: how a build this message starts is delivered (Letter Edit's auto-merge sends build_merge).
@@ -0,0 +1,97 @@
1
+ // `plan` — Auto-Plan on one site (Plan → Auto-Plan; Plan is scoped to one website, --site, else the
2
+ // organization's own domain). The same calls as the Plan's modal and its sidebar's Pending rows.
3
+ // plan auto → get_auto_plan
4
+ // plan auto [activate|disable] [--veto-hours <1-168>|off] [--auto-merge on|off]
5
+ // [--aggression low|medium|high|xhigh] [--slack-channel <C…>|none] → set_auto_plan
6
+ // plan pending → list_auto_plan_proposals (status pending)
7
+ // plan veto <proposal-id> → veto_auto_plan_proposal
8
+
9
+ import { CliError } from "../client.mjs";
10
+ import { argsFromFlags, flagStr, printResult, refuseUnknownFlags } from "./shared.mjs";
11
+
12
+ const onOff = (name) => (flags) => {
13
+ const v = flagStr(flags[name]);
14
+ if (v === undefined) return undefined;
15
+ if (["on", "true", "1"].includes(v)) return true;
16
+ if (["off", "false", "0"].includes(v)) return false;
17
+ throw new CliError(`--${name} takes on or off.`);
18
+ };
19
+
20
+ export const ARGS = {
21
+ get_auto_plan: { domain: "site" },
22
+ set_auto_plan: {
23
+ domain: "site",
24
+ // `plan auto activate` / `plan auto disable`.
25
+ enabled: {
26
+ value: (_flags, positionals) =>
27
+ positionals[0] === "activate" ? true : positionals[0] === "disable" ? false : undefined,
28
+ },
29
+ // --veto-hours <n> waits that long for a veto before each pick builds; --veto-hours off builds at once.
30
+ veto_hours: {
31
+ value: (flags) => {
32
+ const v = flagStr(flags["veto-hours"]);
33
+ if (v === undefined) return undefined;
34
+ if (v === "off") return null;
35
+ const n = Number(v);
36
+ if (!Number.isInteger(n)) throw new CliError("--veto-hours takes a whole number of hours, or off.");
37
+ return n;
38
+ },
39
+ },
40
+ merge: { value: onOff("auto-merge") },
41
+ aggression: { flag: "aggression", enum: ["low", "medium", "high", "xhigh"] },
42
+ slack_channel: {
43
+ value: (flags) => {
44
+ const v = flagStr(flags["slack-channel"]);
45
+ return v === undefined ? undefined : v === "none" ? null : v;
46
+ },
47
+ },
48
+ },
49
+ list_auto_plan_proposals: {
50
+ domain: "site",
51
+ status: { flag: "status", enum: ["pending", "vetoed", "started", "failed"] },
52
+ limit: { flag: "limit", type: "num" },
53
+ },
54
+ veto_auto_plan_proposal: { id: { positional: 0, required: true, label: "proposal-id" } },
55
+ };
56
+
57
+ const SETTING_FLAGS = ["veto-hours", "auto-merge", "aggression", "slack-channel"];
58
+
59
+ export async function cmdPlan(ctx) {
60
+ const { client, flags, io } = ctx;
61
+ const sub = ctx.positionals[0];
62
+ const rest = ctx.positionals.slice(1);
63
+ if (sub === "auto") {
64
+ refuseUnknownFlags(ctx, {}, ["site", ...SETTING_FLAGS]);
65
+ if (rest[0] && !["activate", "disable"].includes(rest[0]))
66
+ throw new CliError("plan auto takes activate or disable, then its settings.");
67
+ const setting = !!rest[0] || SETTING_FLAGS.some((f) => flags[f] !== undefined);
68
+ const tool = setting ? "set_auto_plan" : "get_auto_plan";
69
+ const result = await client.callTool(tool, argsFromFlags(ARGS[tool], flags, rest));
70
+ printResult(io, flags, result, (r) => r.message);
71
+ return 0;
72
+ }
73
+ if (sub === "pending" || sub === "proposals") {
74
+ refuseUnknownFlags(ctx, {}, ["site", "status", "limit"]);
75
+ const args = argsFromFlags(ARGS.list_auto_plan_proposals, flags, rest);
76
+ const result = await client.callTool("list_auto_plan_proposals", {
77
+ ...(sub === "pending" ? { status: "pending" } : {}),
78
+ ...args,
79
+ });
80
+ printResult(io, flags, result, (r) =>
81
+ r.proposals.length
82
+ ? r.proposals.map((p) => ` ${p.status.padEnd(8)} ${p.title} (builds ${p.due_at}) ${p.id}`).join("\n")
83
+ : "Nothing pending."
84
+ );
85
+ return 0;
86
+ }
87
+ if (sub === "veto") {
88
+ refuseUnknownFlags(ctx, {}, []);
89
+ const result = await client.callTool(
90
+ "veto_auto_plan_proposal",
91
+ argsFromFlags(ARGS.veto_auto_plan_proposal, flags, rest)
92
+ );
93
+ printResult(io, flags, result, (r) => r.message);
94
+ return 0;
95
+ }
96
+ throw new CliError("Usage: plan auto [settings…] | plan pending | plan veto <proposal-id>");
97
+ }
@@ -87,9 +87,11 @@ const ARGS = {
87
87
  preview: { flag: "preview", type: "bool" },
88
88
  // --with-preview: the PR opens straight away and a preview of the change stays up next to it.
89
89
  with_preview: { flag: "with-preview", type: "bool" },
90
- // --harness claude-code|letterpress-1: the coding agent; omitted, the deployment's default.
91
- // codex (OpenAI's Codex CLI) runs only on a test organization, for the harness evals.
90
+ // --harness letterpress-1|claude-code|codex: the coding agent (codex is GPT, through OpenAI's Codex CLI);
91
+ // omitted, the organization's default.
92
92
  harness: { flag: "harness", enum: ["claude-code", "letterpress-1", "codex"] },
93
+ // --effort low|medium|high|xhigh: how hard the coding agent works; omitted, its own default.
94
+ effort: { flag: "effort", enum: ["low", "medium", "high", "xhigh"] },
93
95
  // --again: start it even when an open change already asks for the same thing.
94
96
  again: { flag: "again", type: "bool" },
95
97
  // --page <path>, repeatable or comma-separated: the pages the change is about ("/pricing"), so another change
@@ -200,8 +200,8 @@ const ARGS = {
200
200
  action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear", "handoff"] },
201
201
  // --with-preview: the PR opens straight away and a preview of the fix stays up next to it.
202
202
  with_preview: { flag: "with-preview", type: "bool" },
203
- // --harness claude-code|letterpress-1: the coding agent; omitted, the deployment's default.
204
- harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
203
+ // --harness letterpress-1|claude-code|codex: the coding agent (codex is GPT); omitted, the organization's default.
204
+ harness: { flag: "harness", enum: ["letterpress-1", "claude-code", "codex"] },
205
205
  },
206
206
  };
207
207
 
package/lib/commands.mjs CHANGED
@@ -47,6 +47,7 @@ export * from "./commands/feedback.mjs";
47
47
  export * from "./commands/repo.mjs";
48
48
  export * from "./commands/build.mjs";
49
49
  export * from "./commands/ask.mjs";
50
+ export * from "./commands/plan.mjs";
50
51
  export * from "./commands/site.mjs";
51
52
  export * from "./commands/evals.mjs";
52
53
  export * from "./commands/visits.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.15",
3
+ "version": "0.176.17",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",