memory-eternal 0.10.28 → 0.10.31
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/README.en.md +6 -3
- package/README.md +6 -3
- package/bin/dsh-memory.mjs +16 -0
- package/lib/client.js +12 -12
- package/lib/vault.js +40 -6
- package/lib/watchdog.js +117 -24
- package/package.json +2 -2
- package/web/app.js +15 -15
package/lib/client.js
CHANGED
|
@@ -3,17 +3,17 @@ window.__ModuleLoader__.load({
|
|
|
3
3
|
factory: (require) => {
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
|
-
var
|
|
6
|
+
var na=Object.create;var St=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var ia=Object.getOwnPropertyNames;var la=Object.getPrototypeOf,sa=Object.prototype.hasOwnProperty;var ra=(t,o)=>{for(var l in o)St(t,l,{get:o[l],enumerable:!0})},Ht=(t,o,l,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of ia(o))!sa.call(t,c)&&c!==l&&St(t,c,{get:()=>o[c],enumerable:!(f=oa(o,c))||f.enumerable});return t};var da=(t,o,l)=>(l=t!=null?na(la(t)):{},Ht(o||!t||!t.__esModule?St(l,"default",{value:t,enumerable:!0}):l,t)),ca=t=>Ht(St({},"__esModule",{value:!0}),t);var _a={};ra(_a,{EN:()=>Zt,MemoryLibrary:()=>Da,ZH:()=>Jt,apply:()=>Ca,inject:()=>ka});module.exports=ca(_a);var n=da(require("react"),1);var pa={"&":"&","<":"<",">":">"},Rt=t=>String(t).replace(/[&<>]/g,o=>pa[o]),ua=[[/结论|总结|tl;?dr|summary|takeaway/i,"\u2705","ok"],[/风险|注意|警告|禁止|坑|踩坑|务必/i,"\u26A0\uFE0F","warn"],[/根因|原因|为什么|定位|复现/i,"\u{1F50D}","info"],[/修复|解决|变更|fix/i,"\u{1F527}","ok"],[/验证|测试|实测|回归/i,"\u{1F9EA}","ok"],[/方案|做法|实现|设计|思路|架构/i,"\u{1F6E0}\uFE0F","plan"],[/步骤|流程|操作|用法|命令/i,"\u{1F9E9}","plan"],[/背景|由来|context/i,"\u{1F9ED}","info"],[/目标|需求|要解决/i,"\u{1F3AF}","plan"],[/环境|依赖|前置|安装/i,"\u{1F4E6}","info"],[/收益|效果|性能|指标|数据|统计/i,"\u{1F4C8}","ok"],[/示例|例子|样例|demo/i,"\u{1F4A1}","idea"],[/参考|链接|相关/i,"\u{1F517}","info"]],ma=["\u2728","info"],ga=[[/风险|注意|警告|禁止|坑|务必/i,"\u26A0\uFE0F","warn"],[/提示|建议|tip|best practice/i,"\u{1F4A1}","idea"],[/结论|总结/i,"\u2705","ok"],[/错误|失败|报错/i,"\u2757","bad"]],fa=t=>{let o=String(t);for(let[l,f,c]of ua)if(l.test(o))return[f,c];return ma},ba=t=>{let o=t.join(" ");for(let[l,f,c]of ga)if(l.test(o))return[f,c];return["\u{1F4CC}","info"]};function st(t){let o=String(t),l=/^([^::\s]{1,8})[::]\s*(.+)$/.exec(o);if(l&&!/[是为有了吗呢着过把被和与或于]/.test(l[1]))return'<span class="md-kv"><span class="md-k">'+Rt(l[1])+'</span><span class="md-v">'+st(l[2])+"</span></span>";let f=Rt(o);return f=f.replace(/^\[([ xX])\](?=\s|$)\s*/,(c,i)=>'<span class="md-task">'+(i.toLowerCase()==="x"?"\u2611":"\u2610")+"</span> "),f=f.replace(/`([^`\n]+)`/g,'<code class="md-code">$1</code>'),f=f.replace(/\*\*([^*]+)\*\*/g,'<strong class="md-b">$1</strong>'),f=f.replace(/(^|[^*])\*([^*\n]+)\*/g,"$1<em>$2</em>"),f=f.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(c,i,w)=>/^(https?:|\/|#)/i.test(w)?'<a class="md-link" href="'+w+'" target="_blank" rel="noopener noreferrer">'+i+"</a>":i),f}function Ct(t){let o=String(t||"").replace(/\r\n?/g,`
|
|
7
7
|
`),l=/^---\n([\s\S]*?)\n---\n?/.exec(o);if(!l)return{meta:[],body:o};let f=[];for(let c of l[1].split(`
|
|
8
8
|
`)){let i=c.indexOf(":");if(i<=0)continue;let w=c.slice(0,i).trim(),D=c.slice(i+1).trim().replace(/^["']|["']$/g,"");w&&f.push([w,D])}return{meta:f,body:o.slice(l[0].length)}}function Et(t){let o=String(t||"").trim().replace(/^\[|\]$/g,"");return o?o.split(",").map(l=>l.trim().replace(/^["']|["']$/g,"")).filter(Boolean):[]}function Dt(t){let o=Ct(String(t||"").replace(/\r\n?/g,`
|
|
9
|
-
`)).body;if(!o.trim())return"";let l=[],f=o.replace(/```([\w+#.-]*)\n([\s\S]*?)```/g,(g,I,T)=>(l.push('<pre class="md-pre"><code>'+Rt(T.replace(/\n$/,""))+"</code></pre>"),"\0F"+(l.length-1)+"\0")),c=[],i=[],w=null,D=null,k=()=>{i.length&&(c.push('<p class="md-p">'+i.join("<br/>")+"</p>"),i=[])},H=()=>{if(!w)return;let g=w.type;c.push("<"+g+' class="md-'+g+'">'+w.items.map(I=>"<li>"+I+"</li>").join("")+"</"+g+">"),w=null},S=()=>{if(!D)return;let[g,I]=
|
|
10
|
-
`)){let I=g.trim();if(!I){h();continue}let T=/^\u0000F(\d+)\u0000$/.exec(I);if(T){h(),c.push(l[Number(T[1])]);continue}let v;if(v=/^(#{1,6})\s+(.+)$/.exec(I)){h();let[B,A]=
|
|
9
|
+
`)).body;if(!o.trim())return"";let l=[],f=o.replace(/```([\w+#.-]*)\n([\s\S]*?)```/g,(g,I,T)=>(l.push('<pre class="md-pre"><code>'+Rt(T.replace(/\n$/,""))+"</code></pre>"),"\0F"+(l.length-1)+"\0")),c=[],i=[],w=null,D=null,k=()=>{i.length&&(c.push('<p class="md-p">'+i.join("<br/>")+"</p>"),i=[])},H=()=>{if(!w)return;let g=w.type;c.push("<"+g+' class="md-'+g+'">'+w.items.map(I=>"<li>"+I+"</li>").join("")+"</"+g+">"),w=null},S=()=>{if(!D)return;let[g,I]=ba(D);c.push('<div class="md-callout md-c-'+I+'"><span class="md-ico">'+g+"</span>"+D.join("<br/>")+"</div>"),D=null},h=()=>{k(),H(),S()};for(let g of f.split(`
|
|
10
|
+
`)){let I=g.trim();if(!I){h();continue}let T=/^\u0000F(\d+)\u0000$/.exec(I);if(T){h(),c.push(l[Number(T[1])]);continue}let v;if(v=/^(#{1,6})\s+(.+)$/.exec(I)){h();let[B,A]=fa(v[2]);c.push('<div class="md-h md-h-'+(v[1].length<=2?"h1":"h2")+" md-c-"+A+'"><span class="md-ico">'+B+'</span><span class="md-hx">'+st(v[2])+"</span></div>");continue}if(/^(-{3,}|\*{3,}|_{3,})$/.test(I)){h(),c.push('<hr class="md-hr"/>');continue}if(v=/^>\s?(.*)$/.exec(I)){k(),H(),D=D||[],D.push(st(v[1]));continue}if(v=/^[-*+]\s+(.+)$/.exec(I)){k(),S(),(!w||w.type!=="ul")&&(H(),w={type:"ul",items:[]}),w.items.push(st(v[1]));continue}if(v=/^\d+[.)]\s+(.+)$/.exec(I)){k(),S(),(!w||w.type!=="ol")&&(H(),w={type:"ol",items:[]}),w.items.push(st(v[1]));continue}H(),S(),i.push(st(I))}return h(),c.join(`
|
|
11
11
|
`)}function Ot(t={}){let o=t.repo||"EternalNight996/memory-eternal",l=String(t.title||"[Bug] ").slice(0,120),f=Array.isArray(t.labels)?t.labels:["bug"],c=Number(t.maxLength)>500?Number(t.maxLength):7e3,i=k=>{let H=new URLSearchParams;return H.set("title",l),H.set("body",k),f.length&&H.set("labels",f.join(",")),"https://github.com/"+o+"/issues/new?"+H.toString()},w=String(t.body||""),D=i(w);if(D.length>c){let k=`
|
|
12
12
|
|
|
13
13
|
> \u5185\u5BB9\u8FC7\u957F\u5DF2\u622A\u65AD\uFF1A\u5B8C\u6574\u8BCA\u65AD\u8BF7\u5728\u63D2\u4EF6\u91CC\u70B9\u300C\u590D\u5236\u8BCA\u65AD\u4FE1\u606F\u300D\uFF0C\u518D\u8865\u5230 issue \u8BC4\u8BBA\u91CC\u3002`,H=S=>i(w.slice(0,S)+k);if(H(0).length>c)w=k;else{let S=0,h=w.length;for(;S<h;){let g=Math.ceil((S+h)/2);H(g).length<=c?S=g:h=g-1}w=w.slice(0,S)+k}D=i(w)}return D}function Wt(t={}){return["## \u73B0\u8C61",String(t.description||"").trim()||"\uFF08\u8BF7\u63CF\u8FF0\u4F60\u9047\u5230\u7684\u95EE\u9898\uFF09","","## \u590D\u73B0\u6B65\u9AA4","1. ","2. ","","## \u671F\u671B\u884C\u4E3A","","## \u5B9E\u9645\u884C\u4E3A","","## \u73AF\u5883","- \u63D2\u4EF6\u7248\u672C: "+(t.version||"\uFF08\u89C1\u8BCA\u65AD\u4FE1\u606F\uFF09"),"",t.diagnostics||"","","---","> \u7531 memory-eternal \u63D2\u4EF6\u5185\u300C\u53CD\u9988\u5F02\u5E38\u300D\u751F\u6210\uFF08\u8BCA\u65AD\u4FE1\u606F\u5DF2\u81EA\u52A8\u8131\u654F\uFF1Ahome \u76EE\u5F55\u4E0E\u5404\u7C7B key/token \u5DF2\u66FF\u6362\uFF09\u3002"].join(`
|
|
14
|
-
`)}var zt="https://github.com/EternalNight996/memory-eternal",
|
|
15
|
-
`),
|
|
16
|
-
`);function $t(t={}){let o=t.lang==="en"?"en":"zh",l=o==="en"?ya:ba,f=t.repo||"EternalNight996/memory-eternal";return l=l.split(zt).join("https://github.com/"+f),t.description&&(l=l.replace(o==="en"?"<write your problem here>":"<\u5728\u8FD9\u91CC\u5199\u4F60\u7684\u95EE\u9898>",String(t.description).trim())),t.diagnostics&&(l=l.replace(o==="en"?"<paste the diagnostics copied from the in-app Report-a-bug dialog>":"<\u628A\u300C\u53CD\u9988\u5F02\u5E38\u300D\u5F39\u7A97\u91CC\u590D\u5236\u7684\u8BCA\u65AD\u4FE1\u606F\u7C98\u5230\u8FD9\u91CC>",String(t.diagnostics).trim())),l}function _t({panX:t=0,panY:o=0,zoom:l=1,w:f=0,h:c=0,margin:i=60}={}){let w=l||1;return{x0:(0-t)/w-i,y0:(0-o)/w-i,x1:(f-t)/w+i,y1:(c-o)/w+i}}function Nt(t,o,l,f){return f?t+l>=f.x0&&t-l<=f.x1&&o+l>=f.y0&&o-l<=f.y1:!0}function Ut(t){let o=Number(t)||0;return o<=120?1/0:o<=300?160:o<=600?90:60}function Kt(t,o={}){let l=Number.isFinite(o.limit)?o.limit:1/0,f=new Set,c=k=>{k&&f.size<l&&f.add(k)};if(c(o.focusId),c(o.hoverId),o.searchHits)for(let k of o.searchHits){if(f.size>=l)break;f.add(k)}let i=o.degree||{},w=k=>Number(i[k])||0,D=[];for(let k of Array.isArray(t)?t:[])k&&k.id&&!f.has(k.id)&&D.push(k);D.sort((k,H)=>w(H.id)-w(k.id));for(let k of D){if(f.size>=l)break;f.add(k.id)}return f}function ha(t,o){if(t===o)return!0;if(t===null||o===null||t===void 0||o===void 0||typeof t!="object"&&typeof o!="object")return t===o;try{return JSON.stringify(t)===JSON.stringify(o)}catch{return!1}}function qt(t,o){let l={...t||{}},f={};for(let[c,i]of Object.entries(o||{}))ha(t?t[c]:void 0,i)||(l[c]=i,f[c]=i);return{values:l,overlay:f}}var e=require("react/jsx-runtime"),rt="memory-eternal",O="/memory-eternal/api",va=100,xa=["slots","locale"],Xt={nav:"\u8BB0\u5FC6",loading:"\u52A0\u8F7D\u4E2D\u2026",refresh:"\u5237\u65B0",overview:"\u8BB0\u5FC6\u5E93\u6982\u89C8",total:"\u77E5\u8BC6\u5361",recent:"\u8FD1 7 \u5929\u65B0\u589E",tags:"\u6807\u7B7E",searchPlaceholder:"\u641C\u7D22\u8BB0\u5FC6\uFF08\u652F\u6301\u4E2D\u6587\u7247\u6BB5\uFF09\u2026",search:"\u641C\u7D22",all:"\u5168\u90E8",kindProject:"\u9879\u76EE",kindKnowledge:"\u77E5\u8BC6",kindContent:"\u5185\u5BB9",kindPrompt:"\u63D0\u793A\u8BCD",kindBusiness:"\u4E1A\u52A1",kindTool:"\u5DE5\u5177",kindMistake:"\u6559\u8BAD",cardsTab:"\u77E5\u8BC6\u5361",graphTab:"\u77E5\u8BC6\u56FE\u8C31",graph:"\u77E5\u8BC6\u56FE\u8C31",graphHint:"\u8282\u70B9=\u77E5\u8BC6\u5361\uFF1B\u8FDE\u7EBF=[[\u94FE\u63A5]] \u6216\u5171\u4EAB\u6807\u7B7E\u3002\u70B9\u51FB\u8282\u70B9\u9605\u8BFB\u5361\u7247\u3002",graphTip:"\u5DE6\u952E\u51F8\u663E \xB7 Shift+\u62D6\u62FD\u6846\u9009 \xB7 \u53F3\u952E\u83DC\u5355 \xB7 \u6EDA\u8F6E\u7F29\u653E \xB7 \u62D6\u62FD\u5E73\u79FB",rebuild:"\u91CD\u5EFA",reset:"\u91CD\u7F6E",expandAll:"\u5168\u90E8\u5C55\u5F00",capped:"\u5DF2\u5C55\u793A\u6700\u6838\u5FC3\u7684",clearFocus:"\u53D6\u6D88\u9AD8\u4EAE",empty:"\u8BB0\u5FC6\u5E93\u8FD8\u662F\u7A7A\u7684\u3002\u591A\u804A\u51E0\u8F6E\u540E\uFF0C\u503C\u5F97\u4FDD\u5B58\u7684\u5185\u5BB9\u4F1A\u81EA\u52A8\u6C89\u6DC0\u6210\u77E5\u8BC6\u5361\u3002",emptyGraph:"\u56FE\u8C31\u6682\u65E0\u6570\u636E\u3002",open:"\u9605\u8BFB",updated:"\u66F4\u65B0\u4E8E",created:"\u521B\u5EFA\u4E8E",source:"\u6765\u6E90",close:"\u5173\u95ED",vaultDir:"\u8BB0\u5FC6\u5E93\u76EE\u5F55",capture:"\u81EA\u52A8\u6C89\u6DC0",recall:"\u81EA\u52A8\u53EC\u56DE",enabled:"\u5DF2\u542F\u7528",disabled:"\u5DF2\u7981\u7528",error:"\u52A0\u8F7D\u5931\u8D25",back:"\u8FD4\u56DE\u5217\u8868",cardCount:"\u5F20\u5361",nodes:"\u8282\u70B9",edges:"\u8FDE\u7EBF",memoryTitle:"\u8BB0\u5FC6\u5E93",memoryHint:"\u4F60\u7684\u672C\u5730\u7B2C\u4E8C\u5927\u8111",zoomIn:"\u653E\u5927",zoomOut:"\u7F29\u5C0F",fit:"\u9002\u5E94",enterFullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",exportGraph:"\u5BFC\u51FA",openCard:"\u6253\u5F00\u5361\u7247",focusNeighbors:"\u51F8\u663E\u5173\u8054",copyName:"\u590D\u5236\u540D\u79F0",noMatch:"\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6",clearFilter:"\u6E05\u9664\u8FC7\u6EE4",filterLabel:"\u7B5B\u9009",sortRecent:"\u6700\u8FD1",sortTitle:"\u6807\u9898",sortHot:"\u70ED\u70B9",exportSel:"\u5BFC\u51FA\u9009\u4E2D",clearSelection:"\u6E05\u7A7A\u9009\u62E9",download:"\u4E0B\u8F7D",openNewTab:"\u65B0\u6807\u7B7E\u6253\u5F00",copyImage:"\u590D\u5236\u56FE\u7247",done:"\u5B8C\u6210",downloaded:"\u5DF2\u5F00\u59CB\u4E0B\u8F7D",openedTab:"\u5DF2\u5728\u65B0\u6807\u7B7E\u6253\u5F00",copied:"\u5DF2\u590D\u5236",exportedSel:"\u4E2A\u8282\u70B9\u5DF2\u5BFC\u51FA",fullscreen:"\u5168\u5C4F",exitFull:"\u9000\u51FA\u5168\u5C4F",copyFail:"\u590D\u5236\u5931\u8D25",timeDim:"\u65F6\u95F4\u7EF4",timeNew:"3 \u5929\u5185",timeRecent:"2 \u5468\u5185",timeMonth:"1 \u6708\u5185",timeOld:"\u66F4\u65E9",newBadge:"\u65B0",expand:"\u5C55\u5F00\u5168\u90E8",collapse:"\u6536\u8D77",exportVault:"\u5BFC\u51FAMD",exportJson:"\u5BFC\u51FAJSON",exporting:"\u5BFC\u51FA\u4E2D\u2026",exportedVault:"\u8BB0\u5FC6\u5E93\u5DF2\u5BFC\u51FA",exportFail:"\u5BFC\u51FA\u5931\u8D25",importVault:"\u5BFC\u5165",importedVault:"\u5BFC\u5165\u5B8C\u6210",importedTotal:" \u5F20 / \u6587\u4EF6\u5171 ",importedTotalTail:" \u5F20",importedQuarantine:" \xB7 \u5F85\u5BA1\u6838 ",importedQuarantineTail:" \u5F20\uFF08\u9694\u79BB\u533A\uFF0C\u6279\u51C6\u540E\u624D\u53C2\u4E0E\u53EC\u56DE\uFF09",importedSkipped:" \xB7 \u8DF3\u8FC7 ",importedSkippedTail:" \u5F20\uFF08\u91CD\u590D\u6216\u7A7A\uFF09",importFail:"\u5BFC\u5165\u5931\u8D25",location:"\u81EA\u9009\u4F4D\u7F6E",saveAs:"\u53E6\u5B58\u4E3A",saveAsUnsupported:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u9009\u62E9\u4FDD\u5B58\u4F4D\u7F6E",exportedTo:"\u5DF2\u5BFC\u51FA\u5230",defaultDownloads:"\u9ED8\u8BA4\u4E0B\u8F7D\u6587\u4EF6\u5939",exportCancel:"\u5DF2\u53D6\u6D88\u5BFC\u51FA",manage:"\u7BA1\u7406",tabUsage:"\u7528\u91CF/\u4ECA\u65E5",tabOptimize:"\u6574\u7406\u5EFA\u8BAE",adminLoadFail:"\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1A\u8BF7\u5F7B\u5E95\u91CD\u542F dsh-desktop\uFF08host \u9700\u52A0\u8F7D\u65B0\u7248 /memory-eternal \u8DEF\u7531\uFF09",retry:"\u91CD\u8BD5",mergeSimilar:"\u4E00\u952E\u5408\u5E76\u76F8\u4F3C",trendLabel:"\u8FD1 30 \u5929\u8D8B\u52BF",cleanStale:"\u{1F5D1}\uFE0F \u4E00\u952E\u6E05\u7406\u9648\u65E7",deletedStale:"\u4E2A\u9648\u65E7\u5361\u5DF2\u6E05\u7406",newCard:"\u65B0\u5EFA",tplDecision:"\u{1F4DD} \u6280\u672F\u51B3\u7B56",tplBug:"\u{1F41B} \u8E29\u5751",tplMeeting:"\u{1F4CB} \u4F1A\u8BAE\u7EAA\u8981",tplWeekly:"\u{1F4CA} \u5468\u62A5",createCard:"\u521B\u5EFA",cardTitle:"\u6807\u9898",cardBody:"\u6B63\u6587",fbUseful:"\u6709\u7528",fbIrr:"\u65E0\u5173",todayAdd:"\u4ECA\u65E5\u65B0\u589E",weekAdd:"\u8FD1 7 \u5929",byKind:"\u5206\u7C7B\u7EDF\u8BA1",todayList:"\u4ECA\u65E5\u6C89\u6DC0",budgetLabel:"\u4F1A\u8BDD\u9884\u7B97",budgetChars:"\u9884\u7B97\u5B57\u7B26",recallLimitLabel:"\u53EC\u56DE\u6761\u6570",embeddingLabel:"\u8BED\u4E49\u53EC\u56DE",mergePairs:"\u76F8\u4F3C\u5361\u5BF9\uFF08\u53EF\u5408\u5E76\uFF09",staleCards:"\u9648\u65E7\u5361\uFF08>90 \u5929\u672A\u66F4\u65B0\uFF09",noOptimize:"\u6682\u65E0\u53EF\u6574\u7406\u9879\uFF0C\u5F88\u5065\u5EB7 \u{1F389}",refineTitle:"\u77DB\u76FE\u626B\u63CF",refineScan:"\u5F00\u59CB\u626B\u63CF",refineHint:"\u76F8\u4F3C\u53EF\u4EE5\u5408\u5E76\uFF0C\u77DB\u76FE\u5FC5\u987B\u4EBA\u5224\u65AD \u2014\u2014 \u626B\u63CF\u53EA\u8BFB\uFF0C\u9009\u62E9\u540E\u624D\u52A8\u6570\u636E\uFF08\u4FDD\u7559\u4E00\u5F20\u4F1A\u628A\u53E6\u4E00\u5F20\u653E\u8FDB\u56DE\u6536\u7AD9\uFF0C\u53EF\u8FD8\u539F\uFF09",refineIdle:"\u70B9\u300C\u5F00\u59CB\u626B\u63CF\u300D\uFF1A\u5148\u5BBD\u53EC\u56DE\u53EF\u80FD\u6709\u5173\u7CFB\u7684\u5361\u7247\u5BF9\uFF0C\u518D\u8BA9\u6A21\u578B\u5224\u65AD\u662F\u91CD\u590D / \u8865\u5145 / \u77DB\u76FE / \u65E0\u5173",refineNone:"\u8FD9\u4E00\u8F6E\u6CA1\u6709\u53D1\u73B0\u9700\u8981\u4F60\u88C1\u51B3\u7684\u5361\u7247\u5BF9 \u{1F389}",refineFail:"\u77DB\u76FE\u626B\u63CF\u5931\u8D25",refineApplied:"\u5DF2\u8BB0\u5F55\u4F60\u7684\u88C1\u51B3\uFF08\u4E0D\u4F1A\u91CD\u590D\u6253\u6270\uFF09",refineRel_duplicate:"\u91CD\u590D\uFF08\u53EF\u5408\u5E76\uFF09",refineRel_complement:"\u8865\u5145\uFF08\u90FD\u7559\u7740\uFF09",refineRel_conflict:"\u77DB\u76FE\uFF08\u9700\u4F60\u88C1\u51B3\uFF09",refineRel_unrelated:"\u65E0\u5173",refineKeepA:"\u4FDD\u7559 A",refineKeepB:"\u4FDD\u7559 B",refineKeepBoth:"\u90FD\u4FDD\u7559",refineMerge:"\u5408\u5E76",junkTitle:"\u6CE8\u5165\u5783\u573E\u5361",junkScan:"\u626B\u63CF\u5B58\u91CF",junkHint:"\u6000\u7591\u662F\u8FD0\u884C\u65F6\u6CE8\u5165\u6587\u672C\uFF08\u6280\u80FD\u76EE\u5F55 / system-reminder\uFF09\u6C89\u6DC0\u6210\u7684\u5361 \u2014\u2014 \u626B\u63CF\u53EA\u8BFB\uFF0C\u56DE\u6536\u8D70\u56DE\u6536\u7AD9\u53EF\u8FD8\u539F",junkIdle:"\u70B9\u300C\u626B\u63CF\u5B58\u91CF\u300D\uFF1A\u627E\u51FA\u6B63\u6587\u5176\u5B9E\u662F\u88AB\u6CE8\u5165\u7684\u8FD0\u884C\u65F6\u6587\u672C\u3001\u5265\u6389\u540E\u51E0\u4E4E\u4E0D\u5269\u4EBA\u8BDD\u7684\u5361",junkNone:"\u6CA1\u53D1\u73B0\u8FD9\u7C7B\u5361 \u{1F389}",junkRecycle:"\u56DE\u6536",junkRecycleAll:"\u5168\u90E8\u56DE\u6536",junkRecycleAllConfirm:"\u786E\u8BA4\u628A\u8FD9\u4E9B\u5361\u9001\u8FDB\u56DE\u6536\u7AD9\uFF1F\uFF08\u4E0D\u662F\u6C38\u4E45\u5220\u9664\uFF0C\u53EF\u5728\u56DE\u6536\u4E2D\u5FC3\u8FD8\u539F\uFF09",junkDone:"\u5DF2\u9001\u56DE\u6536\u7AD9",junkFail:"\u626B\u63CF / \u56DE\u6536\u5931\u8D25",dbReadonlyTitle:"\u8BB0\u5FC6\u5E93\u5F53\u524D\u4E0D\u53EF\u5199",dbReadonlyBody:"\u5361\u7247\u8BFB\u5199 / \u5BA1\u6838 / \u56FE\u8C31\u4F1A\u5931\u8D25\uFF0C\u4F46**\u914D\u7F6E\u4ECD\u53EF\u4FDD\u5B58**\uFF08\u914D\u7F6E\u4E0D\u7ECF\u8FC7\u6570\u636E\u5E93\uFF09",dbReadonlyFix:"\u6392\u67E5\uFF1Adsh-memory doctor\uFF08\u770B journal \u6A21\u5F0F\u3001\u5199\u63A2\u9488\u3001\u5907\u4EFD\u6E05\u5355\u4E0E\u6062\u590D\u6B65\u9AA4\uFF09",goalTitle:"\u540C\u76EE\u6807\u4E0D\u540C\u505A\u6CD5",goalScan:"\u626B\u63CF\u76EE\u6807",goalHint:"\u6309\u300C\u8FD9\u5F20\u5361\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898\u300D\u805A\u7C7B \u2014\u2014 \u6B63\u6587\u76F8\u4F3C\u5EA6\u6293\u4E0D\u5230\u7684\u505A\u6CD5\u5DEE\u5F02\uFF087z \u538B\u7F29 / tar \u5206\u53D1 / npm \u7626\u8EAB\uFF09\u4E5F\u80FD\u5F52\u5230\u4E00\u8D77",goalIdle:"\u70B9\u300C\u626B\u63CF\u76EE\u6807\u300D\uFF1A\u6A21\u578B\u5148\u7ED9\u6BCF\u5F20\u5361\u62BD\u4E00\u53E5\u76EE\u6807\uFF08\u9996\u6B21\u4F1A\u8C03\u6A21\u578B\uFF0C\u4E4B\u540E\u8D70\u7F13\u5B58\uFF09\uFF0C\u518D\u6309\u76EE\u6807\u805A\u7C7B",goalNone:"\u6CA1\u6709\u53D1\u73B0\u300C\u540C\u4E00\u76EE\u6807\u3001\u591A\u5F20\u5361\u300D\u7684\u7C07 \u{1F389}",goalStats:"\u5DF2\u7D22\u5F15 / \u672C\u6B21\u8C03\u7528",goalCards:"\u5F20\u5361",goalKeep:"\u90FD\u4FDD\u7559",goalMerge:"\u5408\u5E76\u8FD9\u4E00\u7EC4",goalMerged:"\u5DF2\u63D0\u4EA4\u5408\u5E76\uFF08\u65B0\u5361\u8FDB\u5BA1\u6838\u961F\u5217\uFF09",goalDone:"\u5DF2\u8BB0\u5F55\u300C\u90FD\u4FDD\u7559\u300D",goalFail:"\u76EE\u6807\u805A\u7C7B\u5931\u8D25",oneClickOptimize:"\u4E00\u952E\u4F18\u5316",oneClickOptimizeConfirm:"\u786E\u8BA4\u4E00\u952E\u4F18\u5316\uFF1F\u5C06\u5408\u5E76\u6240\u6709\u76F8\u4F3C\u5361\u5BF9\uFF08\u9ED8\u8BA4\u4E0D\u6E05\u7406\u9648\u65E7\u5361\uFF09\u3002",oneClickAlsoStale:"\u540C\u65F6\u6E05\u7406\u9648\u65E7\u5361",oneClickOptimizeDone:"\u4E00\u952E\u4F18\u5316\u5B8C\u6210",optimizedMerged:"\u5BF9\u5DF2\u5408\u5E76",optimizedStaleDeleted:"\u5F20\u9648\u65E7\u5361\u5DF2\u6E05\u7406",mcpSetupStatus:"Agent MCP \u6302\u8F7D\u72B6\u6001",rerunSetup:"\u8865\u5168 MCP",notInstalled:"\u672A\u5B89\u88C5",noMcpEntry:"\u914D\u7F6E\u7F3A\u5931",nodePathMismatch:"node \u8DEF\u5F84\u4E0D\u4E00\u81F4\uFF0C\u5EFA\u8BAE\u91CD\u8DD1 setup",nodePathNote:"node \u73AF\u5883\u4E0D\u540C\uFF08\u53EF\u7528\uFF09",healthy:"\u914D\u7F6E\u6B63\u5E38",mcpSetupHint:"\u300C\u81EA\u52A8\u6302\u8F7D MCP\u300D= \u8BA9 Claude Code / Codex / Cursor \u8FD9\u4E9B\u5DE5\u5177\u80FD\u8C03\u7528\u8BB0\u5FC6\u5E93\u3002\u5F00\u542F\u540E\u81EA\u52A8\u628A\u5B83\u4EEC\u914D\u7F6E\u597D\uFF1B\u5173\u6389\u5C31\u4E0D\u52A8\u4F60\u7535\u8111\u4E0A\u4EFB\u4F55\u914D\u7F6E\u6587\u4EF6\uFF0C\u9700\u8981\u65F6\u624B\u52A8\u8DD1 dsh-memory setup\u3002",mcpManageHint:"\u6BCF\u4E2A agent \u7528\u4E0B\u65B9\u6309\u94AE\u5355\u72EC\u5B89\u88C5/\u5378\u8F7D MCP",tabConfig:"\u8BB0\u5FC6\u914D\u7F6E",tabAudit:"\u5BA1\u6838\u4E2D\u5FC3",statusApproved:"\u5DF2\u5BA1\u6838",statusPending:"\u5F85\u5BA1\u6838",statusRejected:"\u5DF2\u9A73\u56DE",allStatus:"\u5168\u90E8\u72B6\u6001",tabRecycle:"\u56DE\u6536\u4E2D\u5FC3",pending:"\u5F85\u5BA1\u6838",rejected:"\u5DF2\u9A73\u56DE",selectAll:"\u5168\u9009",approve:"\u6279\u51C6",reject:"\u9A73\u56DE",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",noAuditItems:"\u6682\u65E0\u5BA1\u6838\u9879\u76EE",auditBodyFail:"\u6B63\u6587\u8BFB\u53D6\u5931\u8D25",deletedAt:"\u5220\u9664\u4E8E",restore:"\u6062\u590D",restoreDelete:"\u5220\u9664\u8FDB\u56DE\u6536\u7AD9",purge:"\u6C38\u4E45\u5220\u9664",emptyRecycle:"\u56DE\u6536\u7AD9\u4E3A\u7A7A",recycleHint:"\u5220\u9664\u7684\u5361\u7247\u5148\u8FDB\u56DE\u6536\u7AD9\uFF0C30 \u5929\u5185\u53EF\u6062\u590D\uFF0C\u8D85\u671F\u81EA\u52A8\u6C38\u4E45\u5220\u9664",purgeConfirm:"\u786E\u5B9A\u6C38\u4E45\u5220\u9664\uFF1F\u4E0D\u53EF\u6062\u590D\u3002",recycleDeleteConfirm:"\u786E\u5B9A\u5220\u9664\u8FDB\u56DE\u6536\u7AD9\uFF1F30 \u5929\u5185\u53EF\u6062\u590D\u3002",modeInit:"\u542F\u52A8\u65F6\u62C9\u4E00\u6B21",modeInterval:"\u5468\u671F\u4FDD\u6D3B",modeManual:"\u4EC5\u624B\u52A8",serviceConfig:"\u670D\u52A1\u81EA\u7BA1\u7406\u914D\u7F6E",auditConfig:"\u81EA\u52A8\u5BA1\u6838\u914D\u7F6E",auditHint:"\u547D\u4E2D\u514D\u5BA1\u7684\u65B0\u5361\u76F4\u63A5\u5165\u5E93\uFF0C\u5176\u4F59\u8FDB\u5F85\u5BA1\u6838",auditMode:"\u5BA1\u6838\u6A21\u5F0F",auditAll:"\u5168\u90E8\u8981\u5BA1\u6838",auditNone:"\u5168\u90E8\u514D\u5BA1",auditExemptAgents:"\u514D\u5BA1\u667A\u80FD\u4F53",auditExemptKinds:"\u514D\u5BA1\u7C7B\u578B",allExempt:"\u5168\u90E8\u514D\u5BA1",recycleDays:"\u56DE\u6536\u4FDD\u7559\u5929\u6570",editInSetting:"\u7F16\u8F91\u8BF7\u5230 DSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6",pendingSyncNote:"\u6B64\u9875\u662F\u72EC\u7ACB Web \u9875\uFF1A\u4FDD\u5B58\u540E\u7531 DSH \u5BBF\u4E3B\u5E94\u7528\uFF08\u65B0\u7248\u5BBF\u4E3B\u4F1A\u88AB\u76F4\u63A5\u53EB\u9192\u3001\u5728\u8BF7\u6C42\u4E0A\u4E0B\u6587\u91CC\u5E94\u7528\uFF0C\u70B9\u4FDD\u5B58\u5373\u751F\u6548\uFF09\uFF1B\u82E5\u672C\u673A\u6CA1\u6709 DSH \u5BBF\u4E3B\u5728\u8FD0\u884C\uFF0C\u5219\u76F4\u63A5\u5199\u5165\u5171\u4EAB\u914D\u7F6E\u3001\u7ACB\u5373\u751F\u6548\u3002\u53EA\u6709\u5728\u5BF9\u63A5\u65E7\u7248\u5BBF\u4E3B\u65F6\u624D\u4F1A\u9000\u56DE\u300C\u6392\u961F\u7B49\u5B83\u81EA\u5DF1\u540C\u6B65\u300D\uFF0C\u90A3\u65F6\u53EF\u5728 DSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u91CC\u6539\u540C\u4E00\u9879\u3002",readonlyTitle:"\u5F53\u524D\u9875\u9762\u53EA\u8BFB\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u914D\u7F6E",readonlyBody:"\u8FD9\u4E2A\u8FDB\u7A0B\u6CA1\u6709 DSH \u7684\u8BBE\u7F6E\u670D\u52A1\uFF08settings.update \u4E0D\u5B58\u5728\uFF09\uFF0C\u914D\u7F6E\u53EA\u80FD\u5728\u672C\u673A DSH \u91CC\u4FEE\u6539\uFF1A\u684C\u9762\u7248 \u2192 \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u3002",readonlyBtn:"\u53EA\u8BFB",setupRunInTerminal:"\u8BF7\u590D\u5236\u4EE5\u4E0B\u547D\u4EE4\u5230\u7EC8\u7AEF\u6267\u884C\uFF1A",dshMemoryConfig:"DSH \u8BB0\u5FC6\u914D\u7F6E",autoCapture:"\u81EA\u52A8\u6C89\u6DC0",autoRecall:"\u81EA\u52A8\u53EC\u56DE",captureMinChars:"\u6355\u83B7\u6700\u5C0F\u957F\u5EA6",maxCardsPerDay:"\u65E5\u914D\u989D",dedupThreshold:"\u53BB\u91CD\u9608\u503C",recallLimit:"\u53EC\u56DE\u6761\u6570",vaultMulti:"\u591A\u5E93\uFF08\u6309\u9879\u76EE\u9694\u79BB\uFF09",vaultMultiHint:"\u7559\u7A7A\u5373\u5355\u5E93\uFF0C\u8001\u914D\u7F6E\u4E0D\u53D7\u5F71\u54CD",vaultNow:"\u5F53\u524D\u751F\u6548",vaultSource:"\u6765\u6E90",vaultWorkspace:"\u5F53\u524D workspace",vaultNamePh:"\u5E93\u540D\uFF0C\u5982 work",vaultPathPh:"\u76EE\u5F55\uFF0C\u5982 D:/vaults/work",vaultMatchPh:"\u9879\u76EE\u76EE\u5F55\uFF08\u53EF\u9009\uFF0C\u6309 workspace \u81EA\u52A8\u9009\u5E93\uFF09",vaultAdd:"\u6DFB\u52A0\u4E00\u4E2A\u5E93",vaultActive:"\u6FC0\u6D3B\u5E93",vaultActiveNone:"\u9ED8\u8BA4\u5E93\uFF08\u4E0D\u6307\u5B9A\uFF09",vaultSrcEnv:"\u73AF\u5883\u53D8\u91CF MEMORY_VAULT_DIR",vaultSrcProfile:"\u6FC0\u6D3B\u5E93\u914D\u7F6E",vaultSrcWorkspace:"\u6309\u9879\u76EE\u76EE\u5F55\u81EA\u52A8\u547D\u4E2D",vaultSrcVaultDir:"\u5355\u5E93\u914D\u7F6E vaultDir",vaultSrcDefault:"\u9ED8\u8BA4\u76EE\u5F55",fbNav:"\u53CD\u9988\u5F02\u5E38",fbTitle:"\u53CD\u9988\u5F02\u5E38\uFF08\u63D0\u4EA4\u5230 GitHub\uFF09",fbDesc:"\u63CF\u8FF0\u4F60\u9047\u5230\u7684\u95EE\u9898\uFF08\u73B0\u8C61 / \u590D\u73B0\u6B65\u9AA4 / \u671F\u671B\u884C\u4E3A\uFF09",fbDiag:"\u8BCA\u65AD\u4FE1\u606F\uFF08\u5DF2\u81EA\u52A8\u8131\u654F\uFF1Ahome \u76EE\u5F55\u4E0E key/token \u5DF2\u66FF\u6362\uFF09",fbCopyDiag:"\u590D\u5236\u8BCA\u65AD\u4FE1\u606F",fbOpenIssue:"\u5728 GitHub \u63D0\u4EA4\uFF08\u5DF2\u9884\u586B\uFF09",fbCopyPrompt:"\u590D\u5236\u7ED9 AI \u7684\u63D0\u793A\u8BCD",fbCopiedDiag:"\u8BCA\u65AD\u4FE1\u606F\u5DF2\u590D\u5236",fbCopiedPrompt:"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\uFF0C\u7C98\u8FDB AI \u5BF9\u8BDD\u6846\u5373\u53EF",fbCopyFail:"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u4E2D\u590D\u5236",fbWhy:"GitHub \u4E0D\u5141\u8BB8\u533F\u540D\u521B\u5EFA issue\uFF0C\u63D2\u4EF6\u91CC\u4E5F\u4E0D\u5E94\u5185\u7F6E token\uFF1A\u6240\u4EE5\u8FD9\u91CC\u628A\u6807\u9898 / \u6B63\u6587 / \u8BCA\u65AD\u90FD\u9884\u586B\u597D\uFF0C\u4F60\u53EA\u9700\u518D\u70B9\u4E00\u6B21 Submit\u3002",fbNeedDesc:"\u8BF7\u5148\u63CF\u8FF0\u4F60\u9047\u5230\u7684\u95EE\u9898",fbLoading:"\u6B63\u5728\u6536\u96C6\u8BCA\u65AD\u4FE1\u606F\u2026",fbDiagFail:"\u8BCA\u65AD\u63A5\u53E3\u4E0D\u53EF\u7528\uFF08\u72EC\u7ACB web \u6216\u65E7\u7248\u5BBF\u4E3B\uFF09\uFF0C\u8BF7\u624B\u52A8\u8865\u5145\u73AF\u5883\u4FE1\u606F",fbOr:"\u6216\u8005",fbSelectAll:"\u5168\u9009",toastApproved:"\u5DF2\u6279\u51C6",toastRejected:"\u5DF2\u9A73\u56DE",toastCardDeleted:"\u5DF2\u5220\u9664",toastRestored:"\u5DF2\u6062\u590D",toastPurged:"\u5DF2\u5F7B\u5E95\u5220\u9664",toastPurgedExpired:"\u5DF2\u6E05\u7406\u8FC7\u671F\u56DE\u6536\u7AD9",toastFailed:"\u64CD\u4F5C\u5931\u8D25",noSelection:"\u8BF7\u5148\u9009\u62E9\u8981\u5904\u7406\u7684\u5361\u7247",enabledLabel:"\u542F\u7528\u8BB0\u5FC6\u6838\u5FC3",vaultDirLabel:"\u8BB0\u5FC6\u5E93\u76EE\u5F55\uFF08\u5355\u5E93\uFF09",captureCooldownMs:"\u6C89\u6DC0\u51B7\u5374 (ms)",captureProvider:"\u84B8\u998F provider\uFF08\u7559\u7A7A\u81EA\u52A8\uFF09",captureModel:"\u84B8\u998F model\uFF08\u7559\u7A7A\u81EA\u52A8\uFF09",recallEmbedding:"\u8BED\u4E49\u53EC\u56DE provider\uFF08\u53EF\u9009\uFF09",sessionBudgetChars:"\u4F1A\u8BDD\u9884\u7B97 (\u5B57\u7B26)",saving:"\u4FDD\u5B58\u4E2D\u2026",savePending:"\u5DF2\u5199\u5165\u914D\u7F6E\u6587\u4EF6\uFF1B\u5BBF\u4E3B\u4ECD\u662F\u65E7\u7248\uFF0C\u91CD\u542F DSH \u540E\u5373\u4EE5\u65B0\u503C\u4E3A\u51C6\uFF08\u672C\u9762\u677F\u5DF2\u751F\u6548\uFF09",actionRunning:"\u5904\u7406\u4E2D\u2026",recycleEmptyHint:"\u56DE\u6536\u7AD9\u4E3A\u7A7A\uFF1A\u5220\u6389\u7684\u5361\u7247\u4F1A\u5148\u653E\u5230\u8FD9\u91CC\uFF0C\u4FDD\u7559 {days} \u5929\u540E\u81EA\u52A8\u6E05\u7406\u3002",recyclePurgeAll:"\u6E05\u7A7A\u56DE\u6536\u7AD9",fbCopyManual:"\u81EA\u52A8\u590D\u5236\u88AB\u6D4F\u89C8\u5668\u62E6\u622A\uFF0C\u5DF2\u628A\u5185\u5BB9\u653E\u5728\u4E0B\u9762\uFF1A\u70B9\u300C\u5168\u9009\u300D\u518D\u6309 Ctrl+C",vcPage:"\u9875\u9762\u811A\u672C",vcPageStale:"\u26A0 \u5F53\u524D\u9875\u9762\u4ECD\u5728\u8FD0\u884C\u65E7\u7248\u811A\u672C\uFF08\u9875\u9762 v{page} / \u78C1\u76D8 v{disk}\uFF09\uFF1A\u6309 Ctrl+F5 \u5237\u65B0\u9875\u9762\u5373\u751F\u6548\uFF1B\u82E5\u300C\u8FD0\u884C\u4E2D\u300D\u4ECD\u662F\u65E7\u7248\u53F7\uFF0C\u5219\u8FD8\u9700\u91CD\u542F\u684C\u9762\u7248 / DSH",vcLoaded:"\u8FD0\u884C\u4E2D\uFF08\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\uFF09",vcResident:"\u5E38\u9A7B\u5B9E\u4F8B",vcOnDisk:"\u78C1\u76D8\u5B89\u88C5",vcLatest:"npm \u6700\u65B0",vcStale:"\u78C1\u76D8\u5DF2\u5B89\u88C5 v{disk}\uFF0C\u4F46\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\u4ECD\u52A0\u8F7D v{loaded} \u2014\u2014 \u70B9\u300C\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B\u300D\u5373\u53EF\u7528\u65B0\u4EE3\u7801\u91CD\u542F\u5B83\uFF08\u4E0D\u7528\u91CD\u542F DSH\uFF09",vcRestart:"\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B",vcRestarting:"\u91CD\u542F\u4E2D\u2026",vcRestartSent:"\u5DF2\u8C03\u5EA6\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B\uFF1A\u7EA6 3-8 \u79D2\u540E\u65B0\u8FDB\u7A0B\u63A5\u7BA1\uFF0C\u8BF7\u7A0D\u7B49\u518D\u5237\u65B0\u9875\u9762\uFF08Ctrl+F5\uFF09",vcRestartCurrent:"\u5E38\u9A7B\u5B9E\u4F8B\u5DF2\u7ECF\u662F\u6700\u65B0\u7248\uFF0C\u65E0\u9700\u91CD\u542F",vcRestartFail:"\u91CD\u542F\u8BF7\u6C42\u5931\u8D25",vcRestartNoRoute:"\u5F53\u524D\u9875\u9762\u5BF9\u63A5\u7684\u8FDB\u7A0B\u8FD8\u662F\u65E7\u7248\uFF08\u6CA1\u6709\u8FD9\u4E2A\u63A5\u53E3\uFF09\uFF1A\u8BF7\u91CD\u542F\u684C\u9762\u7248 / DSH \u540E\u518D\u8BD5\uFF0C\u6216\u6267\u884C {cmd}",vcHostStale:"\u4E0A\u65B9\u7684\u300C\u8FD0\u884C\u4E2D\u300D\u6765\u81EA\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\uFF1B\u5E38\u9A7B\u5B9E\u4F8B\u5DF2\u662F\u65B0\u7248 \u2014\u2014 \u8981\u8BA9\u5B83\u4E5F\u53D8\u6210\u65B0\u7248\u53F7\uFF0C\u9700\u91CD\u542F\u684C\u9762\u7248 / DSH",vcResidentDownShort:"\u672A\u8FD0\u884C",vcResidentDown:"\u5E38\u9A7B\u5B9E\u4F8B\u6CA1\u5728\u8FD0\u884C\uFF08\u7AEF\u53E3 {port} \u65E0\u54CD\u5E94\uFF09\u2014\u2014 \u70B9\u4E0B\u9762\u7684\u6309\u94AE\u7528\u65B0\u4EE3\u7801\u628A\u5B83\u62C9\u8D77\u6765\uFF1B\u62C9\u4E0D\u8D77\u6765\u65F6\u6267\u884C {cmd}\uFF0C\u5E76\u8D34\u4E00\u4E0B dsh-memory status \u7684\u8F93\u51FA",vcResidentUnmanagedShort:"\u672A\u6258\u7BA1",vcResidentUnmanaged:"\u5E38\u9A7B\u5B9E\u4F8B\u5728\u670D\u52A1 v{served}\uFF0C\u4F46**\u6CA1\u6709\u770B\u95E8\u72D7\u4FDD\u6D3B**\uFF08\u505C\u6B62 / \u786C\u6740\u540E\u6B8B\u7559\u7684\u5B64\u513F\uFF09\u2014\u2014 \u70B9\u4E0B\u9762\u7684\u6309\u94AE\u628A\u5B83\u91CD\u65B0\u6258\u7BA1\uFF08\u91CD\u65B0\u62C9\u4E00\u4E2A\u770B\u95E8\u72D7 + \u65B0\u5B9E\u4F8B\uFF09\uFF1B\u4E5F\u53EF\u4EE5\u6267\u884C {cmd}",vcResidentLockUnknownShort:"\u6258\u7BA1\u72B6\u6001\u672A\u77E5",vcResidentLockUnknown:"\u5E38\u9A7B\u5B9E\u4F8B\u5728\u670D\u52A1 v{served}\uFF0C\u4F46**\u770B\u95E8\u72D7\u9501\u6587\u4EF6\u5199\u4E0D\u8FDB\u53BB**\uFF08\u53D7\u9650\u73AF\u5883\uFF1A\u6C99\u7BB1\u7981\u5199 / ACL / \u975E\u7CFB\u7EDF\u76D8\uFF09\u2192 \u65E0\u6CD5\u5224\u65AD\u5B83\u6709\u6CA1\u6709\u88AB\u6258\u7BA1\uFF08\u4E0D\u662F\u300C\u672A\u6258\u7BA1\u300D\uFF09\u3002\u539F\u56E0\uFF1A{err}\uFF08{path}\uFF09\u3002\u4FDD\u6D3B\u901A\u5E38\u4ECD\u7136\u6709\u6548\uFF1B\u70B9\u4E0B\u9762\u7684\u6309\u94AE\u53EF\u7528\u65B0\u4EE3\u7801\u91CD\u65B0\u6258\u7BA1\u4E00\u6B21\u3002",vcOutdated:"\u6709\u65B0\u7248\u672C",vcUpToDate:"\u5DF2\u662F\u6700\u65B0",vcCheck:"\u68C0\u67E5\u66F4\u65B0",checking:"\u68C0\u67E5\u4E2D\u2026",vcCheckFail:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25",recallSummaryLen:"\u53EC\u56DE\u6458\u8981\u957F\u5EA6",recallBody:"\u53EC\u56DE\u542B\u6B63\u6587",secretHint:"\u51ED\u8BC1\u53D6\u7528\u63D0\u793A\uFF08\u6CE8\u5165\u6BCF\u4E2A\u4F1A\u8BDD\uFF09",autoWeb:"Web server",autoWebMode:"\u4FDD\u6D3B\u6A21\u5F0F",webPort:"Web \u7AEF\u53E3",webCheckIntervalMs:"\u63A2\u6D3B\u95F4\u9694(ms)",webMaxRestart:"\u6700\u5927\u91CD\u542F\u6B21\u6570",watchdogAutoSpawn:"\u770B\u95E8\u72D7\u8FDB\u7A0B",autoRestartOnDrift:"\u7248\u672C\u6F02\u79FB\u81EA\u52A8\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B",autoMcpSetup:"\u81EA\u52A8\u6302\u8F7D MCP",saveConfig:"\u4FDD\u5B58\u914D\u7F6E",saveFail:"\u4FDD\u5B58\u5931\u8D25",savedOk:"\u5DF2\u4FDD\u5B58",savedDirect:"\u672C\u673A\u6CA1\u6709 DSH \u5BBF\u4E3B\u5728\u8FD0\u884C\uFF0C\u5DF2\u76F4\u63A5\u5199\u5165\u5171\u4EAB\u914D\u7F6E\uFF08hooks / MCP / \u72EC\u7ACB\u9875\u7ACB\u5373\u751F\u6548\uFF09",savedApplied:"\u5DF2\u4FDD\u5B58\u5E76\u751F\u6548\uFF08\u5BBF\u4E3B\u5DF2\u5728\u8BF7\u6C42\u4E0A\u4E0B\u6587\u91CC\u5E94\u7528\uFF09",saveQueued:"\u5DF2\u4EA4\u7ED9 DSH \u5BBF\u4E3B\u540C\u6B65\uFF0C\u5C1A\u672A\u786E\u8BA4\u751F\u6548",saveHostGuard:"\u8BE5\u5BBF\u4E3B\u4E0D\u5141\u8BB8\u63D2\u4EF6\u4ECE\u81EA\u5DF1\u7684\u56DE\u8C03\u4E0A\u4E0B\u6587\u91CC\u5199\u914D\u7F6E\uFF1B\u8BF7\u5728\u300CDSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u300D\u91CC\u6539\u540C\u4E00\u9879\uFF0C\u6216\u7F16\u8F91 profile \u7684\u914D\u7F6E\u8865\u4E01\u5C42",saveFailHint:"\u5BBF\u4E3B\u4FA7\u672A\u5E94\u7528\uFF0C\u8BE6\u89C1\u300C\u53CD\u9988\u5F02\u5E38\u300D\u91CC\u7684\u8BCA\u65AD\u4FE1\u606F",recallTool:"recall \u5DE5\u5177",costControl:"\u6210\u672C\u63A7\u5236",costHint:"\u7701 token\u3001\u63A7 LLM \u6D88\u8017",distillEnabled:"\u84B8\u998F\u77E5\u8BC6\u5361(\u5F00=LLM \u538B\u7F29, \u5173=\u539F\u6587\u5361\u96F6 LLM)",dedupByLLM:"\u8BED\u4E49\u53BB\u91CD\u5582 LLM(\u5173=\u7EAF\u8BCD\u6CD5\u66F4\u7701)",captureMaxTokens:"\u84B8\u998F\u8F93\u51FA\u4E0A\u9650(token)",recallMinScore:"\u53EC\u56DE\u76F8\u5173\u6027\u9608\u503C(\u8D8A\u9AD8\u8D8A\u7701)",configNeedsDsh:"\u914D\u7F6E\u7F16\u8F91\u9700\u5728 DSH \u5185\u6253\u5F00\uFF08\u672C\u9875\u53EF\u80FD\u53EA\u8BFB\u6216\u6709\u90E8\u5206\u7F3A\u5931\uFF09",installMcp:"\u5B89\u88C5 MCP",uninstallMcp:"\u5378\u8F7D MCP",uninstallConfirm:"\u786E\u8BA4\u5378\u8F7D\u8BE5\u667A\u80FD\u4F53\u7684 MCP\uFF1FClaude Code/Codex \u5C06\u65E0\u6CD5\u518D\u8C03\u7528\u8BB0\u5FC6\u5E93\u3002",presetConfig:"\u4E00\u952E\u63A8\u8350\u914D\u7F6E",presetHint:"\u70B9\u51FB\u586B\u5145\u5BF9\u5E94\u65B9\u6848\uFF0C\u70B9\u4FDD\u5B58\u751F\u6548",planA:"A \u8F7B\u91CF\u7701\u5FC3",planB:"B \u6781\u81F4\u7701\u94B1",planC:"C \u9AD8\u8D28\u91CF",pluginInfo:"\u63D2\u4EF6\u4FE1\u606F",organizeTitle:"\u6574\u7406\u5EFA\u8BAE",scanAndOrganize:"\u4E00\u952E\u641C\u7D22\u548C\u6574\u7406",scanHint:"\u70B9\u300C\u{1F50D} \u4E00\u952E\u641C\u7D22\u548C\u6574\u7406\u300D\u626B\u63CF\u76F8\u4F3C\u5361/\u9648\u65E7\u5361\uFF0C\u518D\u7528\u300C\u26A1 \u4E00\u952E\u4F18\u5316\u300D\u6267\u884C\u3002",mergeNow:"\u5408\u5E76",delete:"\u5220\u9664",captureAlert:"\u81EA\u52A8\u6C89\u6DC0\u5F02\u5E38",captureAlertHint:"\u6253\u5F00\u5DE6\u680F\u300C\u7528\u91CF/\u4ECA\u65E5\u300D\u770B\u81EA\u52A8\u6C89\u6DC0\u65E5\u5FD7\uFF1B\u82E5\u662F\u63A5\u53E3/\u7248\u672C\u4E0D\u5339\u914D\uFF0C\u9700\u66F4\u65B0 memory-eternal \u63D2\u4EF6\u3002",captureLog:"\u81EA\u52A8\u6C89\u6DC0\u65E5\u5FD7",captureLogHint:"\u6BCF\u8F6E\u5BF9\u8BDD\u7ED3\u675F\u540E\u81EA\u52A8\u8DD1\uFF1A\u76D1\u542C \u2192 \u5224\u5B9A \u2192 \u5199\u5361\u3002\u8FD9\u91CC\u663E\u793A\u6700\u8FD1 100 \u6761\uFF0C\u7528\u6765\u6392\u67E5\u300C\u4E3A\u4EC0\u4E48\u6CA1\u5199\u5361\u300D\u3002",captureLogEmpty:"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002\u8DDF Agent \u804A\u4E00\u8F6E\uFF08> \u6355\u83B7\u6700\u5C0F\u957F\u5EA6\uFF09\u540E\u518D\u56DE\u6765\u770B\u3002",alignTitle:"\u7248\u672C\u5BF9\u9F50\u68C0\u67E5",alignRun:"\u5F00\u59CB\u68C0\u67E5",alignFix:"\u91CD\u5199\u63A5\u7EBF",alignFixConfirm:"\u91CD\u5199 MCP / hooks \u63A5\u7EBF\uFF1F\uFF08\u53EA\u78B0\u63D2\u4EF6\u81EA\u5DF1\u7684\u952E\uFF0C\u4E0D\u52A8\u4F60\u7684\u6570\u636E\u4E0E\u914D\u7F6E\uFF09",alignFixed:"\u63A5\u7EBF\u5DF2\u91CD\u5199\uFF1B\u82E5\u4E0A\u9762\u63D0\u793A\u300C\u5BBF\u4E3B\u8FDB\u7A0B\u65E7\u300D\uFF0C\u4ECD\u9700\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u5F00 DSH",alignFail:"\u5BF9\u9F50\u68C0\u67E5\u5931\u8D25",alignHint:"\u63D2\u4EF6\u5347\u7EA7\u53EA\u6362\u78C1\u76D8\u6587\u4EF6 \u2014\u2014 \u5BBF\u4E3B\u5185\u5B58\u91CC\u7684\u4E8B\u4EF6\u8BA2\u9605\u4E0E MCP / hooks \u91CC\u7684\u65E7\u8DEF\u5F84\u4E0D\u4F1A\u81EA\u5DF1\u66F4\u65B0\uFF0C\u8FD9\u91CC\u4E00\u6B21\u67E5\u6E05",alignIdle:"\u70B9\u300C\u5F00\u59CB\u68C0\u67E5\u300D\uFF1A\u5BF9\u6BD4\u5BBF\u4E3B / \u5E38\u9A7B\u5B9E\u4F8B / npm \u7684\u7248\u672C\uFF0C\u5E76\u68C0\u67E5 MCP\u3001hooks \u91CC\u662F\u5426\u6709\u65E7\u8DEF\u5F84\u4E0E\u65E7\u53C2\u6570",alignDisk:"\u78C1\u76D8",alignResident:"\u5E38\u9A7B\u5B9E\u4F8B",alignHost:"\u5BBF\u4E3B\u8FDB\u7A0B",captureLogUnavailable:"\u65E5\u5FD7\u4EC5\u5728 DSH \u5BBF\u4E3B\u5185\u53EF\u7528\uFF08\u72EC\u7ACB Web \u9875\u6CA1\u6709 host \u8FD0\u884C\u65F6\uFF09\u3002",captureAgentCards:"Agent \u81EA\u52A8\u6C89\u6DC0\u7684\u5361",noCards:"\u6682\u65E0",loadMore:"\u52A0\u8F7D\u66F4\u591A",batchMerge:"\u4E00\u952E\u667A\u80FD\u5408\u5E76",mergeAllConfirm:"\u5C06\u6309\u76F8\u4F3C\u5EA6\u5206\u7EC4\u7684\u5361\u7247\u5404\u5408\u5E76\u4E3A\u4E00\u5F20\uFF08\u4FDD\u7559\u5404\u81EA kind\uFF09\uFF0C\u539F\u5361\u5220\u9664\uFF1F",crossVault:"\u8DE8\u5E93\u805A\u5408",deleteConfirm:"\u786E\u5B9A\u5220\u9664\u8BE5\u8BB0\u5FC6\u5361\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",deleted:"\u5DF2\u5220\u9664",deleteFail:"\u5220\u9664\u5931\u8D25",deleteSelected:"\u5220\u9664\u9009\u4E2D",deletedSelected:"\u5F20\u5361\u5DF2\u5220\u9664",merge:"\u5408\u5E76",mergeNeed:"\u81F3\u5C11\u9009 2 \u5F20\u5361",mergeConfirm:"\u5C06\u6240\u9009\u5361\u7247\u5408\u5E76\u4E3A\u4E00\u5F20\u5E76\u5220\u9664\u539F\u5361\uFF1F",merged:"\u5DF2\u5408\u5E76",mergeFail:"\u5408\u5E76\u5931\u8D25",mcpInstalled:"\u2705 {agent} MCP \u5DF2\u5B89\u88C5",mcpUninstalled:"\u2705 {agent} MCP \u5DF2\u5378\u8F7D",mcpActionFail:"\u274C {agent} MCP \u64CD\u4F5C\u5931\u8D25\uFF1A{error}",dshHostLabel:"DeepSeek Harness\uFF08\u5F53\u524D\u5BBF\u4E3B\uFF09",restartHint:"\u5DF2\u4FDD\u5B58\u3002autoWebMode/watchdogAutoSpawn \u7B49\u9700\u91CD\u542F DSH \u751F\u6548\uFF1B\u5DF2\u6709\u5E38\u9A7B watchdog \u4E0D\u4F1A\u88AB\u81EA\u52A8\u505C\u6389\uFF0C\u9700 dsh-memory stop / restart\uFF08#19\uFF09",conflictRefresh:"\u914D\u7F6E\u5DF2\u88AB\u5916\u90E8\u4FEE\u6539\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5",untitled:"\u65E0\u6807\u9898",tplBlank:"\u{1F4C4} \u7A7A\u767D",tagsHint:"\u6807\u7B7E\uFF08\u9017\u53F7\u5206\u9694\uFF09",connCount:"{n} \u8FDE\u63A5",tplDecisionTags:"\u51B3\u7B56, \u65B9\u6848",tplBugTags:"\u8E29\u5751, \u6559\u8BAD",tplMeetingTags:"\u4F1A\u8BAE, \u7EAA\u8981",tplWeeklyTags:"\u5468\u62A5",tplDecisionBody:`# \u6280\u672F\u51B3\u7B56\uFF1A[\u6807\u9898]
|
|
14
|
+
`)}var zt="https://github.com/EternalNight996/memory-eternal",ya=["\u6211\u5728\u4F7F\u7528 memory-eternal\uFF08DeepSeek Harness \u7684\u8BB0\u5FC6\u63D2\u4EF6\uFF09\u65F6\u9047\u5230\u4E86\u95EE\u9898\uFF0C\u8BF7\u4F60\u5E2E\u6211\u628A\u8FD9\u4E2A\u95EE\u9898\u63D0\u4EA4\u5230 GitHub\u3002","","\u4ED3\u5E93\uFF1A"+zt,"","\u8BF7\u6309\u8FD9\u4E2A\u6D41\u7A0B\u505A\uFF1A","","1. \u5148\u8DD1 `gh issue list --repo EternalNight996/memory-eternal --state open --limit 50`\uFF0C\u770B\u662F\u5426\u5DF2\u6709\u76F8\u540C\u95EE\u9898\uFF1A"," - \u5DF2\u6709 \u2192 \u7528 `gh issue comment <\u7F16\u53F7> --body-file <\u6587\u4EF6>` \u8865\u5145\u73B0\u8C61\uFF0C\u4E0D\u8981\u91CD\u590D\u5F00\u65B0 issue\uFF1B"," - \u6CA1\u6709 \u2192 \u7EE7\u7EED\u7B2C 2 \u6B65\u3002",'2. \u628A\u6B63\u6587\u5199\u6210\u6587\u4EF6\uFF0C\u7136\u540E `gh issue create --repo EternalNight996/memory-eternal --title "[Bug] <\u4E00\u53E5\u8BDD\u6982\u62EC>" --body-file <\u6587\u4EF6>`\uFF1B\u6B63\u6587\u7528\u8FD9\u4E2A\u7ED3\u6784\uFF1A'," \u73B0\u8C61 / \u590D\u73B0\u6B65\u9AA4 / \u671F\u671B\u884C\u4E3A / \u5B9E\u9645\u884C\u4E3A / \u73AF\u5883\uFF08\u63D2\u4EF6\u7248\u672C / DSH \u7248\u672C / \u64CD\u4F5C\u7CFB\u7EDF / Node\uFF09/ \u8BCA\u65AD\u4FE1\u606F\u3002","3. \u5982\u679C `gh` \u6CA1\u767B\u5F55\u6216\u4E0D\u53EF\u7528\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u63D0\u4EA4\uFF0C\u6539\u4E3A\u8F93\u51FA\u4E00\u6761\u300C\u6807\u9898\u4E0E\u6B63\u6587\u90FD\u5DF2\u9884\u586B\u300D\u7684 GitHub \u65B0\u5EFA issue \u94FE\u63A5\u7ED9\u6211\uFF0C\u6211\u81EA\u5DF1\u70B9\u63D0\u4EA4\u3002","4. \u63D0\u4EA4\u6210\u529F\u540E\uFF0C\u628A issue \u94FE\u63A5\u53D1\u7ED9\u6211\u3002","","\u6CE8\u610F\uFF1A\u6211\u7684\u95EE\u9898\u63CF\u8FF0\u8BF7\u539F\u6837\u7167\u5F55\uFF0C\u4E0D\u8981\u66FF\u6211\u7F8E\u5316\u6216\u7701\u7565\u7EC6\u8282\uFF1B\u8BCA\u65AD\u4FE1\u606F\u539F\u6837\u653E\u8FDB\u300C\u8BCA\u65AD\u4FE1\u606F\u300D\u4E00\u8282\u3002","","\u6211\u7684\u95EE\u9898\u63CF\u8FF0\uFF1A","<\u5728\u8FD9\u91CC\u5199\u4F60\u7684\u95EE\u9898>","","\u8BCA\u65AD\u4FE1\u606F\uFF1A","<\u628A\u300C\u53CD\u9988\u5F02\u5E38\u300D\u5F39\u7A97\u91CC\u590D\u5236\u7684\u8BCA\u65AD\u4FE1\u606F\u7C98\u5230\u8FD9\u91CC>"].join(`
|
|
15
|
+
`),ha=["I hit a problem while using memory-eternal (a DeepSeek Harness memory plugin). Please file it on GitHub for me.","","Repo: "+zt,"","Workflow:","","1. Run `gh issue list --repo EternalNight996/memory-eternal --state open --limit 50` first: if a matching issue exists, add a comment with `gh issue comment <n> --body-file <file>` instead of opening a duplicate.",'2. Otherwise create it with `gh issue create --repo EternalNight996/memory-eternal --title "[Bug] <one-line summary>" --body-file <file>`, using sections: Symptoms / Steps to reproduce / Expected / Actual / Environment (plugin, DSH, OS, Node) / Diagnostics.',"3. If `gh` is not authenticated or unavailable, do NOT try to submit: output a GitHub new-issue link with the title and body pre-filled instead, and I will click submit myself.","4. Report the resulting issue URL back to me.","","Keep my description verbatim - do not rewrite or summarise it. Put the diagnostics under the Diagnostics section as-is.","","My description:","<write your problem here>","","Diagnostics:","<paste the diagnostics copied from the in-app Report-a-bug dialog>"].join(`
|
|
16
|
+
`);function $t(t={}){let o=t.lang==="en"?"en":"zh",l=o==="en"?ha:ya,f=t.repo||"EternalNight996/memory-eternal";return l=l.split(zt).join("https://github.com/"+f),t.description&&(l=l.replace(o==="en"?"<write your problem here>":"<\u5728\u8FD9\u91CC\u5199\u4F60\u7684\u95EE\u9898>",String(t.description).trim())),t.diagnostics&&(l=l.replace(o==="en"?"<paste the diagnostics copied from the in-app Report-a-bug dialog>":"<\u628A\u300C\u53CD\u9988\u5F02\u5E38\u300D\u5F39\u7A97\u91CC\u590D\u5236\u7684\u8BCA\u65AD\u4FE1\u606F\u7C98\u5230\u8FD9\u91CC>",String(t.diagnostics).trim())),l}function _t({panX:t=0,panY:o=0,zoom:l=1,w:f=0,h:c=0,margin:i=60}={}){let w=l||1;return{x0:(0-t)/w-i,y0:(0-o)/w-i,x1:(f-t)/w+i,y1:(c-o)/w+i}}function Nt(t,o,l,f){return f?t+l>=f.x0&&t-l<=f.x1&&o+l>=f.y0&&o-l<=f.y1:!0}function Ut(t){let o=Number(t)||0;return o<=120?1/0:o<=300?160:o<=600?90:60}function Kt(t,o={}){let l=Number.isFinite(o.limit)?o.limit:1/0,f=new Set,c=k=>{k&&f.size<l&&f.add(k)};if(c(o.focusId),c(o.hoverId),o.searchHits)for(let k of o.searchHits){if(f.size>=l)break;f.add(k)}let i=o.degree||{},w=k=>Number(i[k])||0,D=[];for(let k of Array.isArray(t)?t:[])k&&k.id&&!f.has(k.id)&&D.push(k);D.sort((k,H)=>w(H.id)-w(k.id));for(let k of D){if(f.size>=l)break;f.add(k.id)}return f}function va(t,o){if(t===o)return!0;if(t===null||o===null||t===void 0||o===void 0||typeof t!="object"&&typeof o!="object")return t===o;try{return JSON.stringify(t)===JSON.stringify(o)}catch{return!1}}function qt(t,o){let l={...t||{}},f={};for(let[c,i]of Object.entries(o||{}))va(t?t[c]:void 0,i)||(l[c]=i,f[c]=i);return{values:l,overlay:f}}var e=require("react/jsx-runtime"),rt="memory-eternal",O="/memory-eternal/api",xa=100,ka=["slots","locale"],Jt={nav:"\u8BB0\u5FC6",loading:"\u52A0\u8F7D\u4E2D\u2026",refresh:"\u5237\u65B0",overview:"\u8BB0\u5FC6\u5E93\u6982\u89C8",total:"\u77E5\u8BC6\u5361",recent:"\u8FD1 7 \u5929\u65B0\u589E",tags:"\u6807\u7B7E",searchPlaceholder:"\u641C\u7D22\u8BB0\u5FC6\uFF08\u652F\u6301\u4E2D\u6587\u7247\u6BB5\uFF09\u2026",search:"\u641C\u7D22",all:"\u5168\u90E8",kindProject:"\u9879\u76EE",kindKnowledge:"\u77E5\u8BC6",kindContent:"\u5185\u5BB9",kindPrompt:"\u63D0\u793A\u8BCD",kindBusiness:"\u4E1A\u52A1",kindTool:"\u5DE5\u5177",kindMistake:"\u6559\u8BAD",cardsTab:"\u77E5\u8BC6\u5361",graphTab:"\u77E5\u8BC6\u56FE\u8C31",graph:"\u77E5\u8BC6\u56FE\u8C31",graphHint:"\u8282\u70B9=\u77E5\u8BC6\u5361\uFF1B\u8FDE\u7EBF=[[\u94FE\u63A5]] \u6216\u5171\u4EAB\u6807\u7B7E\u3002\u70B9\u51FB\u8282\u70B9\u9605\u8BFB\u5361\u7247\u3002",graphTip:"\u5DE6\u952E\u51F8\u663E \xB7 Shift+\u62D6\u62FD\u6846\u9009 \xB7 \u53F3\u952E\u83DC\u5355 \xB7 \u6EDA\u8F6E\u7F29\u653E \xB7 \u62D6\u62FD\u5E73\u79FB",rebuild:"\u91CD\u5EFA",reset:"\u91CD\u7F6E",expandAll:"\u5168\u90E8\u5C55\u5F00",capped:"\u5DF2\u5C55\u793A\u6700\u6838\u5FC3\u7684",clearFocus:"\u53D6\u6D88\u9AD8\u4EAE",empty:"\u8BB0\u5FC6\u5E93\u8FD8\u662F\u7A7A\u7684\u3002\u591A\u804A\u51E0\u8F6E\u540E\uFF0C\u503C\u5F97\u4FDD\u5B58\u7684\u5185\u5BB9\u4F1A\u81EA\u52A8\u6C89\u6DC0\u6210\u77E5\u8BC6\u5361\u3002",emptyGraph:"\u56FE\u8C31\u6682\u65E0\u6570\u636E\u3002",open:"\u9605\u8BFB",updated:"\u66F4\u65B0\u4E8E",created:"\u521B\u5EFA\u4E8E",source:"\u6765\u6E90",close:"\u5173\u95ED",vaultDir:"\u8BB0\u5FC6\u5E93\u76EE\u5F55",capture:"\u81EA\u52A8\u6C89\u6DC0",recall:"\u81EA\u52A8\u53EC\u56DE",enabled:"\u5DF2\u542F\u7528",disabled:"\u5DF2\u7981\u7528",error:"\u52A0\u8F7D\u5931\u8D25",back:"\u8FD4\u56DE\u5217\u8868",cardCount:"\u5F20\u5361",nodes:"\u8282\u70B9",edges:"\u8FDE\u7EBF",memoryTitle:"\u8BB0\u5FC6\u5E93",memoryHint:"\u4F60\u7684\u672C\u5730\u7B2C\u4E8C\u5927\u8111",zoomIn:"\u653E\u5927",zoomOut:"\u7F29\u5C0F",fit:"\u9002\u5E94",enterFullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",exportGraph:"\u5BFC\u51FA",openCard:"\u6253\u5F00\u5361\u7247",focusNeighbors:"\u51F8\u663E\u5173\u8054",copyName:"\u590D\u5236\u540D\u79F0",noMatch:"\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6",clearFilter:"\u6E05\u9664\u8FC7\u6EE4",filterLabel:"\u7B5B\u9009",sortRecent:"\u6700\u8FD1",sortTitle:"\u6807\u9898",sortHot:"\u70ED\u70B9",exportSel:"\u5BFC\u51FA\u9009\u4E2D",clearSelection:"\u6E05\u7A7A\u9009\u62E9",download:"\u4E0B\u8F7D",openNewTab:"\u65B0\u6807\u7B7E\u6253\u5F00",copyImage:"\u590D\u5236\u56FE\u7247",done:"\u5B8C\u6210",downloaded:"\u5DF2\u5F00\u59CB\u4E0B\u8F7D",openedTab:"\u5DF2\u5728\u65B0\u6807\u7B7E\u6253\u5F00",copied:"\u5DF2\u590D\u5236",exportedSel:"\u4E2A\u8282\u70B9\u5DF2\u5BFC\u51FA",fullscreen:"\u5168\u5C4F",exitFull:"\u9000\u51FA\u5168\u5C4F",copyFail:"\u590D\u5236\u5931\u8D25",timeDim:"\u65F6\u95F4\u7EF4",timeNew:"3 \u5929\u5185",timeRecent:"2 \u5468\u5185",timeMonth:"1 \u6708\u5185",timeOld:"\u66F4\u65E9",newBadge:"\u65B0",expand:"\u5C55\u5F00\u5168\u90E8",collapse:"\u6536\u8D77",exportVault:"\u5BFC\u51FAMD",exportJson:"\u5BFC\u51FAJSON",exporting:"\u5BFC\u51FA\u4E2D\u2026",exportedVault:"\u8BB0\u5FC6\u5E93\u5DF2\u5BFC\u51FA",exportFail:"\u5BFC\u51FA\u5931\u8D25",importVault:"\u5BFC\u5165",importedVault:"\u5BFC\u5165\u5B8C\u6210",importedTotal:" \u5F20 / \u6587\u4EF6\u5171 ",importedTotalTail:" \u5F20",importedQuarantine:" \xB7 \u5F85\u5BA1\u6838 ",importedQuarantineTail:" \u5F20\uFF08\u9694\u79BB\u533A\uFF0C\u6279\u51C6\u540E\u624D\u53C2\u4E0E\u53EC\u56DE\uFF09",importedSkipped:" \xB7 \u8DF3\u8FC7 ",importedSkippedTail:" \u5F20\uFF08\u91CD\u590D\u6216\u7A7A\uFF09",importFail:"\u5BFC\u5165\u5931\u8D25",location:"\u81EA\u9009\u4F4D\u7F6E",saveAs:"\u53E6\u5B58\u4E3A",saveAsUnsupported:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u9009\u62E9\u4FDD\u5B58\u4F4D\u7F6E",exportedTo:"\u5DF2\u5BFC\u51FA\u5230",defaultDownloads:"\u9ED8\u8BA4\u4E0B\u8F7D\u6587\u4EF6\u5939",exportCancel:"\u5DF2\u53D6\u6D88\u5BFC\u51FA",manage:"\u7BA1\u7406",tabUsage:"\u7528\u91CF/\u4ECA\u65E5",tabOptimize:"\u6574\u7406\u5EFA\u8BAE",adminLoadFail:"\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1A\u8BF7\u5F7B\u5E95\u91CD\u542F dsh-desktop\uFF08host \u9700\u52A0\u8F7D\u65B0\u7248 /memory-eternal \u8DEF\u7531\uFF09",retry:"\u91CD\u8BD5",mergeSimilar:"\u4E00\u952E\u5408\u5E76\u76F8\u4F3C",trendLabel:"\u8FD1 30 \u5929\u8D8B\u52BF",cleanStale:"\u{1F5D1}\uFE0F \u4E00\u952E\u6E05\u7406\u9648\u65E7",deletedStale:"\u4E2A\u9648\u65E7\u5361\u5DF2\u6E05\u7406",newCard:"\u65B0\u5EFA",tplDecision:"\u{1F4DD} \u6280\u672F\u51B3\u7B56",tplBug:"\u{1F41B} \u8E29\u5751",tplMeeting:"\u{1F4CB} \u4F1A\u8BAE\u7EAA\u8981",tplWeekly:"\u{1F4CA} \u5468\u62A5",createCard:"\u521B\u5EFA",cardTitle:"\u6807\u9898",cardBody:"\u6B63\u6587",fbUseful:"\u6709\u7528",fbIrr:"\u65E0\u5173",todayAdd:"\u4ECA\u65E5\u65B0\u589E",weekAdd:"\u8FD1 7 \u5929",byKind:"\u5206\u7C7B\u7EDF\u8BA1",todayList:"\u4ECA\u65E5\u6C89\u6DC0",budgetLabel:"\u4F1A\u8BDD\u9884\u7B97",budgetChars:"\u9884\u7B97\u5B57\u7B26",recallLimitLabel:"\u53EC\u56DE\u6761\u6570",embeddingLabel:"\u8BED\u4E49\u53EC\u56DE",mergePairs:"\u76F8\u4F3C\u5361\u5BF9\uFF08\u53EF\u5408\u5E76\uFF09",staleCards:"\u9648\u65E7\u5361\uFF08>90 \u5929\u672A\u66F4\u65B0\uFF09",noOptimize:"\u6682\u65E0\u53EF\u6574\u7406\u9879\uFF0C\u5F88\u5065\u5EB7 \u{1F389}",refineTitle:"\u77DB\u76FE\u626B\u63CF",refineScan:"\u5F00\u59CB\u626B\u63CF",refineHint:"\u76F8\u4F3C\u53EF\u4EE5\u5408\u5E76\uFF0C\u77DB\u76FE\u5FC5\u987B\u4EBA\u5224\u65AD \u2014\u2014 \u626B\u63CF\u53EA\u8BFB\uFF0C\u9009\u62E9\u540E\u624D\u52A8\u6570\u636E\uFF08\u4FDD\u7559\u4E00\u5F20\u4F1A\u628A\u53E6\u4E00\u5F20\u653E\u8FDB\u56DE\u6536\u7AD9\uFF0C\u53EF\u8FD8\u539F\uFF09",refineIdle:"\u70B9\u300C\u5F00\u59CB\u626B\u63CF\u300D\uFF1A\u5148\u5BBD\u53EC\u56DE\u53EF\u80FD\u6709\u5173\u7CFB\u7684\u5361\u7247\u5BF9\uFF0C\u518D\u8BA9\u6A21\u578B\u5224\u65AD\u662F\u91CD\u590D / \u8865\u5145 / \u77DB\u76FE / \u65E0\u5173",refineNone:"\u8FD9\u4E00\u8F6E\u6CA1\u6709\u53D1\u73B0\u9700\u8981\u4F60\u88C1\u51B3\u7684\u5361\u7247\u5BF9 \u{1F389}",refineFail:"\u77DB\u76FE\u626B\u63CF\u5931\u8D25",refineApplied:"\u5DF2\u8BB0\u5F55\u4F60\u7684\u88C1\u51B3\uFF08\u4E0D\u4F1A\u91CD\u590D\u6253\u6270\uFF09",refineRel_duplicate:"\u91CD\u590D\uFF08\u53EF\u5408\u5E76\uFF09",refineRel_complement:"\u8865\u5145\uFF08\u90FD\u7559\u7740\uFF09",refineRel_conflict:"\u77DB\u76FE\uFF08\u9700\u4F60\u88C1\u51B3\uFF09",refineRel_unrelated:"\u65E0\u5173",refineKeepA:"\u4FDD\u7559 A",refineKeepB:"\u4FDD\u7559 B",refineKeepBoth:"\u90FD\u4FDD\u7559",refineMerge:"\u5408\u5E76",junkTitle:"\u6CE8\u5165\u5783\u573E\u5361",junkScan:"\u626B\u63CF\u5B58\u91CF",junkHint:"\u6000\u7591\u662F\u8FD0\u884C\u65F6\u6CE8\u5165\u6587\u672C\uFF08\u6280\u80FD\u76EE\u5F55 / system-reminder\uFF09\u6C89\u6DC0\u6210\u7684\u5361 \u2014\u2014 \u626B\u63CF\u53EA\u8BFB\uFF0C\u56DE\u6536\u8D70\u56DE\u6536\u7AD9\u53EF\u8FD8\u539F",junkIdle:"\u70B9\u300C\u626B\u63CF\u5B58\u91CF\u300D\uFF1A\u627E\u51FA\u6B63\u6587\u5176\u5B9E\u662F\u88AB\u6CE8\u5165\u7684\u8FD0\u884C\u65F6\u6587\u672C\u3001\u5265\u6389\u540E\u51E0\u4E4E\u4E0D\u5269\u4EBA\u8BDD\u7684\u5361",junkNone:"\u6CA1\u53D1\u73B0\u8FD9\u7C7B\u5361 \u{1F389}",junkRecycle:"\u56DE\u6536",junkRecycleAll:"\u5168\u90E8\u56DE\u6536",junkRecycleAllConfirm:"\u786E\u8BA4\u628A\u8FD9\u4E9B\u5361\u9001\u8FDB\u56DE\u6536\u7AD9\uFF1F\uFF08\u4E0D\u662F\u6C38\u4E45\u5220\u9664\uFF0C\u53EF\u5728\u56DE\u6536\u4E2D\u5FC3\u8FD8\u539F\uFF09",junkDone:"\u5DF2\u9001\u56DE\u6536\u7AD9",junkFail:"\u626B\u63CF / \u56DE\u6536\u5931\u8D25",dbReadonlyTitle:"\u8BB0\u5FC6\u5E93\u5F53\u524D\u4E0D\u53EF\u5199",dbReadonlyBody:"\u5361\u7247\u8BFB\u5199 / \u5BA1\u6838 / \u56FE\u8C31\u4F1A\u5931\u8D25\uFF0C\u4F46**\u914D\u7F6E\u4ECD\u53EF\u4FDD\u5B58**\uFF08\u914D\u7F6E\u4E0D\u7ECF\u8FC7\u6570\u636E\u5E93\uFF09",dbReadonlyFix:"\u6392\u67E5\uFF1Adsh-memory doctor\uFF08\u770B journal \u6A21\u5F0F\u3001\u5199\u63A2\u9488\u3001\u5907\u4EFD\u6E05\u5355\u4E0E\u6062\u590D\u6B65\u9AA4\uFF09",goalTitle:"\u540C\u76EE\u6807\u4E0D\u540C\u505A\u6CD5",goalScan:"\u626B\u63CF\u76EE\u6807",goalHint:"\u6309\u300C\u8FD9\u5F20\u5361\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898\u300D\u805A\u7C7B \u2014\u2014 \u6B63\u6587\u76F8\u4F3C\u5EA6\u6293\u4E0D\u5230\u7684\u505A\u6CD5\u5DEE\u5F02\uFF087z \u538B\u7F29 / tar \u5206\u53D1 / npm \u7626\u8EAB\uFF09\u4E5F\u80FD\u5F52\u5230\u4E00\u8D77",goalIdle:"\u70B9\u300C\u626B\u63CF\u76EE\u6807\u300D\uFF1A\u6A21\u578B\u5148\u7ED9\u6BCF\u5F20\u5361\u62BD\u4E00\u53E5\u76EE\u6807\uFF08\u9996\u6B21\u4F1A\u8C03\u6A21\u578B\uFF0C\u4E4B\u540E\u8D70\u7F13\u5B58\uFF09\uFF0C\u518D\u6309\u76EE\u6807\u805A\u7C7B",goalNone:"\u6CA1\u6709\u53D1\u73B0\u300C\u540C\u4E00\u76EE\u6807\u3001\u591A\u5F20\u5361\u300D\u7684\u7C07 \u{1F389}",goalStats:"\u5DF2\u7D22\u5F15 / \u672C\u6B21\u8C03\u7528",goalCards:"\u5F20\u5361",goalKeep:"\u90FD\u4FDD\u7559",goalMerge:"\u5408\u5E76\u8FD9\u4E00\u7EC4",goalMerged:"\u5DF2\u63D0\u4EA4\u5408\u5E76\uFF08\u65B0\u5361\u8FDB\u5BA1\u6838\u961F\u5217\uFF09",goalDone:"\u5DF2\u8BB0\u5F55\u300C\u90FD\u4FDD\u7559\u300D",goalFail:"\u76EE\u6807\u805A\u7C7B\u5931\u8D25",oneClickOptimize:"\u4E00\u952E\u4F18\u5316",oneClickOptimizeConfirm:"\u786E\u8BA4\u4E00\u952E\u4F18\u5316\uFF1F\u5C06\u5408\u5E76\u6240\u6709\u76F8\u4F3C\u5361\u5BF9\uFF08\u9ED8\u8BA4\u4E0D\u6E05\u7406\u9648\u65E7\u5361\uFF09\u3002",oneClickAlsoStale:"\u540C\u65F6\u6E05\u7406\u9648\u65E7\u5361",oneClickOptimizeDone:"\u4E00\u952E\u4F18\u5316\u5B8C\u6210",optimizedMerged:"\u5BF9\u5DF2\u5408\u5E76",optimizedStaleDeleted:"\u5F20\u9648\u65E7\u5361\u5DF2\u6E05\u7406",mcpSetupStatus:"Agent MCP \u6302\u8F7D\u72B6\u6001",rerunSetup:"\u8865\u5168 MCP",notInstalled:"\u672A\u5B89\u88C5",noMcpEntry:"\u914D\u7F6E\u7F3A\u5931",nodePathMismatch:"node \u8DEF\u5F84\u4E0D\u4E00\u81F4\uFF0C\u5EFA\u8BAE\u91CD\u8DD1 setup",nodePathNote:"node \u73AF\u5883\u4E0D\u540C\uFF08\u53EF\u7528\uFF09",healthy:"\u914D\u7F6E\u6B63\u5E38",mcpSetupHint:"\u300C\u81EA\u52A8\u6302\u8F7D MCP\u300D= \u8BA9 Claude Code / Codex / Cursor \u8FD9\u4E9B\u5DE5\u5177\u80FD\u8C03\u7528\u8BB0\u5FC6\u5E93\u3002\u5F00\u542F\u540E\u81EA\u52A8\u628A\u5B83\u4EEC\u914D\u7F6E\u597D\uFF1B\u5173\u6389\u5C31\u4E0D\u52A8\u4F60\u7535\u8111\u4E0A\u4EFB\u4F55\u914D\u7F6E\u6587\u4EF6\uFF0C\u9700\u8981\u65F6\u624B\u52A8\u8DD1 dsh-memory setup\u3002",mcpManageHint:"\u6BCF\u4E2A agent \u7528\u4E0B\u65B9\u6309\u94AE\u5355\u72EC\u5B89\u88C5/\u5378\u8F7D MCP",tabConfig:"\u8BB0\u5FC6\u914D\u7F6E",tabAudit:"\u5BA1\u6838\u4E2D\u5FC3",statusApproved:"\u5DF2\u5BA1\u6838",statusPending:"\u5F85\u5BA1\u6838",statusRejected:"\u5DF2\u9A73\u56DE",allStatus:"\u5168\u90E8\u72B6\u6001",tabRecycle:"\u56DE\u6536\u4E2D\u5FC3",pending:"\u5F85\u5BA1\u6838",rejected:"\u5DF2\u9A73\u56DE",selectAll:"\u5168\u9009",approve:"\u6279\u51C6",reject:"\u9A73\u56DE",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",noAuditItems:"\u6682\u65E0\u5BA1\u6838\u9879\u76EE",auditBodyFail:"\u6B63\u6587\u8BFB\u53D6\u5931\u8D25",deletedAt:"\u5220\u9664\u4E8E",restore:"\u6062\u590D",restoreDelete:"\u5220\u9664\u8FDB\u56DE\u6536\u7AD9",purge:"\u6C38\u4E45\u5220\u9664",emptyRecycle:"\u56DE\u6536\u7AD9\u4E3A\u7A7A",recycleHint:"\u5220\u9664\u7684\u5361\u7247\u5148\u8FDB\u56DE\u6536\u7AD9\uFF0C30 \u5929\u5185\u53EF\u6062\u590D\uFF0C\u8D85\u671F\u81EA\u52A8\u6C38\u4E45\u5220\u9664",purgeConfirm:"\u786E\u5B9A\u6C38\u4E45\u5220\u9664\uFF1F\u4E0D\u53EF\u6062\u590D\u3002",recycleDeleteConfirm:"\u786E\u5B9A\u5220\u9664\u8FDB\u56DE\u6536\u7AD9\uFF1F30 \u5929\u5185\u53EF\u6062\u590D\u3002",modeInit:"\u542F\u52A8\u65F6\u62C9\u4E00\u6B21",modeInterval:"\u5468\u671F\u4FDD\u6D3B",modeManual:"\u4EC5\u624B\u52A8",serviceConfig:"\u670D\u52A1\u81EA\u7BA1\u7406\u914D\u7F6E",auditConfig:"\u81EA\u52A8\u5BA1\u6838\u914D\u7F6E",auditHint:"\u547D\u4E2D\u514D\u5BA1\u7684\u65B0\u5361\u76F4\u63A5\u5165\u5E93\uFF0C\u5176\u4F59\u8FDB\u5F85\u5BA1\u6838",auditMode:"\u5BA1\u6838\u6A21\u5F0F",auditAll:"\u5168\u90E8\u8981\u5BA1\u6838",auditNone:"\u5168\u90E8\u514D\u5BA1",auditExemptAgents:"\u514D\u5BA1\u667A\u80FD\u4F53",auditExemptKinds:"\u514D\u5BA1\u7C7B\u578B",allExempt:"\u5168\u90E8\u514D\u5BA1",recycleDays:"\u56DE\u6536\u4FDD\u7559\u5929\u6570",editInSetting:"\u7F16\u8F91\u8BF7\u5230 DSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6",pendingSyncNote:"\u6B64\u9875\u662F\u72EC\u7ACB Web \u9875\uFF1A\u4FDD\u5B58\u540E\u7531 DSH \u5BBF\u4E3B\u5E94\u7528\uFF08\u65B0\u7248\u5BBF\u4E3B\u4F1A\u88AB\u76F4\u63A5\u53EB\u9192\u3001\u5728\u8BF7\u6C42\u4E0A\u4E0B\u6587\u91CC\u5E94\u7528\uFF0C\u70B9\u4FDD\u5B58\u5373\u751F\u6548\uFF09\uFF1B\u82E5\u672C\u673A\u6CA1\u6709 DSH \u5BBF\u4E3B\u5728\u8FD0\u884C\uFF0C\u5219\u76F4\u63A5\u5199\u5165\u5171\u4EAB\u914D\u7F6E\u3001\u7ACB\u5373\u751F\u6548\u3002\u53EA\u6709\u5728\u5BF9\u63A5\u65E7\u7248\u5BBF\u4E3B\u65F6\u624D\u4F1A\u9000\u56DE\u300C\u6392\u961F\u7B49\u5B83\u81EA\u5DF1\u540C\u6B65\u300D\uFF0C\u90A3\u65F6\u53EF\u5728 DSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u91CC\u6539\u540C\u4E00\u9879\u3002",readonlyTitle:"\u5F53\u524D\u9875\u9762\u53EA\u8BFB\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u914D\u7F6E",readonlyBody:"\u8FD9\u4E2A\u8FDB\u7A0B\u6CA1\u6709 DSH \u7684\u8BBE\u7F6E\u670D\u52A1\uFF08settings.update \u4E0D\u5B58\u5728\uFF09\uFF0C\u914D\u7F6E\u53EA\u80FD\u5728\u672C\u673A DSH \u91CC\u4FEE\u6539\uFF1A\u684C\u9762\u7248 \u2192 \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u3002",readonlyBtn:"\u53EA\u8BFB",setupRunInTerminal:"\u8BF7\u590D\u5236\u4EE5\u4E0B\u547D\u4EE4\u5230\u7EC8\u7AEF\u6267\u884C\uFF1A",dshMemoryConfig:"DSH \u8BB0\u5FC6\u914D\u7F6E",autoCapture:"\u81EA\u52A8\u6C89\u6DC0",autoRecall:"\u81EA\u52A8\u53EC\u56DE",captureMinChars:"\u6355\u83B7\u6700\u5C0F\u957F\u5EA6",maxCardsPerDay:"\u65E5\u914D\u989D",dedupThreshold:"\u53BB\u91CD\u9608\u503C",recallLimit:"\u53EC\u56DE\u6761\u6570",vaultMulti:"\u591A\u5E93\uFF08\u6309\u9879\u76EE\u9694\u79BB\uFF09",vaultMultiHint:"\u7559\u7A7A\u5373\u5355\u5E93\uFF0C\u8001\u914D\u7F6E\u4E0D\u53D7\u5F71\u54CD",vaultNow:"\u5F53\u524D\u751F\u6548",vaultSource:"\u6765\u6E90",vaultWorkspace:"\u5F53\u524D workspace",vaultNamePh:"\u5E93\u540D\uFF0C\u5982 work",vaultPathPh:"\u76EE\u5F55\uFF0C\u5982 D:/vaults/work",vaultMatchPh:"\u9879\u76EE\u76EE\u5F55\uFF08\u53EF\u9009\uFF0C\u6309 workspace \u81EA\u52A8\u9009\u5E93\uFF09",vaultAdd:"\u6DFB\u52A0\u4E00\u4E2A\u5E93",vaultActive:"\u6FC0\u6D3B\u5E93",vaultActiveNone:"\u9ED8\u8BA4\u5E93\uFF08\u4E0D\u6307\u5B9A\uFF09",vaultSrcEnv:"\u73AF\u5883\u53D8\u91CF MEMORY_VAULT_DIR",vaultSrcProfile:"\u6FC0\u6D3B\u5E93\u914D\u7F6E",vaultSrcWorkspace:"\u6309\u9879\u76EE\u76EE\u5F55\u81EA\u52A8\u547D\u4E2D",vaultSrcVaultDir:"\u5355\u5E93\u914D\u7F6E vaultDir",vaultSrcDefault:"\u9ED8\u8BA4\u76EE\u5F55",fbNav:"\u53CD\u9988\u5F02\u5E38",fbTitle:"\u53CD\u9988\u5F02\u5E38\uFF08\u63D0\u4EA4\u5230 GitHub\uFF09",fbDesc:"\u63CF\u8FF0\u4F60\u9047\u5230\u7684\u95EE\u9898\uFF08\u73B0\u8C61 / \u590D\u73B0\u6B65\u9AA4 / \u671F\u671B\u884C\u4E3A\uFF09",fbDiag:"\u8BCA\u65AD\u4FE1\u606F\uFF08\u5DF2\u81EA\u52A8\u8131\u654F\uFF1Ahome \u76EE\u5F55\u4E0E key/token \u5DF2\u66FF\u6362\uFF09",fbCopyDiag:"\u590D\u5236\u8BCA\u65AD\u4FE1\u606F",fbOpenIssue:"\u5728 GitHub \u63D0\u4EA4\uFF08\u5DF2\u9884\u586B\uFF09",fbCopyPrompt:"\u590D\u5236\u7ED9 AI \u7684\u63D0\u793A\u8BCD",fbCopiedDiag:"\u8BCA\u65AD\u4FE1\u606F\u5DF2\u590D\u5236",fbCopiedPrompt:"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\uFF0C\u7C98\u8FDB AI \u5BF9\u8BDD\u6846\u5373\u53EF",fbCopyFail:"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u4E2D\u590D\u5236",fbWhy:"GitHub \u4E0D\u5141\u8BB8\u533F\u540D\u521B\u5EFA issue\uFF0C\u63D2\u4EF6\u91CC\u4E5F\u4E0D\u5E94\u5185\u7F6E token\uFF1A\u6240\u4EE5\u8FD9\u91CC\u628A\u6807\u9898 / \u6B63\u6587 / \u8BCA\u65AD\u90FD\u9884\u586B\u597D\uFF0C\u4F60\u53EA\u9700\u518D\u70B9\u4E00\u6B21 Submit\u3002",fbNeedDesc:"\u8BF7\u5148\u63CF\u8FF0\u4F60\u9047\u5230\u7684\u95EE\u9898",fbLoading:"\u6B63\u5728\u6536\u96C6\u8BCA\u65AD\u4FE1\u606F\u2026",fbDiagFail:"\u8BCA\u65AD\u63A5\u53E3\u4E0D\u53EF\u7528\uFF08\u72EC\u7ACB web \u6216\u65E7\u7248\u5BBF\u4E3B\uFF09\uFF0C\u8BF7\u624B\u52A8\u8865\u5145\u73AF\u5883\u4FE1\u606F",fbOr:"\u6216\u8005",fbSelectAll:"\u5168\u9009",toastApproved:"\u5DF2\u6279\u51C6",toastRejected:"\u5DF2\u9A73\u56DE",toastCardDeleted:"\u5DF2\u5220\u9664",toastRestored:"\u5DF2\u6062\u590D",toastPurged:"\u5DF2\u5F7B\u5E95\u5220\u9664",toastPurgedExpired:"\u5DF2\u6E05\u7406\u8FC7\u671F\u56DE\u6536\u7AD9",toastFailed:"\u64CD\u4F5C\u5931\u8D25",noSelection:"\u8BF7\u5148\u9009\u62E9\u8981\u5904\u7406\u7684\u5361\u7247",enabledLabel:"\u542F\u7528\u8BB0\u5FC6\u6838\u5FC3",vaultDirLabel:"\u8BB0\u5FC6\u5E93\u76EE\u5F55\uFF08\u5355\u5E93\uFF09",captureCooldownMs:"\u6C89\u6DC0\u51B7\u5374 (ms)",captureProvider:"\u84B8\u998F provider\uFF08\u7559\u7A7A\u81EA\u52A8\uFF09",captureModel:"\u84B8\u998F model\uFF08\u7559\u7A7A\u81EA\u52A8\uFF09",recallEmbedding:"\u8BED\u4E49\u53EC\u56DE provider\uFF08\u53EF\u9009\uFF09",sessionBudgetChars:"\u4F1A\u8BDD\u9884\u7B97 (\u5B57\u7B26)",saving:"\u4FDD\u5B58\u4E2D\u2026",savePending:"\u5DF2\u5199\u5165\u914D\u7F6E\u6587\u4EF6\uFF1B\u5BBF\u4E3B\u4ECD\u662F\u65E7\u7248\uFF0C\u91CD\u542F DSH \u540E\u5373\u4EE5\u65B0\u503C\u4E3A\u51C6\uFF08\u672C\u9762\u677F\u5DF2\u751F\u6548\uFF09",actionRunning:"\u5904\u7406\u4E2D\u2026",recycleEmptyHint:"\u56DE\u6536\u7AD9\u4E3A\u7A7A\uFF1A\u5220\u6389\u7684\u5361\u7247\u4F1A\u5148\u653E\u5230\u8FD9\u91CC\uFF0C\u4FDD\u7559 {days} \u5929\u540E\u81EA\u52A8\u6E05\u7406\u3002",recyclePurgeAll:"\u6E05\u7A7A\u56DE\u6536\u7AD9",fbCopyManual:"\u81EA\u52A8\u590D\u5236\u88AB\u6D4F\u89C8\u5668\u62E6\u622A\uFF0C\u5DF2\u628A\u5185\u5BB9\u653E\u5728\u4E0B\u9762\uFF1A\u70B9\u300C\u5168\u9009\u300D\u518D\u6309 Ctrl+C",vcPage:"\u9875\u9762\u811A\u672C",vcPageStale:"\u26A0 \u5F53\u524D\u9875\u9762\u4ECD\u5728\u8FD0\u884C\u65E7\u7248\u811A\u672C\uFF08\u9875\u9762 v{page} / \u78C1\u76D8 v{disk}\uFF09\uFF1A\u6309 Ctrl+F5 \u5237\u65B0\u9875\u9762\u5373\u751F\u6548\uFF1B\u82E5\u300C\u8FD0\u884C\u4E2D\u300D\u4ECD\u662F\u65E7\u7248\u53F7\uFF0C\u5219\u8FD8\u9700\u91CD\u542F\u684C\u9762\u7248 / DSH",vcLoaded:"\u8FD0\u884C\u4E2D\uFF08\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\uFF09",vcResident:"\u5E38\u9A7B\u5B9E\u4F8B",vcOnDisk:"\u78C1\u76D8\u5B89\u88C5",vcLatest:"npm \u6700\u65B0",vcStale:"\u78C1\u76D8\u5DF2\u5B89\u88C5 v{disk}\uFF0C\u4F46\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\u4ECD\u52A0\u8F7D v{loaded} \u2014\u2014 \u70B9\u300C\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B\u300D\u5373\u53EF\u7528\u65B0\u4EE3\u7801\u91CD\u542F\u5B83\uFF08\u4E0D\u7528\u91CD\u542F DSH\uFF09",vcRestart:"\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B",vcRestarting:"\u91CD\u542F\u4E2D\u2026",vcRestartSent:"\u5DF2\u8C03\u5EA6\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B\uFF1A\u7EA6 3-8 \u79D2\u540E\u65B0\u8FDB\u7A0B\u63A5\u7BA1\uFF0C\u8BF7\u7A0D\u7B49\u518D\u5237\u65B0\u9875\u9762\uFF08Ctrl+F5\uFF09",vcRestartCurrent:"\u5E38\u9A7B\u5B9E\u4F8B\u5DF2\u7ECF\u662F\u6700\u65B0\u7248\uFF0C\u65E0\u9700\u91CD\u542F",vcRestartFail:"\u91CD\u542F\u8BF7\u6C42\u5931\u8D25",vcRestartNoRoute:"\u5F53\u524D\u9875\u9762\u5BF9\u63A5\u7684\u8FDB\u7A0B\u8FD8\u662F\u65E7\u7248\uFF08\u6CA1\u6709\u8FD9\u4E2A\u63A5\u53E3\uFF09\uFF1A\u8BF7\u91CD\u542F\u684C\u9762\u7248 / DSH \u540E\u518D\u8BD5\uFF0C\u6216\u6267\u884C {cmd}",vcHostStale:"\u4E0A\u65B9\u7684\u300C\u8FD0\u884C\u4E2D\u300D\u6765\u81EA\u670D\u52A1\u672C\u9875\u7684\u8FDB\u7A0B\uFF1B\u5E38\u9A7B\u5B9E\u4F8B\u5DF2\u662F\u65B0\u7248 \u2014\u2014 \u8981\u8BA9\u5B83\u4E5F\u53D8\u6210\u65B0\u7248\u53F7\uFF0C\u9700\u91CD\u542F\u684C\u9762\u7248 / DSH",vcResidentDownShort:"\u672A\u8FD0\u884C",vcResidentDown:"\u5E38\u9A7B\u5B9E\u4F8B\u6CA1\u5728\u8FD0\u884C\uFF08\u7AEF\u53E3 {port} \u65E0\u54CD\u5E94\uFF09\u2014\u2014 \u70B9\u4E0B\u9762\u7684\u6309\u94AE\u7528\u65B0\u4EE3\u7801\u628A\u5B83\u62C9\u8D77\u6765\uFF1B\u62C9\u4E0D\u8D77\u6765\u65F6\u6267\u884C {cmd}\uFF0C\u5E76\u8D34\u4E00\u4E0B dsh-memory status \u7684\u8F93\u51FA",vcResidentUnmanagedShort:"\u672A\u6258\u7BA1",vcResidentUnmanaged:"\u5E38\u9A7B\u5B9E\u4F8B\u5728\u670D\u52A1 v{served}\uFF0C\u4F46**\u6CA1\u6709\u770B\u95E8\u72D7\u4FDD\u6D3B**\uFF08\u505C\u6B62 / \u786C\u6740\u540E\u6B8B\u7559\u7684\u5B64\u513F\uFF09\u2014\u2014 \u70B9\u4E0B\u9762\u7684\u6309\u94AE\u628A\u5B83\u91CD\u65B0\u6258\u7BA1\uFF08\u91CD\u65B0\u62C9\u4E00\u4E2A\u770B\u95E8\u72D7 + \u65B0\u5B9E\u4F8B\uFF09\uFF1B\u4E5F\u53EF\u4EE5\u6267\u884C {cmd}",vcResidentLockUnknownShort:"\u6258\u7BA1\u72B6\u6001\u672A\u77E5",vcResidentLockUnknown:"\u5E38\u9A7B\u5B9E\u4F8B\u5728\u670D\u52A1 v{served}\uFF0C\u4F46**\u770B\u95E8\u72D7\u9501\u6587\u4EF6\u5199\u4E0D\u8FDB\u53BB**\uFF08\u53D7\u9650\u73AF\u5883\uFF1A\u6C99\u7BB1\u7981\u5199 / ACL / \u975E\u7CFB\u7EDF\u76D8\uFF09\u2192 \u65E0\u6CD5\u5224\u65AD\u5B83\u6709\u6CA1\u6709\u88AB\u6258\u7BA1\uFF08\u4E0D\u662F\u300C\u672A\u6258\u7BA1\u300D\uFF09\u3002\u539F\u56E0\uFF1A{err}\uFF08{path}\uFF09\u3002\u4FDD\u6D3B\u901A\u5E38\u4ECD\u7136\u6709\u6548\uFF1B\u70B9\u4E0B\u9762\u7684\u6309\u94AE\u53EF\u7528\u65B0\u4EE3\u7801\u91CD\u65B0\u6258\u7BA1\u4E00\u6B21\u3002",vcOutdated:"\u6709\u65B0\u7248\u672C",vcUpToDate:"\u5DF2\u662F\u6700\u65B0",vcCheck:"\u68C0\u67E5\u66F4\u65B0",checking:"\u68C0\u67E5\u4E2D\u2026",vcCheckFail:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25",recallSummaryLen:"\u53EC\u56DE\u6458\u8981\u957F\u5EA6",recallBody:"\u53EC\u56DE\u542B\u6B63\u6587",secretHint:"\u51ED\u8BC1\u53D6\u7528\u63D0\u793A\uFF08\u6CE8\u5165\u6BCF\u4E2A\u4F1A\u8BDD\uFF09",autoWeb:"Web server",autoWebMode:"\u4FDD\u6D3B\u6A21\u5F0F",webPort:"Web \u7AEF\u53E3",webCheckIntervalMs:"\u63A2\u6D3B\u95F4\u9694(ms)",webMaxRestart:"\u6700\u5927\u91CD\u542F\u6B21\u6570",watchdogAutoSpawn:"\u770B\u95E8\u72D7\u8FDB\u7A0B",autoRestartOnDrift:"\u7248\u672C\u6F02\u79FB\u81EA\u52A8\u91CD\u542F\u5E38\u9A7B\u5B9E\u4F8B",autoMcpSetup:"\u81EA\u52A8\u6302\u8F7D MCP",saveConfig:"\u4FDD\u5B58\u914D\u7F6E",saveFail:"\u4FDD\u5B58\u5931\u8D25",savedOk:"\u5DF2\u4FDD\u5B58",savedDirect:"\u672C\u673A\u6CA1\u6709 DSH \u5BBF\u4E3B\u5728\u8FD0\u884C\uFF0C\u5DF2\u76F4\u63A5\u5199\u5165\u5171\u4EAB\u914D\u7F6E\uFF08hooks / MCP / \u72EC\u7ACB\u9875\u7ACB\u5373\u751F\u6548\uFF09",savedApplied:"\u5DF2\u4FDD\u5B58\u5E76\u751F\u6548\uFF08\u5BBF\u4E3B\u5DF2\u5728\u8BF7\u6C42\u4E0A\u4E0B\u6587\u91CC\u5E94\u7528\uFF09",saveQueued:"\u5DF2\u4EA4\u7ED9 DSH \u5BBF\u4E3B\u540C\u6B65\uFF0C\u5C1A\u672A\u786E\u8BA4\u751F\u6548",saveHostGuard:"\u8BE5\u5BBF\u4E3B\u4E0D\u5141\u8BB8\u63D2\u4EF6\u4ECE\u81EA\u5DF1\u7684\u56DE\u8C03\u4E0A\u4E0B\u6587\u91CC\u5199\u914D\u7F6E\uFF1B\u8BF7\u5728\u300CDSH \u8BBE\u7F6E \u2192 \u8BB0\u5FC6\u300D\u91CC\u6539\u540C\u4E00\u9879\uFF0C\u6216\u7F16\u8F91 profile \u7684\u914D\u7F6E\u8865\u4E01\u5C42",saveFailHint:"\u5BBF\u4E3B\u4FA7\u672A\u5E94\u7528\uFF0C\u8BE6\u89C1\u300C\u53CD\u9988\u5F02\u5E38\u300D\u91CC\u7684\u8BCA\u65AD\u4FE1\u606F",recallTool:"recall \u5DE5\u5177",costControl:"\u6210\u672C\u63A7\u5236",costHint:"\u7701 token\u3001\u63A7 LLM \u6D88\u8017",distillEnabled:"\u84B8\u998F\u77E5\u8BC6\u5361(\u5F00=LLM \u538B\u7F29, \u5173=\u539F\u6587\u5361\u96F6 LLM)",dedupByLLM:"\u8BED\u4E49\u53BB\u91CD\u5582 LLM(\u5173=\u7EAF\u8BCD\u6CD5\u66F4\u7701)",captureMaxTokens:"\u84B8\u998F\u8F93\u51FA\u4E0A\u9650(token)",recallMinScore:"\u53EC\u56DE\u76F8\u5173\u6027\u9608\u503C(\u8D8A\u9AD8\u8D8A\u7701)",configNeedsDsh:"\u914D\u7F6E\u7F16\u8F91\u9700\u5728 DSH \u5185\u6253\u5F00\uFF08\u672C\u9875\u53EF\u80FD\u53EA\u8BFB\u6216\u6709\u90E8\u5206\u7F3A\u5931\uFF09",installMcp:"\u5B89\u88C5 MCP",uninstallMcp:"\u5378\u8F7D MCP",uninstallConfirm:"\u786E\u8BA4\u5378\u8F7D\u8BE5\u667A\u80FD\u4F53\u7684 MCP\uFF1FClaude Code/Codex \u5C06\u65E0\u6CD5\u518D\u8C03\u7528\u8BB0\u5FC6\u5E93\u3002",presetConfig:"\u4E00\u952E\u63A8\u8350\u914D\u7F6E",presetHint:"\u70B9\u51FB\u586B\u5145\u5BF9\u5E94\u65B9\u6848\uFF0C\u70B9\u4FDD\u5B58\u751F\u6548",planA:"A \u8F7B\u91CF\u7701\u5FC3",planB:"B \u6781\u81F4\u7701\u94B1",planC:"C \u9AD8\u8D28\u91CF",pluginInfo:"\u63D2\u4EF6\u4FE1\u606F",organizeTitle:"\u6574\u7406\u5EFA\u8BAE",scanAndOrganize:"\u4E00\u952E\u641C\u7D22\u548C\u6574\u7406",scanHint:"\u70B9\u300C\u{1F50D} \u4E00\u952E\u641C\u7D22\u548C\u6574\u7406\u300D\u626B\u63CF\u76F8\u4F3C\u5361/\u9648\u65E7\u5361\uFF0C\u518D\u7528\u300C\u26A1 \u4E00\u952E\u4F18\u5316\u300D\u6267\u884C\u3002",mergeNow:"\u5408\u5E76",delete:"\u5220\u9664",captureAlert:"\u81EA\u52A8\u6C89\u6DC0\u5F02\u5E38",captureAlertHint:"\u6253\u5F00\u5DE6\u680F\u300C\u7528\u91CF/\u4ECA\u65E5\u300D\u770B\u81EA\u52A8\u6C89\u6DC0\u65E5\u5FD7\uFF1B\u82E5\u662F\u63A5\u53E3/\u7248\u672C\u4E0D\u5339\u914D\uFF0C\u9700\u66F4\u65B0 memory-eternal \u63D2\u4EF6\u3002",captureLog:"\u81EA\u52A8\u6C89\u6DC0\u65E5\u5FD7",captureLogHint:"\u6BCF\u8F6E\u5BF9\u8BDD\u7ED3\u675F\u540E\u81EA\u52A8\u8DD1\uFF1A\u76D1\u542C \u2192 \u5224\u5B9A \u2192 \u5199\u5361\u3002\u8FD9\u91CC\u663E\u793A\u6700\u8FD1 100 \u6761\uFF0C\u7528\u6765\u6392\u67E5\u300C\u4E3A\u4EC0\u4E48\u6CA1\u5199\u5361\u300D\u3002",captureLogEmpty:"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002\u8DDF Agent \u804A\u4E00\u8F6E\uFF08> \u6355\u83B7\u6700\u5C0F\u957F\u5EA6\uFF09\u540E\u518D\u56DE\u6765\u770B\u3002",alignTitle:"\u7248\u672C\u5BF9\u9F50\u68C0\u67E5",alignRun:"\u5F00\u59CB\u68C0\u67E5",alignFix:"\u91CD\u5199\u63A5\u7EBF",alignFixConfirm:"\u91CD\u5199 MCP / hooks \u63A5\u7EBF\uFF1F\uFF08\u53EA\u78B0\u63D2\u4EF6\u81EA\u5DF1\u7684\u952E\uFF0C\u4E0D\u52A8\u4F60\u7684\u6570\u636E\u4E0E\u914D\u7F6E\uFF09",alignFixed:"\u63A5\u7EBF\u5DF2\u91CD\u5199\uFF1B\u82E5\u4E0A\u9762\u63D0\u793A\u300C\u5BBF\u4E3B\u8FDB\u7A0B\u65E7\u300D\uFF0C\u4ECD\u9700\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u5F00 DSH",alignFail:"\u5BF9\u9F50\u68C0\u67E5\u5931\u8D25",alignHint:"\u63D2\u4EF6\u5347\u7EA7\u53EA\u6362\u78C1\u76D8\u6587\u4EF6 \u2014\u2014 \u5BBF\u4E3B\u5185\u5B58\u91CC\u7684\u4E8B\u4EF6\u8BA2\u9605\u4E0E MCP / hooks \u91CC\u7684\u65E7\u8DEF\u5F84\u4E0D\u4F1A\u81EA\u5DF1\u66F4\u65B0\uFF0C\u8FD9\u91CC\u4E00\u6B21\u67E5\u6E05",alignIdle:"\u70B9\u300C\u5F00\u59CB\u68C0\u67E5\u300D\uFF1A\u5BF9\u6BD4\u5BBF\u4E3B / \u5E38\u9A7B\u5B9E\u4F8B / npm \u7684\u7248\u672C\uFF0C\u5E76\u68C0\u67E5 MCP\u3001hooks \u91CC\u662F\u5426\u6709\u65E7\u8DEF\u5F84\u4E0E\u65E7\u53C2\u6570",alignDisk:"\u78C1\u76D8",alignResident:"\u5E38\u9A7B\u5B9E\u4F8B",alignHost:"\u5BBF\u4E3B\u8FDB\u7A0B",captureLogUnavailable:"\u65E5\u5FD7\u4EC5\u5728 DSH \u5BBF\u4E3B\u5185\u53EF\u7528\uFF08\u72EC\u7ACB Web \u9875\u6CA1\u6709 host \u8FD0\u884C\u65F6\uFF09\u3002",captureAgentCards:"Agent \u81EA\u52A8\u6C89\u6DC0\u7684\u5361",noCards:"\u6682\u65E0",loadMore:"\u52A0\u8F7D\u66F4\u591A",batchMerge:"\u4E00\u952E\u667A\u80FD\u5408\u5E76",mergeAllConfirm:"\u5C06\u6309\u76F8\u4F3C\u5EA6\u5206\u7EC4\u7684\u5361\u7247\u5404\u5408\u5E76\u4E3A\u4E00\u5F20\uFF08\u4FDD\u7559\u5404\u81EA kind\uFF09\uFF0C\u539F\u5361\u5220\u9664\uFF1F",crossVault:"\u8DE8\u5E93\u805A\u5408",deleteConfirm:"\u786E\u5B9A\u5220\u9664\u8BE5\u8BB0\u5FC6\u5361\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",deleted:"\u5DF2\u5220\u9664",deleteFail:"\u5220\u9664\u5931\u8D25",deleteSelected:"\u5220\u9664\u9009\u4E2D",deletedSelected:"\u5F20\u5361\u5DF2\u5220\u9664",merge:"\u5408\u5E76",mergeNeed:"\u81F3\u5C11\u9009 2 \u5F20\u5361",mergeConfirm:"\u5C06\u6240\u9009\u5361\u7247\u5408\u5E76\u4E3A\u4E00\u5F20\u5E76\u5220\u9664\u539F\u5361\uFF1F",merged:"\u5DF2\u5408\u5E76",mergeFail:"\u5408\u5E76\u5931\u8D25",mcpInstalled:"\u2705 {agent} MCP \u5DF2\u5B89\u88C5",mcpUninstalled:"\u2705 {agent} MCP \u5DF2\u5378\u8F7D",mcpActionFail:"\u274C {agent} MCP \u64CD\u4F5C\u5931\u8D25\uFF1A{error}",dshHostLabel:"DeepSeek Harness\uFF08\u5F53\u524D\u5BBF\u4E3B\uFF09",restartHint:"\u5DF2\u4FDD\u5B58\u3002autoWebMode/watchdogAutoSpawn \u7B49\u9700\u91CD\u542F DSH \u751F\u6548\uFF1B\u5DF2\u6709\u5E38\u9A7B watchdog \u4E0D\u4F1A\u88AB\u81EA\u52A8\u505C\u6389\uFF0C\u9700 dsh-memory stop / restart\uFF08#19\uFF09",conflictRefresh:"\u914D\u7F6E\u5DF2\u88AB\u5916\u90E8\u4FEE\u6539\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5",untitled:"\u65E0\u6807\u9898",tplBlank:"\u{1F4C4} \u7A7A\u767D",tagsHint:"\u6807\u7B7E\uFF08\u9017\u53F7\u5206\u9694\uFF09",connCount:"{n} \u8FDE\u63A5",tplDecisionTags:"\u51B3\u7B56, \u65B9\u6848",tplBugTags:"\u8E29\u5751, \u6559\u8BAD",tplMeetingTags:"\u4F1A\u8BAE, \u7EAA\u8981",tplWeeklyTags:"\u5468\u62A5",tplDecisionBody:`# \u6280\u672F\u51B3\u7B56\uFF1A[\u6807\u9898]
|
|
17
17
|
|
|
18
18
|
## \u80CC\u666F
|
|
19
19
|
- \u95EE\u9898\u63CF\u8FF0
|
|
@@ -58,7 +58,7 @@ var aa=Object.create;var St=Object.defineProperty;var na=Object.getOwnPropertyDe
|
|
|
58
58
|
-
|
|
59
59
|
|
|
60
60
|
## \u98CE\u9669/\u963B\u585E
|
|
61
|
-
- `},Jt={nav:"Memory",loading:"Loading\u2026",refresh:"Refresh",overview:"Memory Overview",total:"Cards",recent:"Added (7d)",tags:"Tags",searchPlaceholder:"Search memory\u2026",search:"Search",all:"All",kindProject:"Projects",kindKnowledge:"Knowledge",kindContent:"Content",kindPrompt:"Prompts",kindBusiness:"Business",kindTool:"Tools",kindMistake:"Mistakes",cardsTab:"Cards",graphTab:"Graph",graph:"Knowledge Graph",graphHint:"Nodes = cards; edges = [[links]] or shared tags. Click a node to read.",graphTip:"Left-click highlights \xB7 Shift+drag box-select \xB7 right-click menu \xB7 scroll zoom \xB7 drag to pan",rebuild:"Rebuild",reset:"Reset",expandAll:"Expand all",capped:"Showing the",clearFocus:"Clear highlight",empty:"Memory is empty. After a few conversations, valuable content is auto-captured.",emptyGraph:"No graph data yet.",open:"Read",updated:"Updated",created:"Created",source:"Source",close:"Close",vaultDir:"Vault directory",capture:"Auto capture",recall:"Auto recall",enabled:"on",disabled:"off",error:"Load failed",back:"Back to list",cardCount:"cards",nodes:"nodes",edges:"edges",memoryTitle:"Memory Library",memoryHint:"Your local second brain",zoomIn:"Zoom in",zoomOut:"Zoom out",fit:"Fit",enterFullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",exportGraph:"Export",openCard:"Open card",focusNeighbors:"Highlight links",copyName:"Copy name",noMatch:"No matching memory",clearFilter:"Clear filter",filterLabel:"Filter",sortRecent:"Recent",sortTitle:"Title",sortHot:"Hot",exportSel:"Export selected",clearSelection:"Clear selection",download:"Download",openNewTab:"Open in new tab",copyImage:"Copy image",done:"Done",downloaded:"Download started",openedTab:"Opened in new tab",copied:"Copied",exportedSel:" nodes exported",fullscreen:"Fullscreen",exitFull:"Exit fullscreen",copyFail:"Copy failed",timeDim:"Time",timeNew:"\u22643 days",timeRecent:"\u22642 weeks",timeMonth:"\u22641 month",timeOld:"Older",newBadge:"NEW",expand:"Expand",collapse:"Collapse",exportVault:"Export MD",exportJson:"Export JSON",exporting:"Exporting\u2026",exportedVault:"Vault exported",exportFail:"Export failed",importVault:"Import",importedVault:"Import complete",importedTotal:" / of ",importedTotalTail:"",importedQuarantine:" \xB7 pending review ",importedQuarantineTail:" (quarantined until approved)",importedSkipped:" \xB7 skipped ",importedSkippedTail:" (duplicate or empty)",importFail:"Import failed",location:"Choose location",saveAs:"Save as",saveAsUnsupported:"Choose-save-location not supported here",exportedTo:"Exported to",defaultDownloads:"default Downloads folder",exportCancel:"Export cancelled",manage:"Manage",tabUsage:"Usage / Today",tabOptimize:"Optimize",adminLoadFail:"Load failed: fully restart dsh-desktop so the host picks up the new /memory-eternal routes",retry:"Retry",mergeSimilar:"Merge similar",trendLabel:"Last 30 days trend",cleanStale:"\u{1F5D1}\uFE0F Clean stale",deletedStale:" stale cards cleaned",newCard:"New",tplDecision:"\u{1F4DD} Decision",tplBug:"\u{1F41B} Bug",tplMeeting:"\u{1F4CB} Meeting",tplWeekly:"\u{1F4CA} Weekly",createCard:"Create",cardTitle:"Title",cardBody:"Body",fbUseful:"Useful",fbIrr:"Irrelevant",todayAdd:"Added today",weekAdd:"Last 7d",byKind:"By kind",todayList:"Captured today",budgetLabel:"Session budget",budgetChars:"Budget chars",recallLimitLabel:"Recall limit",embeddingLabel:"Semantic recall",mergePairs:"Similar pairs (mergeable)",staleCards:"Stale (>90d)",noOptimize:"Nothing to organize, healthy \u{1F389}",refineTitle:"Conflict scan",refineScan:"Scan now",refineHint:"Similar cards can be merged; conflicts must be judged by a human \u2014 the scan is read-only, and data only moves after you choose (keeping one moves the other to the recycle bin, recoverable)",refineIdle:'Hit "Scan now": recall possibly-related card pairs, then let the model classify each as duplicate / complement / conflict / unrelated',refineNone:"No card pairs need your ruling this round \u{1F389}",refineFail:"Conflict scan failed",refineApplied:"Your ruling was recorded (it will not ask again)",refineRel_duplicate:"Duplicate (mergeable)",refineRel_complement:"Complement (keep both)",refineRel_conflict:"Conflict (needs your ruling)",refineRel_unrelated:"Unrelated",refineKeepA:"Keep A",refineKeepB:"Keep B",refineKeepBoth:"Keep both",refineMerge:"Merge",junkTitle:"Injected junk cards",junkScan:"Scan existing",junkHint:"Cards suspected to be captured runtime injections (skill catalogs / system-reminders) \u2014 the scan is read-only and recycling goes to the recycle bin (recoverable)",junkIdle:'Hit "Scan existing": find cards whose body is really injected runtime text with almost no human content left after stripping',junkNone:"No such cards found \u{1F389}",junkRecycle:"Recycle",junkRecycleAll:"Recycle all",junkRecycleAllConfirm:"Send these cards to the recycle bin? (Not a permanent delete \u2014 recoverable from the recycle center)",junkDone:"Sent to recycle bin",junkFail:"Scan / recycle failed",dbReadonlyTitle:"The memory database is currently not writable",dbReadonlyBody:"Card reads/writes, auditing and the graph will fail, but **settings can still be saved** (they do not go through the database)",dbReadonlyFix:"Diagnose with: dsh-memory doctor (journal mode, write probe, backups and recovery steps)",goalTitle:"Same goal, different approach",goalScan:"Scan goals",goalHint:'Clusters by "what problem does this card solve" \u2014 approaches that differ in wording (7z vs tar vs npm slimming) still land together',goalIdle:'Hit "Scan goals": the model first writes a one-line goal per card (first run calls the model, later runs use the cache), then clusters by goal',goalNone:'No clusters of "one goal, several cards" found \u{1F389}',goalStats:"indexed / calls this run",goalCards:"cards",goalKeep:"Keep all",goalMerge:"Merge this group",goalMerged:"Merge submitted (the new card goes to the audit queue)",goalDone:'Recorded as "keep all"',goalFail:"Goal clustering failed",oneClickOptimize:"One-click optimize",oneClickOptimizeConfirm:"Confirm one-click optimize? This will merge all similar pairs (stale cards are NOT deleted by default).",oneClickAlsoStale:"Also clean stale cards",oneClickOptimizeDone:"One-click optimize done",optimizedMerged:"pairs merged",optimizedStaleDeleted:"stale cards cleaned",mcpSetupStatus:"Agent MCP mount status",rerunSetup:"Re-run setup",notInstalled:"not installed",noMcpEntry:"no MCP entry",nodePathMismatch:"node path mismatch, consider re-running setup",nodePathNote:"different node env (usable)",healthy:"healthy",mcpSetupHint:'"Auto-mount MCP" = lets Claude Code / Codex / Cursor use the memory vault. On = auto-configures them; Off = never touches your machine config, run dsh-memory setup manually when needed.',mcpManageHint:"Use each agent row to install/uninstall MCP individually",tabConfig:"Memory Config",tabAudit:"Audit Center",statusApproved:"Approved",statusPending:"Pending",statusRejected:"Rejected",allStatus:"All statuses",tabRecycle:"Recycle Bin",pending:"Pending",rejected:"Rejected",selectAll:"Select all",approve:"Approve",reject:"Reject",allAgents:"All agents",noAuditItems:"No items to review",auditBodyFail:"Failed to load the card body",deletedAt:"deleted",restore:"Restore",restoreDelete:"Delete to recycle",purge:"Purge",emptyRecycle:"Recycle bin is empty",recycleHint:"Deleted cards go to the recycle bin \u2014 recover within 30 days, else auto-purged",purgeConfirm:"Permanently delete? This cannot be undone.",recycleDeleteConfirm:"Delete to recycle? Recoverable within 30 days.",modeInit:"Init once",modeInterval:"Interval keep-alive",modeManual:"Manual only",serviceConfig:"Service self-hosting config",auditConfig:"Auto-audit config",auditHint:"Cards matching an exemption go straight in; others await audit",auditMode:"Audit mode",auditAll:"Audit all",auditNone:"Skip all",auditExemptAgents:"Exempt agents",auditExemptKinds:"Exempt kinds",allExempt:"Exempt all",recycleDays:"Recycle retention days",editInSetting:"Edit in DSH Settings \u2192 Memory",pendingSyncNote:'This is the standalone web page: the DSH host applies a save (a current host is woken up and applies it in a request context, so saving takes effect immediately); when no DSH host is running here the change goes straight into the shared config. Only an older host falls back to "queued until it syncs on its own" \u2014 in that case change the same option under DSH Settings \u2192 Memory.',readonlyTitle:"This page is read-only; config cannot be saved here",readonlyBody:"This process has no DSH settings service (settings.update is unavailable). Edit the config in DSH: desktop app \u2192 Settings \u2192 Memory.",readonlyBtn:"Read-only",setupRunInTerminal:"Copy this command to your terminal:",dshMemoryConfig:"DSH Memory Config",autoCapture:"Auto capture",autoRecall:"Auto recall",captureMinChars:"Min capture chars",maxCardsPerDay:"Daily quota",dedupThreshold:"Dedup threshold",recallLimit:"Recall limit",vaultMulti:"Multiple vaults (per project)",vaultMultiHint:"Empty = single vault; existing setups unaffected",vaultNow:"Active now",vaultSource:"Source",vaultWorkspace:"Current workspace",vaultNamePh:"Name, e.g. work",vaultPathPh:"Directory, e.g. D:/vaults/work",vaultMatchPh:"Project dir (optional, auto-select by workspace)",vaultAdd:"Add a vault",vaultActive:"Active vault",vaultActiveNone:"Default vault (unset)",vaultSrcEnv:"env MEMORY_VAULT_DIR",vaultSrcProfile:"activeVault profile",vaultSrcWorkspace:"matched by project dir",vaultSrcVaultDir:"vaultDir setting",vaultSrcDefault:"default directory",fbNav:"Report a bug",fbTitle:"Report a bug (files on GitHub)",fbDesc:"Describe the problem (symptoms / steps / expected)",fbDiag:"Diagnostics (auto-redacted: home dir and keys/tokens replaced)",fbCopyDiag:"Copy diagnostics",fbOpenIssue:"Open prefilled issue on GitHub",fbCopyPrompt:"Copy AI prompt",fbCopiedDiag:"Diagnostics copied",fbCopiedPrompt:"Prompt copied \u2014 paste it into your AI chat",fbCopyFail:"Copy failed; please select and copy manually",fbWhy:"GitHub does not allow anonymous issue creation and the plugin must not ship a token: so the title, body and diagnostics are pre-filled \u2014 you just click Submit.",fbNeedDesc:"Please describe the problem first",fbLoading:"Collecting diagnostics\u2026",fbDiagFail:"Diagnostics endpoint unavailable (standalone web or older host); please add environment info manually",fbOr:"or",fbSelectAll:"Select all",toastApproved:"approved",toastRejected:"rejected",toastCardDeleted:"deleted",toastRestored:"restored",toastPurged:"permanently deleted",toastPurgedExpired:"expired recycle entries purged",toastFailed:"Action failed",noSelection:"Select the cards to act on first",enabledLabel:"Enable memory core",vaultDirLabel:"Vault directory (single)",captureCooldownMs:"Capture cooldown (ms)",captureProvider:"Distill provider (auto if empty)",captureModel:"Distill model (auto if empty)",recallEmbedding:"Semantic recall provider (optional)",sessionBudgetChars:"Session budget (chars)",saving:"Saving\u2026",savePending:"Saved to the config file; the host half is still the old build, so restart DSH to make it effective (already applied in this panel)",saveInvalid:"Some field values are invalid; nothing was submitted",invalidField:'"{field}" must be a number between {min} and {max} (now: {value})',actionRunning:"Working\u2026",recycleEmptyHint:"Recycle bin is empty: deleted cards land here first and are purged automatically after {days} days.",recyclePurgeAll:"Empty recycle bin",fbCopyManual:"Auto-copy was blocked by the browser \u2014 the text is below: click Select all, then Ctrl+C",vcLoaded:"running (process serving this page)",vcResident:"resident instance",vcOnDisk:"on disk",vcLatest:"npm latest",vcStale:'v{disk} is installed on disk but the process serving this page still has v{loaded} loaded \u2014 click "Restart resident instance" to restart it on the new code (no DSH restart needed)',vcRestart:"Restart resident instance",vcRestarting:"Restarting\u2026",vcRestartSent:"Resident restart scheduled: the new process takes over in ~3-8s \u2014 refresh the page (Ctrl+F5) shortly",vcRestartCurrent:"The resident instance is already up to date \u2014 no restart needed",vcRestartFail:"Restart request failed",vcRestartNoRoute:"The process serving this page is still the old build (no such endpoint): restart the desktop app / DSH and retry, or run {cmd}",vcHostStale:'The "running" chip above comes from the process serving this page; the resident instance is already current \u2014 restart the desktop app / DSH to refresh that chip',vcResidentDownShort:"not running",vcResidentDown:"The resident instance is not running (no response on port {port}) \u2014 use the button below to bring it up on the new code; if that fails run {cmd} and share the output of dsh-memory status",vcResidentUnmanagedShort:"unmanaged",vcResidentUnmanaged:"The resident instance serves v{served} but has **no watchdog keeping it alive** (an orphan left by a stop or a hard kill) \u2014 use the button below to put it back under management (a fresh watchdog plus a new instance), or run {cmd}",vcResidentLockUnknownShort:"management unknown",vcResidentLockUnknown:'The resident instance serves v{served}, but the **watchdog lock file cannot be written** (restricted environment: sandbox, ACLs, non-system drive) \u2192 whether it is managed cannot be determined (this is not "unmanaged"). Cause: {err} ({path}). Keep-alive usually still works; the button below can put it back under management on the new code.',vcPage:"Page script",vcPageStale:"\u26A0 This page is still running an older script (page v{page} / disk v{disk}): press Ctrl+F5 to refresh. If the running version is still old, restart the desktop app / DSH as well",vcOutdated:"update available",vcUpToDate:"up to date",vcCheck:"Check for updates",checking:"Checking\u2026",vcCheckFail:"Update check failed",recallSummaryLen:"Recall summary len",recallBody:"Recall with body",secretHint:"Credential hint (injected into every session)",autoWeb:"Web server",autoWebMode:"Keep-alive mode",webPort:"Web port",webCheckIntervalMs:"Probe interval (ms)",webMaxRestart:"Max restart",watchdogAutoSpawn:"Watchdog process",autoRestartOnDrift:"Auto-restart resident on version drift",autoMcpSetup:"Auto-mount MCP",saveConfig:"Save config",saveFail:"Save failed",savedOk:"Saved",savedDirect:"No DSH host is running here, so the change went straight into the shared config (hooks / MCP / the standalone page pick it up immediately)",savedApplied:"Saved and applied (the host applied it in a request context)",saveQueued:"Handed to the DSH host for sync \u2014 not confirmed applied yet",saveHostGuard:"This host does not let a plugin write config from its own callback context; change the same option under DSH Settings \u2192 Memory, or edit the profile patch layer",saveFailHint:"the host did not apply it \u2014 see Diagnostics under Report a bug",recallTool:"recall tool",costControl:"Cost control",costHint:"save tokens, control LLM usage",distillEnabled:"Distill cards (on=LLM compress, off=raw cards zero LLM)",dedupByLLM:"Dedup feeds LLM (off=pure lexical, cheaper)",captureMaxTokens:"Distill output cap (tokens)",recallMinScore:"Recall min score (higher = cheaper)",configNeedsDsh:"Edit config inside DSH (this page may be read-only or partially missing)",installMcp:"Install MCP",uninstallMcp:"Uninstall MCP",uninstallConfirm:"Confirm uninstall MCP for this agent? Claude Code/Codex will lose access to the memory vault.",presetConfig:"One-click preset config",presetHint:"Click to fill a plan, then hit Save",planA:"A Light",planB:"B Budget",planC:"C Premium",pluginInfo:"Plugin info",organizeTitle:"Organize",scanAndOrganize:"Scan & organize",scanHint:'Click "\u{1F50D} Scan & organize" to find similar/stale cards, then "\u26A1 One-click optimize" to run.',mergeNow:"Merge",delete:"Delete",captureAlert:"Auto-capture failed",captureAlertHint:'Open "Usage / Today" for the capture log; if the cause is an API/version mismatch, update the memory-eternal plugin.',captureLog:"Auto-capture log",captureLogHint:"Runs after every turn: listen \u2192 judge \u2192 write. Last 100 entries, so you can see why a card was not written.",captureLogEmpty:"No entries yet. Chat one turn (> min capture chars) and come back.",alignTitle:"Version alignment check",alignRun:"Check now",alignFix:"Rewrite wiring",alignFixConfirm:"Rewrite the MCP / hooks wiring? (Only the plugin's own keys are touched; your data and config stay as they are)",alignFixed:"Wiring rewritten; if it still reports an old host process, you must fully quit and reopen DSH",alignFail:"Alignment check failed",alignHint:"Upgrading the plugin only replaces files on disk \u2014 the host's in-memory event subscriptions and stale paths inside MCP / hooks do not update themselves; this checks all of it at once",alignIdle:'Hit "Check now": compare the host / resident / npm versions and look for stale paths and arguments in MCP and hooks',alignDisk:"disk",alignResident:"resident",alignHost:"host process",captureLogUnavailable:"Log is available only inside the DSH host (the standalone web page has no host runtime).",captureAgentCards:"Cards auto-captured by the agent",noCards:"none",loadMore:"Load more",batchMerge:"Smart batch merge",mergeAllConfirm:"Merge similar-grouped cards into one each (keep kind), delete originals?",crossVault:"All vaults",deleteConfirm:"Delete this memory card? This cannot be undone.",deleted:"Deleted",deleteFail:"Delete failed",deleteSelected:"Delete selected",deletedSelected:" cards deleted",merge:"Merge",mergeNeed:"Select at least 2 cards",mergeConfirm:"Merge the selected cards into one and delete the originals?",merged:"Merged",mergeFail:"Merge failed",mcpInstalled:"\u2705 {agent} MCP installed",mcpUninstalled:"\u2705 {agent} MCP uninstalled",mcpActionFail:"\u274C {agent} MCP action failed: {error}",dshHostLabel:"DeepSeek Harness (current host)",restartHint:"Saved. autoWebMode/watchdogAutoSpawn take effect after restarting DSH; a resident watchdog is never stopped automatically \u2014 use dsh-memory stop / restart (#19)",conflictRefresh:"Config changed elsewhere \u2014 refresh and retry",untitled:"Untitled",tplBlank:"\u{1F4C4} Blank",tagsHint:"Tags (comma-separated)",connCount:"{n} connections",tplDecisionTags:"decision, plan",tplBugTags:"pitfall, lesson",tplMeetingTags:"meeting, minutes",tplWeeklyTags:"weekly report",tplDecisionBody:`# Tech decision: [title]
|
|
61
|
+
- `},Zt={nav:"Memory",loading:"Loading\u2026",refresh:"Refresh",overview:"Memory Overview",total:"Cards",recent:"Added (7d)",tags:"Tags",searchPlaceholder:"Search memory\u2026",search:"Search",all:"All",kindProject:"Projects",kindKnowledge:"Knowledge",kindContent:"Content",kindPrompt:"Prompts",kindBusiness:"Business",kindTool:"Tools",kindMistake:"Mistakes",cardsTab:"Cards",graphTab:"Graph",graph:"Knowledge Graph",graphHint:"Nodes = cards; edges = [[links]] or shared tags. Click a node to read.",graphTip:"Left-click highlights \xB7 Shift+drag box-select \xB7 right-click menu \xB7 scroll zoom \xB7 drag to pan",rebuild:"Rebuild",reset:"Reset",expandAll:"Expand all",capped:"Showing the",clearFocus:"Clear highlight",empty:"Memory is empty. After a few conversations, valuable content is auto-captured.",emptyGraph:"No graph data yet.",open:"Read",updated:"Updated",created:"Created",source:"Source",close:"Close",vaultDir:"Vault directory",capture:"Auto capture",recall:"Auto recall",enabled:"on",disabled:"off",error:"Load failed",back:"Back to list",cardCount:"cards",nodes:"nodes",edges:"edges",memoryTitle:"Memory Library",memoryHint:"Your local second brain",zoomIn:"Zoom in",zoomOut:"Zoom out",fit:"Fit",enterFullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",exportGraph:"Export",openCard:"Open card",focusNeighbors:"Highlight links",copyName:"Copy name",noMatch:"No matching memory",clearFilter:"Clear filter",filterLabel:"Filter",sortRecent:"Recent",sortTitle:"Title",sortHot:"Hot",exportSel:"Export selected",clearSelection:"Clear selection",download:"Download",openNewTab:"Open in new tab",copyImage:"Copy image",done:"Done",downloaded:"Download started",openedTab:"Opened in new tab",copied:"Copied",exportedSel:" nodes exported",fullscreen:"Fullscreen",exitFull:"Exit fullscreen",copyFail:"Copy failed",timeDim:"Time",timeNew:"\u22643 days",timeRecent:"\u22642 weeks",timeMonth:"\u22641 month",timeOld:"Older",newBadge:"NEW",expand:"Expand",collapse:"Collapse",exportVault:"Export MD",exportJson:"Export JSON",exporting:"Exporting\u2026",exportedVault:"Vault exported",exportFail:"Export failed",importVault:"Import",importedVault:"Import complete",importedTotal:" / of ",importedTotalTail:"",importedQuarantine:" \xB7 pending review ",importedQuarantineTail:" (quarantined until approved)",importedSkipped:" \xB7 skipped ",importedSkippedTail:" (duplicate or empty)",importFail:"Import failed",location:"Choose location",saveAs:"Save as",saveAsUnsupported:"Choose-save-location not supported here",exportedTo:"Exported to",defaultDownloads:"default Downloads folder",exportCancel:"Export cancelled",manage:"Manage",tabUsage:"Usage / Today",tabOptimize:"Optimize",adminLoadFail:"Load failed: fully restart dsh-desktop so the host picks up the new /memory-eternal routes",retry:"Retry",mergeSimilar:"Merge similar",trendLabel:"Last 30 days trend",cleanStale:"\u{1F5D1}\uFE0F Clean stale",deletedStale:" stale cards cleaned",newCard:"New",tplDecision:"\u{1F4DD} Decision",tplBug:"\u{1F41B} Bug",tplMeeting:"\u{1F4CB} Meeting",tplWeekly:"\u{1F4CA} Weekly",createCard:"Create",cardTitle:"Title",cardBody:"Body",fbUseful:"Useful",fbIrr:"Irrelevant",todayAdd:"Added today",weekAdd:"Last 7d",byKind:"By kind",todayList:"Captured today",budgetLabel:"Session budget",budgetChars:"Budget chars",recallLimitLabel:"Recall limit",embeddingLabel:"Semantic recall",mergePairs:"Similar pairs (mergeable)",staleCards:"Stale (>90d)",noOptimize:"Nothing to organize, healthy \u{1F389}",refineTitle:"Conflict scan",refineScan:"Scan now",refineHint:"Similar cards can be merged; conflicts must be judged by a human \u2014 the scan is read-only, and data only moves after you choose (keeping one moves the other to the recycle bin, recoverable)",refineIdle:'Hit "Scan now": recall possibly-related card pairs, then let the model classify each as duplicate / complement / conflict / unrelated',refineNone:"No card pairs need your ruling this round \u{1F389}",refineFail:"Conflict scan failed",refineApplied:"Your ruling was recorded (it will not ask again)",refineRel_duplicate:"Duplicate (mergeable)",refineRel_complement:"Complement (keep both)",refineRel_conflict:"Conflict (needs your ruling)",refineRel_unrelated:"Unrelated",refineKeepA:"Keep A",refineKeepB:"Keep B",refineKeepBoth:"Keep both",refineMerge:"Merge",junkTitle:"Injected junk cards",junkScan:"Scan existing",junkHint:"Cards suspected to be captured runtime injections (skill catalogs / system-reminders) \u2014 the scan is read-only and recycling goes to the recycle bin (recoverable)",junkIdle:'Hit "Scan existing": find cards whose body is really injected runtime text with almost no human content left after stripping',junkNone:"No such cards found \u{1F389}",junkRecycle:"Recycle",junkRecycleAll:"Recycle all",junkRecycleAllConfirm:"Send these cards to the recycle bin? (Not a permanent delete \u2014 recoverable from the recycle center)",junkDone:"Sent to recycle bin",junkFail:"Scan / recycle failed",dbReadonlyTitle:"The memory database is currently not writable",dbReadonlyBody:"Card reads/writes, auditing and the graph will fail, but **settings can still be saved** (they do not go through the database)",dbReadonlyFix:"Diagnose with: dsh-memory doctor (journal mode, write probe, backups and recovery steps)",goalTitle:"Same goal, different approach",goalScan:"Scan goals",goalHint:'Clusters by "what problem does this card solve" \u2014 approaches that differ in wording (7z vs tar vs npm slimming) still land together',goalIdle:'Hit "Scan goals": the model first writes a one-line goal per card (first run calls the model, later runs use the cache), then clusters by goal',goalNone:'No clusters of "one goal, several cards" found \u{1F389}',goalStats:"indexed / calls this run",goalCards:"cards",goalKeep:"Keep all",goalMerge:"Merge this group",goalMerged:"Merge submitted (the new card goes to the audit queue)",goalDone:'Recorded as "keep all"',goalFail:"Goal clustering failed",oneClickOptimize:"One-click optimize",oneClickOptimizeConfirm:"Confirm one-click optimize? This will merge all similar pairs (stale cards are NOT deleted by default).",oneClickAlsoStale:"Also clean stale cards",oneClickOptimizeDone:"One-click optimize done",optimizedMerged:"pairs merged",optimizedStaleDeleted:"stale cards cleaned",mcpSetupStatus:"Agent MCP mount status",rerunSetup:"Re-run setup",notInstalled:"not installed",noMcpEntry:"no MCP entry",nodePathMismatch:"node path mismatch, consider re-running setup",nodePathNote:"different node env (usable)",healthy:"healthy",mcpSetupHint:'"Auto-mount MCP" = lets Claude Code / Codex / Cursor use the memory vault. On = auto-configures them; Off = never touches your machine config, run dsh-memory setup manually when needed.',mcpManageHint:"Use each agent row to install/uninstall MCP individually",tabConfig:"Memory Config",tabAudit:"Audit Center",statusApproved:"Approved",statusPending:"Pending",statusRejected:"Rejected",allStatus:"All statuses",tabRecycle:"Recycle Bin",pending:"Pending",rejected:"Rejected",selectAll:"Select all",approve:"Approve",reject:"Reject",allAgents:"All agents",noAuditItems:"No items to review",auditBodyFail:"Failed to load the card body",deletedAt:"deleted",restore:"Restore",restoreDelete:"Delete to recycle",purge:"Purge",emptyRecycle:"Recycle bin is empty",recycleHint:"Deleted cards go to the recycle bin \u2014 recover within 30 days, else auto-purged",purgeConfirm:"Permanently delete? This cannot be undone.",recycleDeleteConfirm:"Delete to recycle? Recoverable within 30 days.",modeInit:"Init once",modeInterval:"Interval keep-alive",modeManual:"Manual only",serviceConfig:"Service self-hosting config",auditConfig:"Auto-audit config",auditHint:"Cards matching an exemption go straight in; others await audit",auditMode:"Audit mode",auditAll:"Audit all",auditNone:"Skip all",auditExemptAgents:"Exempt agents",auditExemptKinds:"Exempt kinds",allExempt:"Exempt all",recycleDays:"Recycle retention days",editInSetting:"Edit in DSH Settings \u2192 Memory",pendingSyncNote:'This is the standalone web page: the DSH host applies a save (a current host is woken up and applies it in a request context, so saving takes effect immediately); when no DSH host is running here the change goes straight into the shared config. Only an older host falls back to "queued until it syncs on its own" \u2014 in that case change the same option under DSH Settings \u2192 Memory.',readonlyTitle:"This page is read-only; config cannot be saved here",readonlyBody:"This process has no DSH settings service (settings.update is unavailable). Edit the config in DSH: desktop app \u2192 Settings \u2192 Memory.",readonlyBtn:"Read-only",setupRunInTerminal:"Copy this command to your terminal:",dshMemoryConfig:"DSH Memory Config",autoCapture:"Auto capture",autoRecall:"Auto recall",captureMinChars:"Min capture chars",maxCardsPerDay:"Daily quota",dedupThreshold:"Dedup threshold",recallLimit:"Recall limit",vaultMulti:"Multiple vaults (per project)",vaultMultiHint:"Empty = single vault; existing setups unaffected",vaultNow:"Active now",vaultSource:"Source",vaultWorkspace:"Current workspace",vaultNamePh:"Name, e.g. work",vaultPathPh:"Directory, e.g. D:/vaults/work",vaultMatchPh:"Project dir (optional, auto-select by workspace)",vaultAdd:"Add a vault",vaultActive:"Active vault",vaultActiveNone:"Default vault (unset)",vaultSrcEnv:"env MEMORY_VAULT_DIR",vaultSrcProfile:"activeVault profile",vaultSrcWorkspace:"matched by project dir",vaultSrcVaultDir:"vaultDir setting",vaultSrcDefault:"default directory",fbNav:"Report a bug",fbTitle:"Report a bug (files on GitHub)",fbDesc:"Describe the problem (symptoms / steps / expected)",fbDiag:"Diagnostics (auto-redacted: home dir and keys/tokens replaced)",fbCopyDiag:"Copy diagnostics",fbOpenIssue:"Open prefilled issue on GitHub",fbCopyPrompt:"Copy AI prompt",fbCopiedDiag:"Diagnostics copied",fbCopiedPrompt:"Prompt copied \u2014 paste it into your AI chat",fbCopyFail:"Copy failed; please select and copy manually",fbWhy:"GitHub does not allow anonymous issue creation and the plugin must not ship a token: so the title, body and diagnostics are pre-filled \u2014 you just click Submit.",fbNeedDesc:"Please describe the problem first",fbLoading:"Collecting diagnostics\u2026",fbDiagFail:"Diagnostics endpoint unavailable (standalone web or older host); please add environment info manually",fbOr:"or",fbSelectAll:"Select all",toastApproved:"approved",toastRejected:"rejected",toastCardDeleted:"deleted",toastRestored:"restored",toastPurged:"permanently deleted",toastPurgedExpired:"expired recycle entries purged",toastFailed:"Action failed",noSelection:"Select the cards to act on first",enabledLabel:"Enable memory core",vaultDirLabel:"Vault directory (single)",captureCooldownMs:"Capture cooldown (ms)",captureProvider:"Distill provider (auto if empty)",captureModel:"Distill model (auto if empty)",recallEmbedding:"Semantic recall provider (optional)",sessionBudgetChars:"Session budget (chars)",saving:"Saving\u2026",savePending:"Saved to the config file; the host half is still the old build, so restart DSH to make it effective (already applied in this panel)",saveInvalid:"Some field values are invalid; nothing was submitted",invalidField:'"{field}" must be a number between {min} and {max} (now: {value})',actionRunning:"Working\u2026",recycleEmptyHint:"Recycle bin is empty: deleted cards land here first and are purged automatically after {days} days.",recyclePurgeAll:"Empty recycle bin",fbCopyManual:"Auto-copy was blocked by the browser \u2014 the text is below: click Select all, then Ctrl+C",vcLoaded:"running (process serving this page)",vcResident:"resident instance",vcOnDisk:"on disk",vcLatest:"npm latest",vcStale:'v{disk} is installed on disk but the process serving this page still has v{loaded} loaded \u2014 click "Restart resident instance" to restart it on the new code (no DSH restart needed)',vcRestart:"Restart resident instance",vcRestarting:"Restarting\u2026",vcRestartSent:"Resident restart scheduled: the new process takes over in ~3-8s \u2014 refresh the page (Ctrl+F5) shortly",vcRestartCurrent:"The resident instance is already up to date \u2014 no restart needed",vcRestartFail:"Restart request failed",vcRestartNoRoute:"The process serving this page is still the old build (no such endpoint): restart the desktop app / DSH and retry, or run {cmd}",vcHostStale:'The "running" chip above comes from the process serving this page; the resident instance is already current \u2014 restart the desktop app / DSH to refresh that chip',vcResidentDownShort:"not running",vcResidentDown:"The resident instance is not running (no response on port {port}) \u2014 use the button below to bring it up on the new code; if that fails run {cmd} and share the output of dsh-memory status",vcResidentUnmanagedShort:"unmanaged",vcResidentUnmanaged:"The resident instance serves v{served} but has **no watchdog keeping it alive** (an orphan left by a stop or a hard kill) \u2014 use the button below to put it back under management (a fresh watchdog plus a new instance), or run {cmd}",vcResidentLockUnknownShort:"management unknown",vcResidentLockUnknown:'The resident instance serves v{served}, but the **watchdog lock file cannot be written** (restricted environment: sandbox, ACLs, non-system drive) \u2192 whether it is managed cannot be determined (this is not "unmanaged"). Cause: {err} ({path}). Keep-alive usually still works; the button below can put it back under management on the new code.',vcPage:"Page script",vcPageStale:"\u26A0 This page is still running an older script (page v{page} / disk v{disk}): press Ctrl+F5 to refresh. If the running version is still old, restart the desktop app / DSH as well",vcOutdated:"update available",vcUpToDate:"up to date",vcCheck:"Check for updates",checking:"Checking\u2026",vcCheckFail:"Update check failed",recallSummaryLen:"Recall summary len",recallBody:"Recall with body",secretHint:"Credential hint (injected into every session)",autoWeb:"Web server",autoWebMode:"Keep-alive mode",webPort:"Web port",webCheckIntervalMs:"Probe interval (ms)",webMaxRestart:"Max restart",watchdogAutoSpawn:"Watchdog process",autoRestartOnDrift:"Auto-restart resident on version drift",autoMcpSetup:"Auto-mount MCP",saveConfig:"Save config",saveFail:"Save failed",savedOk:"Saved",savedDirect:"No DSH host is running here, so the change went straight into the shared config (hooks / MCP / the standalone page pick it up immediately)",savedApplied:"Saved and applied (the host applied it in a request context)",saveQueued:"Handed to the DSH host for sync \u2014 not confirmed applied yet",saveHostGuard:"This host does not let a plugin write config from its own callback context; change the same option under DSH Settings \u2192 Memory, or edit the profile patch layer",saveFailHint:"the host did not apply it \u2014 see Diagnostics under Report a bug",recallTool:"recall tool",costControl:"Cost control",costHint:"save tokens, control LLM usage",distillEnabled:"Distill cards (on=LLM compress, off=raw cards zero LLM)",dedupByLLM:"Dedup feeds LLM (off=pure lexical, cheaper)",captureMaxTokens:"Distill output cap (tokens)",recallMinScore:"Recall min score (higher = cheaper)",configNeedsDsh:"Edit config inside DSH (this page may be read-only or partially missing)",installMcp:"Install MCP",uninstallMcp:"Uninstall MCP",uninstallConfirm:"Confirm uninstall MCP for this agent? Claude Code/Codex will lose access to the memory vault.",presetConfig:"One-click preset config",presetHint:"Click to fill a plan, then hit Save",planA:"A Light",planB:"B Budget",planC:"C Premium",pluginInfo:"Plugin info",organizeTitle:"Organize",scanAndOrganize:"Scan & organize",scanHint:'Click "\u{1F50D} Scan & organize" to find similar/stale cards, then "\u26A1 One-click optimize" to run.',mergeNow:"Merge",delete:"Delete",captureAlert:"Auto-capture failed",captureAlertHint:'Open "Usage / Today" for the capture log; if the cause is an API/version mismatch, update the memory-eternal plugin.',captureLog:"Auto-capture log",captureLogHint:"Runs after every turn: listen \u2192 judge \u2192 write. Last 100 entries, so you can see why a card was not written.",captureLogEmpty:"No entries yet. Chat one turn (> min capture chars) and come back.",alignTitle:"Version alignment check",alignRun:"Check now",alignFix:"Rewrite wiring",alignFixConfirm:"Rewrite the MCP / hooks wiring? (Only the plugin's own keys are touched; your data and config stay as they are)",alignFixed:"Wiring rewritten; if it still reports an old host process, you must fully quit and reopen DSH",alignFail:"Alignment check failed",alignHint:"Upgrading the plugin only replaces files on disk \u2014 the host's in-memory event subscriptions and stale paths inside MCP / hooks do not update themselves; this checks all of it at once",alignIdle:'Hit "Check now": compare the host / resident / npm versions and look for stale paths and arguments in MCP and hooks',alignDisk:"disk",alignResident:"resident",alignHost:"host process",captureLogUnavailable:"Log is available only inside the DSH host (the standalone web page has no host runtime).",captureAgentCards:"Cards auto-captured by the agent",noCards:"none",loadMore:"Load more",batchMerge:"Smart batch merge",mergeAllConfirm:"Merge similar-grouped cards into one each (keep kind), delete originals?",crossVault:"All vaults",deleteConfirm:"Delete this memory card? This cannot be undone.",deleted:"Deleted",deleteFail:"Delete failed",deleteSelected:"Delete selected",deletedSelected:" cards deleted",merge:"Merge",mergeNeed:"Select at least 2 cards",mergeConfirm:"Merge the selected cards into one and delete the originals?",merged:"Merged",mergeFail:"Merge failed",mcpInstalled:"\u2705 {agent} MCP installed",mcpUninstalled:"\u2705 {agent} MCP uninstalled",mcpActionFail:"\u274C {agent} MCP action failed: {error}",dshHostLabel:"DeepSeek Harness (current host)",restartHint:"Saved. autoWebMode/watchdogAutoSpawn take effect after restarting DSH; a resident watchdog is never stopped automatically \u2014 use dsh-memory stop / restart (#19)",conflictRefresh:"Config changed elsewhere \u2014 refresh and retry",untitled:"Untitled",tplBlank:"\u{1F4C4} Blank",tagsHint:"Tags (comma-separated)",connCount:"{n} connections",tplDecisionTags:"decision, plan",tplBugTags:"pitfall, lesson",tplMeetingTags:"meeting, minutes",tplWeeklyTags:"weekly report",tplDecisionBody:`# Tech decision: [title]
|
|
62
62
|
|
|
63
63
|
## Background
|
|
64
64
|
- Problem
|
|
@@ -103,7 +103,7 @@ Option A, because:
|
|
|
103
103
|
-
|
|
104
104
|
|
|
105
105
|
## Risks/blockers
|
|
106
|
-
- `},Lt=["all","project","knowledge","content","prompt","business","tool","mistake"],Ve={project:"#3B82F6",knowledge:"#10B981",content:"#F59E0B",prompt:"#A855F7",business:"#EC4899",tool:"#06B6D4",mistake:"#EF4444",other:"#6B7280"},ht={project:"\u{1F4C1}",knowledge:"\u{1F4DA}",content:"\u{1F4DD}",prompt:"\u{1F4AC}",business:"\u{1F4BC}",tool:"\u{1F527}",mistake:"\u26A0\uFE0F",other:"\u{1F4CE}"},qe={project:"kindProject",knowledge:"kindKnowledge",content:"kindContent",prompt:"kindPrompt",business:"kindBusiness",tool:"kindTool",mistake:"kindMistake",other:"kindKnowledge"},yt="deepseek-harness",ut=t=>{let o=String(t||""),l=o.toLowerCase();return!o||o==="agent"||o==="unknown"||o.startsWith("session:")||l.startsWith("claude-code")?l.startsWith("claude-code")?"claude":yt:l==="deepseek harness"?yt:o.split(":")[0]||yt},
|
|
106
|
+
- `},Lt=["all","project","knowledge","content","prompt","business","tool","mistake"],Ve={project:"#3B82F6",knowledge:"#10B981",content:"#F59E0B",prompt:"#A855F7",business:"#EC4899",tool:"#06B6D4",mistake:"#EF4444",other:"#6B7280"},Vt=t=>Array.isArray(t&&t.tags)?t.tags:[],ht={project:"\u{1F4C1}",knowledge:"\u{1F4DA}",content:"\u{1F4DD}",prompt:"\u{1F4AC}",business:"\u{1F4BC}",tool:"\u{1F527}",mistake:"\u26A0\uFE0F",other:"\u{1F4CE}"},qe={project:"kindProject",knowledge:"kindKnowledge",content:"kindContent",prompt:"kindPrompt",business:"kindBusiness",tool:"kindTool",mistake:"kindMistake",other:"kindKnowledge"},yt="deepseek-harness",ut=t=>{let o=String(t||""),l=o.toLowerCase();return!o||o==="agent"||o==="unknown"||o.startsWith("session:")||l.startsWith("claude-code")?l.startsWith("claude-code")?"claude":yt:l==="deepseek harness"?yt:o.split(":")[0]||yt},wa=[yt,"claude","codex","cursor","codex-desktop"],Qt=(t=[])=>[...new Set([...wa,...(t||[]).map(ut)])],Sa={boot:["\u{1F680}","#8b5cf6"],listen:["\u{1F442}","inherit"],created:["\u2705","#10b981"],appended:["\u2795","#3b82f6"],skip:["\u23ED","#f59e0b"],warn:["\u26A0\uFE0F","#f59e0b"],fail:["\u274C","#ef4444"]},Oe=`
|
|
107
107
|
.memory-eternal-root { font-family: inherit; color: var(--dsw-alias-label-primary, #1f2937); }
|
|
108
108
|
.mc-card { background: var(--dsw-alias-bg-layer-1, #fff); border: 1px solid var(--dsw-alias-border-l1, #e5e7eb); border-radius: 12px; padding: 14px 16px; }
|
|
109
109
|
.mc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
|
|
@@ -298,13 +298,13 @@ Option A, because:
|
|
|
298
298
|
height: calc(100vh - var(--dsh-windows-titlebar-height, 0px));
|
|
299
299
|
max-height: calc(100vh - var(--dsh-windows-titlebar-height, 0px));
|
|
300
300
|
}
|
|
301
|
-
`;function
|
|
301
|
+
`;function Ca(t){t.effect(()=>t.locale.register(rt,{zh:Jt,en:Zt}),"memory-eternal: locale");let o=t.locale.bind(rt);t.effect(()=>t.slots.inject("settings.section",()=>t.slots.register({name:"settings.section",id:rt,order:25,label:()=>o("nav"),locale:rt,inject:()=>({})},()=>n.default.createElement(Ma,{t:o}))),"memory-eternal: settings section"),t.effect(()=>t.slots.inject("sidebar.footer.action",()=>t.slots.register({name:"sidebar.footer.action",id:`${rt}:footer`,order:100,label:()=>o("nav"),locale:rt,inject:()=>({})},l=>n.default.createElement(Ta,{t:o,locale:t.locale,wide:!(l&&l.wide===!1)}))),"memory-eternal: sidebar footer action")}function Na(){let[t,o]=(0,n.useState)(O+"/ui/app");return(0,n.useEffect)(()=>{let l=!0,f=()=>fetch("/memory-eternal/api/web-info").then(c=>c.json()).then(c=>{l&&c&&c.ok&&c.alive!==!1&&c.url&&o(c.url.endsWith("/")?c.url:c.url+"/")}).catch(()=>{});return fetch(O+"/ui/app",{method:"HEAD"}).then(c=>{if(l&&!c.ok)return f()}).catch(()=>l?f():void 0),()=>{l=!1}},[]),t}function Ma({t}){return(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsx)(aa,{t,onReload:()=>{},version:0})]})}function Ta({t,locale:o,wide:l}){let[f,c]=(0,n.useState)(!1);return(0,e.jsxs)("div",{className:`me-footer${l?"":" rail"}`,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("button",{type:"button",className:"me-footer-btn",onClick:()=>c(!0),"aria-label":t("nav"),title:t("nav"),children:[(0,e.jsx)("span",{className:"me-footer-ico","aria-hidden":"true",children:(0,e.jsx)(ea,{})}),(0,e.jsx)("span",{className:"me-footer-label",children:t("nav")})]}),f&&(0,e.jsx)(Ra,{t,locale:o,onClose:()=>c(!1)})]})}function Ra({t,locale:o,onClose:l,tab:f}){let[c,i]=(0,n.useState)(!1),w=(0,n.useRef)(null),D=Na(),k=(0,n.useCallback)(T=>o&&typeof o.subscribe=="function"?o.subscribe(T):()=>{},[o]),H=(0,n.useCallback)(()=>o&&typeof o.getSnapshot=="function"?o.getSnapshot():null,[o]),S=(0,n.useSyncExternalStore)(k,H),h=S&&(S.active==="zh"||S.active==="en")?S.active:null,g=(0,n.useRef)(null);g.current===null&&h&&(g.current=h);let I=(0,n.useMemo)(()=>{let T=g.current?`lang=${g.current}`:"";if(f==="config")return`${O}/ui/config?tab=config${T?`&${T}`:""}`;let v=D.replace(/\/$/,""),B=v.endsWith("/ui/app")?"?":"/?";return f?`${v}${B}tab=${f}${T?`&${T}`:""}`:T?`${v}${B}${T}`:D},[D,f]);return(0,n.useEffect)(()=>{let T=w.current&&w.current.contentWindow;T&&h&&T.postMessage({source:"memory-eternal",type:"locale",lang:h},"*")},[h]),(0,n.useEffect)(()=>{let T=v=>{v.key==="Escape"&&l()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[l]),(0,e.jsxs)("div",{className:"me-overlay-top",onClick:l,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsx)("div",{className:"me-modal"+(c?" me-modal-full":""),onClick:T=>T.stopPropagation(),children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,position:"relative"},children:[(0,e.jsxs)("div",{style:{position:"absolute",top:8,right:8,zIndex:10,display:"flex",gap:4,padding:"4px 6px",background:"var(--dsw-alias-bg-overlay, rgba(17,24,39,0.45))",borderRadius:8,backdropFilter:"blur(4px)"},children:[(0,e.jsx)("button",{type:"button",onClick:()=>i(T=>!T),"aria-label":t(c?"exitFullscreen":"enterFullscreen"),title:t(c?"exitFullscreen":"enterFullscreen"),style:{width:26,height:26,borderRadius:6,border:"1px solid rgba(255,255,255,0.18)",background:"rgba(255,255,255,0.08)",color:"#fff",cursor:"pointer",fontSize:14,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},children:c?"\u2921":"\u2922"}),(0,e.jsx)("button",{type:"button",onClick:l,"aria-label":t("close"),title:t("close"),style:{width:26,height:26,borderRadius:6,border:"1px solid rgba(255,255,255,0.18)",background:"rgba(255,255,255,0.08)",color:"#fff",cursor:"pointer",fontSize:16,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},children:"\xD7"})]}),(0,e.jsx)("iframe",{ref:w,src:I,title:"memory-eternal",allow:"clipboard-write; clipboard-read",style:{width:"100%",flex:1,border:0,borderRadius:"inherit",background:"var(--dsw-alias-bg-base, #fff)"}})]})})]})}function ea(){return(0,e.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"mg-brain",x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#FFC46B"}),(0,e.jsx)("stop",{offset:"50%",stopColor:"#F97316"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#EA580C"})]})}),(0,e.jsx)("path",{fill:"url(#mg-brain)",d:"M12 4.5a3.2 3.2 0 0 0-6.4.1 4.1 4.1 0 0 0-2.7 5.9 4.1 4.1 0 0 0 .6 6.7A4.2 4.2 0 0 0 12 18.2Z"}),(0,e.jsx)("path",{fill:"url(#mg-brain)",d:"M12 4.5a3.2 3.2 0 0 1 6.4.1 4.1 4.1 0 0 1 2.7 5.9 4.1 4.1 0 0 1-.6 6.7A4.2 4.2 0 0 1 12 18.2Z"}),(0,e.jsx)("path",{d:"M12 9.2c-.8-1.4-1.7-2-3.1-2.2M12 9.2c.8-1.4 1.7-2 3.1-2.2M12 12.4c-1.2 1-3.2 1.6-5 1.4M12 12.4c1.2 1 3.2 1.6 5 1.4M12 13.2v4",fill:"none",stroke:"rgba(255,255,255,0.62)",strokeWidth:"1",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"12",cy:"8.6",r:"1.1",fill:"rgba(255,255,255,0.85)"})]})}var bt="0.10.31";function Da({t,inModal:o,onClose:l,onFull:f,full:c}){let[i,w]=(0,n.useState)(null),[D,k]=(0,n.useState)([]),[H,S]=(0,n.useState)(!0),[h,g]=(0,n.useState)(null),[I,T]=(0,n.useState)(""),[v,B]=(0,n.useState)("all"),[A,K]=(0,n.useState)(""),[te,Y]=(0,n.useState)("all"),[j,Ae]=(0,n.useState)("all"),[X,be]=(0,n.useState)(()=>{try{let u=new URLSearchParams(typeof location<"u"?location.search:"").get("tab"),z={cards:"cards",graph:"graph",usage:"stats",stats:"stats",audit:"audit",recycle:"optimize",optimize:"optimize",config:"config"};if(u&&z[u])return z[u]}catch{}return"cards"}),[Z,U]=(0,n.useState)(()=>new Set([X])),ie=(0,n.useCallback)(u=>{U(z=>z.has(u)?z:new Set(z).add(u)),be(u)},[]),[ve,C]=(0,n.useState)("recent"),[ke,Q]=(0,n.useState)(null),pe=(0,n.useRef)(null),Pe=(0,n.useRef)(null),[y,W]=(0,n.useState)(!1),[re,J]=(0,n.useState)(null),[le,ye]=(0,n.useState)(!1),[Be,Ne]=(0,n.useState)(!1),[Me,De]=(0,n.useState)(!0),[s,x]=(0,n.useState)(null),[R,G]=(0,n.useState)(0),Se=(0,n.useCallback)(()=>G(u=>u+1),[]),Ce=i?.quarantine?.pending??0,de=i?.quarantine?.deleted??0,ee=(0,n.useRef)(null),[We,Re]=(0,n.useState)(0),[p,r]=(0,n.useState)(!1),$=(0,n.useRef)(null),se=(0,n.useRef)(null),ce=(0,n.useCallback)(async(u=v,z=A,M=j,q={})=>{let _=q.append===!0;try{_?r(!0):(S(!0),T(""));let me=new URLSearchParams;u&&u!=="all"&&me.set("kind",u),z.trim()&&me.set("q",z.trim()),me.set("status",M||"all"),me.set("limit",String(xa)),me.set("offset",String(q.offset||0)),ve==="title"&&me.set("sort","title");let je=await(await fetch(`${O}/cards?${me.toString()}`)).json();if(je.ok){let Ye=je.cards||[];k($e=>_?[...$e,...Ye.filter(Ge=>!$e.some(vt=>vt.path===Ge.path))]:Ye),Re(Number(je.total)||Ye.length)}}catch(me){T(String(me&&me.message?me.message:me))}finally{_?r(!1):S(!1)}},[v,A,j,ve]),ge=(0,n.useCallback)(async()=>{try{let[u,z]=await Promise.all([fetch(`${O}/overview`).then(M=>M.json()),fetch(`${O}/capture-log`).then(M=>M.json()).catch(()=>null)]);u.ok&&w(u),g(z&&z.ok&&z.available&&z.health||null)}catch(u){T(String(u&&u.message?u.message:u))}finally{S(!1)}},[]),a=async u=>{try{let M=await(await fetch(`${O}/delete?path=${encodeURIComponent(u)}`)).json();M.ok?(Q({ok:!0,msg:t("deleted")}),await ge(),Se()):Q({ok:!1,msg:M.error||t("deleteFail")})}catch{Q({ok:!1,msg:t("deleteFail")})}pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2e3)};(0,n.useEffect)(()=>(ge(),()=>{ee.current&&clearTimeout(ee.current)}),[ge]);let tt=u=>{K(u),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>ce(v,u,j),280)},we=u=>{B(u),ce(u,A,j)};(0,n.useEffect)(()=>{X==="cards"&&ce(v,A,j)},[j,X,R,ve]),(0,n.useEffect)(()=>{if(X!=="cards"||H||p||D.length>=We)return;let u=$.current,z=se.current;if(!u)return;let M=new IntersectionObserver(q=>{q[0]&&q[0].isIntersecting&&ce(v,A,j,{append:!0,offset:D.length})},{root:z||null,rootMargin:"400px"});return M.observe(u),()=>M.disconnect()},[X,D,We,H,p,v,A,j,ce]);let nt=async u=>{try{let z=u.status;if(!z&&u.path)try{let ze=((await fetch(`${O}/cards?status=all&q=${encodeURIComponent(u.title||"")}&limit=50`).then(je=>je.json())).cards||[]).find(je=>je.path===u.path);ze&&(z=ze.status)}catch{}let M=z&&z!=="approved"?`&status=${encodeURIComponent(z)}`:"",q=await fetch(`${O}/card?path=${encodeURIComponent(u.path||u.id)}${M}`),_=await q.json();_.ok?J({path:_.path,title:u.title,text:_.text}):T(_.error||`HTTP ${q.status}`)}catch(z){T(String(z&&z.message?z.message:z))}},Le=async(u,z)=>{W(!0);try{let M=await fetch(`${O}/export`);if(!M.ok)throw new Error("HTTP "+M.status);let q=await M.json();if(!q.ok)throw new Error(q.error||"export failed");let _,me,ze;if(u==="json"){me="memory-vault.json",ze="application/json";let $e=q.cards.map(Ge=>({path:Ge.path,title:Ge.title,kind:Ge.kind,status:Ge.status,store:Ge.store,text:Ge.text}));_=JSON.stringify({format:q.format||"memory-eternal-vault",formatVersion:q.formatVersion||1,exportedAt:q.exportedAt||new Date().toISOString(),count:$e.length,cards:$e},null,2)}else me="memory-vault.md",ze="text/markdown;charset=utf-8",_=q.cards.map($e=>$e.text.trim()).filter(Boolean).join(`
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
305
|
-
`);let je=new Blob([_],{type:ze}),Ye=await Wa(je,me,!1);if(!Ye.ok){Q({ok:!1,msg:t("exportFail")}),W(!1);return}Q({ok:!0,msg:t("exportedTo")+"\uFF1A"+t("defaultDownloads")+" \xB7 "+Ye.name})}catch(M){Q({ok:!1,msg:t("exportFail")+" \xB7 "+(M.message||"")})}finally{W(!1)}pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2600)},d=async u=>{let z=u.target.files&&u.target.files[0];if(u.target.value="",!!z){try{let M=await z.text(),_=await(await fetch(`${O}/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:M})).json();if(_.ok){await ge();let me=_.imported||0,ze=t("importedVault")+"\uFF1A"+me;_.total&&(ze+=t("importedTotal")+_.total+t("importedTotalTail")),_.quarantined&&(ze+=t("importedQuarantine")+_.quarantined+t("importedQuarantineTail")),_.skipped&&(ze+=t("importedSkipped")+_.skipped+t("importedSkippedTail")),_.warning&&(ze+=" \xB7 "+_.warning),Q({ok:me>0||!_.total,msg:ze})}else Q({ok:!1,msg:_.error||t("importFail")})}catch{Q({ok:!1,msg:t("importFail")})}pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2400)}},P=(0,n.useMemo)(()=>{let u=D.slice();return te!=="all"&&(u=u.filter(z=>ut(z.submittedBy)===te)),j!=="all"&&(u=u.filter(z=>(z.status||"approved")===j)),ve==="title"?u.sort((z,M)=>String(z.title||"").localeCompare(String(M.title||""))):ve==="hot"?u.sort((z,M)=>(M.weight||M.links||0)-(z.weight||z.links||0)):u.sort((z,M)=>new Date(M.updated||0).getTime()-new Date(z.updated||0).getTime()),u},[D,ve,te,j]),E=(0,n.useMemo)(()=>[...new Set(D.map(u=>ut(u.submittedBy)))],[D]);return(0,e.jsxs)("div",{className:"memory-eternal-root",style:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,e.jsx)("style",{children:Oe}),ke&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(ke.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:ke.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:ke.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{children:ke.msg})]}),o&&(0,e.jsxs)("div",{className:"me-modal-head",children:[(0,e.jsxs)("div",{className:"me-modal-title",children:[(0,e.jsx)("span",{className:"me-wicon",children:(0,e.jsx)(Qt,{})}),(0,e.jsx)("h2",{children:t("memoryTitle")}),(0,e.jsx)("span",{children:t("memoryHint")})]}),(0,e.jsx)("div",{className:"spacer"}),f&&(0,e.jsx)("button",{type:"button",className:"me-modal-close",onClick:f,"aria-label":t(c?"exitFull":"fullscreen"),children:c?"\u2750":"\u26F6"}),(0,e.jsx)("button",{type:"button",className:"me-modal-close",onClick:l,"aria-label":t("close"),children:"\u2715"})]}),h&&h.ok===!1&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,margin:"0 0 8px",padding:"9px 14px",borderRadius:10,background:"rgba(239,68,68,0.10)",border:"1px solid rgba(239,68,68,0.45)",borderLeft:"4px solid #ef4444",color:"var(--dsw-alias-label-primary, #e5e7eb)",fontSize:12.5,lineHeight:1.6},children:[(0,e.jsxs)("span",{style:{fontWeight:800},children:["\u26A0 ",t("captureAlert")]}),(0,e.jsxs)("span",{style:{flex:1},children:[h.reason,(0,e.jsx)("div",{style:{opacity:.68,fontSize:11.5,marginTop:2},children:t("captureAlertHint")})]}),(0,e.jsx)("span",{style:{opacity:.7},children:h.since?pt(new Date(h.since).toISOString()):""})]}),(0,e.jsxs)("div",{className:"me-modal-body",children:[(0,e.jsxs)("div",{className:`mc-rail${Me?" open":""}`,children:[(0,e.jsx)("button",{type:"button",className:"mc-rail-collapse",onClick:()=>De(u=>!u),"aria-label":t(Me?"collapse":"expand"),title:t(Me?"collapse":"expand"),children:Me?"\xAB":"\xBB"}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="cards"?" active":""}`,onClick:()=>ie("cards"),title:t("cardsTab"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F9E0}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("cardsTab")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="graph"?" active":""}`,onClick:()=>ie("graph"),title:t("graphTab"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F52E}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("graphTab")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="stats"?" active":""}`,onClick:()=>ie("stats"),title:t("tabUsage"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F4C8}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabUsage")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="audit"?" active":""}`,onClick:()=>ie("audit"),title:t("tabAudit"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F50D}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabAudit")}),Ce>0&&(0,e.jsx)("span",{className:"mc-dot",children:Ce>99?"99+":Ce})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="optimize"?" active":""}`,onClick:()=>ie("optimize"),title:t("tabRecycle"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u267B\uFE0F"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabRecycle")}),de>0&&(0,e.jsx)("span",{className:"mc-dot",style:{background:"#6b7280"},children:de>99?"99+":de})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="config"?" active":""}`,onClick:()=>ie("config"),title:t("tabConfig"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u2699\uFE0F"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabConfig")})]}),(0,e.jsxs)("button",{type:"button",className:"mc-railbtn",onClick:()=>Ne(!0),title:t("fbNav"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F41E}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("fbNav")})]})]}),(0,e.jsxs)("div",{className:"mc-main",ref:se,children:[i&&i.db&&i.db.writable===!1?(0,e.jsxs)("div",{style:{margin:"8px 10px 0",padding:"8px 12px",borderRadius:8,fontSize:12,lineHeight:1.7,background:"rgba(239,68,68,0.10)",border:"1px solid rgba(239,68,68,0.35)",color:"#b91c1c"},children:["\u26A0\uFE0F ",t("dbReadonlyTitle"),"\uFF1A",i.db.error||"\u2014"," \u2014\u2014 ",t("dbReadonlyBody"),(0,e.jsx)("div",{style:{opacity:.85,marginTop:2},children:t("dbReadonlyFix")})]}):null,X==="cards"&&(0,e.jsxs)("div",{className:"mc-stats",children:[(0,e.jsx)(dt,{label:t("total"),value:i?i.total:"\u2014"}),(0,e.jsx)(dt,{label:t("recent"),value:i?i.recent:"\u2014"}),(0,e.jsx)(dt,{label:t("tags"),value:i?i.tags:"\u2014"}),(0,e.jsx)(dt,{label:t("pending"),value:i?.quarantine?.pending??i?.status?.pending??0}),(0,e.jsx)(dt,{label:t("rejected"),value:i?.quarantine?.rejected??i?.status?.rejected??0}),(0,e.jsx)(dt,{label:t("cardCount"),value:i?i.byKind?.knowledge??0:"\u2014"})]}),X==="cards"&&(0,e.jsxs)("div",{className:"mc-toolbar",children:[(0,e.jsx)("input",{type:"text",placeholder:t("searchPlaceholder"),value:A,onChange:u=>tt(u.target.value)}),(0,e.jsx)("input",{ref:Pe,type:"file",accept:".json,application/json",style:{display:"none"},onChange:d}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>Pe.current&&Pe.current.click(),children:t("importVault")}),(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",onClick:()=>x({kind:"knowledge",title:"",body:"",tags:"",template:""}),children:["+ ",t("newCard")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:y,onClick:()=>Le("md"),children:t(y?"exporting":"exportVault")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:y,onClick:()=>Le("json"),children:t(y?"exporting":"exportJson")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>ge(),children:t("refresh")})]}),X==="cards"&&(0,e.jsxs)("div",{className:"mc-chips",children:[Lt.map(u=>(0,e.jsx)("button",{type:"button",className:`mc-chip${v===u?" active":""}`,onClick:()=>we(u),children:t(u==="all"?"all":qe[u])},u)),(0,e.jsxs)("select",{value:te,onChange:u=>Y(u.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsxs)("option",{value:"all",children:["\u{1F916} ",t("allAgents")]}),Zt(E).map(u=>(0,e.jsx)("option",{value:u,children:u},u))]}),(0,e.jsxs)("select",{value:j,onChange:u=>Ae(u.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("allStatus")}),(0,e.jsx)("option",{value:"approved",children:t("statusApproved")}),(0,e.jsx)("option",{value:"pending",children:t("statusPending")}),(0,e.jsx)("option",{value:"rejected",children:t("statusRejected")})]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),[{key:"recent",label:t("sortRecent")},{key:"title",label:t("sortTitle")},{key:"hot",label:t("sortHot")}].map(u=>(0,e.jsx)("button",{type:"button",className:`mc-chip${ve===u.key?" active":""}`,onClick:()=>C(u.key),children:u.label},u.key))]}),I&&(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",I]}),(0,e.jsx)("div",{style:{display:X==="cards"?"contents":"none"},children:H?(0,e.jsx)("div",{className:"mc-empty",children:t("loading")}):I?(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",I," ",(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>ge(),children:t("retry")})]}):D.length===0?(0,e.jsx)("div",{className:"mc-empty",children:t("empty")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"mc-grid",children:P.map(u=>(0,e.jsx)(Ia,{card:u,t,query:A.trim(),onOpen:nt,onDelete:a},u.path))}),D.length<We&&(0,e.jsx)("div",{ref:$,style:{height:1}}),p&&(0,e.jsxs)("div",{className:"mc-empty",style:{padding:"10px 0"},children:[t("loading"),"\uFF08",D.length," / ",We,"\uFF09"]})]})}),(0,e.jsx)("div",{style:{display:X==="graph"?"flex":"none",flex:1,minHeight:0},children:Z.has("graph")&&(0,e.jsx)(Pa,{t,onOpen:nt,all:le,onAllChange:ye,onMutate:Se,active:X==="graph",visible:X==="graph"})}),(0,e.jsx)("div",{style:{display:X==="config"?"contents":"none"},children:Z.has("config")&&(0,e.jsx)(ta,{t,onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="stats"?"contents":"none"},children:Z.has("stats")&&(0,e.jsx)(La,{t,tab:"stats",onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="audit"?"contents":"none"},children:Z.has("audit")&&(0,e.jsx)(Da,{t,onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="optimize"?"contents":"none"},children:Z.has("optimize")&&(0,e.jsx)(za,{t,onReload:()=>ge(),version:R})}),Be&&(0,e.jsx)(Ba,{t,onClose:()=>Ne(!1)}),re&&(0,e.jsx)(ja,{t,card:re,query:A.trim(),onClose:()=>J(null),onDelete:u=>{J(null),a(u)},onFeedback:u=>{let z=re.path;fetch(`${O}/feedback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:A.trim(),path:z,useful:u})}).then(()=>Q({ok:!0,msg:t(u?"fbUseful":"fbIrr")})).catch(()=>{}),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2e3)}}),(0,e.jsx)(Aa,{t,newCard:s,setNewCard:x,onCreated:()=>{ge(),Se(),Q({ok:!0,msg:t("created")}),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2e3)}})]})]})]})}var ea=({toast:t})=>t?(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"8px 12px",fontSize:12,borderLeft:"4px solid "+(t.ok?"#10b981":"#ef4444"),background:t.ok?"rgba(16,185,129,0.08)":"rgba(239,68,68,0.08)"},children:[t.ok?"\u2705":"\u26A0"," ",t.msg]}):null,dt=({label:t,value:o})=>(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:o}),(0,e.jsx)("span",{children:t})]});function ta({t,onReload:o,version:l,compact:f}){let[c,i]=(0,n.useState)(null),[w,D]=(0,n.useState)(0),[k,H]=(0,n.useState)(null),[S,h]=(0,n.useState)(null),[g,I]=(0,n.useState)(!1),[T,v]=(0,n.useState)(!1),B=(0,n.useRef)(!1),A=(0,n.useRef)(null),K=(0,n.useRef)({}),[te,Y]=(0,n.useState)(null),[j,Ae]=(0,n.useState)(null),[X,be]=(0,n.useState)(""),[Z,U]=(0,n.useState)(""),[ie,ve]=(0,n.useState)(""),[C,ke]=(0,n.useState)(null),Q=(0,n.useCallback)(async d=>{U("version");try{let P=await fetch(O+"/version-check"+(d?"?force=1":"")).then(E=>E.json());P&&P.ok?(ke(P),d&&J(P.updateAvailable?t("vcLatest")+" v"+P.latest:t("vcUpToDate"))):d&&J(t("vcCheckFail"),!1)}catch{d&&J(t("vcCheckFail"),!1)}finally{U("")}},[t]);(0,n.useEffect)(()=>{Q(!1)},[l,Q]);let[pe,Pe]=(0,n.useState)(""),[y,W]=(0,n.useState)(null),re=(0,n.useRef)(null),J=(d,P=!0)=>{re.current&&clearTimeout(re.current),W({msg:d,ok:P}),re.current=setTimeout(()=>W(null),1900)},le=async()=>{if(!Z){U("restart");try{let d=await fetch(O+"/restart-self",{method:"POST"});if(d.status===404||d.status===405){J(x("vcRestartNoRoute",{cmd:C&&C.restartCommand||"dsh-memory restart --port 7999"}),!1);return}let P=await d.json().catch(()=>null);if(!P){J(t("vcRestartFail")+"\uFF08HTTP "+d.status+"\uFF09",!1);return}if(!P.ok){J(P.error||t("vcRestartFail"),!1);return}if(P.alreadyCurrent){J(P.note||t("vcRestartCurrent"));return}J(P.note||t("vcRestartSent")),P.alreadyRunning||setTimeout(()=>{Q(!0)},6e3)}catch(d){J(t("vcRestartFail")+"\uFF1A"+String(d&&d.message||d),!1)}finally{U("")}}},ye=C&&C.resident?String(C.resident.served||""):"",Be=!!(C&&C.onDisk&&ye&&ye!==C.onDisk),Ne=!!(C&&C.resident&&C.resident.managed===!1&&C.resident.managedKnown===!1),Me=!!(C&&C.resident&&C.resident.managed===!1&&!Ne),De=!!(C&&C.resident&&!ye),s=Be||De||Me||Ne,x=(d,P)=>Object.keys(P).reduce((E,u)=>E.split("{"+u+"}").join(P[u]),t(d)),R=(0,n.useCallback)(async()=>{try{let[d,P,E]=await Promise.all([fetch(`${O}/config`).then(u=>u.json()).catch(()=>null),fetch(`${O}/setup-status`).then(u=>u.json()).catch(()=>null),fetch(`${O}/budget`).then(u=>u.json()).catch(()=>null)]);if(d&&d.ok){i(d),D(d.revision??0),H(d.schema??null);let u=qt(d.config??{},K.current);K.current=u.overlay,h({...u.values}),Y(d.dsh??null),I(d.writable===!1),v(d.viaPending===!0),be(""),B.current=!1}else E&&E.ok?(h({...E}),I(!0),be(t("configNeedsDsh"))):be(t("adminLoadFail"));P&&P.ok&&Ae(P),ve("")}catch{be(t("adminLoadFail"))}},[t]);(0,n.useEffect)(()=>{R()},[l,R]);let G=(d,P)=>{B.current=!0,h(E=>({...E??{},[d]:P}))};(0,n.useEffect)(()=>{A.current=R},[R]),(0,n.useEffect)(()=>{if(typeof EventSource>"u")return;let d=null;try{d=new EventSource(O+"/events")}catch{return}let P=()=>{!B.current&&typeof A.current=="function"&&A.current()};try{d.addEventListener("config",P)}catch{}return()=>{try{d.close()}catch{}}},[]);let Se=new Set(["dedupThreshold","captureMinChars","captureCooldownMs","maxCardsPerDay","captureMaxTokens","recallMinScore","recallLimit","recallSummaryLen","recycleRetentionDays","webPort","webCheckIntervalMs","webMaxRestart","sessionBudgetChars"]),Ce=d=>({init:t("modeInit"),interval:t("modeInterval"),manual:t("modeManual")})[d]||d,de=async()=>{if(!S)return;if(g){J(t("editInSetting"),!1);return}let d={dedupThreshold:[0,1],captureMinChars:[0,1e6],captureCooldownMs:[0,1e9],maxCardsPerDay:[0,1e6],captureMaxTokens:[100,4e3],recallMinScore:[0,50],recallLimit:[1,20],recallSummaryLen:[40,400],recycleRetentionDays:[1,3650],webPort:[1,65535],webCheckIntervalMs:[1e3,6e5],webMaxRestart:[1,1e3],sessionBudgetChars:[0,1e9]},P=[];for(let[E,[u,z]]of Object.entries(d)){if(!(E in S))continue;let M=S[E],q=typeof M=="number"?M:Number(M);(M===""||M===null||M===void 0||!Number.isFinite(q)||q<u||q>z)&&P.push(t("invalidField",{field:E,min:u,max:z,value:String(M===""?"\u7A7A":M)}))}if(P.length){let E=t("saveInvalid")+"\uFF1A"+P.join("\uFF1B");be(E),J(E,!1);return}U("save");try{let E={...S};for(let q of Object.keys(S))q in E&&typeof E[q]=="string"&&E[q].trim()!==""&&Se.has(q)&&(E[q]=Number(E[q]));Array.isArray(E.vaultProfiles)&&(E.vaultProfiles=E.vaultProfiles.filter(q=>q&&(String(q.name||"").trim()||String(q.path||"").trim())));let u=await fetch(`${O}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patch:E,expectedRevision:w})}),z=await u.text(),M=null;try{M=z?JSON.parse(z):null}catch{M=null}if(M||(M={error:"HTTP "+u.status+(z?"\uFF1A"+z.slice(0,200):"\uFF08\u5BBF\u4E3B\u672A\u8FD4\u56DE\u539F\u56E0\uFF0C\u8BF7\u68C0\u67E5\u662F\u5426\u6709\u6570\u5B57\u5B57\u6BB5\u4E3A\u7A7A\u6216\u8D85\u51FA\u8303\u56F4\uFF09")}),M&&M.ok){let q=typeof M.pendingOutcome=="string"?M.pendingOutcome:"",_,me=!0;if(q==="applied")_=t("savedApplied")+(Array.isArray(M.applied)&&M.applied.length?" \xB7 "+M.applied.join("\u3001"):"");else if(q==="queued")me=!1,_=t("saveQueued");else if(q==="failed")me=!1,_=t("saveFail")+" \xB7 "+(M.hostGuard?t("saveHostGuard"):t("saveFailHint"));else if(q==="applied-direct")_=t("savedOk")+" \xB7 "+t("savedDirect");else{let ze=Array.isArray(M.pending)&&M.pending.length?" \xB7 "+t("savePending"):M.note?" \xB7 "+t("restartHint"):"";_=(M.retried?"\u267B ":"")+t("savedOk")+ze}K.current={...K.current,...E},me?ve(_):be(_),J(_,me),await R()}else{let q=u.status===409?t("conflictRefresh"):M?.error||t("saveFail");be(q),J(q,!1)}}catch{be(t("saveFail")),J(t("saveFail"),!1)}finally{U("")}},ee=()=>{K.current={},h({...c?.config??{}}),ve("")},We={env:"vaultSrcEnv",profile:"vaultSrcProfile",workspace:"vaultSrcWorkspace",vaultDir:"vaultSrcVaultDir",default:"vaultSrcDefault"},Re=d=>Array.isArray(d?.vaultProfiles)?d.vaultProfiles:[],p=(d,P,E)=>h(u=>{let z=Re(u).map(q=>({...q||{}})),M={...z[d]||{}};return P==="match"?String(E).trim()?M.match={...M.match||{},workspace:E}:delete M.match:M[P]=E,z[d]=M,{...u??{},vaultProfiles:z}}),r=()=>h(d=>({...d??{},vaultProfiles:[...Re(d),{name:"",path:""}]})),$=d=>h(P=>({...P??{},vaultProfiles:Re(P).filter((E,u)=>u!==d)})),se={fontSize:11,padding:"2px 8px",background:"var(--dsw-alias-bg-layer-2, #f3f4f6)",borderRadius:6},ce={padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"transparent",color:"inherit",font:"inherit",fontSize:12,minWidth:0},ge={A:{label:t("planA"),autoWebMode:"init",watchdogAutoSpawn:!1,distillEnabled:!0,dedupByLLM:!0,captureMaxTokens:4e3,recallMinScore:2,recallLimit:5,recallSummaryLen:130,recallIncludeBody:!1,captureCooldownMs:3e5},B:{label:t("planB"),autoWebMode:"init",watchdogAutoSpawn:!1,distillEnabled:!1,dedupByLLM:!1,captureMaxTokens:500,recallMinScore:3,recallLimit:3,recallSummaryLen:80,recallIncludeBody:!1,captureMinChars:300,maxCardsPerDay:40,captureCooldownMs:3e5},C:{label:t("planC"),autoWebMode:"interval",watchdogAutoSpawn:!0,distillEnabled:!0,dedupByLLM:!0,captureMaxTokens:1200,recallMinScore:1,recallLimit:8,recallSummaryLen:200,recallIncludeBody:!0,captureCooldownMs:12e4}},a=async d=>{let P=ge[d];P&&h(E=>({...E??{},...P}))},tt=async(d,P)=>{U(d+P);try{let u=await(await fetch(`${O}/mcp/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:d,action:P})})).json();u&&u.ok?J(x(P==="install"?"mcpInstalled":"mcpUninstalled",{agent:d})):J(x("mcpActionFail",{agent:d,error:u?.error||""}),!1);try{let z=await fetch(`${O}/setup-status`).then(M=>M.json());z&&z.ok&&Ae(z)}catch{}}catch{J(t("mergeFail"),!1)}finally{U("")}},we=({k:d,label:P,type:E="text",step:u,min:z,max:M})=>(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12,minWidth:0},children:[(0,e.jsx)("span",{style:{opacity:.6,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.5},children:P||d}),(0,e.jsx)("input",{type:E,step:u,min:z,max:M,value:S?S[d]??"":"",onChange:q=>{let _=q.target.value;G(d,E==="number"?_===""?"":Number(_):_)},style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12}})]}),nt=new Set(["autoRestartOnDrift"]),Le=({k:d,label:P})=>{let E=S?S[d]:void 0,u=E===void 0?nt.has(d):!!E;return(0,e.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:6,fontSize:12,minWidth:0,lineHeight:1.5},children:[(0,e.jsx)("input",{type:"checkbox",checked:u,onChange:z=>G(d,z.target.checked),style:{marginTop:2,flex:"0 0 auto"}}),(0,e.jsx)("span",{style:{whiteSpace:"normal",overflowWrap:"anywhere"},children:P||d})]})};return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:f?"0 0 auto":1,minHeight:0,maxHeight:f?"52vh":void 0},children:[(0,e.jsx)("style",{children:Oe}),y&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(y.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:y.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:y.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{style:{wordBreak:"break-all"},children:y.msg})]}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[X&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #ef4444",background:"rgba(239,68,68,0.08)",padding:"12px 14px",marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:13,color:"#b91c1c",fontWeight:600,marginBottom:6},children:["\u26A0 ",X]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:R,children:["\u21BB ",t("retry")]})]}),T&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #3b82f6",background:"rgba(59,130,246,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#1d4ed8",lineHeight:1.7},children:["\u2139 ",t("pendingSyncNote")]}),g&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #f59e0b",background:"rgba(245,158,11,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#b45309"},children:["\u2139\uFE0F ",t("configNeedsDsh")," \u2014\u2014 ",t("editInSetting")]}),ie&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #10b981",background:"rgba(16,185,129,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#059669"},children:["\u2713 ",ie]}),c&&(c.version||c.dsh?.vaultDir)&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"10px 14px"},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F4E6} ",t("pluginInfo")]}),(0,e.jsx)("span",{style:{fontSize:12,opacity:.7},children:t("dshHostLabel")}),c.version&&(0,e.jsxs)("code",{style:se,children:[t("vcLoaded")," v",c.version]}),C&&C.resident&&C.resident.served&&C.resident.served!==c.version&&(0,e.jsxs)("code",{style:se,children:[t("vcResident")," v",C.resident.served]}),C&&C.resident&&!C.resident.served&&(0,e.jsxs)("code",{style:{...se,color:"#b45309",fontWeight:600},children:[t("vcResident")," ",t("vcResidentDownShort")]}),C&&C.resident&&C.resident.served&&C.resident.managed===!1&&(0,e.jsxs)("code",{style:{...se,color:"#b45309",fontWeight:600},children:[t("vcResident")," v",C.resident.served," \xB7 ",t(Ne?"vcResidentLockUnknownShort":"vcResidentUnmanagedShort")]}),bt&&(0,e.jsxs)("code",{style:se,children:[t("vcPage")," v",bt]}),C&&C.onDisk&&(0,e.jsxs)("code",{style:se,children:[t("vcOnDisk")," v",C.onDisk]}),C&&C.latest&&(0,e.jsxs)("code",{style:se,children:[t("vcLatest")," v",C.latest]}),c.dsh?.vaultDir&&(0,e.jsxs)("span",{style:{fontSize:11,opacity:.6},children:["\u{1F4C1} ",c.dsh.vaultDir]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:Z==="version",onClick:()=>Q(!0),children:Z==="version"?t("checking"):"\u{1F504} "+t("vcCheck")})]}),C&&(C.stale||De||Me||Ne)&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,color:"#b45309",background:"rgba(245,158,11,0.12)",border:"1px solid rgba(245,158,11,0.35)",borderRadius:8,padding:"6px 10px"},children:[(0,e.jsxs)("div",{children:["\u26A0\uFE0F ",C.stale?x("vcStale",{disk:C.onDisk,loaded:C.loaded}):De?x("vcResidentDown",{port:C.resident&&C.resident.port||"",cmd:C.restartCommand||"dsh-memory restart --port 7999"}):Ne?x("vcResidentLockUnknown",{served:ye,path:C.resident&&C.resident.lock&&C.resident.lock.path||"",err:C.resident&&C.resident.lock&&C.resident.lock.error||""}):x("vcResidentUnmanaged",{served:ye,cmd:C.restartCommand||"dsh-memory restart --port 7999"})]}),s?(0,e.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Z,onClick:le,children:Z==="restart"?"\u23F3 "+t("vcRestarting"):"\u{1F504} "+t("vcRestart")}),C.restartCommand&&(0,e.jsx)("code",{style:{fontSize:11,opacity:.75},children:C.restartCommand})]}):(0,e.jsxs)("div",{style:{marginTop:6,lineHeight:1.7},children:["\u2139\uFE0F ",t("vcHostStale"),C.restartCommand&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("code",{style:{fontSize:11,opacity:.75},children:C.restartCommand})]})]})]}),bt&&C&&C.onDisk&&bt!==C.onDisk&&(0,e.jsx)("div",{style:{marginTop:8,fontSize:11.5,color:"#b45309",background:"rgba(245,158,11,0.12)",border:"1px solid rgba(245,158,11,0.35)",borderRadius:8,padding:"6px 10px",lineHeight:1.7},children:t("vcPageStale",{page:bt,disk:C.onDisk})}),C&&C.updateAvailable&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,opacity:.88},children:["\u2B06 ",t("vcOutdated")," \u2192 ",(0,e.jsx)("code",{children:C.updateCommand})]}),C&&C.checkError&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,color:"#b91c1c"},children:[t("vcCheckFail"),"\uFF1A",C.checkError]})]}),j&&j.agents&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F50C} ",t("mcpSetupStatus")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("mcpManageHint")})]}),(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:j.agents.map(d=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[(0,e.jsxs)("span",{style:{flex:1},children:[(0,e.jsx)("b",{children:d.isDsh?t("dshHostLabel"):d.name}),d.isDsh&&d.version&&(0,e.jsxs)("span",{style:{marginLeft:6,fontSize:11,opacity:.5},children:["v",d.version]}),!d.installed&&(0,e.jsxs)("span",{style:{marginLeft:6,opacity:.6},children:["(",t("notInstalled"),")"]}),d.installed&&d.mcpConfigured===!1&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#f59e0b"},children:["(",t("noMcpEntry"),")"]}),d.mcpConfigured===!0&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#10b981"},children:["\u2713 ",t("healthy")]}),d.mcpConfigured===!0&&d.mcpMatchesCurrentNode===!1&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#9ca3af",fontSize:10},children:["(",t("nodePathNote"),")"]}),d.isDsh&&(0,e.jsxs)("span",{style:{marginLeft:6,opacity:.6,fontSize:11},children:["(",t("recallTool"),": ",d.recallTool?t("enabled"):t("disabled"),")"]})]}),d.hook&&(0,e.jsxs)("span",{style:{fontSize:11,opacity:.7},children:["hook: ",d.hook]}),!d.isDsh&&d.installed&&d.mcpConfigured===!1&&(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Z,onClick:()=>tt(d.name,"install"),children:t("installMcp")}),!d.isDsh&&d.installed&&d.mcpConfigured===!0&&(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},disabled:!!Z,onClick:()=>{window.confirm(t("uninstallConfirm"))&&tt(d.name,"uninstall")},children:t("uninstallMcp")})]},d.name))}),(0,e.jsx)("div",{style:{fontSize:11,opacity:.55,marginTop:6},children:t("mcpSetupHint")}),pe&&(0,e.jsx)("div",{style:{fontSize:11,marginTop:6},children:(0,e.jsx)("code",{style:{padding:"2px 6px",background:"var(--dsw-alias-bg-layer-2, #f3f4f6)",borderRadius:4},children:pe})})]}),S?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #3b82f6"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F3AF} ",t("presetConfig")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("presetHint")})]}),(0,e.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["A","B","C"].map(d=>(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>a(d),disabled:!!Z,children:[d==="A"?"\u{1F7E2} ":d==="B"?"\u{1F4B0} ":"\u2B50 ",ge[d].label]},d))})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9E0} ",t("dshMemoryConfig")]})}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"autoCapture",label:t("autoCapture")}),(0,e.jsx)(Le,{k:"autoRecall",label:t("autoRecall")}),(0,e.jsx)(we,{k:"captureMinChars",label:t("captureMinChars"),type:"number"}),(0,e.jsx)(we,{k:"maxCardsPerDay",label:t("maxCardsPerDay"),type:"number"}),(0,e.jsx)(we,{k:"dedupThreshold",label:t("dedupThreshold"),type:"number",step:"0.01",min:"0",max:"1"}),(0,e.jsx)(we,{k:"recallLimit",label:t("recallLimit"),type:"number"}),(0,e.jsx)(we,{k:"recallSummaryLen",label:t("recallSummaryLen"),type:"number"}),(0,e.jsx)(Le,{k:"recallIncludeBody",label:t("recallBody")}),(0,e.jsx)(we,{k:"secretHint",label:t("secretHint")}),(0,e.jsx)(we,{k:"recallEmbedding",label:t("recallEmbedding")})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #06b6d4"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F5C2}\uFE0F ",t("vaultMulti")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("vaultMultiHint")})]}),(0,e.jsxs)("div",{style:{fontSize:11.5,opacity:.85,marginBottom:8,lineHeight:1.7},children:[t("vaultNow"),"\uFF1A",(0,e.jsx)("code",{children:te?.vaultDir||"\u2014"}),te?.vaultName?`\uFF08${te.vaultName}\uFF09`:""," \xB7 ",t("vaultSource"),"\uFF1A",t(We[te?.vaultSource]||"vaultSrcDefault"),te?.workspace?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("br",{}),t("vaultWorkspace"),"\uFF1A",(0,e.jsx)("code",{children:te.workspace})]}):null]}),Re(S).map((d,P)=>(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1.6fr 1.5fr auto",gap:6,marginBottom:6},children:[(0,e.jsx)("input",{value:d.name||"",placeholder:t("vaultNamePh"),onChange:E=>p(P,"name",E.target.value),style:ce,disabled:g}),(0,e.jsx)("input",{value:d.path||"",placeholder:t("vaultPathPh"),onChange:E=>p(P,"path",E.target.value),style:ce,disabled:g}),(0,e.jsx)("input",{value:d.match&&d.match.workspace||"",placeholder:t("vaultMatchPh"),onChange:E=>p(P,"match",E.target.value),style:ce,disabled:g}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>$(P),disabled:g,title:t("delete"),children:"\u2715"})]},P)),(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginTop:4},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:r,disabled:g,children:["\uFF0B ",t("vaultAdd")]}),(0,e.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12},children:[(0,e.jsx)("span",{style:{opacity:.6},children:t("vaultActive")}),(0,e.jsxs)("select",{value:S.activeVault||"",onChange:d=>G("activeVault",d.target.value),disabled:g,style:ce,children:[(0,e.jsx)("option",{value:"",children:t("vaultActiveNone")}),Re(S).filter(d=>d&&d.name).map(d=>(0,e.jsx)("option",{value:d.name,children:d.name},d.name))]})]})]})]}),(0,e.jsx)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"enabled",label:t("enabledLabel")}),(0,e.jsx)(we,{k:"vaultDir",label:t("vaultDirLabel")})]})}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #f59e0b"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F4B0} ",t("costControl")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("costHint")})]}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8,marginTop:6},children:[(0,e.jsx)(Le,{k:"distillEnabled",label:t("distillEnabled")}),(0,e.jsx)(Le,{k:"dedupByLLM",label:t("dedupByLLM")}),(0,e.jsx)(we,{k:"captureMaxTokens",label:t("captureMaxTokens"),type:"number"}),(0,e.jsx)(we,{k:"recallMinScore",label:t("recallMinScore"),type:"number"}),(0,e.jsx)(we,{k:"captureCooldownMs",label:t("captureCooldownMs"),type:"number"}),(0,e.jsx)(we,{k:"captureProvider",label:t("captureProvider")}),(0,e.jsx)(we,{k:"captureModel",label:t("captureModel")}),(0,e.jsx)(we,{k:"sessionBudgetChars",label:t("sessionBudgetChars"),type:"number"})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #8b5cf6"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E1}\uFE0F ",t("auditConfig")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("auditHint")})]}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8},children:[(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12,minWidth:0},children:[(0,e.jsx)("span",{style:{opacity:.6,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.5},children:t("auditMode")}),(0,e.jsxs)("select",{value:S.auditMode??"all",onChange:d=>G("auditMode",d.target.value),style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12},children:[(0,e.jsx)("option",{value:"all",children:t("auditAll")}),(0,e.jsx)("option",{value:"none",children:t("auditNone")})]})]}),(0,e.jsx)(Yt,{label:t("auditExemptAgents"),value:S.auditExemptAgents||[],options:[{value:"__all__",label:t("allExempt")},...(j?.agents||[]).filter(d=>!d.isDsh).map(d=>({value:d.name,label:d.name}))],onChange:d=>G("auditExemptAgents",d)}),(0,e.jsx)(Yt,{label:t("auditExemptKinds"),value:S.auditExemptKinds||[],options:[{value:"__all__",label:t("allExempt")},...Lt.filter(d=>d!=="all").map(d=>({value:d,label:t(qe[d])}))],onChange:d=>G("auditExemptKinds",d)}),(0,e.jsx)(we,{k:"recycleRetentionDays",label:t("recycleDays"),type:"number"})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E0} ",t("serviceConfig")]})}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"autoWeb",label:t("autoWeb")}),(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[(0,e.jsx)("span",{style:{opacity:.6},children:t("autoWebMode")}),(0,e.jsxs)("select",{value:S.autoWebMode??"init",onChange:d=>G("autoWebMode",d.target.value),style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12},children:[(0,e.jsx)("option",{value:"init",children:t("modeInit")}),(0,e.jsx)("option",{value:"interval",children:t("modeInterval")}),(0,e.jsx)("option",{value:"manual",children:t("modeManual")})]})]}),(0,e.jsx)(we,{k:"webPort",label:t("webPort"),type:"number"}),(0,e.jsx)(we,{k:"webCheckIntervalMs",label:t("webCheckIntervalMs"),type:"number"}),(0,e.jsx)(we,{k:"webMaxRestart",label:t("webMaxRestart"),type:"number"}),(0,e.jsx)(Le,{k:"watchdogAutoSpawn",label:t("watchdogAutoSpawn")}),(0,e.jsx)(Le,{k:"autoRestartOnDrift",label:t("autoRestartOnDrift")}),(0,e.jsx)(Le,{k:"autoMcpSetup",label:t("autoMcpSetup")})]})]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",alignItems:"center",marginBottom:10,flexWrap:"wrap"},children:[Z==="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,opacity:.75},children:["\u23F3 ",t("saving")]}),ie&&Z!=="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,color:"#10b981"},children:["\u2705 ",ie]}),X&&Z!=="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,color:"#b91c1c"},children:["\u26A0 ",X]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:ee,disabled:!!Z,children:t("reset")}),(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",onClick:g?()=>J(t("readonlyTitle")+"\uFF1A"+t("readonlyBody"),!1):de,disabled:Z==="save",title:t(g?"readonlyBody":"saveConfig"),children:Z==="save"?"\u23F3 "+t("saving"):g?"\u{1F512} "+t("readonlyBtn"):"\u{1F4BE} "+t("saveConfig")})]})]}):(0,e.jsx)("div",{style:{fontSize:12,opacity:.6},children:t("loading")})]})]})}function Da({t,onReload:o,version:l}){let[f,c]=(0,n.useState)([]),[i,w]=(0,n.useState)([]),[D,k]=(0,n.useState)("all"),[H,S]=(0,n.useState)("all"),[h,g]=(0,n.useState)(""),[I,T]=(0,n.useState)(new Set),[v,B]=(0,n.useState)(""),[A,K]=(0,n.useState)(null),[te,Y]=(0,n.useState)("pending"),j=(y,W=!0)=>{K({msg:y,ok:W}),setTimeout(()=>K(null),3e3)},Ae=[...new Set([...f,...i].map(y=>y.submittedBy).filter(Boolean))],X=(0,n.useCallback)(async()=>{try{let y=await fetch(`${O}/audit/list`).then(W=>W.json());y.ok&&(c(y.pending||[]),w(y.rejected||[]),T(new Set),ve(new Set),ke({}))}catch{}},[]);(0,n.useEffect)(()=>{X()},[l,X]);let be=(te==="pending"?f:i).filter(y=>{if(D!=="all"&&y.kind!==D||H!=="all"&&ut(y.submittedBy)!==H)return!1;if(h){let W=(y.created||"").slice(0,10);if(W&&W!==h)return!1}return!0}),Z=y=>T(W=>{let re=new Set(W);return re.has(y)?re.delete(y):re.add(y),re}),U=async(y,W)=>{let re=W||[...I];if(!re.length){j(t("noSelection"),!1);return}B("apply");let J=t(y==="approved"?"toastApproved":y==="rejected"?"toastRejected":"toastCardDeleted");try{let le=0;for(let ye of re){let Be=y==="approved"?"audit/approve":y==="rejected"?"audit/reject":"delete";try{(await fetch(O+"/"+Be+"?path="+encodeURIComponent(ye)+(y==="delete"?"&permanent=0":""))).ok||le++}catch{le++}}await X(),o&&o(),le?j(t("toastFailed")+"\uFF08"+le+"/"+re.length+"\uFF09",!1):j(J+" "+re.length+" \u5F20")}catch(le){j(t("toastFailed")+": "+String(le&&le.message||le),!1)}finally{B("")}},[ie,ve]=(0,n.useState)(new Set),[C,ke]=(0,n.useState)({}),Q=y=>C[y]||{},pe=async y=>{let W=y.path,re=!ie.has(W);if(ve(J=>{let le=new Set(J);return re?le.add(W):le.delete(W),le}),!(!re||C[W])){ke(J=>({...J,[W]:{loading:!0}}));try{let J=y.status||(te==="pending"?"pending":"rejected"),le=await fetch(`${O}/card?path=${encodeURIComponent(W)}&status=${J}`).then(ye=>ye.json());le&&le.ok?ke(ye=>({...ye,[W]:{text:le.text||""}})):ke(ye=>({...ye,[W]:{error:le&&le.error||"HTTP"}}))}catch(J){ke(le=>({...le,[W]:{error:String(J&&J.message||J)}}))}}},Pe=[...I];return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[(0,e.jsx)(ea,{toast:A}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E1}\uFE0F ",t("tabAudit")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("select",{value:D,onChange:y=>k(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("all")}),Lt.filter(y=>y!=="all").map(y=>(0,e.jsx)("option",{value:y,children:t(qe[y])},y))]}),(0,e.jsxs)("select",{value:H,onChange:y=>S(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("allAgents")}),Zt(Ae).map(y=>(0,e.jsx)("option",{value:y,children:y},y))]}),(0,e.jsx)("input",{type:"date",value:h,onChange:y=>g(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"}})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("button",{type:"button",className:`mc-btn${te==="pending"?" me-on":""}`,onClick:()=>Y("pending"),children:[t("pending"),"\uFF08",f.length,"\uFF09"]}),(0,e.jsxs)("button",{type:"button",className:`mc-btn${te==="rejected"?" me-on":""}`,onClick:()=>Y("rejected"),children:[t("rejected"),"\uFF08",i.length,"\uFF09"]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("label",{style:{fontSize:12},children:[(0,e.jsx)("input",{type:"checkbox",checked:be.length>0&&Pe.length===be.length,onChange:y=>{y.target.checked?T(new Set(be.map(W=>W.path))):T(new Set)}})," ",t("selectAll")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",disabled:!Pe.length||!!v,onClick:()=>U("approved"),children:["\u2713 ",t(te==="rejected"?"restore":"approve")]}),te==="pending"?(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!Pe.length||!!v,onClick:()=>U("rejected"),children:["\u2715 ",t("reject")]}):(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!Pe.length||!!v,onClick:()=>{window.confirm(t("recycleDeleteConfirm"))&&U("delete")},children:["\u{1F5D1} ",t("restoreDelete")]})]}),be.length?(0,e.jsx)("div",{className:"mc-card",style:{display:"flex",flexDirection:"column"},children:be.map(y=>{let W=Q(y.path),re=ie.has(y.path);return(0,e.jsxs)("div",{style:{borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px",fontSize:12},children:[(0,e.jsx)("input",{type:"checkbox",checked:I.has(y.path),onChange:()=>Z(y.path)}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"0 6px"},title:t(re?"collapse":"expand"),"aria-expanded":re,onClick:()=>pe(y),children:re?"\u25BE":"\u25B8"}),(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[y.kind]||"#999"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},title:t(re?"collapse":"expand"),onClick:()=>pe(y),children:y.title}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:ut(y.submittedBy)}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:y.created?y.created.slice(0,16).replace("T"," "):"-"}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:y.kind}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6,color:y.severity==="high"?"#f87171":"#9ca3af"},children:y.severity}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.reason||"-"}),te==="pending"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>U("approved",[y.path]),children:"\u2713"}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},onClick:()=>U("rejected",[y.path]),children:"\u2715"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},title:t("restore"),onClick:()=>U("approved",[y.path]),children:"\u2713"}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},title:t("restoreDelete"),onClick:()=>{window.confirm(t("recycleDeleteConfirm"))&&U("delete",[y.path])},children:"\u{1F5D1}"})]})]}),re&&(0,e.jsxs)("div",{style:{padding:"2px 10px 12px 34px"},children:[W.loading&&(0,e.jsxs)("div",{style:{fontSize:12,opacity:.6},children:["\u23F3 ",t("loading")]}),W.error&&(0,e.jsxs)("div",{style:{fontSize:12,color:"#f87171"},children:["\u26A0 ",t("auditBodyFail"),"\uFF1A",W.error]}),W.text!=null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"md-meta",style:{marginBottom:6},children:[(0,e.jsxs)("span",{className:"md-chip md-chip-kind",style:{color:Ve[y.kind]||"#6B7280",borderColor:(Ve[y.kind]||"#6B7280")+"59",background:(Ve[y.kind]||"#6B7280")+"1a"},children:[ht[y.kind]||"\u{1F4CE}"," ",t(qe[y.kind]||"kindKnowledge")]}),(Array.isArray(y.tags)?y.tags:[]).slice(0,8).map(J=>(0,e.jsxs)("span",{className:"md-chip md-chip-tag",children:["\u{1F3F7} ",J]},J)),!!y.reason&&(0,e.jsxs)("span",{className:"md-chip md-chip-st-warn",children:["\u2691 ",y.reason]})]}),(0,e.jsx)("div",{className:"md-doc",style:{maxHeight:340,overflow:"auto"},dangerouslySetInnerHTML:{__html:Dt(Ct(W.text).body)}}),te==="pending"&&(0,e.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",disabled:!!v,onClick:()=>U("approved",[y.path]),children:["\u2713 ",t("approve")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!!v,onClick:()=>U("rejected",[y.path]),children:["\u2715 ",t("reject")]})]})]})]})]},y.path)})}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:20,textAlign:"center"},children:t("noAuditItems")})]})]})}function za({t,onReload:o,version:l}){let[f,c]=(0,n.useState)([]),[i,w]=(0,n.useState)(""),[D,k]=(0,n.useState)(null),H=(g,I=!0)=>{k({msg:g,ok:I}),setTimeout(()=>k(null),3200)},S=(0,n.useCallback)(async()=>{try{let g=await fetch(`${O}/recycle/list`).then(I=>I.json());g.ok&&c(g.items||[])}catch{}},[]);(0,n.useEffect)(()=>{S()},[l,S]);let h=async(g,I)=>{let T=(f.find(v=>v.path===I)||{}).title||I;w(g+I);try{let B=await fetch(O+(g==="restore"?"/recycle/restore":"/recycle/purge")+"?path="+encodeURIComponent(I)),A=await B.json().catch(()=>null);await S(),o&&o(),B.ok&&(!A||A.ok!==!1)?H(t(g==="restore"?"toastRestored":"toastPurged")+"\uFF1A"+T):H(t("toastFailed")+"\uFF1A"+(A&&A.error||"HTTP "+B.status),!1)}catch(v){H(t("toastFailed")+"\uFF1A"+String(v&&v.message||v),!1)}finally{w("")}};return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[(0,e.jsx)(ea,{toast:D}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F5D1}\uFE0F ",t("tabRecycle")]}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("recycleHint")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!i||f.length===0,title:f.length?"":t("emptyRecycle"),onClick:async()=>{w("purgeAll");try{let g=await fetch(O+"/recycle/purge-expired?days=0"),I=await g.json().catch(()=>null);await S(),H(g.ok?t("toastPurgedExpired")+(I&&I.purged!=null?"\uFF08"+I.purged+"\uFF09":""):t("toastFailed"),g.ok)}catch(g){H(t("toastFailed")+"\uFF1A"+String(g&&g.message||g),!1)}finally{w("")}},children:t("emptyRecycle")})]}),f.length?(0,e.jsx)("div",{className:"mc-card",style:{display:"flex",flexDirection:"column"},children:f.map(g=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[g.kind]||"#999"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.title}),(0,e.jsxs)("span",{style:{fontSize:10,opacity:.6},children:[t("deletedAt")," ",(g.deletedAt||"").slice(0,10)]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!i,onClick:()=>h("restore",g.path),children:t("restore")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},disabled:!!i,onClick:()=>{window.confirm(t("purgeConfirm"))&&h("purge",g.path)},children:t("purge")})]},g.path))}):(0,e.jsxs)("div",{className:"mc-card",style:{padding:18,fontSize:12.5,opacity:.78,textAlign:"center",lineHeight:1.9},children:["\u{1F5D1}\uFE0F ",t("emptyRecycle"),(0,e.jsx)("br",{}),(0,e.jsx)("span",{style:{fontSize:11.5},children:t("recycleEmptyHint").split("{days}").join("30")})]})]})]})}var Ia=({card:t,t:o,onOpen:l,query:f,onDelete:c})=>(0,e.jsxs)("article",{className:"mc-cardrow mc-card",onClick:()=>l(t),children:[(0,e.jsxs)("h4",{children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[t.kind]||Ve.other}}),(0,e.jsx)("span",{style:{marginRight:4},children:ht[t.kind]||"\u{1F4CE}"}),f?Gt(t.title,f):t.title,Oa(t.updated)&&(0,e.jsx)("span",{className:"mc-new",children:o("newBadge")}),t.status==="pending"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#f59e0b"},children:["\u23F3 ",o("statusPending")]}),t.status==="rejected"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#ef4444"},children:["\u274C ",o("statusRejected")]}),(!t.status||t.status==="approved")&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#10b981"},children:["\u2705 ",o("statusApproved")]})]}),(0,e.jsx)("p",{children:f?Gt(t.summary||"",f):t.summary||""}),t.tags.length>0&&(0,e.jsx)("div",{className:"mc-tags",children:t.tags.slice(0,4).map(i=>(0,e.jsxs)("span",{className:"mc-tag",children:["\u{1F3F7} ",i]},i))}),(0,e.jsxs)("footer",{children:[(0,e.jsxs)("span",{children:[ht[t.kind]||"\u{1F4CE}"," ",o(qe[t.kind])]}),(0,e.jsxs)("span",{style:{fontSize:10,opacity:.6},children:["\u{1F916} ",ut(t.submittedBy)]}),(0,e.jsxs)("span",{children:["\u{1F4C5} ",pt(t.updated)]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-card-del",title:o("delete"),onClick:i=>{i.stopPropagation(),window.confirm(o("deleteConfirm"))&&c&&c(t.path)},children:"\u{1F5D1}"})]})]});function La({t,tab:o,onReload:l,version:f}){let[c,i]=(0,n.useState)(null),[w,D]=(0,n.useState)(""),[k,H]=(0,n.useState)(null),[S,h]=(0,n.useState)(null),[g,I]=(0,n.useState)(null),[T,v]=(0,n.useState)(null),B=(0,n.useCallback)(async()=>{j("align");try{let s=await fetch(O+"/align").then(x=>x.json());s&&s.findings?v(s):notify(t("alignFail"),!1)}catch{notify(t("alignFail"),!1)}finally{j("")}},[t]),A=async()=>{if(window.confirm(t("alignFixConfirm"))){j("alignfix");try{let s=await fetch(O+"/setup-run",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(x=>x.json());s&&s.ok?(notify(t("alignFixed")),await B()):notify(t("alignFail"),!1)}catch{notify(t("alignFail"),!1)}finally{j("")}}},[K,te]=(0,n.useState)([]),[Y,j]=(0,n.useState)(""),[Ae,X]=(0,n.useState)(!1),be=(0,n.useCallback)(async()=>{if(!(!k||!k.merge||!k.merge.length)&&window.confirm(t("mergeAllConfirm"))){j("merge");try{let s={},x=de=>s[de]===void 0?de:s[de]=x(s[de]),R=(de,ee)=>{s[x(de)]=x(ee)},G=new Set;for(let de of k.merge)G.add(de.a.path),G.add(de.b.path),R(de.a.path,de.b.path);let Se={};for(let de of G){let ee=x(de);(Se[ee]=Se[ee]||[]).push(de)}let Ce=0;for(let de of Object.values(Se)){if(de.length<2)continue;(await fetch(`${O}/merge?paths=${encodeURIComponent(de.join(","))}`).then(We=>We.json())).ok&&Ce++}await Z(),l&&l()}catch{}j("")}},[k,Z,l,t]);async function Z(){try{let s=await Promise.all([fetch(`${O}/stats`),fetch(`${O}/budget`),fetch(`${O}/capture-log`),fetch(`${O}/cards?status=all&limit=30&agent=${yt}`)]),[x,R,G,Se]=await Promise.all(s.map(Ce=>Ce.json()));x&&x.ok&&i(x),R&&R.ok&&h(R),G&&G.ok&&I(G),Se&&Se.ok&&te(Se.cards||[]),D(!x||!x.ok?t("adminLoadFail"):"")}catch{D(t("adminLoadFail"))}}let U=(0,n.useCallback)(async()=>{j("scan");try{let s=await fetch(`${O}/optimize`).then(x=>x.json());s.ok&&H(s)}catch{D(t("adminLoadFail"))}finally{j("")}},[t]),[ie,ve]=(0,n.useState)(null),C=(0,n.useCallback)(async()=>{j("refine");try{let s=await fetch(`${O}/refine-scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:8})}).then(x=>x.json());s&&s.ok?ve(s):notify(s&&s.error||t("refineFail"),!1)}catch{notify(t("refineFail"),!1)}finally{j("")}},[t]),ke=async(s,x)=>{if(!(x==="merge"&&!window.confirm(t("mergeConfirm")))){j("refineapply");try{let R=await fetch(`${O}/refine-apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:s.a.path,b:s.b.path,action:x,relation:s.relation})}).then(G=>G.json());R&&R.ok?(notify(t("refineApplied")),ve(G=>G&&{...G,findings:(G.findings||[]).filter(Se=>!(Se.a.path===s.a.path&&Se.b.path===s.b.path))}),await Z(),l&&l()):notify(R&&R.error||t("refineFail"),!1)}catch{notify(t("refineFail"),!1)}finally{j("")}}},[Q,pe]=(0,n.useState)(null),Pe=(0,n.useCallback)(async()=>{j("junk");try{let s=await fetch(`${O}/refine-junk`).then(x=>x.json());s&&s.ok?pe(s.items||[]):notify(t("junkFail"),!1)}catch{notify(t("junkFail"),!1)}finally{j("")}},[t]),y=async s=>{if(s.length&&window.confirm(t("junkRecycleAllConfirm"))){j("junkpurge");try{let x=await fetch(`${O}/refine-junk-purge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:s})}).then(R=>R.json());x&&x.removed?(notify(t("junkDone")+"\uFF1A"+x.removed.length+(x.failed?.length?"\uFF08\u5931\u8D25 "+x.failed.length+"\uFF09":"")),pe(R=>R&&R.filter(G=>!x.removed.includes(G.path))),await Z(),l&&l()):notify(t("junkFail"),!1)}catch{notify(t("junkFail"),!1)}finally{j("")}}},[W,re]=(0,n.useState)(null),J=(0,n.useCallback)(async()=>{j("goals");try{let s=await fetch(O+"/refine-goals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:30})}).then(x=>x.json());s&&s.ok?re(s):notify(s&&s.error||t("goalFail"),!1)}catch{notify(t("goalFail"),!1)}finally{j("")}},[t]),le=async s=>{j("goalskeep");try{let x=await fetch(O+"/refine-goals-keep",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:s.members.map(R=>R.path)})}).then(R=>R.json());x&&x.ok?(notify(t("goalDone")),re(R=>R&&{...R,clusters:(R.clusters||[]).filter(G=>G.goal!==s.goal)})):notify(t("goalFail"),!1)}catch{notify(t("goalFail"),!1)}finally{j("")}},ye=async s=>{if(window.confirm(t("mergeConfirm"))){j("goalsmerge");try{let x=await fetch(O+"/merge?paths="+encodeURIComponent(s.members.map(R=>R.path).join(","))).then(R=>R.json());x&&x.ok?(notify(t("goalMerged")),re(R=>R&&{...R,clusters:(R.clusters||[]).filter(G=>G.goal!==s.goal)}),await Z(),l&&l()):notify(t("mergeFail"),!1)}catch{notify(t("mergeFail"),!1)}finally{j("")}}};(0,n.useEffect)(()=>{Z()},[f]);let Be=async(s,x)=>{if(window.confirm(t("mergeConfirm")))try{(await fetch(`${O}/merge?paths=${encodeURIComponent(s+","+x)}`).then(G=>G.json())).ok&&(await Z(),l&&l())}catch{}},Ne=async s=>{if(window.confirm(t("deleteConfirm")))try{(await fetch(`${O}/delete?path=${encodeURIComponent(s)}`).then(R=>R.json())).ok&&(await Z(),l&&l())}catch{}},Me=["project","knowledge","content","prompt","business","tool","mistake"],De=({title:s,kind:x,updated:R,path:G})=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[x]||"#666"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:pt(R)}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>Ne(G),children:[t("delete")," \u2715"]})]});return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto"},children:[w&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #ef4444",background:"rgba(239,68,68,0.08)",padding:"12px 14px",marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:13,color:"#b91c1c",fontWeight:600,marginBottom:6},children:["\u26A0 ",w]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:Z,children:["\u21BB ",t("retry")]})]}),o==="stats"&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F527} ",t("alignTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:B,children:t(Y==="align"?"exporting":"alignRun")}),T&&T.counts&&T.counts.fix>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:A,children:t(Y==="alignfix"?"exporting":"alignFix")}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("alignHint")})]}),T&&T.findings?(0,e.jsxs)("div",{style:{marginTop:6},children:[(0,e.jsxs)("div",{style:{fontSize:12,opacity:.75,marginBottom:4},children:[t("alignDisk")," v",T.onDisk||"?",T.residentServed?" \xB7 "+t("alignResident")+" v"+T.residentServed:"",T.hostVersion?" \xB7 "+t("alignHost")+" v"+T.hostVersion:""]}),(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:T.findings.map((s,x)=>(0,e.jsxs)("li",{style:{padding:"4px 2px",borderTop:x?"1px solid rgba(127,127,127,0.12)":"none",fontSize:12},children:[(0,e.jsx)("span",{style:{fontWeight:700,color:s.level==="fix"?"#ef4444":s.level==="warn"?"#f59e0b":"#10b981"},children:s.level==="fix"?"\u2717":s.level==="warn"?"\u26A0":"\u2713"})," ",(0,e.jsx)("span",{children:s.title}),s.detail?(0,e.jsx)("div",{style:{opacity:.75,marginLeft:14},children:s.detail}):null,s.command?(0,e.jsxs)("div",{style:{marginLeft:14,opacity:.9},children:["\u2192 ",(0,e.jsx)("code",{children:s.command})]}):null]},x))})]}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginTop:4},children:t("alignIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1FAB5} ",t("captureLog")]}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("captureLogHint")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>Z(),children:["\u21BB ",t("refresh")]})]}),g?g.available===!1?(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("captureLogUnavailable")}):(g.entries||[]).length===0?(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("captureLogEmpty")}):(0,e.jsx)("div",{style:{maxHeight:260,overflow:"auto",marginTop:8},children:(0,e.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:(0,e.jsx)("tbody",{children:(g.entries||[]).map((s,x)=>{let R=wa[s.action]||["\u2022","inherit"];return(0,e.jsxs)("tr",{style:{borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsx)("td",{style:{padding:"4px 6px",opacity:.55,whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:pt(s.time?new Date(s.time).toISOString():"")}),(0,e.jsxs)("td",{style:{padding:"4px 6px",whiteSpace:"nowrap",color:R[1],fontWeight:600},children:[R[0]," ",s.action]}),(0,e.jsx)("td",{style:{padding:"4px 6px"},children:s.reason||""}),(0,e.jsx)("td",{style:{padding:"4px 6px",opacity:.55,maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:s.preview||"",children:s.preview||""})]},x)})})})}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("loading")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:["\u{1F916} ",t("captureAgentCards"),"\uFF08",K.length,"\uFF09"]}),K.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:K.map(s=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[s.kind]||Ve.other}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.title}),s.status==="pending"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#f59e0b"},children:["\u23F3 ",t("statusPending")]}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:pt(s.updated)})]},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noCards")})]}),c&&(0,e.jsxs)(e.Fragment,{children:[c.trend&&c.trend.length>0&&(()=>{let s=c.trend,x=Math.max(...s.map(Ce=>Ce.count),1),R=260,G=50,Se=R/s.length;return(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"10px 14px"},children:[(0,e.jsxs)("div",{style:{fontSize:11,opacity:.6,marginBottom:4},children:["\u{1F4C8} ",t("trendLabel")]}),(0,e.jsx)("svg",{width:R,height:G,style:{display:"block",width:"100%",height:50},children:s.map((Ce,de)=>{let ee=Math.round(Ce.count/x*(G-4));return(0,e.jsx)("rect",{x:de*Se+1,y:G-ee,width:Math.max(Se-2,2),height:ee,rx:1.5,fill:Ce.count>0?"var(--dsw-alias-accent, #3b82f6)":"var(--dsw-alias-border-l1, #e5e7eb)",opacity:Ce.count>0?.85:.35},Ce.date)})})]})})(),(0,e.jsxs)("div",{className:"mc-stats",children:[(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.total}),(0,e.jsx)("span",{children:t("total")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.today}),(0,e.jsx)("span",{children:t("todayAdd")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.week}),(0,e.jsx)("span",{children:t("weekAdd")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.tags}),(0,e.jsx)("span",{children:t("tags")})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsx)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:t("byKind")}),(0,e.jsx)("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:Me.map(s=>(0,e.jsxs)("span",{style:{fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[s]||"#666"}}),t(qe[s]),": ",c.byKind?.[s]||0]},s))})]}),S&&(S.budgetChars||S.recallLimit||S.embedding)&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,fontSize:12},children:[(0,e.jsx)("b",{children:t("budgetLabel")}),"\uFF1A",t("budgetChars")," ",(0,e.jsx)("b",{children:S.budgetChars||8e4})," \xB7 ",t("recallLimitLabel")," ",(0,e.jsx)("b",{children:S.recallLimit||5})," \xB7 ",t("embeddingLabel")," ",S.embedding?"ON":"OFF"]}),(0,e.jsxs)("div",{className:"mc-card",children:[(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:[t("todayList"),"\uFF08",c.todayCards?.length||0,"\uFF09"]}),c.todayCards?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:c.todayCards.map(s=>(0,e.jsx)(De,{title:s.title,kind:s.kind,updated:s.updated,path:s.path},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noOptimize")})]})]})]}),o==="optimize"&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("organizeTitle")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:U,children:Y==="scan"?t("exporting"):"\u{1F50D} "+t("scanAndOrganize")}),k&&k.merge?.length>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:async()=>{if(window.confirm(t("oneClickOptimizeConfirm"))){j("oneclick");try{let s=JSON.stringify({cleanupStale:Ae}),R=await(await fetch(`${O}/optimize-execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:s})).json();R&&R.ok?(notify(`${t("oneClickOptimizeDone")}\uFF1A${R.plan.merged} ${t("optimizedMerged")}${Ae?` \xB7 ${R.plan.staleDeleted} ${t("optimizedStaleDeleted")}`:""}`),await Z(),l&&l(),H(null)):notify(t("mergeFail"),!1)}catch{notify(t("mergeFail"),!1)}finally{j("")}}},children:Y==="oneclick"?t("exporting"):"\u26A1 "+t("oneClickOptimize")}),k&&k.merge?.length>0&&(0,e.jsxs)("label",{style:{fontSize:11,opacity:.7,display:"flex",alignItems:"center",gap:4},children:[(0,e.jsx)("input",{type:"checkbox",checked:Ae,onChange:s=>X(s.target.checked)}),t("oneClickAlsoStale")]})]}),!k&&(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginBottom:10},children:t("scanHint")}),k&&(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",flexDirection:"column",gap:8},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("mergePairs")}),(0,e.jsx)("div",{className:"spacer",style:{flex:1}}),k.merge?.length>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:be,children:t(Y==="merge"?"exporting":"batchMerge")})]}),(0,e.jsx)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:t("mergePairs")}),k.merge?.length?(0,e.jsx)("ul",{style:{margin:"0 0 12px",padding:0,listStyle:"none"},children:k.merge.map((s,x)=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsxs)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[s.a.title," \u21C4 ",s.b.title]}),(0,e.jsxs)("span",{style:{opacity:.6},children:[Math.round(s.sim*100),"%"]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>Be(s.a.path,s.b.path),children:t("mergeNow")})]},x))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginBottom:12},children:t("noOptimize")}),(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:[t("staleCards"),"\uFF08",k.stale?.length||0,"\uFF09"]}),k.stale?.length>0&&(0,e.jsx)("div",{style:{marginBottom:6},children:(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!!Y,onClick:async()=>{if(!window.confirm(t("deleteConfirm")))return;j("clean");let s=0;for(let x of k.stale)try{await fetch(`${O}/delete?path=${encodeURIComponent(x.path)}`),s++}catch{}j(""),notify(`${s} ${t("deletedStale")}`),await Z(),l&&l()},children:t("cleanStale")})}),k.stale?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:k.stale.map(s=>(0,e.jsx)(De,{title:s.title,kind:"other",updated:s.updated,path:s.path},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noOptimize")})]})}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9ED} ",t("refineTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:C,children:t(Y==="refine"?"exporting":"refineScan")}),(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("refineHint")})]}),ie?.findings?.length?ie.findings.map((s,x)=>(0,e.jsxs)("div",{style:{borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",padding:"7px 2px"},children:[(0,e.jsxs)("div",{style:{fontSize:12,marginBottom:3},children:[(0,e.jsx)("span",{style:{fontWeight:700,color:s.relation==="conflict"?"#ef4444":s.relation==="duplicate"?"#f59e0b":"#10b981"},children:t("refineRel_"+s.relation)}),(0,e.jsxs)("span",{style:{opacity:.55},children:[" \xB7 sim ",s.sim," \xB7 ",s.useModel||""]}),s.conflict?(0,e.jsx)("span",{style:{marginLeft:6},children:s.conflict}):null]}),(0,e.jsxs)("div",{style:{fontSize:12,opacity:.85,marginBottom:5},children:["A\uFF1A",s.a.title,(0,e.jsx)("br",{}),"B\uFF1A",s.b.title]}),(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepA"),children:t("refineKeepA")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepB"),children:t("refineKeepB")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepBoth"),children:t("refineKeepBoth")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"merge"),children:t("refineMerge")})]})]},x)):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(ie?"refineNone":"refineIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9F9} ",t("junkTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:Pe,children:t(Y==="junk"?"exporting":"junkScan")}),Q?.length?(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:()=>y(Q.map(s=>s.path)),children:t(Y==="junkpurge"?"exporting":"junkRecycleAll")}):null,(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("junkHint")})]}),Q?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:Q.map((s,x)=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 2px",borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",fontSize:12},children:[(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:s.reasons.join("\uFF1B"),children:s.title||s.path}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:s.reasons[0]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>y([s.path]),children:t("junkRecycle")})]},x))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(Q?"junkNone":"junkIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F3AF} ",t("goalTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:J,children:t(Y==="goals"?"exporting":"goalScan")}),W?(0,e.jsxs)("span",{style:{opacity:.6,fontSize:11},children:[t("goalStats"),"\uFF1A",W.cached," / ",W.calls]}):null,(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("goalHint")})]}),W?.clusters?.length?W.clusters.map((s,x)=>(0,e.jsxs)("div",{style:{borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",padding:"7px 2px"},children:[(0,e.jsxs)("div",{style:{fontSize:12,marginBottom:4},children:[(0,e.jsx)("b",{children:s.goal})," ",(0,e.jsxs)("span",{style:{opacity:.55},children:["\xB7 ",s.members.length," ",t("goalCards")]})]}),(0,e.jsx)("ul",{style:{margin:"0 0 5px",padding:"0 0 0 16px",fontSize:12,opacity:.85},children:s.members.map((R,G)=>(0,e.jsx)("li",{children:R.title},G))}),(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>le(s),children:t("goalKeep")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ye(s),children:t("goalMerge")})]})]},x)):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(W?"goalNone":"goalIdle")})]})]})]})]})}var It=[{key:"decision",label:"tplDecision",kind:"knowledge",tagKey:"tplDecisionTags",bodyKey:"tplDecisionBody"},{key:"bug",label:"tplBug",kind:"mistake",tagKey:"tplBugTags",bodyKey:"tplBugBody"},{key:"meeting",label:"tplMeeting",kind:"content",tagKey:"tplMeetingTags",bodyKey:"tplMeetingBody"},{key:"weekly",label:"tplWeekly",kind:"content",tagKey:"tplWeeklyTags",bodyKey:"tplWeeklyBody"}];function Aa({t,newCard:o,setNewCard:l,onCreated:f}){if(!o)return null;let c=It.find(h=>h.key===o.template),i=o.body||(c?t(c.bodyKey):""),w=o.kind||(c?c.kind:"knowledge"),D=o.tags||(c?t(c.tagKey):""),k=o._creating,H=h=>{let g=It.find(I=>I.key===h);l(I=>({...I,template:h,kind:g?g.kind:I.kind,body:g?t(g.bodyKey):I.body,tags:g?t(g.tagKey):I.tags}))},S=async()=>{if(!(!o.title&&!i)){l(h=>({...h,_creating:!0}));try{(await fetch(`${O}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:o.title||t("untitled"),kind:w,tags:D.split(",").map(g=>g.trim()).filter(Boolean),body:i,source:"manual"})}).then(g=>g.json())).ok?(l(null),f&&f()):l(g=>({...g,_creating:!1}))}catch{l(g=>({...g,_creating:!1}))}}};return(0,e.jsxs)("div",{className:"me-overlay",onClick:()=>l(null),children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:600,width:"92vw",maxHeight:"85vh"},onClick:h=>h.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsx)("h3",{children:t("newCard")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>l(null),children:t("close")})]}),(0,e.jsxs)("div",{className:"me-dialog-body",style:{display:"flex",flexDirection:"column",gap:10,overflow:"auto"},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[It.map(h=>(0,e.jsx)("button",{type:"button",className:`mc-btn${o.template===h.key?" me-on":""}`,onClick:()=>H(h.key),children:t(h.label)},h.key)),(0,e.jsx)("button",{type:"button",className:`mc-btn${o.template===""?" me-on":""}`,onClick:()=>l(h=>({...h,template:"",body:"",tags:"",kind:"knowledge"})),children:t("tplBlank")})]}),(0,e.jsx)("select",{className:"mc-btn",value:w,onChange:h=>l(g=>({...g,kind:h.target.value})),style:{maxWidth:180,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"var(--dsw-alias-label-primary, #111)"},children:["project","knowledge","content","prompt","business","tool","mistake"].map(h=>(0,e.jsx)("option",{value:h,style:{background:"var(--dsw-alias-bg-layer-1, #fff)",color:"var(--dsw-alias-label-primary, #111)"},children:h},h))}),(0,e.jsx)("input",{type:"text",className:"mc-btn",placeholder:t("cardTitle"),value:o.title||"",onChange:h=>l(g=>({...g,title:h.target.value}))}),(0,e.jsx)("input",{type:"text",className:"mc-btn",placeholder:t("tagsHint"),value:D,onChange:h=>l(g=>({...g,tags:h.target.value}))}),(0,e.jsx)("textarea",{className:"mc-btn",placeholder:t("cardBody"),value:i,onChange:h=>l(g=>({...g,body:h.target.value})),style:{minHeight:180,resize:"vertical",fontFamily:"inherit"}}),(0,e.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:k,onClick:S,children:t(k?"exporting":"createCard")})})]})]})]})}async function Vt(t){let o=String(t||"");if(!o)return!1;try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(o),!0}catch{}try{let l=document.createElement("textarea");l.value=o,l.setAttribute("readonly",""),l.style.position="fixed",l.style.left="-9999px",l.style.top="0",document.body.appendChild(l),l.focus(),l.select();let f=!!(document.execCommand&&document.execCommand("copy"));return document.body.removeChild(l),f}catch{return!1}}function Ba({t,onClose:o}){let[l,f]=(0,n.useState)(""),[c,i]=(0,n.useState)(""),[w,D]=(0,n.useState)(""),[k,H]=(0,n.useState)(!0),[S,h]=(0,n.useState)(!1),[g,I]=(0,n.useState)(""),[T,v]=(0,n.useState)(""),B=(0,n.useRef)(null),A=(0,n.useRef)(null),K=()=>{let U=B.current;if(U)try{U.focus(),U.select()}catch{}},te=U=>{I(U),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>I(""),2400)};(0,n.useEffect)(()=>{let U=!0;return fetch(O+"/diagnostics").then(ie=>ie.json()).then(ie=>{U&&(ie&&ie.ok?(i(String(ie.diagnostics||"")),D(String(ie.version||""))):h(!0))}).catch(()=>{U&&h(!0)}).finally(()=>{U&&H(!1)}),()=>{U=!1}},[]),(0,n.useEffect)(()=>{let U=ie=>{ie.key==="Escape"&&o()};return window.addEventListener("keydown",U),()=>{window.removeEventListener("keydown",U),A.current&&clearTimeout(A.current)}},[o]);let Y=(()=>{try{return String(navigator.language||"").toLowerCase().startsWith("en")?"en":"zh"}catch{return"zh"}})(),j=()=>{let U=l.trim().split(`
|
|
306
|
-
`)[0]||"",ie=Ot({title:"[Bug] "+(U.slice(0,60)||"memory-eternal \u95EE\u9898"),body:Wt({description:l,diagnostics:c,version:w})});try{window.open(ie,"_blank","noopener")}catch{te(t("fbCopyFail"))}},Ae=async()=>{await Vt(c)?(v(""),te(t("fbCopiedDiag"))):(v(c),te(t("fbCopyManual")))},X=async()=>{let U=$t({lang:Y,description:l,diagnostics:c});await Vt(U)?(v(""),te(t("fbCopiedPrompt"))):(v(U),te(t("fbCopyManual")))},be={width:"100%",resize:"vertical",padding:"8px 10px",borderRadius:10,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"transparent",color:"inherit",font:"inherit",fontSize:13},Z={margin:0,maxHeight:170,overflow:"auto",fontSize:11.5,lineHeight:1.55,padding:"8px 10px",borderRadius:10,background:"var(--dsw-alias-bg-layer-1, rgba(127,127,127,0.08))",whiteSpace:"pre-wrap"};return(0,e.jsxs)("div",{className:"me-overlay",onClick:o,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:720},onClick:U=>U.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsxs)("h3",{children:["\u{1F41E} ",t("fbTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:o,children:t("close")})]}),(0,e.jsxs)("div",{className:"me-dialog-body",style:{display:"flex",flexDirection:"column",gap:10},children:[(0,e.jsx)("div",{style:{fontSize:12,opacity:.72,lineHeight:1.6},children:t("fbWhy")}),(0,e.jsx)("textarea",{value:l,onChange:U=>f(U.target.value),placeholder:t("fbDesc"),rows:5,style:be}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("fbDiag")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:Ae,disabled:!c,children:t("fbCopyDiag")})]}),(0,e.jsx)("pre",{style:Z,children:k?t("fbLoading"):S?t("fbDiagFail"):c})]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>{if(!l.trim()){te(t("fbNeedDesc"));return}j()},style:{borderColor:"var(--dsw-alias-brand-primary, #3b82f6)",color:"var(--dsw-alias-brand-primary, #3b82f6)",fontWeight:600},children:["\u{1F680} ",t("fbOpenIssue")]}),(0,e.jsx)("span",{style:{opacity:.5,fontSize:12},children:t("fbOr")}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:X,children:["\u{1F916} ",t("fbCopyPrompt")]})]}),g&&(0,e.jsx)("div",{style:{fontSize:12,color:"var(--dsw-alias-brand-primary, #3b82f6)"},children:g}),T&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,e.jsxs)("b",{style:{fontSize:12,color:"#b45309"},children:["\u26A0 ",t("fbCopyFail")]}),(0,e.jsx)("span",{style:{fontSize:11.5,opacity:.75},children:t("fbCopyManual")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:K,children:t("fbSelectAll")})]}),(0,e.jsx)("textarea",{ref:B,readOnly:!0,value:T,rows:7,style:be})]})]})]})]})}function ja({t,card:o,query:l,onClose:f,onDelete:c,onFeedback:i}){(0,n.useEffect)(()=>{let B=A=>{A.key==="Escape"&&f()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[f]);let{meta:w,body:D}=(0,n.useMemo)(()=>Ct(o.text||""),[o.text]),k=B=>{let A=w.find(([K])=>String(K).toLowerCase()===B);return A?A[1]:""},H=Et(k("tags")),S=k("kind")||"knowledge",h=(k("status")||"approved").toLowerCase(),g=Ve[S]||"#6B7280",I=(D||"").length>460,[T,v]=(0,n.useState)(!0);return(0,e.jsxs)("div",{className:"me-overlay",onClick:f,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",onClick:B=>B.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsxs)("h3",{children:[(0,e.jsx)("span",{style:{marginRight:6},children:ht[S]||"\u{1F4CE}"}),o.title]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>i&&i(!0),children:["\u{1F44D} ",t("fbUseful")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>i&&i(!1),children:["\u{1F44E} ",t("fbNotUseful")]})]}),I&&(0,e.jsx)("button",{type:"button",className:"mc-btn","aria-expanded":T,onClick:()=>v(B=>!B),children:t(T?"collapse":"expand")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},onClick:()=>{window.confirm(t("deleteConfirm"))&&c&&c(o.path)},children:t("delete")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:f,children:t("close")})]})]}),(0,e.jsxs)("div",{className:"md-meta",children:[(0,e.jsxs)("span",{className:"md-chip md-chip-kind",style:{color:g,borderColor:g+"59",background:g+"1a"},children:[ht[S]||"\u{1F4CE}"," ",t(qe[S]||"kindKnowledge")]}),(0,e.jsxs)("span",{className:"md-chip "+(h==="approved"?"md-chip-st-ok":h==="pending"?"md-chip-st-warn":"md-chip-st-bad"),children:[h==="approved"?"\u2705":h==="pending"?"\u23F3":"\u26D4"," ",t(h==="approved"?"statusApproved":h==="pending"?"statusPending":"statusRejected")]}),H.slice(0,8).map(B=>(0,e.jsxs)("span",{className:"md-chip md-chip-tag",children:["\u{1F3F7} ",B]},B)),!!k("updated")&&(0,e.jsxs)("span",{className:"md-chip md-date",children:["\u{1F552} ",t("updated")," ",pt(k("updated"))]}),!!k("source")&&(0,e.jsxs)("span",{className:"md-chip md-date",children:["\u{1F4E5} ",k("source")]})]}),(0,e.jsx)("div",{className:"me-dialog-body",style:T?{}:{maxHeight:300,overflow:"hidden"},onClick:T?void 0:B=>{B.stopPropagation(),v(!0)},children:(0,e.jsx)("div",{className:"md-doc",dangerouslySetInnerHTML:{__html:Dt(D)}})}),!T&&(0,e.jsxs)("div",{className:"md-collapsed-hint",onClick:B=>{B.stopPropagation(),v(!0)},children:[t("expand")," \u2304"]})]})]})}function Pa({t,onOpen:o,all:l,onAllChange:f,onMutate:c,active:i,visible:w}){let[D,k]=(0,n.useState)(null),[H,S]=(0,n.useState)(""),h=(0,n.useRef)(!1),g=(0,n.useRef)(0),I=(0,n.useRef)(t);I.current=t;let T=(0,n.useCallback)(async()=>{try{h.current=!1;let K=await(await fetch(`${O}/graph${l?"?all=1":""}`)).json();K.ok?(k(K),S(""),h.current=!0):(k(null),S(K.error||t("error")))}catch(A){S(String(A&&A.message?A.message:A))}},[l,t]);(0,n.useEffect)(()=>{if(!i||h.current)return;let A=!0;return fetch(`${O}/graph${l?"?all=1":""}`).then(K=>K.json()).then(K=>{A&&(K.ok?(k(K),S(""),h.current=!0):(k(null),S(K.error||t("error"))))}).catch(K=>{A&&S(String(K&&K.message?K.message:K))}),()=>{A=!1}},[l,t,i]),(0,n.useEffect)(()=>{w&&D&&g.current++},[w,D]);let v=(0,n.useCallback)(async A=>{try{let te=await(await fetch(`${O}/delete?path=${encodeURIComponent(A)}`)).json();return te&&te.ok?(await T(),c&&c(),!0):!1}catch{return!1}},[T]),B=(0,n.useCallback)(async A=>{if(!A||A.length<2)return!1;try{let K=await fetch(`${O}/merge?paths=${encodeURIComponent(A.join(","))}`).then(te=>te.json());return K&&K.ok?(await T(),c&&c(),!0):!1}catch{return!1}},[T,c]);return(0,e.jsxs)("div",{className:"me-graph",children:[(0,e.jsx)("style",{children:Oe}),H&&(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",H]}),!D&&!H&&(0,e.jsx)("div",{className:"mc-empty",children:t("loading")}),D&&D.nodes.length===0&&(0,e.jsx)("div",{className:"mc-empty",children:t("emptyGraph")}),D&&D.nodes.length>0&&(0,e.jsx)(Ha,{nodes:D.nodes,edges:D.edges,onOpen:o,onDelete:v,onMerge:B,t,all:l,onAllChange:f,countLabel:`${D.nodes.length} ${t("nodes")} \xB7 ${Fa(D.edges)} ${t("edges")}`,fitTrigger:g.current})]})}function Fa(t){let o=new Set;for(let l of t||[])o.add([l.source,l.target].sort().join("|"));return o.size}var ct={colors:{project:"#3B82F6",knowledge:"#10B981",content:"#F59E0B",prompt:"#A855F7",business:"#EC4899",tool:"#06B6D4",mistake:"#EF4444",other:"#6B7280"},shapes:{project:"circle",knowledge:"circle",content:"rect",prompt:"diamond",business:"hexagon",tool:"circle",mistake:"diamond",other:"circle"}};function Ha({nodes:t,edges:o,onOpen:l,onDelete:f,onMerge:c,t:i,countLabel:w,all:D,onAllChange:k,fitTrigger:H}){let S=(0,n.useRef)(null),h=(0,n.useRef)(null),g=(0,n.useRef)(null),I=(0,n.useRef)(null),T=(0,n.useRef)(null),v=(0,n.useRef)(l);(0,n.useEffect)(()=>{v.current=l},[l]);let B=(0,n.useRef)(f);(0,n.useEffect)(()=>{B.current=f},[f]);let A=(0,n.useRef)(c);(0,n.useEffect)(()=>{A.current=c},[c]);let[K,te]=(0,n.useState)(""),[Y,j]=(0,n.useState)(null),Ae=(0,n.useRef)("");(0,n.useEffect)(()=>{Ae.current=K.trim().toLowerCase()},[K]),(0,n.useEffect)(()=>{let p=g.current;if(!p)return;let r=K.trim().toLowerCase();if(!r)return;let $=p.nodes.find(se=>(se.name||"").toLowerCase().includes(r));$&&(g.current.selectedId=$.id,j($.id),p.panX=p.w/2-$.x*p.zoom,p.panY=p.h/2-$.y*p.zoom,p.render&&p.render())},[K]);let[X,be]=(0,n.useState)("all"),[Z,U]=(0,n.useState)(!1),ie=(0,n.useRef)("all"),[ve,C]=(0,n.useState)(""),ke=(0,n.useRef)(""),[Q,pe]=(0,n.useState)(!1),Pe=(0,n.useRef)(!1),[y,W]=(0,n.useState)(null);(0,n.useEffect)(()=>{ie.current=X},[X]),(0,n.useEffect)(()=>{ke.current=ve},[ve]),(0,n.useEffect)(()=>{Pe.current=Q},[Q]);let re=(0,n.useMemo)(()=>{let p=new Map;for(let r of t)for(let $ of r.tags||[]){let se=String($).trim();se&&p.set(se,(p.get(se)||0)+1)}return[...p.entries()].sort((r,$)=>$[1]-r[1]).slice(0,24).map(([r,$])=>({tag:r,n:$}))},[t]),J=(()=>{let p=K.trim().toLowerCase();return!!p&&!t.some(r=>(r.title||r.name||"").toLowerCase().includes(p)||String(r.kind||"").toLowerCase().includes(p)||String(qe[r.kind]||"").toLowerCase().includes(p))})();(0,n.useEffect)(()=>{let p=g.current;p&&p.wake&&p.wake()},[K]),(0,n.useEffect)(()=>{let p=g.current;p&&p.render&&p.render()},[X,ve,Q]);let le=(0,n.useRef)(null),[ye,Be]=(0,n.useState)([]),[Ne,Me]=(0,n.useState)(null),[De,s]=(0,n.useState)(!1),[x,R]=(0,n.useState)(null),[G,Se]=(0,n.useState)(""),Ce=(0,n.useRef)(null),de=(0,n.useRef)(null),ee=(p,r=!0)=>{Ce.current&&clearTimeout(Ce.current),R({msg:p,ok:r}),Ce.current=setTimeout(()=>R(null),1900)},We=p=>{Se(p),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>Se(""),1600)};(0,n.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current),de.current&&clearTimeout(de.current)},[]);let Re=(0,n.useMemo)(()=>t.reduce((p,r)=>(p[r.id]=r,p),{}),[t]);return(0,n.useEffect)(()=>{let p=S.current;if(!p||t.length===0)return;let r=p.getContext("2d");if(!r)return;let $=Math.max(1,window.devicePixelRatio||1),se=()=>document.documentElement.getAttribute("data-theme")==="dark",ce={};o.forEach(m=>{ce[m.source]=(ce[m.source]||0)+1,ce[m.target]=(ce[m.target]||0)+1});let ge=Math.max(1,...Object.values(ce)),a={nodes:t.map(m=>({id:m.id,name:m.title||"",type:m.kind||"other",r:9+Math.min(10,(ce[m.id]||0)/ge*8),x:0,y:0,vx:0,vy:0})),edges:o.map(m=>({sourceNodeId:m.source,targetNodeId:m.target,weight:1})),panX:0,panY:0,zoom:1,running:!0,raf:0,tickCount:0,quietTicks:0,dragNode:null,selectedId:null,mouseX:0,mouseY:0,w:0,h:0,dpr:$,ctx:r,multi:[],marquee:null};a.domain=t,a.domainById=t.reduce((m,L)=>(m[L.id]=L,m),{}),a.nodes.forEach((m,L)=>{let N=L/a.nodes.length*Math.PI*2-Math.PI/2;m.x=Math.cos(N)*60,m.y=Math.sin(N)*60});let tt=[...new Set(a.nodes.map(m=>m.type))];a.clustered=tt.length>1,a.typeCenters={},tt.forEach((m,L)=>{let N=L/tt.length*Math.PI*2-Math.PI/2;a.typeCenters[m]={x:Math.cos(N)*160,y:Math.sin(N)*160}}),g.current=a;let we=0,nt=0,Le=()=>{let m=p.clientWidth,L=p.clientHeight;a.w=m,a.h=L,p.width=m*$,p.height=L*$,r.setTransform($,0,0,$,0,0),(we===0||nt===0)&&m>0&&L>0&&a.tickCount>0&&requestAnimationFrame(()=>M()),we=m,nt=L};Le();let d=new ResizeObserver(Le);d.observe(p.parentElement);let P=(m,L)=>m&&m.length>L?m.slice(0,L)+"\u2026":m,E=(m,L,N,F)=>{if(r.beginPath(),F==="rect")r.rect(m-N,L-N*.75,N*2,N*1.5);else if(F==="diamond")r.moveTo(m,L-N),r.lineTo(m+N,L),r.lineTo(m,L+N),r.lineTo(m-N,L),r.closePath();else if(F==="hexagon"){for(let V=0;V<6;V++){let ue=Math.PI/3*V-Math.PI/2,ae=m+N*Math.cos(ue),Ie=L+N*Math.sin(ue);V===0?r.moveTo(ae,Ie):r.lineTo(ae,Ie)}r.closePath()}else r.arc(m,L,N,0,Math.PI*2)},u=new Map,z=(m,L)=>{let N=m+"|"+Math.round(L),F=u.get(N);if(!F){let V=parseInt(m.slice(1,3),16),ue=parseInt(m.slice(3,5),16),ae=parseInt(m.slice(5,7),16);F=r.createRadialGradient(-L*.3,-L*.3,0,0,0,L*1.2),F.addColorStop(0,"rgba("+Math.min(255,V+70)+","+Math.min(255,ue+70)+","+Math.min(255,ae+70)+",0.95)"),F.addColorStop(1,m),u.set(N,F)}return F},M=()=>{if(!a.nodes.length)return;let m=1/0,L=-1/0,N=1/0,F=-1/0;a.nodes.forEach(_e=>{m=Math.min(m,_e.x),L=Math.max(L,_e.x),N=Math.min(N,_e.y),F=Math.max(F,_e.y)});let V=20,ue=L-m+V*2,ae=F-N+V*2,Ie=Math.min(a.w/ue,a.h/ae);a.zoom=Math.max(.35,Math.min(1.8,Ie)),a.panX=a.w/2-(m+L)/2*a.zoom,a.panY=a.h/2-(N+F)/2*a.zoom};I.current=M;let q=()=>{r.clearRect(0,0,a.w,a.h),a.searchTerm=Ae.current,a.kindFilter=ie.current,a.timeMode=Pe.current,a.tagFilter=ke.current;let m=a.tagFilter,L=a.kindFilter,N=b=>String(b||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");r.save(),r.strokeStyle=se()?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.04)",r.lineWidth=.5;for(let b=0;b<a.w;b+=24)r.beginPath(),r.moveTo(b,0),r.lineTo(b,a.h),r.stroke();for(let b=0;b<a.h;b+=24)r.beginPath(),r.moveTo(0,b),r.lineTo(a.w,b),r.stroke();r.restore(),r.save(),r.translate(a.panX,a.panY),r.scale(a.zoom,a.zoom);let F={};a.nodes.forEach(b=>F[b.id]=b);let V=a.nodes.length>40,ue=V?1.5:.55,ae=a.selectedId||a.hoverId,Ie=_t({panX:a.panX,panY:a.panY,zoom:a.zoom,w:a.w,h:a.h,margin:80}),_e=(()=>{let b=(a.searchTerm||"").toLowerCase();if(!b)return null;let ne=[];for(let oe of a.nodes){let Te=(a.domainById[oe.id]||{}).kind||"other";if(((oe.name||"").toLowerCase().includes(b)||String(qe[Te]||"").toLowerCase().includes(b)||String(Te).toLowerCase().includes(b))&&ne.push(oe.id),ne.length>200)break}return ne})(),ot=Kt(a.nodes,{limit:Ut(a.nodes.length),focusId:ae,hoverId:a.hoverId,searchHits:_e,degree:ce}),fe=new Map,xe=(b,ne)=>{let oe=b+"|"+ne,he=fe.get(oe);return he===void 0&&(r.font=b,he=r.measureText(ne).width,fe.set(oe,he)),he},He=a.nodes.length<=250,Ue=new Map;a.edges.forEach(b=>{let ne=F[b.sourceNodeId],oe=F[b.targetNodeId];if(!ne||!oe||!Nt(ne.x,ne.y,10,Ie)&&!Nt(oe.x,oe.y,10,Ie))return;if(L!=="all"){let lt=a.domainById[b.sourceNodeId]&&a.domainById[b.sourceNodeId].kind,Qe=a.domainById[b.targetNodeId]&&a.domainById[b.targetNodeId].kind;if(lt!==L&&Qe!==L)return}if(m){let lt=a.domainById[b.sourceNodeId]&&(a.domainById[b.sourceNodeId].tags||[]).includes(m),Qe=a.domainById[b.targetNodeId]&&(a.domainById[b.targetNodeId].tags||[]).includes(m);if(!lt&&!Qe)return}let he=oe.x-ne.x,Te=oe.y-ne.y,Fe=Math.sqrt(he*he+Te*Te)||1,et=V?12:18,at=-Te/Fe*et,xt=he/Fe*et,kt=(ne.x+oe.x)/2+at,wt=(ne.y+oe.y)/2+xt,mt=ct.colors[a.domainById[ne.id]&&a.domainById[ne.id].kind||"other"],gt=ae&&(b.sourceNodeId===ae||b.targetNodeId===ae),Mt=ae?gt?.6:.08:V?.14:.24,Ze=parseInt(mt.slice(1,3),16),ft=parseInt(mt.slice(3,5),16),Tt=parseInt(mt.slice(5,7),16),Xe=gt?1.6+(b.weight||1):.8+(b.weight||1)*.5,it=Ze+","+ft+","+Tt+","+Mt+","+Xe,Ke=Ue.get(it);Ke||(Ke={path:new Path2D,stroke:"rgba("+Ze+","+ft+","+Tt+","+Mt+")",width:Xe},Ue.set(it,Ke)),Ke.path.moveTo(ne.x,ne.y),Ke.path.quadraticCurveTo(kt,wt,oe.x,oe.y)}),Ue.forEach(b=>{r.strokeStyle=b.stroke,r.lineWidth=b.width,r.stroke(b.path)});let Ee=null;ae&&(Ee=new Set,a.edges.forEach(b=>{b.sourceNodeId===ae?Ee.add(b.targetNodeId):b.targetNodeId===ae&&Ee.add(b.sourceNodeId)}));let Je=[];if(a.nodes.forEach(b=>{if(!Nt(b.x,b.y,b.r+2,Ie))return;let ne=a.domainById[b.id]||{},oe=ne.kind||"other",he=a.timeMode?Ea(ne.updated):ct.colors[oe],Te=ct.shapes[oe],Fe=a.selectedId===b.id,et=a.hoverId===b.id,at=a.searchTerm||"",xt=!at||(b.name||"").toLowerCase().includes(at)||String(qe[oe]||"").toLowerCase().includes(at)||String(oe).toLowerCase().includes(at),kt=L==="all"||oe===L,wt=!m||(ne.tags||[]).includes(m),mt=ae&&b.id!==ae&&!(Ee&&Ee.has(b.id))||at&&!xt||!kt||!wt;r.save(),r.globalAlpha=mt?.08:1,(Fe||et)&&He&&(r.shadowColor=he,r.shadowBlur=Fe?20:14),r.translate(b.x,b.y),E(0,0,b.r,Te),r.fillStyle=z(he,b.r),r.fill(),r.restore(),Fe?(r.save(),E(b.x,b.y,b.r+3,Te),r.strokeStyle=he,r.lineWidth=3,r.shadowColor=he,r.shadowBlur=12,r.stroke(),r.restore()):et?(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle=he,r.lineWidth=2,r.stroke(),r.restore()):at&&xt?(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle="#e11d48",r.lineWidth=2,r.stroke(),r.restore()):a.multi.indexOf(b.id)>=0&&(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle="#60a5fa",r.lineWidth=2,r.shadowColor="#60a5fa",r.shadowBlur=8,r.stroke(),r.restore());let gt=P(b.name,16);if((Fe||et||ot.has(b.id)&&a.zoom>ue||!V&&a.zoom>.6)&&kt&&wt){let Ze=1/a.zoom,ft="500 "+(12*Ze).toFixed(1)+"px -apple-system,Segoe UI,sans-serif";r.font=ft;let Xe=xe(ft,gt)+16*Ze,it=18*Ze,Ke=b.y+b.r+8*Ze,lt=!0;for(let Qe of Je)if(b.x-Xe/2<Qe.x+Qe.w&&b.x+Xe/2>Qe.x&&Ke<Qe.y+Qe.h&&Ke+it>Qe.y){lt=!1;break}if(!lt&&!Fe&&!et)return;Je.push({x:b.x-Xe/2,y:Ke,w:Xe,h:it}),r.fillStyle=se()?"rgba(30,30,35,0.92)":"rgba(255,255,255,0.92)",r.beginPath(),r.roundRect?r.roundRect(b.x-Xe/2,Ke,Xe,it,4*Ze):r.rect(b.x-Xe/2,Ke,Xe,it),r.fill(),r.strokeStyle=se()?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)",r.lineWidth=1*Ze,r.stroke(),r.fillStyle=se()?Fe||et?"#eee":"#bbb":Fe||et?"#111":"#444",r.textAlign="center",r.fillText(gt,b.x,Ke+13*Ze)}}),r.restore(),a.marquee){let b=a.marquee,ne=Math.min(b.sx,b.ex),oe=Math.min(b.sy,b.ey),he=Math.abs(b.ex-b.sx),Te=Math.abs(b.ey-b.sy);r.save(),r.setLineDash([4,4]),r.strokeStyle="rgba(96,165,250,0.9)",r.lineWidth=1,r.fillStyle="rgba(96,165,250,0.12)",r.fillRect(ne,oe,he,Te),r.strokeRect(ne,oe,he,Te),r.restore()}if(a.hoverId&&le.current){let b=a.domainById[a.hoverId],ne=a.nodes.find(function(oe){return oe.id===a.hoverId});if(b&&ne){let oe=a.edges.filter(function(Fe){return Fe.sourceNodeId===b.id||Fe.targetNodeId===b.id}).length,he=ne.x*a.zoom+a.panX,Te=ne.y*a.zoom+a.panY;le.current.style.display="block",le.current.style.left=he+14+"px",le.current.style.top=Te-6+"px",le.current.innerHTML="<b>"+N(b.title||b.name||"")+'</b><br/><span style="opacity:.8">'+N(b.kind||"")+" \xB7 "+tRef.current("connCount").replace("{n}",oe)+"</span>"}}else le.current&&(le.current.style.display="none")},_=()=>{a.running=!0,a.raf||(a.raf=requestAnimationFrame(ze))};a.wake=_,a.render=q;let me=()=>{let m=a.nodes.length;a.tickCount++;let N=.9-Math.min(.4,a.tickCount/1500),F=m>1e3?3e3:m>100?2e3:m>50?1200:800,V=m>100?.002:.005,ue=m>1e3?.012:m>100?.005:.01,ae=m>1e3?6:m>200?12:24,Ie={};a.nodes.forEach(fe=>Ie[fe.id]=fe);for(let fe=0;fe<m;fe++){if(a.dragNode===a.nodes[fe])continue;let xe=a.nodes[fe],He=0,Ue=0;for(let b=0;b<m;b++){if(fe===b)continue;let ne=xe.x-a.nodes[b].x,oe=xe.y-a.nodes[b].y,he=Math.sqrt(ne*ne+oe*oe)||1,Te=F/(he*he);He+=ne/he*Te,Ue+=oe/he*Te}if(a.clustered&&a.typeCenters[xe.type]){let b=a.typeCenters[xe.type];He+=(b.x-xe.x)*.006,Ue+=(b.y-xe.y)*.006}else He-=xe.x*ue,Ue-=xe.y*ue;let Ee=(xe.vx+He)*N,Je=(xe.vy+Ue)*N;Ee=Math.max(-ae,Math.min(ae,Ee)),Je=Math.max(-ae,Math.min(ae,Je)),xe.vx=Ee,xe.vy=Je}a.edges.forEach(fe=>{let xe=Ie[fe.sourceNodeId],He=Ie[fe.targetNodeId];if(!xe||!He)return;let Ue=He.x-xe.x,Ee=He.y-xe.y,Je=Math.sqrt(Ue*Ue+Ee*Ee)||1,b=(Je-100)*V,ne=Ue/Je*b,oe=Ee/Je*b;a.dragNode!==xe&&(xe.vx+=ne,xe.vy+=oe),a.dragNode!==He&&(He.vx-=ne,He.vy-=oe)});let _e=0;a.nodes.forEach(fe=>{a.dragNode!==fe&&(fe.x+=fe.vx,fe.y+=fe.vy,_e+=fe.vx*fe.vx+fe.vy*fe.vy)}),a.autoFitPending&&a.tickCount>45&&(a.autoFitPending=!1,M()),(m?Math.sqrt(_e/m):0)<.05&&a.tickCount>60&&!a.dragNode?a.quietTicks=(a.quietTicks|0)+1:a.quietTicks=0},ze=()=>{if(a.running){try{me(),q()}catch{}if(a.quietTicks>30){a.raf=0;return}a.raf=requestAnimationFrame(ze)}},je=(m,L)=>{let N=p.getBoundingClientRect();return{x:(m-N.left-a.panX)/a.zoom,y:(L-N.top-a.panY)/a.zoom}},Ye=m=>{let L=a.domainById[m];return!(!L||ie.current!=="all"&&L.kind!==ie.current||ke.current&&!(L.tags||[]).includes(ke.current))},$e=(m,L,N)=>Math.max(L,Math.min(N,m)),Ge=m=>{a.mouseX=m.clientX,a.mouseY=m.clientY;let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+36){N=V.id;break}}N!==a.hoverId&&(a.hoverId=N,_())},vt=m=>{if(m.button!==0)return;let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+25){N=V;break}}if(m.shiftKey){if(N){a.shiftClick=N.id;return}a.marquee={sx:m.clientX,sy:m.clientY,ex:m.clientX,ey:m.clientY};return}a.dragStart={x:m.clientX,y:m.clientY,px:a.panX,py:a.panY},a.dragging=!1,a.dragNode=N||null,N&&(a.dragOffset={dx:N.x-L.x,dy:N.y-L.y})},At=m=>{if(a.marquee){a.marquee.ex=m.clientX,a.marquee.ey=m.clientY,_();return}if(!a.dragStart)return;let L=m.clientX-a.dragStart.x,N=m.clientY-a.dragStart.y;if(Math.abs(L)+Math.abs(N)>3&&(a.dragging=!0),a.dragNode){let F=je(m.clientX,m.clientY);a.dragNode.x=F.x+a.dragOffset.dx,a.dragNode.y=F.y+a.dragOffset.dy,_()}else a.dragging&&(a.panX=$e(a.dragStart.px+L,-1e5,1e5),a.panY=$e(a.dragStart.py+N,-1e5,1e5),_())},Bt=m=>{if(a.marquee){let N=a.marquee;a.marquee=null;let F=p.getBoundingClientRect(),V=Math.min(N.sx,N.ex)-F.left,ue=Math.max(N.sx,N.ex)-F.left,ae=Math.min(N.sy,N.ey)-F.top,Ie=Math.max(N.sy,N.ey)-F.top,_e=a.nodes.filter(ot=>{let fe=ot.x*a.zoom+a.panX,xe=ot.y*a.zoom+a.panY;return fe>=V&&fe<=ue&&xe>=ae&&xe<=Ie}).map(ot=>ot.id);a.multi=_e,Be(_e),_();return}let L=a.dragStart&&!a.dragging;if(a.shiftClick){let N=a.shiftClick;a.shiftClick=null;let F=Array.isArray(a.multi)?a.multi.slice():[];F.includes(N)||F.push(N),a.multi=F,Be(F),_();return}if(L){let N=je(m.clientX,m.clientY),F=null;for(let V=a.nodes.length-1;V>=0;V--){let ue=a.nodes[V];if(!Ye(ue.id))continue;let ae=ue.x-N.x,Ie=ue.y-N.y;if(ae*ae+Ie*Ie<ue.r*ue.r+20){F=ue;break}}F?(a.selectedId=F.id,j(F.id),_()):(a.selectedId=null,a.hoverId=null,m.shiftKey||(a.multi=[],Be([])),j(null),_())}a.dragStart=null,a.dragging=!1,a.dragNode=null},jt=m=>{m.preventDefault();let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+25){N=V;break}}if(N){let F=a.domainById[N.id];F&&W({x:m.clientX,y:m.clientY,id:N.id,path:F.id,title:F.title})}else W(null)},Pt=m=>{m.preventDefault();let L=p.getBoundingClientRect(),N=(m.clientX-L.left-a.panX)/a.zoom,F=(m.clientY-L.top-a.panY)/a.zoom,V=Math.max(.3,Math.min(3,a.zoom*(m.deltaY<0?1.1:1/1.1)));a.panX=$e(a.panX+N*(a.zoom-V),-1e5,1e5),a.panY=$e(a.panY+F*(a.zoom-V),-1e5,1e5),a.zoom=V,_()};p.addEventListener("mousemove",Ge),p.addEventListener("mousedown",vt),window.addEventListener("mousemove",At),window.addEventListener("mouseup",Bt),p.addEventListener("wheel",Pt,{passive:!1}),p.addEventListener("contextmenu",jt),T.current=()=>{a.selectedId=null,a.hoverId=null,a.multi=[],Be([]),M(),_()};for(let m=0;m<200;m++)me();M(),_();let Ft=()=>U(!1);return window.addEventListener("mousedown",Ft),()=>{a.running=!1,a.raf&&cancelAnimationFrame(a.raf),d.disconnect(),p.removeEventListener("mousemove",Ge),p.removeEventListener("mousedown",vt),window.removeEventListener("mousemove",At),window.removeEventListener("mouseup",Bt),p.removeEventListener("wheel",Pt),p.removeEventListener("contextmenu",jt),window.removeEventListener("mousedown",Ft)}},[t,o]),(0,n.useEffect)(()=>{H!==void 0&&I.current&&requestAnimationFrame(()=>I.current())},[H]),(0,e.jsxs)("div",{className:"me-graph",ref:h,children:[(0,e.jsxs)("div",{className:"me-graph-toolbar",children:[(0,e.jsxs)("span",{className:"me-graph-count",children:[t.length," ",i("nodes")," \xB7 ",o.length," ",i("edges")]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),(0,e.jsx)("input",{type:"text",placeholder:i("search"),value:K,onChange:p=>te(p.target.value)}),(0,e.jsxs)("span",{style:{position:"relative",display:"inline-flex"},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>U(p=>!p),"aria-expanded":Z,title:i("filterLabel"),style:{borderRadius:8},children:["\u{1F50D} ",i("filterLabel")," ",X!=="all"||Q||ve?"\u25CF":"\u25BE"]}),Z&&(0,e.jsx)("div",{className:"me-graph-legend-pop",onMouseDown:p=>p.stopPropagation(),style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:50,background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,padding:8,minWidth:240,boxShadow:"0 12px 34px rgba(0,0,0,.35)"},children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,e.jsx)("button",{type:"button",className:`lg${X==="all"&&!Q?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>{be("all"),pe(!1)},children:i("all")}),Object.keys(Ve).map(p=>(0,e.jsxs)("button",{type:"button",className:`lg${X===p?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>be(r=>r===p?"all":p),children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[p]||Ve[p]}}),i(qe[p])]},p)),(0,e.jsx)("div",{style:{height:1,background:"rgba(255,255,255,0.1)",margin:"4px 0"}}),(0,e.jsxs)("button",{type:"button",className:`lg${Q?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>pe(p=>!p),children:["\u23F1 ",i("timeDim")]}),re.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{style:{height:1,background:"rgba(255,255,255,0.1)",margin:"4px 0"}}),(0,e.jsx)("div",{style:{maxHeight:130,overflow:"auto",display:"flex",flexWrap:"wrap",gap:4},children:re.map(p=>(0,e.jsxs)("button",{type:"button",className:`lg${ve===p.tag?" active":""}`,style:{color:"#ddd",padding:"2px 7px",fontSize:11},onClick:()=>C(r=>r===p.tag?"":p.tag),title:p.tag,children:["#",p.tag," ",(0,e.jsx)("span",{style:{opacity:.55},children:p.n})]},p.tag))})]}),(X!=="all"||Q||ve)&&(0,e.jsxs)("button",{type:"button",className:"lg lg-clear",style:{justifyContent:"flex-start",color:"#f87171"},onClick:()=>{be("all"),pe(!1),C("")},children:[i("clearFilter")," \u2715"]})]})})]}),(0,e.jsxs)("label",{className:"mc-btn",style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"pointer"},title:i("crossVault"),children:[(0,e.jsx)("input",{type:"checkbox",checked:!!D,onChange:p=>k&&k(p.target.checked)}),i("crossVault")]}),(0,e.jsx)("button",{type:"button",className:`mc-btn${Q?" me-on":""}`,onClick:()=>pe(p=>!p),children:i("timeDim")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=S.current;if(p)try{p.toBlob(r=>{r&&Me({url:URL.createObjectURL(r),blob:r})},"image/png")}catch{}},children:i("exportGraph")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>I.current&&I.current(),children:i("fit")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{j(null),be("all"),T.current&&T.current()},children:i("reset")})]}),(0,e.jsxs)("div",{className:"me-graph-canvas",style:{position:"relative",overflow:"hidden"},children:[(0,e.jsx)("canvas",{ref:S,style:{width:"100%",height:"100%",display:"block",cursor:"grab"}}),(0,e.jsx)("div",{className:"me-graph-tooltip",ref:le,style:{display:"none",position:"absolute",zIndex:4,pointerEvents:"none",background:"rgba(28,28,32,0.88)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:8,padding:"7px 10px",fontSize:12,maxWidth:220,boxShadow:"0 8px 24px rgba(0,0,0,.2)"}}),J&&(0,e.jsx)("div",{className:"mc-empty",style:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:i("noMatch")}),y&&(0,e.jsx)("div",{className:"me-graph-ctx-back",style:{position:"fixed",inset:0,zIndex:30},onMouseDown:()=>W(null)}),y&&(0,e.jsxs)("div",{className:"me-graph-ctxmenu",style:{position:"fixed",left:y.x,top:y.y,zIndex:31},onMouseDown:p=>p.stopPropagation(),children:[(0,e.jsx)("button",{type:"button",onClick:()=>{v.current({path:y.path,title:y.title}),W(null)},children:i("openCard")}),(0,e.jsx)("button",{type:"button",onClick:()=>{y.id&&(g.current.selectedId=y.id,j(y.id)),W(null);let p=g.current;p&&p.wake&&p.wake()},children:i("focusNeighbors")}),(0,e.jsx)("button",{type:"button",onClick:()=>{try{navigator.clipboard&&navigator.clipboard.writeText(y.title||"")}catch{}W(null),ee(i("copied"))},children:i("copyName")}),(0,e.jsx)("button",{type:"button",onClick:()=>{let p=g.current,r=p&&Array.isArray(p.multi)?p.multi.slice():[],$=y.id;if($&&!r.includes($)&&r.push($),W(null),r.length<2){ee(i("mergeNeed"),!1);return}if(!window.confirm(i("mergeConfirm")))return;let se=A.current&&A.current(r);se&&se.then?se.then(ce=>ce?ee(i("merged")):ee(i("mergeFail"),!1)).catch(()=>ee(i("mergeFail"),!1)):se&&ee(i("merged"))},children:i("merge")}),(0,e.jsx)("button",{type:"button",style:{color:"#f87171"},onClick:()=>{let p=y.path;W(null),window.confirm(i("deleteConfirm"))&&(async()=>{try{(B.current?await B.current(p):!1)?ee(i("deleted")):ee(i("deleteFail"),!1)}catch{ee(i("deleteFail"),!1)}})()},children:i("delete")})]}),ye.length>0&&(0,e.jsxs)("div",{style:{position:"absolute",left:10,top:10,zIndex:3,display:"flex",gap:8,alignItems:"center",background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:10,padding:"6px 10px",fontSize:12,boxShadow:"0 10px 30px rgba(0,0,0,.25)"},children:[(0,e.jsxs)("span",{style:{fontWeight:700},children:[ye.length," ",i("nodes")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let r=ye.map(ge=>Re[ge]).filter(Boolean).map(ge=>ge.title||ge.name).join(`
|
|
307
|
-
`),$=new Blob([r],{type:"text/plain;charset=utf-8"}),se=URL.createObjectURL($),ce=document.createElement("a");ce.href=se,ce.download="memory-selected.txt",document.body.appendChild(ce),ce.click(),document.body.removeChild(ce),setTimeout(()=>URL.revokeObjectURL(se),1e3),ee(ye.length+i("exportedSel"))},children:i("exportSel")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{if(ye.length<2){ee(i("mergeNeed"),!1);return}let p=ye.map($=>Re[$]?Re[$].id:$);if(!window.confirm(i("mergeConfirm")))return;Be([]);let r=g.current;r&&(r.multi=[]),fetch(`${O}/merge?paths=${encodeURIComponent(p.join(","))}`).then($=>$.json()).then($=>{$&&$.ok?ee(i("merged")):ee(i("mergeFail"),!1)}).catch(()=>ee(i("mergeFail"),!1))},children:i("merge")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},onClick:()=>{if(!window.confirm(i("deleteConfirm")))return;let p=ye.map($=>Re[$]?Re[$].id:$);Be([]);let r=g.current;r&&(r.multi=[]),(async()=>{let $=0;for(let se of p)try{(B.current?await B.current(se):!1)&&$++}catch{}ee($+i("deletedSelected"),$>0)})()},children:i("deleteSelected")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=g.current;p&&(p.multi=[]),Be([]);let r=g.current;r&&r.render&&r.render()},children:i("clearSelection")})]}),Y&&(0,e.jsxs)("div",{className:"me-graph-sidebar",style:{position:"absolute",right:10,top:10,zIndex:3,maxWidth:240,background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:10,padding:12,fontSize:12,boxShadow:"0 10px 30px rgba(0,0,0,.25)"},children:[(0,e.jsx)("div",{style:{fontWeight:700,fontSize:13,marginBottom:4},children:Re[Y]?Re[Y].title||Re[Y].name:Y}),(0,e.jsx)("div",{style:{opacity:.8,marginBottom:8},children:Re[Y]?i(qe[Re[Y].kind]||"kindKnowledge"):"\u2014"}),(0,e.jsx)("div",{style:{fontSize:11,opacity:.65,letterSpacing:".04em",marginBottom:6},children:i("graphHint")}),(o.filter(p=>p.source===Y||p.target===Y)||[]).slice(0,8).map((p,r)=>{let $=p.source===Y?p.target:p.source,se=Re[$];return(0,e.jsx)("div",{style:{padding:"4px 6px",cursor:"pointer",borderRadius:6},onMouseDown:ce=>{ce.preventDefault();let ge=g.current;ge&&(ge.selectedId=$,ge.hoverId=$,ge.wake&&ge.wake()),j($)},children:se?(se.title||se.name).slice(0,28):$},r)})]})]}),(0,e.jsx)("div",{className:"me-graph-tip",children:i("graphTip")}),x&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(x.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:x.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:x.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{style:{wordBreak:"break-all"},children:x.msg})]}),Ne&&(0,e.jsxs)("div",{className:"me-overlay",onClick:()=>{Ne.url&&URL.revokeObjectURL(Ne.url),Me(null),s(!1)},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:De?"100vw":900,width:De?"100vw":"92vw",maxHeight:De?"100%":"90vh",height:De?"100%":void 0,borderRadius:De?0:14},onClick:p=>p.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsx)("h3",{children:i("exportGraph")}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("a",{className:"mc-btn",href:Ne.url,download:"memory-graph.png",onClick:()=>{We("download"),ee(i("downloaded")+" \xB7 "+i("defaultDownloads"))},style:{textDecoration:"none",display:"inline-flex",alignItems:"center"},children:i(G==="download"?"done":"download")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{We("full"),s(p=>!p),ee(i("fullscreen"))},children:i(G==="full"?"done":De?"exitFull":"fullscreen")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=Ne.blob;p&&window.ClipboardItem&&navigator.clipboard?navigator.clipboard.write([new window.ClipboardItem({"image/png":p})]).then(()=>{We("copy"),ee(i("copied"))}).catch(()=>{ee(i("copyFail"),!1)}):ee(i("copyFail"),!1)},children:i(G==="copy"?"done":"copyImage")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{Ne.url&&URL.revokeObjectURL(Ne.url),Me(null),s(!1)},children:i("close")})]})]}),(0,e.jsx)("div",{className:"me-dialog-body",style:{display:"flex",justifyContent:"center",background:De?"var(--dsw-alias-bg-base, #0b0d10)":"var(--dsw-alias-bg-base, #f3f4f6)"},children:(0,e.jsx)("img",{src:Ne.url,alt:i("exportGraph"),style:{maxWidth:"100%",maxHeight:De?"calc(100% - 64px)":"70vh",borderRadius:De?0:8,cursor:"zoom-in"},onClick:()=>s(p=>!p)})})]})]})]})}function
|
|
305
|
+
`);let je=new Blob([_],{type:ze}),Ye=await $a(je,me,!1);if(!Ye.ok){Q({ok:!1,msg:t("exportFail")}),W(!1);return}Q({ok:!0,msg:t("exportedTo")+"\uFF1A"+t("defaultDownloads")+" \xB7 "+Ye.name})}catch(M){Q({ok:!1,msg:t("exportFail")+" \xB7 "+(M.message||"")})}finally{W(!1)}pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2600)},d=async u=>{let z=u.target.files&&u.target.files[0];if(u.target.value="",!!z){try{let M=await z.text(),_=await(await fetch(`${O}/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:M})).json();if(_.ok){await ge();let me=_.imported||0,ze=t("importedVault")+"\uFF1A"+me;_.total&&(ze+=t("importedTotal")+_.total+t("importedTotalTail")),_.quarantined&&(ze+=t("importedQuarantine")+_.quarantined+t("importedQuarantineTail")),_.skipped&&(ze+=t("importedSkipped")+_.skipped+t("importedSkippedTail")),_.warning&&(ze+=" \xB7 "+_.warning),Q({ok:me>0||!_.total,msg:ze})}else Q({ok:!1,msg:_.error||t("importFail")})}catch{Q({ok:!1,msg:t("importFail")})}pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2400)}},P=(0,n.useMemo)(()=>{let u=D.slice();return te!=="all"&&(u=u.filter(z=>ut(z.submittedBy)===te)),j!=="all"&&(u=u.filter(z=>(z.status||"approved")===j)),ve==="title"?u.sort((z,M)=>String(z.title||"").localeCompare(String(M.title||""))):ve==="hot"?u.sort((z,M)=>(M.weight||M.links||0)-(z.weight||z.links||0)):u.sort((z,M)=>new Date(M.updated||0).getTime()-new Date(z.updated||0).getTime()),u},[D,ve,te,j]),E=(0,n.useMemo)(()=>[...new Set(D.map(u=>ut(u.submittedBy)))],[D]);return(0,e.jsxs)("div",{className:"memory-eternal-root",style:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,e.jsx)("style",{children:Oe}),ke&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(ke.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:ke.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:ke.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{children:ke.msg})]}),o&&(0,e.jsxs)("div",{className:"me-modal-head",children:[(0,e.jsxs)("div",{className:"me-modal-title",children:[(0,e.jsx)("span",{className:"me-wicon",children:(0,e.jsx)(ea,{})}),(0,e.jsx)("h2",{children:t("memoryTitle")}),(0,e.jsx)("span",{children:t("memoryHint")})]}),(0,e.jsx)("div",{className:"spacer"}),f&&(0,e.jsx)("button",{type:"button",className:"me-modal-close",onClick:f,"aria-label":t(c?"exitFull":"fullscreen"),children:c?"\u2750":"\u26F6"}),(0,e.jsx)("button",{type:"button",className:"me-modal-close",onClick:l,"aria-label":t("close"),children:"\u2715"})]}),h&&h.ok===!1&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,margin:"0 0 8px",padding:"9px 14px",borderRadius:10,background:"rgba(239,68,68,0.10)",border:"1px solid rgba(239,68,68,0.45)",borderLeft:"4px solid #ef4444",color:"var(--dsw-alias-label-primary, #e5e7eb)",fontSize:12.5,lineHeight:1.6},children:[(0,e.jsxs)("span",{style:{fontWeight:800},children:["\u26A0 ",t("captureAlert")]}),(0,e.jsxs)("span",{style:{flex:1},children:[h.reason,(0,e.jsx)("div",{style:{opacity:.68,fontSize:11.5,marginTop:2},children:t("captureAlertHint")})]}),(0,e.jsx)("span",{style:{opacity:.7},children:h.since?pt(new Date(h.since).toISOString()):""})]}),(0,e.jsxs)("div",{className:"me-modal-body",children:[(0,e.jsxs)("div",{className:`mc-rail${Me?" open":""}`,children:[(0,e.jsx)("button",{type:"button",className:"mc-rail-collapse",onClick:()=>De(u=>!u),"aria-label":t(Me?"collapse":"expand"),title:t(Me?"collapse":"expand"),children:Me?"\xAB":"\xBB"}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="cards"?" active":""}`,onClick:()=>ie("cards"),title:t("cardsTab"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F9E0}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("cardsTab")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="graph"?" active":""}`,onClick:()=>ie("graph"),title:t("graphTab"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F52E}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("graphTab")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="stats"?" active":""}`,onClick:()=>ie("stats"),title:t("tabUsage"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F4C8}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabUsage")})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="audit"?" active":""}`,onClick:()=>ie("audit"),title:t("tabAudit"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F50D}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabAudit")}),Ce>0&&(0,e.jsx)("span",{className:"mc-dot",children:Ce>99?"99+":Ce})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="optimize"?" active":""}`,onClick:()=>ie("optimize"),title:t("tabRecycle"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u267B\uFE0F"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabRecycle")}),de>0&&(0,e.jsx)("span",{className:"mc-dot",style:{background:"#6b7280"},children:de>99?"99+":de})]}),(0,e.jsxs)("button",{type:"button",className:`mc-railbtn${X==="config"?" active":""}`,onClick:()=>ie("config"),title:t("tabConfig"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u2699\uFE0F"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("tabConfig")})]}),(0,e.jsxs)("button",{type:"button",className:"mc-railbtn",onClick:()=>Ne(!0),title:t("fbNav"),children:[(0,e.jsx)("span",{className:"mc-rail-ico",children:"\u{1F41E}"}),Me&&(0,e.jsx)("span",{className:"mc-rail-label",children:t("fbNav")})]})]}),(0,e.jsxs)("div",{className:"mc-main",ref:se,children:[i&&i.db&&i.db.writable===!1?(0,e.jsxs)("div",{style:{margin:"8px 10px 0",padding:"8px 12px",borderRadius:8,fontSize:12,lineHeight:1.7,background:"rgba(239,68,68,0.10)",border:"1px solid rgba(239,68,68,0.35)",color:"#b91c1c"},children:["\u26A0\uFE0F ",t("dbReadonlyTitle"),"\uFF1A",i.db.error||"\u2014"," \u2014\u2014 ",t("dbReadonlyBody"),(0,e.jsx)("div",{style:{opacity:.85,marginTop:2},children:t("dbReadonlyFix")})]}):null,X==="cards"&&(0,e.jsxs)("div",{className:"mc-stats",children:[(0,e.jsx)(dt,{label:t("total"),value:i?i.total:"\u2014"}),(0,e.jsx)(dt,{label:t("recent"),value:i?i.recent:"\u2014"}),(0,e.jsx)(dt,{label:t("tags"),value:i?i.tags:"\u2014"}),(0,e.jsx)(dt,{label:t("pending"),value:i?.quarantine?.pending??i?.status?.pending??0}),(0,e.jsx)(dt,{label:t("rejected"),value:i?.quarantine?.rejected??i?.status?.rejected??0}),(0,e.jsx)(dt,{label:t("cardCount"),value:i?i.byKind?.knowledge??0:"\u2014"})]}),X==="cards"&&(0,e.jsxs)("div",{className:"mc-toolbar",children:[(0,e.jsx)("input",{type:"text",placeholder:t("searchPlaceholder"),value:A,onChange:u=>tt(u.target.value)}),(0,e.jsx)("input",{ref:Pe,type:"file",accept:".json,application/json",style:{display:"none"},onChange:d}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>Pe.current&&Pe.current.click(),children:t("importVault")}),(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",onClick:()=>x({kind:"knowledge",title:"",body:"",tags:"",template:""}),children:["+ ",t("newCard")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:y,onClick:()=>Le("md"),children:t(y?"exporting":"exportVault")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:y,onClick:()=>Le("json"),children:t(y?"exporting":"exportJson")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>ge(),children:t("refresh")})]}),X==="cards"&&(0,e.jsxs)("div",{className:"mc-chips",children:[Lt.map(u=>(0,e.jsx)("button",{type:"button",className:`mc-chip${v===u?" active":""}`,onClick:()=>we(u),children:t(u==="all"?"all":qe[u])},u)),(0,e.jsxs)("select",{value:te,onChange:u=>Y(u.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsxs)("option",{value:"all",children:["\u{1F916} ",t("allAgents")]}),Qt(E).map(u=>(0,e.jsx)("option",{value:u,children:u},u))]}),(0,e.jsxs)("select",{value:j,onChange:u=>Ae(u.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("allStatus")}),(0,e.jsx)("option",{value:"approved",children:t("statusApproved")}),(0,e.jsx)("option",{value:"pending",children:t("statusPending")}),(0,e.jsx)("option",{value:"rejected",children:t("statusRejected")})]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),[{key:"recent",label:t("sortRecent")},{key:"title",label:t("sortTitle")},{key:"hot",label:t("sortHot")}].map(u=>(0,e.jsx)("button",{type:"button",className:`mc-chip${ve===u.key?" active":""}`,onClick:()=>C(u.key),children:u.label},u.key))]}),I&&(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",I]}),(0,e.jsx)("div",{style:{display:X==="cards"?"contents":"none"},children:H?(0,e.jsx)("div",{className:"mc-empty",children:t("loading")}):I?(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",I," ",(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>ge(),children:t("retry")})]}):D.length===0?(0,e.jsx)("div",{className:"mc-empty",children:t("empty")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"mc-grid",children:P.map(u=>(0,e.jsx)(La,{card:u,t,query:A.trim(),onOpen:nt,onDelete:a},u.path))}),D.length<We&&(0,e.jsx)("div",{ref:$,style:{height:1}}),p&&(0,e.jsxs)("div",{className:"mc-empty",style:{padding:"10px 0"},children:[t("loading"),"\uFF08",D.length," / ",We,"\uFF09"]})]})}),(0,e.jsx)("div",{style:{display:X==="graph"?"flex":"none",flex:1,minHeight:0},children:Z.has("graph")&&(0,e.jsx)(Fa,{t,onOpen:nt,all:le,onAllChange:ye,onMutate:Se,active:X==="graph",visible:X==="graph"})}),(0,e.jsx)("div",{style:{display:X==="config"?"contents":"none"},children:Z.has("config")&&(0,e.jsx)(aa,{t,onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="stats"?"contents":"none"},children:Z.has("stats")&&(0,e.jsx)(Aa,{t,tab:"stats",onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="audit"?"contents":"none"},children:Z.has("audit")&&(0,e.jsx)(za,{t,onReload:()=>ge(),version:R})}),(0,e.jsx)("div",{style:{display:X==="optimize"?"contents":"none"},children:Z.has("optimize")&&(0,e.jsx)(Ia,{t,onReload:()=>ge(),version:R})}),Be&&(0,e.jsx)(ja,{t,onClose:()=>Ne(!1)}),re&&(0,e.jsx)(Pa,{t,card:re,query:A.trim(),onClose:()=>J(null),onDelete:u=>{J(null),a(u)},onFeedback:u=>{let z=re.path;fetch(`${O}/feedback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:A.trim(),path:z,useful:u})}).then(()=>Q({ok:!0,msg:t(u?"fbUseful":"fbIrr")})).catch(()=>{}),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2e3)}}),(0,e.jsx)(Ba,{t,newCard:s,setNewCard:x,onCreated:()=>{ge(),Se(),Q({ok:!0,msg:t("created")}),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>Q(null),2e3)}})]})]})]})}var ta=({toast:t})=>t?(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"8px 12px",fontSize:12,borderLeft:"4px solid "+(t.ok?"#10b981":"#ef4444"),background:t.ok?"rgba(16,185,129,0.08)":"rgba(239,68,68,0.08)"},children:[t.ok?"\u2705":"\u26A0"," ",t.msg]}):null,dt=({label:t,value:o})=>(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:o}),(0,e.jsx)("span",{children:t})]});function aa({t,onReload:o,version:l,compact:f}){let[c,i]=(0,n.useState)(null),[w,D]=(0,n.useState)(0),[k,H]=(0,n.useState)(null),[S,h]=(0,n.useState)(null),[g,I]=(0,n.useState)(!1),[T,v]=(0,n.useState)(!1),B=(0,n.useRef)(!1),A=(0,n.useRef)(null),K=(0,n.useRef)({}),[te,Y]=(0,n.useState)(null),[j,Ae]=(0,n.useState)(null),[X,be]=(0,n.useState)(""),[Z,U]=(0,n.useState)(""),[ie,ve]=(0,n.useState)(""),[C,ke]=(0,n.useState)(null),Q=(0,n.useCallback)(async d=>{U("version");try{let P=await fetch(O+"/version-check"+(d?"?force=1":"")).then(E=>E.json());P&&P.ok?(ke(P),d&&J(P.updateAvailable?t("vcLatest")+" v"+P.latest:t("vcUpToDate"))):d&&J(t("vcCheckFail"),!1)}catch{d&&J(t("vcCheckFail"),!1)}finally{U("")}},[t]);(0,n.useEffect)(()=>{Q(!1)},[l,Q]);let[pe,Pe]=(0,n.useState)(""),[y,W]=(0,n.useState)(null),re=(0,n.useRef)(null),J=(d,P=!0)=>{re.current&&clearTimeout(re.current),W({msg:d,ok:P}),re.current=setTimeout(()=>W(null),1900)},le=async()=>{if(!Z){U("restart");try{let d=await fetch(O+"/restart-self",{method:"POST"});if(d.status===404||d.status===405){J(x("vcRestartNoRoute",{cmd:C&&C.restartCommand||"dsh-memory restart --port 7999"}),!1);return}let P=await d.json().catch(()=>null);if(!P){J(t("vcRestartFail")+"\uFF08HTTP "+d.status+"\uFF09",!1);return}if(!P.ok){J(P.error||t("vcRestartFail"),!1);return}if(P.alreadyCurrent){J(P.note||t("vcRestartCurrent"));return}J(P.note||t("vcRestartSent")),P.alreadyRunning||setTimeout(()=>{Q(!0)},6e3)}catch(d){J(t("vcRestartFail")+"\uFF1A"+String(d&&d.message||d),!1)}finally{U("")}}},ye=C&&C.resident?String(C.resident.served||""):"",Be=!!(C&&C.onDisk&&ye&&ye!==C.onDisk),Ne=!!(C&&C.resident&&C.resident.managed===!1&&C.resident.managedKnown===!1),Me=!!(C&&C.resident&&C.resident.managed===!1&&!Ne),De=!!(C&&C.resident&&!ye),s=Be||De||Me||Ne,x=(d,P)=>Object.keys(P).reduce((E,u)=>E.split("{"+u+"}").join(P[u]),t(d)),R=(0,n.useCallback)(async()=>{try{let[d,P,E]=await Promise.all([fetch(`${O}/config`).then(u=>u.json()).catch(()=>null),fetch(`${O}/setup-status`).then(u=>u.json()).catch(()=>null),fetch(`${O}/budget`).then(u=>u.json()).catch(()=>null)]);if(d&&d.ok){i(d),D(d.revision??0),H(d.schema??null);let u=qt(d.config??{},K.current);K.current=u.overlay,h({...u.values}),Y(d.dsh??null),I(d.writable===!1),v(d.viaPending===!0),be(""),B.current=!1}else E&&E.ok?(h({...E}),I(!0),be(t("configNeedsDsh"))):be(t("adminLoadFail"));P&&P.ok&&Ae(P),ve("")}catch{be(t("adminLoadFail"))}},[t]);(0,n.useEffect)(()=>{R()},[l,R]);let G=(d,P)=>{B.current=!0,h(E=>({...E??{},[d]:P}))};(0,n.useEffect)(()=>{A.current=R},[R]),(0,n.useEffect)(()=>{if(typeof EventSource>"u")return;let d=null;try{d=new EventSource(O+"/events")}catch{return}let P=()=>{!B.current&&typeof A.current=="function"&&A.current()};try{d.addEventListener("config",P)}catch{}return()=>{try{d.close()}catch{}}},[]);let Se=new Set(["dedupThreshold","captureMinChars","captureCooldownMs","maxCardsPerDay","captureMaxTokens","recallMinScore","recallLimit","recallSummaryLen","recycleRetentionDays","webPort","webCheckIntervalMs","webMaxRestart","sessionBudgetChars"]),Ce=d=>({init:t("modeInit"),interval:t("modeInterval"),manual:t("modeManual")})[d]||d,de=async()=>{if(!S)return;if(g){J(t("editInSetting"),!1);return}let d={dedupThreshold:[0,1],captureMinChars:[0,1e6],captureCooldownMs:[0,1e9],maxCardsPerDay:[0,1e6],captureMaxTokens:[100,4e3],recallMinScore:[0,50],recallLimit:[1,20],recallSummaryLen:[40,400],recycleRetentionDays:[1,3650],webPort:[1,65535],webCheckIntervalMs:[1e3,6e5],webMaxRestart:[1,1e3],sessionBudgetChars:[0,1e9]},P=[];for(let[E,[u,z]]of Object.entries(d)){if(!(E in S))continue;let M=S[E],q=typeof M=="number"?M:Number(M);(M===""||M===null||M===void 0||!Number.isFinite(q)||q<u||q>z)&&P.push(t("invalidField",{field:E,min:u,max:z,value:String(M===""?"\u7A7A":M)}))}if(P.length){let E=t("saveInvalid")+"\uFF1A"+P.join("\uFF1B");be(E),J(E,!1);return}U("save");try{let E={...S};for(let q of Object.keys(S))q in E&&typeof E[q]=="string"&&E[q].trim()!==""&&Se.has(q)&&(E[q]=Number(E[q]));Array.isArray(E.vaultProfiles)&&(E.vaultProfiles=E.vaultProfiles.filter(q=>q&&(String(q.name||"").trim()||String(q.path||"").trim())));let u=await fetch(`${O}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patch:E,expectedRevision:w})}),z=await u.text(),M=null;try{M=z?JSON.parse(z):null}catch{M=null}if(M||(M={error:"HTTP "+u.status+(z?"\uFF1A"+z.slice(0,200):"\uFF08\u5BBF\u4E3B\u672A\u8FD4\u56DE\u539F\u56E0\uFF0C\u8BF7\u68C0\u67E5\u662F\u5426\u6709\u6570\u5B57\u5B57\u6BB5\u4E3A\u7A7A\u6216\u8D85\u51FA\u8303\u56F4\uFF09")}),M&&M.ok){let q=typeof M.pendingOutcome=="string"?M.pendingOutcome:"",_,me=!0;if(q==="applied")_=t("savedApplied")+(Array.isArray(M.applied)&&M.applied.length?" \xB7 "+M.applied.join("\u3001"):"");else if(q==="queued")me=!1,_=t("saveQueued");else if(q==="failed")me=!1,_=t("saveFail")+" \xB7 "+(M.hostGuard?t("saveHostGuard"):t("saveFailHint"));else if(q==="applied-direct")_=t("savedOk")+" \xB7 "+t("savedDirect");else{let ze=Array.isArray(M.pending)&&M.pending.length?" \xB7 "+t("savePending"):M.note?" \xB7 "+t("restartHint"):"";_=(M.retried?"\u267B ":"")+t("savedOk")+ze}K.current={...K.current,...E},me?ve(_):be(_),J(_,me),await R()}else{let q=u.status===409?t("conflictRefresh"):M?.error||t("saveFail");be(q),J(q,!1)}}catch{be(t("saveFail")),J(t("saveFail"),!1)}finally{U("")}},ee=()=>{K.current={},h({...c?.config??{}}),ve("")},We={env:"vaultSrcEnv",profile:"vaultSrcProfile",workspace:"vaultSrcWorkspace",vaultDir:"vaultSrcVaultDir",default:"vaultSrcDefault"},Re=d=>Array.isArray(d?.vaultProfiles)?d.vaultProfiles:[],p=(d,P,E)=>h(u=>{let z=Re(u).map(q=>({...q||{}})),M={...z[d]||{}};return P==="match"?String(E).trim()?M.match={...M.match||{},workspace:E}:delete M.match:M[P]=E,z[d]=M,{...u??{},vaultProfiles:z}}),r=()=>h(d=>({...d??{},vaultProfiles:[...Re(d),{name:"",path:""}]})),$=d=>h(P=>({...P??{},vaultProfiles:Re(P).filter((E,u)=>u!==d)})),se={fontSize:11,padding:"2px 8px",background:"var(--dsw-alias-bg-layer-2, #f3f4f6)",borderRadius:6},ce={padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"transparent",color:"inherit",font:"inherit",fontSize:12,minWidth:0},ge={A:{label:t("planA"),autoWebMode:"init",watchdogAutoSpawn:!1,distillEnabled:!0,dedupByLLM:!0,captureMaxTokens:4e3,recallMinScore:2,recallLimit:5,recallSummaryLen:130,recallIncludeBody:!1,captureCooldownMs:3e5},B:{label:t("planB"),autoWebMode:"init",watchdogAutoSpawn:!1,distillEnabled:!1,dedupByLLM:!1,captureMaxTokens:500,recallMinScore:3,recallLimit:3,recallSummaryLen:80,recallIncludeBody:!1,captureMinChars:300,maxCardsPerDay:40,captureCooldownMs:3e5},C:{label:t("planC"),autoWebMode:"interval",watchdogAutoSpawn:!0,distillEnabled:!0,dedupByLLM:!0,captureMaxTokens:1200,recallMinScore:1,recallLimit:8,recallSummaryLen:200,recallIncludeBody:!0,captureCooldownMs:12e4}},a=async d=>{let P=ge[d];P&&h(E=>({...E??{},...P}))},tt=async(d,P)=>{U(d+P);try{let u=await(await fetch(`${O}/mcp/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:d,action:P})})).json();u&&u.ok?J(x(P==="install"?"mcpInstalled":"mcpUninstalled",{agent:d})):J(x("mcpActionFail",{agent:d,error:u?.error||""}),!1);try{let z=await fetch(`${O}/setup-status`).then(M=>M.json());z&&z.ok&&Ae(z)}catch{}}catch{J(t("mergeFail"),!1)}finally{U("")}},we=({k:d,label:P,type:E="text",step:u,min:z,max:M})=>(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12,minWidth:0},children:[(0,e.jsx)("span",{style:{opacity:.6,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.5},children:P||d}),(0,e.jsx)("input",{type:E,step:u,min:z,max:M,value:S?S[d]??"":"",onChange:q=>{let _=q.target.value;G(d,E==="number"?_===""?"":Number(_):_)},style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12}})]}),nt=new Set(["autoRestartOnDrift"]),Le=({k:d,label:P})=>{let E=S?S[d]:void 0,u=E===void 0?nt.has(d):!!E;return(0,e.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:6,fontSize:12,minWidth:0,lineHeight:1.5},children:[(0,e.jsx)("input",{type:"checkbox",checked:u,onChange:z=>G(d,z.target.checked),style:{marginTop:2,flex:"0 0 auto"}}),(0,e.jsx)("span",{style:{whiteSpace:"normal",overflowWrap:"anywhere"},children:P||d})]})};return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:f?"0 0 auto":1,minHeight:0,maxHeight:f?"52vh":void 0},children:[(0,e.jsx)("style",{children:Oe}),y&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(y.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:y.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:y.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{style:{wordBreak:"break-all"},children:y.msg})]}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[X&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #ef4444",background:"rgba(239,68,68,0.08)",padding:"12px 14px",marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:13,color:"#b91c1c",fontWeight:600,marginBottom:6},children:["\u26A0 ",X]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:R,children:["\u21BB ",t("retry")]})]}),T&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #3b82f6",background:"rgba(59,130,246,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#1d4ed8",lineHeight:1.7},children:["\u2139 ",t("pendingSyncNote")]}),g&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #f59e0b",background:"rgba(245,158,11,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#b45309"},children:["\u2139\uFE0F ",t("configNeedsDsh")," \u2014\u2014 ",t("editInSetting")]}),ie&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #10b981",background:"rgba(16,185,129,0.08)",padding:"10px 14px",marginBottom:10,fontSize:12,color:"#059669"},children:["\u2713 ",ie]}),c&&(c.version||c.dsh?.vaultDir)&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"10px 14px"},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F4E6} ",t("pluginInfo")]}),(0,e.jsx)("span",{style:{fontSize:12,opacity:.7},children:t("dshHostLabel")}),c.version&&(0,e.jsxs)("code",{style:se,children:[t("vcLoaded")," v",c.version]}),C&&C.resident&&C.resident.served&&C.resident.served!==c.version&&(0,e.jsxs)("code",{style:se,children:[t("vcResident")," v",C.resident.served]}),C&&C.resident&&!C.resident.served&&(0,e.jsxs)("code",{style:{...se,color:"#b45309",fontWeight:600},children:[t("vcResident")," ",t("vcResidentDownShort")]}),C&&C.resident&&C.resident.served&&C.resident.managed===!1&&(0,e.jsxs)("code",{style:{...se,color:"#b45309",fontWeight:600},children:[t("vcResident")," v",C.resident.served," \xB7 ",t(Ne?"vcResidentLockUnknownShort":"vcResidentUnmanagedShort")]}),bt&&(0,e.jsxs)("code",{style:se,children:[t("vcPage")," v",bt]}),C&&C.onDisk&&(0,e.jsxs)("code",{style:se,children:[t("vcOnDisk")," v",C.onDisk]}),C&&C.latest&&(0,e.jsxs)("code",{style:se,children:[t("vcLatest")," v",C.latest]}),c.dsh?.vaultDir&&(0,e.jsxs)("span",{style:{fontSize:11,opacity:.6},children:["\u{1F4C1} ",c.dsh.vaultDir]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:Z==="version",onClick:()=>Q(!0),children:Z==="version"?t("checking"):"\u{1F504} "+t("vcCheck")})]}),C&&(C.stale||De||Me||Ne)&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,color:"#b45309",background:"rgba(245,158,11,0.12)",border:"1px solid rgba(245,158,11,0.35)",borderRadius:8,padding:"6px 10px"},children:[(0,e.jsxs)("div",{children:["\u26A0\uFE0F ",C.stale?x("vcStale",{disk:C.onDisk,loaded:C.loaded}):De?x("vcResidentDown",{port:C.resident&&C.resident.port||"",cmd:C.restartCommand||"dsh-memory restart --port 7999"}):Ne?x("vcResidentLockUnknown",{served:ye,path:C.resident&&C.resident.lock&&C.resident.lock.path||"",err:C.resident&&C.resident.lock&&C.resident.lock.error||""}):x("vcResidentUnmanaged",{served:ye,cmd:C.restartCommand||"dsh-memory restart --port 7999"})]}),s?(0,e.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Z,onClick:le,children:Z==="restart"?"\u23F3 "+t("vcRestarting"):"\u{1F504} "+t("vcRestart")}),C.restartCommand&&(0,e.jsx)("code",{style:{fontSize:11,opacity:.75},children:C.restartCommand})]}):(0,e.jsxs)("div",{style:{marginTop:6,lineHeight:1.7},children:["\u2139\uFE0F ",t("vcHostStale"),C.restartCommand&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("code",{style:{fontSize:11,opacity:.75},children:C.restartCommand})]})]})]}),bt&&C&&C.onDisk&&bt!==C.onDisk&&(0,e.jsx)("div",{style:{marginTop:8,fontSize:11.5,color:"#b45309",background:"rgba(245,158,11,0.12)",border:"1px solid rgba(245,158,11,0.35)",borderRadius:8,padding:"6px 10px",lineHeight:1.7},children:t("vcPageStale",{page:bt,disk:C.onDisk})}),C&&C.updateAvailable&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,opacity:.88},children:["\u2B06 ",t("vcOutdated")," \u2192 ",(0,e.jsx)("code",{children:C.updateCommand})]}),C&&C.checkError&&(0,e.jsxs)("div",{style:{marginTop:8,fontSize:11.5,color:"#b91c1c"},children:[t("vcCheckFail"),"\uFF1A",C.checkError]})]}),j&&j.agents&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F50C} ",t("mcpSetupStatus")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("mcpManageHint")})]}),(0,e.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:j.agents.map(d=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[(0,e.jsxs)("span",{style:{flex:1},children:[(0,e.jsx)("b",{children:d.isDsh?t("dshHostLabel"):d.name}),d.isDsh&&d.version&&(0,e.jsxs)("span",{style:{marginLeft:6,fontSize:11,opacity:.5},children:["v",d.version]}),!d.installed&&(0,e.jsxs)("span",{style:{marginLeft:6,opacity:.6},children:["(",t("notInstalled"),")"]}),d.installed&&d.mcpConfigured===!1&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#f59e0b"},children:["(",t("noMcpEntry"),")"]}),d.mcpConfigured===!0&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#10b981"},children:["\u2713 ",t("healthy")]}),d.mcpConfigured===!0&&d.mcpMatchesCurrentNode===!1&&(0,e.jsxs)("span",{style:{marginLeft:6,color:"#9ca3af",fontSize:10},children:["(",t("nodePathNote"),")"]}),d.isDsh&&(0,e.jsxs)("span",{style:{marginLeft:6,opacity:.6,fontSize:11},children:["(",t("recallTool"),": ",d.recallTool?t("enabled"):t("disabled"),")"]})]}),d.hook&&(0,e.jsxs)("span",{style:{fontSize:11,opacity:.7},children:["hook: ",d.hook]}),!d.isDsh&&d.installed&&d.mcpConfigured===!1&&(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Z,onClick:()=>tt(d.name,"install"),children:t("installMcp")}),!d.isDsh&&d.installed&&d.mcpConfigured===!0&&(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},disabled:!!Z,onClick:()=>{window.confirm(t("uninstallConfirm"))&&tt(d.name,"uninstall")},children:t("uninstallMcp")})]},d.name))}),(0,e.jsx)("div",{style:{fontSize:11,opacity:.55,marginTop:6},children:t("mcpSetupHint")}),pe&&(0,e.jsx)("div",{style:{fontSize:11,marginTop:6},children:(0,e.jsx)("code",{style:{padding:"2px 6px",background:"var(--dsw-alias-bg-layer-2, #f3f4f6)",borderRadius:4},children:pe})})]}),S?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #3b82f6"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F3AF} ",t("presetConfig")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("presetHint")})]}),(0,e.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:["A","B","C"].map(d=>(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>a(d),disabled:!!Z,children:[d==="A"?"\u{1F7E2} ":d==="B"?"\u{1F4B0} ":"\u2B50 ",ge[d].label]},d))})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9E0} ",t("dshMemoryConfig")]})}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"autoCapture",label:t("autoCapture")}),(0,e.jsx)(Le,{k:"autoRecall",label:t("autoRecall")}),(0,e.jsx)(we,{k:"captureMinChars",label:t("captureMinChars"),type:"number"}),(0,e.jsx)(we,{k:"maxCardsPerDay",label:t("maxCardsPerDay"),type:"number"}),(0,e.jsx)(we,{k:"dedupThreshold",label:t("dedupThreshold"),type:"number",step:"0.01",min:"0",max:"1"}),(0,e.jsx)(we,{k:"recallLimit",label:t("recallLimit"),type:"number"}),(0,e.jsx)(we,{k:"recallSummaryLen",label:t("recallSummaryLen"),type:"number"}),(0,e.jsx)(Le,{k:"recallIncludeBody",label:t("recallBody")}),(0,e.jsx)(we,{k:"secretHint",label:t("secretHint")}),(0,e.jsx)(we,{k:"recallEmbedding",label:t("recallEmbedding")})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #06b6d4"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F5C2}\uFE0F ",t("vaultMulti")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("vaultMultiHint")})]}),(0,e.jsxs)("div",{style:{fontSize:11.5,opacity:.85,marginBottom:8,lineHeight:1.7},children:[t("vaultNow"),"\uFF1A",(0,e.jsx)("code",{children:te?.vaultDir||"\u2014"}),te?.vaultName?`\uFF08${te.vaultName}\uFF09`:""," \xB7 ",t("vaultSource"),"\uFF1A",t(We[te?.vaultSource]||"vaultSrcDefault"),te?.workspace?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("br",{}),t("vaultWorkspace"),"\uFF1A",(0,e.jsx)("code",{children:te.workspace})]}):null]}),Re(S).map((d,P)=>(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1.6fr 1.5fr auto",gap:6,marginBottom:6},children:[(0,e.jsx)("input",{value:d.name||"",placeholder:t("vaultNamePh"),onChange:E=>p(P,"name",E.target.value),style:ce,disabled:g}),(0,e.jsx)("input",{value:d.path||"",placeholder:t("vaultPathPh"),onChange:E=>p(P,"path",E.target.value),style:ce,disabled:g}),(0,e.jsx)("input",{value:d.match&&d.match.workspace||"",placeholder:t("vaultMatchPh"),onChange:E=>p(P,"match",E.target.value),style:ce,disabled:g}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>$(P),disabled:g,title:t("delete"),children:"\u2715"})]},P)),(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginTop:4},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:r,disabled:g,children:["\uFF0B ",t("vaultAdd")]}),(0,e.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12},children:[(0,e.jsx)("span",{style:{opacity:.6},children:t("vaultActive")}),(0,e.jsxs)("select",{value:S.activeVault||"",onChange:d=>G("activeVault",d.target.value),disabled:g,style:ce,children:[(0,e.jsx)("option",{value:"",children:t("vaultActiveNone")}),Re(S).filter(d=>d&&d.name).map(d=>(0,e.jsx)("option",{value:d.name,children:d.name},d.name))]})]})]})]}),(0,e.jsx)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"enabled",label:t("enabledLabel")}),(0,e.jsx)(we,{k:"vaultDir",label:t("vaultDirLabel")})]})}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #f59e0b"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F4B0} ",t("costControl")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("costHint")})]}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8,marginTop:6},children:[(0,e.jsx)(Le,{k:"distillEnabled",label:t("distillEnabled")}),(0,e.jsx)(Le,{k:"dedupByLLM",label:t("dedupByLLM")}),(0,e.jsx)(we,{k:"captureMaxTokens",label:t("captureMaxTokens"),type:"number"}),(0,e.jsx)(we,{k:"recallMinScore",label:t("recallMinScore"),type:"number"}),(0,e.jsx)(we,{k:"captureCooldownMs",label:t("captureCooldownMs"),type:"number"}),(0,e.jsx)(we,{k:"captureProvider",label:t("captureProvider")}),(0,e.jsx)(we,{k:"captureModel",label:t("captureModel")}),(0,e.jsx)(we,{k:"sessionBudgetChars",label:t("sessionBudgetChars"),type:"number"})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px",borderLeft:"3px solid #8b5cf6"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E1}\uFE0F ",t("auditConfig")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("auditHint")})]}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:8},children:[(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12,minWidth:0},children:[(0,e.jsx)("span",{style:{opacity:.6,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.5},children:t("auditMode")}),(0,e.jsxs)("select",{value:S.auditMode??"all",onChange:d=>G("auditMode",d.target.value),style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12},children:[(0,e.jsx)("option",{value:"all",children:t("auditAll")}),(0,e.jsx)("option",{value:"none",children:t("auditNone")})]})]}),(0,e.jsx)(Gt,{label:t("auditExemptAgents"),value:S.auditExemptAgents||[],options:[{value:"__all__",label:t("allExempt")},...(j?.agents||[]).filter(d=>!d.isDsh).map(d=>({value:d.name,label:d.name}))],onChange:d=>G("auditExemptAgents",d)}),(0,e.jsx)(Gt,{label:t("auditExemptKinds"),value:S.auditExemptKinds||[],options:[{value:"__all__",label:t("allExempt")},...Lt.filter(d=>d!=="all").map(d=>({value:d,label:t(qe[d])}))],onChange:d=>G("auditExemptKinds",d)}),(0,e.jsx)(we,{k:"recycleRetentionDays",label:t("recycleDays"),type:"number"})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"12px 14px"},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E0} ",t("serviceConfig")]})}),(0,e.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:8},children:[(0,e.jsx)(Le,{k:"autoWeb",label:t("autoWeb")}),(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[(0,e.jsx)("span",{style:{opacity:.6},children:t("autoWebMode")}),(0,e.jsxs)("select",{value:S.autoWebMode??"init",onChange:d=>G("autoWebMode",d.target.value),style:{padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12},children:[(0,e.jsx)("option",{value:"init",children:t("modeInit")}),(0,e.jsx)("option",{value:"interval",children:t("modeInterval")}),(0,e.jsx)("option",{value:"manual",children:t("modeManual")})]})]}),(0,e.jsx)(we,{k:"webPort",label:t("webPort"),type:"number"}),(0,e.jsx)(we,{k:"webCheckIntervalMs",label:t("webCheckIntervalMs"),type:"number"}),(0,e.jsx)(we,{k:"webMaxRestart",label:t("webMaxRestart"),type:"number"}),(0,e.jsx)(Le,{k:"watchdogAutoSpawn",label:t("watchdogAutoSpawn")}),(0,e.jsx)(Le,{k:"autoRestartOnDrift",label:t("autoRestartOnDrift")}),(0,e.jsx)(Le,{k:"autoMcpSetup",label:t("autoMcpSetup")})]})]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",alignItems:"center",marginBottom:10,flexWrap:"wrap"},children:[Z==="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,opacity:.75},children:["\u23F3 ",t("saving")]}),ie&&Z!=="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,color:"#10b981"},children:["\u2705 ",ie]}),X&&Z!=="save"&&(0,e.jsxs)("span",{style:{fontSize:11.5,color:"#b91c1c"},children:["\u26A0 ",X]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:ee,disabled:!!Z,children:t("reset")}),(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",onClick:g?()=>J(t("readonlyTitle")+"\uFF1A"+t("readonlyBody"),!1):de,disabled:Z==="save",title:t(g?"readonlyBody":"saveConfig"),children:Z==="save"?"\u23F3 "+t("saving"):g?"\u{1F512} "+t("readonlyBtn"):"\u{1F4BE} "+t("saveConfig")})]})]}):(0,e.jsx)("div",{style:{fontSize:12,opacity:.6},children:t("loading")})]})]})}function za({t,onReload:o,version:l}){let[f,c]=(0,n.useState)([]),[i,w]=(0,n.useState)([]),[D,k]=(0,n.useState)("all"),[H,S]=(0,n.useState)("all"),[h,g]=(0,n.useState)(""),[I,T]=(0,n.useState)(new Set),[v,B]=(0,n.useState)(""),[A,K]=(0,n.useState)(null),[te,Y]=(0,n.useState)("pending"),j=(y,W=!0)=>{K({msg:y,ok:W}),setTimeout(()=>K(null),3e3)},Ae=[...new Set([...f,...i].map(y=>y.submittedBy).filter(Boolean))],X=(0,n.useCallback)(async()=>{try{let y=await fetch(`${O}/audit/list`).then(W=>W.json());y.ok&&(c(y.pending||[]),w(y.rejected||[]),T(new Set),ve(new Set),ke({}))}catch{}},[]);(0,n.useEffect)(()=>{X()},[l,X]);let be=(te==="pending"?f:i).filter(y=>{if(D!=="all"&&y.kind!==D||H!=="all"&&ut(y.submittedBy)!==H)return!1;if(h){let W=(y.created||"").slice(0,10);if(W&&W!==h)return!1}return!0}),Z=y=>T(W=>{let re=new Set(W);return re.has(y)?re.delete(y):re.add(y),re}),U=async(y,W)=>{let re=W||[...I];if(!re.length){j(t("noSelection"),!1);return}B("apply");let J=t(y==="approved"?"toastApproved":y==="rejected"?"toastRejected":"toastCardDeleted");try{let le=0;for(let ye of re){let Be=y==="approved"?"audit/approve":y==="rejected"?"audit/reject":"delete";try{(await fetch(O+"/"+Be+"?path="+encodeURIComponent(ye)+(y==="delete"?"&permanent=0":""))).ok||le++}catch{le++}}await X(),o&&o(),le?j(t("toastFailed")+"\uFF08"+le+"/"+re.length+"\uFF09",!1):j(J+" "+re.length+" \u5F20")}catch(le){j(t("toastFailed")+": "+String(le&&le.message||le),!1)}finally{B("")}},[ie,ve]=(0,n.useState)(new Set),[C,ke]=(0,n.useState)({}),Q=y=>C[y]||{},pe=async y=>{let W=y.path,re=!ie.has(W);if(ve(J=>{let le=new Set(J);return re?le.add(W):le.delete(W),le}),!(!re||C[W])){ke(J=>({...J,[W]:{loading:!0}}));try{let J=y.status||(te==="pending"?"pending":"rejected"),le=await fetch(`${O}/card?path=${encodeURIComponent(W)}&status=${J}`).then(ye=>ye.json());le&&le.ok?ke(ye=>({...ye,[W]:{text:le.text||""}})):ke(ye=>({...ye,[W]:{error:le&&le.error||"HTTP"}}))}catch(J){ke(le=>({...le,[W]:{error:String(J&&J.message||J)}}))}}},Pe=[...I];return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[(0,e.jsx)(ta,{toast:A}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F6E1}\uFE0F ",t("tabAudit")]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("select",{value:D,onChange:y=>k(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("all")}),Lt.filter(y=>y!=="all").map(y=>(0,e.jsx)("option",{value:y,children:t(qe[y])},y))]}),(0,e.jsxs)("select",{value:H,onChange:y=>S(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"},children:[(0,e.jsx)("option",{value:"all",children:t("allAgents")}),Qt(Ae).map(y=>(0,e.jsx)("option",{value:y,children:y},y))]}),(0,e.jsx)("input",{type:"date",value:h,onChange:y=>g(y.target.value),style:{fontSize:12,padding:"4px 8px",borderRadius:8,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",border:"1px solid var(--dsw-alias-border-l2, #d1d5db)"}})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("button",{type:"button",className:`mc-btn${te==="pending"?" me-on":""}`,onClick:()=>Y("pending"),children:[t("pending"),"\uFF08",f.length,"\uFF09"]}),(0,e.jsxs)("button",{type:"button",className:`mc-btn${te==="rejected"?" me-on":""}`,onClick:()=>Y("rejected"),children:[t("rejected"),"\uFF08",i.length,"\uFF09"]}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("label",{style:{fontSize:12},children:[(0,e.jsx)("input",{type:"checkbox",checked:be.length>0&&Pe.length===be.length,onChange:y=>{y.target.checked?T(new Set(be.map(W=>W.path))):T(new Set)}})," ",t("selectAll")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",disabled:!Pe.length||!!v,onClick:()=>U("approved"),children:["\u2713 ",t(te==="rejected"?"restore":"approve")]}),te==="pending"?(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!Pe.length||!!v,onClick:()=>U("rejected"),children:["\u2715 ",t("reject")]}):(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!Pe.length||!!v,onClick:()=>{window.confirm(t("recycleDeleteConfirm"))&&U("delete")},children:["\u{1F5D1} ",t("restoreDelete")]})]}),be.length?(0,e.jsx)("div",{className:"mc-card",style:{display:"flex",flexDirection:"column"},children:be.map(y=>{let W=Q(y.path),re=ie.has(y.path);return(0,e.jsxs)("div",{style:{borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px",fontSize:12},children:[(0,e.jsx)("input",{type:"checkbox",checked:I.has(y.path),onChange:()=>Z(y.path)}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"0 6px"},title:t(re?"collapse":"expand"),"aria-expanded":re,onClick:()=>pe(y),children:re?"\u25BE":"\u25B8"}),(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[y.kind]||"#999"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},title:t(re?"collapse":"expand"),onClick:()=>pe(y),children:y.title}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:ut(y.submittedBy)}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:y.created?y.created.slice(0,16).replace("T"," "):"-"}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6},children:y.kind}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6,color:y.severity==="high"?"#f87171":"#9ca3af"},children:y.severity}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.6,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.reason||"-"}),te==="pending"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>U("approved",[y.path]),children:"\u2713"}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},onClick:()=>U("rejected",[y.path]),children:"\u2715"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},title:t("restore"),onClick:()=>U("approved",[y.path]),children:"\u2713"}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},title:t("restoreDelete"),onClick:()=>{window.confirm(t("recycleDeleteConfirm"))&&U("delete",[y.path])},children:"\u{1F5D1}"})]})]}),re&&(0,e.jsxs)("div",{style:{padding:"2px 10px 12px 34px"},children:[W.loading&&(0,e.jsxs)("div",{style:{fontSize:12,opacity:.6},children:["\u23F3 ",t("loading")]}),W.error&&(0,e.jsxs)("div",{style:{fontSize:12,color:"#f87171"},children:["\u26A0 ",t("auditBodyFail"),"\uFF1A",W.error]}),W.text!=null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"md-meta",style:{marginBottom:6},children:[(0,e.jsxs)("span",{className:"md-chip md-chip-kind",style:{color:Ve[y.kind]||"#6B7280",borderColor:(Ve[y.kind]||"#6B7280")+"59",background:(Ve[y.kind]||"#6B7280")+"1a"},children:[ht[y.kind]||"\u{1F4CE}"," ",t(qe[y.kind]||"kindKnowledge")]}),(Array.isArray(y.tags)?y.tags:[]).slice(0,8).map(J=>(0,e.jsxs)("span",{className:"md-chip md-chip-tag",children:["\u{1F3F7} ",J]},J)),!!y.reason&&(0,e.jsxs)("span",{className:"md-chip md-chip-st-warn",children:["\u2691 ",y.reason]})]}),(0,e.jsx)("div",{className:"md-doc",style:{maxHeight:340,overflow:"auto"},dangerouslySetInnerHTML:{__html:Dt(Ct(W.text).body)}}),te==="pending"&&(0,e.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn me-on",disabled:!!v,onClick:()=>U("approved",[y.path]),children:["\u2713 ",t("approve")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!!v,onClick:()=>U("rejected",[y.path]),children:["\u2715 ",t("reject")]})]})]})]})]},y.path)})}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:20,textAlign:"center"},children:t("noAuditItems")})]})]})}function Ia({t,onReload:o,version:l}){let[f,c]=(0,n.useState)([]),[i,w]=(0,n.useState)(""),[D,k]=(0,n.useState)(null),H=(g,I=!0)=>{k({msg:g,ok:I}),setTimeout(()=>k(null),3200)},S=(0,n.useCallback)(async()=>{try{let g=await fetch(`${O}/recycle/list`).then(I=>I.json());g.ok&&c(g.items||[])}catch{}},[]);(0,n.useEffect)(()=>{S()},[l,S]);let h=async(g,I)=>{let T=(f.find(v=>v.path===I)||{}).title||I;w(g+I);try{let B=await fetch(O+(g==="restore"?"/recycle/restore":"/recycle/purge")+"?path="+encodeURIComponent(I)),A=await B.json().catch(()=>null);await S(),o&&o(),B.ok&&(!A||A.ok!==!1)?H(t(g==="restore"?"toastRestored":"toastPurged")+"\uFF1A"+T):H(t("toastFailed")+"\uFF1A"+(A&&A.error||"HTTP "+B.status),!1)}catch(v){H(t("toastFailed")+"\uFF1A"+String(v&&v.message||v),!1)}finally{w("")}};return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto",padding:4},children:[(0,e.jsx)(ta,{toast:D}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F5D1}\uFE0F ",t("tabRecycle")]}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("recycleHint")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!i||f.length===0,title:f.length?"":t("emptyRecycle"),onClick:async()=>{w("purgeAll");try{let g=await fetch(O+"/recycle/purge-expired?days=0"),I=await g.json().catch(()=>null);await S(),H(g.ok?t("toastPurgedExpired")+(I&&I.purged!=null?"\uFF08"+I.purged+"\uFF09":""):t("toastFailed"),g.ok)}catch(g){H(t("toastFailed")+"\uFF1A"+String(g&&g.message||g),!1)}finally{w("")}},children:t("emptyRecycle")})]}),f.length?(0,e.jsx)("div",{className:"mc-card",style:{display:"flex",flexDirection:"column"},children:f.map(g=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[g.kind]||"#999"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.title}),(0,e.jsxs)("span",{style:{fontSize:10,opacity:.6},children:[t("deletedAt")," ",(g.deletedAt||"").slice(0,10)]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!i,onClick:()=>h("restore",g.path),children:t("restore")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px",color:"#f87171"},disabled:!!i,onClick:()=>{window.confirm(t("purgeConfirm"))&&h("purge",g.path)},children:t("purge")})]},g.path))}):(0,e.jsxs)("div",{className:"mc-card",style:{padding:18,fontSize:12.5,opacity:.78,textAlign:"center",lineHeight:1.9},children:["\u{1F5D1}\uFE0F ",t("emptyRecycle"),(0,e.jsx)("br",{}),(0,e.jsx)("span",{style:{fontSize:11.5},children:t("recycleEmptyHint").split("{days}").join("30")})]})]})]})}var La=({card:t,t:o,onOpen:l,query:f,onDelete:c})=>(0,e.jsxs)("article",{className:"mc-cardrow mc-card",onClick:()=>l(t),children:[(0,e.jsxs)("h4",{children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[t.kind]||Ve.other}}),(0,e.jsx)("span",{style:{marginRight:4},children:ht[t.kind]||"\u{1F4CE}"}),f?Xt(t.title,f):t.title,Wa(t.updated)&&(0,e.jsx)("span",{className:"mc-new",children:o("newBadge")}),t.status==="pending"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#f59e0b"},children:["\u23F3 ",o("statusPending")]}),t.status==="rejected"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#ef4444"},children:["\u274C ",o("statusRejected")]}),(!t.status||t.status==="approved")&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#10b981"},children:["\u2705 ",o("statusApproved")]})]}),(0,e.jsx)("p",{children:f?Xt(t.summary||"",f):t.summary||""}),Vt(t).length>0&&(0,e.jsx)("div",{className:"mc-tags",children:Vt(t).slice(0,4).map(i=>(0,e.jsxs)("span",{className:"mc-tag",children:["\u{1F3F7} ",i]},i))}),(0,e.jsxs)("footer",{children:[(0,e.jsxs)("span",{children:[ht[t.kind]||"\u{1F4CE}"," ",o(qe[t.kind])]}),(0,e.jsxs)("span",{style:{fontSize:10,opacity:.6},children:["\u{1F916} ",ut(t.submittedBy)]}),(0,e.jsxs)("span",{children:["\u{1F4C5} ",pt(t.updated)]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-card-del",title:o("delete"),onClick:i=>{i.stopPropagation(),window.confirm(o("deleteConfirm"))&&c&&c(t.path)},children:"\u{1F5D1}"})]})]});function Aa({t,tab:o,onReload:l,version:f}){let[c,i]=(0,n.useState)(null),[w,D]=(0,n.useState)(""),[k,H]=(0,n.useState)(null),[S,h]=(0,n.useState)(null),[g,I]=(0,n.useState)(null),[T,v]=(0,n.useState)(null),B=(0,n.useCallback)(async()=>{j("align");try{let s=await fetch(O+"/align").then(x=>x.json());s&&s.findings?v(s):notify(t("alignFail"),!1)}catch{notify(t("alignFail"),!1)}finally{j("")}},[t]),A=async()=>{if(window.confirm(t("alignFixConfirm"))){j("alignfix");try{let s=await fetch(O+"/setup-run",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}).then(x=>x.json());s&&s.ok?(notify(t("alignFixed")),await B()):notify(t("alignFail"),!1)}catch{notify(t("alignFail"),!1)}finally{j("")}}},[K,te]=(0,n.useState)([]),[Y,j]=(0,n.useState)(""),[Ae,X]=(0,n.useState)(!1),be=(0,n.useCallback)(async()=>{if(!(!k||!k.merge||!k.merge.length)&&window.confirm(t("mergeAllConfirm"))){j("merge");try{let s={},x=de=>s[de]===void 0?de:s[de]=x(s[de]),R=(de,ee)=>{s[x(de)]=x(ee)},G=new Set;for(let de of k.merge)G.add(de.a.path),G.add(de.b.path),R(de.a.path,de.b.path);let Se={};for(let de of G){let ee=x(de);(Se[ee]=Se[ee]||[]).push(de)}let Ce=0;for(let de of Object.values(Se)){if(de.length<2)continue;(await fetch(`${O}/merge?paths=${encodeURIComponent(de.join(","))}`).then(We=>We.json())).ok&&Ce++}await Z(),l&&l()}catch{}j("")}},[k,Z,l,t]);async function Z(){try{let s=await Promise.all([fetch(`${O}/stats`),fetch(`${O}/budget`),fetch(`${O}/capture-log`),fetch(`${O}/cards?status=all&limit=30&agent=${yt}`)]),[x,R,G,Se]=await Promise.all(s.map(Ce=>Ce.json()));x&&x.ok&&i(x),R&&R.ok&&h(R),G&&G.ok&&I(G),Se&&Se.ok&&te(Se.cards||[]),D(!x||!x.ok?t("adminLoadFail"):"")}catch{D(t("adminLoadFail"))}}let U=(0,n.useCallback)(async()=>{j("scan");try{let s=await fetch(`${O}/optimize`).then(x=>x.json());s.ok&&H(s)}catch{D(t("adminLoadFail"))}finally{j("")}},[t]),[ie,ve]=(0,n.useState)(null),C=(0,n.useCallback)(async()=>{j("refine");try{let s=await fetch(`${O}/refine-scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:8})}).then(x=>x.json());s&&s.ok?ve(s):notify(s&&s.error||t("refineFail"),!1)}catch{notify(t("refineFail"),!1)}finally{j("")}},[t]),ke=async(s,x)=>{if(!(x==="merge"&&!window.confirm(t("mergeConfirm")))){j("refineapply");try{let R=await fetch(`${O}/refine-apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:s.a.path,b:s.b.path,action:x,relation:s.relation})}).then(G=>G.json());R&&R.ok?(notify(t("refineApplied")),ve(G=>G&&{...G,findings:(G.findings||[]).filter(Se=>!(Se.a.path===s.a.path&&Se.b.path===s.b.path))}),await Z(),l&&l()):notify(R&&R.error||t("refineFail"),!1)}catch{notify(t("refineFail"),!1)}finally{j("")}}},[Q,pe]=(0,n.useState)(null),Pe=(0,n.useCallback)(async()=>{j("junk");try{let s=await fetch(`${O}/refine-junk`).then(x=>x.json());s&&s.ok?pe(s.items||[]):notify(t("junkFail"),!1)}catch{notify(t("junkFail"),!1)}finally{j("")}},[t]),y=async s=>{if(s.length&&window.confirm(t("junkRecycleAllConfirm"))){j("junkpurge");try{let x=await fetch(`${O}/refine-junk-purge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:s})}).then(R=>R.json());x&&x.removed?(notify(t("junkDone")+"\uFF1A"+x.removed.length+(x.failed?.length?"\uFF08\u5931\u8D25 "+x.failed.length+"\uFF09":"")),pe(R=>R&&R.filter(G=>!x.removed.includes(G.path))),await Z(),l&&l()):notify(t("junkFail"),!1)}catch{notify(t("junkFail"),!1)}finally{j("")}}},[W,re]=(0,n.useState)(null),J=(0,n.useCallback)(async()=>{j("goals");try{let s=await fetch(O+"/refine-goals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:30})}).then(x=>x.json());s&&s.ok?re(s):notify(s&&s.error||t("goalFail"),!1)}catch{notify(t("goalFail"),!1)}finally{j("")}},[t]),le=async s=>{j("goalskeep");try{let x=await fetch(O+"/refine-goals-keep",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:s.members.map(R=>R.path)})}).then(R=>R.json());x&&x.ok?(notify(t("goalDone")),re(R=>R&&{...R,clusters:(R.clusters||[]).filter(G=>G.goal!==s.goal)})):notify(t("goalFail"),!1)}catch{notify(t("goalFail"),!1)}finally{j("")}},ye=async s=>{if(window.confirm(t("mergeConfirm"))){j("goalsmerge");try{let x=await fetch(O+"/merge?paths="+encodeURIComponent(s.members.map(R=>R.path).join(","))).then(R=>R.json());x&&x.ok?(notify(t("goalMerged")),re(R=>R&&{...R,clusters:(R.clusters||[]).filter(G=>G.goal!==s.goal)}),await Z(),l&&l()):notify(t("mergeFail"),!1)}catch{notify(t("mergeFail"),!1)}finally{j("")}}};(0,n.useEffect)(()=>{Z()},[f]);let Be=async(s,x)=>{if(window.confirm(t("mergeConfirm")))try{(await fetch(`${O}/merge?paths=${encodeURIComponent(s+","+x)}`).then(G=>G.json())).ok&&(await Z(),l&&l())}catch{}},Ne=async s=>{if(window.confirm(t("deleteConfirm")))try{(await fetch(`${O}/delete?path=${encodeURIComponent(s)}`).then(R=>R.json())).ok&&(await Z(),l&&l())}catch{}},Me=["project","knowledge","content","prompt","business","tool","mistake"],De=({title:s,kind:x,updated:R,path:G})=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[x]||"#666"}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:pt(R)}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>Ne(G),children:[t("delete")," \u2715"]})]});return(0,e.jsxs)("div",{className:"mc-admin",style:{display:"flex",flexDirection:"column",overflow:"auto",flex:1,minHeight:0},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{style:{overflow:"auto"},children:[w&&(0,e.jsxs)("div",{className:"mc-card",style:{borderLeft:"4px solid #ef4444",background:"rgba(239,68,68,0.08)",padding:"12px 14px",marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:13,color:"#b91c1c",fontWeight:600,marginBottom:6},children:["\u26A0 ",w]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:Z,children:["\u21BB ",t("retry")]})]}),o==="stats"&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F527} ",t("alignTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:B,children:t(Y==="align"?"exporting":"alignRun")}),T&&T.counts&&T.counts.fix>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:A,children:t(Y==="alignfix"?"exporting":"alignFix")}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("alignHint")})]}),T&&T.findings?(0,e.jsxs)("div",{style:{marginTop:6},children:[(0,e.jsxs)("div",{style:{fontSize:12,opacity:.75,marginBottom:4},children:[t("alignDisk")," v",T.onDisk||"?",T.residentServed?" \xB7 "+t("alignResident")+" v"+T.residentServed:"",T.hostVersion?" \xB7 "+t("alignHost")+" v"+T.hostVersion:""]}),(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:T.findings.map((s,x)=>(0,e.jsxs)("li",{style:{padding:"4px 2px",borderTop:x?"1px solid rgba(127,127,127,0.12)":"none",fontSize:12},children:[(0,e.jsx)("span",{style:{fontWeight:700,color:s.level==="fix"?"#ef4444":s.level==="warn"?"#f59e0b":"#10b981"},children:s.level==="fix"?"\u2717":s.level==="warn"?"\u26A0":"\u2713"})," ",(0,e.jsx)("span",{children:s.title}),s.detail?(0,e.jsx)("div",{style:{opacity:.75,marginLeft:14},children:s.detail}):null,s.command?(0,e.jsxs)("div",{style:{marginLeft:14,opacity:.9},children:["\u2192 ",(0,e.jsx)("code",{children:s.command})]}):null]},x))})]}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginTop:4},children:t("alignIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1FAB5} ",t("captureLog")]}),(0,e.jsx)("span",{style:{fontSize:11,opacity:.6},children:t("captureLogHint")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>Z(),children:["\u21BB ",t("refresh")]})]}),g?g.available===!1?(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("captureLogUnavailable")}):(g.entries||[]).length===0?(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("captureLogEmpty")}):(0,e.jsx)("div",{style:{maxHeight:260,overflow:"auto",marginTop:8},children:(0,e.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:(0,e.jsx)("tbody",{children:(g.entries||[]).map((s,x)=>{let R=Sa[s.action]||["\u2022","inherit"];return(0,e.jsxs)("tr",{style:{borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsx)("td",{style:{padding:"4px 6px",opacity:.55,whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:pt(s.time?new Date(s.time).toISOString():"")}),(0,e.jsxs)("td",{style:{padding:"4px 6px",whiteSpace:"nowrap",color:R[1],fontWeight:600},children:[R[0]," ",s.action]}),(0,e.jsx)("td",{style:{padding:"4px 6px"},children:s.reason||""}),(0,e.jsx)("td",{style:{padding:"4px 6px",opacity:.55,maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:s.preview||"",children:s.preview||""})]},x)})})})}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,padding:"8px 0"},children:t("loading")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:["\u{1F916} ",t("captureAgentCards"),"\uFF08",K.length,"\uFF09"]}),K.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:K.map(s=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:Ve[s.kind]||Ve.other}}),(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.title}),s.status==="pending"&&(0,e.jsxs)("span",{className:"mc-status",style:{background:"#f59e0b"},children:["\u23F3 ",t("statusPending")]}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:pt(s.updated)})]},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noCards")})]}),c&&(0,e.jsxs)(e.Fragment,{children:[c.trend&&c.trend.length>0&&(()=>{let s=c.trend,x=Math.max(...s.map(Ce=>Ce.count),1),R=260,G=50,Se=R/s.length;return(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,padding:"10px 14px"},children:[(0,e.jsxs)("div",{style:{fontSize:11,opacity:.6,marginBottom:4},children:["\u{1F4C8} ",t("trendLabel")]}),(0,e.jsx)("svg",{width:R,height:G,style:{display:"block",width:"100%",height:50},children:s.map((Ce,de)=>{let ee=Math.round(Ce.count/x*(G-4));return(0,e.jsx)("rect",{x:de*Se+1,y:G-ee,width:Math.max(Se-2,2),height:ee,rx:1.5,fill:Ce.count>0?"var(--dsw-alias-accent, #3b82f6)":"var(--dsw-alias-border-l1, #e5e7eb)",opacity:Ce.count>0?.85:.35},Ce.date)})})]})})(),(0,e.jsxs)("div",{className:"mc-stats",children:[(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.total}),(0,e.jsx)("span",{children:t("total")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.today}),(0,e.jsx)("span",{children:t("todayAdd")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.week}),(0,e.jsx)("span",{children:t("weekAdd")})]}),(0,e.jsxs)("div",{className:"mc-stat mc-card",children:[(0,e.jsx)("b",{children:c.tags}),(0,e.jsx)("span",{children:t("tags")})]})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsx)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:t("byKind")}),(0,e.jsx)("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:Me.map(s=>(0,e.jsxs)("span",{style:{fontSize:12},children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[s]||"#666"}}),t(qe[s]),": ",c.byKind?.[s]||0]},s))})]}),S&&(S.budgetChars||S.recallLimit||S.embedding)&&(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,fontSize:12},children:[(0,e.jsx)("b",{children:t("budgetLabel")}),"\uFF1A",t("budgetChars")," ",(0,e.jsx)("b",{children:S.budgetChars||8e4})," \xB7 ",t("recallLimitLabel")," ",(0,e.jsx)("b",{children:S.recallLimit||5})," \xB7 ",t("embeddingLabel")," ",S.embedding?"ON":"OFF"]}),(0,e.jsxs)("div",{className:"mc-card",children:[(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:[t("todayList"),"\uFF08",c.todayCards?.length||0,"\uFF09"]}),c.todayCards?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:c.todayCards.map(s=>(0,e.jsx)(De,{title:s.title,kind:s.kind,updated:s.updated,path:s.path},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noOptimize")})]})]})]}),o==="optimize"&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("organizeTitle")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:U,children:Y==="scan"?t("exporting"):"\u{1F50D} "+t("scanAndOrganize")}),k&&k.merge?.length>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:async()=>{if(window.confirm(t("oneClickOptimizeConfirm"))){j("oneclick");try{let s=JSON.stringify({cleanupStale:Ae}),R=await(await fetch(`${O}/optimize-execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:s})).json();R&&R.ok?(notify(`${t("oneClickOptimizeDone")}\uFF1A${R.plan.merged} ${t("optimizedMerged")}${Ae?` \xB7 ${R.plan.staleDeleted} ${t("optimizedStaleDeleted")}`:""}`),await Z(),l&&l(),H(null)):notify(t("mergeFail"),!1)}catch{notify(t("mergeFail"),!1)}finally{j("")}}},children:Y==="oneclick"?t("exporting"):"\u26A1 "+t("oneClickOptimize")}),k&&k.merge?.length>0&&(0,e.jsxs)("label",{style:{fontSize:11,opacity:.7,display:"flex",alignItems:"center",gap:4},children:[(0,e.jsx)("input",{type:"checkbox",checked:Ae,onChange:s=>X(s.target.checked)}),t("oneClickAlsoStale")]})]}),!k&&(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginBottom:10},children:t("scanHint")}),k&&(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10,display:"flex",flexDirection:"column",gap:8},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("mergePairs")}),(0,e.jsx)("div",{className:"spacer",style:{flex:1}}),k.merge?.length>0&&(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:!!Y,onClick:be,children:t(Y==="merge"?"exporting":"batchMerge")})]}),(0,e.jsx)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:t("mergePairs")}),k.merge?.length?(0,e.jsx)("ul",{style:{margin:"0 0 12px",padding:0,listStyle:"none"},children:k.merge.map((s,x)=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 4px",borderBottom:"1px solid rgba(127,127,127,0.12)",fontSize:12},children:[(0,e.jsxs)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[s.a.title," \u21C4 ",s.b.title]}),(0,e.jsxs)("span",{style:{opacity:.6},children:[Math.round(s.sim*100),"%"]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},onClick:()=>Be(s.a.path,s.b.path),children:t("mergeNow")})]},x))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12,marginBottom:12},children:t("noOptimize")}),(0,e.jsxs)("div",{style:{fontSize:12,fontWeight:700,marginBottom:6},children:[t("staleCards"),"\uFF08",k.stale?.length||0,"\uFF09"]}),k.stale?.length>0&&(0,e.jsx)("div",{style:{marginBottom:6},children:(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},disabled:!!Y,onClick:async()=>{if(!window.confirm(t("deleteConfirm")))return;j("clean");let s=0;for(let x of k.stale)try{await fetch(`${O}/delete?path=${encodeURIComponent(x.path)}`),s++}catch{}j(""),notify(`${s} ${t("deletedStale")}`),await Z(),l&&l()},children:t("cleanStale")})}),k.stale?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:k.stale.map(s=>(0,e.jsx)(De,{title:s.title,kind:"other",updated:s.updated,path:s.path},s.path))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t("noOptimize")})]})}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9ED} ",t("refineTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:C,children:t(Y==="refine"?"exporting":"refineScan")}),(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("refineHint")})]}),ie?.findings?.length?ie.findings.map((s,x)=>(0,e.jsxs)("div",{style:{borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",padding:"7px 2px"},children:[(0,e.jsxs)("div",{style:{fontSize:12,marginBottom:3},children:[(0,e.jsx)("span",{style:{fontWeight:700,color:s.relation==="conflict"?"#ef4444":s.relation==="duplicate"?"#f59e0b":"#10b981"},children:t("refineRel_"+s.relation)}),(0,e.jsxs)("span",{style:{opacity:.55},children:[" \xB7 sim ",s.sim," \xB7 ",s.useModel||""]}),s.conflict?(0,e.jsx)("span",{style:{marginLeft:6},children:s.conflict}):null]}),(0,e.jsxs)("div",{style:{fontSize:12,opacity:.85,marginBottom:5},children:["A\uFF1A",s.a.title,(0,e.jsx)("br",{}),"B\uFF1A",s.b.title]}),(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepA"),children:t("refineKeepA")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepB"),children:t("refineKeepB")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"keepBoth"),children:t("refineKeepBoth")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ke(s,"merge"),children:t("refineMerge")})]})]},x)):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(ie?"refineNone":"refineIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F9F9} ",t("junkTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:Pe,children:t(Y==="junk"?"exporting":"junkScan")}),Q?.length?(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:()=>y(Q.map(s=>s.path)),children:t(Y==="junkpurge"?"exporting":"junkRecycleAll")}):null,(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("junkHint")})]}),Q?.length?(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:Q.map((s,x)=>(0,e.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 2px",borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",fontSize:12},children:[(0,e.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:s.reasons.join("\uFF1B"),children:s.title||s.path}),(0,e.jsx)("span",{style:{opacity:.55,fontSize:11},children:s.reasons[0]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>y([s.path]),children:t("junkRecycle")})]},x))}):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(Q?"junkNone":"junkIdle")})]}),(0,e.jsxs)("div",{className:"mc-card",style:{marginBottom:10},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap",marginBottom:6},children:[(0,e.jsxs)("b",{style:{fontSize:12},children:["\u{1F3AF} ",t("goalTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",disabled:!!Y,onClick:J,children:t(Y==="goals"?"exporting":"goalScan")}),W?(0,e.jsxs)("span",{style:{opacity:.6,fontSize:11},children:[t("goalStats"),"\uFF1A",W.cached," / ",W.calls]}):null,(0,e.jsx)("span",{style:{opacity:.6,fontSize:11},children:t("goalHint")})]}),W?.clusters?.length?W.clusters.map((s,x)=>(0,e.jsxs)("div",{style:{borderTop:x?"1px solid rgba(127,127,127,0.14)":"none",padding:"7px 2px"},children:[(0,e.jsxs)("div",{style:{fontSize:12,marginBottom:4},children:[(0,e.jsx)("b",{children:s.goal})," ",(0,e.jsxs)("span",{style:{opacity:.55},children:["\xB7 ",s.members.length," ",t("goalCards")]})]}),(0,e.jsx)("ul",{style:{margin:"0 0 5px",padding:"0 0 0 16px",fontSize:12,opacity:.85},children:s.members.map((R,G)=>(0,e.jsx)("li",{children:R.title},G))}),(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>le(s),children:t("goalKeep")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{padding:"2px 8px"},disabled:!!Y,onClick:()=>ye(s),children:t("goalMerge")})]})]},x)):(0,e.jsx)("div",{style:{opacity:.6,fontSize:12},children:t(W?"goalNone":"goalIdle")})]})]})]})]})}var It=[{key:"decision",label:"tplDecision",kind:"knowledge",tagKey:"tplDecisionTags",bodyKey:"tplDecisionBody"},{key:"bug",label:"tplBug",kind:"mistake",tagKey:"tplBugTags",bodyKey:"tplBugBody"},{key:"meeting",label:"tplMeeting",kind:"content",tagKey:"tplMeetingTags",bodyKey:"tplMeetingBody"},{key:"weekly",label:"tplWeekly",kind:"content",tagKey:"tplWeeklyTags",bodyKey:"tplWeeklyBody"}];function Ba({t,newCard:o,setNewCard:l,onCreated:f}){if(!o)return null;let c=It.find(h=>h.key===o.template),i=o.body||(c?t(c.bodyKey):""),w=o.kind||(c?c.kind:"knowledge"),D=o.tags||(c?t(c.tagKey):""),k=o._creating,H=h=>{let g=It.find(I=>I.key===h);l(I=>({...I,template:h,kind:g?g.kind:I.kind,body:g?t(g.bodyKey):I.body,tags:g?t(g.tagKey):I.tags}))},S=async()=>{if(!(!o.title&&!i)){l(h=>({...h,_creating:!0}));try{(await fetch(`${O}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:o.title||t("untitled"),kind:w,tags:D.split(",").map(g=>g.trim()).filter(Boolean),body:i,source:"manual"})}).then(g=>g.json())).ok?(l(null),f&&f()):l(g=>({...g,_creating:!1}))}catch{l(g=>({...g,_creating:!1}))}}};return(0,e.jsxs)("div",{className:"me-overlay",onClick:()=>l(null),children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:600,width:"92vw",maxHeight:"85vh"},onClick:h=>h.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsx)("h3",{children:t("newCard")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>l(null),children:t("close")})]}),(0,e.jsxs)("div",{className:"me-dialog-body",style:{display:"flex",flexDirection:"column",gap:10,overflow:"auto"},children:[(0,e.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[It.map(h=>(0,e.jsx)("button",{type:"button",className:`mc-btn${o.template===h.key?" me-on":""}`,onClick:()=>H(h.key),children:t(h.label)},h.key)),(0,e.jsx)("button",{type:"button",className:`mc-btn${o.template===""?" me-on":""}`,onClick:()=>l(h=>({...h,template:"",body:"",tags:"",kind:"knowledge"})),children:t("tplBlank")})]}),(0,e.jsx)("select",{className:"mc-btn",value:w,onChange:h=>l(g=>({...g,kind:h.target.value})),style:{maxWidth:180,background:"var(--dsw-alias-bg-layer-1, #fff)",color:"var(--dsw-alias-label-primary, #111)"},children:["project","knowledge","content","prompt","business","tool","mistake"].map(h=>(0,e.jsx)("option",{value:h,style:{background:"var(--dsw-alias-bg-layer-1, #fff)",color:"var(--dsw-alias-label-primary, #111)"},children:h},h))}),(0,e.jsx)("input",{type:"text",className:"mc-btn",placeholder:t("cardTitle"),value:o.title||"",onChange:h=>l(g=>({...g,title:h.target.value}))}),(0,e.jsx)("input",{type:"text",className:"mc-btn",placeholder:t("tagsHint"),value:D,onChange:h=>l(g=>({...g,tags:h.target.value}))}),(0,e.jsx)("textarea",{className:"mc-btn",placeholder:t("cardBody"),value:i,onChange:h=>l(g=>({...g,body:h.target.value})),style:{minHeight:180,resize:"vertical",fontFamily:"inherit"}}),(0,e.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:(0,e.jsx)("button",{type:"button",className:"mc-btn me-on",disabled:k,onClick:S,children:t(k?"exporting":"createCard")})})]})]})]})}async function Yt(t){let o=String(t||"");if(!o)return!1;try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(o),!0}catch{}try{let l=document.createElement("textarea");l.value=o,l.setAttribute("readonly",""),l.style.position="fixed",l.style.left="-9999px",l.style.top="0",document.body.appendChild(l),l.focus(),l.select();let f=!!(document.execCommand&&document.execCommand("copy"));return document.body.removeChild(l),f}catch{return!1}}function ja({t,onClose:o}){let[l,f]=(0,n.useState)(""),[c,i]=(0,n.useState)(""),[w,D]=(0,n.useState)(""),[k,H]=(0,n.useState)(!0),[S,h]=(0,n.useState)(!1),[g,I]=(0,n.useState)(""),[T,v]=(0,n.useState)(""),B=(0,n.useRef)(null),A=(0,n.useRef)(null),K=()=>{let U=B.current;if(U)try{U.focus(),U.select()}catch{}},te=U=>{I(U),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>I(""),2400)};(0,n.useEffect)(()=>{let U=!0;return fetch(O+"/diagnostics").then(ie=>ie.json()).then(ie=>{U&&(ie&&ie.ok?(i(String(ie.diagnostics||"")),D(String(ie.version||""))):h(!0))}).catch(()=>{U&&h(!0)}).finally(()=>{U&&H(!1)}),()=>{U=!1}},[]),(0,n.useEffect)(()=>{let U=ie=>{ie.key==="Escape"&&o()};return window.addEventListener("keydown",U),()=>{window.removeEventListener("keydown",U),A.current&&clearTimeout(A.current)}},[o]);let Y=(()=>{try{return String(navigator.language||"").toLowerCase().startsWith("en")?"en":"zh"}catch{return"zh"}})(),j=()=>{let U=l.trim().split(`
|
|
306
|
+
`)[0]||"",ie=Ot({title:"[Bug] "+(U.slice(0,60)||"memory-eternal \u95EE\u9898"),body:Wt({description:l,diagnostics:c,version:w})});try{window.open(ie,"_blank","noopener")}catch{te(t("fbCopyFail"))}},Ae=async()=>{await Yt(c)?(v(""),te(t("fbCopiedDiag"))):(v(c),te(t("fbCopyManual")))},X=async()=>{let U=$t({lang:Y,description:l,diagnostics:c});await Yt(U)?(v(""),te(t("fbCopiedPrompt"))):(v(U),te(t("fbCopyManual")))},be={width:"100%",resize:"vertical",padding:"8px 10px",borderRadius:10,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"transparent",color:"inherit",font:"inherit",fontSize:13},Z={margin:0,maxHeight:170,overflow:"auto",fontSize:11.5,lineHeight:1.55,padding:"8px 10px",borderRadius:10,background:"var(--dsw-alias-bg-layer-1, rgba(127,127,127,0.08))",whiteSpace:"pre-wrap"};return(0,e.jsxs)("div",{className:"me-overlay",onClick:o,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:720},onClick:U=>U.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsxs)("h3",{children:["\u{1F41E} ",t("fbTitle")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:o,children:t("close")})]}),(0,e.jsxs)("div",{className:"me-dialog-body",style:{display:"flex",flexDirection:"column",gap:10},children:[(0,e.jsx)("div",{style:{fontSize:12,opacity:.72,lineHeight:1.6},children:t("fbWhy")}),(0,e.jsx)("textarea",{value:l,onChange:U=>f(U.target.value),placeholder:t("fbDesc"),rows:5,style:be}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,e.jsx)("b",{style:{fontSize:12},children:t("fbDiag")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:Ae,disabled:!c,children:t("fbCopyDiag")})]}),(0,e.jsx)("pre",{style:Z,children:k?t("fbLoading"):S?t("fbDiagFail"):c})]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>{if(!l.trim()){te(t("fbNeedDesc"));return}j()},style:{borderColor:"var(--dsw-alias-brand-primary, #3b82f6)",color:"var(--dsw-alias-brand-primary, #3b82f6)",fontWeight:600},children:["\u{1F680} ",t("fbOpenIssue")]}),(0,e.jsx)("span",{style:{opacity:.5,fontSize:12},children:t("fbOr")}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:X,children:["\u{1F916} ",t("fbCopyPrompt")]})]}),g&&(0,e.jsx)("div",{style:{fontSize:12,color:"var(--dsw-alias-brand-primary, #3b82f6)"},children:g}),T&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,e.jsxs)("b",{style:{fontSize:12,color:"#b45309"},children:["\u26A0 ",t("fbCopyFail")]}),(0,e.jsx)("span",{style:{fontSize:11.5,opacity:.75},children:t("fbCopyManual")}),(0,e.jsx)("div",{style:{flex:1}}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:K,children:t("fbSelectAll")})]}),(0,e.jsx)("textarea",{ref:B,readOnly:!0,value:T,rows:7,style:be})]})]})]})]})}function Pa({t,card:o,query:l,onClose:f,onDelete:c,onFeedback:i}){(0,n.useEffect)(()=>{let B=A=>{A.key==="Escape"&&f()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[f]);let{meta:w,body:D}=(0,n.useMemo)(()=>Ct(o.text||""),[o.text]),k=B=>{let A=w.find(([K])=>String(K).toLowerCase()===B);return A?A[1]:""},H=Et(k("tags")),S=k("kind")||"knowledge",h=(k("status")||"approved").toLowerCase(),g=Ve[S]||"#6B7280",I=(D||"").length>460,[T,v]=(0,n.useState)(!0);return(0,e.jsxs)("div",{className:"me-overlay",onClick:f,children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",onClick:B=>B.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsxs)("h3",{children:[(0,e.jsx)("span",{style:{marginRight:6},children:ht[S]||"\u{1F4CE}"}),o.title]}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>i&&i(!0),children:["\u{1F44D} ",t("fbUseful")]}),(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>i&&i(!1),children:["\u{1F44E} ",t("fbNotUseful")]})]}),I&&(0,e.jsx)("button",{type:"button",className:"mc-btn","aria-expanded":T,onClick:()=>v(B=>!B),children:t(T?"collapse":"expand")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},onClick:()=>{window.confirm(t("deleteConfirm"))&&c&&c(o.path)},children:t("delete")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:f,children:t("close")})]})]}),(0,e.jsxs)("div",{className:"md-meta",children:[(0,e.jsxs)("span",{className:"md-chip md-chip-kind",style:{color:g,borderColor:g+"59",background:g+"1a"},children:[ht[S]||"\u{1F4CE}"," ",t(qe[S]||"kindKnowledge")]}),(0,e.jsxs)("span",{className:"md-chip "+(h==="approved"?"md-chip-st-ok":h==="pending"?"md-chip-st-warn":"md-chip-st-bad"),children:[h==="approved"?"\u2705":h==="pending"?"\u23F3":"\u26D4"," ",t(h==="approved"?"statusApproved":h==="pending"?"statusPending":"statusRejected")]}),(Array.isArray(H)?H:[]).slice(0,8).map(B=>(0,e.jsxs)("span",{className:"md-chip md-chip-tag",children:["\u{1F3F7} ",B]},B)),!!k("updated")&&(0,e.jsxs)("span",{className:"md-chip md-date",children:["\u{1F552} ",t("updated")," ",pt(k("updated"))]}),!!k("source")&&(0,e.jsxs)("span",{className:"md-chip md-date",children:["\u{1F4E5} ",k("source")]})]}),(0,e.jsx)("div",{className:"me-dialog-body",style:T?{}:{maxHeight:300,overflow:"hidden"},onClick:T?void 0:B=>{B.stopPropagation(),v(!0)},children:(0,e.jsx)("div",{className:"md-doc",dangerouslySetInnerHTML:{__html:Dt(D)}})}),!T&&(0,e.jsxs)("div",{className:"md-collapsed-hint",onClick:B=>{B.stopPropagation(),v(!0)},children:[t("expand")," \u2304"]})]})]})}function Fa({t,onOpen:o,all:l,onAllChange:f,onMutate:c,active:i,visible:w}){let[D,k]=(0,n.useState)(null),[H,S]=(0,n.useState)(""),h=(0,n.useRef)(!1),g=(0,n.useRef)(0),I=(0,n.useRef)(t);I.current=t;let T=(0,n.useCallback)(async()=>{try{h.current=!1;let K=await(await fetch(`${O}/graph${l?"?all=1":""}`)).json();K.ok?(k(K),S(""),h.current=!0):(k(null),S(K.error||t("error")))}catch(A){S(String(A&&A.message?A.message:A))}},[l,t]);(0,n.useEffect)(()=>{if(!i||h.current)return;let A=!0;return fetch(`${O}/graph${l?"?all=1":""}`).then(K=>K.json()).then(K=>{A&&(K.ok?(k(K),S(""),h.current=!0):(k(null),S(K.error||t("error"))))}).catch(K=>{A&&S(String(K&&K.message?K.message:K))}),()=>{A=!1}},[l,t,i]),(0,n.useEffect)(()=>{w&&D&&g.current++},[w,D]);let v=(0,n.useCallback)(async A=>{try{let te=await(await fetch(`${O}/delete?path=${encodeURIComponent(A)}`)).json();return te&&te.ok?(await T(),c&&c(),!0):!1}catch{return!1}},[T]),B=(0,n.useCallback)(async A=>{if(!A||A.length<2)return!1;try{let K=await fetch(`${O}/merge?paths=${encodeURIComponent(A.join(","))}`).then(te=>te.json());return K&&K.ok?(await T(),c&&c(),!0):!1}catch{return!1}},[T,c]);return(0,e.jsxs)("div",{className:"me-graph",children:[(0,e.jsx)("style",{children:Oe}),H&&(0,e.jsxs)("div",{className:"mc-empty",children:[t("error"),"\uFF1A",H]}),!D&&!H&&(0,e.jsx)("div",{className:"mc-empty",children:t("loading")}),D&&D.nodes.length===0&&(0,e.jsx)("div",{className:"mc-empty",children:t("emptyGraph")}),D&&D.nodes.length>0&&(0,e.jsx)(Ea,{nodes:D.nodes,edges:D.edges,onOpen:o,onDelete:v,onMerge:B,t,all:l,onAllChange:f,countLabel:`${D.nodes.length} ${t("nodes")} \xB7 ${Ha(D.edges)} ${t("edges")}`,fitTrigger:g.current})]})}function Ha(t){let o=new Set;for(let l of t||[])o.add([l.source,l.target].sort().join("|"));return o.size}var ct={colors:{project:"#3B82F6",knowledge:"#10B981",content:"#F59E0B",prompt:"#A855F7",business:"#EC4899",tool:"#06B6D4",mistake:"#EF4444",other:"#6B7280"},shapes:{project:"circle",knowledge:"circle",content:"rect",prompt:"diamond",business:"hexagon",tool:"circle",mistake:"diamond",other:"circle"}};function Ea({nodes:t,edges:o,onOpen:l,onDelete:f,onMerge:c,t:i,countLabel:w,all:D,onAllChange:k,fitTrigger:H}){let S=(0,n.useRef)(null),h=(0,n.useRef)(null),g=(0,n.useRef)(null),I=(0,n.useRef)(null),T=(0,n.useRef)(null),v=(0,n.useRef)(l);(0,n.useEffect)(()=>{v.current=l},[l]);let B=(0,n.useRef)(f);(0,n.useEffect)(()=>{B.current=f},[f]);let A=(0,n.useRef)(c);(0,n.useEffect)(()=>{A.current=c},[c]);let[K,te]=(0,n.useState)(""),[Y,j]=(0,n.useState)(null),Ae=(0,n.useRef)("");(0,n.useEffect)(()=>{Ae.current=K.trim().toLowerCase()},[K]),(0,n.useEffect)(()=>{let p=g.current;if(!p)return;let r=K.trim().toLowerCase();if(!r)return;let $=p.nodes.find(se=>(se.name||"").toLowerCase().includes(r));$&&(g.current.selectedId=$.id,j($.id),p.panX=p.w/2-$.x*p.zoom,p.panY=p.h/2-$.y*p.zoom,p.render&&p.render())},[K]);let[X,be]=(0,n.useState)("all"),[Z,U]=(0,n.useState)(!1),ie=(0,n.useRef)("all"),[ve,C]=(0,n.useState)(""),ke=(0,n.useRef)(""),[Q,pe]=(0,n.useState)(!1),Pe=(0,n.useRef)(!1),[y,W]=(0,n.useState)(null);(0,n.useEffect)(()=>{ie.current=X},[X]),(0,n.useEffect)(()=>{ke.current=ve},[ve]),(0,n.useEffect)(()=>{Pe.current=Q},[Q]);let re=(0,n.useMemo)(()=>{let p=new Map;for(let r of t)for(let $ of r.tags||[]){let se=String($).trim();se&&p.set(se,(p.get(se)||0)+1)}return[...p.entries()].sort((r,$)=>$[1]-r[1]).slice(0,24).map(([r,$])=>({tag:r,n:$}))},[t]),J=(()=>{let p=K.trim().toLowerCase();return!!p&&!t.some(r=>(r.title||r.name||"").toLowerCase().includes(p)||String(r.kind||"").toLowerCase().includes(p)||String(qe[r.kind]||"").toLowerCase().includes(p))})();(0,n.useEffect)(()=>{let p=g.current;p&&p.wake&&p.wake()},[K]),(0,n.useEffect)(()=>{let p=g.current;p&&p.render&&p.render()},[X,ve,Q]);let le=(0,n.useRef)(null),[ye,Be]=(0,n.useState)([]),[Ne,Me]=(0,n.useState)(null),[De,s]=(0,n.useState)(!1),[x,R]=(0,n.useState)(null),[G,Se]=(0,n.useState)(""),Ce=(0,n.useRef)(null),de=(0,n.useRef)(null),ee=(p,r=!0)=>{Ce.current&&clearTimeout(Ce.current),R({msg:p,ok:r}),Ce.current=setTimeout(()=>R(null),1900)},We=p=>{Se(p),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>Se(""),1600)};(0,n.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current),de.current&&clearTimeout(de.current)},[]);let Re=(0,n.useMemo)(()=>t.reduce((p,r)=>(p[r.id]=r,p),{}),[t]);return(0,n.useEffect)(()=>{let p=S.current;if(!p||t.length===0)return;let r=p.getContext("2d");if(!r)return;let $=Math.max(1,window.devicePixelRatio||1),se=()=>document.documentElement.getAttribute("data-theme")==="dark",ce={};o.forEach(m=>{ce[m.source]=(ce[m.source]||0)+1,ce[m.target]=(ce[m.target]||0)+1});let ge=Math.max(1,...Object.values(ce)),a={nodes:t.map(m=>({id:m.id,name:m.title||"",type:m.kind||"other",r:9+Math.min(10,(ce[m.id]||0)/ge*8),x:0,y:0,vx:0,vy:0})),edges:o.map(m=>({sourceNodeId:m.source,targetNodeId:m.target,weight:1})),panX:0,panY:0,zoom:1,running:!0,raf:0,tickCount:0,quietTicks:0,dragNode:null,selectedId:null,mouseX:0,mouseY:0,w:0,h:0,dpr:$,ctx:r,multi:[],marquee:null};a.domain=t,a.domainById=t.reduce((m,L)=>(m[L.id]=L,m),{}),a.nodes.forEach((m,L)=>{let N=L/a.nodes.length*Math.PI*2-Math.PI/2;m.x=Math.cos(N)*60,m.y=Math.sin(N)*60});let tt=[...new Set(a.nodes.map(m=>m.type))];a.clustered=tt.length>1,a.typeCenters={},tt.forEach((m,L)=>{let N=L/tt.length*Math.PI*2-Math.PI/2;a.typeCenters[m]={x:Math.cos(N)*160,y:Math.sin(N)*160}}),g.current=a;let we=0,nt=0,Le=()=>{let m=p.clientWidth,L=p.clientHeight;a.w=m,a.h=L,p.width=m*$,p.height=L*$,r.setTransform($,0,0,$,0,0),(we===0||nt===0)&&m>0&&L>0&&a.tickCount>0&&requestAnimationFrame(()=>M()),we=m,nt=L};Le();let d=new ResizeObserver(Le);d.observe(p.parentElement);let P=(m,L)=>m&&m.length>L?m.slice(0,L)+"\u2026":m,E=(m,L,N,F)=>{if(r.beginPath(),F==="rect")r.rect(m-N,L-N*.75,N*2,N*1.5);else if(F==="diamond")r.moveTo(m,L-N),r.lineTo(m+N,L),r.lineTo(m,L+N),r.lineTo(m-N,L),r.closePath();else if(F==="hexagon"){for(let V=0;V<6;V++){let ue=Math.PI/3*V-Math.PI/2,ae=m+N*Math.cos(ue),Ie=L+N*Math.sin(ue);V===0?r.moveTo(ae,Ie):r.lineTo(ae,Ie)}r.closePath()}else r.arc(m,L,N,0,Math.PI*2)},u=new Map,z=(m,L)=>{let N=m+"|"+Math.round(L),F=u.get(N);if(!F){let V=parseInt(m.slice(1,3),16),ue=parseInt(m.slice(3,5),16),ae=parseInt(m.slice(5,7),16);F=r.createRadialGradient(-L*.3,-L*.3,0,0,0,L*1.2),F.addColorStop(0,"rgba("+Math.min(255,V+70)+","+Math.min(255,ue+70)+","+Math.min(255,ae+70)+",0.95)"),F.addColorStop(1,m),u.set(N,F)}return F},M=()=>{if(!a.nodes.length)return;let m=1/0,L=-1/0,N=1/0,F=-1/0;a.nodes.forEach(_e=>{m=Math.min(m,_e.x),L=Math.max(L,_e.x),N=Math.min(N,_e.y),F=Math.max(F,_e.y)});let V=20,ue=L-m+V*2,ae=F-N+V*2,Ie=Math.min(a.w/ue,a.h/ae);a.zoom=Math.max(.35,Math.min(1.8,Ie)),a.panX=a.w/2-(m+L)/2*a.zoom,a.panY=a.h/2-(N+F)/2*a.zoom};I.current=M;let q=()=>{r.clearRect(0,0,a.w,a.h),a.searchTerm=Ae.current,a.kindFilter=ie.current,a.timeMode=Pe.current,a.tagFilter=ke.current;let m=a.tagFilter,L=a.kindFilter,N=b=>String(b||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");r.save(),r.strokeStyle=se()?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.04)",r.lineWidth=.5;for(let b=0;b<a.w;b+=24)r.beginPath(),r.moveTo(b,0),r.lineTo(b,a.h),r.stroke();for(let b=0;b<a.h;b+=24)r.beginPath(),r.moveTo(0,b),r.lineTo(a.w,b),r.stroke();r.restore(),r.save(),r.translate(a.panX,a.panY),r.scale(a.zoom,a.zoom);let F={};a.nodes.forEach(b=>F[b.id]=b);let V=a.nodes.length>40,ue=V?1.5:.55,ae=a.selectedId||a.hoverId,Ie=_t({panX:a.panX,panY:a.panY,zoom:a.zoom,w:a.w,h:a.h,margin:80}),_e=(()=>{let b=(a.searchTerm||"").toLowerCase();if(!b)return null;let ne=[];for(let oe of a.nodes){let Te=(a.domainById[oe.id]||{}).kind||"other";if(((oe.name||"").toLowerCase().includes(b)||String(qe[Te]||"").toLowerCase().includes(b)||String(Te).toLowerCase().includes(b))&&ne.push(oe.id),ne.length>200)break}return ne})(),ot=Kt(a.nodes,{limit:Ut(a.nodes.length),focusId:ae,hoverId:a.hoverId,searchHits:_e,degree:ce}),fe=new Map,xe=(b,ne)=>{let oe=b+"|"+ne,he=fe.get(oe);return he===void 0&&(r.font=b,he=r.measureText(ne).width,fe.set(oe,he)),he},He=a.nodes.length<=250,Ue=new Map;a.edges.forEach(b=>{let ne=F[b.sourceNodeId],oe=F[b.targetNodeId];if(!ne||!oe||!Nt(ne.x,ne.y,10,Ie)&&!Nt(oe.x,oe.y,10,Ie))return;if(L!=="all"){let lt=a.domainById[b.sourceNodeId]&&a.domainById[b.sourceNodeId].kind,Qe=a.domainById[b.targetNodeId]&&a.domainById[b.targetNodeId].kind;if(lt!==L&&Qe!==L)return}if(m){let lt=a.domainById[b.sourceNodeId]&&(a.domainById[b.sourceNodeId].tags||[]).includes(m),Qe=a.domainById[b.targetNodeId]&&(a.domainById[b.targetNodeId].tags||[]).includes(m);if(!lt&&!Qe)return}let he=oe.x-ne.x,Te=oe.y-ne.y,Fe=Math.sqrt(he*he+Te*Te)||1,et=V?12:18,at=-Te/Fe*et,xt=he/Fe*et,kt=(ne.x+oe.x)/2+at,wt=(ne.y+oe.y)/2+xt,mt=ct.colors[a.domainById[ne.id]&&a.domainById[ne.id].kind||"other"],gt=ae&&(b.sourceNodeId===ae||b.targetNodeId===ae),Mt=ae?gt?.6:.08:V?.14:.24,Ze=parseInt(mt.slice(1,3),16),ft=parseInt(mt.slice(3,5),16),Tt=parseInt(mt.slice(5,7),16),Xe=gt?1.6+(b.weight||1):.8+(b.weight||1)*.5,it=Ze+","+ft+","+Tt+","+Mt+","+Xe,Ke=Ue.get(it);Ke||(Ke={path:new Path2D,stroke:"rgba("+Ze+","+ft+","+Tt+","+Mt+")",width:Xe},Ue.set(it,Ke)),Ke.path.moveTo(ne.x,ne.y),Ke.path.quadraticCurveTo(kt,wt,oe.x,oe.y)}),Ue.forEach(b=>{r.strokeStyle=b.stroke,r.lineWidth=b.width,r.stroke(b.path)});let Ee=null;ae&&(Ee=new Set,a.edges.forEach(b=>{b.sourceNodeId===ae?Ee.add(b.targetNodeId):b.targetNodeId===ae&&Ee.add(b.sourceNodeId)}));let Je=[];if(a.nodes.forEach(b=>{if(!Nt(b.x,b.y,b.r+2,Ie))return;let ne=a.domainById[b.id]||{},oe=ne.kind||"other",he=a.timeMode?Oa(ne.updated):ct.colors[oe],Te=ct.shapes[oe],Fe=a.selectedId===b.id,et=a.hoverId===b.id,at=a.searchTerm||"",xt=!at||(b.name||"").toLowerCase().includes(at)||String(qe[oe]||"").toLowerCase().includes(at)||String(oe).toLowerCase().includes(at),kt=L==="all"||oe===L,wt=!m||(ne.tags||[]).includes(m),mt=ae&&b.id!==ae&&!(Ee&&Ee.has(b.id))||at&&!xt||!kt||!wt;r.save(),r.globalAlpha=mt?.08:1,(Fe||et)&&He&&(r.shadowColor=he,r.shadowBlur=Fe?20:14),r.translate(b.x,b.y),E(0,0,b.r,Te),r.fillStyle=z(he,b.r),r.fill(),r.restore(),Fe?(r.save(),E(b.x,b.y,b.r+3,Te),r.strokeStyle=he,r.lineWidth=3,r.shadowColor=he,r.shadowBlur=12,r.stroke(),r.restore()):et?(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle=he,r.lineWidth=2,r.stroke(),r.restore()):at&&xt?(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle="#e11d48",r.lineWidth=2,r.stroke(),r.restore()):a.multi.indexOf(b.id)>=0&&(r.save(),E(b.x,b.y,b.r+2,Te),r.strokeStyle="#60a5fa",r.lineWidth=2,r.shadowColor="#60a5fa",r.shadowBlur=8,r.stroke(),r.restore());let gt=P(b.name,16);if((Fe||et||ot.has(b.id)&&a.zoom>ue||!V&&a.zoom>.6)&&kt&&wt){let Ze=1/a.zoom,ft="500 "+(12*Ze).toFixed(1)+"px -apple-system,Segoe UI,sans-serif";r.font=ft;let Xe=xe(ft,gt)+16*Ze,it=18*Ze,Ke=b.y+b.r+8*Ze,lt=!0;for(let Qe of Je)if(b.x-Xe/2<Qe.x+Qe.w&&b.x+Xe/2>Qe.x&&Ke<Qe.y+Qe.h&&Ke+it>Qe.y){lt=!1;break}if(!lt&&!Fe&&!et)return;Je.push({x:b.x-Xe/2,y:Ke,w:Xe,h:it}),r.fillStyle=se()?"rgba(30,30,35,0.92)":"rgba(255,255,255,0.92)",r.beginPath(),r.roundRect?r.roundRect(b.x-Xe/2,Ke,Xe,it,4*Ze):r.rect(b.x-Xe/2,Ke,Xe,it),r.fill(),r.strokeStyle=se()?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)",r.lineWidth=1*Ze,r.stroke(),r.fillStyle=se()?Fe||et?"#eee":"#bbb":Fe||et?"#111":"#444",r.textAlign="center",r.fillText(gt,b.x,Ke+13*Ze)}}),r.restore(),a.marquee){let b=a.marquee,ne=Math.min(b.sx,b.ex),oe=Math.min(b.sy,b.ey),he=Math.abs(b.ex-b.sx),Te=Math.abs(b.ey-b.sy);r.save(),r.setLineDash([4,4]),r.strokeStyle="rgba(96,165,250,0.9)",r.lineWidth=1,r.fillStyle="rgba(96,165,250,0.12)",r.fillRect(ne,oe,he,Te),r.strokeRect(ne,oe,he,Te),r.restore()}if(a.hoverId&&le.current){let b=a.domainById[a.hoverId],ne=a.nodes.find(function(oe){return oe.id===a.hoverId});if(b&&ne){let oe=a.edges.filter(function(Fe){return Fe.sourceNodeId===b.id||Fe.targetNodeId===b.id}).length,he=ne.x*a.zoom+a.panX,Te=ne.y*a.zoom+a.panY;le.current.style.display="block",le.current.style.left=he+14+"px",le.current.style.top=Te-6+"px",le.current.innerHTML="<b>"+N(b.title||b.name||"")+'</b><br/><span style="opacity:.8">'+N(b.kind||"")+" \xB7 "+tRef.current("connCount").replace("{n}",oe)+"</span>"}}else le.current&&(le.current.style.display="none")},_=()=>{a.running=!0,a.raf||(a.raf=requestAnimationFrame(ze))};a.wake=_,a.render=q;let me=()=>{let m=a.nodes.length;a.tickCount++;let N=.9-Math.min(.4,a.tickCount/1500),F=m>1e3?3e3:m>100?2e3:m>50?1200:800,V=m>100?.002:.005,ue=m>1e3?.012:m>100?.005:.01,ae=m>1e3?6:m>200?12:24,Ie={};a.nodes.forEach(fe=>Ie[fe.id]=fe);for(let fe=0;fe<m;fe++){if(a.dragNode===a.nodes[fe])continue;let xe=a.nodes[fe],He=0,Ue=0;for(let b=0;b<m;b++){if(fe===b)continue;let ne=xe.x-a.nodes[b].x,oe=xe.y-a.nodes[b].y,he=Math.sqrt(ne*ne+oe*oe)||1,Te=F/(he*he);He+=ne/he*Te,Ue+=oe/he*Te}if(a.clustered&&a.typeCenters[xe.type]){let b=a.typeCenters[xe.type];He+=(b.x-xe.x)*.006,Ue+=(b.y-xe.y)*.006}else He-=xe.x*ue,Ue-=xe.y*ue;let Ee=(xe.vx+He)*N,Je=(xe.vy+Ue)*N;Ee=Math.max(-ae,Math.min(ae,Ee)),Je=Math.max(-ae,Math.min(ae,Je)),xe.vx=Ee,xe.vy=Je}a.edges.forEach(fe=>{let xe=Ie[fe.sourceNodeId],He=Ie[fe.targetNodeId];if(!xe||!He)return;let Ue=He.x-xe.x,Ee=He.y-xe.y,Je=Math.sqrt(Ue*Ue+Ee*Ee)||1,b=(Je-100)*V,ne=Ue/Je*b,oe=Ee/Je*b;a.dragNode!==xe&&(xe.vx+=ne,xe.vy+=oe),a.dragNode!==He&&(He.vx-=ne,He.vy-=oe)});let _e=0;a.nodes.forEach(fe=>{a.dragNode!==fe&&(fe.x+=fe.vx,fe.y+=fe.vy,_e+=fe.vx*fe.vx+fe.vy*fe.vy)}),a.autoFitPending&&a.tickCount>45&&(a.autoFitPending=!1,M()),(m?Math.sqrt(_e/m):0)<.05&&a.tickCount>60&&!a.dragNode?a.quietTicks=(a.quietTicks|0)+1:a.quietTicks=0},ze=()=>{if(a.running){try{me(),q()}catch{}if(a.quietTicks>30){a.raf=0;return}a.raf=requestAnimationFrame(ze)}},je=(m,L)=>{let N=p.getBoundingClientRect();return{x:(m-N.left-a.panX)/a.zoom,y:(L-N.top-a.panY)/a.zoom}},Ye=m=>{let L=a.domainById[m];return!(!L||ie.current!=="all"&&L.kind!==ie.current||ke.current&&!(L.tags||[]).includes(ke.current))},$e=(m,L,N)=>Math.max(L,Math.min(N,m)),Ge=m=>{a.mouseX=m.clientX,a.mouseY=m.clientY;let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+36){N=V.id;break}}N!==a.hoverId&&(a.hoverId=N,_())},vt=m=>{if(m.button!==0)return;let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+25){N=V;break}}if(m.shiftKey){if(N){a.shiftClick=N.id;return}a.marquee={sx:m.clientX,sy:m.clientY,ex:m.clientX,ey:m.clientY};return}a.dragStart={x:m.clientX,y:m.clientY,px:a.panX,py:a.panY},a.dragging=!1,a.dragNode=N||null,N&&(a.dragOffset={dx:N.x-L.x,dy:N.y-L.y})},At=m=>{if(a.marquee){a.marquee.ex=m.clientX,a.marquee.ey=m.clientY,_();return}if(!a.dragStart)return;let L=m.clientX-a.dragStart.x,N=m.clientY-a.dragStart.y;if(Math.abs(L)+Math.abs(N)>3&&(a.dragging=!0),a.dragNode){let F=je(m.clientX,m.clientY);a.dragNode.x=F.x+a.dragOffset.dx,a.dragNode.y=F.y+a.dragOffset.dy,_()}else a.dragging&&(a.panX=$e(a.dragStart.px+L,-1e5,1e5),a.panY=$e(a.dragStart.py+N,-1e5,1e5),_())},Bt=m=>{if(a.marquee){let N=a.marquee;a.marquee=null;let F=p.getBoundingClientRect(),V=Math.min(N.sx,N.ex)-F.left,ue=Math.max(N.sx,N.ex)-F.left,ae=Math.min(N.sy,N.ey)-F.top,Ie=Math.max(N.sy,N.ey)-F.top,_e=a.nodes.filter(ot=>{let fe=ot.x*a.zoom+a.panX,xe=ot.y*a.zoom+a.panY;return fe>=V&&fe<=ue&&xe>=ae&&xe<=Ie}).map(ot=>ot.id);a.multi=_e,Be(_e),_();return}let L=a.dragStart&&!a.dragging;if(a.shiftClick){let N=a.shiftClick;a.shiftClick=null;let F=Array.isArray(a.multi)?a.multi.slice():[];F.includes(N)||F.push(N),a.multi=F,Be(F),_();return}if(L){let N=je(m.clientX,m.clientY),F=null;for(let V=a.nodes.length-1;V>=0;V--){let ue=a.nodes[V];if(!Ye(ue.id))continue;let ae=ue.x-N.x,Ie=ue.y-N.y;if(ae*ae+Ie*Ie<ue.r*ue.r+20){F=ue;break}}F?(a.selectedId=F.id,j(F.id),_()):(a.selectedId=null,a.hoverId=null,m.shiftKey||(a.multi=[],Be([])),j(null),_())}a.dragStart=null,a.dragging=!1,a.dragNode=null},jt=m=>{m.preventDefault();let L=je(m.clientX,m.clientY),N=null;for(let F=a.nodes.length-1;F>=0;F--){let V=a.nodes[F];if(!Ye(V.id))continue;let ue=V.x-L.x,ae=V.y-L.y;if(ue*ue+ae*ae<V.r*V.r+25){N=V;break}}if(N){let F=a.domainById[N.id];F&&W({x:m.clientX,y:m.clientY,id:N.id,path:F.id,title:F.title})}else W(null)},Pt=m=>{m.preventDefault();let L=p.getBoundingClientRect(),N=(m.clientX-L.left-a.panX)/a.zoom,F=(m.clientY-L.top-a.panY)/a.zoom,V=Math.max(.3,Math.min(3,a.zoom*(m.deltaY<0?1.1:1/1.1)));a.panX=$e(a.panX+N*(a.zoom-V),-1e5,1e5),a.panY=$e(a.panY+F*(a.zoom-V),-1e5,1e5),a.zoom=V,_()};p.addEventListener("mousemove",Ge),p.addEventListener("mousedown",vt),window.addEventListener("mousemove",At),window.addEventListener("mouseup",Bt),p.addEventListener("wheel",Pt,{passive:!1}),p.addEventListener("contextmenu",jt),T.current=()=>{a.selectedId=null,a.hoverId=null,a.multi=[],Be([]),M(),_()};for(let m=0;m<200;m++)me();M(),_();let Ft=()=>U(!1);return window.addEventListener("mousedown",Ft),()=>{a.running=!1,a.raf&&cancelAnimationFrame(a.raf),d.disconnect(),p.removeEventListener("mousemove",Ge),p.removeEventListener("mousedown",vt),window.removeEventListener("mousemove",At),window.removeEventListener("mouseup",Bt),p.removeEventListener("wheel",Pt),p.removeEventListener("contextmenu",jt),window.removeEventListener("mousedown",Ft)}},[t,o]),(0,n.useEffect)(()=>{H!==void 0&&I.current&&requestAnimationFrame(()=>I.current())},[H]),(0,e.jsxs)("div",{className:"me-graph",ref:h,children:[(0,e.jsxs)("div",{className:"me-graph-toolbar",children:[(0,e.jsxs)("span",{className:"me-graph-count",children:[t.length," ",i("nodes")," \xB7 ",o.length," ",i("edges")]}),(0,e.jsx)("span",{className:"spacer",style:{flex:1}}),(0,e.jsx)("input",{type:"text",placeholder:i("search"),value:K,onChange:p=>te(p.target.value)}),(0,e.jsxs)("span",{style:{position:"relative",display:"inline-flex"},children:[(0,e.jsxs)("button",{type:"button",className:"mc-btn",onClick:()=>U(p=>!p),"aria-expanded":Z,title:i("filterLabel"),style:{borderRadius:8},children:["\u{1F50D} ",i("filterLabel")," ",X!=="all"||Q||ve?"\u25CF":"\u25BE"]}),Z&&(0,e.jsx)("div",{className:"me-graph-legend-pop",onMouseDown:p=>p.stopPropagation(),style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:50,background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,padding:8,minWidth:240,boxShadow:"0 12px 34px rgba(0,0,0,.35)"},children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,e.jsx)("button",{type:"button",className:`lg${X==="all"&&!Q?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>{be("all"),pe(!1)},children:i("all")}),Object.keys(Ve).map(p=>(0,e.jsxs)("button",{type:"button",className:`lg${X===p?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>be(r=>r===p?"all":p),children:[(0,e.jsx)("span",{className:"mc-kind",style:{background:ct.colors[p]||Ve[p]}}),i(qe[p])]},p)),(0,e.jsx)("div",{style:{height:1,background:"rgba(255,255,255,0.1)",margin:"4px 0"}}),(0,e.jsxs)("button",{type:"button",className:`lg${Q?" active":""}`,style:{justifyContent:"flex-start"},onClick:()=>pe(p=>!p),children:["\u23F1 ",i("timeDim")]}),re.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{style:{height:1,background:"rgba(255,255,255,0.1)",margin:"4px 0"}}),(0,e.jsx)("div",{style:{maxHeight:130,overflow:"auto",display:"flex",flexWrap:"wrap",gap:4},children:re.map(p=>(0,e.jsxs)("button",{type:"button",className:`lg${ve===p.tag?" active":""}`,style:{color:"#ddd",padding:"2px 7px",fontSize:11},onClick:()=>C(r=>r===p.tag?"":p.tag),title:p.tag,children:["#",p.tag," ",(0,e.jsx)("span",{style:{opacity:.55},children:p.n})]},p.tag))})]}),(X!=="all"||Q||ve)&&(0,e.jsxs)("button",{type:"button",className:"lg lg-clear",style:{justifyContent:"flex-start",color:"#f87171"},onClick:()=>{be("all"),pe(!1),C("")},children:[i("clearFilter")," \u2715"]})]})})]}),(0,e.jsxs)("label",{className:"mc-btn",style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"pointer"},title:i("crossVault"),children:[(0,e.jsx)("input",{type:"checkbox",checked:!!D,onChange:p=>k&&k(p.target.checked)}),i("crossVault")]}),(0,e.jsx)("button",{type:"button",className:`mc-btn${Q?" me-on":""}`,onClick:()=>pe(p=>!p),children:i("timeDim")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=S.current;if(p)try{p.toBlob(r=>{r&&Me({url:URL.createObjectURL(r),blob:r})},"image/png")}catch{}},children:i("exportGraph")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>I.current&&I.current(),children:i("fit")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{j(null),be("all"),T.current&&T.current()},children:i("reset")})]}),(0,e.jsxs)("div",{className:"me-graph-canvas",style:{position:"relative",overflow:"hidden"},children:[(0,e.jsx)("canvas",{ref:S,style:{width:"100%",height:"100%",display:"block",cursor:"grab"}}),(0,e.jsx)("div",{className:"me-graph-tooltip",ref:le,style:{display:"none",position:"absolute",zIndex:4,pointerEvents:"none",background:"rgba(28,28,32,0.88)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:8,padding:"7px 10px",fontSize:12,maxWidth:220,boxShadow:"0 8px 24px rgba(0,0,0,.2)"}}),J&&(0,e.jsx)("div",{className:"mc-empty",style:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:i("noMatch")}),y&&(0,e.jsx)("div",{className:"me-graph-ctx-back",style:{position:"fixed",inset:0,zIndex:30},onMouseDown:()=>W(null)}),y&&(0,e.jsxs)("div",{className:"me-graph-ctxmenu",style:{position:"fixed",left:y.x,top:y.y,zIndex:31},onMouseDown:p=>p.stopPropagation(),children:[(0,e.jsx)("button",{type:"button",onClick:()=>{v.current({path:y.path,title:y.title}),W(null)},children:i("openCard")}),(0,e.jsx)("button",{type:"button",onClick:()=>{y.id&&(g.current.selectedId=y.id,j(y.id)),W(null);let p=g.current;p&&p.wake&&p.wake()},children:i("focusNeighbors")}),(0,e.jsx)("button",{type:"button",onClick:()=>{try{navigator.clipboard&&navigator.clipboard.writeText(y.title||"")}catch{}W(null),ee(i("copied"))},children:i("copyName")}),(0,e.jsx)("button",{type:"button",onClick:()=>{let p=g.current,r=p&&Array.isArray(p.multi)?p.multi.slice():[],$=y.id;if($&&!r.includes($)&&r.push($),W(null),r.length<2){ee(i("mergeNeed"),!1);return}if(!window.confirm(i("mergeConfirm")))return;let se=A.current&&A.current(r);se&&se.then?se.then(ce=>ce?ee(i("merged")):ee(i("mergeFail"),!1)).catch(()=>ee(i("mergeFail"),!1)):se&&ee(i("merged"))},children:i("merge")}),(0,e.jsx)("button",{type:"button",style:{color:"#f87171"},onClick:()=>{let p=y.path;W(null),window.confirm(i("deleteConfirm"))&&(async()=>{try{(B.current?await B.current(p):!1)?ee(i("deleted")):ee(i("deleteFail"),!1)}catch{ee(i("deleteFail"),!1)}})()},children:i("delete")})]}),ye.length>0&&(0,e.jsxs)("div",{style:{position:"absolute",left:10,top:10,zIndex:3,display:"flex",gap:8,alignItems:"center",background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:10,padding:"6px 10px",fontSize:12,boxShadow:"0 10px 30px rgba(0,0,0,.25)"},children:[(0,e.jsxs)("span",{style:{fontWeight:700},children:[ye.length," ",i("nodes")]}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let r=ye.map(ge=>Re[ge]).filter(Boolean).map(ge=>ge.title||ge.name).join(`
|
|
307
|
+
`),$=new Blob([r],{type:"text/plain;charset=utf-8"}),se=URL.createObjectURL($),ce=document.createElement("a");ce.href=se,ce.download="memory-selected.txt",document.body.appendChild(ce),ce.click(),document.body.removeChild(ce),setTimeout(()=>URL.revokeObjectURL(se),1e3),ee(ye.length+i("exportedSel"))},children:i("exportSel")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{if(ye.length<2){ee(i("mergeNeed"),!1);return}let p=ye.map($=>Re[$]?Re[$].id:$);if(!window.confirm(i("mergeConfirm")))return;Be([]);let r=g.current;r&&(r.multi=[]),fetch(`${O}/merge?paths=${encodeURIComponent(p.join(","))}`).then($=>$.json()).then($=>{$&&$.ok?ee(i("merged")):ee(i("mergeFail"),!1)}).catch(()=>ee(i("mergeFail"),!1))},children:i("merge")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",style:{color:"#f87171"},onClick:()=>{if(!window.confirm(i("deleteConfirm")))return;let p=ye.map($=>Re[$]?Re[$].id:$);Be([]);let r=g.current;r&&(r.multi=[]),(async()=>{let $=0;for(let se of p)try{(B.current?await B.current(se):!1)&&$++}catch{}ee($+i("deletedSelected"),$>0)})()},children:i("deleteSelected")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=g.current;p&&(p.multi=[]),Be([]);let r=g.current;r&&r.render&&r.render()},children:i("clearSelection")})]}),Y&&(0,e.jsxs)("div",{className:"me-graph-sidebar",style:{position:"absolute",right:10,top:10,zIndex:3,maxWidth:240,background:"rgba(28,28,32,0.92)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",color:"#eee",borderRadius:10,padding:12,fontSize:12,boxShadow:"0 10px 30px rgba(0,0,0,.25)"},children:[(0,e.jsx)("div",{style:{fontWeight:700,fontSize:13,marginBottom:4},children:Re[Y]?Re[Y].title||Re[Y].name:Y}),(0,e.jsx)("div",{style:{opacity:.8,marginBottom:8},children:Re[Y]?i(qe[Re[Y].kind]||"kindKnowledge"):"\u2014"}),(0,e.jsx)("div",{style:{fontSize:11,opacity:.65,letterSpacing:".04em",marginBottom:6},children:i("graphHint")}),(o.filter(p=>p.source===Y||p.target===Y)||[]).slice(0,8).map((p,r)=>{let $=p.source===Y?p.target:p.source,se=Re[$];return(0,e.jsx)("div",{style:{padding:"4px 6px",cursor:"pointer",borderRadius:6},onMouseDown:ce=>{ce.preventDefault();let ge=g.current;ge&&(ge.selectedId=$,ge.hoverId=$,ge.wake&&ge.wake()),j($)},children:se?(se.title||se.name).slice(0,28):$},r)})]})]}),(0,e.jsx)("div",{className:"me-graph-tip",children:i("graphTip")}),x&&(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,position:"fixed",left:"50%",transform:"translateX(-50%)",top:22,zIndex:70,background:"rgba(20,22,26,0.97)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#f5f5f5",borderRadius:12,padding:"10px 20px",fontSize:13.5,fontWeight:600,boxShadow:"0 14px 44px rgba(0,0,0,.5)",pointerEvents:"none",animation:"me-pop .22s ease",borderLeft:"4px solid "+(x.ok?"#22c55e":"#ef4444"),maxWidth:"90vw"},children:[(0,e.jsx)("span",{style:{color:x.ok?"#34d399":"#f87171",fontWeight:800,fontSize:15},children:x.ok?"\u2713":"\u2715"}),(0,e.jsx)("span",{style:{wordBreak:"break-all"},children:x.msg})]}),Ne&&(0,e.jsxs)("div",{className:"me-overlay",onClick:()=>{Ne.url&&URL.revokeObjectURL(Ne.url),Me(null),s(!1)},children:[(0,e.jsx)("style",{children:Oe}),(0,e.jsxs)("div",{className:"me-dialog",style:{maxWidth:De?"100vw":900,width:De?"100vw":"92vw",maxHeight:De?"100%":"90vh",height:De?"100%":void 0,borderRadius:De?0:14},onClick:p=>p.stopPropagation(),children:[(0,e.jsxs)("div",{className:"me-dialog-head",children:[(0,e.jsx)("h3",{children:i("exportGraph")}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("a",{className:"mc-btn",href:Ne.url,download:"memory-graph.png",onClick:()=>{We("download"),ee(i("downloaded")+" \xB7 "+i("defaultDownloads"))},style:{textDecoration:"none",display:"inline-flex",alignItems:"center"},children:i(G==="download"?"done":"download")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{We("full"),s(p=>!p),ee(i("fullscreen"))},children:i(G==="full"?"done":De?"exitFull":"fullscreen")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{let p=Ne.blob;p&&window.ClipboardItem&&navigator.clipboard?navigator.clipboard.write([new window.ClipboardItem({"image/png":p})]).then(()=>{We("copy"),ee(i("copied"))}).catch(()=>{ee(i("copyFail"),!1)}):ee(i("copyFail"),!1)},children:i(G==="copy"?"done":"copyImage")}),(0,e.jsx)("button",{type:"button",className:"mc-btn",onClick:()=>{Ne.url&&URL.revokeObjectURL(Ne.url),Me(null),s(!1)},children:i("close")})]})]}),(0,e.jsx)("div",{className:"me-dialog-body",style:{display:"flex",justifyContent:"center",background:De?"var(--dsw-alias-bg-base, #0b0d10)":"var(--dsw-alias-bg-base, #f3f4f6)"},children:(0,e.jsx)("img",{src:Ne.url,alt:i("exportGraph"),style:{maxWidth:"100%",maxHeight:De?"calc(100% - 64px)":"70vh",borderRadius:De?0:8,cursor:"zoom-in"},onClick:()=>s(p=>!p)})})]})]})]})}function Oa(t){let o=new Date(t||0).getTime();if(!o)return"#94a3b8";let l=(Date.now()-o)/864e5;return l<3?"#10b981":l<14?"#f59e0b":l<30?"#f97316":"#94a3b8"}function Gt({label:t,value:o=[],options:l,onChange:f,placeholder:c,z:i=20}){let[w,D]=(0,n.useState)(!1),k=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!w)return;let v=B=>{k.current&&!k.current.contains(B.target)&&D(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[w]);let H=Array.isArray(o)?o:[],S=H.includes("__all__"),h=S?l.find(v=>v.value==="__all__")?.label||"":H.length?H.map(v=>l.find(B=>B.value===v)?.label||v).join("\u3001"):"",g=(v,B)=>{if(v.value==="__all__"){f(B?["__all__"]:[]);return}let A=new Set(H);A.has("__all__")&&A.delete("__all__"),B?A.add(v.value):A.delete(v.value),f([...A])},I=l.find(v=>v.value==="__all__"),T=l.filter(v=>v.value!=="__all__");return(0,e.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12,minWidth:0},children:[(0,e.jsx)("span",{style:{opacity:.6,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.5},children:t}),(0,e.jsxs)("div",{ref:k,style:{position:"relative",minWidth:0},children:[(0,e.jsxs)("button",{type:"button",onClick:()=>D(v=>!v),style:{width:"100%",textAlign:"left",padding:"6px 8px",borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:6},children:[(0,e.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h||c||"\u2014"}),(0,e.jsx)("span",{style:{fontSize:10,opacity:.7},children:"\u25BE"})]}),w&&(0,e.jsxs)("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:i,marginTop:2,borderRadius:8,border:"1px solid var(--dsw-alias-border-l2, #d1d5db)",background:"var(--dsw-alias-bg-layer-1, #fff)",color:"inherit",boxShadow:"0 6px 20px rgba(0,0,0,0.14)",maxHeight:180,overflow:"auto"},children:[I&&(0,e.jsxs)("label",{onClick:v=>v.stopPropagation(),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px",cursor:"pointer",borderBottom:"1px solid rgba(127,127,127,0.12)"},children:[(0,e.jsx)("input",{type:"checkbox",checked:S,onChange:v=>g(I,v.target.checked)}),(0,e.jsx)("span",{children:I.label})]}),T.map(v=>(0,e.jsxs)("label",{onClick:B=>B.stopPropagation(),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px",cursor:"pointer"},children:[(0,e.jsx)("input",{type:"checkbox",checked:H.includes(v.value),onChange:B=>g(v,B.target.checked)}),(0,e.jsx)("span",{children:v.label})]},v.value))]})]})]})}function Wa(t){let o=new Date(t||0).getTime();return!!o&&(Date.now()-o)/864e5<3}async function $a(t,o,l){if(l&&typeof window.showSaveFilePicker=="function")try{let i=await window.showSaveFilePicker({suggestedName:o}),w=await i.createWritable();return await w.write(t),await w.close(),{ok:!0,picked:!0,name:i.name}}catch(i){return i&&i.name==="AbortError"?{ok:!1,aborted:!0}:{ok:!1,err:String(i.message||i)}}let f=URL.createObjectURL(t),c=document.createElement("a");return c.href=f,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c),setTimeout(()=>URL.revokeObjectURL(f),1e3),{ok:!0,picked:!1,name:o}}function Xt(t,o){if(!o||!t)return t;let l=t.toLowerCase(),f=o.toLowerCase(),c=[],i=0;for(;i<t.length;){let w=l.indexOf(f,i);if(w<0){c.push(t.slice(i));break}w>i&&c.push(t.slice(i,w)),c.push((0,e.jsx)("mark",{className:"mc-hl",children:t.slice(w,w+f.length)},w)),i=w+f.length}return c}function pt(t){if(!t)return"";let o=new Date(t);if(Number.isNaN(o.getTime()))return"";let l=new Date,f=o.toDateString()===l.toDateString(),c=w=>String(w).padStart(2,"0"),i=`${c(o.getHours())}:${c(o.getMinutes())}`;return f?i:`${o.getMonth()+1}-${o.getDate()} ${i}`}
|
|
308
308
|
|
|
309
309
|
return module.exports;
|
|
310
310
|
},
|