From f162bb2cde6bd491b68e4b39deefa5692e02f4aa Mon Sep 17 00:00:00 2001 From: xiaomakuaiz Date: Fri, 17 Jul 2026 12:13:25 +0000 Subject: [PATCH] =?UTF-8?q?feat(ui+server):=20=E6=96=87=E4=BB=B6=E6=8A=BD?= =?UTF-8?q?=E5=B1=89=E6=94=AF=E6=8C=81=E5=9C=A8=E7=B3=BB=E7=BB=9F=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E5=99=A8=E4=B8=AD=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 内核新增 repo_reveal call:目录直接打开、文件在父目录选中 (open / explorer /select / xdg-open);serve 仅绑 loopback,浏览器 与内核同机,浏览器模式与桌面壳行为一致,无需 Tauri 能力 - 路径强制限定工作区内(复用 resolve 守卫,越界单测);Start 不等退出 (explorer.exe 成功也返回非零码) - 入口按"不认识路径的普通用户"设计:抽屉底部常驻"这个任务的文件都 保存在这台电脑上" + 平台母语主按钮(在访达中打开/打开文件夹), 预览头部"在访达中显示/打开所在文件夹";完整路径仅在悬停提示 - 系统调用失败时复制绝对路径兜底并提示 --- agent/cmd/mc-agent/uidist/index.html | 112 +++++++++++++-------------- agent/internal/frame/frame.go | 1 + agent/internal/repo/repo.go | 33 ++++++++ agent/internal/repo/repo_test.go | 12 +++ agent/internal/server/server.go | 7 ++ agent/ui/src/App.tsx | 57 +++++++++++++- agent/ui/src/useSession.ts | 9 +++ 7 files changed, 174 insertions(+), 57 deletions(-) diff --git a/agent/cmd/mc-agent/uidist/index.html b/agent/cmd/mc-agent/uidist/index.html index a83bfeb1..6744d5a0 100644 --- a/agent/cmd/mc-agent/uidist/index.html +++ b/agent/cmd/mc-agent/uidist/index.html @@ -10,7 +10,7 @@ - +`}strong({tokens:i}){return`${this.parser.parseInline(i)}`}em({tokens:i}){return`${this.parser.parseInline(i)}`}codespan({text:i}){return`${hr(i,!0)}`}br(i){return"
"}del({tokens:i}){return`${this.parser.parseInline(i)}`}link({href:i,title:s,tokens:o}){const u=this.parser.parseInline(o),d=ff(i);if(d===null)return u;i=d;let p='",p}image({href:i,title:s,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));const d=ff(i);if(d===null)return hr(o);i=d;let p=`${o}{const w=v[m].flat(1/0);o=o.concat(this.walkTokens(w,s))}):v.tokens&&(o=o.concat(this.walkTokens(v.tokens,s)))}}return o}use(...i){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=s.renderers[d.name];p?s.renderers[d.name]=function(...v){let m=d.renderer.apply(this,v);return m===!1&&(m=p.apply(this,v)),m}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=s[d.level];p?p.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),u.extensions=s),o.renderer){const d=this.defaults.renderer||new el(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(["options","parser"].includes(p))continue;const v=p,m=o.renderer[v],w=d[v];d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E||""}}u.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new $o(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const v=p,m=o.tokenizer[v],w=d[v];d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E}}u.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Qo;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(["options","block"].includes(p))continue;const v=p,m=o.hooks[v],w=d[v];Qo.passThroughHooks.has(p)?d[v]=y=>{if(this.defaults.async)return Promise.resolve(m.call(d,y)).then(D=>w.call(d,D));const E=m.call(d,y);return w.call(d,E)}:d[v]=(...y)=>{let E=m.apply(d,y);return E===!1&&(E=w.apply(d,y)),E}}u.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(v){let m=[];return m.push(p.call(this,v)),d&&(m=m.concat(d.call(this,v))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,s){return _r.lex(i,s??this.defaults)}parser(i,s){return Tr.parse(i,s??this.defaults)}parseMarkdown(i){return(o,u)=>{const d={...u},p={...this.defaults,...d},v=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&d.async===!1)return v(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return v(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return v(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));p.hooks&&(p.hooks.options=p,p.hooks.block=i);const m=p.hooks?p.hooks.provideLexer():i?_r.lex:_r.lexInline,w=p.hooks?p.hooks.provideParser():i?Tr.parse:Tr.parseInline;if(p.async)return Promise.resolve(p.hooks?p.hooks.preprocess(o):o).then(y=>m(y,p)).then(y=>p.hooks?p.hooks.processAllTokens(y):y).then(y=>p.walkTokens?Promise.all(this.walkTokens(y,p.walkTokens)).then(()=>y):y).then(y=>w(y,p)).then(y=>p.hooks?p.hooks.postprocess(y):y).catch(v);try{p.hooks&&(o=p.hooks.preprocess(o));let y=m(o,p);p.hooks&&(y=p.hooks.processAllTokens(y)),p.walkTokens&&this.walkTokens(y,p.walkTokens);let E=w(y,p);return p.hooks&&(E=p.hooks.postprocess(E)),E}catch(y){return v(y)}}}onError(i,s){return o=>{if(o.message+=` +Please report this to https://github.com/markedjs/marked.`,i){const u="

An error occurred:

"+hr(o.message+"",!0)+"
";return s?Promise.resolve(u):u}if(s)return Promise.reject(o);throw o}}},fi=new _v;function tt(i,s){return fi.parse(i,s)}tt.options=tt.setOptions=function(i){return fi.setOptions(i),tt.defaults=fi.defaults,Qf(tt.defaults),tt};tt.getDefaults=cc;tt.defaults=pi;tt.use=function(...i){return fi.use(...i),tt.defaults=fi.defaults,Qf(tt.defaults),tt};tt.walkTokens=function(i,s){return fi.walkTokens(i,s)};tt.parseInline=fi.parseInline;tt.Parser=Tr;tt.parser=Tr.parse;tt.Renderer=el;tt.TextRenderer=vc;tt.Lexer=_r;tt.lexer=_r.lex;tt.Tokenizer=$o;tt.Hooks=Qo;tt.parse=tt;tt.options;tt.setOptions;tt.use;tt.walkTokens;tt.parseInline;Tr.parse;_r.lex;const kt={flex:"none",display:"block"};function Nr({size:i=13,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M1.5 4a1.5 1.5 0 0 1 1.5-1.5h2.6l1.3 1.5H11A1.5 1.5 0 0 1 12.5 5.5v5A1.5 1.5 0 0 1 11 12H3a1.5 1.5 0 0 1-1.5-1.5V4z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Is({size:i=13,color:s="var(--t4)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("path",{d:"M3.5 2.8A1.3 1.3 0 0 1 4.8 1.5h3.4l2.3 2.3v7.4a1.3 1.3 0 0 1-1.3 1.3H4.8a1.3 1.3 0 0 1-1.3-1.3V2.8z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("path",{d:"M8 1.7v2.5h2.4",stroke:s,strokeWidth:"1.1",strokeLinejoin:"round"})]})}function Tv({size:i=12,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2.3 9.7 9.2 2.8a1.25 1.25 0 0 1 1.77 0l.23.23a1.25 1.25 0 0 1 0 1.77L4.3 11.7l-2.6.6.6-2.6z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function ic({size:i=14,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.03 2.75 2.75 0 0 1-.4 6H4.5z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function op({size:i=14,color:s="var(--t5)",strokeWidth:o=1.2,style:u}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...u},children:[c.jsx("rect",{x:"2",y:"3.5",width:"12",height:"7.5",rx:"1.4",stroke:s,strokeWidth:o}),c.jsx("path",{d:"M5.5 13.5h5",stroke:s,strokeWidth:o,strokeLinecap:"round"})]})}function ll({size:i=11,color:s="var(--t4)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M6 2v8M2 6h8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function yc({size:i=10,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M3.5 2L7 5 3.5 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function sc({size:i=8,color:s="var(--t6)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function lp({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("circle",{cx:"3",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"7",cy:"7",r:"1.1",fill:s}),c.jsx("circle",{cx:"11",cy:"7",r:"1.1",fill:s})]})}function ap({size:i=12,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("rect",{x:"2",y:"2.5",width:"10",height:"3",rx:"1",stroke:s,strokeWidth:"1.2"}),c.jsx("path",{d:"M3 5.5v4A1.5 1.5 0 0 0 4.5 11h5A1.5 1.5 0 0 0 11 9.5v-4M5.5 7.5h3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round"})]})}function tl({size:i=12,color:s="var(--err)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2.5 3.5h9M5.5 3.5v-1h3v1M4 3.5l.5 7A1.5 1.5 0 0 0 6 12h2a1.5 1.5 0 0 0 1.5-1.5l.5-7",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nv({size:i=15,color:s="var(--t3)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...kt,...o},children:[c.jsx("path",{d:"M6.8 1.8h2.4l.3 1.6c.5.2 1 .4 1.4.8l1.6-.6 1.2 2-1.3 1.1c.05.25.1.55.1.85s-.05.6-.1.85l1.3 1.1-1.2 2-1.6-.6c-.4.35-.9.6-1.4.8l-.3 1.6H6.8l-.3-1.6c-.5-.2-1-.45-1.4-.8l-1.6.6-1.2-2 1.3-1.1A4.6 4.6 0 0 1 3.5 8c0-.3.03-.6.1-.85L2.3 6l1.2-2 1.6.6c.4-.35.9-.6 1.4-.8l.3-2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),c.jsx("circle",{cx:"8",cy:"8",r:"1.9",stroke:s,strokeWidth:"1.2"})]})}function Rv({size:i=13,color:s="var(--t5)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:s,strokeWidth:"1.2"}),c.jsx("path",{d:"M7 4v3.2l2.2 1.3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ps({size:i=9,color:s="var(--t5)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M2 2l6 6M8 2L2 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function cp({size:i=13,color:s="var(--onAcc)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M7 11.5V2.8M3.2 6.3 7 2.5l3.8 3.8",stroke:s,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cv({size:i=11,color:s="var(--t3)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M6 1.2 10 2.8v3c0 2.4-1.7 4.2-4 5-2.3-.8-4-2.6-4-5v-3L6 1.2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function xc({size:i=10,color:s="var(--ok)",strokeWidth:o=1.5,style:u}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...u},children:c.jsx("path",{d:"M1.5 5.5 4 8l4.5-6",stroke:s,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Av({size:i=12,color:s="var(--acc)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M6 1c.4 2.6 1.4 3.6 4 4-2.6.4-3.6 1.4-4 4-.4-2.6-1.4-3.6-4-4 2.6-.4 3.6-1.4 4-4z",fill:s})})}function Iv({size:i=8,color:s="var(--err)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 8 8",style:{...kt,...o},children:c.jsx("rect",{width:"8",height:"8",rx:"1.5",fill:s})})}function Ov({size:i=13,color:s="var(--warn)",style:o}){return c.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...kt,...o},children:[c.jsx("circle",{cx:"7",cy:"7",r:"5.8",stroke:s,strokeWidth:"1.2"}),c.jsx("path",{d:"M7 4.2v3.3M7 9.6v.4",stroke:s,strokeWidth:"1.3",strokeLinecap:"round"})]})}function Mv({size:i=10,color:s="var(--t1)",style:o}){return c.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...kt,...o},children:c.jsx("path",{d:"M6.5 2 3 5l3.5 3",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const Zo={items:[],running:!1,usage:null,streamKind:"",turnEnded:!1,model:"",permMode:""},Lv={approved:"已允许",denied:"已拒绝",timeout:"已超时(按拒绝处理)",cancelled:"已取消"};function gf(i){switch(i){case"allowed":return"已允许";case"rejected":return"已拒绝";case"expired":return"(已过期)";default:return Lv[i]??i}}function mf(i,s,o){const u=i.items.slice(),d=u[u.length-1];return i.streamKind===s&&d&&d.kind===s?u[u.length-1]={...d,text:d.text+o}:u.push({kind:s,text:o}),{...i,items:u,streamKind:s}}function Kr(i,s){return{...i,items:[...i.items,s],streamKind:""}}function vf(i){return i.map(s=>s.kind==="perm"&&s.state==="open"?{...s,state:"expired"}:s)}const Vo=200;function Dv(i,s,o){const u=i.items.slice();for(let d=u.length-1;d>=0;d--){const p=u[d];if(!(p.kind!=="tool"||p.tcId!==s)){switch(o.kind){case"subagent_tool":{let v=(p.feed??[]).slice();const m=v.findIndex(y=>y.kind==="tool"&&y.id===o.id),w={kind:"tool",id:o.id??String(v.length),title:o.title??"",status:o.status??"run"};if(m>=0){const y=v[m];v[m]={...w,title:w.title||y.title}}else v.push(w),v.length>Vo&&(v=v.slice(-Vo));u[d]={...p,feed:v};break}case"subagent_text":{if(!o.line)break;let v=(p.feed??[]).slice();v.push({kind:"text",text:o.line}),v.length>Vo&&(v=v.slice(-Vo)),u[d]={...p,feed:v};break}case"output":u[d]={...p,lastLine:o.line};break;case"child_session":u[d]={...p,childSessionId:o.childSessionId};break}return{...i,items:u}}}return i}function jv(i,s){var o,u;switch(s.sessionUpdate){case"agent_message_chunk":return mf(i,"agent",((o=s.content)==null?void 0:o.text)??"");case"agent_thought_chunk":return mf(i,"thought",((u=s.content)==null?void 0:u.text)??"");case"tool_call":return Kr(i,{kind:"tool",tcId:s.toolCallId??"",title:s.title||s.kind||"工具调用",status:"run",out:""});case"tool_call_update":{if(s.status==="in_progress")return s.progress?Dv(i,s.toolCallId??"",s.progress):i;const d=i.items.slice();for(let p=d.length-1;p>=0;p--){const v=d[p];if(v.kind==="tool"&&v.tcId===s.toolCallId){const m=typeof s.rawOutput=="string"?s.rawOutput.split(` +`)[0].slice(0,160):"";d[p]={...v,status:s.status==="completed"?"ok":"fail",out:m,lastLine:void 0};break}}return{...i,items:d}}case"plan":{const d=i.items.slice();for(let p=d.length-1;p>=0;p--)if(d[p].kind==="plan")return d[p]={kind:"plan",entries:s.entries??[]},{...i,items:d,streamKind:""};return Kr(i,{kind:"plan",entries:s.entries??[]})}case"llm_call_retry":return Kr(i,{kind:"sys",text:`模型调用重试 #${s.attempt??"?"}: ${s.message??""}`});case"usage_update":return{...i,usage:{used:s.used??0,size:s.size??0}};case"compact_status":return Kr(i,{kind:"sys",text:s.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const d=s.model??"";return{...Kr(i,{kind:"sys",text:`模型已切换为 ${d}`}),model:d}}case"permission_mode_update":{const d=s.mode??"default";return{...Kr(i,{kind:"sys",text:d==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:d}}default:return i}}function zv(i,s){switch(s.type){case"task-started":return{...i,running:!0};case"task-ended":return{...i,running:!1,streamKind:"",turnEnded:!0,items:[...vf(i.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const o=Gi(s);return{...i,running:!1,streamKind:"",items:[...vf(i.items),{kind:"sys",text:"✗ "+((o==null?void 0:o.error)||"未知错误"),error:!0}]}}case"user-input":{const o=Gi(s);let u="";try{u=o!=null&&o.content?Af(o.content):""}catch{u=(o==null?void 0:o.content)??""}return Kr(i,{kind:"user",text:u})}case"permission-req":{const o=Gi(s);return o!=null&&o.id?Kr(i,{kind:"perm",id:o.id,title:o.title??"",tool:o.tool??"",state:"open"}):i}case"permission-resolved":{const o=Gi(s);return o!=null&&o.id?{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===o.id&&u.state==="open"?{...u,state:o.outcome??"expired"}:u)}:i}case"task-running":if(s.kind==="acp_event"){const o=Gi(s);if(o!=null&&o.update)return jv(i,o.update)}return i;default:return i}}function up(i,s){let o=i;for(const u of s)o=zv(o,u);return o}function Pv(i,s,o){return{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===s&&u.state==="open"?{...u,state:o?"allowed":"rejected"}:u)}}tt.setOptions({gfm:!0,breaks:!0});const Tt='"JetBrains Mono","HarmonyOS Sans SC",ui-monospace,Menlo,Consolas,"Courier New","Microsoft YaHei",monospace';function Bv(i){const s=i.target.closest("a");if(!s)return;i.preventDefault();const o=s.getAttribute("href")||"";/^https?:/i.test(o)&&Of(o)}function Uv({text:i}){const s=F.useMemo(()=>fm.sanitize(tt.parse(i,{async:!1})),[i]);return c.jsx("div",{className:"md",onClick:Bv,dangerouslySetInnerHTML:{__html:s}})}function Fv({text:i}){const[s,o]=F.useState(!1);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsxs("div",{onClick:()=>o(!s),style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",cursor:"pointer",userSelect:"none",lineHeight:1.6,minWidth:0},children:[c.jsx(Av,{}),c.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:"思考"}),!s&&c.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:i.trim().replace(/\s+/g," ")}),s&&c.jsx("span",{style:{flex:1}}),c.jsx(yc,{size:9,color:"var(--t6)",style:{transform:s?"rotate(90deg)":"none",transition:"transform .15s ease"}})]}),s&&c.jsx("div",{style:{marginLeft:5,borderLeft:"2px solid var(--line)",padding:"2px 0 2px 13px",fontSize:12,color:"var(--t4)",lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .2s ease"},children:i})]})}function Wv({entries:i}){const s=o=>o==="completed"?"☑":o==="in_progress"?"◐":"☐";return c.jsx("div",{className:"card",style:{padding:"11px 14px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:i.map((o,u)=>c.jsxs("div",{style:{color:o.status==="completed"?"var(--t5)":o.status==="in_progress"?"var(--acc)":"var(--t2)",textDecoration:o.status==="completed"?"line-through":"none"},children:[c.jsx("span",{style:{display:"inline-block",width:18},children:s(o.status)})," ",o.content]},u))})}function Hv({status:i}){return i==="ok"?c.jsx(xc,{size:11}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:11,flex:"none"},children:"✗"}):c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",flex:"none",border:"1.5px solid var(--acc)",background:"var(--accBd)",animation:"mcpulse 1.4s infinite"}})}function Gv(i){return i==="ok"?c.jsx(xc,{size:10}):i==="fail"?c.jsx("span",{style:{color:"var(--err)",fontSize:10,flex:"none"},children:"✗"}):c.jsx("span",{style:{color:"var(--t5)",fontSize:10,flex:"none",animation:"mcpulse 1.2s infinite"},children:"◌"})}function yf(i,s){if(!s)return i;const o=s.endsWith("/")?s:s+"/";return i.split(o).join("")}function Yv({item:i,onOpenChild:s,workdir:o}){const u=i.feed??[],d=u.slice(-5),p=yf(i.title,o),v=p.indexOf(" "),m=(v>0?p.slice(0,v):"").replace(/[::]$/,""),w=v>0?p.slice(v+1):p,y={display:"flex",gap:7,alignItems:"center",paddingLeft:15,font:"11px/1.7 "+Tt,color:"var(--t3)",whiteSpace:"nowrap",minWidth:0};return c.jsxs("div",{className:"card",style:{padding:"11px 14px",display:"flex",flexDirection:"column",gap:7,fontSize:12.5},children:[c.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",minWidth:0,whiteSpace:"nowrap"},children:[c.jsx(Hv,{status:i.status}),m&&c.jsx("span",{style:{fontWeight:600,flex:"none",color:"var(--t1)"},children:m}),c.jsx("span",{className:"ellipsis",style:{color:"var(--t3)",font:"12px "+Tt,minWidth:0},children:w}),c.jsx("span",{style:{flex:1}}),i.out&&c.jsx("span",{className:"ellipsis",style:{color:"var(--t5)",fontSize:11,flex:"none",maxWidth:"40%"},children:i.out}),i.childSessionId&&s&&c.jsx("a",{href:"#",onClick:E=>{E.preventDefault(),s(i.childSessionId)},style:{fontSize:11.5,fontWeight:600,flex:"none"},children:"查看子会话"})]}),d.length>0&&c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:d.map((E,D)=>c.jsx("div",{style:y,children:E.kind==="tool"?c.jsxs(c.Fragment,{children:[Gv(E.status),c.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:yf(E.title,o)})]}):c.jsx("span",{className:"ellipsis",style:{color:"var(--t5)",flex:1,minWidth:0},children:E.text})},u.length-d.length+D))}),i.status==="run"&&i.lastLine&&c.jsx("div",{style:{...y,display:"block",color:"var(--t5)",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",animation:"mcpulse 1.2s infinite"},children:i.lastLine})]})}function xf(i){switch(i){case"allowed":case"approved":return{text:"✓ 已允许",color:"var(--ok)"};case"rejected":case"denied":return{text:"✕ 已拒绝",color:"var(--err)"};case"timeout":return{text:"✕ "+gf(i),color:"var(--err)"};default:return{text:gf(i),color:"var(--t5)"}}}function Kv({item:i,onAnswer:s}){const o={height:28,display:"flex",alignItems:"center",padding:"0 14px",background:"var(--card)",border:"1px solid var(--line)",color:"var(--t2)",borderRadius:8,cursor:"pointer",fontSize:12.5,fontWeight:600,userSelect:"none",whiteSpace:"nowrap"};return c.jsxs("div",{style:{border:"1px solid var(--warnBd)",borderRadius:12,background:"var(--warnBg)",padding:"13px 15px",maxWidth:560,animation:"mcin .25s ease"},children:[c.jsxs("div",{style:{fontSize:12.5,fontWeight:700,color:"var(--warn)",whiteSpace:"nowrap"},children:["需要确认 · ",i.tool||"执行操作"]}),c.jsx("div",{style:{margin:"9px 0 11px",padding:"8px 12px",background:"var(--card)",border:"1px solid var(--line2)",borderRadius:8,font:"12.5px "+Tt,color:"var(--t1)",wordBreak:"break-all"},children:i.title}),i.state==="open"?c.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[c.jsx("div",{className:"hv-acc",onClick:()=>s(i.id,"allow"),style:{...o,background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"},children:"允许"}),c.jsx("div",{className:"hv",onClick:()=>s(i.id,"always"),style:o,children:"本会话始终"}),c.jsx("div",{className:"hv",onClick:()=>s(i.id,"persist"),style:o,children:"此项目永久"}),c.jsx("div",{className:"hv-errbg",onClick:()=>s(i.id,"deny"),style:{...o,background:"transparent",border:"1px solid var(--errBd)",color:"var(--err)"},children:"拒绝"}),c.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)"},children:"⏎ 允许 · esc 拒绝"})]}):c.jsx("div",{style:{fontSize:12,color:xf(i.state).color},children:xf(i.state).text})]})}function Vv(){const i=c.jsx("span",{style:{flex:1,height:1,background:"var(--line2)"}});return c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,color:"var(--t6)",fontSize:10.5,letterSpacing:1},children:[i,"本轮结束",i]})}const qv=/^\[(图片|文件)\] (\S+)$/;function Qv({text:i,uploadUrl:s}){const[o,u]=F.useState(null),d=i.split(` +`),p=[],v=[],m=[];for(const y of d){const E=y.match(qv);E&&s?(E[1]==="图片"?p:v).push(E[2]):m.push(y)}const w=m.join(` +`).trim();return c.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[c.jsxs("div",{style:{maxWidth:"70%",background:"var(--userBg)",border:"1px solid var(--accBd)",borderRadius:"12px 12px 3px 12px",padding:"9px 15px",fontSize:13.5,lineHeight:1.6,color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:[w,(p.length>0||v.length>0)&&c.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:w?8:2,alignItems:"center"},children:[p.map(y=>c.jsx("img",{src:s(y),alt:y,title:y,onClick:()=>u(y),style:{maxWidth:150,maxHeight:120,borderRadius:8,border:"1px solid var(--accBd)",cursor:"zoom-in",display:"block"}},y)),v.map(y=>c.jsxs("span",{title:y+"(点击下载)",onClick:()=>Of(new URL(s(y),location.origin).href),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--accBd)",background:"var(--card)",fontSize:12,color:"var(--t2)",maxWidth:240,cursor:"pointer"},children:["📄",c.jsx("span",{className:"ellipsis",children:y.split("/").pop()})]},y))]})]}),o&&c.jsx("div",{onClick:()=>u(null),style:{position:"fixed",inset:0,background:"var(--scrim3)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:c.jsx("img",{src:s(o),alt:o,style:{maxWidth:"90vw",maxHeight:"90vh",borderRadius:10,boxShadow:"var(--shadowLg)"}})})]})}function Zv({item:i,onPermAnswer:s,uploadUrl:o}){switch(i.kind){case"user":return c.jsx(Qv,{text:i.text,uploadUrl:o});case"agent":return c.jsx("div",{style:{maxWidth:"92%",wordBreak:"break-word",animation:"mcin .25s ease"},children:c.jsx(Uv,{text:i.text})});case"thought":return c.jsx(Fv,{text:i.text});case"plan":return c.jsx(Wv,{entries:i.entries});case"sys":return i.text==="— 本轮结束 —"?c.jsx(Vv,{}):c.jsx("div",{style:{color:i.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:i.text});case"perm":return c.jsx(Kv,{item:i,onAnswer:s})}}function dp({items:i,onPermAnswer:s,onOpenChild:o,uploadUrl:u,workdir:d}){const p=[];for(let v=0;vc.jsx(Yv,{item:E,onOpenChild:o,workdir:d},E.tcId||D))},"g"+w))}else p.push(c.jsx(Zv,{item:m,onPermAnswer:s,uploadUrl:u},v)),v++}return c.jsx(c.Fragment,{children:p})}function Xv(i){const s=[];let o=0,u=0;for(const d of i.split(` +`)){const p=d.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(p){o=+p[1],u=+p[2],s.push({no:"",text:d,kind:"h"});continue}d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("+++")||d.startsWith("---")||d.startsWith("new file")||d.startsWith("deleted file")||d.startsWith("similarity")||d.startsWith("rename")||d.startsWith("old mode")||d.startsWith("new mode")||(d.startsWith("+")?s.push({no:String(u++),text:d,kind:"add"}):d.startsWith("-")?s.push({no:String(o++),text:d,kind:"del"}):(s.push({no:String(u),text:d,kind:"ctx"}),o++,u++))}return s}function Jv({text:i}){const s=F.useMemo(()=>Xv(i),[i]);return s.some(o=>o.kind==="h")?c.jsx("div",{style:{font:"12px/1.9 "+Tt},children:s.map((o,u)=>o.kind==="h"?c.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--codeBg)",color:"var(--t4)",fontSize:11},children:[c.jsx("span",{style:{width:36,flex:"none"}}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:o.text})]},u):c.jsxs("div",{style:{display:"flex",padding:"0 24px",background:o.kind==="add"?"var(--addBg)":o.kind==="del"?"var(--delBg)":"transparent",color:o.kind==="add"?"var(--addT)":o.kind==="del"?"var(--delT)":"var(--t3)"},children:[c.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:o.no}),c.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:o.text||" "})]},u))}):c.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:i})}for(const[i,s]of Object.entries({bash:gm,c:mm,cpp:vm,css:Tm,go:Nm,ini:Rm,java:Cm,javascript:Lm,json:Dm,markdown:jm,python:zm,rust:Pm,sql:Bm,typescript:Fm,xml:Wm,yaml:Hm}))zf.registerLanguage(i,s);const $v={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",go:"go",py:"python",rs:"rust",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",hpp:"cpp",json:"json",css:"css",html:"xml",htm:"xml",xml:"xml",svg:"xml",vue:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",sql:"sql",ini:"ini",toml:"ini",conf:"ini"};function ey(i){const s=[],o=[];for(const u of i.split(` +`)){const d=o.join(""),p=/]*>|<\/span>/g;for(let v=p.exec(u);v;v=p.exec(u))v[0]===""?o.pop():o.push(v[0]);s.push(d+u+"".repeat(o.length))}return s}const wf={flex:1,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--t2)"};function ty({path:i,text:s}){const o=F.useMemo(()=>{var p;const u=((p=i.split(".").pop())==null?void 0:p.toLowerCase())??"",d=$v[u];if(d)try{return{html:!0,rows:ey(zf.highlight(s,{language:d}).value)}}catch{}return{html:!1,rows:s.split(` +`)}},[i,s]);return c.jsx("div",{style:{font:"12px/1.9 "+Tt},children:o.rows.map((u,d)=>c.jsxs("div",{style:{display:"flex",padding:"0 24px"},children:[c.jsx("span",{style:{width:42,color:"var(--t5)",flex:"none",opacity:.6,userSelect:"none"},children:d+1}),o.html?c.jsx("span",{className:"hl",style:wf,dangerouslySetInnerHTML:{__html:u||" "}}):c.jsx("span",{style:wf,children:u||" "})]},d))})}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hUffPfvMxOe71zXZYY1ZSbM7GdP/kcJ/icIoAoioqYyU89kqqmGDUeA38iC4Q+3Lx+fIzhudbltz5Jv9shqL110Nb5UYk4Q/LKHkvDwiB6ZSyr2fiOCdq3OXLyuZWMbRaxsiCvdmFT20oFWbPFQO/bkhOT28y5Re75Z6r58zGqwGybxfxbMPkj4nyKA7tAgDXr6bDSTpgfdY8gjKBZK47C/598Y/k52wz5NlAZZlrvnsuJGqdOJPbLKT7SZooCoqmYfWgq0pO2IMoH/llFs2NHKBF5UzRsaxJtGuekl0xL7L48p3drdQFM1azdMmmbeixDtDwP+ZwmgO3RxBqAbd6hCNfQvqVyyprTZqJCIUn652zs9KwoRPhGY9D820/uD/ycIoDeIiJo6c6ZunFKv5jAbZld+2BoVrAHNpDC4YuKkSTAbJk2aZKbBu9LdP+rw/yQBbBZEVP/d3nZnysfwMXwMH8PH8DF8DB/Dx/AxfAwfw/8W/H/VP8Ld2brlVwAAAABJRU5ErkJggg==",fp=i=>i>=1e6?Math.round(i/1e5)/10+"M":i>=1e3?Math.round(i/100)/10+"k":String(i),Sf="clamp(680px, 55vw, 860px)",Vi=i=>i.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||i;let pp=-1/0;const nl=i=>{pp=i.timeStamp},rl=i=>i.nativeEvent.isComposing||i.timeStamp-pp<100;function ny({usage:i}){const[s,o]=F.useState(!1),u=2*Math.PI*7,d=i&&i.size>0?i.used/i.size:0,p=(u*Math.max(.03,Math.min(1,d))).toFixed(1)+" "+u.toFixed(1);return c.jsxs("span",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{position:"relative",display:"flex",flex:"none",cursor:"default"},children:[c.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 18 18",fill:"none",children:[c.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"var(--track)",strokeWidth:"2"}),c.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:d>.85?"var(--err)":"var(--acc)",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:p,transform:"rotate(-90 9 9)"})]}),s&&c.jsxs("span",{className:"pop",style:{position:"absolute",bottom:26,right:-6,borderRadius:8,padding:"7px 11px",gap:3,whiteSpace:"nowrap",animation:"mcin .12s ease"},children:[c.jsx("span",{style:{fontSize:10.5,fontWeight:700,letterSpacing:.4,color:"var(--t5)"},children:"上下文用量"}),i?c.jsxs(c.Fragment,{children:[c.jsxs("span",{style:{font:"12px "+Tt,color:"var(--t1)"},children:[i.used.toLocaleString()," / ",i.size.toLocaleString()," tokens"]}),c.jsxs("span",{style:{fontSize:11,color:d>.85?"var(--err)":"var(--t4)"},children:["已用 ",(d*100).toFixed(1),"%",d>.85?" · 接近上限,即将自动压缩":`,剩余 ${fp(Math.max(0,i.size-i.used))}`]})]}):c.jsx("span",{style:{fontSize:11.5,color:"var(--t4)"},children:"暂无数据,本轮请求后更新"})]})]})}function ry({yolo:i,onToggle:s}){const o=i?"var(--warn)":"var(--t3)";return c.jsxs("button",{title:"点击切换权限模式 (⇧⇥);YOLO 下所有操作不再询问,直接执行",onClick:s,style:{height:24,display:"flex",alignItems:"center",gap:5,padding:"0 9px",borderRadius:12,border:`1px solid ${i?"var(--warnBd)":"var(--btnBd)"}`,background:i?"var(--warnBg)":"transparent",color:o,fontSize:11.5,fontWeight:600,cursor:"pointer",flex:"none"},children:[c.jsx(Cv,{color:o}),i?"YOLO":"默认权限"]})}function hp({models:i,current:s,disabled:o,onPick:u}){const[d,p]=F.useState(!1);return c.jsxs("div",{style:{position:"relative",flex:"none"},children:[c.jsxs("button",{className:o?void 0:"hv",title:o?"轮次执行中,结束后可切换":"切换模型(下一轮生效)",onClick:()=>!o&&p(!d),style:{height:24,display:"flex",alignItems:"center",gap:4,padding:"0 7px",border:"none",borderRadius:6,background:"transparent",fontSize:12,color:o?"var(--t5)":"var(--t3)",cursor:o?"default":"pointer",fontWeight:500},children:[s||"模型",c.jsx(sc,{style:{marginTop:1}})]}),d&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"backdrop",onClick:()=>p(!1)}),c.jsx("div",{className:"pop",style:{position:"absolute",bottom:30,right:0,minWidth:200},children:i.map(v=>c.jsxs("button",{className:"hv menu-item",onClick:()=>{p(!1),u(v.name)},style:{padding:"7px 10px",color:v.name===s?"var(--acc)":"var(--t2)",fontWeight:v.name===s?600:400},children:[v.name,c.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)",fontWeight:400},children:v.default?"默认":""})]},v.name))})]})]})}function iy({meta:i,session:s,models:o,currentModel:u,onOpenDrawer:d,onOpenChild:p,onArchive:v,onDelete:m}){var re;const{chat:w,input:y,queued:E,atts:D,yolo:T}=s,P=((re=s.changes)==null?void 0:re.length)??0,B=F.useRef(null),U=F.useRef(null),G=F.useRef(!0),[ae,me]=F.useState("closed"),[xe,Z]=F.useState(!1),pe=F.useRef(0);F.useEffect(()=>{const M=B.current;M&&G.current&&(M.scrollTop=M.scrollHeight)},[w.items,w.running]),F.useEffect(()=>{const M=U.current;M&&(M.style.height="auto",M.style.height=Math.min(M.scrollHeight,160)+"px")},[y]);const A=()=>{const M=B.current;M&&(G.current=M.scrollHeight-M.scrollTop-M.clientHeight<40)},V=M=>{M.key==="Enter"&&!M.shiftKey&&!rl(M)&&(M.preventDefault(),s.send())},j=M=>{const S=[];for(const N of M.clipboardData.items)if(N.kind==="file"){const W=N.getAsFile();W&&S.push(W)}S.length&&(M.preventDefault(),s.addFiles(S))},H=M=>{[...M.dataTransfer.items].some(S=>S.kind==="file")&&(M.preventDefault(),pe.current++,Z(!0))},ee=M=>{M.preventDefault(),--pe.current<=0&&(pe.current=0,Z(!1))},Me=M=>{M.preventDefault(),pe.current=0,Z(!1);const S=[...M.dataTransfer.files];S.length&&s.addFiles(S)},be=(i==null?void 0:i.workdir)??"",Be=w.items.length===0&&!w.running,qe=[...w.items].reverse().find(M=>M.kind==="perm"&&M.state==="open"),$e=w.items.some(M=>M.kind==="tool"&&M.status==="run"),Ge=qe?"等待权限确认":$e?"执行中":"思考中",Pe=Math.max(1,w.items.filter(M=>M.kind==="user").length),z=w.usage;return c.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0,position:"relative"},onDragEnter:H,onDragOver:M=>M.preventDefault(),onDragLeave:ee,onDrop:Me,children:[xe&&c.jsx("div",{style:{position:"absolute",inset:8,zIndex:20,border:"2px dashed var(--acc)",borderRadius:14,background:"var(--accBgSoft)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",fontSize:14,fontWeight:700,color:"var(--acc)"},children:"松开以添加文件"}),c.jsxs("div",{"data-tauri-drag-region":"",style:{height:56,flex:"none",display:"flex",alignItems:"center",gap:12,padding:"0 24px",borderBottom:"1px solid var(--line2)"},children:[c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[c.jsx("span",{className:"ellipsis",style:{fontWeight:700,fontSize:13.5},children:(i==null?void 0:i.title)||"新任务"}),c.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--t5)",minWidth:0},children:[c.jsx(Nr,{size:11,color:"var(--t6)"}),c.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:Vi(be)}),c.jsx("span",{style:{color:"var(--t7)",flex:"none"},children:"·"}),c.jsx("span",{className:"ellipsis",style:{fontFamily:Tt},children:be})]})]}),c.jsx("span",{"data-tauri-drag-region":"",style:{flex:1,alignSelf:"stretch"}}),c.jsxs("button",{className:"hv",title:"浏览工作区文件(标注本轮改动)",onClick:()=>d(),style:{height:28,border:"1px solid var(--line)",display:"flex",alignItems:"center",gap:6,padding:"0 12px",borderRadius:8,background:"var(--card)",fontSize:12,color:"var(--t2)",cursor:"pointer",fontWeight:600,boxShadow:"var(--cardSh)",flex:"none"},children:[c.jsx(Nr,{size:12}),"文件",P>0&&c.jsx("span",{title:"查看本轮改动",onClick:M=>{M.stopPropagation(),d("changes")},style:{minWidth:16,height:16,borderRadius:8,background:"var(--accBg)",color:"var(--acc)",fontSize:10.5,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 4px"},children:P})]}),c.jsxs("div",{style:{position:"relative",flex:"none"},children:[c.jsx("button",{className:"hv icon-btn",title:"更多",onClick:()=>me(ae==="closed"?"open":"closed"),style:{width:28,height:28,borderRadius:8,background:ae!=="closed"?"var(--hov)":"transparent"},children:c.jsx(lp,{size:14,color:"var(--t5)"})}),ae!=="closed"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"backdrop",onClick:()=>me("closed")}),c.jsx("div",{className:"pop",style:{position:"absolute",top:32,right:0,minWidth:118},children:ae==="open"?c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"hv menu-item",onClick:()=>{me("closed"),v()},children:[c.jsx(ap,{}),i!=null&&i.archived?"取消归档":"归档"]}),w.running?c.jsxs("button",{className:"menu-item",style:{cursor:"default",color:"var(--t5)"},title:"运行中,请先停止",children:[c.jsx(tl,{color:"var(--t5)"}),"删除"]}):c.jsxs("button",{className:"hv-errbg menu-item",style:{color:"var(--err)"},onClick:()=>me("confirm"),children:[c.jsx(tl,{}),"删除"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{padding:"6px 9px 4px",fontSize:11.5,color:"var(--t4)",lineHeight:1.6,maxWidth:200,whiteSpace:"normal"},children:["删除后不可恢复。",i!=null&&i.worktree?"隔离工作区及未应用改动将一并删除。":""]}),c.jsxs("div",{style:{display:"flex",gap:4},children:[c.jsx("button",{className:"hv-errbg menu-item",style:{color:"var(--err)",fontWeight:600},onClick:()=>{me("closed"),m()},children:"确认删除"}),c.jsx("button",{className:"hv menu-item",onClick:()=>me("closed"),children:"取消"})]})]})})]})]})]}),Be?c.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,padding:24},children:[c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:52,height:52}}),c.jsxs("div",{style:{fontSize:15,fontWeight:700,textAlign:"center",maxWidth:420},children:["在 ",c.jsx("span",{style:{whiteSpace:"nowrap",fontFamily:Tt,fontSize:13.5},children:be})," 开始新任务"]}),c.jsxs("div",{style:{fontSize:12.5,color:"var(--t5)",textAlign:"center",lineHeight:1.6},children:["描述你想做的事,比如修一个 Bug、加一个功能、",c.jsx("br",{}),"或者让我先看看这个项目。"]})]}):c.jsx("div",{ref:B,onScroll:A,style:{flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,scrollbarGutter:"stable both-edges"},children:c.jsx("div",{style:{maxWidth:Sf,margin:"0 auto",padding:"26px 36px 16px",display:"flex",flexDirection:"column",gap:18},children:c.jsx(dp,{items:w.items,onPermAnswer:s.answerPerm,onOpenChild:p,uploadUrl:s.uploadUrl,workdir:be})})}),c.jsxs("div",{style:{flex:"none",maxWidth:Sf,width:"100%",margin:"0 auto",padding:"0 36px 20px",display:"flex",flexDirection:"column",gap:8},children:[w.running&&c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9},children:[c.jsx("span",{className:"spinner"}),c.jsx("span",{style:{fontWeight:600,fontSize:12.5},children:Ge}),c.jsxs("span",{style:{fontSize:12,color:"var(--t5)"},children:["第 ",Pe," 轮",z?` · 已用 ${fp(z.used)} tokens`:""]}),c.jsx("span",{style:{flex:1}}),c.jsxs("button",{className:"hv-errbg",onClick:s.stop,style:{height:26,border:"1px solid var(--errBd)",background:"transparent",color:"var(--err)",borderRadius:13,padding:"0 12px",fontSize:11.5,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:5},children:[c.jsx(Iv,{}),"停止"]})]}),E&&c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:"var(--panel2)",border:"1px solid var(--cardBd)",borderRadius:10,padding:"7px 12px",fontSize:12},children:[c.jsx(Rv,{}),c.jsx("span",{style:{color:"var(--t3)",flex:"none"},children:"已排队"}),c.jsx("span",{className:"ellipsis",style:{fontWeight:600,flex:1},children:E}),c.jsx("span",{style:{color:"var(--t6)",flex:"none",fontSize:11.5},children:"运行结束后自动发送"}),c.jsx("button",{className:"hv2 icon-btn",title:"取消排队",onClick:s.clearQueued,style:{width:20,height:20,borderRadius:5},children:c.jsx(Ps,{})})]}),c.jsxs("div",{style:{background:"var(--panel)",border:"1px solid var(--inputBd)",borderRadius:12,boxShadow:"var(--panelSh)",display:"flex",flexDirection:"column"},children:[D.length>0&&c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,padding:"10px 12px 0"},children:D.map((M,S)=>c.jsxs("span",{style:{position:"relative",display:"flex"},children:[M.isImage?c.jsx("img",{src:M.preview,alt:M.path,title:M.path,style:{width:52,height:52,objectFit:"cover",borderRadius:8,border:"1px solid var(--cardBd)"}}):c.jsxs("span",{title:M.path,style:{height:30,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--cardBd)",background:"var(--codeBg)",fontSize:12,color:"var(--t2)",maxWidth:220},children:[c.jsx(Nr,{size:12,color:"var(--t4)"}),c.jsx("span",{className:"ellipsis",children:M.name})]}),c.jsx("button",{className:"icon-btn",title:"移除",onClick:()=>s.removeAtt(S),style:{position:"absolute",top:-5,right:-5,width:17,height:17,border:"1px solid var(--line)",borderRadius:"50%",background:"var(--card)",boxShadow:"var(--cardSh)"},children:c.jsx(Ps,{size:8,color:"var(--t3)"})})]},M.path))}),c.jsx("textarea",{ref:U,rows:2,value:y,placeholder:w.running?"补充说明…运行中发送会排队":"输入任务…粘贴或拖入图片/文件可作为附件",onChange:M=>s.setInput(M.target.value),onCompositionEnd:nl,onKeyDown:V,onPaste:j,style:{border:"none",outline:"none",resize:"none",background:"transparent",color:"var(--t1)",padding:"12px 15px 2px",fontSize:13,lineHeight:1.5,maxHeight:160,display:"block",width:"100%"}}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px 10px"},children:[c.jsx(ry,{yolo:T,onToggle:()=>void s.toggleYolo()}),c.jsx("span",{style:{flex:1}}),c.jsx(hp,{models:o,current:u,disabled:w.running,onPick:M=>void s.switchModel(M)}),c.jsx(ny,{usage:z}),c.jsx("button",{className:"hv-acc icon-btn",title:"发送 ↩ · 换行 ⇧↩",onClick:s.send,style:{width:27,height:27,borderRadius:8,background:"var(--acc)",opacity:y.trim()||D.length>0?1:.45},children:c.jsx(cp,{})})]})]})]})]})}function sy({dir:i,recentDirs:s,text:o,models:u,model:d,busy:p,err:v,offerCreate:m,onDirChange:w,onTextChange:y,onModelChange:E,onCreate:D}){const[T,P]=F.useState(!1),[B,U]=F.useState("local"),[G,ae]=F.useState(""),me=A=>{w(A),P(!1)},xe=async()=>{const A=await xg();A&&me(A)},Z=A=>{A.key==="Enter"&&!A.shiftKey&&!rl(A)&&(A.preventDefault(),D())},pe=(A,V)=>({display:"flex",alignItems:"center",gap:5,height:22,padding:"0 10px",borderRadius:11,background:A?"var(--card)":"transparent",boxShadow:A?"var(--segSh)":"none",fontSize:11.5,fontWeight:700,color:A?V:"var(--t5)",cursor:"pointer",userSelect:"none"});return c.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:0,display:"flex",flexDirection:"column"},children:c.jsxs("div",{style:{margin:"0 auto",width:"100%",maxWidth:640,padding:"max(40px,14vh) 36px 32px",display:"flex",flexDirection:"column",gap:14},children:[c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,marginBottom:8},children:[c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:52,height:52}}),c.jsx("div",{style:{fontSize:18,fontWeight:800,letterSpacing:.2,marginTop:6},children:"开始一个新任务"}),c.jsx("div",{style:{fontSize:12,color:"var(--t6)"},children:"告诉我要做什么,剩下的交给我"})]}),c.jsxs("div",{style:{background:"var(--panel)",border:"1px solid var(--line)",borderRadius:16,boxShadow:"var(--panelShLg)",display:"flex",flexDirection:"column",position:"relative"},children:[c.jsx("div",{style:{padding:"8px 8px 0",position:"relative"},children:B==="cloud"?c.jsxs("button",{title:"云端任务基于代码仓库运行",style:{display:"flex",alignItems:"center",gap:7,height:28,padding:"0 9px",border:"none",borderRadius:8,background:"transparent",cursor:"pointer",maxWidth:"100%"},className:"hv",children:[c.jsx(ic,{size:13,color:"var(--t3)"}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"连接代码仓库…"}),c.jsx(sc,{color:"var(--t5)"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"hv",onClick:()=>P(!T),style:{display:"flex",alignItems:"center",gap:7,height:28,padding:"0 9px",border:"none",borderRadius:8,background:T?"var(--hov)":"transparent",cursor:"pointer",maxWidth:"100%"},children:[c.jsx(Nr,{}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)",flex:"none"},children:"在"}),c.jsx("span",{className:"ellipsis",style:{fontSize:12,fontWeight:600,color:"var(--t2)"},children:Vi(i)}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)",flex:"none"},children:"文件夹里工作"}),c.jsx(sc,{color:"var(--t5)",style:{transform:T?"rotate(180deg)":"none",transition:"transform .15s ease"}})]}),T&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"backdrop",onClick:()=>P(!1)}),c.jsxs("div",{className:"pop",style:{position:"absolute",top:34,left:8,borderRadius:10,minWidth:280,maxWidth:380},children:[c.jsx("span",{style:{fontSize:10.5,fontWeight:700,letterSpacing:.4,color:"var(--t6)",padding:"5px 9px 3px"},children:"最近用过的文件夹"}),s.map(A=>c.jsxs("button",{className:"hv menu-item",onClick:()=>me(A),style:{gap:9},children:[c.jsx(Nr,{color:"var(--t5)"}),c.jsxs("span",{style:{flex:1,display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[c.jsx("span",{className:"ellipsis",style:{fontSize:12.5,fontWeight:500,color:"var(--t2)"},children:Vi(A)}),c.jsx("span",{className:"ellipsis",style:{fontSize:10.5,fontFamily:Tt,color:"var(--t6)"},children:A})]}),A===i&&c.jsx(xc,{size:11,color:"var(--acc)",strokeWidth:1.6})]},A)),c.jsx("span",{style:{height:1,background:"var(--line2)",margin:"4px 6px"}}),qi()&&c.jsxs("button",{className:"hv menu-item",onClick:()=>void xe(),style:{gap:9},children:[c.jsx(ll,{size:12,color:"var(--t3)"}),c.jsx("span",{style:{fontSize:12,color:"var(--t3)"},children:"选择其他文件夹…"})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 6px 4px 9px"},children:[c.jsx("input",{value:G,onChange:A=>ae(A.target.value),onCompositionEnd:nl,onKeyDown:A=>{A.key==="Enter"&&!rl(A)&&G.trim()&&me(G.trim())},placeholder:"或输入路径,如 ~/dev/project",style:{flex:1,minWidth:0,border:"1px solid var(--line)",borderRadius:6,padding:"5px 8px",font:"11px "+Tt,color:"var(--t1)",outline:"none",background:"var(--card)"}}),c.jsx("button",{className:"hv2",onClick:()=>G.trim()&&me(G.trim()),style:{border:"none",background:"var(--hov)",borderRadius:6,padding:"5px 10px",fontSize:11.5,color:"var(--t2)",cursor:"pointer",flex:"none"},children:"确定"})]})]})]})]})}),c.jsx("textarea",{value:o,autoFocus:!0,rows:4,onChange:A=>y(A.target.value),onCompositionEnd:nl,onKeyDown:Z,placeholder:"描述要做的事…留空则先建会话",style:{border:"none",outline:"none",resize:"none",background:"transparent",color:"var(--t1)",padding:"9px 17px 4px",fontSize:13.5,lineHeight:1.55,width:"100%"}}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 10px 11px"},children:[c.jsxs("span",{style:{display:"flex",background:"var(--segBg)",borderRadius:13,padding:2,flex:"none"},children:[c.jsxs("span",{onClick:()=>U("local"),title:"跑在这台电脑上,直接读写本地文件,每步权限逐一确认",style:pe(B==="local","var(--acc)"),children:[c.jsx(op,{size:11,color:B==="local"?"var(--acc)":"var(--t5)",strokeWidth:1.4}),"本地"]}),c.jsxs("span",{onClick:()=>U("cloud"),title:"跑在云上服务器,关掉客户端也继续",style:pe(B==="cloud","var(--warn)"),children:[c.jsx(ic,{size:11,color:B==="cloud"?"var(--warn)":"var(--t5)"}),"云端"]})]}),c.jsx(hp,{models:u,current:d,onPick:E}),c.jsx("span",{style:{flex:1}}),c.jsxs("button",{className:"hv-acc",onClick:()=>D(),style:{height:30,border:"none",borderRadius:9,background:"var(--acc)",color:"var(--onAcc)",fontSize:12.5,fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:6,padding:"0 15px",flex:"none",boxShadow:"var(--accSh)",opacity:p?.6:1},children:[p?"创建中…":"开始任务",c.jsx(cp,{size:11})]})]}),B==="cloud"&&c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,margin:"0 10px 10px",padding:"8px 11px",borderRadius:9,background:"var(--warnBg)",border:"1px solid var(--warnBd2)"},children:[c.jsx(Ov,{color:"var(--warn)"}),c.jsx("span",{style:{fontSize:12,color:"var(--warnT)",lineHeight:1.5},children:"云端运行还在准备中,预计下个版本上线。这个任务会先在本地跑,之后可以随时切换。"})]})]}),v&&c.jsxs("div",{style:{fontSize:12,color:"var(--err)",lineHeight:1.6},children:[v,m&&c.jsx("span",{className:"hv-t1",onClick:()=>D(!0),style:{cursor:"pointer",color:"var(--warn)",marginLeft:8},children:"创建该目录并继续 →"})]})]})})}function gp(i){var u;const s=new Map;for(const d of i){const p=((u=d.worktree)==null?void 0:u.repo)||d.workdir,v=s.get(p);v?v.push(d):s.set(p,[d])}const o=[...s.entries()].map(([d,p])=>{var v;return p.sort((m,w)=>(w.updated_at??"").localeCompare(m.updated_at??"")),{dir:d,name:d.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||d,latest:((v=p[0])==null?void 0:v.updated_at)??"",items:p}});return o.sort((d,p)=>p.latest.localeCompare(d.latest)),o}const Ef={display:"flex",alignItems:"center",gap:5,fontSize:11,fontWeight:700,color:"var(--t4)",padding:"6px 6px 4px",letterSpacing:.4};function oy(i){switch(i.status){case"running":return{text:"运行中",color:"var(--acc)"};case"error":return{text:"出错",color:"var(--err)"};case"interrupted":return{text:"已中断",color:"inherit"};default:return{text:i.turns>0?i.turns+" 轮":"",color:"inherit"}}}function ly({meta:i,active:s,archived:o,onClick:u,onArchive:d,onDelete:p,onRename:v}){const[m,w]=F.useState(!1),[y,E]=F.useState("closed"),[D,T]=F.useState(!1),[P,B]=F.useState(""),U=()=>{T(!1);const j=P.trim();j&&j!==(i.title||"")&&v(j)},[G,ae]=F.useState({left:0}),me=i.status==="running",xe=m||y!=="closed",Z=oy(i),pe=s?o?"var(--hov3)":"var(--accSel)":"transparent",A=s&&!o?"var(--onAcc)":"var(--t2)",V=()=>E("closed");return c.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[c.jsxs("div",{className:s?void 0:"hv",title:i.workdir,onClick:u,style:{height:28,display:"flex",alignItems:"center",gap:2,padding:"0 5px 0 23px",borderRadius:6,cursor:"pointer",fontSize:12.5,background:pe,color:A,fontWeight:s?500:400,whiteSpace:"nowrap",minWidth:0},children:[D?c.jsx("input",{autoFocus:!0,value:P,onChange:j=>B(j.target.value),onClick:j=>j.stopPropagation(),onCompositionEnd:nl,onBlur:U,onKeyDown:j=>{j.stopPropagation(),j.key==="Enter"&&!rl(j)?U():j.key==="Escape"&&T(!1)},style:{flex:1,minWidth:0,border:"1px solid var(--accBd)",borderRadius:5,padding:"2px 6px",fontSize:12.5,background:"var(--card)",color:"var(--t1)",outline:"none"}}):c.jsx("span",{className:"ellipsis",style:{flex:1},children:i.title||"新任务"}),i.worktree&&!xe&&c.jsx("span",{title:"隔离 worktree 会话",style:{flex:"none",fontSize:10,fontWeight:600,color:s?"var(--onAccDim)":"var(--acc)",background:s?"var(--onAccBg)":"var(--accBg)",borderRadius:5,padding:"1px 6px",marginRight:3},children:"隔离"}),xe?c.jsx("button",{title:"更多操作",onClick:j=>{if(j.stopPropagation(),y!=="closed")return V();const H=j.currentTarget.getBoundingClientRect(),ee=H.bottom+160>window.innerHeight;ae({left:Math.min(H.left,window.innerWidth-170),...ee?{bottom:window.innerHeight-H.top+4}:{top:H.bottom+4}}),E("open")},className:"hv3 icon-btn",style:{width:20,height:20,borderRadius:5,background:y!=="closed"?"var(--hov3)":"transparent"},children:c.jsx(lp,{color:s&&!o?"var(--onAccDim)":"var(--t3)"})}):c.jsx("span",{style:{fontSize:11,opacity:.7,flex:"none",fontWeight:400,paddingRight:3,color:Z.color==="inherit"?void 0:Z.color},children:Z.text})]}),y!=="closed"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"backdrop",onClick:j=>{j.stopPropagation(),V()}}),c.jsx("div",{className:"pop",style:{position:"fixed",left:G.left,top:G.top,bottom:G.bottom,minWidth:118},onClick:j=>j.stopPropagation(),children:y==="open"?c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"hv menu-item",onClick:()=>{V(),B(i.title||""),T(!0)},children:[c.jsx(Tv,{}),"重命名"]}),c.jsxs("button",{className:"hv menu-item",onClick:()=>{V(),d()},children:[c.jsx(ap,{}),i.archived?"取消归档":"归档"]}),me?c.jsxs("button",{className:"menu-item",style:{cursor:"default",color:"var(--t5)"},title:"运行中,请先停止",children:[c.jsx(tl,{color:"var(--t5)"}),"删除"]}):c.jsxs("button",{className:"hv-errbg menu-item",style:{color:"var(--err)"},onClick:()=>E("confirm"),children:[c.jsx(tl,{}),"删除"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{padding:"6px 9px 4px",fontSize:11.5,color:"var(--t4)",lineHeight:1.6,maxWidth:200,whiteSpace:"normal"},children:["删除后不可恢复。",i.worktree?"隔离工作区及未应用改动将一并删除。":""]}),c.jsxs("div",{style:{display:"flex",gap:4},children:[c.jsx("button",{className:"hv-errbg menu-item",style:{color:"var(--err)",fontWeight:600},onClick:()=>{V(),p()},children:"确认删除"}),c.jsx("button",{className:"hv menu-item",onClick:V,children:"取消"})]})]})})]})]})}function kf({name:i,nameColor:s,expanded:o,onToggle:u,onNewTask:d,children:p}){const[v,m]=F.useState(!1);return c.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[c.jsxs("div",{className:"hv",onClick:u,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 4px 0 8px",borderRadius:6,cursor:"pointer",userSelect:"none",fontWeight:600,fontSize:12.5},children:[c.jsx("span",{style:{width:12,height:12,flex:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(yc,{style:{transform:o?"rotate(90deg)":"none",transition:"transform .15s ease"}})}),c.jsx("span",{className:"ellipsis",style:{flex:1,color:s??"var(--t1)"},children:i}),d&&v&&c.jsx("button",{className:"hv3 icon-btn",title:"在此文件夹新建任务",onClick:w=>{w.stopPropagation(),d()},style:{width:20,height:20,borderRadius:5},children:c.jsx(ll,{size:10,color:"var(--t3)"})})]}),o&&c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,paddingBottom:3},children:p})]})}function ay({sessions:i,currentId:s,sessionActive:o,connected:u,status:d,settingsActive:p,updateAvailable:v,onSelect:m,onNewTask:w,onOpenSettings:y,onArchive:E,onDelete:D,onRename:T}){const[P,B]=F.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("mc.collapsedGroups")||"[]"))}catch{return new Set}}),[U,G]=F.useState(()=>localStorage.getItem("mc.archivedOpen")==="1"),ae=A=>{B(V=>{const j=new Set(V);return j.has(A)?j.delete(A):j.add(A),localStorage.setItem("mc.collapsedGroups",JSON.stringify([...j])),j})},me=()=>{G(A=>(localStorage.setItem("mc.archivedOpen",A?"0":"1"),!A))},xe=i.filter(A=>!A.archived),Z=i.filter(A=>A.archived).sort((A,V)=>(V.updated_at??"").localeCompare(A.updated_at??"")),pe=(A,V)=>c.jsx(ly,{meta:A,active:A.id===s&&o,archived:V,onClick:()=>m(A),onArchive:()=>E(A),onDelete:()=>D(A),onRename:j=>T(A,j)},A.id);return c.jsxs("div",{style:{width:256,flex:"none",background:"var(--side)",borderRight:"1px solid var(--line)",display:"flex",flexDirection:"column",minHeight:0},children:[Eg()?c.jsx("div",{"data-tauri-drag-region":"",style:{height:50,flex:"none"}}):c.jsx("div",{style:{height:12,flex:"none"}}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,padding:"2px 16px 14px"},children:[c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:30,height:30,borderRadius:8,flex:"none"}}),c.jsx("span",{style:{fontWeight:700,fontSize:14},children:"MonkeyCode"}),c.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:.5,color:"var(--acc)",background:"var(--accBg)",borderRadius:5,padding:"1.5px 6px",flex:"none"},children:"Work"})]}),c.jsxs("div",{style:{flex:1,overflowY:"auto",minHeight:0,padding:"0 12px 8px",display:"flex",flexDirection:"column",gap:2},children:[c.jsxs("div",{style:{...Ef,marginTop:-1},children:[c.jsx(ic,{style:{marginTop:-1}}),"云端任务"]}),c.jsx("div",{style:{borderRadius:8,border:"1px dashed var(--dashBd)",padding:"9px 11px",fontSize:11.5,color:"var(--t4)",lineHeight:1.55,marginBottom:8},children:"还没有云端任务。长任务可派发到服务器,关掉客户端也会继续。"}),c.jsxs("div",{style:Ef,children:[c.jsx(op,{style:{marginTop:-1}}),c.jsx("span",{style:{flex:1},children:"本地会话"}),c.jsx("button",{className:"hv2 icon-btn",title:"新建任务",onClick:()=>w(),style:{width:20,height:20,borderRadius:5},children:c.jsx(ll,{color:"var(--t4)"})})]}),i.length===0&&c.jsx("div",{style:{borderRadius:8,border:"1px dashed var(--dashBd)",padding:"9px 11px",fontSize:11.5,color:"var(--t4)",lineHeight:1.55},children:"还没有会话。点上方 + 开始第一个任务。"}),gp(xe).map(A=>c.jsx(kf,{name:A.name,expanded:!P.has(A.dir),onToggle:()=>ae(A.dir),onNewTask:()=>w(A.dir),children:A.items.map(V=>pe(V,!1))},A.dir)),Z.length>0&&c.jsx(kf,{name:"已归档",nameColor:"var(--t5)",expanded:U,onToggle:me,children:Z.map(A=>pe(A,!0))})]}),c.jsxs("div",{style:{height:44,flex:"none",display:"flex",alignItems:"center",gap:7,padding:"0 14px",borderTop:"1px solid var(--line)"},children:[c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:u?"var(--ok)":"var(--t6)",flex:"none"}}),c.jsx("span",{title:d,className:"ellipsis",style:{fontSize:12,color:"var(--t3)",flex:1},children:d}),c.jsxs("button",{className:"hv2 icon-btn",title:"设置",onClick:y,style:{position:"relative",width:26,height:26,borderRadius:7,background:p?"var(--accBg2)":"transparent"},children:[v&&c.jsx("span",{style:{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:"50%",background:"var(--notice)",border:"1.5px solid var(--side)"}}),c.jsx(Nv,{})]})]})]})}function bf(i){const s={};let o=0;for(const u of i.split(` +`)){const d=u.indexOf("=");if(d<=0)continue;const p=u.slice(0,d).trim();p&&(s[p]=u.slice(d+1).trim(),o++)}return o?s:void 0}const cy=i=>i&&typeof i=="object"?Object.entries(i).map(([s,o])=>`${s}=${String(o)}`).join(` +`):"";function uy(i){const s={};for(const o of i){const u=o.name.trim();if(u)if(o.type==="stdio"){if(!o.command.trim())continue;const d=o.args.trim()?o.args.trim().split(/\s+/):void 0;s[u]={command:o.command.trim(),args:d,env:bf(o.kv)}}else{if(!o.url.trim())continue;s[u]={url:o.url.trim(),headers:bf(o.kv)}}}return s}function _f(i){return Object.entries(i).map(([s,o])=>{const u=o??{},d=typeof u.command=="string"&&u.command!=="";return{name:s,type:d?"stdio":"http",url:typeof u.url=="string"?u.url:"",command:typeof u.command=="string"?u.command:"",args:Array.isArray(u.args)?u.args.map(String).join(" "):"",kv:cy(d?u.env:u.headers)}})}const dy={fontSize:11,fontWeight:700,letterSpacing:.5,color:"var(--t4)"},Hn={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 10px",fontSize:12,fontFamily:Tt,outline:"none",minWidth:0},Tf={width:"100%",height:30,border:"1px solid var(--inputBd)",borderRadius:7,background:"var(--inputBg)",color:"var(--t1)",padding:"0 6px",fontSize:12,outline:"none",cursor:"pointer"},Vr={height:28,border:"1px solid var(--btnBd)",background:"var(--card)",color:"var(--t1)",borderRadius:8,padding:"0 13px",fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:5,boxShadow:"var(--cardSh)",whiteSpace:"nowrap"};function wn({label:i,children:s}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0},children:[c.jsx("span",{style:{fontSize:11.5,color:"var(--t3)",fontWeight:600},children:i}),s]})}function Os({label:i,action:s,children:o}){return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:9},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx("span",{style:dy,children:i}),c.jsx("span",{style:{flex:1}}),s]}),o]})}function fy({version:i,update:s,onUpdateStatus:o}){const[u,d]=F.useState("idle"),[p,v]=F.useState(null),m=!!(s!=null&&s.available),w=async()=>{d("checking"),v(null);try{const P=await If();o(P),P.available||v({text:"已是最新版本",color:"var(--ok)"})}catch(P){v({text:P instanceof Error?P.message:String(P),color:"var(--err)"})}finally{d("idle")}},y=async()=>{d("installing"),v(null);try{await Ag()}catch(P){v({text:P instanceof Error?P.message:String(P),color:"var(--err)"}),d("idle")}},E=u!=="idle",D=u==="checking"?"检查中":u==="installing"?"更新中":m?"下载更新":"检查更新",T=m&&u!=="checking";return c.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:12},children:[c.jsx("div",{style:{width:34,height:34,borderRadius:9,background:"var(--accBg)",display:"flex",alignItems:"center",justifyContent:"center",flex:"none"},children:c.jsx("img",{src:al,alt:"",draggable:!1,style:{width:22,height:22,borderRadius:5}})}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[c.jsx("span",{style:{fontWeight:700,fontSize:13},children:"MonkeyCode"}),c.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Tt},children:m?`${(s==null?void 0:s.current)??i} → ${s==null?void 0:s.latest} 可用`:i})]}),c.jsx("span",{style:{flex:1}}),p&&c.jsx("span",{style:{fontSize:12,color:p.color,flex:"none"},children:p.text}),c.jsxs("button",{className:T?"hv-acc":"hv",onClick:()=>!E&&void(T?y():w()),style:{...Vr,gap:6,flex:"none",...T?{background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"}:{},opacity:E?.7:1,cursor:E?"default":"pointer"},children:[E&&c.jsx("span",{style:{width:11,height:11,border:`1.5px solid ${T?"var(--onAcc)":"var(--t1)"}`,borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),D]})]})}const Nf=i=>/^1[3-9]\d{9}$/.test(i.trim());function py(i){for(const s of["name","nickname","username","phone","email"]){const o=i==null?void 0:i[s];if(typeof o=="string"&&o.trim())return o.trim()}return"已登录"}function hy({onSynced:i,knownKeys:s,existingNames:o}){const[u,d]=F.useState(null),[p,v]=F.useState(""),[m,w]=F.useState("wechat"),[y,E]=F.useState(""),[D,T]=F.useState(""),[P,B]=F.useState(!1),[U,G]=F.useState(!1),[ae,me]=F.useState(0),[xe,Z]=F.useState(""),[pe,A]=F.useState(""),[V,j]=F.useState("loading"),[H,ee]=F.useState(!1),[Me,be]=F.useState(null),[Be,qe]=F.useState(null),[$e,Ge]=F.useState({}),[Pe,z]=F.useState(!0),re=F.useRef(!0),M=F.useRef(0);F.useEffect(()=>(re.current=!0,Wo().then(se=>re.current&&d(se)).catch(se=>re.current&&v(se instanceof Error?se.message:String(se))),()=>{re.current=!1,M.current++}),[]);const S=async()=>{const se=++M.current,_e=()=>re.current&&se===M.current;Z(""),A(""),j("loading");try{const ze=await mg();if(!_e())return;for(A(ze.qr),j("waiting");;){const De=await vg();if(!_e())return;if(De.status==="waiting"||De.status==="scanned"){j(De.status);continue}if(De.status==="ok"){const yt=await Wo();_e()&&d(yt);return}j(De.status);return}}catch(ze){if(!_e())return;j("error"),Z(ze instanceof Error?ze.message:String(ze))}},N=!!(u!=null&&u.logged_in);F.useEffect(()=>{if(!(!u||N||m!=="wechat"))return S(),()=>{M.current++}},[u,N,m]),F.useEffect(()=>{if(ae<=0)return;const se=setTimeout(()=>me(_e=>Math.max(0,_e-1)),1e3);return()=>clearTimeout(se)},[ae]);const W=async()=>{if(Z(""),!Nf(y)){Z("请输入有效的手机号");return}G(!0);try{await pg(y.trim()),me(60)}catch(se){Z(se instanceof Error?se.message:String(se))}finally{G(!1)}},le=async()=>{if(Z(""),!Nf(y)){Z("请输入有效的手机号");return}if(!/^\d{4,6}$/.test(D.trim())){Z("请输入短信验证码");return}B(!0);try{await hg(y.trim(),D.trim());const se=await Wo();re.current&&(d(se),T(""))}catch(se){re.current&&Z(se instanceof Error?se.message:String(se))}finally{re.current&&B(!1)}},Le=async()=>{Z("");try{await gg();const se=await Wo();re.current&&d(se)}catch(se){re.current&&Z(se instanceof Error?se.message:String(se))}},Ae=async()=>{var se;be(null),qe(null),ee(!0);try{const _e=await yg(s());if(!re.current)return;if(!_e.models.length&&!Object.keys(_e.mcp_servers??{}).length){be({text:"没有拉取到可用的模型"+((se=_e.notes)!=null&&se.length?`(${_e.notes.join(";")})`:""),color:"var(--err)"});return}const ze=new Set(o()),De={};for(const yt of _e.models)De[yt.name]=ze.has(yt.name);Ge(De),z(!0),qe(_e)}catch(_e){re.current&&be({text:_e instanceof Error?_e.message:String(_e),color:"var(--err)"})}finally{re.current&&ee(!1)}},We=()=>{if(!Be)return;const se=Be.models.filter(De=>$e[De.name]),_e=Pe?Be.mcp_servers:{};i({...Be,models:se,mcp_servers:_e});const ze=[`已填入 ${se.length} 个模型`];Object.keys(_e??{}).length&&ze.push("MCP 条目"),Be.key_created&&ze.push(`已在网关新建密钥「${Be.key_name||"MonkeyCode"}」`),ze.push("请核对下方配置后点保存"),be({text:ze.join("、"),color:"var(--ok)"}),qe(null)};if(p)return c.jsxs("div",{className:"card card-lg",style:{color:"var(--err)",fontSize:12.5},children:["百智云状态读取失败: ",p]});if(!u)return c.jsx("div",{className:"card card-lg",style:{color:"var(--t5)",fontSize:12.5},children:"读取登录状态中…"});if(u.logged_in)return c.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[c.jsx("span",{className:"ellipsis",style:{fontWeight:700,fontSize:13},children:py(u.profile)}),c.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Tt},children:u.host})]}),c.jsx("span",{style:{flex:1}}),xe&&c.jsx("span",{style:{fontSize:12,color:"var(--err)",flex:"none"},children:xe}),c.jsxs("button",{className:"hv-acc",onClick:()=>!H&&void Ae(),style:{...Vr,flex:"none",gap:6,background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)",opacity:H?.7:1,cursor:H?"default":"pointer"},children:[H&&c.jsx("span",{style:{width:11,height:11,border:"1.5px solid var(--onAcc)",borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),H?"同步中…":"同步模型与 MCP"]}),c.jsx("button",{className:"hv",onClick:()=>void Le(),style:{...Vr,flex:"none"},children:"退出登录"})]}),Me&&c.jsx("span",{style:{fontSize:12,color:Me.color,lineHeight:1.6},children:Me.text}),Be&&(()=>{var yt;const se=Be.models.filter(fe=>$e[fe.name]).length,_e=Object.keys(Be.mcp_servers??{}).length,ze=fe=>{const zt={};for(const Ke of Be.models)zt[Ke.name]=fe;Ge(zt)},De={background:"none",border:"none",padding:"2px 4px",fontSize:12,color:"var(--acc)",cursor:"pointer",flex:"none"};return c.jsxs("div",{style:{border:"1px solid var(--line)",borderRadius:8,overflow:"hidden"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:"1px solid var(--line)"},children:[c.jsx("span",{style:{fontWeight:700,fontSize:12.5},children:"选择要导入的模型"}),c.jsxs("span",{style:{fontSize:12,color:"var(--t5)"},children:[se,"/",Be.models.length]}),c.jsx("span",{style:{flex:1}}),c.jsx("button",{className:"hv",style:De,onClick:()=>ze(!0),children:"全选"}),c.jsx("button",{className:"hv",style:De,onClick:()=>ze(!1),children:"清空"})]}),c.jsx("div",{style:{maxHeight:240,overflowY:"auto"},children:Be.models.map(fe=>c.jsxs("label",{className:"hv",style:{display:"flex",alignItems:"center",gap:8,padding:"5px 12px",cursor:"pointer"},children:[c.jsx("input",{type:"checkbox",checked:!!$e[fe.name],onChange:zt=>Ge(Ke=>({...Ke,[fe.name]:zt.target.checked})),style:{flex:"none",accentColor:"var(--acc)"}}),c.jsx("span",{className:"ellipsis",style:{fontSize:12.5,fontFamily:Tt},children:fe.name}),c.jsx("span",{style:{marginLeft:"auto",flex:"none",fontSize:11,color:"var(--t5)"},children:fe.provider})]},fe.name))}),_e>0&&c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderTop:"1px solid var(--line)",cursor:"pointer"},children:[c.jsx("input",{type:"checkbox",checked:Pe,onChange:fe=>z(fe.target.checked),style:{flex:"none",accentColor:"var(--acc)"}}),c.jsxs("span",{style:{fontSize:12.5},children:["同时导入 MCP 条目(",Object.keys(Be.mcp_servers).join("、"),")"]})]}),!!((yt=Be.notes)!=null&&yt.length)&&c.jsx("div",{style:{padding:"6px 12px",borderTop:"1px solid var(--line)",fontSize:11.5,color:"var(--t5)",lineHeight:1.6},children:Be.notes.join(";")}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderTop:"1px solid var(--line)"},children:[c.jsx("button",{className:"hv-acc",onClick:We,disabled:se===0&&!(Pe&&_e>0),style:{...Vr,flex:"none",background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)",opacity:se===0&&!(Pe&&_e>0)?.5:1},children:"导入所选"}),c.jsx("button",{className:"hv",onClick:()=>qe(null),style:{...Vr,flex:"none"},children:"取消"})]})]})})(),c.jsx("span",{style:{fontSize:11.5,color:"var(--t5)",lineHeight:1.6},children:"同步从模型网关拉取模型清单;推理密钥优先复用现有条目,必要时自动新建并启用「MonkeyCode」密钥。"})]});if(m==="wechat"){const se={loading:"二维码加载中…",waiting:"用微信扫一扫登录",scanned:"已扫码,请在手机上确认",expired:"二维码已过期",canceled:"已在手机上取消",error:"二维码获取失败"},_e=V==="expired"||V==="canceled"||V==="error";return c.jsxs("div",{className:"card card-lg",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,padding:"18px 16px"},children:[c.jsx("span",{style:{fontSize:12.5,color:"var(--t3)"},children:"登录百智云账号后,可同步账号下的模型与 MCP 配置。"}),c.jsxs("div",{style:{position:"relative",width:168,height:168,borderRadius:10,border:"1px solid var(--inputBd)",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:[pe&&c.jsx("img",{src:pe,alt:"微信扫码登录",draggable:!1,style:{width:"100%",height:"100%",objectFit:"contain",filter:_e?"blur(3px) opacity(.35)":"none"}}),!pe&&!_e&&c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"加载中…"}),_e&&c.jsx("button",{className:"hv",onClick:()=>void S(),style:{...Vr,position:"absolute",flex:"none"},children:"重新获取二维码"})]}),c.jsx("span",{style:{fontSize:12,color:V==="scanned"?"var(--ok)":"var(--t4)",fontWeight:600},children:se[V]}),xe&&c.jsx("span",{style:{fontSize:12,color:"var(--err)"},children:xe}),c.jsx("span",{className:"hv-t1",onClick:()=>{Z(""),w("phone")},style:{fontSize:12,color:"var(--t5)",cursor:"pointer",userSelect:"none"},children:"使用手机验证码登录"})]})}return c.jsxs("div",{className:"card card-lg",style:{display:"flex",flexDirection:"column",gap:12},children:[c.jsx("span",{style:{fontSize:12.5,color:"var(--t3)",lineHeight:1.6},children:"登录百智云账号后,可一键同步个人空间的模型与 MCP 配置。"}),c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[c.jsx(wn,{label:"手机号",children:c.jsx("input",{style:Hn,value:y,placeholder:"13800000000",inputMode:"numeric",maxLength:11,onChange:se=>E(se.target.value.replace(/\D/g,"").slice(0,11)),className:"hv-bd"})}),c.jsx(wn,{label:"短信验证码",children:c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("input",{style:{...Hn,flex:1},value:D,placeholder:"6 位数字",inputMode:"numeric",maxLength:6,onChange:se=>T(se.target.value.replace(/\D/g,"").slice(0,6)),onKeyDown:se=>se.key==="Enter"&&!P&&void le(),className:"hv-bd"}),c.jsx("button",{className:"hv",onClick:()=>!U&&ae<=0&&void W(),style:{...Vr,height:30,flex:"none",opacity:U||ae>0?.6:1,cursor:U||ae>0?"default":"pointer"},children:U?"发送中…":ae>0?`${ae}s`:"获取验证码"})]})})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[c.jsx("button",{className:"hv-acc",onClick:()=>!P&&void le(),style:{height:30,border:"none",borderRadius:8,background:"var(--acc)",color:"var(--onAcc)",fontWeight:700,fontSize:12.5,padding:"0 18px",cursor:P?"default":"pointer",opacity:P?.6:1},children:P?"登录中…":"登录"}),xe&&c.jsx("span",{style:{fontSize:12,color:"var(--err)"},children:xe}),c.jsx("span",{style:{flex:1}}),c.jsx("span",{className:"hv-t1",onClick:()=>{Z(""),w("wechat")},style:{fontSize:12,color:"var(--t5)",cursor:"pointer",userSelect:"none"},children:"使用微信扫码登录"})]})]})}const Qa=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),gy=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function my({onClose:i,hostVersion:s,update:o,onUpdateStatus:u}){const d=qi(),[p,v]=F.useState([]),[m,w]=F.useState(0),[y,E]=F.useState({}),[D,T]=F.useState([]),[P,B]=F.useState(!1),[U,G]=F.useState(""),[ae,me]=F.useState(!1);F.useEffect(()=>{d&&wg().then(j=>{const H=(j==null?void 0:j.models)??[];v(H.length?H:[Qa()]),w(Math.max(0,H.findIndex(ee=>ee.default))),T(_f((j==null?void 0:j.mcp_servers)??{})),B(!0)}).catch(j=>G("读取配置失败: "+(j instanceof Error?j.message:String(j))))},[d]);const xe=(j,H)=>v(ee=>ee.map((Me,be)=>be===j?{...Me,...H}:Me)),Z=(j,H)=>T(ee=>ee.map((Me,be)=>be===j?{...Me,...H}:Me)),pe=j=>{v(H=>{const ee=new Map(H.filter(be=>be.name.trim()).map(be=>[be.name.trim(),be]));for(const be of j.models)ee.set(be.name,{name:be.name,provider:be.provider,base_url:be.base_url,api_key:be.api_key,model:be.model,context_window:be.context_window,vision:be.vision});const Me=[...ee.values()];return Me.length?Me:[Qa()]}),T(H=>{const ee=new Map(H.filter(Me=>Me.name.trim()).map(Me=>[Me.name.trim(),Me]));for(const Me of _f(j.mcp_servers))ee.set(Me.name.trim(),Me);return[...ee.values()]})},A=async()=>{for(const H of p)if(!H.name.trim()||!H.base_url.trim()||!H.api_key.trim()||!H.model.trim()){G(`模型「${H.name.trim()||"未命名"}」信息不完整(需名称/接口地址/API Key/模型标识)`);return}const j=new Set;for(const H of p){if(j.has(H.name.trim())){G(`模型名称重复: ${H.name.trim()}`);return}j.add(H.name.trim())}G(""),me(!0);try{await Sg({models:p.map((H,ee)=>({...H,name:H.name.trim(),default:ee===m})),mcp_servers:uy(D)})}catch(H){G(H instanceof Error?H.message:String(H)),me(!1)}},V=(j,H)=>c.jsxs("button",{className:"hv-accbg",onClick:H,style:{height:26,border:"1px solid var(--accBd2)",background:"transparent",color:"var(--acc)",borderRadius:8,padding:"0 11px",fontSize:11.5,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:5},children:[c.jsx(ll,{size:10,color:"var(--acc)"}),j]});return c.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:0,animation:"mcin .25s ease"},children:c.jsxs("div",{style:{maxWidth:640,margin:"0 auto",padding:"28px 36px 48px",display:"flex",flexDirection:"column",gap:24},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx("span",{style:{fontSize:20,fontWeight:800},children:"设置"}),c.jsx("span",{style:{flex:1}}),c.jsxs("button",{className:"hv",onClick:i,style:Vr,children:[c.jsx(Mv,{}),"返回"]})]}),c.jsx(Os,{label:"外观",children:c.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:14},children:[c.jsxs("div",{style:{display:"flex",background:"var(--segBg)",borderRadius:8,padding:3,gap:2},children:[c.jsx("button",{style:{border:"none",borderRadius:6,height:26,padding:"0 15px",fontSize:12,fontWeight:600,cursor:"pointer",background:"var(--card)",color:"var(--t1)",boxShadow:"var(--segSh)"},children:"浅色"}),c.jsx("button",{title:"深色模式即将支持",style:{border:"none",borderRadius:6,height:26,padding:"0 15px",fontSize:12,fontWeight:600,cursor:"not-allowed",background:"transparent",color:"var(--tDis)"},children:"深色"})]}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"深色模式即将支持。"})]})}),d&&c.jsx(Os,{label:"关于",children:c.jsx(fy,{version:s??"—",update:o,onUpdateStatus:u})}),c.jsx(Os,{label:"百智云账号",children:c.jsx(hy,{onSynced:pe,knownKeys:()=>p.map(j=>j.api_key.trim()).filter(j=>j.startsWith("sk-")),existingNames:()=>p.map(j=>j.name.trim()).filter(Boolean)})}),!d&&c.jsx("div",{className:"card card-lg",style:{color:"var(--t4)",fontSize:12.5,lineHeight:1.7},children:"浏览器模式下配置只读:模型与 MCP 由启动 mc-agent 的宿主(桌面应用或环境变量)管理。"}),d&&!P&&!U&&c.jsx("div",{style:{fontSize:12.5,color:"var(--t5)"},children:"读取配置中…"}),d&&P&&c.jsxs(c.Fragment,{children:[c.jsxs(Os,{label:"模型",action:V("添加模型",()=>v(j=>[...j,Qa()])),children:[p.length===0&&c.jsx("div",{className:"card card-lg",style:{color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"还没有模型。保存后应用可运行,但需要添加模型才能开始任务。"}),p.map((j,H)=>c.jsxs("div",{className:"card card-lg",style:{display:"flex",flexDirection:"column",gap:12},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 240px",gap:12},children:[c.jsx(wn,{label:"名称",children:c.jsx("input",{style:Hn,value:j.name,placeholder:"如: 主力模型",onChange:ee=>xe(H,{name:ee.target.value}),className:"hv-bd"})}),c.jsx(wn,{label:"协议",children:c.jsxs("select",{style:Tf,value:j.provider||"anthropic",onChange:ee=>xe(H,{provider:ee.target.value}),children:[c.jsx("option",{value:"anthropic",children:"anthropic"}),c.jsx("option",{value:"openai",children:"openai(Chat Completions)"}),c.jsx("option",{value:"openai_responses",children:"openai_responses(Responses)"})]})})]}),c.jsx(wn,{label:"接口地址",children:c.jsx("input",{style:Hn,value:j.base_url,placeholder:"https://api.example.com",onChange:ee=>xe(H,{base_url:ee.target.value}),className:"hv-bd"})}),c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[c.jsx(wn,{label:"API Key",children:c.jsx("input",{style:Hn,type:"password",value:j.api_key,placeholder:"sk-...",onChange:ee=>xe(H,{api_key:ee.target.value}),className:"hv-bd"})}),c.jsx(wn,{label:"模型标识",children:c.jsx("input",{style:Hn,value:j.model,placeholder:"请求中的 model 字段",onChange:ee=>xe(H,{model:ee.target.value}),className:"hv-bd"})})]}),y[H]&&c.jsxs(c.Fragment,{children:[c.jsx(wn,{label:"上下文窗口(token)",children:c.jsx("input",{style:Hn,type:"number",min:1,value:j.context_window??"",placeholder:"200000(默认)",onChange:ee=>{const Me=parseInt(ee.target.value,10);xe(H,{context_window:Number.isFinite(Me)&&Me>0?Me:void 0})},className:"hv-bd"})}),c.jsxs("label",{title:"跳过 HTTPS 证书校验,连接可被窃听或篡改。仅用于自签名证书的内网网关;公网接口在老系统(如 Win7)验不过时内核会自动用内置根证书兜底,无需开启",style:{display:"flex",alignItems:"center",gap:5,color:"var(--t3)",cursor:"pointer",fontSize:12,userSelect:"none"},children:[c.jsx("input",{type:"checkbox",checked:!!j.skip_tls_verify,onChange:ee=>xe(H,{skip_tls_verify:ee.target.checked||void 0}),style:{accentColor:"var(--err)",margin:0}}),"跳过 TLS 证书校验",j.skip_tls_verify&&c.jsx("span",{style:{color:"var(--err)",fontWeight:600},children:"(不安全,仅限内网自签名网关)"})]})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,paddingTop:2,fontSize:12},children:[c.jsxs("span",{className:"hv-t1",onClick:()=>E(ee=>({...ee,[H]:!ee[H]})),style:{display:"flex",alignItems:"center",gap:4,color:"var(--t5)",cursor:"pointer",userSelect:"none"},children:[c.jsx("span",{style:{display:"inline-block",transform:y[H]?"rotate(90deg)":"none",transition:"transform .15s ease",fontSize:9},children:"▸"}),"高级选项",!y[H]&&j.context_window?`(上下文窗口 ${j.context_window.toLocaleString()})`:""]}),c.jsxs("label",{title:"模型支持图片输入(视觉)。未勾选时对话里的图片以文件路径提供,模型不会收到图片内容",style:{display:"flex",alignItems:"center",gap:5,color:"var(--t3)",cursor:"pointer",fontWeight:600,userSelect:"none"},children:[c.jsx("input",{type:"checkbox",checked:!!j.vision,onChange:ee=>xe(H,{vision:ee.target.checked}),style:{accentColor:"var(--acc)",margin:0}}),"支持图片"]}),H===m?c.jsx("span",{style:{display:"flex",alignItems:"center",gap:5,fontWeight:700,color:"var(--acc)"},children:"✓ 默认模型"}):c.jsx("span",{className:"hv-t1",onClick:()=>w(H),style:{color:"var(--t3)",cursor:"pointer",fontWeight:600},children:"设为默认"}),c.jsx("span",{style:{flex:1}}),c.jsx("span",{className:"hv-err",style:{color:"var(--t5)",cursor:"pointer"},onClick:()=>{v(ee=>ee.filter((Me,be)=>be!==H)),w(ee=>HT(j=>[...j,gy()])),children:[D.length===0&&c.jsx("div",{className:"card card-lg",style:{color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"未配置 MCP 服务器(可选)。项目级 .mc-agent/mcp.json 仍随仓库生效。"}),D.map((j,H)=>c.jsxs("div",{className:"card card-lg",style:{display:"flex",flexDirection:"column",gap:12},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 240px",gap:12},children:[c.jsx(wn,{label:"名称",children:c.jsx("input",{style:Hn,value:j.name,placeholder:"如: context7",onChange:ee=>Z(H,{name:ee.target.value}),className:"hv-bd"})}),c.jsx(wn,{label:"类型",children:c.jsxs("select",{style:Tf,value:j.type,onChange:ee=>Z(H,{type:ee.target.value}),children:[c.jsx("option",{value:"http",children:"HTTP(URL)"}),c.jsx("option",{value:"stdio",children:"stdio(本地命令)"})]})})]}),j.type==="http"?c.jsx(wn,{label:"URL",children:c.jsx("input",{style:Hn,value:j.url,placeholder:"https://mcp.example.com/mcp",onChange:ee=>Z(H,{url:ee.target.value}),className:"hv-bd"})}):c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[c.jsx(wn,{label:"命令",children:c.jsx("input",{style:Hn,value:j.command,placeholder:"npx",onChange:ee=>Z(H,{command:ee.target.value}),className:"hv-bd"})}),c.jsx(wn,{label:"参数(空格分隔)",children:c.jsx("input",{style:Hn,value:j.args,placeholder:"@playwright/mcp",onChange:ee=>Z(H,{args:ee.target.value}),className:"hv-bd"})})]}),c.jsx(wn,{label:j.type==="http"?"Headers(每行 KEY=VALUE)":"环境变量(每行 KEY=VALUE)",children:c.jsx("textarea",{style:{...Hn,height:"auto",padding:"7px 10px",resize:"vertical",lineHeight:1.6},rows:2,value:j.kv,onChange:ee=>Z(H,{kv:ee.target.value}),className:"hv-bd"})}),c.jsx("div",{style:{display:"flex",fontSize:12},children:c.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t5)",cursor:"pointer"},onClick:()=>T(ee=>ee.filter((Me,be)=>be!==H)),children:"删除"})})]},H))]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[c.jsx("button",{className:"hv-acc",onClick:()=>!ae&&void A(),style:{height:32,border:"none",borderRadius:9,background:"var(--acc)",color:"var(--onAcc)",fontWeight:700,fontSize:13,padding:"0 22px",cursor:"pointer",opacity:ae?.6:1,boxShadow:"var(--accSh)"},children:ae?"保存并重启内核中…":"保存"}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"保存后内核自动重启,会话在磁盘不丢失。"})]})]}),U&&c.jsx("div",{style:{fontSize:12.5,color:"var(--err)"},children:U})]})})}const Za={width:46,height:"100%",border:"none",background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--t3)",cursor:"default",padding:0,flex:"none"};function qo({d:i}){return c.jsx("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",style:{display:"block"},children:c.jsx("path",{d:i,stroke:"currentColor",strokeWidth:"1"})})}function vy(){const[i,s]=F.useState(!1);return F.useEffect(()=>{const o=()=>void Ng().then(s);return o(),Rg(o)},[]),c.jsxs("div",{"data-tauri-drag-region":"",style:{height:36,flex:"none",display:"flex",alignItems:"center",background:"var(--bg)",borderBottom:"1px solid var(--line2)",userSelect:"none"},children:[c.jsx("span",{"data-tauri-drag-region":"",style:{flex:1,alignSelf:"stretch"}}),c.jsx("button",{className:"hv",title:"最小化",onClick:()=>void bg(),style:Za,children:c.jsx(qo,{d:"M0 5h10"})}),c.jsx("button",{className:"hv",title:i?"向下还原":"最大化",onClick:()=>void _g(),style:Za,children:i?c.jsx(qo,{d:"M.5 2.5h7v7h-7zM2.5 2.5v-2h7v7h-2"}):c.jsx(qo,{d:"M.5 .5h9v9h-9z"})}),c.jsx("button",{className:"hv-caption-close",title:"关闭",onClick:()=>void Tg(),style:Za,children:c.jsx(qo,{d:"M0 0l10 10M10 0L0 10"})})]})}const oc="mc.lastSession",yy=()=>localStorage.getItem(oc);function xy(i={}){const[s,o]=F.useState(null),[u,d]=F.useState(Zo),[p,v]=F.useState("未连接"),[m,w]=F.useState(!1),[y,E]=F.useState(""),[D,T]=F.useState(!1),[P,B]=F.useState(""),[U,G]=F.useState(null),[ae,me]=F.useState([]),[xe,Z]=F.useState(null),[pe,A]=F.useState(""),V=F.useRef(null),j=F.useRef(null),H=F.useRef(i.onSessionsChanged);H.current=i.onSessionsChanged;const ee=F.useCallback(async()=>{const N=V.current;if(!N)return[];try{const W=await N.call("repo_file_changes");if(W.error)return A(W.error),Z([]),[];A("");const le=W.result??[];return Z(le),le}catch(W){return A(W instanceof Error?W.message:String(W)),Z([]),[]}},[]),Me=F.useCallback((N,W={})=>{var le,Le;(le=V.current)==null||le.close(),o(N),d(Zo),G(null),me([]),Z(null),A(""),E(W.model??""),T(W.mode==="yolo"),j.current=W.firstMessage??null,localStorage.setItem(oc,N),V.current=Mf(N,{onFrames:Ae=>d(We=>up(We,Ae)),onStatus:(Ae,We)=>{v(Ae),w(We)}}),(Le=H.current)==null||Le.call(H)},[]),be=F.useCallback((N=!1)=>{var W;(W=V.current)==null||W.close(),V.current=null,j.current=null,o(null),d(Zo),v("未连接"),w(!1),E(""),T(!1),G(null),me([]),Z(null),A(""),N&&localStorage.removeItem(oc)},[]);return F.useEffect(()=>{u.model&&E(u.model)},[u.model]),F.useEffect(()=>{u.permMode&&T(u.permMode==="yolo")},[u.permMode]),F.useEffect(()=>{var W;if(!m)return;ee();const N=j.current;N&&((W=V.current)!=null&&W.send("user-input",{content:js(N)}))&&(j.current=null)},[m,ee]),F.useEffect(()=>{var N;u.turnEnded&&(d(W=>({...W,turnEnded:!1})),ee(),(N=H.current)==null||N.call(H))},[u.turnEnded,ee]),F.useEffect(()=>{var N;u.running||!U||(N=V.current)!=null&&N.send("user-input",{content:js(U)})&&G(null)},[u.running,U]),F.useEffect(()=>()=>{var N;return(N=V.current)==null?void 0:N.close()},[]),{id:s,chat:u,status:p,connected:m,model:y,yolo:D,input:P,queued:U,atts:ae,changes:xe,changesErr:pe,uploadUrl:s?N=>fg(s,N):void 0,open:Me,close:be,setInput:B,send:()=>{const N=ae.map(le=>`${le.isImage?"[图片]":"[文件]"} ${le.path}`),W=[P.trim(),...N].filter(Boolean).join(` +`);if(!(!W||!V.current)){if(u.running){G(W),B(""),me([]);return}V.current.send("user-input",{content:js(W)})&&(B(""),me([]))}},stop:()=>{var N;return void((N=V.current)==null?void 0:N.send("user-cancel",{}))},clearQueued:()=>G(null),addFiles:async N=>{if(s)for(const W of N){if(W.size>20*1024*1024){v(`⚠ ${W.name||"文件"} 过大(上限 20MB)`);continue}try{const le=await new Promise((se,_e)=>{const ze=new FileReader;ze.onload=()=>se(ze.result),ze.onerror=()=>_e(new Error("读取文件失败")),ze.readAsDataURL(W)}),Le=le.slice(le.indexOf(",")+1),Ae=W.type.startsWith("image/"),{path:We}=await dg(s,W.name,W.type,Le);me(se=>[...se,{path:We,isImage:Ae,name:W.name||We.split("/").pop()||"",preview:Ae?le:void 0}])}catch(le){v("⚠ 附件上传失败: "+(le instanceof Error?le.message:String(le)))}}},removeAtt:N=>me(W=>W.filter((le,Le)=>Le!==N)),answerPerm:(N,W)=>{var Le;const le=W!=="deny";(Le=V.current)!=null&&Le.send("permission-resp",{id:N,approved:le,remember:W==="always"||W==="persist",persist:W==="persist"})&&d(Ae=>Pv(Ae,N,le))},switchModel:async N=>{var W;if(!(!V.current||!N||N===y))try{const le=await V.current.call("session_set_model",{model:N});if(le.error){v("⚠ 切换模型失败: "+le.error);return}E(N),(W=H.current)==null||W.call(H)}catch(le){v("⚠ 切换模型失败: "+(le instanceof Error?le.message:le))}},toggleYolo:async()=>{if(!V.current)return;const N=D,W=N?"default":"yolo";T(!N);try{const le=await V.current.call("session_set_mode",{mode:W});le.error&&(T(N),v("⚠ 切换权限模式失败: "+le.error))}catch(le){T(N),v("⚠ 切换权限模式失败: "+(le instanceof Error?le.message:le))}},refreshChanges:ee,fileDiff:N=>{const W=V.current;return W?W.call("repo_file_diff",{path:N}):Promise.reject(new Error("未连接"))},listFiles:N=>{const W=V.current;return W?W.call("repo_file_list",{path:N}):Promise.reject(new Error("未连接"))},readFile:N=>{const W=V.current;return W?W.call("repo_read_file",{path:N}):Promise.reject(new Error("未连接"))},reveal:N=>{const W=V.current;return W?W.call("repo_reveal",{path:N}):Promise.reject(new Error("未连接"))},notify:v}}const Xa="~/MonkeyCode",Rf=/Mac/.test(navigator.userAgent),fr={A:{text:"新增",fg:"var(--addT)",bg:"var(--addBg)"},M:{text:"修改",fg:"var(--warn)",bg:"var(--warnBg)"},D:{text:"删除",fg:"var(--delT)",bg:"var(--delBg)"}},wy=i=>i>=1<<20?(i/(1<<20)).toFixed(1)+" MB":i>=1024?(i/1024).toFixed(1)+" KB":i+" B",Ms={height:32,display:"flex",alignItems:"center",gap:9,padding:"0 10px",borderRadius:8,cursor:"pointer",minWidth:0,flex:"none"},Ls={flex:"none",fontSize:10.5,fontWeight:600,borderRadius:9,padding:"2px 8px",lineHeight:1.4},Cf=i=>({border:"none",background:"transparent",height:34,padding:"0 3px",marginBottom:-1,borderBottom:`2px solid ${i?"var(--acc)":"transparent"}`,fontSize:13,fontWeight:i?700:500,color:i?"var(--t1)":"var(--t5)",cursor:i?"default":"pointer",display:"flex",alignItems:"center",gap:6,flex:"none"});function Sy(){var kn,fn;const[i,s]=F.useState([]),[o,u]=F.useState("new"),[d,p]=F.useState([]),[v,m]=F.useState(null),[w,y]=F.useState(null),[E,D]=F.useState(!1),[T,P]=F.useState("files"),[B,U]=F.useState(new Map),[G,ae]=F.useState(new Set),[me,xe]=F.useState(new Set),[Z,pe]=F.useState(""),[A,V]=F.useState(null),[j,H]=F.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerWidth")??"",10);return Number.isFinite(L)?Math.min(Math.max(L,420),1200):600}),[ee,Me]=F.useState(!1),[be,Be]=F.useState(()=>{const L=parseInt(localStorage.getItem("mc.drawerSplit")??"",10);return Number.isFinite(L)&&L>0?Math.max(L,80):0}),[qe,$e]=F.useState(!1),Ge=F.useRef(null),[Pe,z]=F.useState(null),[re,M]=F.useState(Xa),[S,N]=F.useState(""),[W,le]=F.useState(""),[Le,Ae]=F.useState(""),[We,se]=F.useState(!1),[_e,ze]=F.useState(!1),De=F.useRef(!1),yt=F.useCallback(async()=>{const L=await sg();return s(L),L},[]),fe=xy({onSessionsChanged:()=>void yt()}),zt=(L,K)=>{fe.open(L.id,{model:L.model,mode:L.mode,firstMessage:K}),u("session"),D(!1),V(null)},Ke=async L=>{try{await ug(L.id,!L.archived),await yt()}catch(K){fe.notify("⚠ 归档失败: "+(K instanceof Error?K.message:String(K)))}},Mn=async(L,K)=>{try{await cg(L.id,K),await yt()}catch(g){fe.notify("⚠ 重命名失败: "+(g instanceof Error?g.message:String(g)))}},Gn=async L=>{try{await ag(L.id)}catch(K){fe.notify("⚠ 删除失败: "+(K instanceof Error?K.message:String(K)));return}L.id===fe.id&&(fe.close(!0),u("new"),D(!1),V(null)),yt()};F.useEffect(()=>{const L=Ig("open-settings",()=>u("settings"));return Promise.all([og().catch(()=>[]),yt()]).then(([K,g])=>{var we;p(K),N(((we=K.find(ge=>ge.default))==null?void 0:we.name)??"");const C=yy(),J=g.find(ge=>ge.id===C);J&&zt(J),K.length===0&&qi()&&u("settings")}).catch(K=>fe.notify("无法连接服务: "+(K instanceof Error?K.message:K))),qi()&&(Cg().then(K=>m((K==null?void 0:K.version)??null)),If().then(y).catch(()=>{})),()=>L()},[]);const Vt=((kn=[...i].sort((L,K)=>(K.updated_at??"").localeCompare(L.updated_at??""))[0])==null?void 0:kn.workdir)??"";F.useEffect(()=>{De.current||M(Vt||Xa)},[Vt]);const Ln=async L=>{var K;V({path:L,kind:"diff",text:"加载中…"});try{const g=await fe.fileDiff(L);V({path:L,kind:"diff",text:g.error?"✗ "+g.error:((K=g.result)==null?void 0:K.diff)||"(无差异)"})}catch(g){V({path:L,kind:"diff",text:"✗ "+(g instanceof Error?g.message:g)})}},cn=async L=>{var K;V({path:L,kind:"plain",text:"加载中…"});try{const g=await fe.readFile(L);if(g.error){V({path:L,kind:"plain",text:"✗ "+g.error});return}const C=((K=g.result)==null?void 0:K.content)??"";C?C.includes("\0")?V({path:L,kind:"plain",text:"二进制文件,不支持预览"}):V({path:L,kind:"code",text:C}):V({path:L,kind:"plain",text:"(空文件)"})}catch(g){V({path:L,kind:"plain",text:"✗ "+(g instanceof Error?g.message:g)})}},un=async(L,K=!1)=>{if(!(!K&&(B.has(L)||me.has(L)))){xe(g=>new Set(g).add(L));try{const g=await fe.listFiles(L);g.error?pe(g.error):U(C=>new Map(C).set(L,g.result??[]))}catch(g){pe(g instanceof Error?g.message:String(g))}finally{xe(g=>{const C=new Set(g);return C.delete(L),C})}}},tr=L=>{ae(K=>{const g=new Set(K);return g.has(L)?g.delete(L):(g.add(L),un(L)),g})},Pt=(L,K,g)=>{document.body.style.cursor=L,document.body.style.userSelect="none";const C=()=>{document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",C),g()};window.addEventListener("mousemove",K),window.addEventListener("mouseup",C)},St=L=>{L.preventDefault(),Me(!0),Pt("col-resize",K=>{const g=Math.round(window.innerWidth*.9);H(Math.min(Math.max(window.innerWidth-K.clientX,420),g))},()=>{Me(!1),H(K=>(localStorage.setItem("mc.drawerWidth",String(K)),K))})},en=L=>{var g;L.preventDefault();const K=((g=Ge.current)==null?void 0:g.getBoundingClientRect().top)??0;$e(!0),Pt("row-resize",C=>{const J=Math.max(window.innerHeight-K-160,80);Be(Math.min(Math.max(C.clientY-K,80),J))},()=>{$e(!1),Be(C=>(localStorage.setItem("mc.drawerSplit",String(C)),C))})},tn=L=>{const K=(rt==null?void 0:rt.workdir)??"";if(!L)return K;const g=K.includes("\\")?"\\":"/",C=g==="\\"?L.split("/").join(g):L;return K.endsWith(g)?K+C:K+g+C},nn=async L=>{try{const K=await fe.reveal(L);if(K.error)throw new Error(K.error)}catch(K){const g=tn(L);try{await navigator.clipboard.writeText(g),fe.notify("⚠ 无法打开文件夹,已复制路径: "+g)}catch{fe.notify("⚠ 无法打开文件夹: "+(K instanceof Error?K.message:String(K)))}}},En=(L="files")=>{D(!0),P(L),V(null),U(new Map),ae(new Set),pe(""),fe.refreshChanges(),un("",!0)},nr=async(L=!1)=>{const K=re.trim();if(!(!K||_e)){ze(!0),Ae(""),se(!1);try{const g=await lg(K,S,L||K===Xa),C=W.trim();le(""),await yt(),zt(g,C||void 0)}catch(g){const C=g instanceof Error?g.message:String(g);Ae("创建失败: "+C),C.includes("目录不存在")&&se(!0)}finally{ze(!1)}}},rt=i.find(L=>L.id===fe.id),dn=fe.model||((fn=d.find(L=>L.default))==null?void 0:fn.name)||"",rr=fe.model&&!d.some(L=>L.name===fe.model)?[...d,{name:fe.model,default:!1}]:d,Dn=[...fe.chat.items].reverse().find(L=>L.kind==="perm"&&L.state==="open"),Yn=o==="new"||fe.id===null,rn=fe.changes,Bt=new Map((rn??[]).map(L=>[L.path,L.status])),Kn=L=>(rn??[]).filter(K=>K.path.startsWith(L+"/")).length,Ut=(L,K)=>{const g=10+K*16,C=[],J=B.get(L);if(!J){if(me.has(L))for(let ge=0;ge<(L===""?4:1);ge++)C.push(c.jsxs("div",{style:{...Ms,cursor:"default",paddingLeft:g+21},children:[c.jsx("span",{className:"skeleton",style:{width:14,height:14,borderRadius:4}}),c.jsx("span",{className:"skeleton",style:{height:10,width:110+ge%3*52}})]},`ld:${L}:${ge}`));return C}for(const ge of J){const et=ge.is_dir?void 0:Bt.get(ge.path),ce=et?fr[et]:void 0,he=ge.is_dir?Kn(ge.path):0,Re=ge.is_dir&&G.has(ge.path),ot=(A==null?void 0:A.path)===ge.path;C.push(c.jsxs("div",{className:ot?void 0:"hv",title:ge.path,onClick:()=>ge.is_dir?tr(ge.path):ce?void Ln(ge.path):void cn(ge.path),style:{...Ms,paddingLeft:g,background:ot?"var(--hov)":"transparent"},children:[c.jsx("span",{style:{width:12,flex:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:ge.is_dir&&c.jsx(yc,{size:8,color:"var(--t5)",style:{transform:Re?"rotate(90deg)":"none",transition:"transform .15s ease"}})}),ge.is_dir?c.jsx(Nr,{size:14,color:"var(--acc)"}):c.jsx(Is,{color:ce?ce.fg:"var(--t4)"}),c.jsx("span",{className:"ellipsis",style:{flex:1,fontSize:12.5,color:"var(--t1)"},children:ge.name}),ge.is_dir&&he>0&&c.jsxs("span",{style:{...Ls,color:"var(--acc)",background:"var(--accBg)"},children:[he," 处改动"]}),!ge.is_dir&&ce&&c.jsx("span",{style:{...Ls,color:ce.fg,background:ce.bg},children:ce.text}),!ge.is_dir&&!ce&&c.jsx("span",{style:{flex:"none",width:60,textAlign:"right",font:"10.5px "+Tt,color:"var(--t6)"},children:wy(ge.size)})]},ge.path)),Re&&C.push(...Ut(ge.path,K+1))}const we=(rn??[]).filter(ge=>ge.status==="D"&&(ge.path.includes("/")?ge.path.slice(0,ge.path.lastIndexOf("/")):"")===L);for(const ge of we)C.push(c.jsxs("div",{className:"hv",title:ge.path,onClick:()=>void Ln(ge.path),style:{...Ms,paddingLeft:g},children:[c.jsx("span",{style:{width:12,flex:"none"}}),c.jsx(Is,{color:fr.D.fg}),c.jsx("span",{className:"ellipsis",style:{flex:1,fontSize:12.5,color:"var(--t5)",textDecoration:"line-through"},children:Vi(ge.path)}),c.jsx("span",{style:{...Ls,color:fr.D.fg,background:fr.D.bg},children:fr.D.text})]},"del:"+ge.path));return J.length===0&&we.length===0&&(L===""?C.push(c.jsxs("div",{style:{padding:"36px 0 28px",display:"flex",flexDirection:"column",alignItems:"center",gap:9},children:[c.jsx(Nr,{size:22,color:"var(--t6)"}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"工作区是空的"})]},"empty-root")):C.push(c.jsx("div",{style:{...Ms,cursor:"default",paddingLeft:g+21},children:c.jsx("span",{style:{fontSize:11.5,color:"var(--t6)"},children:"(空)"})},"empty:"+L))),C},Rt=(()=>{const L=gp(i.filter(K=>!K.archived)).map(K=>K.dir);return L.includes(re)||L.unshift(re),L.slice(0,6)})();return F.useEffect(()=>{const L=K=>{if(K.key==="Tab"&&K.shiftKey&&o==="session"&&fe.id){K.preventDefault(),fe.toggleYolo();return}if(K.key==="Escape"){if(Pe)return z(null);if(E)return A?V(null):D(!1);if(o==="settings")return u(fe.id?"session":"new");Dn&&fe.answerPerm(Dn.id,"deny");return}if(K.key==="Enter"&&!K.isComposing&&Dn&&!Yn){const g=K.target;if(g&&(g.tagName==="TEXTAREA"||g.tagName==="INPUT")&&fe.input.trim())return;K.preventDefault(),fe.answerPerm(Dn.id,"allow")}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",background:"var(--bg)",color:"var(--t1)",fontSize:13,overflow:"hidden"},children:[kg()&&c.jsx(vy,{}),c.jsxs("div",{style:{flex:1,display:"flex",minHeight:0,position:"relative"},children:[c.jsx(ay,{sessions:i,currentId:fe.id,sessionActive:o==="session",connected:fe.connected,status:fe.status,settingsActive:o==="settings",updateAvailable:!!(w!=null&&w.available),onSelect:L=>zt(L),onNewTask:L=>{L&&(De.current=!0,M(L)),Ae(""),se(!1),u("new")},onOpenSettings:()=>u("settings"),onArchive:L=>void Ke(L),onDelete:L=>void Gn(L),onRename:(L,K)=>void Mn(L,K)}),c.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},children:o==="settings"?c.jsx(my,{onClose:()=>u(fe.id?"session":"new"),hostVersion:v,update:w,onUpdateStatus:y}):Yn?c.jsx(sy,{dir:re,recentDirs:Rt,text:W,models:d,model:S,busy:_e,err:Le,offerCreate:We,onDirChange:L=>{De.current=!0,M(L),Ae(""),se(!1)},onTextChange:le,onModelChange:N,onCreate:L=>void nr(L)}):c.jsx(iy,{meta:rt,session:fe,models:rr,currentModel:dn,onOpenDrawer:En,onOpenChild:z,onArchive:()=>rt&&void Ke(rt),onDelete:()=>rt&&void Gn(rt)})}),E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{onClick:()=>D(!1),style:{position:"absolute",inset:0,background:"var(--scrim)",zIndex:35}}),c.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,width:j,maxWidth:"90vw",background:"var(--pop)",borderLeft:"1px solid var(--line)",boxShadow:"var(--shadow)",zIndex:36,display:"flex",flexDirection:"column",animation:"mcslide .22s ease"},children:[c.jsx("div",{className:ee?"resize-handle dragging":"resize-handle",title:"拖动调整宽度",onMouseDown:St}),c.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:16,padding:"6px 14px 0 20px",borderBottom:"1px solid var(--line2)",flex:"none",whiteSpace:"nowrap"},children:[c.jsx("button",{className:T==="files"?void 0:"hv-t1",style:Cf(T==="files"),onClick:()=>P("files"),children:"文件"}),c.jsxs("button",{className:T==="changes"?void 0:"hv-t1",style:Cf(T==="changes"),onClick:()=>P("changes"),children:["改动",rn&&rn.length>0&&c.jsx("span",{style:{fontSize:10.5,fontWeight:700,color:"var(--acc)",background:"var(--accBg)",borderRadius:8,padding:"0 6px",lineHeight:"15px"},children:rn.length})]}),c.jsx("button",{className:"hv2 icon-btn",title:"关闭 (esc)",onClick:()=>D(!1),style:{marginLeft:"auto",alignSelf:"center",width:24,height:24},children:c.jsx(Ps,{size:11,color:"var(--t4)"})})]}),(Z||fe.changesErr)&&c.jsx("div",{style:{padding:"0 20px 8px",fontSize:12,color:"var(--err)",flex:"none"},children:Z||fe.changesErr}),c.jsx("div",{ref:Ge,style:{flex:A?"none":1,height:A&&be?be:void 0,maxHeight:A?be?"calc(100% - 190px)":"38%":void 0,overflowY:"auto",padding:"0 12px 10px",display:"flex",flexDirection:"column",gap:1},children:T==="changes"?c.jsxs(c.Fragment,{children:[[...rn??[]].sort((L,K)=>L.path.localeCompare(K.path)).map(L=>{const K=fr[L.status],g=L.path.lastIndexOf("/"),C=g>0?L.path.slice(0,g):"",J=(A==null?void 0:A.path)===L.path;return c.jsxs("div",{className:J?void 0:"hv",title:L.path,onClick:()=>void Ln(L.path),style:{...Ms,background:J?"var(--hov)":"transparent"},children:[c.jsx(Is,{color:K.fg}),c.jsx("span",{style:{flex:"none",fontSize:12.5,color:L.status==="D"?"var(--t5)":"var(--t1)",textDecoration:L.status==="D"?"line-through":"none"},children:Vi(L.path)}),c.jsx("span",{className:"ellipsis",style:{flex:1,fontSize:11,fontFamily:Tt,color:"var(--t5)"},children:C}),c.jsx("span",{style:{...Ls,color:K.fg,background:K.bg},children:K.text})]},L.path)}),(rn??[]).length===0&&c.jsxs("div",{style:{padding:"36px 0 28px",display:"flex",flexDirection:"column",alignItems:"center",gap:9},children:[c.jsx(Is,{size:22,color:"var(--t6)"}),c.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"本轮还没有文件改动"})]})]}):c.jsx(c.Fragment,{children:Ut("",0)})}),A&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:qe?"resize-handle-h dragging":"resize-handle-h",title:"拖动调整列表/预览高度",onMouseDown:en,style:{margin:"-5px 0 0"}}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"9px 14px 9px 20px",borderTop:"1px solid var(--line2)",background:"var(--bg)",flex:"none",whiteSpace:"nowrap",overflow:"hidden"},children:[c.jsx(Is,{color:Bt.get(A.path)?fr[Bt.get(A.path)].fg:"var(--t4)"}),c.jsx("span",{style:{font:"600 12.5px "+Tt,color:"var(--t1)",flex:"none"},children:Vi(A.path)}),c.jsx("span",{className:"ellipsis",style:{fontSize:11,fontFamily:Tt,color:"var(--t5)"},children:A.path}),Bt.get(A.path)&&c.jsx("span",{style:{...Ls,color:fr[Bt.get(A.path)].fg,background:fr[Bt.get(A.path)].bg},children:fr[Bt.get(A.path)].text}),c.jsxs("button",{className:"hv",title:"在系统文件管理器中定位此文件(浏览器模式复制路径)",onClick:()=>void nn(A.path),style:{marginLeft:"auto",flex:"none",height:22,display:"flex",alignItems:"center",gap:5,border:"none",background:"transparent",borderRadius:6,padding:"0 8px",fontSize:11.5,fontWeight:600,color:"var(--t3)",cursor:"pointer"},children:[c.jsx(Nr,{size:11,color:"var(--t4)"}),Rf?"在访达中显示":"打开所在文件夹"]}),c.jsx("button",{className:"hv2 icon-btn",title:"关闭,回到文件列表 (esc)",onClick:()=>V(null),style:{width:22,height:22},children:c.jsx(Ps,{size:10,color:"var(--t4)"})})]}),c.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 0 20px"},children:A.kind==="diff"?c.jsx(Jv,{text:A.text}):A.kind==="code"?c.jsx(ty,{path:A.path,text:A.text}):c.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:A.text})})]}),c.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",gap:10,padding:"9px 12px 9px 16px",borderTop:"1px solid var(--line2)",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"ellipsis",style:{flex:1,fontSize:11.5,color:"var(--t5)"},children:"这个任务的文件都保存在这台电脑上"}),c.jsxs("button",{className:"hv-acc",title:(rt==null?void 0:rt.workdir)??"",onClick:()=>void nn(""),style:{flex:"none",height:26,border:"none",background:"var(--acc)",color:"var(--onAcc)",borderRadius:8,padding:"0 12px",fontSize:11.5,fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:6,boxShadow:"var(--accSh)"},children:[c.jsx(Nr,{size:12,color:"var(--onAcc)"}),Rf?"在访达中打开":"打开文件夹"]})]})]})]}),Pe&&c.jsx("div",{onClick:()=>z(null),style:{position:"fixed",inset:0,background:"var(--scrim2)",zIndex:40,display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsxs("div",{onClick:L=>L.stopPropagation(),style:{width:"min(860px, 92vw)",maxHeight:"84vh",background:"var(--pop)",border:"1px solid var(--line)",borderRadius:16,boxShadow:"var(--shadowLg)",padding:"20px 24px",display:"flex",flexDirection:"column",overflow:"hidden",animation:"mcin .2s ease"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12,whiteSpace:"nowrap"},children:[c.jsxs("span",{className:"ellipsis",style:{fontSize:14,fontWeight:700},children:["子代理会话 ",Pe]}),c.jsx("button",{className:"hv2 icon-btn",onClick:()=>z(null),style:{marginLeft:"auto",width:24,height:24},children:c.jsx(Ps,{size:11,color:"var(--t4)"})})]}),c.jsx(Ey,{id:Pe,workdir:rt==null?void 0:rt.workdir})]})})]})]})}function Ey({id:i,workdir:s}){const[o,u]=F.useState(Zo),[d,p]=F.useState("连接中…");return F.useEffect(()=>{const v=Mf(i,{onFrames:m=>u(w=>up(w,m)),onStatus:m=>p(m)});return()=>v.close()},[i]),c.jsxs("div",{style:{overflowY:"auto",flex:1,paddingRight:6,display:"flex",flexDirection:"column",gap:14,lineHeight:1.8},children:[c.jsx("div",{style:{color:"var(--t4)",fontSize:12},children:d}),c.jsx(dp,{items:o.items,onPermAnswer:()=>{},workdir:s})]})}ig.createRoot(document.getElementById("root")).render(c.jsx(F.StrictMode,{children:c.jsx(Sy,{})})); diff --git a/agent/internal/frame/frame.go b/agent/internal/frame/frame.go index 23193206..82d17da2 100644 --- a/agent/internal/frame/frame.go +++ b/agent/internal/frame/frame.go @@ -48,6 +48,7 @@ const ( KindRepoReadFile = "repo_read_file" KindRepoFileChanges = "repo_file_changes" KindRepoFileDiff = "repo_file_diff" + KindRepoReveal = "repo_reveal" // KindSessionSetModel 切换会话模型(轮次间生效;执行中拒绝)。 // 成功后另发 model_update 帧进事件日志,回放可见。 KindSessionSetModel = "session_set_model" diff --git a/agent/internal/repo/repo.go b/agent/internal/repo/repo.go index a0625f98..0fc15027 100644 --- a/agent/internal/repo/repo.go +++ b/agent/internal/repo/repo.go @@ -8,6 +8,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "sort" "strings" ) @@ -175,6 +176,38 @@ func (b *Browser) FileDiff(rel string) (string, error) { return out, nil } +// Reveal 在系统文件管理器中定位路径:目录直接打开,文件在父目录中选中。 +// 内核与浏览器同机(serve 仅绑 loopback),浏览器模式也因此可用。 +// Start 不等退出:explorer.exe 成功也返回非零码,Run 会误报错误。 +func (b *Browser) Reveal(rel string) error { + p, err := b.resolve(rel) + if err != nil { + return err + } + st, err := os.Stat(p) + if err != nil { + return fmt.Errorf("路径不存在: %w", err) + } + switch runtime.GOOS { + case "darwin": + if st.IsDir() { + return exec.Command("open", p).Start() + } + return exec.Command("open", "-R", p).Start() + case "windows": + if st.IsDir() { + return exec.Command("explorer", p).Start() + } + return exec.Command("explorer", "/select,"+p).Start() + default: + dir := p + if !st.IsDir() { + dir = filepath.Dir(p) + } + return exec.Command("xdg-open", dir).Start() + } +} + func (b *Browser) isGitRepo() bool { out, err := b.git("rev-parse", "--is-inside-work-tree") return err == nil && strings.TrimSpace(out) == "true" diff --git a/agent/internal/repo/repo_test.go b/agent/internal/repo/repo_test.go index 2fc5781f..aad3b718 100644 --- a/agent/internal/repo/repo_test.go +++ b/agent/internal/repo/repo_test.go @@ -162,3 +162,15 @@ func TestFileChangesInSubdirWorkdir(t *testing.T) { } } } + +// Reveal 的守卫路径:越界拒绝、不存在报错(真实唤起文件管理器不在单测覆盖)。 +func TestRevealGuards(t *testing.T) { + dir := t.TempDir() + b := New(dir) + if err := b.Reveal("../etc"); err == nil { + t.Fatal("越界路径应被拒绝") + } + if err := b.Reveal("no-such-file"); err == nil { + t.Fatal("不存在的路径应报错") + } +} diff --git a/agent/internal/server/server.go b/agent/internal/server/server.go index 63f8a262..1ec51715 100644 --- a/agent/internal/server/server.go +++ b/agent/internal/server/server.go @@ -1121,6 +1121,13 @@ func (ls *liveSession) handleCall(c *wsClient, f *frame.Frame) { result = map[string]string{"path": p.Path, "content": content} case frame.KindRepoFileChanges: result, callErr = browser.FileChanges() + case frame.KindRepoReveal: + var p struct { + Path string `json:"path"` + } + _ = json.Unmarshal(f.Data, &p) + callErr = browser.Reveal(p.Path) + result = map[string]bool{"ok": callErr == nil} case frame.KindRepoFileDiff: var p struct { Path string `json:"path"` diff --git a/agent/ui/src/App.tsx b/agent/ui/src/App.tsx index f8defff7..66e2affc 100644 --- a/agent/ui/src/App.tsx +++ b/agent/ui/src/App.tsx @@ -31,6 +31,9 @@ import type { FileChange, FileEntry, LogItem, ModelInfo, SessionMeta } from "./t /** 首启默认工作目录(内核解析 ~,不存在时自动创建);老用户默认沿用最近会话的目录 */ const DEFAULT_DIR = "~/MonkeyCode"; +/** 内核与页面同机(serve 仅绑 loopback),浏览器 UA 即宿主平台 */ +const IS_MAC = /Mac/.test(navigator.userAgent); + /** 改动状态 → 普通用户可读的中文标签与配色(git 的 A/M/D 不外显) */ const CHANGE_KIND: Record = { A: { text: "新增", fg: "var(--addT)", bg: "var(--addBg)" }, @@ -317,6 +320,32 @@ export default function App() { ); }; + // 工作区相对路径 → 绝对路径(Windows workdir 为反斜杠时统一分隔符) + const absPath = (rel: string) => { + const wd = currentMeta?.workdir ?? ""; + if (!rel) return wd; + const sep = wd.includes("\\") ? "\\" : "/"; + const tail = sep === "\\" ? rel.split("/").join(sep) : rel; + return wd.endsWith(sep) ? wd + tail : wd + sep + tail; + }; + + // 在系统文件管理器中定位:内核在本机执行(open/explorer/xdg-open), + // 壳内与浏览器模式行为一致;失败时复制绝对路径兜底 + const revealPath = async (rel: string) => { + try { + const r = await session.reveal(rel); + if (r.error) throw new Error(r.error); + } catch (e) { + const p = absPath(rel); + try { + await navigator.clipboard.writeText(p); + session.notify("⚠ 无法打开文件夹,已复制路径: " + p); + } catch { + session.notify("⚠ 无法打开文件夹: " + (e instanceof Error ? e.message : String(e))); + } + } + }; + // 打开抽屉(可指定视角:聊天区徽标直达「改动」);两个 tab 的数据并行刷新 const openDrawer = (tab: "files" | "changes" = "files") => { setDrawerOpen(true); @@ -710,7 +739,16 @@ export default function App() { {CHANGE_KIND[changeMap.get(viewer.path)!].text} )} - + @@ -727,6 +765,23 @@ export default function App() { )} + + {/* 底部动作栏:不给普通用户看路径(不认识),给任务语言 + 平台母语按钮; + 完整路径留在按钮悬停提示里给开发者 */} +
+ + 这个任务的文件都保存在这台电脑上 + + +
)} diff --git a/agent/ui/src/useSession.ts b/agent/ui/src/useSession.ts index e4b15042..9edb0afd 100644 --- a/agent/ui/src/useSession.ts +++ b/agent/ui/src/useSession.ts @@ -52,6 +52,8 @@ export interface SessionHandle { listFiles(dir: string): Promise<{ result?: FileEntry[]; error?: string }>; /** repo_read_file 同步查询(文件抽屉:读文件内容,内核限 1MB) */ readFile(path: string): Promise<{ result?: { content?: string }; error?: string }>; + /** repo_reveal:在系统文件管理器中定位(内核本机执行,浏览器模式同样可用) */ + reveal(path: string): Promise<{ result?: { ok?: boolean }; error?: string }>; /** 在状态行外显一条告警(App 级操作失败与连接状态同渠道展示) */ notify(text: string): void; } @@ -286,6 +288,12 @@ export function useSession(opts: { onSessionsChanged?: () => void } = {}): Sessi return conn.call<{ result?: { content?: string }; error?: string }>("repo_read_file", { path }); }; + const reveal = (path: string) => { + const conn = connRef.current; + if (!conn) return Promise.reject(new Error("未连接")); + return conn.call<{ result?: { ok?: boolean }; error?: string }>("repo_reveal", { path }); + }; + return { id, chat, @@ -314,6 +322,7 @@ export function useSession(opts: { onSessionsChanged?: () => void } = {}): Sessi fileDiff, listFiles, readFile, + reveal, notify: setStatus, }; }