@lmzhen/dsh-evolution-merge 0.30.6 → 0.30.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/lib/index.js CHANGED
@@ -814,10 +814,15 @@ async function recoverCommitJournals(io, home, now, skillRoot, restoreSource, is
814
814
  }
815
815
  if (!restoredArchived) for (const source of snapshot.sourceBodies) await io.writeText(skillBodyPath(skillRoot, source.name), source.body);
816
816
  }
817
- if (snapshot.create && snapshot.targetBody === null) try {
818
- await io.remove(skillBodyPath(skillRoot, snapshot.target));
819
- } catch {}
820
- else if (snapshot.targetBody !== null) await io.writeText(skillBodyPath(skillRoot, snapshot.target), snapshot.targetBody);
817
+ if (snapshot.create && snapshot.targetBody === null) {
818
+ try {
819
+ await io.remove(skillBodyPath(skillRoot, snapshot.target));
820
+ } catch {}
821
+ try {
822
+ const dir = join(skillRoot, snapshot.target);
823
+ if ((await io.list(dir)).length === 0) await io.remove(dir);
824
+ } catch {}
825
+ } else if (snapshot.targetBody !== null) await io.writeText(skillBodyPath(skillRoot, snapshot.target), snapshot.targetBody);
821
826
  const oldPaths = new Set((snapshot.targetSupport ?? []).map((file) => file.path));
822
827
  for (const file of snapshot.targetSupport ?? []) await io.writeText(skillFilePath(skillRoot, snapshot.target, file.path), file.content);
823
828
  for (const file of snapshot.targetSupportAfter ?? []) if (!oldPaths.has(file.path)) try {
@@ -72,6 +72,12 @@ export async function recoverCommitJournals(io, home, now, skillRoot, restoreSou
72
72
  await io.remove(skillBodyPath(skillRoot, snapshot.target));
73
73
  }
74
74
  catch { /* already gone */ }
75
+ try {
76
+ const dir = join(skillRoot, snapshot.target);
77
+ if ((await io.list(dir)).length === 0)
78
+ await io.remove(dir);
79
+ }
80
+ catch { /* absent or non-empty */ }
75
81
  }
76
82
  else if (snapshot.targetBody !== null) {
77
83
  await io.writeText(skillBodyPath(skillRoot, snapshot.target), snapshot.targetBody);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-merge",
3
3
  "description": "Skill auto-merge domain: screening, two-round authoring, queues and commit orchestration (community build)",
4
- "version": "0.30.6",
4
+ "version": "0.30.7",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,8 +27,8 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-core": "^0.30.6",
31
- "@lmzhen/dsh-evolution-merge-engine": "^0.30.6"
30
+ "@lmzhen/dsh-evolution-core": "^0.30.7",
31
+ "@lmzhen/dsh-evolution-merge-engine": "^0.30.7"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.5"