@letterstory/cli 0.177.211 → 0.177.213
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 +4 -4
- package/lib/commands/automate.mjs +4 -0
- package/lib/commands/repo.mjs +20 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.213";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -806,15 +806,15 @@ Reviewers:
|
|
|
806
806
|
and what Letterpress then does
|
|
807
807
|
automate show <automation-id>
|
|
808
808
|
automate add [--template post_new_issues|recommended_actions|competitor_pages|competitor_takes|
|
|
809
|
-
competitor_changes|icp_visitors|icp_followups|vc_visitors|transact_questions|plan_updates|weekly_release_notes|weekly_growth_brief|monthly_page_refresh|
|
|
809
|
+
competitor_changes|icp_visitors|icp_followups|vc_visitors|transact_questions|idea_previews|plan_updates|weekly_release_notes|weekly_growth_brief|monthly_page_refresh|
|
|
810
810
|
relink_posts|mention_revisions|fix_autopilot|auto_plan|ai_portrayal] [--letterbase <id>|--host <site>]
|
|
811
811
|
[--name <n>] [--trigger competitor_page|competitor_change|visitor_identified|issue_found|build_suggestion|plan_update|post_ready|
|
|
812
|
-
transact_ask|custom|schedule]
|
|
812
|
+
preview_ready|transact_ask|custom|schedule]
|
|
813
813
|
[--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
|
|
814
814
|
[--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
|
|
815
815
|
[--every <n> --unit hours|days|weeks|months] [--facts <a,b>] [--recipe <id>]
|
|
816
816
|
[--fit-run <run-id> --publication-host <site>]
|
|
817
|
-
[--hot-leads-only] [--icp] [--delivery live|daily --delivery-hour <0-23> --timezone <zone>] [--not-in-sources-only]
|
|
817
|
+
[--hot-leads-only] [--icp] [--delivery live|daily --delivery-hour <0-23> --timezone <zone>] [--not-in-sources-only] [--started-by letter|anyone]
|
|
818
818
|
[--per-day <n>] [--backfill all|<YYYY-MM-DD>] [--off]
|
|
819
819
|
Make one (a template fills what you leave out): it starts
|
|
820
820
|
from now (--backfill also runs it on past events, oldest
|
|
@@ -18,6 +18,7 @@ const TRIGGERS = [
|
|
|
18
18
|
"build_suggestion",
|
|
19
19
|
"plan_update",
|
|
20
20
|
"post_ready",
|
|
21
|
+
"preview_ready",
|
|
21
22
|
"transact_ask",
|
|
22
23
|
"custom",
|
|
23
24
|
"schedule",
|
|
@@ -33,6 +34,7 @@ const TEMPLATES = [
|
|
|
33
34
|
"icp_followups",
|
|
34
35
|
"vc_visitors",
|
|
35
36
|
"transact_questions",
|
|
37
|
+
"idea_previews",
|
|
36
38
|
"plan_updates",
|
|
37
39
|
"weekly_release_notes",
|
|
38
40
|
"weekly_growth_brief",
|
|
@@ -55,6 +57,8 @@ const triggerParams = {
|
|
|
55
57
|
// --post-letterbase <id>: post_ready only for these letterbases (--letterbase is a job's scope).
|
|
56
58
|
collections: { flag: "post-letterbase", type: "list" },
|
|
57
59
|
hosts: { flag: "site", type: "list" },
|
|
60
|
+
// --started-by letter|anyone: preview_ready only for builds Letter started on its own (the default), or every build.
|
|
61
|
+
started_by: { flag: "started-by", enum: ["letter", "anyone"] },
|
|
58
62
|
hot_leads_only: { flag: "hot-leads-only", type: "bool" },
|
|
59
63
|
// --not-in-sources-only: transact_ask only for questions the sources didn't answer.
|
|
60
64
|
not_in_sources_only: { flag: "not-in-sources-only", type: "bool" },
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
// repo delete-secret → delete_repo_preview_secret
|
|
22
22
|
// repo suggestions → list_suggested_fixes
|
|
23
23
|
// repo settings → get_repo_change_settings, or set_repo_change_settings with --action / --branch
|
|
24
|
+
// repo merge-default [once_ready|window|by_hand|org] → get_merge_default, or set_merge_default
|
|
24
25
|
// repo slack-targets → list_slack_fix_targets repo slack-test → send_slack_test_message
|
|
25
26
|
|
|
26
27
|
import { readFileSync } from "node:fs";
|
|
@@ -208,6 +209,11 @@ const ARGS = {
|
|
|
208
209
|
action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
|
|
209
210
|
},
|
|
210
211
|
get_repo_change_settings: {},
|
|
212
|
+
get_merge_default: {},
|
|
213
|
+
// repo merge-default once_ready|window|by_hand, or org for the organization's: the tool's null.
|
|
214
|
+
set_merge_default: {
|
|
215
|
+
merge: { value: (_flags, positionals) => (positionals[0] === "org" ? null : positionals[0]) },
|
|
216
|
+
},
|
|
211
217
|
list_suggested_fixes: {},
|
|
212
218
|
// --query gtm: only the channels named like it (a big workspace's whole list is long).
|
|
213
219
|
list_slack_fix_targets: { query: "query" },
|
|
@@ -456,6 +462,8 @@ export async function cmdRepo(ctx) {
|
|
|
456
462
|
return repoPrs(rest);
|
|
457
463
|
case "settings":
|
|
458
464
|
return repoSettings(rest);
|
|
465
|
+
case "merge-default":
|
|
466
|
+
return repoMergeDefault(rest);
|
|
459
467
|
case "suggestions":
|
|
460
468
|
return repoSuggestions(rest);
|
|
461
469
|
case "slack-targets":
|
|
@@ -468,7 +476,7 @@ export async function cmdRepo(ctx) {
|
|
|
468
476
|
return repoDeploy(rest);
|
|
469
477
|
default:
|
|
470
478
|
throw new CliError(
|
|
471
|
-
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, deploy, list, publish, merge, retry, revise, address-reviews, say, cancel, repos, branches, prs, settings, suggestions, slack-targets, slack-test, slack-delete, connect, disconnect`
|
|
479
|
+
`Unknown repo subcommand: ${sub ?? "(none)"}. Try: start, fix-audit, install-letterprove, install-visitors, sites, set-site, reset-site, secrets, set-secret, delete-secret, status, deploy, list, publish, merge, retry, revise, address-reviews, say, cancel, repos, branches, prs, settings, merge-default, suggestions, slack-targets, slack-test, slack-delete, connect, disconnect`
|
|
472
480
|
);
|
|
473
481
|
}
|
|
474
482
|
}
|
|
@@ -1040,6 +1048,17 @@ async function repoSettings(ctx) {
|
|
|
1040
1048
|
return 0;
|
|
1041
1049
|
}
|
|
1042
1050
|
|
|
1051
|
+
/** `repo merge-default [once_ready|window|by_hand|org]`: the member's own merge default, read or set. */
|
|
1052
|
+
async function repoMergeDefault(ctx) {
|
|
1053
|
+
const { client, flags, io } = ctx;
|
|
1054
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
1055
|
+
const result = ctx.positionals.length
|
|
1056
|
+
? await client.callTool("set_merge_default", argsFromFlags(ARGS.set_merge_default, flags, ctx.positionals))
|
|
1057
|
+
: await client.callTool("get_merge_default", {});
|
|
1058
|
+
printResult(io, flags, result, (r) => `Your merge default: ${r.merge ?? "the organization's"}`);
|
|
1059
|
+
return 0;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1043
1062
|
/** `repo suggestions`: fixes found and not acted on yet, and the command that starts each. */
|
|
1044
1063
|
async function repoSuggestions(ctx) {
|
|
1045
1064
|
const { client, flags, io } = ctx;
|