@staff0rd/assist 0.911.2 → 0.913.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/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.913.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -5185,6 +5185,11 @@ function githubPullNumber(url) {
|
|
|
5185
5185
|
var prActions = [
|
|
5186
5186
|
{ label: "Checkout", args: ["review", "--checkout-only"] },
|
|
5187
5187
|
{ label: "Address Comments", args: ["review-pr-comments"] },
|
|
5188
|
+
{
|
|
5189
|
+
label: "Address Comments (batch)",
|
|
5190
|
+
args: ["review-pr-comments", "--batch"]
|
|
5191
|
+
},
|
|
5192
|
+
{ label: "Address Comments (auto)", args: ["review-pr-comments", "--auto"] },
|
|
5188
5193
|
{ label: "Fix conflicts (merge)", args: ["fix-conflict"] },
|
|
5189
5194
|
{ label: "Fix conflicts (rebase)", args: ["fix-conflict", "--rebase"] }
|
|
5190
5195
|
];
|
|
@@ -27169,7 +27174,7 @@ function registerRefineLaunch(program, resumeFlag) {
|
|
|
27169
27174
|
configHelp(command, harnessConfigHelp);
|
|
27170
27175
|
}
|
|
27171
27176
|
|
|
27172
|
-
// src/commands/
|
|
27177
|
+
// src/commands/fixConflict.ts
|
|
27173
27178
|
import { randomUUID as randomUUID11 } from "crypto";
|
|
27174
27179
|
|
|
27175
27180
|
// src/commands/review/checkoutPr.ts
|
|
@@ -27933,29 +27938,21 @@ async function checkoutPr(number) {
|
|
|
27933
27938
|
}
|
|
27934
27939
|
}
|
|
27935
27940
|
|
|
27936
|
-
// src/commands/
|
|
27937
|
-
function buildPrompt2(
|
|
27938
|
-
|
|
27939
|
-
return `/review-pr-comments --announce ${number}`;
|
|
27940
|
-
}
|
|
27941
|
-
function validateAnnounce(number, announce) {
|
|
27942
|
-
if (!announce || number) return;
|
|
27943
|
-
console.error("Error: --announce requires a PR number.");
|
|
27944
|
-
process.exit(1);
|
|
27941
|
+
// src/commands/fixConflict.ts
|
|
27942
|
+
function buildPrompt2(rebase) {
|
|
27943
|
+
return rebase ? "/fix-conflict --rebase" : "/fix-conflict";
|
|
27945
27944
|
}
|
|
27946
|
-
async function
|
|
27947
|
-
const
|
|
27948
|
-
const resumeSessionId = options2.resumeSessionId;
|
|
27949
|
-
validateAnnounce(number, announce);
|
|
27945
|
+
async function fixConflict(number, options2 = {}) {
|
|
27946
|
+
const { resumeSessionId } = options2;
|
|
27950
27947
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
27951
27948
|
const claudeSessionId = resumeSessionId ?? randomUUID11();
|
|
27952
27949
|
emitActivity({
|
|
27953
27950
|
kind: "command",
|
|
27954
|
-
name: "
|
|
27951
|
+
name: "fix-conflict",
|
|
27955
27952
|
claudeSessionId
|
|
27956
27953
|
});
|
|
27957
27954
|
const { done: done2 } = spawnClaude(
|
|
27958
|
-
resumeSessionId ? resumeNudge() : buildPrompt2(
|
|
27955
|
+
resumeSessionId ? resumeNudge() : buildPrompt2(options2.rebase === true),
|
|
27959
27956
|
{
|
|
27960
27957
|
permissionMode: "auto",
|
|
27961
27958
|
sessionId: claudeSessionId,
|
|
@@ -27965,22 +27962,51 @@ async function reviewPrComments(number, options2 = {}) {
|
|
|
27965
27962
|
await done2;
|
|
27966
27963
|
}
|
|
27967
27964
|
|
|
27968
|
-
// src/commands/
|
|
27965
|
+
// src/commands/registerFixConflict.ts
|
|
27966
|
+
function registerFixConflict(program, resumeFlag) {
|
|
27967
|
+
program.command("fix-conflict").argument("[number]", "PR number to check out first").option("--rebase", "Rebase onto the remote default instead of merging").option("--resume-session <id>", resumeFlag).description("Launch Claude in /fix-conflict mode (single session)").action(
|
|
27968
|
+
(number, options2) => fixConflict(number, {
|
|
27969
|
+
rebase: options2.rebase,
|
|
27970
|
+
resumeSessionId: options2.resumeSession
|
|
27971
|
+
})
|
|
27972
|
+
);
|
|
27973
|
+
}
|
|
27974
|
+
|
|
27975
|
+
// src/commands/reviewPrComments.ts
|
|
27969
27976
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
27970
|
-
function buildPrompt3(
|
|
27971
|
-
|
|
27977
|
+
function buildPrompt3(number, announce, options2) {
|
|
27978
|
+
const args = [
|
|
27979
|
+
"/review-pr-comments",
|
|
27980
|
+
...options2.batch ? ["--batch"] : [],
|
|
27981
|
+
...options2.auto ? ["--auto"] : [],
|
|
27982
|
+
...announce ? [`--announce ${number}`] : []
|
|
27983
|
+
];
|
|
27984
|
+
return args.join(" ");
|
|
27972
27985
|
}
|
|
27973
|
-
|
|
27974
|
-
|
|
27986
|
+
function validateAnnounce(number, announce) {
|
|
27987
|
+
if (!announce || number) return;
|
|
27988
|
+
console.error("Error: --announce requires a PR number.");
|
|
27989
|
+
process.exit(1);
|
|
27990
|
+
}
|
|
27991
|
+
function validateMode(options2) {
|
|
27992
|
+
if (!options2.batch || !options2.auto) return;
|
|
27993
|
+
console.error("Error: --batch and --auto cannot be used together.");
|
|
27994
|
+
process.exit(1);
|
|
27995
|
+
}
|
|
27996
|
+
async function reviewPrComments(number, options2 = {}) {
|
|
27997
|
+
const announce = options2.announce === true;
|
|
27998
|
+
const resumeSessionId = options2.resumeSessionId;
|
|
27999
|
+
validateAnnounce(number, announce);
|
|
28000
|
+
validateMode(options2);
|
|
27975
28001
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
27976
28002
|
const claudeSessionId = resumeSessionId ?? randomUUID12();
|
|
27977
28003
|
emitActivity({
|
|
27978
28004
|
kind: "command",
|
|
27979
|
-
name: "
|
|
28005
|
+
name: "review-pr-comments",
|
|
27980
28006
|
claudeSessionId
|
|
27981
28007
|
});
|
|
27982
28008
|
const { done: done2 } = spawnClaude(
|
|
27983
|
-
resumeSessionId ? resumeNudge() : buildPrompt3(
|
|
28009
|
+
resumeSessionId ? resumeNudge() : buildPrompt3(number, announce, options2),
|
|
27984
28010
|
{
|
|
27985
28011
|
permissionMode: "auto",
|
|
27986
28012
|
sessionId: claudeSessionId,
|
|
@@ -27990,12 +28016,23 @@ async function fixConflict(number, options2 = {}) {
|
|
|
27990
28016
|
await done2;
|
|
27991
28017
|
}
|
|
27992
28018
|
|
|
27993
|
-
// src/commands/
|
|
27994
|
-
function
|
|
27995
|
-
program.command("
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
28019
|
+
// src/commands/registerReviewPrComments.ts
|
|
28020
|
+
function registerReviewPrComments(program, resumeFlag) {
|
|
28021
|
+
program.command("review-pr-comments").argument("[number]", "PR number to check out first").description("Launch Claude in /review-pr-comments mode (single session)").option(
|
|
28022
|
+
"--announce",
|
|
28023
|
+
"After every comment thread is processed, announce the PR in Slack via /prs-slack <number> --no-confirm (requires a PR number)"
|
|
28024
|
+
).option(
|
|
28025
|
+
"--auto",
|
|
28026
|
+
"Accept Claude's own recommendation for each thread without asking, falling back to asking only for threads it cannot confidently decide"
|
|
28027
|
+
).option(
|
|
28028
|
+
"--batch",
|
|
28029
|
+
"Collect a decision for every thread before changing anything, then apply each fix as its own commit, push once and resolve every thread (cannot be combined with --auto)"
|
|
28030
|
+
).option("--resume-session <id>", resumeFlag).action(
|
|
28031
|
+
(number, opts) => reviewPrComments(number, {
|
|
28032
|
+
announce: opts.announce,
|
|
28033
|
+
auto: opts.auto,
|
|
28034
|
+
batch: opts.batch,
|
|
28035
|
+
resumeSessionId: opts.resumeSession
|
|
27999
28036
|
})
|
|
28000
28037
|
);
|
|
28001
28038
|
}
|
|
@@ -28020,17 +28057,6 @@ function registerDescriptionLaunch(program, name, slashCommand, description, ali
|
|
|
28020
28057
|
);
|
|
28021
28058
|
if (alias) command.alias(alias);
|
|
28022
28059
|
}
|
|
28023
|
-
function registerReviewPrComments(program) {
|
|
28024
|
-
program.command("review-pr-comments").argument("[number]", "PR number to check out first").description("Launch Claude in /review-pr-comments mode (single session)").option(
|
|
28025
|
-
"--announce",
|
|
28026
|
-
"After every comment thread is processed, announce the PR in Slack via /prs-slack <number> --no-confirm (requires a PR number)"
|
|
28027
|
-
).option("--resume-session <id>", RESUME_SESSION_FLAG).action(
|
|
28028
|
-
(number, opts) => reviewPrComments(number, {
|
|
28029
|
-
announce: opts.announce,
|
|
28030
|
-
resumeSessionId: opts.resumeSession
|
|
28031
|
-
})
|
|
28032
|
-
);
|
|
28033
|
-
}
|
|
28034
28060
|
function registerLaunch(program) {
|
|
28035
28061
|
registerNext(program);
|
|
28036
28062
|
registerDescriptionLaunch(
|
|
@@ -28046,7 +28072,7 @@ function registerLaunch(program) {
|
|
|
28046
28072
|
"bug",
|
|
28047
28073
|
"Launch Claude in /bug mode, chain into next on /next signal"
|
|
28048
28074
|
);
|
|
28049
|
-
registerReviewPrComments(program);
|
|
28075
|
+
registerReviewPrComments(program, RESUME_SESSION_FLAG);
|
|
28050
28076
|
registerFixConflict(program, RESUME_SESSION_FLAG);
|
|
28051
28077
|
registerRefineLaunch(program, RESUME_SESSION_FLAG);
|
|
28052
28078
|
}
|