claude-mem-lite 3.96.0 → 3.97.0

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 (143) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/adopt-cli.mjs +125 -51
  4. package/bash-utils.mjs +105 -29
  5. package/claudemd.mjs +63 -19
  6. package/cli/activity.mjs +36 -18
  7. package/cli/common.mjs +101 -18
  8. package/cli/doctor.mjs +29 -9
  9. package/cli.mjs +69 -10
  10. package/deep-search.mjs +63 -20
  11. package/format-utils.mjs +15 -7
  12. package/haiku-client.mjs +189 -111
  13. package/hash-utils.mjs +15 -6
  14. package/hook-context.mjs +135 -46
  15. package/hook-episode.mjs +76 -23
  16. package/hook-handoff.mjs +216 -84
  17. package/hook-llm.mjs +476 -216
  18. package/hook-memory.mjs +106 -43
  19. package/hook-optimize.mjs +272 -109
  20. package/hook-precompact.mjs +1 -1
  21. package/hook-semaphore.mjs +46 -12
  22. package/hook-shared.mjs +101 -131
  23. package/hook-update.mjs +286 -88
  24. package/hook.mjs +1207 -617
  25. package/install-metadata.mjs +246 -125
  26. package/install.mjs +1327 -917
  27. package/lib/activity.mjs +52 -29
  28. package/lib/atomic-write.mjs +23 -4
  29. package/lib/binding-probe.mjs +40 -38
  30. package/lib/browse-core.mjs +22 -8
  31. package/lib/citation-tracker.mjs +189 -79
  32. package/lib/cite-back-hint.mjs +37 -19
  33. package/lib/cite-recall-path.mjs +3 -1
  34. package/lib/cli-flags.mjs +4 -2
  35. package/lib/cli-project.mjs +8 -5
  36. package/lib/compress-core.mjs +34 -9
  37. package/lib/cooldown-path.mjs +3 -1
  38. package/lib/db-backup.mjs +33 -11
  39. package/lib/deferred-work.mjs +73 -32
  40. package/lib/delete-core.mjs +25 -9
  41. package/lib/doctor-benchmark.mjs +5 -1
  42. package/lib/doctor-drift.mjs +25 -8
  43. package/lib/edge-attribution.mjs +23 -9
  44. package/lib/env-number.mjs +7 -8
  45. package/lib/err-sampler.mjs +22 -11
  46. package/lib/error-recall-core.mjs +15 -17
  47. package/lib/events-injection.mjs +25 -8
  48. package/lib/export-columns.mjs +49 -10
  49. package/lib/fast-summary.mjs +22 -9
  50. package/lib/file-edge-match.mjs +4 -2
  51. package/lib/file-intel.mjs +38 -13
  52. package/lib/frontmatter.mjs +22 -5
  53. package/lib/get-core.mjs +78 -11
  54. package/lib/handoff-constants.mjs +18 -0
  55. package/lib/hook-stdin.mjs +10 -3
  56. package/lib/hook-stdout.mjs +21 -7
  57. package/lib/hook-telemetry.mjs +44 -17
  58. package/lib/id-routing.mjs +11 -6
  59. package/lib/import-jsonl.mjs +92 -41
  60. package/lib/inject-search-core.mjs +5 -2
  61. package/lib/injected-ids.mjs +19 -12
  62. package/lib/install-shape.mjs +47 -23
  63. package/lib/keyctx-marker.mjs +3 -1
  64. package/lib/lesson-bridge.mjs +8 -5
  65. package/lib/llm-call.mjs +76 -0
  66. package/lib/llm-provider-probe.mjs +24 -12
  67. package/lib/low-signal-patterns.mjs +25 -22
  68. package/lib/maintain-core.mjs +221 -92
  69. package/lib/mem-override.mjs +4 -2
  70. package/lib/metrics.mjs +30 -25
  71. package/lib/native-binding-hint.mjs +29 -8
  72. package/lib/observation-write.mjs +74 -19
  73. package/lib/patha-exclude-meter.mjs +10 -6
  74. package/lib/persist-reminder.mjs +22 -10
  75. package/lib/plan-reader.mjs +2 -2
  76. package/lib/private-strip.mjs +3 -3
  77. package/lib/proc-lock.mjs +15 -3
  78. package/lib/proxy-fetch.mjs +49 -13
  79. package/lib/quiet-scope.mjs +42 -0
  80. package/lib/recall-core.mjs +19 -7
  81. package/lib/recent-core.mjs +18 -5
  82. package/lib/registry-core.mjs +12 -6
  83. package/lib/release-digest.mjs +4 -1
  84. package/lib/relevance-floor.mjs +5 -2
  85. package/lib/reread-guard.mjs +16 -8
  86. package/lib/resolve-data-dir.mjs +1 -1
  87. package/lib/rrf.mjs +4 -1
  88. package/lib/save-enrich.mjs +36 -18
  89. package/lib/save-observation.mjs +78 -35
  90. package/lib/scrub-record.mjs +20 -6
  91. package/lib/search-core.mjs +456 -123
  92. package/lib/shard-gc.mjs +50 -0
  93. package/lib/startup-dashboard.mjs +20 -9
  94. package/lib/stats-core.mjs +101 -35
  95. package/lib/stats-quality.mjs +56 -20
  96. package/lib/summary-extractor.mjs +2 -2
  97. package/lib/task-imperative.mjs +12 -4
  98. package/lib/timeline-core.mjs +88 -28
  99. package/lib/tmp-fixture-sweep.mjs +32 -9
  100. package/lib/transcript-scan.mjs +20 -4
  101. package/lib/upgrade-banner.mjs +11 -7
  102. package/mem-cli.mjs +1314 -506
  103. package/memdir.mjs +53 -21
  104. package/nlp.mjs +68 -38
  105. package/npm-shrinkwrap.json +2 -2
  106. package/package.json +9 -2
  107. package/plugin-cache-guard.mjs +31 -15
  108. package/project-utils.mjs +44 -20
  109. package/registry-enricher.mjs +26 -6
  110. package/registry-github.mjs +4 -2
  111. package/registry-importer.mjs +151 -40
  112. package/registry-recommend.mjs +189 -96
  113. package/registry-retriever.mjs +229 -70
  114. package/registry-scanner.mjs +11 -6
  115. package/registry.mjs +163 -66
  116. package/rerank.mjs +18 -4
  117. package/resource-discovery.mjs +14 -4
  118. package/schema.mjs +258 -99
  119. package/scoring-sql.mjs +21 -10
  120. package/scripts/binding-probe-cli.mjs +17 -12
  121. package/scripts/hook-launcher.mjs +148 -31
  122. package/scripts/launch-preflight.mjs +5 -7
  123. package/scripts/launch.mjs +21 -9
  124. package/scripts/post-tool-recall.js +21 -5
  125. package/scripts/pre-agent-inject.js +51 -13
  126. package/scripts/pre-skill-bridge.js +22 -7
  127. package/scripts/pre-tool-recall.js +157 -77
  128. package/scripts/prompt-search-utils.mjs +70 -25
  129. package/scripts/setup.sh +16 -1
  130. package/scripts/user-prompt-search.js +238 -97
  131. package/search-engine.mjs +329 -96
  132. package/search-scoring.mjs +75 -33
  133. package/secret-scrub.mjs +48 -12
  134. package/server/fts-check.mjs +12 -9
  135. package/server.mjs +674 -243
  136. package/skip-tools.mjs +19 -8
  137. package/source-files.mjs +54 -21
  138. package/stop-words.mjs +152 -19
  139. package/synonyms.mjs +579 -164
  140. package/tfidf.mjs +130 -40
  141. package/tier.mjs +1 -1
  142. package/tool-schemas.mjs +381 -131
  143. package/utils.mjs +184 -36
