@staff0rd/assist 0.911.2 → 0.912.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.912.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -5185,6 +5185,7 @@ 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
|
+
{ label: "Address Comments (auto)", args: ["review-pr-comments", "--auto"] },
|
|
5188
5189
|
{ label: "Fix conflicts (merge)", args: ["fix-conflict"] },
|
|
5189
5190
|
{ label: "Fix conflicts (rebase)", args: ["fix-conflict", "--rebase"] }
|
|
5190
5191
|
];
|
|
@@ -27169,7 +27170,7 @@ function registerRefineLaunch(program, resumeFlag) {
|
|
|
27169
27170
|
configHelp(command, harnessConfigHelp);
|
|
27170
27171
|
}
|
|
27171
27172
|
|
|
27172
|
-
// src/commands/
|
|
27173
|
+
// src/commands/fixConflict.ts
|
|
27173
27174
|
import { randomUUID as randomUUID11 } from "crypto";
|
|
27174
27175
|
|
|
27175
27176
|
// src/commands/review/checkoutPr.ts
|
|
@@ -27933,29 +27934,21 @@ async function checkoutPr(number) {
|
|
|
27933
27934
|
}
|
|
27934
27935
|
}
|
|
27935
27936
|
|
|
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);
|
|
27937
|
+
// src/commands/fixConflict.ts
|
|
27938
|
+
function buildPrompt2(rebase) {
|
|
27939
|
+
return rebase ? "/fix-conflict --rebase" : "/fix-conflict";
|
|
27945
27940
|
}
|
|
27946
|
-
async function
|
|
27947
|
-
const
|
|
27948
|
-
const resumeSessionId = options2.resumeSessionId;
|
|
27949
|
-
validateAnnounce(number, announce);
|
|
27941
|
+
async function fixConflict(number, options2 = {}) {
|
|
27942
|
+
const { resumeSessionId } = options2;
|
|
27950
27943
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
27951
27944
|
const claudeSessionId = resumeSessionId ?? randomUUID11();
|
|
27952
27945
|
emitActivity({
|
|
27953
27946
|
kind: "command",
|
|
27954
|
-
name: "
|
|
27947
|
+
name: "fix-conflict",
|
|
27955
27948
|
claudeSessionId
|
|
27956
27949
|
});
|
|
27957
27950
|
const { done: done2 } = spawnClaude(
|
|
27958
|
-
resumeSessionId ? resumeNudge() : buildPrompt2(
|
|
27951
|
+
resumeSessionId ? resumeNudge() : buildPrompt2(options2.rebase === true),
|
|
27959
27952
|
{
|
|
27960
27953
|
permissionMode: "auto",
|
|
27961
27954
|
sessionId: claudeSessionId,
|
|
@@ -27965,22 +27958,44 @@ async function reviewPrComments(number, options2 = {}) {
|
|
|
27965
27958
|
await done2;
|
|
27966
27959
|
}
|
|
27967
27960
|
|
|
27968
|
-
// src/commands/
|
|
27961
|
+
// src/commands/registerFixConflict.ts
|
|
27962
|
+
function registerFixConflict(program, resumeFlag) {
|
|
27963
|
+
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(
|
|
27964
|
+
(number, options2) => fixConflict(number, {
|
|
27965
|
+
rebase: options2.rebase,
|
|
27966
|
+
resumeSessionId: options2.resumeSession
|
|
27967
|
+
})
|
|
27968
|
+
);
|
|
27969
|
+
}
|
|
27970
|
+
|
|
27971
|
+
// src/commands/reviewPrComments.ts
|
|
27969
27972
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
27970
|
-
function buildPrompt3(
|
|
27971
|
-
|
|
27973
|
+
function buildPrompt3(number, announce, auto) {
|
|
27974
|
+
const args = [
|
|
27975
|
+
"/review-pr-comments",
|
|
27976
|
+
...auto ? ["--auto"] : [],
|
|
27977
|
+
...announce ? [`--announce ${number}`] : []
|
|
27978
|
+
];
|
|
27979
|
+
return args.join(" ");
|
|
27972
27980
|
}
|
|
27973
|
-
|
|
27974
|
-
|
|
27981
|
+
function validateAnnounce(number, announce) {
|
|
27982
|
+
if (!announce || number) return;
|
|
27983
|
+
console.error("Error: --announce requires a PR number.");
|
|
27984
|
+
process.exit(1);
|
|
27985
|
+
}
|
|
27986
|
+
async function reviewPrComments(number, options2 = {}) {
|
|
27987
|
+
const announce = options2.announce === true;
|
|
27988
|
+
const resumeSessionId = options2.resumeSessionId;
|
|
27989
|
+
validateAnnounce(number, announce);
|
|
27975
27990
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
27976
27991
|
const claudeSessionId = resumeSessionId ?? randomUUID12();
|
|
27977
27992
|
emitActivity({
|
|
27978
27993
|
kind: "command",
|
|
27979
|
-
name: "
|
|
27994
|
+
name: "review-pr-comments",
|
|
27980
27995
|
claudeSessionId
|
|
27981
27996
|
});
|
|
27982
27997
|
const { done: done2 } = spawnClaude(
|
|
27983
|
-
resumeSessionId ? resumeNudge() : buildPrompt3(options2.
|
|
27998
|
+
resumeSessionId ? resumeNudge() : buildPrompt3(number, announce, options2.auto === true),
|
|
27984
27999
|
{
|
|
27985
28000
|
permissionMode: "auto",
|
|
27986
28001
|
sessionId: claudeSessionId,
|
|
@@ -27990,12 +28005,19 @@ async function fixConflict(number, options2 = {}) {
|
|
|
27990
28005
|
await done2;
|
|
27991
28006
|
}
|
|
27992
28007
|
|
|
27993
|
-
// src/commands/
|
|
27994
|
-
function
|
|
27995
|
-
program.command("
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
28008
|
+
// src/commands/registerReviewPrComments.ts
|
|
28009
|
+
function registerReviewPrComments(program, resumeFlag) {
|
|
28010
|
+
program.command("review-pr-comments").argument("[number]", "PR number to check out first").description("Launch Claude in /review-pr-comments mode (single session)").option(
|
|
28011
|
+
"--announce",
|
|
28012
|
+
"After every comment thread is processed, announce the PR in Slack via /prs-slack <number> --no-confirm (requires a PR number)"
|
|
28013
|
+
).option(
|
|
28014
|
+
"--auto",
|
|
28015
|
+
"Accept Claude's own recommendation for each thread without asking, falling back to asking only for threads it cannot confidently decide"
|
|
28016
|
+
).option("--resume-session <id>", resumeFlag).action(
|
|
28017
|
+
(number, opts) => reviewPrComments(number, {
|
|
28018
|
+
announce: opts.announce,
|
|
28019
|
+
auto: opts.auto,
|
|
28020
|
+
resumeSessionId: opts.resumeSession
|
|
27999
28021
|
})
|
|
28000
28022
|
);
|
|
28001
28023
|
}
|
|
@@ -28020,17 +28042,6 @@ function registerDescriptionLaunch(program, name, slashCommand, description, ali
|
|
|
28020
28042
|
);
|
|
28021
28043
|
if (alias) command.alias(alias);
|
|
28022
28044
|
}
|
|
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
28045
|
function registerLaunch(program) {
|
|
28035
28046
|
registerNext(program);
|
|
28036
28047
|
registerDescriptionLaunch(
|
|
@@ -28046,7 +28057,7 @@ function registerLaunch(program) {
|
|
|
28046
28057
|
"bug",
|
|
28047
28058
|
"Launch Claude in /bug mode, chain into next on /next signal"
|
|
28048
28059
|
);
|
|
28049
|
-
registerReviewPrComments(program);
|
|
28060
|
+
registerReviewPrComments(program, RESUME_SESSION_FLAG);
|
|
28050
28061
|
registerFixConflict(program, RESUME_SESSION_FLAG);
|
|
28051
28062
|
registerRefineLaunch(program, RESUME_SESSION_FLAG);
|
|
28052
28063
|
}
|