@letterstory/cli 0.124.0 → 0.126.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
@@ -61,7 +61,7 @@ import {
61
61
  } from "./commands.mjs";
62
62
 
63
63
  // Keep in sync with cli/package.json.
64
- export const VERSION = "0.124.0";
64
+ export const VERSION = "0.126.0";
65
65
 
66
66
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
67
67
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -96,6 +96,7 @@ export const BOOLEAN_FLAGS = new Set([
96
96
  "own-beat",
97
97
  "refresh",
98
98
  "preview",
99
+ "with-preview",
99
100
  "accept",
100
101
  "help",
101
102
  "version",
@@ -1312,8 +1313,9 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
1312
1313
  repo slack-test Post a test into the Send to Slack channel
1313
1314
  repo start --repo <owner/name> --instructions <text>|--instructions-file <path|->
1314
1315
  [--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]...
1315
- [--action build|build_pr|build_merge|slack|linear] [--wait]
1316
+ [--action build|build_pr|build_merge|slack|linear] [--with-preview] [--wait]
1316
1317
  Start a change (attached files go to the sandbox);
1318
+ --with-preview keeps a preview up next to the PR;
1317
1319
  --wait follows it to the PR
1318
1320
  repo fix-audit --issue <issue-type>... [--audit <id>] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
1319
1321
  One PR fixing site-audit issues (repeat --issue to bundle) on every affected page,
@@ -1336,6 +1338,8 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
1336
1338
  repo list [--status running|succeeded|no_changes|failed|cancelled] [--limit n] [--audit <id>]
1337
1339
  [--source site_audit_issue|site_quick_check|letterprove_install]
1338
1340
  repo publish <run-id> Make PR on a preview in review
1341
+ repo revise <run-id> --instructions <text>|--instructions-file <path|->
1342
+ Ask for more on a preview; it takes over the preview's link
1339
1343
  repo cancel <run-id> Stop it and delete the sandbox; no PR (Discard a preview)
1340
1344
 
1341
1345
  Feedback (tell us what's broken, missing, unclear, or wanted):
@@ -4,6 +4,7 @@
4
4
  // repo activity → get_repo_change_activity (what the sandbox is doing; --follow polls)
5
5
  // repo list → list_repo_changes repo cancel → cancel_repo_change
6
6
  // repo publish → publish_repo_change (Make PR on a preview)
7
+ // repo revise → revise_repo_change (ask for more on a preview, before the PR)
7
8
  // repo repos → list_github_app_repos repo branches → list_repo_branches
8
9
  // repo prs → list_open_pull_requests (every open PR, whoever opened it)
9
10
  // repo install-letterprove → letterprove_open_install_pr
@@ -62,6 +63,8 @@ const ARGS = {
62
63
  files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
63
64
  action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
64
65
  preview: { flag: "preview", type: "bool" },
66
+ // --with-preview: the PR opens straight away and a preview of the change stays up next to it.
67
+ with_preview: { flag: "with-preview", type: "bool" },
65
68
  },
66
69
  create_repo_change_upload: { file_names: { internal: "the basenames of the --attach files" } },
67
70
  list_repo_sites: {},
@@ -167,6 +170,10 @@ const ARGS = {
167
170
  get_repo_change_activity: { run_id: { positional: 0, required: true, label: "run-id" } },
168
171
  cancel_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
169
172
  publish_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
173
+ revise_repo_change: {
174
+ run_id: { positional: 0, required: true, label: "run-id" },
175
+ instructions: { value: (flags) => readTextInput(flags, "instructions", "instructions-file") },
176
+ },
170
177
  list_repo_changes: {
171
178
  status: { flag: "status", enum: ["running", "succeeded", "no_changes", "failed", "cancelled", "sent"] },
172
179
  limit: { flag: "limit", type: "num" },
@@ -195,8 +202,14 @@ function describe(run) {
195
202
  `${run.id} ${run.repo}@${run.baseBranch} ${run.status} (${run.phase}) $${run.costUsd.toFixed(2)}`,
196
203
  ];
197
204
  if (run.preview?.url) lines.push(` Preview: ${run.preview.url}`);
205
+ for (const [i, change] of (run.preview?.changes ?? []).entries())
206
+ lines.push(` ${i + 1}. ${change.path} ${change.note}${change.url ? ` ${change.url}` : ""}`);
198
207
  if (run.preview?.state === "failed") lines.push(` Preview failed: ${run.preview.detail ?? ""}`);
199
- if (run.phase === "review") lines.push(` Make PR: letterstory repo publish ${run.id}`);
208
+ if (run.preview?.revisionRunId) lines.push(` Follow-up being built: ${run.preview.revisionRunId}`);
209
+ else if (run.phase === "review") {
210
+ lines.push(` Make PR: letterstory repo publish ${run.id}`);
211
+ lines.push(` Ask for more: letterstory repo revise ${run.id} --instructions "…"`);
212
+ }
200
213
  if (run.prUrl) lines.push(` PR: ${run.prUrl} (${run.prState ?? "state unknown"})`);
201
214
  if (run.errorCode) lines.push(` Error (${run.errorCode}): ${run.errorDetail ?? ""}`);
202
215
  if (run.summary) lines.push(...run.summary.split("\n").map((l) => ` ${l}`));
@@ -235,6 +248,8 @@ export async function cmdRepo(ctx) {
235
248
  return repoCancel(rest);
236
249
  case "publish":
237
250
  return repoPublish(rest);
251
+ case "revise":
252
+ return repoRevise(rest);
238
253
  case "repos":
239
254
  return repoRepos(rest);
240
255
  case "branches":
@@ -307,6 +322,7 @@ async function repoStart(ctx) {
307
322
  "attach-url",
308
323
  "action",
309
324
  "preview",
325
+ "with-preview",
310
326
  "wait",
311
327
  ]);
312
328
  const files = [
@@ -549,6 +565,17 @@ async function repoPublish(ctx) {
549
565
  return 0;
550
566
  }
551
567
 
568
+ /** `repo revise <run-id> --instructions <text>`: a follow-up on a preview, built on top of it. */
569
+ async function repoRevise(ctx) {
570
+ const { client, flags, io } = ctx;
571
+ const args = argsFromFlags(ARGS.revise_repo_change, flags, ctx.positionals);
572
+ if (!args.instructions) throw new CliError("Missing --instructions (or --instructions-file <path|->)");
573
+ const result = await client.callTool("revise_repo_change", args);
574
+ ok(ctx, result.message);
575
+ printResult(io, flags, result.run, describe);
576
+ return 0;
577
+ }
578
+
552
579
  async function repoRepos(ctx) {
553
580
  const { client, flags, io } = ctx;
554
581
  const result = await client.callTool("list_github_app_repos", argsFromFlags(ARGS.list_github_app_repos, flags));
@@ -178,6 +178,8 @@ const ARGS = {
178
178
  base_branch: { flag: "base-branch" },
179
179
  preview: { flag: "preview", type: "bool" },
180
180
  action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
181
+ // --with-preview: the PR opens straight away and a preview of the fix stays up next to it.
182
+ with_preview: { flag: "with-preview", type: "bool" },
181
183
  },
182
184
  };
183
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.124.0",
3
+ "version": "0.126.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",