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.
@@ -0,0 +1,69 @@
1
+ 0 verbose cli /home/walter/.nvm/versions/node/v20.18.3/bin/node /home/walter/.nvm/versions/node/v20.18.3/bin/npm
2
+ 1 info using npm@10.8.2
3
+ 2 info using node@v20.18.3
4
+ 3 silly config load:file:/home/walter/.nvm/versions/node/v20.18.3/lib/node_modules/npm/npmrc
5
+ 4 silly config load:file:/home/walter/.npmrc
6
+ 5 silly config load:file:/tmp/tmp.NQjGxz5gur/prefix/etc/npmrc
7
+ 6 verbose title npm install ./claude-memory-layer-1.0.14.tgz
8
+ 7 verbose argv "install" "--global" "./claude-memory-layer-1.0.14.tgz" "--prefix" "/tmp/tmp.NQjGxz5gur/prefix"
9
+ 8 verbose logfile logs-max:10 dir:/home/walter/workspace/opensource/claude-memory-layer/.npm-cache/_logs/2026-02-26T12_05_53_567Z-
10
+ 9 verbose logfile /home/walter/workspace/opensource/claude-memory-layer/.npm-cache/_logs/2026-02-26T12_05_53_567Z-debug-0.log
11
+ 10 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
12
+ 11 silly logfile done cleaning log files
13
+ 12 silly idealTree buildDeps
14
+ 13 silly fetch manifest claude-memory-layer@file:../../../../home/walter/workspace/opensource/claude-memory-layer/claude-memory-layer-1.0.14.tgz
15
+ 14 silly placeDep ROOT claude-memory-layer@1.0.14 OK for: want: file:../../../../home/walter/workspace/opensource/claude-memory-layer/claude-memory-layer-1.0.14.tgz
16
+ 15 silly fetch manifest @hono/node-server@^1.13.0
17
+ 16 silly packumentCache full:https://registry.npmjs.org/@hono%2fnode-server cache-miss
18
+ 17 silly fetch manifest @lancedb/lancedb@^0.5.0
19
+ 18 silly packumentCache full:https://registry.npmjs.org/@lancedb%2flancedb cache-miss
20
+ 19 silly fetch manifest @xenova/transformers@^2.17.0
21
+ 20 silly packumentCache full:https://registry.npmjs.org/@xenova%2ftransformers cache-miss
22
+ 21 silly fetch manifest better-sqlite3@^12.6.2
23
+ 22 silly packumentCache full:https://registry.npmjs.org/better-sqlite3 cache-miss
24
+ 23 silly fetch manifest commander@^12.0.0
25
+ 24 silly packumentCache full:https://registry.npmjs.org/commander cache-miss
26
+ 25 silly fetch manifest duckdb@^0.10.0
27
+ 26 silly packumentCache full:https://registry.npmjs.org/duckdb cache-miss
28
+ 27 silly fetch manifest hono@^4.0.0
29
+ 28 silly packumentCache full:https://registry.npmjs.org/hono cache-miss
30
+ 29 silly fetch manifest mongodb@^6.14.0
31
+ 30 silly packumentCache full:https://registry.npmjs.org/mongodb cache-miss
32
+ 31 silly fetch manifest zod@^3.22.0
33
+ 32 silly packumentCache full:https://registry.npmjs.org/zod cache-miss
34
+ 33 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 1 failed with EAI_AGAIN
35
+ 34 http fetch GET https://registry.npmjs.org/@lancedb%2flancedb attempt 1 failed with EAI_AGAIN
36
+ 35 http fetch GET https://registry.npmjs.org/@xenova%2ftransformers attempt 1 failed with EAI_AGAIN
37
+ 36 http fetch GET https://registry.npmjs.org/better-sqlite3 attempt 1 failed with EAI_AGAIN
38
+ 37 http fetch GET https://registry.npmjs.org/commander attempt 1 failed with EAI_AGAIN
39
+ 38 http fetch GET https://registry.npmjs.org/duckdb attempt 1 failed with EAI_AGAIN
40
+ 39 http fetch GET https://registry.npmjs.org/hono attempt 1 failed with EAI_AGAIN
41
+ 40 http fetch GET https://registry.npmjs.org/mongodb attempt 1 failed with EAI_AGAIN
42
+ 41 http fetch GET https://registry.npmjs.org/zod attempt 1 failed with EAI_AGAIN
43
+ 42 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 2 failed with EAI_AGAIN
44
+ 43 http fetch GET https://registry.npmjs.org/@lancedb%2flancedb attempt 2 failed with EAI_AGAIN
45
+ 44 http fetch GET https://registry.npmjs.org/@xenova%2ftransformers attempt 2 failed with EAI_AGAIN
46
+ 45 http fetch GET https://registry.npmjs.org/better-sqlite3 attempt 2 failed with EAI_AGAIN
47
+ 46 http fetch GET https://registry.npmjs.org/commander attempt 2 failed with EAI_AGAIN
48
+ 47 http fetch GET https://registry.npmjs.org/duckdb attempt 2 failed with EAI_AGAIN
49
+ 48 http fetch GET https://registry.npmjs.org/hono attempt 2 failed with EAI_AGAIN
50
+ 49 http fetch GET https://registry.npmjs.org/mongodb attempt 2 failed with EAI_AGAIN
51
+ 50 http fetch GET https://registry.npmjs.org/zod attempt 2 failed with EAI_AGAIN
52
+ 51 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 3 failed with EAI_AGAIN
53
+ 52 http fetch GET https://registry.npmjs.org/@lancedb%2flancedb attempt 3 failed with EAI_AGAIN
54
+ 53 http fetch GET https://registry.npmjs.org/@xenova%2ftransformers attempt 3 failed with EAI_AGAIN
55
+ 54 http fetch GET https://registry.npmjs.org/better-sqlite3 attempt 3 failed with EAI_AGAIN
56
+ 55 http fetch GET https://registry.npmjs.org/commander attempt 3 failed with EAI_AGAIN
57
+ 56 http fetch GET https://registry.npmjs.org/duckdb attempt 3 failed with EAI_AGAIN
58
+ 57 http fetch GET https://registry.npmjs.org/hono attempt 3 failed with EAI_AGAIN
59
+ 58 http fetch GET https://registry.npmjs.org/mongodb attempt 3 failed with EAI_AGAIN
60
+ 59 http fetch GET https://registry.npmjs.org/zod attempt 3 failed with EAI_AGAIN
61
+ 60 silly fetch manifest @hono/node-server@^1.13.0
62
+ 61 silly packumentCache full:https://registry.npmjs.org/@hono%2fnode-server cache-miss
63
+ 62 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 1 failed with EAI_AGAIN
64
+ 63 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 2 failed with EAI_AGAIN
65
+ 64 http fetch GET https://registry.npmjs.org/@hono%2fnode-server attempt 3 failed with EAI_AGAIN
66
+ 65 silly fetch manifest @lancedb/lancedb@^0.5.0
67
+ 66 silly packumentCache full:https://registry.npmjs.org/@lancedb%2flancedb cache-miss
68
+ 67 http fetch GET https://registry.npmjs.org/@lancedb%2flancedb attempt 1 failed with EAI_AGAIN
69
+ 68 http fetch GET https://registry.npmjs.org/@lancedb%2flancedb attempt 2 failed with EAI_AGAIN
File without changes
Binary file
package/dist/cli/index.js CHANGED
@@ -7037,16 +7037,28 @@ var SessionHistoryImporter = class {
7037
7037
  };
