claude-mem-lite 2.24.1 → 2.24.2
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/install.mjs +5 -5
- package/package.json +1 -1
- package/scripts/launch.mjs +22 -0
- package/scripts/setup.sh +5 -1
package/install.mjs
CHANGED
|
@@ -977,11 +977,11 @@ async function doctor() {
|
|
|
977
977
|
issues++;
|
|
978
978
|
}
|
|
979
979
|
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
ok('@modelcontextprotocol/sdk:
|
|
983
|
-
}
|
|
984
|
-
fail(
|
|
980
|
+
try {
|
|
981
|
+
await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
982
|
+
ok('@modelcontextprotocol/sdk: verified (import OK)');
|
|
983
|
+
} catch (e) {
|
|
984
|
+
fail(`@modelcontextprotocol/sdk: import failed (${e.message})`);
|
|
985
985
|
issues++;
|
|
986
986
|
}
|
|
987
987
|
|
package/package.json
CHANGED
package/scripts/launch.mjs
CHANGED
|
@@ -20,6 +20,28 @@ if (!existsSync(join(ROOT, 'node_modules', 'better-sqlite3'))) {
|
|
|
20
20
|
process.stderr.write('[claude-mem-lite] Dependencies installed\n');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// Verify MCP SDK is importable (exports mapping intact).
|
|
24
|
+
// Incomplete installs can leave the directory present but package.json missing,
|
|
25
|
+
// causing Node.js to fail resolving subpath exports like /server/mcp.js.
|
|
26
|
+
try {
|
|
27
|
+
await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
28
|
+
} catch (firstErr) {
|
|
29
|
+
process.stderr.write(`[claude-mem-lite] MCP SDK broken (${firstErr.code || firstErr.message}) — reinstalling...\n`);
|
|
30
|
+
try {
|
|
31
|
+
execSync('npm install @modelcontextprotocol/sdk --force --omit=dev --no-audit --no-fund', {
|
|
32
|
+
cwd: ROOT,
|
|
33
|
+
stdio: ['ignore', 'pipe', 'inherit'],
|
|
34
|
+
timeout: 60_000,
|
|
35
|
+
});
|
|
36
|
+
// Verify the reinstall actually fixed it
|
|
37
|
+
await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
38
|
+
process.stderr.write('[claude-mem-lite] MCP SDK repaired\n');
|
|
39
|
+
} catch (e) {
|
|
40
|
+
process.stderr.write(`[claude-mem-lite] MCP SDK repair failed: ${e.message}\n`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
23
45
|
// Dev mode: prefer ~/.claude-mem-lite/server.mjs (symlinked to source) over
|
|
24
46
|
// CLAUDE_PLUGIN_ROOT (potentially stale plugin cache). This ensures the MCP
|
|
25
47
|
// server always runs the latest code when installed with `install --dev`.
|
package/scripts/setup.sh
CHANGED
|
@@ -122,7 +122,11 @@ if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
|
|
|
122
122
|
CACHE_DIR="$HOME/.claude/plugins/cache/sdsrss/claude-mem-lite"
|
|
123
123
|
if [[ -d "$CACHE_DIR" ]]; then
|
|
124
124
|
# List version dirs sorted by semver descending, skip top 3
|
|
125
|
-
|
|
125
|
+
# Use while-read instead of mapfile for bash 3.2 (macOS) compatibility
|
|
126
|
+
OLD_VERS=()
|
|
127
|
+
while IFS= read -r ver; do
|
|
128
|
+
[[ -n "$ver" ]] && OLD_VERS+=("$ver")
|
|
129
|
+
done < <(ls -1 "$CACHE_DIR" | grep -E '^[0-9]+\.' | sort -t. -k1,1nr -k2,2nr -k3,3nr | tail -n +4)
|
|
126
130
|
if [[ ${#OLD_VERS[@]} -gt 0 ]]; then
|
|
127
131
|
for ver in "${OLD_VERS[@]}"; do
|
|
128
132
|
rm -rf "${CACHE_DIR:?}/$ver" 2>/dev/null || true
|