mneme-ai 3.120.0 → 3.122.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":"vericert.d.ts","sourceRoot":"","sources":["../../src/commands/vericert.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"vericert.d.ts","sourceRoot":"","sources":["../../src/commands/vericert.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+C/D"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* cat report.md | mneme certify - # certify a file/stdin
|
|
8
8
|
* mneme certify verify --cert cert.json [--deliverable report.md]
|
|
9
9
|
*/
|
|
10
|
-
import { readFileSync } from "node:fs";
|
|
10
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { vericert, notary } from "@mneme-ai/core";
|
|
12
12
|
function out(s) { process.stdout.write(s + "\n"); }
|
|
13
13
|
export function registerVericertCommands(program) {
|
|
@@ -17,6 +17,7 @@ export function registerVericertCommands(program) {
|
|
|
17
17
|
.argument("[deliverable...]", "the AI-produced deliverable ('-' = stdin)")
|
|
18
18
|
.description("🎗️ VERICERT — stamp an AI-worker deliverable (report / code / answer) with a signed, offline-verifiable certificate: CERTIFIED / CONDITIONAL / REJECTED. Runs every claim through the HPE verification stack; CERTIFIED only if NO known fault (CERTIFIED-precision 1.0 — never certifies a hallucinated deliverable). The trust layer the AI-worker gold rush is missing.")
|
|
19
19
|
.option("--json", "JSON output (the full signed certificate)")
|
|
20
|
+
.option("--badge <file>", "also write a shareable 'Verified by Mneme' SVG badge ('-' = stdout)")
|
|
20
21
|
.action((deliverable, opts) => {
|
|
21
22
|
let d = Array.isArray(deliverable) ? deliverable.join(" ") : String(deliverable ?? "");
|
|
22
23
|
if (d === "-") {
|
|
@@ -37,6 +38,18 @@ export function registerVericertCommands(program) {
|
|
|
37
38
|
}
|
|
38
39
|
catch { /* */ }
|
|
39
40
|
const signed = { ...cert, signed: receipt };
|
|
41
|
+
if (opts.badge) {
|
|
42
|
+
const svg = vericert.badgeSVG(cert);
|
|
43
|
+
if (opts.badge === "-")
|
|
44
|
+
out(svg);
|
|
45
|
+
else {
|
|
46
|
+
try {
|
|
47
|
+
writeFileSync(opts.badge, svg);
|
|
48
|
+
out(` 🎗 badge → ${opts.badge}`);
|
|
49
|
+
}
|
|
50
|
+
catch { /* */ }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
40
53
|
if (opts.json) {
|
|
41
54
|
out(JSON.stringify(signed, null, 2));
|
|
42
55
|
process.exitCode = cert.verdict === "REJECTED" ? 2 : 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vericert.js","sourceRoot":"","sources":["../../src/commands/vericert.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"vericert.js","sourceRoot":"","sources":["../../src/commands/vericert.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElD,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,CAAC,GAAG,OAAO;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C,YAAY,EAAE,CAAC,CAAC;QAC/F,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,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.122.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.122.0",
|
|
36
|
+
"@mneme-ai/correlator": "3.122.0",
|
|
37
|
+
"@mneme-ai/embeddings": "3.122.0",
|
|
38
|
+
"@mneme-ai/matrix": "3.122.0",
|
|
39
|
+
"@mneme-ai/mcp": "3.122.0",
|
|
40
|
+
"@mneme-ai/xray": "3.122.0",
|
|
41
41
|
"commander": "^14.0.3",
|
|
42
42
|
"kleur": "^4.1.5"
|
|
43
43
|
},
|