@wipcomputer/wip-ldm-os 0.3.2 → 0.3.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.
- package/SKILL.md +1 -1
- package/bin/ldm.js +23 -4
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/bin/ldm.js
CHANGED
|
@@ -45,6 +45,19 @@ try {
|
|
|
45
45
|
CATALOG = JSON.parse(readFileSync(catalogPath, 'utf8'));
|
|
46
46
|
} catch {}
|
|
47
47
|
|
|
48
|
+
// Auto-sync version.json when CLI version drifts (#33)
|
|
49
|
+
// npm install -g updates the binary but not version.json. Fix it on any CLI invocation.
|
|
50
|
+
if (existsSync(VERSION_PATH)) {
|
|
51
|
+
try {
|
|
52
|
+
const v = JSON.parse(readFileSync(VERSION_PATH, 'utf8'));
|
|
53
|
+
if (v.version && v.version !== PKG_VERSION) {
|
|
54
|
+
v.version = PKG_VERSION;
|
|
55
|
+
v.updated = new Date().toISOString();
|
|
56
|
+
writeFileSync(VERSION_PATH, JSON.stringify(v, null, 2) + '\n');
|
|
57
|
+
}
|
|
58
|
+
} catch {}
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
const args = process.argv.slice(2);
|
|
49
62
|
const command = args[0];
|
|
50
63
|
const DRY_RUN = args.includes('--dry-run');
|
|
@@ -111,8 +124,11 @@ function cleanStaleHooks() {
|
|
|
111
124
|
const match = h.command.match(/node\s+"?([^"]+)"?\s*$/);
|
|
112
125
|
if (!match) return true; // keep non-node commands
|
|
113
126
|
const scriptPath = match[1];
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
// /tmp/ paths will vanish on reboot, always treat as stale
|
|
128
|
+
const isTmp = scriptPath.startsWith('/tmp/') || scriptPath.startsWith('/private/tmp/');
|
|
129
|
+
if (existsSync(scriptPath) && !isTmp) return true;
|
|
130
|
+
const reason = isTmp ? '(temp path, will break on reboot)' : '(missing)';
|
|
131
|
+
console.log(` + Removed stale hook: ${event} -> ${scriptPath} ${reason}`);
|
|
116
132
|
cleaned++;
|
|
117
133
|
return false;
|
|
118
134
|
});
|
|
@@ -749,10 +765,13 @@ async function cmdDoctor() {
|
|
|
749
765
|
if (!h.command) continue;
|
|
750
766
|
const match = h.command.match(/node\s+"?([^"]+)"?\s*$/);
|
|
751
767
|
if (!match) continue;
|
|
752
|
-
|
|
768
|
+
const hookPath = match[1];
|
|
769
|
+
const isTmpPath = hookPath.startsWith('/tmp/') || hookPath.startsWith('/private/tmp/');
|
|
770
|
+
if (!existsSync(hookPath) || isTmpPath) {
|
|
753
771
|
staleHooks++;
|
|
754
772
|
if (!FIX_FLAG) {
|
|
755
|
-
|
|
773
|
+
const reason = isTmpPath ? '(temp path)' : '(missing)';
|
|
774
|
+
console.log(` ! Stale hook: ${event} -> ${hookPath} ${reason}`);
|
|
756
775
|
}
|
|
757
776
|
}
|
|
758
777
|
}
|