@must-b/must-b 1.74.41 → 1.74.42

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.41",
4
- "gitHash": "477233ad",
5
- "buildTime": "2026-05-31T19:16:44.116Z",
3
+ "version": "1.74.42",
4
+ "gitHash": "188d2ce1",
5
+ "buildTime": "2026-05-31T19:52:52.267Z",
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-31T19:15:49.234Z",
3
+ "generatedAt": "2026-05-31T19:51:36.023Z",
4
4
  "count": 57,
5
5
  "skills": [
6
6
  {
package/dist/index.cjs CHANGED
@@ -5024,7 +5024,7 @@ ${p}${m}`+g.repeat(u)+`${p}`,E}function c(u,h,f,p){return`${h}${p}`+f.repeat(u)+
5024
5024
  \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
5025
5025
  \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
5026
5026
  \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
5027
- \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 vYA(){try{return"1.74.41"}catch{return"1.0.0"}}function MYA(){try{return"477233ad"}catch{return""}}function SD(s,e=58){let t=s.replace(/\x1b\[[0-9;]*m/g,""),A=Math.max(0,Math.floor((e-t.length)/2));return" ".repeat(A)+s}function wZe(s="\u2500",e=58){return Fp(" "+s.repeat(e))}function tN(s,e){let t=vYA(),A=MYA();console.log(BZe(OYA)),console.log(""),console.log(SD(kYA(IYA("Must-b"))+" "+QZe("v"+t))),console.log(SD(Fp("Professional AI Operating System"))),console.log(""),console.log(SD(BZe("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(SD(Fp("Vision")+Fp(" \xB7 ")+Fp("Voice")+Fp(" \xB7 ")+Fp("OS Control")+Fp(" \xB7 ")+Fp("Multi-Agent Hierarchy"))),console.log(""),console.log(wZe()),console.log("");let i=[`Node ${process.version}`,`Mode: ${s.toUpperCase()}`,`PID ${process.pid}`,A?`#${A}`:null].filter(Boolean).join(Fp(" \xB7 "));console.log(SD(Fp(i))),s==="web"&&(console.log(""),console.log(SD(CYA("\u25B6 ")+QZe(`http://localhost:${e}`))),console.log(SD(Fp("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(wZe()),console.log(SD(Fp("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var Qet=require("events"),wet=require("module"),OO=Ve(require("path"),1),vO=Ve(require("fs"),1),Lp=Ve(require("os"),1),yet=Ve(require("crypto"),1);var n$e=require("events"),IO=Ve(require("os"),1),zBe=Ve(require("fs"),1),a$e=Ve(require("path"),1);wO();Ko();var VVA=[{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}],i$e=80,WVA=75,dN=85,jVA=90,zVA=5*60*1e3,tee=class extends n$e.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=pQ}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 A=this.ramUsagePct(),i=this.sampleCpu(),r=this.deltaCpu(t,i);t=i,this.onResourceSample(r,A)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=IO.default.totalmem(),A=IO.default.freemem();return(t-A)/t*100}sampleCpu(){let t=0,A=0;for(let i of IO.default.cpus()){for(let r of Object.values(i.times))A+=r;t+=i.times.idle}return{idle:t,total:A}}deltaCpu(t,A){let i=A.total-t.total,r=A.idle-t.idle;return i===0?0:Math.max(0,Math.min(100,100*(1-r/i)))}onResourceSample(t,A){if(this._lastCpu=t,this._lastRam=A,A>=i$e&&!this.liteActive){this.liteActive=!0;let i=`RAM at ${A.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!0,reason:i})}else if(A<i$e-5&&this.liteActive){this.liteActive=!1;let i=`RAM dropped to ${A.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!1,reason:i})}if(A>=dN&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${A.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):A<dN-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${A.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(A>=dN&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):A<dN-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),A>=dN){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${A.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${i} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(A>=WVA){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${A.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${i} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=jVA&&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{zBe.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=fQ(a$e.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 A="";try{A=zBe.default.readFileSync(t,"utf-8")}catch{return}for(let i of VVA){if(!i.re.test(A))continue;let r=Date.now(),[n,a]=this.patternHits.get(i.kind)??[0,r],o=r-a<this.PATTERN_WINDOW_MS?n+1:1,c=r-a<this.PATTERN_WINDOW_MS?a:r;this.patternHits.set(i.kind,[o,c]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${i.kind} (${o}\xD7)`),this.emitAlert({level:i.level,kind:i.kind,message:`Recurring error (${o}\xD7): ${i.message}`,recommendation:i.recommendation}),this.patternHits.set(i.kind,[0,r]),i.healable&&this.triggerAutoHeal(i.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(()=>(DO(),A$e)).then(({runDoctor:A})=>A(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(A=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${A.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let A=Date.now(),i=this.lastAlertTs.get(t.kind)??0;if(A-i<zVA)return;this.lastAlertTs.set(t.kind,A);let r={...t,ts:A};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},$$=null,eee=null,KVA=2e3;function s$e(){let s=0,e=0;for(let t of IO.default.cpus()){for(let A of Object.values(t.times))e+=A;s+=t.times.idle}return{idle:s,total:e}}function r$e(s,e){let t=e.total-s.total,A=e.idle-s.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-A/t)))}async function o$e(){let s=Date.now();if(eee&&s-eee.ts<KVA)return eee.result;let e=s$e(),t=0;if($$)t=r$e($$,e);else{await new Promise(a=>setTimeout(a,150));let n=s$e();t=r$e(e,n),$$=n}$$=e;let A=IO.default.freemem()/IO.default.totalmem()*100,r={isCritical:t>80||A<15,cpuUsage:Math.round(t),memFreePercent:Math.round(A)};return eee={result:r,ts:s},r}var Aee=Ve(require("fs"),1),KBe=Ve(require("path"),1),c$e=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],JVA={"must-b.md":`# Must-b \u2014 Persona & Core Rules
5027
+ \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 vYA(){try{return"1.74.42"}catch{return"1.0.0"}}function MYA(){try{return"188d2ce1"}catch{return""}}function SD(s,e=58){let t=s.replace(/\x1b\[[0-9;]*m/g,""),A=Math.max(0,Math.floor((e-t.length)/2));return" ".repeat(A)+s}function wZe(s="\u2500",e=58){return Fp(" "+s.repeat(e))}function tN(s,e){let t=vYA(),A=MYA();console.log(BZe(OYA)),console.log(""),console.log(SD(kYA(IYA("Must-b"))+" "+QZe("v"+t))),console.log(SD(Fp("Professional AI Operating System"))),console.log(""),console.log(SD(BZe("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(SD(Fp("Vision")+Fp(" \xB7 ")+Fp("Voice")+Fp(" \xB7 ")+Fp("OS Control")+Fp(" \xB7 ")+Fp("Multi-Agent Hierarchy"))),console.log(""),console.log(wZe()),console.log("");let i=[`Node ${process.version}`,`Mode: ${s.toUpperCase()}`,`PID ${process.pid}`,A?`#${A}`:null].filter(Boolean).join(Fp(" \xB7 "));console.log(SD(Fp(i))),s==="web"&&(console.log(""),console.log(SD(CYA("\u25B6 ")+QZe(`http://localhost:${e}`))),console.log(SD(Fp("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(wZe()),console.log(SD(Fp("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var Qet=require("events"),wet=require("module"),OO=Ve(require("path"),1),vO=Ve(require("fs"),1),Lp=Ve(require("os"),1),yet=Ve(require("crypto"),1);var n$e=require("events"),IO=Ve(require("os"),1),zBe=Ve(require("fs"),1),a$e=Ve(require("path"),1);wO();Ko();var VVA=[{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}],i$e=80,WVA=75,dN=85,jVA=90,zVA=5*60*1e3,tee=class extends n$e.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=pQ}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 A=this.ramUsagePct(),i=this.sampleCpu(),r=this.deltaCpu(t,i);t=i,this.onResourceSample(r,A)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=IO.default.totalmem(),A=IO.default.freemem();return(t-A)/t*100}sampleCpu(){let t=0,A=0;for(let i of IO.default.cpus()){for(let r of Object.values(i.times))A+=r;t+=i.times.idle}return{idle:t,total:A}}deltaCpu(t,A){let i=A.total-t.total,r=A.idle-t.idle;return i===0?0:Math.max(0,Math.min(100,100*(1-r/i)))}onResourceSample(t,A){if(this._lastCpu=t,this._lastRam=A,A>=i$e&&!this.liteActive){this.liteActive=!0;let i=`RAM at ${A.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!0,reason:i})}else if(A<i$e-5&&this.liteActive){this.liteActive=!1;let i=`RAM dropped to ${A.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!1,reason:i})}if(A>=dN&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${A.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):A<dN-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${A.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(A>=dN&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):A<dN-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),A>=dN){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${A.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${i} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(A>=WVA){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${A.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${i} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=jVA&&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{zBe.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=fQ(a$e.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 A="";try{A=zBe.default.readFileSync(t,"utf-8")}catch{return}for(let i of VVA){if(!i.re.test(A))continue;let r=Date.now(),[n,a]=this.patternHits.get(i.kind)??[0,r],o=r-a<this.PATTERN_WINDOW_MS?n+1:1,c=r-a<this.PATTERN_WINDOW_MS?a:r;this.patternHits.set(i.kind,[o,c]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${i.kind} (${o}\xD7)`),this.emitAlert({level:i.level,kind:i.kind,message:`Recurring error (${o}\xD7): ${i.message}`,recommendation:i.recommendation}),this.patternHits.set(i.kind,[0,r]),i.healable&&this.triggerAutoHeal(i.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(()=>(DO(),A$e)).then(({runDoctor:A})=>A(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(A=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${A.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let A=Date.now(),i=this.lastAlertTs.get(t.kind)??0;if(A-i<zVA)return;this.lastAlertTs.set(t.kind,A);let r={...t,ts:A};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},$$=null,eee=null,KVA=2e3;function s$e(){let s=0,e=0;for(let t of IO.default.cpus()){for(let A of Object.values(t.times))e+=A;s+=t.times.idle}return{idle:s,total:e}}function r$e(s,e){let t=e.total-s.total,A=e.idle-s.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-A/t)))}async function o$e(){let s=Date.now();if(eee&&s-eee.ts<KVA)return eee.result;let e=s$e(),t=0;if($$)t=r$e($$,e);else{await new Promise(a=>setTimeout(a,150));let n=s$e();t=r$e(e,n),$$=n}$$=e;let A=IO.default.freemem()/IO.default.totalmem()*100,r={isCritical:t>80||A<15,cpuUsage:Math.round(t),memFreePercent:Math.round(A)};return eee={result:r,ts:s},r}var Aee=Ve(require("fs"),1),KBe=Ve(require("path"),1),c$e=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],JVA={"must-b.md":`# Must-b \u2014 Persona & Core Rules
5028
5028
 
5029
5029
  ## Identity
5030
5030
  You are Must-b \u2014 an autonomous AI operating system. Not a chatbot. A Cognitive OS:
package/dist/index.js CHANGED
@@ -5024,7 +5024,7 @@ ${p}${m}`+g.repeat(u)+`${p}`,E}function c(u,h,f,p){return`${h}${p}`+f.repeat(u)+
5024
5024
  \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
5025
5025
  \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
5026
5026
  \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
5027
- \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 vYA(){try{return"1.74.41"}catch{return"1.0.0"}}function MYA(){try{return"477233ad"}catch{return""}}function SD(s,e=58){let t=s.replace(/\x1b\[[0-9;]*m/g,""),A=Math.max(0,Math.floor((e-t.length)/2));return" ".repeat(A)+s}function wZe(s="\u2500",e=58){return Fp(" "+s.repeat(e))}function tN(s,e){let t=vYA(),A=MYA();console.log(BZe(OYA)),console.log(""),console.log(SD(kYA(IYA("Must-b"))+" "+QZe("v"+t))),console.log(SD(Fp("Professional AI Operating System"))),console.log(""),console.log(SD(BZe("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(SD(Fp("Vision")+Fp(" \xB7 ")+Fp("Voice")+Fp(" \xB7 ")+Fp("OS Control")+Fp(" \xB7 ")+Fp("Multi-Agent Hierarchy"))),console.log(""),console.log(wZe()),console.log("");let i=[`Node ${process.version}`,`Mode: ${s.toUpperCase()}`,`PID ${process.pid}`,A?`#${A}`:null].filter(Boolean).join(Fp(" \xB7 "));console.log(SD(Fp(i))),s==="web"&&(console.log(""),console.log(SD(CYA("\u25B6 ")+QZe(`http://localhost:${e}`))),console.log(SD(Fp("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(wZe()),console.log(SD(Fp("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var Qet=require("events"),wet=require("module"),OO=Ve(require("path"),1),vO=Ve(require("fs"),1),Lp=Ve(require("os"),1),yet=Ve(require("crypto"),1);var n$e=require("events"),IO=Ve(require("os"),1),zBe=Ve(require("fs"),1),a$e=Ve(require("path"),1);wO();Ko();var VVA=[{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}],i$e=80,WVA=75,dN=85,jVA=90,zVA=5*60*1e3,tee=class extends n$e.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=pQ}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 A=this.ramUsagePct(),i=this.sampleCpu(),r=this.deltaCpu(t,i);t=i,this.onResourceSample(r,A)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=IO.default.totalmem(),A=IO.default.freemem();return(t-A)/t*100}sampleCpu(){let t=0,A=0;for(let i of IO.default.cpus()){for(let r of Object.values(i.times))A+=r;t+=i.times.idle}return{idle:t,total:A}}deltaCpu(t,A){let i=A.total-t.total,r=A.idle-t.idle;return i===0?0:Math.max(0,Math.min(100,100*(1-r/i)))}onResourceSample(t,A){if(this._lastCpu=t,this._lastRam=A,A>=i$e&&!this.liteActive){this.liteActive=!0;let i=`RAM at ${A.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!0,reason:i})}else if(A<i$e-5&&this.liteActive){this.liteActive=!1;let i=`RAM dropped to ${A.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!1,reason:i})}if(A>=dN&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${A.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):A<dN-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${A.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(A>=dN&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):A<dN-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),A>=dN){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${A.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${i} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(A>=WVA){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${A.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${i} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=jVA&&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{zBe.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=fQ(a$e.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 A="";try{A=zBe.default.readFileSync(t,"utf-8")}catch{return}for(let i of VVA){if(!i.re.test(A))continue;let r=Date.now(),[n,a]=this.patternHits.get(i.kind)??[0,r],o=r-a<this.PATTERN_WINDOW_MS?n+1:1,c=r-a<this.PATTERN_WINDOW_MS?a:r;this.patternHits.set(i.kind,[o,c]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${i.kind} (${o}\xD7)`),this.emitAlert({level:i.level,kind:i.kind,message:`Recurring error (${o}\xD7): ${i.message}`,recommendation:i.recommendation}),this.patternHits.set(i.kind,[0,r]),i.healable&&this.triggerAutoHeal(i.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(()=>(DO(),A$e)).then(({runDoctor:A})=>A(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(A=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${A.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let A=Date.now(),i=this.lastAlertTs.get(t.kind)??0;if(A-i<zVA)return;this.lastAlertTs.set(t.kind,A);let r={...t,ts:A};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},$$=null,eee=null,KVA=2e3;function s$e(){let s=0,e=0;for(let t of IO.default.cpus()){for(let A of Object.values(t.times))e+=A;s+=t.times.idle}return{idle:s,total:e}}function r$e(s,e){let t=e.total-s.total,A=e.idle-s.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-A/t)))}async function o$e(){let s=Date.now();if(eee&&s-eee.ts<KVA)return eee.result;let e=s$e(),t=0;if($$)t=r$e($$,e);else{await new Promise(a=>setTimeout(a,150));let n=s$e();t=r$e(e,n),$$=n}$$=e;let A=IO.default.freemem()/IO.default.totalmem()*100,r={isCritical:t>80||A<15,cpuUsage:Math.round(t),memFreePercent:Math.round(A)};return eee={result:r,ts:s},r}var Aee=Ve(require("fs"),1),KBe=Ve(require("path"),1),c$e=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],JVA={"must-b.md":`# Must-b \u2014 Persona & Core Rules
5027
+ \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 vYA(){try{return"1.74.42"}catch{return"1.0.0"}}function MYA(){try{return"188d2ce1"}catch{return""}}function SD(s,e=58){let t=s.replace(/\x1b\[[0-9;]*m/g,""),A=Math.max(0,Math.floor((e-t.length)/2));return" ".repeat(A)+s}function wZe(s="\u2500",e=58){return Fp(" "+s.repeat(e))}function tN(s,e){let t=vYA(),A=MYA();console.log(BZe(OYA)),console.log(""),console.log(SD(kYA(IYA("Must-b"))+" "+QZe("v"+t))),console.log(SD(Fp("Professional AI Operating System"))),console.log(""),console.log(SD(BZe("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(SD(Fp("Vision")+Fp(" \xB7 ")+Fp("Voice")+Fp(" \xB7 ")+Fp("OS Control")+Fp(" \xB7 ")+Fp("Multi-Agent Hierarchy"))),console.log(""),console.log(wZe()),console.log("");let i=[`Node ${process.version}`,`Mode: ${s.toUpperCase()}`,`PID ${process.pid}`,A?`#${A}`:null].filter(Boolean).join(Fp(" \xB7 "));console.log(SD(Fp(i))),s==="web"&&(console.log(""),console.log(SD(CYA("\u25B6 ")+QZe(`http://localhost:${e}`))),console.log(SD(Fp("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(wZe()),console.log(SD(Fp("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var Qet=require("events"),wet=require("module"),OO=Ve(require("path"),1),vO=Ve(require("fs"),1),Lp=Ve(require("os"),1),yet=Ve(require("crypto"),1);var n$e=require("events"),IO=Ve(require("os"),1),zBe=Ve(require("fs"),1),a$e=Ve(require("path"),1);wO();Ko();var VVA=[{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}],i$e=80,WVA=75,dN=85,jVA=90,zVA=5*60*1e3,tee=class extends n$e.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=pQ}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 A=this.ramUsagePct(),i=this.sampleCpu(),r=this.deltaCpu(t,i);t=i,this.onResourceSample(r,A)},5e3),this.resourceTimer.unref()}ramUsagePct(){let t=IO.default.totalmem(),A=IO.default.freemem();return(t-A)/t*100}sampleCpu(){let t=0,A=0;for(let i of IO.default.cpus()){for(let r of Object.values(i.times))A+=r;t+=i.times.idle}return{idle:t,total:A}}deltaCpu(t,A){let i=A.total-t.total,r=A.idle-t.idle;return i===0?0:Math.max(0,Math.min(100,100*(1-r/i)))}onResourceSample(t,A){if(this._lastCpu=t,this._lastRam=A,A>=i$e&&!this.liteActive){this.liteActive=!0;let i=`RAM at ${A.toFixed(1)}% \u2014 Lite Mode active`;this.logger.warn(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!0,reason:i})}else if(A<i$e-5&&this.liteActive){this.liteActive=!1;let i=`RAM dropped to ${A.toFixed(1)}% \u2014 Lite Mode off`;this.logger.info(`[GhostGuard] ${i}`),this.emit("liteMode",{active:!1,reason:i})}if(A>=dN&&!this.watcherSuspended?(this.watcherSuspended=!0,this.logWatcher?.close(),this.logWatcher=null,this.emit("purgeOldMemory"),this.logger.warn(`[GhostGuard] RAM critical (${A.toFixed(1)}%) \u2014 log watcher suspended; older semantic memory will be purged, last 5 conversation turns preserved`)):A<dN-5&&this.watcherSuspended&&(this.watcherSuspended=!1,this.startLogScanner(),this.logger.info(`[GhostGuard] RAM recovered (${A.toFixed(1)}%) \u2014 log watcher resumed`)),this.cloudSync&&(A>=dN&&!this.syncSuspended?(this.syncSuspended=!0,this.cloudSync.stopAutoSync(),this.logger.warn("[GhostGuard] RAM critical \u2014 CloudSync auto-sync paused")):A<dN-5&&this.syncSuspended&&(this.syncSuspended=!1,this.cloudSync.startAutoSync(60),this.logger.info("[GhostGuard] RAM recovered \u2014 CloudSync auto-sync resumed"))),A>=dN){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"critical",kind:"ram_critical",message:`RAM at ${A.toFixed(1)}% \u2014 system lockup risk.`,recommendation:r?`${i} requires too much RAM. Switch to an 8B or 14B model.`:"Close unused applications or restart Must-b."})}else if(A>=WVA){let i=process.env.LLM_MODEL??process.env.MUSTB_MODEL??"",r=/70b|32b|34b|72b/i.test(i);this.emitAlert({level:"warning",kind:"ram_high",message:`RAM at ${A.toFixed(1)}% \u2014 performance may degrade.`,recommendation:r?`${i} is RAM-intensive. Consider switching to an 8B model.`:"RAM pressure high. Lite Mode may activate."})}t>=jVA&&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{zBe.default.mkdirSync(this.logDir,{recursive:!0})}catch{}this.logWatcher=fQ(a$e.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 A="";try{A=zBe.default.readFileSync(t,"utf-8")}catch{return}for(let i of VVA){if(!i.re.test(A))continue;let r=Date.now(),[n,a]=this.patternHits.get(i.kind)??[0,r],o=r-a<this.PATTERN_WINDOW_MS?n+1:1,c=r-a<this.PATTERN_WINDOW_MS?a:r;this.patternHits.set(i.kind,[o,c]),o>=this.PATTERN_THRESHOLD&&(this.logger.warn(`[GhostGuard] Tekrarlayan hata: ${i.kind} (${o}\xD7)`),this.emitAlert({level:i.level,kind:i.kind,message:`Recurring error (${o}\xD7): ${i.message}`,recommendation:i.recommendation}),this.patternHits.set(i.kind,[0,r]),i.healable&&this.triggerAutoHeal(i.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(()=>(DO(),A$e)).then(({runDoctor:A})=>A(this.root,!0,!0)).then(()=>{this.logger.info("[GhostGuard] Auto-heal complete.")}).catch(A=>{this.logger.error(`[GhostGuard] Auto-heal failed: ${A.message}`)}).finally(()=>{this.healing=!1}))}emitAlert(t){let A=Date.now(),i=this.lastAlertTs.get(t.kind)??0;if(A-i<zVA)return;this.lastAlertTs.set(t.kind,A);let r={...t,ts:A};this.logger.warn(`[GhostGuard] Alert [${r.level}/${r.kind}]: ${r.message}`),this.emit("alert",r)}},$$=null,eee=null,KVA=2e3;function s$e(){let s=0,e=0;for(let t of IO.default.cpus()){for(let A of Object.values(t.times))e+=A;s+=t.times.idle}return{idle:s,total:e}}function r$e(s,e){let t=e.total-s.total,A=e.idle-s.idle;return t===0?0:Math.max(0,Math.min(100,100*(1-A/t)))}async function o$e(){let s=Date.now();if(eee&&s-eee.ts<KVA)return eee.result;let e=s$e(),t=0;if($$)t=r$e($$,e);else{await new Promise(a=>setTimeout(a,150));let n=s$e();t=r$e(e,n),$$=n}$$=e;let A=IO.default.freemem()/IO.default.totalmem()*100,r={isCritical:t>80||A<15,cpuUsage:Math.round(t),memFreePercent:Math.round(A)};return eee={result:r,ts:s},r}var Aee=Ve(require("fs"),1),KBe=Ve(require("path"),1),c$e=["must-b.md","ARCHITECTURE.md","database.md","checklist.md"],JVA={"must-b.md":`# Must-b \u2014 Persona & Core Rules
5028
5028
 
5029
5029
  ## Identity
5030
5030
  You are Must-b \u2014 an autonomous AI operating system. Not a chatbot. A Cognitive OS: