claude-memory-layer 1.0.13 → 1.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-memory-layer",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Claude Code plugin that learns from conversations to provide personalized assistance",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -426,24 +426,32 @@ export class SessionHistoryImporter {
426
426
  .map(name => path.join(projectsDir, name))
427
427
  .filter(p => fs.statSync(p).isDirectory());
428
428
 
429
- const normalizedPath = projectPath.replace(/\/+/g, '/').replace(/\/$/, '');
430
- const normalizedDashed = normalizedPath.replace(/\//g, '-').replace(/^-/, '');
431
- const baseName = path.basename(normalizedPath);
429
+ const normalizedPath = projectPath.replace(/\+/g, '/').replace(/\/$/, '');
430
+ const normalizeToken = (value: string) => value
431
+ .toLowerCase()
432
+ .replace(/[\s_]+/g, '-')
433
+ .replace(/\/+/g, '-')
434
+ .replace(/-+/g, '-')
435
+ .replace(/^-|-$/g, '');
436
+
437
+ const normalizedDashed = normalizeToken(normalizedPath);
438
+ const baseName = normalizeToken(path.basename(normalizedPath));
432
439
 
433
440
  const scored = projectDirs.map((dir) => {
434
441
  const dirName = path.basename(dir);
442
+ const normalizedDirName = dirName.toLowerCase().replace(/[\s_]+/g, '-');
435
443
  let score = 0;
436
444
 
437
445
  // strong matches
438
- if (dirName.includes(normalizedDashed)) score += 100;
439
- if (normalizedDashed.includes(dirName)) score += 80;
446
+ if (normalizedDirName.includes(normalizedDashed)) score += 100;
447
+ if (normalizedDashed.includes(normalizedDirName)) score += 80;
440
448
 
441
449
  // basename signal (handles wrappers adding extra suffix)
442
- if (baseName && dirName.includes(baseName)) score += 30;
450
+ if (baseName && normalizedDirName.includes(baseName)) score += 30;
443
451
 
444
452
  // token overlap signal
445
453
  const pathTokens = normalizedDashed.split('-').filter(Boolean);
446
- const tokenHits = pathTokens.filter(t => t.length >= 3 && dirName.includes(t)).length;
454
+ const tokenHits = pathTokens.filter(t => t.length >= 3 && normalizedDirName.includes(t)).length;
447
455
  score += Math.min(tokenHits, 20);
448
456
 
449
457
  return { dir, score, dirName };