package/skip-tools.mjs CHANGED
@@ -3,19 +3,30 @@
3
3
 
4
4
  /** Exact tool names to skip — low-value tools that don't need memory processing */
5
5
  export const SKIP_TOOLS = new Set([
6
- 'Read', 'Glob', // noise — just opening/finding files
7
- 'TodoRead', 'TodoWrite', 'TaskList', 'TaskGet', 'TaskCreate', 'TaskUpdate',
8
- 'AskUserQuestion', 'EnterPlanMode', 'ExitPlanMode',
9
- 'mcp__claude-in-chrome__screenshot', 'mcp__claude-in-chrome__read_page',
10
- 'mcp__claude-in-chrome__tabs_context_mcp', 'mcp__claude-in-chrome__computer',
11
- 'mcp__claude-in-chrome__find', 'mcp__claude-in-chrome__navigate',
6
+ 'Read',
7
+ 'Glob', // noise — just opening/finding files
8
+ 'TodoRead',
9
+ 'TodoWrite',
10
+ 'TaskList',
11
+ 'TaskGet',
12
+ 'TaskCreate',
13
+ 'TaskUpdate',
14
+ 'AskUserQuestion',
15
+ 'EnterPlanMode',
16
+ 'ExitPlanMode',
17
+ 'mcp__claude-in-chrome__screenshot',
18
+ 'mcp__claude-in-chrome__read_page',
19
+ 'mcp__claude-in-chrome__tabs_context_mcp',
20
+ 'mcp__claude-in-chrome__computer',
21
+ 'mcp__claude-in-chrome__find',
22
+ 'mcp__claude-in-chrome__navigate',
12
23
  ]);
