claude-mem-lite 2.10.2 → 2.10.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.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "claude-mem-lite",
13
- "version": "2.10.2",
13
+ "version": "2.10.4",
14
14
  "source": "./",
15
15
  "description": "Lightweight persistent memory system for Claude Code — FTS5 search, episode batching, error-triggered recall"
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "2.10.2",
3
+ "version": "2.10.4",
4
4
  "description": "Lightweight persistent memory system for Claude Code — FTS5 search, episode batching, error-triggered recall",
5
5
  "author": {
6
6
  "name": "sdsrss"
package/README.md CHANGED
@@ -425,8 +425,7 @@ claude-mem-lite/
425
425
  .claude-plugin/
426
426
  plugin.json # Plugin manifest
427
427
  marketplace.json # Marketplace catalog
428
- claude-plugin/
429
- .mcp.json # MCP server definition source (installed into cache root)
428
+ .mcp.json # MCP server definition (plugin root)
430
429
  hooks/
431
430
  hooks.json # Hook definitions (plugin mode)
432
431
  commands/
package/README.zh-CN.md CHANGED
@@ -425,8 +425,7 @@ claude-mem-lite/
425
425
  .claude-plugin/
426
426
  plugin.json # 插件清单
427
427
  marketplace.json # 市场目录
428
- claude-plugin/
429
- .mcp.json # MCP 服务器定义源(安装后落到 cache 根目录)
428
+ .mcp.json # MCP 服务器定义(插件根目录)
430
429
  hooks/
431
430
  hooks.json # 钩子定义(插件模式)
432
431
  commands/
package/install.mjs CHANGED
@@ -237,9 +237,9 @@ async function install() {
237
237
  }
238
238
 
239
239
  // 3. Register MCP server (skip if plugin system already handles it)
240
- // Plugin source keeps MCP manifest at claude-plugin/.mcp.json.
241
- // Release packaging materializes that as root .mcp.json so Claude Code loads
242
- // plugin:*:mem from the installed cache.
240
+ // Plugin MCP must stay at root .mcp.json so Claude Code registers plugin:*:mem.
241
+ // Duplicate mem registrations in practice come from old global install.mjs state
242
+ // (claude mcp add) or stale marketplace copies, not from the cache root itself.
243
243
  // Global registration via `claude mcp add` creates a DUPLICATE mcp__mem__* server.
244
244
  // Detect plugin mode: installed_plugins.json has our entry → plugin handles MCP.
245
245
  const installedPluginsPath = join(homedir(), '.claude', 'plugins', 'installed_plugins.json');
@@ -272,17 +272,16 @@ async function install() {
272
272
  // while plugin hooks use ${CLAUDE_PLUGIN_ROOT} (potentially stale marketplace copy).
273
273
  //
274
274
  // MCP dedup: Claude Code loads .mcp.json from BOTH marketplace root (generic scan)
275
- // and cache dir (plugin runtime). Root-level .mcp.json in the marketplace clone
276
- // would duplicate the cache-installed plugin MCP. Keep the source manifest under
277
- // claude-plugin/.mcp.json and only materialize root .mcp.json in the release
278
- // package, while the marketplace root stays clear. Remove stale marketplace-root
279
- // copies here.
275
+ // and cache dir (plugin runtime). Keep root .mcp.json in the plugin so Claude
276
+ // Code can register MCP correctly, but remove stale marketplace-root copies and
277
+ // old global ~/.claude.json mem config to avoid duplicate registrations.
280
278
  const pluginDir = join(homedir(), '.claude', 'plugins', 'marketplaces', MARKETPLACE_KEY);
281
279
  const pluginHooksPath = join(pluginDir, 'hooks', 'hooks.json');
282
280
 
283
281
  if (existsSync(pluginDir)) {
284
282
  // Clear root-level .mcp.json if it exists (stale from older git versions).
285
- // Source MCP manifest stays in claude-plugin/.mcp.json; only the release package gets root .mcp.json.
283
+ // Root .mcp.json is required in the installed plugin cache; only remove stale
284
+ // marketplace clone copies here.
286
285
  const rootMcpPath = join(pluginDir, '.mcp.json');
287
286
  try {
288
287
  if (existsSync(rootMcpPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "2.10.2",
3
+ "version": "2.10.4",
4
4
  "description": "Lightweight persistent memory system for Claude Code",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,8 +18,6 @@
18
18
  "test": "vitest run",
19
19
  "test:smoke": "vitest run tests/smoke.test.mjs",
20
20
  "test:coverage": "vitest run --coverage",
21
- "prepack": "node scripts/sync-package-mcp.mjs write",
22
- "postpack": "node scripts/sync-package-mcp.mjs cleanup",
23
21
  "benchmark": "node benchmark/benchmark.mjs",
24
22
  "benchmark:gate": "node benchmark/ci-gate.mjs"
25
23
  },
package/scripts/setup.sh CHANGED
@@ -85,15 +85,16 @@ if [[ ! -d "$ROOT/node_modules/better-sqlite3" ]]; then
85
85
  fi
86
86
  fi
87
87
 
88
- # 7. One-time MCP migration: clean stale registrations from pre-2.10 versions.
89
- # Only runs once per version skips if marker file exists.
90
- # Before 2.10: .mcp.json at repo root caused duplicate MCP servers.
88
+ # 7. MCP cleanup: idempotently clean stale registrations from pre-2.10 direct installs.
89
+ # This runs on every plugin SessionStart because old global mem entries may still
90
+ # exist even after an earlier migration marker was written.
91
+ # Before 2.10: old direct installs left a global mem MCP alongside plugin MCP.
91
92
  # - Global mcpServers.mem in ~/.claude.json (from old install.mjs)
92
- # - Marketplace root .mcp.json (from old git clone)
93
- # Now: source manifest lives in claude-plugin/.mcp.json and release packaging
94
- # materializes cache root .mcp.json, while the marketplace root stays clear.
95
- MCP_MIGRATION="$DATA_DIR/runtime/.mcp-dedup-v2.10"
96
- if [[ ! -f "$MCP_MIGRATION" && -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
93
+ # - Possibly stale marketplace root .mcp.json (from old git clone)
94
+ # Root .mcp.json in the installed plugin cache is required for Claude Code to
95
+ # register plugin MCP; only stale global/marketplace copies should be removed.
96
+ MCP_MIGRATION="$DATA_DIR/runtime/.mcp-dedup-v2.10.4"
97
+ if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
97
98
  CLAUDE_JSON="$HOME/.claude.json" ROOT="$ROOT" node -e '
98
99
  const fs = require("fs");
99
100
  let changed = false;
@@ -119,7 +120,7 @@ if [[ ! -f "$MCP_MIGRATION" && -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
119
120
  if (m.mcpServers?.mem) {
120
121
  delete m.mcpServers.mem;
121
122
  fs.writeFileSync(mktMcp, JSON.stringify(m, null, 2) + "\n");
122
- process.stderr.write("✓ Cleared marketplace root .mcp.json (source manifest now lives in claude-plugin/)\n");
123
+ process.stderr.write("✓ Cleared stale marketplace root .mcp.json\n");
123
124
  changed = true;
124
125
  }
125
126
  }