@letterstory/cli 0.175.16 → 0.175.18
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 +15 -14
- package/lib/commands/automate.mjs +19 -4
- package/lib/commands/repo.mjs +1 -39
- package/lib/commands/vary.mjs +4 -1
- package/package.json +1 -1
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.
|
|
81
|
+
export const VERSION = "0.175.18";
|
|
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;
|
|
@@ -560,16 +560,20 @@ Reviewers:
|
|
|
560
560
|
[--brief <text>] [--remap]
|
|
561
561
|
automations remove <automation-id> --collection <id>
|
|
562
562
|
automate options What an automation can be made of here: the triggers,
|
|
563
|
-
|
|
563
|
+
whether each one's events can come yet, and templates
|
|
564
564
|
automate list Your automations: an event, which ones it acts on,
|
|
565
565
|
and what Letterpress then does
|
|
566
566
|
automate show <automation-id>
|
|
567
|
-
automate add --
|
|
568
|
-
--
|
|
567
|
+
automate add [--template post_new_issues|fix_new_issues|recommended_actions|competitor_pages|icp_visitors]
|
|
568
|
+
[--name <n>] [--trigger competitor_page|visitor_identified|issue_found|build_suggestion|custom]
|
|
569
|
+
[--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
|
|
569
570
|
[--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
|
|
570
|
-
[--hot-leads-only] [--off]
|
|
571
|
-
Make one
|
|
572
|
-
|
|
571
|
+
[--hot-leads-only] [--per-day <n>] [--off]
|
|
572
|
+
Make one (a template fills what you leave out): it starts
|
|
573
|
+
from now, acts on its own, and posts each event it acts on
|
|
574
|
+
to --slack-channel with its buttons
|
|
575
|
+
automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--slack-channel <C…>|none]
|
|
576
|
+
[--on|--off] ...
|
|
573
577
|
automate try [<automation-id>] [--trigger <t> --prompt <text> --instruction <text> ...] [--limit <n>]
|
|
574
578
|
What it would do with the latest events (acts on none)
|
|
575
579
|
automate runs [--automation <id>] [--status acting|acted|skipped|failed|proposed|rejected] [--limit <n>]
|
|
@@ -1617,18 +1621,15 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
1617
1621
|
repo prs [--repo owner/name] Every open PR (whoever opened it), longest-idle first
|
|
1618
1622
|
repo suggestions Fixes found and not acted on yet, and how to start each
|
|
1619
1623
|
repo settings [--action build|build_pr|build_merge|slack|linear] [--branch <name>|none] [--slack-agent <name|U…>|none]
|
|
1620
|
-
[--slack-channel <C…>|none] [--
|
|
1624
|
+
[--slack-channel <C…>|none] [--autopilot-channel <C…>|none] [--listen <C…,C…>|none] [--autopilot on|off] [--autopilot-weekly <1-20>]
|
|
1621
1625
|
[--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
1626
|
The org's defaults for every fix: build (preview first),
|
|
1625
1627
|
build_pr, or slack (post it to --slack-channel for your
|
|
1626
1628
|
own agent, tagging --slack-agent), and the branch changes go to;
|
|
1627
1629
|
--auto-merge merges Letter's PRs once open that long;
|
|
1628
|
-
--editor-auto-merge merges Letter Edit's (⌘L) changes once ready
|
|
1629
|
-
Slack
|
|
1630
|
-
|
|
1631
|
-
actions, and competitors' new pages, each with a channel
|
|
1630
|
+
--editor-auto-merge merges Letter Edit's (⌘L) changes once ready.
|
|
1631
|
+
What Letter posts to Slack on its own is an automation:
|
|
1632
|
+
automate add --template … --slack-channel <C…>
|
|
1632
1633
|
repo slack-targets Slack channels and people Send to Slack can use, with ids
|
|
1633
1634
|
repo slack-test Post a test into the Send to Slack channel
|
|
1634
1635
|
repo start --repo <owner/name> [--gitlab] --instructions <text>|--instructions-file <path|->
|
|
@@ -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
|
-
|
|
54
|
-
|
|
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"
|
|
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: {
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -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
|
-
// --
|
|
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/commands/vary.mjs
CHANGED
|
@@ -63,7 +63,10 @@ export const ARGS = {
|
|
|
63
63
|
site_id: "site",
|
|
64
64
|
status: { flag: "status", enum: ["draft", "running", "paused", "ended"] },
|
|
65
65
|
},
|
|
66
|
-
get_variational: {
|
|
66
|
+
get_variational: {
|
|
67
|
+
variational_id: variationalId,
|
|
68
|
+
with_results: { internal: "vary get shows where the test stands, so it always reads results" },
|
|
69
|
+
},
|
|
67
70
|
read_variational_page: { variational_id: variationalId },
|
|
68
71
|
create_variational: {
|
|
69
72
|
page_url: { flag: "page", required: true },
|