@letterstory/cli 0.175.17 → 0.175.19

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
@@ -78,7 +78,7 @@ import {
78
78
  } from "./commands.mjs";
79
79
 
80
80
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
81
- export const VERSION = "0.175.17";
81
+ export const VERSION = "0.175.19";
82
82
 
83
83
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
84
84
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -87,6 +87,8 @@ export const EXIT_PAYMENT_REQUIRED = 3;
87
87
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
88
88
  // `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
89
89
  export const BOOLEAN_FLAGS = new Set([
90
+ // bench update: remove the README's disclosure.
91
+ "no-disclosure",
90
92
  // sim create / resample / sample-key: keep the customer's sample key, or delete it now.
91
93
  "keep-key",
92
94
  "delete-key",
@@ -560,16 +562,20 @@ Reviewers:
560
562
  [--brief <text>] [--remap]
561
563
  automations remove <automation-id> --collection <id>
562
564
  automate options What an automation can be made of here: the triggers,
563
- and whether each one's events can come yet
565
+ whether each one's events can come yet, and templates
564
566
  automate list Your automations: an event, which ones it acts on,
565
567
  and what Letterpress then does
566
568
  automate show <automation-id>
567
- automate add --name <n> --trigger competitor_page|visitor_identified|issue_found|custom
568
- --prompt <what Letterpress does with each event> [--instruction <which events>]
569
+ automate add [--template post_new_issues|fix_new_issues|recommended_actions|competitor_pages|icp_visitors]
570
+ [--name <n>] [--trigger competitor_page|visitor_identified|issue_found|build_suggestion|custom]
571
+ [--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
569
572
  [--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
570
- [--hot-leads-only] [--off]
571
- Make one: it starts from now, and acts on its own
572
- automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--on|--off] ...
573
+ [--hot-leads-only] [--per-day <n>] [--off]
574
+ Make one (a template fills what you leave out): it starts
575
+ from now, acts on its own, and posts each event it acts on
576
+ to --slack-channel with its buttons
577
+ automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--slack-channel <C…>|none]
578
+ [--on|--off] ...
573
579
  automate try [<automation-id>] [--trigger <t> --prompt <text> --instruction <text> ...] [--limit <n>]
574
580
  What it would do with the latest events (acts on none)
575
581
  automate runs [--automation <id>] [--status acting|acted|skipped|failed|proposed|rejected] [--limit <n>]
@@ -1617,18 +1623,15 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
1617
1623
  repo prs [--repo owner/name] Every open PR (whoever opened it), longest-idle first
1618
1624
  repo suggestions Fixes found and not acted on yet, and how to start each
1619
1625
  repo settings [--action build|build_pr|build_merge|slack|linear] [--branch <name>|none] [--slack-agent <name|U…>|none]
1620
- [--slack-channel <C…>|none] [--slack-reports off|as_found|daily] [--reports-channel <C…>|none] [--autopilot-channel <C…>|none] [--listen <C…,C…>|none] [--autopilot on|off] [--autopilot-weekly <1-20>]
1626
+ [--slack-channel <C…>|none] [--autopilot-channel <C…>|none] [--listen <C…,C…>|none] [--autopilot on|off] [--autopilot-weekly <1-20>]
1621
1627
  [--autopilot-severity critical|warning] [--auto-merge 1h|12h|24h|3d|off] [--editor-auto-merge on|off]
1622
- [--reports-remedy report|fix_pr|fix_merge] [--recommendations on|off] [--recommendations-channel <C…>|none]
1623
- [--competitor-pages on|off] [--competitor-pages-mode relevant|all] [--competitor-pages-channel <C…>|none]
1624
1628
  The org's defaults for every fix: build (preview first),
1625
1629
  build_pr, or slack (post it to --slack-channel for your
1626
1630
  own agent, tagging --slack-agent), and the branch changes go to;
1627
1631
  --auto-merge merges Letter's PRs once open that long;
1628
- --editor-auto-merge merges Letter Edit's (⌘L) changes once ready;
1629
- Slack's automations: new issues (--slack-reports, and
1630
- --reports-remedy to fix them on their own), recommended
1631
- actions, and competitors' new pages, each with a channel
1632
+ --editor-auto-merge merges Letter Edit's (⌘L) changes once ready.
1633
+ What Letter posts to Slack on its own is an automation:
1634
+ automate add --template … --slack-channel <C…>
1632
1635
  repo slack-targets Slack channels and people Send to Slack can use, with ids
1633
1636
  repo slack-test Post a test into the Send to Slack channel
1634
1637
  repo start --repo <owner/name> [--gitlab] --instructions <text>|--instructions-file <path|->
@@ -1726,6 +1729,7 @@ Bench (Benches: open-source benchmarks on their own domains, kept running; @lett
1726
1729
  The repo lives on your organization's GitHub
1727
1730
  bench show <id> Spec, domain, repo, site, results, recent events
1728
1731
  bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file <path>] [--domain <d>] [--every <days>]
1732
+ [--disclosure "<text>"|--disclosure-file <path>|--no-disclosure] The README's optional ## Disclosure
1729
1733
  bench pause <id> | bench resume <id> | bench archive <id>
1730
1734
  bench advance <id> [--retry] Move it on now; --retry once blocked_on is done
1731
1735
  bench run <id> [--note "<what else to do>"] Letterpress-1 runs the benchmark again
@@ -7,7 +7,8 @@
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", "custom"];
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"];
11
12
  const STATUSES = ["pending", "proposed", "acting", "acted", "skipped", "failed", "rejected"];
12
13
 
13
14
  const triggerParams = {
@@ -17,8 +18,18 @@ const triggerParams = {
17
18
  hosts: { flag: "site", type: "list" },
18
19
  hot_leads_only: { flag: "hot-leads-only", type: "bool" },
19
20
  event: { flag: "event" },
21
+ per_day: { flag: "per-day", type: "num" },
20
22
  },
21
23
  };
24
+ // --slack-channel C0123ABCD (repo slack-targets), or none to post nothing.
25
+ const slackChannel = {
26
+ value: (flags) =>
27
+ flags["slack-channel"] === undefined
28
+ ? undefined
29
+ : flags["slack-channel"] === "none"
30
+ ? null
31
+ : String(flags["slack-channel"]),
32
+ };
22
33
  const enabled = { value: (flags) => (flags.off === true ? false : flags.on === true ? true : undefined) };
23
34
 
24
35
  /** --fact plan=team --fact seats=40 → { plan: "team", seats: 40 } (numbers and true/false read as such). */
@@ -50,11 +61,13 @@ export const ARGS = {
50
61
  automation_id: { positional: 0, label: "automation-id", required: true },
51
62
  },
52
63
  create_event_automation: {
53
- name: { flag: "name", required: true },
54
- trigger: { flag: "trigger", required: true, enum: TRIGGERS },
64
+ template: { flag: "template", enum: TEMPLATES },
65
+ name: { flag: "name" },
66
+ trigger: { flag: "trigger", enum: TRIGGERS },
55
67
  trigger_params: triggerParams,
56
68
  instruction: { flag: "instruction" },
57
- prompt: { flag: "prompt", required: true },
69
+ prompt: { flag: "prompt" },
70
+ slack_channel: slackChannel,
58
71
  enabled,
59
72
  },
60
73
  update_event_automation: {
@@ -63,6 +76,7 @@ export const ARGS = {
63
76
  trigger_params: triggerParams,
64
77
  instruction: { flag: "instruction" },
65
78
  prompt: { flag: "prompt" },
79
+ slack_channel: slackChannel,
66
80
  enabled,
67
81
  },
68
82
  delete_event_automation: {
@@ -74,6 +88,7 @@ export const ARGS = {
74
88
  trigger_params: triggerParams,
75
89
  instruction: { flag: "instruction" },
76
90
  prompt: { flag: "prompt" },
91
+ slack_channel: slackChannel,
77
92
  limit: { flag: "limit", type: "num" },
78
93
  },
79
94
  list_automation_runs: {
@@ -10,6 +10,7 @@
10
10
  // letterstory bench list
11
11
  // letterstory bench show <id>
12
12
  // letterstory bench update <id> [--name <n>] [--slug <s>] [--repo-owner <o>] [--repo-name <r>] [--spec-file spec.json] [--domain <d>] [--every <days>]
13
+ // [--disclosure "<README disclosure text>" | --no-disclosure]
13
14
  // letterstory bench pause <id> | resume <id> | archive <id>
14
15
  // letterstory bench advance <id> [--retry]
15
16
  // letterstory bench run <id> [--note "add Qdrant as a contender"]
@@ -61,6 +62,14 @@ export const ARGS = {
61
62
  spec: { value: specFromFile },
62
63
  domain: "domain",
63
64
  rerun_every_days: { flag: "every", type: "num" },
65
+ // The README's disclosure: text sets it, --no-disclosure removes it (the default is none).
66
+ disclosure: {
67
+ value: (flags) => {
68
+ if (flags["no-disclosure"] === true) return null;
69
+ const text = readTextInput(flags, "disclosure", "disclosure-file");
70
+ return text === undefined ? undefined : text;
71
+ },
72
+ },
64
73
  status: { flag: "status", enum: ["live", "paused", "archived"] },
65
74
  },
66
75
  advance_bench: { bench_id: benchId, retry: { flag: "retry", type: "bool" } },
@@ -96,7 +105,12 @@ export async function cmdBench(ctx) {
96
105
  case "show":
97
106
  return benchShow(rest, await call(rest, "get_bench"));
98
107
  case "update":
99
- refuseUnknownFlags(rest, ARGS.update_bench, ["spec-file"]);
108
+ refuseUnknownFlags(rest, ARGS.update_bench, [
109
+ "spec-file",
110
+ "disclosure",
111
+ "disclosure-file",
112
+ "no-disclosure",
113
+ ]);
100
114
  return benchShow(rest, await call(rest, "update_bench"));
101
115
  case "pause":
102
116
  case "resume":
@@ -169,37 +169,7 @@ const ARGS = {
169
169
  slack_channel: {
170
170
  value: (flags) => (flags["slack-channel"] === "none" ? null : flagStr(flags["slack-channel"])),
171
171
  },
172
- // --slack-reports off|as_found|daily
173
- slack_reports: { flag: "slack-reports", enum: ["off", "as_found", "daily"] },
174
- // --reports-channel C…|none, --autopilot-channel C…|none (none = the fix channel)
175
- slack_reports_channel: {
176
- value: (flags) => (flags["reports-channel"] === "none" ? null : flagStr(flags["reports-channel"])),
177
- },
178
- // --reports-remedy report|fix_pr|fix_merge: ask, or fix it (PR, or PR and merge) and report the change
179
- slack_reports_remedy: { flag: "reports-remedy", enum: ["report", "fix_pr", "fix_merge"] },
180
- // --recommendations on|off, --recommendations-channel C…|none
181
- slack_recommendations: {
182
- value: (flags) =>
183
- flags.recommendations === undefined
184
- ? undefined
185
- : ["on", "true", "1"].includes(String(flags.recommendations)),
186
- },
187
- slack_recommendations_channel: {
188
- value: (flags) =>
189
- flags["recommendations-channel"] === "none" ? null : flagStr(flags["recommendations-channel"]),
190
- },
191
- // --competitor-pages on|off, --competitor-pages-mode relevant|all, --competitor-pages-channel C…|none
192
- slack_competitor_pages: {
193
- value: (flags) =>
194
- flags["competitor-pages"] === undefined
195
- ? undefined
196
- : ["on", "true", "1"].includes(String(flags["competitor-pages"])),
197
- },
198
- slack_competitor_pages_mode: { flag: "competitor-pages-mode", enum: ["relevant", "all"] },
199
- slack_competitor_pages_channel: {
200
- value: (flags) =>
201
- flags["competitor-pages-channel"] === "none" ? null : flagStr(flags["competitor-pages-channel"]),
202
- },
172
+ // --autopilot-channel C…|none (none = the fix channel)
203
173
  // --listen C…,C… (the full list), or --listen none
204
174
  slack_listening_channels: {
205
175
  value: (flags) =>
@@ -862,14 +832,6 @@ async function repoSettings(ctx) {
862
832
  "branch",
863
833
  "slack-agent",
864
834
  "slack-channel",
865
- "slack-reports",
866
- "reports-channel",
867
- "reports-remedy",
868
- "recommendations",
869
- "recommendations-channel",
870
- "competitor-pages",
871
- "competitor-pages-mode",
872
- "competitor-pages-channel",
873
835
  "autopilot-channel",
874
836
  "listen",
875
837
  "autopilot",
package/lib/documents.mjs CHANGED
@@ -65,6 +65,8 @@ export const DOCUMENT_FLAG_PAIRS = [
65
65
  ["instructions", "instructions-file"],
66
66
  // A bench's prompt (bench.mjs `bench create`): what the benchmark is and how it works, prose.
67
67
  ["prompt", "prompt-file"],
68
+ // A bench's README disclosure (bench.mjs `bench create|update --disclosure-file`): prose.
69
+ ["disclosure", "disclosure-file"],
68
70
  ];
69
71
 
70
72
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.175.17",
3
+ "version": "0.175.19",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",