@letterstory/cli 0.175.4 → 0.175.6
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/README.md +1 -0
- package/lib/cli.mjs +20 -16
- package/lib/commands/automate.mjs +8 -21
- package/lib/commands/build.mjs +21 -0
- package/lib/commands/outbound.mjs +6 -1
- package/lib/commands/repo.mjs +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -868,6 +868,7 @@ letterstory mailers launch acme-mail.com --mailer "hello:Hello Team" --forward-t
|
|
|
868
868
|
letterstory mailers domains # every domain: setup job, mailers, warmup
|
|
869
869
|
letterstory mailers list [--domain acme.com] # status + daily send limit
|
|
870
870
|
letterstory mailers domain <owned-domain-id> # provisioning stage, DNS, mailers on it
|
|
871
|
+
letterstory mailers retry <owned-domain-id> # resume a failed setup from the step it stopped at
|
|
871
872
|
letterstory mailers messages <mailer-id> [--folder inbox|sent|all] [--limit 25] # envelopes
|
|
872
873
|
letterstory mailers message <mailer-id> <uid> --folder inbox # one message, plain-text body
|
|
873
874
|
letterstory mailers forward <mailer-id> --to me@acme.com # or --clear
|
package/lib/cli.mjs
CHANGED
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
} from "./commands.mjs";
|
|
78
78
|
|
|
79
79
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
80
|
-
export const VERSION = "0.175.
|
|
80
|
+
export const VERSION = "0.175.6";
|
|
81
81
|
|
|
82
82
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
83
83
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -554,22 +554,22 @@ Reviewers:
|
|
|
554
554
|
automations set <automation-id> --collection <id> [--pace <n>] [--pause | --resume] [--goal <id>]
|
|
555
555
|
[--brief <text>] [--remap]
|
|
556
556
|
automations remove <automation-id> --collection <id>
|
|
557
|
-
automate options What an automation can be made of here: triggers,
|
|
558
|
-
|
|
559
|
-
automate list Your automations: an event,
|
|
560
|
-
|
|
557
|
+
automate options What an automation can be made of here: the triggers,
|
|
558
|
+
and whether each one's events can come yet
|
|
559
|
+
automate list Your automations: an event, which ones it acts on,
|
|
560
|
+
and what Letterpress then does
|
|
561
561
|
automate show <automation-id>
|
|
562
|
-
automate add --name <n> --trigger competitor_page|visitor_identified|custom
|
|
563
|
-
--
|
|
564
|
-
[--
|
|
565
|
-
[--
|
|
566
|
-
Make one: it starts from now
|
|
567
|
-
automate set <automation-id> [--name <n>] [--instruction <text>] [--
|
|
568
|
-
automate try [<automation-id>] [--trigger <t> --
|
|
562
|
+
automate add --name <n> --trigger competitor_page|visitor_identified|issue_found|custom
|
|
563
|
+
--prompt <what Letterpress does with each event> [--instruction <which events>]
|
|
564
|
+
[--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
|
|
565
|
+
[--hot-leads-only] [--off]
|
|
566
|
+
Make one: it starts from now, and acts on its own
|
|
567
|
+
automate set <automation-id> [--name <n>] [--instruction <text>] [--prompt <text>] [--on|--off] ...
|
|
568
|
+
automate try [<automation-id>] [--trigger <t> --prompt <text> --instruction <text> ...] [--limit <n>]
|
|
569
569
|
What it would do with the latest events (acts on none)
|
|
570
|
-
automate runs [--automation <id>] [--status
|
|
570
|
+
automate runs [--automation <id>] [--status acting|acted|skipped|failed|proposed|rejected] [--limit <n>]
|
|
571
571
|
Every event read, what came of it and why
|
|
572
|
-
automate approve <run-id> Make the call a run
|
|
572
|
+
automate approve <run-id> Make the call a run left from asking first proposes
|
|
573
573
|
automate reject <run-id> --reason <why>
|
|
574
574
|
automate send <event-name> --title <what happened> [--key <id>] [--url <u>] [--fact k=v ...]
|
|
575
575
|
[--email <e>] [--person <name>] [--company <c>]
|
|
@@ -1506,6 +1506,7 @@ Mailers (the sending mailboxes):
|
|
|
1506
1506
|
admin (with this org's Vercel key unless --keep-vercel-key)
|
|
1507
1507
|
mailers list [--domain <apex>] Your mailers + status + daily send limit
|
|
1508
1508
|
mailers domain <owned-domain-id> Provisioning stage, DNS state, mailers on a domain
|
|
1509
|
+
mailers retry <owned-domain-id> Resume a domain's failed mail setup where it stopped
|
|
1509
1510
|
mailers messages <mailer-id> [--folder all|inbox|sent] [--limit <n>]
|
|
1510
1511
|
Recent mail (envelopes)
|
|
1511
1512
|
mailers message <mailer-id> <uid> --folder inbox|sent
|
|
@@ -1566,8 +1567,10 @@ Build (a change to your site, or launching what isn't code; the Build box's own
|
|
|
1566
1567
|
done by Build itself (a phantom site buys its own domain), and the
|
|
1567
1568
|
build reads Done with no PR to merge. --again repeats an open build's ask
|
|
1568
1569
|
build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness claude-code|letterpress-1]
|
|
1569
|
-
[--repo owner/name]
|
|
1570
|
+
[--repo owner/name] [--action build|build_pr|build_merge]
|
|
1570
1571
|
One turn of a conversation with Build (questions, follow-ups on a build)
|
|
1572
|
+
build cancel <build-id> Stop a build before it merges: what's being built stops, its
|
|
1573
|
+
preview goes, and its open pull request is closed unmerged
|
|
1571
1574
|
build benchmark <words…> [--prompt <text>] [--site <host>] [--agent letterpress-1|claude-code|codex]...
|
|
1572
1575
|
[--attach <path>]... [--attach-url <name>=<https url>]... [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
|
|
1573
1576
|
Staff only. The same prompt on Letterpress-1 (as Build runs it) and on
|
|
@@ -1610,13 +1613,14 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
1610
1613
|
repo suggestions Fixes found and not acted on yet, and how to start each
|
|
1611
1614
|
repo settings [--action build|build_pr|build_merge|slack|linear] [--branch <name>|none] [--slack-agent <name|U…>|none]
|
|
1612
1615
|
[--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>]
|
|
1613
|
-
[--autopilot-severity critical|warning] [--auto-merge 1h|12h|24h|3d|off]
|
|
1616
|
+
[--autopilot-severity critical|warning] [--auto-merge 1h|12h|24h|3d|off] [--editor-auto-merge on|off]
|
|
1614
1617
|
[--reports-remedy report|fix_pr|fix_merge] [--recommendations on|off] [--recommendations-channel <C…>|none]
|
|
1615
1618
|
[--competitor-pages on|off] [--competitor-pages-mode relevant|all] [--competitor-pages-channel <C…>|none]
|
|
1616
1619
|
The org's defaults for every fix: build (preview first),
|
|
1617
1620
|
build_pr, or slack (post it to --slack-channel for your
|
|
1618
1621
|
own agent, tagging --slack-agent), and the branch changes go to;
|
|
1619
1622
|
--auto-merge merges Letter's PRs once open that long;
|
|
1623
|
+
--editor-auto-merge merges Letter Edit's (⌘L) changes once ready;
|
|
1620
1624
|
Slack's automations: new issues (--slack-reports, and
|
|
1621
1625
|
--reports-remedy to fix them on their own), recommended
|
|
1622
1626
|
actions, and competitors' new pages, each with a channel
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// `automate` — Letterpress → Automations (docs/architecture/event-automations.md): an event, read
|
|
2
|
-
// against your instruction,
|
|
3
|
-
//
|
|
4
|
-
// automations are `automations`.)
|
|
2
|
+
// against your filter (--instruction), then done by Letterpress as your prompt (--prompt) says.
|
|
3
|
+
// options / list / show / add / set / try / runs / approve / reject / send / remove, through the
|
|
4
|
+
// same tools the app uses. (A letterbase's writing automations are `automations`.)
|
|
5
5
|
// Same flag/positional/io conventions as posts.mjs — no commander, no color.
|
|
6
6
|
|
|
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", "custom"];
|
|
11
|
-
const
|
|
12
|
-
const REVIEW = ["act", "ask"];
|
|
13
|
-
const STATUSES = ["pending", "proposed", "acted", "skipped", "failed", "rejected"];
|
|
10
|
+
const TRIGGERS = ["competitor_page", "visitor_identified", "issue_found", "custom"];
|
|
11
|
+
const STATUSES = ["pending", "proposed", "acting", "acted", "skipped", "failed", "rejected"];
|
|
14
12
|
|
|
15
13
|
const triggerParams = {
|
|
16
14
|
object: {
|
|
@@ -21,13 +19,6 @@ const triggerParams = {
|
|
|
21
19
|
event: { flag: "event" },
|
|
22
20
|
},
|
|
23
21
|
};
|
|
24
|
-
const actionParams = {
|
|
25
|
-
object: {
|
|
26
|
-
collection_id: { flag: "collection" },
|
|
27
|
-
sequence_id: { flag: "sequence" },
|
|
28
|
-
host: { flag: "host" },
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
22
|
const enabled = { value: (flags) => (flags.off === true ? false : flags.on === true ? true : undefined) };
|
|
32
23
|
|
|
33
24
|
/** --fact plan=team --fact seats=40 → { plan: "team", seats: 40 } (numbers and true/false read as such). */
|
|
@@ -63,9 +54,7 @@ export const ARGS = {
|
|
|
63
54
|
trigger: { flag: "trigger", required: true, enum: TRIGGERS },
|
|
64
55
|
trigger_params: triggerParams,
|
|
65
56
|
instruction: { flag: "instruction" },
|
|
66
|
-
|
|
67
|
-
action_params: actionParams,
|
|
68
|
-
review: { flag: "review", enum: REVIEW },
|
|
57
|
+
prompt: { flag: "prompt", required: true },
|
|
69
58
|
enabled,
|
|
70
59
|
},
|
|
71
60
|
update_event_automation: {
|
|
@@ -73,8 +62,7 @@ export const ARGS = {
|
|
|
73
62
|
name: { flag: "name" },
|
|
74
63
|
trigger_params: triggerParams,
|
|
75
64
|
instruction: { flag: "instruction" },
|
|
76
|
-
|
|
77
|
-
review: { flag: "review", enum: REVIEW },
|
|
65
|
+
prompt: { flag: "prompt" },
|
|
78
66
|
enabled,
|
|
79
67
|
},
|
|
80
68
|
delete_event_automation: {
|
|
@@ -85,8 +73,7 @@ export const ARGS = {
|
|
|
85
73
|
trigger: { flag: "trigger", enum: TRIGGERS },
|
|
86
74
|
trigger_params: triggerParams,
|
|
87
75
|
instruction: { flag: "instruction" },
|
|
88
|
-
|
|
89
|
-
action_params: actionParams,
|
|
76
|
+
prompt: { flag: "prompt" },
|
|
90
77
|
limit: { flag: "limit", type: "num" },
|
|
91
78
|
},
|
|
92
79
|
list_automation_runs: {
|
package/lib/commands/build.mjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
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 cancel <id> → cancel_growth_build (stop it before it merges: its PR is closed)
|
|
7
8
|
// build benchmark <words…> → start_build_benchmark (staff only: Letterpress-1, stock Claude Code
|
|
8
9
|
// and stock Codex on the same prompt, each a preview)
|
|
9
10
|
// build benchmarks → list_build_benchmarks (staff only; --id <uuid> for one)
|
|
@@ -43,7 +44,10 @@ const ARGS = {
|
|
|
43
44
|
harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
|
|
44
45
|
// --repo owner/name: the repo you're working in, where a Proofs install goes.
|
|
45
46
|
repo: "repo",
|
|
47
|
+
// --action build|build_pr|build_merge: how a build this message starts is delivered (Letter Edit's auto-merge sends build_merge).
|
|
48
|
+
delivery: { flag: "action", enum: ["build", "build_pr", "build_merge"] },
|
|
46
49
|
},
|
|
50
|
+
cancel_growth_build: { id: { positional: 0, required: true, label: "build-id" } },
|
|
47
51
|
start_build_benchmark: {
|
|
48
52
|
prompt: { value: (flags, positionals) => flagStr(flags.prompt) ?? (positionals.join(" ").trim() || undefined) },
|
|
49
53
|
domain: "site",
|
|
@@ -73,6 +77,7 @@ async function attachedFiles(ctx) {
|
|
|
73
77
|
|
|
74
78
|
export async function cmdBuild(ctx) {
|
|
75
79
|
if (ctx.positionals[0] === "talk") return buildTalk({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
80
|
+
if (ctx.positionals[0] === "cancel") return buildCancel({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
76
81
|
if (ctx.positionals[0] === "benchmark") return buildBenchmark({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
77
82
|
if (ctx.positionals[0] === "benchmarks") return buildBenchmarks({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
78
83
|
return buildStart(ctx);
|
|
@@ -92,6 +97,21 @@ export function benchmarkLines(b) {
|
|
|
92
97
|
return lines.join("\n");
|
|
93
98
|
}
|
|
94
99
|
|
|
100
|
+
/** `build cancel <id>`: stop a build before anything of it merges (cancel_growth_build). */
|
|
101
|
+
async function buildCancel(ctx) {
|
|
102
|
+
const { client, flags, io } = ctx;
|
|
103
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
104
|
+
const args = argsFromFlags(ARGS.cancel_growth_build, flags, ctx.positionals);
|
|
105
|
+
const result = await client.callTool("cancel_growth_build", args);
|
|
106
|
+
printResult(io, flags, result, (r) =>
|
|
107
|
+
[
|
|
108
|
+
r.message,
|
|
109
|
+
...(r.changes ?? []).map((c) => ` ${c.outcome} ${c.title}${c.message ? `: ${c.message}` : ""}`),
|
|
110
|
+
].join("\n")
|
|
111
|
+
);
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
95
115
|
async function buildBenchmark(ctx) {
|
|
96
116
|
const { client, flags, io } = ctx;
|
|
97
117
|
refuseUnknownFlags(ctx, {}, ["prompt", "site", "agent", ...FILE_FLAGS]);
|
|
@@ -149,6 +169,7 @@ async function buildTalk(ctx) {
|
|
|
149
169
|
"subject",
|
|
150
170
|
"harness",
|
|
151
171
|
"repo",
|
|
172
|
+
"action",
|
|
152
173
|
...FILE_FLAGS,
|
|
153
174
|
]);
|
|
154
175
|
const files = await attachedFiles(ctx);
|
|
@@ -342,6 +342,9 @@ export const ARGS = {
|
|
|
342
342
|
get_mailer_domain_status: {
|
|
343
343
|
owned_domain_id: { positional: 0, label: "owned-domain-id", required: true },
|
|
344
344
|
},
|
|
345
|
+
retry_mailer_setup: {
|
|
346
|
+
owned_domain_id: { positional: 0, label: "owned-domain-id", required: true },
|
|
347
|
+
},
|
|
345
348
|
list_mailer_messages: {
|
|
346
349
|
mailer_id: { positional: 0, label: "mailer-id", required: true },
|
|
347
350
|
folder: { flag: "folder", enum: ["all", ...MAILER_FOLDERS] },
|
|
@@ -703,7 +706,7 @@ async function prospectsColumns(ctx, sub) {
|
|
|
703
706
|
}
|
|
704
707
|
}
|
|
705
708
|
|
|
706
|
-
const MAILERS_USAGE = `Usage: mailers <list|domains|domain|quote|launch|move|messages|message|forward|forwards|warmup|limit|retire|suppressions>`;
|
|
709
|
+
const MAILERS_USAGE = `Usage: mailers <list|domains|domain|retry|quote|launch|move|messages|message|forward|forwards|warmup|limit|retire|suppressions>`;
|
|
707
710
|
|
|
708
711
|
export async function cmdMailers(ctx) {
|
|
709
712
|
const sub = ctx.positionals[0];
|
|
@@ -716,6 +719,8 @@ export async function cmdMailers(ctx) {
|
|
|
716
719
|
return run(rest, "list_mail_domains");
|
|
717
720
|
case "domain":
|
|
718
721
|
return run(rest, "get_mailer_domain_status");
|
|
722
|
+
case "retry":
|
|
723
|
+
return run(rest, "retry_mailer_setup");
|
|
719
724
|
case "quote":
|
|
720
725
|
return run(rest, "quote_mail_domain");
|
|
721
726
|
case "move": {
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -234,6 +234,13 @@ const ARGS = {
|
|
|
234
234
|
autopilot_min_severity: { flag: "autopilot-severity", enum: ["critical", "warning"] },
|
|
235
235
|
// --auto-merge 1h|12h|24h|3d (or the hours: 1, 12, 24, 72), or --auto-merge off
|
|
236
236
|
auto_merge_after_hours: { value: (flags) => autoMergeHours(flags["auto-merge"]) },
|
|
237
|
+
// --editor-auto-merge on|off: Letter Edit's (⌘L) changes merge once they're ready
|
|
238
|
+
editor_auto_merge: {
|
|
239
|
+
value: (flags) =>
|
|
240
|
+
flags["editor-auto-merge"] === undefined
|
|
241
|
+
? undefined
|
|
242
|
+
: ["on", "true", "1"].includes(String(flags["editor-auto-merge"])),
|
|
243
|
+
},
|
|
237
244
|
},
|
|
238
245
|
get_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
239
246
|
get_repo_change_activity: {
|
|
@@ -853,6 +860,7 @@ async function repoSettings(ctx) {
|
|
|
853
860
|
"autopilot-weekly",
|
|
854
861
|
"autopilot-severity",
|
|
855
862
|
"auto-merge",
|
|
863
|
+
"editor-auto-merge",
|
|
856
864
|
];
|
|
857
865
|
refuseUnknownFlags(ctx, {}, settingFlags);
|
|
858
866
|
const setting = settingFlags.some((f) => flags[f] !== undefined);
|