chiefwiggum 1.3.33 → 1.3.36
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 +129 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -388,12 +388,14 @@ function getTodoTaskPrompt() {
|
|
|
388
388
|
return `You are an autonomous coding agent. Complete ONE task from TODO.md.
|
|
389
389
|
|
|
390
390
|
## Before Starting
|
|
391
|
-
Read these files
|
|
391
|
+
Read these ROOT-LEVEL files only (ignore subdirectories for project context):
|
|
392
392
|
- CLAUDE.md \u2014 Project context and conventions
|
|
393
393
|
- specs/prd.md \u2014 What we are building
|
|
394
394
|
- specs/technical.md \u2014 How we are building it
|
|
395
395
|
- TODO.md \u2014 Task list
|
|
396
396
|
|
|
397
|
+
IMPORTANT: Only use the root-level files above for project context. Do not read subdirectory README files or other nested project files when determining what project you're working on.
|
|
398
|
+
|
|
397
399
|
## Workflow
|
|
398
400
|
1. Find the FIRST unchecked task (- [ ]) in TODO.md
|
|
399
401
|
2. Plan: Understand what needs to be done
|
|
@@ -416,11 +418,13 @@ function getGitHubTaskPrompt() {
|
|
|
416
418
|
return `You are an autonomous coding agent. Complete ONE GitHub Issue.
|
|
417
419
|
|
|
418
420
|
## Before Starting
|
|
419
|
-
Read these files
|
|
421
|
+
Read these ROOT-LEVEL files only (ignore subdirectories for project context):
|
|
420
422
|
- CLAUDE.md \u2014 Project context and conventions
|
|
421
423
|
- specs/prd.md \u2014 What we are building
|
|
422
424
|
- specs/technical.md \u2014 How we are building it
|
|
423
425
|
|
|
426
|
+
IMPORTANT: Only use the root-level files above for project context. Do not read subdirectory README files or other nested project files when determining what project you're working on.
|
|
427
|
+
|
|
424
428
|
Then list open issues: gh issue list --state open
|
|
425
429
|
|
|
426
430
|
## Workflow
|
|
@@ -550,6 +554,17 @@ function hasOpenIssues() {
|
|
|
550
554
|
return false;
|
|
551
555
|
}
|
|
552
556
|
}
|
|
557
|
+
function countClosedIssues() {
|
|
558
|
+
try {
|
|
559
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
560
|
+
"gh issue list --state closed --json number --jq 'length'",
|
|
561
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
562
|
+
);
|
|
563
|
+
return parseInt(output.trim(), 10) || 0;
|
|
564
|
+
} catch {
|
|
565
|
+
return 0;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
553
568
|
function getCurrentCommit() {
|
|
554
569
|
try {
|
|
555
570
|
return (0, import_node_child_process5.execSync)("git rev-parse HEAD", { encoding: "utf-8" }).trim();
|
|
@@ -557,6 +572,106 @@ function getCurrentCommit() {
|
|
|
557
572
|
return "none";
|
|
558
573
|
}
|
|
559
574
|
}
|
|
575
|
+
function getLinkedProjectNumber() {
|
|
576
|
+
try {
|
|
577
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
578
|
+
"gh repo view --json projectsV2 -q '.projectsV2.nodes[0].number'",
|
|
579
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
580
|
+
);
|
|
581
|
+
const num = output.trim();
|
|
582
|
+
return num && num !== "null" ? num : null;
|
|
583
|
+
} catch {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
async function ensureProjectLinked() {
|
|
588
|
+
if (getLinkedProjectNumber()) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const configuredProject = getGithubProject();
|
|
592
|
+
console.log();
|
|
593
|
+
console.log(import_picocolors6.default.yellow("\u26A0 No project board is linked to this repo."));
|
|
594
|
+
console.log(import_picocolors6.default.dim(" This is required for automatic status updates."));
|
|
595
|
+
console.log();
|
|
596
|
+
let repoName = "";
|
|
597
|
+
let owner = "";
|
|
598
|
+
try {
|
|
599
|
+
repoName = (0, import_node_child_process5.execSync)("gh repo view --json nameWithOwner -q .nameWithOwner", {
|
|
600
|
+
encoding: "utf-8",
|
|
601
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
602
|
+
}).trim();
|
|
603
|
+
owner = repoName.split("/")[0];
|
|
604
|
+
} catch {
|
|
605
|
+
console.log(import_picocolors6.default.red("Could not detect GitHub repo."));
|
|
606
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
let existingProjects = [];
|
|
610
|
+
try {
|
|
611
|
+
const projectsOutput = (0, import_node_child_process5.execSync)(`gh project list --owner ${owner} --format json`, {
|
|
612
|
+
encoding: "utf-8",
|
|
613
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
614
|
+
});
|
|
615
|
+
const projects = JSON.parse(projectsOutput);
|
|
616
|
+
existingProjects = projects.projects?.map((p2) => ({
|
|
617
|
+
title: p2.title,
|
|
618
|
+
number: p2.number
|
|
619
|
+
})) || [];
|
|
620
|
+
} catch {
|
|
621
|
+
}
|
|
622
|
+
const options = [
|
|
623
|
+
...existingProjects.map((p2) => ({
|
|
624
|
+
value: String(p2.number),
|
|
625
|
+
label: p2.title,
|
|
626
|
+
hint: configuredProject === p2.title ? "configured" : void 0
|
|
627
|
+
})),
|
|
628
|
+
{ value: "__new__", label: "Create new board..." },
|
|
629
|
+
{ value: "__skip__", label: "Skip (automation will be limited)" }
|
|
630
|
+
];
|
|
631
|
+
const selected = await select2({
|
|
632
|
+
message: "Link a project board to this repo?",
|
|
633
|
+
options
|
|
634
|
+
});
|
|
635
|
+
if (selected === "__skip__") {
|
|
636
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (selected === "__new__") {
|
|
640
|
+
const projectName = await text2({
|
|
641
|
+
message: "Board name",
|
|
642
|
+
placeholder: "e.g., My Project Kanban"
|
|
643
|
+
});
|
|
644
|
+
console.log(import_picocolors6.default.cyan(`Creating board "${projectName}"...`));
|
|
645
|
+
try {
|
|
646
|
+
const createOutput = (0, import_node_child_process5.execSync)(
|
|
647
|
+
`gh project create --owner ${owner} --title "${projectName}"`,
|
|
648
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
649
|
+
);
|
|
650
|
+
const projectNumberMatch = createOutput.match(/projects\/(\d+)/);
|
|
651
|
+
const projectNumber = projectNumberMatch ? projectNumberMatch[1] : null;
|
|
652
|
+
if (projectNumber) {
|
|
653
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
654
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
655
|
+
});
|
|
656
|
+
console.log(import_picocolors6.default.green(`\u2713 Board "${projectName}" created and linked`));
|
|
657
|
+
}
|
|
658
|
+
} catch (err) {
|
|
659
|
+
console.log(import_picocolors6.default.yellow("Could not create board. Continuing without project integration..."));
|
|
660
|
+
}
|
|
661
|
+
} else {
|
|
662
|
+
const projectNumber = selected;
|
|
663
|
+
const projectTitle = existingProjects.find((p2) => String(p2.number) === projectNumber)?.title || projectNumber;
|
|
664
|
+
try {
|
|
665
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
666
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
667
|
+
});
|
|
668
|
+
console.log(import_picocolors6.default.green(`\u2713 Linked "${projectTitle}" to ${repoName}`));
|
|
669
|
+
} catch {
|
|
670
|
+
console.log(import_picocolors6.default.yellow("Could not link project. It may already be linked."));
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
console.log();
|
|
674
|
+
}
|
|
560
675
|
function pushToOrigin() {
|
|
561
676
|
try {
|
|
562
677
|
(0, import_node_child_process5.execSync)("git push origin HEAD", { stdio: "pipe" });
|
|
@@ -567,11 +682,16 @@ function pushToOrigin() {
|
|
|
567
682
|
async function cmdLoop() {
|
|
568
683
|
const tracker = getProjectTracker();
|
|
569
684
|
const isGitHub = tracker === "github";
|
|
685
|
+
if (isGitHub) {
|
|
686
|
+
await ensureProjectLinked();
|
|
687
|
+
}
|
|
570
688
|
let maxIterations;
|
|
571
689
|
let hasRemainingTasks;
|
|
572
690
|
let trackerLabel;
|
|
691
|
+
let completedCount = 0;
|
|
573
692
|
if (isGitHub) {
|
|
574
693
|
maxIterations = countOpenIssues();
|
|
694
|
+
completedCount = countClosedIssues();
|
|
575
695
|
hasRemainingTasks = hasOpenIssues;
|
|
576
696
|
trackerLabel = "Issues";
|
|
577
697
|
if (maxIterations === 0) {
|
|
@@ -594,7 +714,12 @@ async function cmdLoop() {
|
|
|
594
714
|
console.log();
|
|
595
715
|
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
716
|
console.log(import_picocolors6.default.green(" Starting Build Loop"));
|
|
597
|
-
|
|
717
|
+
if (isGitHub && completedCount > 0) {
|
|
718
|
+
const total = maxIterations + completedCount;
|
|
719
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel}: ${maxIterations} remaining, ${completedCount} done (${total} total)`));
|
|
720
|
+
} else {
|
|
721
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel} remaining: ${maxIterations}`));
|
|
722
|
+
}
|
|
598
723
|
console.log(import_picocolors6.default.green(` Timeout: ${config.iterationTimeoutMinutes}m per task`));
|
|
599
724
|
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
725
|
let consecutiveFailures = 0;
|
|
@@ -661,6 +786,7 @@ var init_loop = __esm({
|
|
|
661
786
|
init_claude();
|
|
662
787
|
init_process();
|
|
663
788
|
init_new();
|
|
789
|
+
init_prompts();
|
|
664
790
|
}
|
|
665
791
|
});
|
|
666
792
|
|