7038
7038
  const onProgress = options.onProgress;
7039
7039
  onProgress?.({ phase: "scan", message: "Scanning for session files..." });
7040
- const projectDir = await this.findProjectDir(projectPath);
7041
- if (!projectDir) {
7040
+ const projectDirs = await this.findProjectDirs(projectPath);
7041
+ if (projectDirs.length === 0) {
7042
7042
  result.errors.push(`Project directory not found for: ${projectPath}`);
7043
7043
  return result;
7044
7044
  }
7045
- const sessionFiles = await this.findSessionFiles(projectDir);
7045
+ const allSessionFiles = [];
7046
+ for (const dir of projectDirs) {
7047
+ const files = await this.findSessionFiles(dir);
7048
+ allSessionFiles.push(...files);
7049
+ }
7050
+ const sessionFiles = [...new Set(allSessionFiles)];
7046
7051
  result.totalSessions = sessionFiles.length;
7047
- onProgress?.({ phase: "scan", message: `Found ${sessionFiles.length} sessions in ${path4.basename(projectDir)}` });
7052
+ onProgress?.({
7053
+ phase: "scan",
7054
+ message: `Found ${sessionFiles.length} sessions in ${projectDirs.length} matched project folder(s)`
7055
+ });
7048
7056
  if (options.verbose) {
7049
- console.log(`Found ${sessionFiles.length} session files in ${projectDir}`);
7057
+ console.log(`Matched project folders:`);
7058
+ for (const dir of projectDirs) {
7059
+ console.log(` - ${dir}`);
7060
+ }
7061
+ console.log(`Found ${sessionFiles.length} session files across matched folders`);
7050
7062
  }
7051
7063
  for (let i = 0; i < sessionFiles.length; i++) {
7052
7064
  const sessionFile = sessionFiles[i];
@@ -7246,22 +7258,39 @@ var SessionHistoryImporter = class {
7246
7258
  return result;
7247
7259
  }
7248
7260
  /**
7249
- * Find project directory from project path
7261
+ * Find project directories from project path.
7262
+ * Supports wrappers (e.g. happy) that append extra path segments in folder names.
7250
7263
  */
7251
- async findProjectDir(projectPath) {
7264
+ async findProjectDirs(projectPath) {
7252
7265
  const projectsDir = path4.join(this.claudeDir, "projects");
7253
7266
  if (!fs5.existsSync(projectsDir)) {
7254
- return null;
7267
+ return [];
7255
7268
  }
7256
7269
  const projectDirs = fs5.readdirSync(projectsDir).map((name) => path4.join(projectsDir, name)).filter((p) => fs5.statSync(p).isDirectory());
7257
- const normalizedPath = projectPath.replace(/\//g, "-").replace(/^-/, "");
7258
- for (const dir of projectDirs) {
7270
+ const normalizedPath = projectPath.replace(/\+/g, "/").replace(/\/$/, "");
7271
+ const normalizeToken = (value) => value.toLowerCase().replace(/[\s_]+/g, "-").replace(/\/+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
7272
+ const normalizedDashed = normalizeToken(normalizedPath);
7273
+ const baseName = normalizeToken(path4.basename(normalizedPath));
7274
+ const scored = projectDirs.map((dir) => {
7259
7275
  const dirName = path4.basename(dir);
7260
- if (dirName.includes(normalizedPath) || normalizedPath.includes(dirName)) {
7261
- return dir;
7262
- }
7263
- }
7264
- return projectDirs.length > 0 ? projectDirs[0] : null;
7276
+ const normalizedDirName = dirName.toLowerCase().replace(/[\s_]+/g, "-");
7277
+ let score = 0;
7278
+ if (normalizedDirName.includes(normalizedDashed))
7279
+ score += 100;
7280
+ if (normalizedDashed.includes(normalizedDirName))
7281
+ score += 80;
7282
+ if (baseName && normalizedDirName.includes(baseName))
7283
+ score += 30;
7284
+ const pathTokens = normalizedDashed.split("-").filter(Boolean);
7285
+ const tokenHits = pathTokens.filter((t) => t.length >= 3 && normalizedDirName.includes(t)).length;
7286
+ score += Math.min(tokenHits, 20);
7287
+ return { dir, score, dirName };
7288
+ }).filter((x) => x.score > 0).sort((a, b) => b.score - a.score);
7289
+ if (scored.length === 0)
7290
+ return [];
7291
+ const top = scored[0].score;
7292
+ const threshold = Math.max(30, top - 25);
7293
+ return scored.filter((x) => x.score >= threshold).map((x) => x.dir);
7265
7294
  }
7266
7295
  /**
7267
7296
  * Find all JSONL session files in a directory
@@ -7296,10 +7325,7 @@ var SessionHistoryImporter = class {
7296
7325
  const sessions = [];
7297
7326
  let projectDirs = [];
7298
7327
  if (projectPath) {
7299
- const projectDir = await this.findProjectDir(projectPath);
7300
- if (projectDir) {
7301
- projectDirs = [projectDir];
7302
- }
7328
+ projectDirs = await this.findProjectDirs(projectPath);
7303
7329
  } else {
7304
7330
  const projectsDir = path4.join(this.claudeDir, "projects");
7305
7331
  if (fs5.existsSync(projectsDir)) {
@@ -9215,7 +9241,7 @@ function getHooksConfig(pluginPath) {
9215
9241
  };
9216
9242
  }
9217
9243
  var program = new Command();
9218
- program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.12");
9244
+ program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.15");
9219
9245
  program.command("install").description("Install hooks into Claude Code settings").option("--path <path>", "Custom plugin path (defaults to auto-detect)").action(async (options) => {
9220
9246
  try {
9221
9247
  const pluginPath = options.path || getPluginPath();