@letterstory/cli 0.130.0 → 0.131.0

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
@@ -62,7 +62,7 @@ import {
62
62
  } from "./commands.mjs";
63
63
 
64
64
  // Keep in sync with cli/package.json.
65
- export const VERSION = "0.130.0";
65
+ export const VERSION = "0.131.0";
66
66
 
67
67
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
68
68
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -1355,10 +1355,11 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
1355
1355
  repo suggestions Fixes found and not acted on yet, and how to start each
1356
1356
  repo settings [--action build|build_pr|build_merge|slack|linear] [--branch <name>|none] [--slack-agent <name|U…>|none]
1357
1357
  [--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>]
1358
- [--autopilot-severity critical|warning]
1358
+ [--autopilot-severity critical|warning] [--auto-merge 1h|12h|24h|3d|off]
1359
1359
  The org's defaults for every fix: build (preview first),
1360
1360
  build_pr, or slack (post it to --slack-channel for your
1361
- own agent, tagging --slack-agent), and the branch changes go to
1361
+ own agent, tagging --slack-agent), and the branch changes go to;
1362
+ --auto-merge merges Letter's PRs once open that long
1362
1363
  repo slack-targets Slack channels and people Send to Slack can use, with ids
1363
1364
  repo slack-test Post a test into the Send to Slack channel
1364
1365
  repo start --repo <owner/name> --instructions <text>|--instructions-file <path|->
@@ -165,6 +165,8 @@ const ARGS = {
165
165
  value: (flags) => (flags["autopilot-weekly"] === undefined ? undefined : Number(flags["autopilot-weekly"])),
166
166
  },
167
167
  autopilot_min_severity: { flag: "autopilot-severity", enum: ["critical", "warning"] },
168
+ // --auto-merge 1h|12h|24h|3d (or the hours: 1, 12, 24, 72), or --auto-merge off
169
+ auto_merge_after_hours: { value: (flags) => autoMergeHours(flags["auto-merge"]) },
168
170
  },
169
171
  get_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
170
172
  get_repo_change_activity: { run_id: { positional: 0, required: true, label: "run-id" } },
@@ -195,6 +197,16 @@ const ARGS = {
195
197
  },
196
198
  };
197
199
 
200
+ /** `--auto-merge`: off → null, 1h / 12h / 24h / 3d or plain hours → the hours; anything else is passed on for the tool to refuse. */
201
+ function autoMergeHours(value) {
202
+ if (value === undefined) return undefined;
203
+ const text = String(value).trim().toLowerCase();
204
+ if (["off", "none", "false", "0"].includes(text)) return null;
205
+ const match = /^(\d+)\s*(h|hours?|d|days?)?$/.exec(text);
206
+ if (!match) return text;
207
+ return Number(match[1]) * (match[2]?.startsWith("d") ? 24 : 1);
208
+ }
209
+
198
210
  const TERMINAL = new Set(["succeeded", "no_changes", "failed", "cancelled"]);
199
211
 
200
212
  function describe(run) {
@@ -634,6 +646,7 @@ async function repoSettings(ctx) {
634
646
  "autopilot",
635
647
  "autopilot-weekly",
636
648
  "autopilot-severity",
649
+ "auto-merge",
637
650
  ];
638
651
  refuseUnknownFlags(ctx, {}, settingFlags);
639
652
  const setting = settingFlags.some((f) => flags[f] !== undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.130.0",
3
+ "version": "0.131.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",