@letterstory/cli 0.176.21 → 0.176.22
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 +1 -1
- package/lib/commands/repo.mjs +25 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
82
82
|
|
|
83
83
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
84
|
-
export const VERSION = "0.176.
|
|
84
|
+
export const VERSION = "0.176.22";
|
|
85
85
|
|
|
86
86
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
87
87
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// pull request by the Letter GitHub App (src/lib/repo-changes). One subcommand per tool:
|
|
3
3
|
// repo start → start_repo_change repo status → get_repo_change
|
|
4
4
|
// repo activity → get_repo_change_activity (what the sandbox is doing; --follow polls)
|
|
5
|
+
// repo diff → get_repo_change_diff (what it changed, line by line)
|
|
5
6
|
// repo list → list_repo_changes repo cancel → cancel_repo_change
|
|
6
7
|
// repo publish → publish_repo_change (Make PR on a preview)
|
|
7
8
|
// repo merge → merge_repo_change (merge its open PR, as a squash)
|
|
@@ -236,6 +237,7 @@ const ARGS = {
|
|
|
236
237
|
run_id: { positional: 0, required: true, label: "run-id" },
|
|
237
238
|
since: "since",
|
|
238
239
|
},
|
|
240
|
+
get_repo_change_diff: { run_id: { positional: 0, required: true, label: "run-id" } },
|
|
239
241
|
send_repo_change_message: {
|
|
240
242
|
run_id: { positional: 0, required: true, label: "run-id" },
|
|
241
243
|
message: {
|
|
@@ -338,6 +340,8 @@ export async function cmdRepo(ctx) {
|
|
|
338
340
|
return repoStatus(rest);
|
|
339
341
|
case "activity":
|
|
340
342
|
return repoActivity(rest);
|
|
343
|
+
case "diff":
|
|
344
|
+
return repoDiff(rest);
|
|
341
345
|
case "fix-audit":
|
|
342
346
|
return repoFixAudit(rest);
|
|
343
347
|
case "install-letterprove":
|
|
@@ -679,6 +683,27 @@ async function repoActivity(ctx) {
|
|
|
679
683
|
return 0;
|
|
680
684
|
}
|
|
681
685
|
|
|
686
|
+
/** `repo diff <run-id>`: what a change changed, line by line (--json for the tool's answer). */
|
|
687
|
+
async function repoDiff(ctx) {
|
|
688
|
+
const { client, flags, io } = ctx;
|
|
689
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
690
|
+
const { diff } = await client.callTool(
|
|
691
|
+
"get_repo_change_diff",
|
|
692
|
+
argsFromFlags(ARGS.get_repo_change_diff, flags, ctx.positionals)
|
|
693
|
+
);
|
|
694
|
+
printResult(io, flags, diff, (d) =>
|
|
695
|
+
[
|
|
696
|
+
...d.files.map((f) => {
|
|
697
|
+
const counts = f.additions === null ? "" : ` +${f.additions} -${f.deletions}`;
|
|
698
|
+
return `${f.path} (${f.status})${counts}${f.patch ? `\n${f.patch}` : ""}`;
|
|
699
|
+
}),
|
|
700
|
+
...(d.message ? [d.message] : []),
|
|
701
|
+
...(d.url ? [d.url] : []),
|
|
702
|
+
].join("\n")
|
|
703
|
+
);
|
|
704
|
+
return 0;
|
|
705
|
+
}
|
|
706
|
+
|
|
682
707
|
async function repoList(ctx) {
|
|
683
708
|
const { client, flags, io } = ctx;
|
|
684
709
|
const result = await client.callTool(
|