@aman_asmuei/aman 0.5.3 → 0.5.4

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/index.js +19 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -294,7 +294,21 @@ function healLayerScope(layerDir, filename, home) {
294
294
  fs4.writeFileSync(scopedPath, legacyContent, "utf-8");
295
295
  return "repaired";
296
296
  }
297
- return "ok";
297
+ if (scopedContent === legacyContent) {
298
+ return "ok";
299
+ }
300
+ const legacyMtime = fs4.statSync(legacyPath).mtimeMs;
301
+ const scopedMtime = fs4.statSync(scopedPath).mtimeMs;
302
+ if (legacyMtime > scopedMtime) {
303
+ fs4.writeFileSync(scopedPath, legacyContent, "utf-8");
304
+ return "synced";
305
+ }
306
+ if (scopedMtime > legacyMtime) {
307
+ fs4.writeFileSync(legacyPath, scopedContent, "utf-8");
308
+ return "synced";
309
+ }
310
+ fs4.writeFileSync(legacyPath, scopedContent, "utf-8");
311
+ return "synced";
298
312
  }
299
313
  function healResultMessage(layerDir, filename, result) {
300
314
  if (result === "migrated") {
@@ -303,6 +317,9 @@ function healResultMessage(layerDir, filename, result) {
303
317
  if (result === "repaired") {
304
318
  return `${layerDir.replace(/^\./, "")}: replaced unfilled template at ~/${layerDir}/dev/plugin/${filename} with your personalised content`;
305
319
  }
320
+ if (result === "synced") {
321
+ return `${layerDir.replace(/^\./, "")}: synced diverged content between ~/${layerDir}/${filename} and ~/${layerDir}/dev/plugin/${filename} (newer wins)`;
322
+ }
306
323
  return null;
307
324
  }
308
325
  function runAutoHeal(home) {
@@ -1097,7 +1114,7 @@ async function hereCommand(opts = {}) {
1097
1114
  // src/index.ts
1098
1115
  import pc6 from "picocolors";
1099
1116
  var program = new Command();
1100
- program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.3").action(() => {
1117
+ program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.4").action(() => {
1101
1118
  for (const msg of runAutoHeal()) {
1102
1119
  console.log(` ${pc6.green("\u2714")} ${msg}`);
1103
1120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aman_asmuei/aman",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Your complete AI companion — identity, memory, and tools in one command",
5
5
  "type": "module",
6
6
  "bin": {