@letterstory/cli 0.177.210 → 0.177.212

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
@@ -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.210";
96
+ export const VERSION = "0.177.212";
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;
@@ -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;
@@ -17,7 +17,7 @@
17
17
  // site highlight <domain> [--off] → set_competitor_highlight
18
18
  // site prospect <url> → read_prospect_site (staff: any company's site, no account, nothing stored)
19
19
  // site suggest <host> --idea <id> | --draft-id <id>… | --pattern <folder> | --item <id> --path <p>
20
- // | --new-page <folder> --words "<what the page is>" [--auto-merge | --keep-open] → start_suggestion
20
+ // | --new-page <folder> --words "<what the page is>" [--merge once_ready|window|by_hand] → start_suggestion
21
21
 
22
22
  import { writeFileSync } from "node:fs";
23
23
 
@@ -229,7 +229,9 @@ const ARGS = {
229
229
  return folder ? { folder: String(folder), words: String(words ?? "") } : undefined;
230
230
  },
231
231
  },
232
- // --auto-merge / --keep-open: the Auto-merge box; left out, the organization's default.
232
+ // --merge once_ready | window | by_hand: Build's merge box; --auto-merge / --keep-open, its older two-way form.
233
+ // Left out, the organization's default.
234
+ merge: { flag: "merge", enum: ["once_ready", "window", "by_hand"] },
233
235
  auto_merge: { flag: "auto-merge", type: "bool", negate: "keep-open" },
234
236
  },
235
237
  fix_site_observations: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.210",
3
+ "version": "0.177.212",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",