chiefwiggum 1.3.33 → 1.3.35
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/cli.cjs +123 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -550,6 +550,17 @@ function hasOpenIssues() {
|
|
|
550
550
|
return false;
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
+
function countClosedIssues() {
|
|
554
|
+
try {
|
|
555
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
556
|
+
"gh issue list --state closed --json number --jq 'length'",
|
|
557
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
558
|
+
);
|
|
559
|
+
return parseInt(output.trim(), 10) || 0;
|
|
560
|
+
} catch {
|
|
561
|
+
return 0;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
553
564
|
function getCurrentCommit() {
|
|
554
565
|
try {
|
|
555
566
|
return (0, import_node_child_process5.execSync)("git rev-parse HEAD", { encoding: "utf-8" }).trim();
|
|
@@ -557,6 +568,106 @@ function getCurrentCommit() {
|
|
|
557
568
|
return "none";
|
|
558
569
|
}
|
|
559
570
|
}
|
|
571
|
+
function getLinkedProjectNumber() {
|
|
572
|
+
try {
|
|
573
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
574
|
+
"gh repo view --json projectsV2 -q '.projectsV2.nodes[0].number'",
|
|
575
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
576
|
+
);
|
|
577
|
+
const num = output.trim();
|
|
578
|
+
return num && num !== "null" ? num : null;
|
|
579
|
+
} catch {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
async function ensureProjectLinked() {
|
|
584
|
+
if (getLinkedProjectNumber()) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const configuredProject = getGithubProject();
|
|
588
|
+
console.log();
|
|
589
|
+
console.log(import_picocolors6.default.yellow("\u26A0 No project board is linked to this repo."));
|
|
590
|
+
console.log(import_picocolors6.default.dim(" This is required for automatic status updates."));
|
|
591
|
+
console.log();
|
|
592
|
+
let repoName = "";
|
|
593
|
+
let owner = "";
|
|
594
|
+
try {
|
|
595
|
+
repoName = (0, import_node_child_process5.execSync)("gh repo view --json nameWithOwner -q .nameWithOwner", {
|
|
596
|
+
encoding: "utf-8",
|
|
597
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
598
|
+
}).trim();
|
|
599
|
+
owner = repoName.split("/")[0];
|
|
600
|
+
} catch {
|
|
601
|
+
console.log(import_picocolors6.default.red("Could not detect GitHub repo."));
|
|
602
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
let existingProjects = [];
|
|
606
|
+
try {
|
|
607
|
+
const projectsOutput = (0, import_node_child_process5.execSync)(`gh project list --owner ${owner} --format json`, {
|
|
608
|
+
encoding: "utf-8",
|
|
609
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
610
|
+
});
|
|
611
|
+
const projects = JSON.parse(projectsOutput);
|
|
612
|
+
existingProjects = projects.projects?.map((p2) => ({
|
|
613
|
+
title: p2.title,
|
|
614
|
+
number: p2.number
|
|
615
|
+
})) || [];
|
|
616
|
+
} catch {
|
|
617
|
+
}
|
|
618
|
+
const options = [
|
|
619
|
+
...existingProjects.map((p2) => ({
|
|
620
|
+
value: String(p2.number),
|
|
621
|
+
label: p2.title,
|
|
622
|
+
hint: configuredProject === p2.title ? "configured" : void 0
|
|
623
|
+
})),
|
|
624
|
+
{ value: "__new__", label: "Create new board..." },
|
|
625
|
+
{ value: "__skip__", label: "Skip (automation will be limited)" }
|
|
626
|
+
];
|
|
627
|
+
const selected = await select2({
|
|
628
|
+
message: "Link a project board to this repo?",
|
|
629
|
+
options
|
|
630
|
+
});
|
|
631
|
+
if (selected === "__skip__") {
|
|
632
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (selected === "__new__") {
|
|
636
|
+
const projectName = await text2({
|
|
637
|
+
message: "Board name",
|
|
638
|
+
placeholder: "e.g., My Project Kanban"
|
|
639
|
+
});
|
|
640
|
+
console.log(import_picocolors6.default.cyan(`Creating board "${projectName}"...`));
|
|
641
|
+
try {
|
|
642
|
+
const createOutput = (0, import_node_child_process5.execSync)(
|
|
643
|
+
`gh project create --owner ${owner} --title "${projectName}"`,
|
|
644
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
645
|
+
);
|
|
646
|
+
const projectNumberMatch = createOutput.match(/projects\/(\d+)/);
|
|
647
|
+
const projectNumber = projectNumberMatch ? projectNumberMatch[1] : null;
|
|
648
|
+
if (projectNumber) {
|
|
649
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
650
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
651
|
+
});
|
|
652
|
+
console.log(import_picocolors6.default.green(`\u2713 Board "${projectName}" created and linked`));
|
|
653
|
+
}
|
|
654
|
+
} catch (err) {
|
|
655
|
+
console.log(import_picocolors6.default.yellow("Could not create board. Continuing without project integration..."));
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
const projectNumber = selected;
|
|
659
|
+
const projectTitle = existingProjects.find((p2) => String(p2.number) === projectNumber)?.title || projectNumber;
|
|
660
|
+
try {
|
|
661
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
662
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
663
|
+
});
|
|
664
|
+
console.log(import_picocolors6.default.green(`\u2713 Linked "${projectTitle}" to ${repoName}`));
|
|
665
|
+
} catch {
|
|
666
|
+
console.log(import_picocolors6.default.yellow("Could not link project. It may already be linked."));
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
console.log();
|
|
670
|
+
}
|
|
560
671
|
function pushToOrigin() {
|
|
561
672
|
try {
|
|
562
673
|
(0, import_node_child_process5.execSync)("git push origin HEAD", { stdio: "pipe" });
|
|
@@ -567,11 +678,16 @@ function pushToOrigin() {
|
|
|
567
678
|
async function cmdLoop() {
|
|
568
679
|
const tracker = getProjectTracker();
|
|
569
680
|
const isGitHub = tracker === "github";
|
|
681
|
+
if (isGitHub) {
|
|
682
|
+
await ensureProjectLinked();
|
|
683
|
+
}
|
|
570
684
|
let maxIterations;
|
|
571
685
|
let hasRemainingTasks;
|
|
572
686
|
let trackerLabel;
|
|
687
|
+
let completedCount = 0;
|
|
573
688
|
if (isGitHub) {
|
|
574
689
|
maxIterations = countOpenIssues();
|
|
690
|
+
completedCount = countClosedIssues();
|
|
575
691
|
hasRemainingTasks = hasOpenIssues;
|
|
576
692
|
trackerLabel = "Issues";
|
|
577
693
|
if (maxIterations === 0) {
|
|
@@ -594,7 +710,12 @@ async function cmdLoop() {
|
|
|
594
710
|
console.log();
|
|
595
711
|
console.log(import_picocolors6.default.green("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
|
596
712
|
console.log(import_picocolors6.default.green(" Starting Build Loop"));
|
|
597
|
-
|
|
713
|
+
if (isGitHub && completedCount > 0) {
|
|
714
|
+
const total = maxIterations + completedCount;
|
|
715
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel}: ${maxIterations} remaining, ${completedCount} done (${total} total)`));
|
|
716
|
+
} else {
|
|
717
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel} remaining: ${maxIterations}`));
|
|
718
|
+
}
|
|
598
719
|
console.log(import_picocolors6.default.green(` Timeout: ${config.iterationTimeoutMinutes}m per task`));
|
|
599
720
|
console.log(import_picocolors6.default.green("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
|
600
721
|
let consecutiveFailures = 0;
|
|
@@ -661,6 +782,7 @@ var init_loop = __esm({
|
|
|
661
782
|
init_claude();
|
|
662
783
|
init_process();
|
|
663
784
|
init_new();
|
|
785
|
+
init_prompts();
|
|
664
786
|
}
|
|
665
787
|
});
|
|
666
788
|
|