mneme-ai 2.124.0 โ†’ 2.125.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.
@@ -21,8 +21,8 @@ export function registerOutlineCommands(program) {
21
21
  program
22
22
  .command("outline <file>")
23
23
  .alias("glance")
24
- .description("๐Ÿ”ญ Read a file's STRUCTURE (every symbol + line range, bodies elided) for a fraction of the tokens, instead of loading the whole file. `--region <symbol|L1-L2>` fetches the byte-EXACT slice to edit. Orient cheap โ†’ edit exact.")
25
- .option("--region <selector>", "fetch the byte-exact slice for a symbol name or an L<a>-L<b> range.")
24
+ .description("๐Ÿ”ญ Read a file's STRUCTURE (every symbol + line range, bodies elided) for a fraction of the tokens, instead of loading the whole file. Multi-language (TS/JS/Python/Go/Rust/Java/C). `--region <symbol|L1-L2|a,b,...>` fetches the byte-EXACT slice(s) to edit. Orient cheap โ†’ edit exact.")
25
+ .option("--region <selector>", "byte-exact slice(s): a symbol name, an L<a>-L<b> range, or a comma-separated list of either (multi-region).")
26
26
  .option("--json", "structured JSON output.")
27
27
  .action((file, opts) => {
28
28
  const cwd = process.cwd();
@@ -42,7 +42,7 @@ export function registerOutlineCommands(program) {
42
42
  return;
43
43
  }
44
44
  if (opts.region) {
45
- const r = outline.extractRegion(src, opts.region);
45
+ const r = outline.extractRegion(src, opts.region, { path: file });
46
46
  if (!r.ok) {
47
47
  out(`โœ— ${r.note}`);
48
48
  process.exitCode = 1;
@@ -52,11 +52,11 @@ export function registerOutlineCommands(program) {
52
52
  outJson(r);
53
53
  return;
54
54
  }
55
- out(`# ${file} ยท L${r.startLine}-${r.endLine} (byte-exact)`);
55
+ out(`# ${file} ยท ${r.note}`);
56
56
  out(r.text);
57
57
  return;
58
58
  }
59
- const o = outline.extractOutline(src);
59
+ const o = outline.extractOutline(src, { path: file });
60
60
  const rendered = outline.renderOutline(o, { path: file });
61
61
  const m = outline.measureReduction(src.length, rendered.length);
62
62
  // record the measured saving into the signed treasury ledger (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-1,6 +1,6 @@
1
1
  {
2
2
  "name": "mneme-ai",
3
- "version": "2.124.0",
3
+ "version": "2.125.0",
4
4
  "mcpName": "io.github.patsa2561-art/mneme-ai",
5
5
  "description": "Mneme โ€” the memory layer for your codebase. Knows the WHY, the WHAT, the WHERE-IT-BREAKS.",
6
6
  "type": "module",
@@ -32,10 +32,10 @@
32
32
  "preinstall": "node -e \"try{const fs=require('node:fs');const path=require('node:path');const os=require('node:os');const{spawnSync}=require('node:child_process');const crypto=require('node:crypto');const w=process.platform==='win32';const home=os.homedir();const organ=path.join(home,'.mneme-global');const trailPath=path.join(organ,'preinstall-trail.jsonl');const trailSecret=process.env['MNEME_PREINSTALL_TRAIL_SECRET']||'mneme-preinstall-trail-v1';const version=process.env['npm_package_version']||'unknown';try{if(!fs.existsSync(organ))fs.mkdirSync(organ,{recursive:true,mode:0o700})}catch(e){}const lastSig=()=>{try{if(!fs.existsSync(trailPath))return'genesis';const lines=fs.readFileSync(trailPath,'utf8').trim().split('\\\\n').filter(Boolean);if(lines.length===0)return'genesis';const last=JSON.parse(lines[lines.length-1]);return typeof last?.sig==='string'?last.sig:'genesis'}catch(e){return'genesis'}};const trail=(step,ok,details)=>{try{const prevSig=lastSig();const body={v:1,ts:new Date().toISOString(),version,step,ok,...(details?{details}:{}),pid:process.pid,prevSig};const sig=crypto.createHmac('sha256',trailSecret).update(prevSig+'::'+JSON.stringify(body)).digest('hex');fs.appendFileSync(trailPath,JSON.stringify({...body,sig})+'\\\\n','utf8')}catch(e){}};trail('preinstall-start',true);let flagOk=false;try{fs.writeFileSync(path.join(organ,'install-incoming.flag'),JSON.stringify({v:1,announcedAt:new Date().toISOString(),announcerPid:process.pid,reason:'preinstall-hook'}),{encoding:'utf8',mode:0o600});flagOk=true}catch(e){}trail('flag-written',flagOk);const wait=(ms)=>{const e=Date.now()+ms;while(Date.now()<e){}};wait(300);let held=[];if(w){const r=spawnSync('taskkill',['/F','/IM','mneme.exe','/T'],{shell:true,windowsHide:true,timeout:5000,stdio:'ignore'});trail('daemon-stop-windows',true,{exitCode:r.status});let reaped=0;try{const beatDir=path.join(organ,'heartbeats');if(fs.existsSync(beatDir)){for(const f of fs.readdirSync(beatDir)){const m=f.match(/^(\\\\d+)\\\\.beat$/);if(m){const pid=parseInt(m[1]);if(pid>0&&pid!==process.pid){try{const bj=JSON.parse(fs.readFileSync(path.join(beatDir,f),'utf8'));if(Array.isArray(bj.holdsPaths))for(const hp of bj.holdsPaths){if(typeof hp==='string'&&hp)held.push(hp)}}catch(e){}spawnSync('taskkill',['/F','/PID',pid.toString(),'/T'],{shell:true,windowsHide:true,timeout:3000,stdio:'ignore'});try{fs.unlinkSync(path.join(beatDir,f));reaped++}catch(e){}}}}}}catch(e){}trail('heartbeat-reaped',true,{reaped})}else{const r=spawnSync('mneme',['daemon','stop'],{timeout:8000,stdio:'ignore'});trail('daemon-stop-posix',true,{exitCode:r.status});let reaped=0;try{const beatDir=path.join(organ,'heartbeats');if(fs.existsSync(beatDir)){for(const f of fs.readdirSync(beatDir)){const m=f.match(/^(\\\\d+)\\\\.beat$/);if(m){const pid=parseInt(m[1]);if(pid>0&&pid!==process.pid){try{const bj=JSON.parse(fs.readFileSync(path.join(beatDir,f),'utf8'));if(Array.isArray(bj.holdsPaths))for(const hp of bj.holdsPaths){if(typeof hp==='string'&&hp)held.push(hp)}}catch(e){}try{process.kill(pid,'SIGTERM')}catch(e){}wait(100);try{process.kill(pid,'SIGKILL')}catch(e){}try{fs.unlinkSync(path.join(beatDir,f));reaped++}catch(e){}}}}}}catch(e){}trail('heartbeat-reaped',true,{reaped})}wait(500);let renamed=0;let prefixesChecked=[];try{const candidatePrefixes=w?[path.join(home,'AppData','Roaming','npm'),path.dirname(process.execPath),'C:\\\\\\\\nvm4w\\\\\\\\nodejs',path.join(home,'AppData','Local','nvm')]:['/usr/local/lib','/usr/lib',path.join(home,'.npm-global'),path.join(home,'.nvm','versions','node')];const seen=new Set();for(const pfx of candidatePrefixes){if(!fs.existsSync(pfx))continue;let nodeModulesBases=[];if(fs.existsSync(path.join(pfx,'node_modules')))nodeModulesBases.push(path.join(pfx,'node_modules'));try{for(const entry of fs.readdirSync(pfx)){const sub=path.join(pfx,entry,'node_modules');if(fs.existsSync(sub))nodeModulesBases.push(sub);const sub2=path.join(pfx,entry,'nodejs','node_modules');if(fs.existsSync(sub2))nodeModulesBases.push(sub2)}}catch(e){}for(const nm of nodeModulesBases){if(seen.has(nm))continue;seen.add(nm);prefixesChecked.push(nm);const npmGlobal=path.join(nm,'mneme-ai');if(!fs.existsSync(npmGlobal))continue;const dllPaths=w?[path.join(npmGlobal,'node_modules','@img','sharp-libvips-win32-x64','lib','libvips-42.dll'),path.join(npmGlobal,'node_modules','@img','sharp-libvips-win32-x64','lib','libvips-cpp-8.17.3.dll'),path.join(npmGlobal,'node_modules','sharp','build','Release','sharp-win32-x64.node')]:[];for(const dll of dllPaths){if(!fs.existsSync(dll))continue;let freed=false;for(let i=0;i<40;i++){try{const fd=fs.openSync(dll,'r+');fs.closeSync(fd);freed=true;break}catch(e2){wait(50)}}if(!freed){try{fs.renameSync(dll,dll+'.locked-'+Date.now()+'-'+process.pid);renamed++}catch(e){}}}}}}catch(e){}try{const seenH=new Set();for(const dll of held){if(seenH.has(dll))continue;seenH.add(dll);if(!fs.existsSync(dll))continue;let freed=false;for(let i=0;i<40;i++){try{const fd=fs.openSync(dll,'r+');fs.closeSync(fd);freed=true;break}catch(e2){wait(50)}}if(!freed){try{fs.renameSync(dll,dll+'.locked-'+Date.now()+'-'+process.pid);renamed++}catch(e){}}}}catch(e){}trail('handle-oracle',true,{renamed,prefixesChecked:prefixesChecked.length,held:held.length});let swept=0;try{const candidates=w?[path.join(home,'AppData','Roaming','npm','node_modules'),path.join(path.dirname(process.execPath),'node_modules')]:['/usr/local/lib/node_modules',path.join(home,'.npm-global','node_modules')];for(const npmParent of candidates){if(!fs.existsSync(npmParent))continue;try{for(const entry of fs.readdirSync(npmParent)){if(entry.startsWith('.mneme-ai-')){try{fs.rmSync(path.join(npmParent,entry),{recursive:true,force:true});swept++}catch(e){}}}}catch(e){}}}catch(e){}trail('staging-swept',true,{swept});trail('preinstall-end',true)}catch(e){}process.exit(0)\""
33
33
  },
34
34
  "dependencies": {
35
- "@mneme-ai/core": "^2.124.0",
36
- "@mneme-ai/correlator": "^2.124.0",
37
- "@mneme-ai/embeddings": "^2.124.0",
38
- "@mneme-ai/mcp": "^2.124.0",
35
+ "@mneme-ai/core": "^2.125.0",
36
+ "@mneme-ai/correlator": "^2.125.0",
37
+ "@mneme-ai/embeddings": "^2.125.0",
38
+ "@mneme-ai/mcp": "^2.125.0",
39
39
  "commander": "^14.0.3",
40
40
  "kleur": "^4.1.5"
41
41
  },