claude-mem-lite 2.9.6 → 2.9.7

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.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "claude-mem-lite",
13
- "version": "2.9.6",
13
+ "version": "2.9.7",
14
14
  "source": "./",
15
15
  "description": "Lightweight persistent memory system for Claude Code — FTS5 search, episode batching, error-triggered recall"
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "2.9.6",
3
+ "version": "2.9.7",
4
4
  "description": "Lightweight persistent memory system for Claude Code — FTS5 search, episode batching, error-triggered recall",
5
5
  "author": {
6
6
  "name": "sdsrss"
package/README.md CHANGED
@@ -485,7 +485,7 @@ The benchmark suite runs as a CI gate (`npm run benchmark:gate`) to prevent sear
485
485
  npm run lint # ESLint static analysis
486
486
  npm test # Run full test suite (vitest)
487
487
  npm run test:smoke # Run 5 core smoke tests
488
- npm run test:coverage # Run tests with V8 coverage (≥70% lines/functions, ≥60% branches)
488
+ npm run test:coverage # Run tests with V8 coverage (≥75% lines/functions, ≥65% branches)
489
489
  npm run benchmark # Run full search quality benchmark
490
490
  npm run benchmark:gate # CI gate: fails if metrics regress beyond 5% tolerance
491
491
  ```
package/README.zh-CN.md CHANGED
@@ -485,7 +485,7 @@ claude-mem-lite/
485
485
  npm run lint # ESLint 静态分析
486
486
  npm test # 运行完整测试套件(vitest)
487
487
  npm run test:smoke # 运行 5 个核心冒烟测试
488
- npm run test:coverage # 运行测试并生成 V8 覆盖率(≥70% 行/函数,≥60% 分支)
488
+ npm run test:coverage # 运行测试并生成 V8 覆盖率(≥75% 行/函数,≥65% 分支)
489
489
  npm run benchmark # 运行完整搜索质量基准测试
490
490
  npm run benchmark:gate # CI 门控:指标回退超过 5% 容差时失败
491
491
  ```
package/hook-update.mjs CHANGED
@@ -83,10 +83,15 @@ export async function checkForUpdate(options = {}) {
83
83
  latestVersion: latest.version,
84
84
  updateAvailable: false,
85
85
  rateLimited: false,
86
+ lastError: null,
86
87
  });
87
88
  return null;
88
89
  } catch (err) {
89
90
  debugCatch(err, 'checkForUpdate');
91
+ try {
92
+ const s = readState();
93
+ saveState({ ...s, lastCheck: new Date().toISOString(), lastError: err.message });
94
+ } catch {}
90
95
  return null;
91
96
  }
92
97
  }
package/install.mjs CHANGED
@@ -945,6 +945,7 @@ async function doctor() {
945
945
  if (state.lastUpdate) parts.push(`last update: ${state.lastUpdate}`);
946
946
  if (state.updateAvailable) parts.push('update pending');
947
947
  if (state.rateLimited) parts.push('rate-limited');
948
+ if (state.lastError) parts.push(`last error: ${state.lastError}`);
948
949
  ok(`Update state: ${parts.join(', ') || 'empty'}`);
949
950
  } else {
950
951
  warn('Update state: no state file (first run?)');
@@ -969,7 +970,7 @@ async function doctor() {
969
970
  }
970
971
  }
971
972
  if (staleCount > 0) {
972
- warn(`Stale temp files: ${staleCount} found (run cleanup to remove)`);
973
+ warn(`Stale temp files: ${staleCount} found (run: node install.mjs cleanup)`);
973
974
  } else {
974
975
  ok('Stale temp files: none');
975
976
  }
@@ -1068,6 +1069,47 @@ function writeSettings(settings) {
1068
1069
  renameSync(tmp, SETTINGS_PATH);
1069
1070
  }
1070
1071
 
1072
+ // ─── Cleanup Stale Files ─────────────────────────────────────────────────────
1073
+
1074
+ function cleanup() {
1075
+ console.log('\nclaude-mem-lite cleanup\n');
1076
+ let removed = 0;
1077
+
1078
+ // Clean .update-staging-* / .update-backup-* in INSTALL_DIR
1079
+ const stalePatterns = ['.update-staging-', '.update-backup-'];
1080
+ if (existsSync(INSTALL_DIR)) {
1081
+ for (const f of readdirSync(INSTALL_DIR)) {
1082
+ if (stalePatterns.some(p => f.startsWith(p))) {
1083
+ try {
1084
+ rmSync(join(INSTALL_DIR, f), { recursive: true, force: true });
1085
+ ok(`Removed: ${f}`);
1086
+ removed++;
1087
+ } catch (e) {
1088
+ warn(`Failed to remove ${f}: ${e.message}`);
1089
+ }
1090
+ }
1091
+ }
1092
+ }
1093
+
1094
+ // Clean pending-* / ep-flush-* in runtime/
1095
+ const runtimeDir = join(INSTALL_DIR, 'runtime');
1096
+ if (existsSync(runtimeDir)) {
1097
+ for (const f of readdirSync(runtimeDir)) {
1098
+ if (f.startsWith('pending-') || f.startsWith('ep-flush-')) {
1099
+ try {
1100
+ rmSync(join(runtimeDir, f), { force: true });
1101
+ ok(`Removed: runtime/${f}`);
1102
+ removed++;
1103
+ } catch (e) {
1104
+ warn(`Failed to remove runtime/${f}: ${e.message}`);
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+
1110
+ console.log(`\n ${removed === 0 ? 'No stale files found.' : `Removed ${removed} stale file(s).`}\n`);
1111
+ }
1112
+
1071
1113
  // ─── Manual Update ───────────────────────────────────────────────────────────
1072
1114
 
1073
1115
  async function manualUpdate() {
@@ -1156,6 +1198,9 @@ export async function main(argv = process.argv.slice(2)) {
1156
1198
  case 'cleanup-hooks':
1157
1199
  await cleanupHooks();
1158
1200
  break;
1201
+ case 'cleanup':
1202
+ cleanup();
1203
+ break;
1159
1204
  case 'update':
1160
1205
  await manualUpdate();
1161
1206
  break;
@@ -1177,6 +1222,7 @@ Usage:
1177
1222
  node install.mjs uninstall --purge Remove and delete all data
1178
1223
  node install.mjs status Show current status
1179
1224
  node install.mjs doctor Diagnose issues
1225
+ node install.mjs cleanup Remove stale temp/staging files
1180
1226
  node install.mjs cleanup-hooks Remove only claude-mem-lite hooks from settings.json
1181
1227
  node install.mjs update Check for and install updates
1182
1228
  node install.mjs release Sync version to plugin.json + marketplace.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "2.9.6",
3
+ "version": "2.9.7",
4
4
  "description": "Lightweight persistent memory system for Claude Code",
5
5
  "type": "module",
6
6
  "engines": {