mneme-ai 3.106.0 โ 3.107.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morph.d.ts","sourceRoot":"","sources":["../../src/commands/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"morph.d.ts","sourceRoot":"","sources":["../../src/commands/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuC5D"}
|
package/dist/commands/morph.js
CHANGED
|
@@ -24,15 +24,27 @@ export function registerMorphCommands(program) {
|
|
|
24
24
|
process.exitCode = 2;
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const plan = morphCore.morphPlan(q);
|
|
28
|
+
const m = plan.steps[0]?.result ?? morphCore.morph(q);
|
|
28
29
|
let receipt = null;
|
|
29
30
|
try {
|
|
30
|
-
receipt = notary.issueReceipt(process.cwd(), { kind: "claim-verdict", subject: `morph:${m.verdict}`, payload: {
|
|
31
|
+
receipt = notary.issueReceipt(process.cwd(), { kind: "claim-verdict", subject: `morph:${plan.multi ? "plan" : m.verdict}`, payload: { multi: plan.multi, steps: plan.plan.map((s) => s.command), verdict: m.verdict, command: m.capability?.command ?? null, confidence: m.confidence }, includePayload: true });
|
|
31
32
|
}
|
|
32
33
|
catch { /* */ }
|
|
33
34
|
if (opts.json) {
|
|
34
|
-
out(JSON.stringify({ ...m, signed: receipt }, null, 2));
|
|
35
|
-
process.exitCode = m.verdict === "MORPHED" ? 0 : 2;
|
|
35
|
+
out(JSON.stringify({ ...(plan.multi ? { plan } : m), signed: receipt }, null, 2));
|
|
36
|
+
process.exitCode = (plan.multi ? plan.plan.length > 0 : m.verdict === "MORPHED") ? 0 : 2;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// compound intent โ render the ordered pipeline
|
|
40
|
+
if (plan.multi && plan.plan.length > 1) {
|
|
41
|
+
out(`๐งฌ morph plan โ ${plan.plan.length} steps (${plan.routedCount} routed ยท ${plan.abstainedCount} abstained):`);
|
|
42
|
+
plan.plan.forEach((s, i) => {
|
|
43
|
+
out(` ${i + 1}. ${s.command}${s.mcpTool ? ` โ ${s.mcpTool}` : ""}`);
|
|
44
|
+
if (s.cli && s.cli !== s.command)
|
|
45
|
+
out(` CLI: ${s.cli}`);
|
|
46
|
+
});
|
|
47
|
+
process.exitCode = 0;
|
|
36
48
|
return;
|
|
37
49
|
}
|
|
38
50
|
if (m.verdict === "MORPHED" && m.capability) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morph.js","sourceRoot":"","sources":["../../src/commands/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE5D,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,KAAK,CAAC,MAAM,CAAC;SACb,QAAQ,CAAC,aAAa,EAAE,iDAAiD,CAAC;SAC1E,WAAW,CAAC,qaAAqa,CAAC;SAClb,MAAM,CAAC,QAAQ,EAAE,sBAAsB,CAAC;SACxC,MAAM,CAAC,CAAC,MAA4B,EAAE,IAAwB,EAAE,EAAE;QACjE,MAAM,CAAC,GAAG,KAAK,CAA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AAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACxH,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,yGAAyG,CAAC,CAAC;QACjH,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mneme-ai",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.107.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,12 +32,12 @@
|
|
|
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": "3.
|
|
36
|
-
"@mneme-ai/correlator": "3.
|
|
37
|
-
"@mneme-ai/embeddings": "3.
|
|
38
|
-
"@mneme-ai/matrix": "3.
|
|
39
|
-
"@mneme-ai/mcp": "3.
|
|
40
|
-
"@mneme-ai/xray": "3.
|
|
35
|
+
"@mneme-ai/core": "3.107.0",
|
|
36
|
+
"@mneme-ai/correlator": "3.107.0",
|
|
37
|
+
"@mneme-ai/embeddings": "3.107.0",
|
|
38
|
+
"@mneme-ai/matrix": "3.107.0",
|
|
39
|
+
"@mneme-ai/mcp": "3.107.0",
|
|
40
|
+
"@mneme-ai/xray": "3.107.0",
|
|
41
41
|
"commander": "^14.0.3",
|
|
42
42
|
"kleur": "^4.1.5"
|
|
43
43
|
},
|