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/index.js CHANGED
@@ -3572,7 +3572,8 @@ async function updateAiMemory(featureName, featureSlug) {
3572
3572
  return;
3573
3573
  }
3574
3574
  let content = await FileUtils.read(aiMemoryFile);
3575
- const newRow = `| ${featureName} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3575
+ const featureDisplay = featureName.replace(/[-_]/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
3576
+ const newRow = `| ${featureDisplay} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3576
3577
  if (!content.includes("## \u529F\u80FD\u6E05\u5355")) {
3577
3578
  content += `
3578
3579
  ## \u529F\u80FD\u6E05\u5355 (Feature Inventory)
@@ -3583,18 +3584,45 @@ ${newRow}
3583
3584
  `;
3584
3585
  } else {
3585
3586
  const lines = content.split("\n");
3586
- const lastIndex = lines.findLastIndex((line) => line.trim().startsWith("|") && !line.includes("---"));
3587
- if (lastIndex !== -1) {
3588
- lines.splice(lastIndex + 1, 0, newRow);
3587
+ let featureInventorySection = false;
3588
+ let insertIndex = -1;
3589
+ for (let i = 0; i < lines.length; i++) {
3590
+ const line = lines[i];
3591
+ if (line.includes("## \u529F\u80FD\u6E05\u5355")) {
3592
+ featureInventorySection = true;
3593
+ continue;
3594
+ }
3595
+ if (featureInventorySection && line.startsWith("## ") && !line.includes("\u529F\u80FD\u6E05\u5355")) {
3596
+ break;
3597
+ }
3598
+ if (featureInventorySection && /^\|[-]+\|/.test(line.trim())) {
3599
+ insertIndex = i + 1;
3600
+ break;
3601
+ }
3602
+ }
3603
+ if (insertIndex !== -1) {
3604
+ lines.splice(insertIndex, 0, newRow);
3589
3605
  content = lines.join("\n");
3590
3606
  } else {
3591
- content += `
3607
+ const sectionIndex = lines.findIndex((line) => line.includes("## \u529F\u80FD\u6E05\u5355"));
3608
+ if (sectionIndex !== -1) {
3609
+ const tableLines = [
3610
+ "",
3611
+ "| \u529F\u80FD | Spec \u6587\u4EF6 | \u72B6\u6001 | \u8FDB\u5EA6 | \u5B8C\u6210\u65E5\u671F | \u5907\u6CE8 |",
3612
+ "|------|----------|------|------|---------|------|",
3613
+ newRow,
3614
+ ""
3615
+ ];
3616
+ lines.splice(sectionIndex + 1, 0, ...tableLines);
3617
+ content = lines.join("\n");
3618
+ } else {
3619
+ content += `
3592
3620
  ${newRow}
3593
3621
  `;
3622
+ }
3594
3623
  }
3595
3624
  }
3596
3625
  await FileUtils.write(aiMemoryFile, content);
3597
- logger.success("AI_MEMORY.md \u5DF2\u66F4\u65B0");
3598
3626
  }
3599
3627
  async function showSpecPreview(specFile) {
3600
3628
  logger.newLine();