@alex900530/claude-persistent-memory 1.0.0 → 1.0.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/README.md CHANGED
@@ -95,7 +95,7 @@ export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com"
95
95
  export AZURE_OPENAI_KEY="your-api-key"
96
96
 
97
97
  # Install in any project
98
- npm install @alex/claude-persistent-memory
98
+ npm install @alex900530/claude-persistent-memory
99
99
  ```
100
100
 
101
101
  That's it. The postinstall script automatically:
@@ -188,7 +188,7 @@ Then manually configure `.mcp.json` and `.claude/settings.json` — see [Configu
188
188
  npx claude-persistent-memory-uninstall
189
189
  ```
190
190
 
191
- Or manually: remove the `memory` entry from `.mcp.json`, remove memory hooks from `.claude/settings.json`, then `npm uninstall @alex/claude-persistent-memory`. The `.claude-memory/` data directory is preserved — delete it manually if no longer needed.
191
+ Or manually: remove the `memory` entry from `.mcp.json`, remove memory hooks from `.claude/settings.json`, then `npm uninstall @alex900530/claude-persistent-memory`. The `.claude-memory/` data directory is preserved — delete it manually if no longer needed.
192
192
 
193
193
  ## Configuration
194
194
 
package/bin/setup.js CHANGED
@@ -142,17 +142,19 @@ function setupHooks() {
142
142
  const command = `${envPrefix} ${NODE_BIN} ${path.join(PKG_DIR, 'hooks', file)}`;
143
143
 
144
144
  if (!existing.hooks[event]) existing.hooks[event] = [];
145
- const hooks = existing.hooks[event];
146
145
 
147
- // Find existing hook by script filename
148
- const idx = hooks.findIndex(h => h.command && h.command.includes(file));
149
- const entry = { type: 'command', command };
146
+ // Remove any existing entries (old or new format) matching this hook file
147
+ existing.hooks[event] = existing.hooks[event].filter(h => {
148
+ // Old format: { type, command }
149
+ if (h.command && h.command.includes(file)) return false;
150
+ // New format: { matcher, hooks: [{ type, command }] }
151
+ if (h.hooks && h.hooks.some(hh => hh.command && hh.command.includes(file))) return false;
152
+ return true;
153
+ });
150
154
 
151
- if (idx >= 0) {
152
- hooks[idx] = entry;
153
- } else {
154
- hooks.push(entry);
155
- }
155
+ // Add new format entry
156
+ const hookCmd = { type: 'command', command };
157
+ existing.hooks[event].push({ matcher: {}, hooks: [hookCmd] });
156
158
  }
157
159
 
158
160
  writeJSON(SETTINGS_FILE, existing);
package/bin/uninstall.js CHANGED
@@ -80,7 +80,10 @@ function removeHooks() {
80
80
  for (const event of Object.keys(data.hooks)) {
81
81
  const before = data.hooks[event].length;
82
82
  data.hooks[event] = data.hooks[event].filter(
83
- h => !hookFiles.some(f => h.command && h.command.includes(f))
83
+ h => !hookFiles.some(f =>
84
+ (h.hooks && h.hooks.some(hh => hh.command && hh.command.includes(f))) ||
85
+ (h.command && h.command.includes(f))
86
+ )
84
87
  );
85
88
  removed += before - data.hooks[event].length;
86
89
  if (data.hooks[event].length === 0) delete data.hooks[event];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alex900530/claude-persistent-memory",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Persistent memory system for Claude Code — hybrid BM25 + vector search, LLM-driven structuring, automatic clustering",
5
5
  "main": "lib/memory-db.js",
6
6
  "bin": {