yg-team-cli 2.4.6 → 2.4.7

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.js CHANGED
@@ -3548,7 +3548,8 @@ async function updateAiMemory(featureName, featureSlug) {
3548
3548
  return;
3549
3549
  }
3550
3550
  let content = await FileUtils.read(aiMemoryFile);
3551
- const newRow = `| ${featureName} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3551
+ const featureDisplay = featureName.replace(/[-_]/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
3552
+ const newRow = `| ${featureDisplay} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3552
3553
  if (!content.includes("## \u529F\u80FD\u6E05\u5355")) {
3553
3554
  content += `
3554
3555
  ## \u529F\u80FD\u6E05\u5355 (Feature Inventory)
@@ -3559,18 +3560,45 @@ ${newRow}
3559
3560
  `;
3560
3561
  } else {
3561
3562
  const lines = content.split("\n");
3562
- const lastIndex = lines.findLastIndex((line) => line.trim().startsWith("|") && !line.includes("---"));
3563
- if (lastIndex !== -1) {
3564
- lines.splice(lastIndex + 1, 0, newRow);
3563
+ let featureInventorySection = false;
3564
+ let insertIndex = -1;
3565
+ for (let i = 0; i < lines.length; i++) {
3566
+ const line = lines[i];
3567
+ if (line.includes("## \u529F\u80FD\u6E05\u5355")) {
3568
+ featureInventorySection = true;
3569
+ continue;
3570
+ }
3571
+ if (featureInventorySection && line.startsWith("## ") && !line.includes("\u529F\u80FD\u6E05\u5355")) {
3572
+ break;
3573
+ }
3574
+ if (featureInventorySection && /^\|[-]+\|/.test(line.trim())) {
3575
+ insertIndex = i + 1;
3576
+ break;
3577
+ }
3578
+ }
3579
+ if (insertIndex !== -1) {
3580
+ lines.splice(insertIndex, 0, newRow);
3565
3581
  content = lines.join("\n");
3566
3582
  } else {
3567
- content += `
3583
+ const sectionIndex = lines.findIndex((line) => line.includes("## \u529F\u80FD\u6E05\u5355"));
3584
+ if (sectionIndex !== -1) {
3585
+ const tableLines = [
3586
+ "",
3587
+ "| \u529F\u80FD | Spec \u6587\u4EF6 | \u72B6\u6001 | \u8FDB\u5EA6 | \u5B8C\u6210\u65E5\u671F | \u5907\u6CE8 |",
3588
+ "|------|----------|------|------|---------|------|",
3589
+ newRow,
3590
+ ""
3591
+ ];
3592
+ lines.splice(sectionIndex + 1, 0, ...tableLines);
3593
+ content = lines.join("\n");
3594
+ } else {
3595
+ content += `
3568
3596
  ${newRow}
3569
3597
  `;
3598
+ }
3570
3599
  }
3571
3600
  }
3572
3601
  await FileUtils.write(aiMemoryFile, content);
3573
- logger.success("AI_MEMORY.md \u5DF2\u66F4\u65B0");
3574
3602
  }
3575
3603
  async function showSpecPreview(specFile) {
3576
3604
  logger.newLine();