chiefwiggum 1.3.47 → 1.3.48

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/cli.cjs +38 -25
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1435,8 +1435,8 @@ Create 5-15 issues.${projectName ? ` Add each to project "${projectName}".` : ""
1435
1435
  } catch {
1436
1436
  }
1437
1437
  console.log(import_picocolors7.default.dim(" Creating epic from PRD..."));
1438
- const prdTitleMatch = prdGenerated.match(/^#\s+(.+)$/m);
1439
- const epicTitle = prdTitleMatch ? `Epic: ${prdTitleMatch[1]}` : "Epic: Project Implementation";
1438
+ const planTitleMatch = planContent.match(/^#\s+(.+)$/m);
1439
+ const epicTitle = planTitleMatch ? `Epic: ${planTitleMatch[1]}` : "Epic: Project Implementation";
1440
1440
  const epicBodyInitial = `${prdGenerated}
1441
1441
 
1442
1442
  ---
@@ -1549,21 +1549,18 @@ _Creating issues..._
1549
1549
  let failed = 0;
1550
1550
  const failedIssues = [];
1551
1551
  const createdIssueNumbers = [];
1552
+ const loggedMilestones = /* @__PURE__ */ new Set();
1552
1553
  for (let i = 0; i < issues.length; i++) {
1553
1554
  const issue = issues[i];
1554
1555
  const progress = Math.round((i + 1) / total * 100);
1555
- const barWidth = 20;
1556
- const filled = Math.round(progress / 100 * barWidth);
1557
- const empty = barWidth - filled;
1558
- const bar = import_picocolors7.default.green("\u2588".repeat(filled)) + import_picocolors7.default.dim("\u2591".repeat(empty));
1559
- process.stdout.write(`\x1B[2K\r ${bar} ${progress}% (${i + 1}/${total}) Creating: ${issue.title.slice(0, 40)}...`);
1556
+ const milestone = Math.floor(progress / 25) * 25;
1557
+ if (milestone > 0 && !loggedMilestones.has(milestone) && milestone < 100) {
1558
+ console.log(import_picocolors7.default.dim(` ${milestone}% complete (${i + 1}/${total})...`));
1559
+ loggedMilestones.add(milestone);
1560
+ }
1560
1561
  try {
1561
1562
  const validLabels = issue.labels.filter((label) => availableLabels.size === 0 || availableLabels.has(label));
1562
1563
  const allLabels = ["chiefwiggum", ...validLabels];
1563
- const labelsArg = `--label "${allLabels.join(",")}"`;
1564
- const escapeForShell = (str) => {
1565
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/!/g, "\\!").replace(/\n/g, "\\n");
1566
- };
1567
1564
  let bodyWithEpic = issue.body;
1568
1565
  if (epicNumber) {
1569
1566
  bodyWithEpic = `Part of #${epicNumber}
@@ -1572,13 +1569,23 @@ _Creating issues..._
1572
1569
 
1573
1570
  ${issue.body}`;
1574
1571
  }
1575
- const body = escapeForShell(bodyWithEpic);
1576
- const title = escapeForShell(issue.title);
1577
- const createCmd = `gh issue create --title "${title}" --body "${body}" ${labelsArg}`;
1578
- const issueUrl = (0, import_node_child_process6.execSync)(createCmd, {
1572
+ const createResult = (0, import_node_child_process6.spawnSync)("gh", [
1573
+ "issue",
1574
+ "create",
1575
+ "--title",
1576
+ issue.title,
1577
+ "--body",
1578
+ bodyWithEpic,
1579
+ "--label",
1580
+ allLabels.join(",")
1581
+ ], {
1579
1582
  encoding: "utf-8",
1580
1583
  stdio: ["pipe", "pipe", "pipe"]
1581
- }).trim();
1584
+ });
1585
+ if (createResult.status !== 0) {
1586
+ throw new Error(createResult.stderr || "Failed to create issue");
1587
+ }
1588
+ const issueUrl = createResult.stdout.trim();
1582
1589
  const issueNumMatch = issueUrl.match(/\/issues\/(\d+)$/);
1583
1590
  if (issueNumMatch) {
1584
1591
  createdIssueNumbers.push(parseInt(issueNumMatch[1], 10));
@@ -1612,7 +1619,6 @@ ${issue.body}`;
1612
1619
  failedIssues.push({ title: issue.title, error: errorMsg });
1613
1620
  }
1614
1621
  }
1615
- process.stdout.write("\r" + " ".repeat(100) + "\r");
1616
1622
  console.log(import_picocolors7.default.green(` \u2713 Created ${created} GitHub Issues`));
1617
1623
  if (failed > 0) {
1618
1624
  console.log(import_picocolors7.default.yellow(` \u26A0 ${failed} issues failed to create:`));
@@ -1632,9 +1638,6 @@ ${issue.body}`;
1632
1638
  }
1633
1639
  }
1634
1640
  if (epicNumber && createdIssueNumbers.length > 0) {
1635
- const escapeForShell = (str) => {
1636
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/!/g, "\\!").replace(/\n/g, "\\n");
1637
- };
1638
1641
  const tasklist = createdIssueNumbers.map((num) => `- [ ] #${num}`).join("\n");
1639
1642
  const updatedEpicBody = `${prdGenerated}
1640
1643
 
@@ -1644,11 +1647,21 @@ ${issue.body}`;
1644
1647
 
1645
1648
  ${tasklist}`;
1646
1649
  try {
1647
- (0, import_node_child_process6.execSync)(
1648
- `gh issue edit ${epicNumber} --body "${escapeForShell(updatedEpicBody)}"`,
1649
- { stdio: ["pipe", "pipe", "pipe"] }
1650
- );
1651
- console.log(import_picocolors7.default.green(` \u2713 Updated epic #${epicNumber} with tasklist`));
1650
+ const editResult = (0, import_node_child_process6.spawnSync)("gh", [
1651
+ "issue",
1652
+ "edit",
1653
+ String(epicNumber),
1654
+ "--body",
1655
+ updatedEpicBody
1656
+ ], {
1657
+ encoding: "utf-8",
1658
+ stdio: ["pipe", "pipe", "pipe"]
1659
+ });
1660
+ if (editResult.status === 0) {
1661
+ console.log(import_picocolors7.default.green(` \u2713 Updated epic #${epicNumber} with tasklist`));
1662
+ } else {
1663
+ throw new Error(editResult.stderr || "Failed");
1664
+ }
1652
1665
  } catch {
1653
1666
  console.log(import_picocolors7.default.yellow(` Could not update epic with tasklist`));
1654
1667
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiefwiggum",
3
- "version": "1.3.47",
3
+ "version": "1.3.48",
4
4
  "description": "Autonomous coding agent CLI. Point it at a plan, watch it build.",
5
5
  "type": "module",
6
6
  "bin": {