@nxuss/lemma 1.25.0 → 1.26.1

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 (34) hide show
  1. package/README.md +14 -3
  2. package/dist/cjs/cli/lemma-proxy.d.ts.map +1 -1
  3. package/dist/cjs/cli/lemma-proxy.js +10 -2
  4. package/dist/cjs/cli/lemma-proxy.js.map +1 -1
  5. package/dist/cjs/mcp/index.js +15 -0
  6. package/dist/cjs/mcp/index.js.map +1 -1
  7. package/dist/cjs/mcp/tools/memory.d.ts.map +1 -1
  8. package/dist/cjs/mcp/tools/memory.js +57 -7
  9. package/dist/cjs/mcp/tools/memory.js.map +1 -1
  10. package/dist/cjs/subconscious/TheBrainV2.d.ts +20 -0
  11. package/dist/cjs/subconscious/TheBrainV2.d.ts.map +1 -1
  12. package/dist/cjs/subconscious/TheBrainV2.js +76 -10
  13. package/dist/cjs/subconscious/TheBrainV2.js.map +1 -1
  14. package/dist/cjs/utils/ClipboardWatcher.d.ts +5 -2
  15. package/dist/cjs/utils/ClipboardWatcher.d.ts.map +1 -1
  16. package/dist/cjs/utils/ClipboardWatcher.js +38 -4
  17. package/dist/cjs/utils/ClipboardWatcher.js.map +1 -1
  18. package/dist/esm/cli/lemma-proxy.d.ts.map +1 -1
  19. package/dist/esm/cli/lemma-proxy.js +10 -2
  20. package/dist/esm/cli/lemma-proxy.js.map +1 -1
  21. package/dist/esm/mcp/index.js +15 -0
  22. package/dist/esm/mcp/index.js.map +1 -1
  23. package/dist/esm/mcp/tools/memory.d.ts.map +1 -1
  24. package/dist/esm/mcp/tools/memory.js +57 -7
  25. package/dist/esm/mcp/tools/memory.js.map +1 -1
  26. package/dist/esm/subconscious/TheBrainV2.d.ts +20 -0
  27. package/dist/esm/subconscious/TheBrainV2.d.ts.map +1 -1
  28. package/dist/esm/subconscious/TheBrainV2.js +75 -10
  29. package/dist/esm/subconscious/TheBrainV2.js.map +1 -1
  30. package/dist/esm/utils/ClipboardWatcher.d.ts +5 -2
  31. package/dist/esm/utils/ClipboardWatcher.d.ts.map +1 -1
  32. package/dist/esm/utils/ClipboardWatcher.js +39 -5
  33. package/dist/esm/utils/ClipboardWatcher.js.map +1 -1
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![MCP Tools](https://img.shields.io/badge/MCP%20tools-109-ff69b4?style=flat-square)](https://github.com/Nxusbets/lemma)
6
6
  [![Security](https://img.shields.io/badge/privacy-firewall%20active-blueviolet?style=flat-square)](https://github.com/Nxusbets/lemma)
7
7
  [![Caching](https://img.shields.io/badge/semantic%20memory-enabled-success?style=flat-square)](https://github.com/Nxusbets/lemma)
8
- [![Tests](https://img.shields.io/badge/tests-917%20passing-00c853?style=flat-square)](https://github.com/Nxusbets/lemma)
8
+ [![Tests](https://img.shields.io/badge/tests-919%20passing-00c853?style=flat-square)](https://github.com/Nxusbets/lemma)
9
9
 
10
10
  ```text
11
11
  __
@@ -35,6 +35,14 @@ lemma start # gateway + dashboard on http://localhost:8081
35
35
  >
36
36
  > **🆕 v1.22.0 — Lemma auto-activates in every LLM client.** `npm i -g @nxuss/lemma` registers the skill in your **user** catalog (auto-loads in every `muse` session, any project) and `lemma init` wires each project for Muse, Claude Code, Cursor, Codex, Windsurf, Kiro and OpenCode. Health check: `lemma doctor`.
37
37
  >
38
+ > **🆕 v1.26.0 — a memory without evidence is no longer sold as a verified hit, and the Brain
39
+ > repairs it on the spot.** `search_memory` now splits its results into three buckets — `fresh`
40
+ > (tracked + verified, the only ones credited `tokensSaved`/`hits`), `stale`, and `UNTRACKED`
41
+ > (no files/symbols to re-check: flagged with ⚠️ and its remedy, never "from cache"). On the
42
+ > maintenance side, `brain_upkeep` auto-anchors those evidence-free memories when their body
43
+ > names real repo files — corpus snapshot first (`auto-anchor`), reversible via
44
+ > `brain_trash restore-snapshot`; `autoAnchor:false` keeps the old read-only pass.
45
+ >
38
46
  > **🆕 v1.24.0 — the Brain stops crediting what it can't verify.** `smarter_cache` no longer
39
47
  > presents a stale hit as a clean one (`stale:true`/`tokensSaved:0` + why, instead of a silent
40
48
  > guess); `store_memory` derives evidence by default from files/symbols the session already
@@ -65,8 +73,11 @@ lemma start # gateway + dashboard on http://localhost:8081
65
73
  whatever the session already read, wrote, or patched when the caller doesn't pass them —
66
74
  flagged as auto-derived in the response, correctable, but no longer opt-in.
67
75
  - **A memory that maintains itself** — `brain_upkeep` revalidates the most-reused memories,
68
- surfaces exact duplicates and merge candidates, dead weight, and savings in one read-only
69
- pass, each finding with its fix. `brain_merge` folds near-duplicate fragments into one
76
+ surfaces exact duplicates and merge candidates, dead weight, and savings, each finding with its
77
+ fix. Since v1.26.0 it also **auto-anchors** evidence-free memories whose body names real repo
78
+ files — snapshot first (`auto-anchor`), then re-anchored to those paths so they become
79
+ verifiable; `autoAnchor:false` keeps the pass read-only, and everything is reversible via
80
+ `brain_trash restore-snapshot`. `brain_merge` folds near-duplicate fragments into one
70
81
  canonical entry (fragments survive as evidence-carrying claims). `forget_memory` moves to a
71
82
  trash (`brain_trash`: list/restore/purge) instead of destroying, automatic snapshots roll
72
83
  back every forget/import/clear/merge, and `brain_import dryRun:true` previews a bundle —
@@ -1 +1 @@
1
- {"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA0cA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA4DvF;AAqfD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtD;AAsrDD,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA8KhL"}
1
+ {"version":3,"file":"lemma-proxy.d.ts","sourceRoot":"","sources":["../../../src/cli/lemma-proxy.ts"],"names":[],"mappings":";AA8cA,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA8DvF;AAqfD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtD;AAwrDD,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA8KhL"}
@@ -143,7 +143,11 @@ async function ensureChromaRunning() {
143
143
  const cp = spawn('chroma', ['run', '--path', path_1.default.join(ProjectStore_1.CACHE_DIR, 'chroma_data')], {
144
144
  stdio: 'ignore',
145
145
  detached: true,
146
+ windowsHide: true,
146
147
  });
148
+ // 'chroma' may not be on PATH (e.g. chromadb not pip-installed) — an ENOENT here is
149
+ // async and, unhandled, would throw and crash whichever process called us.
150
+ cp.on('error', () => console.log('⚠️ Could not start ChromaDB (is it installed and on PATH?)'));
147
151
  cp.unref();
148
152
  await new Promise(resolve => setTimeout(resolve, 3000));
149
153
  }
@@ -516,8 +520,10 @@ function startBackgroundClipboardWatcher(cliOpts) {
516
520
  const cp = spawn(cmd, args, {
517
521
  stdio: 'ignore',
518
522
  detached: true,
523
+ windowsHide: true,
519
524
  env: { ...process.env }
520
525
  });
526
+ cp.on('error', (err) => console.error(`❌ Could not start Clipboard Watcher: ${err.message}`));
521
527
  cp.unref();
522
528
  if (cp.pid) {
523
529
  fs_1.default.writeFileSync(ProjectStore_1.CLIPBOARD_PID_FILE, String(cp.pid));
@@ -2344,10 +2350,12 @@ commander_1.program.command('start')
2344
2350
  if (!fs_1.default.existsSync(chromaDataPath)) {
2345
2351
  fs_1.default.mkdirSync(chromaDataPath, { recursive: true });
2346
2352
  }
2347
- const chromaProcess = spawn('chroma', ['run', '--path', chromaDataPath], { stdio: 'ignore', detached: true });
2353
+ const chromaProcess = spawn('chroma', ['run', '--path', chromaDataPath], { stdio: 'ignore', detached: true, windowsHide: true });
2354
+ chromaProcess.on('error', () => console.log(' ⚠️ Could not start ChromaDB (is it installed and on PATH?)'));
2348
2355
  chromaProcess.unref();
2349
2356
  console.log(' ✅ ChromaDB requested');
2350
- const dash = spawn('npm', ['run', 'dev', '--prefix', 'dashboard', '--', '--port', '8082'], { stdio: 'ignore', detached: true });
2357
+ const dash = spawn('npm', ['run', 'dev', '--prefix', 'dashboard', '--', '--port', '8082'], { stdio: 'ignore', detached: true, windowsHide: true, shell: process.platform === 'win32' });
2358
+ dash.on('error', () => console.log(' ⚠️ Could not start the dashboard dev server'));
2351
2359
  dash.unref();
2352
2360
  console.log(' ✅ Dashboard requested (http://localhost:8082)');
2353
2361
  setTimeout(() => {