@letterstory/cli 0.130.0 → 0.131.1

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.1";
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|->
@@ -110,6 +110,10 @@ export const ARGS = {
110
110
  ...fields,
111
111
  },
112
112
  list_generator_starters: {},
113
+ get_generator_version: {
114
+ generator_id: { positional: 0, label: "enclosure-id", required: true },
115
+ version: { value: (_flags, positionals) => Number(requirePositional(positionals, 1, "version")) },
116
+ },
113
117
  add_generator_version: {
114
118
  generator_id: { positional: 0, label: "enclosure-id", required: true },
115
119
  script: { value: (flags) => readTextInput(flags, "script", "script-file") },
@@ -173,6 +177,7 @@ const USAGE = `Usage: enclosures <list|show|create|update|prints>
173
177
  enclosures prints <enclosure-id> [--status done|failed|no_fit|…] [--limit <n>]
174
178
  enclosures starters
175
179
  enclosures create --starter site_audit --login <app-id> Begin from a starter (its version 1 included)
180
+ enclosures version <enclosure-id> <n> One version in full: its steps and the script prints replay
176
181
  enclosures add-version <enclosure-id> (--script <code>|--script-file <path>) --step <text>… [--host <h>…] [--summary <s>]
177
182
  enclosures approve <enclosure-id> --version <n>
178
183
  enclosures print <enclosure-id> (--prospect <id>…|--list <list-id>) [--version <n>] [--redo] [--dry-run]
@@ -201,6 +206,8 @@ export async function cmdEnclosures(ctx) {
201
206
  return enclosuresApps(rest);
202
207
  case "starters":
203
208
  return enclosuresStarters(rest);
209
+ case "version":
210
+ return enclosuresVersion(rest);
204
211
  case "add-version":
205
212
  return enclosuresAddVersion(rest);
206
213
  case "approve":
@@ -346,6 +353,28 @@ async function enclosuresStarters(ctx) {
346
353
  return 0;
347
354
  }
348
355
 
356
+ async function enclosuresVersion(ctx) {
357
+ const { client, flags, positionals, io } = ctx;
358
+ refuseUnknownFlags(ctx, ARGS.get_generator_version, []);
359
+ const result = await client.callTool(
360
+ "get_generator_version",
361
+ argsFromFlags(ARGS.get_generator_version, flags, positionals)
362
+ );
363
+ printResult(io, flags, result, ({ version: v }) =>
364
+ [
365
+ `version ${v.version} (${v.author})${v.current ? ", prints run this one" : ""}${v.change_summary ? `: ${v.change_summary}` : ""}`,
366
+ ...v.steps.map((s) => ` ${s.n}. ${s.text}${s.screenshot_url ? ` ${s.screenshot_url}` : ""}`),
367
+ v.allowed_hosts.length ? ` hosts: ${v.allowed_hosts.join(", ")}` : null,
368
+ v.region ? ` region: ${v.region.selectors.join(", ")}` : null,
369
+ "",
370
+ v.script,
371
+ ]
372
+ .filter((l) => l !== null)
373
+ .join("\n")
374
+ );
375
+ return 0;
376
+ }
377
+
349
378
  async function enclosuresAddVersion(ctx) {
350
379
  const { client, flags, positionals, io } = ctx;
351
380
  refuseUnknownFlags(ctx, ARGS.add_generator_version, ["script", "script-file", "step", "region-selector"]);
@@ -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.1",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",