@staff0rd/assist 0.157.0 → 0.158.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 +46 -41
- package/package.json +1 -1
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.158.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -554,15 +554,16 @@ function prepareRun(id) {
|
|
|
554
554
|
// src/commands/backlog/run.ts
|
|
555
555
|
async function run(id, spawnOptions) {
|
|
556
556
|
const prepared = prepareRun(id);
|
|
557
|
-
if (!prepared) return;
|
|
557
|
+
if (!prepared) return false;
|
|
558
558
|
const { item, plan: plan2, startPhase } = prepared;
|
|
559
559
|
setStatus(id, "in-progress");
|
|
560
560
|
logProgress(id, item.name, startPhase, plan2.length);
|
|
561
|
-
if (!await runPhases(item, startPhase, plan2, spawnOptions)) return;
|
|
562
|
-
if (!await runReview(item, plan2, spawnOptions)) return;
|
|
561
|
+
if (!await runPhases(item, startPhase, plan2, spawnOptions)) return false;
|
|
562
|
+
if (!await runReview(item, plan2, spawnOptions)) return false;
|
|
563
563
|
ensureDone(id);
|
|
564
564
|
console.log(chalk8.green(`
|
|
565
565
|
All phases complete for #${id}: ${item.name}`));
|
|
566
|
+
return true;
|
|
566
567
|
}
|
|
567
568
|
function logProgress(id, name, startPhase, total) {
|
|
568
569
|
console.log(chalk8.bold(`Running plan for #${id}: ${name}`));
|
|
@@ -602,41 +603,45 @@ async function runReview(item, plan2, spawnOptions) {
|
|
|
602
603
|
|
|
603
604
|
// src/commands/backlog/next.ts
|
|
604
605
|
async function next(options2) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
606
|
+
while (true) {
|
|
607
|
+
const items = loadBacklog();
|
|
608
|
+
const inProgress = items.find((i) => i.status === "in-progress" && i.plan);
|
|
609
|
+
if (inProgress) {
|
|
610
|
+
console.log(
|
|
611
|
+
chalk9.bold(
|
|
612
|
+
`Resuming in-progress item #${inProgress.id}: ${inProgress.name}`
|
|
613
|
+
)
|
|
614
|
+
);
|
|
615
|
+
const completed2 = await run(String(inProgress.id), options2);
|
|
616
|
+
if (!completed2) return;
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
const todo = items.filter((i) => i.status === "todo");
|
|
620
|
+
if (todo.length === 0) {
|
|
621
|
+
console.log(chalk9.green("All backlog items complete."));
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
let id;
|
|
625
|
+
if (todo.length === 1) {
|
|
626
|
+
const only = todo[0];
|
|
627
|
+
console.log(chalk9.bold(`Starting #${only.id}: ${only.name}`));
|
|
628
|
+
id = String(only.id);
|
|
629
|
+
} else {
|
|
630
|
+
const choices = todo.map((i) => ({
|
|
631
|
+
name: `${typeLabel(i.type)} #${i.id}: ${i.name}`,
|
|
632
|
+
value: String(i.id)
|
|
633
|
+
}));
|
|
634
|
+
const { selected } = await enquirer2.prompt({
|
|
635
|
+
type: "select",
|
|
636
|
+
name: "selected",
|
|
637
|
+
message: "Choose a backlog item to start:",
|
|
638
|
+
choices: choices.map((c) => c.name)
|
|
639
|
+
});
|
|
640
|
+
id = selected.match(/#(\d+)/)?.[1] ?? "";
|
|
641
|
+
}
|
|
642
|
+
const completed = await run(id, options2);
|
|
643
|
+
if (!completed) return;
|
|
627
644
|
}
|
|
628
|
-
const choices = todo.map((i) => ({
|
|
629
|
-
name: `${typeLabel(i.type)} #${i.id}: ${i.name}`,
|
|
630
|
-
value: String(i.id)
|
|
631
|
-
}));
|
|
632
|
-
const { selected } = await enquirer2.prompt({
|
|
633
|
-
type: "select",
|
|
634
|
-
name: "selected",
|
|
635
|
-
message: "Choose a backlog item to start:",
|
|
636
|
-
choices: choices.map((c) => c.name)
|
|
637
|
-
});
|
|
638
|
-
const id = selected.match(/#(\d+)/)?.[1] ?? "";
|
|
639
|
-
await run(id, options2);
|
|
640
645
|
}
|
|
641
646
|
|
|
642
647
|
// src/commands/backlog/phaseDone.ts
|
|
@@ -3456,9 +3461,9 @@ function registerNextCommand(cmd) {
|
|
|
3456
3461
|
);
|
|
3457
3462
|
}
|
|
3458
3463
|
function registerRunCommand(cmd) {
|
|
3459
|
-
cmd.command("run <id>").description("Run a backlog item's plan phase-by-phase with Claude").option("-w, --write", "Run Claude with acceptEdits permission mode").action(
|
|
3460
|
-
|
|
3461
|
-
);
|
|
3464
|
+
cmd.command("run <id>").description("Run a backlog item's plan phase-by-phase with Claude").option("-w, --write", "Run Claude with acceptEdits permission mode").action(async (id, opts) => {
|
|
3465
|
+
await run(id, { allowEdits: opts.write });
|
|
3466
|
+
});
|
|
3462
3467
|
}
|
|
3463
3468
|
function registerBacklog(program2) {
|
|
3464
3469
|
const cmd = program2.command("backlog").description("Manage a backlog of work items").action(() => web({ port: "3000" }));
|