@letterstory/cli 0.176.16 → 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.16";
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,7 +1659,7 @@ 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 letterpress-1|claude-code|codex] [--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
@@ -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 letterpress-1|claude-code|codex] [--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 = {
@@ -31,6 +31,8 @@ const ARGS = {
31
31
  delivery: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
32
32
  notify_slack: { flag: "notify-slack", type: "bool" },
33
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",
@@ -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
+ }
@@ -90,6 +90,8 @@ const ARGS = {
90
90
  // --harness letterpress-1|claude-code|codex: the coding agent (codex is GPT, through OpenAI's Codex CLI);
91
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
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.16",
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",