13
24
 
14
25
  /** Prefix patterns — tools starting with these are also skipped */
15
26
  export const SKIP_PREFIXES = [
16
27
  'mem_',
17
- 'mcp__mem__', // legacy global MCP name (pre-rename)
18
- 'mcp__mem-lite__', // current global MCP name (post-rename v2.78+)
28
+ 'mcp__mem__', // legacy global MCP name (pre-rename)
29
+ 'mcp__mem-lite__', // current global MCP name (post-rename v2.78+)
19
30
  'mcp__plugin_claude-mem-lite',
20
31
  'mcp__sequential',
21
32
  'mcp__plugin_context7',
package/source-files.mjs CHANGED
@@ -6,29 +6,63 @@
6
6
 
7
7
  export const SOURCE_FILES = [
8
8
  // Entry points and top-level modules
9
- 'cli.mjs', 'cli-path.mjs', 'server.mjs', 'search-scoring.mjs', 'search-engine.mjs', 'deep-search.mjs', 'rerank.mjs', 'tool-schemas.mjs',
10
- 'hook.mjs', 'hook-shared.mjs', 'hook-llm.mjs', 'hook-memory.mjs', 'skip-tools.mjs',
11
- 'hook-semaphore.mjs', 'hook-episode.mjs', 'hook-context.mjs', 'hook-handoff.mjs',
12
- 'hook-update.mjs', 'hook-optimize.mjs', 'hook-precompact.mjs',
9
+ 'cli.mjs',
10
+ 'cli-path.mjs',
11
+ 'server.mjs',
12
+ 'search-scoring.mjs',
13
+ 'search-engine.mjs',
14
+ 'deep-search.mjs',
15
+ 'rerank.mjs',
16
+ 'tool-schemas.mjs',
17
+ 'hook.mjs',
18
+ 'hook-shared.mjs',
19
+ 'hook-llm.mjs',
20
+ 'hook-memory.mjs',
21
+ 'skip-tools.mjs',
22
+ 'hook-semaphore.mjs',
23
+ 'hook-episode.mjs',
24
+ 'hook-context.mjs',
25
+ 'hook-handoff.mjs',
26
+ 'hook-update.mjs',
27
+ 'hook-optimize.mjs',
28
+ 'hook-precompact.mjs',
13
29
  'plugin-cache-guard.mjs',
14
- 'haiku-client.mjs', 'utils.mjs', 'schema.mjs',
15
- 'package.json', 'package-lock.json', 'skill.md',
16
- 'registry.mjs', 'registry-scanner.mjs',
17
- 'registry-retriever.mjs', 'resource-discovery.mjs',
30
+ 'haiku-client.mjs',
31
+ 'utils.mjs',
32
+ 'schema.mjs',
33
+ 'package.json',
34
+ 'package-lock.json',
35
+ 'skill.md',
36
+ 'registry.mjs',
37
+ 'registry-scanner.mjs',
38
+ 'registry-retriever.mjs',
39
+ 'resource-discovery.mjs',
18
40
  // registry-recommend.mjs: statically imported by hook.mjs (PostToolUse adoption probe)
19
41
  // and scripts/user-prompt-search.js (UserPromptSubmit shadow recommendation).
20
42
  'registry-recommend.mjs',
21
43
  // registry-enricher/-github/-importer are dynamically imported by server.mjs
22
44
  // (mem_registry tool) and mem-cli.mjs (registry CLI subcommands). Missing
23
45
  // them from SOURCE_FILES silently broke those code paths prior to this fix.
24
- 'registry-enricher.mjs', 'registry-github.mjs', 'registry-importer.mjs',
46
+ 'registry-enricher.mjs',
47
+ 'registry-github.mjs',
48
+ 'registry-importer.mjs',
25
49
  // Shared SOURCE_FILES manifest — self-reference so `~/.claude-mem-lite/` can
26
50
  // re-run install.mjs (which imports this module) after an auto-update.
27
51
  'source-files.mjs',
28
- 'install.mjs', 'install-metadata.mjs', 'mem-cli.mjs',
29
- 'tier.mjs', 'tfidf.mjs',
30
- 'nlp.mjs', 'synonyms.mjs', 'scoring-sql.mjs', 'stop-words.mjs', 'project-utils.mjs',
31
- 'secret-scrub.mjs', 'format-utils.mjs', 'hash-utils.mjs', 'bash-utils.mjs',
52
+ 'install.mjs',
53
+ 'install-metadata.mjs',
54
+ 'mem-cli.mjs',
55
+ 'tier.mjs',
56
+ 'tfidf.mjs',
57
+ 'nlp.mjs',
58
+ 'synonyms.mjs',
59
+ 'scoring-sql.mjs',
60
+ 'stop-words.mjs',
61
+ 'project-utils.mjs',
62
+ 'secret-scrub.mjs',
63
+ 'format-utils.mjs',
64
+ 'hash-utils.mjs',
65
+ 'bash-utils.mjs',
32
66
  // Single source of truth for the CLAUDE_MEM_DIR → data-dir resolver (rejects a
33
67
  // stringified "undefined"/"null"/relative env instead of creating a stray dir).
34
68
  // Statically imported by schema.mjs / cli.mjs / install.mjs / registry-recommend.mjs
@@ -83,7 +117,11 @@ export const SOURCE_FILES = [
83
117
  // source-files-sync.test.mjs is what keeps these from being dropped on bump.
84
118
  'lib/file-intel.mjs',
85
119
  'lib/reread-guard.mjs',
120
+ 'lib/handoff-constants.mjs',
121
+ 'lib/llm-call.mjs',
86
122
  'lib/metrics.mjs',
123
+ 'lib/quiet-scope.mjs',
124
+ 'lib/shard-gc.mjs',
87
125
  // v3.6.x: bind-salience producer — extracts identifiers a lesson names that
88
126
  // are present in the pre-edit file (component 2). Imported ONLY by
89
127
  // scripts/pre-tool-recall.js; kept here for the same reason as file-intel.mjs.
@@ -332,12 +370,7 @@ export const HOOK_SCRIPT_FILES = [
332
370
  // listing them here changes ONLY what is signed/verified, not what install materializes.
333
371
  // Module-internal (spread into RELEASE_SIGNED_FILES below); not exported — no external
334
372
  // consumer, and the signing test asserts coverage via the built manifest, not this list.
335
- const LAUNCHER_SCRIPT_FILES = [
336
- 'launch.mjs',
337
- 'launch-preflight.mjs',
338
- 'setup.sh',
339
- 'binding-probe-cli.mjs',
340
- ];
373
+ const LAUNCHER_SCRIPT_FILES = ['launch.mjs', 'launch-preflight.mjs', 'setup.sh', 'binding-probe-cli.mjs'];
341
374
 
342
375
  // Plugin/marketplace DECLARATION files (audit 2026-08-14 P-2). Not executable
343
376
  // themselves, but they NAME what gets executed: hooks/hooks.json declares the
@@ -379,7 +412,7 @@ const PLUGIN_DECLARATION_FILES = [
379
412
  // verifyReleaseFiles hashes against.
380
413
  export const RELEASE_SIGNED_FILES = [
381
414
  ...SOURCE_FILES,
382
- ...HOOK_SCRIPT_FILES.map(name => `scripts/${name}`),
383
- ...LAUNCHER_SCRIPT_FILES.map(name => `scripts/${name}`),
415
+ ...HOOK_SCRIPT_FILES.map((name) => `scripts/${name}`),
416
+ ...LAUNCHER_SCRIPT_FILES.map((name) => `scripts/${name}`),
384
417
  ...PLUGIN_DECLARATION_FILES,
385
418
  ];
package/stop-words.mjs CHANGED
@@ -3,33 +3,166 @@
3
3
 
4
4
  /** Common English stop words shared across FTS, TF-IDF, PRF, and registry search. */
5
5
  export const BASE_STOP_WORDS = new Set([
6
- 'the', 'a', 'an', 'is', 'are', 'was', 'were', 'be', 'been', 'being',
7
- 'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would', 'could',
8
- 'should', 'may', 'might', 'can', 'shall', 'to', 'of', 'in', 'for',
9
- 'on', 'with', 'at', 'by', 'from', 'as', 'into', 'about', 'between',
10
- 'after', 'before', 'above', 'below', 'and', 'or', 'but', 'not', 'no',
11
- 'this', 'that', 'these', 'those', 'it', 'its', 'my', 'your', 'his',
12
- 'her', 'our', 'their', 'me', 'him', 'us', 'them', 'i', 'you', 'he',
13
- 'she', 'we', 'they', 'what', 'which', 'who', 'when', 'where', 'how',
14
- 'all', 'each', 'every', 'both', 'few', 'more', 'most', 'other', 'some',
15
- 'such', 'than', 'too', 'very', 'just', 'also', 'then', 'so', 'if',
6
+ 'the',
7
+ 'a',
8
+ 'an',
9
+ 'is',
10
+ 'are',
11
+ 'was',
12
+ 'were',
13
+ 'be',
14
+ 'been',
15
+ 'being',
16
+ 'have',
17
+ 'has',
18
+ 'had',
19
+ 'do',
20
+ 'does',
21
+ 'did',
22
+ 'will',
23
+ 'would',
24
+ 'could',
25
+ 'should',
26
+ 'may',
27
+ 'might',
28
+ 'can',
29
+ 'shall',
30
+ 'to',
31
+ 'of',
32
+ 'in',
33
+ 'for',
34
+ 'on',
35
+ 'with',
36
+ 'at',
37
+ 'by',
38
+ 'from',
39
+ 'as',
40
+ 'into',
41
+ 'about',
42
+ 'between',
43
+ 'after',
44
+ 'before',
45
+ 'above',
46
+ 'below',
47
+ 'and',
48
+ 'or',
49
+ 'but',
50
+ 'not',
51
+ 'no',
52
+ 'this',
53
+ 'that',
54
+ 'these',
55
+ 'those',
56
+ 'it',
57
+ 'its',
58
+ 'my',
59
+ 'your',
60
+ 'his',
61
+ 'her',
62
+ 'our',
63
+ 'their',
64
+ 'me',
65
+ 'him',
66
+ 'us',
67
+ 'them',
68
+ 'i',
69
+ 'you',
70
+ 'he',
71
+ 'she',
72
+ 'we',
73
+ 'they',
74
+ 'what',
75
+ 'which',
76
+ 'who',
77
+ 'when',
78
+ 'where',
79
+ 'how',
80
+ 'all',
81
+ 'each',
82
+ 'every',
83
+ 'both',
84
+ 'few',
85
+ 'more',
86
+ 'most',
87
+ 'other',
88
+ 'some',
89
+ 'such',
90
+ 'than',
91
+ 'too',
92
+ 'very',
93
+ 'just',
94
+ 'also',
95
+ 'then',
96
+ 'so',
97
+ 'if',
16
98
  ]);
17
99
 
18
100
  /** CJK stop words — particles, function words, and fillers that add noise to FTS queries. */
19
101
  export const CJK_STOP_WORDS = new Set([
20
102
  // Particles & structural
21
- '的', '了', '是', '在', '有', '和', '与', '被', '把', '给',
22
- '个', '这', '那', '也', '就', '都', '而', '及', '或', '但',
23
- '还', '到', '让', '很', '得', '着', '过', '会', '要',
24
- '能', '不', '没',
103
+ '的',
104
+ '了',
105
+ '是',
106
+ '在',
107
+ '有',
108
+ '和',
109
+ '与',
110
+ '被',
111
+ '把',
112
+ '给',
113
+ '个',
114
+ '这',
115
+ '那',
116
+ '也',
117
+ '就',
118
+ '都',
119
+ '而',
120
+ '及',
121
+ '或',
122
+ '但',
123
+ '还',
124
+ '到',
125
+ '让',
126
+ '很',
127
+ '得',
128
+ '着',
129
+ '过',
130
+ '会',
131
+ '要',
132
+ '能',
133
+ '不',
134
+ '没',
25
135
  // Question words (intent detection handles these separately)
26
- '什么', '怎么', '如何', '为何', '哪个',
136
+ '什么',
137
+ '怎么',
138
+ '如何',
139
+ '为何',
140
+ '哪个',
27
141
  // Quantifiers & demonstratives
28
- '一下', '一些', '一个', '一种',
142
+ '一下',
143
+ '一些',
144
+ '一个',
145
+ '一种',
29
146
  // Directional/auxiliary
30
- '来', '去', '做', '从', '向', '比', '对',
147
+ '来',
148
+ '去',
149
+ '做',
150
+ '从',
151
+ '向',
152
+ '比',
153
+ '对',
31
154
  // Sentence-final particles
32
- '吗', '吧', '呢', '呀', '啊', '嗯', '哦',
155
+ '吗',
156
+ '吧',
157
+ '呢',
158
+ '呀',
159
+ '啊',
160
+ '嗯',
161
+ '哦',
33
162
  // Common filler phrases
34
- '看看', '帮我', '没有', '可以', '怎么样',
163
+ '看看',
164
+ '帮我',
165
+ '没有',
166
+ '可以',
167
+ '怎么样',
35
168
  ]);