@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.
Files changed (2) hide show
  1. package/dist/index.js +46 -41
  2. 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.157.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
- const items = loadBacklog();
606
- const inProgress = items.find((i) => i.status === "in-progress" && i.plan);
607
- if (inProgress) {
608
- console.log(
609
- chalk9.bold(
610
- `Resuming in-progress item #${inProgress.id}: ${inProgress.name}`
611
- )
612
- );
613
- await run(String(inProgress.id), options2);
614
- return;
615
- }
616
- const todo = items.filter((i) => i.status === "todo");
617
- if (todo.length === 0) {
618
- console.log(chalk9.dim("No incomplete backlog items. Opening /draft..."));
619
- await spawnClaude("/draft", options2);
620
- return;
621
- }
622
- if (todo.length === 1) {
623
- const only = todo[0];
624
- console.log(chalk9.bold(`Starting #${only.id}: ${only.name}`));
625
- await run(String(only.id), options2);
626
- return;
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
- (id, opts) => run(id, { allowEdits: opts.write })
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" }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.157.0",
3
+ "version": "0.158.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {