brain-memory 0.1.0-beta.18 → 0.1.0-beta.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/installer.js +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brain-memory",
3
- "version": "0.1.0-beta.18",
3
+ "version": "0.1.0-beta.19",
4
4
  "description": "A brain-inspired hierarchical memory system for AI coding agents. Deep nested file structure that mimics human memory with time-decay and strength-based recall.",
5
5
  "keywords": [
6
6
  "claude-code",
package/src/installer.js CHANGED
@@ -225,9 +225,23 @@ function installForRuntime(runtime, scope) {
225
225
 
226
226
  if (config.commandStyle === 'skills') {
227
227
  const skillsDest = path.join(targetDir, config.commandsSubdir);
228
+ // Clear stale brain-* skill dirs first so renamed/removed commands don't
229
+ // linger across upgrades (e.g. brain-skill → brain-skills).
230
+ if (fs.existsSync(skillsDest)) {
231
+ for (const entry of fs.readdirSync(skillsDest)) {
232
+ if (entry.startsWith('brain-')) {
233
+ fs.rmSync(path.join(skillsDest, entry), { recursive: true, force: true });
234
+ }
235
+ }
236
+ }
228
237
  installSkills(commandsSrc, skillsDest);
229
238
  } else {
230
239
  const commandsDest = path.join(targetDir, config.commandsSubdir, 'brain');
240
+ // Wipe the brain command dir before copying so renamed/removed commands
241
+ // don't linger across upgrades. This is critical on case-insensitive
242
+ // filesystems: a leftover skill.md (== SKILL.md) makes Claude Code treat
243
+ // the whole dir as one skill and hides every /brain:* command.
244
+ fs.rmSync(commandsDest, { recursive: true, force: true });
231
245
  copyDir(commandsSrc, commandsDest);
232
246
  }
233
247