@must-b/must-b 1.71.22 → 1.71.24

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.71.22",
4
- "gitHash": "340820ec",
5
- "buildTime": "2026-04-21T02:30:41.010Z",
3
+ "version": "1.71.24",
4
+ "gitHash": "79a758c9",
5
+ "buildTime": "2026-04-21T02:51:15.459Z",
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-04-21T02:29:25.792Z",
3
+ "generatedAt": "2026-04-21T02:50:08.557Z",
4
4
  "count": 57,
5
5
  "skills": [
6
6
  {
package/dist/index.cjs CHANGED
@@ -4356,7 +4356,7 @@ ${Q}${m}`+p.repeat(E)+`${Q}`,I}function l(E,B,g,Q){return`${B}${Q}`+g.repeat(E)+
4356
4356
  \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
4357
4357
  \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
4358
4358
  \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
4359
- \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 tFe(){try{return"1.71.22"}catch{return"1.0.0"}}function iFe(){try{return"340820ec"}catch{return""}}function e0(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 LpA(e="\u2500",A=58){return dl(" "+e.repeat(A))}function SI(e,A){let t=tFe(),i=iFe();console.log(YpA(eFe)),console.log(""),console.log(e0($xe(Zxe("Must-b"))+" "+PpA("v"+t))),console.log(e0(dl("Professional AI Operating System"))),console.log(""),console.log(e0(YpA("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(e0(dl("Vision")+dl(" \xB7 ")+dl("Voice")+dl(" \xB7 ")+dl("OS Control")+dl(" \xB7 ")+dl("Multi-Agent Hierarchy"))),console.log(""),console.log(LpA()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(dl(" \xB7 "));console.log(e0(dl(a))),e==="web"&&(console.log(""),console.log(e0(AFe("\u25B6 ")+PpA(`http://localhost:${A}`))),console.log(e0(dl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(LpA()),console.log(e0(dl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var KpA=require("events"),qpA=require("module"),wM=Ae(require("path"),1),mM=Ae(require("fs"),1),vE=Ae(require("os"),1);function jpA(e){let A=e.toLowerCase();return[/\b(refactor|redesign|architect|migrate|overhaul)\b/i,/\ball\s+(files|modules|services|endpoints)\b/i,/\bacross\s+the\s+(codebase|project|repo)\b/i,/\bmultiple\s+files\b/i,/\bimplement\s+(a\s+)?(new\s+)?(feature|system|module|service|api)\b/i,/\badd\s+(support\s+for|full|complete)\b/i,/\b(investigate|diagnose|audit|analyze)\b.*\b(and|then)\s+(fix|implement|add)\b/i,/\bfind\s+(all|every|the\s+root)\b/i,/\bsecurity\b.*\b(audit|review|fix|vulnerability)\b/i,/\b(vulnerability|cve|exploit|injection|xss|sql.inject)\b/i,/\b(first|step\s+1|phase\s+1)\b.*\bthen\b.*\b(implement|update|change)\b/i,/\bresearch\b.*\b(and|then)\b/i,/\binvestigate\b/i].some(i=>i.test(A))}async function aFe(e,A){let t=`${e}
4359
+ \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 tFe(){try{return"1.71.24"}catch{return"1.0.0"}}function iFe(){try{return"79a758c9"}catch{return""}}function e0(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 LpA(e="\u2500",A=58){return dl(" "+e.repeat(A))}function SI(e,A){let t=tFe(),i=iFe();console.log(YpA(eFe)),console.log(""),console.log(e0($xe(Zxe("Must-b"))+" "+PpA("v"+t))),console.log(e0(dl("Professional AI Operating System"))),console.log(""),console.log(e0(YpA("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(e0(dl("Vision")+dl(" \xB7 ")+dl("Voice")+dl(" \xB7 ")+dl("OS Control")+dl(" \xB7 ")+dl("Multi-Agent Hierarchy"))),console.log(""),console.log(LpA()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(dl(" \xB7 "));console.log(e0(dl(a))),e==="web"&&(console.log(""),console.log(e0(AFe("\u25B6 ")+PpA(`http://localhost:${A}`))),console.log(e0(dl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(LpA()),console.log(e0(dl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var KpA=require("events"),qpA=require("module"),wM=Ae(require("path"),1),mM=Ae(require("fs"),1),vE=Ae(require("os"),1);function jpA(e){let A=e.toLowerCase();return[/\b(refactor|redesign|architect|migrate|overhaul)\b/i,/\ball\s+(files|modules|services|endpoints)\b/i,/\bacross\s+the\s+(codebase|project|repo)\b/i,/\bmultiple\s+files\b/i,/\bimplement\s+(a\s+)?(new\s+)?(feature|system|module|service|api)\b/i,/\badd\s+(support\s+for|full|complete)\b/i,/\b(investigate|diagnose|audit|analyze)\b.*\b(and|then)\s+(fix|implement|add)\b/i,/\bfind\s+(all|every|the\s+root)\b/i,/\bsecurity\b.*\b(audit|review|fix|vulnerability)\b/i,/\b(vulnerability|cve|exploit|injection|xss|sql.inject)\b/i,/\b(first|step\s+1|phase\s+1)\b.*\bthen\b.*\b(implement|update|change)\b/i,/\bresearch\b.*\b(and|then)\b/i,/\binvestigate\b/i].some(i=>i.test(A))}async function aFe(e,A){let t=`${e}
4360
4360
 
4361
4361
  COORDINATOR INSTRUCTION: Generate ONLY research steps (read-only, no file writes).
4362
4362
  Steps must use ONLY these tools: filesystem_read, filesystem_list, filesystem_search,
package/dist/index.js CHANGED
@@ -4356,7 +4356,7 @@ ${Q}${m}`+p.repeat(E)+`${Q}`,I}function l(E,B,g,Q){return`${B}${Q}`+g.repeat(E)+
4356
4356
  \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
4357
4357
  \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
4358
4358
  \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
4359
- \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 tFe(){try{return"1.71.22"}catch{return"1.0.0"}}function iFe(){try{return"340820ec"}catch{return""}}function e0(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 LpA(e="\u2500",A=58){return dl(" "+e.repeat(A))}function SI(e,A){let t=tFe(),i=iFe();console.log(YpA(eFe)),console.log(""),console.log(e0($xe(Zxe("Must-b"))+" "+PpA("v"+t))),console.log(e0(dl("Professional AI Operating System"))),console.log(""),console.log(e0(YpA("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(e0(dl("Vision")+dl(" \xB7 ")+dl("Voice")+dl(" \xB7 ")+dl("OS Control")+dl(" \xB7 ")+dl("Multi-Agent Hierarchy"))),console.log(""),console.log(LpA()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(dl(" \xB7 "));console.log(e0(dl(a))),e==="web"&&(console.log(""),console.log(e0(AFe("\u25B6 ")+PpA(`http://localhost:${A}`))),console.log(e0(dl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(LpA()),console.log(e0(dl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var KpA=require("events"),qpA=require("module"),wM=Ae(require("path"),1),mM=Ae(require("fs"),1),vE=Ae(require("os"),1);function jpA(e){let A=e.toLowerCase();return[/\b(refactor|redesign|architect|migrate|overhaul)\b/i,/\ball\s+(files|modules|services|endpoints)\b/i,/\bacross\s+the\s+(codebase|project|repo)\b/i,/\bmultiple\s+files\b/i,/\bimplement\s+(a\s+)?(new\s+)?(feature|system|module|service|api)\b/i,/\badd\s+(support\s+for|full|complete)\b/i,/\b(investigate|diagnose|audit|analyze)\b.*\b(and|then)\s+(fix|implement|add)\b/i,/\bfind\s+(all|every|the\s+root)\b/i,/\bsecurity\b.*\b(audit|review|fix|vulnerability)\b/i,/\b(vulnerability|cve|exploit|injection|xss|sql.inject)\b/i,/\b(first|step\s+1|phase\s+1)\b.*\bthen\b.*\b(implement|update|change)\b/i,/\bresearch\b.*\b(and|then)\b/i,/\binvestigate\b/i].some(i=>i.test(A))}async function aFe(e,A){let t=`${e}
4359
+ \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 tFe(){try{return"1.71.24"}catch{return"1.0.0"}}function iFe(){try{return"79a758c9"}catch{return""}}function e0(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 LpA(e="\u2500",A=58){return dl(" "+e.repeat(A))}function SI(e,A){let t=tFe(),i=iFe();console.log(YpA(eFe)),console.log(""),console.log(e0($xe(Zxe("Must-b"))+" "+PpA("v"+t))),console.log(e0(dl("Professional AI Operating System"))),console.log(""),console.log(e0(YpA("\u26A1 Autonomous \xB7 Precise \xB7 Always On"))),console.log(e0(dl("Vision")+dl(" \xB7 ")+dl("Voice")+dl(" \xB7 ")+dl("OS Control")+dl(" \xB7 ")+dl("Multi-Agent Hierarchy"))),console.log(""),console.log(LpA()),console.log("");let a=[`Node ${process.version}`,`Mode: ${e.toUpperCase()}`,`PID ${process.pid}`,i?`#${i}`:null].filter(Boolean).join(dl(" \xB7 "));console.log(e0(dl(a))),e==="web"&&(console.log(""),console.log(e0(AFe("\u25B6 ")+PpA(`http://localhost:${A}`))),console.log(e0(dl("Dashboard is live \u2014 open in your browser")))),console.log(""),console.log(LpA()),console.log(e0(dl("Built by Auto Step \xB7 https://must-b.com"))),console.log("")}var KpA=require("events"),qpA=require("module"),wM=Ae(require("path"),1),mM=Ae(require("fs"),1),vE=Ae(require("os"),1);function jpA(e){let A=e.toLowerCase();return[/\b(refactor|redesign|architect|migrate|overhaul)\b/i,/\ball\s+(files|modules|services|endpoints)\b/i,/\bacross\s+the\s+(codebase|project|repo)\b/i,/\bmultiple\s+files\b/i,/\bimplement\s+(a\s+)?(new\s+)?(feature|system|module|service|api)\b/i,/\badd\s+(support\s+for|full|complete)\b/i,/\b(investigate|diagnose|audit|analyze)\b.*\b(and|then)\s+(fix|implement|add)\b/i,/\bfind\s+(all|every|the\s+root)\b/i,/\bsecurity\b.*\b(audit|review|fix|vulnerability)\b/i,/\b(vulnerability|cve|exploit|injection|xss|sql.inject)\b/i,/\b(first|step\s+1|phase\s+1)\b.*\bthen\b.*\b(implement|update|change)\b/i,/\bresearch\b.*\b(and|then)\b/i,/\binvestigate\b/i].some(i=>i.test(A))}async function aFe(e,A){let t=`${e}
4360
4360
 
4361
4361
  COORDINATOR INSTRUCTION: Generate ONLY research steps (read-only, no file writes).
4362
4362
  Steps must use ONLY these tools: filesystem_read, filesystem_list, filesystem_search,
@@ -738,4 +738,4 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
738
738
  group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(xh,{size:13})}),r.jsx("span",{className:"text-[12px] font-semibold text-white/50 group-hover:text-red-400 transition-colors",children:i?"Signing out…":"Sign Out"})]})]}),r.jsx("div",{className:"px-4 py-2 border-t border-white/6",children:r.jsx("p",{className:"text-[9.5px] text-white/18 text-center",children:"must-b.com · Secure OAuth connection"})})]},"profile-panel")})]})}const m_=4,g_=3e3;function x_(){return r.jsxs(U.div,{className:"fixed inset-0 z-[200] pointer-events-none flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[r.jsx("div",{className:"absolute inset-0 bg-black/35"}),Array.from({length:m_}).map((e,t)=>r.jsx(U.span,{className:"absolute rounded-full",style:{border:"1.5px solid rgba(249,115,22,0.70)",boxShadow:"0 0 20px rgba(249,115,22,0.25)"},initial:{width:64,height:64,opacity:.9,scale:1},animate:{width:64+t*0,height:64+t*0,scale:[1,3.5+t*1.2],opacity:[.8,0]},transition:{duration:1.8,delay:t*.22,ease:"easeOut",repeat:1/0,repeatDelay:.1}},t)),r.jsx(U.div,{className:"relative z-10 w-16 h-16 rounded-full flex items-center justify-center",style:{background:"rgba(249,115,22,0.18)",border:"1.5px solid rgba(249,115,22,0.55)",backdropFilter:"blur(16px)",boxShadow:"0 0 32px rgba(249,115,22,0.35), 0 0 64px rgba(249,115,22,0.15)"},animate:{scale:[1,1.06,1]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:r.jsx(Nr,{size:26,className:"text-orange-400"})}),r.jsx(U.p,{className:"absolute text-[12px] font-semibold text-orange-300/80 tracking-widest uppercase",style:{top:"calc(50% + 52px)"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.15,duration:.3},children:"Dinliyorum…"})]})}function y_(){const[e,t]=f.useState(!1),n=f.useRef(null),s=f.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),g_)},[]);return f.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(ee,{children:e&&r.jsx(x_,{},"wake-aura")})}const v_={browser_navigate:"navigate",web_search:"search",http_request:"request"},b_=20,w_=5e3;function k_(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function j_(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function N_(e){return e==="search"?r.jsx(qt,{size:10}):e==="request"?r.jsx(zr,{size:10}):r.jsx(Xe,{size:10})}function E1(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function S_({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=E1(t);return r.jsx("span",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 text-[10px] font-black",style:{background:`${s}18`,border:`1px solid ${s}30`,color:s},children:n})}function C_({entry:e,isLatest:t}){var a;const n=E1(e.kind),s=e.domain??"",i=e.query??(e.url?j_(e.url):"");return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",style:{borderLeft:t?`2px solid ${n}`:"2px solid transparent",background:t?`${n}08`:"transparent"},children:[r.jsx(S_,{domain:s||"?",kind:e.kind}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-semibold text-white/80 truncate leading-tight",children:s||((a=e.query)==null?void 0:a.slice(0,30))||"—"}),i&&r.jsx("p",{className:"text-[9px] text-white/35 truncate font-mono mt-0.5",children:i})]}),r.jsx("span",{style:{color:n,opacity:.6},className:"flex-shrink-0",children:N_(e.kind)}),r.jsx("span",{className:"text-[9px] text-white/20 font-mono flex-shrink-0",children:new Date(e.ts).toLocaleTimeString("tr-TR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})}function __(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=f.useRef(null),d=f.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},w_)},[]);return f.useEffect(()=>{const u=at(),p=h=>{const{type:m}=h;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(y=>y.map(b=>({...b,done:!0}))),d();return}if(m==="stepStart"&&h.step){const y=h.step,b=y.tool?v_[y.tool]:void 0;if(!b)return;const v=y.parameters??{},g=String(v.url??v.endpoint??"").trim(),x=String(v.query??"").trim();if(!g&&!x)return;const w={id:`v-${Date.now()}-${Math.random().toString(36).slice(2,5)}`,kind:b,url:g||void 0,query:x||void 0,domain:g?k_(g):void 0,ts:Date.now(),done:!1};t(j=>[w,...j].slice(0,b_)),s(!0),a(!1)}};return u.on("agentUpdate",p),()=>{u.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[d]),!n||e.length===0?null:r.jsx(U.div,{className:"fixed right-4 z-[120] w-[300px]",style:{top:"88px"},initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:16,scale:.96},transition:{type:"spring",stiffness:360,damping:30},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(5,3,1,0.88)",border:"1px solid rgba(56,189,248,0.22)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(56,189,248,0.06), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer select-none",style:{borderBottom:i?"none":"1px solid rgba(255,255,255,0.06)"},onClick:()=>a(u=>!u),children:[r.jsx(BS,{size:11,className:"text-sky-400/70 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-bold text-white/60 flex-1 tracking-wide uppercase",children:"Gezi Haritası"}),o&&r.jsxs("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx(U.span,{className:"w-1.5 h-1.5 rounded-full bg-sky-400",animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0}}),r.jsx("span",{className:"text-[10px] text-sky-400/70 font-medium",children:"taranıyor"})]}),r.jsx("span",{className:"text-[10px] text-white/25 flex-shrink-0 font-mono ml-1",children:e.length}),r.jsx("button",{onClick:u=>{u.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(st,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(fh,{size:10}):r.jsx(na,{size:10})})]}),r.jsx(ee,{children:!i&&r.jsxs(U.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.18},className:"overflow-hidden",children:[r.jsx("div",{className:"overflow-y-auto divide-y divide-white/4",style:{maxHeight:"260px"},children:r.jsx(ee,{mode:"popLayout",children:e.map((u,p)=>r.jsx(U.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(C_,{entry:u,isLatest:p===0&&o})},u.id))})}),r.jsx("div",{className:"px-3 py-1.5 flex items-center justify-between",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-white/20 font-mono",children:[e.filter(u=>u.kind==="navigate").length," gezinti ·"," ",e.filter(u=>u.kind==="search").length," arama ·"," ",e.filter(u=>u.kind==="request").length," istek"]})})]})})]})})}function E_(e){if(!e.created_at)return"Older";const t=new Date,n=new Date(e.created_at),s=(t.getTime()-n.getTime())/864e5;return s<1&&t.getDate()===n.getDate()?"Today":s<2&&t.getDate()-n.getDate()===1?"Yesterday":s<7?"Last 7 Days":"Older"}const T_=["Today","Yesterday","Last 7 Days","Older"],P_="flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium mb-0.5 w-full text-left",A_="bg-orange-500/15 text-orange-300 border border-orange-500/25",M_="text-white/80 hover:text-white/95 hover:bg-white/6";function z_(e){return Ke(P_,e?A_:M_)}function R_(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function L_({onClose:e}){const{t}=pt(),n=is(),s=un(),i=n.pathname,[a,o]=f.useState([]),[l,c]=f.useState(null),[d,u]=f.useState(""),[p,h]=f.useState(null),[m,y]=f.useState(null),[b,v]=f.useState(""),[g,x]=f.useState(""),[w,j]=f.useState(!1),k=f.useCallback(async()=>{try{const T=await $("/api/chats");if(!T.ok)return;const V=await T.json();o(V);const M=new Set([...V.map(I=>I.id),"default"]);for(let I=localStorage.length-1;I>=0;I--){const z=localStorage.key(I);z!=null&&z.startsWith("mustb_chat_turns_")&&!M.has(z.slice(17))&&localStorage.removeItem(z)}}catch{}},[]);f.useEffect(()=>{k();const T=setInterval(k,1e4);return()=>clearInterval(T)},[k]),f.useEffect(()=>{const T=V=>{const{id:M,title:I}=V.detail;o(z=>z.map(R=>R.id===M?{...R,title:I}:R))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),f.useEffect(()=>{$("/api/setup/status").then(T=>T.ok?T.json():null).then(T=>{T&&(v(T.activeProvider??""),x(T.activeModel??""))}).catch(()=>{}),fetch("/api/auth/user-status").then(T=>T.json()).then(T=>j(!!T.authenticated)).catch(()=>{})},[]);const N=async()=>{try{const T=await $("/api/chats",{method:"POST",body:JSON.stringify({title:"New Chat"})});if(!T.ok){pe.error("Failed to create chat.");return}const V=await T.json();o(M=>[V,...M]),s(`/app?chat=${V.id}`),e()}catch{pe.error("Gateway unreachable.")}},S=async()=>{if(p){try{await $(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(V=>V.id!==p)),pe.success("Chat deleted."),i.includes(p)&&s("/app")}catch{pe.error("Failed to delete chat.")}h(null)}},_=async T=>{y(null);try{await $(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(V=>V.filter(M=>M.id!==T)),pe.success("Chat archived.")}catch{pe.error("Failed to archive chat.")}},A=async()=>{if(!l||!d.trim()){c(null);return}try{await $(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:d})}),o(T=>T.map(V=>V.id===l?{...V,title:d}:V)),pe.success("Chat renamed.")}catch{pe.error("Failed to rename chat.")}c(null)},P=[{to:"/app/browser",icon:r.jsx(Xe,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx(r4,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(Re,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Sr,{size:14}),label:t.nav.plugins},{to:"/app/files",icon:r.jsx(os,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(il,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(bh,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(n1,{size:14}),label:t.nav.apiKeys}];return r.jsxs("aside",{className:"w-[280px] h-full bg-[#0d0703] border-r border-orange-500/10 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex items-center h-[60px] pl-14 pr-4 shrink-0",children:r.jsxs(hi,{to:"/app",onClick:e,className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[r.jsxs("div",{className:"relative w-7 h-7 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-sm opacity-40"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[18px] font-black tracking-tight text-white/90 leading-none select-none",children:"Must-b"})]})}),r.jsx("p",{className:"text-[10px] font-bold text-white/30 uppercase tracking-widest px-3 mb-2",children:"Sohbet"}),r.jsx("div",{className:"px-3 pb-3 shrink-0",children:r.jsxs("button",{onClick:N,className:"flex items-center justify-center gap-2 w-full px-3 py-1.5 rounded-lg border border-orange-500/20 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20 hover:border-orange-500/30 transition-all text-[12px] font-medium",children:[r.jsx(ll,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&y(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const V of a)T[E_(V)].push(V);return T_.map(V=>{const M=T[V];return M.length===0?null:r.jsxs("div",{children:[r.jsx("p",{className:"px-2 mt-3 mb-1 text-[9.5px] font-bold text-white/20 uppercase tracking-widest",children:V}),r.jsx("div",{className:"space-y-0.5",children:M.map(I=>r.jsx("div",{className:"group relative",children:l===I.id?r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-orange-500/10 rounded-lg border border-orange-500/25",children:[r.jsx("input",{value:d,onChange:z=>u(z.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:z=>{z.key==="Enter"&&A(),z.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:A,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(Mt,{size:12})}),r.jsx("button",{onClick:()=>c(null),className:"p-1 text-red-400 hover:bg-red-400/10 rounded transition-colors",children:r.jsx(st,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(hi,{to:`/app?chat=${I.id}`,onClick:e,className:Ke("flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium pr-8",i.includes(I.id)?"bg-orange-500/15 text-orange-300 border border-orange-500/25":"text-white/55 hover:text-white/85 hover:bg-white/6"),children:[r.jsx(sa,{size:13,className:i.includes(I.id)?"text-orange-400 shrink-0":"text-white/30 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:I.title})]}),r.jsx("button",{onClick:z=>{z.preventDefault(),z.stopPropagation(),y(m===I.id?null:I.id)},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded text-white/25 hover:text-white/70 hover:bg-white/8 opacity-0 group-hover:opacity-100 transition-all",children:r.jsx(CS,{size:14})}),m===I.id&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[150px] rounded-xl py-1 overflow-hidden",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.15)",backdropFilter:"blur(20px)"},onClick:z=>z.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{y(null),c(I.id),u(I.title)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(GS,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>_(I.id),className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(yS,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:z=>{z.preventDefault(),z.stopPropagation(),y(null),h(I.id)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[r.jsx(Ls,{size:12,className:"shrink-0"})," Delete"]})]})]})},I.id))})]},V)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),P.map(({to:T,icon:V,label:M,exact:I})=>{const z=T.split("?")[0],R=I?i===z:i.startsWith(z);return r.jsxs(hi,{to:T,onClick:e,className:z_(R),children:[r.jsx("span",{className:R_(R),children:V}),M]},T)})]}),r.jsxs("div",{className:"border-t border-orange-500/10 p-3 shrink-0",children:[g&&r.jsxs("div",{className:"mb-2 px-1",children:[r.jsx("p",{className:"text-[9px] text-white/25 font-bold uppercase tracking-[0.2em] mb-0.5",children:"Active Model"}),r.jsx("p",{className:"text-orange-400 text-[11px] font-bold truncate",children:g}),b&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:b})]}),w&&r.jsxs("button",{onClick:async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}catch{}e(),s("/app"),window.location.reload()},className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-white/30 hover:text-red-400 hover:bg-red-500/10 transition-all text-xs font-medium",children:[r.jsx(xh,{size:13}),t.sidebar.logout]}),r.jsxs("p",{className:"mt-2 text-[10px] text-white/20 px-1",children:[t.sidebar.poweredBy," ",r.jsx("span",{className:"text-orange-500/70 font-semibold",children:"Auto Step"})]})]}),p&&r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",children:r.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.18)"},children:[r.jsx("h3",{className:"text-lg font-bold text-white/90 mb-2",children:t.sidebar.deleteChat}),r.jsx("p",{className:"text-white/45 text-sm mb-6",children:t.sidebar.deleteConfirm}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("button",{onClick:()=>h(null),className:"flex-1 px-4 py-2 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-sm font-medium transition-colors",children:t.sidebar.cancel}),r.jsx("button",{onClick:S,className:"flex-1 px-4 py-2 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-medium transition-colors",children:t.sidebar.delete})]})]})})]})}function he(e){window.dispatchEvent(new CustomEvent("mustb:invoke-skill",{detail:{skill:e}})),setTimeout(()=>{var t;return(t=document.querySelector("textarea"))==null?void 0:t.focus()},80)}function D_({panel:e,title:t,onClose:n}){return f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(ee,{children:[r.jsx(U.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-40 bg-black/55 backdrop-blur-[3px]",onClick:n},"stage-backdrop"),r.jsxs(U.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",stiffness:380,damping:32},className:`fixed z-50 top-[72px] left-1/2 -translate-x-1/2
739
739
  w-full max-w-2xl max-h-[calc(100vh-92px)]
740
740
  glass-panel rounded-3xl overflow-hidden flex flex-col
741
- shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(WC,{}),e==="plugins"&&r.jsx(qC,{}),e==="skills"&&r.jsx(JC,{}),e==="workspace"&&r.jsx(s_,{}),e==="livesight"&&r.jsx(r_,{})]})]},"stage-card")]})}function O_(){const{t:e}=pt(),t=is(),n=un(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[d,u]=f.useState(!1);f.useEffect(()=>{const y=b=>{u(b.detail.active)};return window.addEventListener("mustb:safeMode",y),()=>window.removeEventListener("mustb:safeMode",y)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(y=>o(b=>b===y?"":y),[]),f.useCallback(y=>{c(y),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(J2,{reducedMotion:d?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(D_,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(y=>!y),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(VS,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(hi,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(kS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(U.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(UC,{})}),r.jsx(f_,{})]})]}),r.jsx(ee,{children:s&&r.jsx(U.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(L_,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(e2,{})}),r.jsx(a_,{}),r.jsx(h_,{}),r.jsx(y_,{}),r.jsx(__,{})]})})}const I_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:PS,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:NS,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:JS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function B_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=at(),d=u=>{u.type==="CONFLICT_DETECTED"&&(t({localAgentName:u.localAgentName??null,cloudAgentName:u.cloudAgentName??null,localMtime:u.localMtime??null,cloudTimestamp:u.cloudTimestamp??null}),a(!1)),u.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",d),()=>{c.off("agentUpdate",d)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(ee,{children:e&&r.jsx(U.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs(U.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(es,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):I_.map(c=>{const d=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(ne,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(d,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}const F_="1.71.22";function V_(){const[e,t]=f.useState("idle"),[n,s]=f.useState(null),[i,a]=f.useState(""),[o,l]=f.useState(""),c=f.useCallback(async()=>{var h,m;t("checking"),a("");try{const y=await $("/api/system/version");if(!y.ok)throw new Error(`Server returned ${y.status}`);const v=await y.json(),g=(v==null?void 0:v.current)??((h=v==null?void 0:v.data)==null?void 0:h.current),x=(v==null?void 0:v.latest)??((m=v==null?void 0:v.data)==null?void 0:m.latest);if(!g||!x)throw new Error("Version endpoint returned incomplete data");s({current:g,latest:x}),$_(x,g)>0?t("update-available"):(t("up-to-date"),setTimeout(()=>t("idle"),3e3))}catch(y){a((y==null?void 0:y.message)??"Check failed"),t("error")}},[]);f.useEffect(()=>{const m=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&c(),y))},288e5);return()=>clearInterval(m)},[c]);const d=f.useCallback(async()=>{t("downloading"),l("");try{const h=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!h.body)throw new Error("No response body");const m=h.body.getReader(),y=new TextDecoder;for(;;){const{done:b,value:v}=await m.read();if(b)break;l(g=>g+y.decode(v))}t("done")}catch(h){a((h==null?void 0:h.message)??"Update failed"),t("error")}},[]),u=f.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const h=at();let m=0;const y=setInterval(()=>{m++,h.connected&&(clearInterval(y),window.location.reload()),m>60&&clearInterval(y)},500)},[]),p=(n==null?void 0:n.current)??F_;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2",children:[r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?c:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Ke("flex items-center gap-2","py-2 px-4 rounded-full shadow-2xl","text-xs font-medium","transition-all duration-200",e==="update-available"?"bg-red-900/90 backdrop-blur-md border border-red-500/50 text-white hover:bg-red-800 hover:border-red-400/60":e==="error"?"bg-amber-900/90 backdrop-blur-md border border-amber-500/60 text-white hover:bg-amber-800 hover:border-amber-400/70":"bg-gray-900/90 backdrop-blur-md border border-gray-700/50 text-gray-300 hover:bg-gray-800 hover:border-gray-600/60 hover:text-white",["checking","downloading","restarting"].includes(e)&&"cursor-wait opacity-80"),children:[e==="checking"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="update-available"&&r.jsx(xi,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(nc,{size:13,className:"text-emerald-400 shrink-0"}),e==="downloading"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="done"&&r.jsx(nc,{size:13,className:"text-emerald-400 shrink-0"}),e==="restarting"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="error"&&r.jsx(ln,{size:13,className:"text-amber-300 shrink-0"}),e==="idle"&&r.jsx(le,{size:13,className:"text-gray-500 shrink-0"}),r.jsxs("span",{className:"tabular-nums",children:[r.jsx("span",{children:"Must-b v"}),r.jsx("span",{children:p})]}),e==="checking"&&r.jsx("span",{className:"text-orange-400/80",children:"Checking…"}),e==="up-to-date"&&r.jsx("span",{className:"text-emerald-400/80",children:"Up to date"}),e==="downloading"&&r.jsx("span",{className:"text-orange-400/80",children:"Installing…"}),e==="done"&&r.jsx("span",{className:"text-emerald-400/80",children:"Installed!"}),e==="restarting"&&r.jsx("span",{className:"text-orange-400/80",children:"Restarting…"}),e==="error"&&r.jsxs("span",{className:"text-amber-300/90 max-w-[140px] truncate",children:["Check failed",i?` — ${i}`:""]})]}),e==="update-available"&&n&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-orange-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xi,{size:16,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-orange-300 font-semibold text-sm",children:"Update Available"})]}),r.jsxs("div",{className:"text-gray-400 text-xs leading-relaxed",children:[r.jsx("span",{children:"Version "}),r.jsx("span",{className:"font-mono text-white",children:n.latest}),r.jsx("span",{children:" is ready to install."})]}),r.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500",children:[r.jsxs("span",{children:["Current: ",r.jsx("span",{className:"font-mono",children:n.current})]}),r.jsxs("span",{children:["Latest: ",r.jsx("span",{className:"font-mono text-orange-300",children:n.latest})]})]}),r.jsxs("button",{onClick:d,className:"flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-500 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150 shadow-lg shadow-orange-900/30",children:[r.jsx(xi,{size:13}),r.jsx("span",{children:"Download & Install"})]}),r.jsx("button",{onClick:()=>t("idle"),className:"text-center text-[11px] text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx("span",{children:"Dismiss"})})]}),e==="downloading"&&r.jsxs("div",{className:"p-4 rounded-2xl bg-gray-900/95 border border-white/10 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-orange-300 mb-3",children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing update…"})]}),r.jsx("pre",{className:"text-[10px] text-gray-400 max-h-24 overflow-y-auto whitespace-pre-wrap break-all font-mono bg-black/30 rounded-lg p-2",children:r.jsx("span",{children:o||"Connecting to npm registry…"})})]}),e==="done"&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-emerald-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(nc,{size:16,className:"text-emerald-400 shrink-0"}),r.jsx("span",{className:"text-emerald-300 font-semibold text-sm",children:"Update Installed!"})]}),r.jsx("p",{className:"text-gray-400 text-xs",children:r.jsx("span",{children:"Restart Must-b to apply the new version."})}),r.jsxs("button",{onClick:u,className:"flex items-center justify-center gap-2 bg-emerald-700 hover:bg-emerald-600 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150",children:[r.jsx(le,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="restarting"&&r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm",children:[r.jsx(ne,{size:44,className:"animate-spin text-orange-400 mb-5"}),r.jsx("p",{className:"text-white text-lg font-semibold",children:r.jsx("span",{children:"Restarting Must-b…"})}),r.jsx("p",{className:"text-gray-400 text-sm mt-2",children:r.jsx("span",{children:"The dashboard will reload automatically."})})]})]})}function $_(e,t){const n=a=>a.replace(/[^0-9.]/g,"").split(".").map(Number),[s,i]=[n(e),n(t)];for(let a=0;a<Math.max(s.length,i.length);a++){const o=(s[a]??0)-(i[a]??0);if(o!==0)return o}return 0}class U_ extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const pc="mustb_setup_complete";function H_({children:e}){const t=un(),[n,s]=f.useState(()=>localStorage.getItem(pc)==="1");return f.useEffect(()=>{if(localStorage.getItem(pc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(pc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function W_(){return r.jsx(U_,{children:r.jsx(h4,{children:r.jsxs(d2,{children:[r.jsx(V2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(B_,{}),r.jsx(V_,{}),r.jsxs(n2,{children:[r.jsx(we,{path:"/",element:r.jsx(bm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(bm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(y4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(H_,{children:r.jsx(O_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(Dm,{})}),r.jsx(we,{path:"chat",element:r.jsx(Dm,{})}),r.jsx(we,{path:"settings",element:r.jsx(tC,{})}),r.jsx(we,{path:"active",element:r.jsx(sC,{})}),r.jsx(we,{path:"automations",element:r.jsx(aC,{})}),r.jsx(we,{path:"clients",element:r.jsx(cC,{})}),r.jsx(we,{path:"logs",element:r.jsx(pC,{})}),r.jsx(we,{path:"products",element:r.jsx(gC,{})}),r.jsx(we,{path:"memory",element:r.jsx(jC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(CC,{})}),r.jsx(we,{path:"skills",element:r.jsx(EC,{})}),r.jsx(we,{path:"plugins",element:r.jsx(MC,{})}),r.jsx(we,{path:"files",element:r.jsx(LC,{})}),r.jsx(we,{path:"browser",element:r.jsx(BC,{})}),r.jsx(we,{path:"voice",element:r.jsx($C,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(RC,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/",replace:!0})})]})]})})})}lx(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(W_,{})}));
741
+ shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(WC,{}),e==="plugins"&&r.jsx(qC,{}),e==="skills"&&r.jsx(JC,{}),e==="workspace"&&r.jsx(s_,{}),e==="livesight"&&r.jsx(r_,{})]})]},"stage-card")]})}function O_(){const{t:e}=pt(),t=is(),n=un(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[d,u]=f.useState(!1);f.useEffect(()=>{const y=b=>{u(b.detail.active)};return window.addEventListener("mustb:safeMode",y),()=>window.removeEventListener("mustb:safeMode",y)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(y=>o(b=>b===y?"":y),[]),f.useCallback(y=>{c(y),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(J2,{reducedMotion:d?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(D_,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(y=>!y),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(VS,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(hi,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(kS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx(U.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(UC,{})}),r.jsx(f_,{})]})]}),r.jsx(ee,{children:s&&r.jsx(U.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(L_,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(e2,{})}),r.jsx(a_,{}),r.jsx(h_,{}),r.jsx(y_,{}),r.jsx(__,{})]})})}const I_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:PS,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:NS,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:JS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function B_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=at(),d=u=>{u.type==="CONFLICT_DETECTED"&&(t({localAgentName:u.localAgentName??null,cloudAgentName:u.cloudAgentName??null,localMtime:u.localMtime??null,cloudTimestamp:u.cloudTimestamp??null}),a(!1)),u.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",d),()=>{c.off("agentUpdate",d)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(ee,{children:e&&r.jsx(U.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs(U.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(es,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):I_.map(c=>{const d=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(ne,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(d,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}const F_="1.71.24";function V_(){const[e,t]=f.useState("idle"),[n,s]=f.useState(null),[i,a]=f.useState(""),[o,l]=f.useState(""),c=f.useCallback(async()=>{var h,m;t("checking"),a("");try{const y=await $("/api/system/version");if(!y.ok)throw new Error(`Server returned ${y.status}`);const v=await y.json(),g=(v==null?void 0:v.current)??((h=v==null?void 0:v.data)==null?void 0:h.current),x=(v==null?void 0:v.latest)??((m=v==null?void 0:v.data)==null?void 0:m.latest);if(!g||!x)throw new Error("Version endpoint returned incomplete data");s({current:g,latest:x}),$_(x,g)>0?t("update-available"):(t("up-to-date"),setTimeout(()=>t("idle"),3e3))}catch(y){a((y==null?void 0:y.message)??"Check failed"),t("error")}},[]);f.useEffect(()=>{const m=setInterval(()=>{t(y=>((y==="idle"||y==="up-to-date")&&c(),y))},288e5);return()=>clearInterval(m)},[c]);const d=f.useCallback(async()=>{t("downloading"),l("");try{const h=await fetch("/api/system/update",{method:"POST",credentials:"include"});if(!h.body)throw new Error("No response body");const m=h.body.getReader(),y=new TextDecoder;for(;;){const{done:b,value:v}=await m.read();if(b)break;l(g=>g+y.decode(v))}t("done")}catch(h){a((h==null?void 0:h.message)??"Update failed"),t("error")}},[]),u=f.useCallback(async()=>{t("restarting");try{await $("/api/system/restart",{method:"POST"})}catch{}const h=at();let m=0;const y=setInterval(()=>{m++,h.connected&&(clearInterval(y),window.location.reload()),m>60&&clearInterval(y)},500)},[]),p=(n==null?void 0:n.current)??F_;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2",children:[r.jsxs("button",{onClick:e==="idle"||e==="up-to-date"||e==="error"?c:void 0,disabled:["checking","downloading","restarting"].includes(e),title:"Check for updates",className:Ke("flex items-center gap-2","py-2 px-4 rounded-full shadow-2xl","text-xs font-medium","transition-all duration-200",e==="update-available"?"bg-red-900/90 backdrop-blur-md border border-red-500/50 text-white hover:bg-red-800 hover:border-red-400/60":e==="error"?"bg-amber-900/90 backdrop-blur-md border border-amber-500/60 text-white hover:bg-amber-800 hover:border-amber-400/70":"bg-gray-900/90 backdrop-blur-md border border-gray-700/50 text-gray-300 hover:bg-gray-800 hover:border-gray-600/60 hover:text-white",["checking","downloading","restarting"].includes(e)&&"cursor-wait opacity-80"),children:[e==="checking"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="update-available"&&r.jsx(xi,{size:13,className:"text-red-300 shrink-0"}),e==="up-to-date"&&r.jsx(nc,{size:13,className:"text-emerald-400 shrink-0"}),e==="downloading"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="done"&&r.jsx(nc,{size:13,className:"text-emerald-400 shrink-0"}),e==="restarting"&&r.jsx(ne,{size:13,className:"animate-spin text-orange-400 shrink-0"}),e==="error"&&r.jsx(ln,{size:13,className:"text-amber-300 shrink-0"}),e==="idle"&&r.jsx(le,{size:13,className:"text-gray-500 shrink-0"}),r.jsxs("span",{className:"tabular-nums",children:[r.jsx("span",{children:"Must-b v"}),r.jsx("span",{children:p})]}),e==="checking"&&r.jsx("span",{className:"text-orange-400/80",children:"Checking…"}),e==="up-to-date"&&r.jsx("span",{className:"text-emerald-400/80",children:"Up to date"}),e==="downloading"&&r.jsx("span",{className:"text-orange-400/80",children:"Installing…"}),e==="done"&&r.jsx("span",{className:"text-emerald-400/80",children:"Installed!"}),e==="restarting"&&r.jsx("span",{className:"text-orange-400/80",children:"Restarting…"}),e==="error"&&r.jsxs("span",{className:"text-amber-300/90 max-w-[140px] truncate",children:["Check failed",i?` — ${i}`:""]})]}),e==="update-available"&&n&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-orange-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xi,{size:16,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-orange-300 font-semibold text-sm",children:"Update Available"})]}),r.jsxs("div",{className:"text-gray-400 text-xs leading-relaxed",children:[r.jsx("span",{children:"Version "}),r.jsx("span",{className:"font-mono text-white",children:n.latest}),r.jsx("span",{children:" is ready to install."})]}),r.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500",children:[r.jsxs("span",{children:["Current: ",r.jsx("span",{className:"font-mono",children:n.current})]}),r.jsxs("span",{children:["Latest: ",r.jsx("span",{className:"font-mono text-orange-300",children:n.latest})]})]}),r.jsxs("button",{onClick:d,className:"flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-500 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150 shadow-lg shadow-orange-900/30",children:[r.jsx(xi,{size:13}),r.jsx("span",{children:"Download & Install"})]}),r.jsx("button",{onClick:()=>t("idle"),className:"text-center text-[11px] text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx("span",{children:"Dismiss"})})]}),e==="downloading"&&r.jsxs("div",{className:"p-4 rounded-2xl bg-gray-900/95 border border-white/10 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-orange-300 mb-3",children:[r.jsx(ne,{size:13,className:"animate-spin shrink-0"}),r.jsx("span",{children:"Installing update…"})]}),r.jsx("pre",{className:"text-[10px] text-gray-400 max-h-24 overflow-y-auto whitespace-pre-wrap break-all font-mono bg-black/30 rounded-lg p-2",children:r.jsx("span",{children:o||"Connecting to npm registry…"})})]}),e==="done"&&r.jsxs("div",{className:"flex flex-col gap-3 p-4 rounded-2xl bg-gray-900/95 border border-emerald-500/30 backdrop-blur-md shadow-2xl w-60",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(nc,{size:16,className:"text-emerald-400 shrink-0"}),r.jsx("span",{className:"text-emerald-300 font-semibold text-sm",children:"Update Installed!"})]}),r.jsx("p",{className:"text-gray-400 text-xs",children:r.jsx("span",{children:"Restart Must-b to apply the new version."})}),r.jsxs("button",{onClick:u,className:"flex items-center justify-center gap-2 bg-emerald-700 hover:bg-emerald-600 active:scale-95 text-white rounded-xl py-2 text-xs font-semibold transition-all duration-150",children:[r.jsx(le,{size:13}),r.jsx("span",{children:"Restart Now"})]})]})]}),e==="restarting"&&r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm",children:[r.jsx(ne,{size:44,className:"animate-spin text-orange-400 mb-5"}),r.jsx("p",{className:"text-white text-lg font-semibold",children:r.jsx("span",{children:"Restarting Must-b…"})}),r.jsx("p",{className:"text-gray-400 text-sm mt-2",children:r.jsx("span",{children:"The dashboard will reload automatically."})})]})]})}function $_(e,t){const n=a=>a.replace(/[^0-9.]/g,"").split(".").map(Number),[s,i]=[n(e),n(t)];for(let a=0;a<Math.max(s.length,i.length);a++){const o=(s[a]??0)-(i[a]??0);if(o!==0)return o}return 0}class U_ extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const pc="mustb_setup_complete";function H_({children:e}){const t=un(),[n,s]=f.useState(()=>localStorage.getItem(pc)==="1");return f.useEffect(()=>{if(localStorage.getItem(pc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(pc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function W_(){return r.jsx(U_,{children:r.jsx(h4,{children:r.jsxs(d2,{children:[r.jsx(V2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(B_,{}),r.jsx(V_,{}),r.jsxs(n2,{children:[r.jsx(we,{path:"/",element:r.jsx(bm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(bm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(y4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(H_,{children:r.jsx(O_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(Dm,{})}),r.jsx(we,{path:"chat",element:r.jsx(Dm,{})}),r.jsx(we,{path:"settings",element:r.jsx(tC,{})}),r.jsx(we,{path:"active",element:r.jsx(sC,{})}),r.jsx(we,{path:"automations",element:r.jsx(aC,{})}),r.jsx(we,{path:"clients",element:r.jsx(cC,{})}),r.jsx(we,{path:"logs",element:r.jsx(pC,{})}),r.jsx(we,{path:"products",element:r.jsx(gC,{})}),r.jsx(we,{path:"memory",element:r.jsx(jC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(CC,{})}),r.jsx(we,{path:"skills",element:r.jsx(EC,{})}),r.jsx(we,{path:"plugins",element:r.jsx(MC,{})}),r.jsx(we,{path:"files",element:r.jsx(LC,{})}),r.jsx(we,{path:"browser",element:r.jsx(BC,{})}),r.jsx(we,{path:"voice",element:r.jsx($C,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(RC,{})}),r.jsx(we,{path:"*",element:r.jsx(Kp,{to:"/",replace:!0})})]})]})})})}lx(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(W_,{})}));
@@ -11,7 +11,7 @@
11
11
  <meta property="og:type" content="website" />
12
12
  <link rel="preconnect" href="https://fonts.googleapis.com" />
13
13
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
14
- <script type="module" crossorigin src="/assets/index-PU8icrfG.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-7TwDAfKC.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-Bn0FAD1a.css">
16
16
  </head>
17
17
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@must-b/must-b",
3
- "version": "1.71.22",
4
- "description": "Must-b v1.71.22 — Autonomous AI agent with Computer Use + Voice pipeline + cross-platform OS abstraction + MetaTrader 5 finance bridge, 57+ embedded skills — 8-hour auto-update check + graceful ASCII terminal exit",
3
+ "version": "1.71.24",
4
+ "description": "Must-b v1.71.24 — Autonomous AI agent with Computer Use + Voice pipeline + cross-platform OS abstraction + MetaTrader 5 finance bridge, 57+ embedded skills — 8-hour auto-update check + graceful ASCII terminal exit",
5
5
  "license": "MIT",
6
6
  "author": "Must-b Inc.",
7
7
  "homepage": "https://must-b.com",
@@ -23,9 +23,7 @@
23
23
  "files": [
24
24
  "dist/",
25
25
  "bin/",
26
- "install.sh",
27
- "install.ps1",
28
- "install.cmd"
26
+ "README.md"
29
27
  ],
30
28
  "main": "dist/index.cjs",
31
29
  "bin": {
package/install.cmd DELETED
@@ -1,73 +0,0 @@
1
- @echo off
2
- :: Usage: curl -fsSL https://must-b.com/install.cmd -o install.cmd && install.cmd
3
- title Must-b Installer — Auto Step Edition
4
- echo.
5
- echo =============================================
6
- echo Must-b v2.0 — Auto Step Edition Installer
7
- echo =============================================
8
- echo.
9
-
10
- :: Check if Node.js is installed
11
- node --version >nul 2>&1
12
- if %errorlevel% neq 0 (
13
- echo [ERROR] Node.js is not installed. Please install Node.js 18+ from https://nodejs.org
14
- pause
15
- exit /b 1
16
- )
17
-
18
- :: Check if Git is installed
19
- git --version >nul 2>&1
20
- if %errorlevel% neq 0 (
21
- echo [ERROR] Git is not installed. Please install Git from https://git-scm.com
22
- pause
23
- exit /b 1
24
- )
25
-
26
- echo [1/4] Cloning Must-b repository...
27
- git clone https://github.com/aytac43-0/must-b.git must-b
28
- if %errorlevel% neq 0 (
29
- echo [ERROR] Failed to clone repository. Check your internet connection.
30
- pause
31
- exit /b 1
32
- )
33
-
34
- cd must-b
35
-
36
- echo [2/4] Installing dependencies...
37
- npm install
38
- if %errorlevel% neq 0 (
39
- echo [ERROR] npm install failed.
40
- pause
41
- exit /b 1
42
- )
43
-
44
- echo [3/4] Setting up environment config...
45
- if not exist .env (
46
- copy .env.example .env >nul 2>&1
47
- echo [INFO] .env file created from .env.example — please edit it with your API keys.
48
- ) else (
49
- echo [INFO] .env file already exists.
50
- )
51
-
52
- echo [4/4] Registering global "must-b" command...
53
- npm link
54
- if %errorlevel% neq 0 (
55
- echo [WARN] npm link failed — try running as Administrator, or run "npm link" manually.
56
- )
57
-
58
- echo.
59
- echo =============================================
60
- echo Installation complete!
61
- echo =============================================
62
- echo.
63
- echo Build the frontend once (required before first run):
64
- echo npm run build:frontend
65
- echo.
66
- echo Then start Must-b:
67
- echo must-b (global command)
68
- echo npm start (from project folder)
69
- echo.
70
- echo Open http://localhost:4309 in your browser.
71
- echo =============================================
72
- echo.
73
- pause
package/install.ps1 DELETED
@@ -1,150 +0,0 @@
1
- # ── Must-b Universal Installer (Windows PowerShell) ──────────────────────
2
- # Usage: irm https://must-b.com/install.ps1 | iex
3
- # Or: .\install.ps1
4
- $ErrorActionPreference = "Stop"
5
-
6
- $REPO = "https://github.com/aytac43-0/must-b.git"
7
- $DIR = "must-b"
8
- $REQ_MAJOR = 22
9
- $REQ_MINOR = 5
10
-
11
- function Write-Cyan($msg) { Write-Host $msg -ForegroundColor Cyan }
12
- function Write-Green($msg) { Write-Host $msg -ForegroundColor Green }
13
- function Write-Red($msg) { Write-Host $msg -ForegroundColor Red }
14
- function Write-Yellow($msg) { Write-Host $msg -ForegroundColor Yellow }
15
- function Write-Dim($msg) { Write-Host $msg -ForegroundColor DarkGray }
16
-
17
- Write-Host ""
18
- Write-Cyan " ══════════════════════════════════════════════"
19
- Write-Cyan " Must-b — Installer (Windows)"
20
- Write-Cyan " ══════════════════════════════════════════════"
21
- Write-Host ""
22
-
23
- # ── helpers ───────────────────────────────────────────────────────────────
24
-
25
- function Test-SemverOk([string]$ver) {
26
- $parts = $ver -replace '^v','' -split '\.'
27
- $maj = [int]$parts[0]
28
- $min = [int]$parts[1]
29
- return ($maj -gt $REQ_MAJOR) -or ($maj -eq $REQ_MAJOR -and $min -ge $REQ_MINOR)
30
- }
31
-
32
- function Install-Node22 {
33
- Write-Yellow " ⟳ Attempting to install Node.js v22 via winget..."
34
- $wingetPath = Get-Command winget -ErrorAction SilentlyContinue
35
- if (-not $wingetPath) {
36
- Write-Red " ✗ winget not available."
37
- Write-Host " Download Node.js v22 from: https://nodejs.org/en/download"
38
- exit 1
39
- }
40
- winget install --id OpenJS.NodeJS.LTS --accept-source-agreements --accept-package-agreements --wait
41
- # Refresh PATH from registry so node is reachable in this session
42
- $userPath = [System.Environment]::GetEnvironmentVariable('PATH','User')
43
- $machinePath = [System.Environment]::GetEnvironmentVariable('PATH','Machine')
44
- $env:PATH = "$userPath;$machinePath;$env:PATH"
45
- }
46
-
47
- # ── 1. Check PowerShell ExecutionPolicy ───────────────────────────────────
48
- $policy = (Get-ExecutionPolicy -Scope CurrentUser).ToString().ToLower()
49
- if ($policy -eq 'restricted' -or $policy -eq 'allsigned') {
50
- Write-Yellow " ⚠ PowerShell ExecutionPolicy is '$policy' — scripts may be blocked."
51
- Write-Yellow " Auto-fixing: Set-ExecutionPolicy RemoteSigned (CurrentUser)..."
52
- try {
53
- Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
54
- Write-Green " ✓ ExecutionPolicy set to RemoteSigned."
55
- } catch {
56
- Write-Red " ✗ Could not set ExecutionPolicy. Run PowerShell as Administrator and:"
57
- Write-Host " Set-ExecutionPolicy -Scope CurrentUser RemoteSigned"
58
- exit 1
59
- }
60
- } else {
61
- Write-Green " ✓ ExecutionPolicy: $policy (scripts allowed)"
62
- }
63
-
64
- # ── 2. Check / install Node.js ────────────────────────────────────────────
65
- $nodePath = Get-Command node -ErrorAction SilentlyContinue
66
- if (-not $nodePath) {
67
- Write-Red " ✗ Node.js not found — attempting automatic install..."
68
- Install-Node22
69
- $nodePath = Get-Command node -ErrorAction SilentlyContinue
70
- }
71
-
72
- $nodeVersion = (node --version 2>$null)
73
- if (-not (Test-SemverOk $nodeVersion)) {
74
- Write-Red " ✗ Node.js $nodeVersion found, but v${REQ_MAJOR}.${REQ_MINOR}+ is required."
75
- Write-Yellow " Upgrading via winget..."
76
- Install-Node22
77
- $nodeVersion = (node --version 2>$null)
78
- }
79
-
80
- if (-not (Test-SemverOk $nodeVersion)) {
81
- Write-Red " ✗ Node.js $nodeVersion still below requirement. Download manually:"
82
- Write-Host " https://nodejs.org/en/download (choose v22 LTS)"
83
- exit 1
84
- }
85
- Write-Green " ✓ Node.js $nodeVersion (>= v${REQ_MAJOR}.${REQ_MINOR} ✓)"
86
-
87
- # ── 3. Check Git ──────────────────────────────────────────────────────────
88
- $gitPath = Get-Command git -ErrorAction SilentlyContinue
89
- if (-not $gitPath) {
90
- Write-Red " ✗ Git not found."
91
- Write-Host " Download from: https://git-scm.com"
92
- exit 1
93
- }
94
- Write-Green " ✓ $(git --version)"
95
-
96
- # ── 4. Clone or update ────────────────────────────────────────────────────
97
- Write-Host ""
98
- if (Test-Path $DIR) {
99
- Write-Dim " Directory '$DIR' exists — pulling latest..."
100
- Push-Location $DIR
101
- git pull --ff-only
102
- } else {
103
- Write-Dim " [1/4] Cloning Must-b..."
104
- git clone $REPO $DIR
105
- Push-Location $DIR
106
- }
107
-
108
- # ── 5. npm install (force fresh, ignore cache) ────────────────────────────
109
- Write-Dim " [2/4] Installing dependencies (--prefer-online)..."
110
- npm install --prefer-online
111
- if ($LASTEXITCODE -ne 0) {
112
- Write-Red " ✗ npm install failed."
113
- Pop-Location; exit 1
114
- }
115
-
116
- # ── 6. .env setup ─────────────────────────────────────────────────────────
117
- Write-Dim " [3/4] Setting up environment config..."
118
- if (-not (Test-Path ".env")) {
119
- Copy-Item ".env.example" ".env"
120
- Write-Green " ✓ .env created from .env.example"
121
- Write-Host " Edit .env and set your OPENROUTER_API_KEY before starting."
122
- } else {
123
- Write-Dim " .env already exists — skipping."
124
- }
125
-
126
- # ── 7. Global link ────────────────────────────────────────────────────────
127
- Write-Dim " [4/4] Linking global 'must-b' command..."
128
- try {
129
- npm link
130
- Write-Green " ✓ 'must-b' registered as a global command."
131
- } catch {
132
- Write-Yellow " ⚠ npm link failed. Try running PowerShell as Administrator and re-run this script."
133
- }
134
-
135
- Pop-Location
136
-
137
- Write-Host ""
138
- Write-Cyan " ══════════════════════════════════════════════"
139
- Write-Green " Installation complete!"
140
- Write-Host ""
141
- Write-Dim " Run the first-time setup wizard:"
142
- Write-Host " must-b onboard"
143
- Write-Host ""
144
- Write-Dim " Quick reference:"
145
- Write-Host " must-b -> web UI at http://localhost:4309"
146
- Write-Host " must-b cli -> terminal chat"
147
- Write-Host " must-b doctor -> system health check"
148
- Write-Host " must-b --version -> show installed version"
149
- Write-Cyan " ══════════════════════════════════════════════"
150
- Write-Host ""
package/install.sh DELETED
@@ -1,150 +0,0 @@
1
- #!/usr/bin/env bash
2
- # ── Must-b Universal Installer (Linux / macOS) ────────────────────────────
3
- # Usage: curl -fsSL https://must-b.com/install.sh | bash
4
- set -euo pipefail
5
-
6
- REPO="https://github.com/aytac43-0/must-b.git"
7
- DIR="must-b"
8
- REQUIRED_MAJOR=22
9
- REQUIRED_MINOR=5
10
-
11
- cyan() { printf '\033[38;2;0;204;255m%s\033[0m\n' "$*"; }
12
- green() { printf '\033[32m%s\033[0m\n' "$*"; }
13
- red() { printf '\033[31m%s\033[0m\n' "$*"; }
14
- yellow(){ printf '\033[33m%s\033[0m\n' "$*"; }
15
- dim() { printf '\033[2m%s\033[0m\n' "$*"; }
16
-
17
- echo ""
18
- cyan " ══════════════════════════════════════════════"
19
- cyan " Must-b — Installer (Linux / macOS)"
20
- cyan " ══════════════════════════════════════════════"
21
- echo ""
22
-
23
- # ── helpers ───────────────────────────────────────────────────────────────
24
-
25
- semver_ok() {
26
- # $1 = full version string like "22.6.0"
27
- local maj min
28
- maj=$(echo "$1" | cut -d. -f1)
29
- min=$(echo "$1" | cut -d. -f2)
30
- if [ "$maj" -gt "$REQUIRED_MAJOR" ]; then return 0
31
- elif [ "$maj" -eq "$REQUIRED_MAJOR" ] && [ "$min" -ge "$REQUIRED_MINOR" ]; then return 0
32
- else return 1
33
- fi
34
- }
35
-
36
- install_node22() {
37
- yellow " ⟳ Attempting to install Node.js v22 automatically..."
38
- local plat
39
- plat="$(uname -s)"
40
- if [ "$plat" = "Darwin" ]; then
41
- if command -v brew &>/dev/null; then
42
- brew install node@22 || brew upgrade node
43
- brew link --overwrite node@22 2>/dev/null || true
44
- else
45
- red " ✗ Homebrew not found. Install it first: https://brew.sh"
46
- red " Then run: brew install node@22"
47
- exit 1
48
- fi
49
- else
50
- # Linux — try nodesource v22 (Debian/Ubuntu) else nvm
51
- if command -v apt-get &>/dev/null; then
52
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
53
- sudo apt-get install -y nodejs
54
- elif command -v dnf &>/dev/null; then
55
- curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
56
- sudo dnf install -y nodejs
57
- elif command -v yum &>/dev/null; then
58
- curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
59
- sudo yum install -y nodejs
60
- else
61
- yellow " ⚠ Could not auto-install Node.js on this distro."
62
- yellow " Install nvm and run: nvm install 22 && nvm use 22"
63
- exit 1
64
- fi
65
- fi
66
- }
67
-
68
- # ── 1. Check / install Node.js ────────────────────────────────────────────
69
- if ! command -v node &>/dev/null; then
70
- red " ✗ Node.js not found — will attempt automatic install..."
71
- install_node22
72
- fi
73
-
74
- NODE_VER=$(node -e "process.stdout.write(process.versions.node)")
75
- if ! semver_ok "$NODE_VER"; then
76
- red " ✗ Node.js v${NODE_VER} found, but v${REQUIRED_MAJOR}.${REQUIRED_MINOR}+ is required."
77
- yellow " Attempting upgrade..."
78
- install_node22
79
- NODE_VER=$(node -e "process.stdout.write(process.versions.node)")
80
- fi
81
-
82
- if ! semver_ok "$NODE_VER"; then
83
- red " ✗ Node.js v${NODE_VER} still below requirement. Please upgrade manually:"
84
- if [ "$(uname -s)" = "Darwin" ]; then
85
- echo " brew install node@22"
86
- else
87
- echo " curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -"
88
- echo " sudo apt-get install -y nodejs"
89
- fi
90
- exit 1
91
- fi
92
- green " ✓ Node.js v${NODE_VER} (>= v${REQUIRED_MAJOR}.${REQUIRED_MINOR} ✓)"
93
-
94
- # ── 2. Check Git ──────────────────────────────────────────────────────────
95
- if ! command -v git &>/dev/null; then
96
- red " ✗ Git not found. Install it:"
97
- echo " Debian/Ubuntu: sudo apt install git"
98
- echo " macOS: xcode-select --install"
99
- exit 1
100
- fi
101
- green " ✓ $(git --version)"
102
-
103
- # ── 3. Clone or update ────────────────────────────────────────────────────
104
- echo ""
105
- if [ -d "$DIR" ]; then
106
- dim " Directory '$DIR' already exists — pulling latest..."
107
- cd "$DIR"
108
- git pull --ff-only
109
- else
110
- dim " [1/4] Cloning Must-b..."
111
- git clone "$REPO" "$DIR"
112
- cd "$DIR"
113
- fi
114
-
115
- # ── 4. npm install (force fresh, ignore cache) ────────────────────────────
116
- dim " [2/4] Installing dependencies (--prefer-online)..."
117
- npm install --prefer-online
118
-
119
- # ── 5. .env setup ─────────────────────────────────────────────────────────
120
- dim " [3/4] Setting up environment config..."
121
- if [ ! -f .env ]; then
122
- cp .env.example .env
123
- green " ✓ .env created from .env.example"
124
- echo " Edit .env and set your OPENROUTER_API_KEY before starting."
125
- else
126
- dim " .env already exists — skipping."
127
- fi
128
-
129
- # ── 6. Global link ────────────────────────────────────────────────────────
130
- dim " [4/4] Linking global 'must-b' command..."
131
- npm link 2>/dev/null || {
132
- echo ""
133
- dim " npm link requires write permission to the global node_modules."
134
- dim " Try: sudo npm link or npm link --prefix ~/.local"
135
- }
136
-
137
- echo ""
138
- cyan " ══════════════════════════════════════════════"
139
- green " Installation complete!"
140
- echo ""
141
- dim " Run the first-time setup wizard:"
142
- echo " must-b onboard"
143
- echo ""
144
- dim " Quick reference:"
145
- echo " must-b → web UI at http://localhost:4309"
146
- echo " must-b cli → terminal chat"
147
- echo " must-b doctor → system health check"
148
- echo " must-b --version → show installed version"
149
- cyan " ══════════════════════════════════════════════"
150
- echo ""