zen-gitsync 2.18.19 → 2.18.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/ui/public/assets/{AgentView-CRkUXGCW.js → AgentView-Du9akUeZ.js} +2 -2
- package/src/ui/public/assets/{AppVersionBadge-Dqca8Uoi.js → AppVersionBadge-86tbKU20.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-CN2iCCAs.js → BranchSelector-CsrkmTCA.js} +1 -1
- package/src/ui/public/assets/{ChatSilenceBadge-ltPjxE4-.js → ChatSilenceBadge-BBoFeSqe.js} +1 -1
- package/src/ui/public/assets/{CommitForm-mOWC0Zio.js → CommitForm-DBK0GXEh.js} +1 -1
- package/src/ui/public/assets/{CommonDialog-D2f72EzI.js → CommonDialog-BkuDIWro.js} +1 -1
- package/src/ui/public/assets/EditorAgentPanel-BMUphuG0.css +1 -0
- package/src/ui/public/assets/EditorAgentPanel-KiHbQPJP.js +34 -0
- package/src/ui/public/assets/EditorView-B18B4yNJ.js +13 -0
- package/src/ui/public/assets/EditorView-CnWsMdHg.css +1 -0
- package/src/ui/public/assets/{FlowExecutionViewer-4dAyrq6w.js → FlowExecutionViewer-ClUkAmA2.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-BYcu7GZu.js → FlowOrchestrationWorkspace-B3sOK3fz.js} +1 -1
- package/src/ui/public/assets/{LogList-n-gSd_A8.js → LogList-6aO0-2xh.js} +1 -1
- package/src/ui/public/assets/{MindmapView-DZHwQrhd.css → MindmapView-BDI3D_1h.css} +1 -1
- package/src/ui/public/assets/MindmapView-aJ9TTijE.js +4 -0
- package/src/ui/public/assets/{MonitorView-D0mJlgEJ.js → MonitorView-fcNrgVaU.js} +1 -1
- package/src/ui/public/assets/{ProjectManagerView-CuKtgxJg.js → ProjectManagerView-CZfrML6A.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-Cx0JvDzM.js → ProjectStartupButton-D5MREz6F.js} +1 -1
- package/src/ui/public/assets/{RecentDirectoriesChat-5OEF3wdB.js → RecentDirectoriesChat-wfkSF6NU.js} +1 -1
- package/src/ui/public/assets/{RemoteManagerDialog-ItxNmLvY.js → RemoteManagerDialog-BBwNlK9J.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-y-GzPZ7M.js → RemoteRepoCard-CTnmfv2y.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-DXJUPkaX.js → SourceMapView-B4q5qiE8.js} +1 -1
- package/src/ui/public/assets/{SvgIcon-DkU8Uro2.js → SvgIcon-WpEiC1rI.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-unSg-ucz.js → UserInputNode-Deoc3UvQ.js} +1 -1
- package/src/ui/public/assets/{WorkbenchView-C2-X3Ik_.js → WorkbenchView-CijzpDWN.js} +1 -1
- package/src/ui/public/assets/{_plugin-vue_export-helper-Dz34f-q7.js → _plugin-vue_export-helper-BhdsvhKo.js} +2 -2
- package/src/ui/public/assets/{agentConversations-DLAC_0wI.js → agentConversations-DaAtF1v4.js} +3 -3
- package/src/ui/public/assets/{configStore-BjNspgAX.js → configStore-Drlw8KtR.js} +1 -1
- package/src/ui/public/assets/{flow-mindmap-DqCKZUlr.css → flow-mindmap-BwYC4xxV.css} +1 -1
- package/src/ui/public/assets/flow-mindmap-cTg78Krq.js +139 -0
- package/src/ui/public/assets/{index-BybDOX1D.js → index-cDiVh_ZL.js} +6 -6
- package/src/ui/public/assets/{relativeTime-DN4_NV-7.js → relativeTime-CoXAs57j.js} +1 -1
- package/src/ui/public/assets/{toolsStore-C5a4cV7b.js → toolsStore-CnX34C96.js} +1 -1
- package/src/ui/public/assets/{useOrchestrator-Cd6p-ldI.js → useOrchestrator-BXmxJsRl.js} +1 -1
- package/src/ui/public/assets/{useWorkbenchProjects-OkQTFYcp.js → useWorkbenchProjects-BS59r5Rj.js} +1 -1
- package/src/ui/public/index.html +8 -8
- package/src/ui/server/routes/workbench/agentChat.js +12 -4
- package/src/ui/server/routes/workbench/agentChatContext.test.js +22 -0
- package/src/ui/server/routes/workbench/agentRoutes.js +12 -0
- package/src/ui/public/assets/EditorView-D7tyqaAl.js +0 -46
- package/src/ui/public/assets/EditorView-cW_Ax-z8.css +0 -1
- package/src/ui/public/assets/MindmapView-msWKbkjo.js +0 -2
- package/src/ui/public/assets/flow-mindmap-CpjwoduB.js +0 -259
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as e}from"./_plugin-vue_export-helper-BhdsvhKo.js";var t=6e4,n=60*t,r=24*n;function i(i,a=Date.now()){if(!i)return``;let o=new Date(i).getTime();if(Number.isNaN(o))return``;let s=Math.max(0,a-o);return s<t?e(`@WORKBENCH:刚刚`):s<n?e(`@WORKBENCH:N 分钟前`,{n:Math.floor(s/t)}):s<r?e(`@WORKBENCH:N 小时前`,{n:Math.floor(s/n)}):s<30*r?e(`@WORKBENCH:N 天前`,{n:Math.floor(s/r)}):new Date(o).toLocaleDateString()}function a(t){if(typeof t!=`number`||!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?e(`@WORKBENCH:N 小时 M 分`,{n:r,m:i}):i>0?e(`@WORKBENCH:N 分 M 秒`,{n:i,m:a}):e(`@WORKBENCH:N 秒`,{n:a})}function o(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function s(t,n=Date.now()){if(!t)return``;let r=new Date(t);if(Number.isNaN(r.getTime()))return``;let i=e=>String(e).padStart(2,`0`),a=`${i(r.getHours())}:${i(r.getMinutes())}:${i(r.getSeconds())}`,s=new Date(n);if(o(r,s))return a;if(o(r,new Date(s.getFullYear(),s.getMonth(),s.getDate()-1)))return e(`@WORKBENCH:昨天 {time}`,{time:a});let c=`${r.getMonth()+1}/${r.getDate()}`;return r.getFullYear()===s.getFullYear()?`${c} ${a}`:`${r.getFullYear()}/${c} ${a}`}export{a as n,i as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gr as e,lr as t}from"./element-plus-Bz6lYur-.js";import{S as n}from"./vendor-C2k0GBzj.js";import{n as r}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{gr as e,lr as t}from"./element-plus-Bz6lYur-.js";import{S as n}from"./vendor-C2k0GBzj.js";import{n as r}from"./_plugin-vue_export-helper-BhdsvhKo.js";import{c as i,s as a}from"./configStore-Drlw8KtR.js";t();var o=6e5;function s(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.name!=`string`||!t.name?null:{name:t.name,detail:typeof t.detail==`string`&&t.detail?t.detail:null,provider:typeof t.provider==`string`&&t.provider?t.provider:null,source:t.source===`config`||t.source===`state`?t.source:null}}var c=n(`tools`,()=>{let t=e(!1),n=e(!1),c=e(!1),l=e(!1),u=e(!1),d=e(!1),f=e(!1),p=e(!1),m=e(!1),h=e(null),g=e(!1),_=e(``),v=e({}),y=e({}),b=e({}),x=e({}),S=e(!1),C=0,w=null;function T(e=!1){return!e&&Date.now()-C<3e5?Promise.resolve():w||(S.value=!0,w=(async()=>{try{let e=await(await fetch(`/api/latest-tool-versions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})})).json();e.success&&e.latest&&typeof e.latest==`object`&&(x.value=e.latest,C=Date.now())}catch{}finally{S.value=!1,w=null}})(),w)}let E=null;function D(){return E||(g.value=!0,E=(async()=>{try{let e=await(await fetch(`/api/check-tools`)).json();e.success&&(t.value=!!e.vscode,n.value=!!e.claude,c.value=!!e.codex,l.value=!!e.opencode,u.value=!!e.codebuddy,d.value=!!e.pi,f.value=!!e.kimi,p.value=!!e.zcode,m.value=!!e.dsh,_.value=typeof e.platform==`string`?e.platform:``,v.value=e.installers&&typeof e.installers==`object`?e.installers:{},b.value=e.desktopApps&&typeof e.desktopApps==`object`?e.desktopApps:{},y.value=e.versions&&typeof e.versions==`object`?e.versions:{},h.value=Date.now())}catch{}finally{g.value=!1,E=null}})(),E)}function O(e){switch(e){case`vscode`:return t.value;case`claude`:return n.value;case`codex`:return c.value;case`opencode`:return l.value;case`codebuddy`:return u.value;case`pi`:return d.value;case`kimi`:return f.value;case`zcode`:return p.value;case`dsh`:return m.value}}function k(e){return b.value[e]}let A=e({}),j=e(!1),M=0,N=null;function P(e){if(!j.value)return{status:`unknown`};if(!i(e))return{status:`unset`};let t=A.value[e];return t?{status:`set`,info:t}:{status:`unset`}}function F(e=!1){return!e&&j.value&&Date.now()-M<6e5?Promise.resolve():N||(N=(async()=>{try{let e=await(await fetch(`/api/workbench/executor-models`)).json();if(e?.success&&e.models&&typeof e.models==`object`){let t={};for(let n of a)t[n.id]=s(e.models[n.id]);A.value=t,j.value=!0,M=Date.now()}}catch{}finally{N=null}})(),N)}function I(e){let t=P(e);return t.status===`unknown`?``:t.status===`set`?t.info.name:r(`@42BB9:未在配置中指定`)}function L(e){let t=P(e);return t.status===`set`?[t.info.source===`state`?r(`@42BB9:CLI 内最近使用`):``,t.info.detail,t.info.provider].filter(Boolean).join(` · `):``}let R=null;function z(){R||=(D(),F(),setInterval(()=>{D(),F()},o))}function B(){R&&=(clearInterval(R),null)}return{vscodeAvailable:t,claudeAvailable:n,codexAvailable:c,opencodeAvailable:l,codebuddyAvailable:u,piAvailable:d,kimiAvailable:f,zcodeAvailable:p,dshAvailable:m,lastCheckedAt:h,isChecking:g,platform:_,installers:v,versions:y,latestVersions:x,isFetchingLatest:S,isToolAvailable:O,desktopApps:b,desktopAppOf:k,executorModels:A,executorModelsReady:j,executorModelState:P,executorModelText:I,executorModelDetail:L,fetchExecutorModels:F,checkTools:D,fetchLatestVersions:T,startPolling:z,stopPolling:B}});export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{gr as e,i as t,lr as n}from"./element-plus-Bz6lYur-.js";import{n as r}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{gr as e,i as t,lr as n}from"./element-plus-Bz6lYur-.js";import{n as r}from"./_plugin-vue_export-helper-BhdsvhKo.js";import{t as i}from"./configStore-Drlw8KtR.js";import{h as a,m as o,y as s}from"./index-cDiVh_ZL.js";n();var c=1e5;function l(){let n=e([]),l=e([]),u=e(c),d=e([]),f=e(null),p=e(!1),m=e(!1),h=e(``),g=e({}),_=e([]),v=e(!1),y=e(!1),b=e(a);async function x(e=!1){try{let i=await fetch(`/api/workbench/orchestrator`,{cache:`no-store`}).then(e=>e.json());return i?.success?(Number.isInteger(i.maxInstructionChars)&&i.maxInstructionChars>0&&(u.value=i.maxInstructionChars),n.value=Array.isArray(i.instructions)?i.instructions:[],l.value=Array.isArray(i.activity)?i.activity:[],d.value=Array.isArray(i.running)?i.running:[],o().setRunning(d.value.length),f.value=i.updatedAt||null,h.value=typeof i.defaultPrompt==`string`?i.defaultPrompt:``,g.value=i.projectPrompts&&typeof i.projectPrompts==`object`?i.projectPrompts:{},b.value=s(i.reportIntervalMs),p.value=!0,!0):(e||t.error(i?.error||r(`@WORKBENCH:读取编排状态失败`)),!1)}catch(n){return e||t.error(r(`@WORKBENCH:网络错误: `)+(n?.message||n)),!1}}async function S(e=!1){if(v.value)return!1;v.value=!0;try{let n=await fetch(`/api/workbench/orchestrator/reports`,{cache:`no-store`}).then(e=>e.json());return n?.success?(_.value=Array.isArray(n.reports)?n.reports:[],!0):(e||t.error(n?.error||r(`@WORKBENCH:读取进度报告失败`)),!1)}catch(n){return e||t.error(r(`@WORKBENCH:网络错误: `)+(n?.message||n)),!1}finally{v.value=!1}}async function C(){if(y.value)return null;y.value=!0;try{let e=String(i().locale||``).startsWith(`en`)?`en`:`zh`,n=await fetch(`/api/workbench/orchestrator/report`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({locale:e})}).then(e=>e.json());return n?.success?n.report?(_.value=[n.report,..._.value].slice(0,20),n.report):(t.info(r(`@WORKBENCH:当前没有正在执行的任务,没有可汇报的进度`)),null):(t.error(n?.error||r(`@WORKBENCH:生成进度报告失败`)),null)}catch(e){return t.error(r(`@WORKBENCH:网络错误: `)+(e?.message||e)),null}finally{y.value=!1}}async function w(e){try{let n=await fetch(`/api/workbench/orchestrator/report-interval`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({intervalMs:e})}).then(e=>e.json());return n?.success?(b.value=s(n.reportIntervalMs),!0):(t.error(n?.error||r(`@WORKBENCH:保存失败`)),!1)}catch(e){return t.error(r(`@WORKBENCH:网络错误: `)+(e?.message||e)),!1}}async function T(e){try{let n=await fetch(`/api/workbench/orchestrator/default-prompt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e})}).then(e=>e.json());return n?.success?(h.value=typeof n.defaultPrompt==`string`?n.defaultPrompt:``,t.success(r(`@WORKBENCH:已保存全局预设提示词`)),!0):(t.error(n?.error||r(`@WORKBENCH:保存失败`)),!1)}catch(e){return t.error(r(`@WORKBENCH:网络错误: `)+(e?.message||e)),!1}}async function E(e,n){try{let i=await fetch(`/api/workbench/orchestrator/project-prompt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectPath:e,prompt:n})}).then(e=>e.json());return i?.success?(g.value=i.projectPrompts&&typeof i.projectPrompts==`object`?i.projectPrompts:{},t.success(r(`@WORKBENCH:已保存项目预设提示词`)),!0):(t.error(i?.error||r(`@WORKBENCH:保存失败`)),!1)}catch(e){return t.error(r(`@WORKBENCH:网络错误: `)+(e?.message||e)),!1}}async function D(e){if(m.value)return null;m.value=!0;try{let n=await fetch(`/api/workbench/orchestrator/dispatch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e.text,projectPath:e.projectPath||``,autoRun:e.autoRun!==!1,useDefaultPrompt:e.useDefaultPrompt!==!1,executor:e.executor,attachments:(e.attachments||[]).map(e=>({id:e.id,ext:e.ext,originalName:e.originalName}))})}).then(e=>e.json());return n?.success?(await x(!0),{task:n.task||null,ran:!!n.ran}):(t.error(n?.error||r(`@WORKBENCH:派发失败`)),null)}catch(e){return t.error(r(`@WORKBENCH:网络错误: `)+(e?.message||e)),null}finally{m.value=!1}}return{instructions:n,activity:l,running:d,updatedAt:f,loaded:p,dispatching:m,maxInstructionChars:u,defaultPrompt:h,projectPrompts:g,reports:_,loadingReports:v,generatingReport:y,reportIntervalMs:b,loadOrchestrator:x,dispatch:D,saveDefaultPrompt:T,saveProjectPrompt:E,loadReports:S,generateReport:C,setReportInterval:w}}export{l as t};
|
package/src/ui/public/assets/{useWorkbenchProjects-OkQTFYcp.js → useWorkbenchProjects-BS59r5Rj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{An as e,Cn as t,In as n,J as r,Lt as i,Mn as a,Nt as o,Sn as s,Tn as c,Wr as l,Xr as u,Yn as d,_n as f,gn as p,gr as m,hn as h,i as g,ir as _,jr as v,lr as y,on as b,qn as x,st as S,wn as C,xn as w,xt as T}from"./element-plus-Bz6lYur-.js";import{n as E,t as ee}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{An as e,Cn as t,In as n,J as r,Lt as i,Mn as a,Nt as o,Sn as s,Tn as c,Wr as l,Xr as u,Yn as d,_n as f,gn as p,gr as m,hn as h,i as g,ir as _,jr as v,lr as y,on as b,qn as x,st as S,wn as C,xn as w,xt as T}from"./element-plus-Bz6lYur-.js";import{n as E,t as ee}from"./_plugin-vue_export-helper-BhdsvhKo.js";import{t as te}from"./SvgIcon-WpEiC1rI.js";import{t as D}from"./toolsStore-CnX34C96.js";import{B as O,F as k,G as A,H as j,I as M,L as N,M as P,N as F,P as I,R as L,U as R,V as z,W as B,z as V}from"./index-cDiVh_ZL.js";function H(){let e=D();function t(t){return e.lastCheckedAt!==null&&!e.isToolAvailable(t)}async function n(t,n,r){if(!n)return`no-dir`;if(!await L())return g.warning(E(`@67CE7:工具检测失败,请稍后重试`)),`failed`;if(!e.isToolAvailable(t))return`install`;let i=await R(t,n,r);return i.success?(g.success(i.message||E(`@67CE7:已用 {tool} 打开目录`,{tool:k[t]})),`opened`):(g.error(`${E(`@67CE7:打开失败: `)}${i.error??``}`),`failed`)}return{toolMissing:t,tryOpenWithTool:n}}n(),y();var U=a({__name:`ProjectOpenMenuList`,props:{path:{type:String,required:!0},name:{type:String,required:!0}},emits:[`done`],setup(e,{expose:t,emit:n}){t();let r=e,a=n,{toolMissing:s,tryOpenWithTool:c}=H(),l=D(),u=m(!1),d=m(null),f=w(()=>F.filter(e=>l.desktopAppOf(e)).map(e=>({id:e,name:k[e],icon:I.find(t=>t.id===e)?.icon??``})));async function p(e){let t=l.desktopAppOf(e);if(!t)return;if(a(`done`),!t.installed){window.open(t.downloadUrl,`_blank`,`noopener,noreferrer`);return}let n=await O(e);n.success?g.success(n.message||E(`@67CE7:已打开 {app}`,{app:t.name})):g.error(n.error||E(`@WORKBENCH:打开桌面端失败`))}async function h(){a(`done`);let e=await z(r.path);e.success?g.success(e.message||E(`@WORKBENCH:已在文件管理器中打开文件夹`)):g.error(e.error||E(`@WORKBENCH:打开文件夹失败`))}async function _(){a(`done`);let e=await j(r.path);e.success?g.success(e.message||E(`@67CE7:已在终端中打开目录`)):g.error(e.error||E(`@WORKBENCH:打开终端失败`))}async function v(){a(`done`);let e=await V(r.path);e.success?g.success(E(`@WORKBENCH:已在新标签页启动 g ui`)):g.error(e.error||E(`@WORKBENCH:启动 g ui 失败`))}async function y(){if(a(`done`),r.name)try{await navigator.clipboard.writeText(r.name),g.success(E(`@67CE7:已复制文件夹名称`))}catch{g.error(E(`@67CE7:复制失败`))}}async function b(){if(a(`done`),r.path)try{await navigator.clipboard.writeText(r.path),g.success(E(`@67CE7:已复制文件夹路径`))}catch{g.error(E(`@67CE7:复制失败`))}}async function x(e,t){if(await c(e,r.path,t)===`install`){d.value=e,u.value=!0;return}a(`done`)}let C={props:r,emit:a,toolMissing:s,tryOpenWithTool:c,toolsStore:l,installVisible:u,installTool:d,desktopTools:f,openOrDownloadDesktop:p,openInFileManager:h,openInTerminal:_,launchGui:v,copyFolderName:y,copyFolderPath:b,openWithTool:x,get CopyDocument(){return S},get FolderOpened(){return T},get Monitor(){return o},get Promotion(){return i},SvgIcon:te,ToolInstallDialog:A,get claudeCodeIcon(){return B},get $t(){return E},get DARK_TILE_ICON_IDS(){return P},get OPEN_WITH_TOOLS(){return I},get desktopAppHint(){return M},get desktopAppLabel(){return N}};return Object.defineProperty(C,"__isScriptSetup",{enumerable:!1,value:!0}),C}});n(),v(),b();var W=[`aria-label`],G=[`onKeydown`],K={class:`proj-menu__icon`},q={class:`proj-menu__label`},J=[`onKeydown`],Y={class:`proj-menu__icon`},X={class:`proj-menu__label`},Z=[`onKeydown`],Q={class:`proj-menu__icon`},ne={class:`proj-menu__label`},re=[`onKeydown`],ie={class:`proj-menu__icon`},ae={class:`proj-menu__label`},oe=[`onKeydown`],se={class:`proj-menu__icon`},ce={class:`proj-menu__label`},le={class:`proj-menu__title`,role:`presentation`},ue=[`onClick`,`onKeydown`],de={class:`proj-menu__icon`},fe={class:`proj-menu__label`},pe={key:0,class:`proj-menu__hint`},me={class:`proj-menu__icon`},he=[`src`],ge={class:`proj-menu__label`},_e={class:`proj-menu__hint`},ve={class:`proj-menu__icon`},ye=[`src`],be={class:`proj-menu__label`},xe={class:`proj-menu__icon`},Se={class:`proj-menu__label`},Ce={class:`proj-menu__icon`},we={class:`proj-menu__label`},Te={key:0,class:`proj-menu__hint`},Ee={key:1,class:`proj-menu__hint`},De={class:`proj-menu__icon`},$={class:`proj-menu__label`},Oe={class:`proj-menu__icon`},ke={class:`proj-menu__label`},Ae={class:`proj-menu__icon`},je={class:`proj-menu__label`},Me={class:`proj-menu__title`,role:`presentation`},Ne=[`onClick`,`onKeydown`],Pe={class:`proj-menu__icon`},Fe=[`src`],Ie={class:`proj-menu__label`},Le={class:`proj-menu__hint`};function Re(n,i,a,o,m,g){let v=r;return x(),c(f,null,[s(`ul`,{class:`proj-menu`,role:`menu`,"aria-label":o.$t(`@WORKBENCH:打开方式`)},[s(`li`,{class:`proj-menu__item`,role:`menuitem`,tabindex:`-1`,onClick:o.openInFileManager,onKeydown:[h(p(o.openInFileManager,[`prevent`]),[`enter`]),h(p(o.openInFileManager,[`prevent`]),[`space`])]},[s(`span`,K,[e(v,{"aria-hidden":`true`},{default:_(()=>[e(o.FolderOpened)]),_:1})]),s(`span`,q,u(o.$t(`@WORKBENCH:在文件管理器中打开`)),1)],40,G),s(`li`,{class:`proj-menu__item`,role:`menuitem`,tabindex:`-1`,onClick:o.openInTerminal,onKeydown:[h(p(o.openInTerminal,[`prevent`]),[`enter`]),h(p(o.openInTerminal,[`prevent`]),[`space`])]},[s(`span`,Y,[e(v,{"aria-hidden":`true`},{default:_(()=>[e(o.Monitor)]),_:1})]),s(`span`,X,u(o.$t(`@WORKBENCH:在终端中打开`)),1)],40,J),s(`li`,{class:`proj-menu__item`,role:`menuitem`,tabindex:`-1`,onClick:o.launchGui,onKeydown:[h(p(o.launchGui,[`prevent`]),[`enter`]),h(p(o.launchGui,[`prevent`]),[`space`])]},[s(`span`,Q,[e(v,{"aria-hidden":`true`},{default:_(()=>[e(o.Promotion)]),_:1})]),s(`span`,ne,u(o.$t(`@WORKBENCH:在新标签页启动 g ui`)),1)],40,Z),C(` 复制文件夹名称:放在"打开"这一组里,因为它操作的是项目目录本身,
|
|
2
2
|
而不是"用哪个工具打开"(下面那组有独立标题)。 `),s(`li`,{class:`proj-menu__item`,role:`menuitem`,tabindex:`-1`,onClick:o.copyFolderName,onKeydown:[h(p(o.copyFolderName,[`prevent`]),[`enter`]),h(p(o.copyFolderName,[`prevent`]),[`space`])]},[s(`span`,ie,[e(v,{"aria-hidden":`true`},{default:_(()=>[e(o.CopyDocument)]),_:1})]),s(`span`,ae,u(o.$t(`@67CE7:复制文件夹名称`)),1)],40,re),C(` 复制文件夹路径:与名称成对(名称=最后一级目录名,路径=完整绝对路径,
|
|
3
3
|
粘进终端 cd 用)。同属"操作目录本身"的一组,排在名称下面。 `),s(`li`,{class:`proj-menu__item`,role:`menuitem`,tabindex:`-1`,onClick:o.copyFolderPath,onKeydown:[h(p(o.copyFolderPath,[`prevent`]),[`enter`]),h(p(o.copyFolderPath,[`prevent`]),[`space`])]},[s(`span`,se,[e(v,{"aria-hidden":`true`},{default:_(()=>[e(o.CopyDocument)]),_:1})]),s(`span`,ce,u(o.$t(`@67CE7:复制文件夹路径`)),1)],40,oe),i[23]||=s(`li`,{class:`proj-menu__sep`,role:`separator`},null,-1),s(`li`,le,u(o.$t(`@WORKBENCH:用工具打开`)),1),(x(!0),c(f,null,d(o.OPEN_WITH_TOOLS,t=>(x(),c(`li`,{key:t.id,class:l([`proj-menu__item`,{"is-missing":o.toolMissing(t.id)}]),role:`menuitem`,tabindex:`-1`,onClick:e=>o.openWithTool(t.id),onKeydown:[h(p(e=>o.openWithTool(t.id),[`prevent`]),[`enter`]),h(p(e=>o.openWithTool(t.id),[`prevent`]),[`space`])]},[s(`span`,de,[e(o.SvgIcon,{"icon-class":t.icon,class:l({"icon-invert-dark":t.id===`codex`,"icon-outline-dark":o.DARK_TILE_ICON_IDS.has(t.id)})},null,8,[`icon-class`,`class`])]),s(`span`,fe,u(o.$t(t.labelKey)),1),o.toolMissing(t.id)?(x(),c(`span`,pe,u(o.$t(`@67CE7:未安装`)),1)):C(`v-if`,!0)],42,ue))),128)),C(` claude 有两种权限模式,不混进上面的工具列表(顶栏也是单独排布的) `),s(`li`,{class:l([`proj-menu__item`,{"is-missing":o.toolMissing(`claude`)}]),role:`menuitem`,tabindex:`-1`,onClick:i[0]||=e=>o.openWithTool(`claude`),onKeydown:[i[1]||=h(p(e=>o.openWithTool(`claude`),[`prevent`]),[`enter`]),i[2]||=h(p(e=>o.openWithTool(`claude`),[`prevent`]),[`space`])]},[s(`span`,me,[s(`img`,{src:o.claudeCodeIcon,alt:``,class:`proj-menu__img`},null,8,he)]),s(`span`,ge,u(o.$t(`@67CE7:用 Claude Code 打开`)),1),s(`span`,_e,u(o.toolMissing(`claude`)?o.$t(`@67CE7:未安装`):o.$t(`@67CE7:默认权限`)),1)],34),s(`li`,{class:l([`proj-menu__item proj-menu__item--danger`,{"is-missing":o.toolMissing(`claude`)}]),role:`menuitem`,tabindex:`-1`,onClick:i[3]||=e=>o.openWithTool(`claude`,`bypassPermissions`),onKeydown:[i[4]||=h(p(e=>o.openWithTool(`claude`,`bypassPermissions`),[`prevent`]),[`enter`]),i[5]||=h(p(e=>o.openWithTool(`claude`,`bypassPermissions`),[`prevent`]),[`space`])]},[s(`span`,ve,[s(`img`,{src:o.claudeCodeIcon,alt:``,class:`proj-menu__img`},null,8,ye)]),s(`span`,be,u(o.$t(`@67CE7:用 Claude Code 打开(完全批准)`)),1)],34),C(` opencode 的「完全批准」(\`--auto\`)与 claude 的 bypass 档并列收在末尾:
|
|
4
4
|
它带警示色,混进上面的普通工具列表会把"一行一个工具"的节奏打乱,
|
package/src/ui/public/index.html
CHANGED
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
<meta name="theme-color" content="#141820" media="(prefers-color-scheme: dark)" />
|
|
11
11
|
<title>Zen GitSync</title>
|
|
12
12
|
<!-- 字体改为自托管(@font-face 见 src/main.css),不再依赖 Google Fonts 外链 -->
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-cDiVh_ZL.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/dagre-CpKxpMNH.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/element-plus-Bz6lYur-.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-C2k0GBzj.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/SvgIcon-
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BhdsvhKo.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/SvgIcon-WpEiC1rI.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/socket-io-BFqQXqAp.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/configStore-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/toolsStore-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/configStore-Drlw8KtR.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/toolsStore-CnX34C96.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/monaco-CvMddat7.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/flow-mindmap-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/CommonDialog-
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/flow-mindmap-cTg78Krq.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/CommonDialog-BkuDIWro.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/vue-flow-Cnxq2qrs.js">
|
|
27
27
|
<link rel="stylesheet" crossorigin href="/assets/element-plus-D-6gla1z.css">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/vendor-CSFGMcMB.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/assets/SvgIcon-CDNsk4-Q.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/assets/monaco-B2lPvkrc.css">
|
|
31
|
-
<link rel="stylesheet" crossorigin href="/assets/flow-mindmap-
|
|
31
|
+
<link rel="stylesheet" crossorigin href="/assets/flow-mindmap-BwYC4xxV.css">
|
|
32
32
|
<link rel="stylesheet" crossorigin href="/assets/CommonDialog-w6EmBEXv.css">
|
|
33
33
|
<link rel="stylesheet" crossorigin href="/assets/vue-flow-CavUTEzp.css">
|
|
34
34
|
<link rel="stylesheet" crossorigin href="/assets/index-DSQ6mp_N.css">
|
|
@@ -374,7 +374,7 @@ ${isWin ? `- This is Windows. The following Unix commands do NOT exist here:
|
|
|
374
374
|
// 分流、摘要注进请求副本(agentParity.test.js 有守卫)。
|
|
375
375
|
//
|
|
376
376
|
// 返回: { aborted: boolean }
|
|
377
|
-
export async function runAgentTurn({ session, model, userMessage, images = [], cwd, locale, openFilePath, attachments = [], dirStatusBlock = '', signal, send, onChild, askUser, listProjects, registerProject, dispatchTask, getContextBlock, requestBudget = null, resume = false, streamFn = streamChatOnce, promptSection }) {
|
|
377
|
+
export async function runAgentTurn({ session, model, userMessage, images = [], cwd, locale, openFilePath, docNote = '', attachments = [], dirStatusBlock = '', signal, send, onChild, askUser, listProjects, registerProject, dispatchTask, getContextBlock, requestBudget = null, resume = false, streamFn = streamChatOnce, promptSection }) {
|
|
378
378
|
const ctx = { cwd, locale, onChild, askUser, listProjects, registerProject, dispatchTask };
|
|
379
379
|
|
|
380
380
|
// 确保 session.messages 存在
|
|
@@ -474,7 +474,7 @@ export async function runAgentTurn({ session, model, userMessage, images = [], c
|
|
|
474
474
|
const messages = prepareRequestMessages(session.messages, { locale, ...budget });
|
|
475
475
|
// 请求级上下文:用户固定提示词 + 工作区状态快照 + 常用目录状态 + 当前打开的文档
|
|
476
476
|
// + 本轮附件路径 + 扩展层摘要(只改副本,不落 session.messages,下一轮不重复累积)
|
|
477
|
-
injectRequestContext(messages, { cwd, openFilePath, attachments, locale, workspaceBlock, dirStatusBlock, promptSection: userPromptSection, extensionSection: extensionPromptSuffix(extensions, locale) });
|
|
477
|
+
injectRequestContext(messages, { cwd, openFilePath, docNote, attachments, locale, workspaceBlock, dirStatusBlock, promptSection: userPromptSection, extensionSection: extensionPromptSuffix(extensions, locale) });
|
|
478
478
|
|
|
479
479
|
// 上下文占用:在**请求发出去之前**量一次,发给 UI 画圆环。
|
|
480
480
|
// 为什么必须在发之前:provider 的真实 usage(input_tokens)要等响应回来才有,
|
|
@@ -660,7 +660,8 @@ function summarizeArgs(name, args) {
|
|
|
660
660
|
|
|
661
661
|
// ── 请求级上下文注入(用户固定提示词 / 工作区状态 / 常用目录状态 / 文件空间对话 / 本轮附件 / 扩展层摘要) ──
|
|
662
662
|
// 把"用户配的两块固定提示词""工作区各板块的状态摘要""常用目录那批目录的 Git 状态"
|
|
663
|
-
// "用户当前打开的文件""本轮附件的落盘路径"与
|
|
663
|
+
// "用户当前打开的文件""宿主补充的当前上下文(docNote)""本轮附件的落盘路径"与
|
|
664
|
+
// "扩展层摘要(Skill + MCP)"追加到
|
|
664
665
|
// **请求副本**的 system 消息末尾:只影响这一次请求,session.messages 与磁盘历史保持
|
|
665
666
|
// 原样,下一轮也不会重复累积。
|
|
666
667
|
//
|
|
@@ -677,7 +678,7 @@ function summarizeArgs(name, args) {
|
|
|
677
678
|
// 附件为什么只给路径、不给内容:见 utils/agentAttachments.js 的头注释 —— 非图片附件
|
|
678
679
|
// 由服务端落盘,模型自己用 read / grep 按需取,比把几百 KB 文本内联进消息省得多。
|
|
679
680
|
// 快照块同理,只给摘要与目录路径,板块正文由模型按需读。
|
|
680
|
-
export function injectRequestContext(messages, { cwd, openFilePath, attachments = [], locale, workspaceBlock = '', dirStatusBlock = '', promptSection = '', extensionSection = '' }) {
|
|
681
|
+
export function injectRequestContext(messages, { cwd, openFilePath, docNote = '', attachments = [], locale, workspaceBlock = '', dirStatusBlock = '', promptSection = '', extensionSection = '' }) {
|
|
681
682
|
if (!Array.isArray(messages)) return;
|
|
682
683
|
const en = String(locale || '').startsWith('en');
|
|
683
684
|
|
|
@@ -712,6 +713,13 @@ export function injectRequestContext(messages, { cwd, openFilePath, attachments
|
|
|
712
713
|
}
|
|
713
714
|
}
|
|
714
715
|
|
|
716
|
+
// ②' 宿主补充的当前上下文(思维导图页:导图文件位置 + "生成导图"的输出约定)。
|
|
717
|
+
// 原文由前端给(它才知道面板此刻在什么界面),这里只做转发 —— 同样
|
|
718
|
+
// 只进请求副本,不落 session.messages。
|
|
719
|
+
if (typeof docNote === 'string' && docNote.trim()) {
|
|
720
|
+
parts.push(docNote.trim());
|
|
721
|
+
}
|
|
722
|
+
|
|
715
723
|
// ③ 本轮附件:只给绝对路径,内容让模型自己去读
|
|
716
724
|
const files = (Array.isArray(attachments) ? attachments : [])
|
|
717
725
|
.filter(a => a && typeof a.path === 'string' && a.path)
|
|
@@ -49,6 +49,28 @@ test('injectRequestContext: 每轮都基于副本重新注入,不会重复累
|
|
|
49
49
|
assert.equal((second[0].content.match(/# 当前上下文/g) || []).length, 1)
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
+
test('injectRequestContext: docNote 原样进副本(项目外路径照样生效)', () => {
|
|
53
|
+
const messages = [{ role: 'system', content: 'rules' }]
|
|
54
|
+
// 思维导图页的用法:文件在项目外,openFilePath 那条会按"项目外忽略"丢掉,
|
|
55
|
+
// 所以宿主改用 docNote 把格式约定带上来 —— 这条不受项目根限制。
|
|
56
|
+
injectRequestContext(messages, {
|
|
57
|
+
cwd: ROOT,
|
|
58
|
+
openFilePath: 'D:/maps/a.mindmap.json',
|
|
59
|
+
docNote: '用户此刻在「思维导图」视图里。用 ```mindmap 输出大纲。',
|
|
60
|
+
locale: 'zh'
|
|
61
|
+
})
|
|
62
|
+
assert.match(messages[0].content, /# 当前上下文/)
|
|
63
|
+
assert.match(messages[0].content, /思维导图/)
|
|
64
|
+
assert.ok(!messages[0].content.includes('D:/maps/a.mindmap.json'), '项目外的 openFilePath 仍被忽略')
|
|
65
|
+
assert.ok(!messages[0].content.includes('用户此刻在文件空间打开的文件'), '没有走 openFilePath 那条说明')
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('injectRequestContext: 空 docNote 不产生空段落', () => {
|
|
69
|
+
const messages = [{ role: 'system', content: 'rules' }]
|
|
70
|
+
injectRequestContext(messages, { cwd: ROOT, docNote: ' ', locale: 'zh' })
|
|
71
|
+
assert.equal(messages[0].content, 'rules')
|
|
72
|
+
})
|
|
73
|
+
|
|
52
74
|
test('injectRequestContext: 附件只注入绝对路径,内容不进消息体', () => {
|
|
53
75
|
const messages = [{ role: 'system', content: 'rules' }, { role: 'user', content: '看下这个日志' }]
|
|
54
76
|
injectRequestContext(messages, {
|
|
@@ -456,6 +456,12 @@ export function registerAgentRoutes({ app, getCurrentProjectPath, configManager,
|
|
|
456
456
|
// 文件空间对话:客户端把"当前打开的文档"带上来,服务端只在请求副本里注入上下文(不落库)
|
|
457
457
|
const openFilePath = String(req.body?.openFilePath || '').trim().slice(0, 512);
|
|
458
458
|
|
|
459
|
+
// 宿主补充的当前上下文说明(思维导图页:导图文件位置 + "生成导图"的输出约定)。
|
|
460
|
+
// 为什么不用 openFilePath:导图落在用户自选目录里,常常在项目根之外,那条注入
|
|
461
|
+
// 按"项目外忽略"会整段丢掉;而且这里要说的是格式约定,不是"哪个文件开着"。
|
|
462
|
+
// 与其它请求级上下文同一条路 —— 内置引擎塞请求副本、外部引擎拼 prompt 前缀,都不落会话。
|
|
463
|
+
const docNote = String(req.body?.docNote || '').trim().slice(0, 4000);
|
|
464
|
+
|
|
459
465
|
// 切换工作目录弹窗里的 g ai 追问:客户端把"常用目录那批目录的状态"带上来。
|
|
460
466
|
// 与 /api/recent_directories/summary 完全是同一份数据形状,走同一个归一化函数;
|
|
461
467
|
// 真正拼块要等拿到 configManager(需要读最近目录白名单),见下面 cwd 那一段。
|
|
@@ -719,6 +725,11 @@ export function registerAgentRoutes({ app, getCurrentProjectPath, configManager,
|
|
|
719
725
|
if (dirStatusBlock) {
|
|
720
726
|
promptPrefix = promptPrefix ? `${dirStatusBlock}\n\n${promptPrefix}` : dirStatusBlock;
|
|
721
727
|
}
|
|
728
|
+
// 宿主的当前上下文说明(思维导图页的导图格式约定)。外部引擎那边 openFilePath
|
|
729
|
+
// 根本传不进去,所以这类"宿主才知道的约定"只能走前缀。
|
|
730
|
+
if (docNote) {
|
|
731
|
+
promptPrefix = promptPrefix ? `${docNote}\n\n${promptPrefix}` : docNote;
|
|
732
|
+
}
|
|
722
733
|
// 用户固定提示词排在最前:它是每轮都成立的规则,工作区快照是这一刻的现场。
|
|
723
734
|
// 外部引擎那条链路的 system 提示词是 CLI 自己的,进不去 —— 只能靠这个前缀。
|
|
724
735
|
if (promptSection) {
|
|
@@ -757,6 +768,7 @@ export function registerAgentRoutes({ app, getCurrentProjectPath, configManager,
|
|
|
757
768
|
cwd,
|
|
758
769
|
locale,
|
|
759
770
|
openFilePath,
|
|
771
|
+
docNote,
|
|
760
772
|
attachments,
|
|
761
773
|
dirStatusBlock,
|
|
762
774
|
signal: abortController.signal,
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{An as e,Bn as t,Cn as n,Gn as r,In as i,Kr as a,Mn as o,On as s,Sn as c,Tn as l,Un as u,W as ee,Wr as d,Xr as f,Yn as p,_n as m,_r as te,ar as h,gn as g,gr as _,hn as v,i as y,ir as b,jr as x,kn as S,ln as ne,lr as re,mn as C,nr as w,on as T,pn as E,qn as D,r as ie,wn as O,xn as k,yn as ae}from"./element-plus-Bz6lYur-.js";import{c as oe,l as se,t as ce}from"./vendor-C2k0GBzj.js";import{n as A,t as j}from"./_plugin-vue_export-helper-Dz34f-q7.js";import{t as le}from"./SvgIcon-DkU8Uro2.js";import{t as ue}from"./configStore-BjNspgAX.js";import{a as de,c as fe,i as pe,n as me,o as he,r as ge,s as _e}from"./monaco-CvMddat7.js";import{n as M,r as ve}from"./flow-mindmap-CpjwoduB.js";import{$ as ye,Q as be,X as xe,Z as Se,a as Ce,at as we,et as Te,f as Ee,it as De,nt as Oe,ot as ke,rt as Ae,st as je,tt as Me,ut as Ne}from"./index-BybDOX1D.js";import{a as Pe,c as Fe,i as Ie,l as Le,m as Re,n as ze,o as Be,r as Ve,s as N,t as P,u as F}from"./agentConversations-DLAC_0wI.js";import{c as He,d as Ue,n as We,t as Ge,u as Ke}from"./ChatSilenceBadge-ltPjxE4-.js";function qe(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,html:`html`,htm:`html`,css:`css`,scss:`scss`,less:`less`,json:`json`,jsonc:`json`,md:`markdown`,markdown:`markdown`,yaml:`yaml`,yml:`yaml`,toml:`ini`,xml:`xml`,svg:`xml`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,ps1:`powershell`,py:`python`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,rb:`ruby`,php:`php`,c:`c`,cpp:`cpp`,h:`cpp`,cs:`csharp`,sql:`sql`,graphql:`graphql`,gql:`graphql`,txt:`plaintext`,log:`plaintext`,ini:`ini`,env:`ini`,gitignore:`ini`,dockerfile:`dockerfile`}[e.toLowerCase()]??`plaintext`}i(),re();var I=o({__name:`MediaPreview`,props:{filePath:{type:String,required:!0},fileName:{type:String,required:!1}},setup(e,{expose:t}){t();let n=e,r=k(()=>De(n.filePath)??`audio`),i=k(()=>we(n.filePath)),a=k(()=>n.fileName||n.filePath.split(/[\\/]/).pop()||``),o=_(!0),s=_(!1),c=_(0),l=_(0),u=_(0),ee=_(0);async function d(){try{let e=await(await fetch(`/api/editor/file?path=${encodeURIComponent(n.filePath)}&meta=1`)).json();e?.success&&typeof e.size==`number`&&(l.value=e.size)}catch{}}w(()=>n.filePath,()=>{o.value=!0,s.value=!1,c.value=0,l.value=0,u.value=0,ee.value=0,d()},{immediate:!0});function f(e){let t=e.target;Number.isFinite(t.duration)&&t.duration>0&&(c.value=t.duration),t instanceof HTMLVideoElement&&(u.value=t.videoWidth,ee.value=t.videoHeight),o.value=!1}function p(){o.value=!1}function m(){o.value=!1,s.value=!0}function te(e){if(!Number.isFinite(e)||e<=0)return`--:--`;let t=Math.floor(e),n=t%60,r=Math.floor(t/60)%60,i=Math.floor(t/3600),a=String(r).padStart(2,`0`);return i>0?`${i}:${a}:${String(n).padStart(2,`0`)}`:`${r}:${String(n).padStart(2,`0`)}`}function h(e){return!e||e<0?``:e>=1073741824?`${(e/1024/1024/1024).toFixed(2)} GB`:e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}let g={props:n,kind:r,src:i,displayName:a,loading:o,error:s,duration:c,size:l,videoW:u,videoH:ee,fetchSize:d,onLoadedMetadata:f,onCanPlay:p,onError:m,formatDuration:te,formatSize:h,metaLine:k(()=>{let e=[r.value===`video`?A(`@EDITOR:视频`):A(`@EDITOR:音频`)];c.value>0&&e.push(te(c.value)),u.value>0&&ee.value>0&&e.push(`${u.value} × ${ee.value}`);let t=h(l.value);return t&&e.push(t),e.join(` · `)}),get $t(){return A}};return Object.defineProperty(g,"__isScriptSetup",{enumerable:!1,value:!0}),g}});i(),x();var L=[`data-media-kind`,`data-media-path`],R={class:`media-preview-stage`},z={key:0,class:`media-preview-error`},Je={class:`media-preview-error-title`},B={class:`media-preview-error-path`},V=[`src`],Ye={class:`media-preview-audio`},Xe=[`title`],Ze=[`src`],H={key:2,class:`media-preview-loading`},Qe={class:`media-preview-footer`},$e={class:`media-preview-meta`},et=[`title`];function tt(e,t,n,r,i,a){return D(),l(`div`,{class:`media-preview`,"data-media-kind":r.kind,"data-media-path":r.props.filePath},[c(`div`,R,[r.error?(D(),l(`div`,z,[t[0]||=c(`svg`,{viewBox:`0 0 24 24`,width:`40`,height:`40`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[c(`circle`,{cx:`12`,cy:`12`,r:`9`}),c(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`13`}),c(`line`,{x1:`12`,y1:`16.5`,x2:`12`,y2:`16.6`})],-1),c(`p`,Je,f(r.$t(`@EDITOR:无法播放该文件,可能是编码或格式不受支持`)),1),c(`p`,B,f(r.props.filePath),1)])):(D(),l(m,{key:1},[O(` 视频:占满可用区域,等比缩放(黑边由舞台底色补) `),r.kind===`video`?(D(),l(`video`,{key:r.props.filePath,class:`media-preview-video`,src:r.src,controls:``,playsinline:``,preload:`metadata`,onLoadedmetadata:r.onLoadedMetadata,onCanplay:r.onCanPlay,onError:r.onError},null,40,V)):(D(),l(m,{key:1},[O(` 音频:中间一块信息 + 原生控制条。不套"圆角 + 单边框"的卡片 `),c(`div`,Ye,[t[1]||=s(`<div class="media-preview-glyph" aria-hidden="true" data-v-35007775><svg viewBox="0 0 24 24" width="46" height="46" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-35007775><path d="M3 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" data-v-35007775></path><path d="M9 17v-13h10v13" data-v-35007775></path><path d="M9 8h10" data-v-35007775></path></svg></div>`,1),c(`p`,{class:`media-preview-title`,title:r.props.filePath},f(r.displayName),9,Xe),(D(),l(`audio`,{key:r.props.filePath,class:`media-preview-audio-el`,src:r.src,controls:``,preload:`metadata`,onLoadedmetadata:r.onLoadedMetadata,onCanplay:r.onCanPlay,onError:r.onError},null,40,Ze))])],2112)),r.loading?(D(),l(`div`,H,[t[2]||=c(`span`,{class:`media-preview-spinner`},null,-1),c(`span`,null,f(r.$t(`@EDITOR:正在载入媒体文件…`)),1)])):O(`v-if`,!0)],64))]),c(`div`,Qe,[c(`span`,$e,f(r.metaLine),1),r.kind===`video`?(D(),l(`span`,{key:0,class:`media-preview-name`,title:r.props.filePath},f(r.displayName),9,et)):O(`v-if`,!0)])],8,L)}var nt=j(I,[[`render`,tt],[`__scopeId`,`data-v-35007775`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MediaPreview.vue`]]);i();var rt=o({__name:`MindmapPreview`,props:{content:{type:String,required:!0}},setup(e,{expose:t}){t();let n=e,r={props:n,data:k(()=>ve(n.content||``,`未命名文档`)),get MindMap(){return M}};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}});i();var it={class:`mindmap-preview`},at={class:`mindmap-preview-canvas`};function ot(t,n,r,i,a,o){return D(),l(`div`,it,[n[0]||=c(`div`,{class:`mindmap-preview-header`},[c(`span`,{class:`mindmap-preview-title`},`整篇导图`),c(`span`,{class:`mindmap-preview-hint`},`基于整篇 Markdown 自动生成 · 阅读模式`)],-1),c(`div`,at,[e(i.MindMap,{data:i.data,"preview-mode":``},null,8,[`data`])])])}var st=j(rt,[[`render`,ot],[`__scopeId`,`data-v-3969a8bf`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MindmapPreview.vue`]]);i(),re();var ct=o({__name:`EditorAgentPanel`,props:{activeFilePath:{type:[String,null],required:!1},activeFileName:{type:String,required:!1},active:{type:Boolean,required:!1},fullscreen:{type:Boolean,required:!1}},emits:[`close`,`toggle-fullscreen`],setup(e,{expose:n,emit:i}){n();let a=e,o=i,{theme:s}=Me(),c=k(()=>s.value===`dark`?`dark`:`light`),{sessions:l,sessionsLoading:ee,currentSessionId:d,messages:f,displayMessages:p,isStreaming:m,questionPanel:te,answeringQuestion:h,isSessionGenerating:g,currentEngine:v,pendingEngine:y,isEngineLocked:b,pickEngine:x,loadSessions:S,loadSession:ne,deleteSession:re,renameSession:C,newSession:T,sendMessage:E,retryTurn:D,answerQuestion:ie,stop:O,inputContextUsage:ae,queuedMessages:j,queuePaused:le,removeQueuedMessage:de,flushQueued:fe,silentMs:pe}=F(),me=ue(),he=Ne(),ge=k(()=>{let e=me.models.find(e=>e.isDefault);return e&&(e.name||e.model)||``}),_e=k(()=>b.value?v.value:y.value);function M(e){b.value||x(e)}let ve=k(()=>Fe(l.value,g)),ye=Pe(),be=Be(),xe=N(),Se=k(()=>ve.value.find(e=>e.id===d.value)?.title||``),Ce=_(null),we=_(null),Te=_(null),Ee=_(null),De=_(null),{width:Oe,narrow:ke}=Ue(De),Ae=_(`chat`),{convListCollapsed:je,setConvListCollapsed:qe}=Ke(),I=k(()=>!ke.value&&je.value),L=_(null),R=_(!1),z=null,Je=k(()=>!!a.activeFileName&&!R.value);function B(e){return Array.from(e.children).find(e=>e.classList?.contains(`acu-input-attachments`))??null}function V(){let e=we.value?.$el;if(!e)return;let n=e.querySelector(`.agent-context-slot`);if(!Je.value){if(!n)return;L.value=null,t(()=>n.remove());return}let r=L.value&&e.contains(L.value)?L.value:n;r||(r=document.createElement(`div`),r.className=`agent-context-slot`);let i=B(e),a=i??e;r.parentElement!==a&&a.insertBefore(r,i?i.firstChild:e.firstChild),L.value=r}function Ye(e=!0){Ce.value?.scrollToBottom(e)}async function Xe(e){let n=R.value?void 0:a.activeFilePath||void 0;await E(e.text,e.files,{openFilePath:n}),await t(),Ye()}function Ze(e){ne(e),Ae.value=`chat`}function H(){T(),Ae.value=`chat`}w(()=>f.value.length,()=>{t(()=>Ye(!1))});function Qe(){let e=Ee.value;!e||typeof MutationObserver>`u`||(z?.disconnect(),z=new MutationObserver(()=>V()),z.observe(e,{childList:!0,subtree:!0}))}w(()=>a.active,e=>{e&&(Ae.value=`chat`,S().catch(()=>{}),t(()=>{V(),Ye(!1)}))}),w(ke,e=>{e||(Ae.value=`chat`)}),w(()=>a.activeFilePath,()=>{R.value=!1}),w(Je,e=>{e&&t(V)}),r(()=>{S().catch(()=>{}),t(()=>{V(),Qe()})}),u(()=>{z?.disconnect(),z=null,L.value=null});let $e={props:a,emit:o,theme:s,chatTheme:c,sessions:l,sessionsLoading:ee,currentSessionId:d,messages:f,displayMessages:p,isStreaming:m,questionPanel:te,answeringQuestion:h,isSessionGenerating:g,currentEngine:v,pendingEngine:y,isEngineLocked:b,pickEngine:x,loadSessions:S,loadSession:ne,deleteSession:re,renameSession:C,newSession:T,sendMessage:E,retryTurn:D,answerQuestion:ie,stop:O,inputContextUsage:ae,queuedMessages:j,queuePaused:le,removeQueuedMessage:de,flushQueued:fe,silentMs:pe,configStore:me,gitStore:he,inputModelName:ge,displayEngine:_e,onEngineSelect:M,conversationItems:ve,conversationLabels:ye,questionLabels:be,queueLabels:xe,currentSessionTitle:Se,chatRef:Ce,inputRef:we,chatHostRef:Te,composerRef:Ee,rootRef:De,width:Oe,narrow:ke,page:Ae,convListCollapsed:je,setConvListCollapsed:qe,convsCollapsed:I,contextSlot:L,contextDismissed:R,get slotObserver(){return z},set slotObserver(e){z=e},showContextCard:Je,findAttachmentsHost:B,syncContextSlot:V,scrollToBottom:Ye,onSend:Xe,onSelectSession:Ze,onNewSession:H,watchChatDom:Qe,get $t(){return A},get ChatContainer(){return oe},get ChatInput(){return se},get ConversationList(){return ce},get AGENT_UPLOAD_ACCEPT(){return Le},get agentEngineName(){return Re},get AGENT_ASSISTANT_NAME(){return ze},get AGENT_ASSISTANT_AVATAR(){return P},get MESSAGE_RAIL_CONFIG(){return Ie},get MESSAGE_META_CONFIG(){return Ve},AgentEngineSelector:He,CopySessionButton:We,ChatSilenceBadge:Ge};return Object.defineProperty($e,"__isScriptSetup",{enumerable:!1,value:!0}),$e}});i(),x(),T();var lt={class:`agent-panel-header`},U=[`title`,`aria-label`],ut={class:`agent-panel-title`},dt={key:1,class:`agent-panel-title`},ft=[`title`,`aria-label`],W=[`title`,`aria-label`],pt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},mt={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},ht=[`title`],gt={class:`agent-panel-convs`},_t={ref:`chatHostRef`,class:`agent-panel-chat`},vt=[`data-theme`],yt=[`title`],bt={class:`agent-context-att-name`},G=[`title`,`aria-label`];function xt(t,r,i,a,o,u){return D(),l(m,null,[O(`
|
|
2
|
-
文件空间右侧的 g ai 对话面板。
|
|
3
|
-
- 够宽(≥680px,判据同「智能体」视图):左边一列会话历史 + 右边对话,历史**直接摆在那儿**,
|
|
4
|
-
不用先点按钮翻过去;不够宽就折成两页,头部按钮来回翻
|
|
5
|
-
- 输入框常驻底部:ChatContainer 传 show-input=false,输入框拆出来自己摆在面板最下方。
|
|
6
|
-
于是两种形态、两个页面都有输入框 —— 列表页也能直接开聊,翻页时草稿与附件都不丢
|
|
7
|
-
- 复用的都是组件库的独立导出:ConversationList(列表)+ ChatContainer(气泡区)+ ChatInput(输入框)
|
|
8
|
-
- "当前打开的文档"通过请求级注入告知模型(sendMessage 的 openFilePath 选项);
|
|
9
|
-
它修饰的是**这一条消息的上下文**,所以做成附件卡片、搬进输入框内部(见 contextSlot)
|
|
10
|
-
- 自己持有一个 useAgentChat 实例:runs/refs 与「对话」Tab 隔离,互不打断
|
|
11
|
-
`),O(`
|
|
12
|
-
全屏对话:盖住整个编辑区(左栏文件树不动)。父级负责把分隔条藏掉。
|
|
13
|
-
absolute 而不是改 flex-basis —— Monaco 留在原地、状态不重建。
|
|
14
|
-
`),c(`div`,{ref:`rootRef`,class:d([`editor-agent-panel`,{"is-fullscreen":i.fullscreen}])},[c(`div`,lt,[O(` 窄屏的列表页:整条 header 让给「返回对话 + 标题」 `),a.narrow&&a.page===`list`?(D(),l(m,{key:0},[c(`button`,{class:`agent-panel-icon-btn agent-panel-back-btn`,title:a.$t(`@EDITOR:返回对话`),"aria-label":a.$t(`@EDITOR:返回对话`),onClick:r[0]||=e=>a.page=`chat`},[...r[5]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[c(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),c(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,U),c(`span`,ut,f(a.$t(`@EDITOR:会话列表`)),1)],64)):(D(),l(`span`,dt,f(a.$t(`@EDITOR:g ai 对话`)),1)),r[10]||=c(`div`,{class:`agent-panel-spacer`},null,-1),O(` 本轮静默:与「智能体」页、主 Agent 控制台同一枚(等回答时不算静默) `),!a.narrow||a.page===`chat`?(D(),n(a.ChatSilenceBadge,{key:2,class:`agent-panel-silence`,"silent-ms":a.silentMs,streaming:a.isStreaming&&!a.questionPanel},null,8,[`silent-ms`,`streaming`])):O(`v-if`,!0),O(` 引擎切换:与「智能体」视图同一套(同一个 AgentEngineSelector)。
|
|
15
|
-
宽屏左边摆着历史,对话区一直在,所以常驻;窄屏只在对话页出现 ——
|
|
16
|
-
列表页没有正在跑的对话,摆这儿只会挤占标题。 `),!a.narrow||a.page===`chat`?(D(),n(a.AgentEngineSelector,{key:3,class:`agent-panel-engine`,engine:a.displayEngine,locked:a.isEngineLocked,onSelect:a.onEngineSelect},null,8,[`engine`,`locked`])):O(`v-if`,!0),O(` 复制整条会话:只有对话页才有"当前这条会话"可复制(列表页连引擎选择器都不摆) `),!a.narrow||a.page===`chat`?(D(),n(a.CopySessionButton,{key:4,class:`agent-panel-copy`,messages:a.messages,title:a.currentSessionTitle,engine:a.agentEngineName(a.displayEngine)},null,8,[`messages`,`title`,`engine`])):O(`v-if`,!0),O(` 会话列表按钮:只有"列表是独立一页"时才需要它(宽屏列表就在旁边) `),a.narrow&&a.page===`chat`?(D(),l(`button`,{key:5,class:`agent-panel-icon-btn agent-panel-list-btn`,title:a.$t(`@EDITOR:会话列表`),"aria-label":a.$t(`@EDITOR:会话列表`),onClick:r[1]||=e=>a.page=`list`},[...r[6]||=[s(`<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-7cc12c51><line x1="8" y1="6" x2="21" y2="6" data-v-7cc12c51></line><line x1="8" y1="12" x2="21" y2="12" data-v-7cc12c51></line><line x1="8" y1="18" x2="21" y2="18" data-v-7cc12c51></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-7cc12c51></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-7cc12c51></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-7cc12c51></line></svg>`,1)]],8,ft)):O(`v-if`,!0),c(`button`,{class:`agent-panel-icon-btn agent-panel-fullscreen-btn`,title:i.fullscreen?a.$t(`@EDITOR:退出全屏对话`):a.$t(`@EDITOR:全屏对话`),"aria-label":i.fullscreen?a.$t(`@EDITOR:退出全屏对话`):a.$t(`@EDITOR:全屏对话`),onClick:r[2]||=e=>a.emit(`toggle-fullscreen`)},[O(` 展开:四角朝外;收起:四角朝内(Tabler maximize / minimize) `),i.fullscreen?(D(),l(`svg`,mt,[...r[8]||=[c(`path`,{d:`M5 9h3a1 1 0 0 0 1-1V5`},null,-1),c(`path`,{d:`M15 5v3a1 1 0 0 0 1 1h3`},null,-1),c(`path`,{d:`M19 15h-3a1 1 0 0 0-1 1v3`},null,-1),c(`path`,{d:`M9 19v-3a1 1 0 0 0-1-1H5`},null,-1)]])):(D(),l(`svg`,pt,[...r[7]||=[c(`path`,{d:`M4 8V5a1 1 0 0 1 1-1h3`},null,-1),c(`path`,{d:`M16 4h3a1 1 0 0 1 1 1v3`},null,-1),c(`path`,{d:`M20 16v3a1 1 0 0 1-1 1h-3`},null,-1),c(`path`,{d:`M8 20H5a1 1 0 0 1-1-1v-3`},null,-1)]]))],8,W),c(`button`,{class:`agent-panel-icon-btn`,title:a.$t(`@EDITOR:关闭对话`),onClick:r[3]||=e=>a.emit(`close`)},[...r[9]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[c(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),c(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,ht)]),c(`div`,{class:d([`agent-panel-body`,{"is-wide":!a.narrow,"is-convs-collapsed":a.convsCollapsed}])},[O(` 会话历史:宽屏是常驻左列(可收起),窄屏是独享整页 `),h(c(`div`,gt,[e(a.ConversationList,{"show-search":!0,items:a.conversationItems,"active-id":a.currentSessionId,loading:a.sessionsLoading,labels:a.conversationLabels,collapsible:!a.narrow,collapsed:a.convsCollapsed,"onUpdate:collapsed":a.setConvListCollapsed,onSelect:a.onSelectSession,onNew:a.onNewSession,onRename:a.renameSession,onDelete:a.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`collapsible`,`collapsed`,`onUpdate:collapsed`,`onRename`,`onDelete`])],512),[[C,!a.narrow||a.page===`list`]]),O(` 气泡区:输入框已经不在这里了(show-input=false),见下面常驻的那一条 `),h(c(`div`,_t,[e(a.ChatContainer,{ref:`chatRef`,"show-input":!1,messages:a.displayMessages,"assistant-name":a.AGENT_ASSISTANT_NAME,"assistant-avatar":a.AGENT_ASSISTANT_AVATAR,theme:a.chatTheme,question:a.questionPanel,"question-submitting":a.answeringQuestion,"question-labels":a.questionLabels,"plan-config":{labels:{title:a.$t(`@AGENT:计划`),raw:a.$t(`@AGENT:原始参数`)}},"message-rail-config":a.MESSAGE_RAIL_CONFIG,"message-meta-config":a.MESSAGE_META_CONFIG,onAnswer:a.answerQuestion,onRetry:a.retryTurn},null,8,[`messages`,`assistant-name`,`assistant-avatar`,`theme`,`question`,`question-submitting`,`question-labels`,`plan-config`,`message-rail-config`,`message-meta-config`,`onAnswer`,`onRetry`])],512),[[C,!a.narrow||a.page===`chat`]]),O(`
|
|
17
|
-
输入框常驻:两种形态、两个页面都在最下方(与演示页同一套做法)。
|
|
18
|
-
它被拆到 ChatContainer 外面,所以 acu-root 与 data-theme 得自己套上:
|
|
19
|
-
库把盒模型重置限定在 .acu-root 子树里,而 ChatInput 根节点是 div(不是 button),
|
|
20
|
-
少了它就会退回 content-box、横着溢出面板。
|
|
21
|
-
|
|
22
|
-
v-if="width > 0":**等量到本面板的宽度再挂载输入框**。库的 ChatInput 只在
|
|
23
|
-
onMounted 里量一次 scrollHeight,量到的宽度不对就再也纠不回来 —— 实测首帧挂载时
|
|
24
|
-
容器还没宽度,占位文案被折成十几行,textarea 直接顶到 200px 上限并一直卡在那里。
|
|
25
|
-
宽度是 useNarrowPane 在 onMounted 里同步量到的,所以这里晚的只是一次重渲染。
|
|
26
|
-
`),a.width>0?(D(),l(`div`,{key:0,ref:`composerRef`,class:`agent-panel-composer acu-root`,"data-theme":a.chatTheme},[e(a.ChatInput,{ref:`inputRef`,generating:a.isStreaming,"allow-queue":!0,queued:a.queuedMessages,"queue-paused":a.queuePaused,"queue-labels":a.queueLabels,placeholder:a.isStreaming?a.$t(`@AGENT:生成中,发送后会排队,等本轮跑完自动接上…`):a.$t(`@AGENT:输入消息,Enter 发送`),"upload-config":{accept:a.AGENT_UPLOAD_ACCEPT},"context-usage":a.inputContextUsage,"git-branch":a.gitStore.currentBranch||void 0,model:a.inputModelName||void 0,onSend:a.onSend,onStop:a.stop,onUnqueue:a.removeQueuedMessage,onFlushQueued:a.flushQueued},null,8,[`generating`,`queued`,`queue-paused`,`queue-labels`,`placeholder`,`upload-config`,`context-usage`,`git-branch`,`model`,`onStop`,`onUnqueue`,`onFlushQueued`]),O(`
|
|
27
|
-
当前文档:**和添加的附件同处一行、同一副样子**。
|
|
28
|
-
组件库的 ChatContainer / ChatInput 没有任何插槽(dist 里 \`slots\` 出现 0 次),
|
|
29
|
-
没法声明式地往输入框里放东西,所以:
|
|
30
|
-
· 往 \`.acu-input-wrap\` 插一个锚点,再把卡片 Teleport 进去(节点仍是 Vue 渲染的);
|
|
31
|
-
· **有附件行(.acu-input-attachments)时锚点住进它内部** —— 卡片因此成为那一行的
|
|
32
|
-
flex item,与附件并排、共用同一套 gap/wrap。只插在输入框最前面是不行的:
|
|
33
|
-
Vue 更新输入框时会用自己的锚点 \`insertBefore\`,把外来节点挤到后面去。
|
|
34
|
-
`),a.contextSlot?(D(),n(ae,{key:0,to:a.contextSlot},[a.showContextCard?(D(),l(`div`,{key:0,class:`agent-context-att`,title:i.activeFilePath||``},[r[12]||=c(`svg`,{class:`agent-context-att-icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[c(`path`,{d:`M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z`}),c(`polyline`,{points:`14 3 14 8 19 8`})],-1),c(`span`,bt,f(i.activeFileName),1),c(`button`,{type:`button`,class:`agent-context-att-remove`,title:a.$t(`@EDITOR:不引用当前文档`),"aria-label":a.$t(`@EDITOR:不引用当前文档`),onClick:r[4]||=e=>a.contextDismissed=!0},[...r[11]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"aria-hidden":`true`},[c(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),c(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,G)],8,yt)):O(`v-if`,!0)],8,[`to`])):O(`v-if`,!0)],8,vt)):O(`v-if`,!0)],2)],2)],2112)}var St=j(ct,[[`render`,xt],[`__scopeId`,`data-v-7cc12c51`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/EditorAgentPanel.vue`]]),Ct=1080,wt=6e5,Tt=.86;function Et(e){if(!e||e.startsWith(`data:`))return!1;if(e.startsWith(`blob:`)||e.startsWith(`/`))return!0;try{return new URL(e,location.href).origin===location.origin}catch{return!1}}async function Dt(e){try{let t=await fetch(e);if(!t.ok)return null;let n=await t.blob();return await new Promise(e=>{let t=new FileReader;t.onload=()=>e(t.result||``),t.onerror=()=>e(``),t.readAsDataURL(n)})}catch{return null}}function Ot(e){return new Promise(t=>{let n=!1,r=e=>{n||(n=!0,t(e))};if(typeof Image>`u`){r(e);return}let i=new Image,a=setTimeout(()=>r(e),4e3);i.onload=()=>{if(clearTimeout(a),!(i.naturalWidth>Ct||e.length>wt)){r(e);return}try{let t=Math.min(1,Ct/i.naturalWidth),n=Math.max(1,Math.round(i.naturalWidth*t)),a=Math.max(1,Math.round(i.naturalHeight*t)),o=document.createElement(`canvas`);o.width=n,o.height=a;let s=o.getContext(`2d`);if(!s){r(e);return}s.fillStyle=`#ffffff`,s.fillRect(0,0,n,a),s.drawImage(i,0,0,n,a),r(o.toDataURL(`image/jpeg`,Tt))}catch{r(e)}},i.onerror=()=>{clearTimeout(a),r(e)},i.src=e})}async function kt(e){let t=await Dt(e);return t?Ot(t):null}async function At(e){let t=Array.from(e.querySelectorAll(`img`)).filter(e=>Et(e.getAttribute(`src`)||``)),n=0;return await Promise.all(t.map(async e=>{let t=await kt(e.getAttribute(`src`)||``);t?e.setAttribute(`src`,t):n+=1})),n}function K(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var jt={h1:`font-size:26px;font-weight:700;line-height:1.35;margin:28px 0 16px;color:#111;`,h2:`font-size:22px;font-weight:700;line-height:1.4;margin:26px 0 14px;color:#111;`,h3:`font-size:19px;font-weight:700;line-height:1.45;margin:22px 0 12px;color:#222;`,h4:`font-size:17px;font-weight:600;line-height:1.5;margin:20px 0 10px;color:#333;`,h5:`font-size:16px;font-weight:600;line-height:1.5;margin:18px 0 8px;color:#333;`,h6:`font-size:15px;font-weight:600;line-height:1.5;margin:18px 0 8px;color:#555;`,p:`font-size:16px;line-height:1.8;margin:16px 0;color:#333;`,li:`font-size:16px;line-height:1.8;margin:0 0 6px;color:#333;`,ul:`margin:16px 0;padding-left:24px;`,ol:`margin:16px 0;padding-left:24px;`,blockquote:`margin:16px 0;padding:8px 16px;border-left:4px solid #e2e2e2;background:#f7f7f7;color:#666;font-size:15px;line-height:1.8;`,hr:`border:none;border-top:1px solid #e5e5e5;margin:26px 0;`,a:`color:#576b95;text-decoration:none;`,strong:`font-weight:700;color:#111;`,em:`font-style:italic;color:#555;`,code:`font-family:Menlo,Consolas,Monaco,monospace;font-size:0.92em;background:#f2f3f5;color:#c7254e;padding:1px 5px;border-radius:3px;`,pre:`font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.6;background:#f6f8fa;color:#24292f;padding:12px 14px;border-radius:6px;overflow-x:auto;margin:16px 0;`,table:`border-collapse:collapse;width:100%;margin:16px 0;font-size:14px;`,th:`border:1px solid #e0e0e0;padding:8px 10px;background:#f6f8fa;font-weight:600;text-align:left;color:#333;`,td:`border:1px solid #e0e0e0;padding:8px 10px;color:#333;`,img:`max-width:100%;height:auto;display:block;margin:16px auto;border-radius:6px;`};function Mt(e){e.querySelectorAll(`*`).forEach(e=>{let t=jt[e.tagName.toLowerCase()];t&&e.setAttribute(`style`,t)}),e.querySelectorAll(`pre code`).forEach(e=>e.setAttribute(`style`,`background:none;padding:0;color:inherit;font-size:inherit;`))}async function Nt(e,t){let n=e.cloneNode(!0),r=t?await At(n):0;return{html:n.innerHTML,leftover:r}}async function Pt(e,t){let n=e.cloneNode(!0),r=t.inline?await At(n):0;Mt(n);let i=(t.title||``).trim();return{html:`<section style="font-size:16px;line-height:1.8;color:#333;word-break:break-word;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;">${i?`<h1 style="font-size:26px;font-weight:700;line-height:1.35;margin:0 0 22px;color:#111;">${K(i)}</h1>`:``}${n.innerHTML}</section>`,leftover:r}}i(),re();var Ft=2,It=6e4,Lt=3e4,Rt=300,zt=320,q=o({__name:`EditorView`,props:{pendingFilePath:{type:[String,null],required:!1}},setup(e,{expose:n}){n(),self.MonacoEnvironment={getWorker(e,t){return t===`json`?new _e:t===`css`||t===`scss`||t===`less`?new he:t===`html`||t===`handlebars`||t===`razor`?new de:t===`typescript`||t===`javascript`?new pe:new fe}};let i=e,a=ue(),o=Ee(),s=_([]),c=_(!1),l=_(``),d=_(``),f=null;function p(){l.value=``,d.value=``,f&&=(clearTimeout(f),null)}w(l,e=>{f&&clearTimeout(f),f=setTimeout(()=>{d.value=e,f=null},180)});let m=_([]),h=_(0),g=_(``),v=_(!1),b=_(!1),x=null,S=0;function ne(){x?.abort(),x=null,S+=1,m.value=[],h.value=0,g.value=``,v.value=!1,b.value=!1}async function re(e){let t=e.trim(),n=a.currentDirectory;if(!n||t.length<Ft){ne();return}if(t===g.value&&v.value)return;x?.abort();let r=++S,i=new AbortController;x=i,v.value=!0,g.value=t;try{let e=await(await fetch(`/api/search_content`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n,query:t}),signal:i.signal})).json().catch(()=>null);if(r!==S)return;if(!e?.success){m.value=[],h.value=0,b.value=!1;return}m.value=Array.isArray(e.files)?e.files:[],h.value=typeof e.totalMatches==`number`?e.totalMatches:0,b.value=!!e.truncated}catch(e){if(e?.name===`AbortError`||r!==S)return;m.value=[],h.value=0,b.value=!1}finally{r===S&&(v.value=!1)}}w(d,e=>{re(e)}),u(()=>{f&&clearTimeout(f),x?.abort(),E(),lt()});let C=null;function T(){E(),a.ui.fileTreeAutoRefresh&&(C=setInterval(()=>{document.hidden||a.currentDirectory&&(l.value.trim()||j())},It))}function E(){C&&=(clearInterval(C),null)}w(()=>a.currentDirectory,async()=>{if(I=!1,ne(),T(),await O(),N.value.some(e=>e.isDirty)){I=!0;return}N.value=[],P.value=null,Xe(),await z()}),w(()=>a.ui.fileTreeAutoRefresh,()=>{T()});async function D(e,t=0){let n=await(await fetch(`/api/browse_directory?path=${encodeURIComponent(e)}`)).json();return n.success?n.items.map(e=>({...e,depth:t,expanded:!1,loading:!1,children:(e.type,void 0)})):[]}async function O(){let e=a.currentDirectory;if(e){c.value=!0;try{s.value=await D(e,0)}finally{c.value=!1}}}function ae(e,t=new Set){for(let n of e)n.type===`directory`&&n.expanded&&(t.add(n.path),n.children&&ae(n.children,t));return t}function oe(e,t=0){return(e||[]).map(e=>{let n={name:e.name,path:e.path,type:e.type,depth:t,expanded:!1,loading:!1};return n.type===`directory`&&Array.isArray(e.children)&&(n.children=oe(e.children,t+1),n.expanded=!0),n})}async function se(e){let t=a.currentDirectory;if(!t)return null;try{let n=await(await fetch(`/api/browse_directory_tree`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t,expand:e})})).json().catch(()=>null);return!n?.success||!Array.isArray(n.items)?null:oe(n.items,0)}catch{return null}}function ce(e,t){let n=new Map(e.map(e=>[e.path,e])),r=e.length!==t.length;if(!r){for(let n=0;n<t.length;n++)if(e[n].path!==t[n].path){r=!0;break}}for(let e=0;e<t.length;e++){let i=t[e],a=n.get(i.path);a&&(t[e]=a,a.name!==i.name&&(a.name=i.name,r=!0),a.type===`directory`&&a.expanded&&Array.isArray(i.children)&&(Array.isArray(a.children)?ce(a.children,i.children)&&(a.children=i.children,r=!0):(a.children=i.children,r=!0)))}return r}async function j(e={}){if(!a.currentDirectory)return;let t=await se([...ae(s.value)]);if(!t){e.notifyOnError&&y.error(A(`@EDITOR:刷新失败`));return}if(s.value.length===0){s.value=t;return}ce(s.value,t)&&(s.value=t)}async function M(e){if(e.type===`directory`){if(e.expanded)e.expanded=!1;else{if(!e.children){e.loading=!0;try{e.children=await D(e.path,e.depth+1)}finally{e.loading=!1}}e.expanded=!0}}}function ve(e){let t=[];for(let n of e)t.push(n),n.type===`directory`&&n.expanded&&n.children&&t.push(...ve(n.children));return t}let we=k(()=>d.value.trim().toLowerCase());function De(e,t){if(!t)return e;let n=[];for(let r of e){let e=r.name.toLowerCase().includes(t);if(r.type===`directory`){let i=r.children?De(r.children,t):[];if(!e&&i.length===0)continue;n.push({...r,expanded:!0,children:r.children===void 0?void 0:i})}else e&&n.push(r)}return n}function Ne(e,t){for(let n of e){if(n.path===t)return n;if(n.children){let e=Ne(n.children,t);if(e)return e}}return null}let Pe=k(()=>De(s.value,we.value)),Fe=k(()=>we.value.length>0&&Pe.value.length===0),Ie=k(()=>Fe.value&&m.value.length===0&&!v.value);function Le(e){let t=d.value.trim();if(!t)return[{text:e,hit:!1}];let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push({text:e.slice(a,o),hit:!1}),i.push({text:e.slice(o,o+r.length),hit:!0}),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push({text:e.slice(a),hit:!1}),i}async function Re(e,n){if(await He({name:e.name,path:e.path,type:`file`,depth:0}),!n||n<1)return;await t();let r=B.value;r&&r.getModel()&&We()?.path===e.path&&(r.revealLineInCenter(n,ge.ScrollType.Smooth),r.setPosition({lineNumber:n,column:1}),r.focus())}let ze=_(null);function Be(){let e=ze.value;e&&(e.focus(),e.select())}function Ve(){l.value?(p(),ze.value?.focus()):(ze.value?.blur(),B.value?.focus())}let N=_([]),P=_(null),F=_(null);async function He(e){if(F.value=e,e.type!==`file`){M(Ne(s.value,e.path)??e);return}let n=N.value.find(t=>t.path===e.path);if(console.log(`[debug-open-in-editor] EditorView openFile existing tab check:`,{path:e.path,found:!!n,tabsCount:N.value.length}),n){P.value=e.path,t(()=>H());return}let r=e.name.split(`.`).pop()||``;if(Ae.has(r.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`media`,diskMtimeMs:null};N.value.push(t),P.value=e.path;return}if(rn.has(r.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null};N.value.push(t),P.value=e.path,J.value=!0;return}if(Oe(e.name)){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null};N.value.push(t),P.value=e.path,Y.value=!1,J.value=!0;return}try{let t=await fetch(`/api/editor/file?path=${encodeURIComponent(e.path)}`),n=await t.json();if(console.log(`[debug-open-in-editor] EditorView fetch /api/editor/file response:`,{path:e.path,status:t.status,data:n}),!n.success){y.error(`${A(`@EDITOR:打开文件失败: `)}${n.error}`);return}let i=qe(r),a=V.get(e.path);a&&!a.isDisposed()&&a.setValue(n.content);let o={path:e.path,name:e.name,content:n.content,originalContent:n.content,isDirty:!1,language:i,diskMtimeMs:typeof n.mtimeMs==`number`?n.mtimeMs:null};console.log(`[debug-open-in-editor] EditorView pushing tab:`,{path:o.path,name:o.name,contentLen:o.content.length,lang:o.language}),N.value.push(o),P.value=e.path,console.log(`[debug-open-in-editor] EditorView tabs after push:`,N.value.length,`activeTabPath=`,P.value)}catch(e){console.log(`[debug-open-in-editor] EditorView fetch threw:`,e),y.error(`${A(`@EDITOR:打开文件失败: `)}${e.message}`)}}w(()=>i.pendingFilePath,async e=>{if(console.log(`[debug-open-in-editor] EditorView watcher fired, filePath=`,e),!e)return;await t();let n=e.split(/[\\/]/).pop()||e;console.log(`[debug-open-in-editor] EditorView calling openFile, name=`,n,`path=`,e),await He({name:n,path:e,type:`file`,depth:0}),console.log(`[debug-open-in-editor] EditorView openFile returned`)},{immediate:!0});function Ue(e,t){t.stopPropagation();let n=N.value.findIndex(t=>t.path===e);n!==-1&&(!N.value[n].isDirty||confirm(A(`@EDITOR:文件未保存,确认关闭?`)))&&(N.value.splice(n,1),P.value===e&&(P.value=N.value[Math.min(n,N.value.length-1)]?.path??null))}let We=()=>N.value.find(e=>e.path===P.value)??null,Ge=k(()=>({expandedDirs:[...ae(s.value)],tabs:N.value.map(e=>e.path),activeTab:P.value})),Ke=!1,I=!1;function L(){I&&!Ke&&a.isUiLoaded&&a.saveEditorWorkspace(Ge.value)}w(Ge,()=>L());async function R(e){if(N.value.some(t=>t.path===e))return;let t=e.split(/[\\/]/).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();if(Ae.has(n)){N.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`media`,diskMtimeMs:null});return}if(rn.has(n)){N.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null});return}if(Oe(t)){N.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null});return}try{let r=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();if(!r.success)return;let i=V.get(e);i&&!i.isDisposed()&&B.value?.getModel()!==i&&(i.dispose(),V.delete(e)),N.value.push({path:e,name:t,content:r.content,originalContent:r.content,isDirty:!1,language:qe(n),diskMtimeMs:typeof r.mtimeMs==`number`?r.mtimeMs:null})}catch{}}async function z(){try{for(let e=0;e<100&&!a.isUiLoaded;e++)await new Promise(e=>setTimeout(e,50));if(!a.isUiLoaded)return;pt.value=a.ui.editorSidebarWidth;let e=a.getEditorWorkspace();if(!e)return;Ke=!0;try{if(e.expandedDirs.length>0){let t=await se(e.expandedDirs);t&&(s.value=t)}for(let t of e.tabs)await R(t);if(!i.pendingFilePath&&e.activeTab&&N.value.some(t=>t.path===e.activeTab)){P.value=e.activeTab;let t=We(),n=(t?.name.split(`.`).pop()||``).toLowerCase();t&&(rn.has(n)||Oe(t.name))&&(J.value=!0)}}finally{Ke=!1}}finally{I=!0,L()}}let Je=_(null),B=te(null),V=new Map;function Ye(e){let t=V.get(e.path);return(!t||t.isDisposed())&&(t=ge.createModel(e.content,e.language,me.file(e.path)),V.set(e.path,t)),t}function Xe(){B.value?.setModel(null);for(let e of V.values())e.isDisposed()||e.dispose();V.clear()}function Ze(){if(!Je.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;B.value=ge.create(Je.value,{theme:e?`vs-dark`:`vs`,fontSize:13,lineHeight:20,fontFamily:`'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace`,minimap:{enabled:!0},scrollBeyondLastLine:!1,renderWhitespace:`selection`,automaticLayout:!0,tabSize:2,wordWrap:`off`,smoothScrolling:!0,cursorBlinking:`smooth`,padding:{top:8,bottom:8},editContext:!1}),B.value.onDidChangeModelContent(()=>{let e=We();if(!e)return;let t=B.value.getValue();e.content=t,e.isDirty=t!==e.originalContent}),B.value.onDidBlurEditorText(()=>{a.ui.editorAutoSave&&We()?.isDirty&&dt(!1),requestAnimationFrame(()=>{if(!W.value||W.value.offsetParent===null)return;let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||H()})})}w(P,e=>{if(!B.value||!e)return;let n=N.value.find(t=>t.path===e);if(!n)return;let r=Ye(n);B.value.setModel(r),t(()=>H()),it(e)});function H(){if(!B.value)return;B.value.focus();let e=document.querySelector(`.monaco-editor .native-edit-context`);e&&document.activeElement!==e&&requestAnimationFrame(()=>e.focus?.())}let Qe=0,$e=new Map;async function et(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}&meta=1`)).json();return!t?.success||typeof t.mtimeMs!=`number`?null:{mtimeMs:t.mtimeMs}}catch{return null}}async function tt(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();return t?.success?{content:t.content,mtimeMs:typeof t.mtimeMs==`number`?t.mtimeMs:null}:null}catch{return null}}function rt(e,t,n){e.content=t,e.originalContent=t,e.isDirty=!1,e.diskMtimeMs=n;let r=V.get(e.path);if(!r||r.isDisposed())return;let i=B.value;if(!i||i.getModel()!==r){r.setValue(t);return}let a=i.saveViewState();r.pushEditOperations([],[{range:r.getFullModelRange(),text:t}],()=>null),i.restoreViewState(a)}async function it(e){if(!e)return;let t=N.value.find(t=>t.path===e);if(!t||t.diskMtimeMs===null)return;let n=++Qe,r=await et(e);if(n!==Qe||N.value.find(t=>t.path===e)!==t||!r||r.mtimeMs===t.diskMtimeMs)return;if(t.isDirty){if($e.get(e)===r.mtimeMs)return;$e.set(e,r.mtimeMs);try{await ie.confirm(A(`@EDITOR:这个文件在磁盘上已被改动,你这边也有未保存的编辑。重新加载会丢弃你的改动。`),A(`@EDITOR:文件已被外部改动`),{confirmButtonText:A(`@EDITOR:重新加载`),cancelButtonText:A(`@EDITOR:保留我的`),type:`warning`})}catch{return}if(t.isDirty)return}let i=await tt(e);i&&N.value.find(t=>t.path===e)===t&&rt(t,i.content,i.mtimeMs)}function at(){document.hidden||it(P.value)}let ot=null;function ct(){lt(),ot=setInterval(()=>{document.hidden||it(P.value)},Lt)}function lt(){ot&&=(clearInterval(ot),null)}w(()=>N.value.filter(e=>e.isDirty).length,e=>{o.setDirtyCount(e)},{immediate:!0}),u(()=>o.setDirtyCount(0)),Me(()=>{let e=document.documentElement.getAttribute(`data-theme`)===`dark`;ge.setTheme(e?`vs-dark`:`vs`)});let U=null;function ut(){if(U||!W.value)return;let e=[W.value],t=W.value.parentElement;for(;t;){if(t.classList.contains(`view-pane`)||t.classList.contains(`editor-pane`)){e.push(t);break}t=t.parentElement}U=new MutationObserver(()=>{W.value&&W.value.offsetParent!==null&&P.value&&B.value&&(it(P.value),requestAnimationFrame(()=>{let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||H()}))});let n=U;e.forEach(e=>n.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}))}r(async()=>{Ze(),await O(),await z(),ut(),T(),window.addEventListener(`focus`,at),document.addEventListener(`visibilitychange`,at),ct(),P.value&&t(()=>H())}),u(()=>{U?.disconnect(),U=null,window.removeEventListener(`focus`,at),document.removeEventListener(`visibilitychange`,at),B.value?.dispose(),V.forEach(e=>e.dispose()),V.clear()});async function dt(e=!1){let t=We();if(t&&!(sn.value||cn.value||ln.value))try{let n=await(await fetch(`/api/editor/file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t.path,content:t.content})})).json();if(!n.success){y.error(`${A(`@EDITOR:保存失败: `)}${n.error}`);return}t.originalContent=t.content,t.isDirty=!1,typeof n.mtimeMs==`number`&&(t.diskMtimeMs=n.mtimeMs),e||y.success(A(`@EDITOR:已保存`))}catch(e){y.error(`${A(`@EDITOR:保存失败: `)}${e.message}`)}}function ft(e){let t=e.ctrlKey||e.metaKey;if(t&&e.key.toLowerCase()===`f`){e.preventDefault(),Be();return}t&&e.key===`s`&&(e.preventDefault(),dt())}r(()=>window.addEventListener(`keydown`,ft)),u(()=>window.removeEventListener(`keydown`,ft));let W=_(null),pt=_(a.ui.editorSidebarWidth),mt=!1,ht=0,gt=0;function _t(e){mt=!0,ht=e.clientX,gt=pt.value,document.addEventListener(`mousemove`,vt),document.addEventListener(`mouseup`,yt),e.preventDefault()}function vt(e){if(!mt)return;let t=e.clientX-ht;pt.value=Math.max(140,Math.min(400,gt+t))}function yt(){mt=!1,document.removeEventListener(`mousemove`,vt),document.removeEventListener(`mouseup`,yt),pt.value!==a.ui.editorSidebarWidth&&a.setEditorSidebarWidth(pt.value)}function bt(e){return e.type===`directory`?je(e.name):ke(e.name)}let G=_(null),xt=_(null),Ct=_(null),wt=_(null);function Tt(){let e=F.value;return e?e.type===`directory`?{parentPath:e.path,afterNode:e,depth:e.depth+1}:{parentPath:e.path.includes(`/`)||e.path.includes(`\\`)?e.path.replace(/[\\/][^\\/]+$/,``):a.currentDirectory??``,afterNode:e,depth:e.depth}:{parentPath:a.currentDirectory??``,afterNode:null,depth:0}}async function Et(){let e=Tt();F.value?.type===`directory`&&!F.value.expanded&&await M(F.value),G.value={...e,kind:`file`,value:``},await t(),Ct.value?.focus()}async function Dt(){let e=Tt();F.value?.type===`directory`&&!F.value.expanded&&await M(F.value),G.value={...e,kind:`directory`,value:``},await t(),Ct.value?.focus()}function Ot(){G.value=null}async function kt(){let e=G.value;if(!e||!e.value.trim()){G.value=null;return}let t=e.value.trim(),n=e.parentPath.replace(/[/\\]$/,``)+`/`+t;if(e.kind===`file`){let e=await(await fetch(`/api/editor/file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){y.error(e.error);return}y.success(A(`@EDITOR:创建成功`))}else{let e=await(await fetch(`/api/editor/directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){y.error(e.error);return}y.success(A(`@EDITOR:创建成功`))}G.value=null,await j()}function At(e){e.key===`Enter`&&(e.preventDefault(),kt()),e.key===`Escape`&&(e.preventDefault(),Ot())}let K=_(null),jt=_(null);function Mt(e,t){e.preventDefault(),K.value={x:e.clientX,y:e.clientY,node:t}}function q(){K.value=null}async function Bt(){let e=K.value?.node;q(),e&&(F.value=e),e?.type===`directory`&&!e.expanded&&await M(e);let n=Tt();G.value={...n,kind:`file`,value:``},await t(),Ct.value?.focus()}async function Vt(){let e=K.value?.node;q(),e&&(F.value=e),e?.type===`directory`&&!e.expanded&&await M(e);let n=Tt();G.value={...n,kind:`directory`,value:``},await t(),Ct.value?.focus()}async function Ht(){let e=K.value?.node;q(),e&&(xt.value={node:e,value:e.name},await t(),wt.value?.focus(),wt.value?.select())}async function Ut(){let e=xt.value;if(!e||!e.value.trim()||e.value.trim()===e.node.name){xt.value=null;return}let t=e.value.trim(),n=e.node.path.replace(/[\\/][^\\/]+$/,``).replace(/[/\\]$/,``)+`/`+t,r=await(await fetch(`/api/editor/rename`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:e.node.path,newPath:n})})).json();if(!r.success){y.error(r.error);return}let i=N.value.find(t=>t.path===e.node.path);i&&(i.path=n,i.name=t,P.value===e.node.path&&(P.value=n)),xt.value=null,await j()}function Wt(e){e.key===`Enter`&&(e.preventDefault(),Ut()),e.key===`Escape`&&(e.preventDefault(),xt.value=null)}async function Gt(){let e=K.value?.node;if(q(),!e)return;let t=e.type===`directory`?A(`@EDITOR:文件夹`):A(`@EDITOR:文件`);if(!confirm(`${A(`@EDITOR:确认删除`)} ${t} "${e.name}"?`))return;let n=await(await fetch(`/api/editor/entry?path=${encodeURIComponent(e.path)}`,{method:`DELETE`})).json();if(!n.success){y.error(n.error);return}let r=N.value.findIndex(t=>t.path===e.path);r!==-1&&(N.value.splice(r,1),P.value===e.path&&(P.value=N.value[Math.max(0,r-1)]?.path??null)),y.success(A(`@EDITOR:已删除`)),await j()}async function Kt(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||y.error(t.error)}catch(e){y.error(e?.message||String(e))}}function qt(e){let t=a.currentDirectory;if(!t)return e;let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),r=n(t),i=n(e);return i===r?`.`:i.startsWith(r+`/`)?i.slice(r.length+1):i}async function Jt(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}async function Yt(){let e=K.value?.node;q(),e&&(await Jt(e.path)?y.success(A(`@EDITOR:已复制到剪贴板`)):y.error(A(`@EDITOR:复制失败`)))}async function Xt(){let e=K.value?.node;q(),e&&(await Jt(qt(e.path))?y.success(A(`@EDITOR:已复制到剪贴板`)):y.error(A(`@EDITOR:复制失败`)))}async function Zt(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/open-in-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||y.error(t.error||A(`@EDITOR:VSCode 未安装`))}catch(e){y.error(e?.message||String(e))}}let Qt=new Set([`html`,`htm`]),$t=k(()=>{let e=K.value?.node;if(!e||e.type!==`file`)return!1;let t=e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase();return Qt.has(t)});async function en(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/open-in-browser`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||y.error(t.error||A(`@EDITOR:浏览器打开失败`))}catch(e){y.error(e?.message||String(e))}}r(()=>{document.addEventListener(`click`,q),document.addEventListener(`keydown`,tn)}),u(()=>{document.removeEventListener(`click`,q),document.removeEventListener(`keydown`,tn)});function tn(e){e.key===`Escape`&&Z.value&&(Z.value=!1)}let nn=new Set([`md`,`html`,`htm`,`svg`]),rn=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`ico`,`bmp`]),J=_(!1),Y=_(!1),X=_(!1),an=_(!1),Z=_(!1),on=_(0),Q=k(()=>N.value.find(e=>e.path===P.value)??null),sn=k(()=>Q.value?.language===`plaintext`&&Q.value?.content===``),cn=k(()=>Q.value?.language===`office`),ln=k(()=>Q.value?.language===`media`),$=k(()=>(Q.value?.name??``).split(`.`).pop()?.toLowerCase()??``),un=k(()=>nn.has($.value)||rn.has($.value)||Oe($.value)),dn=k(()=>((Q.value?.content??``).match(/^#{1,6}\s+/gm)||[]).length),fn=k(()=>$.value===`md`&&dn.value>0);w(P,()=>{J.value&&!un.value&&(J.value=!1),Y.value&&!fn.value&&(Y.value=!1)});function pn(){un.value&&(J.value||(Y.value=!1,X.value=!1),J.value=!J.value)}function mn(){fn.value&&(Y.value||(J.value=!1,X.value=!1),Y.value=!Y.value)}function hn(){X.value||(J.value=!1,Y.value=!1),X.value=!X.value,an.value=!0}function gn(){X.value=!1}w(X,e=>{e||(Z.value=!1)});function _n(){Z.value=!Z.value}let vn=k(()=>on.value<=0||N.value.length===0?{flexBasis:`0px`}:Z.value?{flex:`0 0 ${on.value}px`}:{flex:`0 0 ${on.value}px`,maxWidth:`calc(100% - 320px)`}),yn=_(null),bn=_(!1),xn=_(``),Sn=_(!0),Cn=null,wn=k(()=>!Y.value&&J.value&&$.value===`md`&&!!Q.value);function Tn(){return Q.value?.content??``}function En(){return Tn().match(/^\s*#\s+(.+?)\s*(?:\r?\n|$)/)?.[1]?.trim()??``}function Dn(e,t,n){if(!e){y.error(A(`@EDITOR:复制失败`));return}xn.value=n,Cn&&clearTimeout(Cn),Cn=setTimeout(()=>{xn.value=``},1800),t>0?y.warning(A(`@EDITOR:{n} 张图片未能转成 Base64,已保留原地址`,{n:t})):y.success(A(`@EDITOR:已复制`))}async function On(){Dn(await Jt(Tn()),0,`md`)}async function kn(){let e=yn.value?.getRenderedElement();if(e){bn.value=!0;try{let{html:t,leftover:n}=await Nt(e,Sn.value);Dn(await Jt(t),n,`html`)}finally{bn.value=!1}}}function An(e){let t=document.createElement(`div`);t.style.cssText=`position:fixed;top:-9999px;left:-9999px;opacity:0;`,t.innerHTML=e,document.body.appendChild(t);try{let e=window.getSelection(),n=document.createRange();n.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(n);let r=document.execCommand(`copy`);return e?.removeAllRanges(),r}catch{return!1}finally{document.body.removeChild(t)}}async function jn(){let e=yn.value?.getRenderedElement();if(e){bn.value=!0;try{let{html:t,leftover:n}=await Pt(e,{inline:Sn.value,title:En()}),r=Tn(),i=!1;try{navigator.clipboard?.write&&typeof ClipboardItem<`u`&&(await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:`text/html`}),"text/plain":new Blob([r],{type:`text/plain`})})]),i=!0)}catch{i=!1}i||=An(t),Dn(i,n,`rich`)}finally{bn.value=!1}}}let Mn=k(()=>{let e=Q.value;if(!e)return``;let t=$.value,n=document.documentElement.getAttribute(`data-theme`)===`light`?`#ffffff`:`#0d1117`;return t===`html`||t===`htm`?Se(e.content):t===`svg`?`<!DOCTYPE html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:${n};display:flex;align-items:center;justify-content:center;min-height:100vh;}svg{max-width:100%;max-height:90vh;}</style></head><body>${e.content}</body></html>`:``}),Nn=!1,Pn=0,Fn=0,In=0;function Ln(e){let t=e.currentTarget,n=t.parentElement;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect();Nn=!0,Pn=e.clientX,Fn=r.right-i.right,In=Math.max(Rt,r.width-zt),document.addEventListener(`mousemove`,Rn),document.addEventListener(`mouseup`,zn),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,e.preventDefault()}function Rn(e){if(!Nn)return;let t=Pn-e.clientX;on.value=Math.round(Math.max(Rt,Math.min(In,Fn+t)))}function zn(){Nn=!1,document.removeEventListener(`mousemove`,Rn),document.removeEventListener(`mouseup`,zn),document.body.style.cursor=``,document.body.style.userSelect=``}let Bn={props:i,configStore:a,editorTabsStore:o,treeNodes:s,treeLoading:c,searchQuery:l,debouncedSearchQuery:d,get searchDebounceTimer(){return f},set searchDebounceTimer(e){f=e},clearSearch:p,CONTENT_SEARCH_MIN_LEN:Ft,contentHits:m,contentTotalMatches:h,contentQuery:g,contentSearching:v,contentTruncated:b,get contentAbort(){return x},set contentAbort(e){x=e},get contentSeq(){return S},set contentSeq(e){S=e},resetContentSearch:ne,runContentSearch:re,TREE_POLL_MS:It,get treePollTimer(){return C},set treePollTimer(e){C=e},startTreePolling:T,stopTreePolling:E,loadDir:D,initTree:O,collectExpandedPaths:ae,toTreeNodes:oe,fetchTreeSnapshot:se,reconcileTree:ce,refreshTree:j,toggleDir:M,flattenTree:ve,searchQueryLower:we,filterTree:De,findNodeByPath:Ne,visibleTree:Pe,noSearchResults:Fe,noAnySearchResults:Ie,highlightText:Le,openContentHit:Re,searchInputRef:ze,focusSearchInput:Be,onSearchEscape:Ve,tabs:N,activeTabPath:P,selectedNode:F,openFile:He,closeTab:Ue,activeTab:We,workspaceSnapshot:Ge,get workspaceRestoring(){return Ke},set workspaceRestoring(e){Ke=e},get workspaceHydrated(){return I},set workspaceHydrated(e){I=e},persistWorkspace:L,restoreTab:R,restoreWorkspace:z,editorContainerRef:Je,editorInstance:B,modelCache:V,getOrCreateModel:Ye,disposeAllModels:Xe,mountEditor:Ze,focusEditor:H,get diskSyncSeq(){return Qe},set diskSyncSeq(e){Qe=e},diskConflictPromptedAt:$e,fetchFileMeta:et,fetchFileContent:tt,applyDiskContent:rt,syncActiveTabWithDisk:it,handleWindowFocus:at,DISK_SYNC_POLL_MS:Lt,get diskSyncTimer(){return ot},set diskSyncTimer(e){ot=e},startDiskSyncPolling:ct,stopDiskSyncPolling:lt,get viewVisibilityObserver(){return U},set viewVisibilityObserver(e){U=e},setupViewVisibilityObserver:ut,saveCurrentFile:dt,handleKeydown:ft,containerRef:W,sidebarWidth:pt,get isResizing(){return mt},set isResizing(e){mt=e},get resizeStartX(){return ht},set resizeStartX(e){ht=e},get resizeStartW(){return gt},set resizeStartW(e){gt=e},startSidebarResize:_t,onSidebarResize:vt,stopSidebarResize:yt,getNodeSpriteId:bt,inlineInput:G,renameInput:xt,inlineInputRef:Ct,renameInputRef:wt,getTargetDir:Tt,startNewFile:Et,startNewFolder:Dt,cancelInlineInput:Ot,confirmInlineInput:kt,handleInlineKeydown:At,ctxMenu:K,ctxMenuRef:jt,openContextMenu:Mt,closeContextMenu:q,ctxNewFile:Bt,ctxNewFolder:Vt,ctxRename:Ht,confirmRename:Ut,handleRenameKeydown:Wt,ctxDelete:Gt,ctxRevealInExplorer:Kt,toWorkspaceRelative:qt,copyToClipboard:Jt,ctxCopyAbsolutePath:Yt,ctxCopyRelativePath:Xt,ctxOpenInVscode:Zt,BROWSER_OPEN_EXTS:Qt,ctxMenuCanOpenInBrowser:$t,ctxOpenInBrowser:en,onEditorKeydown:tn,PREVIEW_TEXT_EXTS:nn,IMAGE_EXTS:rn,showPreview:J,showMindmap:Y,showAgentChat:X,agentOpened:an,agentFullscreen:Z,previewWidth:on,activeTabRef:Q,activeTabIsImage:sn,activeTabIsOffice:cn,activeTabIsMedia:ln,activeExt:$,isPreviewable:un,mindmapTitleCount:dn,isMindmapable:fn,togglePreview:pn,toggleMindmap:mn,toggleAgentChat:hn,closeAgentChat:gn,toggleAgentFullscreen:_n,rightPaneStyle:vn,mdPreviewRef:yn,mdCopyBusy:bn,mdCopiedType:xn,mdCopyInlineImages:Sn,get mdCopiedTimer(){return Cn},set mdCopiedTimer(e){Cn=e},mdCopyAvailable:wn,mdSourceText:Tn,mdDocTitle:En,mdCopyFeedback:Dn,copyMarkdownSource:On,copyRenderedHtml:kn,copyRichTextBySelection:An,copyRichTextToClipboard:jn,previewSrcdoc:Mn,PREVIEW_MIN_WIDTH:Rt,EDITOR_MIN_WIDTH:zt,get isPreviewResizing(){return Nn},set isPreviewResizing(e){Nn=e},get previewResizeStartX(){return Pn},set previewResizeStartX(e){Pn=e},get previewResizeStartW(){return Fn},set previewResizeStartW(e){Fn=e},get previewResizeMaxW(){return In},set previewResizeMaxW(e){In=e},startPreviewResize:Ln,onPreviewResize:Rn,stopPreviewResize:zn,get $t(){return A},get ElTooltip(){return ee},get getFileIconClass(){return ke},ImagePreview:Te,MediaPreview:nt,OfficePreview:be,MarkdownPreview:ye,MindmapPreview:st,EditorAgentPanel:St,EmptyState:Ce,SvgIcon:le,get PREVIEW_IFRAME_SANDBOX(){return xe}};return Object.defineProperty(Bn,"__isScriptSetup",{enumerable:!1,value:!0}),Bn}});i(),x(),T();var Bt={class:`editor-view`,ref:`containerRef`},Vt={class:`sidebar-header`},Ht={class:`sidebar-title`},Ut={class:`sidebar-actions`},Wt={class:`sidebar-search`},Gt=[`placeholder`,`title`],Kt=[`title`,`aria-label`],qt={key:0,class:`sidebar-tree`},Jt={key:0,class:`search-section-head`},Yt={key:1,class:`tree-arrow-spacer`},Xt={class:`tree-icon mit-icon`,"aria-hidden":`true`},Zt=[`xlink:href`],Qt=[`onClick`,`onContextmenu`],$t={key:1,class:`tree-arrow-spacer`},en={key:2,class:`tree-icon mit-icon`,"aria-hidden":`true`},tn=[`xlink:href`],nn={key:3,class:`tree-icon mit-icon`,"aria-hidden":`true`},rn=[`xlink:href`],J=[`title`],Y={key:0,class:`tree-name-hit`},X={key:4,class:`tree-loading`},an={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},Z={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},on=[`placeholder`],Q={key:1,class:`tree-node tree-inline-input-row`,style:{paddingLeft:`12px`}},sn={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},cn={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},ln=[`placeholder`],$=[`data-query`],un={key:0,class:`content-results-status`},dn={class:`search-section-head`},fn={class:`search-section-count`},pn={key:0,class:`search-section-note`},mn=[`title`,`onClick`],hn={class:`tree-icon mit-icon`,"aria-hidden":`true`},gn=[`xlink:href`],_n={class:`content-hit-name`},vn={class:`content-hit-dir`},yn={class:`content-hit-total`},bn=[`title`,`onClick`],xn={class:`content-hit-ln`},Sn={class:`content-hit-text`},Cn={key:0,class:`content-hit-mark`},wn={key:3,class:`tree-empty`},Tn={key:1,class:`sidebar-loading`},En={class:`editor-main`},Dn={class:`editor-tabs`},On=[`onClick`,`title`],kn={class:`tab-name`},An={key:0,class:`tab-dirty-dot`},jn=[`onClick`],Mn=[`title`],Nn=[`disabled`,`title`],Pn=[`title`],Fn={key:1,class:`image-tab-placeholder`},In={viewBox:`0 0 24 24`,width:`56`,height:`56`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.35`}},Ln={class:`image-tab-placeholder-title`},Rn={class:`image-tab-placeholder-hint`},zn={class:`preview-header`},Bn={class:`preview-title`},Vn={class:`preview-ext-badge`},Hn=[`title`],Un={class:`preview-body`},Wn={key:0,class:`preview-copybar`},Gn=[`disabled`,`title`],Kn=[`disabled`,`title`],qn=[`disabled`,`title`],Jn=[`title`],Yn=[`sandbox`,`srcdoc`];function Xn(t,r,i,o,u,ee){return D(),l(m,null,[c(`div`,Bt,[O(` 左侧文件树 `),c(`div`,{class:`editor-sidebar`,style:a({width:o.sidebarWidth+`px`})},[c(`div`,Vt,[c(`span`,Ht,f(o.$t(`@EDITOR:资源管理器`)),1),c(`div`,Ut,[e(o.ElTooltip,{content:o.$t(`@EDITOR:新建文件`),placement:`bottom`,"show-after":300},{default:b(()=>[c(`button`,{class:`sidebar-action-btn`,onClick:o.startNewFile},[O(` file-plus.svg(Tabler icons,MIT) `),r[11]||=c(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),c(`path`,{d:`M17 21h-10a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2`}),c(`path`,{d:`M12 11l0 6`}),c(`path`,{d:`M9 14l6 0`})],-1)])]),_:1},8,[`content`]),e(o.ElTooltip,{content:o.$t(`@EDITOR:新建文件夹`),placement:`bottom`,"show-after":300},{default:b(()=>[c(`button`,{class:`sidebar-action-btn`,onClick:o.startNewFolder},[O(` folder-plus.svg(Tabler icons,MIT) `),r[12]||=c(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M12 19h-7a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v3.5`}),c(`path`,{d:`M16 19h6`}),c(`path`,{d:`M19 16v6`})],-1)])]),_:1},8,[`content`]),e(o.ElTooltip,{content:o.$t(`@EDITOR:刷新`),placement:`bottom`,"show-after":300},{default:b(()=>[c(`button`,{class:`sidebar-action-btn`,onClick:r[0]||=e=>o.refreshTree({notifyOnError:!0})},[O(` refresh.svg(Tabler icons,MIT) `),r[13]||=c(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4`}),c(`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`})],-1)])]),_:1},8,[`content`])])]),c(`div`,Wt,[r[15]||=c(`svg`,{class:`sidebar-search-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[c(`circle`,{cx:`11`,cy:`11`,r:`7`}),c(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),h(c(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":r[1]||=e=>o.searchQuery=e,type:`text`,class:`sidebar-search-input`,placeholder:o.$t(`@EDITOR:搜索文件名或内容...`),title:o.$t(`@EDITOR:搜索文件名或内容...`),spellcheck:`false`,autocomplete:`off`,onKeydown:v(o.onSearchEscape,[`escape`])},null,40,Gt),[[E,o.searchQuery]]),o.searchQuery?(D(),l(`button`,{key:0,class:`sidebar-search-clear`,title:o.$t(`@EDITOR:清除搜索`),"aria-label":o.$t(`@EDITOR:清除搜索`),onClick:o.clearSearch},[...r[14]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[c(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),c(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Kt)):O(`v-if`,!0)]),o.treeLoading?(D(),l(`div`,Tn,[...r[25]||=[c(`span`,{class:`spin-icon`},null,-1)]])):(D(),l(`div`,qt,[O(` 搜索态下给上方森林一个分组标题:下面还有「内容匹配」,不标一下分不清两块 `),o.searchQueryLower&&o.visibleTree.length>0?(D(),l(`div`,Jt,f(o.$t(`@EDITOR:名称匹配`)),1)):O(`v-if`,!0),(D(!0),l(m,null,p(o.flattenTree(o.visibleTree),e=>(D(),l(m,{key:e.path},[O(` 重命名时用输入框替换节点 `),o.renameInput&&o.renameInput.node.path===e.path?(D(),l(`div`,{key:0,class:`tree-node tree-inline-input-row`,style:a({paddingLeft:12+e.depth*14+`px`})},[e.type===`directory`?(D(),l(`span`,{key:0,class:d([`tree-arrow`,{expanded:e.expanded}])},[...r[16]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[c(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(D(),l(`span`,Yt)),(D(),l(`svg`,Xt,[c(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,Zt)])),h(c(`input`,{ref_for:!0,ref:`renameInputRef`,"onUpdate:modelValue":r[2]||=e=>o.renameInput.value=e,onKeydown:o.handleRenameKeydown,onBlur:o.confirmRename,onClick:r[3]||=g(()=>{},[`stop`])},null,544),[[E,o.renameInput.value]])],4)):(D(),l(m,{key:1},[O(` 普通节点 `),c(`div`,{class:d([`tree-node`,{"tree-node--dir":e.type===`directory`,"tree-node--file":e.type===`file`,"tree-node--active":o.activeTabPath===e.path,"tree-node--selected":o.selectedNode?.path===e.path&&o.activeTabPath!==e.path}]),style:a({paddingLeft:12+e.depth*14+`px`}),onClick:t=>o.openFile(e),onContextmenu:t=>o.openContextMenu(t,e)},[O(` 展开箭头 `),e.type===`directory`?(D(),l(`span`,{key:0,class:d([`tree-arrow`,{expanded:e.expanded}])},[...r[17]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[c(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(D(),l(`span`,$t)),O(` 图标 `),e.type===`directory`?(D(),l(`svg`,en,[c(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,tn)])):(D(),l(`svg`,nn,[c(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,rn)])),O(` 名称(命中关键字高亮) `),c(`span`,{class:`tree-name`,title:e.path},[(D(!0),l(m,null,p(o.highlightText(e.name),(e,t)=>(D(),l(m,{key:t},[e.hit?(D(),l(`span`,Y,f(e.text),1)):(D(),l(m,{key:1},[S(f(e.text),1)],64))],64))),128))],8,J),e.loading?(D(),l(`span`,X)):O(`v-if`,!0)],46,Qt)],2112)),O(` 内联新建输入框:紧跟在 afterNode 之后 `),o.inlineInput&&o.inlineInput.afterNode?.path===e.path?(D(),l(`div`,{key:2,class:`tree-node tree-inline-input-row`,style:a({paddingLeft:12+o.inlineInput.depth*14+`px`})},[r[20]||=c(`span`,{class:`tree-arrow-spacer`},null,-1),o.inlineInput.kind===`directory`?(D(),l(`svg`,an,[...r[18]||=[c(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(D(),l(`svg`,Z,[...r[19]||=[c(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),c(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),h(c(`input`,{ref_for:!0,ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":r[4]||=e=>o.inlineInput.value=e,placeholder:o.inlineInput.kind===`file`?o.$t(`@EDITOR:输入文件名`):o.$t(`@EDITOR:输入文件夹名`),onKeydown:o.handleInlineKeydown,onBlur:o.cancelInlineInput,onClick:r[5]||=g(()=>{},[`stop`])},null,40,on),[[E,o.inlineInput.value]])],4)):O(`v-if`,!0)],64))),128)),O(` 根级输入框(无选中节点时出现在列表末尾) `),o.inlineInput&&o.inlineInput.afterNode===null?(D(),l(`div`,Q,[r[23]||=c(`span`,{class:`tree-arrow-spacer`},null,-1),o.inlineInput.kind===`directory`?(D(),l(`svg`,sn,[...r[21]||=[c(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(D(),l(`svg`,cn,[...r[22]||=[c(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),c(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),h(c(`input`,{ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":r[6]||=e=>o.inlineInput.value=e,placeholder:o.inlineInput.kind===`file`?o.$t(`@EDITOR:输入文件名`):o.$t(`@EDITOR:输入文件夹名`),onKeydown:o.handleInlineKeydown,onBlur:o.cancelInlineInput,onClick:r[7]||=g(()=>{},[`stop`])},null,40,ln),[[E,o.inlineInput.value]])])):O(`v-if`,!0),O(` 内容匹配:搜索框的第二块结果。名称在树里已经能懒加载,内容命中只能平铺 `),o.searchQueryLower?(D(),l(`div`,{key:2,class:`content-results`,"data-query":o.contentQuery},[o.contentSearching?(D(),l(`div`,un,[r[24]||=c(`span`,{class:`content-search-spin`},null,-1),c(`span`,null,f(o.$t(`@EDITOR:正在搜索文件内容...`)),1)])):o.contentHits.length>0?(D(),l(m,{key:1},[c(`div`,dn,[c(`span`,null,f(o.$t(`@EDITOR:内容匹配`)),1),c(`span`,fn,f(o.contentTotalMatches),1),o.contentTruncated?(D(),l(`span`,pn,f(o.$t(`@EDITOR:结果过多,已截断`)),1)):O(`v-if`,!0)]),(D(!0),l(m,null,p(o.contentHits,e=>(D(),l(`div`,{key:e.path,class:`content-hit`},[c(`div`,{class:`content-hit-file`,title:e.relPath,onClick:t=>o.openContentHit(e,e.matches[0]?.line)},[(D(),l(`svg`,hn,[c(`use`,{"xlink:href":`#${o.getFileIconClass(e.name)}`},null,8,gn)])),c(`span`,_n,f(e.name),1),c(`span`,vn,f(e.dir),1),c(`span`,yn,f(e.total),1)],8,mn),(D(!0),l(m,null,p(e.matches,t=>(D(),l(`div`,{key:`${e.path}:${t.line}`,class:`content-hit-line`,title:o.$t(`@EDITOR:点击跳到该行`),onClick:n=>o.openContentHit(e,t.line)},[c(`span`,xn,f(t.line),1),c(`span`,Sn,[(D(!0),l(m,null,p(o.highlightText(t.text),(e,t)=>(D(),l(m,{key:t},[e.hit?(D(),l(`span`,Cn,f(e.text),1)):(D(),l(m,{key:1},[S(f(e.text),1)],64))],64))),128))])],8,bn))),128))]))),128))],64)):O(`v-if`,!0)],8,$)):O(`v-if`,!0),!o.inlineInput&&(o.noAnySearchResults||o.treeNodes.length===0)?(D(),l(`div`,wn,f(o.noAnySearchResults?o.$t(`@EDITOR:未找到匹配文件`):o.$t(`@EDITOR:暂无文件`)),1)):O(`v-if`,!0)]))],4),O(` 拖拽分隔条 `),c(`div`,{class:`editor-resizer`,onMousedown:o.startSidebarResize},null,32),O(` 右侧编辑区 `),c(`div`,En,[O(` 标签栏:没有打开文件时也留着 —— 右侧 g ai 面板的口子在它右端,
|
|
35
|
-
藏掉整条就是"不选文件就没法跟 g ai 说话"(用户 2026-10-21 反馈)。
|
|
36
|
-
此时左半边是空的,只留右端那几个按钮。 `),c(`div`,Dn,[(D(!0),l(m,null,p(o.tabs,e=>(D(),l(`div`,{key:e.path,class:d([`editor-tab`,{active:o.activeTabPath===e.path,dirty:e.isDirty}]),onClick:t=>o.activeTabPath=e.path,title:e.path},[c(`span`,kn,f(e.name),1),e.isDirty?(D(),l(`span`,An)):O(`v-if`,!0),c(`button`,{class:`tab-close`,onClick:t=>o.closeTab(e.path,t)},[...r[26]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[c(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),c(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,jn)],10,On))),128)),r[30]||=c(`div`,{class:`editor-tabs-spacer`},null,-1),O(` 预览切换按钮 `),o.isPreviewable?(D(),l(`button`,{key:0,class:d([`preview-toggle-btn`,{active:o.showPreview}]),title:o.showPreview?o.$t(`@EDITOR:关闭预览`):o.$t(`@EDITOR:打开预览`),onClick:o.togglePreview},[O(` eye.svg(Tabler icons,MIT) `),r[27]||=c(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0-4 0`}),c(`path`,{d:`M21 12c-2.4 4-5.4 6-9 6c-3.6 0-6.6-2-9-6c2.4-4 5.4-6 9-6c3.6 0 6.6 2 9 6`})],-1),c(`span`,null,f(o.$t(`@EDITOR:预览`)),1)],10,Mn)):O(`v-if`,!0),O(` 思维导图:整篇 markdown 渲染为一张大导图 `),o.isMindmapable?(D(),l(`button`,{key:1,class:d([`preview-toggle-btn mindmap-toggle-btn`,{active:o.showMindmap,disabled:!o.isMindmapable}]),disabled:!o.isMindmapable,title:o.isMindmapable?o.showMindmap?o.$t(`@EDITOR:关闭思维导图`):o.$t(`@EDITOR:打开思维导图`):o.$t(`@EDITOR:需要至少一个 # 标题`),onClick:o.toggleMindmap},[O(` topology-star.svg(Tabler icons,MIT):中心节点 + 四向辐射(与左栏「思维导图」同款) `),r[28]||=s(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" data-v-fc2ebf13><path d="M8 18a2 2 0 1 0-4 0a2 2 0 0 0 4 0" data-v-fc2ebf13></path><path d="M20 6a2 2 0 1 0-4 0a2 2 0 0 0 4 0" data-v-fc2ebf13></path><path d="M8 6a2 2 0 1 0-4 0a2 2 0 0 0 4 0" data-v-fc2ebf13></path><path d="M20 18a2 2 0 1 0-4 0a2 2 0 0 0 4 0" data-v-fc2ebf13></path><path d="M14 12a2 2 0 1 0-4 0a2 2 0 0 0 4 0" data-v-fc2ebf13></path><path d="M7.5 7.5l3 3" data-v-fc2ebf13></path><path d="M7.5 16.5l3-3" data-v-fc2ebf13></path><path d="M13.5 13.5l3 3" data-v-fc2ebf13></path><path d="M16.5 7.5l-3 3" data-v-fc2ebf13></path></svg>`,1),c(`span`,null,f(o.$t(`@EDITOR:思维导图`)),1)],10,Nn)):O(`v-if`,!0),O(` g ai 对话:文件空间右侧的智能体面板(与预览/思维导图互斥) `),c(`button`,{class:d([`preview-toggle-btn agent-toggle-btn`,{active:o.showAgentChat}]),title:o.showAgentChat?o.$t(`@EDITOR:关闭 g ai 对话`):o.$t(`@EDITOR:打开 g ai 对话`),onClick:o.toggleAgentChat},[O(` message-chatbot.svg(Tabler icons,MIT):对话气泡+机器人脸。
|
|
37
|
-
原来是自绘双星闪光 —— 用户偏好「AI 功能不用星星/闪光贴标签」,顺带换掉 `),r[29]||=s(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" data-v-fc2ebf13><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-5l-5 3v-3h-2a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3h12" data-v-fc2ebf13></path><path d="M9.5 9h.01" data-v-fc2ebf13></path><path d="M14.5 9h.01" data-v-fc2ebf13></path><path d="M9.5 13a3.5 3.5 0 0 0 5 0" data-v-fc2ebf13></path></svg>`,1),c(`span`,null,f(o.$t(`@EDITOR:g ai 对话`)),1)],10,Pn)]),O(` 无文件打开时的提示(g ai 面板开着时让位给它 —— 两个都是 flex:1 的话
|
|
38
|
-
对话区只剩半截高) `),o.tabs.length===0&&!o.showAgentChat?(D(),n(o.EmptyState,{key:0,class:`editor-empty`,title:o.$t(`@EDITOR:从左侧选择文件打开`),hint:o.$t(`@EDITOR:Ctrl+S 保存`)},{icon:b(()=>[...r[31]||=[c(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[c(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),c(`polyline`,{points:`14 2 14 8 20 8`})],-1)]]),_:1},8,[`title`,`hint`])):O(`v-if`,!0),O(` Monaco 容器(始终挂载,tab 为空或 image tab 时隐藏) `),c(`div`,{class:d([`editor-body`,{"is-agent-fullscreen":o.agentFullscreen&&o.showAgentChat}])},[c(`div`,{class:d([`monaco-container`,{hidden:o.tabs.length===0||o.activeTabIsImage||o.activeTabIsOffice||o.activeTabIsMedia}]),ref:`editorContainerRef`},null,2),O(` 音视频 tab:播放器直接铺满主区域(不走右侧预览面板 —— 音频没必要和空编辑区平分) `),o.activeTabIsMedia&&o.activeTabRef?(D(),n(o.MediaPreview,{key:o.activeTabRef.path,"file-path":o.activeTabRef.path,"file-name":o.activeTabRef.name},null,8,[`file-path`,`file-name`])):O(`v-if`,!0),O(` 图片 tab 时的占位提示(主预览区在右侧 preview-panel) `),o.activeTabIsImage&&o.tabs.length>0&&!o.showPreview&&!o.showMindmap?(D(),l(`div`,Fn,[(D(),l(`svg`,In,[...r[32]||=[c(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`},null,-1),c(`circle`,{cx:`9`,cy:`9`,r:`2`},null,-1),c(`path`,{d:`m21 15-5-5L5 21`},null,-1)]])),c(`p`,Ln,f(o.activeTabRef?.name),1),c(`p`,Rn,f(o.$t(`@EDITOR:这是图片文件,已在右侧预览面板中打开`)),1)])):O(`v-if`,!0),O(` 分隔条:贴在右侧面板的**左边缘**(DOM 顺序在面板之前),向左拖 = 面板变宽。
|
|
39
|
-
以前靠 order:99 挂在容器最右端,用户根本分不清拖的是哪条边。 `),(o.showPreview||o.showMindmap||o.showAgentChat)&&o.tabs.length>0?(D(),l(`div`,{key:2,class:`preview-resizer`,onMousedown:o.startPreviewResize},null,32)):O(`v-if`,!0),O(` g ai 对话面板:v-if 懒挂载 + v-show 保状态(切到预览再切回来,进行中的流还在)。
|
|
40
|
-
不再要求 tabs.length > 0:不选文件也能聊(当前文档上下文自动为空)。 `),o.agentOpened?h((D(),n(o.EditorAgentPanel,{key:3,active:o.showAgentChat,"active-file-path":o.activeTabPath,"active-file-name":o.activeTabRef?.name??``,fullscreen:o.agentFullscreen&&o.showAgentChat,style:a(o.rightPaneStyle),onClose:o.closeAgentChat,onToggleFullscreen:o.toggleAgentFullscreen},null,8,[`active`,`active-file-path`,`active-file-name`,`fullscreen`,`style`])),[[C,o.showAgentChat]]):O(`v-if`,!0),O(` 预览面板 `),(o.showPreview||o.showMindmap)&&o.tabs.length>0?(D(),l(`div`,{key:4,class:`preview-panel`,style:a(o.rightPaneStyle)},[c(`div`,zn,[c(`span`,Bn,f(o.showMindmap?o.$t(`@EDITOR:思维导图`):o.$t(`@EDITOR:预览`)),1),c(`span`,Vn,f(o.activeExt.toUpperCase()),1),r[34]||=c(`div`,{class:`preview-header-spacer`},null,-1),c(`button`,{class:`preview-close-btn`,title:o.showMindmap?o.$t(`@EDITOR:关闭思维导图`):o.$t(`@EDITOR:关闭预览`),onClick:r[8]||=e=>o.showMindmap?o.showMindmap=!1:o.showPreview=!1},[...r[33]||=[c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[c(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),c(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Hn)]),c(`div`,Un,[O(` 复制栏:Markdown 预览导出到公众号 / 其它富文本编辑器 `),o.mdCopyAvailable?(D(),l(`div`,Wn,[c(`button`,{class:d([`preview-copy-btn`,{done:o.mdCopiedType===`md`}]),disabled:o.mdCopyBusy,title:o.$t(`@EDITOR:复制 Markdown 源码`),onClick:o.copyMarkdownSource},[r[35]||=c(`span`,{class:`preview-copy-btn-icon`},`{ }`,-1),c(`span`,null,f(o.mdCopiedType===`md`?o.$t(`@EDITOR:已复制`):`Markdown`),1)],10,Gn),c(`button`,{class:d([`preview-copy-btn`,{done:o.mdCopiedType===`html`}]),disabled:o.mdCopyBusy,title:o.$t(`@EDITOR:复制渲染后的 HTML(图片按开关内嵌)`),onClick:o.copyRenderedHtml},[r[36]||=c(`span`,{class:`preview-copy-btn-icon`},`</>`,-1),c(`span`,null,f(o.mdCopiedType===`html`?o.$t(`@EDITOR:已复制`):`HTML`),1)],10,Kn),c(`button`,{class:d([`preview-copy-btn preview-copy-btn--primary`,{done:o.mdCopiedType===`rich`}]),disabled:o.mdCopyBusy,title:o.$t(`@EDITOR:复制为富文本,可直接粘贴到公众号编辑器`),onClick:o.copyRichTextToClipboard},[r[37]||=c(`span`,{class:`preview-copy-btn-icon`},`⊞`,-1),c(`span`,null,f(o.mdCopyBusy?o.$t(`@EDITOR:转换图片中…`):o.mdCopiedType===`rich`?o.$t(`@EDITOR:已复制`):o.$t(`@EDITOR:复制富文本`)),1)],10,qn),c(`label`,{class:`preview-copy-embed`,title:o.$t(`@EDITOR:复制时把本地图片转成 Base64 内嵌,关闭后保留原图地址`)},[h(c(`input`,{"onUpdate:modelValue":r[9]||=e=>o.mdCopyInlineImages=e,type:`checkbox`},null,512),[[ne,o.mdCopyInlineImages]]),c(`span`,null,f(o.$t(`@EDITOR:图片转 Base64`)),1)],8,Jn)])):O(`v-if`,!0),O(` 思维导图:整篇 markdown → 一张大导图 `),o.showMindmap&&o.activeExt===`md`&&o.activeTabRef?(D(),n(o.MindmapPreview,{key:1,content:o.activeTabRef.content,class:`preview-mindmap`},null,8,[`content`])):o.showPreview&&o.activeExt===`md`&&o.activeTabRef?(D(),l(m,{key:2},[O(` Markdown → in-app 渲染 `),O(` :key 按文件路径切 —— 预览的滚动容器就是这个组件自己的根节点
|
|
41
|
-
(.preview-markdown[overflow:auto]),不换 key 时切 tab 走的是同类型
|
|
42
|
-
组件 → Vue 复用同一个 DOM 节点、只把内容换掉,scrollTop 不在 patch
|
|
43
|
-
范围里,会从上一个文件原样带过来(表现为"新文件预览停在上一个文件的
|
|
44
|
-
滚动位置")。key 随路径变 → 重建节点,天然回到顶部。
|
|
45
|
-
注意 key 只取 path、不取 content:同一个文件里改字时预览是实时镜像,
|
|
46
|
-
那种情况下不该把用户踢回顶部。 `),(D(),n(o.MarkdownPreview,{ref:`mdPreviewRef`,key:o.activeTabRef.path,content:o.activeTabRef.content,"base-path":o.activeTabRef.path,class:`preview-markdown`},null,8,[`content`,`base-path`]))],2112)):o.showPreview&&[`html`,`htm`,`svg`].includes(o.activeExt)?(D(),l(m,{key:3},[O(` HTML / SVG → sandboxed iframe (JS 可执行,不透明 origin 隔离宿主) `),c(`iframe`,{class:`preview-iframe`,sandbox:o.PREVIEW_IFRAME_SANDBOX,srcdoc:o.previewSrcdoc},null,8,Yn)],2112)):o.showPreview&&o.IMAGE_EXTS.has(o.activeExt)&&o.activeTabRef?(D(),l(m,{key:4},[O(` 图片预览(使用增强版 ImagePreview,支持缩放/拖拽) `),e(o.ImagePreview,{"file-path":o.activeTabRef.path,"file-name":o.activeTabRef.name},null,8,[`file-path`,`file-name`])],2112)):o.showPreview&&o.activeTabIsOffice&&o.activeTabRef?(D(),n(o.OfficePreview,{key:5,"file-path":o.activeTabRef.path},null,8,[`file-path`])):O(`v-if`,!0)])],4)):O(`v-if`,!0)],2)])],512),O(` 右键菜单 `),(D(),n(ae,{to:`body`},[o.ctxMenu?(D(),l(`div`,{key:0,ref:`ctxMenuRef`,class:`ctx-menu`,style:a({left:o.ctxMenu.x+`px`,top:o.ctxMenu.y+`px`}),onClick:r[10]||=g(()=>{},[`stop`])},[c(`button`,{class:`ctx-menu-item`,onClick:o.ctxNewFile},[O(` file-plus.svg(Tabler icons,MIT) `),r[38]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),c(`path`,{d:`M17 21h-10a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2`}),c(`path`,{d:`M12 11l0 6`}),c(`path`,{d:`M9 14l6 0`})],-1),S(` `+f(o.$t(`@EDITOR:新建文件`)),1)]),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxNewFolder},[O(` folder-plus.svg(Tabler icons,MIT) `),r[39]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M12 19h-7a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v3.5`}),c(`path`,{d:`M16 19h6`}),c(`path`,{d:`M19 16v6`})],-1),S(` `+f(o.$t(`@EDITOR:新建文件夹`)),1)]),r[46]||=c(`div`,{class:`ctx-menu-sep`},null,-1),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxCopyAbsolutePath},[O(` copy.svg(Tabler icons,MIT) `),r[40]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667-2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1-2.667 2.667h-8.666a2.667 2.667 0 0 1-2.667-2.667l0-8.666`}),c(`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1-1.012-1.737v-10c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1`})],-1),S(` `+f(o.$t(`@EDITOR:复制绝对路径`)),1)]),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxCopyRelativePath},[O(` link.svg(Tabler icons,MIT) `),r[41]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M9 15l6-6`}),c(`path`,{d:`M11 6l.463-.536a5 5 0 0 1 7.071 7.072l-.534.464`}),c(`path`,{d:`M13 18l-.397.534a5.068 5.068 0 0 1-7.127 0a4.972 4.972 0 0 1 0-7.071l.524-.463`})],-1),S(` `+f(o.$t(`@EDITOR:复制相对路径`)),1)]),r[47]||=c(`div`,{class:`ctx-menu-sep`},null,-1),O(` 只有 HTML 才有"用浏览器打开":浏览器能直接渲染出结果 `),o.ctxMenuCanOpenInBrowser?(D(),l(`button`,{key:0,class:`ctx-menu-item`,onClick:o.ctxOpenInBrowser},[O(` world.svg(Tabler icons,MIT) `),r[42]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0`}),c(`path`,{d:`M3.6 9h16.8`}),c(`path`,{d:`M3.6 15h16.8`}),c(`path`,{d:`M11.5 3a17 17 0 0 0 0 18`}),c(`path`,{d:`M12.5 3a17 17 0 0 1 0 18`})],-1),S(` `+f(o.$t(`@EDITOR:在浏览器中打开`)),1)])):O(`v-if`,!0),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxRevealInExplorer},[O(` folder-open.svg(Tabler icons,MIT) `),r[43]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M5 19l2.757-7.351a1 1 0 0 1 .936-.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1-1.964 1.625h-14.026a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2`})],-1),S(` `+f(o.$t(`@EDITOR:在资源管理器中打开`)),1)]),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxOpenInVscode},[e(o.SvgIcon,{"icon-class":`vscode`,"class-name":`ctx-menu-icon`}),S(` `+f(o.$t(`@EDITOR:在 VSCode 中打开`)),1)]),c(`button`,{class:`ctx-menu-item`,onClick:o.ctxRename},[O(` edit.svg(Tabler icons,MIT) `),r[44]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M7 7h-1a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1`}),c(`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97l-8.415 8.385v3h3l8.385-8.415`}),c(`path`,{d:`M16 5l3 3`})],-1),S(` `+f(o.$t(`@EDITOR:重命名`)),1)]),c(`button`,{class:`ctx-menu-item ctx-menu-item--danger`,onClick:o.ctxDelete},[O(` trash.svg(Tabler icons,MIT) `),r[45]||=c(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,xmlns:`http://www.w3.org/2000/svg`},[c(`path`,{d:`M4 7l16 0`}),c(`path`,{d:`M10 11l0 6`}),c(`path`,{d:`M14 11l0 6`}),c(`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12`}),c(`path`,{d:`M9 7v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`})],-1),S(` `+f(o.$t(`@EDITOR:删除`)),1)])],4)):O(`v-if`,!0)]))],64)}var Zn=j(q,[[`render`,Xn],[`__scopeId`,`data-v-fc2ebf13`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/views/EditorView.vue`]]);export{Zn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.media-preview[data-v-35007775]{background:var(--bg-container);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;overflow:hidden}.media-preview-stage[data-v-35007775]{min-height:0;padding:var(--spacing-lg);background:var(--bg-panel);flex:1;justify-content:center;align-items:center;display:flex;position:relative}.media-preview-video[data-v-35007775]{background:#000;max-width:100%;min-height:0;max-height:100%;display:block}.media-preview-audio[data-v-35007775]{align-items:center;gap:var(--spacing-md);flex-direction:column;width:min(560px,100%);display:flex}.media-preview-glyph[data-v-35007775]{color:var(--color-primary);opacity:.85}.media-preview-title[data-v-35007775]{max-width:100%;font-size:var(--font-size-lg);font-weight:var(--font-weight-medium);color:var(--text-primary);text-align:center;word-break:break-all;margin:0}.media-preview-audio-el[data-v-35007775]{width:100%;color-scheme:inherit}.media-preview-loading[data-v-35007775]{justify-content:center;align-items:center;gap:var(--spacing-sm);font-size:var(--font-size-sm);color:var(--text-secondary);background:color-mix(in srgb, var(--bg-panel) 78%, transparent);pointer-events:none;display:flex;position:absolute;inset:0}.media-preview-spinner[data-v-35007775]{border:2px solid var(--border-color);border-top-color:var(--color-primary);border-radius:50%;width:14px;height:14px;animation:.8s linear infinite media-spin-35007775}@keyframes media-spin-35007775{to{transform:rotate(360deg)}}.media-preview-error[data-v-35007775]{align-items:center;gap:var(--spacing-sm);color:var(--text-secondary);text-align:center;padding:var(--spacing-lg);flex-direction:column;display:flex}.media-preview-error-title[data-v-35007775]{color:var(--text-primary);font-size:var(--font-size-md);margin:0}.media-preview-error-path[data-v-35007775]{max-width:520px;color:var(--text-meta);font-size:var(--font-size-xs);word-break:break-all;margin:0}.media-preview-footer[data-v-35007775]{align-items:center;gap:var(--spacing-sm);background:var(--bg-panel);font-size:var(--font-size-xs);color:var(--text-meta);flex-shrink:0;padding:4px 12px;display:flex}.media-preview-meta[data-v-35007775]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.media-preview-name[data-v-35007775]{max-width:55%;color:var(--text-secondary);white-space:nowrap;text-overflow:ellipsis;margin-left:auto;overflow:hidden}.mindmap-preview[data-v-3969a8bf]{background:var(--bg-container,#fff);flex-direction:column;width:100%;height:100%;display:flex}.mindmap-preview-header[data-v-3969a8bf]{background:var(--bg-panel,var(--md-bg-subtle));font-size:var(--font-size-sm);align-items:center;gap:12px;padding:8px 14px;display:flex}.mindmap-preview-title[data-v-3969a8bf]{color:var(--text-primary,var(--md-text-strong));letter-spacing:.5px;font-weight:600}.mindmap-preview-hint[data-v-3969a8bf]{color:var(--text-secondary,var(--md-text-muted));font-size:var(--font-size-xs)}.mindmap-preview-canvas[data-v-3969a8bf]{flex:1;width:100%;min-height:0}.mindmap-preview-canvas[data-v-3969a8bf] .zm-mindmap,.mindmap-preview-canvas[data-v-3969a8bf]>*{width:100%;height:100%}.editor-agent-panel[data-v-7cc12c51]{background:var(--bg-panel);border-left:1px solid var(--border-color);flex-direction:column;flex-grow:1;flex-basis:0;min-width:200px;min-height:0;display:flex;overflow:hidden}.editor-agent-panel.is-fullscreen[data-v-7cc12c51]{z-index:20;background:var(--bg-container);border-left:none;flex:none;position:absolute;inset:0}.agent-panel-header[data-v-7cc12c51]{border-bottom:1px solid var(--border-color);flex-shrink:0;align-items:center;gap:8px;height:34px;padding:0 6px 0 12px;display:flex}.agent-panel-title[data-v-7cc12c51]{font-size:var(--font-size-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--text-meta);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-weight:700;overflow:hidden}.agent-panel-spacer[data-v-7cc12c51]{flex:1}.agent-panel-engine[data-v-7cc12c51]{flex:none}.agent-panel-silence[data-v-7cc12c51]{flex:none;margin-right:4px}.agent-panel-icon-btn[data-v-7cc12c51]{border-radius:var(--radius-xs);width:24px;height:24px;color:var(--text-meta);cursor:pointer;transition:var(--transition-ui-fast);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex}.agent-panel-icon-btn[data-v-7cc12c51]:hover{background:var(--bg-hover);color:var(--text-secondary)}.agent-panel-body[data-v-7cc12c51]{flex:1;grid-template:"stage"minmax(0,1fr)"composer"/minmax(0,1fr);min-height:0;display:grid}.agent-panel-body.is-wide[data-v-7cc12c51]{transition:grid-template-columns var(--transition-base) var(--ease-custom);grid-template-columns:240px minmax(0,1fr);grid-template-areas:"list chat""list composer"}.agent-panel-body.is-wide.is-convs-collapsed[data-v-7cc12c51]{grid-template-columns:40px minmax(0,1fr)}.agent-panel-body.is-wide.is-convs-collapsed .agent-panel-convs[data-v-7cc12c51]{padding:8px 4px}.agent-panel-convs[data-v-7cc12c51]{grid-area:stage;min-height:0;padding:8px 10px;overflow-y:auto}.agent-panel-chat[data-v-7cc12c51]{grid-area:stage;min-height:0;display:flex}.agent-panel-body.is-wide .agent-panel-convs[data-v-7cc12c51]{grid-area:list}.agent-panel-body.is-wide .agent-panel-chat[data-v-7cc12c51]{grid-area:chat}.agent-panel-composer[data-v-7cc12c51]{padding:var(--acu-space-3) var(--acu-space-4) var(--acu-space-4);background:linear-gradient(to top, var(--acu-bg) 70%, transparent);grid-area:composer}.agent-panel-composer[data-v-7cc12c51] .acu-input-queue{--acu-queue-edge:var(--role-pending-edge);--acu-queue-surface:var(--role-pending-surface);--acu-queue-ink:var(--role-pending-ink);--acu-queue-wash:var(--role-pending-wash)}.agent-panel-chat[data-v-7cc12c51]>.acu-chat{flex:1;min-width:0}.agent-panel-chat[data-v-7cc12c51] .acu-avatar--left{background:0 0}.agent-panel-chat[data-v-7cc12c51] .acu-bubble-row.is-assistant .acu-bubble-main{width:var(--acu-bubble-max-width);max-width:var(--acu-bubble-max-width);position:relative}.agent-panel-chat[data-v-7cc12c51] .acu-bubble-row.is-assistant .acu-bubble{align-self:flex-start}.agent-panel-chat[data-v-7cc12c51] .acu-message-meta{margin:0;position:absolute;top:0;right:0}.agent-panel-composer[data-v-7cc12c51] .acu-input-wrap>.agent-context-slot{gap:var(--acu-space-2,8px);padding:var(--acu-space-2,8px) var(--acu-space-2,8px) 0;flex-wrap:wrap;display:flex}.agent-panel-composer[data-v-7cc12c51] .acu-input-attachments>.agent-context-slot{display:inline-flex}.agent-context-att[data-v-7cc12c51]{align-items:center;gap:var(--acu-space-2,8px);max-width:180px;padding:var(--acu-space-2,8px) var(--acu-space-3,12px);border:1px solid var(--acu-border);border-radius:var(--acu-radius-sm,8px);background:var(--acu-bg,var(--bg-container));color:var(--acu-text-secondary,var(--text-secondary));font-size:var(--acu-font-size-xs,12px);display:inline-flex;position:relative}.agent-context-att-icon[data-v-7cc12c51]{opacity:.75;flex-shrink:0}.agent-context-att-name[data-v-7cc12c51]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-context-att-remove[data-v-7cc12c51]{border-radius:var(--acu-radius-full,999px);background:var(--acu-text,var(--text-primary));width:18px;height:18px;color:var(--acu-bg,var(--bg-container));cursor:pointer;box-shadow:var(--acu-shadow-sm,0 1px 2px #0003);transition:transform var(--acu-duration-fast,.15s) var(--acu-easing,ease);border:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:-6px;right:-6px}.agent-context-att-remove[data-v-7cc12c51]:hover{transform:scale(1.12)}.agent-context-att-remove[data-v-7cc12c51]:active{transform:scale(1.02)}.editor-view[data-v-fc2ebf13]{background:var(--bg-container);width:100%;height:100%;box-shadow:var(--shadow-sm);border-radius:0;display:flex;overflow:hidden}.editor-sidebar[data-v-fc2ebf13]{background:var(--bg-panel);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.sidebar-header[data-v-fc2ebf13]{flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 10px 6px;display:flex}.sidebar-title[data-v-fc2ebf13]{font-size:var(--font-size-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary);-webkit-user-select:none;user-select:none;font-weight:700}.sidebar-action-btn[data-v-fc2ebf13]{cursor:pointer;color:var(--text-meta);border-radius:var(--radius-base);background:0 0;border:none;align-items:center;padding:3px;display:flex}.sidebar-action-btn[data-v-fc2ebf13]:hover{color:var(--text-primary);background:var(--bg-hover)}.sidebar-search[data-v-fc2ebf13]{flex-shrink:0;align-items:center;padding:6px 10px;display:flex;position:relative}.sidebar-search-icon[data-v-fc2ebf13]{color:var(--text-meta);pointer-events:none;position:absolute;left:18px}.sidebar-search-input[data-v-fc2ebf13]{min-width:0;height:26px;font-size:var(--font-size-sm);color:var(--text-primary);background:var(--bg-input,#ffffff0a);border:1px solid var(--border-color);border-radius:var(--radius-base);transition:border-color var(--transition-fast), background var(--transition-fast);outline:none;flex:1;padding:0 24px 0 26px}.sidebar-search-input[data-v-fc2ebf13]::placeholder{color:var(--text-meta)}.sidebar-search-input[data-v-fc2ebf13]:hover{border-color:var(--text-tertiary)}.sidebar-search-input[data-v-fc2ebf13]:focus{border-color:var(--color-primary);background:var(--bg-panel)}.sidebar-search-clear[data-v-fc2ebf13]{cursor:pointer;width:18px;height:18px;color:var(--text-meta);transition:background var(--transition-fast), color var(--transition-fast);background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;display:flex;position:absolute;right:14px}.sidebar-search-clear[data-v-fc2ebf13]:hover{background:var(--bg-hover);color:var(--text-primary)}.tree-name-hit[data-v-fc2ebf13]{color:var(--color-warning-light);border-radius:var(--radius-xs);background:#f59e0b26;padding:0 1px}.search-section-head[data-v-fc2ebf13]{letter-spacing:.04em;color:var(--text-meta);-webkit-user-select:none;user-select:none;align-items:center;gap:6px;padding:7px 12px 3px;font-size:11px;font-weight:600;display:flex}.search-section-count[data-v-fc2ebf13]{text-align:center;min-width:14px;color:var(--text-meta);background:var(--bg-hover);border-radius:var(--radius-xs);padding:0 4px;font-size:10px;line-height:14px}.search-section-note[data-v-fc2ebf13]{color:var(--text-meta);margin-left:auto;font-size:10px;font-weight:400}.content-results[data-v-fc2ebf13]{margin-top:6px;padding-bottom:6px}.content-results>.search-section-head[data-v-fc2ebf13],.content-results-status[data-v-fc2ebf13]{border-top:1px solid var(--border-color)}.content-results-status[data-v-fc2ebf13]{color:var(--text-meta);align-items:center;gap:6px;padding:8px 12px;font-size:12px;display:flex}.content-search-spin[data-v-fc2ebf13]{border:1.5px solid var(--color-primary);border-top-color:#0000;border-radius:50%;flex-shrink:0;width:11px;height:11px;animation:.8s linear infinite spin-fc2ebf13}.content-hit-file[data-v-fc2ebf13]{cursor:pointer;height:24px;color:var(--text-primary);transition:background var(--transition-fast);align-items:center;gap:5px;padding:0 8px 0 12px;display:flex}.content-hit-file[data-v-fc2ebf13]:hover,.content-hit-line[data-v-fc2ebf13]:hover{background:var(--bg-hover)}.content-hit-name[data-v-fc2ebf13]{font-size:var(--font-size-mid);white-space:nowrap}.content-hit-dir[data-v-fc2ebf13]{min-width:0;color:var(--text-meta);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:11px;overflow:hidden}.content-hit-total[data-v-fc2ebf13]{text-align:center;min-width:16px;color:var(--text-meta);background:var(--bg-hover);border-radius:var(--radius-xs);flex-shrink:0;font-size:10px;line-height:14px}.content-hit-line[data-v-fc2ebf13]{cursor:pointer;align-items:baseline;gap:6px;padding:1px 10px 1px 24px;display:flex}.content-hit-ln[data-v-fc2ebf13]{text-align:right;width:30px;color:var(--text-meta);flex-shrink:0;font-family:JetBrains Mono,Consolas,monospace;font-size:10.5px}.content-hit-text[data-v-fc2ebf13]{min-width:0;color:var(--text-secondary);white-space:pre;text-overflow:ellipsis;flex:1;font-family:JetBrains Mono,Consolas,monospace;font-size:11px;overflow:hidden}.content-hit-mark[data-v-fc2ebf13]{color:var(--color-warning-light);border-radius:var(--radius-xs);background:#f59e0b26;padding:0 1px}.sidebar-tree[data-v-fc2ebf13]{flex:1;padding:4px 0;overflow:hidden auto}.tree-node[data-v-fc2ebf13]{cursor:pointer;border-radius:var(--radius-base);-webkit-user-select:none;user-select:none;height:24px;color:var(--text-primary);font-size:var(--font-size-mid);transition:background var(--transition-fast);white-space:nowrap;align-items:center;gap:4px;padding-right:8px;display:flex;overflow:hidden}.tree-node[data-v-fc2ebf13]:hover{background:var(--bg-hover)}.tree-node--active[data-v-fc2ebf13]{background:var(--tint-primary-12);color:var(--color-primary)}.tree-node--selected[data-v-fc2ebf13]{outline-offset:-1px;background:#63b3ed26;outline:1px solid #63b3ed59}.tree-arrow[data-v-fc2ebf13]{color:var(--text-meta);transition:transform var(--transition-fast);flex-shrink:0;align-items:center;width:12px;display:flex}.tree-arrow.expanded[data-v-fc2ebf13]{transform:rotate(90deg)}.tree-arrow-spacer[data-v-fc2ebf13]{flex-shrink:0;width:12px}.tree-icon[data-v-fc2ebf13]{font-size:var(--font-size-base);flex-shrink:0;align-items:center;line-height:1;display:flex}.tree-icon.mit-icon[data-v-fc2ebf13]{fill:currentColor;vertical-align:middle;width:14px;height:14px;display:inline-block}.tree-icon--dir[data-v-fc2ebf13]{color:#e8b84b}.tree-name[data-v-fc2ebf13]{text-overflow:ellipsis;min-width:0;font-size:var(--font-size-mid);flex:1;overflow:hidden}.tree-loading[data-v-fc2ebf13]{border:1.5px solid var(--color-primary);border-top-color:#0000;border-radius:50%;flex-shrink:0;width:10px;height:10px;animation:.8s linear infinite spin-fc2ebf13;display:inline-block}.tree-empty[data-v-fc2ebf13]{font-size:var(--font-size-sm);color:var(--text-meta);text-align:center;padding:24px 12px}.sidebar-loading[data-v-fc2ebf13]{flex:1;justify-content:center;align-items:center;display:flex}.spin-icon[data-v-fc2ebf13]{border:2px solid var(--color-primary);border-top-color:#0000;border-radius:50%;width:20px;height:20px;animation:.8s linear infinite spin-fc2ebf13;display:inline-block}@keyframes spin-fc2ebf13{to{transform:rotate(360deg)}}.editor-resizer[data-v-fc2ebf13]{cursor:col-resize;width:6px;transition:background var(--transition-fast);z-index:2;background:0 0;flex-shrink:0;position:relative}.editor-resizer[data-v-fc2ebf13]:after{content:"";background:var(--color-gray-300);border-radius:var(--radius-xs);width:2px;height:32px;transition:background var(--transition-fast), height var(--transition-fast);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.editor-resizer[data-v-fc2ebf13]:hover{background:var(--tint-primary-06)}.editor-resizer[data-v-fc2ebf13]:hover:after{background:var(--color-primary);height:48px;box-shadow:0 0 8px #3b82f666}.editor-main[data-v-fc2ebf13]{flex-direction:column;flex:1;display:flex;overflow:hidden}.editor-tabs[data-v-fc2ebf13]{background:var(--bg-panel);scrollbar-width:none;flex-shrink:0;display:flex;overflow:auto hidden}.editor-tabs[data-v-fc2ebf13]::-webkit-scrollbar{display:none}.editor-tab[data-v-fc2ebf13]{cursor:pointer;height:34px;font-size:var(--font-size-mid);color:var(--text-secondary);transition:background var(--transition-fast), color var(--transition-fast);-webkit-user-select:none;user-select:none;flex-shrink:0;align-items:center;gap:6px;min-width:80px;max-width:200px;padding:0 12px;display:flex}.editor-tab[data-v-fc2ebf13]:hover{background:var(--bg-hover);color:var(--text-primary)}.editor-tab.active[data-v-fc2ebf13]{background:var(--bg-container);color:var(--text-primary);border-bottom:2px solid var(--color-primary)}.tab-name[data-v-fc2ebf13]{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.tab-dirty-dot[data-v-fc2ebf13]{background:var(--color-warning);border-radius:50%;flex-shrink:0;width:6px;height:6px}.tab-close[data-v-fc2ebf13]{cursor:pointer;color:var(--text-meta);border-radius:var(--radius-base);opacity:0;transition:opacity var(--transition-fast), background var(--transition-fast);background:0 0;border:none;flex-shrink:0;align-items:center;padding:2px;display:flex}.editor-tab:hover .tab-close[data-v-fc2ebf13],.editor-tab.active .tab-close[data-v-fc2ebf13]{opacity:1}.tab-close[data-v-fc2ebf13]:hover{background:var(--bg-hover);color:var(--color-danger-dark)}.editor-empty[data-v-fc2ebf13]{flex:1}.monaco-container[data-v-fc2ebf13]{flex:1;min-width:0;overflow:hidden}.monaco-container.hidden[data-v-fc2ebf13]{display:none}.image-tab-placeholder[data-v-fc2ebf13]{justify-content:center;align-items:center;gap:var(--spacing-sm);color:var(--text-secondary);background:var(--bg-container);text-align:center;padding:var(--spacing-lg);flex-direction:column;flex:1;display:flex}.image-tab-placeholder-title[data-v-fc2ebf13]{font-size:var(--font-size-md);font-weight:var(--font-weight-medium);color:var(--text-primary);word-break:break-all;margin:0}.image-tab-placeholder-hint[data-v-fc2ebf13]{font-size:var(--font-size-sm);color:var(--text-meta);margin:0}.editor-body[data-v-fc2ebf13]{flex:1;min-height:0;display:flex;position:relative;overflow:hidden}.editor-body.is-agent-fullscreen .preview-resizer[data-v-fc2ebf13]{display:none}.preview-resizer[data-v-fc2ebf13]{cursor:col-resize;z-index:2;background:0 0;flex-shrink:0;width:7px;position:relative}.preview-resizer[data-v-fc2ebf13]:after{content:"";background:var(--border-color);width:1px;transition:background var(--transition-fast), width var(--transition-fast);position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%)}.preview-resizer:hover[data-v-fc2ebf13]{background:var(--tint-primary-06)}.preview-resizer:hover[data-v-fc2ebf13]:after{background:var(--color-primary);width:2px}.preview-panel[data-v-fc2ebf13]{background:var(--bg-panel);flex-direction:column;flex:1 1 0;min-width:200px;display:flex;overflow:hidden}.preview-header[data-v-fc2ebf13]{background:var(--bg-panel);flex-shrink:0;align-items:center;gap:6px;height:34px;padding:0 10px;display:flex}.preview-title[data-v-fc2ebf13]{font-size:var(--font-size-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary);-webkit-user-select:none;user-select:none;font-weight:700}.preview-ext-badge[data-v-fc2ebf13]{font-size:var(--font-size-xs);border-radius:var(--radius-base);background:var(--tint-primary-16);color:var(--color-primary);letter-spacing:.04em;padding:1px 5px;font-weight:600}.preview-header-spacer[data-v-fc2ebf13]{flex:1}.preview-close-btn[data-v-fc2ebf13]{cursor:pointer;color:var(--text-meta);border-radius:var(--radius-base);transition:color var(--transition-fast), background var(--transition-fast);background:0 0;border:none;align-items:center;padding:3px;display:flex}.preview-close-btn[data-v-fc2ebf13]:hover{color:var(--color-danger-dark);background:var(--bg-hover)}.preview-body[data-v-fc2ebf13]{flex-direction:column;flex:1;display:flex;overflow:hidden}.preview-copybar[data-v-fc2ebf13]{border-bottom:1px solid var(--border-color);background:var(--bg-panel);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:6px;padding:6px 10px;display:flex}.preview-copy-btn[data-v-fc2ebf13]{border:1px solid var(--border-color);border-radius:var(--radius-base);background:var(--bg-panel);color:var(--text-secondary);font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;transition:background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);align-items:center;gap:5px;padding:3px 10px;font-weight:600;display:inline-flex}.preview-copy-btn[data-v-fc2ebf13]:hover:not(:disabled){background:var(--bg-hover);color:var(--text-primary)}.preview-copy-btn[data-v-fc2ebf13]:disabled{opacity:.6;cursor:default}.preview-copy-btn.done[data-v-fc2ebf13]{border-color:var(--color-primary);color:var(--color-primary);background:var(--tint-primary-12)}.preview-copy-btn--primary[data-v-fc2ebf13]{background:var(--color-primary);color:#fff;border-color:#0000}.preview-copy-btn--primary[data-v-fc2ebf13]:hover:not(:disabled){background:var(--color-primary-dark,var(--color-primary));color:#fff}.preview-copy-btn--primary.done[data-v-fc2ebf13]{background:var(--color-primary);color:#fff;border-color:#0000}.preview-copy-btn-icon[data-v-fc2ebf13]{opacity:.75;font-family:monospace;font-size:11px}.preview-copy-embed[data-v-fc2ebf13]{color:var(--text-meta);font-size:var(--font-size-xs);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:5px;margin-left:auto;display:inline-flex}.preview-copy-embed input[data-v-fc2ebf13]{accent-color:var(--color-primary);margin:0}.preview-iframe[data-v-fc2ebf13]{background:0 0;border:none;flex:1;width:100%;height:100%}.preview-markdown[data-v-fc2ebf13]{flex:1;width:100%;height:100%;overflow:auto}.preview-mindmap[data-v-fc2ebf13]{background:var(--bg-container,#fff);flex-direction:column;flex:1;width:100%;height:100%;display:flex;overflow:hidden}.mindmap-toggle-btn.disabled[data-v-fc2ebf13]{opacity:.45;cursor:not-allowed}.mindmap-toggle-btn.active[data-v-fc2ebf13]{color:#fff;background:linear-gradient(#6366f1 0%,#4f46e5 100%);border-color:#4f46e5}.preview-image-wrap[data-v-fc2ebf13]{background:var(--bg-container);flex:1;justify-content:center;align-items:center;padding:16px;display:flex;overflow:auto}.preview-image-wrap img[data-v-fc2ebf13]{object-fit:contain;border-radius:var(--radius-base);max-width:100%;max-height:100%;box-shadow:0 2px 12px #0003}.editor-tabs-spacer[data-v-fc2ebf13]{flex:1}.preview-toggle-btn[data-v-fc2ebf13]{cursor:pointer;height:34px;color:var(--text-secondary);font-size:var(--font-size-sm);white-space:nowrap;transition:background var(--transition-fast), color var(--transition-fast);background:0 0;border:none;flex-shrink:0;align-items:center;gap:5px;padding:0 10px;display:flex}.preview-toggle-btn[data-v-fc2ebf13]:hover{background:var(--bg-hover);color:var(--text-primary)}.preview-toggle-btn.active[data-v-fc2ebf13]{color:var(--color-primary);background:var(--tint-primary-08)}.sidebar-actions[data-v-fc2ebf13]{align-items:center;gap:2px;display:flex}.tree-inline-input-row[data-v-fc2ebf13]{cursor:default;background:var(--bg-hover)}.tree-inline-input[data-v-fc2ebf13]{min-width:0;height:20px;font-size:var(--font-size-mid);background:var(--bg-container);border:1px solid var(--color-primary);border-radius:var(--radius-base);color:var(--text-primary);outline:none;flex:1;padding:0 5px;font-family:inherit}.ctx-menu[data-v-fc2ebf13]{z-index:var(--z-menu-float);background:var(--bg-container);border:1px solid var(--border-color);border-radius:var(--radius-md);-webkit-user-select:none;user-select:none;min-width:160px;padding:4px;position:fixed;box-shadow:0 8px 24px #00000059}.ctx-menu-icon[data-v-fc2ebf13]{flex-shrink:0;width:13px;height:13px}.ctx-menu-item[data-v-fc2ebf13]{border-radius:var(--radius-base);cursor:pointer;width:100%;font-size:var(--font-size-mid);color:var(--text-primary);text-align:left;transition:background var(--transition-fast);background:0 0;border:none;align-items:center;gap:8px;padding:6px 10px;display:flex}.ctx-menu-item[data-v-fc2ebf13]:hover{background:var(--bg-hover)}.ctx-menu-item--danger[data-v-fc2ebf13]{color:var(--color-danger-dark)}.ctx-menu-item--danger[data-v-fc2ebf13]:hover{background:#ef44441a}.ctx-menu-sep[data-v-fc2ebf13]{background:var(--border-color);height:1px;margin:4px 2px}
|