@geminilight/mindos 0.6.36 → 0.6.38
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/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +19 -19
- package/_standalone/.next/build-manifest.json +2 -2
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +1 -1
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +3 -3
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +3 -3
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app-paths-manifest.json +19 -19
- package/_standalone/.next/server/chunks/4931.js +14 -14
- package/_standalone/.next/server/chunks/{9360.js → 8407.js} +2 -2
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/app/{layout-d0f6dc4d3e6f0be4.js → layout-aab90c2b4faf8d57.js} +11 -11
- package/_standalone/.next/static/chunks/app/{page-404b0bfb5721b7f8.js → page-9a15cf85f0962c59.js} +2 -2
- package/_standalone/.next/static/chunks/app/trash/{page-a79804c1df44d3cc.js → page-7df0139c6b0f87e0.js} +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-35811d7e49e08157.js +12 -0
- package/_standalone/.next/trace +53 -53
- package/_standalone/components/settings/UpdateTab.tsx +16 -0
- package/app/components/settings/UpdateTab.tsx +16 -0
- package/bin/cli.js +2 -2
- package/bin/lib/startup.js +1 -1
- package/package.json +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-d3aceca36a1a9eb2.js +0 -12
- /package/_standalone/.next/static/{VWZDVb8DL1Pbykh9EOj_Y → VAb8MoUUpoXjVJalRJogO}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{VWZDVb8DL1Pbykh9EOj_Y → VAb8MoUUpoXjVJalRJogO}/_ssgManifest.js +0 -0
|
@@ -22,7 +22,7 @@ Execute concisely. Provide:
|
|
|
22
22
|
|
|
23
23
|
Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.selectedAcpAgent=h);let j=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:e});if(!j.ok)throw Error(`Request failed (HTTP ${j.status})`);if(!j.body)throw Error("No response body");let k=j.body.getReader(),l=new TextDecoder,m="";for(;;){let{done:a,value:b}=await k.read();if(a)break;for(let a of l.decode(b,{stream:!0}).split("\n")){let b=a.match(/^data:(.+)$/);if(b){try{let a=JSON.parse(b[1]);if("text_delta"===a.type&&"string"==typeof a.delta)m+=a.delta,d(m);else if("thinking_delta"===a.type&&"string"==typeof a.delta)m+=a.delta,d(m);else if("error"===a.type&&a.message)throw Error(a.message)}catch{let b=a.match(/^0:"((?:[^"\\]|\\.)*)"$/);b&&d(m+=b[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"))}continue}let c=a.match(/^0:"((?:[^"\\]|\\.)*)"$/);c&&d(m+=c[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"))}}}function R(a){return a.steps.map((a,b)=>({...a,index:b,status:"pending",output:"",error:void 0}))}function S({status:a,index:b}){let c="w-[26px] h-[26px] rounded-full flex items-center justify-center shrink-0 transition-all";return"running"===a?(0,d.jsx)("div",{className:`${c} bg-[var(--amber)]/15 ring-2 ring-[var(--amber)]/30`,children:(0,d.jsx)(m.A,{size:12,className:"text-[var(--amber)] animate-spin"})}):"done"===a?(0,d.jsx)("div",{className:`${c} bg-[var(--success)]/15`,children:(0,d.jsx)(o.A,{size:13,className:"text-[var(--success)]"})}):"error"===a?(0,d.jsx)("div",{className:`${c} bg-[var(--error)]/15`,children:(0,d.jsx)(i.A,{size:13,className:"text-[var(--error)]"})}):"skipped"===a?(0,d.jsx)("div",{className:`${c} bg-muted/50`,children:(0,d.jsx)(I.A,{size:11,className:"text-muted-foreground/40"})}):(0,d.jsx)("div",{className:`${c} border-2 border-border bg-background`,children:(0,d.jsx)("span",{className:"text-[11px] font-bold text-muted-foreground/50",children:b+1})})}function T({step:a,canRun:b,onRun:c,onSkip:f,onCancel:h}){let[j,k]=(0,e.useState)(!1),l=!!(a.output||a.error),m=a.skills?.length?a.skills:a.skill?[a.skill]:[];return"running"===a.status||a.status,(0,d.jsx)("div",{className:`transition-opacity ${"skipped"===a.status?"opacity-50":""}`,children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)(S,{status:a.status,index:a.index}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,d.jsx)("span",{className:`text-sm font-medium truncate ${"done"===a.status?"text-foreground":"running"===a.status?"text-[var(--amber)]":"error"===a.status?"text-[var(--error)]":"text-foreground/70"}`,children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[null!=a.durationMs&&("done"===a.status||"error"===a.status)&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 font-mono",children:function(a){if(a<1e3)return`${a}ms`;let b=Math.round(a/1e3);return b<60?`${b}s`:`${Math.floor(b/60)}m ${b%60}s`}(a.durationMs)}),"pending"===a.status&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{onClick:c,disabled:!b,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-2xs font-medium transition-all disabled:opacity-30 bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,d.jsx)(g.A,{size:9})," Run"]}),(0,d.jsx)("button",{onClick:f,className:"px-1.5 py-0.5 rounded-md text-2xs text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted transition-colors",children:"Skip"})]}),"running"===a.status&&(0,d.jsxs)("button",{onClick:h,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-2xs text-[var(--error)]/70 hover:text-[var(--error)] hover:bg-[var(--error)]/10 transition-colors",children:[(0,d.jsx)(J.A,{size:9})," Stop"]}),l&&"running"!==a.status&&(0,d.jsx)("button",{onClick:()=>k(a=>!a),className:"p-0.5 rounded text-muted-foreground/30 hover:text-muted-foreground transition-colors",children:(0,d.jsx)(p.A,{size:12,className:`transition-transform ${j?"rotate-180":""}`})})]})]}),(a.agent||m.length>0)&&(0,d.jsxs)("div",{className:"flex gap-1 mt-0.5 flex-wrap",children:[a.agent&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50",children:a.agent}),a.agent&&m.length>0&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/20",children:"/"}),m.map(a=>(0,d.jsx)("span",{className:"text-2xs text-[var(--amber)]/60",children:a},a))]}),(j||"running"===a.status)&&l&&(0,d.jsxs)("div",{className:"mt-2 rounded-lg overflow-hidden border border-border/50",children:[a.error&&(0,d.jsxs)("div",{className:"px-3 py-2.5 bg-[var(--error)]/5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)(i.A,{size:10,className:"text-[var(--error)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-[var(--error)]",children:"Error"})]}),(0,d.jsx)("div",{className:"text-xs text-[var(--error)]/80 whitespace-pre-wrap break-words leading-relaxed",children:a.error})]}),a.output&&(0,d.jsxs)("div",{className:"px-3 py-2.5 bg-muted/20",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,d.jsx)(K.A,{size:10,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50 uppercase tracking-wider font-medium",children:"Output"}),"running"===a.status&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse"})]}),(0,d.jsx)("div",{className:"text-xs leading-relaxed text-foreground/80 whitespace-pre-wrap break-words",children:a.output})]})]})]})]})})}function U({workflow:a,filePath:b}){let[c,f]=(0,e.useState)(()=>R(a)),[g,h]=(0,e.useState)(!1),j=(0,e.useRef)(null),l=(0,e.useCallback)(()=>{j.current?.abort(),j.current=null,h(!1),f(a=>a.map(a=>"running"===a.status?{...a,status:"error",error:"Cancelled"}:a))},[]),n=(0,e.useCallback)(async c=>{if(g)return;j.current?.abort();let d=new AbortController;j.current=d,h(!0);let e=Date.now();f(a=>a.map((a,b)=>b===c?{...a,status:"running",output:"",error:void 0,startedAt:new Date}:a));try{let g={...a.steps[c],index:c,status:"running",output:""};await Q(g,a,b,a=>f(b=>b.map((b,d)=>d===c?{...b,output:a}:b)),d.signal);let h=Date.now()-e;f(a=>a.map((a,b)=>b===c?{...a,status:"done",completedAt:new Date,durationMs:h}:a))}catch(b){if(b instanceof Error&&"AbortError"===b.name)return;let a=Date.now()-e;f(d=>d.map((d,e)=>e===c?{...d,status:"error",error:b instanceof Error?b.message:String(b),durationMs:a}:d))}finally{h(!1)}},[g,a,b]),p=(0,e.useCallback)(a=>{f(b=>b.map((b,c)=>c===a?{...b,status:"skipped"}:b))},[]),q=(0,e.useCallback)(()=>{j.current?.abort(),j.current=null,h(!1),N.clear(),f(R(a))},[a]),r=c.filter(a=>"done"===a.status).length,s=c.length>0?Math.round(r/c.length*100):0,t=r===c.length&&c.length>0,u=c.findIndex(a=>"pending"===a.status),v=c.some(a=>"error"===a.status);return(0,d.jsxs)("div",{children:[(a.workDir||a.description)&&(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-4 text-xs text-muted-foreground flex-wrap",children:[a.workDir&&(0,d.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-2xs bg-muted/50 px-2 py-0.5 rounded",children:[(0,d.jsx)(k.A,{size:10,className:"shrink-0"}),a.workDir]}),a.description&&(0,d.jsx)("span",{className:"leading-relaxed",children:a.description})]}),(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("div",{className:"flex items-center gap-2",children:t?(0,d.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-[var(--success)]",children:[(0,d.jsx)(o.A,{size:13}),"Complete"]}):v?(0,d.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-[var(--error)]",children:[(0,d.jsx)(i.A,{size:13}),r,"/",c.length," done"]}):(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[r,"/",c.length]})}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[u>=0&&(0,d.jsxs)("button",{onClick:()=>n(u),disabled:g,className:"flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all disabled:opacity-40 bg-[var(--amber)] text-[var(--amber-foreground)]",children:[g?(0,d.jsx)(m.A,{size:11,className:"animate-spin"}):(0,d.jsx)(L.A,{size:11}),g?"Running...":"Run next"]}),(0,d.jsxs)("button",{onClick:q,className:"flex items-center gap-1 px-2 py-1 rounded-md text-2xs text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(M.A,{size:10}),"Reset"]})]})]}),(0,d.jsx)("div",{className:"h-1 rounded-full bg-border/50 overflow-hidden",children:(0,d.jsx)("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${t?"bg-[var(--success)]":v?"bg-[var(--error)]":"bg-[var(--amber)]"}`,style:{width:`${s}%`}})})]}),(0,d.jsxs)("div",{className:"relative",children:[c.length>1&&(0,d.jsx)("div",{className:"absolute left-[12px] top-5 bottom-5 w-px bg-border/50"}),(0,d.jsx)("div",{className:"flex flex-col gap-4",children:c.map((a,b)=>(0,d.jsx)(T,{step:a,canRun:!g,onRun:()=>n(b),onSkip:()=>p(b),onCancel:l},a.id))})]})]})}function V({filePath:a,content:b}){let c=(0,e.useMemo)(()=>(function(a){try{let b=j.Ay.load(a,{schema:j.Ay.JSON_SCHEMA});if(!b)return{workflow:null,errors:["File is empty"]};if("object"!=typeof b)return{workflow:null,errors:["Content is not valid YAML"]};let c=function(a){let b=[];if(!a||"object"!=typeof a)return{valid:!1,errors:["Must be a valid YAML object"]};if(a.title&&"string"==typeof a.title&&a.title.trim()||b.push("Missing required field 'title' (string)"),void 0!==a.description&&"string"!=typeof a.description&&b.push("'description' must be a string"),void 0!==a.skills&&(Array.isArray(a.skills)?a.skills.every(a=>"string"==typeof a)||b.push("'skills' must contain only strings"):b.push("'skills' must be an array of strings")),void 0!==a.tools&&(Array.isArray(a.tools)?a.tools.every(a=>"string"==typeof a)||b.push("'tools' must contain only strings"):b.push("'tools' must be an array of strings")),a.steps)if(Array.isArray(a.steps))if(0===a.steps.length)b.push("'steps' must have at least 1 step");else{let c=new Set;a.steps.forEach((a,d)=>{var e,f;let g,h,i=(e=a,f=d,g=[],h=`steps[${f}]`,e&&"object"==typeof e?(e.id&&"string"==typeof e.id&&e.id.trim()?/^[a-z0-9_-]+$/.test(e.id)||g.push(`${h}.id: '${e.id}' is invalid — use only lowercase letters, numbers, hyphens, underscores (e.g., 'run-tests')`):g.push(`${h}: missing required field 'id' (non-empty string)`),e.name&&"string"==typeof e.name&&e.name.trim()||g.push(`${h}: missing required field 'name' (non-empty string)`),void 0!==e.description&&"string"!=typeof e.description&&g.push(`${h}.description: must be a string`),void 0===e.agent||"string"==typeof e.agent&&e.agent.trim()||g.push(`${h}.agent: must be a non-empty string`),void 0===e.skill||"string"==typeof e.skill&&e.skill.trim()||g.push(`${h}.skill: must be a non-empty string`),void 0!==e.tools&&(Array.isArray(e.tools)?e.tools.every(a=>"string"==typeof a)||g.push(`${h}.tools: must contain only strings`):g.push(`${h}.tools: must be an array of strings`)),e.prompt&&"string"==typeof e.prompt&&e.prompt.trim()||g.push(`${h}: missing required field 'prompt' (non-empty string)`),void 0!==e.timeout&&("number"!=typeof e.timeout||e.timeout<=0)&&g.push(`${h}.timeout: must be a positive number (seconds)`)):g.push(`${h}: must be a valid object`),g);b.push(...i);let j=a?.id;"string"==typeof j&&j.trim()&&(c.has(j)&&b.push(`steps[${d}].id: duplicate id '${j}' (each step must have a unique id)`),c.add(j))})}else b.push("'steps' must be an array");else b.push("Missing required field 'steps' (array)");return{valid:0===b.length,errors:b}}(b);if(!c.valid)return{workflow:null,errors:c.errors};return{workflow:b,errors:[]}}catch(a){return{workflow:null,errors:[a instanceof Error?a.message:String(a)]}}})(b),[b]),[k,l]=(0,e.useState)("edit"),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(()=>c.workflow?structuredClone(c.workflow):{title:"",description:"",steps:[]});(0,e.useRef)(b);let q=(0,e.useMemo)(()=>c.workflow??null,[c.workflow]),r=(0,e.useCallback)(a=>{p(a),n(!0)},[]),s=(0,e.useCallback)(()=>n(!1),[]),t=q??o,u=t.steps.length>0&&!!t.title,v=c.errors.length>0,w=t.title?0===t.steps.length?"Add at least one step":m?"Save changes first":void 0:"Add a title first",x=a=>{("run"!==a||u)&&l(a)};return(0,d.jsxs)("div",{className:"max-w-[720px] mx-auto py-8 px-2",children:[(0,d.jsxs)("div",{className:"mb-8",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 p-0.5 rounded-lg bg-muted/50",children:[(0,d.jsxs)("button",{onClick:()=>x("edit"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all ${"edit"===k?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(f.A,{size:11}),"Edit"]}),(0,d.jsxs)("button",{onClick:()=>x("run"),disabled:!u,title:w,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all disabled:opacity-30 disabled:cursor-not-allowed ${"run"===k?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(g.A,{size:11}),"Run"]})]}),o.steps.length>0&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60 font-mono",children:[o.steps.length," step",1!==o.steps.length?"s":""]})]}),(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"mt-1 w-8 h-8 rounded-lg bg-[var(--amber)]/10 flex items-center justify-center shrink-0",children:(0,d.jsx)(h.A,{size:16,className:"text-[var(--amber)]"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("h1",{className:"text-lg font-semibold text-foreground truncate leading-tight",children:[o.title||"Untitled Flow",m&&(0,d.jsx)("span",{className:"text-[var(--amber)] ml-1.5 text-sm",title:"Unsaved changes",children:"*"})]}),o.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:o.description})]})]})]}),v&&"edit"===k&&(0,d.jsxs)("div",{className:"mb-5 px-3.5 py-3 rounded-lg bg-[var(--error)]/8 border border-[var(--error)]/20",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,d.jsx)(i.A,{size:13,className:"text-[var(--error)] shrink-0"}),(0,d.jsx)("span",{className:"text-xs font-medium text-[var(--error)]",children:"Parse issues found"})]}),(0,d.jsx)("ul",{className:"text-2xs text-[var(--error)]/70 pl-5 list-disc space-y-0.5",children:c.errors.slice(0,3).map((a,b)=>(0,d.jsx)("li",{children:a},b))})]}),"edit"===k?(0,d.jsx)(H,{workflow:o,filePath:a,onChange:r,onSaved:s}):(0,d.jsx)(U,{workflow:t,filePath:a})]})}},2887:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(41023),g=c(46674),h=c(40560),i=c(8455),j=c(49681),k=c(77505);function l({open:a,onClose:b,onDiscover:c,discovering:l,error:m}){let{t:n}=(0,k.Y)(),o=n.panels.agents,[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(null);if(!a)return null;let t=async()=>{if(!p.trim()||l)return;s(null);let a=await c(p.trim());a&&s(a)},u=()=>{q(""),s(null),b()};return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:u,children:(0,d.jsxs)("div",{className:"bg-popover border border-border rounded-xl shadow-lg w-full max-w-md mx-4 p-5",onClick:a=>a.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":o.a2aDiscover,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,d.jsx)(f.A,{size:15,className:"text-muted-foreground"}),o.a2aDiscover]}),(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,d.jsx)(g.A,{size:14})})]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground mb-3",children:o.a2aDiscoverHint}),(0,d.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,d.jsx)("input",{type:"url",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&t(),"Escape"===a.key&&b()},placeholder:o.a2aDiscoverPlaceholder,disabled:l,className:"flex-1 px-3 py-2 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",autoFocus:!0}),(0,d.jsxs)("button",{type:"button",onClick:t,disabled:l||!p.trim(),className:"px-3 py-2 text-xs font-medium rounded-lg bg-foreground text-background hover:bg-foreground/90 disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-1.5 shrink-0",children:[l&&(0,d.jsx)(h.A,{size:12,className:"animate-spin"}),l?o.a2aDiscovering:o.a2aDiscover]})]}),m&&!r&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/5 px-3 py-2.5 mb-3",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(i.A,{size:14,className:"text-error mt-0.5 shrink-0"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-error",children:o.a2aDiscoverFailed}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground mt-0.5",children:o.a2aDiscoverFailedHint})]})]})}),r&&(0,d.jsx)("div",{className:"rounded-lg border border-success/30 bg-success/5 px-3 py-2.5",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(j.A,{size:14,className:"text-success mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-success mb-1.5",children:o.a2aDiscoverSuccess}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)("p",{className:"text-xs font-medium text-foreground truncate",title:r.card.name,children:[r.card.name,(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground ml-1.5",children:["v",r.card.version]})]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground truncate",title:r.card.description,children:r.card.description}),r.card.skills.length>0&&(0,d.jsxs)("div",{className:"mt-1.5",children:[(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground mb-1",children:[o.a2aSkills,":"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1",children:r.card.skills.map(a=>(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted/80 text-muted-foreground border border-border/50",title:a.description,children:a.name},a.id))})]}),(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground mt-1 truncate",title:r.endpoint,children:[o.a2aEndpoint,": ",r.endpoint]})]})]})]})})]})})}},4299:(a,b,c)=>{"use strict";c.d(b,{m:()=>e});let d=new Set(["write_file","create_file","batch_create_files","update_section","insert_after_heading","delete_file","rename_file","create_space"]);async function e(a,b,c){let e=a.getReader(),f=new TextDecoder,g="",h=[],i=new Map,j=null,k=null,l=Date.now();function m(){let a=h.map(a=>"text"===a.type?{type:"text",text:a.text}:"reasoning"===a.type?{type:"reasoning",text:a.text}:{...a});return{role:"assistant",content:a.filter(a=>"text"===a.type).map(a=>a.text).join(""),parts:a,timestamp:l}}try{for(;!c?.aborted;){let{done:a,value:c}=await e.read();if(a)break;let l=(g+=f.decode(c,{stream:!0})).split("\n");g=l.pop()??"";let n=!1;for(let a of l){let b,c=a.trim(),e=null;if(c.startsWith("data:")&&(e=c.slice(5).trim()),e){try{b=JSON.parse(e)}catch{continue}switch(b.type){case"text_delta":{let a=function(a){if(j===a){let a=h[h.length-1];if(a&&"text"===a.type)return a}let b={type:"text",text:""};return h.push(b),j=a,b}("text");a.text+=b.delta??"",n=!0;break}case"thinking_delta":k||(k={type:"reasoning",text:""},h.push(k),j=null),k.text+=b.delta??"",n=!0;break;case"tool_start":{let a=b.toolCallId,c=b.toolName,d=function(a,b){let c=i.get(a);return c||(c={type:"tool-call",toolCallId:a,toolName:b??"unknown",input:void 0,state:"pending"},i.set(a,c),h.push(c),j=null),c}(a,c);d.input=b.args,d.state="running",n=!0;break}case"tool_end":{let a=b.toolCallId,c=i.get(a);c&&(c.output=b.output??"",c.state=b.isError?"error":"done",n=!0,b.isError||d.has(c.toolName));break}case"error":{let a=b.message;h.push({type:"text",text:`
|
|
24
24
|
|
|
25
|
-
**Stream Error:** ${a}`}),j=null,n=!0}}}}n&&b(m())}}finally{e.releaseLock()}let n=!1;for(let a of i.values())("running"===a.state||"pending"===a.state)&&(a.state="error",a.output=a.output??"Stream ended before tool completed",n=!0);return n&&b(m()),m()}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx","default")},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},7610:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("4073229f21cf2b7673e9bd62939e2e2a92ee4c1d61",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["about-you","continued","daily","past-you","growth"],e={"about-you":"/echo/about-you",continued:"/echo/continued",daily:"/echo/daily","past-you":"/echo/past-you",growth:"/echo/growth"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx","default")},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-[9999] overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-[9999] overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},27852:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>j,cd:()=>i,kr:()=>h});var d=c(48249),e=c(67484),f=c(95054);let g=(0,e.createContext)(null);function h(){let a=(0,e.useContext)(g);if(!a)throw Error("useMcpData must be used within McpProvider");return a}function i(){return(0,e.useContext)(g)}function j({children:a}){let[b,c]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)([]),[l,m]=(0,e.useState)(!0),n=(0,e.useRef)(null),o=(0,e.useRef)(h);o.current=h;let p=(0,e.useCallback)(async()=>{n.current?.abort();let a=new AbortController;n.current=a;try{let[b,d,e]=await Promise.all([(0,f.n)("/api/mcp/status",{signal:a.signal}),(0,f.n)("/api/mcp/agents",{signal:a.signal}),(0,f.n)("/api/skills",{signal:a.signal})]);a.signal.aborted||(c(b),i(d.agents),k(e.skills))}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{a.signal.aborted||m(!1)}},[]),q=(0,e.useCallback)(async()=>{await p()},[p]),r=(0,e.useCallback)(async(a,b)=>{k(c=>c.map(c=>c.name===a?{...c,enabled:b}:c));try{return await (0,f.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:a,enabled:b})}),!0}catch{return k(c=>c.map(c=>c.name===a?{...c,enabled:!b}:c)),!1}},[]),s=(0,e.useCallback)(async(a,b)=>{let c=o.current.find(b=>b.key===a);if(!c)return!1;try{let d=await (0,f.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:a,scope:b?.scope??(c.hasProjectScope?"project":"global"),transport:b?.transport??c.preferredTransport}],transport:"auto"})}),e=d.results?.[0],g=e?.ok===!0||e?.status==="ok";return g&&await p(),g}catch{return!1}},[p]),t=(0,e.useMemo)(()=>({status:b,agents:h,skills:j,loading:l,refresh:q,toggleSkill:r,installAgent:s}),[b,h,j,l,q,r,s]);return(0,d.jsx)(g.Provider,{value:t,children:a})}},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33378:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>v});var d=c(48249),e=c(67484),f=c(24520),g=c(44643),h=c(44218),i=c(19794),j=c(99941),k=c(59347);let l=/^#{1,6}\s+(.+)/,m=/^(\s*)- \[([ xX])\]\s+(.*)$/;function n(a,b){let c=[...a];return b(c),c.join("\n")}let o={TODAY:{dot:"bg-red-400",label:"text-red-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};function p(a){return a.reduce((a,b)=>a+ +!!b.checked+p(b.children),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r({text:a,checked:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function s({onAdd:a}){let[b,c]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&a(b),i(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(g.A,{size:15})}),(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:a=>{"Enter"===a.key&&k(),"Escape"===a.key&&(i(""),c(!1))},placeholder:"New item…",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(f.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function t({item:a,depth:b,onToggle:c,onRename:f,onDelete:l}){let[m,n]=(0,e.useState)(!0),o=a.children.length>0;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${a.checked?"opacity-50":""}`,style:{paddingLeft:`${8+20*b}px`},children:[o?(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:m?(0,d.jsx)(h.A,{size:13}):(0,d.jsx)(i.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("button",{onClick:()=>c(a.lineIndex,!a.checked),className:"shrink-0 transition-colors",style:{color:a.checked?"var(--amber)":"var(--muted-foreground)"},children:a.checked?(0,d.jsx)(j.A,{size:15}):(0,d.jsx)(g.A,{size:15})}),(0,d.jsx)(r,{text:a.text,checked:a.checked,onRename:b=>f(a.lineIndex,b)}),(0,d.jsx)("button",{onClick:()=>l(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(k.A,{size:12})})]}),o&&m&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(t,{item:a,depth:b+1,onToggle:c,onRename:f,onDelete:l},a.id))})]})}function u({name:a,meta:b,onToggle:c,onRename:f,onDelete:g,onAdd:j}){let k,[l,m]=(0,e.useState)(!1),n=(k=Object.keys(o).find(b=>a.includes(b)))?o[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:r,lastLineIndex:u}=b,v=p(r),w=q(r);return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[v,"/",w]})]}),l?(0,d.jsx)(i.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(h.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:w?`${v/w*100}%`:"0%",background:"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[r.map(a=>(0,d.jsx)(t,{item:a,depth:0,onToggle:c,onRename:f,onDelete:g},a.id)),0===r.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),(0,d.jsx)(s,{onAdd:a=>j(u,a)})]})]})}function v({content:a,saveAction:b}){let[c,f]=(0,e.useState)(a),{sections:g,lines:h}=(0,e.useMemo)(()=>{let a,b,d,e;return a=c.split("\n"),b="General",d={},e=[],a.forEach((a,c)=>{let f=a.match(l);if(f){b=f[1].replace(/^[^\w\s]+\s*/,"").trim();return}let g=a.match(m);if(!g)return;let[,h,i,j]=g,k=Math.floor(h.length/2),n="x"===i.toLowerCase(),o={id:`${c}`,text:j.replace(/\*\*(.*?)\*\*/g,"$1").trim(),checked:n,indent:k,lineIndex:c,section:b,children:[]};for(;e.length>0&&e[e.length-1].indent>=k;)e.pop();d[b]||(d[b]={items:[],lastLineIndex:-1}),e.length>0?e[e.length-1].children.push(o):d[b].items.push(o),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),e.push(o)}),{sections:d,lines:a}},[c]),i=(0,e.useMemo)(()=>Object.values(g).reduce((a,b)=>a+p(b.items),0),[g]),j=(0,e.useMemo)(()=>Object.values(g).reduce((a,b)=>a+q(b.items),0),[g]),k=(0,e.useCallback)(async a=>{f(a),await b(a)},[b]),o=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{c[a]=b?c[a].replace(/- \[ \]/,"- [x]"):c[a].replace(/- \[[xX]\]/,"- [ ]")}))},[h,k]),r=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{c[a]=c[a].replace(/(- \[[ xX]\]\s*)(.*)$/,`$1${b}`)}))},[h,k]),s=(0,e.useCallback)(async a=>{await k(n(h,b=>{b.splice(a,1)}))},[h,k]),t=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[h,k]),v=Object.entries(g);return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsxs)("p",{className:"text-xs text-muted-foreground font-display",children:[i," / ",j," completed"]}),(0,d.jsx)("div",{className:"mt-1.5 w-48 h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:j?`${i/j*100}%`:"0%",background:"var(--amber)"}})})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[v.map(([a,b])=>(0,d.jsx)(u,{name:a,meta:b,onToggle:o,onRename:r,onDelete:s,onAdd:t},a)),0===v.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},39868:(a,b,c)=>{"use strict";async function d(a){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(a),!0}catch{}try{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();let c=document.execCommand("copy");return document.body.removeChild(b),c}catch{return!1}}c.d(b,{l:()=>d})},41527:(a,b,c)=>{"use strict";c.d(b,{LocaleProvider:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LocaleProvider() from the server but LocaleProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/LocaleContext.tsx","LocaleProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useLocale() from the server but useLocale is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/LocaleContext.tsx","useLocale")},45862:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call SummaryRenderer() from the server but SummaryRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/summary/SummaryRenderer.tsx","SummaryRenderer")},46376:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23)),Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},46427:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>D});var d=c(48249),e=c(67484),f=c.n(e),g=c(93053),h=c(75155),i=c(22242),j=c(91282),k=c(65732),l=c.n(k);function m(a,b){return l().unparse([a,...b])}let n=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"},{bg:"rgba(200,96,96,0.12)",text:"#c86060"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function o(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return n[b%n.length]}var p=c(82884),q=c(72419),r=c(44218),s=c(59347),t=c(24520);function u({value:a,onCommit:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(a),i=(0,e.useRef)(null);function j(){f(!1),g!==a?b(g):h(a)}return c?(0,d.jsx)("input",{ref:i,value:g,onChange:a=>h(a.target.value),onBlur:j,onKeyDown:b=>{"Enter"===b.key&&j(),"Escape"===b.key&&(h(a),f(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:a=>a.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,d.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>f(!0),title:a,children:a||(0,d.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function v({headers:a,visibleIndices:b,onAdd:c,onCancel:f}){let[g,h]=(0,e.useState)(()=>Array(a.length).fill(""));return(0,d.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[b.map((b,e)=>(0,d.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("input",{autoFocus:0===e,value:g[b],onChange:a=>{var c;return c=a.target.value,void h(a=>{let d=[...a];return d[b]=c,d})},onKeyDown:a=>{"Enter"===a.key&&c(g),"Escape"===a.key&&f()},placeholder:a[b],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},b)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function w({headers:a,rows:b,cfg:c,saveAction:g}){let[h,i]=(0,e.useState)(b),[j,k]=(0,e.useState)(!1),l=(0,e.useMemo)(()=>a.map((a,b)=>b).filter(b=>!c.hiddenFields.includes(a[b])),[a,c.hiddenFields]),n=a.indexOf(c.sortField),o=(0,e.useMemo)(()=>{let a=[...h];return n>=0&&a.sort((a,b)=>{let d=a[n]??"",e=b[n]??"",f=parseFloat(d),g=parseFloat(e),h=isNaN(f)||isNaN(g)?d.localeCompare(e):f-g;return"asc"===c.sortDir?h:-h}),a},[h,n,c.sortDir]),p=a.indexOf(c.groupField),w=(0,e.useMemo)(()=>{if(p<0)return[{key:null,rows:o.map(a=>({row:a,orig:a}))}];let a=new Map;for(let b of o){let c=b[p]||"(empty)";a.has(c)||a.set(c,[]),a.get(c).push(b)}return[...a.entries()].map(([a,b])=>({key:a,rows:b.map(a=>({row:a,orig:a}))}))},[o,p]);async function x(b,c,d){let e=h.map(a=>a===b?a.map((a,b)=>b===c?d:a):a);i(e),await g(m(a,e))}async function y(b){let c=h.filter(a=>a!==b);i(c),await g(m(a,c))}async function z(b){let c=[...h,b];i(c),k(!1),await g(m(a,c))}let A={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},B=0;return(0,d.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{background:"var(--muted)"},children:[l.map(b=>(0,d.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:A,children:(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[a[b],c.sortField===a[b]&&("asc"===c.sortDir?(0,d.jsx)(q.A,{size:10,style:{color:"var(--amber)"}}):(0,d.jsx)(r.A,{size:10,style:{color:"var(--amber)"}}))]})},b)),(0,d.jsx)("th",{className:"w-8",style:{...A,background:"var(--muted)"}})]})}),(0,d.jsxs)("tbody",{children:[w.map((a,b)=>(0,d.jsxs)(f().Fragment,{children:[null!==a.key&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:l.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,d.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[a.key," \xb7 ",a.rows.length]})})},`grp-${a.key}`),a.rows.map(({row:a,orig:b})=>{let c=B++;return(0,d.jsxs)("tr",{className:"group transition-colors",style:{background:c%2==0?"var(--background)":"var(--card)"},onMouseEnter:a=>a.currentTarget.style.background="var(--muted)",onMouseLeave:a=>a.currentTarget.style.background=c%2==0?"var(--background)":"var(--card)",children:[l.map(c=>(0,d.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)(u,{value:a[c]??"",onCommit:a=>x(b,c,a)})},c)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("button",{onClick:()=>y(b),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(s.A,{size:12})})})]},c)})]},a.key??`section-${b}`)),j&&(0,d.jsx)(v,{headers:a,visibleIndices:l,onAdd:z,onCancel:()=>k(!1)})]})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[h.length," rows \xb7 ",a.length," cols"]}),j?(0,d.jsx)("button",{onClick:()=>k(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,d.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,d.jsx)(t.A,{size:12})," Add row"]})]})]})}function x({headers:a,rows:b,cfg:c}){let e=a.indexOf(c.titleField),f=a.indexOf(c.descField),g=a.indexOf(c.tagField);return(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map((b,c)=>{let h=e>=0?b[e]:b[0]??"",i=f>=0?b[f]:"",j=g>=0?b[g]:"",k=j?o(j):null;return(0,d.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[j&&k&&(0,d.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:k.bg,color:k.text},children:j}),(0,d.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:h}),i&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:i}),(0,d.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:a.map((a,c)=>{if(c===e||c===f||c===g)return null;let h=b[c];return h?(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:a}),(0,d.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:h})]},c):null})})]},c)})})}function y({headers:a,rows:b,cfg:c,saveAction:f}){let[g,h]=(0,e.useState)(b),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(!1),q=a.indexOf(c.groupField),r=a.indexOf(c.titleField),s=a.indexOf(c.descField),{groups:u,groupKeys:v}=(0,e.useMemo)(()=>{let a=new Map;return g.forEach((b,c)=>{let d=(q>=0?b[q]:"")||"(empty)";a.has(d)||a.set(d,[]),a.get(d).push({row:b,origIdx:c})}),{groups:a,groupKeys:[...a.keys()]}},[g,q]);async function w(b,c){let d=g.map((a,d)=>{if(d!==b)return a;let e=[...a];return q>=0&&(e[q]=c),e});h(d),await f(m(a,d))}function x({group:b}){let c=u.get(b)??[],e=o(b),f=i===b;return(0,d.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:e.text}}),(0,d.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:e.text},children:b}),(0,d.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:c.length})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:f?"var(--amber-dim)":"var(--muted)",border:`1px solid ${f?"var(--amber)":"transparent"}`},onDragOver:a=>{a.preventDefault(),j(b)},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||j(null)},onDrop:a=>{j(null);let c=parseInt(a.dataTransfer.getData("origIdx"));isNaN(c)||w(c,b)},children:[c.map(({row:b,origIdx:c})=>{let e=r>=0?b[r]:b[0]??"",f=s>=0?b[s]:"";return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.setData("origIdx",String(c)),j(null)},onDragEnd:()=>j(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:e}),f&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:f}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:a.map((a,c)=>{if(c===q||c===r||c===s)return null;let e=b[c];return e?(0,d.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[a,": ",e]},c):null})})]},c)}),0===c.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,d.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[v.map(a=>(0,d.jsx)(x,{group:a},a)),(0,d.jsx)("div",{className:"flex-shrink-0 w-64",children:n?(0,d.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("input",{autoFocus:!0,value:k,onChange:a=>l(a.target.value),onKeyDown:a=>{"Enter"===a.key&&k.trim()&&(l(""),p(!1)),"Escape"===a.key&&(l(""),p(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,d.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,d.jsx)(t.A,{size:12})," Add column"]})})]})}var z=c(46674),A=c(27608);function B({headers:a,cfg:b,view:c,onClose:e,onChange:f}){let g={color:"var(--muted-foreground)",fontSize:"0.72rem"};function h({label:b,value:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-display",style:g,children:b}),(0,d.jsx)(A.A,{value:c,onChange:e,size:"sm",options:[{value:"",label:"— none —"},...a.map(a=>({value:a,label:a}))]})]})}return(0,d.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:[c," settings"]}),(0,d.jsx)("button",{onClick:e,style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(z.A,{size:13})})]}),"table"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Sort"}),(0,d.jsx)(h,{label:"Sort by",value:b.table.sortField,onChange:a=>f({...b,table:{...b.table,sortField:a}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{style:g,children:"Direction"}),(0,d.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(a=>(0,d.jsx)("button",{onClick:()=>f({...b,table:{...b.table,sortDir:a}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:b.table.sortDir===a?"var(--amber)":"var(--background)",color:b.table.sortDir===a?"var(--amber-foreground)":"var(--muted-foreground)"},children:a},a))})]}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Group"}),(0,d.jsx)(h,{label:"Group by",value:b.table.groupField,onChange:a=>f({...b,table:{...b.table,groupField:a}})}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Columns"}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(a=>{let c=b.table.hiddenFields.includes(a);return(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{style:g,children:a}),(0,d.jsx)("button",{onClick:()=>{let d=c?b.table.hiddenFields.filter(b=>b!==a):[...b.table.hiddenFields,a];f({...b,table:{...b.table,hiddenFields:d}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:c?"var(--muted)":"var(--amber-dim)",color:c?"var(--muted-foreground)":"var(--amber)"},children:c?"Hidden":"Visible"})]},a)})})]}),"gallery"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Title",value:b.gallery.titleField,onChange:a=>f({...b,gallery:{...b.gallery,titleField:a}})}),(0,d.jsx)(h,{label:"Description",value:b.gallery.descField,onChange:a=>f({...b,gallery:{...b.gallery,descField:a}})}),(0,d.jsx)(h,{label:"Tag / Badge",value:b.gallery.tagField,onChange:a=>f({...b,gallery:{...b.gallery,tagField:a}})})]}),"board"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Group by",value:b.board.groupField,onChange:a=>f({...b,board:{...b.board,groupField:a}})}),(0,d.jsx)(h,{label:"Card title",value:b.board.titleField,onChange:a=>f({...b,board:{...b.board,titleField:a}})}),(0,d.jsx)(h,{label:"Card desc",value:b.board.descField,onChange:a=>f({...b,board:{...b.board,descField:a}})})]})]})}let C=[{id:"table",icon:(0,d.jsx)(g.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,d.jsx)(h.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,d.jsx)(i.A,{size:13}),label:"Board"}];function D({filePath:a,content:b,saveAction:c}){let{headers:f,rows:g}=(0,e.useMemo)(()=>{let a;return{headers:(a=l().parse(b,{skipEmptyLines:!0}).data)[0]??[],rows:a.slice(1)}},[b]),h=(0,e.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:f[0]??"",descField:f[1]??"",tagField:f[2]??""},board:{groupField:f[f.length-1]??"",titleField:f[0]??"",descField:f[1]??""}}),[f]),[i,k]=(0,p.Un)("csv",a,h),[m,n]=(0,e.useState)(!1),o=(0,e.useCallback)(a=>{k(a)},[k]),q=i.activeView;return(0,d.jsxs)("div",{className:"max-w-[1100px] mx-auto px-0 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,d.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:C.map(a=>(0,d.jsxs)("button",{onClick:()=>o({...i,activeView:a.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:q===a.id?"var(--card)":"transparent",color:q===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:q===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[a.icon,a.label]},a.id))}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[g.length," rows"]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,d.jsx)(j.A,{size:13})}),m&&(0,d.jsx)(B,{headers:f,cfg:i,view:q,onClose:()=>n(!1),onChange:o})]})]}),"table"===q&&(0,d.jsx)(w,{headers:f,rows:g,cfg:i.table,saveAction:c}),"gallery"===q&&(0,d.jsx)(x,{headers:f,rows:g,cfg:i.gallery}),"board"===q&&(0,d.jsx)(y,{headers:f,rows:g,cfg:i.board,saveAction:c})]})}},47038:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(99829);let e=(0,d.createServerReference)("00b827eab44f7ab7cb36667578f653c98c3eeeba57",d.callServer,void 0,d.findSourceMapURL,"scanExampleFilesAction")},49692:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23))},51488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>m});var d=c(48249),e=c(67484),f=c(69924),g=c(6079),h=c(80600),i=c(13576),j=c(33191);function k(a){let b=Date.now()-a,c=Math.floor(b/6e4),d=Math.floor(b/36e5),e=Math.floor(b/864e5);return c<1?"just now":c<60?`${c}m ago`:d<24?`${d}h ago`:`${e}d ago`}function l(a){return a.split("/").pop()?.replace(/\.(md|csv)$/,"")??a}function m({filePath:a}){let[b,c]=(0,e.useState)([]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null);async function v(){if(0===b.length)return;u.current?.abort();let a=new AbortController;u.current=a,n(""),r(""),p(!0),t(!1);let c=b.map(a=>a.path),d=b.map(a=>`- **${l(a.path)}** (${a.path}, modified ${k(a.mtime)})`).join("\n"),e=`You are summarizing recent changes in a personal knowledge base (MindOS).
|
|
25
|
+
**Stream Error:** ${a}`}),j=null,n=!0}}}}n&&b(m())}}finally{e.releaseLock()}let n=!1;for(let a of i.values())("running"===a.state||"pending"===a.state)&&(a.state="error",a.output=a.output??"Stream ended before tool completed",n=!0);return n&&b(m()),m()}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx","default")},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},9760:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(99829);let e=(0,d.createServerReference)("00300006bff96f57367ef928515794663cdbfcbb98",d.callServer,void 0,d.findSourceMapURL,"scanExampleFilesAction")},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["about-you","continued","daily","past-you","growth"],e={"about-you":"/echo/about-you",continued:"/echo/continued",daily:"/echo/daily","past-you":"/echo/past-you",growth:"/echo/growth"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx","default")},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-[9999] overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-[9999] overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},27852:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>j,cd:()=>i,kr:()=>h});var d=c(48249),e=c(67484),f=c(95054);let g=(0,e.createContext)(null);function h(){let a=(0,e.useContext)(g);if(!a)throw Error("useMcpData must be used within McpProvider");return a}function i(){return(0,e.useContext)(g)}function j({children:a}){let[b,c]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)([]),[l,m]=(0,e.useState)(!0),n=(0,e.useRef)(null),o=(0,e.useRef)(h);o.current=h;let p=(0,e.useCallback)(async()=>{n.current?.abort();let a=new AbortController;n.current=a;try{let[b,d,e]=await Promise.all([(0,f.n)("/api/mcp/status",{signal:a.signal}),(0,f.n)("/api/mcp/agents",{signal:a.signal}),(0,f.n)("/api/skills",{signal:a.signal})]);a.signal.aborted||(c(b),i(d.agents),k(e.skills))}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{a.signal.aborted||m(!1)}},[]),q=(0,e.useCallback)(async()=>{await p()},[p]),r=(0,e.useCallback)(async(a,b)=>{k(c=>c.map(c=>c.name===a?{...c,enabled:b}:c));try{return await (0,f.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:a,enabled:b})}),!0}catch{return k(c=>c.map(c=>c.name===a?{...c,enabled:!b}:c)),!1}},[]),s=(0,e.useCallback)(async(a,b)=>{let c=o.current.find(b=>b.key===a);if(!c)return!1;try{let d=await (0,f.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:a,scope:b?.scope??(c.hasProjectScope?"project":"global"),transport:b?.transport??c.preferredTransport}],transport:"auto"})}),e=d.results?.[0],g=e?.ok===!0||e?.status==="ok";return g&&await p(),g}catch{return!1}},[p]),t=(0,e.useMemo)(()=>({status:b,agents:h,skills:j,loading:l,refresh:q,toggleSkill:r,installAgent:s}),[b,h,j,l,q,r,s]);return(0,d.jsx)(g.Provider,{value:t,children:a})}},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33378:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>v});var d=c(48249),e=c(67484),f=c(24520),g=c(44643),h=c(44218),i=c(19794),j=c(99941),k=c(59347);let l=/^#{1,6}\s+(.+)/,m=/^(\s*)- \[([ xX])\]\s+(.*)$/;function n(a,b){let c=[...a];return b(c),c.join("\n")}let o={TODAY:{dot:"bg-red-400",label:"text-red-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};function p(a){return a.reduce((a,b)=>a+ +!!b.checked+p(b.children),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r({text:a,checked:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function s({onAdd:a}){let[b,c]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&a(b),i(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(g.A,{size:15})}),(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:a=>{"Enter"===a.key&&k(),"Escape"===a.key&&(i(""),c(!1))},placeholder:"New item…",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(f.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function t({item:a,depth:b,onToggle:c,onRename:f,onDelete:l}){let[m,n]=(0,e.useState)(!0),o=a.children.length>0;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${a.checked?"opacity-50":""}`,style:{paddingLeft:`${8+20*b}px`},children:[o?(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:m?(0,d.jsx)(h.A,{size:13}):(0,d.jsx)(i.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("button",{onClick:()=>c(a.lineIndex,!a.checked),className:"shrink-0 transition-colors",style:{color:a.checked?"var(--amber)":"var(--muted-foreground)"},children:a.checked?(0,d.jsx)(j.A,{size:15}):(0,d.jsx)(g.A,{size:15})}),(0,d.jsx)(r,{text:a.text,checked:a.checked,onRename:b=>f(a.lineIndex,b)}),(0,d.jsx)("button",{onClick:()=>l(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(k.A,{size:12})})]}),o&&m&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(t,{item:a,depth:b+1,onToggle:c,onRename:f,onDelete:l},a.id))})]})}function u({name:a,meta:b,onToggle:c,onRename:f,onDelete:g,onAdd:j}){let k,[l,m]=(0,e.useState)(!1),n=(k=Object.keys(o).find(b=>a.includes(b)))?o[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:r,lastLineIndex:u}=b,v=p(r),w=q(r);return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[v,"/",w]})]}),l?(0,d.jsx)(i.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(h.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:w?`${v/w*100}%`:"0%",background:"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[r.map(a=>(0,d.jsx)(t,{item:a,depth:0,onToggle:c,onRename:f,onDelete:g},a.id)),0===r.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),(0,d.jsx)(s,{onAdd:a=>j(u,a)})]})]})}function v({content:a,saveAction:b}){let[c,f]=(0,e.useState)(a),{sections:g,lines:h}=(0,e.useMemo)(()=>{let a,b,d,e;return a=c.split("\n"),b="General",d={},e=[],a.forEach((a,c)=>{let f=a.match(l);if(f){b=f[1].replace(/^[^\w\s]+\s*/,"").trim();return}let g=a.match(m);if(!g)return;let[,h,i,j]=g,k=Math.floor(h.length/2),n="x"===i.toLowerCase(),o={id:`${c}`,text:j.replace(/\*\*(.*?)\*\*/g,"$1").trim(),checked:n,indent:k,lineIndex:c,section:b,children:[]};for(;e.length>0&&e[e.length-1].indent>=k;)e.pop();d[b]||(d[b]={items:[],lastLineIndex:-1}),e.length>0?e[e.length-1].children.push(o):d[b].items.push(o),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),e.push(o)}),{sections:d,lines:a}},[c]),i=(0,e.useMemo)(()=>Object.values(g).reduce((a,b)=>a+p(b.items),0),[g]),j=(0,e.useMemo)(()=>Object.values(g).reduce((a,b)=>a+q(b.items),0),[g]),k=(0,e.useCallback)(async a=>{f(a),await b(a)},[b]),o=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{c[a]=b?c[a].replace(/- \[ \]/,"- [x]"):c[a].replace(/- \[[xX]\]/,"- [ ]")}))},[h,k]),r=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{c[a]=c[a].replace(/(- \[[ xX]\]\s*)(.*)$/,`$1${b}`)}))},[h,k]),s=(0,e.useCallback)(async a=>{await k(n(h,b=>{b.splice(a,1)}))},[h,k]),t=(0,e.useCallback)(async(a,b)=>{await k(n(h,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[h,k]),v=Object.entries(g);return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsxs)("p",{className:"text-xs text-muted-foreground font-display",children:[i," / ",j," completed"]}),(0,d.jsx)("div",{className:"mt-1.5 w-48 h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:j?`${i/j*100}%`:"0%",background:"var(--amber)"}})})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[v.map(([a,b])=>(0,d.jsx)(u,{name:a,meta:b,onToggle:o,onRename:r,onDelete:s,onAdd:t},a)),0===v.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},39868:(a,b,c)=>{"use strict";async function d(a){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(a),!0}catch{}try{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();let c=document.execCommand("copy");return document.body.removeChild(b),c}catch{return!1}}c.d(b,{l:()=>d})},41527:(a,b,c)=>{"use strict";c.d(b,{LocaleProvider:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LocaleProvider() from the server but LocaleProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/LocaleContext.tsx","LocaleProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useLocale() from the server but useLocale is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/LocaleContext.tsx","useLocale")},41990:(a,b,c)=>{"use strict";c.d(b,{E:()=>e});var d=c(99829);let e=(0,d.createServerReference)("00d77f32c0c685fa362daee699699035f0d6adb9da",d.callServer,void 0,d.findSourceMapURL,"cleanupExamplesAction")},45862:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call SummaryRenderer() from the server but SummaryRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/summary/SummaryRenderer.tsx","SummaryRenderer")},46154:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("40576bff32adb1f4319678b659fd2630799cabc7f1",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},46376:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23)),Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},46427:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>D});var d=c(48249),e=c(67484),f=c.n(e),g=c(93053),h=c(75155),i=c(22242),j=c(91282),k=c(65732),l=c.n(k);function m(a,b){return l().unparse([a,...b])}let n=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"},{bg:"rgba(200,96,96,0.12)",text:"#c86060"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function o(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return n[b%n.length]}var p=c(82884),q=c(72419),r=c(44218),s=c(59347),t=c(24520);function u({value:a,onCommit:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(a),i=(0,e.useRef)(null);function j(){f(!1),g!==a?b(g):h(a)}return c?(0,d.jsx)("input",{ref:i,value:g,onChange:a=>h(a.target.value),onBlur:j,onKeyDown:b=>{"Enter"===b.key&&j(),"Escape"===b.key&&(h(a),f(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:a=>a.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,d.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>f(!0),title:a,children:a||(0,d.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function v({headers:a,visibleIndices:b,onAdd:c,onCancel:f}){let[g,h]=(0,e.useState)(()=>Array(a.length).fill(""));return(0,d.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[b.map((b,e)=>(0,d.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("input",{autoFocus:0===e,value:g[b],onChange:a=>{var c;return c=a.target.value,void h(a=>{let d=[...a];return d[b]=c,d})},onKeyDown:a=>{"Enter"===a.key&&c(g),"Escape"===a.key&&f()},placeholder:a[b],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},b)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function w({headers:a,rows:b,cfg:c,saveAction:g}){let[h,i]=(0,e.useState)(b),[j,k]=(0,e.useState)(!1),l=(0,e.useMemo)(()=>a.map((a,b)=>b).filter(b=>!c.hiddenFields.includes(a[b])),[a,c.hiddenFields]),n=a.indexOf(c.sortField),o=(0,e.useMemo)(()=>{let a=[...h];return n>=0&&a.sort((a,b)=>{let d=a[n]??"",e=b[n]??"",f=parseFloat(d),g=parseFloat(e),h=isNaN(f)||isNaN(g)?d.localeCompare(e):f-g;return"asc"===c.sortDir?h:-h}),a},[h,n,c.sortDir]),p=a.indexOf(c.groupField),w=(0,e.useMemo)(()=>{if(p<0)return[{key:null,rows:o.map(a=>({row:a,orig:a}))}];let a=new Map;for(let b of o){let c=b[p]||"(empty)";a.has(c)||a.set(c,[]),a.get(c).push(b)}return[...a.entries()].map(([a,b])=>({key:a,rows:b.map(a=>({row:a,orig:a}))}))},[o,p]);async function x(b,c,d){let e=h.map(a=>a===b?a.map((a,b)=>b===c?d:a):a);i(e),await g(m(a,e))}async function y(b){let c=h.filter(a=>a!==b);i(c),await g(m(a,c))}async function z(b){let c=[...h,b];i(c),k(!1),await g(m(a,c))}let A={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},B=0;return(0,d.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{background:"var(--muted)"},children:[l.map(b=>(0,d.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:A,children:(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[a[b],c.sortField===a[b]&&("asc"===c.sortDir?(0,d.jsx)(q.A,{size:10,style:{color:"var(--amber)"}}):(0,d.jsx)(r.A,{size:10,style:{color:"var(--amber)"}}))]})},b)),(0,d.jsx)("th",{className:"w-8",style:{...A,background:"var(--muted)"}})]})}),(0,d.jsxs)("tbody",{children:[w.map((a,b)=>(0,d.jsxs)(f().Fragment,{children:[null!==a.key&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:l.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,d.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[a.key," \xb7 ",a.rows.length]})})},`grp-${a.key}`),a.rows.map(({row:a,orig:b})=>{let c=B++;return(0,d.jsxs)("tr",{className:"group transition-colors",style:{background:c%2==0?"var(--background)":"var(--card)"},onMouseEnter:a=>a.currentTarget.style.background="var(--muted)",onMouseLeave:a=>a.currentTarget.style.background=c%2==0?"var(--background)":"var(--card)",children:[l.map(c=>(0,d.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)(u,{value:a[c]??"",onCommit:a=>x(b,c,a)})},c)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("button",{onClick:()=>y(b),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(s.A,{size:12})})})]},c)})]},a.key??`section-${b}`)),j&&(0,d.jsx)(v,{headers:a,visibleIndices:l,onAdd:z,onCancel:()=>k(!1)})]})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[h.length," rows \xb7 ",a.length," cols"]}),j?(0,d.jsx)("button",{onClick:()=>k(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,d.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,d.jsx)(t.A,{size:12})," Add row"]})]})]})}function x({headers:a,rows:b,cfg:c}){let e=a.indexOf(c.titleField),f=a.indexOf(c.descField),g=a.indexOf(c.tagField);return(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map((b,c)=>{let h=e>=0?b[e]:b[0]??"",i=f>=0?b[f]:"",j=g>=0?b[g]:"",k=j?o(j):null;return(0,d.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[j&&k&&(0,d.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:k.bg,color:k.text},children:j}),(0,d.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:h}),i&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:i}),(0,d.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:a.map((a,c)=>{if(c===e||c===f||c===g)return null;let h=b[c];return h?(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:a}),(0,d.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:h})]},c):null})})]},c)})})}function y({headers:a,rows:b,cfg:c,saveAction:f}){let[g,h]=(0,e.useState)(b),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(!1),q=a.indexOf(c.groupField),r=a.indexOf(c.titleField),s=a.indexOf(c.descField),{groups:u,groupKeys:v}=(0,e.useMemo)(()=>{let a=new Map;return g.forEach((b,c)=>{let d=(q>=0?b[q]:"")||"(empty)";a.has(d)||a.set(d,[]),a.get(d).push({row:b,origIdx:c})}),{groups:a,groupKeys:[...a.keys()]}},[g,q]);async function w(b,c){let d=g.map((a,d)=>{if(d!==b)return a;let e=[...a];return q>=0&&(e[q]=c),e});h(d),await f(m(a,d))}function x({group:b}){let c=u.get(b)??[],e=o(b),f=i===b;return(0,d.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:e.text}}),(0,d.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:e.text},children:b}),(0,d.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:c.length})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:f?"var(--amber-dim)":"var(--muted)",border:`1px solid ${f?"var(--amber)":"transparent"}`},onDragOver:a=>{a.preventDefault(),j(b)},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||j(null)},onDrop:a=>{j(null);let c=parseInt(a.dataTransfer.getData("origIdx"));isNaN(c)||w(c,b)},children:[c.map(({row:b,origIdx:c})=>{let e=r>=0?b[r]:b[0]??"",f=s>=0?b[s]:"";return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.setData("origIdx",String(c)),j(null)},onDragEnd:()=>j(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:e}),f&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:f}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:a.map((a,c)=>{if(c===q||c===r||c===s)return null;let e=b[c];return e?(0,d.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[a,": ",e]},c):null})})]},c)}),0===c.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,d.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[v.map(a=>(0,d.jsx)(x,{group:a},a)),(0,d.jsx)("div",{className:"flex-shrink-0 w-64",children:n?(0,d.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("input",{autoFocus:!0,value:k,onChange:a=>l(a.target.value),onKeyDown:a=>{"Enter"===a.key&&k.trim()&&(l(""),p(!1)),"Escape"===a.key&&(l(""),p(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,d.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,d.jsx)(t.A,{size:12})," Add column"]})})]})}var z=c(46674),A=c(27608);function B({headers:a,cfg:b,view:c,onClose:e,onChange:f}){let g={color:"var(--muted-foreground)",fontSize:"0.72rem"};function h({label:b,value:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-display",style:g,children:b}),(0,d.jsx)(A.A,{value:c,onChange:e,size:"sm",options:[{value:"",label:"— none —"},...a.map(a=>({value:a,label:a}))]})]})}return(0,d.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:[c," settings"]}),(0,d.jsx)("button",{onClick:e,style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(z.A,{size:13})})]}),"table"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Sort"}),(0,d.jsx)(h,{label:"Sort by",value:b.table.sortField,onChange:a=>f({...b,table:{...b.table,sortField:a}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{style:g,children:"Direction"}),(0,d.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(a=>(0,d.jsx)("button",{onClick:()=>f({...b,table:{...b.table,sortDir:a}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:b.table.sortDir===a?"var(--amber)":"var(--background)",color:b.table.sortDir===a?"var(--amber-foreground)":"var(--muted-foreground)"},children:a},a))})]}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Group"}),(0,d.jsx)(h,{label:"Group by",value:b.table.groupField,onChange:a=>f({...b,table:{...b.table,groupField:a}})}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Columns"}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(a=>{let c=b.table.hiddenFields.includes(a);return(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{style:g,children:a}),(0,d.jsx)("button",{onClick:()=>{let d=c?b.table.hiddenFields.filter(b=>b!==a):[...b.table.hiddenFields,a];f({...b,table:{...b.table,hiddenFields:d}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:c?"var(--muted)":"var(--amber-dim)",color:c?"var(--muted-foreground)":"var(--amber)"},children:c?"Hidden":"Visible"})]},a)})})]}),"gallery"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Title",value:b.gallery.titleField,onChange:a=>f({...b,gallery:{...b.gallery,titleField:a}})}),(0,d.jsx)(h,{label:"Description",value:b.gallery.descField,onChange:a=>f({...b,gallery:{...b.gallery,descField:a}})}),(0,d.jsx)(h,{label:"Tag / Badge",value:b.gallery.tagField,onChange:a=>f({...b,gallery:{...b.gallery,tagField:a}})})]}),"board"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Group by",value:b.board.groupField,onChange:a=>f({...b,board:{...b.board,groupField:a}})}),(0,d.jsx)(h,{label:"Card title",value:b.board.titleField,onChange:a=>f({...b,board:{...b.board,titleField:a}})}),(0,d.jsx)(h,{label:"Card desc",value:b.board.descField,onChange:a=>f({...b,board:{...b.board,descField:a}})})]})]})}let C=[{id:"table",icon:(0,d.jsx)(g.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,d.jsx)(h.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,d.jsx)(i.A,{size:13}),label:"Board"}];function D({filePath:a,content:b,saveAction:c}){let{headers:f,rows:g}=(0,e.useMemo)(()=>{let a;return{headers:(a=l().parse(b,{skipEmptyLines:!0}).data)[0]??[],rows:a.slice(1)}},[b]),h=(0,e.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:f[0]??"",descField:f[1]??"",tagField:f[2]??""},board:{groupField:f[f.length-1]??"",titleField:f[0]??"",descField:f[1]??""}}),[f]),[i,k]=(0,p.Un)("csv",a,h),[m,n]=(0,e.useState)(!1),o=(0,e.useCallback)(a=>{k(a)},[k]),q=i.activeView;return(0,d.jsxs)("div",{className:"max-w-[1100px] mx-auto px-0 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,d.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:C.map(a=>(0,d.jsxs)("button",{onClick:()=>o({...i,activeView:a.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:q===a.id?"var(--card)":"transparent",color:q===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:q===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[a.icon,a.label]},a.id))}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[g.length," rows"]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,d.jsx)(j.A,{size:13})}),m&&(0,d.jsx)(B,{headers:f,cfg:i,view:q,onClose:()=>n(!1),onChange:o})]})]}),"table"===q&&(0,d.jsx)(w,{headers:f,rows:g,cfg:i.table,saveAction:c}),"gallery"===q&&(0,d.jsx)(x,{headers:f,rows:g,cfg:i.gallery}),"board"===q&&(0,d.jsx)(y,{headers:f,rows:g,cfg:i.board,saveAction:c})]})}},49692:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23))},51488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>m});var d=c(48249),e=c(67484),f=c(69924),g=c(6079),h=c(80600),i=c(13576),j=c(33191);function k(a){let b=Date.now()-a,c=Math.floor(b/6e4),d=Math.floor(b/36e5),e=Math.floor(b/864e5);return c<1?"just now":c<60?`${c}m ago`:d<24?`${d}h ago`:`${e}d ago`}function l(a){return a.split("/").pop()?.replace(/\.(md|csv)$/,"")??a}function m({filePath:a}){let[b,c]=(0,e.useState)([]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null);async function v(){if(0===b.length)return;u.current?.abort();let a=new AbortController;u.current=a,n(""),r(""),p(!0),t(!1);let c=b.map(a=>a.path),d=b.map(a=>`- **${l(a.path)}** (${a.path}, modified ${k(a.mtime)})`).join("\n"),e=`You are summarizing recent changes in a personal knowledge base (MindOS).
|
|
26
26
|
|
|
27
27
|
The following files were recently modified:
|
|
28
28
|
${d}
|
|
@@ -35,17 +35,11 @@ Please provide a concise daily briefing in this format:
|
|
|
35
35
|
Be specific. Reference actual content from the files. Keep the total response under 300 words.`;try{let b=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:e}],attachedFiles:c}),signal:a.signal});if(!b.ok)throw Error(`HTTP ${b.status}`);if(!b.body)throw Error("No response body");let d=b.body.getReader(),f=new TextDecoder,g="";for(;;){let{done:a,value:b}=await d.read();if(a)break;for(let a of f.decode(b,{stream:!0}).split("\n")){let b=a.match(/^0:"((?:[^"\\]|\\.)*)"$/);b?g+=b[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):!a||a.startsWith("d:")||a.startsWith("e:")||a.startsWith("0:")||(g+=a)}n(g)}t(!0)}catch(a){a instanceof Error&&"AbortError"!==a.name&&r(a.message||"Failed to generate summary")}finally{p(!1)}}return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:"1.5rem",flexWrap:"wrap"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:b.length>0?`${b.length} recently modified files`:"Loading recent files…"}),(0,d.jsxs)("button",{onClick:v,disabled:o||0===b.length,className:"font-display",style:{display:"flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,fontSize:12,cursor:o||0===b.length?"not-allowed":"pointer",border:"none",background:o?"var(--muted)":"var(--amber)",color:o?"var(--muted-foreground)":"var(--amber-foreground)",opacity:0===b.length?.5:1,transition:"opacity .15s"},children:[o?(0,d.jsx)(f.A,{size:12,style:{animation:"spin 1s linear infinite"}}):(0,d.jsx)(g.A,{size:12}),o?"Generating…":s?"Regenerate":"Generate briefing"]})]}),b.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:"1.5rem"},children:b.map(a=>(0,d.jsxs)("a",{href:`/view/${(0,j.O0)(a.path)}`,className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",background:"var(--muted)",color:"var(--muted-foreground)",textDecoration:"none",border:"1px solid var(--border)",transition:"color .15s"},onMouseEnter:a=>a.currentTarget.style.color="var(--foreground)",onMouseLeave:a=>a.currentTarget.style.color="var(--muted-foreground)",title:a.path,children:[(0,d.jsx)(h.A,{size:10}),l(a.path),(0,d.jsxs)("span",{style:{opacity:.5},children:[(0,d.jsx)(i.A,{size:9,style:{display:"inline",marginLeft:2}})," ",k(a.mtime)]})]},a.path))}),q&&(0,d.jsx)("div",{className:"font-display",style:{padding:"10px 14px",borderRadius:8,background:"color-mix(in srgb, var(--error) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--error) 30%, transparent)",color:"var(--error)",fontSize:12,marginBottom:"1rem"},children:q}),m?(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"18px 20px",position:"relative"},children:[o&&(0,d.jsx)("div",{style:{position:"absolute",top:12,right:14,width:6,height:6,borderRadius:"50%",background:"var(--amber)",animation:"pulse 1.2s ease-in-out infinite"}}),(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:m.replace(/^### (.+)$/gm,'<h3 style="font-size:.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:1em 0 .3em">$1</h3>').replace(/^## (.+)$/gm,'<h2 style="font-size:.9rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h2>').replace(/^# (.+)$/gm,'<h1 style="font-size:1rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h1>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:.82em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/^[-*] (.+)$/gm,'<li style="margin:.2em 0;padding-left:.3em">$1</li>').replace(/(<li[^>]*>.*<\/li>\n?)+/g,a=>`<ul style="margin:.4em 0;padding-left:1.4em;list-style:disc">${a}</ul>`).replace(/\n{2,}/g,'</p><p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">').replace(/^(?!<[hulo])(.+)$/gm,'<p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">$1</p>')}})]}):o||s||!(b.length>0)?null:(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)"},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3,color:"var(--amber)"}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["Click ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:"Generate briefing"})," to summarize recent changes with AI."]})]}),(0,d.jsx)("style",{children:`
|
|
36
36
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
37
37
|
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }
|
|
38
|
-
`})]})}c(95054)},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>u,DO:()=>k,KF:()=>i,Mv:()=>m,TM:()=>t,ZC:()=>s,lx:()=>r,md:()=>j,pp:()=>n,rA:()=>l});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484);function i({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function j({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function k({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function l({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function m({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function n({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-dashed border-border/60 bg-gradient-to-b from-card/80 to-card/40 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let o=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function p(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function q(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function r({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=o[p(a)%o.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:q(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-white flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function s({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function t({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:i,variant:j="destructive"}){let k=(0,h.useRef)(null);return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-label":b,children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:i,"aria-hidden":"true"}),(0,d.jsxs)("div",{className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:k,type:"button",onClick:i,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===j?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function u({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=o[p(a.name)%o.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:q(a.name)})})(),a.name]},a.key))})}):null}},59420:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23))},59528:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23)),Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},60442:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call CsvRenderer() from the server but CsvRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/csv/CsvRenderer.tsx","CsvRenderer")},60725:(a,b,c)=>{"use strict";function d(a,b,c){let d,e,f;if("stdio"===c){var g,h,i;let b={type:"stdio",command:"mindos",args:["mcp"]};if("toml"===a.format){let b=`[${a.configKey}.mindos]
|
|
39
|
-
command = "mindos"
|
|
40
|
-
args = ["mcp"]
|
|
41
|
-
|
|
42
|
-
[${a.configKey}.mindos.env]
|
|
43
|
-
MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if(a.globalNestedKey){let c=JSON.stringify({[a.configKey]:{mindos:b}},null,2);return{snippet:c,displaySnippet:c,path:a.projectPath??a.globalPath}}let c=JSON.stringify({[a.configKey]:{mindos:b}},null,2);return{snippet:c,displaySnippet:c,path:a.globalPath}}return g=b?.endpoint??"http://127.0.0.1:8781/mcp",h=b?.authToken,i=b?.maskedToken,d={url:g},h&&(d.headers={Authorization:`Bearer ${h}`}),e={url:g},i&&(e.headers={Authorization:`Bearer ${i}`}),{snippet:(f=b=>{if("toml"===a.format){let c=[`[${a.configKey}.mindos]`,'type = "http"',`url = "${g}"`],d=b.headers?.Authorization;return d&&(c.push(""),c.push(`[${a.configKey}.mindos.headers]`),c.push(`Authorization = "${d}"`)),c.join("\n")}return a.globalNestedKey,JSON.stringify({[a.configKey]:{mindos:b}},null,2)})(d),displaySnippet:f(h?e:d),path:"toml"===a.format?a.globalPath:a.globalNestedKey?a.projectPath??a.globalPath:a.globalPath}}c.d(b,{$k:()=>d})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"#8ab4d8",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"#c8a0d8",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:["ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipProvider")},70887:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("60b74fb91a59ee6786f3c8a956bf7246cc2f02c202",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},72161:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("406a760c80264be58d943201ebafe31465b27b61f1",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},72362:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>j});var d=c(48249),e=c(67484),f=c(40560),g=c(42742),h=c(46674),i=c(24520);function j({content:a,saveAction:b}){let c=(0,e.useMemo)(()=>{try{return JSON.parse(a)}catch{return null}},[a]),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)({}),t=j??{},u=t.uiSchema?.sections??[],v=t.keySpecs??{},w=(0,e.useCallback)(async a=>{m(!0),o(!1),q("");try{await b(`${JSON.stringify(a,null,2)}
|
|
44
|
-
`),o(!0),setTimeout(()=>o(!1),1200)}catch(a){q(a instanceof Error?a.message:"Failed to save")}finally{m(!1)}},[b]),x=(0,e.useCallback)(async(a,b)=>{if(!j)return;let c=function(a,b,c){let d=b.split("."),e=structuredClone(a),f=e;for(let a=0;a<d.length-1;a++){let b=d[a],c=f[b];(!c||"object"!=typeof c||Array.isArray(c))&&(f[b]={}),f=f[b]}return f[d[d.length-1]]=c,e}(j,a,b);k(c),await w(c)},[j,w]);return c&&j?(0,d.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,d.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[l&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,d.jsx)(f.A,{size:12,className:"animate-spin"}),"Saving"]}),!l&&n&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,d.jsx)(g.A,{size:12}),"Saved"]})]})]}),p&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:p}),u.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),(0,d.jsx)("div",{className:"space-y-3",children:a.fields.map(a=>{let b=v[a]??{},c=function(a,b){let c=b.split("."),d=a;for(let a of c){if(!d||"object"!=typeof d||!(a in d))return null;d=d[a]}return d}(j,a),e=b.label||a;return(0,d.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:e}),b.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]}),"switch"===b.control&&"boolean"==typeof c&&(0,d.jsx)("button",{type:"button",onClick:()=>x(a,!c),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:c?"var(--amber)":"var(--muted)",color:c?"var(--amber-foreground)":"var(--muted-foreground)"},children:c?"ON":"OFF"})]}),"text"===b.control&&"string"==typeof c&&(0,d.jsx)("input",{defaultValue:c,onBlur:b=>x(a,b.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===b.control&&"number"==typeof c&&(0,d.jsx)("input",{type:"number",defaultValue:c,min:b.constraints?.min,max:b.constraints?.max,onBlur:d=>{let e=Number(d.target.value),f=b.constraints?.min,g=b.constraints?.max,h=Number.isFinite(e)?e:c;"number"==typeof f&&h<f&&(h=f),"number"==typeof g&&h>g&&(h=g),x(a,h)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===b.control&&Array.isArray(c)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.map((b,e)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(b),(0,d.jsx)("button",{type:"button",onClick:()=>x(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{size:11})})]},`${String(b)}-${e}`))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:r[a]??"",onChange:b=>s(c=>({...c,[a]:b.target.value})),onKeyDown:b=>{if("Enter"!==b.key)return;b.preventDefault();let d=(r[a]??"").trim();d&&(x(a,[...c,d]),s(b=>({...b,[a]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,d.jsxs)("button",{type:"button",onClick:()=>{let b=(r[a]??"").trim();b&&(x(a,[...c,b]),s(b=>({...b,[a]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:12})," Add"]})]})]})]},a)})})]},a.id))]}):(0,d.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},74122:(a,b,c)=>{"use strict";c.d(b,{default:()=>dK});var d=c(48249),e=c(19099),f=c(67484),g=c(2116),h=c.n(g),i=c(9915),j=c(10316),k=c(95581),l=c(46674),m=c(801),n=c(65585),o=c(83877),p=c(65255),q=c(95801),r=c(6394),s=c(69924),t=c(72987),u=c(19794),v=c(77505),w=c(49681),x=c(2797),y=c(95054),z=c(1619),A=c(8455),B=c(41479),C=c(61075),D=c(40560),E=c(86588),F=c(81285);function G(a){if(!a)return"never";let b=Date.now()-new Date(a).getTime();return b<6e4?"just now":b<36e5?`${Math.floor(b/6e4)}m ago`:b<864e5?`${Math.floor(b/36e5)}h ago`:`${Math.floor(b/864e5)}d ago`}function H({t:a,onInitComplete:b}){var c;let e=a.settings?.sync,[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)("main"),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),s=g.trim()?(c=g.trim(),/^https:\/\/.+/.test(c)?"https":!!/^git@[\w.-]+:.+/.test(c)&&"ssh"):null,t="https"===s||"ssh"===s,u=async()=>{p(!0),r("");try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",remote:g.trim(),token:i.trim()||void 0,branch:k.trim()||"main"})}),b()}catch(a){r(a instanceof Error?a.message:"Connection failed")}finally{p(!1)}};return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:(0,d.jsx)(z.A,{size:18,className:"text-muted-foreground"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:e?.emptyTitle??"Cross-device Sync"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e?.emptyDesc??"Automatically sync your knowledge base across devices via Git."})]})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground block",children:e?.remoteUrl??"Git Remote URL"}),(0,d.jsx)(F.pd,{type:"text",value:g,onChange:a=>{h(a.target.value),r("")},placeholder:"https://github.com/user/my-mind.git",className:`font-mono ${g.trim()&&!t?"border-destructive":""}`}),g.trim()&&!t&&(0,d.jsx)("p",{className:"text-xs text-destructive",children:e?.invalidUrl??"Invalid Git URL — use HTTPS (https://...) or SSH (git@...)"}),"ssh"===s&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:11,className:"shrink-0"}),e?.sshHint??"SSH URLs require SSH key configured on this machine. HTTPS with token recommended."]})]}),"https"===s&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground block",children:[e?.accessToken??"Access Token"," ",(0,d.jsx)("span",{className:"text-muted-foreground font-normal",children:e?.optional??"(optional, for private repos)"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(F.pd,{type:m?"text":"password",value:i,onChange:a=>j(a.target.value),placeholder:"ghp_xxxxxxxxxxxx",className:"pr-9 font-mono"}),(0,d.jsx)("button",{type:"button",onClick:()=>n(!m),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-muted text-muted-foreground transition-colors",children:m?(0,d.jsx)(B.A,{size:14}):(0,d.jsx)(C.A,{size:14})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e?.tokenHint??"GitHub: Settings → Developer settings → Personal access tokens → repo scope"})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground block",children:e?.branchLabel??"Branch"}),(0,d.jsx)(F.pd,{type:"text",value:k,onChange:a=>l(a.target.value),placeholder:"main",className:"max-w-[200px] font-mono"})]}),(0,d.jsxs)(F.jn,{onClick:u,disabled:!t||o,className:"flex items-center gap-2",children:[o&&(0,d.jsx)(D.A,{size:14,className:"animate-spin"}),o?e?.connecting??"Connecting...":e?.connectButton??"Connect & Start Sync"]}),q&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs p-3 rounded-lg bg-destructive/10 text-destructive",role:"alert","aria-live":"polite",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:q})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 text-xs text-muted-foreground pt-2",children:[e?.featureAutoCommit??"Auto-commit on save",e?.featureAutoPull??"Auto-pull from remote",e?.featureConflict??"Conflict detection",e?.featureMultiDevice??"Works across devices"].map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:11,className:"text-success/60 shrink-0"}),(0,d.jsx)("span",{children:a})]},b))})]})}function I({t:a}){let[b,c]=(0,f.useState)(null),[e,g]=(0,f.useState)(!0),[h,i]=(0,f.useState)(!1),[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/sync");c(a)}catch{c(null)}finally{g(!1)}},[]),o=async()=>{i(!0),m(null);try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),m({type:"success",text:"Sync complete"}),await n()}catch{m({type:"error",text:"Sync failed"})}finally{i(!1),setTimeout(()=>m(null),3e3)}},p=async()=>{if(!b)return;k(!0),m(null);let a=b.enabled?"off":"on";try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a})}),await n(),m({type:"success",text:b.enabled?"Auto-sync disabled":"Auto-sync enabled"})}catch{m({type:"error",text:"Failed to toggle sync"})}finally{k(!1),setTimeout(()=>m(null),3e3)}};if(e)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:18,className:"animate-spin text-muted-foreground"})});if(!b||!b.enabled)return(0,d.jsx)(H,{t:a,onInitComplete:n});let q=b.conflicts||[];return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(F.eN,{children:"Sync"}),(0,d.jsxs)("div",{className:"space-y-2.5 text-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Provider"}),(0,d.jsx)("span",{className:"font-mono text-sm",children:b.provider})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Remote"}),(0,d.jsx)("span",{className:"font-mono text-sm truncate",title:b.remote,children:b.remote})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Branch"}),(0,d.jsx)("span",{className:"font-mono text-sm",children:b.branch})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Last sync"}),(0,d.jsx)("span",{className:"text-sm",children:G(b.lastSync)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Unpushed"}),(0,d.jsxs)("span",{className:"text-sm",children:[b.unpushed," commits"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Auto-sync"}),(0,d.jsxs)("span",{className:"text-sm",children:["commit: ",b.autoCommitInterval,"s, pull: ",Math.floor((b.autoPullInterval||300)/60),"min"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)("button",{type:"button",onClick:o,disabled:h,title:h?a.hints.syncInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:12,className:h?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{type:"button",onClick:p,disabled:j,title:j?a.hints.toggleInProgress:void 0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${b.enabled?"border-border text-muted-foreground hover:text-destructive hover:border-destructive/50":"border-success/30 text-success hover:bg-success/10"}`,children:b.enabled?"Disable Auto-sync":"Enable Auto-sync"})]}),l&&(0,d.jsx)("div",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:"success"===l.type?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:13,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:l.text})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:13,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:l.text})]})}),q.length>0&&(0,d.jsxs)("div",{className:"pt-2 border-t border-border",children:[(0,d.jsxs)(F.eN,{children:["Conflicts (",q.length,")"]}),(0,d.jsx)("div",{className:"space-y-1.5",children:q.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs group",children:[(0,d.jsx)(A.A,{size:12,className:"text-error shrink-0"}),(0,d.jsx)("a",{href:`/view/${encodeURIComponent(a.file)}`,className:"font-mono truncate hover:text-foreground hover:underline transition-colors",title:`Open ${a.file}`,children:a.file}),(0,d.jsx)("a",{href:`/view/${encodeURIComponent(a.file+".sync-conflict")}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-muted-foreground hover:text-foreground",title:"View remote version (.sync-conflict)",children:(0,d.jsx)(E.A,{size:11})}),(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 ml-auto",children:G(a.time)})]},b))}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Click a file to view your version. Hover and click ",(0,d.jsx)(E.A,{size:10,className:"inline"})," to see the remote version."]})]}),b.lastError&&(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:12,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:b.lastError})]})})]})}function J(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}let K={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function L(){let[a,b]=(0,f.useState)(null),[c,d]=(0,f.useState)(!1);return(0,f.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function M(a){let[b,c]=(0,f.useState)(!1),[d,e]=(0,f.useState)(null),g=(0,f.useCallback)(async()=>{if(!b){c(!0),e(null);try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),e("success")}catch{await a(),e("error")}finally{c(!1),setTimeout(()=>e(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function N(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${G(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function O({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:e,fetchStatus:g}=L(),{syncing:h,syncResult:i,syncNow:j}=M(g),[k,l]=(0,f.useState)(null);(0,f.useRef)("off");let[m,n]=(0,f.useState)(()=>!1),{t:o}=(0,v.Y)();if(!function(a){let[,b]=(0,f.useState)(0)}(0),!e||a)return null;let p=J(c,h);if("off"===p){if(m)return null;let a=o.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}n(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let q=o.sidebar?.sync,{label:r,tooltip:t}=N(p,c,q);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:t,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${K[p]} ${"syncing"===p||"conflicts"===p?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:k||r})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===i||k)&&(0,d.jsx)(w.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===i&&(0,d.jsx)(x.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),j()},disabled:h,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:q?.syncNow??"Sync now",children:(0,d.jsx)(s.A,{size:12,className:h?"animate-spin":""})})]})]})}function P({status:a,syncing:b}){let c=J(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${K[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}function Q({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}function R({icon:a,label:b,shortcut:c,active:e=!1,expanded:f,onClick:g,buttonRef:h,badge:i,walkthroughId:j}){return(0,d.jsxs)("button",{ref:h,onClick:g,"aria-pressed":e,"aria-label":b,title:f?void 0:c?`${b} (${c})`:b,"data-walkthrough":j,className:`
|
|
38
|
+
`})]})}c(95054)},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>u,DO:()=>k,KF:()=>i,Mv:()=>m,TM:()=>t,ZC:()=>s,lx:()=>r,md:()=>j,pp:()=>n,rA:()=>l});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484);function i({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function j({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function k({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function l({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function m({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function n({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-dashed border-border/60 bg-gradient-to-b from-card/80 to-card/40 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let o=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function p(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function q(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function r({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=o[p(a)%o.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:q(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-white flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function s({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function t({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:i,variant:j="destructive"}){let k=(0,h.useRef)(null);return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-label":b,children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:i,"aria-hidden":"true"}),(0,d.jsxs)("div",{className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:k,type:"button",onClick:i,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===j?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-background hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function u({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=o[p(a.name)%o.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:q(a.name)})})(),a.name]},a.key))})}):null}},58520:(a,b,c)=>{"use strict";c.d(b,{default:()=>dK});var d=c(48249),e=c(19099),f=c(67484),g=c(2116),h=c.n(g),i=c(9915),j=c(10316),k=c(95581),l=c(46674),m=c(801),n=c(65585),o=c(83877),p=c(65255),q=c(95801),r=c(6394),s=c(69924),t=c(72987),u=c(19794),v=c(77505),w=c(49681),x=c(2797),y=c(95054),z=c(1619),A=c(8455),B=c(41479),C=c(61075),D=c(40560),E=c(86588),F=c(81285);function G(a){if(!a)return"never";let b=Date.now()-new Date(a).getTime();return b<6e4?"just now":b<36e5?`${Math.floor(b/6e4)}m ago`:b<864e5?`${Math.floor(b/36e5)}h ago`:`${Math.floor(b/864e5)}d ago`}function H({t:a,onInitComplete:b}){var c;let e=a.settings?.sync,[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)("main"),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),s=g.trim()?(c=g.trim(),/^https:\/\/.+/.test(c)?"https":!!/^git@[\w.-]+:.+/.test(c)&&"ssh"):null,t="https"===s||"ssh"===s,u=async()=>{p(!0),r("");try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",remote:g.trim(),token:i.trim()||void 0,branch:k.trim()||"main"})}),b()}catch(a){r(a instanceof Error?a.message:"Connection failed")}finally{p(!1)}};return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:(0,d.jsx)(z.A,{size:18,className:"text-muted-foreground"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:e?.emptyTitle??"Cross-device Sync"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e?.emptyDesc??"Automatically sync your knowledge base across devices via Git."})]})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground block",children:e?.remoteUrl??"Git Remote URL"}),(0,d.jsx)(F.pd,{type:"text",value:g,onChange:a=>{h(a.target.value),r("")},placeholder:"https://github.com/user/my-mind.git",className:`font-mono ${g.trim()&&!t?"border-destructive":""}`}),g.trim()&&!t&&(0,d.jsx)("p",{className:"text-xs text-destructive",children:e?.invalidUrl??"Invalid Git URL — use HTTPS (https://...) or SSH (git@...)"}),"ssh"===s&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:11,className:"shrink-0"}),e?.sshHint??"SSH URLs require SSH key configured on this machine. HTTPS with token recommended."]})]}),"https"===s&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground block",children:[e?.accessToken??"Access Token"," ",(0,d.jsx)("span",{className:"text-muted-foreground font-normal",children:e?.optional??"(optional, for private repos)"})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(F.pd,{type:m?"text":"password",value:i,onChange:a=>j(a.target.value),placeholder:"ghp_xxxxxxxxxxxx",className:"pr-9 font-mono"}),(0,d.jsx)("button",{type:"button",onClick:()=>n(!m),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-muted text-muted-foreground transition-colors",children:m?(0,d.jsx)(B.A,{size:14}):(0,d.jsx)(C.A,{size:14})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e?.tokenHint??"GitHub: Settings → Developer settings → Personal access tokens → repo scope"})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground block",children:e?.branchLabel??"Branch"}),(0,d.jsx)(F.pd,{type:"text",value:k,onChange:a=>l(a.target.value),placeholder:"main",className:"max-w-[200px] font-mono"})]}),(0,d.jsxs)(F.jn,{onClick:u,disabled:!t||o,className:"flex items-center gap-2",children:[o&&(0,d.jsx)(D.A,{size:14,className:"animate-spin"}),o?e?.connecting??"Connecting...":e?.connectButton??"Connect & Start Sync"]}),q&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs p-3 rounded-lg bg-destructive/10 text-destructive",role:"alert","aria-live":"polite",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:q})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 text-xs text-muted-foreground pt-2",children:[e?.featureAutoCommit??"Auto-commit on save",e?.featureAutoPull??"Auto-pull from remote",e?.featureConflict??"Conflict detection",e?.featureMultiDevice??"Works across devices"].map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:11,className:"text-success/60 shrink-0"}),(0,d.jsx)("span",{children:a})]},b))})]})}function I({t:a}){let[b,c]=(0,f.useState)(null),[e,g]=(0,f.useState)(!0),[h,i]=(0,f.useState)(!1),[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/sync");c(a)}catch{c(null)}finally{g(!1)}},[]),o=async()=>{i(!0),m(null);try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),m({type:"success",text:"Sync complete"}),await n()}catch{m({type:"error",text:"Sync failed"})}finally{i(!1),setTimeout(()=>m(null),3e3)}},p=async()=>{if(!b)return;k(!0),m(null);let a=b.enabled?"off":"on";try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a})}),await n(),m({type:"success",text:b.enabled?"Auto-sync disabled":"Auto-sync enabled"})}catch{m({type:"error",text:"Failed to toggle sync"})}finally{k(!1),setTimeout(()=>m(null),3e3)}};if(e)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:18,className:"animate-spin text-muted-foreground"})});if(!b||!b.enabled)return(0,d.jsx)(H,{t:a,onInitComplete:n});let q=b.conflicts||[];return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(F.eN,{children:"Sync"}),(0,d.jsxs)("div",{className:"space-y-2.5 text-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Provider"}),(0,d.jsx)("span",{className:"font-mono text-sm",children:b.provider})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Remote"}),(0,d.jsx)("span",{className:"font-mono text-sm truncate",title:b.remote,children:b.remote})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Branch"}),(0,d.jsx)("span",{className:"font-mono text-sm",children:b.branch})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Last sync"}),(0,d.jsx)("span",{className:"text-sm",children:G(b.lastSync)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Unpushed"}),(0,d.jsxs)("span",{className:"text-sm",children:[b.unpushed," commits"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground w-24 shrink-0",children:"Auto-sync"}),(0,d.jsxs)("span",{className:"text-sm",children:["commit: ",b.autoCommitInterval,"s, pull: ",Math.floor((b.autoPullInterval||300)/60),"min"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)("button",{type:"button",onClick:o,disabled:h,title:h?a.hints.syncInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:12,className:h?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{type:"button",onClick:p,disabled:j,title:j?a.hints.toggleInProgress:void 0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${b.enabled?"border-border text-muted-foreground hover:text-destructive hover:border-destructive/50":"border-success/30 text-success hover:bg-success/10"}`,children:b.enabled?"Disable Auto-sync":"Enable Auto-sync"})]}),l&&(0,d.jsx)("div",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:"success"===l.type?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:13,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:l.text})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:13,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:l.text})]})}),q.length>0&&(0,d.jsxs)("div",{className:"pt-2 border-t border-border",children:[(0,d.jsxs)(F.eN,{children:["Conflicts (",q.length,")"]}),(0,d.jsx)("div",{className:"space-y-1.5",children:q.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs group",children:[(0,d.jsx)(A.A,{size:12,className:"text-error shrink-0"}),(0,d.jsx)("a",{href:`/view/${encodeURIComponent(a.file)}`,className:"font-mono truncate hover:text-foreground hover:underline transition-colors",title:`Open ${a.file}`,children:a.file}),(0,d.jsx)("a",{href:`/view/${encodeURIComponent(a.file+".sync-conflict")}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-muted-foreground hover:text-foreground",title:"View remote version (.sync-conflict)",children:(0,d.jsx)(E.A,{size:11})}),(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 ml-auto",children:G(a.time)})]},b))}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Click a file to view your version. Hover and click ",(0,d.jsx)(E.A,{size:10,className:"inline"})," to see the remote version."]})]}),b.lastError&&(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:12,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:b.lastError})]})})]})}function J(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}let K={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function L(){let[a,b]=(0,f.useState)(null),[c,d]=(0,f.useState)(!1);return(0,f.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function M(a){let[b,c]=(0,f.useState)(!1),[d,e]=(0,f.useState)(null),g=(0,f.useCallback)(async()=>{if(!b){c(!0),e(null);try{await (0,y.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),e("success")}catch{await a(),e("error")}finally{c(!1),setTimeout(()=>e(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function N(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${G(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function O({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:e,fetchStatus:g}=L(),{syncing:h,syncResult:i,syncNow:j}=M(g),[k,l]=(0,f.useState)(null);(0,f.useRef)("off");let[m,n]=(0,f.useState)(()=>!1),{t:o}=(0,v.Y)();if(!function(a){let[,b]=(0,f.useState)(0)}(0),!e||a)return null;let p=J(c,h);if("off"===p){if(m)return null;let a=o.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}n(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let q=o.sidebar?.sync,{label:r,tooltip:t}=N(p,c,q);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:t,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${K[p]} ${"syncing"===p||"conflicts"===p?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:k||r})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===i||k)&&(0,d.jsx)(w.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===i&&(0,d.jsx)(x.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),j()},disabled:h,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:q?.syncNow??"Sync now",children:(0,d.jsx)(s.A,{size:12,className:h?"animate-spin":""})})]})]})}function P({status:a,syncing:b}){let c=J(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${K[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}function Q({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}function R({icon:a,label:b,shortcut:c,active:e=!1,expanded:f,onClick:g,buttonRef:h,badge:i,walkthroughId:j}){return(0,d.jsxs)("button",{ref:h,onClick:g,"aria-pressed":e,"aria-label":b,title:f?void 0:c?`${b} (${c})`:b,"data-walkthrough":j,className:`
|
|
45
39
|
relative flex items-center ${f?"justify-start px-3 w-full":"justify-center w-10"} h-10 rounded-md transition-colors
|
|
46
40
|
${e?"text-[var(--amber)] bg-[var(--amber-dim)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}
|
|
47
41
|
focus-visible:ring-2 focus-visible:ring-ring
|
|
48
|
-
`,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function S({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:e,onDiscoverClick:g,onWorkflowsClick:i,syncStatus:l,expanded:m,onExpandedChange:w,onSettingsClick:x,onSyncClick:y}){let z=(0,f.useRef)(0),A=(0,f.useRef)(null),{t:B}=(0,v.Y)(),[C,D]=(0,f.useState)(!1),E=(0,f.useCallback)(a=>{let b=Date.now();b-z.current<300||(z.current=b,a())},[]),F=(0,f.useCallback)(c=>{E(()=>b(a===c?null:c))},[a,b,E]),G=J(l,!1),H=m?180:48,I="off"!==G&&"synced"!==G?(0,d.jsx)("span",{className:`absolute ${m?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${K[G]} ${"error"===G||"conflicts"===G?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${H}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)(h(),{href:"/",className:`flex items-center ${m?"px-3 gap-2":"justify-center"} w-full py-[13px] hover:opacity-80 transition-opacity`,"aria-label":"MindOS Home",children:[(0,d.jsx)(Q,{id:"rail",className:"w-7 h-3.5 shrink-0"}),m&&(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground font-display whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(R,{icon:(0,d.jsx)(n.A,{size:18}),label:B.sidebar.files,active:"files"===a,expanded:m,onClick:()=>F("files"),walkthroughId:"files-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(o.A,{size:18}),label:B.sidebar.echo,active:"echo"===a,expanded:m,onClick:()=>c?E(c):F("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(j.A,{size:18}),label:B.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:m,onClick:()=>F("search")}),(0,d.jsx)(R,{icon:(0,d.jsx)(p.A,{size:18}),label:B.sidebar.agents,active:"agents"===a,expanded:m,onClick:()=>e?E(e):F("agents"),walkthroughId:"agents-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(q.A,{size:18}),label:B.sidebar.workflows??"Flows",active:"workflows"===a,expanded:m,onClick:()=>i?E(i):F("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(R,{icon:(0,d.jsx)(r.A,{size:18}),label:B.sidebar.discover,active:"discover"===a,expanded:m,onClick:()=>g?E(g):F("discover")})}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(R,{icon:(0,d.jsx)(k.A,{size:18}),label:B.sidebar.settingsTitle,shortcut:"⌘,",expanded:m,onClick:()=>E(x),badge:C?(0,d.jsx)("span",{className:`absolute ${m?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),l?.enabled&&l?.remote&&"(not configured)"!==l.remote&&(0,d.jsx)(R,{icon:(0,d.jsx)(s.A,{size:18}),label:B.sidebar.syncLabel,expanded:m,buttonRef:A,badge:I,onClick:()=>E(()=>{let a=A.current?.getBoundingClientRect();a&&y(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>w(!m),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":m?"Collapse sidebar":"Expand sidebar",title:m?"Collapse":"Expand",children:m?(0,d.jsx)(t.A,{size:10}):(0,d.jsx)(u.A,{size:10})})]})}var T=c(24520),U=c(80600),V=c(86718),W=c(7817),X=c(84699),Y=c(12417),Z=c(33191),$=c(83654),_=c(16944),aa=c(37917),ab=c(15273),ac=c(12625),ad=c(59347),ae=c(44218),af=c(7309),ag=c(65032),ah=c(24703),ai=c(99829);let aj=(0,ai.createServerReference)("40eda14de1188be17d9a6e955866239f752cff3040",ai.callServer,void 0,ai.findSourceMapURL,"convertToSpaceAction"),ak=(0,ai.createServerReference)("60b16d7dd01778049115dc295094455b238a5ea2ad",ai.callServer,void 0,ai.findSourceMapURL,"createFileAction"),al=(0,ai.createServerReference)("602c4b24ec570b8c3f081c8aa2991adeb4227d9d83",ai.callServer,void 0,ai.findSourceMapURL,"renameSpaceAction");var am=c(70887);let an=(0,ai.createServerReference)("4039519f96264ac66b9227cee32b1e9f655b519c96",ai.callServer,void 0,ai.findSourceMapURL,"deleteSpaceAction"),ao=(0,ai.createServerReference)("40c205144d3c7775242ad9dc8be4e6471678b08f6d",ai.callServer,void 0,ai.findSourceMapURL,"deleteFolderAction");var ap=c(72161),aq=c(7610),ar=c(99101),as=c(57056),at=c(29713);function au(){window.dispatchEvent(new Event("mindos:files-changed"))}async function av(a){try{await navigator.clipboard.writeText(a)}catch{}}let aw=new Set(["INSTRUCTION.md","README.md"]),ax="show-hidden-files";function ay(a){let b=b=>{b.key===ax&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function az(){return!1}function aA({x:a,y:b,onClose:c,menuHeight:e,children:g}){let h=(0,f.useRef)(null),i=Math.min(b,window.innerHeight-(e??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}let aB="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",aC="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",aD="my-1 border-t border-border/50";function aE({x:a,y:b,node:c,onClose:f,onRename:g,onImport:h,onDelete:i}){let j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),{isPinned:l,togglePin:n}=(0,at.Z)(),o=l(c.path);return(0,d.jsxs)(aA,{x:a,y:b,onClose:f,children:[(0,d.jsxs)("button",{className:aB,onClick:()=>{n(c.path),f()},children:[(0,d.jsx)(_.A,{size:14,className:`shrink-0 ${o?"fill-[var(--amber)] text-[var(--amber)]":""}`}),o?k.fileTree.removeFromFavorites:k.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{j.push(`/view/${(0,Z.O0)(`${c.path}/INSTRUCTION.md`)}`),f()},children:[(0,d.jsx)(aa.A,{size:14,className:"shrink-0"})," ",k.fileTree.editRules]}),h&&(0,d.jsxs)("button",{className:aB,onClick:()=>{h(c.path),f()},children:[(0,d.jsx)(m.A,{size:14,className:"shrink-0"})," ",k.fileTree.importFile]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{av(c.path),f()},children:[(0,d.jsx)(ab.A,{size:14,className:"shrink-0"})," ",k.fileTree.copyPath]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{g(),f()},children:[(0,d.jsx)(ac.A,{size:14,className:"shrink-0"})," ",k.fileTree.renameSpace]}),(0,d.jsx)("div",{className:aD}),(0,d.jsxs)("button",{className:aC,onClick:()=>{f(),i()},children:[(0,d.jsx)(ad.A,{size:14,className:"shrink-0"}),k.fileTree.deleteSpace]})]})}function aF({x:a,y:b,node:c,onClose:g,onRename:h,onDelete:i}){let j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),[l,m]=(0,f.useTransition)(),{isPinned:n,togglePin:o}=(0,at.Z)(),p=n(c.path);return(0,d.jsxs)(aA,{x:a,y:b,onClose:g,menuHeight:180,children:[(0,d.jsxs)("button",{className:aB,onClick:()=>{o(c.path),g()},children:[(0,d.jsx)(_.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?k.fileTree.removeFromFavorites:k.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:aB,disabled:l,onClick:()=>{m(async()=>{(await aj(c.path)).success&&(j.refresh(),au()),g()})},children:[(0,d.jsx)(V.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",k.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{av(c.path),g()},children:[(0,d.jsx)(ab.A,{size:14,className:"shrink-0"})," ",k.fileTree.copyPath]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{h(),g()},children:[(0,d.jsx)(ac.A,{size:14,className:"shrink-0"})," ",k.fileTree.rename]}),(0,d.jsx)("div",{className:aD}),(0,d.jsxs)("button",{className:aC,onClick:()=>{g(),i()},children:[(0,d.jsx)(ad.A,{size:14,className:"shrink-0"}),k.fileTree.deleteFolder]})]})}function aG({dirPath:a,depth:b,onDone:c}){let[g,h]=(0,f.useState)(""),[i,j]=(0,f.useTransition)(),[k,l]=(0,f.useState)(""),m=(0,e.useRouter)(),{t:n}=(0,v.Y)(),o=(0,f.useRef)(null),p=(0,f.useCallback)(()=>{let b=g.trim();b?j(async()=>{let d=await ak(a,b);d.success&&d.filePath?(c(),m.push(`/view/${(0,Z.O0)(d.filePath)}`),m.refresh(),au()):l(d.error||n.fileTree.failed)}):l(n.fileTree.enterFileName)},[g,a,c,m,n]);return(0,d.jsxs)("div",{ref:o,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{h(a.target.value),l("")},onKeyDown:a=>{"Enter"===a.key&&p(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),i?(0,d.jsx)(D.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:p,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:n.fileTree.create})]}),k&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:k})]})}function aH({node:a,depth:b,currentPath:c,onNavigate:g,maxOpenDepth:h,onImport:i}){let j,k=(0,e.useRouter)(),l=c.startsWith(a.path+"/")||c===a.path,n=!!a.isSpace,[o,p]=(0,f.useState)(0===b||l),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(!1),[u,w]=(0,f.useState)(a.name),[x,y]=(0,f.useTransition)(),z=(0,f.useRef)(null),A=(0,f.useRef)(null),[B,C]=(0,f.useState)(null),[E,F]=(0,f.useState)(!1),G=(0,f.useRef)(null),{t:H}=(0,v.Y)(),[I,J]=(0,f.useState)(null),[K,L]=(0,f.useTransition)(),M=(0,f.useCallback)(()=>p(a=>!a),[]);(0,f.useRef)(void 0);let N=(0,f.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),A.current&&(clearTimeout(A.current),A.current=null),w(a.name),t(!0),setTimeout(()=>z.current?.select(),0)},[a.name]),O=(0,f.useCallback)(()=>{let b=u.trim();b&&b!==a.name?y(async()=>{let c=n?al:am.f,d=await c(a.path,b);d.success&&d.newPath?(t(!1),k.push(`/view/${(0,Z.O0)(d.newPath)}`),k.refresh(),au()):t(!1)}):t(!1)},[u,a.name,a.path,k,n]),P=(0,f.useCallback)(()=>{s||(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{k.push(`/view/${(0,Z.O0)(a.path)}`),g?.(),A.current=null},180))},[s,k,a.path,g]),Q=(0,f.useCallback)(a=>{a.stopPropagation(),M()},[M]),R=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),C({x:a.clientX,y:a.clientY})},[]),S=n?function a(b){return"file"===b.type?+!aw.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(s)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:z,autoFocus:!0,value:u,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&O(),"Escape"===a.key&&t(!1)},onBlur:O,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(D.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let W=n&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"relative group/dir flex items-center",onContextMenu:R,children:[(0,d.jsx)("button",{onClick:M,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":o?"Collapse":"Expand",children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:o?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(ae.A,{size:13})})}),(0,d.jsxs)("button",{type:"button",onClick:P,onDoubleClick:Q,className:`
|
|
42
|
+
`,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function S({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:e,onDiscoverClick:g,onWorkflowsClick:i,syncStatus:l,expanded:m,onExpandedChange:w,onSettingsClick:x,onSyncClick:y}){let z=(0,f.useRef)(0),A=(0,f.useRef)(null),{t:B}=(0,v.Y)(),[C,D]=(0,f.useState)(!1),E=(0,f.useCallback)(a=>{let b=Date.now();b-z.current<300||(z.current=b,a())},[]),F=(0,f.useCallback)(c=>{E(()=>b(a===c?null:c))},[a,b,E]),G=J(l,!1),H=m?180:48,I="off"!==G&&"synced"!==G?(0,d.jsx)("span",{className:`absolute ${m?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${K[G]} ${"error"===G||"conflicts"===G?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${H}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)(h(),{href:"/",className:`flex items-center ${m?"px-3 gap-2":"justify-center"} w-full py-[13px] hover:opacity-80 transition-opacity`,"aria-label":"MindOS Home",children:[(0,d.jsx)(Q,{id:"rail",className:"w-7 h-3.5 shrink-0"}),m&&(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground font-display whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(R,{icon:(0,d.jsx)(n.A,{size:18}),label:B.sidebar.files,active:"files"===a,expanded:m,onClick:()=>F("files"),walkthroughId:"files-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(o.A,{size:18}),label:B.sidebar.echo,active:"echo"===a,expanded:m,onClick:()=>c?E(c):F("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(j.A,{size:18}),label:B.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:m,onClick:()=>F("search")}),(0,d.jsx)(R,{icon:(0,d.jsx)(p.A,{size:18}),label:B.sidebar.agents,active:"agents"===a,expanded:m,onClick:()=>e?E(e):F("agents"),walkthroughId:"agents-panel"}),(0,d.jsx)(R,{icon:(0,d.jsx)(q.A,{size:18}),label:B.sidebar.workflows??"Flows",active:"workflows"===a,expanded:m,onClick:()=>i?E(i):F("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(R,{icon:(0,d.jsx)(r.A,{size:18}),label:B.sidebar.discover,active:"discover"===a,expanded:m,onClick:()=>g?E(g):F("discover")})}),(0,d.jsx)("div",{className:`${m?"mx-3":"mx-auto w-6"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${m?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(R,{icon:(0,d.jsx)(k.A,{size:18}),label:B.sidebar.settingsTitle,shortcut:"⌘,",expanded:m,onClick:()=>E(x),badge:C?(0,d.jsx)("span",{className:`absolute ${m?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),l?.enabled&&l?.remote&&"(not configured)"!==l.remote&&(0,d.jsx)(R,{icon:(0,d.jsx)(s.A,{size:18}),label:B.sidebar.syncLabel,expanded:m,buttonRef:A,badge:I,onClick:()=>E(()=>{let a=A.current?.getBoundingClientRect();a&&y(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>w(!m),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":m?"Collapse sidebar":"Expand sidebar",title:m?"Collapse":"Expand",children:m?(0,d.jsx)(t.A,{size:10}):(0,d.jsx)(u.A,{size:10})})]})}var T=c(24520),U=c(80600),V=c(86718),W=c(7817),X=c(84699),Y=c(12417),Z=c(33191),$=c(83654),_=c(16944),aa=c(37917),ab=c(15273),ac=c(12625),ad=c(59347),ae=c(44218),af=c(7309),ag=c(65032),ah=c(24703),ai=c(99829);let aj=(0,ai.createServerReference)("400a778e38e5312824730781ddcd201068ca98959c",ai.callServer,void 0,ai.findSourceMapURL,"convertToSpaceAction"),ak=(0,ai.createServerReference)("601706be2653b4a23e3983e82db2c580e569ab2f2a",ai.callServer,void 0,ai.findSourceMapURL,"createFileAction"),al=(0,ai.createServerReference)("6065c0b148f912351b8b61d2f4195467cb420475c8",ai.callServer,void 0,ai.findSourceMapURL,"renameSpaceAction");var am=c(84627);let an=(0,ai.createServerReference)("406888de5c5a90de9cd92117798e7d8d135a8378e2",ai.callServer,void 0,ai.findSourceMapURL,"deleteSpaceAction"),ao=(0,ai.createServerReference)("40d2fd1d1983934bca2c87b288fa4c58520339d779",ai.callServer,void 0,ai.findSourceMapURL,"deleteFolderAction");var ap=c(46154),aq=c(87476),ar=c(99101),as=c(57056),at=c(29713);function au(){window.dispatchEvent(new Event("mindos:files-changed"))}async function av(a){try{await navigator.clipboard.writeText(a)}catch{}}let aw=new Set(["INSTRUCTION.md","README.md"]),ax="show-hidden-files";function ay(a){let b=b=>{b.key===ax&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function az(){return!1}function aA({x:a,y:b,onClose:c,menuHeight:e,children:g}){let h=(0,f.useRef)(null),i=Math.min(b,window.innerHeight-(e??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}let aB="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",aC="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",aD="my-1 border-t border-border/50";function aE({x:a,y:b,node:c,onClose:f,onRename:g,onImport:h,onDelete:i}){let j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),{isPinned:l,togglePin:n}=(0,at.Z)(),o=l(c.path);return(0,d.jsxs)(aA,{x:a,y:b,onClose:f,children:[(0,d.jsxs)("button",{className:aB,onClick:()=>{n(c.path),f()},children:[(0,d.jsx)(_.A,{size:14,className:`shrink-0 ${o?"fill-[var(--amber)] text-[var(--amber)]":""}`}),o?k.fileTree.removeFromFavorites:k.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{j.push(`/view/${(0,Z.O0)(`${c.path}/INSTRUCTION.md`)}`),f()},children:[(0,d.jsx)(aa.A,{size:14,className:"shrink-0"})," ",k.fileTree.editRules]}),h&&(0,d.jsxs)("button",{className:aB,onClick:()=>{h(c.path),f()},children:[(0,d.jsx)(m.A,{size:14,className:"shrink-0"})," ",k.fileTree.importFile]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{av(c.path),f()},children:[(0,d.jsx)(ab.A,{size:14,className:"shrink-0"})," ",k.fileTree.copyPath]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{g(),f()},children:[(0,d.jsx)(ac.A,{size:14,className:"shrink-0"})," ",k.fileTree.renameSpace]}),(0,d.jsx)("div",{className:aD}),(0,d.jsxs)("button",{className:aC,onClick:()=>{f(),i()},children:[(0,d.jsx)(ad.A,{size:14,className:"shrink-0"}),k.fileTree.deleteSpace]})]})}function aF({x:a,y:b,node:c,onClose:g,onRename:h,onDelete:i}){let j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),[l,m]=(0,f.useTransition)(),{isPinned:n,togglePin:o}=(0,at.Z)(),p=n(c.path);return(0,d.jsxs)(aA,{x:a,y:b,onClose:g,menuHeight:180,children:[(0,d.jsxs)("button",{className:aB,onClick:()=>{o(c.path),g()},children:[(0,d.jsx)(_.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?k.fileTree.removeFromFavorites:k.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:aB,disabled:l,onClick:()=>{m(async()=>{(await aj(c.path)).success&&(j.refresh(),au()),g()})},children:[(0,d.jsx)(V.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",k.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{av(c.path),g()},children:[(0,d.jsx)(ab.A,{size:14,className:"shrink-0"})," ",k.fileTree.copyPath]}),(0,d.jsxs)("button",{className:aB,onClick:()=>{h(),g()},children:[(0,d.jsx)(ac.A,{size:14,className:"shrink-0"})," ",k.fileTree.rename]}),(0,d.jsx)("div",{className:aD}),(0,d.jsxs)("button",{className:aC,onClick:()=>{g(),i()},children:[(0,d.jsx)(ad.A,{size:14,className:"shrink-0"}),k.fileTree.deleteFolder]})]})}function aG({dirPath:a,depth:b,onDone:c}){let[g,h]=(0,f.useState)(""),[i,j]=(0,f.useTransition)(),[k,l]=(0,f.useState)(""),m=(0,e.useRouter)(),{t:n}=(0,v.Y)(),o=(0,f.useRef)(null),p=(0,f.useCallback)(()=>{let b=g.trim();b?j(async()=>{let d=await ak(a,b);d.success&&d.filePath?(c(),m.push(`/view/${(0,Z.O0)(d.filePath)}`),m.refresh(),au()):l(d.error||n.fileTree.failed)}):l(n.fileTree.enterFileName)},[g,a,c,m,n]);return(0,d.jsxs)("div",{ref:o,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{h(a.target.value),l("")},onKeyDown:a=>{"Enter"===a.key&&p(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),i?(0,d.jsx)(D.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:p,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:n.fileTree.create})]}),k&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:k})]})}function aH({node:a,depth:b,currentPath:c,onNavigate:g,maxOpenDepth:h,onImport:i}){let j,k=(0,e.useRouter)(),l=c.startsWith(a.path+"/")||c===a.path,n=!!a.isSpace,[o,p]=(0,f.useState)(0===b||l),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(!1),[u,w]=(0,f.useState)(a.name),[x,y]=(0,f.useTransition)(),z=(0,f.useRef)(null),A=(0,f.useRef)(null),[B,C]=(0,f.useState)(null),[E,F]=(0,f.useState)(!1),G=(0,f.useRef)(null),{t:H}=(0,v.Y)(),[I,J]=(0,f.useState)(null),[K,L]=(0,f.useTransition)(),M=(0,f.useCallback)(()=>p(a=>!a),[]);(0,f.useRef)(void 0);let N=(0,f.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),A.current&&(clearTimeout(A.current),A.current=null),w(a.name),t(!0),setTimeout(()=>z.current?.select(),0)},[a.name]),O=(0,f.useCallback)(()=>{let b=u.trim();b&&b!==a.name?y(async()=>{let c=n?al:am.f,d=await c(a.path,b);d.success&&d.newPath?(t(!1),k.push(`/view/${(0,Z.O0)(d.newPath)}`),k.refresh(),au()):t(!1)}):t(!1)},[u,a.name,a.path,k,n]),P=(0,f.useCallback)(()=>{s||(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{k.push(`/view/${(0,Z.O0)(a.path)}`),g?.(),A.current=null},180))},[s,k,a.path,g]),Q=(0,f.useCallback)(a=>{a.stopPropagation(),M()},[M]),R=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),C({x:a.clientX,y:a.clientY})},[]),S=n?function a(b){return"file"===b.type?+!aw.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(s)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:z,autoFocus:!0,value:u,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&O(),"Escape"===a.key&&t(!1)},onBlur:O,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(D.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let W=n&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"relative group/dir flex items-center",onContextMenu:R,children:[(0,d.jsx)("button",{onClick:M,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":o?"Collapse":"Expand",children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:o?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(ae.A,{size:13})})}),(0,d.jsxs)("button",{type:"button",onClick:P,onDoubleClick:Q,className:`
|
|
49
43
|
flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
|
|
50
44
|
text-sm transition-colors duration-100
|
|
51
45
|
hover:bg-muted
|
|
@@ -103,7 +97,7 @@ ${b}`:`[PDF: ${a.name}] Could not extract readable text (possibly scanned/image
|
|
|
103
97
|
`,children:[".csv"===e?(0,d.jsx)($.A,{size:14,className:"text-success shrink-0 mt-0.5"}):(0,d.jsx)(U.A,{size:14,className:"text-muted-foreground shrink-0 mt-0.5"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm text-foreground font-medium truncate",title:g,children:g}),i&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground truncate",title:i,children:i})]}),a.snippet&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2 leading-relaxed",title:a.snippet,children:function(a,b){if(!b.trim())return a;let c=b.trim().split(/\s+/).filter(Boolean).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),e=RegExp(`(${c.join("|")})`,"gi");return a.split(e).map((a,b)=>e.test(a)?(0,d.jsx)("mark",{className:"bg-yellow-300/40 text-foreground rounded-sm px-0.5",children:a},b):a)}(a.snippet,c)})]})]},a.path)})]}),h.length>0&&(0,d.jsxs)("div",{className:"hidden md:flex px-4 py-2 border-t border-border items-center gap-3 text-xs text-muted-foreground/60",children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("kbd",{className:"font-mono",children:"↑↓"})," ",D.search.navigate]}),(0,d.jsxs)("span",{children:[(0,d.jsx)("kbd",{className:"font-mono",children:"↵"})," ",D.search.open]}),(0,d.jsxs)("span",{children:[(0,d.jsx)("kbd",{className:"font-mono",children:"ESC"})," ",D.search.close]})]})]}),"actions"===s&&(0,d.jsx)("div",{ref:A,className:"max-h-[50vh] md:max-h-80 overflow-y-auto flex-1 py-1",children:F.map((a,b)=>(0,d.jsxs)("button",{onClick:()=>a.execute(),onMouseEnter:()=>w(b),className:`
|
|
104
98
|
w-full px-4 py-2.5 flex items-center gap-3 text-left transition-colors duration-75
|
|
105
99
|
${b===u?"bg-muted":"hover:bg-muted/50"}
|
|
106
|
-
`,children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a.icon}),(0,d.jsx)("span",{className:"text-sm text-foreground flex-1",children:a.label}),a.shortcut&&(0,d.jsx)("kbd",{className:"text-xs text-muted-foreground/60 font-mono border border-border rounded px-1.5 py-0.5",children:a.shortcut})]},a.id))})]})}):null}function cD({open:a,onClose:b,currentFile:c,initialMessage:e,initialAcpAgent:f,onFirstMessage:g,askMode:h,onModeSwitch:i}){let{t:j}=(0,v.Y)();return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-end md:items-start justify-center md:pt-[10vh] modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(),children:(0,d.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":j.ask.title,className:"w-full md:max-w-2xl md:mx-4 bg-card border-t md:border border-border rounded-t-2xl md:rounded-xl shadow-2xl flex flex-col h-[92vh] md:h-auto md:max-h-[75vh]",children:(0,d.jsx)(cp,{visible:a,variant:"modal",onClose:b,currentFile:c,initialMessage:e,initialAcpAgent:f,onFirstMessage:g,askMode:h,onModeSwitch:i})})}):null}var cE=c(87148),cF=c(36041);function cG({data:a,updateAi:b,updateAgent:c,t:e}){let g=a.envOverrides??{},h=a.envValues??{},i=a.ai.provider,[j,k]=(0,f.useState)({}),l=(0,f.useRef)(void 0);(0,f.useRef)(i);let m=(0,f.useCallback)(async b=>{let c=a.ai.providers?.[b]??{};k(a=>({...a,[b]:{state:"testing"}}));try{let a={provider:b};c.apiKey&&(a.apiKey=c.apiKey),c.model&&(a.model=c.model),"openai"===b&&c.baseUrl&&(a.baseUrl=c.baseUrl);let d=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),e=await d.json();e.ok?(k(a=>({...a,[b]:{state:"ok",latency:e.latency}})),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{k(a=>({...a,[b]:{state:"idle"}}))},8e3)):k(a=>({...a,[b]:{state:"error",error:e.error,code:e.code}}))}catch{k(a=>({...a,[b]:{state:"error",code:"network_error",error:"Network error"}}))}},[a.ai.providers]),n=(0,f.useCallback)((c,d)=>{"apiKey"in d&&k(a=>({...a,[c]:{state:"idle"}})),b({providers:{...a.ai.providers,[c]:{...a.ai.providers?.[c],...d}}})},[a.ai.providers,b]),o=a.ai.providers?.anthropic??{apiKey:"",model:""},q=a.ai.providers?.openai??{apiKey:"",model:"",baseUrl:""},r="anthropic"===i?o.apiKey:q.apiKey,s="anthropic"===i?g.ANTHROPIC_API_KEY:g.OPENAI_API_KEY,t=(a,b,c)=>{let f=j[a]??{state:"idle"},g="testing"===f.state||!b&&!c;return(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,d.jsx)("button",{type:"button",disabled:g,title:g?e.hints.testInProgressOrNoKey:void 0,onClick:()=>m(a),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"testing"===f.state?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin"}),e.settings.ai.testKeyTesting]}):e.settings.ai.testKey}),"ok"===f.state&&null!=f.latency&&(0,d.jsx)("span",{className:"text-xs text-success",children:e.settings.ai.testKeyOk(f.latency)}),"error"===f.state&&(0,d.jsxs)("span",{className:"text-xs text-error",children:["✗ ",function(a,b){switch(b){case"auth_error":return a.settings.ai.testKeyAuthError;case"model_not_found":return a.settings.ai.testKeyModelNotFound;case"rate_limited":return a.settings.ai.testKeyRateLimited;case"network_error":return a.settings.ai.testKeyNetworkError;default:return a.settings.ai.testKeyUnknown}}(e,f.code)]})]})};return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(bx.A,{size:15}),title:e.settings.ai.provider,description:"anthropic"===i?"Anthropic Claude":"OpenAI / compatible",children:[(0,d.jsx)("div",{className:"flex gap-2",children:["anthropic","openai"].map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>b({provider:a}),className:`flex-1 flex items-center gap-2.5 px-3.5 py-2.5 rounded-lg border transition-all ${i===a?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,d.jsx)("span",{className:`text-sm font-medium ${i===a?"text-foreground":"text-muted-foreground"}`,children:"anthropic"===a?"Anthropic":"OpenAI"}),(0,d.jsx)(F.Bt,{overridden:g.AI_PROVIDER})]},a))}),"anthropic"===i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.model," ",(0,d.jsx)(F.Bt,{overridden:g.ANTHROPIC_MODEL})]}),children:(0,d.jsx)(cH,{value:o.model,onChange:a=>{n("anthropic",{model:a})},placeholder:h.ANTHROPIC_MODEL||"claude-sonnet-4-6",provider:"anthropic",apiKey:o.apiKey,envKey:g.ANTHROPIC_API_KEY,t:e})}),(0,d.jsxs)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.apiKey," ",(0,d.jsx)(F.Bt,{overridden:g.ANTHROPIC_API_KEY})]}),hint:g.ANTHROPIC_API_KEY?e.settings.ai.envFieldNote("ANTHROPIC_API_KEY"):e.settings.ai.keyHint,children:[(0,d.jsx)(F.Ak,{value:o.apiKey,onChange:a=>{n("anthropic",{apiKey:a})}}),t("anthropic",!!o.apiKey,!!g.ANTHROPIC_API_KEY)]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.model," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_MODEL})]}),children:(0,d.jsx)(cH,{value:q.model,onChange:a=>{n("openai",{model:a})},placeholder:h.OPENAI_MODEL||"gpt-5.4",provider:"openai",apiKey:q.apiKey,envKey:g.OPENAI_API_KEY,baseUrl:q.baseUrl,t:e})}),(0,d.jsxs)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.apiKey," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_API_KEY})]}),hint:g.OPENAI_API_KEY?e.settings.ai.envFieldNote("OPENAI_API_KEY"):e.settings.ai.keyHint,children:[(0,d.jsx)(F.Ak,{value:q.apiKey,onChange:a=>{n("openai",{apiKey:a})}}),t("openai",!!q.apiKey,!!g.OPENAI_API_KEY)]}),(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.baseUrl," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_BASE_URL})]}),hint:e.settings.ai.baseUrlHint,children:(0,d.jsx)(F.pd,{value:q.baseUrl??"",onChange:a=>{n("openai",{baseUrl:a.target.value})},placeholder:h.OPENAI_BASE_URL||"https://api.openai.com/v1"})})]}),!r&&!s&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-destructive/80 bg-destructive/8 border border-destructive/20 rounded-lg px-3 py-2.5",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:e.settings.ai.noApiKey})]}),Object.values(g).some(Boolean)&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-[var(--amber)] bg-[var(--amber-subtle)] border border-[var(--amber)]/20 rounded-lg px-3 py-2.5",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:e.settings.ai.envHint})]})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(p.A,{size:15}),title:e.settings.agent.title,description:e.settings.agent.subtitle??"Configure how the AI agent operates",children:[(0,d.jsx)(F.pM,{label:e.settings.agent.maxSteps,hint:e.settings.agent.maxStepsHint,children:(0,d.jsxs)(F.l6,{value:String(a.agent?.maxSteps??20),onChange:a=>c({maxSteps:Number(a.target.value)}),className:"w-20",children:[(0,d.jsx)("option",{value:"5",children:"5"}),(0,d.jsx)("option",{value:"10",children:"10"}),(0,d.jsx)("option",{value:"15",children:"15"}),(0,d.jsx)("option",{value:"20",children:"20"}),(0,d.jsx)("option",{value:"25",children:"25"}),(0,d.jsx)("option",{value:"30",children:"30"})]})}),(0,d.jsx)(F.pM,{label:e.settings.agent.contextStrategy,hint:e.settings.agent.contextStrategyHint,children:(0,d.jsxs)(F.l6,{value:a.agent?.contextStrategy??"auto",onChange:a=>c({contextStrategy:a.target.value}),className:"w-24",children:[(0,d.jsx)("option",{value:"auto",children:e.settings.agent.contextStrategyAuto}),(0,d.jsx)("option",{value:"off",children:e.settings.agent.contextStrategyOff})]})}),(0,d.jsx)(F.pM,{label:e.settings.agent.reconnectRetries,hint:e.settings.agent.reconnectRetriesHint,children:(0,d.jsxs)(F.l6,{value:String(a.agent?.reconnectRetries??3),onChange:a=>{let b=Number(a.target.value);c({reconnectRetries:b});try{localStorage.setItem("mindos-reconnect-retries",String(b))}catch(a){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",a)}},className:"w-20",children:[(0,d.jsx)("option",{value:"0",children:"Off"}),(0,d.jsx)("option",{value:"1",children:"1"}),(0,d.jsx)("option",{value:"2",children:"2"}),(0,d.jsx)("option",{value:"3",children:"3"}),(0,d.jsx)("option",{value:"5",children:"5"}),(0,d.jsx)("option",{value:"10",children:"10"})]})}),"anthropic"===i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.pM,{label:e.settings.agent.thinking,hint:e.settings.agent.thinkingHint,children:(0,d.jsx)(F.lM,{checked:a.agent?.enableThinking??!1,onChange:()=>c({enableThinking:!a.agent?.enableThinking})})}),a.agent?.enableThinking&&(0,d.jsx)(F.D0,{label:e.settings.agent.thinkingBudget,hint:e.settings.agent.thinkingBudgetHint,children:(0,d.jsx)(F.pd,{type:"number",value:String(a.agent?.thinkingBudget??5e3),onChange:a=>{let b=parseInt(a.target.value,10);isNaN(b)||c({thinkingBudget:Math.max(1e3,Math.min(5e4,b))})},min:1e3,max:5e4,step:1e3})})]})]}),(0,d.jsx)(cI,{})]})}function cH({value:a,onChange:b,placeholder:c,provider:e,apiKey:g,envKey:h,baseUrl:i,t:j}){let[k,l]=(0,f.useState)(null),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),s=(0,f.useRef)(null),t=!!g||!!h,u=(0,f.useCallback)(async()=>{if(!m){n(!0),r("");try{let a={provider:e};g&&(a.apiKey=g),i&&(a.baseUrl=i);let b=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();c.ok&&Array.isArray(c.models)?(l(c.models),p(!0)):r(c.error||"Failed to fetch models")}catch{r("Network error")}finally{n(!1)}}},[e,g,i,m]);return(0,d.jsxs)("div",{ref:s,className:"relative",children:[(0,d.jsxs)("div",{className:"flex gap-1.5",children:[(0,d.jsx)(F.pd,{value:a,onChange:a=>b(a.target.value),placeholder:c,className:"flex-1"}),(0,d.jsxs)("button",{type:"button",disabled:!t||m,onClick:u,title:j.settings.ai.listModels,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[m?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(ae.A,{size:12}),j.settings.ai.listModels]})]}),q&&(0,d.jsx)("p",{className:"text-xs text-error mt-1",children:q}),o&&k&&k.length>0&&(0,d.jsx)("div",{className:"absolute z-50 mt-1 w-full max-h-48 overflow-y-auto rounded-lg border border-border bg-popover shadow-lg",children:k.map(c=>(0,d.jsx)("button",{type:"button",className:`w-full text-left px-3 py-1.5 text-sm hover:bg-accent transition-colors ${c===a?"bg-accent/60 font-medium":""}`,onClick:()=>{b(c),p(!1)},children:c},c))}),o&&k&&0===k.length&&(0,d.jsx)("div",{className:"absolute z-50 mt-1 w-full rounded-lg border border-border bg-popover shadow-lg px-3 py-2 text-xs text-muted-foreground",children:j.settings.ai.noModelsFound})]})}function cI(){let{t:a}=(0,v.Y)(),[b,c]=(0,f.useState)("panel");return(0,d.jsx)(F.L7,{icon:(0,d.jsx)(cs.A,{size:15}),title:a.settings.askDisplayMode?.label??"Display Mode",description:a.settings.askDisplayMode?.hint??"Side panel stays docked on the right. Popup opens a floating dialog.",children:(0,d.jsxs)(F.l6,{value:b,onChange:a=>(a=>{c(a);try{localStorage.setItem("ask-mode",a)}catch(a){console.warn("[AiTab] localStorage setItem ask-mode failed:",a)}window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:a}))})(a.target.value),children:[(0,d.jsx)("option",{value:"panel",children:a.settings.askDisplayMode?.panel??"Side Panel"}),(0,d.jsx)("option",{value:"popup",children:a.settings.askDisplayMode?.popup??"Popup"})]})})}var cJ=c(35654),cK=c(83052),cL=c(3541),cM=c(99917);let cN=[{value:"680px",label:"Narrow",width:42},{value:"780px",label:"Default",width:56},{value:"960px",label:"Wide",width:75},{value:"100%",label:"Full",width:100}],cO=[{value:"lora",label:"Lora",category:"Serif",style:{fontFamily:"Lora, Georgia, serif"}},{value:"ibm-plex-sans",label:"IBM Plex Sans",category:"Sans",style:{fontFamily:"'IBM Plex Sans', sans-serif"}},{value:"geist",label:"Geist",category:"Sans",style:{fontFamily:"var(--font-geist-sans), sans-serif"}},{value:"ibm-plex-mono",label:"IBM Plex Mono",category:"Mono",style:{fontFamily:"'IBM Plex Mono', monospace"}}];function cP({icon:a,label:b,children:c}){return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:a}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:b})]}),c]})}function cQ({options:a,value:b,onChange:c}){return(0,d.jsx)("div",{className:"flex gap-2",children:a.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.value),className:`flex items-center gap-1.5 px-3.5 py-2 text-sm font-medium rounded-xl transition-all ${b===a.value?"bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[a.icon,a.label]},a.value))})}function cR({font:a,setFont:b,fontSize:c,setFontSize:e,contentWidth:g,setContentWidth:h,dark:i,setDark:j,locale:k,setLocale:l,t:m}){let[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(()=>"system"),[r,s]=(0,f.useState)(()=>"system"),t=m.settings.appearance;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cJ.A,{size:15}),title:t.readingTitle??"Reading",description:t.readingDesc??"Customize how your notes look",children:[(0,d.jsx)(cP,{icon:(0,d.jsx)(cK.A,{size:14}),label:t.readingFont,children:(0,d.jsx)("div",{className:"space-y-0.5",children:cO.map(c=>{let e=a===c.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>b(c.value),className:`flex items-center gap-4 w-full px-3 py-2.5 rounded-lg transition-all text-left relative ${e?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[e&&(0,d.jsx)("div",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:`text-xl font-medium w-10 text-center shrink-0 ${e?"text-foreground":"text-muted-foreground/60"}`,style:{fontFamily:c.style.fontFamily},children:"Aa"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:`text-sm font-medium ${e?"text-foreground":"text-muted-foreground"}`,style:{fontFamily:c.style.fontFamily},children:c.label}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/50",children:c.category})]}),(0,d.jsx)("p",{className:`text-sm truncate mt-0.5 ${e?"text-muted-foreground":"text-muted-foreground/40"}`,style:{fontFamily:c.style.fontFamily},children:t.fontPreview})]})]},c.value)})})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(cL.A,{size:14}),label:t.fontSize,children:(0,d.jsxs)("div",{className:"px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 shrink-0",style:{fontSize:"11px"},children:"A"}),(0,d.jsx)("input",{type:"range",min:14,max:17,step:1,value:parseInt(c),onChange:a=>e(`${a.target.value}px`),className:"flex-1 h-1.5 rounded-full appearance-none bg-muted cursor-pointer accent-[var(--amber)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[var(--amber)] [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[var(--amber)] [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:cursor-pointer"}),(0,d.jsx)("span",{className:"text-base text-muted-foreground/60 shrink-0",children:"A"})]}),(0,d.jsx)("div",{className:"text-center mt-1.5",children:(0,d.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground",children:[parseInt(c),"px"]})}),(0,d.jsx)("p",{className:"text-muted-foreground leading-relaxed mt-2 px-1",style:{fontSize:c,fontFamily:cO.find(b=>b.value===a)?.style.fontFamily},children:t.fontSizePreview})]})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(cM.A,{size:14}),label:t.contentWidth,children:(0,d.jsx)("div",{className:"space-y-1",children:cN.map(a=>{let b=g===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>h(a.value),className:`flex items-center gap-3 w-full px-3 py-2 rounded-lg transition-all ${b?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[(0,d.jsx)("div",{className:"flex-1 h-2 rounded-full bg-muted/40 overflow-hidden",children:(0,d.jsx)("div",{className:`h-full rounded-full transition-all ${b?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,style:{width:`${a.width}%`}})}),(0,d.jsx)("span",{className:`text-sm shrink-0 w-14 text-right ${b?"text-foreground font-medium":"text-muted-foreground"}`,children:a.label})]},a.value)})})})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cF.A,{size:15}),title:t.preferencesTitle??"Preferences",children:[(0,d.jsx)(cP,{icon:(0,d.jsx)(bo.A,{size:14}),label:t.colorTheme,children:(0,d.jsx)(cQ,{options:[{value:"system",label:t.system,icon:(0,d.jsx)(cs.A,{size:14})},{value:"dark",label:t.dark,icon:(0,d.jsx)(cA.A,{size:14})},{value:"light",label:t.light,icon:(0,d.jsx)(bo.A,{size:14})}],value:p,onChange:a=>{q(a),localStorage.setItem("theme",a);let b="system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches:"dark"===a;j(b),document.documentElement.classList.toggle("dark",b)}})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(aT.A,{size:14}),label:t.language,children:(0,d.jsx)(cQ,{options:[{value:"system",label:t.system,icon:(0,d.jsx)(cs.A,{size:14})},{value:"en",label:"EN"},{value:"zh",label:"中文"}],value:r,onChange:a=>{s(a),localStorage.setItem("locale",a);let b="system"===a?navigator.language.startsWith("zh")?"zh":"en":a;l(b),document.cookie=`locale=${b};path=/;max-age=31536000;SameSite=Lax`}})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/40 px-0.5",children:t.browserNote}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[n?(0,d.jsx)(ae.A,{size:14}):(0,d.jsx)(u.A,{size:14}),m.settings.tabs.shortcuts]}),n&&(0,d.jsx)("div",{className:"mt-3 space-y-0.5",children:m.shortcuts.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 px-1",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:a.description}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs font-mono bg-muted border border-border rounded text-muted-foreground",children:a},b))})]},b))})]})]})}var cS=c(27381),cT=c(19236),cU=c(66336);function cV(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(2)} GB`}c(47038);var cW=c(78365);function cX({data:a,setData:b,t:c}){let e=a.envOverrides??{},g=c.settings.knowledge,[h,i]=(0,f.useState)(()=>!1),[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)(!1),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(null),[r,t]=(0,f.useState)(!1),u=(0,f.useCallback)(()=>{let a=!r;t(a);let b={dismissed:a};a||(b.active=!0),(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:b})}).then(()=>window.dispatchEvent(new Event("guide-state-updated"))).catch(b=>{console.error("Failed to update guide state:",b),t(!a)})},[r]),v=(0,f.useCallback)(()=>{(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{active:!0,dismissed:!1,walkthroughStep:0,walkthroughDismissed:!1}})}).then(()=>{q(!0),t(!1),window.dispatchEvent(new Event("guide-state-updated"))}).catch(a=>console.error("Failed to restart walkthrough:",a))},[]),w=(0,f.useSyncExternalStore)(()=>()=>{},()=>`${window.location.protocol}//${window.location.hostname}`,()=>"http://localhost"),[x,z]=(0,f.useState)(!1),A="***set***"===a.webPassword,[B,C]=(0,f.useState)(!1),[E,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(!1),[J,K]=(0,f.useState)(!1),L=!!a.authToken,M=E??a.authToken??"";async function N(){C(!0);try{let a=await (0,y.n)("/api/settings/reset-token",{method:"POST"});G(a.token),b(b=>b?{...b,authToken:a.token}:b)}finally{C(!1)}}async function O(){b(a=>a?{...a,authToken:""}:a),G(null)}return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cS.A,{size:15}),title:"Knowledge Base",description:g.sopRootHint,children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[g.sopRoot," ",(0,d.jsx)(F.Bt,{overridden:e.MIND_ROOT})]}),hint:e.MIND_ROOT?g.envNote:g.sopRootHint,children:(0,d.jsx)(F.pd,{value:a.mindRoot,onChange:a=>b(b=>b?{...b,mindRoot:a.target.value}:b),placeholder:"/path/to/your/notes"})}),(0,d.jsx)(F.pM,{label:g.showHiddenFiles,hint:g.showHiddenFilesHint,children:(0,d.jsx)(F.lM,{checked:h,onChange:()=>{let a=!h;i(a),localStorage.setItem(ax,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}})}),null!==j&&j>0&&null===n&&(0,d.jsx)(F.pM,{label:g.cleanupExamples,hint:g.cleanupExamplesHint,children:(0,d.jsxs)("button",{onClick:()=>K(!0),disabled:l,title:l?c.hints.cleanupInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0 disabled:opacity-50",children:[l?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(ad.A,{size:12}),g.cleanupExamplesButton,(0,d.jsx)("span",{className:"ml-1 tabular-nums text-2xs opacity-70",children:j})]})}),null!==n&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(a0.A,{size:14}),g.cleanupExamplesDone(n)]})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cT.A,{size:15}),title:"Security",children:[(0,d.jsx)(F.D0,{label:g.webPassword,hint:g.webPasswordHint,children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(F.pd,{type:x?"text":"password",value:A?"••••••••":a.webPassword??"",onChange:a=>b(b=>b?{...b,webPassword:a.target.value}:b),onFocus:()=>{A&&b(a=>a?{...a,webPassword:""}:a)},placeholder:"Leave empty to disable"}),(0,d.jsx)("button",{type:"button",onClick:()=>z(a=>!a),className:"px-3 py-2 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:x?"Hide":"Show"})]})}),(0,d.jsx)(F.D0,{label:g.authToken,hint:L?g.authTokenHint:g.authTokenNone,children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-background border border-border rounded-lg min-h-[38px]",children:[(0,d.jsx)("code",{className:"flex-1 text-xs font-mono text-foreground break-all select-all",children:M||(0,d.jsx)("span",{className:"text-muted-foreground italic",children:"— not set —"})}),M&&(0,d.jsx)("button",{type:"button",onClick:function(){let b=E??a.authToken??"";b&&(0,cu.l)(b).then(a=>{a&&ar.oR.copy()})},className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground transition-colors",title:g.authTokenCopy,children:(0,d.jsx)(ab.A,{size:13})})]}),a.mcpPort&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[g.authTokenMcpPort,": ",(0,d.jsx)("code",{className:"font-mono",children:a.mcpPort}),M&&(0,d.jsxs)(d.Fragment,{children:[" \xa0\xb7\xa0 MCP URL: ",(0,d.jsx)("code",{className:"font-mono select-all",children:`${w}:${a.mcpPort}/mcp`})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:function(){I(!0)},disabled:B,title:B?c.hints.tokenResetInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:B?"animate-spin":""}),g.authTokenReset]}),L&&(0,d.jsxs)("button",{type:"button",onClick:O,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 transition-colors",children:[(0,d.jsx)(ad.A,{size:14}),g.authTokenClear]})]}),E&&(0,d.jsx)("p",{className:"text-xs text-[var(--amber-text)]",children:"New token generated. Copy it now — it won't be shown in full again."})]})})]}),null!==p&&(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(bx.A,{size:15}),title:c.guide?.title??"Getting Started",children:[(0,d.jsx)(F.pM,{label:c.guide?.showGuide??"Show getting started guide",children:(0,d.jsx)(F.lM,{checked:!r,onChange:()=>u()})}),(0,d.jsxs)("button",{onClick:v,className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(cz.A,{size:14}),g.restartWalkthrough??"Restart walkthrough"]})]}),(0,d.jsx)(cY,{}),(0,d.jsx)(as.TM,{open:H,title:g.authTokenReset??"Regenerate Token",message:g.authTokenResetConfirm,confirmLabel:g.authTokenReset??"Regenerate",cancelLabel:"Cancel",onConfirm:()=>{I(!1),N()},onCancel:()=>I(!1)}),(0,d.jsx)(as.TM,{open:J,title:g.cleanupExamples??"Cleanup Examples",message:null!==j?g.cleanupExamplesConfirm(j):"",confirmLabel:g.cleanupExamplesButton??"Clean up",cancelLabel:"Cancel",variant:"destructive",onConfirm:async()=>{K(!1),m(!0);let a=await (0,cW.E)();m(!1),a.success&&(o(a.deleted),k(0))},onCancel:()=>K(!1)})]})}function cY(){let[a,b]=(0,f.useState)(!1),[c,e]=(0,f.useState)(null),[g,h]=(0,f.useState)(!1);return(0,f.useCallback)(async()=>{h(!0);try{let a=await (0,y.n)("/api/monitoring",{timeout:5e3});e(a)}catch{}h(!1)},[]),(0,f.useRef)(!1),(0,d.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,d.jsxs)("button",{onClick:()=>b(a=>!a),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors w-full",children:[a?(0,d.jsx)(ae.A,{size:14}):(0,d.jsx)(u.A,{size:14}),(0,d.jsx)(cU.A,{size:12}),"System Monitoring",g&&(0,d.jsx)(D.A,{size:10,className:"animate-spin ml-1"})]}),a&&c&&(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-xs",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Heap"}),(0,d.jsxs)("span",{className:"ml-2 tabular-nums",children:[cV(c.system.memory.heapUsed)," / ",cV(c.system.memory.heapTotal)]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"RSS"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:cV(c.system.memory.rss)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Uptime"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:function(a){let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);if(c<60)return`${c}m ${b%60}s`;let d=Math.floor(c/60);if(d<24)return`${d}h ${c%60}m`;let e=Math.floor(d/24);return`${e}d ${d%24}h`}(c.system.uptimeMs)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Node"}),(0,d.jsx)("span",{className:"ml-2",children:c.system.nodeVersion})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Requests"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.agentRequests})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Tool Calls"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.toolExecutions})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Tokens"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:(c.application.totalTokens.input+c.application.totalTokens.output).toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Files"}),(0,d.jsxs)("span",{className:"ml-2 tabular-nums",children:[c.knowledgeBase.fileCount," (",cV(c.knowledgeBase.totalSizeBytes),")"]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"MCP"}),(0,d.jsx)("span",{className:"ml-2",children:c.mcp.running?`Running :${c.mcp.port}`:"Stopped"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Errors"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.errors})]})]}),a&&!c&&!g&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Failed to load monitoring data"})]})}var cZ=c(27608);function c$({agents:a,t:b,onRefresh:c}){let e=b.settings?.mcp,[g,h]=(0,f.useState)(new Set),[i,j]=(0,f.useState)("auto"),[k,l]=(0,f.useState)("http://localhost:8787/mcp"),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)({}),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(null),u=async()=>{if(0!==g.size){r(!0),t(null);try{let b={agents:[...g].map(b=>{let c=a.find(a=>a.key===b),d="auto"===i?c?.preferredTransport||"stdio":i;return{key:b,scope:o[b]||(c?.hasProjectScope?"project":"global"),transport:d}}),transport:i,..."http"===i?{url:k,token:m}:{},..."auto"===i?{url:k,token:m}:{}},d=await (0,y.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),f=d.results.filter(a=>"ok"===a.status).length,j=d.results.filter(a=>"error"===a.status);j.length>0?t({type:"error",text:j.map(a=>`${a.agent}: ${a.message}`).join("; ")}):t({type:"success",text:e?.installSuccess?e.installSuccess(f):`${f} agent(s) configured`}),h(new Set),c()}catch{t({type:"error",text:e?.installFailed??"Install failed"})}finally{r(!1),setTimeout(()=>t(null),4e3)}}},v="http"===i||"auto"===i&&[...g].some(b=>{let c=a.find(a=>a.key===b);return c?.preferredTransport==="http"});return(0,d.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,d.jsx)("div",{className:"space-y-1",children:a.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 py-1.5 text-sm",children:[(0,d.jsx)("input",{type:"checkbox",checked:g.has(a.key),onChange:()=>{var b;return b=a.key,void h(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"form-check"}),(0,d.jsx)("span",{className:"w-28 shrink-0 text-xs",children:a.name}),(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-mono bg-muted",children:"auto"===i?a.preferredTransport:i}),a.installed?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-success/15 text-success font-mono",children:a.transport}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:a.scope})]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:a.present?e?.detected??"Detected":e?.notFound??"Not found"}),g.has(a.key)&&a.hasProjectScope&&a.hasGlobalScope&&(0,d.jsx)(cZ.A,{value:o[a.key]||"project",onChange:b=>p({...o,[a.key]:b}),size:"sm",className:"ml-auto",options:[{value:"project",label:e?.project??"Project"},{value:"global",label:e?.global??"Global"}]})]},a.key))}),(0,d.jsxs)("div",{className:"flex gap-2 text-xs pt-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>h(new Set(a.filter(a=>!a.installed&&a.present).map(a=>a.key))),className:"px-2.5 py-1 rounded-md border border-[var(--amber)] text-[var(--amber)] transition-colors hover:bg-muted/50",children:e?.selectDetected??"Select Detected"}),(0,d.jsx)("button",{type:"button",onClick:()=>h(new Set),className:"px-2.5 py-1 rounded-md border border-border text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:e?.clearSelection??"Clear"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-4 text-xs pt-1",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"auto"===i,onChange:()=>j("auto"),className:"form-radio"}),e?.transportAuto??"auto (recommended)"]}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"stdio"===i,onChange:()=>j("stdio"),className:"form-radio"}),e?.transportStdio??"stdio"]}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"http"===i,onChange:()=>j("http"),className:"form-radio"}),e?.transportHttp??"http"]})]}),v&&(0,d.jsxs)("div",{className:"space-y-2 pl-5 text-xs",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-muted-foreground",children:e?.httpUrl??"MCP URL"}),(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-muted-foreground",children:e?.httpToken??"Auth Token"}),(0,d.jsx)("input",{type:"password",value:m,onChange:a=>n(a.target.value),placeholder:"Bearer token",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]})]}),(0,d.jsxs)("button",{onClick:u,disabled:0===g.size||q,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed bg-[var(--amber)] text-[var(--amber-foreground)]",children:[q&&(0,d.jsx)(D.A,{size:12,className:"animate-spin"}),q?e?.installing??"Installing...":e?.installSelected??"Install Selected"]}),s&&(0,d.jsx)("div",{className:"flex items-center gap-1.5 text-xs",role:"status",children:"success"===s.type?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:s.text})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:s.text})]})})]})}var c_=c(90314);let c0=(0,c_.default)(async()=>{},{loadableGenerated:{modules:["components/settings/McpSkillRow.tsx -> @/components/MarkdownView"]},ssr:!1});function c1({skill:a,expanded:b,onExpand:c,onToggle:e,onDelete:f,onEditStart:g,onEditSave:h,onEditCancel:i,editing:j,editContent:k,setEditContent:l,editError:m,saving:n,fullContent:o,loadingContent:p,loadErrors:q,m:r}){return(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>c(a.name),children:[b?(0,d.jsx)(ae.A,{size:12}):(0,d.jsx)(u.A,{size:12}),(0,d.jsx)("span",{className:"text-xs font-medium flex-1",children:a.name}),(0,d.jsx)("span",{className:`text-2xs px-1.5 py-0.5 rounded ${"builtin"===a.source?"bg-muted text-muted-foreground":"bg-[var(--amber-subtle)] text-[var(--amber-text)]"}`,children:"builtin"===a.source?r?.skillBuiltin??"Built-in":r?.skillUser??"Custom"}),(0,d.jsx)(F.lM,{size:"sm",checked:a.enabled,onClick:b=>{b.stopPropagation(),e(a.name,!a.enabled)}})]}),b&&(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border text-xs space-y-2 bg-muted/20",children:[(0,d.jsx)("p",{className:"text-muted-foreground",children:a.description||"No description"}),(0,d.jsx)("p",{className:"text-muted-foreground font-mono text-2xs",children:a.path}),p===a.name?(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),(0,d.jsx)("span",{className:"text-2xs",children:"Loading..."})]}):o[a.name]?(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-2xs text-muted-foreground font-medium",children:r?.skillContent??"Content"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.editable&&j!==a.name&&(0,d.jsxs)("button",{onClick:()=>g(a.name),className:"flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(ac.A,{size:10}),r?.editSkill??"Edit"]}),a.editable&&(0,d.jsxs)("button",{onClick:()=>f(a.name),className:"flex items-center gap-1 text-2xs text-destructive hover:underline",children:[(0,d.jsx)(ad.A,{size:10}),r?.deleteSkill??"Delete"]})]})]}),j===a.name?(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("textarea",{value:k,onChange:a=>l(a.target.value),rows:Math.min(20,(k.match(/\n/g)||[]).length+3),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{onClick:()=>h(a.name),disabled:n,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[n&&(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),r?.saveSkill??"Save"]}),(0,d.jsx)("button",{onClick:i,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:r?.cancelSkill??"Cancel"})]}),m&&(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),m]})]}):(0,d.jsx)("div",{className:"w-full rounded-md border border-border bg-background/50 max-h-[300px] overflow-y-auto px-2.5 py-1.5 text-xs [&_.prose]:max-w-none [&_.prose]:text-xs [&_h1]:text-sm [&_h2]:text-xs [&_h3]:text-xs [&_pre]:text-2xs [&_code]:text-2xs",children:(0,d.jsx)(c0,{content:function(a){if(!a.startsWith("---"))return a;let b=a.indexOf("\n---",3);return -1===b?a:a.slice(b+4).replace(/^\n+/,"")}(o[a.name])})})]}):q[a.name]?(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),q[a.name]]}):null]})]})}let c2=a=>`---
|
|
100
|
+
`,children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a.icon}),(0,d.jsx)("span",{className:"text-sm text-foreground flex-1",children:a.label}),a.shortcut&&(0,d.jsx)("kbd",{className:"text-xs text-muted-foreground/60 font-mono border border-border rounded px-1.5 py-0.5",children:a.shortcut})]},a.id))})]})}):null}function cD({open:a,onClose:b,currentFile:c,initialMessage:e,initialAcpAgent:f,onFirstMessage:g,askMode:h,onModeSwitch:i}){let{t:j}=(0,v.Y)();return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-end md:items-start justify-center md:pt-[10vh] modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(),children:(0,d.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":j.ask.title,className:"w-full md:max-w-2xl md:mx-4 bg-card border-t md:border border-border rounded-t-2xl md:rounded-xl shadow-2xl flex flex-col h-[92vh] md:h-auto md:max-h-[75vh]",children:(0,d.jsx)(cp,{visible:a,variant:"modal",onClose:b,currentFile:c,initialMessage:e,initialAcpAgent:f,onFirstMessage:g,askMode:h,onModeSwitch:i})})}):null}var cE=c(87148),cF=c(36041);function cG({data:a,updateAi:b,updateAgent:c,t:e}){let g=a.envOverrides??{},h=a.envValues??{},i=a.ai.provider,[j,k]=(0,f.useState)({}),l=(0,f.useRef)(void 0);(0,f.useRef)(i);let m=(0,f.useCallback)(async b=>{let c=a.ai.providers?.[b]??{};k(a=>({...a,[b]:{state:"testing"}}));try{let a={provider:b};c.apiKey&&(a.apiKey=c.apiKey),c.model&&(a.model=c.model),"openai"===b&&c.baseUrl&&(a.baseUrl=c.baseUrl);let d=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),e=await d.json();e.ok?(k(a=>({...a,[b]:{state:"ok",latency:e.latency}})),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{k(a=>({...a,[b]:{state:"idle"}}))},8e3)):k(a=>({...a,[b]:{state:"error",error:e.error,code:e.code}}))}catch{k(a=>({...a,[b]:{state:"error",code:"network_error",error:"Network error"}}))}},[a.ai.providers]),n=(0,f.useCallback)((c,d)=>{"apiKey"in d&&k(a=>({...a,[c]:{state:"idle"}})),b({providers:{...a.ai.providers,[c]:{...a.ai.providers?.[c],...d}}})},[a.ai.providers,b]),o=a.ai.providers?.anthropic??{apiKey:"",model:""},q=a.ai.providers?.openai??{apiKey:"",model:"",baseUrl:""},r="anthropic"===i?o.apiKey:q.apiKey,s="anthropic"===i?g.ANTHROPIC_API_KEY:g.OPENAI_API_KEY,t=(a,b,c)=>{let f=j[a]??{state:"idle"},g="testing"===f.state||!b&&!c;return(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,d.jsx)("button",{type:"button",disabled:g,title:g?e.hints.testInProgressOrNoKey:void 0,onClick:()=>m(a),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"testing"===f.state?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin"}),e.settings.ai.testKeyTesting]}):e.settings.ai.testKey}),"ok"===f.state&&null!=f.latency&&(0,d.jsx)("span",{className:"text-xs text-success",children:e.settings.ai.testKeyOk(f.latency)}),"error"===f.state&&(0,d.jsxs)("span",{className:"text-xs text-error",children:["✗ ",function(a,b){switch(b){case"auth_error":return a.settings.ai.testKeyAuthError;case"model_not_found":return a.settings.ai.testKeyModelNotFound;case"rate_limited":return a.settings.ai.testKeyRateLimited;case"network_error":return a.settings.ai.testKeyNetworkError;default:return a.settings.ai.testKeyUnknown}}(e,f.code)]})]})};return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(bx.A,{size:15}),title:e.settings.ai.provider,description:"anthropic"===i?"Anthropic Claude":"OpenAI / compatible",children:[(0,d.jsx)("div",{className:"flex gap-2",children:["anthropic","openai"].map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>b({provider:a}),className:`flex-1 flex items-center gap-2.5 px-3.5 py-2.5 rounded-lg border transition-all ${i===a?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,d.jsx)("span",{className:`text-sm font-medium ${i===a?"text-foreground":"text-muted-foreground"}`,children:"anthropic"===a?"Anthropic":"OpenAI"}),(0,d.jsx)(F.Bt,{overridden:g.AI_PROVIDER})]},a))}),"anthropic"===i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.model," ",(0,d.jsx)(F.Bt,{overridden:g.ANTHROPIC_MODEL})]}),children:(0,d.jsx)(cH,{value:o.model,onChange:a=>{n("anthropic",{model:a})},placeholder:h.ANTHROPIC_MODEL||"claude-sonnet-4-6",provider:"anthropic",apiKey:o.apiKey,envKey:g.ANTHROPIC_API_KEY,t:e})}),(0,d.jsxs)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.apiKey," ",(0,d.jsx)(F.Bt,{overridden:g.ANTHROPIC_API_KEY})]}),hint:g.ANTHROPIC_API_KEY?e.settings.ai.envFieldNote("ANTHROPIC_API_KEY"):e.settings.ai.keyHint,children:[(0,d.jsx)(F.Ak,{value:o.apiKey,onChange:a=>{n("anthropic",{apiKey:a})}}),t("anthropic",!!o.apiKey,!!g.ANTHROPIC_API_KEY)]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.model," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_MODEL})]}),children:(0,d.jsx)(cH,{value:q.model,onChange:a=>{n("openai",{model:a})},placeholder:h.OPENAI_MODEL||"gpt-5.4",provider:"openai",apiKey:q.apiKey,envKey:g.OPENAI_API_KEY,baseUrl:q.baseUrl,t:e})}),(0,d.jsxs)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.apiKey," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_API_KEY})]}),hint:g.OPENAI_API_KEY?e.settings.ai.envFieldNote("OPENAI_API_KEY"):e.settings.ai.keyHint,children:[(0,d.jsx)(F.Ak,{value:q.apiKey,onChange:a=>{n("openai",{apiKey:a})}}),t("openai",!!q.apiKey,!!g.OPENAI_API_KEY)]}),(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[e.settings.ai.baseUrl," ",(0,d.jsx)(F.Bt,{overridden:g.OPENAI_BASE_URL})]}),hint:e.settings.ai.baseUrlHint,children:(0,d.jsx)(F.pd,{value:q.baseUrl??"",onChange:a=>{n("openai",{baseUrl:a.target.value})},placeholder:h.OPENAI_BASE_URL||"https://api.openai.com/v1"})})]}),!r&&!s&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-destructive/80 bg-destructive/8 border border-destructive/20 rounded-lg px-3 py-2.5",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:e.settings.ai.noApiKey})]}),Object.values(g).some(Boolean)&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-xs text-[var(--amber)] bg-[var(--amber-subtle)] border border-[var(--amber)]/20 rounded-lg px-3 py-2.5",children:[(0,d.jsx)(A.A,{size:13,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{children:e.settings.ai.envHint})]})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(p.A,{size:15}),title:e.settings.agent.title,description:e.settings.agent.subtitle??"Configure how the AI agent operates",children:[(0,d.jsx)(F.pM,{label:e.settings.agent.maxSteps,hint:e.settings.agent.maxStepsHint,children:(0,d.jsxs)(F.l6,{value:String(a.agent?.maxSteps??20),onChange:a=>c({maxSteps:Number(a.target.value)}),className:"w-20",children:[(0,d.jsx)("option",{value:"5",children:"5"}),(0,d.jsx)("option",{value:"10",children:"10"}),(0,d.jsx)("option",{value:"15",children:"15"}),(0,d.jsx)("option",{value:"20",children:"20"}),(0,d.jsx)("option",{value:"25",children:"25"}),(0,d.jsx)("option",{value:"30",children:"30"})]})}),(0,d.jsx)(F.pM,{label:e.settings.agent.contextStrategy,hint:e.settings.agent.contextStrategyHint,children:(0,d.jsxs)(F.l6,{value:a.agent?.contextStrategy??"auto",onChange:a=>c({contextStrategy:a.target.value}),className:"w-24",children:[(0,d.jsx)("option",{value:"auto",children:e.settings.agent.contextStrategyAuto}),(0,d.jsx)("option",{value:"off",children:e.settings.agent.contextStrategyOff})]})}),(0,d.jsx)(F.pM,{label:e.settings.agent.reconnectRetries,hint:e.settings.agent.reconnectRetriesHint,children:(0,d.jsxs)(F.l6,{value:String(a.agent?.reconnectRetries??3),onChange:a=>{let b=Number(a.target.value);c({reconnectRetries:b});try{localStorage.setItem("mindos-reconnect-retries",String(b))}catch(a){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",a)}},className:"w-20",children:[(0,d.jsx)("option",{value:"0",children:"Off"}),(0,d.jsx)("option",{value:"1",children:"1"}),(0,d.jsx)("option",{value:"2",children:"2"}),(0,d.jsx)("option",{value:"3",children:"3"}),(0,d.jsx)("option",{value:"5",children:"5"}),(0,d.jsx)("option",{value:"10",children:"10"})]})}),"anthropic"===i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.pM,{label:e.settings.agent.thinking,hint:e.settings.agent.thinkingHint,children:(0,d.jsx)(F.lM,{checked:a.agent?.enableThinking??!1,onChange:()=>c({enableThinking:!a.agent?.enableThinking})})}),a.agent?.enableThinking&&(0,d.jsx)(F.D0,{label:e.settings.agent.thinkingBudget,hint:e.settings.agent.thinkingBudgetHint,children:(0,d.jsx)(F.pd,{type:"number",value:String(a.agent?.thinkingBudget??5e3),onChange:a=>{let b=parseInt(a.target.value,10);isNaN(b)||c({thinkingBudget:Math.max(1e3,Math.min(5e4,b))})},min:1e3,max:5e4,step:1e3})})]})]}),(0,d.jsx)(cI,{})]})}function cH({value:a,onChange:b,placeholder:c,provider:e,apiKey:g,envKey:h,baseUrl:i,t:j}){let[k,l]=(0,f.useState)(null),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),s=(0,f.useRef)(null),t=!!g||!!h,u=(0,f.useCallback)(async()=>{if(!m){n(!0),r("");try{let a={provider:e};g&&(a.apiKey=g),i&&(a.baseUrl=i);let b=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();c.ok&&Array.isArray(c.models)?(l(c.models),p(!0)):r(c.error||"Failed to fetch models")}catch{r("Network error")}finally{n(!1)}}},[e,g,i,m]);return(0,d.jsxs)("div",{ref:s,className:"relative",children:[(0,d.jsxs)("div",{className:"flex gap-1.5",children:[(0,d.jsx)(F.pd,{value:a,onChange:a=>b(a.target.value),placeholder:c,className:"flex-1"}),(0,d.jsxs)("button",{type:"button",disabled:!t||m,onClick:u,title:j.settings.ai.listModels,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[m?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(ae.A,{size:12}),j.settings.ai.listModels]})]}),q&&(0,d.jsx)("p",{className:"text-xs text-error mt-1",children:q}),o&&k&&k.length>0&&(0,d.jsx)("div",{className:"absolute z-50 mt-1 w-full max-h-48 overflow-y-auto rounded-lg border border-border bg-popover shadow-lg",children:k.map(c=>(0,d.jsx)("button",{type:"button",className:`w-full text-left px-3 py-1.5 text-sm hover:bg-accent transition-colors ${c===a?"bg-accent/60 font-medium":""}`,onClick:()=>{b(c),p(!1)},children:c},c))}),o&&k&&0===k.length&&(0,d.jsx)("div",{className:"absolute z-50 mt-1 w-full rounded-lg border border-border bg-popover shadow-lg px-3 py-2 text-xs text-muted-foreground",children:j.settings.ai.noModelsFound})]})}function cI(){let{t:a}=(0,v.Y)(),[b,c]=(0,f.useState)("panel");return(0,d.jsx)(F.L7,{icon:(0,d.jsx)(cs.A,{size:15}),title:a.settings.askDisplayMode?.label??"Display Mode",description:a.settings.askDisplayMode?.hint??"Side panel stays docked on the right. Popup opens a floating dialog.",children:(0,d.jsxs)(F.l6,{value:b,onChange:a=>(a=>{c(a);try{localStorage.setItem("ask-mode",a)}catch(a){console.warn("[AiTab] localStorage setItem ask-mode failed:",a)}window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:a}))})(a.target.value),children:[(0,d.jsx)("option",{value:"panel",children:a.settings.askDisplayMode?.panel??"Side Panel"}),(0,d.jsx)("option",{value:"popup",children:a.settings.askDisplayMode?.popup??"Popup"})]})})}var cJ=c(35654),cK=c(83052),cL=c(3541),cM=c(99917);let cN=[{value:"680px",label:"Narrow",width:42},{value:"780px",label:"Default",width:56},{value:"960px",label:"Wide",width:75},{value:"100%",label:"Full",width:100}],cO=[{value:"lora",label:"Lora",category:"Serif",style:{fontFamily:"Lora, Georgia, serif"}},{value:"ibm-plex-sans",label:"IBM Plex Sans",category:"Sans",style:{fontFamily:"'IBM Plex Sans', sans-serif"}},{value:"geist",label:"Geist",category:"Sans",style:{fontFamily:"var(--font-geist-sans), sans-serif"}},{value:"ibm-plex-mono",label:"IBM Plex Mono",category:"Mono",style:{fontFamily:"'IBM Plex Mono', monospace"}}];function cP({icon:a,label:b,children:c}){return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:a}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:b})]}),c]})}function cQ({options:a,value:b,onChange:c}){return(0,d.jsx)("div",{className:"flex gap-2",children:a.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.value),className:`flex items-center gap-1.5 px-3.5 py-2 text-sm font-medium rounded-xl transition-all ${b===a.value?"bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[a.icon,a.label]},a.value))})}function cR({font:a,setFont:b,fontSize:c,setFontSize:e,contentWidth:g,setContentWidth:h,dark:i,setDark:j,locale:k,setLocale:l,t:m}){let[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(()=>"system"),[r,s]=(0,f.useState)(()=>"system"),t=m.settings.appearance;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cJ.A,{size:15}),title:t.readingTitle??"Reading",description:t.readingDesc??"Customize how your notes look",children:[(0,d.jsx)(cP,{icon:(0,d.jsx)(cK.A,{size:14}),label:t.readingFont,children:(0,d.jsx)("div",{className:"space-y-0.5",children:cO.map(c=>{let e=a===c.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>b(c.value),className:`flex items-center gap-4 w-full px-3 py-2.5 rounded-lg transition-all text-left relative ${e?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[e&&(0,d.jsx)("div",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:`text-xl font-medium w-10 text-center shrink-0 ${e?"text-foreground":"text-muted-foreground/60"}`,style:{fontFamily:c.style.fontFamily},children:"Aa"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:`text-sm font-medium ${e?"text-foreground":"text-muted-foreground"}`,style:{fontFamily:c.style.fontFamily},children:c.label}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/50",children:c.category})]}),(0,d.jsx)("p",{className:`text-sm truncate mt-0.5 ${e?"text-muted-foreground":"text-muted-foreground/40"}`,style:{fontFamily:c.style.fontFamily},children:t.fontPreview})]})]},c.value)})})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(cL.A,{size:14}),label:t.fontSize,children:(0,d.jsxs)("div",{className:"px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 shrink-0",style:{fontSize:"11px"},children:"A"}),(0,d.jsx)("input",{type:"range",min:14,max:17,step:1,value:parseInt(c),onChange:a=>e(`${a.target.value}px`),className:"flex-1 h-1.5 rounded-full appearance-none bg-muted cursor-pointer accent-[var(--amber)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[var(--amber)] [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[var(--amber)] [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:cursor-pointer"}),(0,d.jsx)("span",{className:"text-base text-muted-foreground/60 shrink-0",children:"A"})]}),(0,d.jsx)("div",{className:"text-center mt-1.5",children:(0,d.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground",children:[parseInt(c),"px"]})}),(0,d.jsx)("p",{className:"text-muted-foreground leading-relaxed mt-2 px-1",style:{fontSize:c,fontFamily:cO.find(b=>b.value===a)?.style.fontFamily},children:t.fontSizePreview})]})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(cM.A,{size:14}),label:t.contentWidth,children:(0,d.jsx)("div",{className:"space-y-1",children:cN.map(a=>{let b=g===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>h(a.value),className:`flex items-center gap-3 w-full px-3 py-2 rounded-lg transition-all ${b?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[(0,d.jsx)("div",{className:"flex-1 h-2 rounded-full bg-muted/40 overflow-hidden",children:(0,d.jsx)("div",{className:`h-full rounded-full transition-all ${b?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,style:{width:`${a.width}%`}})}),(0,d.jsx)("span",{className:`text-sm shrink-0 w-14 text-right ${b?"text-foreground font-medium":"text-muted-foreground"}`,children:a.label})]},a.value)})})})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cF.A,{size:15}),title:t.preferencesTitle??"Preferences",children:[(0,d.jsx)(cP,{icon:(0,d.jsx)(bo.A,{size:14}),label:t.colorTheme,children:(0,d.jsx)(cQ,{options:[{value:"system",label:t.system,icon:(0,d.jsx)(cs.A,{size:14})},{value:"dark",label:t.dark,icon:(0,d.jsx)(cA.A,{size:14})},{value:"light",label:t.light,icon:(0,d.jsx)(bo.A,{size:14})}],value:p,onChange:a=>{q(a),localStorage.setItem("theme",a);let b="system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches:"dark"===a;j(b),document.documentElement.classList.toggle("dark",b)}})}),(0,d.jsx)(cP,{icon:(0,d.jsx)(aT.A,{size:14}),label:t.language,children:(0,d.jsx)(cQ,{options:[{value:"system",label:t.system,icon:(0,d.jsx)(cs.A,{size:14})},{value:"en",label:"EN"},{value:"zh",label:"中文"}],value:r,onChange:a=>{s(a),localStorage.setItem("locale",a);let b="system"===a?navigator.language.startsWith("zh")?"zh":"en":a;l(b),document.cookie=`locale=${b};path=/;max-age=31536000;SameSite=Lax`}})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/40 px-0.5",children:t.browserNote}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[n?(0,d.jsx)(ae.A,{size:14}):(0,d.jsx)(u.A,{size:14}),m.settings.tabs.shortcuts]}),n&&(0,d.jsx)("div",{className:"mt-3 space-y-0.5",children:m.shortcuts.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 px-1",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:a.description}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs font-mono bg-muted border border-border rounded text-muted-foreground",children:a},b))})]},b))})]})]})}var cS=c(27381),cT=c(19236),cU=c(66336);function cV(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(2)} GB`}c(9760);var cW=c(41990);function cX({data:a,setData:b,t:c}){let e=a.envOverrides??{},g=c.settings.knowledge,[h,i]=(0,f.useState)(()=>!1),[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)(!1),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(null),[r,t]=(0,f.useState)(!1),u=(0,f.useCallback)(()=>{let a=!r;t(a);let b={dismissed:a};a||(b.active=!0),(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:b})}).then(()=>window.dispatchEvent(new Event("guide-state-updated"))).catch(b=>{console.error("Failed to update guide state:",b),t(!a)})},[r]),v=(0,f.useCallback)(()=>{(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{active:!0,dismissed:!1,walkthroughStep:0,walkthroughDismissed:!1}})}).then(()=>{q(!0),t(!1),window.dispatchEvent(new Event("guide-state-updated"))}).catch(a=>console.error("Failed to restart walkthrough:",a))},[]),w=(0,f.useSyncExternalStore)(()=>()=>{},()=>`${window.location.protocol}//${window.location.hostname}`,()=>"http://localhost"),[x,z]=(0,f.useState)(!1),A="***set***"===a.webPassword,[B,C]=(0,f.useState)(!1),[E,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(!1),[J,K]=(0,f.useState)(!1),L=!!a.authToken,M=E??a.authToken??"";async function N(){C(!0);try{let a=await (0,y.n)("/api/settings/reset-token",{method:"POST"});G(a.token),b(b=>b?{...b,authToken:a.token}:b)}finally{C(!1)}}async function O(){b(a=>a?{...a,authToken:""}:a),G(null)}return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cS.A,{size:15}),title:"Knowledge Base",description:g.sopRootHint,children:[(0,d.jsx)(F.D0,{label:(0,d.jsxs)(d.Fragment,{children:[g.sopRoot," ",(0,d.jsx)(F.Bt,{overridden:e.MIND_ROOT})]}),hint:e.MIND_ROOT?g.envNote:g.sopRootHint,children:(0,d.jsx)(F.pd,{value:a.mindRoot,onChange:a=>b(b=>b?{...b,mindRoot:a.target.value}:b),placeholder:"/path/to/your/notes"})}),(0,d.jsx)(F.pM,{label:g.showHiddenFiles,hint:g.showHiddenFilesHint,children:(0,d.jsx)(F.lM,{checked:h,onChange:()=>{let a=!h;i(a),localStorage.setItem(ax,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}})}),null!==j&&j>0&&null===n&&(0,d.jsx)(F.pM,{label:g.cleanupExamples,hint:g.cleanupExamplesHint,children:(0,d.jsxs)("button",{onClick:()=>K(!0),disabled:l,title:l?c.hints.cleanupInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0 disabled:opacity-50",children:[l?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(ad.A,{size:12}),g.cleanupExamplesButton,(0,d.jsx)("span",{className:"ml-1 tabular-nums text-2xs opacity-70",children:j})]})}),null!==n&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(a0.A,{size:14}),g.cleanupExamplesDone(n)]})]}),(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(cT.A,{size:15}),title:"Security",children:[(0,d.jsx)(F.D0,{label:g.webPassword,hint:g.webPasswordHint,children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(F.pd,{type:x?"text":"password",value:A?"••••••••":a.webPassword??"",onChange:a=>b(b=>b?{...b,webPassword:a.target.value}:b),onFocus:()=>{A&&b(a=>a?{...a,webPassword:""}:a)},placeholder:"Leave empty to disable"}),(0,d.jsx)("button",{type:"button",onClick:()=>z(a=>!a),className:"px-3 py-2 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:x?"Hide":"Show"})]})}),(0,d.jsx)(F.D0,{label:g.authToken,hint:L?g.authTokenHint:g.authTokenNone,children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-background border border-border rounded-lg min-h-[38px]",children:[(0,d.jsx)("code",{className:"flex-1 text-xs font-mono text-foreground break-all select-all",children:M||(0,d.jsx)("span",{className:"text-muted-foreground italic",children:"— not set —"})}),M&&(0,d.jsx)("button",{type:"button",onClick:function(){let b=E??a.authToken??"";b&&(0,cu.l)(b).then(a=>{a&&ar.oR.copy()})},className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground transition-colors",title:g.authTokenCopy,children:(0,d.jsx)(ab.A,{size:13})})]}),a.mcpPort&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[g.authTokenMcpPort,": ",(0,d.jsx)("code",{className:"font-mono",children:a.mcpPort}),M&&(0,d.jsxs)(d.Fragment,{children:[" \xa0\xb7\xa0 MCP URL: ",(0,d.jsx)("code",{className:"font-mono select-all",children:`${w}:${a.mcpPort}/mcp`})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:function(){I(!0)},disabled:B,title:B?c.hints.tokenResetInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:B?"animate-spin":""}),g.authTokenReset]}),L&&(0,d.jsxs)("button",{type:"button",onClick:O,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 transition-colors",children:[(0,d.jsx)(ad.A,{size:14}),g.authTokenClear]})]}),E&&(0,d.jsx)("p",{className:"text-xs text-[var(--amber-text)]",children:"New token generated. Copy it now — it won't be shown in full again."})]})})]}),null!==p&&(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(bx.A,{size:15}),title:c.guide?.title??"Getting Started",children:[(0,d.jsx)(F.pM,{label:c.guide?.showGuide??"Show getting started guide",children:(0,d.jsx)(F.lM,{checked:!r,onChange:()=>u()})}),(0,d.jsxs)("button",{onClick:v,className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(cz.A,{size:14}),g.restartWalkthrough??"Restart walkthrough"]})]}),(0,d.jsx)(cY,{}),(0,d.jsx)(as.TM,{open:H,title:g.authTokenReset??"Regenerate Token",message:g.authTokenResetConfirm,confirmLabel:g.authTokenReset??"Regenerate",cancelLabel:"Cancel",onConfirm:()=>{I(!1),N()},onCancel:()=>I(!1)}),(0,d.jsx)(as.TM,{open:J,title:g.cleanupExamples??"Cleanup Examples",message:null!==j?g.cleanupExamplesConfirm(j):"",confirmLabel:g.cleanupExamplesButton??"Clean up",cancelLabel:"Cancel",variant:"destructive",onConfirm:async()=>{K(!1),m(!0);let a=await (0,cW.E)();m(!1),a.success&&(o(a.deleted),k(0))},onCancel:()=>K(!1)})]})}function cY(){let[a,b]=(0,f.useState)(!1),[c,e]=(0,f.useState)(null),[g,h]=(0,f.useState)(!1);return(0,f.useCallback)(async()=>{h(!0);try{let a=await (0,y.n)("/api/monitoring",{timeout:5e3});e(a)}catch{}h(!1)},[]),(0,f.useRef)(!1),(0,d.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,d.jsxs)("button",{onClick:()=>b(a=>!a),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors w-full",children:[a?(0,d.jsx)(ae.A,{size:14}):(0,d.jsx)(u.A,{size:14}),(0,d.jsx)(cU.A,{size:12}),"System Monitoring",g&&(0,d.jsx)(D.A,{size:10,className:"animate-spin ml-1"})]}),a&&c&&(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-xs",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Heap"}),(0,d.jsxs)("span",{className:"ml-2 tabular-nums",children:[cV(c.system.memory.heapUsed)," / ",cV(c.system.memory.heapTotal)]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"RSS"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:cV(c.system.memory.rss)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Uptime"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:function(a){let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);if(c<60)return`${c}m ${b%60}s`;let d=Math.floor(c/60);if(d<24)return`${d}h ${c%60}m`;let e=Math.floor(d/24);return`${e}d ${d%24}h`}(c.system.uptimeMs)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Node"}),(0,d.jsx)("span",{className:"ml-2",children:c.system.nodeVersion})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Requests"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.agentRequests})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Tool Calls"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.toolExecutions})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Tokens"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:(c.application.totalTokens.input+c.application.totalTokens.output).toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Files"}),(0,d.jsxs)("span",{className:"ml-2 tabular-nums",children:[c.knowledgeBase.fileCount," (",cV(c.knowledgeBase.totalSizeBytes),")"]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"MCP"}),(0,d.jsx)("span",{className:"ml-2",children:c.mcp.running?`Running :${c.mcp.port}`:"Stopped"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"Errors"}),(0,d.jsx)("span",{className:"ml-2 tabular-nums",children:c.application.errors})]})]}),a&&!c&&!g&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Failed to load monitoring data"})]})}var cZ=c(27608);function c$({agents:a,t:b,onRefresh:c}){let e=b.settings?.mcp,[g,h]=(0,f.useState)(new Set),[i,j]=(0,f.useState)("auto"),[k,l]=(0,f.useState)("http://localhost:8787/mcp"),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)({}),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(null),u=async()=>{if(0!==g.size){r(!0),t(null);try{let b={agents:[...g].map(b=>{let c=a.find(a=>a.key===b),d="auto"===i?c?.preferredTransport||"stdio":i;return{key:b,scope:o[b]||(c?.hasProjectScope?"project":"global"),transport:d}}),transport:i,..."http"===i?{url:k,token:m}:{},..."auto"===i?{url:k,token:m}:{}},d=await (0,y.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),f=d.results.filter(a=>"ok"===a.status).length,j=d.results.filter(a=>"error"===a.status);j.length>0?t({type:"error",text:j.map(a=>`${a.agent}: ${a.message}`).join("; ")}):t({type:"success",text:e?.installSuccess?e.installSuccess(f):`${f} agent(s) configured`}),h(new Set),c()}catch{t({type:"error",text:e?.installFailed??"Install failed"})}finally{r(!1),setTimeout(()=>t(null),4e3)}}},v="http"===i||"auto"===i&&[...g].some(b=>{let c=a.find(a=>a.key===b);return c?.preferredTransport==="http"});return(0,d.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,d.jsx)("div",{className:"space-y-1",children:a.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-3 py-1.5 text-sm",children:[(0,d.jsx)("input",{type:"checkbox",checked:g.has(a.key),onChange:()=>{var b;return b=a.key,void h(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"form-check"}),(0,d.jsx)("span",{className:"w-28 shrink-0 text-xs",children:a.name}),(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-mono bg-muted",children:"auto"===i?a.preferredTransport:i}),a.installed?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-success/15 text-success font-mono",children:a.transport}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:a.scope})]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:a.present?e?.detected??"Detected":e?.notFound??"Not found"}),g.has(a.key)&&a.hasProjectScope&&a.hasGlobalScope&&(0,d.jsx)(cZ.A,{value:o[a.key]||"project",onChange:b=>p({...o,[a.key]:b}),size:"sm",className:"ml-auto",options:[{value:"project",label:e?.project??"Project"},{value:"global",label:e?.global??"Global"}]})]},a.key))}),(0,d.jsxs)("div",{className:"flex gap-2 text-xs pt-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>h(new Set(a.filter(a=>!a.installed&&a.present).map(a=>a.key))),className:"px-2.5 py-1 rounded-md border border-[var(--amber)] text-[var(--amber)] transition-colors hover:bg-muted/50",children:e?.selectDetected??"Select Detected"}),(0,d.jsx)("button",{type:"button",onClick:()=>h(new Set),className:"px-2.5 py-1 rounded-md border border-border text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:e?.clearSelection??"Clear"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-4 text-xs pt-1",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"auto"===i,onChange:()=>j("auto"),className:"form-radio"}),e?.transportAuto??"auto (recommended)"]}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"stdio"===i,onChange:()=>j("stdio"),className:"form-radio"}),e?.transportStdio??"stdio"]}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"transport",checked:"http"===i,onChange:()=>j("http"),className:"form-radio"}),e?.transportHttp??"http"]})]}),v&&(0,d.jsxs)("div",{className:"space-y-2 pl-5 text-xs",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-muted-foreground",children:e?.httpUrl??"MCP URL"}),(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-muted-foreground",children:e?.httpToken??"Auth Token"}),(0,d.jsx)("input",{type:"password",value:m,onChange:a=>n(a.target.value),placeholder:"Bearer token",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]})]}),(0,d.jsxs)("button",{onClick:u,disabled:0===g.size||q,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed bg-[var(--amber)] text-[var(--amber-foreground)]",children:[q&&(0,d.jsx)(D.A,{size:12,className:"animate-spin"}),q?e?.installing??"Installing...":e?.installSelected??"Install Selected"]}),s&&(0,d.jsx)("div",{className:"flex items-center gap-1.5 text-xs",role:"status",children:"success"===s.type?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:s.text})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:s.text})]})})]})}var c_=c(90314);let c0=(0,c_.default)(async()=>{},{loadableGenerated:{modules:["components/settings/McpSkillRow.tsx -> @/components/MarkdownView"]},ssr:!1});function c1({skill:a,expanded:b,onExpand:c,onToggle:e,onDelete:f,onEditStart:g,onEditSave:h,onEditCancel:i,editing:j,editContent:k,setEditContent:l,editError:m,saving:n,fullContent:o,loadingContent:p,loadErrors:q,m:r}){return(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>c(a.name),children:[b?(0,d.jsx)(ae.A,{size:12}):(0,d.jsx)(u.A,{size:12}),(0,d.jsx)("span",{className:"text-xs font-medium flex-1",children:a.name}),(0,d.jsx)("span",{className:`text-2xs px-1.5 py-0.5 rounded ${"builtin"===a.source?"bg-muted text-muted-foreground":"bg-[var(--amber-subtle)] text-[var(--amber-text)]"}`,children:"builtin"===a.source?r?.skillBuiltin??"Built-in":r?.skillUser??"Custom"}),(0,d.jsx)(F.lM,{size:"sm",checked:a.enabled,onClick:b=>{b.stopPropagation(),e(a.name,!a.enabled)}})]}),b&&(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border text-xs space-y-2 bg-muted/20",children:[(0,d.jsx)("p",{className:"text-muted-foreground",children:a.description||"No description"}),(0,d.jsx)("p",{className:"text-muted-foreground font-mono text-2xs",children:a.path}),p===a.name?(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),(0,d.jsx)("span",{className:"text-2xs",children:"Loading..."})]}):o[a.name]?(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-2xs text-muted-foreground font-medium",children:r?.skillContent??"Content"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.editable&&j!==a.name&&(0,d.jsxs)("button",{onClick:()=>g(a.name),className:"flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(ac.A,{size:10}),r?.editSkill??"Edit"]}),a.editable&&(0,d.jsxs)("button",{onClick:()=>f(a.name),className:"flex items-center gap-1 text-2xs text-destructive hover:underline",children:[(0,d.jsx)(ad.A,{size:10}),r?.deleteSkill??"Delete"]})]})]}),j===a.name?(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("textarea",{value:k,onChange:a=>l(a.target.value),rows:Math.min(20,(k.match(/\n/g)||[]).length+3),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{onClick:()=>h(a.name),disabled:n,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[n&&(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),r?.saveSkill??"Save"]}),(0,d.jsx)("button",{onClick:i,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:r?.cancelSkill??"Cancel"})]}),m&&(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),m]})]}):(0,d.jsx)("div",{className:"w-full rounded-md border border-border bg-background/50 max-h-[300px] overflow-y-auto px-2.5 py-1.5 text-xs [&_.prose]:max-w-none [&_.prose]:text-xs [&_h1]:text-sm [&_h2]:text-xs [&_h3]:text-xs [&_pre]:text-2xs [&_code]:text-2xs",children:(0,d.jsx)(c0,{content:function(a){if(!a.startsWith("---"))return a;let b=a.indexOf("\n---",3);return -1===b?a:a.slice(b+4).replace(/^\n+/,"")}(o[a.name])})})]}):q[a.name]?(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),q[a.name]]}):null]})]})}let c2=a=>`---
|
|
107
101
|
name: ${a}
|
|
108
102
|
description: >
|
|
109
103
|
Describe WHEN the agent should use this
|
|
@@ -150,12 +144,12 @@ description: >
|
|
|
150
144
|
|
|
151
145
|
## Rollback
|
|
152
146
|
<!-- What to do on failure -->
|
|
153
|
-
`};function c4({onSave:a,onCancel:b,saving:c,error:e,m:g}){let[h,i]=(0,f.useState)(""),[j,k]=(0,f.useState)(""),[m,n]=(0,f.useState)("general"),o=(a,b)=>(c3[b||m]||c3.general)(a||"my-skill");return(0,d.jsxs)("div",{className:"border border-border rounded-lg p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs font-medium",children:g?.addSkill??"+ Add Skill"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground",children:(0,d.jsx)(l.A,{size:12})})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillName??"Name"}),(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{let b,c;return b=a.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""),c=o(h||"my-skill"),void((!j||j===c)&&k(o(b||"my-skill")),i(b))},placeholder:"my-skill",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillTemplate??"Template"}),(0,d.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden w-fit",children:["general","tool-use","workflow"].map((a,b)=>(0,d.jsx)("button",{onClick:()=>{let b;return b=o(h||"my-skill",m),void(n(a),(!j||j===b)&&k(o(h||"my-skill",a)))},className:`px-2.5 py-1 text-xs transition-colors ${b>0?"border-l border-border":""} ${m===a?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:"general"===a?g?.skillTemplateGeneral??"General":"tool-use"===a?g?.skillTemplateToolUse??"Tool-use":g?.skillTemplateWorkflow??"Workflow"},a))})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillContent??"Content"}),(0,d.jsx)("textarea",{value:j||o(h||"my-skill"),onChange:a=>k(a.target.value),rows:16,placeholder:"Skill instructions (markdown)...",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"})]}),e&&(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),e]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{onClick:()=>a(h.trim(),j||o(h.trim()||"my-skill")),disabled:!h.trim()||c,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[c&&(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),g?.saveSkill??"Save"]}),(0,d.jsx)("button",{onClick:b,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:g?.cancelSkill??"Cancel"})]})]})}function c5({t:a}){let b,c,e=a.settings?.mcp,g=(0,aU.cd)(),[h,i]=(0,f.useState)([]),[k,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(!1),[t,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(null),[E,F]=(0,f.useState)(""),[G,H]=(0,f.useState)(""),[I,J]=(0,f.useState)({}),[K,L]=(0,f.useState)(null),[M,N]=(0,f.useState)({}),[O,P]=(0,f.useState)(!1),[Q,R]=(0,f.useState)(null),S=(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/skills");i(a.skills),N({})}catch(b){let a=b instanceof Error?b.message:"Failed to load skills";console.error("fetchSkills error:",a),N(b=>({...b,_root:a}))}m(!1)},[]),U=(0,f.useMemo)(()=>{if(!w)return h;let a=w.toLowerCase();return h.filter(b=>b.name.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))},[h,w]),V=(0,f.useMemo)(()=>U.filter(a=>"user"===a.source),[U]),W=(0,f.useMemo)(()=>U.filter(a=>"builtin"===a.source),[U]),X=async(a,b)=>{if(g){await g.toggleSkill(a,b),i(c=>c.map(c=>c.name===a?{...c,enabled:b}:c));return}try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:a,enabled:b})}),i(c=>c.map(c=>c.name===a?{...c,enabled:b}:c)),N(b=>{let c={...b};return delete c[a],c})}catch(c){let b=c instanceof Error?c.message:"Failed to toggle skill";console.error("handleToggle error:",b),N(c=>({...c,[a]:b}))}},Y=a=>{R(a)},Z=async a=>{try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",name:a})}),J(b=>{let c={...b};return delete c[a],c}),B===a&&C(null),n===a&&o(null),N(b=>{let c={...b};return delete c[a],c}),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(c){let b=c instanceof Error?c.message:"Failed to delete skill";console.error("handleDelete error:",b),N(c=>({...c,[a]:b}))}},$=async a=>{if(!I[a]){L(a);try{let b=await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:a})});J(c=>({...c,[a]:b.content})),N(b=>{let c={...b};return delete c[a],c})}catch(b){N(c=>({...c,[a]:b instanceof Error?b.message:"Failed to load skill content"}))}finally{L(null)}}},_=a=>{let b=n===a?null:a;o(b),b&&$(a),B&&B!==a&&C(null)},aa=a=>{C(a),F(I[a]||""),H("")},ab=async a=>{s(!0),H("");try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update",name:a,content:E})}),J(b=>({...b,[a]:E})),C(null),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(a){H(a instanceof Error?a.message:"Failed to save skill")}finally{s(!1)}},ac=()=>{C(null),F(""),H("")},ad=async(a,b)=>{if(a){s(!0),v("");try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",name:a,content:b})}),q(!1),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(a){v(a instanceof Error?a.message:"Failed to create skill")}finally{s(!1)}}};return k?(0,d.jsx)("div",{className:"flex justify-center py-4",children:(0,d.jsx)(D.A,{size:16,className:"animate-spin text-muted-foreground"})}):(0,d.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(j.A,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:e?.searchSkills??"Search skills...",className:"w-full pl-7 pr-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"}),w&&(0,d.jsx)("button",{onClick:()=>x(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,d.jsx)(l.A,{size:10})})]}),(b=h.find(a=>"mindos"===a.name)?.enabled??!0?"en":"zh",c=async a=>{if(a!==b&&!O){P(!0);try{"en"===a?(await X("mindos",!0),await X("mindos-zh",!1)):(await X("mindos-zh",!0),await X("mindos",!1))}catch(a){console.error("Lang switch failed:",a)}finally{P(!1)}}},(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:e?.skillLanguage??"Skill Language"}),(0,d.jsxs)("div",{className:"flex rounded-md border border-border overflow-hidden",children:[(0,d.jsx)("button",{onClick:()=>c("en"),disabled:O,className:`px-2.5 py-1 text-xs transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${"en"===b?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:e?.skillLangEn??"English"}),(0,d.jsx)("button",{onClick:()=>c("zh"),disabled:O,className:`px-2.5 py-1 text-xs transition-colors disabled:opacity-50 disabled:cursor-not-allowed border-l border-border ${"zh"===b?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:e?.skillLangZh??"中文"})]})]})),0===U.length&&w&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground text-center py-3",children:e?.noSkillsMatch?e.noSkillsMatch(w):`No skills match "${w}"`}),V.length>0&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:(0,d.jsxs)("span",{children:[e?.customGroup??"Custom"," (",V.length,")"]})}),(0,d.jsx)("div",{className:"space-y-1.5",children:V.map(a=>(0,d.jsx)(c1,{skill:a,expanded:n===a.name,onExpand:_,onToggle:X,onDelete:Y,onEditStart:aa,onEditSave:ab,onEditCancel:ac,editing:B,editContent:E,setEditContent:F,editError:G,saving:r,fullContent:I,loadingContent:K,loadErrors:M,m:e},a.name))})]}),W.length>0&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground cursor-pointer hover:text-foreground transition-colors",onClick:()=>A(!z),children:[z?(0,d.jsx)(u.A,{size:12}):(0,d.jsx)(ae.A,{size:12}),(0,d.jsxs)("span",{children:[e?.builtinGroup??"Built-in"," (",W.length,")"]})]}),!z&&(0,d.jsx)("div",{className:"space-y-1.5",children:W.map(a=>(0,d.jsx)(c1,{skill:a,expanded:n===a.name,onExpand:_,onToggle:X,onDelete:Y,onEditStart:aa,onEditSave:ab,onEditCancel:ac,editing:B,editContent:E,setEditContent:F,editError:G,saving:r,fullContent:I,loadingContent:K,loadErrors:M,m:e},a.name))})]}),p?(0,d.jsx)(c4,{onSave:ad,onCancel:()=>{q(!1),v("")},saving:r,error:t,m:e}):(0,d.jsxs)("button",{onClick:()=>q(!0),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(T.A,{size:12}),e?.addSkill??"+ Add Skill"]}),(0,d.jsx)(c6,{agents:g?.agents??[],skillName:h.find(a=>"mindos"===a.name)?.enabled??!0?"mindos":"mindos-zh",m:e}),(0,d.jsx)(as.TM,{open:!!Q,title:"Delete skill?",message:Q?e?.skillDeleteConfirm?.(Q)??`Delete skill "${Q}"?`:"",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:async()=>{R(null),await Z(Q)},onCancel:()=>R(null)})]})}function c6({agents:a,skillName:b,m:c}){let[e,g]=(0,f.useState)("claude-code"),h=`npx skills add GeminiLight/MindOS --skill ${b} -a ${e} -g -y`,i=`~/.agents/skills/${b}/SKILL.md`,j=async()=>{await (0,cu.l)(h)&&ar.oR.copy()},k=a.filter(a=>a.present&&a.installed),l=a.filter(a=>a.present&&!a.installed),m=a.filter(a=>!a.present);return(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-3 space-y-2.5",children:[(0,d.jsx)("p",{className:"text-2xs font-medium text-muted-foreground",children:c?.cliInstallHint??"Install via CLI:"}),(0,d.jsx)(cZ.A,{value:e,onChange:g,size:"sm",options:[...k.length>0?[{label:c?.connectedGroup??"Connected",options:k.map(a=>({value:a.key,label:a.name}))}]:[],...l.length>0?[{label:c?.detectedGroup??"Detected",options:l.map(a=>({value:a.key,label:a.name}))}]:[],...m.length>0?[{label:c?.notFoundGroup??"Not Installed",options:m.map(a=>({value:a.key,label:a.name}))}]:[]]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("code",{className:"flex-1 text-[10px] font-mono bg-muted/50 border border-border rounded-lg px-2.5 py-2 text-muted-foreground select-all overflow-x-auto whitespace-nowrap",children:h}),(0,d.jsx)("button",{onClick:j,className:"p-1.5 rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:(0,d.jsx)(ab.A,{size:11})})]}),(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground",children:[c?.skillPathHint??"Skill files installed at:"," ",(0,d.jsx)("code",{className:"font-mono text-[10px] bg-muted px-1 py-0.5 rounded",children:i})]})]})}function c7({t:a}){let b=(0,aU.cd)(),c=a.settings?.mcp,[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(""),[j,k]=(0,f.useState)("stdio"),l=(0,f.useRef)(void 0);if(!b||b.loading)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:18,className:"animate-spin text-muted-foreground"})});let m=b.agents.filter(a=>a.present&&a.installed),n=b.agents.filter(a=>a.present&&!a.installed),o=b.agents.filter(a=>!a.present),p=h||(b.agents[0]?.key??""),q=b.agents.find(a=>a.key===p);return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(c8,{status:b.status,restarting:e,onRestart:async()=>{g(!0);try{await (0,y.n)("/api/mcp/restart",{method:"POST"})}catch(a){console.error("[McpTab] Restart request failed:",a),g(!1);return}let a=Date.now()+6e4;clearInterval(l.current),l.current=setInterval(async()=>{if(Date.now()>a){clearInterval(l.current),g(!1),console.warn("[McpTab] MCP restart timed out after 60s");return}try{(await (0,y.n)("/api/mcp/status",{timeout:3e3})).running&&(clearInterval(l.current),g(!1),b.refresh())}catch(a){console.warn("[McpTab] Status poll attempt failed:",a)}},3e3)},onRefresh:b.refresh,m:c}),b.agents.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"MCP"}),(0,d.jsx)(c9,{connectedAgents:m,detectedAgents:n,notFoundAgents:o,currentAgent:q??null,mcpStatus:b.status,selectedAgent:p,onSelectAgent:a=>i(a),transport:j,onTransportChange:k,onCopy:async a=>{await (0,cu.l)(a)&&ar.oR.copy()},m:c})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:c?.skillsTitle??"Skills"}),(0,d.jsx)(c5,{t:a})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:c?.agentsTitle??"Agent Configuration"}),(0,d.jsx)(c$,{agents:b.agents,t:a,onRefresh:b.refresh})]})]})}function c8({status:a,restarting:b,onRestart:c,onRefresh:e,m:f}){return a?(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 flex items-center justify-between",children:[(0,d.jsx)("div",{className:"flex items-center gap-2.5 text-sm",children:b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-[var(--amber)]",children:f?.restarting??"Restarting..."})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${a.running?"bg-success":"bg-muted-foreground"}`}),(0,d.jsx)("span",{className:"text-foreground font-medium",children:a.running?f?.running??"Running":f?.stopped??"Stopped"}),a.running&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"\xb7"}),(0,d.jsx)("span",{className:"font-mono text-muted-foreground",children:a.endpoint}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[a.toolCount," tools"]})]})]})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[!a.running&&!b&&(0,d.jsxs)("button",{onClick:c,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(cz.A,{size:14})," ",f?.restart??"Restart"]}),(0,d.jsx)("button",{onClick:e,className:"p-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}):null}function c9({connectedAgents:a,detectedAgents:b,notFoundAgents:c,currentAgent:e,mcpStatus:g,selectedAgent:h,onSelectAgent:i,transport:j,onTransportChange:k,onCopy:l,m}){let n=(0,f.useMemo)(()=>e?(0,ct.$k)(e,g,j):null,[e,g,j]);return(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsx)(cZ.A,{value:h,onChange:i,options:[...a.length>0?[{label:m?.connectedGroup??"Connected",options:a.map(a=>({value:a.key,label:`${a.name} — ${a.transport??"stdio"} \xb7 ${a.scope??"global"}`}))}]:[],...b.length>0?[{label:m?.detectedGroup??"Detected (not configured)",options:b.map(a=>({value:a.key,label:`${a.name} — ${m?.notConfigured??"not configured"}`}))}]:[],...c.length>0?[{label:m?.notFoundGroup??"Not Installed",options:c.map(a=>({value:a.key,label:a.name}))}]:[]]}),e&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[e.present&&e.installed?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-success/10 text-success",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success inline-block"}),m?.tagConnected??"Connected"]}):e.present&&!e.installed?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-[var(--amber-subtle)] text-[var(--amber-text)]",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] inline-block"}),m?.tagDetected??"Detected — not configured"]}):(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-muted text-muted-foreground",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground inline-block"}),m?.tagNotInstalled??"Not installed"]}),e.transport&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded text-2xs bg-muted text-muted-foreground",children:e.transport}),e.scope&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded text-2xs bg-muted text-muted-foreground",children:e.scope})]}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden w-fit",children:[(0,d.jsxs)("button",{onClick:()=>k("stdio"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm transition-colors ${"stdio"===j?"bg-muted text-foreground font-medium":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(cs.A,{size:14})," ",m?.transportLocal??"Local (stdio)"]}),(0,d.jsxs)("button",{onClick:()=>k("http"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm transition-colors ${"http"===j?"bg-muted text-foreground font-medium":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(aT.A,{size:14})," ",m?.transportRemote??"Remote (HTTP)"]})]}),"http"===j&&g&&!g.authConfigured&&(0,d.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(A.A,{size:12}),m?.noAuthWarning??"Auth not configured. Run `mindos token` to set up."]}),n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"text-[11px] font-mono bg-muted/50 border border-border rounded-lg p-3 overflow-x-auto whitespace-pre select-all max-h-[240px] overflow-y-auto",children:n.displaySnippet}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,d.jsxs)("button",{onClick:()=>l(n.snippet),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:[(0,d.jsx)(ab.A,{size:14}),m?.copyConfig??"Copy config"]}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"→"}),(0,d.jsx)("span",{className:"font-mono text-muted-foreground truncate text-2xs",children:n.path})]})]})]})]})}var da=c(33740);let db="https://github.com/GeminiLight/MindOS/releases",dc="mindos_update_in_progress",dd={downloading:{en:"Downloading update",zh:"下载更新"},skills:{en:"Updating skills",zh:"更新 Skills"},rebuilding:{en:"Rebuilding app",zh:"重新构建应用"},restarting:{en:"Restarting server",zh:"重启服务"}};function de({status:a}){switch(a){case"done":return(0,d.jsx)(w.A,{size:14,className:"text-success shrink-0"});case"running":return(0,d.jsx)(D.A,{size:14,className:"animate-spin shrink-0 text-[var(--amber)]"});case"failed":return(0,d.jsx)(A.A,{size:14,className:"text-destructive shrink-0"});default:return(0,d.jsx)(da.A,{size:14,className:"text-muted-foreground/40 shrink-0"})}}function df(){let{t:a}=(0,v.Y)(),b=a.settings.update,[c,e]=(0,f.useState)("idle"),[g,h]=(0,f.useState)(!1),[i,j]=(0,f.useState)(null),[k,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(0),[o,p]=(0,f.useState)(""),q=async()=>{e("checking"),p("");try{let a=await null.checkUpdate();h(a.available),a.version&&j(a.version),e("idle")}catch{e("error"),p(b?.error??"Failed to check for updates.")}},r=async()=>{e("downloading"),n(0);try{await null.installUpdate()}catch{e("error"),p("Update failed. Please try again.")}};return(0,d.jsx)("div",{className:"space-y-6",children:(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(cs.A,{size:14,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"MindOS Desktop"})]}),k&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground",children:["v",k]})]}),"checking"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin"}),b?.checking??"Checking for updates..."]}),"idle"===c&&!g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),b?.upToDate??"You're up to date"]}),"idle"===c&&g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(a8.A,{size:13}),i?`Update available: v${i}`:"Update available"]}),"downloading"===c&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin text-[var(--amber)]"}),b?.desktopDownloading??"Downloading update..."]}),(0,d.jsx)("div",{className:"h-1 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-[var(--amber)] transition-all duration-300",style:{width:`${Math.max(m,3)}%`}})})]}),"ready"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),b?.desktopReady??"Update downloaded. Restart to apply."]}),"error"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:13}),o]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,d.jsxs)("button",{onClick:q,disabled:"checking"===c||"downloading"===c,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:"checking"===c?"animate-spin":""}),b?.checkButton??"Check for Updates"]}),"idle"===c&&g&&(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(a8.A,{size:14}),i?`Update to v${i}`:"Update"]}),"ready"===c&&(0,d.jsxs)("button",{onClick:async()=>{try{await null.installUpdate()}catch{e("error"),p(b?.error??"Failed to install update. Please try again.")}},className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(s.A,{size:14}),b?.desktopRestart??"Restart Now"]})]}),(0,d.jsxs)("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[(0,d.jsxs)("a",{href:db,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(E.A,{size:12}),b?.releaseNotes??"View release notes"]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/60",children:b?.desktopHint??"Updates are delivered through the Desktop app auto-updater."})]})]})})}function dg(){let[a,b]=(0,f.useState)(!1);return a?(0,d.jsx)(df,{}):(0,d.jsx)(dh,{})}function dh(){let{t:a,locale:b}=(0,v.Y)(),c=a.settings.update,[e,g]=(0,f.useState)(null),[h,i]=(0,f.useState)("idle"),[j,k]=(0,f.useState)(""),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),r=(0,f.useRef)(void 0),t=(0,f.useRef)(void 0),u=(0,f.useRef)(""),x=(0,f.useCallback)(async()=>{i("checking"),k("");try{let a=await (0,y.n)("/api/update-check");if(g(a),u.current||(u.current=a.current),a.hasUpdate){let b=localStorage.getItem("mindos_update_dismissed");localStorage.setItem("mindos_update_latest",a.latest),window.dispatchEvent(new Event(a.latest===b?"mindos:update-dismissed":"mindos:update-available"))}else localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),window.dispatchEvent(new Event("mindos:update-dismissed"));i("idle")}catch{i("error"),k(c?.error??"Failed to check for updates.")}},[c]),z=(0,f.useCallback)(()=>{clearInterval(r.current),clearTimeout(t.current)},[]),B=(0,f.useCallback)(a=>{z(),g(a),i("updated"),localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),localStorage.removeItem(dc),window.dispatchEvent(new Event("mindos:update-dismissed")),setTimeout(()=>window.location.reload(),2e3)},[z]),C=(0,f.useCallback)(()=>{r.current=setInterval(async()=>{try{let a=await (0,y.n)("/api/update-status",{timeout:5e3});if(q(!1),a.stages?.length>0&&m(a.stages),"failed"===a.stage){z(),localStorage.removeItem(dc),o(a.error||"Update failed"),i("error");return}if("done"===a.stage)try{let a=await (0,y.n)("/api/update-check");if(a.current!==u.current)return void B(a)}catch{}}catch{q(!0);try{let a=await (0,y.n)("/api/update-check",{timeout:5e3});a.current&&a.current!==u.current&&(m(a=>a.map(a=>({...a,status:"done"}))),B(a))}catch{}}},3e3),t.current=setTimeout(()=>{z(),localStorage.removeItem(dc),i("timeout")},3e5)},[z,B]),F=(0,f.useCallback)(async()=>{i("updating"),k(""),o(null),q(!1),m([{id:"downloading",status:"pending"},{id:"skills",status:"pending"},{id:"rebuilding",status:"pending"},{id:"restarting",status:"pending"}]),localStorage.setItem(dc,JSON.stringify({originalVer:u.current||e?.current,startedAt:Date.now()})),window.dispatchEvent(new Event("mindos:update-started"));try{await (0,y.n)("/api/update",{method:"POST"})}catch(a){if(a instanceof y.h){localStorage.removeItem(dc),o(a.message||"Update failed"),i("error");return}}C()},[C,e]),G=(0,f.useCallback)(()=>{o(null),F()},[F]),H="zh"===b?"zh":"en",I=l.filter(a=>"done"===a.status).length,J=l.length>0?Math.round(I/l.length*100):0;return(0,d.jsx)("div",{className:"space-y-6",children:(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"MindOS"}),e&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground",children:["v",e.current]})]}),"checking"===h&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin"}),c?.checking??"Checking for updates..."]}),"idle"===h&&e&&!e.hasUpdate&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),c?.upToDate??"You're up to date"]}),"idle"===h&&e?.hasUpdate&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(a8.A,{size:13}),c?.available?c.available(e.current,e.latest):`Update available: v${e.current} → v${e.latest}`]}),"updating"===h&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("div",{className:"space-y-1.5",children:l.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)(de,{status:a.status}),(0,d.jsx)("span",{className:"pending"===a.status?"text-muted-foreground/50":"running"===a.status?"text-foreground":"text-muted-foreground",children:dd[a.id]?.[H]??a.id})]},a.id))}),(0,d.jsx)("div",{className:"h-1 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-[var(--amber)] transition-all duration-500 ease-out",style:{width:`${Math.max(J,5)}%`}})}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:p?c?.serverRestarting??"Server is restarting, please wait...":c?.updatingHint??"This may take 1–3 minutes. Do not close this page."})]}),"updated"===h&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),c?.updated??"Updated successfully! Reloading..."]}),"timeout"===h&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(A.A,{size:13}),c?.timeout??"Update may still be in progress."]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:c?.timeoutHint??"The server may need more time to rebuild. Try refreshing."}),(0,d.jsxs)("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(s.A,{size:12}),c?.refreshButton??"Refresh Page"]})]}),"error"===h&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:13}),n||j]}),n&&(0,d.jsxs)("button",{onClick:G,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(s.A,{size:12}),c?.retryButton??"Retry Update"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,d.jsxs)("button",{onClick:x,disabled:"checking"===h||"updating"===h,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:"checking"===h?"animate-spin":""}),c?.checkButton??"Check for Updates"]}),e?.hasUpdate&&"updating"!==h&&"updated"!==h&&(0,d.jsxs)("button",{onClick:F,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(a8.A,{size:14}),c?.updateButton?c.updateButton(e.latest):`Update to v${e.latest}`]})]}),(0,d.jsxs)("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[(0,d.jsxs)("a",{href:db,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(E.A,{size:12}),c?.releaseNotes??"View release notes"]}),(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:[c?.hint??"Updates are installed via npm. Equivalent to running"," ",(0,d.jsx)("code",{className:"font-mono bg-muted px-1 py-0.5 rounded",children:"mindos update"})," ",c?.inTerminal??"in your terminal."]})]})]})})}function di(){let{t:a}=(0,v.Y)(),b=a.settings.uninstall,[c,e]=(0,f.useState)("idle"),[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(!0),[k,l]=(0,f.useState)(!0),m=async()=>{e("running"),h("");try{await (0,y.n)("/api/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({removeConfig:i})}),e("success")}catch(a){h(a instanceof Error?a.message:String(a)),e("error")}},n=({checked:a,onChange:b,label:c,desc:e,disabled:f})=>(0,d.jsxs)("label",{className:`flex items-start gap-2.5 p-2.5 rounded bg-muted/30 cursor-pointer select-none ${f?"opacity-50 cursor-not-allowed":"hover:bg-muted/50"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:a,onChange:a=>!f&&b(a.target.checked),disabled:f,className:"mt-0.5 form-check"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-foreground",children:c}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})]});return(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(ad.A,{size:15}),title:b.title,description:(0,b.descCli),children:[(0,d.jsxs)("div",{className:"flex gap-2.5 p-3 rounded-md bg-muted/50 border border-border",children:[(0,d.jsx)(bd.A,{size:14,className:"text-success shrink-0 mt-0.5"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:b.kbSafe})]}),"idle"===c||"confirming"===c?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(n,{checked:!0,disabled:!0,label:b.stopServices,desc:b.stopServicesDesc,onChange:()=>{}}),(0,d.jsx)(n,{checked:i,onChange:j,label:b.removeConfig,desc:b.removeConfigDesc}),(0,d.jsx)(n,{checked:!0,disabled:!0,label:b.removeNpm,desc:b.removeNpmDesc,onChange:()=>{}}),!1]}):null,"idle"===c&&(0,d.jsxs)("button",{onClick:()=>e("confirming"),className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-error/10 text-error border border-error/20 hover:bg-error/20 transition-colors focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,d.jsx)(ad.A,{size:12,className:"inline mr-1.5 -mt-px"}),b.confirmButton]}),"confirming"===c&&(0,d.jsxs)("div",{className:"p-3 rounded-md border border-error/30 bg-error/5 space-y-2.5",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-error",children:b.confirmTitle}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:m,className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-error text-white hover:bg-error/90 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.confirmButton}),(0,d.jsx)("button",{onClick:()=>e("idle"),className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-muted text-foreground hover:bg-muted/80 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.cancelButton})]})]}),"running"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,d.jsx)(D.A,{size:14,className:"animate-spin text-muted-foreground"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:b.running})]}),"success"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,d.jsx)(w.A,{size:14,className:"text-success"}),(0,d.jsx)("span",{className:"text-xs text-success font-medium",children:(0,b.success)})]}),"error"===c&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(bv.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs text-error font-medium",children:b.error})]}),g&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:g}),(0,d.jsx)("button",{onClick:()=>e("idle"),className:"px-3 py-1.5 text-xs font-medium rounded-md bg-muted text-foreground hover:bg-muted/80 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.cancelButton})]})]})}function dj({visible:a,initialTab:b,variant:c,onClose:g}){let[h,i]=(0,f.useState)("ai"),[j,m]=(0,f.useState)(null),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)("idle"),{t:r,locale:t,setLocale:u}=(0,v.Y)(),x=(0,e.useRouter)();(0,f.useRef)(void 0),(0,f.useRef)(!1);let[z,B]=(0,f.useState)("lora"),[C,E]=(0,f.useState)("15px"),[F,G]=(0,f.useState)("780px"),[H,J]=(0,f.useState)(!0),[K,L]=(0,f.useState)(()=>!1),M="panel"===c;(0,f.useRef)(!1),(0,f.useCallback)(async a=>{o(!0);try{await (0,y.n)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ai:a.ai,agent:a.agent,mindRoot:a.mindRoot,webPassword:a.webPassword,authToken:a.authToken})}),q("saved"),setTimeout(()=>q("idle"),2500)}catch{q("error"),setTimeout(()=>q("idle"),2500)}finally{o(!1)}},[]);let N=(0,f.useCallback)(a=>{m(b=>b?{...b,ai:{...b.ai,...a}}:b)},[]),O=(0,f.useCallback)(a=>{m(b=>b?{...b,agent:{...b.agent??{},...a}}:b)},[]),P=(0,f.useCallback)(async()=>{if(!j)return;let a={provider:"anthropic",providers:{anthropic:{apiKey:"",model:""},openai:{apiKey:"",model:"",baseUrl:""}}};m(b=>b?{...b,ai:a}:b),setTimeout(()=>{(0,y.n)("/api/settings").then(a=>{m(a)}).catch(()=>q("error"))},1300)},[j]),Q=j?.envOverrides??{},R=M?12:13,S=[{id:"ai",label:r.settings.tabs.ai,icon:(0,d.jsx)(bx.A,{size:R})},{id:"mcp",label:r.settings.tabs.mcp??"MCP & Skills",icon:(0,d.jsx)(cE.A,{size:R})},{id:"knowledge",label:r.settings.tabs.knowledge,icon:(0,d.jsx)(k.A,{size:R})},{id:"appearance",label:r.settings.tabs.appearance,icon:(0,d.jsx)(cF.A,{size:R})},{id:"sync",label:r.settings.tabs.sync??"Sync",icon:(0,d.jsx)(s.A,{size:R})},{id:"update",label:r.settings.tabs.update??"Update",icon:(0,d.jsx)(a8.A,{size:R}),badge:K},{id:"uninstall",label:r.settings.tabs.uninstall??"Uninstall",icon:(0,d.jsx)(ad.A,{size:R})}],T=S.find(a=>a.id===h)?.label??"",U=()=>(0,d.jsx)("div",{className:`flex-1 overflow-y-auto min-h-0 ${M?"px-4 py-4 space-y-4":"px-5 py-5 space-y-5"}`,children:"load-error"===p&&("ai"===h||"knowledge"===h)?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-center",children:[(0,d.jsx)(A.A,{size:M?18:20,className:"text-destructive"}),(0,d.jsx)("p",{className:`${M?"text-xs":"text-sm"} text-destructive font-medium`,children:"Failed to load settings"}),!M&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Check that the server is running and AUTH_TOKEN is configured correctly."})]}):j||"appearance"===h||"mcp"===h||"sync"===h||"update"===h||"uninstall"===h?(0,d.jsxs)(d.Fragment,{children:["ai"===h&&j?.ai&&(0,d.jsx)(cG,{data:j,updateAi:N,updateAgent:O,t:r}),"appearance"===h&&(0,d.jsx)(cR,{font:z,setFont:B,fontSize:C,setFontSize:E,contentWidth:F,setContentWidth:G,dark:H,setDark:J,locale:t,setLocale:u,t:r}),"knowledge"===h&&j&&(0,d.jsx)(cX,{data:j,setData:m,t:r}),"sync"===h&&(0,d.jsx)(I,{t:r}),"mcp"===h&&(0,d.jsx)(c7,{t:r}),"update"===h&&(0,d.jsx)(dg,{}),"uninstall"===h&&(0,d.jsx)(di,{})]}):(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:M?16:18,className:"animate-spin text-muted-foreground"})})}),V=()=>"ai"===h||"knowledge"===h?(0,d.jsxs)("div",{className:`${M?"px-4 py-2":"px-5 py-2.5"} border-t border-border shrink-0 flex items-center justify-between`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:["ai"===h&&Object.values(Q).some(Boolean)&&(0,d.jsxs)("button",{onClick:P,disabled:n||!j,className:`flex items-center gap-1.5 ${M?"px-2.5 py-1 text-xs rounded-md":"px-3 py-1.5 text-sm rounded-lg"} border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[(0,d.jsx)(cz.A,{size:M?12:13}),r.settings.ai.restoreFromEnv]}),"knowledge"===h&&(0,d.jsxs)("a",{href:"/setup?force=1",className:`flex items-center gap-1.5 ${M?"px-2.5 py-1 text-xs rounded-md":"px-3 py-1.5 text-sm rounded-lg"} border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:[(0,d.jsx)(cz.A,{size:M?12:13}),r.settings.reconfigure]})]}),!M&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[r.settings.save,"..."]})]}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]})]}):null;return M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,d.jsx)(k.A,{size:14,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider font-display",children:"Settings"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:10,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsx)(w.A,{size:10,className:"text-success"}),"error"===p&&(0,d.jsx)(A.A,{size:10,className:"text-destructive"})]})})]}),(0,d.jsx)("div",{className:"flex border-b border-border px-3 shrink-0 overflow-x-auto scrollbar-none gap-0",children:S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-1 px-2 py-2 text-xs font-medium transition-colors border-b-2 -mb-px whitespace-nowrap ${h===a.id?"border-[var(--amber)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id))}),U(),V()]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col h-full md:hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[(0,d.jsx)("div",{className:"flex justify-center pt-2 pb-0 absolute top-0 left-1/2 -translate-x-1/2",children:(0,d.jsx)("div",{className:"w-8 h-1 rounded-full bg-muted-foreground/20"})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,d.jsx)(k.A,{size:15,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"font-display",children:r.settings.title})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]}),g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]})]}),(0,d.jsxs)("div",{className:"flex border-b border-border px-4 shrink-0 overflow-x-auto scrollbar-none gap-0",children:[S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px whitespace-nowrap ${h===a.id?"border-[var(--amber)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id)),(0,d.jsxs)("button",{onClick:()=>{g?.(),x.push("/help")},className:"flex items-center gap-1.5 px-3 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px whitespace-nowrap border-transparent text-muted-foreground hover:text-foreground",children:[(0,d.jsx)(cB.A,{size:R}),r.sidebar.help]})]}),U(),V()]}),(0,d.jsxs)("div",{className:"hidden md:flex flex-row h-full min-h-0",children:[(0,d.jsxs)("div",{className:"w-[180px] shrink-0 border-r border-border flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[(0,d.jsx)(k.A,{size:15,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm font-medium font-display text-foreground",children:r.settings.title})]}),(0,d.jsx)("nav",{className:"flex-1 overflow-y-auto py-1.5",children:S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-2 w-full px-4 py-2 text-sm font-medium transition-colors relative ${h===a.id?"text-foreground bg-muted":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[h===a.id&&(0,d.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-[3px] rounded-r-full bg-[var(--amber)]"}),a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id))}),(0,d.jsx)("div",{className:"shrink-0 border-t border-border px-4 py-2",children:(0,d.jsxs)("button",{onClick:()=>{g?.(),x.push("/help")},className:"flex items-center gap-2 w-full px-0 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(cB.A,{size:13}),r.sidebar.help]})})]}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground font-display",children:T}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]}),g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]})]}),U(),V()]})]})]})}function dk({open:a,onClose:b,initialTab:c}){return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-end md:items-start justify-center md:pt-[10vh] modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(),children:(0,d.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"w-full md:max-w-3xl md:mx-4 bg-card border-t md:border border-border rounded-t-2xl md:rounded-xl shadow-2xl flex flex-col h-[88vh] md:h-[80vh] md:max-h-[85vh]",children:(0,d.jsx)(dj,{visible:a,variant:"modal",onClose:b,initialTab:c})})}):null}function dl(){let[a,b]=(0,f.useState)(!1),{t:c}=(0,v.Y)(),e=c.shortcutPanel,g="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",h=(0,f.useMemo)(()=>[{keys:`${g} K`,label:e.toggleSearch,section:e.navigation},{keys:`${g} /`,label:e.toggleAskAI,section:e.navigation},{keys:`${g} ,`,label:e.openSettings,section:e.navigation},{keys:`${g} ?`,label:e.keyboardShortcuts,section:e.navigation},{keys:"Esc",label:e.closePanel,section:e.panelsSection},{keys:`${g} S`,label:e.saveFile,section:e.editor},{keys:`${g} Z`,label:e.undo,section:e.editor},{keys:`${g} Shift Z`,label:e.redo,section:e.editor}],[g,e]);if(!a)return null;let i=[...new Set(h.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":e.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium font-display text-foreground",children:e.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:i.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:h.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:g}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",e.toggleHint]})})]})})}function dm(){let[a,b]=(0,f.useState)(0),[c,g]=(0,f.useState)(null),[i,j]=(0,f.useState)(!1);(0,f.useRef)(0);let[k,m]=(0,f.useState)(!1),[n,o]=(0,f.useState)(!1),p=(0,e.usePathname)(),{t:q}=(0,v.Y)();async function r(){try{await (0,y.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{b(0),g(0)}}return((0,f.useMemo)(()=>!(a<=0||p?.startsWith("/changes"))&&(null===c||!(a<=c))&&!i,[c,p,a,i]),k)?(0,d.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${n?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,d.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,d.jsx)(aY.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-xs text-foreground font-display whitespace-nowrap",children:q.changes.unreadBanner(a)}),(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,d.jsx)(h(),{href:"/changes",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-white focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:q.changes.reviewNow}),(0,d.jsx)("button",{type:"button",onClick:()=>void r(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:q.changes.markAllRead})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>g(a),"aria-label":q.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(l.A,{size:14})})]})})}):null}var dn=c(97621);let dp=(0,ai.createServerReference)("70e64c21da7696435710381375e61f8dcb722299f1",ai.callServer,void 0,ai.findSourceMapURL,"revertSpaceInitAction");function dq(){let[a,b]=(0,f.useState)(null),[c,g]=(0,f.useState)(!1),[h,i]=(0,f.useTransition)(),j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),m=(0,f.useCallback)(()=>{g(!1),setTimeout(()=>b(null),200)},[]);(0,f.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>g(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),j.refresh()):m()},[j,m]);let n=(0,f.useCallback)(()=>{a&&(m(),j.push(`/view/${(0,Z.O0)(a.spacePath+"/")}`))},[a,m,j]),o=(0,f.useCallback)(()=>{a&&i(async()=>{await dp(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),j.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(m,2e3)})},[a,j,m]),p=(0,f.useCallback)(()=>{m()},[m]);if(!a)return null;let q=k.home,{state:r}=a,s="done"===r,t="reverted"===r;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:s?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${t?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===r?"animate-pulse":""}`,children:t?(0,d.jsx)(dn.A,{size:12}):s?(0,d.jsx)(a0.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(bx.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:t?q.aiInitReverted(a.spaceName):s?q.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[q.aiInitGenerating(a.spaceName),(0,d.jsx)(dr,{})]})}),s&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:n,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-white hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:q.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:o,disabled:h,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:q.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:p,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(l.A,{size:12})})]})]})})}function dr(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
|
|
147
|
+
`};function c4({onSave:a,onCancel:b,saving:c,error:e,m:g}){let[h,i]=(0,f.useState)(""),[j,k]=(0,f.useState)(""),[m,n]=(0,f.useState)("general"),o=(a,b)=>(c3[b||m]||c3.general)(a||"my-skill");return(0,d.jsxs)("div",{className:"border border-border rounded-lg p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs font-medium",children:g?.addSkill??"+ Add Skill"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground",children:(0,d.jsx)(l.A,{size:12})})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillName??"Name"}),(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{let b,c;return b=a.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""),c=o(h||"my-skill"),void((!j||j===c)&&k(o(b||"my-skill")),i(b))},placeholder:"my-skill",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background font-mono text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillTemplate??"Template"}),(0,d.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden w-fit",children:["general","tool-use","workflow"].map((a,b)=>(0,d.jsx)("button",{onClick:()=>{let b;return b=o(h||"my-skill",m),void(n(a),(!j||j===b)&&k(o(h||"my-skill",a)))},className:`px-2.5 py-1 text-xs transition-colors ${b>0?"border-l border-border":""} ${m===a?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:"general"===a?g?.skillTemplateGeneral??"General":"tool-use"===a?g?.skillTemplateToolUse??"Tool-use":g?.skillTemplateWorkflow??"Workflow"},a))})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground",children:g?.skillContent??"Content"}),(0,d.jsx)("textarea",{value:j||o(h||"my-skill"),onChange:a=>k(a.target.value),rows:16,placeholder:"Skill instructions (markdown)...",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"})]}),e&&(0,d.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,d.jsx)(A.A,{size:10}),e]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{onClick:()=>a(h.trim(),j||o(h.trim()||"my-skill")),disabled:!h.trim()||c,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[c&&(0,d.jsx)(D.A,{size:10,className:"animate-spin"}),g?.saveSkill??"Save"]}),(0,d.jsx)("button",{onClick:b,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:g?.cancelSkill??"Cancel"})]})]})}function c5({t:a}){let b,c,e=a.settings?.mcp,g=(0,aU.cd)(),[h,i]=(0,f.useState)([]),[k,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(!1),[t,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(null),[E,F]=(0,f.useState)(""),[G,H]=(0,f.useState)(""),[I,J]=(0,f.useState)({}),[K,L]=(0,f.useState)(null),[M,N]=(0,f.useState)({}),[O,P]=(0,f.useState)(!1),[Q,R]=(0,f.useState)(null),S=(0,f.useCallback)(async()=>{try{let a=await (0,y.n)("/api/skills");i(a.skills),N({})}catch(b){let a=b instanceof Error?b.message:"Failed to load skills";console.error("fetchSkills error:",a),N(b=>({...b,_root:a}))}m(!1)},[]),U=(0,f.useMemo)(()=>{if(!w)return h;let a=w.toLowerCase();return h.filter(b=>b.name.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))},[h,w]),V=(0,f.useMemo)(()=>U.filter(a=>"user"===a.source),[U]),W=(0,f.useMemo)(()=>U.filter(a=>"builtin"===a.source),[U]),X=async(a,b)=>{if(g){await g.toggleSkill(a,b),i(c=>c.map(c=>c.name===a?{...c,enabled:b}:c));return}try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:a,enabled:b})}),i(c=>c.map(c=>c.name===a?{...c,enabled:b}:c)),N(b=>{let c={...b};return delete c[a],c})}catch(c){let b=c instanceof Error?c.message:"Failed to toggle skill";console.error("handleToggle error:",b),N(c=>({...c,[a]:b}))}},Y=a=>{R(a)},Z=async a=>{try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",name:a})}),J(b=>{let c={...b};return delete c[a],c}),B===a&&C(null),n===a&&o(null),N(b=>{let c={...b};return delete c[a],c}),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(c){let b=c instanceof Error?c.message:"Failed to delete skill";console.error("handleDelete error:",b),N(c=>({...c,[a]:b}))}},$=async a=>{if(!I[a]){L(a);try{let b=await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:a})});J(c=>({...c,[a]:b.content})),N(b=>{let c={...b};return delete c[a],c})}catch(b){N(c=>({...c,[a]:b instanceof Error?b.message:"Failed to load skill content"}))}finally{L(null)}}},_=a=>{let b=n===a?null:a;o(b),b&&$(a),B&&B!==a&&C(null)},aa=a=>{C(a),F(I[a]||""),H("")},ab=async a=>{s(!0),H("");try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update",name:a,content:E})}),J(b=>({...b,[a]:E})),C(null),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(a){H(a instanceof Error?a.message:"Failed to save skill")}finally{s(!1)}},ac=()=>{C(null),F(""),H("")},ad=async(a,b)=>{if(a){s(!0),v("");try{await (0,y.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",name:a,content:b})}),q(!1),S(),window.dispatchEvent(new Event("mindos:skills-changed"))}catch(a){v(a instanceof Error?a.message:"Failed to create skill")}finally{s(!1)}}};return k?(0,d.jsx)("div",{className:"flex justify-center py-4",children:(0,d.jsx)(D.A,{size:16,className:"animate-spin text-muted-foreground"})}):(0,d.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(j.A,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:e?.searchSkills??"Search skills...",className:"w-full pl-7 pr-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring"}),w&&(0,d.jsx)("button",{onClick:()=>x(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,d.jsx)(l.A,{size:10})})]}),(b=h.find(a=>"mindos"===a.name)?.enabled??!0?"en":"zh",c=async a=>{if(a!==b&&!O){P(!0);try{"en"===a?(await X("mindos",!0),await X("mindos-zh",!1)):(await X("mindos-zh",!0),await X("mindos",!1))}catch(a){console.error("Lang switch failed:",a)}finally{P(!1)}}},(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:e?.skillLanguage??"Skill Language"}),(0,d.jsxs)("div",{className:"flex rounded-md border border-border overflow-hidden",children:[(0,d.jsx)("button",{onClick:()=>c("en"),disabled:O,className:`px-2.5 py-1 text-xs transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${"en"===b?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:e?.skillLangEn??"English"}),(0,d.jsx)("button",{onClick:()=>c("zh"),disabled:O,className:`px-2.5 py-1 text-xs transition-colors disabled:opacity-50 disabled:cursor-not-allowed border-l border-border ${"zh"===b?"bg-[var(--amber-subtle)] text-[var(--amber-text)] font-medium":"text-muted-foreground hover:bg-muted"}`,children:e?.skillLangZh??"中文"})]})]})),0===U.length&&w&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground text-center py-3",children:e?.noSkillsMatch?e.noSkillsMatch(w):`No skills match "${w}"`}),V.length>0&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:(0,d.jsxs)("span",{children:[e?.customGroup??"Custom"," (",V.length,")"]})}),(0,d.jsx)("div",{className:"space-y-1.5",children:V.map(a=>(0,d.jsx)(c1,{skill:a,expanded:n===a.name,onExpand:_,onToggle:X,onDelete:Y,onEditStart:aa,onEditSave:ab,onEditCancel:ac,editing:B,editContent:E,setEditContent:F,editError:G,saving:r,fullContent:I,loadingContent:K,loadErrors:M,m:e},a.name))})]}),W.length>0&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground cursor-pointer hover:text-foreground transition-colors",onClick:()=>A(!z),children:[z?(0,d.jsx)(u.A,{size:12}):(0,d.jsx)(ae.A,{size:12}),(0,d.jsxs)("span",{children:[e?.builtinGroup??"Built-in"," (",W.length,")"]})]}),!z&&(0,d.jsx)("div",{className:"space-y-1.5",children:W.map(a=>(0,d.jsx)(c1,{skill:a,expanded:n===a.name,onExpand:_,onToggle:X,onDelete:Y,onEditStart:aa,onEditSave:ab,onEditCancel:ac,editing:B,editContent:E,setEditContent:F,editError:G,saving:r,fullContent:I,loadingContent:K,loadErrors:M,m:e},a.name))})]}),p?(0,d.jsx)(c4,{onSave:ad,onCancel:()=>{q(!1),v("")},saving:r,error:t,m:e}):(0,d.jsxs)("button",{onClick:()=>q(!0),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(T.A,{size:12}),e?.addSkill??"+ Add Skill"]}),(0,d.jsx)(c6,{agents:g?.agents??[],skillName:h.find(a=>"mindos"===a.name)?.enabled??!0?"mindos":"mindos-zh",m:e}),(0,d.jsx)(as.TM,{open:!!Q,title:"Delete skill?",message:Q?e?.skillDeleteConfirm?.(Q)??`Delete skill "${Q}"?`:"",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:async()=>{R(null),await Z(Q)},onCancel:()=>R(null)})]})}function c6({agents:a,skillName:b,m:c}){let[e,g]=(0,f.useState)("claude-code"),h=`npx skills add GeminiLight/MindOS --skill ${b} -a ${e} -g -y`,i=`~/.agents/skills/${b}/SKILL.md`,j=async()=>{await (0,cu.l)(h)&&ar.oR.copy()},k=a.filter(a=>a.present&&a.installed),l=a.filter(a=>a.present&&!a.installed),m=a.filter(a=>!a.present);return(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-3 space-y-2.5",children:[(0,d.jsx)("p",{className:"text-2xs font-medium text-muted-foreground",children:c?.cliInstallHint??"Install via CLI:"}),(0,d.jsx)(cZ.A,{value:e,onChange:g,size:"sm",options:[...k.length>0?[{label:c?.connectedGroup??"Connected",options:k.map(a=>({value:a.key,label:a.name}))}]:[],...l.length>0?[{label:c?.detectedGroup??"Detected",options:l.map(a=>({value:a.key,label:a.name}))}]:[],...m.length>0?[{label:c?.notFoundGroup??"Not Installed",options:m.map(a=>({value:a.key,label:a.name}))}]:[]]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("code",{className:"flex-1 text-[10px] font-mono bg-muted/50 border border-border rounded-lg px-2.5 py-2 text-muted-foreground select-all overflow-x-auto whitespace-nowrap",children:h}),(0,d.jsx)("button",{onClick:j,className:"p-1.5 rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:(0,d.jsx)(ab.A,{size:11})})]}),(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground",children:[c?.skillPathHint??"Skill files installed at:"," ",(0,d.jsx)("code",{className:"font-mono text-[10px] bg-muted px-1 py-0.5 rounded",children:i})]})]})}function c7({t:a}){let b=(0,aU.cd)(),c=a.settings?.mcp,[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(""),[j,k]=(0,f.useState)("stdio"),l=(0,f.useRef)(void 0);if(!b||b.loading)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:18,className:"animate-spin text-muted-foreground"})});let m=b.agents.filter(a=>a.present&&a.installed),n=b.agents.filter(a=>a.present&&!a.installed),o=b.agents.filter(a=>!a.present),p=h||(b.agents[0]?.key??""),q=b.agents.find(a=>a.key===p);return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(c8,{status:b.status,restarting:e,onRestart:async()=>{g(!0);try{await (0,y.n)("/api/mcp/restart",{method:"POST"})}catch(a){console.error("[McpTab] Restart request failed:",a),g(!1);return}let a=Date.now()+6e4;clearInterval(l.current),l.current=setInterval(async()=>{if(Date.now()>a){clearInterval(l.current),g(!1),console.warn("[McpTab] MCP restart timed out after 60s");return}try{(await (0,y.n)("/api/mcp/status",{timeout:3e3})).running&&(clearInterval(l.current),g(!1),b.refresh())}catch(a){console.warn("[McpTab] Status poll attempt failed:",a)}},3e3)},onRefresh:b.refresh,m:c}),b.agents.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"MCP"}),(0,d.jsx)(c9,{connectedAgents:m,detectedAgents:n,notFoundAgents:o,currentAgent:q??null,mcpStatus:b.status,selectedAgent:p,onSelectAgent:a=>i(a),transport:j,onTransportChange:k,onCopy:async a=>{await (0,cu.l)(a)&&ar.oR.copy()},m:c})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:c?.skillsTitle??"Skills"}),(0,d.jsx)(c5,{t:a})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:c?.agentsTitle??"Agent Configuration"}),(0,d.jsx)(c$,{agents:b.agents,t:a,onRefresh:b.refresh})]})]})}function c8({status:a,restarting:b,onRestart:c,onRefresh:e,m:f}){return a?(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 flex items-center justify-between",children:[(0,d.jsx)("div",{className:"flex items-center gap-2.5 text-sm",children:b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-[var(--amber)]",children:f?.restarting??"Restarting..."})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${a.running?"bg-success":"bg-muted-foreground"}`}),(0,d.jsx)("span",{className:"text-foreground font-medium",children:a.running?f?.running??"Running":f?.stopped??"Stopped"}),a.running&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"\xb7"}),(0,d.jsx)("span",{className:"font-mono text-muted-foreground",children:a.endpoint}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[a.toolCount," tools"]})]})]})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[!a.running&&!b&&(0,d.jsxs)("button",{onClick:c,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(cz.A,{size:14})," ",f?.restart??"Restart"]}),(0,d.jsx)("button",{onClick:e,className:"p-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}):null}function c9({connectedAgents:a,detectedAgents:b,notFoundAgents:c,currentAgent:e,mcpStatus:g,selectedAgent:h,onSelectAgent:i,transport:j,onTransportChange:k,onCopy:l,m}){let n=(0,f.useMemo)(()=>e?(0,ct.$k)(e,g,j):null,[e,g,j]);return(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsx)(cZ.A,{value:h,onChange:i,options:[...a.length>0?[{label:m?.connectedGroup??"Connected",options:a.map(a=>({value:a.key,label:`${a.name} — ${a.transport??"stdio"} \xb7 ${a.scope??"global"}`}))}]:[],...b.length>0?[{label:m?.detectedGroup??"Detected (not configured)",options:b.map(a=>({value:a.key,label:`${a.name} — ${m?.notConfigured??"not configured"}`}))}]:[],...c.length>0?[{label:m?.notFoundGroup??"Not Installed",options:c.map(a=>({value:a.key,label:a.name}))}]:[]]}),e&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[e.present&&e.installed?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-success/10 text-success",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success inline-block"}),m?.tagConnected??"Connected"]}):e.present&&!e.installed?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-[var(--amber-subtle)] text-[var(--amber-text)]",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] inline-block"}),m?.tagDetected??"Detected — not configured"]}):(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-2xs font-medium bg-muted text-muted-foreground",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground inline-block"}),m?.tagNotInstalled??"Not installed"]}),e.transport&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded text-2xs bg-muted text-muted-foreground",children:e.transport}),e.scope&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded text-2xs bg-muted text-muted-foreground",children:e.scope})]}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden w-fit",children:[(0,d.jsxs)("button",{onClick:()=>k("stdio"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm transition-colors ${"stdio"===j?"bg-muted text-foreground font-medium":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(cs.A,{size:14})," ",m?.transportLocal??"Local (stdio)"]}),(0,d.jsxs)("button",{onClick:()=>k("http"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm transition-colors ${"http"===j?"bg-muted text-foreground font-medium":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)(aT.A,{size:14})," ",m?.transportRemote??"Remote (HTTP)"]})]}),"http"===j&&g&&!g.authConfigured&&(0,d.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(A.A,{size:12}),m?.noAuthWarning??"Auth not configured. Run `mindos token` to set up."]}),n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"text-[11px] font-mono bg-muted/50 border border-border rounded-lg p-3 overflow-x-auto whitespace-pre select-all max-h-[240px] overflow-y-auto",children:n.displaySnippet}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,d.jsxs)("button",{onClick:()=>l(n.snippet),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0",children:[(0,d.jsx)(ab.A,{size:14}),m?.copyConfig??"Copy config"]}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"→"}),(0,d.jsx)("span",{className:"font-mono text-muted-foreground truncate text-2xs",children:n.path})]})]})]})]})}var da=c(33740);let db="https://github.com/GeminiLight/MindOS/releases",dc="mindos_update_in_progress",dd={downloading:{en:"Downloading update",zh:"下载更新"},skills:{en:"Updating skills",zh:"更新 Skills"},rebuilding:{en:"Rebuilding app",zh:"重新构建应用"},restarting:{en:"Restarting server",zh:"重启服务"}};function de({status:a}){switch(a){case"done":return(0,d.jsx)(w.A,{size:14,className:"text-success shrink-0"});case"running":return(0,d.jsx)(D.A,{size:14,className:"animate-spin shrink-0 text-[var(--amber)]"});case"failed":return(0,d.jsx)(A.A,{size:14,className:"text-destructive shrink-0"});default:return(0,d.jsx)(da.A,{size:14,className:"text-muted-foreground/40 shrink-0"})}}function df(){let{t:a}=(0,v.Y)(),b=a.settings.update,[c,e]=(0,f.useState)("idle"),[g,h]=(0,f.useState)(!1),[i,j]=(0,f.useState)(null),[k,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(0),[o,p]=(0,f.useState)(""),q=async()=>{e("checking"),p("");try{let a=await null.checkUpdate();h(a.available),a.version&&j(a.version),e("idle")}catch{e("error"),p(b?.error??"Failed to check for updates.")}},r=async()=>{e("downloading"),n(0);try{await null.installUpdate()}catch{e("error"),p("Update failed. Please try again.")}};return(0,d.jsx)("div",{className:"space-y-6",children:(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(cs.A,{size:14,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"MindOS Desktop"})]}),k&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground",children:["v",k]})]}),"checking"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin"}),b?.checking??"Checking for updates..."]}),"idle"===c&&!g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),b?.upToDate??"You're up to date"]}),"idle"===c&&g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(a8.A,{size:13}),i?`Update available: v${i}`:"Update available"]}),"downloading"===c&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin text-[var(--amber)]"}),b?.desktopDownloading??"Downloading update..."]}),(0,d.jsx)("div",{className:"h-1 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-[var(--amber)] transition-all duration-300",style:{width:`${Math.max(m,3)}%`}})})]}),"ready"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),b?.desktopReady??"Update downloaded. Restart to apply."]}),"error"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:13}),o]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,d.jsxs)("button",{onClick:q,disabled:"checking"===c||"downloading"===c,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:"checking"===c?"animate-spin":""}),b?.checkButton??"Check for Updates"]}),"idle"===c&&g&&(0,d.jsxs)("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(a8.A,{size:14}),i?`Update to v${i}`:"Update"]}),"ready"===c&&(0,d.jsxs)("button",{onClick:async()=>{try{await null.installUpdate()}catch{e("error"),p(b?.error??"Failed to install update. Please try again.")}},className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(s.A,{size:14}),b?.desktopRestart??"Restart Now"]})]}),(0,d.jsxs)("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[(0,d.jsxs)("a",{href:db,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(E.A,{size:12}),b?.releaseNotes??"View release notes"]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/60",children:b?.desktopHint??"Updates are delivered through the Desktop app auto-updater."})]})]})})}function dg(){let[a,b]=(0,f.useState)(!1);return a?(0,d.jsx)(df,{}):(0,d.jsx)(dh,{})}function dh(){let{t:a,locale:b}=(0,v.Y)(),c=a.settings.update,[e,g]=(0,f.useState)(null),[h,i]=(0,f.useState)("idle"),[j,k]=(0,f.useState)(""),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),r=(0,f.useRef)(void 0),t=(0,f.useRef)(void 0),u=(0,f.useRef)(""),x=(0,f.useCallback)(async()=>{i("checking"),k("");try{let a=await (0,y.n)("/api/update-check");if(g(a),u.current||(u.current=a.current),a.hasUpdate){let b=localStorage.getItem("mindos_update_dismissed");localStorage.setItem("mindos_update_latest",a.latest),window.dispatchEvent(new Event(a.latest===b?"mindos:update-dismissed":"mindos:update-available"))}else localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),window.dispatchEvent(new Event("mindos:update-dismissed"));i("idle")}catch{i("error"),k(c?.error??"Failed to check for updates.")}},[c]),z=(0,f.useCallback)(()=>{clearInterval(r.current),clearTimeout(t.current)},[]),B=(0,f.useCallback)(a=>{z(),g(a),i("updated"),localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),localStorage.removeItem(dc),window.dispatchEvent(new Event("mindos:update-dismissed")),setTimeout(()=>window.location.reload(),2e3)},[z]),C=(0,f.useCallback)(()=>{r.current=setInterval(async()=>{try{let a=await (0,y.n)("/api/update-status",{timeout:5e3});if(q(!1),a.stages?.length>0&&m(a.stages),"failed"===a.stage){z(),localStorage.removeItem(dc),o(a.error||"Update failed"),i("error");return}if("done"===a.stage)try{let a=await (0,y.n)("/api/update-check");if(a.current!==u.current)return void B(a)}catch{}}catch{q(!0);try{let a=await (0,y.n)("/api/update-check",{timeout:5e3});a.current&&a.current!==u.current&&(m(a=>a.map(a=>({...a,status:"done"}))),B(a))}catch{}}},3e3),t.current=setTimeout(()=>{z(),localStorage.removeItem(dc),i("timeout")},3e5)},[z,B]),F=(0,f.useCallback)(async()=>{i("updating"),k(""),o(null),q(!1),m([{id:"downloading",status:"pending"},{id:"skills",status:"pending"},{id:"rebuilding",status:"pending"},{id:"restarting",status:"pending"}]),localStorage.setItem(dc,JSON.stringify({originalVer:u.current||e?.current,startedAt:Date.now()})),window.dispatchEvent(new Event("mindos:update-started"));try{await (0,y.n)("/api/update",{method:"POST"})}catch(a){if(a instanceof y.h){localStorage.removeItem(dc),o(a.message||"Update failed"),i("error");return}}C()},[C,e]),G=(0,f.useCallback)(()=>{o(null),F()},[F]),H="zh"===b?"zh":"en",I=l.filter(a=>"done"===a.status).length,J=l.length>0?Math.round(I/l.length*100):0;return(0,d.jsx)("div",{className:"space-y-6",children:(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"MindOS"}),e&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground",children:["v",e.current]})]}),"checking"===h&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(D.A,{size:13,className:"animate-spin"}),c?.checking??"Checking for updates..."]}),"idle"===h&&e&&!e.hasUpdate&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),c?.upToDate??"You're up to date"]}),"idle"===h&&e?.hasUpdate&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(a8.A,{size:13}),c?.available?c.available(e.current,e.latest):`Update available: v${e.current} → v${e.latest}`]}),"updating"===h&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("div",{className:"space-y-1.5",children:l.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)(de,{status:a.status}),(0,d.jsx)("span",{className:"pending"===a.status?"text-muted-foreground/50":"running"===a.status?"text-foreground":"text-muted-foreground",children:dd[a.id]?.[H]??a.id})]},a.id))}),(0,d.jsx)("div",{className:"h-1 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-[var(--amber)] transition-all duration-500 ease-out",style:{width:`${Math.max(J,5)}%`}})}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:p?c?.serverRestarting??"Server is restarting, please wait...":c?.updatingHint??"This may take 1–3 minutes. Do not close this page."})]}),"updated"===h&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,d.jsx)(w.A,{size:13}),c?.updated??"Updated successfully! Reloading..."]}),"timeout"===h&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--amber-text)]",children:[(0,d.jsx)(A.A,{size:13}),c?.timeout??"Update may still be in progress."]}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:c?.timeoutHint??"The server may need more time to rebuild. Try refreshing."}),(0,d.jsxs)("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(s.A,{size:12}),c?.refreshButton??"Refresh Page"]})]}),"error"===h&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-destructive",children:[(0,d.jsx)(A.A,{size:13}),n||j]}),n&&(0,d.jsxs)("button",{onClick:G,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(s.A,{size:12}),c?.retryButton??"Retry Update"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,d.jsxs)("button",{onClick:x,disabled:"checking"===h||"updating"===h,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,d.jsx)(s.A,{size:14,className:"checking"===h?"animate-spin":""}),c?.checkButton??"Check for Updates"]}),e?.hasUpdate&&"updating"!==h&&"updated"!==h&&(0,d.jsxs)("button",{onClick:F,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg font-medium text-[var(--amber-foreground)] bg-[var(--amber)] transition-colors",children:[(0,d.jsx)(a8.A,{size:14}),c?.updateButton?c.updateButton(e.latest):`Update to v${e.latest}`]})]}),(0,d.jsxs)("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[(0,d.jsxs)("a",{href:db,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(E.A,{size:12}),c?.releaseNotes??"View release notes"]}),(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:[c?.hint??"Updates are installed via npm. Equivalent to running"," ",(0,d.jsx)("code",{className:"font-mono bg-muted px-1 py-0.5 rounded",children:"mindos update"})," ",c?.inTerminal??"in your terminal."]})]})]})})}function di(){let{t:a}=(0,v.Y)(),b=a.settings.uninstall,[c,e]=(0,f.useState)("idle"),[g,h]=(0,f.useState)(""),[i,j]=(0,f.useState)(!0),[k,l]=(0,f.useState)(!0),m=async()=>{e("running"),h("");try{await (0,y.n)("/api/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({removeConfig:i})}),e("success")}catch(a){h(a instanceof Error?a.message:String(a)),e("error")}},n=({checked:a,onChange:b,label:c,desc:e,disabled:f})=>(0,d.jsxs)("label",{className:`flex items-start gap-2.5 p-2.5 rounded bg-muted/30 cursor-pointer select-none ${f?"opacity-50 cursor-not-allowed":"hover:bg-muted/50"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:a,onChange:a=>!f&&b(a.target.checked),disabled:f,className:"mt-0.5 form-check"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-foreground",children:c}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})]});return(0,d.jsxs)(F.L7,{icon:(0,d.jsx)(ad.A,{size:15}),title:b.title,description:(0,b.descCli),children:[(0,d.jsxs)("div",{className:"flex gap-2.5 p-3 rounded-md bg-muted/50 border border-border",children:[(0,d.jsx)(bd.A,{size:14,className:"text-success shrink-0 mt-0.5"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:b.kbSafe})]}),"idle"===c||"confirming"===c?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(n,{checked:!0,disabled:!0,label:b.stopServices,desc:b.stopServicesDesc,onChange:()=>{}}),(0,d.jsx)(n,{checked:i,onChange:j,label:b.removeConfig,desc:b.removeConfigDesc}),(0,d.jsx)(n,{checked:!0,disabled:!0,label:b.removeNpm,desc:b.removeNpmDesc,onChange:()=>{}}),!1]}):null,"idle"===c&&(0,d.jsxs)("button",{onClick:()=>e("confirming"),className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-error/10 text-error border border-error/20 hover:bg-error/20 transition-colors focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,d.jsx)(ad.A,{size:12,className:"inline mr-1.5 -mt-px"}),b.confirmButton]}),"confirming"===c&&(0,d.jsxs)("div",{className:"p-3 rounded-md border border-error/30 bg-error/5 space-y-2.5",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-error",children:b.confirmTitle}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:m,className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-error text-white hover:bg-error/90 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.confirmButton}),(0,d.jsx)("button",{onClick:()=>e("idle"),className:"px-3.5 py-2 text-sm font-medium rounded-lg bg-muted text-foreground hover:bg-muted/80 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.cancelButton})]})]}),"running"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,d.jsx)(D.A,{size:14,className:"animate-spin text-muted-foreground"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:b.running})]}),"success"===c&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,d.jsx)(w.A,{size:14,className:"text-success"}),(0,d.jsx)("span",{className:"text-xs text-success font-medium",children:(0,b.success)})]}),"error"===c&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(bv.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs text-error font-medium",children:b.error})]}),g&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:g}),(0,d.jsx)("button",{onClick:()=>e("idle"),className:"px-3 py-1.5 text-xs font-medium rounded-md bg-muted text-foreground hover:bg-muted/80 transition-colors focus-visible:ring-1 focus-visible:ring-ring",children:b.cancelButton})]})]})}function dj({visible:a,initialTab:b,variant:c,onClose:g}){let[h,i]=(0,f.useState)("ai"),[j,m]=(0,f.useState)(null),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)("idle"),{t:r,locale:t,setLocale:u}=(0,v.Y)(),x=(0,e.useRouter)();(0,f.useRef)(void 0),(0,f.useRef)(!1);let[z,B]=(0,f.useState)("lora"),[C,E]=(0,f.useState)("15px"),[F,G]=(0,f.useState)("780px"),[H,J]=(0,f.useState)(!0),[K,L]=(0,f.useState)(()=>!1),M="panel"===c;(0,f.useRef)(!1),(0,f.useCallback)(async a=>{o(!0);try{await (0,y.n)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ai:a.ai,agent:a.agent,mindRoot:a.mindRoot,webPassword:a.webPassword,authToken:a.authToken})}),q("saved"),setTimeout(()=>q("idle"),2500)}catch{q("error"),setTimeout(()=>q("idle"),2500)}finally{o(!1)}},[]);let N=(0,f.useCallback)(a=>{m(b=>b?{...b,ai:{...b.ai,...a}}:b)},[]),O=(0,f.useCallback)(a=>{m(b=>b?{...b,agent:{...b.agent??{},...a}}:b)},[]),P=(0,f.useCallback)(async()=>{if(!j)return;let a={provider:"anthropic",providers:{anthropic:{apiKey:"",model:""},openai:{apiKey:"",model:"",baseUrl:""}}};m(b=>b?{...b,ai:a}:b),setTimeout(()=>{(0,y.n)("/api/settings").then(a=>{m(a)}).catch(()=>q("error"))},1300)},[j]),Q=j?.envOverrides??{},R=M?12:13,S=[{id:"ai",label:r.settings.tabs.ai,icon:(0,d.jsx)(bx.A,{size:R})},{id:"mcp",label:r.settings.tabs.mcp??"MCP & Skills",icon:(0,d.jsx)(cE.A,{size:R})},{id:"knowledge",label:r.settings.tabs.knowledge,icon:(0,d.jsx)(k.A,{size:R})},{id:"appearance",label:r.settings.tabs.appearance,icon:(0,d.jsx)(cF.A,{size:R})},{id:"sync",label:r.settings.tabs.sync??"Sync",icon:(0,d.jsx)(s.A,{size:R})},{id:"update",label:r.settings.tabs.update??"Update",icon:(0,d.jsx)(a8.A,{size:R}),badge:K},{id:"uninstall",label:r.settings.tabs.uninstall??"Uninstall",icon:(0,d.jsx)(ad.A,{size:R})}],T=S.find(a=>a.id===h)?.label??"",U=()=>(0,d.jsx)("div",{className:`flex-1 overflow-y-auto min-h-0 ${M?"px-4 py-4 space-y-4":"px-5 py-5 space-y-5"}`,children:"load-error"===p&&("ai"===h||"knowledge"===h)?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-center",children:[(0,d.jsx)(A.A,{size:M?18:20,className:"text-destructive"}),(0,d.jsx)("p",{className:`${M?"text-xs":"text-sm"} text-destructive font-medium`,children:"Failed to load settings"}),!M&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Check that the server is running and AUTH_TOKEN is configured correctly."})]}):j||"appearance"===h||"mcp"===h||"sync"===h||"update"===h||"uninstall"===h?(0,d.jsxs)(d.Fragment,{children:["ai"===h&&j?.ai&&(0,d.jsx)(cG,{data:j,updateAi:N,updateAgent:O,t:r}),"appearance"===h&&(0,d.jsx)(cR,{font:z,setFont:B,fontSize:C,setFontSize:E,contentWidth:F,setContentWidth:G,dark:H,setDark:J,locale:t,setLocale:u,t:r}),"knowledge"===h&&j&&(0,d.jsx)(cX,{data:j,setData:m,t:r}),"sync"===h&&(0,d.jsx)(I,{t:r}),"mcp"===h&&(0,d.jsx)(c7,{t:r}),"update"===h&&(0,d.jsx)(dg,{}),"uninstall"===h&&(0,d.jsx)(di,{})]}):(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(D.A,{size:M?16:18,className:"animate-spin text-muted-foreground"})})}),V=()=>"ai"===h||"knowledge"===h?(0,d.jsxs)("div",{className:`${M?"px-4 py-2":"px-5 py-2.5"} border-t border-border shrink-0 flex items-center justify-between`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:["ai"===h&&Object.values(Q).some(Boolean)&&(0,d.jsxs)("button",{onClick:P,disabled:n||!j,className:`flex items-center gap-1.5 ${M?"px-2.5 py-1 text-xs rounded-md":"px-3 py-1.5 text-sm rounded-lg"} border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[(0,d.jsx)(cz.A,{size:M?12:13}),r.settings.ai.restoreFromEnv]}),"knowledge"===h&&(0,d.jsxs)("a",{href:"/setup?force=1",className:`flex items-center gap-1.5 ${M?"px-2.5 py-1 text-xs rounded-md":"px-3 py-1.5 text-sm rounded-lg"} border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:[(0,d.jsx)(cz.A,{size:M?12:13}),r.settings.reconfigure]})]}),!M&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[r.settings.save,"..."]})]}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]})]}):null;return M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,d.jsx)(k.A,{size:14,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider font-display",children:"Settings"})]}),(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:10,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsx)(w.A,{size:10,className:"text-success"}),"error"===p&&(0,d.jsx)(A.A,{size:10,className:"text-destructive"})]})})]}),(0,d.jsx)("div",{className:"flex border-b border-border px-3 shrink-0 overflow-x-auto scrollbar-none gap-0",children:S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-1 px-2 py-2 text-xs font-medium transition-colors border-b-2 -mb-px whitespace-nowrap ${h===a.id?"border-[var(--amber)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id))}),U(),V()]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col h-full md:hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[(0,d.jsx)("div",{className:"flex justify-center pt-2 pb-0 absolute top-0 left-1/2 -translate-x-1/2",children:(0,d.jsx)("div",{className:"w-8 h-1 rounded-full bg-muted-foreground/20"})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,d.jsx)(k.A,{size:15,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"font-display",children:r.settings.title})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]}),g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]})]}),(0,d.jsxs)("div",{className:"flex border-b border-border px-4 shrink-0 overflow-x-auto scrollbar-none gap-0",children:[S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px whitespace-nowrap ${h===a.id?"border-[var(--amber)] text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id)),(0,d.jsxs)("button",{onClick:()=>{g?.(),x.push("/help")},className:"flex items-center gap-1.5 px-3 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px whitespace-nowrap border-transparent text-muted-foreground hover:text-foreground",children:[(0,d.jsx)(cB.A,{size:R}),r.sidebar.help]})]}),U(),V()]}),(0,d.jsxs)("div",{className:"hidden md:flex flex-row h-full min-h-0",children:[(0,d.jsxs)("div",{className:"w-[180px] shrink-0 border-r border-border flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[(0,d.jsx)(k.A,{size:15,className:"text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm font-medium font-display text-foreground",children:r.settings.title})]}),(0,d.jsx)("nav",{className:"flex-1 overflow-y-auto py-1.5",children:S.map(a=>(0,d.jsxs)("button",{onClick:()=>i(a.id),className:`flex items-center gap-2 w-full px-4 py-2 text-sm font-medium transition-colors relative ${h===a.id?"text-foreground bg-muted":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[h===a.id&&(0,d.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-[3px] rounded-r-full bg-[var(--amber)]"}),a.icon,a.label,a.badge&&(0,d.jsx)("span",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-error shrink-0"})]},a.id))}),(0,d.jsx)("div",{className:"shrink-0 border-t border-border px-4 py-2",children:(0,d.jsxs)("button",{onClick:()=>{g?.(),x.push("/help")},className:"flex items-center gap-2 w-full px-0 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(cB.A,{size:13}),r.sidebar.help]})})]}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground font-display",children:T}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",role:"status","aria-live":"polite",children:[n&&(0,d.jsx)(D.A,{size:12,className:"animate-spin text-muted-foreground"}),"saved"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.A,{size:12,className:"text-success"}),(0,d.jsx)("span",{className:"text-success",children:r.settings.saved})]}),"error"===p&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:12,className:"text-destructive"}),(0,d.jsx)("span",{className:"text-destructive",children:r.settings.saveFailed})]})]}),g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]})]}),U(),V()]})]})]})}function dk({open:a,onClose:b,initialTab:c}){return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-end md:items-start justify-center md:pt-[10vh] modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(),children:(0,d.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"w-full md:max-w-3xl md:mx-4 bg-card border-t md:border border-border rounded-t-2xl md:rounded-xl shadow-2xl flex flex-col h-[88vh] md:h-[80vh] md:max-h-[85vh]",children:(0,d.jsx)(dj,{visible:a,variant:"modal",onClose:b,initialTab:c})})}):null}function dl(){let[a,b]=(0,f.useState)(!1),{t:c}=(0,v.Y)(),e=c.shortcutPanel,g="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",h=(0,f.useMemo)(()=>[{keys:`${g} K`,label:e.toggleSearch,section:e.navigation},{keys:`${g} /`,label:e.toggleAskAI,section:e.navigation},{keys:`${g} ,`,label:e.openSettings,section:e.navigation},{keys:`${g} ?`,label:e.keyboardShortcuts,section:e.navigation},{keys:"Esc",label:e.closePanel,section:e.panelsSection},{keys:`${g} S`,label:e.saveFile,section:e.editor},{keys:`${g} Z`,label:e.undo,section:e.editor},{keys:`${g} Shift Z`,label:e.redo,section:e.editor}],[g,e]);if(!a)return null;let i=[...new Set(h.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":e.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium font-display text-foreground",children:e.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:i.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:h.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:g}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",e.toggleHint]})})]})})}function dm(){let[a,b]=(0,f.useState)(0),[c,g]=(0,f.useState)(null),[i,j]=(0,f.useState)(!1);(0,f.useRef)(0);let[k,m]=(0,f.useState)(!1),[n,o]=(0,f.useState)(!1),p=(0,e.usePathname)(),{t:q}=(0,v.Y)();async function r(){try{await (0,y.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{b(0),g(0)}}return((0,f.useMemo)(()=>!(a<=0||p?.startsWith("/changes"))&&(null===c||!(a<=c))&&!i,[c,p,a,i]),k)?(0,d.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${n?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,d.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,d.jsx)(aY.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-xs text-foreground font-display whitespace-nowrap",children:q.changes.unreadBanner(a)}),(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,d.jsx)(h(),{href:"/changes",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-white focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:q.changes.reviewNow}),(0,d.jsx)("button",{type:"button",onClick:()=>void r(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:q.changes.markAllRead})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>g(a),"aria-label":q.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(l.A,{size:14})})]})})}):null}var dn=c(97621);let dp=(0,ai.createServerReference)("70b97339a2b77e94c358da0f2fdaea1fe2a52c65ad",ai.callServer,void 0,ai.findSourceMapURL,"revertSpaceInitAction");function dq(){let[a,b]=(0,f.useState)(null),[c,g]=(0,f.useState)(!1),[h,i]=(0,f.useTransition)(),j=(0,e.useRouter)(),{t:k}=(0,v.Y)(),m=(0,f.useCallback)(()=>{g(!1),setTimeout(()=>b(null),200)},[]);(0,f.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>g(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),j.refresh()):m()},[j,m]);let n=(0,f.useCallback)(()=>{a&&(m(),j.push(`/view/${(0,Z.O0)(a.spacePath+"/")}`))},[a,m,j]),o=(0,f.useCallback)(()=>{a&&i(async()=>{await dp(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),j.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(m,2e3)})},[a,j,m]),p=(0,f.useCallback)(()=>{m()},[m]);if(!a)return null;let q=k.home,{state:r}=a,s="done"===r,t="reverted"===r;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:s?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${t?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===r?"animate-pulse":""}`,children:t?(0,d.jsx)(dn.A,{size:12}):s?(0,d.jsx)(a0.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(bx.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:t?q.aiInitReverted(a.spaceName):s?q.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[q.aiInitGenerating(a.spaceName),(0,d.jsx)(dr,{})]})}),s&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:n,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-white hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:q.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:o,disabled:h,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:q.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:p,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(l.A,{size:12})})]})]})})}function dr(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
|
|
154
148
|
@keyframes dotBounce {
|
|
155
149
|
0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
|
|
156
150
|
30% { opacity: 1; transform: translateY(-2px); }
|
|
157
151
|
}
|
|
158
|
-
`})]})}var ds=c(50567),dt=c(22772),du=c(47086);function dv(a,b){let c=[],d=c.findIndex(b=>b.id===a);d>=0&&(c[d]={...c[d],...b});return c}function dw(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function dx({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:g}){let{t:h}=(0,v.Y)(),i=(0,e.useRouter)(),j=h.fileImport,k="organizing"===a.phase,{elapsed:m,displayHint:n}=function(a,b){let[c,d]=(0,f.useState)(0),[e,g]=(0,f.useState)(!1);return(0,f.useRef)(Date.now()),{elapsed:c,displayHint:e?{stage:"thinking"}:b}}(0,a.stageHint),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(!1),u=(0,f.useRef)(null),w=(0,f.useRef)(null),x="done"===a.phase,y="error"===a.phase,z=k||x||y,B=a.changes.filter(a=>a.ok&&!a.undone).length,C=(0,f.useCallback)(()=>{u.current&&clearTimeout(u.current),(x||y)&&(u.current=setTimeout(()=>{b()},18e4))},[x,y,b]),F=(0,f.useCallback)(()=>{C()},[C]),G=(0,f.useCallback)(async b=>{F(),t(!0);let c=await a.undoOne(b);t(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(w.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);dv(w.current,{files:c,status:d?"undone":"partial"}),g?.()}},0))},[a,F,g]),H=(0,f.useCallback)(async()=>{F(),t(!0);let b=await a.undoAll();t(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),w.current&&(dv(w.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),g?.()))},[a,F,g]),I=(0,f.useCallback)(a=>{F(),i.push(`/view/${(0,Z.O0)(a)}`)},[i,F]),J=(0,f.useCallback)(()=>{b()},[b]);if(!z)return null;function K(b,c){let e=b.undone,f=a.canUndo(b.path),g=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(dn.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(ds.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(dt.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:g}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:j.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?j.organizeCreated:j.organizeUpdated:j.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>G(b.path),disabled:s,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:j.organizeUndoOne,children:(0,d.jsx)(dn.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>I(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:j.organizeViewFile,children:(0,d.jsx)(E.A,{size:12})})]},`${b.path}-${c}`)}function L(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[x&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:H,disabled:s,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[s?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(dn.A,{size:12}),j.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:J,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(a0.A,{size:12}),j.organizeDone]})]})}return q?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&r(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:F,role:"dialog","aria-modal":"true","aria-label":j.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[k?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(bx.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(D.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):x?(0,d.jsx)(a0.A,{size:16,className:"text-success"}):(0,d.jsx)(A.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:j.organizeDetailTitle}),k&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:j.organizeElapsed(m)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>r(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:j.organizeMinimizeModal,children:(0,d.jsx)(aK.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:J,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(D.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:dw(h,n)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(du.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||k)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||j.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>K(a,b))})]}),y&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(x||y)&&L()]})}):o&&(x||y)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:F,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[x?(0,d.jsx)(a0.A,{size:14,className:"text-success"}):(0,d.jsx)(A.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:x?j.organizeReviewTitle:j.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{p(!1),r(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:j.organizeDetailTitle,children:(0,d.jsx)(aL.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>p(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(ae.A,{size:14})})]})]}),x&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>K(a,b))}),y&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),L()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:F,children:x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a0.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:j.organizeReviewDesc(B)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{p(!0),F()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(ae.A,{size:12,className:"rotate-180"}),j.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:J,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(a0.A,{size:12}),j.organizeDone]})]}):y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:j.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{p(!0),F()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:j.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:J,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(l.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(bx.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(D.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:dw(h,n)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:j.organizeElapsed(m)}),(0,d.jsx)("button",{type:"button",onClick:()=>{r(!0),F()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:j.organizeDetailTitle,children:(0,d.jsx)(aL.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:J,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(l.A,{size:14})})]})})}let dy=(0,ai.createServerReference)("70d315f76e02c47c4819cca810a1ff5d1d8d865616",ai.callServer,void 0,ai.findSourceMapURL,"createSpaceAction");var dz=c(90826);function dA({t:a,dirPaths:b}){let c=(0,e.useRouter)(),[g,h]=(0,f.useState)(!1),[i,j]=(0,f.useState)(""),[k,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)(!0),z=(0,f.useRef)(null),A=(0,f.useCallback)(()=>{h(!1),j(""),m(""),o(""),s(""),u(""),w(null)},[]),B=(0,f.useCallback)(b=>b.includes("/")||b.includes("\\")?(u(a.home.spaceNameNoSlash??"Name cannot contain / or \\"),!1):(u(""),!0),[a]),C=(0,f.useMemo)(()=>{let a=i.trim();return a?(n?n+"/":"")+a+"/":""},[i,n]),E=(0,f.useCallback)(async()=>{if(!i.trim()||p||!B(i))return;q(!0),s("");let b=i.trim(),d=await dy(b,k,n);if(d.success){let a=d.path??b;if(x&&v){let c="zh"===document.documentElement.lang?`初始化新建的心智空间「${b}」,路径为「${a}/」。${k?`描述:「${k}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
|
|
152
|
+
`})]})}var ds=c(50567),dt=c(22772),du=c(47086);function dv(a,b){let c=[],d=c.findIndex(b=>b.id===a);d>=0&&(c[d]={...c[d],...b});return c}function dw(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function dx({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:g}){let{t:h}=(0,v.Y)(),i=(0,e.useRouter)(),j=h.fileImport,k="organizing"===a.phase,{elapsed:m,displayHint:n}=function(a,b){let[c,d]=(0,f.useState)(0),[e,g]=(0,f.useState)(!1);return(0,f.useRef)(Date.now()),{elapsed:c,displayHint:e?{stage:"thinking"}:b}}(0,a.stageHint),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(!1),[s,t]=(0,f.useState)(!1),u=(0,f.useRef)(null),w=(0,f.useRef)(null),x="done"===a.phase,y="error"===a.phase,z=k||x||y,B=a.changes.filter(a=>a.ok&&!a.undone).length,C=(0,f.useCallback)(()=>{u.current&&clearTimeout(u.current),(x||y)&&(u.current=setTimeout(()=>{b()},18e4))},[x,y,b]),F=(0,f.useCallback)(()=>{C()},[C]),G=(0,f.useCallback)(async b=>{F(),t(!0);let c=await a.undoOne(b);t(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(w.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);dv(w.current,{files:c,status:d?"undone":"partial"}),g?.()}},0))},[a,F,g]),H=(0,f.useCallback)(async()=>{F(),t(!0);let b=await a.undoAll();t(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),w.current&&(dv(w.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),g?.()))},[a,F,g]),I=(0,f.useCallback)(a=>{F(),i.push(`/view/${(0,Z.O0)(a)}`)},[i,F]),J=(0,f.useCallback)(()=>{b()},[b]);if(!z)return null;function K(b,c){let e=b.undone,f=a.canUndo(b.path),g=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(dn.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(ds.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(dt.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:g}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:j.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?j.organizeCreated:j.organizeUpdated:j.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>G(b.path),disabled:s,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:j.organizeUndoOne,children:(0,d.jsx)(dn.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>I(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:j.organizeViewFile,children:(0,d.jsx)(E.A,{size:12})})]},`${b.path}-${c}`)}function L(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[x&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:H,disabled:s,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[s?(0,d.jsx)(D.A,{size:12,className:"animate-spin"}):(0,d.jsx)(dn.A,{size:12}),j.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:J,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(a0.A,{size:12}),j.organizeDone]})]})}return q?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&r(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:F,role:"dialog","aria-modal":"true","aria-label":j.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[k?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(bx.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(D.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):x?(0,d.jsx)(a0.A,{size:16,className:"text-success"}):(0,d.jsx)(A.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:j.organizeDetailTitle}),k&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:j.organizeElapsed(m)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>r(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:j.organizeMinimizeModal,children:(0,d.jsx)(aK.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:J,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(l.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(D.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:dw(h,n)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(du.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||k)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||j.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:j.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>K(a,b))})]}),y&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(x||y)&&L()]})}):o&&(x||y)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:F,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[x?(0,d.jsx)(a0.A,{size:14,className:"text-success"}):(0,d.jsx)(A.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:x?j.organizeReviewTitle:j.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{p(!1),r(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:j.organizeDetailTitle,children:(0,d.jsx)(aL.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>p(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(ae.A,{size:14})})]})]}),x&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>K(a,b))}),y&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),L()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:F,children:x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a0.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:j.organizeReviewDesc(B)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{p(!0),F()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(ae.A,{size:12,className:"rotate-180"}),j.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:J,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(a0.A,{size:12}),j.organizeDone]})]}):y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:j.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{p(!0),F()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:j.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:J,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(l.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(bx.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(D.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:dw(h,n)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:j.organizeElapsed(m)}),(0,d.jsx)("button",{type:"button",onClick:()=>{r(!0),F()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:j.organizeDetailTitle,children:(0,d.jsx)(aL.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:J,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(l.A,{size:14})})]})})}let dy=(0,ai.createServerReference)("705e41e1eae359661d7a8e233c3fc6f50addd22e1a",ai.callServer,void 0,ai.findSourceMapURL,"createSpaceAction");var dz=c(90826);function dA({t:a,dirPaths:b}){let c=(0,e.useRouter)(),[g,h]=(0,f.useState)(!1),[i,j]=(0,f.useState)(""),[k,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)(!0),z=(0,f.useRef)(null),A=(0,f.useCallback)(()=>{h(!1),j(""),m(""),o(""),s(""),u(""),w(null)},[]),B=(0,f.useCallback)(b=>b.includes("/")||b.includes("\\")?(u(a.home.spaceNameNoSlash??"Name cannot contain / or \\"),!1):(u(""),!0),[a]),C=(0,f.useMemo)(()=>{let a=i.trim();return a?(n?n+"/":"")+a+"/":""},[i,n]),E=(0,f.useCallback)(async()=>{if(!i.trim()||p||!B(i))return;q(!0),s("");let b=i.trim(),d=await dy(b,k,n);if(d.success){let a=d.path??b;if(x&&v){let c="zh"===document.documentElement.lang?`初始化新建的心智空间「${b}」,路径为「${a}/」。${k?`描述:「${k}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
|
|
159
153
|
1. 「${a}/README.md」— 写入空间用途、结构概览、使用指南
|
|
160
154
|
2. 「${a}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
|
|
161
155
|
|
|
@@ -175,7 +169,13 @@ Keep content concise and actionable. Write files directly using tools.`;window.d
|
|
|
175
169
|
padding-top: 0;
|
|
176
170
|
}
|
|
177
171
|
}
|
|
178
|
-
`})]})})})}function dK({fileTree:a,children:b}){return"/login"===(0,e.usePathname)()?(0,d.jsx)(d.Fragment,{children:b}):(0,d.jsx)(dJ,{fileTree:a,children:b})}},77505:(a,b,c)=>{"use strict";c.d(b,{LocaleProvider:()=>i,Y:()=>j});var d=c(48249),e=c(67484);let f={en:{common:{relatedFiles:"Related Files"},app:{tagline:"You think here, Agents act there.",footer:"MindOS \xb7 human-agent collaborative mind system"},login:{tagline:"You think here, Agents act there.",subtitle:"Enter your password to continue",passwordLabel:"Password",passwordPlaceholder:"Enter password",signIn:"Sign in",signingIn:"Signing in…",incorrectPassword:"Incorrect password. Please try again.",connectionError:"Connection error. Please try again."},notFound:{title:"File not found",description:"This file does not exist in your knowledge base.",createButton:"Create this file",creating:"Creating...",goToParent:"Go to parent folder",goHome:"Home"},updateBanner:{newVersion:(a,b)=>`MindOS v${a} available (current: v${b})`,updateNow:"Update",runUpdate:"Run",orSee:"or",releaseNotes:"release notes"},sidebar:{files:"Spaces",search:"Search",searchTitle:"Search",askTitle:"MindOS Agent",settingsTitle:"Settings",plugins:"Plugins",agents:"Agents",echo:"Echo",discover:"Discover",workflows:"Flows",history:"History",help:"Help",syncLabel:"Sync",collapseTitle:"Collapse sidebar",expandTitle:"Expand sidebar",collapseLevel:"Collapse one level",collapseLevelHint:"Collapse one level (double-click: all)",expandLevel:"Expand one level",expandLevelHint:"Expand one level (double-click: all)",importFile:"Import file",new:"New",newFile:"New file",newSpace:"New Space",sync:{synced:"Synced",unpushed:"awaiting push",unpushedHint:"commit(s) not yet pushed to remote — will sync automatically",conflicts:"conflicts",conflictsHint:"file(s) have merge conflicts — open Settings > Sync to resolve",syncError:"Sync error",syncOff:"Sync off",syncing:"Syncing...",syncNow:"Sync now",syncDone:"Sync complete",syncFailed:"Sync failed",syncRestored:"Sync restored",enableSync:"Enable sync",enableHint:"Set up cross-device sync"}},search:{placeholder:"Search files...",noResults:"No results found",prompt:"Type to search across all files",navigate:"navigate",open:"open",close:"close",tabSearch:"Search",tabActions:"Actions",openSettings:"Open Settings",restartWalkthrough:"Restart Walkthrough",toggleDarkMode:"Toggle Dark Mode",goToAgents:"Go to Agents",goToDiscover:"Go to Discover",goToHelp:"Go to Help",walkthroughRestarted:"Walkthrough restarted"},shortcutPanel:{title:"Keyboard Shortcuts",navigation:"Navigation",panelsSection:"Panels",editor:"Editor",toggleSearch:"Toggle Search",toggleAskAI:"Toggle Ask AI",openSettings:"Open Settings",keyboardShortcuts:"Keyboard Shortcuts",closePanel:"Close panel / Exit maximize",saveFile:"Save file",undo:"Undo",redo:"Redo",toggleHint:"to toggle this panel"},ask:{title:"MindOS Agent",fabLabel:"Ask AI",placeholder:"Ask a question... @ files, / skills",emptyPrompt:"Ask anything about your knowledge base",send:"send",newlineHint:"new line",panelComposerResize:"Drag up to enlarge the input area",panelComposerFooter:"Resize height",panelComposerResetHint:"Double-click to reset height",panelComposerKeyboard:"Arrow keys adjust height; Home/End min/max",attachFile:"Context",uploadedFiles:"Uploaded",skillsHint:"skills",attachCurrent:"attach current file",stopTitle:"Stop",cancelReconnect:"Cancel reconnect",connecting:"Thinking with you...",thinking:"Thinking...",thinkingLabel:"Thinking",searching:"Searching knowledge base...",generating:"Generating response...",stopped:"Generation stopped.",errorNoResponse:"AI returned no content. Possible causes: model does not support streaming, proxy compatibility issue, or request exceeds context limit.",reconnecting:(a,b)=>`Connection lost. Reconnecting (${a}/${b})...`,reconnectFailed:"Connection failed after multiple attempts.",retry:"Retry",suggestions:["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"],sessionHistory:"Session History",clearAll:"Clear all",confirmClear:"Confirm clear?",noSessions:"No saved sessions.",draftingHint:"AI is still running — you can draft the next step now."},changes:{unreadBanner:a=>`${a} content change${1===a?"":"s"} unread`,reviewNow:"Review now",dismiss:"Dismiss notification",title:"Content changes",subtitle:"Review recent edits across user and agent operations.",eventsCount:a=>`${a} event${1===a?"":"s"}`,unreadCount:a=>`${a} unread`,refresh:"Refresh",markSeen:"Mark seen",markAllRead:"Mark all read",filters:{filePath:"File path",filePathPlaceholder:"e.g. Projects/plan.md",source:"Agents (source)",operation:"Tools (operation)",operationAll:"All operations",keyword:"Keyword",keywordPlaceholder:"summary / op / path",all:"All",agent:"Agent",user:"User",system:"System"},loading:"Loading changes...",empty:"No content changes yet.",open:"Open",unchangedLines:a=>`... ${a} unchanged lines ...`,relativeTime:{justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`}},hints:{noValidFiles:"No valid files selected",aiOrganizing:"AI is organizing",importInProgress:"Import in progress",templateInitializing:"Another template is being initialized",configureAiKey:"Configure API key in Settings → AI",syncInProgress:"Sync already in progress",toggleInProgress:"Toggle operation in progress",typeMessage:"Type a message",mentionInProgress:"Mention or command in progress",cleanupInProgress:"Cleanup already in progress",tokenResetInProgress:"Token reset in progress",aiNotConfigured:"AI not configured or generation in progress",generationInProgress:"Generation in progress or AI not configured",cannotJumpForward:"Cannot jump forward in setup",testInProgressOrNoKey:"Test in progress or no API key",workflowStepRunning:"Workflow step already running",workflowRunning:"Workflow step is running",sessionHistory:"Session history",newSession:"New session",attachFile:"Attach local file",maximizePanel:"Maximize panel",restorePanel:"Restore panel",dockToSide:"Dock to side panel",openAsPopup:"Open as popup",closePanel:"Close",newChat:"New chat",closeSession:"Close session"},home:{recentlyModified:"Recently Modified",recentlyActive:"Recently Active",recentlyEdited:"Recently Edited",allSpaces:"All Spaces",spaces:"Spaces",nFiles:a=>`${a} file${1===a?"":"s"}`,other:"Other",newSpace:"New Space",spaceName:"Space name",spaceDescription:"Description",spaceDescPlaceholder:"Describe the purpose of this space",spaceNameNoSlash:"Name cannot contain / or \\",spaceExists:"A space with this name already exists",spaceCreateFailed:"Failed to create space",noSpacesYet:"No spaces yet. Create one to organize your knowledge.",spaceLocation:"Location",rootLevel:"Root",optional:"optional",aiInit:"AI initialize content",aiInitHint:"AI will generate a description and guidelines for this space",aiInitNoKey:"Configure an API key in Settings → AI to enable",aiInitGenerating:a=>`Generating content for ${a}`,aiInitReady:a=>`${a} ready`,aiInitReview:"Review",aiInitDiscard:"Discard",aiInitReverted:a=>`${a} reverted to template`,createSpace:"Create",cancelCreate:"Cancel",continueEditing:"Continue editing",newNote:"New Notes",builtinFeatures:"Tools",builtinActive:"Active",builtinInactive:"Not active",toolName:{"agent-inspector":"Agent Inspector","config-panel":"Config Panel",todo:"TODO Board","workflow-yaml":"Workflows"},toolDesc:{"agent-inspector":"View agent tool-call logs and audit trail","config-panel":"Edit and manage global configuration",todo:"Manage tasks as an interactive kanban board","workflow-yaml":"Execute step-by-step workflows with AI assistance"},plugins:"Extensions",changeHistory:"Change History",showMore:"Show more",showLess:"Show less",viewAll:"View all",createToActivate:"Create {file} to activate",shortcuts:{searchFiles:"Search files",askAI:"MindOS Agent",editFile:"Edit file",save:"Save",settings:"Settings"},relativeTime:{justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`},cleanupExamples:a=>`${a} example file${a>1?"s":""} from the template can be removed`,cleanupExamplesButton:"Clean up",cleanupExamplesDone:"Example files removed"},echoSpotlight:{title:"Echo",dailyLine:"Today's thought",placeholder:"A quiet line for today...",invite:"Record today's one thought",inviteDesc:"One line, no pressure. Echo reflects your thinking patterns over time.",goToEcho:"Open Echo",savedLocally:"Saved locally on this device"},suggestion:{title:"You might want to",staleFiles:a=>`${a} file${1!==a?"s":""} not updated in 30+ days`,reviewStale:"Review",dismiss:"Dismiss"},pulse:{title:"Knowledge Pulse",manage:"Manage",connectTitle:"Connect your AI tools",connectDesc:"Let Cursor, Claude Code, and ChatGPT read your notes.",connectAction:"Connect Agent",active:"Connected",detected:"Detected",notFound:"Not found",running:"Online",offline:"Offline",summary:(a,b)=>`${a} Agent${1!==a?"s":""} \xb7 ${b} Skills`,skillCount:(a,b)=>`${a}/${b} skills`,showMore:a=>`${a} more agent${1!==a?"s":""}`,showLess:"Show less",otherDetected:"Detected"},fileTree:{newFileTitle:"New file in this directory",rename:"Rename",delete:"Delete",create:"Create",enterFileName:"Enter a file name",failed:"Failed",confirmDelete:a=>`Delete "${a}"? You can recover from Trash for 30 days.`,rules:"Rules",about:"About",viewAll:"View all",editRules:"Edit Rules",renameSpace:"Rename Space",deleteSpace:"Delete Space",confirmDeleteSpace:a=>`Delete space "${a}" and all its files? You can recover from Trash for 30 days.`,convertToSpace:"Convert to Space",deleteFolder:"Delete Folder",confirmDeleteFolder:a=>`Delete folder "${a}" and all its contents? You can recover from Trash for 30 days.`,newFile:"New File",importFile:"Import File",importToSpace:"Import file to this space",copyPath:"Copy Path",pathCopied:"Path copied",pinToFavorites:"Pin to Favorites",removeFromFavorites:"Remove from Favorites",export:"Export..."},pinnedFiles:{title:"Pinned Files",addedToast:"Added to Favorites",removedToast:"Removed from Favorites",empty:"Pin files for quick access"},trash:{title:"Trash",subtitle:"Items you delete appear here for 30 days.",empty:"No deleted files yet.",emptySubtext:"Items you delete will appear here for 30 days.",emptyTrash:"Empty Trash",emptyTrashConfirm:"Permanently delete all items in Trash? This cannot be undone.",restore:"Restore",deletePermanently:"Delete Forever",deletePermanentlyConfirm:a=>`Permanently delete "${a}"? This cannot be undone.`,from:"From",deletedAgo:a=>`Deleted ${a}`,expiresIn:a=>`Expires in ${a} day${1!==a?"s":""}`,restored:"Restored successfully",deleted:"Permanently deleted",movedToTrash:"Deleted",undo:"Undo",undoFailed:"Undo failed",emptied:a=>`Emptied ${a} item${1!==a?"s":""} from Trash`,restoreConflict:"A file with this name already exists at the original location.",overwrite:"Overwrite",saveAsCopy:"Save as Copy",itemCount:a=>`${a} item${1!==a?"s":""}`,undoDelete:"Undo",viewInTrash:"View in Trash",fileDeleted:a=>`"${a}" moved to Trash`,cancel:"Cancel",justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`},export:{title:"Export",exportFile:"Export File",exportSpace:"Export Space",chooseFormat:"Choose format",formatMd:"Markdown (.md)",formatMdDesc:"Original format, editable",formatHtml:"HTML (.html)",formatHtmlDesc:"Static webpage, shareable",formatZipMd:"Markdown ZIP",formatZipMdDesc:"All files in original format",formatZipHtml:"HTML ZIP",formatZipHtmlDesc:"All files as webpages",preview:"Preview",exporting:"Exporting...",exportButton:"Export",cancel:"Cancel",close:"Done",done:"Export Complete",downloadAgain:"Download Again",fileCount:a=>`${a} file${1!==a?"s":""}`,downloaded:"Downloaded",error:"Export failed",retry:"Retry"},fileImport:{title:"Import Files",subtitle:"Save files to your knowledge base or let AI organize them",dropzoneText:"Drag files here, or",dropzoneButton:"click to select",dropzoneCompact:"Drag more files, or",dropzoneCompactButton:"click to add",dropzoneMobile:"Tap to select files",fileCount:a=>`${a} file${1!==a?"s":""}`,clearAll:"Clear all",unsupported:"Unsupported file type",tooLarge:a=>`File too large (max ${a})`,archiveTitle:"Save to Knowledge Base",archiveDesc:"Save as-is to a space",digestTitle:"AI Organize",digestDesc:"Extract key points into notes",archiveConfigTitle:"Save to Knowledge Base",back:"← Back",targetSpace:"Target space",rootDir:"Root",conflictLabel:"If file already exists",conflictRename:"Auto-rename (add number suffix)",conflictSkip:"Skip",conflictOverwrite:"Overwrite existing file",overwriteWarn:"This will permanently replace existing file content",cancel:"Cancel",importButton:a=>`Save ${a} file${1!==a?"s":""}`,importing:"Saving...",preparing:"Preparing...",successToast:(a,b)=>`Saved ${a} file${1!==a?"s":""} to ${b||"knowledge base"}`,updatedIndex:a=>`Updated ${a} index file${1!==a?"s":""}`,partialToast:(a,b)=>`Saved ${a}/${b} files`,skipReason:"File already exists",failToast:"Import failed",retry:"Retry",undo:"Undo",discardTitle:"Discard import?",discardMessage:a=>`Discard ${a} selected file${1!==a?"s":""}?`,discardConfirm:"Discard",discardCancel:"Cancel",dropOverlay:"Drop files to import into knowledge base",dropOverlayFormats:"Supports .md .txt .pdf .csv .json .yaml .html",onboardingHint:"Already have notes? Import files →",digestPromptSingle:(a,b)=>{let c=b?` under the "${b}" space`:"";return`The user uploaded "${a}". You MUST:
|
|
172
|
+
`})]})})})}function dK({fileTree:a,children:b}){return"/login"===(0,e.usePathname)()?(0,d.jsx)(d.Fragment,{children:b}):(0,d.jsx)(dJ,{fileTree:a,children:b})}},59420:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23))},59528:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23)),Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},60442:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call CsvRenderer() from the server but CsvRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/csv/CsvRenderer.tsx","CsvRenderer")},60725:(a,b,c)=>{"use strict";function d(a,b,c){let d,e,f;if("stdio"===c){var g,h,i;let b={type:"stdio",command:"mindos",args:["mcp"]};if("toml"===a.format){let b=`[${a.configKey}.mindos]
|
|
173
|
+
command = "mindos"
|
|
174
|
+
args = ["mcp"]
|
|
175
|
+
|
|
176
|
+
[${a.configKey}.mindos.env]
|
|
177
|
+
MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if(a.globalNestedKey){let c=JSON.stringify({[a.configKey]:{mindos:b}},null,2);return{snippet:c,displaySnippet:c,path:a.projectPath??a.globalPath}}let c=JSON.stringify({[a.configKey]:{mindos:b}},null,2);return{snippet:c,displaySnippet:c,path:a.globalPath}}return g=b?.endpoint??"http://127.0.0.1:8781/mcp",h=b?.authToken,i=b?.maskedToken,d={url:g},h&&(d.headers={Authorization:`Bearer ${h}`}),e={url:g},i&&(e.headers={Authorization:`Bearer ${i}`}),{snippet:(f=b=>{if("toml"===a.format){let c=[`[${a.configKey}.mindos]`,'type = "http"',`url = "${g}"`],d=b.headers?.Authorization;return d&&(c.push(""),c.push(`[${a.configKey}.mindos.headers]`),c.push(`Authorization = "${d}"`)),c.join("\n")}return a.globalNestedKey,JSON.stringify({[a.configKey]:{mindos:b}},null,2)})(d),displaySnippet:f(h?e:d),path:"toml"===a.format?a.globalPath:a.globalNestedKey?a.projectPath??a.globalPath:a.globalPath}}c.d(b,{$k:()=>d})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"#8ab4d8",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"#c8a0d8",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:["ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipProvider")},72362:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>j});var d=c(48249),e=c(67484),f=c(40560),g=c(42742),h=c(46674),i=c(24520);function j({content:a,saveAction:b}){let c=(0,e.useMemo)(()=>{try{return JSON.parse(a)}catch{return null}},[a]),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)({}),t=j??{},u=t.uiSchema?.sections??[],v=t.keySpecs??{},w=(0,e.useCallback)(async a=>{m(!0),o(!1),q("");try{await b(`${JSON.stringify(a,null,2)}
|
|
178
|
+
`),o(!0),setTimeout(()=>o(!1),1200)}catch(a){q(a instanceof Error?a.message:"Failed to save")}finally{m(!1)}},[b]),x=(0,e.useCallback)(async(a,b)=>{if(!j)return;let c=function(a,b,c){let d=b.split("."),e=structuredClone(a),f=e;for(let a=0;a<d.length-1;a++){let b=d[a],c=f[b];(!c||"object"!=typeof c||Array.isArray(c))&&(f[b]={}),f=f[b]}return f[d[d.length-1]]=c,e}(j,a,b);k(c),await w(c)},[j,w]);return c&&j?(0,d.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,d.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[l&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,d.jsx)(f.A,{size:12,className:"animate-spin"}),"Saving"]}),!l&&n&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,d.jsx)(g.A,{size:12}),"Saved"]})]})]}),p&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:p}),u.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),(0,d.jsx)("div",{className:"space-y-3",children:a.fields.map(a=>{let b=v[a]??{},c=function(a,b){let c=b.split("."),d=a;for(let a of c){if(!d||"object"!=typeof d||!(a in d))return null;d=d[a]}return d}(j,a),e=b.label||a;return(0,d.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:e}),b.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]}),"switch"===b.control&&"boolean"==typeof c&&(0,d.jsx)("button",{type:"button",onClick:()=>x(a,!c),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:c?"var(--amber)":"var(--muted)",color:c?"var(--amber-foreground)":"var(--muted-foreground)"},children:c?"ON":"OFF"})]}),"text"===b.control&&"string"==typeof c&&(0,d.jsx)("input",{defaultValue:c,onBlur:b=>x(a,b.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===b.control&&"number"==typeof c&&(0,d.jsx)("input",{type:"number",defaultValue:c,min:b.constraints?.min,max:b.constraints?.max,onBlur:d=>{let e=Number(d.target.value),f=b.constraints?.min,g=b.constraints?.max,h=Number.isFinite(e)?e:c;"number"==typeof f&&h<f&&(h=f),"number"==typeof g&&h>g&&(h=g),x(a,h)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===b.control&&Array.isArray(c)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.map((b,e)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(b),(0,d.jsx)("button",{type:"button",onClick:()=>x(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{size:11})})]},`${String(b)}-${e}`))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:r[a]??"",onChange:b=>s(c=>({...c,[a]:b.target.value})),onKeyDown:b=>{if("Enter"!==b.key)return;b.preventDefault();let d=(r[a]??"").trim();d&&(x(a,[...c,d]),s(b=>({...b,[a]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,d.jsxs)("button",{type:"button",onClick:()=>{let b=(r[a]??"").trim();b&&(x(a,[...c,b]),s(b=>({...b,[a]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:12})," Add"]})]})]})]},a)})})]},a.id))]}):(0,d.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},77505:(a,b,c)=>{"use strict";c.d(b,{LocaleProvider:()=>i,Y:()=>j});var d=c(48249),e=c(67484);let f={en:{common:{relatedFiles:"Related Files"},app:{tagline:"You think here, Agents act there.",footer:"MindOS \xb7 human-agent collaborative mind system"},login:{tagline:"You think here, Agents act there.",subtitle:"Enter your password to continue",passwordLabel:"Password",passwordPlaceholder:"Enter password",signIn:"Sign in",signingIn:"Signing in…",incorrectPassword:"Incorrect password. Please try again.",connectionError:"Connection error. Please try again."},notFound:{title:"File not found",description:"This file does not exist in your knowledge base.",createButton:"Create this file",creating:"Creating...",goToParent:"Go to parent folder",goHome:"Home"},updateBanner:{newVersion:(a,b)=>`MindOS v${a} available (current: v${b})`,updateNow:"Update",runUpdate:"Run",orSee:"or",releaseNotes:"release notes"},sidebar:{files:"Spaces",search:"Search",searchTitle:"Search",askTitle:"MindOS Agent",settingsTitle:"Settings",plugins:"Plugins",agents:"Agents",echo:"Echo",discover:"Discover",workflows:"Flows",history:"History",help:"Help",syncLabel:"Sync",collapseTitle:"Collapse sidebar",expandTitle:"Expand sidebar",collapseLevel:"Collapse one level",collapseLevelHint:"Collapse one level (double-click: all)",expandLevel:"Expand one level",expandLevelHint:"Expand one level (double-click: all)",importFile:"Import file",new:"New",newFile:"New file",newSpace:"New Space",sync:{synced:"Synced",unpushed:"awaiting push",unpushedHint:"commit(s) not yet pushed to remote — will sync automatically",conflicts:"conflicts",conflictsHint:"file(s) have merge conflicts — open Settings > Sync to resolve",syncError:"Sync error",syncOff:"Sync off",syncing:"Syncing...",syncNow:"Sync now",syncDone:"Sync complete",syncFailed:"Sync failed",syncRestored:"Sync restored",enableSync:"Enable sync",enableHint:"Set up cross-device sync"}},search:{placeholder:"Search files...",noResults:"No results found",prompt:"Type to search across all files",navigate:"navigate",open:"open",close:"close",tabSearch:"Search",tabActions:"Actions",openSettings:"Open Settings",restartWalkthrough:"Restart Walkthrough",toggleDarkMode:"Toggle Dark Mode",goToAgents:"Go to Agents",goToDiscover:"Go to Discover",goToHelp:"Go to Help",walkthroughRestarted:"Walkthrough restarted"},shortcutPanel:{title:"Keyboard Shortcuts",navigation:"Navigation",panelsSection:"Panels",editor:"Editor",toggleSearch:"Toggle Search",toggleAskAI:"Toggle Ask AI",openSettings:"Open Settings",keyboardShortcuts:"Keyboard Shortcuts",closePanel:"Close panel / Exit maximize",saveFile:"Save file",undo:"Undo",redo:"Redo",toggleHint:"to toggle this panel"},ask:{title:"MindOS Agent",fabLabel:"Ask AI",placeholder:"Ask a question... @ files, / skills",emptyPrompt:"Ask anything about your knowledge base",send:"send",newlineHint:"new line",panelComposerResize:"Drag up to enlarge the input area",panelComposerFooter:"Resize height",panelComposerResetHint:"Double-click to reset height",panelComposerKeyboard:"Arrow keys adjust height; Home/End min/max",attachFile:"Context",uploadedFiles:"Uploaded",skillsHint:"skills",attachCurrent:"attach current file",stopTitle:"Stop",cancelReconnect:"Cancel reconnect",connecting:"Thinking with you...",thinking:"Thinking...",thinkingLabel:"Thinking",searching:"Searching knowledge base...",generating:"Generating response...",stopped:"Generation stopped.",errorNoResponse:"AI returned no content. Possible causes: model does not support streaming, proxy compatibility issue, or request exceeds context limit.",reconnecting:(a,b)=>`Connection lost. Reconnecting (${a}/${b})...`,reconnectFailed:"Connection failed after multiple attempts.",retry:"Retry",suggestions:["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"],sessionHistory:"Session History",clearAll:"Clear all",confirmClear:"Confirm clear?",noSessions:"No saved sessions.",draftingHint:"AI is still running — you can draft the next step now."},changes:{unreadBanner:a=>`${a} content change${1===a?"":"s"} unread`,reviewNow:"Review now",dismiss:"Dismiss notification",title:"Content changes",subtitle:"Review recent edits across user and agent operations.",eventsCount:a=>`${a} event${1===a?"":"s"}`,unreadCount:a=>`${a} unread`,refresh:"Refresh",markSeen:"Mark seen",markAllRead:"Mark all read",filters:{filePath:"File path",filePathPlaceholder:"e.g. Projects/plan.md",source:"Agents (source)",operation:"Tools (operation)",operationAll:"All operations",keyword:"Keyword",keywordPlaceholder:"summary / op / path",all:"All",agent:"Agent",user:"User",system:"System"},loading:"Loading changes...",empty:"No content changes yet.",open:"Open",unchangedLines:a=>`... ${a} unchanged lines ...`,relativeTime:{justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`}},hints:{noValidFiles:"No valid files selected",aiOrganizing:"AI is organizing",importInProgress:"Import in progress",templateInitializing:"Another template is being initialized",configureAiKey:"Configure API key in Settings → AI",syncInProgress:"Sync already in progress",toggleInProgress:"Toggle operation in progress",typeMessage:"Type a message",mentionInProgress:"Mention or command in progress",cleanupInProgress:"Cleanup already in progress",tokenResetInProgress:"Token reset in progress",aiNotConfigured:"AI not configured or generation in progress",generationInProgress:"Generation in progress or AI not configured",cannotJumpForward:"Cannot jump forward in setup",testInProgressOrNoKey:"Test in progress or no API key",workflowStepRunning:"Workflow step already running",workflowRunning:"Workflow step is running",sessionHistory:"Session history",newSession:"New session",attachFile:"Attach local file",maximizePanel:"Maximize panel",restorePanel:"Restore panel",dockToSide:"Dock to side panel",openAsPopup:"Open as popup",closePanel:"Close",newChat:"New chat",closeSession:"Close session"},home:{recentlyModified:"Recently Modified",recentlyActive:"Recently Active",recentlyEdited:"Recently Edited",allSpaces:"All Spaces",spaces:"Spaces",nFiles:a=>`${a} file${1===a?"":"s"}`,other:"Other",newSpace:"New Space",spaceName:"Space name",spaceDescription:"Description",spaceDescPlaceholder:"Describe the purpose of this space",spaceNameNoSlash:"Name cannot contain / or \\",spaceExists:"A space with this name already exists",spaceCreateFailed:"Failed to create space",noSpacesYet:"No spaces yet. Create one to organize your knowledge.",spaceLocation:"Location",rootLevel:"Root",optional:"optional",aiInit:"AI initialize content",aiInitHint:"AI will generate a description and guidelines for this space",aiInitNoKey:"Configure an API key in Settings → AI to enable",aiInitGenerating:a=>`Generating content for ${a}`,aiInitReady:a=>`${a} ready`,aiInitReview:"Review",aiInitDiscard:"Discard",aiInitReverted:a=>`${a} reverted to template`,createSpace:"Create",cancelCreate:"Cancel",continueEditing:"Continue editing",newNote:"New Notes",builtinFeatures:"Tools",builtinActive:"Active",builtinInactive:"Not active",toolName:{"agent-inspector":"Agent Inspector","config-panel":"Config Panel",todo:"TODO Board","workflow-yaml":"Workflows"},toolDesc:{"agent-inspector":"View agent tool-call logs and audit trail","config-panel":"Edit and manage global configuration",todo:"Manage tasks as an interactive kanban board","workflow-yaml":"Execute step-by-step workflows with AI assistance"},plugins:"Extensions",changeHistory:"Change History",showMore:"Show more",showLess:"Show less",viewAll:"View all",createToActivate:"Create {file} to activate",shortcuts:{searchFiles:"Search files",askAI:"MindOS Agent",editFile:"Edit file",save:"Save",settings:"Settings"},relativeTime:{justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`},cleanupExamples:a=>`${a} example file${a>1?"s":""} from the template can be removed`,cleanupExamplesButton:"Clean up",cleanupExamplesDone:"Example files removed"},echoSpotlight:{title:"Echo",dailyLine:"Today's thought",placeholder:"A quiet line for today...",invite:"Record today's one thought",inviteDesc:"One line, no pressure. Echo reflects your thinking patterns over time.",goToEcho:"Open Echo",savedLocally:"Saved locally on this device"},suggestion:{title:"You might want to",staleFiles:a=>`${a} file${1!==a?"s":""} not updated in 30+ days`,reviewStale:"Review",dismiss:"Dismiss"},pulse:{title:"Knowledge Pulse",manage:"Manage",connectTitle:"Connect your AI tools",connectDesc:"Let Cursor, Claude Code, and ChatGPT read your notes.",connectAction:"Connect Agent",active:"Connected",detected:"Detected",notFound:"Not found",running:"Online",offline:"Offline",summary:(a,b)=>`${a} Agent${1!==a?"s":""} \xb7 ${b} Skills`,skillCount:(a,b)=>`${a}/${b} skills`,showMore:a=>`${a} more agent${1!==a?"s":""}`,showLess:"Show less",otherDetected:"Detected"},fileTree:{newFileTitle:"New file in this directory",rename:"Rename",delete:"Delete",create:"Create",enterFileName:"Enter a file name",failed:"Failed",confirmDelete:a=>`Delete "${a}"? You can recover from Trash for 30 days.`,rules:"Rules",about:"About",viewAll:"View all",editRules:"Edit Rules",renameSpace:"Rename Space",deleteSpace:"Delete Space",confirmDeleteSpace:a=>`Delete space "${a}" and all its files? You can recover from Trash for 30 days.`,convertToSpace:"Convert to Space",deleteFolder:"Delete Folder",confirmDeleteFolder:a=>`Delete folder "${a}" and all its contents? You can recover from Trash for 30 days.`,newFile:"New File",importFile:"Import File",importToSpace:"Import file to this space",copyPath:"Copy Path",pathCopied:"Path copied",pinToFavorites:"Pin to Favorites",removeFromFavorites:"Remove from Favorites",export:"Export..."},pinnedFiles:{title:"Pinned Files",addedToast:"Added to Favorites",removedToast:"Removed from Favorites",empty:"Pin files for quick access"},trash:{title:"Trash",subtitle:"Items you delete appear here for 30 days.",empty:"No deleted files yet.",emptySubtext:"Items you delete will appear here for 30 days.",emptyTrash:"Empty Trash",emptyTrashConfirm:"Permanently delete all items in Trash? This cannot be undone.",restore:"Restore",deletePermanently:"Delete Forever",deletePermanentlyConfirm:a=>`Permanently delete "${a}"? This cannot be undone.`,from:"From",deletedAgo:a=>`Deleted ${a}`,expiresIn:a=>`Expires in ${a} day${1!==a?"s":""}`,restored:"Restored successfully",deleted:"Permanently deleted",movedToTrash:"Deleted",undo:"Undo",undoFailed:"Undo failed",emptied:a=>`Emptied ${a} item${1!==a?"s":""} from Trash`,restoreConflict:"A file with this name already exists at the original location.",overwrite:"Overwrite",saveAsCopy:"Save as Copy",itemCount:a=>`${a} item${1!==a?"s":""}`,undoDelete:"Undo",viewInTrash:"View in Trash",fileDeleted:a=>`"${a}" moved to Trash`,cancel:"Cancel",justNow:"just now",minutesAgo:a=>`${a}m ago`,hoursAgo:a=>`${a}h ago`,daysAgo:a=>`${a}d ago`},export:{title:"Export",exportFile:"Export File",exportSpace:"Export Space",chooseFormat:"Choose format",formatMd:"Markdown (.md)",formatMdDesc:"Original format, editable",formatHtml:"HTML (.html)",formatHtmlDesc:"Static webpage, shareable",formatZipMd:"Markdown ZIP",formatZipMdDesc:"All files in original format",formatZipHtml:"HTML ZIP",formatZipHtmlDesc:"All files as webpages",preview:"Preview",exporting:"Exporting...",exportButton:"Export",cancel:"Cancel",close:"Done",done:"Export Complete",downloadAgain:"Download Again",fileCount:a=>`${a} file${1!==a?"s":""}`,downloaded:"Downloaded",error:"Export failed",retry:"Retry"},fileImport:{title:"Import Files",subtitle:"Save files to your knowledge base or let AI organize them",dropzoneText:"Drag files here, or",dropzoneButton:"click to select",dropzoneCompact:"Drag more files, or",dropzoneCompactButton:"click to add",dropzoneMobile:"Tap to select files",fileCount:a=>`${a} file${1!==a?"s":""}`,clearAll:"Clear all",unsupported:"Unsupported file type",tooLarge:a=>`File too large (max ${a})`,archiveTitle:"Save to Knowledge Base",archiveDesc:"Save as-is to a space",digestTitle:"AI Organize",digestDesc:"Extract key points into notes",archiveConfigTitle:"Save to Knowledge Base",back:"← Back",targetSpace:"Target space",rootDir:"Root",conflictLabel:"If file already exists",conflictRename:"Auto-rename (add number suffix)",conflictSkip:"Skip",conflictOverwrite:"Overwrite existing file",overwriteWarn:"This will permanently replace existing file content",cancel:"Cancel",importButton:a=>`Save ${a} file${1!==a?"s":""}`,importing:"Saving...",preparing:"Preparing...",successToast:(a,b)=>`Saved ${a} file${1!==a?"s":""} to ${b||"knowledge base"}`,updatedIndex:a=>`Updated ${a} index file${1!==a?"s":""}`,partialToast:(a,b)=>`Saved ${a}/${b} files`,skipReason:"File already exists",failToast:"Import failed",retry:"Retry",undo:"Undo",discardTitle:"Discard import?",discardMessage:a=>`Discard ${a} selected file${1!==a?"s":""}?`,discardConfirm:"Discard",discardCancel:"Cancel",dropOverlay:"Drop files to import into knowledge base",dropOverlayFormats:"Supports .md .txt .pdf .csv .json .yaml .html",onboardingHint:"Already have notes? Import files →",digestPromptSingle:(a,b)=>{let c=b?` under the "${b}" space`:"";return`The user uploaded "${a}". You MUST:
|
|
179
179
|
1. Read the content from the "USER-UPLOADED FILES" section above
|
|
180
180
|
2. Extract and reorganize the key information into well-structured Markdown notes
|
|
181
181
|
3. Save the result${c} in the knowledge base — create new files or update existing ones as appropriate
|
|
@@ -199,4 +199,4 @@ ${a.trim()||"(empty line)"}`,pastYouDrawLabel:"A glimpse from the past",pastYouA
|
|
|
199
199
|
|
|
200
200
|
不要只做文字回复。你必须实际写入知识库。`},arrowTo:"→",remove:"移除",aiRecommended:"推荐",aiRecommendedHint:"根据文件名自动匹配",conflictsFound:a=>`${a} 个文件已存在`,organizeTitle:"AI 整理中",organizeProcessing:"AI 正在分析和整理你的文件...",organizeConnecting:"正在连接 AI...",organizeAnalyzing:"AI 正在分析你的文件...",organizeReading:a=>a?`正在阅读 ${a}...`:"正在阅读文件...",organizeThinking:"AI 正在深度思考...",organizeWriting:a=>a?`正在写入 ${a}...`:"正在写入文件...",organizeElapsed:a=>{let b=Math.floor(a/60);return`${b}:${(a%60).toString().padStart(2,"0")}`},organizeCancel:"取消",organizeMinimize:"继续浏览",organizeExpand:"查看",organizeCreating:a=>`正在创建 ${a}`,organizeUpdating:a=>`正在更新 ${a}`,organizeReviewTitle:"整理完成",organizeErrorTitle:"整理失败",organizeReviewDesc:a=>`AI 整理了 ${a} 处变更`,organizeCreated:"已创建",organizeUpdated:"已更新",organizeFailed:"失败",organizeNoChanges:"AI 分析了你的文件,但没有做任何更改。",organizeToolCallsInfo:a=>`AI 执行了 ${a} 个操作 — 请检查知识库查看更新`,organizeError:"整理失败",organizeRetry:"重试",organizeDone:"完成",organizeUndoAll:"撤销全部",organizeUndoOne:"撤销",organizeUndone:"已撤销",organizeViewFile:"查看文件",organizeUndoSuccess:a=>`已撤销 ${a} 个文件`,organizeDetailTitle:"AI 整理详情",organizeSourceFiles:"源文件",organizeSummaryLabel:"AI 总结",organizeChangesLabel:a=>`变更列表 (${a})`,organizeNoSummary:"AI 正在处理中...",organizeMinimizeModal:"最小化"},importHistory:{title:"导入历史",clearAll:"清空历史",emptyTitle:"暂无导入记录",emptyDesc:"AI 整理的结果会出现在这里"},dirView:{gridView:"网格视图",listView:"列表视图",emptyFolder:"此目录为空。",fileCount:a=>`${a} 个文件`,newFile:"新建文件"},view:{saveDirectory:"目录",saveFileName:"文件名",delete:"删除",deleteConfirm:a=>`确定删除「${a}」?文件将移至回收站。`,cancel:"取消",rename:"重命名",dismiss:"关闭"},findInPage:{placeholder:"在文档中查找…",matchCount:(a,b)=>`${a} / ${b}`,noResults:"无结果"},panels:{agents:{title:"智能体",connected:"已连接",refresh:"刷新智能体状态",retry:"重试",failedToLoad:"加载智能体失败",mcpServer:"MCP 服务器",stopped:"已停止",sectionConnected:"已连接",sectionDetected:"已检测",sectionNotDetected:"未检测到",noAgents:"未检测到智能体。",autoRefresh:"每 30 秒自动刷新",connect:"连接",installing:"安装中...",install:"安装",installSuccess:"已安装",installFailed:"安装失败",retryInstall:"重试",copyConfig:"复制配置",copied:"已复制!",transportLocal:"本地",transportRemote:"远程",configPath:"配置路径",noAuthWarning:"未设置 Token — 请在高级配置中设置",skillsTitle:"Skills",skillsActive:"已启用",builtinSkills:"内置",newSkill:"+ 新建",advancedConfig:"高级配置 →",navOverview:"总览",navMcp:"MCP",navSkills:"技能",navNetwork:"网络",navSessions:"会话",a2aTabTitle:"远程 Agent",a2aTabEmpty:"无远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aRemoveAgent:"移除",rosterLabel:"当前环境",notFoundDetail:"本机未检测到该智能体客户端。请安装后刷新列表。",skillsEmptyHint:"请在「MCP 与技能」设置中启用或编辑 Skills。",backToList:"返回",closeAgentDetail:"关闭",agentDetailPanelAria:"智能体连接配置",agentDetailTransport:"传输方式",agentDetailSnippet:"配置片段",a2aLabel:"A2A",a2aReady:"A2A 就绪",a2aChecking:"检测 A2A 中...",a2aUnavailable:"A2A 不可用",a2aRemote:"远程",a2aDiscover:"发现远程 Agent",a2aDiscoverHint:"通过 URL 连接外部 A2A Agent",a2aDiscoverPlaceholder:"https://agent.example.com",a2aDiscovering:"发现中...",a2aDiscoverSuccess:"Agent 已发现!",a2aDiscoverFailed:"未在此 URL 找到 A2A Agent",a2aDiscoverFailedHint:"该服务器可能不支持 A2A 协议,请检查 URL 后重试。",a2aSkills:"技能",a2aEndpoint:"端点",a2aVersion:"版本",a2aCapabilities:"A2A 能力",a2aStatus:"状态",a2aConnected:"已连接,A2A 就绪",a2aNoRemote:"无远程 Agent",a2aNoRemoteHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aDelegations:"近期委派",a2aDelegationsEmpty:"暂无委派记录",a2aDelegationCompleted:"已完成",a2aDelegationFailed:"失败",a2aDelegationPending:"进行中",acpSectionTitle:"ACP 智能体",acpSectionDesc:a=>`${a} 个智能体可用`,acpTransportNpx:"npx",acpTransportBinary:"二进制",acpTransportUvx:"uvx",acpTransportStdio:"stdio",acpUseAgent:"使用",acpComingSoon:"即将上线 — 当前可通过 Ask AI 调用",acpReady:"就绪",acpNotInstalled:"未安装",acpScan:"重新扫描",acpInstallHint:a=>`安装命令: ${a}`,acpInstall:"安装",acpInstalling:"安装中…",acpLoading:"加载 ACP 注册表中…",acpLoadFailed:"加载 ACP 注册表失败。",acpRetry:"重试",acpQuickReview:"代码审查",acpQuickFix:"修复Bug",acpQuickExplain:"解释项目",acpUseWith:a=>`使用 ${a} `,acpDefaultAgent:"MindOS Agent",acpSelectAgent:"选择 Agent",acpChangeAgent:"切换 Agent",acpConfigToggle:"配置",acpConfigCommand:"命令",acpConfigArgs:"参数",acpConfigEnv:"环境变量",acpConfigEnvAdd:"添加环境变量",acpConfigSource:"来源",acpConfigSourceBuiltin:"内置",acpConfigSourceRegistry:"注册表",acpConfigSourceUser:"自定义",acpConfigReset:"重置",acpConfigSave:"保存",acpConfigSaved:"已保存",acpConfigPath:"路径",networkEmptyTitle:"连接智能体生态",networkEmptyDesc:"发现远程 Agent 或浏览 ACP 注册表中的编程智能体。",networkDiscoverBtn:"发现 Agent",networkBrowseBtn:"浏览注册表"},plugins:{title:"插件",active:"已启用",noPlugins:"暂无插件",core:"核心",coreDisabled:"核心插件 — 不可禁用",footer:"插件用于自定义文件渲染方式。核心插件不可禁用。",ready:"就绪 — 点击打开",disabled:"已禁用",noFile:"入口文件不存在",createFile:"创建 {file} 以激活"},echo:{title:"回响",aboutYouTitle:"关于你",aboutYouDesc:"指向你的笔记与线索",continuedTitle:"未完待续",continuedDesc:"草稿与未收口的事",dailyEchoTitle:"今日",dailyDesc:"一行就够",pastYouTitle:"往昔",pastYouDesc:"瞥见另一个时间点的自己",intentGrowthTitle:"生长",growthDesc:"你正在推进的方向"},discover:{title:"探索",useCases:"使用案例",useCasesDesc:"动手体验 MindOS 的典型场景",pluginMarket:"插件市场",pluginMarketDesc:"扩展文件的渲染和编辑方式",skillMarket:"技能市场",skillMarketDesc:"为 AI 智能体添加新能力",spaceTemplates:"空间模板",spaceTemplatesDesc:"预设的空间结构,适用于常见工作流场景",comingSoon:"即将推出",viewAll:"查看所有使用案例",tryIt:"试试"},workflows:{title:"流程",empty:"还没有流程",emptyDesc:"创建第一个流程,用 AI 自动化多步骤任务。",newWorkflow:"新建流程",nSteps:a=>`${a} 个步骤`,parseError:"解析错误",name:"名称",namePlaceholder:"我的流程",template:"模板",templateBlank:"空白",create:"创建",cancel:"取消",creating:"创建中...",exists:"已存在同名流程"}},echoPages:{parent:"回响",heroKicker:"回响",segmentNavAria:"回响模块",snapshotBadge:"本地 \xb7 私密",factsHeading:"所见",snapshotAboutYouTitle:"线索在此汇聚",snapshotAboutYouBody:"路径、链接或标题指向你的笔记会浮现在这里,点击即可打开编辑。现在也可以用下方按钮打开 Agent 聊聊。",snapshotContinuedTitle:"草稿与未收口",snapshotContinuedBody:"未命名草稿、写到一半的稿、待办里尚未勾上的项,接入文库后会汇集在此。",snapshotDailyTitle:"从一行开始",snapshotDailyBody:"离手即存,写在浏览器本机。一行就够——想展开时再找 Agent。",snapshotPastYouTitle:"温和地一瞥",snapshotPastYouBody:"从时间轴里随机浮出一篇旧笔记片段,让你瞥见那时的自己。即将上线。",snapshotGrowthTitle:"意图落在这里",snapshotGrowthBody:"写一句此刻最想推进的方向。它只保存在本机,可随时间改写。",insightTitle:"见解",insightShow:"展开见解",insightHide:"收起见解",insightHint:"只会带上本页可见的文字(含「所见」与你在本页输入的内容),不会默认上传整库。需在 设置 → AI 中配置后再用。",generateInsight:"生成见解",generateInsightNoAi:"请在 设置 → AI 中填写 API Key(或配置环境变量)后刷新本页。",insightGenerating:"生成中…",insightErrorPrefix:"生成失败:",insightRetry:"重试",continueAgent:"在 Agent 中展开",continuedDrafts:"草稿",continuedTodos:"未收口",subEmptyHint:"接入文库后,条目会出现在对应分组里。",dailyLineLabel:"今日一行",dailyLinePlaceholder:"写下一行轻量的文字…",dailySavedNote:"已保存在本机浏览器;仅本设备可见。",savedFlash:"已保存",dailyAskPrefill:a=>`回响 / 每日 — 围绕这一行帮我展开:
|
|
201
201
|
|
|
202
|
-
${a.trim()||"(空行)"}`,pastYouDrawLabel:"往日一瞥",pastYouAnother:"再抽一笔",pastYouComingSoon:"即将推出",pastYouDisabledHint:"时间轴采样即将上线——届时轻点即可抽读旧笔记片段。",growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",aboutYouLead:"无需翻找,与你相关的笔记自然浮现。",continuedLead:"草稿、待办、写到一半的念头。",dailyLead:"一行就够。想展开时再找 Agent。",pastYouLead:"温和地瞥见另一个时间点的自己。",growthLead:"你正在推进的方向,以及它如何缓慢漂移。"},agentsContent:{title:"Agents",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"工作区脉搏",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"Skills",navNetwork:"网络",navSessions:"会话",a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回 Agents",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起"},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP Server 查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP Server",searchServersPlaceholder:"搜索 MCP server...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`},skills:{title:"Skills",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`Universal:${a}`,registryAdditional:a=>`Additional:${a}`,registryUnsupported:a=>`Unsupported:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按 Skill 查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"Skill 模式",agentMcpServers:"MCP Servers",agentNativeSkills:"原生 Skills",agentMindosSkills:"MindOS Skills",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置 servers",healthInstalledSkills:"原生已安装 skills",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent Key",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"Skill 模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部 Skills",skillsEnabled:"已启用 Skills",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置 Skills...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取 Skill 内容失败。",skillSaveFailed:"保存 Skill 内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"MCP & Skills",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"Agents",update:"更新",uninstall:"卸载"},ai:{provider:"服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或 OpenAI 兼容 API。",keyHint:"本地存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{sopRoot:"知识库根目录",sopRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",sopRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshHint:"SSH URL 需要在本机配置 SSH 密钥。推荐使用 HTTPS + Token。",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub: Settings → Developer settings → Personal access tokens → repo scope",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中..."},plugins:{title:"已安装渲染器",builtinBadge:"内置",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"Skills",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加 Skill",cliInstallHint:"通过命令行安装:",skillPathHint:"Skill 文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名 skill 已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"Skill 语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索 Skill...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的 Skill`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。"},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败,请重试。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 工具","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或 OpenAI 兼容 API。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"Auth Token",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"MCP 认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 工具",agentToolsHint:"选择要与 MindOS MCP 配置的 AI Agent。标注「未安装」的 agent 可以先行配置,安装应用后即可生效。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 agent — 可稍后在 设置 → MCP 中配置。",agentSkipLater:"跳过 — 稍后在 设置 > MCP 中安装",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"Skill 教 AI Agent 如何使用你的知识库 — 包括笔记的读取、写入和整理规则。",skillAutoHint:a=>`根据您选择的模板,将向选中的 Agent 安装「${a}」Skill。`,skillLabel:"Skill",skillInstalling:"正在安装 Skill…",skillInstalled:"Skill 已安装",skillFailed:"Skill 安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → MCP 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。可以开始向 AI 提问、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS Agent",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"感受 AI 读取内容",cta:"试试",desc:"你的文件已在知识库中。问问 MindOS Agent 它了解了什么:",prompt:"根据我的知识库介绍一下我——我是谁、在做什么?",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"在其他 Agent 验证",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意连接了 MCP 的 Agent,粘贴以下提示词:",copyPrompt:"读取我的 MindOS 知识库,概括我的背景,然后建议我接下来该做什么。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS Agent 自动读取整个知识库。问它项目相关的事,不需要重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"},{title:"回响 — 认知在积累",body:"关于你、每日回顾、成长轨迹——MindOS 帮你沉淀判断与偏好,让经验不断复利。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS Agent"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你思考的地方,也是 AI Agent 行动的起点。你和 AI 共享同一个大脑——你纠正了 AI,这个纠正自动沉淀;AI 下次更懂你,你自己的思路也跟着变清晰。人和 AI 一起成长。在 AI 焦虑蔓延的时代,MindOS 更关注人的成长——想清楚问题、做好判断、快速实践、攒下属于自己的认知。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如 Profile、Notes 或 Projects。',step2Title:"和 AI 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 AI 面板。询问任何关于知识库的问题,或使用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → MCP 连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 AI 面板",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 AI 对话中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → MCP & Skills。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}},g=(0,e.createContext)({locale:"en",setLocale:()=>{},t:f.en});function h(){let a=localStorage.getItem("locale");return"zh"===a?"zh":"en"===a?"en":navigator.language.startsWith("zh")?"zh":"en"}function i({children:a,ssrLocale:b="en"}){let c=(0,e.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("mindos-locale-change",b),()=>window.removeEventListener("mindos-locale-change",b)},h,()=>b);return(0,d.jsx)(g.Provider,{value:{locale:c,setLocale:a=>{document.cookie=`locale=${a};path=/;max-age=31536000;SameSite=Lax`,document.documentElement.lang="zh"===a?"zh":"en",window.dispatchEvent(new Event("mindos-locale-change"))},t:f[c]},children:a})}function j(){return(0,e.useContext)(g)}},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},78365:(a,b,c)=>{"use strict";c.d(b,{E:()=>e});var d=c(99829);let e=(0,d.createServerReference)("0043ce6d8342976c485697a6a0f3dbb86877b6cd32",d.callServer,void 0,d.findSourceMapURL,"cleanupExamplesAction")},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(56024),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>o,Bt:()=>m,D0:()=>j,L7:()=>q,eN:()=>i,jn:()=>p,l6:()=>l,lM:()=>n,pM:()=>r,pd:()=>k});var d=c(48249),e=c(67484),f=c.n(e),g=c(44218),h=c(42742);function i({children:a}){return(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:a})}function j({label:a,hint:b,children:c}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),c,b&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b})]})}function k({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function l({value:a,onChange:b,children:c,className:i="",disabled:j}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${i}`,children:[(0,d.jsxs)("button",{type:"button",disabled:j,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(g.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(h.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function m({overridden:a}){return a?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-[var(--amber-subtle)] text-[var(--amber-text)] font-mono ml-1.5",children:"env"}):null}function n({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function o({value:a,onChange:b,placeholder:c,disabled:e}){let f="***set***"===a;return(0,d.jsx)("input",{type:"password",value:f?"••••••••••••••••":a,onChange:a=>b(a.target.value),placeholder:c??"sk-...",disabled:e,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",onFocus:()=>{f&&b("")}})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}function q({icon:a,title:b,description:c,badge:e,children:f,className:g=""}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/50 bg-card/50 p-5 ${g}`,children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,d.jsx)("div",{className:"w-8 h-8 rounded-lg bg-muted/50 flex items-center justify-center shrink-0 mt-0.5",children:(0,d.jsx)("span",{className:"text-muted-foreground",children:a})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b}),e]}),c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:c})]})]}),(0,d.jsx)("div",{className:"space-y-4 pl-11",children:f})]})}function r({label:a,hint:b,children:c}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:a}),b&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b})]}),(0,d.jsx)("div",{className:"shrink-0",children:c})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/error.tsx","default")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},89386:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(42742),g=c(8455),h=c(41160),i=c(46674),j=c(99101);let k={success:(0,d.jsx)(f.A,{size:15,className:"text-success shrink-0"}),error:(0,d.jsx)(g.A,{size:15,className:"text-error shrink-0"}),info:(0,d.jsx)(h.A,{size:15,className:"text-muted-foreground shrink-0"})};function l(){let a=(0,e.useSyncExternalStore)(j.B1,j.dV,j.dV);return 0===a.length?null:(0,d.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none","aria-live":"polite",children:a.map(a=>(0,d.jsxs)("div",{className:"pointer-events-auto flex items-center gap-2.5 bg-card border border-border rounded-lg shadow-lg px-4 py-2.5 min-w-[180px] max-w-[320px] animate-in slide-in-from-right-4 fade-in duration-200",children:[k[a.type],(0,d.jsx)("span",{className:"text-sm text-foreground flex-1 truncate",children:a.message}),a.action&&(0,d.jsx)("button",{type:"button",onClick:()=>{a.action.onClick(),(0,j.X8)(a.id)},className:"shrink-0 px-2.5 py-1 rounded text-xs font-medium text-[var(--amber)] hover:bg-[var(--amber-dim)] transition-colors min-h-[28px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:a.action.label}),(0,d.jsx)("button",{type:"button",onClick:()=>(0,j.X8)(a.id),className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":a.action?.label?"Close":"Dismiss",children:(0,d.jsx)(i.A,{size:13})})]},a.id))})}},90598:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/UpdateOverlay.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/UpdateOverlay.tsx","default")},90826:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(19794),h=c(65032),i=c(42742),j=c(44218),k=c(33191);function l({dirPaths:a,value:b,onChange:c,rootLabel:l="Root"}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(b),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b=window.innerHeight-a.bottom,c=a.top,d=b<208&&c>b;r({top:d?a.top:a.bottom,left:a.left,width:a.width,flipUp:d})},[]);let u=(0,e.useCallback)(()=>n(!1),[]),v=(0,e.useMemo)(()=>{let b=o?o+"/":"";return a.filter(a=>{if(!a.startsWith(b))return!1;let c=a.slice(b.length);return c.length>0&&!c.includes("/")}).sort()},[a,o]),w=(0,e.useMemo)(()=>o?o.split("/"):[],[o]),x=a=>{if(a<0)p(""),c("");else{let b=w.slice(0,a+1).join("/");p(b),c(b)}},y=b?b.split("/").map(a=>(0,k.vr)(a)).join(" / "):"/ "+l,z=m&&q&&(0,f.createPortal)((0,d.jsxs)("div",{ref:t,className:"fixed z-[9999] rounded-lg border border-[var(--amber)] bg-card shadow-lg overflow-hidden flex flex-col",style:{left:q.left,width:q.width,maxHeight:200,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:[(0,d.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1.5 bg-muted/30 border-b border-border overflow-x-auto text-xs shrink-0",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(-1),className:`shrink-0 px-1.5 py-0.5 rounded transition-colors ${""===o?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:["/ ",l]}),w.map((a,b)=>(0,d.jsxs)("span",{className:"flex items-center gap-0.5 shrink-0",children:[(0,d.jsx)(g.A,{size:10,className:"text-muted-foreground/50"}),(0,d.jsx)("button",{type:"button",onClick:()=>x(b),className:`px-1.5 py-0.5 rounded transition-colors truncate max-w-[100px] ${b===w.length-1?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:a})]},b))]}),v.length>0?(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:v.map(b=>{let e=b.split("/").pop()||b,f=a.some(a=>a.startsWith(b+"/"));return(0,d.jsxs)("button",{type:"button",onClick:()=>{p(b),c(b)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-muted/60 transition-colors",children:[(0,d.jsx)(h.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1 text-left truncate",children:e}),f&&(0,d.jsx)(g.A,{size:11,className:"shrink-0 text-muted-foreground/40"})]},b)})}):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground/50 text-center",children:"—"}),(0,d.jsx)("button",{type:"button",onClick:u,className:"w-full py-1.5 flex items-center justify-center gap-1 text-xs font-medium text-[var(--amber)] border-t border-border hover:bg-muted/30 transition-colors shrink-0",children:(0,d.jsx)(i.A,{size:12})})]}),document.body);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"true","aria-expanded":m,className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg border bg-background text-foreground transition-colors text-left focus-visible:ring-1 focus-visible:ring-ring outline-none ${m?"border-[var(--amber)]":"border-border hover:border-[var(--amber)]/40"}`,children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:y}),(0,d.jsx)(j.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${m?"rotate-180":""}`})]}),z]})}},92464:(a,b,c)=>{"use strict";c.d(b,{KT:()=>k,NH:()=>j});var d=c(67484);let e={open:!1,initialMessage:"",source:"user",acpAgent:null},f=new Set;function g(){f.forEach(a=>a())}function h(a){return f.add(a),()=>{f.delete(a)}}function i(){return e}function j(a="",b="user",c=null){e={open:!0,initialMessage:a,source:b,acpAgent:c},g()}function k(){let a=(0,d.useSyncExternalStore)(h,i,i);return{open:a.open,initialMessage:a.initialMessage,source:a.source,acpAgent:a.acpAgent,openWith:(0,d.useCallback)((a,b="user",c=null)=>j(a,b,c),[]),close:(0,d.useCallback)(()=>void(e={open:!1,initialMessage:"",source:"user",acpAgent:null},g()),[])}}},94082:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>A,metadata:()=>y,viewport:()=>z});var d=c(5735),e=c(64571),f=c.n(e),g=c(94273),h=c.n(g),i=c(10890),j=c.n(i),k=c(81079),l=c.n(k),m=c(57353),n=c.n(m);c(82704);var o=c(50953),p=c(5315),q=c(68533),r=c(41527),s=c(24387),t=c(32248),u=c(12978),v=c(90598),w=c(65573),x=c(36312);for(let a of[{id:"agent-inspector",name:"Agent Inspector",description:"Visualizes agent tool-call logs as a filterable timeline. Auto-activates on .mindos/agent-audit-log.json and supports legacy .agent-log.json.",author:"MindOS",icon:"\uD83D\uDD0D",tags:["agent","inspector","log","mcp","tools"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/agent-audit-log.json",match:({filePath:a})=>/(^|\/)\.mindos\/agent-audit-log\.json$/i.test(a)||/\.agent-log\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,66913)).then(a=>({default:a.AgentInspectorRenderer}))},{id:"backlinks",name:"Backlinks Explorer",description:"Shows all files that link to the current page via wikilinks or markdown links, with highlighted snippet context.",author:"MindOS",icon:"\uD83D\uDD17",tags:["backlinks","wiki","links","references"],builtin:!0,entryPath:"BACKLINKS.md",match:({filePath:a})=>/\bBACKLINKS\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,66874)).then(a=>({default:a.BacklinksRenderer}))},{id:"config-panel",name:"Config Panel",description:"Renders CONFIG.json as an editable control panel based on uiSchema/keySpecs. Changes are written back to the JSON file directly.",author:"MindOS",icon:"\uD83E\uDDE9",tags:["config","json","settings","schema"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"CONFIG.json",match:({filePath:a,extension:b})=>"json"===b&&/(^|\/)CONFIG\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,63112)).then(a=>({default:a.ConfigRenderer}))},{id:"csv",name:"CSV Views",description:"Renders any CSV file as Table, Gallery, or Board. Each view is independently configurable — choose which columns map to title, description, tag, and group.",author:"MindOS",icon:"\uD83D\uDCCA",tags:["csv","table","gallery","board","data"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"Resources/Products.csv",match:({extension:a,filePath:b})=>"csv"===a&&!/\bTODO\b/i.test(b),load:()=>Promise.resolve().then(c.bind(c,60442)).then(a=>({default:a.CsvRenderer}))},{id:"summary",name:"AI Briefing",description:"Streams an AI-generated daily briefing summarizing your most recently modified files — key changes, recurring themes, and suggested next actions.",author:"MindOS",icon:"✨",tags:["ai","summary","briefing","daily"],builtin:!0,entryPath:"DAILY.md",match:({filePath:a})=>/\b(SUMMARY|summary|Summary|BRIEFING|briefing|Briefing|DAILY|daily|Daily)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,45862)).then(a=>({default:a.SummaryRenderer}))},{id:"timeline",name:"Timeline",description:"Renders changelog and journal files as a vertical timeline. Any markdown with ## date headings (e.g. ## 2025-01-15) becomes a card in the feed.",author:"MindOS",icon:"\uD83D\uDCC5",tags:["timeline","changelog","journal","history"],builtin:!0,entryPath:"CHANGELOG.md",match:({filePath:a})=>/\b(CHANGELOG|changelog|TIMELINE|timeline|journal|Journal|diary|Diary)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,1394)).then(a=>({default:a.TimelineRenderer}))},{id:"todo",name:"TODO Board",description:"Renders TODO.md/TODO.csv as an interactive kanban board grouped by section. Check items off directly — changes are written back to the source file.",author:"MindOS",icon:"✅",tags:["productivity","tasks","markdown"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"TODO.md",match:({filePath:a})=>/\bTODO\b.*\.(md|csv)$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,18776)).then(a=>({default:a.TodoRenderer}))},{id:"workflow-yaml",name:"Workflow Runner",description:"Execute step-by-step YAML workflows with Skills & Agent support.",author:"MindOS",icon:"⚡",tags:["workflow","automation","steps","ai","yaml"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/workflows/",match:({extension:a,filePath:b})=>("yaml"===a||"yml"===a)&&/\.flow\.(yaml|yml)$/i.test(b),load:()=>Promise.resolve().then(c.bind(c,83539)).then(a=>({default:a.WorkflowYamlRenderer}))},{id:"graph",name:"Wiki Graph",description:"Force-directed graph of wikilink references across all markdown files. Supports Global and Local (2-hop) scope filters.",author:"MindOS",icon:"\uD83D\uDD78️",tags:["graph","wiki","links","visualization"],builtin:!0,match:()=>!1,load:()=>Promise.resolve().then(c.bind(c,37718)).then(a=>({default:a.GraphRenderer}))}])(0,x.TS)(a);let y={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},z={width:"device-width",initialScale:1,viewportFit:"cover"};async function A({children:a}){let b=[];try{b=(0,o.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),e=c.get("locale")?.value==="zh"?"zh":"en";return(0,d.jsxs)("html",{lang:e,suppressHydrationWarning:!0,children:[(0,d.jsxs)("head",{children:[(0,d.jsx)("meta",{name:"theme-color",content:"#c8871e"}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',geist:'var(--font-geist-sans), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,d.jsx)("body",{className:`${f().variable} ${h().variable} ${j().variable} ${l().variable} ${n().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:(0,d.jsxs)(r.LocaleProvider,{ssrLocale:e,children:[(0,d.jsx)(q.TooltipProvider,{delay:300,children:(0,d.jsx)(s.default,{children:(0,d.jsx)(p.default,{fileTree:b,children:a})})}),(0,d.jsx)(t.default,{}),(0,d.jsx)(u.default,{}),(0,d.jsx)(v.default,{})]})})]})}},94416:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49681),g=c(40560),h=c(77505);let i="mindos_update_in_progress";function j(){let[a,b]=(0,e.useState)(!1),[c,j]=(0,e.useState)(!1),k=(0,e.useRef)(void 0),{locale:l}=(0,h.Y)(),m="zh"===l;return((0,e.useCallback)(()=>{k.current=setInterval(async()=>{try{if((await fetch("/api/health",{signal:AbortSignal.timeout(3e3)})).ok){clearInterval(k.current),k.current=void 0;try{let a=localStorage.getItem(i);if(a){let{originalVer:b}=JSON.parse(a),c=await fetch("/api/update-check").then(a=>a.json());if(c.current&&c.current!==b){j(!0),localStorage.removeItem(i),localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),setTimeout(()=>window.location.reload(),1500);return}}}catch{}localStorage.removeItem(i),window.location.reload()}}catch{}},3e3)},[]),a)?(0,d.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:99999,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"system-ui, -apple-system, sans-serif"},children:[c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{size:32,style:{color:"var(--success)",marginBottom:12}}),(0,d.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"更新成功!":"Update Complete!"}),(0,d.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6},children:m?"正在刷新页面...":"Reloading..."})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.A,{size:32,style:{color:"var(--amber)",marginBottom:12,animation:"spin 1s linear infinite"}}),(0,d.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"MindOS 正在更新...":"MindOS is Updating..."}),(0,d.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6,textAlign:"center",maxWidth:300,lineHeight:1.5},children:m?"服务正在重启,请勿关闭此页面。完成后将自动刷新。":"The server is restarting. Please do not close this page. It will auto-reload when ready."})]}),(0,d.jsx)("style",{children:"@keyframes spin { to { transform: rotate(360deg) } }"})]}):null}},95054:(a,b,c)=>{"use strict";c.d(b,{h:()=>d,n:()=>e});class d extends Error{constructor(a,b,c){super(a),this.name="ApiError",this.status=b,this.code=c}}async function e(a,b={}){let c,f,g,{timeout:h=3e4,signal:i,...j}=b;if((h>0||i)&&(c=new AbortController),h>0&&c&&(f=setTimeout(()=>c.abort(),h)),i&&c)if(i.aborted)c.abort();else{let a=()=>c?.abort();i.addEventListener("abort",a,{once:!0}),g=()=>{i.removeEventListener("abort",a)}}let k=c?.signal??i;try{let b=await fetch(a,{...j,signal:k});if(!b.ok){let a,c=`Request failed (${b.status})`;try{let d=await b.json();d?.error?.code&&d?.error?.message?(c=d.error.message,a=d.error.code):d?.error&&(c="string"==typeof d.error?d.error:d.error.message??c)}catch{}throw new d(c,b.status,a)}return await b.json()}finally{f&&clearTimeout(f),g&&g()}}},96407:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,33378)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,74122)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,77505))},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})}};
|
|
202
|
+
${a.trim()||"(空行)"}`,pastYouDrawLabel:"往日一瞥",pastYouAnother:"再抽一笔",pastYouComingSoon:"即将推出",pastYouDisabledHint:"时间轴采样即将上线——届时轻点即可抽读旧笔记片段。",growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",aboutYouLead:"无需翻找,与你相关的笔记自然浮现。",continuedLead:"草稿、待办、写到一半的念头。",dailyLead:"一行就够。想展开时再找 Agent。",pastYouLead:"温和地瞥见另一个时间点的自己。",growthLead:"你正在推进的方向,以及它如何缓慢漂移。"},agentsContent:{title:"Agents",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"工作区脉搏",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"Skills",navNetwork:"网络",navSessions:"会话",a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回 Agents",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起"},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP Server 查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP Server",searchServersPlaceholder:"搜索 MCP server...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`},skills:{title:"Skills",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`Universal:${a}`,registryAdditional:a=>`Additional:${a}`,registryUnsupported:a=>`Unsupported:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按 Skill 查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"Skill 模式",agentMcpServers:"MCP Servers",agentNativeSkills:"原生 Skills",agentMindosSkills:"MindOS Skills",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置 servers",healthInstalledSkills:"原生已安装 skills",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent Key",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"Skill 模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部 Skills",skillsEnabled:"已启用 Skills",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置 Skills...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取 Skill 内容失败。",skillSaveFailed:"保存 Skill 内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"MCP & Skills",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"Agents",update:"更新",uninstall:"卸载"},ai:{provider:"服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或 OpenAI 兼容 API。",keyHint:"本地存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{sopRoot:"知识库根目录",sopRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",sopRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshHint:"SSH URL 需要在本机配置 SSH 密钥。推荐使用 HTTPS + Token。",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub: Settings → Developer settings → Personal access tokens → repo scope",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中..."},plugins:{title:"已安装渲染器",builtinBadge:"内置",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"Skills",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加 Skill",cliInstallHint:"通过命令行安装:",skillPathHint:"Skill 文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名 skill 已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"Skill 语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索 Skill...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的 Skill`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。"},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败,请重试。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 工具","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或 OpenAI 兼容 API。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"Auth Token",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"MCP 认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 工具",agentToolsHint:"选择要与 MindOS MCP 配置的 AI Agent。标注「未安装」的 agent 可以先行配置,安装应用后即可生效。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 agent — 可稍后在 设置 → MCP 中配置。",agentSkipLater:"跳过 — 稍后在 设置 > MCP 中安装",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"Skill 教 AI Agent 如何使用你的知识库 — 包括笔记的读取、写入和整理规则。",skillAutoHint:a=>`根据您选择的模板,将向选中的 Agent 安装「${a}」Skill。`,skillLabel:"Skill",skillInstalling:"正在安装 Skill…",skillInstalled:"Skill 已安装",skillFailed:"Skill 安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → MCP 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。可以开始向 AI 提问、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS Agent",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"感受 AI 读取内容",cta:"试试",desc:"你的文件已在知识库中。问问 MindOS Agent 它了解了什么:",prompt:"根据我的知识库介绍一下我——我是谁、在做什么?",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"在其他 Agent 验证",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意连接了 MCP 的 Agent,粘贴以下提示词:",copyPrompt:"读取我的 MindOS 知识库,概括我的背景,然后建议我接下来该做什么。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS Agent 自动读取整个知识库。问它项目相关的事,不需要重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"},{title:"回响 — 认知在积累",body:"关于你、每日回顾、成长轨迹——MindOS 帮你沉淀判断与偏好,让经验不断复利。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS Agent"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你思考的地方,也是 AI Agent 行动的起点。你和 AI 共享同一个大脑——你纠正了 AI,这个纠正自动沉淀;AI 下次更懂你,你自己的思路也跟着变清晰。人和 AI 一起成长。在 AI 焦虑蔓延的时代,MindOS 更关注人的成长——想清楚问题、做好判断、快速实践、攒下属于自己的认知。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如 Profile、Notes 或 Projects。',step2Title:"和 AI 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 AI 面板。询问任何关于知识库的问题,或使用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → MCP 连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 AI 面板",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 AI 对话中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → MCP & Skills。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}},g=(0,e.createContext)({locale:"en",setLocale:()=>{},t:f.en});function h(){let a=localStorage.getItem("locale");return"zh"===a?"zh":"en"===a?"en":navigator.language.startsWith("zh")?"zh":"en"}function i({children:a,ssrLocale:b="en"}){let c=(0,e.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("mindos-locale-change",b),()=>window.removeEventListener("mindos-locale-change",b)},h,()=>b);return(0,d.jsx)(g.Provider,{value:{locale:c,setLocale:a=>{document.cookie=`locale=${a};path=/;max-age=31536000;SameSite=Lax`,document.documentElement.lang="zh"===a?"zh":"en",window.dispatchEvent(new Event("mindos-locale-change"))},t:f[c]},children:a})}function j(){return(0,e.useContext)(g)}},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(56024),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>o,Bt:()=>m,D0:()=>j,L7:()=>q,eN:()=>i,jn:()=>p,l6:()=>l,lM:()=>n,pM:()=>r,pd:()=>k});var d=c(48249),e=c(67484),f=c.n(e),g=c(44218),h=c(42742);function i({children:a}){return(0,d.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:a})}function j({label:a,hint:b,children:c}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),c,b&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b})]})}function k({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function l({value:a,onChange:b,children:c,className:i="",disabled:j}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${i}`,children:[(0,d.jsxs)("button",{type:"button",disabled:j,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(g.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(h.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function m({overridden:a}){return a?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-[var(--amber-subtle)] text-[var(--amber-text)] font-mono ml-1.5",children:"env"}):null}function n({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function o({value:a,onChange:b,placeholder:c,disabled:e}){let f="***set***"===a;return(0,d.jsx)("input",{type:"password",value:f?"••••••••••••••••":a,onChange:a=>b(a.target.value),placeholder:c??"sk-...",disabled:e,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",onFocus:()=>{f&&b("")}})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}function q({icon:a,title:b,description:c,badge:e,children:f,className:g=""}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/50 bg-card/50 p-5 ${g}`,children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,d.jsx)("div",{className:"w-8 h-8 rounded-lg bg-muted/50 flex items-center justify-center shrink-0 mt-0.5",children:(0,d.jsx)("span",{className:"text-muted-foreground",children:a})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b}),e]}),c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:c})]})]}),(0,d.jsx)("div",{className:"space-y-4 pl-11",children:f})]})}function r({label:a,hint:b,children:c}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:a}),b&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b})]}),(0,d.jsx)("div",{className:"shrink-0",children:c})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},84627:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("605375101ac16acdfaee6c18b38338f1b0577fc3bc",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/error.tsx","default")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},87476:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("408ff8e7591e49c2efa558c6a49ffa3a5f17ee9acf",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},89386:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(42742),g=c(8455),h=c(41160),i=c(46674),j=c(99101);let k={success:(0,d.jsx)(f.A,{size:15,className:"text-success shrink-0"}),error:(0,d.jsx)(g.A,{size:15,className:"text-error shrink-0"}),info:(0,d.jsx)(h.A,{size:15,className:"text-muted-foreground shrink-0"})};function l(){let a=(0,e.useSyncExternalStore)(j.B1,j.dV,j.dV);return 0===a.length?null:(0,d.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none","aria-live":"polite",children:a.map(a=>(0,d.jsxs)("div",{className:"pointer-events-auto flex items-center gap-2.5 bg-card border border-border rounded-lg shadow-lg px-4 py-2.5 min-w-[180px] max-w-[320px] animate-in slide-in-from-right-4 fade-in duration-200",children:[k[a.type],(0,d.jsx)("span",{className:"text-sm text-foreground flex-1 truncate",children:a.message}),a.action&&(0,d.jsx)("button",{type:"button",onClick:()=>{a.action.onClick(),(0,j.X8)(a.id)},className:"shrink-0 px-2.5 py-1 rounded text-xs font-medium text-[var(--amber)] hover:bg-[var(--amber-dim)] transition-colors min-h-[28px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:a.action.label}),(0,d.jsx)("button",{type:"button",onClick:()=>(0,j.X8)(a.id),className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":a.action?.label?"Close":"Dismiss",children:(0,d.jsx)(i.A,{size:13})})]},a.id))})}},90598:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/UpdateOverlay.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/UpdateOverlay.tsx","default")},90826:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(19794),h=c(65032),i=c(42742),j=c(44218),k=c(33191);function l({dirPaths:a,value:b,onChange:c,rootLabel:l="Root"}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(b),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b=window.innerHeight-a.bottom,c=a.top,d=b<208&&c>b;r({top:d?a.top:a.bottom,left:a.left,width:a.width,flipUp:d})},[]);let u=(0,e.useCallback)(()=>n(!1),[]),v=(0,e.useMemo)(()=>{let b=o?o+"/":"";return a.filter(a=>{if(!a.startsWith(b))return!1;let c=a.slice(b.length);return c.length>0&&!c.includes("/")}).sort()},[a,o]),w=(0,e.useMemo)(()=>o?o.split("/"):[],[o]),x=a=>{if(a<0)p(""),c("");else{let b=w.slice(0,a+1).join("/");p(b),c(b)}},y=b?b.split("/").map(a=>(0,k.vr)(a)).join(" / "):"/ "+l,z=m&&q&&(0,f.createPortal)((0,d.jsxs)("div",{ref:t,className:"fixed z-[9999] rounded-lg border border-[var(--amber)] bg-card shadow-lg overflow-hidden flex flex-col",style:{left:q.left,width:q.width,maxHeight:200,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:[(0,d.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1.5 bg-muted/30 border-b border-border overflow-x-auto text-xs shrink-0",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(-1),className:`shrink-0 px-1.5 py-0.5 rounded transition-colors ${""===o?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:["/ ",l]}),w.map((a,b)=>(0,d.jsxs)("span",{className:"flex items-center gap-0.5 shrink-0",children:[(0,d.jsx)(g.A,{size:10,className:"text-muted-foreground/50"}),(0,d.jsx)("button",{type:"button",onClick:()=>x(b),className:`px-1.5 py-0.5 rounded transition-colors truncate max-w-[100px] ${b===w.length-1?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:a})]},b))]}),v.length>0?(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:v.map(b=>{let e=b.split("/").pop()||b,f=a.some(a=>a.startsWith(b+"/"));return(0,d.jsxs)("button",{type:"button",onClick:()=>{p(b),c(b)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-muted/60 transition-colors",children:[(0,d.jsx)(h.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1 text-left truncate",children:e}),f&&(0,d.jsx)(g.A,{size:11,className:"shrink-0 text-muted-foreground/40"})]},b)})}):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground/50 text-center",children:"—"}),(0,d.jsx)("button",{type:"button",onClick:u,className:"w-full py-1.5 flex items-center justify-center gap-1 text-xs font-medium text-[var(--amber)] border-t border-border hover:bg-muted/30 transition-colors shrink-0",children:(0,d.jsx)(i.A,{size:12})})]}),document.body);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"true","aria-expanded":m,className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg border bg-background text-foreground transition-colors text-left focus-visible:ring-1 focus-visible:ring-ring outline-none ${m?"border-[var(--amber)]":"border-border hover:border-[var(--amber)]/40"}`,children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:y}),(0,d.jsx)(j.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${m?"rotate-180":""}`})]}),z]})}},92464:(a,b,c)=>{"use strict";c.d(b,{KT:()=>k,NH:()=>j});var d=c(67484);let e={open:!1,initialMessage:"",source:"user",acpAgent:null},f=new Set;function g(){f.forEach(a=>a())}function h(a){return f.add(a),()=>{f.delete(a)}}function i(){return e}function j(a="",b="user",c=null){e={open:!0,initialMessage:a,source:b,acpAgent:c},g()}function k(){let a=(0,d.useSyncExternalStore)(h,i,i);return{open:a.open,initialMessage:a.initialMessage,source:a.source,acpAgent:a.acpAgent,openWith:(0,d.useCallback)((a,b="user",c=null)=>j(a,b,c),[]),close:(0,d.useCallback)(()=>void(e={open:!1,initialMessage:"",source:"user",acpAgent:null},g()),[])}}},94082:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>A,metadata:()=>y,viewport:()=>z});var d=c(5735),e=c(64571),f=c.n(e),g=c(94273),h=c.n(g),i=c(10890),j=c.n(i),k=c(81079),l=c.n(k),m=c(57353),n=c.n(m);c(82704);var o=c(50953),p=c(5315),q=c(68533),r=c(41527),s=c(24387),t=c(32248),u=c(12978),v=c(90598),w=c(65573),x=c(36312);for(let a of[{id:"agent-inspector",name:"Agent Inspector",description:"Visualizes agent tool-call logs as a filterable timeline. Auto-activates on .mindos/agent-audit-log.json and supports legacy .agent-log.json.",author:"MindOS",icon:"\uD83D\uDD0D",tags:["agent","inspector","log","mcp","tools"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/agent-audit-log.json",match:({filePath:a})=>/(^|\/)\.mindos\/agent-audit-log\.json$/i.test(a)||/\.agent-log\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,66913)).then(a=>({default:a.AgentInspectorRenderer}))},{id:"backlinks",name:"Backlinks Explorer",description:"Shows all files that link to the current page via wikilinks or markdown links, with highlighted snippet context.",author:"MindOS",icon:"\uD83D\uDD17",tags:["backlinks","wiki","links","references"],builtin:!0,entryPath:"BACKLINKS.md",match:({filePath:a})=>/\bBACKLINKS\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,66874)).then(a=>({default:a.BacklinksRenderer}))},{id:"config-panel",name:"Config Panel",description:"Renders CONFIG.json as an editable control panel based on uiSchema/keySpecs. Changes are written back to the JSON file directly.",author:"MindOS",icon:"\uD83E\uDDE9",tags:["config","json","settings","schema"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"CONFIG.json",match:({filePath:a,extension:b})=>"json"===b&&/(^|\/)CONFIG\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,63112)).then(a=>({default:a.ConfigRenderer}))},{id:"csv",name:"CSV Views",description:"Renders any CSV file as Table, Gallery, or Board. Each view is independently configurable — choose which columns map to title, description, tag, and group.",author:"MindOS",icon:"\uD83D\uDCCA",tags:["csv","table","gallery","board","data"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"Resources/Products.csv",match:({extension:a,filePath:b})=>"csv"===a&&!/\bTODO\b/i.test(b),load:()=>Promise.resolve().then(c.bind(c,60442)).then(a=>({default:a.CsvRenderer}))},{id:"summary",name:"AI Briefing",description:"Streams an AI-generated daily briefing summarizing your most recently modified files — key changes, recurring themes, and suggested next actions.",author:"MindOS",icon:"✨",tags:["ai","summary","briefing","daily"],builtin:!0,entryPath:"DAILY.md",match:({filePath:a})=>/\b(SUMMARY|summary|Summary|BRIEFING|briefing|Briefing|DAILY|daily|Daily)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,45862)).then(a=>({default:a.SummaryRenderer}))},{id:"timeline",name:"Timeline",description:"Renders changelog and journal files as a vertical timeline. Any markdown with ## date headings (e.g. ## 2025-01-15) becomes a card in the feed.",author:"MindOS",icon:"\uD83D\uDCC5",tags:["timeline","changelog","journal","history"],builtin:!0,entryPath:"CHANGELOG.md",match:({filePath:a})=>/\b(CHANGELOG|changelog|TIMELINE|timeline|journal|Journal|diary|Diary)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,1394)).then(a=>({default:a.TimelineRenderer}))},{id:"todo",name:"TODO Board",description:"Renders TODO.md/TODO.csv as an interactive kanban board grouped by section. Check items off directly — changes are written back to the source file.",author:"MindOS",icon:"✅",tags:["productivity","tasks","markdown"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"TODO.md",match:({filePath:a})=>/\bTODO\b.*\.(md|csv)$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,18776)).then(a=>({default:a.TodoRenderer}))},{id:"workflow-yaml",name:"Workflow Runner",description:"Execute step-by-step YAML workflows with Skills & Agent support.",author:"MindOS",icon:"⚡",tags:["workflow","automation","steps","ai","yaml"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/workflows/",match:({extension:a,filePath:b})=>("yaml"===a||"yml"===a)&&/\.flow\.(yaml|yml)$/i.test(b),load:()=>Promise.resolve().then(c.bind(c,83539)).then(a=>({default:a.WorkflowYamlRenderer}))},{id:"graph",name:"Wiki Graph",description:"Force-directed graph of wikilink references across all markdown files. Supports Global and Local (2-hop) scope filters.",author:"MindOS",icon:"\uD83D\uDD78️",tags:["graph","wiki","links","visualization"],builtin:!0,match:()=>!1,load:()=>Promise.resolve().then(c.bind(c,37718)).then(a=>({default:a.GraphRenderer}))}])(0,x.TS)(a);let y={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},z={width:"device-width",initialScale:1,viewportFit:"cover"};async function A({children:a}){let b=[];try{b=(0,o.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),e=c.get("locale")?.value==="zh"?"zh":"en";return(0,d.jsxs)("html",{lang:e,suppressHydrationWarning:!0,children:[(0,d.jsxs)("head",{children:[(0,d.jsx)("meta",{name:"theme-color",content:"#c8871e"}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',geist:'var(--font-geist-sans), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,d.jsx)("body",{className:`${f().variable} ${h().variable} ${j().variable} ${l().variable} ${n().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:(0,d.jsxs)(r.LocaleProvider,{ssrLocale:e,children:[(0,d.jsx)(q.TooltipProvider,{delay:300,children:(0,d.jsx)(s.default,{children:(0,d.jsx)(p.default,{fileTree:b,children:a})})}),(0,d.jsx)(t.default,{}),(0,d.jsx)(u.default,{}),(0,d.jsx)(v.default,{})]})})]})}},94416:(a,b,c)=>{"use strict";c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(49681),g=c(40560),h=c(77505);let i="mindos_update_in_progress";function j(){let[a,b]=(0,e.useState)(!1),[c,j]=(0,e.useState)(!1),k=(0,e.useRef)(void 0),{locale:l}=(0,h.Y)(),m="zh"===l;return((0,e.useCallback)(()=>{k.current=setInterval(async()=>{try{if((await fetch("/api/health",{signal:AbortSignal.timeout(3e3)})).ok){clearInterval(k.current),k.current=void 0;try{let a=localStorage.getItem(i);if(a){let{originalVer:b}=JSON.parse(a),c=await fetch("/api/update-check").then(a=>a.json());if(c.current&&c.current!==b){j(!0),localStorage.removeItem(i),localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),setTimeout(()=>window.location.reload(),1500);return}}}catch{}localStorage.removeItem(i),window.location.reload()}}catch{}},3e3)},[]),a)?(0,d.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:99999,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"system-ui, -apple-system, sans-serif"},children:[c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{size:32,style:{color:"var(--success)",marginBottom:12}}),(0,d.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"更新成功!":"Update Complete!"}),(0,d.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6},children:m?"正在刷新页面...":"Reloading..."})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.A,{size:32,style:{color:"var(--amber)",marginBottom:12,animation:"spin 1s linear infinite"}}),(0,d.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"MindOS 正在更新...":"MindOS is Updating..."}),(0,d.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6,textAlign:"center",maxWidth:300,lineHeight:1.5},children:m?"服务正在重启,请勿关闭此页面。完成后将自动刷新。":"The server is restarting. Please do not close this page. It will auto-reload when ready."})]}),(0,d.jsx)("style",{children:"@keyframes spin { to { transform: rotate(360deg) } }"})]}):null}},95054:(a,b,c)=>{"use strict";c.d(b,{h:()=>d,n:()=>e});class d extends Error{constructor(a,b,c){super(a),this.name="ApiError",this.status=b,this.code=c}}async function e(a,b={}){let c,f,g,{timeout:h=3e4,signal:i,...j}=b;if((h>0||i)&&(c=new AbortController),h>0&&c&&(f=setTimeout(()=>c.abort(),h)),i&&c)if(i.aborted)c.abort();else{let a=()=>c?.abort();i.addEventListener("abort",a,{once:!0}),g=()=>{i.removeEventListener("abort",a)}}let k=c?.signal??i;try{let b=await fetch(a,{...j,signal:k});if(!b.ok){let a,c=`Request failed (${b.status})`;try{let d=await b.json();d?.error?.code&&d?.error?.message?(c=d.error.message,a=d.error.code):d?.error&&(c="string"==typeof d.error?d.error:d.error.message??c)}catch{}throw new d(c,b.status,a)}return await b.json()}finally{f&&clearTimeout(f),g&&g()}}},96407:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,33378)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,58520)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,77505))},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})}};
|