@alex900530/claude-persistent-memory 1.0.1 → 1.0.3
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/bin/setup.js +11 -14
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -142,22 +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
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
);
|
|
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
|
+
});
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
hooks.push(entry);
|
|
160
|
-
}
|
|
155
|
+
// Add new format entry (matcher: "" means match all)
|
|
156
|
+
const hookCmd = { type: 'command', command };
|
|
157
|
+
existing.hooks[event].push({ matcher: '', hooks: [hookCmd] });
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
writeJSON(SETTINGS_FILE, existing);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alex900530/claude-persistent-memory",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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": {
|