@letterstory/cli 0.124.0 → 0.125.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 +3 -1
- package/lib/commands/repo.mjs +25 -1
- package/package.json +1 -1
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.
|
|
64
|
+
export const VERSION = "0.125.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
|
|
@@ -1336,6 +1336,8 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
|
|
|
1336
1336
|
repo list [--status running|succeeded|no_changes|failed|cancelled] [--limit n] [--audit <id>]
|
|
1337
1337
|
[--source site_audit_issue|site_quick_check|letterprove_install]
|
|
1338
1338
|
repo publish <run-id> Make PR on a preview in review
|
|
1339
|
+
repo revise <run-id> --instructions <text>|--instructions-file <path|->
|
|
1340
|
+
Ask for more on a preview; it takes over the preview's link
|
|
1339
1341
|
repo cancel <run-id> Stop it and delete the sandbox; no PR (Discard a preview)
|
|
1340
1342
|
|
|
1341
1343
|
Feedback (tell us what's broken, missing, unclear, or wanted):
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -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
|
|
@@ -167,6 +168,10 @@ const ARGS = {
|
|
|
167
168
|
get_repo_change_activity: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
168
169
|
cancel_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
169
170
|
publish_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
171
|
+
revise_repo_change: {
|
|
172
|
+
run_id: { positional: 0, required: true, label: "run-id" },
|
|
173
|
+
instructions: { value: (flags) => readTextInput(flags, "instructions", "instructions-file") },
|
|
174
|
+
},
|
|
170
175
|
list_repo_changes: {
|
|
171
176
|
status: { flag: "status", enum: ["running", "succeeded", "no_changes", "failed", "cancelled", "sent"] },
|
|
172
177
|
limit: { flag: "limit", type: "num" },
|
|
@@ -195,8 +200,14 @@ function describe(run) {
|
|
|
195
200
|
`${run.id} ${run.repo}@${run.baseBranch} ${run.status} (${run.phase}) $${run.costUsd.toFixed(2)}`,
|
|
196
201
|
];
|
|
197
202
|
if (run.preview?.url) lines.push(` Preview: ${run.preview.url}`);
|
|
203
|
+
for (const [i, change] of (run.preview?.changes ?? []).entries())
|
|
204
|
+
lines.push(` ${i + 1}. ${change.path} ${change.note}${change.url ? ` ${change.url}` : ""}`);
|
|
198
205
|
if (run.preview?.state === "failed") lines.push(` Preview failed: ${run.preview.detail ?? ""}`);
|
|
199
|
-
if (run.
|
|
206
|
+
if (run.preview?.revisionRunId) lines.push(` Follow-up being built: ${run.preview.revisionRunId}`);
|
|
207
|
+
else if (run.phase === "review") {
|
|
208
|
+
lines.push(` Make PR: letterstory repo publish ${run.id}`);
|
|
209
|
+
lines.push(` Ask for more: letterstory repo revise ${run.id} --instructions "…"`);
|
|
210
|
+
}
|
|
200
211
|
if (run.prUrl) lines.push(` PR: ${run.prUrl} (${run.prState ?? "state unknown"})`);
|
|
201
212
|
if (run.errorCode) lines.push(` Error (${run.errorCode}): ${run.errorDetail ?? ""}`);
|
|
202
213
|
if (run.summary) lines.push(...run.summary.split("\n").map((l) => ` ${l}`));
|
|
@@ -235,6 +246,8 @@ export async function cmdRepo(ctx) {
|
|
|
235
246
|
return repoCancel(rest);
|
|
236
247
|
case "publish":
|
|
237
248
|
return repoPublish(rest);
|
|
249
|
+
case "revise":
|
|
250
|
+
return repoRevise(rest);
|
|
238
251
|
case "repos":
|
|
239
252
|
return repoRepos(rest);
|
|
240
253
|
case "branches":
|
|
@@ -549,6 +562,17 @@ async function repoPublish(ctx) {
|
|
|
549
562
|
return 0;
|
|
550
563
|
}
|
|
551
564
|
|
|
565
|
+
/** `repo revise <run-id> --instructions <text>`: a follow-up on a preview, built on top of it. */
|
|
566
|
+
async function repoRevise(ctx) {
|
|
567
|
+
const { client, flags, io } = ctx;
|
|
568
|
+
const args = argsFromFlags(ARGS.revise_repo_change, flags, ctx.positionals);
|
|
569
|
+
if (!args.instructions) throw new CliError("Missing --instructions (or --instructions-file <path|->)");
|
|
570
|
+
const result = await client.callTool("revise_repo_change", args);
|
|
571
|
+
ok(ctx, result.message);
|
|
572
|
+
printResult(io, flags, result.run, describe);
|
|
573
|
+
return 0;
|
|
574
|
+
}
|
|
575
|
+
|
|
552
576
|
async function repoRepos(ctx) {
|
|
553
577
|
const { client, flags, io } = ctx;
|
|
554
578
|
const result = await client.callTool("list_github_app_repos", argsFromFlags(ARGS.list_github_app_repos, flags));
|