@must-b/must-b 1.74.3 → 1.74.4

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.
package/dist/BUILD.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@must-b/must-b",
3
- "version": "1.74.3",
4
- "gitHash": "3ebb8341",
5
- "buildTime": "2026-05-18T08:45:56.916Z",
3
+ "version": "1.74.4",
4
+ "gitHash": "77c52d1c",
5
+ "buildTime": "2026-05-18T09:15:04.580Z",
6
6
  "node": "v24.14.0",
7
7
  "platform": "win32"
8
8
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.71.4",
3
- "generatedAt": "2026-05-18T08:45:17.363Z",
3
+ "generatedAt": "2026-05-18T09:14:22.279Z",
4
4
  "count": 57,
5
5
  "skills": [
6
6
  {
package/dist/index.cjs CHANGED
@@ -4716,7 +4716,7 @@ ${Q}${m}`+p.repeat(E)+`${Q}`,C}function l(E,B,g,Q){return`${B}${Q}`+g.repeat(E)+
4716
4716
  \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
4717
4717
  \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
4718
4718
  \u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
4719
- \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D `;function tSe(){try{return"1.74.3"}catch{return"1.0.0"}}function iSe(){try{return"3ebb8341"}catch{return""}}function s0(e,A=58){let t=e.replace(/\x1b\[[0-9;]*m/g,""),i=Math.max(0,Math.floor((A-t.length)/2));return" ".repeat(i)+e}function n1A(e="\u2500",A=58){return hl(" "+e.repeat(A))}function ZI(e,A){let t=tSe(),i=iSe();console.log(a1A(eSe)),console.log(""),console.log(s0($Fe(ZFe("Must-b"))+" "+r1A("v"+t))),console.log(s0(hl("Professional AI Operating System"))),console.log(""),console.log(s0(a1A("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(s0(hl("Vision")+hl(" \xB7 ")+hl("Voice")+hl(" \xB7 ")+hl("OS Control")+hl(" \xB7 ")+hl("Multi-Agent Hierarchy"))),console.log(""),console.log(n1A()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(hl(" \xB7 "));console.log(s0(hl(a))),e==="web"&&(console.log(""),console.log(s0(ASe("\u25B6 ")+r1A(`http://localhost:${A}`))),console.log(s0(hl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(n1A()),console.log(s0(hl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var efA=require("events"),tfA=require("module"),GQ=UA(require("path"),1),NQ=UA(require("fs"),1),pl=UA(require("os"),1),ifA=UA(require("crypto"),1);var V1A=require("events"),TQ=UA(require("os"),1),JY=UA(require("fs"),1),K1A=UA(require("path"),1);ef();kr();var lTe=[{re:/connection refused|ECONNREFUSED/i,kind:"network",level:"warning",message:"Network connection refused.",recommendation:"LLM provider unreachable. Check API key and network in .env.",healable:!1},{re:/model not found|model.*does not exist|no such model/i,kind:"model",level:"warning",message:"Specified model not found.",recommendation:"Check MUSTB_MODEL or select a valid model in Settings > Model.",healable:!1},{re:/JavaScript heap out of memory|out of memory/i,kind:"oom",level:"critical",message:"Node.js memory limit reached.",recommendation:"Switch to a smaller model or start with NODE_OPTIONS=--max-old-space-size=4096.",healable:!1},{re:/python.*not found|pip.*not found|\'python\' is not recognized/i,kind:"path",level:"warning",message:"Python not found on PATH.",recommendation:"Run must-b doctor --fix to auto-repair.",healable:!0},{re:/cannot find module|module not found/i,kind:"module",level:"warning",message:"Missing Node.js module detected.",recommendation:"Run must-b doctor --fix to repair npm dependencies.",healable:!0},{re:/ENOENT.*node_modules/i,kind:"deps",level:"warning",message:"node_modules missing or corrupt.",recommendation:"Run must-b doctor --fix to trigger npm install.",healable:!0}],j1A=80,cTe=75,sC=85,uTe=90,ETe=5*60*1e3,i6=class extends V1A.EventEmitter{constructor(t){super();this.resourceTimer=null;this.logWatcher=null;this.liteActive=!1;this.healing=!1;this.watcherSuspended=!1;this.syncSuspended=!1;this.cloudSync=null;this.lastAlertTs=new Map;this._lastCpu=0;this._lastRam=0;this.patternHits=new Map;this.PATTERN_WINDOW_MS=5*60*1e3;this.PATTERN_THRESHOLD=3;this.root=t.root,this.logger=t.logger,this.logDir=TE}start(){this.startResourceMonitor(),this.startLogScanner(),this.logger.info("[GhostGuard] Resource monitor + log scanner active.")}getStats(){return{cpu:Math.round(this._lastCpu),ram:Math.round(this._lastRam),liteMode:this.liteActive,safeMode:this.watcherSuspended,ts:Date.now()}}registerCloudSync(t){this.cloudSync=t}stop(){this.resourceTimer&&(clearInterval(this.resourceTimer),this.resourceTimer=null),this.logWatcher?.close(),this.logWatcher=null,this.logger.info("[GhostGuard] Stopped.")}startResourceMonitor(){let t=this.sampleCpu();this.resourceTimer=setInterval(()=>{let i=this.ramUsagePct(),a=this.sampleCpu(),r=this.deltaCpu(t,a);t=a,this.onResourceSample(r,i)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=TQ.default.totalmem(),i=TQ.default.freemem();return(t-i)/t*100}sampleCpu(){let t=0,i=0;for(let a of TQ.default.cpus()){for(let r of Object.values(a.times))i+=r;t+=a.times.idle}return{idle:t,total:i}}deltaCpu(t,i){let a=i.total-t.total,r=i.idle-t.idle;return a===0?0:Math.max(0,Math.min(100,100*(1-r/a)))}onResourceSample(t,i){if(this._lastCpu=t,this._lastRam=i,i>=j1A&&!this.liteActive){this.liteActive=!0;let a=`RAM at ${i.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!0,reason:a})}else if(i<j1A-5&&this.liteActive){this.liteActive=!1;let a=`RAM dropped to ${i.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!1,reason:a})}if(i>=sC&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${i.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):i<sC-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${i.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(i>=sC&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):i<sC-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),i>=sC){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${i.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${a} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(i>=cTe){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${i.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${a} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=uTe&&this.emitAlert({level:"warning",kind:"cpu_high",message:`CPU at ${t.toFixed(1)}% \u2014 LLM load is saturating the system.`,recommendation:"Close background processes or switch to a smaller model."})}startLogScanner(){try{JY.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=o0(K1A.default.join(this.logDir,"*.md"),{ignoreInitial:!0,persistent:!1}),this.logWatcher.on("add",t=>this.scanLogFile(t)),this.logWatcher.on("change",t=>this.scanLogFile(t))}scanLogFile(t){let i="";try{i=JY.default.readFileSync(t,"utf-8")}catch{return}for(let a of lTe){if(!a.re.test(i))continue;let r=Date.now(),[n,s]=this.patternHits.get(a.kind)??[0,r],o=r-s<this.PATTERN_WINDOW_MS?n+1:1,l=r-s<this.PATTERN_WINDOW_MS?s:r;this.patternHits.set(a.kind,[o,l]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${a.kind} (${o}\xD7)`),this.emitAlert({level:a.level,kind:a.kind,message:`Recurring error (${o}\xD7): ${a.message}`,recommendation:a.recommendation}),this.patternHits.set(a.kind,[0,r]),a.healable&&this.triggerAutoHeal(a.kind));break}}triggerAutoHeal(t){this.healing||(this.healing=!0,this.logger.info(`[GhostGuard] Auto-heal starting: ${t}`),this.emit("autoHeal",{kind:t,message:`doctor --fix triggered (${t})`}),Promise.resolve().then(()=>(SQ(),L1A)).then(({runDoctor:i})=>i(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(i=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${i.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let i=Date.now(),a=this.lastAlertTs.get(t.kind)??0;if(i-a<ETe)return;this.lastAlertTs.set(t.kind,i);let r={...t,ts:i};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},e6=null,t6=null,BTe=2e3;function W1A(){let e=0,A=0;for(let t of TQ.default.cpus()){for(let i of Object.values(t.times))A+=i;e+=t.times.idle}return{idle:e,total:A}}function z1A(e,A){let t=A.total-e.total,i=A.idle-e.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-i/t)))}async function q1A(){let e=Date.now();if(t6&&e-t6.ts<BTe)return t6.result;let A=W1A(),t=0;if(e6)t=z1A(e6,A);else{await new Promise(s=>setTimeout(s,150));let n=W1A();t=z1A(A,n),e6=n}e6=A;let i=TQ.default.freemem()/TQ.default.totalmem()*100,r={isCritical:t>80||i<15,cpuUsage:Math.round(t),memFreePercent:Math.round(i)};return t6={result:r,ts:e},r}var a6=UA(require("fs"),1),XY=UA(require("path"),1),J1A=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],gTe={"must-b.md":`# Must-b \u2014 Persona & Core Rules
4719
+ \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D `;function tSe(){try{return"1.74.4"}catch{return"1.0.0"}}function iSe(){try{return"77c52d1c"}catch{return""}}function s0(e,A=58){let t=e.replace(/\x1b\[[0-9;]*m/g,""),i=Math.max(0,Math.floor((A-t.length)/2));return" ".repeat(i)+e}function n1A(e="\u2500",A=58){return hl(" "+e.repeat(A))}function ZI(e,A){let t=tSe(),i=iSe();console.log(a1A(eSe)),console.log(""),console.log(s0($Fe(ZFe("Must-b"))+" "+r1A("v"+t))),console.log(s0(hl("Professional AI Operating System"))),console.log(""),console.log(s0(a1A("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(s0(hl("Vision")+hl(" \xB7 ")+hl("Voice")+hl(" \xB7 ")+hl("OS Control")+hl(" \xB7 ")+hl("Multi-Agent Hierarchy"))),console.log(""),console.log(n1A()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(hl(" \xB7 "));console.log(s0(hl(a))),e==="web"&&(console.log(""),console.log(s0(ASe("\u25B6 ")+r1A(`http://localhost:${A}`))),console.log(s0(hl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(n1A()),console.log(s0(hl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var efA=require("events"),tfA=require("module"),GQ=UA(require("path"),1),NQ=UA(require("fs"),1),pl=UA(require("os"),1),ifA=UA(require("crypto"),1);var V1A=require("events"),TQ=UA(require("os"),1),JY=UA(require("fs"),1),K1A=UA(require("path"),1);ef();kr();var lTe=[{re:/connection refused|ECONNREFUSED/i,kind:"network",level:"warning",message:"Network connection refused.",recommendation:"LLM provider unreachable. Check API key and network in .env.",healable:!1},{re:/model not found|model.*does not exist|no such model/i,kind:"model",level:"warning",message:"Specified model not found.",recommendation:"Check MUSTB_MODEL or select a valid model in Settings > Model.",healable:!1},{re:/JavaScript heap out of memory|out of memory/i,kind:"oom",level:"critical",message:"Node.js memory limit reached.",recommendation:"Switch to a smaller model or start with NODE_OPTIONS=--max-old-space-size=4096.",healable:!1},{re:/python.*not found|pip.*not found|\'python\' is not recognized/i,kind:"path",level:"warning",message:"Python not found on PATH.",recommendation:"Run must-b doctor --fix to auto-repair.",healable:!0},{re:/cannot find module|module not found/i,kind:"module",level:"warning",message:"Missing Node.js module detected.",recommendation:"Run must-b doctor --fix to repair npm dependencies.",healable:!0},{re:/ENOENT.*node_modules/i,kind:"deps",level:"warning",message:"node_modules missing or corrupt.",recommendation:"Run must-b doctor --fix to trigger npm install.",healable:!0}],j1A=80,cTe=75,sC=85,uTe=90,ETe=5*60*1e3,i6=class extends V1A.EventEmitter{constructor(t){super();this.resourceTimer=null;this.logWatcher=null;this.liteActive=!1;this.healing=!1;this.watcherSuspended=!1;this.syncSuspended=!1;this.cloudSync=null;this.lastAlertTs=new Map;this._lastCpu=0;this._lastRam=0;this.patternHits=new Map;this.PATTERN_WINDOW_MS=5*60*1e3;this.PATTERN_THRESHOLD=3;this.root=t.root,this.logger=t.logger,this.logDir=TE}start(){this.startResourceMonitor(),this.startLogScanner(),this.logger.info("[GhostGuard] Resource monitor + log scanner active.")}getStats(){return{cpu:Math.round(this._lastCpu),ram:Math.round(this._lastRam),liteMode:this.liteActive,safeMode:this.watcherSuspended,ts:Date.now()}}registerCloudSync(t){this.cloudSync=t}stop(){this.resourceTimer&&(clearInterval(this.resourceTimer),this.resourceTimer=null),this.logWatcher?.close(),this.logWatcher=null,this.logger.info("[GhostGuard] Stopped.")}startResourceMonitor(){let t=this.sampleCpu();this.resourceTimer=setInterval(()=>{let i=this.ramUsagePct(),a=this.sampleCpu(),r=this.deltaCpu(t,a);t=a,this.onResourceSample(r,i)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=TQ.default.totalmem(),i=TQ.default.freemem();return(t-i)/t*100}sampleCpu(){let t=0,i=0;for(let a of TQ.default.cpus()){for(let r of Object.values(a.times))i+=r;t+=a.times.idle}return{idle:t,total:i}}deltaCpu(t,i){let a=i.total-t.total,r=i.idle-t.idle;return a===0?0:Math.max(0,Math.min(100,100*(1-r/a)))}onResourceSample(t,i){if(this._lastCpu=t,this._lastRam=i,i>=j1A&&!this.liteActive){this.liteActive=!0;let a=`RAM at ${i.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!0,reason:a})}else if(i<j1A-5&&this.liteActive){this.liteActive=!1;let a=`RAM dropped to ${i.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!1,reason:a})}if(i>=sC&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${i.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):i<sC-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${i.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(i>=sC&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):i<sC-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),i>=sC){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${i.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${a} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(i>=cTe){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${i.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${a} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=uTe&&this.emitAlert({level:"warning",kind:"cpu_high",message:`CPU at ${t.toFixed(1)}% \u2014 LLM load is saturating the system.`,recommendation:"Close background processes or switch to a smaller model."})}startLogScanner(){try{JY.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=o0(K1A.default.join(this.logDir,"*.md"),{ignoreInitial:!0,persistent:!1}),this.logWatcher.on("add",t=>this.scanLogFile(t)),this.logWatcher.on("change",t=>this.scanLogFile(t))}scanLogFile(t){let i="";try{i=JY.default.readFileSync(t,"utf-8")}catch{return}for(let a of lTe){if(!a.re.test(i))continue;let r=Date.now(),[n,s]=this.patternHits.get(a.kind)??[0,r],o=r-s<this.PATTERN_WINDOW_MS?n+1:1,l=r-s<this.PATTERN_WINDOW_MS?s:r;this.patternHits.set(a.kind,[o,l]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${a.kind} (${o}\xD7)`),this.emitAlert({level:a.level,kind:a.kind,message:`Recurring error (${o}\xD7): ${a.message}`,recommendation:a.recommendation}),this.patternHits.set(a.kind,[0,r]),a.healable&&this.triggerAutoHeal(a.kind));break}}triggerAutoHeal(t){this.healing||(this.healing=!0,this.logger.info(`[GhostGuard] Auto-heal starting: ${t}`),this.emit("autoHeal",{kind:t,message:`doctor --fix triggered (${t})`}),Promise.resolve().then(()=>(SQ(),L1A)).then(({runDoctor:i})=>i(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(i=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${i.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let i=Date.now(),a=this.lastAlertTs.get(t.kind)??0;if(i-a<ETe)return;this.lastAlertTs.set(t.kind,i);let r={...t,ts:i};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},e6=null,t6=null,BTe=2e3;function W1A(){let e=0,A=0;for(let t of TQ.default.cpus()){for(let i of Object.values(t.times))A+=i;e+=t.times.idle}return{idle:e,total:A}}function z1A(e,A){let t=A.total-e.total,i=A.idle-e.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-i/t)))}async function q1A(){let e=Date.now();if(t6&&e-t6.ts<BTe)return t6.result;let A=W1A(),t=0;if(e6)t=z1A(e6,A);else{await new Promise(s=>setTimeout(s,150));let n=W1A();t=z1A(A,n),e6=n}e6=A;let i=TQ.default.freemem()/TQ.default.totalmem()*100,r={isCritical:t>80||i<15,cpuUsage:Math.round(t),memFreePercent:Math.round(i)};return t6={result:r,ts:e},r}var a6=UA(require("fs"),1),XY=UA(require("path"),1),J1A=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],gTe={"must-b.md":`# Must-b \u2014 Persona & Core Rules
4720
4720
 
4721
4721
  ## Identity
4722
4722
  You are Must-b \u2014 an autonomous AI operating system. Not a chatbot. A Cognitive OS:
package/dist/index.js CHANGED
@@ -4716,7 +4716,7 @@ ${Q}${m}`+p.repeat(E)+`${Q}`,C}function l(E,B,g,Q){return`${B}${Q}`+g.repeat(E)+
4716
4716
  \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
4717
4717
  \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
4718
4718
  \u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
4719
- \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D `;function tSe(){try{return"1.74.3"}catch{return"1.0.0"}}function iSe(){try{return"3ebb8341"}catch{return""}}function s0(e,A=58){let t=e.replace(/\x1b\[[0-9;]*m/g,""),i=Math.max(0,Math.floor((A-t.length)/2));return" ".repeat(i)+e}function n1A(e="\u2500",A=58){return hl(" "+e.repeat(A))}function ZI(e,A){let t=tSe(),i=iSe();console.log(a1A(eSe)),console.log(""),console.log(s0($Fe(ZFe("Must-b"))+" "+r1A("v"+t))),console.log(s0(hl("Professional AI Operating System"))),console.log(""),console.log(s0(a1A("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(s0(hl("Vision")+hl(" \xB7 ")+hl("Voice")+hl(" \xB7 ")+hl("OS Control")+hl(" \xB7 ")+hl("Multi-Agent Hierarchy"))),console.log(""),console.log(n1A()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(hl(" \xB7 "));console.log(s0(hl(a))),e==="web"&&(console.log(""),console.log(s0(ASe("\u25B6 ")+r1A(`http://localhost:${A}`))),console.log(s0(hl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(n1A()),console.log(s0(hl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var efA=require("events"),tfA=require("module"),GQ=UA(require("path"),1),NQ=UA(require("fs"),1),pl=UA(require("os"),1),ifA=UA(require("crypto"),1);var V1A=require("events"),TQ=UA(require("os"),1),JY=UA(require("fs"),1),K1A=UA(require("path"),1);ef();kr();var lTe=[{re:/connection refused|ECONNREFUSED/i,kind:"network",level:"warning",message:"Network connection refused.",recommendation:"LLM provider unreachable. Check API key and network in .env.",healable:!1},{re:/model not found|model.*does not exist|no such model/i,kind:"model",level:"warning",message:"Specified model not found.",recommendation:"Check MUSTB_MODEL or select a valid model in Settings > Model.",healable:!1},{re:/JavaScript heap out of memory|out of memory/i,kind:"oom",level:"critical",message:"Node.js memory limit reached.",recommendation:"Switch to a smaller model or start with NODE_OPTIONS=--max-old-space-size=4096.",healable:!1},{re:/python.*not found|pip.*not found|\'python\' is not recognized/i,kind:"path",level:"warning",message:"Python not found on PATH.",recommendation:"Run must-b doctor --fix to auto-repair.",healable:!0},{re:/cannot find module|module not found/i,kind:"module",level:"warning",message:"Missing Node.js module detected.",recommendation:"Run must-b doctor --fix to repair npm dependencies.",healable:!0},{re:/ENOENT.*node_modules/i,kind:"deps",level:"warning",message:"node_modules missing or corrupt.",recommendation:"Run must-b doctor --fix to trigger npm install.",healable:!0}],j1A=80,cTe=75,sC=85,uTe=90,ETe=5*60*1e3,i6=class extends V1A.EventEmitter{constructor(t){super();this.resourceTimer=null;this.logWatcher=null;this.liteActive=!1;this.healing=!1;this.watcherSuspended=!1;this.syncSuspended=!1;this.cloudSync=null;this.lastAlertTs=new Map;this._lastCpu=0;this._lastRam=0;this.patternHits=new Map;this.PATTERN_WINDOW_MS=5*60*1e3;this.PATTERN_THRESHOLD=3;this.root=t.root,this.logger=t.logger,this.logDir=TE}start(){this.startResourceMonitor(),this.startLogScanner(),this.logger.info("[GhostGuard] Resource monitor + log scanner active.")}getStats(){return{cpu:Math.round(this._lastCpu),ram:Math.round(this._lastRam),liteMode:this.liteActive,safeMode:this.watcherSuspended,ts:Date.now()}}registerCloudSync(t){this.cloudSync=t}stop(){this.resourceTimer&&(clearInterval(this.resourceTimer),this.resourceTimer=null),this.logWatcher?.close(),this.logWatcher=null,this.logger.info("[GhostGuard] Stopped.")}startResourceMonitor(){let t=this.sampleCpu();this.resourceTimer=setInterval(()=>{let i=this.ramUsagePct(),a=this.sampleCpu(),r=this.deltaCpu(t,a);t=a,this.onResourceSample(r,i)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=TQ.default.totalmem(),i=TQ.default.freemem();return(t-i)/t*100}sampleCpu(){let t=0,i=0;for(let a of TQ.default.cpus()){for(let r of Object.values(a.times))i+=r;t+=a.times.idle}return{idle:t,total:i}}deltaCpu(t,i){let a=i.total-t.total,r=i.idle-t.idle;return a===0?0:Math.max(0,Math.min(100,100*(1-r/a)))}onResourceSample(t,i){if(this._lastCpu=t,this._lastRam=i,i>=j1A&&!this.liteActive){this.liteActive=!0;let a=`RAM at ${i.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!0,reason:a})}else if(i<j1A-5&&this.liteActive){this.liteActive=!1;let a=`RAM dropped to ${i.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!1,reason:a})}if(i>=sC&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${i.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):i<sC-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${i.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(i>=sC&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):i<sC-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),i>=sC){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${i.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${a} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(i>=cTe){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${i.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${a} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=uTe&&this.emitAlert({level:"warning",kind:"cpu_high",message:`CPU at ${t.toFixed(1)}% \u2014 LLM load is saturating the system.`,recommendation:"Close background processes or switch to a smaller model."})}startLogScanner(){try{JY.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=o0(K1A.default.join(this.logDir,"*.md"),{ignoreInitial:!0,persistent:!1}),this.logWatcher.on("add",t=>this.scanLogFile(t)),this.logWatcher.on("change",t=>this.scanLogFile(t))}scanLogFile(t){let i="";try{i=JY.default.readFileSync(t,"utf-8")}catch{return}for(let a of lTe){if(!a.re.test(i))continue;let r=Date.now(),[n,s]=this.patternHits.get(a.kind)??[0,r],o=r-s<this.PATTERN_WINDOW_MS?n+1:1,l=r-s<this.PATTERN_WINDOW_MS?s:r;this.patternHits.set(a.kind,[o,l]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${a.kind} (${o}\xD7)`),this.emitAlert({level:a.level,kind:a.kind,message:`Recurring error (${o}\xD7): ${a.message}`,recommendation:a.recommendation}),this.patternHits.set(a.kind,[0,r]),a.healable&&this.triggerAutoHeal(a.kind));break}}triggerAutoHeal(t){this.healing||(this.healing=!0,this.logger.info(`[GhostGuard] Auto-heal starting: ${t}`),this.emit("autoHeal",{kind:t,message:`doctor --fix triggered (${t})`}),Promise.resolve().then(()=>(SQ(),L1A)).then(({runDoctor:i})=>i(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(i=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${i.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let i=Date.now(),a=this.lastAlertTs.get(t.kind)??0;if(i-a<ETe)return;this.lastAlertTs.set(t.kind,i);let r={...t,ts:i};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},e6=null,t6=null,BTe=2e3;function W1A(){let e=0,A=0;for(let t of TQ.default.cpus()){for(let i of Object.values(t.times))A+=i;e+=t.times.idle}return{idle:e,total:A}}function z1A(e,A){let t=A.total-e.total,i=A.idle-e.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-i/t)))}async function q1A(){let e=Date.now();if(t6&&e-t6.ts<BTe)return t6.result;let A=W1A(),t=0;if(e6)t=z1A(e6,A);else{await new Promise(s=>setTimeout(s,150));let n=W1A();t=z1A(A,n),e6=n}e6=A;let i=TQ.default.freemem()/TQ.default.totalmem()*100,r={isCritical:t>80||i<15,cpuUsage:Math.round(t),memFreePercent:Math.round(i)};return t6={result:r,ts:e},r}var a6=UA(require("fs"),1),XY=UA(require("path"),1),J1A=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],gTe={"must-b.md":`# Must-b \u2014 Persona & Core Rules
4719
+ \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D `;function tSe(){try{return"1.74.4"}catch{return"1.0.0"}}function iSe(){try{return"77c52d1c"}catch{return""}}function s0(e,A=58){let t=e.replace(/\x1b\[[0-9;]*m/g,""),i=Math.max(0,Math.floor((A-t.length)/2));return" ".repeat(i)+e}function n1A(e="\u2500",A=58){return hl(" "+e.repeat(A))}function ZI(e,A){let t=tSe(),i=iSe();console.log(a1A(eSe)),console.log(""),console.log(s0($Fe(ZFe("Must-b"))+" "+r1A("v"+t))),console.log(s0(hl("Professional AI Operating System"))),console.log(""),console.log(s0(a1A("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(s0(hl("Vision")+hl(" \xB7 ")+hl("Voice")+hl(" \xB7 ")+hl("OS Control")+hl(" \xB7 ")+hl("Multi-Agent Hierarchy"))),console.log(""),console.log(n1A()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(hl(" \xB7 "));console.log(s0(hl(a))),e==="web"&&(console.log(""),console.log(s0(ASe("\u25B6 ")+r1A(`http://localhost:${A}`))),console.log(s0(hl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(n1A()),console.log(s0(hl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var efA=require("events"),tfA=require("module"),GQ=UA(require("path"),1),NQ=UA(require("fs"),1),pl=UA(require("os"),1),ifA=UA(require("crypto"),1);var V1A=require("events"),TQ=UA(require("os"),1),JY=UA(require("fs"),1),K1A=UA(require("path"),1);ef();kr();var lTe=[{re:/connection refused|ECONNREFUSED/i,kind:"network",level:"warning",message:"Network connection refused.",recommendation:"LLM provider unreachable. Check API key and network in .env.",healable:!1},{re:/model not found|model.*does not exist|no such model/i,kind:"model",level:"warning",message:"Specified model not found.",recommendation:"Check MUSTB_MODEL or select a valid model in Settings > Model.",healable:!1},{re:/JavaScript heap out of memory|out of memory/i,kind:"oom",level:"critical",message:"Node.js memory limit reached.",recommendation:"Switch to a smaller model or start with NODE_OPTIONS=--max-old-space-size=4096.",healable:!1},{re:/python.*not found|pip.*not found|\'python\' is not recognized/i,kind:"path",level:"warning",message:"Python not found on PATH.",recommendation:"Run must-b doctor --fix to auto-repair.",healable:!0},{re:/cannot find module|module not found/i,kind:"module",level:"warning",message:"Missing Node.js module detected.",recommendation:"Run must-b doctor --fix to repair npm dependencies.",healable:!0},{re:/ENOENT.*node_modules/i,kind:"deps",level:"warning",message:"node_modules missing or corrupt.",recommendation:"Run must-b doctor --fix to trigger npm install.",healable:!0}],j1A=80,cTe=75,sC=85,uTe=90,ETe=5*60*1e3,i6=class extends V1A.EventEmitter{constructor(t){super();this.resourceTimer=null;this.logWatcher=null;this.liteActive=!1;this.healing=!1;this.watcherSuspended=!1;this.syncSuspended=!1;this.cloudSync=null;this.lastAlertTs=new Map;this._lastCpu=0;this._lastRam=0;this.patternHits=new Map;this.PATTERN_WINDOW_MS=5*60*1e3;this.PATTERN_THRESHOLD=3;this.root=t.root,this.logger=t.logger,this.logDir=TE}start(){this.startResourceMonitor(),this.startLogScanner(),this.logger.info("[GhostGuard] Resource monitor + log scanner active.")}getStats(){return{cpu:Math.round(this._lastCpu),ram:Math.round(this._lastRam),liteMode:this.liteActive,safeMode:this.watcherSuspended,ts:Date.now()}}registerCloudSync(t){this.cloudSync=t}stop(){this.resourceTimer&&(clearInterval(this.resourceTimer),this.resourceTimer=null),this.logWatcher?.close(),this.logWatcher=null,this.logger.info("[GhostGuard] Stopped.")}startResourceMonitor(){let t=this.sampleCpu();this.resourceTimer=setInterval(()=>{let i=this.ramUsagePct(),a=this.sampleCpu(),r=this.deltaCpu(t,a);t=a,this.onResourceSample(r,i)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=TQ.default.totalmem(),i=TQ.default.freemem();return(t-i)/t*100}sampleCpu(){let t=0,i=0;for(let a of TQ.default.cpus()){for(let r of Object.values(a.times))i+=r;t+=a.times.idle}return{idle:t,total:i}}deltaCpu(t,i){let a=i.total-t.total,r=i.idle-t.idle;return a===0?0:Math.max(0,Math.min(100,100*(1-r/a)))}onResourceSample(t,i){if(this._lastCpu=t,this._lastRam=i,i>=j1A&&!this.liteActive){this.liteActive=!0;let a=`RAM at ${i.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!0,reason:a})}else if(i<j1A-5&&this.liteActive){this.liteActive=!1;let a=`RAM dropped to ${i.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${a}`),this.emit("liteMode",{active:!1,reason:a})}if(i>=sC&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${i.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):i<sC-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${i.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(i>=sC&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):i<sC-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),i>=sC){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${i.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${a} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(i>=cTe){let a=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(a);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${i.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${a} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=uTe&&this.emitAlert({level:"warning",kind:"cpu_high",message:`CPU at ${t.toFixed(1)}% \u2014 LLM load is saturating the system.`,recommendation:"Close background processes or switch to a smaller model."})}startLogScanner(){try{JY.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=o0(K1A.default.join(this.logDir,"*.md"),{ignoreInitial:!0,persistent:!1}),this.logWatcher.on("add",t=>this.scanLogFile(t)),this.logWatcher.on("change",t=>this.scanLogFile(t))}scanLogFile(t){let i="";try{i=JY.default.readFileSync(t,"utf-8")}catch{return}for(let a of lTe){if(!a.re.test(i))continue;let r=Date.now(),[n,s]=this.patternHits.get(a.kind)??[0,r],o=r-s<this.PATTERN_WINDOW_MS?n+1:1,l=r-s<this.PATTERN_WINDOW_MS?s:r;this.patternHits.set(a.kind,[o,l]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${a.kind} (${o}\xD7)`),this.emitAlert({level:a.level,kind:a.kind,message:`Recurring error (${o}\xD7): ${a.message}`,recommendation:a.recommendation}),this.patternHits.set(a.kind,[0,r]),a.healable&&this.triggerAutoHeal(a.kind));break}}triggerAutoHeal(t){this.healing||(this.healing=!0,this.logger.info(`[GhostGuard] Auto-heal starting: ${t}`),this.emit("autoHeal",{kind:t,message:`doctor --fix triggered (${t})`}),Promise.resolve().then(()=>(SQ(),L1A)).then(({runDoctor:i})=>i(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(i=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${i.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let i=Date.now(),a=this.lastAlertTs.get(t.kind)??0;if(i-a<ETe)return;this.lastAlertTs.set(t.kind,i);let r={...t,ts:i};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},e6=null,t6=null,BTe=2e3;function W1A(){let e=0,A=0;for(let t of TQ.default.cpus()){for(let i of Object.values(t.times))A+=i;e+=t.times.idle}return{idle:e,total:A}}function z1A(e,A){let t=A.total-e.total,i=A.idle-e.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-i/t)))}async function q1A(){let e=Date.now();if(t6&&e-t6.ts<BTe)return t6.result;let A=W1A(),t=0;if(e6)t=z1A(e6,A);else{await new Promise(s=>setTimeout(s,150));let n=W1A();t=z1A(A,n),e6=n}e6=A;let i=TQ.default.freemem()/TQ.default.totalmem()*100,r={isCritical:t>80||i<15,cpuUsage:Math.round(t),memFreePercent:Math.round(i)};return t6={result:r,ts:e},r}var a6=UA(require("fs"),1),XY=UA(require("path"),1),J1A=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],gTe={"must-b.md":`# Must-b \u2014 Persona & Core Rules
4720
4720
 
4721
4721
  ## Identity
4722
4722
  You are Must-b \u2014 an autonomous AI operating system. Not a chatbot. A Cognitive OS: